summaryrefslogtreecommitdiffstats
path: root/src/fakerw/fake.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-04-26 20:16:31 +0200
committeraap <aap@papnet.eu>2020-04-26 20:16:31 +0200
commit41586c7cda403291be80f414082d16b5333933a5 (patch)
tree4832dde8a039ec2e831f0cb044ad4ae6c06ad16d /src/fakerw/fake.cpp
parentRemove struct workaround in CControllerConfigManager (diff)
downloadre3-41586c7cda403291be80f414082d16b5333933a5.tar
re3-41586c7cda403291be80f414082d16b5333933a5.tar.gz
re3-41586c7cda403291be80f414082d16b5333933a5.tar.bz2
re3-41586c7cda403291be80f414082d16b5333933a5.tar.lz
re3-41586c7cda403291be80f414082d16b5333933a5.tar.xz
re3-41586c7cda403291be80f414082d16b5333933a5.tar.zst
re3-41586c7cda403291be80f414082d16b5333933a5.zip
Diffstat (limited to 'src/fakerw/fake.cpp')
-rw-r--r--src/fakerw/fake.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp
index 3d4ddf5d..26b5ae3d 100644
--- a/src/fakerw/fake.cpp
+++ b/src/fakerw/fake.cpp
@@ -290,9 +290,29 @@ RwTextureAddressMode RwTextureGetAddressingV(const RwTexture *texture);
// TODO
void _rwD3D8TexDictionaryEnableRasterFormatConversion(bool enable) { }
+static rw::Raster*
+ConvertTexRaster(rw::Raster *ras)
+{
+ using namespace rw;
+ Image *img = ras->toImage();
+ ras->destroy();
+ img->unindex();
+ ras = Raster::createFromImage(img);
+ img->destroy();
+ return ras;
+}
+
// hack for reading native textures
RwBool rwNativeTextureHackRead(RwStream *stream, RwTexture **tex, RwInt32 size)
- { *tex = Texture::streamReadNative(stream); return *tex != nil; }
+{
+ *tex = Texture::streamReadNative(stream);
+#ifdef RW_GL3
+ if(strcmp((*tex)->name, "copnu") == 0)
+ tex = tex;
+ (*tex)->raster = ConvertTexRaster((*tex)->raster);
+#endif
+ return *tex != nil;
+}