# HG changeset patch # User zipi # Date 1359296150 0 # Node ID 2b90f29892aec4c26efb66889ed8108be585d0e6 # Parent 2b798f781d1daa7cf544ff8e61a64c7cb831af6a ESC menu fixed popups fixed diff -r 2b798f781d1d -r 2b90f29892ae GUIFont.cpp --- a/GUIFont.cpp Sun Jan 27 12:10:43 2013 +0000 +++ b/GUIFont.cpp Sun Jan 27 14:15:50 2013 +0000 @@ -108,8 +108,8 @@ unsigned int v15; // edx@9 unsigned __int16 v16; // cx@12 unsigned __int8 *v17; // eax@12 - char Dest; // [sp+Ch] [bp-1Ch]@16 - char v19; // [sp+11h] [bp-17h]@16 + char Dest[20]; // [sp+Ch] [bp-1Ch]@16 + //char v19; // [sp+11h] [bp-17h]@16 size_t v20; // [sp+20h] [bp-8h]@2 int v21; // [sp+24h] [bp-4h]@1 int uXa; // [sp+30h] [bp+8h]@9 @@ -160,9 +160,9 @@ } else { - strncpy(&Dest, &Str[v6 + 1], 5u); - v19 = 0; - v21 = atoi(&Dest); + strncpy(Dest, &Str[v6 + 1], 5u); + Dest[5] = 0; + v21 = atoi(Dest); ui_current_text_color = v21; v6 += 5; } diff -r 2b798f781d1d -r 2b90f29892ae Texture.cpp --- a/Texture.cpp Sun Jan 27 12:10:43 2013 +0000 +++ b/Texture.cpp Sun Jan 27 14:15:50 2013 +0000 @@ -1333,7 +1333,6 @@ { RGBTexture *v3; // esi@1 signed int result; // eax@2 - FILE *v5; // edi@3 char *v6; // eax@3 int v7; // edx@3 char v8; // cl@4 @@ -1353,18 +1352,9 @@ unsigned __int16 *v22; // edi@71 signed int v23; // eax@73 int v24; // eax@78 - char v25; // [sp+Ch] [bp-54h]@3 - char DstBuf; // [sp+3Ch] [bp-24h]@3 - char v27; // [sp+3Dh] [bp-23h]@3 - char v28; // [sp+3Eh] [bp-22h]@3 - char v29; // [sp+3Fh] [bp-21h]@3 - int v30; // [sp+40h] [bp-20h]@3 - int v31; // [sp+44h] [bp-1Ch]@3 - char v32; // [sp+48h] [bp-18h]@3 - char v33; // [sp+4Ah] [bp-16h]@3 - char v34; // [sp+4Ch] [bp-14h]@3 - char v35; // [sp+4Dh] [bp-13h]@3 - unsigned __int16 v36; // [sp+4Eh] [bp-12h]@3 + char v25[48]; // [sp+Ch] [bp-54h]@3 + PCXHeader1 pcx_header1; + PCXHeader2 pcx_header2; int v37; // [sp+54h] [bp-Ch]@3 int v38; // [sp+58h] [bp-8h]@57 FILE *File; // [sp+5Ch] [bp-4h]@1 @@ -1373,21 +1363,11 @@ File = fopen(Filename, "rb"); if ( !File ) return 1; - v5 = File; - fread(&DstBuf, 1u, 1u, File); - fread(&v27, 1u, 1u, v5); - fread(&v28, 1u, 1u, v5); - fread(&v29, 1u, 1u, v5); - fread(&v30, 2u, 1u, v5); - fread((char *)&v30 + 2, 2u, 1u, File); - fread(&v31, 2u, 1u, File); - fread((char *)&v31 + 2, 2u, 1u, File); - fread(&v32, 2u, 1u, File); - fread(&v33, 2u, 1u, File); - fread(&v25, 0x30u, 1u, File); - fread(&v34, 1u, 1u, File); - fread(&v35, 1u, 1u, File); - fread(&v36, 2u, 1u, File); + + fread(&pcx_header1, sizeof(pcx_header1), 1, File); + fread(&v25,48,1,File); + fread(&pcx_header2, 4, 1, File); + v6 = (char *)Filename; v37 = 0; v7 = (char *)v3 - Filename; @@ -1403,10 +1383,10 @@ } while ( v37 < 15 ); v3->pName[v37] = 0; - if ( v29 != 8 ) + if ( pcx_header1.bpp != 8 ) return 3; - v9 = v31 - (short)v30 + 1; - v10 = HIWORD(v31) - HIWORD(v30); + v9 = pcx_header1.right - pcx_header1.left + 1; + v10 = pcx_header1.bottom - pcx_header1.up; v3->uWidth = v9; ++v10; v3->uHeight = v10; @@ -1525,9 +1505,9 @@ } fseek(File, 128, 0); ftell(File); - if ( v35 == 1 ) + if ( pcx_header2.planes == 1 ) Abortf("24bit PCX Only!"); - if ( v35 == 3 ) + if ( pcx_header2.planes == 3 ) { v37 = 0; if ( v3->uHeight > 0 ) @@ -1538,7 +1518,7 @@ v17 = v3->pPixels; v38 = 0; v18 = &v17[v16]; - if ( v36 ) + if ( pcx_header2.pitch ) { do { @@ -1573,10 +1553,10 @@ ++v18; } } - while ( v38 < v36 ); + while ( v38 < (unsigned __int16)pcx_header2.pitch); } v20 = &v3->pPixels[v37 * v3->uWidth]; - while ( v38 < 2 * v36 ) + while ( v38 < 2 * (unsigned __int16)pcx_header2.pitch ) { fread((char *)&Filename + 3, 1u, 1u, File); if ( (BYTE3(Filename) & 0xC0) == -64 ) @@ -1608,7 +1588,7 @@ } } v22 = &v3->pPixels[v37 * v3->uWidth]; - while ( v38 < 3 * v36 ) + while ( v38 < 3 * (unsigned __int16)pcx_header2.pitch ) { fread((char *)&Filename + 3, 1u, 1u, File); if ( (BYTE3(Filename) & 0xC0) == -64 )