#176277 - SchmendrickSchmuck - Sat Jun 11, 2011 11:49 pm
I've been having some trouble trying to load a texture (pcx file) from fat.
Loading an included file is easy enough:
However, loading from fat doesn't give the expected results:
Apparently, the 'foo_pcx' in this case doesn't yield the same result in the second as in the first. Was I wrong in assuming they would? How should I load the pcx file from fat in order to use the loadPCX function as I would in the first example?
Thanks
_________________
http://DSLiero.DennisvanZwieten.com - Liero for NDS!
Loading an included file is easy enough:
Code: |
#include "foo_pcx.h" sImage image; loadPCX(foo_pcx, &image); |
However, loading from fat doesn't give the expected results:
Code: |
fp = fopen("fat:/foo.pcx", "rb"); fseek(fp, 0, SEEK_END); long len = ftell(fp); fseek(fp, 0, SEEK_SET); char* foo_pcx = (char *)malloc(len); fread(foo_pcx, len, 1, fp); fclose(fp); sImage image; loadPCX(foo_pcx, &image); |
Apparently, the 'foo_pcx' in this case doesn't yield the same result in the second as in the first. Was I wrong in assuming they would? How should I load the pcx file from fat in order to use the loadPCX function as I would in the first example?
Thanks
_________________
http://DSLiero.DennisvanZwieten.com - Liero for NDS!