diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2020-04-18 12:08:38 +0200 |
---|---|---|
committer | Filip Gawin <filip.gawin@zoho.com> | 2020-04-18 12:08:38 +0200 |
commit | 2b1570de703c32ab43c979c286413a3a1c5e3dc0 (patch) | |
tree | ff5510329a08fd5b3dca88de1c9fc5e36abef1b9 /src/fakerw | |
parent | Part one (diff) | |
parent | Zones save/load (diff) | |
download | re3-2b1570de703c32ab43c979c286413a3a1c5e3dc0.tar re3-2b1570de703c32ab43c979c286413a3a1c5e3dc0.tar.gz re3-2b1570de703c32ab43c979c286413a3a1c5e3dc0.tar.bz2 re3-2b1570de703c32ab43c979c286413a3a1c5e3dc0.tar.lz re3-2b1570de703c32ab43c979c286413a3a1c5e3dc0.tar.xz re3-2b1570de703c32ab43c979c286413a3a1c5e3dc0.tar.zst re3-2b1570de703c32ab43c979c286413a3a1c5e3dc0.zip |
Diffstat (limited to 'src/fakerw')
-rw-r--r-- | src/fakerw/fake.cpp | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp index 557318be..03df55e2 100644 --- a/src/fakerw/fake.cpp +++ b/src/fakerw/fake.cpp @@ -201,40 +201,9 @@ RwInt32 RwImageStreamGetSize(const RwImage * image); RwImage *RwImageStreamRead(RwStream * stream); const RwImage *RwImageStreamWrite(const RwImage * image, RwStream * stream); -// TODO: this is kind hard... RwImage *RwImageFindRasterFormat(RwImage *ipImage,RwInt32 nRasterType, RwInt32 *npWidth,RwInt32 *npHeight, RwInt32 *npDepth,RwInt32 *npFormat) { - // very dumb implementation for now - // this is also platform specific - if((nRasterType&rwRASTERTYPEMASK) != rwRASTERTYPETEXTURE){ - *npFormat = 0; - return nil; - } - *npWidth = ipImage->width; - *npHeight = ipImage->height; - switch(ipImage->depth){ - case 4: - case 8: - *npDepth = 8; - *npFormat = Raster::C8888 | Raster::PAL8; - break; - case 16: - *npDepth = 16; - *npFormat = Raster::C1555; - break; - case 24: - *npDepth = 32; - *npFormat = Raster::C888; - break; - case 32: - *npDepth = 32; - *npFormat = Raster::C8888; - break; - default: - assert(0 && "invalid depth"); - return nil; - } - return ipImage; + return Raster::imageFindRasterFormat(ipImage, nRasterType, npWidth, npHeight, npDepth, npFormat) ? ipImage : nil; } @@ -269,11 +238,7 @@ RwInt32 RwRasterRegisterPlugin(RwInt32 size, RwUInt32 pluginID, RwPluginObj RwInt32 RwRasterGetPluginOffset(RwUInt32 pluginID); RwBool RwRasterValidatePlugins(const RwRaster * raster); -// TODO: let's hope this works -RwRaster *RwRasterSetFromImage(RwRaster *raster, RwImage *image) { - engine->driver[raster->platform]->rasterFromImage(raster, image); - return raster; -} +RwRaster *RwRasterSetFromImage(RwRaster *raster, RwImage *image) { return raster->setFromImage(image); } |