mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-04 13:47:04 -04:00
Fixed the update-libraries script (thanks to Anderson Souza) and added a basic Linux daemon for the server
This commit is contained in:
parent
bb904c4698
commit
5444c9aea6
19 changed files with 260 additions and 84 deletions
|
@ -60,7 +60,7 @@ int main(int argc, char *argv[]){
|
|||
struct MD5Context md5c;
|
||||
unsigned char digest[16];
|
||||
uint8_t * IFFData;
|
||||
IFFFile * IFFFileInfo;
|
||||
IFFFile IFFFileInfo;
|
||||
IFFChunk * ChunkData;
|
||||
|
||||
if(argc == 1 || !strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")){
|
||||
|
@ -139,12 +139,11 @@ int main(int argc, char *argv[]){
|
|||
** Load header information
|
||||
*/
|
||||
|
||||
IFFFileInfo = iff_create();
|
||||
if(IFFFileInfo == NULL){
|
||||
if(!iff_create(&IFFFileInfo)){
|
||||
printf("%sMemory for this file could not be allocated.", "iff2html: error: ");
|
||||
return -1;
|
||||
}
|
||||
if(!iff_read_header(IFFFileInfo, IFFData, FileSize)){
|
||||
if(!iff_read_header(&IFFFileInfo, IFFData, FileSize)){
|
||||
printf("%sNot a valid IFF file.", "iff2html: error: ");
|
||||
return -1;
|
||||
}
|
||||
|
@ -153,7 +152,7 @@ int main(int argc, char *argv[]){
|
|||
** Load entry information
|
||||
*/
|
||||
|
||||
if(!iff_enumerate_chunks(IFFFileInfo, IFFData+64, FileSize-64)){
|
||||
if(!iff_enumerate_chunks(&IFFFileInfo, IFFData+64, FileSize-64)){
|
||||
printf("%sChunk data is corrupt.", "iff2html: error: ");
|
||||
return -1;
|
||||
}
|
||||
|
@ -164,7 +163,7 @@ int main(int argc, char *argv[]){
|
|||
MD5Final(digest, &md5c);
|
||||
free(IFFData);
|
||||
|
||||
for(c = 0, ChunkData = IFFFileInfo->Chunks; c < IFFFileInfo->ChunkCount; c++, ChunkData++)
|
||||
for(c = 0, ChunkData = IFFFileInfo.Chunks; c < IFFFileInfo.ChunkCount; c++, ChunkData++)
|
||||
iff_parse_chunk(ChunkData, ChunkData->Data);
|
||||
|
||||
/****
|
||||
|
@ -292,9 +291,9 @@ int main(int argc, char *argv[]){
|
|||
fprintf(hFile, "</div>\n");
|
||||
fprintf(hFile, "<div>Dumped by iff2html.</div></div>\n");
|
||||
fprintf(hFile, "\n");
|
||||
fprintf(hFile, "<div id=\"toc\"><div><b>Contents</b> – %u chunks</div>\n", IFFFileInfo->ChunkCount);
|
||||
fprintf(hFile, "<div id=\"toc\"><div><b>Contents</b> – %u chunks</div>\n", IFFFileInfo.ChunkCount);
|
||||
fprintf(hFile, "<ul>\n");
|
||||
for(c=1, ChunkData = IFFFileInfo->Chunks; c <= IFFFileInfo->ChunkCount; c++, ChunkData++)
|
||||
for(c=1, ChunkData = IFFFileInfo.Chunks; c <= IFFFileInfo.ChunkCount; c++, ChunkData++)
|
||||
fprintf(hFile, "<li><a href=\"#chunk%u_%.4x\">%u [%s] (%.4X)%s%s</a></li>\n",
|
||||
c, ChunkData->ChunkID, c, ChunkData->Type, ChunkData->ChunkID,
|
||||
(ChunkData->Label[0] != 0x00) ? " – " : "", ChunkData->Label);
|
||||
|
@ -302,7 +301,7 @@ int main(int argc, char *argv[]){
|
|||
fprintf(hFile, "</div>\n");
|
||||
fprintf(hFile, "\n");
|
||||
|
||||
for(c=0, ChunkData = IFFFileInfo->Chunks; c < IFFFileInfo->ChunkCount; c++, ChunkData++){
|
||||
for(c=0, ChunkData = IFFFileInfo.Chunks; c < IFFFileInfo.ChunkCount; c++, ChunkData++){
|
||||
fprintf(hFile, "<h2 id=\"chunk%u_%.4x\">%u [%s] (%.4X)%s%s <a href=\"#chunk%u_%.4x\">(Jump)</a></h2>\n",
|
||||
c+1, ChunkData->ChunkID, c+1, ChunkData->Type, ChunkData->ChunkID,
|
||||
(ChunkData->Label[0] != 0x00) ? " – " : "", ChunkData->Label,
|
||||
|
@ -555,9 +554,9 @@ int main(int argc, char *argv[]){
|
|||
fprintf(hFile, "</table>\n");
|
||||
|
||||
if(SpriteList->PaletteID < 0xFFFF){
|
||||
Palette = iff_find_chunk(IFFFileInfo, "PALT", SpriteList->PaletteID);
|
||||
if(!Palette || !Palette->FormattedData) Palette = iff_find_chunk(IFFFileInfo, "PALT", ChunkData->ChunkID);
|
||||
if(!Palette || !Palette->FormattedData) Palette = iff_find_chunk(IFFFileInfo, "PALT", -1);
|
||||
Palette = iff_find_chunk(&IFFFileInfo, "PALT", SpriteList->PaletteID);
|
||||
if(!Palette || !Palette->FormattedData) Palette = iff_find_chunk(&IFFFileInfo, "PALT", ChunkData->ChunkID);
|
||||
if(!Palette || !Palette->FormattedData) Palette = iff_find_chunk(&IFFFileInfo, "PALT", -1);
|
||||
}
|
||||
if(!Palette || !Palette->FormattedData){
|
||||
memset(&BlankPalette, 0, sizeof(IFFPalette));
|
||||
|
@ -697,7 +696,7 @@ int main(int argc, char *argv[]){
|
|||
|
||||
fprintf(hFile, "</div>\n\n");
|
||||
}
|
||||
iff_delete(IFFFileInfo);
|
||||
iff_delete(&IFFFileInfo);
|
||||
|
||||
fprintf(hFile,
|
||||
"<div id=\"footer\">This page was generated by the use of <a href=\"http://www.niotso.org/\">iff2html</a>.\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue