diff --git a/Libraries/CMakeLists.txt b/Libraries/CMakeLists.txt index 30bdcc5..4979e0a 100644 --- a/Libraries/CMakeLists.txt +++ b/Libraries/CMakeLists.txt @@ -1,3 +1,4 @@ add_subdirectory(FileHandler) add_subdirectory(freetype) +add_subdirectory(libpq) add_subdirectory(libvitaboy) \ No newline at end of file diff --git a/Libraries/FileHandler/iff/spr.c b/Libraries/FileHandler/iff/spr.c index 0fbe940..b39bf80 100644 --- a/Libraries/FileHandler/iff/spr.c +++ b/Libraries/FileHandler/iff/spr.c @@ -146,8 +146,8 @@ int iff_parse_spr(IFFChunk * ChunkInfo, const uint8_t * Buffer){ Count = *(b.Buffer++); SpriteSize -= 2; - if(Command == 0){ - /* Do nothing */ + if(Command == 0 || Command == 16){ + /* Start marker */ }else if(Command == 4){ /* Pixel command: valid commands are 1, 2, and 3 */ unsigned pixel = 0; @@ -208,8 +208,6 @@ int iff_parse_spr(IFFChunk * ChunkInfo, const uint8_t * Buffer){ if(Count > Sprite->Height - row) {printf("Error %u\n", 9);return 0;} row += Count; - }else if(Command == 16){ - /* Do nothing */ }else {printf("Error %u\n", 10);return 0;} } } diff --git a/Libraries/FileHandler/iff/spr2.c b/Libraries/FileHandler/iff/spr2.c new file mode 100644 index 0000000..e69de29 diff --git a/Tools/iff2html/iff2html.c b/Tools/iff2html/iff2html.c index 421a05f..a9f2eef 100644 --- a/Tools/iff2html/iff2html.c +++ b/Tools/iff2html/iff2html.c @@ -50,10 +50,11 @@ static void printsize(FILE * hFile, size_t FileSize){ } int main(int argc, char *argv[]){ - unsigned c, slash; + unsigned c; + int slash; FILE * hFile; int overwrite = 0; - char *InFile, *OutFile = NULL, *OutDir = NULL; + char *InFile, *OutFile = NULL, *FileName, *OutDir = NULL; size_t FileSize; struct MD5Context md5c; unsigned char digest[16]; @@ -93,14 +94,18 @@ int main(int argc, char *argv[]){ strcpy(max(OutFile+length-4, OutFile), ".html"); } - for(c=0, slash=0; OutFile[c]; c++) + for(c=0, slash=-1; OutFile[c]; c++) if(OutFile[c] == '/' || OutFile[c] == '\\') slash = c; - if(slash != 0){ + if(slash >= 0){ OutDir = malloc(slash+2); memcpy(OutDir, OutFile, slash+1); OutDir[slash+1] = 0x00; }else OutDir = ""; + for(c=0, slash=-1; InFile[c]; c++) + if(InFile[c] == '/' || InFile[c] == '\\') slash = c; + FileName = InFile + slash + 1; + /**** ** Open the file and read in entire contents to memory */ @@ -195,9 +200,9 @@ int main(int argc, char *argv[]){ fprintf(hFile, "\n"); fprintf(hFile, "\n"); fprintf(hFile, "\n"); - fprintf(hFile, "\n", InFile); + fprintf(hFile, "\n", FileName); fprintf(hFile, "\n"); - fprintf(hFile, "%s (iff2html)\n", InFile); + fprintf(hFile, "%s (iff2html)\n", FileName); fprintf(hFile, "\n"); fprintf(hFile, "\n"); fprintf(hFile, "\n"); - fprintf(hFile, "

%s

\n", InFile); + fprintf(hFile, "

%s

\n", FileName); fprintf(hFile, "
\n"); fprintf(hFile, "
"); for(c=0; c<16; c++)