summaryrefslogtreecommitdiff
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
parenta6b56e6b7a11aae060229b9066f733ff9e93e3d2 (diff)
imrove readme; enable screenshots with F12
Diffstat (limited to 'src/fakerw')
-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);