summaryrefslogtreecommitdiffstats
path: root/src/fakerw
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-02-12 00:29:09 +0100
committeraap <aap@papnet.eu>2021-02-12 00:29:09 +0100
commit879838c9f20d9f166353d4dd5ea486dda6f91921 (patch)
tree27705a876633ea97e95f3ecbbbf666867f653d5e /src/fakerw
parentbetter controller menu txds (diff)
downloadre3-879838c9f20d9f166353d4dd5ea486dda6f91921.tar
re3-879838c9f20d9f166353d4dd5ea486dda6f91921.tar.gz
re3-879838c9f20d9f166353d4dd5ea486dda6f91921.tar.bz2
re3-879838c9f20d9f166353d4dd5ea486dda6f91921.tar.lz
re3-879838c9f20d9f166353d4dd5ea486dda6f91921.tar.xz
re3-879838c9f20d9f166353d4dd5ea486dda6f91921.tar.zst
re3-879838c9f20d9f166353d4dd5ea486dda6f91921.zip
Diffstat (limited to 'src/fakerw')
-rw-r--r--src/fakerw/fake.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp
index 18a27ec1..1faf6ee6 100644
--- a/src/fakerw/fake.cpp
+++ b/src/fakerw/fake.cpp
@@ -947,6 +947,43 @@ RtBMPImageRead(const RwChar *imageName)
#endif
}
+
+RwImage *
+RtPNGImageWrite(RwImage *image, const RwChar *imageName)
+{
+#ifndef _WIN32
+ char *r = casepath(imageName);
+ if (r) {
+ rw::writePNG(image, r);
+ free(r);
+ } else {
+ rw::writePNG(image, imageName);
+ }
+
+#else
+ rw::writePNG(image, imageName);
+#endif
+ return image;
+}
+RwImage *
+RtPNGImageRead(const RwChar *imageName)
+{
+#ifndef _WIN32
+ RwImage *image;
+ char *r = casepath(imageName);
+ if (r) {
+ image = rw::readPNG(r);
+ free(r);
+ } else {
+ image = rw::readPNG(imageName);
+ }
+ return image;
+
+#else
+ return rw::readPNG(imageName);
+#endif
+}
+
#include "rtquat.h"
RtQuat *RtQuatRotate(RtQuat * quat, const RwV3d * axis, RwReal angle, RwOpCombineType combineOp) { return (RtQuat*)((rw::Quat*)quat)->rotate(axis, angle/180.0f*3.14159f, (CombineOp)combineOp); }