I checked my image with
Code: Select all
od -tx1 client\data\ui\background2.png
Code: Select all
0000000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52
0000020 00 00 00 40 00 00 00 40 08 02 00 00 00 25 0b e6
0000040 89 00 00 00 09 70 48 59 73 00 00 0b 13 00 00 0b
0000060 13 01 00 9a 9c 18 00 00 00 07 74 49 4d 45 07 e2
0000100 08 04 10 21 1a 45 91 83 56 00 00 00 1d 69 54 58
0000120 74 43 6f 6d 6d 65 6e 74 00 00 00 00 00 43 72 65
0000140 61 74 65 64 20 77 69 74 68 20 47 49 4d 50 64 2e
0000160 65 07 00 00 00 5c 49 44 41 54 68 de ed d9 b1 0d
0000200 00 30 08 03 41 93 41 19 8e 49 33 43 0a 8a 48 f7
0000220 0b a0 2b 5c 51 dd 9d b5 66 26 c9 ea 89 93 cf 03
0000240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000260 00 00 00 00 90 9e 2b 0f 0e 23 06 00 00 00 00 00
0000300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 78
0000320 ed 02 4f 26 08 af 93 c6 1a 72 00 00 00 00 49 45
0000340 4e 44 ae 42 60 82
0000346
My code to load the file looks like this:
Code: Select all
int newiimagefromfile(...){
printf("Creating new iimage from file");
const char* strpath = ...;
int numloaders = driver->getImageLoaderCount();
bool hasloaded = false;
IImage* img = NULL;
printf("About to create and open file\n");
io::IReadFile* f = device->getFileSystem()->createAndOpenFile(strpath);
if(!f){
...
}
printf("Opened file\n");
for(int j = 0; j < numloaders; j++){
IImageLoader* loader = driver->getImageLoader(j);
if(!loader->isALoadableFileExtension(strpath))
continue;
if(!loader->isALoadableFileFormat(f))
continue;
hasloaded = true;
printf("Found a loader, about to load\n");
img = loader->loadImage(f);
printf("Done loading\n");
f->drop();
}
if(!hasloaded){
...
}
if(!img){
...
}
...
return 1;
}
Code: Select all
Creating new iimage from fileAbout to create and open file
Opened file
Found a loader, about to load
LOAD PNG: not really a png
: c:/Users/Alex/Desktop/broken_texturemaker/client/data/ui/background2.png
Done loading