fix windows build, don't use crossplatform

This commit is contained in:
Filip Gawin 2020-07-25 22:38:42 +02:00
parent b0414c84b9
commit 40c09d28f7

View File

@ -858,19 +858,37 @@ RpHAnimHierarchy *RpSkinAtomicGetHAnimHierarchy( const RpAtomic *atomic ) { retu
RwImage * RwImage *
RtBMPImageWrite(RwImage *image, const RwChar *imageName) RtBMPImageWrite(RwImage *image, const RwChar *imageName)
{ {
#ifndef _WIN32
char *r = nil;
FILE *valid = fopen((char *)imageName, "r");
if(!valid) {
char *r = (char *)alloca(strlen((char *)imageName) + 2); char *r = (char *)alloca(strlen((char *)imageName) + 2);
// Use default path(and pass error handling to librw) if we can't find any match // Use default path(and pass error handling to librw) if we can't find any match
if(!casepath((char *)imageName, r)) r = (char *)imageName; if(!casepath((char *)imageName, r)) r = (char *)imageName;
} else
fclose(valid);
rw::writeBMP(image, r); rw::writeBMP(image, r);
#else
rw::writeBMP(image, imageName);
#endif
return image; return image;
} }
RwImage * RwImage *
RtBMPImageRead(const RwChar *imageName) RtBMPImageRead(const RwChar *imageName)
{ {
char *r = (char *)alloca(strlen((char *)imageName) + 2); #ifndef _WIN32
char *r = nil;
FILE *valid = fopen((char *)imageName, "r");
if(!valid) {
r = (char *)alloca(strlen((char *)imageName) + 2);
// Use default path(and pass error handling to librw) if we can't find any match // Use default path(and pass error handling to librw) if we can't find any match
if(!casepath((char *)imageName, r)) r = (char *)imageName; if(!casepath((char *)imageName, r)) r = (char *)imageName;
} else
fclose(valid);
return rw::readBMP(r); return rw::readBMP(r);
#else
return rw::readBMP(imageName);
#endif
} }
#include "rtquat.h" #include "rtquat.h"