summaryrefslogtreecommitdiffstats
path: root/src/fakerw
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-02-11 20:51:13 +0100
committeraap <aap@papnet.eu>2021-02-12 00:06:54 +0100
commitf3bfdd78571f9335f2274b047b127747457a8e79 (patch)
treef81772ce8d40f5956bb2677c1dd6e0826eb11e3f /src/fakerw
parentMerge remote-tracking branch 'origin/master' (diff)
downloadre3-f3bfdd78571f9335f2274b047b127747457a8e79.tar
re3-f3bfdd78571f9335f2274b047b127747457a8e79.tar.gz
re3-f3bfdd78571f9335f2274b047b127747457a8e79.tar.bz2
re3-f3bfdd78571f9335f2274b047b127747457a8e79.tar.lz
re3-f3bfdd78571f9335f2274b047b127747457a8e79.tar.xz
re3-f3bfdd78571f9335f2274b047b127747457a8e79.tar.zst
re3-f3bfdd78571f9335f2274b047b127747457a8e79.zip
Diffstat (limited to '')
-rw-r--r--src/fakerw/fake.cpp37
-rw-r--r--src/fakerw/rtpng.h4
2 files changed, 41 insertions, 0 deletions
diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp
index 366dcf3e..1d4c881f 100644
--- a/src/fakerw/fake.cpp
+++ b/src/fakerw/fake.cpp
@@ -945,6 +945,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); }
diff --git a/src/fakerw/rtpng.h b/src/fakerw/rtpng.h
new file mode 100644
index 00000000..80f29020
--- /dev/null
+++ b/src/fakerw/rtpng.h
@@ -0,0 +1,4 @@
+#pragma once
+
+RwImage *RtPNGImageWrite(RwImage * image, const RwChar * imageName);
+RwImage *RtPNGImageRead(const RwChar * imageName);