Mercurial > mm7
comparison Texture.cpp @ 71:2b90f29892ae
ESC menu fixed
popups fixed
author | zipi |
---|---|
date | Sun, 27 Jan 2013 14:15:50 +0000 |
parents | 9c0607679772 |
children | 0a7860ded5c2 |
comparison
equal
deleted
inserted
replaced
70:2b798f781d1d | 71:2b90f29892ae |
---|---|
1331 //----- (0040E55E) -------------------------------------------------------- | 1331 //----- (0040E55E) -------------------------------------------------------- |
1332 int RGBTexture::_40E55E(const char *Filename, unsigned int a3) | 1332 int RGBTexture::_40E55E(const char *Filename, unsigned int a3) |
1333 { | 1333 { |
1334 RGBTexture *v3; // esi@1 | 1334 RGBTexture *v3; // esi@1 |
1335 signed int result; // eax@2 | 1335 signed int result; // eax@2 |
1336 FILE *v5; // edi@3 | |
1337 char *v6; // eax@3 | 1336 char *v6; // eax@3 |
1338 int v7; // edx@3 | 1337 int v7; // edx@3 |
1339 char v8; // cl@4 | 1338 char v8; // cl@4 |
1340 unsigned __int16 v9; // cx@9 | 1339 unsigned __int16 v9; // cx@9 |
1341 unsigned __int16 v10; // ax@9 | 1340 unsigned __int16 v10; // ax@9 |
1351 unsigned __int16 *v20; // edi@64 | 1350 unsigned __int16 *v20; // edi@64 |
1352 signed int v21; // eax@66 | 1351 signed int v21; // eax@66 |
1353 unsigned __int16 *v22; // edi@71 | 1352 unsigned __int16 *v22; // edi@71 |
1354 signed int v23; // eax@73 | 1353 signed int v23; // eax@73 |
1355 int v24; // eax@78 | 1354 int v24; // eax@78 |
1356 char v25; // [sp+Ch] [bp-54h]@3 | 1355 char v25[48]; // [sp+Ch] [bp-54h]@3 |
1357 char DstBuf; // [sp+3Ch] [bp-24h]@3 | 1356 PCXHeader1 pcx_header1; |
1358 char v27; // [sp+3Dh] [bp-23h]@3 | 1357 PCXHeader2 pcx_header2; |
1359 char v28; // [sp+3Eh] [bp-22h]@3 | |
1360 char v29; // [sp+3Fh] [bp-21h]@3 | |
1361 int v30; // [sp+40h] [bp-20h]@3 | |
1362 int v31; // [sp+44h] [bp-1Ch]@3 | |
1363 char v32; // [sp+48h] [bp-18h]@3 | |
1364 char v33; // [sp+4Ah] [bp-16h]@3 | |
1365 char v34; // [sp+4Ch] [bp-14h]@3 | |
1366 char v35; // [sp+4Dh] [bp-13h]@3 | |
1367 unsigned __int16 v36; // [sp+4Eh] [bp-12h]@3 | |
1368 int v37; // [sp+54h] [bp-Ch]@3 | 1358 int v37; // [sp+54h] [bp-Ch]@3 |
1369 int v38; // [sp+58h] [bp-8h]@57 | 1359 int v38; // [sp+58h] [bp-8h]@57 |
1370 FILE *File; // [sp+5Ch] [bp-4h]@1 | 1360 FILE *File; // [sp+5Ch] [bp-4h]@1 |
1371 | 1361 |
1372 v3 = this; | 1362 v3 = this; |
1373 File = fopen(Filename, "rb"); | 1363 File = fopen(Filename, "rb"); |
1374 if ( !File ) | 1364 if ( !File ) |
1375 return 1; | 1365 return 1; |
1376 v5 = File; | 1366 |
1377 fread(&DstBuf, 1u, 1u, File); | 1367 fread(&pcx_header1, sizeof(pcx_header1), 1, File); |
1378 fread(&v27, 1u, 1u, v5); | 1368 fread(&v25,48,1,File); |
1379 fread(&v28, 1u, 1u, v5); | 1369 fread(&pcx_header2, 4, 1, File); |
1380 fread(&v29, 1u, 1u, v5); | 1370 |
1381 fread(&v30, 2u, 1u, v5); | |
1382 fread((char *)&v30 + 2, 2u, 1u, File); | |
1383 fread(&v31, 2u, 1u, File); | |
1384 fread((char *)&v31 + 2, 2u, 1u, File); | |
1385 fread(&v32, 2u, 1u, File); | |
1386 fread(&v33, 2u, 1u, File); | |
1387 fread(&v25, 0x30u, 1u, File); | |
1388 fread(&v34, 1u, 1u, File); | |
1389 fread(&v35, 1u, 1u, File); | |
1390 fread(&v36, 2u, 1u, File); | |
1391 v6 = (char *)Filename; | 1371 v6 = (char *)Filename; |
1392 v37 = 0; | 1372 v37 = 0; |
1393 v7 = (char *)v3 - Filename; | 1373 v7 = (char *)v3 - Filename; |
1394 do | 1374 do |
1395 { | 1375 { |
1401 ++v37; | 1381 ++v37; |
1402 (v6++)[v7] = v8; | 1382 (v6++)[v7] = v8; |
1403 } | 1383 } |
1404 while ( v37 < 15 ); | 1384 while ( v37 < 15 ); |
1405 v3->pName[v37] = 0; | 1385 v3->pName[v37] = 0; |
1406 if ( v29 != 8 ) | 1386 if ( pcx_header1.bpp != 8 ) |
1407 return 3; | 1387 return 3; |
1408 v9 = v31 - (short)v30 + 1; | 1388 v9 = pcx_header1.right - pcx_header1.left + 1; |
1409 v10 = HIWORD(v31) - HIWORD(v30); | 1389 v10 = pcx_header1.bottom - pcx_header1.up; |
1410 v3->uWidth = v9; | 1390 v3->uWidth = v9; |
1411 ++v10; | 1391 ++v10; |
1412 v3->uHeight = v10; | 1392 v3->uHeight = v10; |
1413 v11 = (signed __int16)v9 * (signed __int16)v10; | 1393 v11 = (signed __int16)v9 * (signed __int16)v10; |
1414 v12 = a3 == 0; | 1394 v12 = a3 == 0; |
1523 default: | 1503 default: |
1524 break; | 1504 break; |
1525 } | 1505 } |
1526 fseek(File, 128, 0); | 1506 fseek(File, 128, 0); |
1527 ftell(File); | 1507 ftell(File); |
1528 if ( v35 == 1 ) | 1508 if ( pcx_header2.planes == 1 ) |
1529 Abortf("24bit PCX Only!"); | 1509 Abortf("24bit PCX Only!"); |
1530 if ( v35 == 3 ) | 1510 if ( pcx_header2.planes == 3 ) |
1531 { | 1511 { |
1532 v37 = 0; | 1512 v37 = 0; |
1533 if ( v3->uHeight > 0 ) | 1513 if ( v3->uHeight > 0 ) |
1534 { | 1514 { |
1535 do | 1515 do |
1536 { | 1516 { |
1537 v16 = v37 * v3->uWidth; | 1517 v16 = v37 * v3->uWidth; |
1538 v17 = v3->pPixels; | 1518 v17 = v3->pPixels; |
1539 v38 = 0; | 1519 v38 = 0; |
1540 v18 = &v17[v16]; | 1520 v18 = &v17[v16]; |
1541 if ( v36 ) | 1521 if ( pcx_header2.pitch ) |
1542 { | 1522 { |
1543 do | 1523 do |
1544 { | 1524 { |
1545 fread((char *)&Filename + 3, 1u, 1u, File); | 1525 fread((char *)&Filename + 3, 1u, 1u, File); |
1546 if ( (BYTE3(Filename) & 0xC0) == -64 ) | 1526 if ( (BYTE3(Filename) & 0xC0) == -64 ) |
1571 + LOBYTE(pRenderer->uTargetBBits) | 1551 + LOBYTE(pRenderer->uTargetBBits) |
1572 - 8)); | 1552 - 8)); |
1573 ++v18; | 1553 ++v18; |
1574 } | 1554 } |
1575 } | 1555 } |
1576 while ( v38 < v36 ); | 1556 while ( v38 < (unsigned __int16)pcx_header2.pitch); |
1577 } | 1557 } |
1578 v20 = &v3->pPixels[v37 * v3->uWidth]; | 1558 v20 = &v3->pPixels[v37 * v3->uWidth]; |
1579 while ( v38 < 2 * v36 ) | 1559 while ( v38 < 2 * (unsigned __int16)pcx_header2.pitch ) |
1580 { | 1560 { |
1581 fread((char *)&Filename + 3, 1u, 1u, File); | 1561 fread((char *)&Filename + 3, 1u, 1u, File); |
1582 if ( (BYTE3(Filename) & 0xC0) == -64 ) | 1562 if ( (BYTE3(Filename) & 0xC0) == -64 ) |
1583 { | 1563 { |
1584 BYTE3(Filename) &= 0x3Fu; | 1564 BYTE3(Filename) &= 0x3Fu; |
1606 ++v38; | 1586 ++v38; |
1607 ++v20; | 1587 ++v20; |
1608 } | 1588 } |
1609 } | 1589 } |
1610 v22 = &v3->pPixels[v37 * v3->uWidth]; | 1590 v22 = &v3->pPixels[v37 * v3->uWidth]; |
1611 while ( v38 < 3 * v36 ) | 1591 while ( v38 < 3 * (unsigned __int16)pcx_header2.pitch ) |
1612 { | 1592 { |
1613 fread((char *)&Filename + 3, 1u, 1u, File); | 1593 fread((char *)&Filename + 3, 1u, 1u, File); |
1614 if ( (BYTE3(Filename) & 0xC0) == -64 ) | 1594 if ( (BYTE3(Filename) & 0xC0) == -64 ) |
1615 { | 1595 { |
1616 BYTE3(Filename) &= 0x3Fu; | 1596 BYTE3(Filename) &= 0x3Fu; |