comparison mm7_1.cpp @ 68:d7e3f844fc2e

inventory fixed
author zipi
date Sun, 27 Jan 2013 09:58:10 +0000
parents 2bcc7b24c831
children f12a7fd4d114
comparison
equal deleted inserted replaced
67:3b4f8bd48e3b 68:d7e3f844fc2e
812 int uTextureId; // [sp+18h] [bp-20h]@6 812 int uTextureId; // [sp+18h] [bp-20h]@6
813 int *v23; // [sp+1Ch] [bp-1Ch]@1 813 int *v23; // [sp+1Ch] [bp-1Ch]@1
814 int v24; // [sp+20h] [bp-18h]@5 814 int v24; // [sp+20h] [bp-18h]@5
815 ItemGen *pItem2; // [sp+24h] [bp-14h]@5 815 ItemGen *pItem2; // [sp+24h] [bp-14h]@5
816 int v26; // [sp+28h] [bp-10h]@3 816 int v26; // [sp+28h] [bp-10h]@3
817 signed int v27; // [sp+2Ch] [bp-Ch]@3 817 unsigned int uCellID; // [sp+2Ch] [bp-Ch]@3
818 int a2a; // [sp+30h] [bp-8h]@5 818 unsigned int uCellX; // [sp+30h] [bp-8h]@5
819 int a3; // [sp+34h] [bp-4h]@5 819 unsigned int uCellY; // [sp+34h] [bp-4h]@5
820 820
821 v23 = pRenderer->pActiveZBuffer; 821 v23 = pRenderer->pActiveZBuffer;
822 pPlayer = pPlayers[uPlayerID]; 822 pPlayer = pPlayers[uPlayerID];
823 v3 = a2; 823 v3 = a2;
824 pPlayer2 = pPlayers[uPlayerID]; 824 pPlayer2 = pPlayers[uPlayerID];
826 if ( v3 ) 826 if ( v3 )
827 { 827 {
828 v4 = pIcons_LOD->LoadTexture("fr_strip", TEXTURE_16BIT_PALETTE); 828 v4 = pIcons_LOD->LoadTexture("fr_strip", TEXTURE_16BIT_PALETTE);
829 pRenderer->DrawTextureIndexed(8u, 0x131u, (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0)); 829 pRenderer->DrawTextureIndexed(8u, 0x131u, (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0));
830 } 830 }
831 v27 = 0; 831 uCellID = 0;
832 v26 = (int)pPlayer->pInventoryIndices; 832 v26 = (int)pPlayer->pInventoryIndices;
833 do 833 do
834 { 834 {
835 if ( *(int *)v26 > 0 ) 835 if ( *(int *)v26 > 0 )
836 { 836 {
837 v24 = *(int *)v26 - 1; 837 v24 = *(int *)v26 - 1;
838 a3 = 32 * v27 / 14 + 17; 838 uCellY = 32 * (uCellID / 14) + 17;
839 pItem = &pPlayer->pInventoryItems[v24]; 839 pItem = &pPlayer->pInventoryItems[v24];
840 a2a = 32 * v27 % 14 + 14; 840 uCellX = 32 * (uCellID % 14) + 14;
841 pItem2 = pItem; 841 pItem2 = pItem;
842 if ( pItem->uItemID ) 842 if ( pItem->uItemID )
843 { 843 {
844 v6 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pItem->uItemID].pIconName, TEXTURE_16BIT_PALETTE); 844 v6 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pItem->uItemID].pIconName, TEXTURE_16BIT_PALETTE);
845 uTextureId = v6; 845 uTextureId = v6;
849 v10 = v7->uTextureWidth; 849 v10 = v7->uTextureWidth;
850 v11 = v7->uTextureWidth; 850 v11 = v7->uTextureWidth;
851 if ( v10 < 14 ) 851 if ( v10 < 14 )
852 v11 = 14; 852 v11 = 14;
853 if ( (v11 - 14) >> 5 == 0 && v8 < 32 ) 853 if ( (v11 - 14) >> 5 == 0 && v8 < 32 )
854 a2a += (32 - v10) / 2; 854 uCellX += (32 - v10) / 2;
855 v12 = v7->uTextureWidth; 855 v12 = v7->uTextureWidth;
856 if ( v10 < 14 ) 856 if ( v10 < 14 )
857 v12 = 14; 857 v12 = 14;
858 v13 = v12 - 14; 858 v13 = v12 - 14;
859 v14 = v7->uTextureHeight; 859 v14 = v7->uTextureHeight;
860 LOBYTE(v13) = v13 & 0xE0; 860 LOBYTE(v13) = v13 & 0xE0;
861 v15 = v13 + 32; 861 v15 = v13 + 32;
862 if ( v9 < 14 ) 862 if ( v9 < 14 )
863 v14 = 14; 863 v14 = 14;
864 v16 = pItem->uAttributes; 864 v16 = pItem->uAttributes;
865 v17 = a2a + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[a3 + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)]; 865 v17 = uCellX + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[uCellY + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)];
866 if ( !(v16 & 0xF0) ) 866 if ( !(v16 & 0xF0) )
867 { 867 {
868 if ( v16 & 1 868 if ( v16 & 1
869 || pCurrentScreen != 13 ) 869 || pCurrentScreen != 13 )
870 { 870 {
871 if ( v16 & 2 ) 871 if ( v16 & 2 )
872 pRenderer->_4A6776(a2a, a3, v7); 872 pRenderer->_4A6776(uCellX, uCellY, v7);
873 else 873 else
874 pRenderer->DrawTextureTransparent(a2a, a3, v7); 874 pRenderer->DrawTextureTransparent(uCellX, uCellY, v7);
875 } 875 }
876 else 876 else
877 { 877 {
878 pRenderer->DrawTransparentGreenShade(a2a, a3, v7); 878 pRenderer->DrawTransparentGreenShade(uCellX, uCellY, v7);
879 } 879 }
880 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); 880 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1);
881 pPlayer = pPlayer2; 881 pPlayer = pPlayer2;
882 //goto LABEL_34; 882 //goto LABEL_34;
883 ++v27; 883 ++uCellID;
884 v26 += 4; 884 v26 += 4;
885 break; 885 continue;
886 } 886 }
887 if ( (unsigned __int8)(v16 & 0xF0) != 16 ) 887 if ( (unsigned __int8)(v16 & 0xF0) != 16 )
888 { 888 {
889 if ( (unsigned __int8)(v16 & 0xF0) == 32 ) 889 if ( (unsigned __int8)(v16 & 0xF0) == 32 )
890 { 890 {
896 dword_50C9A8 = 0; 896 dword_50C9A8 = 0;
897 LOBYTE(pItem2->uAttributes) &= 0xFu; 897 LOBYTE(pItem2->uAttributes) &= 0xFu;
898 ptr_50C9A4 = 0; 898 ptr_50C9A4 = 0;
899 } 899 }
900 v19 = (double)GetTickCount() * 0.1; 900 v19 = (double)GetTickCount() * 0.1;
901 pRenderer->_4A63E6(a2a, a3, v7, pTexture, (signed __int64)v19, 0, 255); 901 pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255);
902 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); 902 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1);
903 pPlayer = pPlayer2; 903 pPlayer = pPlayer2;
904 //goto LABEL_34; 904 //goto LABEL_34;
905 ++v27; 905 ++uCellID;
906 v26 += 4; 906 v26 += 4;
907 break; 907 continue;
908 } 908 }
909 if ( (unsigned __int8)(v16 & 0xF0) == 64 ) 909 if ( (unsigned __int8)(v16 & 0xF0) == 64 )
910 { 910 {
911 v20 = "sp30a"; 911 v20 = "sp30a";
912 pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; 912 pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)];
916 dword_50C9A8 = 0; 916 dword_50C9A8 = 0;
917 LOBYTE(pItem2->uAttributes) &= 0xFu; 917 LOBYTE(pItem2->uAttributes) &= 0xFu;
918 ptr_50C9A4 = 0; 918 ptr_50C9A4 = 0;
919 } 919 }
920 v19 = (double)GetTickCount() * 0.1; 920 v19 = (double)GetTickCount() * 0.1;
921 pRenderer->_4A63E6(a2a, a3, v7, pTexture, (signed __int64)v19, 0, 255); 921 pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255);
922 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); 922 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1);
923 pPlayer = pPlayer2; 923 pPlayer = pPlayer2;
924 //goto LABEL_34; 924 //goto LABEL_34;
925 ++v27; 925 ++uCellID;
926 v26 += 4; 926 v26 += 4;
927 break; 927 continue;
928 } 928 }
929 if ( (unsigned __int8)(v16 & 0xF0) == 128 ) 929 if ( (unsigned __int8)(v16 & 0xF0) == 128 )
930 { 930 {
931 v20 = "sp91a"; 931 v20 = "sp91a";
932 pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; 932 pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)];
936 dword_50C9A8 = 0; 936 dword_50C9A8 = 0;
937 LOBYTE(pItem2->uAttributes) &= 0xFu; 937 LOBYTE(pItem2->uAttributes) &= 0xFu;
938 ptr_50C9A4 = 0; 938 ptr_50C9A4 = 0;
939 } 939 }
940 v19 = (double)GetTickCount() * 0.1; 940 v19 = (double)GetTickCount() * 0.1;
941 pRenderer->_4A63E6(a2a, a3, v7, pTexture, (signed __int64)v19, 0, 255); 941 pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255);
942 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); 942 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1);
943 pPlayer = pPlayer2; 943 pPlayer = pPlayer2;
944 //goto LABEL_34; 944 //goto LABEL_34;
945 ++v27; 945 ++uCellID;
946 v26 += 4; 946 v26 += 4;
947 break; 947 continue;
948 } 948 }
949 } 949 }
950 v20 = "sptext01"; 950 v20 = "sptext01";
951 pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; 951 pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)];
952 dword_50C9A8 -= pEventTimer->uTimeElapsed; 952 dword_50C9A8 -= pEventTimer->uTimeElapsed;
955 dword_50C9A8 = 0; 955 dword_50C9A8 = 0;
956 LOBYTE(pItem2->uAttributes) &= 0xFu; 956 LOBYTE(pItem2->uAttributes) &= 0xFu;
957 ptr_50C9A4 = 0; 957 ptr_50C9A4 = 0;
958 } 958 }
959 v19 = (double)GetTickCount() * 0.1; 959 v19 = (double)GetTickCount() * 0.1;
960 pRenderer->_4A63E6(a2a, a3, v7, pTexture, (signed __int64)v19, 0, 255); 960 pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255);
961 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); 961 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1);
962 pPlayer = pPlayer2; 962 pPlayer = pPlayer2;
963 } 963 }
964 } 964 }
965 //LABEL_34: 965 //LABEL_34:
966 ++v27; 966 ++uCellID;
967 v26 += 4; 967 v26 += 4;
968 } 968 }
969 while ( v27 < 126 ); 969 while ( uCellID < 126 );
970 } 970 }
971 // 4E28F8: using guessed type int pCurrentScreen; 971 // 4E28F8: using guessed type int pCurrentScreen;
972 // 507958: using guessed type int uTextureID_507958; 972 // 507958: using guessed type int uTextureID_507958;
973 // 50C9A8: using guessed type int dword_50C9A8; 973 // 50C9A8: using guessed type int dword_50C9A8;
974 974