mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-04 13:47:04 -04:00
Linux x86-64 build of everything but the client, FARDive, and libpq. For libvitaboy Renderer, this is made possible with the new libgldemo.
This commit is contained in:
parent
9b5b1758c2
commit
90c703188b
23 changed files with 789 additions and 399 deletions
|
@ -12,9 +12,7 @@ if(WIN32)
|
|||
windows/Dialog/AddToArchive.cpp
|
||||
windows/Dialog/NewArchive.cpp
|
||||
)
|
||||
set(FARDIVE_LINK ole32 uxtheme)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/FileHandler/libpng)
|
||||
add_executable(FARDive WIN32 ${FARDIVE_SOURCES})
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/FileHandler/libpng)
|
||||
target_link_libraries(FARDive ${FARDIVE_LINK} FileHandler_shared)
|
||||
target_link_libraries(FARDive ole32 uxtheme FileHandler_shared)
|
||||
endif()
|
|
@ -12,4 +12,4 @@ set(IFF2HTML_SOURCES
|
|||
include_directories(${CMAKE_SOURCE_DIR}/Libraries/FileHandler)
|
||||
|
||||
add_executable(iff2html ${IFF2HTML_SOURCES})
|
||||
target_link_libraries(iff2html iff_static libpng_static zlib_static)
|
||||
target_link_libraries(iff2html iff_static libpng_static zlib_static m)
|
||||
|
|
|
@ -41,10 +41,10 @@ static void printsize(FILE * hFile, size_t FileSize){
|
|||
fprintf(hFile, "%.1f kB (", (float)FileSize/1024);
|
||||
while((temp/=1000) != 0)
|
||||
position *= 1000;
|
||||
fprintf(hFile, "%u", FileSize/position);
|
||||
fprintf(hFile, "%u", (unsigned) FileSize/position);
|
||||
FileSize -= (FileSize/position)*position;
|
||||
while((position/=1000) != 0){
|
||||
fprintf(hFile, ",%.3u", FileSize/position);
|
||||
fprintf(hFile, ",%.3u", (unsigned) FileSize/position);
|
||||
FileSize -= (FileSize/position)*position;
|
||||
}
|
||||
fprintf(hFile, " bytes)");
|
||||
|
@ -322,7 +322,7 @@ int main(int argc, char *argv[]){
|
|||
fprintf(hFile, "<table class=\"center centerall\">\n");
|
||||
fprintf(hFile, "<tr><th>Image</th></tr>\n");
|
||||
fprintf(hFile, "<tr><td><img src=\"%s_%u_%.4x.png\" width=\"%u\" height=\"%u\" alt=\"\" /></td></tr>\n",
|
||||
bmp ? "bmp" : "fbmp", c+1, ChunkData->ChunkID, Width, Height);
|
||||
bmp ? "bmp" : "fbmp", c+1, ChunkData->ChunkID, (unsigned) Width, (unsigned) Height);
|
||||
fprintf(hFile, "</table>\n");
|
||||
success++;
|
||||
}
|
||||
|
@ -708,4 +708,4 @@ int main(int argc, char *argv[]){
|
|||
|
||||
printf("Wrote contents to '%s'.\n", OutFile);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ void MD5Update(ctx, buf, len)
|
|||
/* Handle any leading odd-sized chunks */
|
||||
|
||||
if (t) {
|
||||
unsigned char *p = (unsigned char *) ctx->in + t;
|
||||
unsigned char *p = (unsigned char *) ctx->in.c + t;
|
||||
|
||||
t = 64 - t;
|
||||
if (len < t) {
|
||||
|
@ -86,24 +86,24 @@ void MD5Update(ctx, buf, len)
|
|||
return;
|
||||
}
|
||||
memcpy(p, buf, t);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
byteReverse(ctx->in.c, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in.c);
|
||||
buf += t;
|
||||
len -= t;
|
||||
}
|
||||
/* Process data in 64-byte chunks */
|
||||
|
||||
while (len >= 64) {
|
||||
memcpy(ctx->in, buf, 64);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
memcpy(ctx->in.c, buf, 64);
|
||||
byteReverse(ctx->in.c, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in.c);
|
||||
buf += 64;
|
||||
len -= 64;
|
||||
}
|
||||
|
||||
/* Handle any remaining bytes of data. */
|
||||
|
||||
memcpy(ctx->in, buf, len);
|
||||
memcpy(ctx->in.c, buf, len);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -121,7 +121,7 @@ void MD5Final(digest, ctx)
|
|||
|
||||
/* Set the first char of padding to 0x80. This is safe since there is
|
||||
always at least one byte free */
|
||||
p = ctx->in + count;
|
||||
p = ctx->in.c + count;
|
||||
*p++ = 0x80;
|
||||
|
||||
/* Bytes of padding needed to make 64 bytes */
|
||||
|
@ -131,22 +131,22 @@ void MD5Final(digest, ctx)
|
|||
if (count < 8) {
|
||||
/* Two lots of padding: Pad the first block to 64 bytes */
|
||||
memset(p, 0, count);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
byteReverse(ctx->in.c, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in.c);
|
||||
|
||||
/* Now fill the next block with 56 bytes */
|
||||
memset(ctx->in, 0, 56);
|
||||
memset(ctx->in.c, 0, 56);
|
||||
} else {
|
||||
/* Pad block to 56 bytes */
|
||||
memset(p, 0, count - 8);
|
||||
}
|
||||
byteReverse(ctx->in, 14);
|
||||
byteReverse(ctx->in.c, 14);
|
||||
|
||||
/* Append length in bits and transform */
|
||||
((uint32 *) ctx->in)[14] = ctx->bits[0];
|
||||
((uint32 *) ctx->in)[15] = ctx->bits[1];
|
||||
ctx->in.i[14] = ctx->bits[0];
|
||||
ctx->in.i[15] = ctx->bits[1];
|
||||
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in.c);
|
||||
byteReverse((unsigned char *) ctx->buf, 4);
|
||||
memcpy(digest, ctx->buf, 16);
|
||||
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
|
||||
|
|
|
@ -34,7 +34,10 @@ typedef unsigned long uint32;
|
|||
struct MD5Context {
|
||||
uint32 buf[4];
|
||||
uint32 bits[2];
|
||||
unsigned char in[64];
|
||||
union {
|
||||
unsigned char c[64];
|
||||
uint32 i[16];
|
||||
} in;
|
||||
};
|
||||
|
||||
extern void MD5Init();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue