comparison mm7_1.cpp @ 45:bcc051713d20

BLV render & seffects
author Nomad
date Mon, 22 Oct 2012 20:45:14 +0200
parents 93bf1d5f6a6d
children 79a30ee1ecdb
comparison
equal deleted inserted replaced
43:484492a6dd28 45:bcc051713d20
624 Source, 624 Source,
625 pGlobalTXT_LocalizationStrings[429], 625 pGlobalTXT_LocalizationStrings[429],
626 &stru_AA1058[3].pSounds[6972 * v1 + 40720], 626 &stru_AA1058[3].pSounds[6972 * v1 + 40720],
627 pClassNames[stru_AA1058[3].pSounds[6972 * v1 + 40737]]); 627 pClassNames[stru_AA1058[3].pSounds[6972 * v1 + 40737]]);
628 strcat(pTmpBuf, Source); 628 strcat(pTmpBuf, Source);
629 strcat(pTmpBuf, byte_4E2FD4); 629 strcat(pTmpBuf, "\xC" "00000");
630 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); 630 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0);
631 result = dword_506528; 631 result = dword_506528;
632 a1.uFrameX = 12; 632 a1.uFrameX = 12;
633 a1.uFrameY = 48; 633 a1.uFrameY = 48;
634 a1.uFrameWidth = 424; 634 a1.uFrameWidth = 424;
3091 v12 = a1->uFrameY + 52; 3091 v12 = a1->uFrameY + 52;
3092 v106.uViewportX = a1->uFrameX + 13; 3092 v106.uViewportX = a1->uFrameX + 13;
3093 v106.uViewportY = v12; 3093 v106.uViewportY = v12;
3094 v106.uViewportW = v12 + 128; 3094 v106.uViewportW = v12 + 128;
3095 v106.uViewportZ = v106.uViewportX + 128; 3095 v106.uViewportZ = v106.uViewportX + 128;
3096 v106.field_8 = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; 3096 v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2;
3097 v106.field_10 = 65536; 3097 v106.field_10 = 65536;
3098 v106.field_14 = 65536; 3098 v106.field_14 = 65536;
3099 v106.field_C = v115 + v12 + *(short *)(v11 + 18); 3099 v106.uScreenSpaceY = v115 + v12 + *(short *)(v11 + 18);
3100 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); 3100 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1);
3101 v106.field_28 = 0; 3101 v106.sZValue = 0;
3102 v106.uFlags = 0; 3102 v106.uFlags = 0;
3103 pRenderer->Clip_v2(0, 0, 0x27Fu, 0x1DFu); 3103 pRenderer->Clip_v2(0, 0, 0x27Fu, 0x1DFu);
3104 pRenderer->FillRect(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5); 3104 pRenderer->FillRect(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5);
3105 pRenderer->FillRect( 3105 pRenderer->FillRect(
3106 v106.uViewportX + 129, 3106 v106.uViewportX + 129,
3111 pRenderer->FillRect(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5); 3111 pRenderer->FillRect(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5);
3112 pRenderer->FillRect(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5); 3112 pRenderer->FillRect(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5);
3113 if ( pRenderer->pRenderD3D ) 3113 if ( pRenderer->pRenderD3D )
3114 { 3114 {
3115 v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]]; 3115 v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]];
3116 v106.field_C = v115 + v106.uViewportY + v13->uBufferHeight; 3116 v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight;
3117 v222 = (IDirectDrawSurface *)v13->pTextureSurface; 3117 v222 = (IDirectDrawSurface *)v13->pTextureSurface;
3118 memset(&Dst, 0, 0x64u); 3118 memset(&Dst, 0, 0x64u);
3119 Dst.dwSize = 100; 3119 Dst.dwSize = 100;
3120 Dst.dwFillColor = 0; 3120 Dst.dwFillColor = 0;
3121 memset(&pDesc, 0, 0x7Cu); 3121 memset(&pDesc, 0, 0x7Cu);
3125 v120 = (SpellBuff *)v13->uBufferWidth; 3125 v120 = (SpellBuff *)v13->uBufferWidth;
3126 v107 = 0; 3126 v107 = 0;
3127 v15 = v13->uAreaX; 3127 v15 = v13->uAreaX;
3128 v119 = (signed int)v120 / 2; 3128 v119 = (signed int)v120 / 2;
3129 i = 0; 3129 i = 0;
3130 a4 = (char *)(v106.field_8 + v15 - (signed int)v120 / 2); 3130 a4 = (char *)(v106.uScreenSpaceX + v15 - (signed int)v120 / 2);
3131 v115 = v13->uAreaY; 3131 v115 = v13->uAreaY;
3132 v16 = v13->uAreaWidth + (signed int)v120 / 2 + v15 - (int)v120; 3132 v16 = v13->uAreaWidth + (signed int)v120 / 2 + v15 - (int)v120;
3133 v124 = v106.field_C + v115 - v14; 3133 v124 = v106.uScreenSpaceY + v115 - v14;
3134 v17 = v13->uAreaHeight + v115 - v14; 3134 v17 = v13->uAreaHeight + v115 - v14;
3135 v116 = v106.field_8 + v16; 3135 v116 = v106.uScreenSpaceX + v16;
3136 v119 = v106.field_C + v17; 3136 v119 = v106.uScreenSpaceY + v17;
3137 if ( (signed int)a4 < (signed int)v106.uViewportX ) 3137 if ( (signed int)a4 < (signed int)v106.uViewportX )
3138 { 3138 {
3139 v18 = v106.uViewportX - (int)a4; 3139 v18 = v106.uViewportX - (int)a4;
3140 a4 = (char *)v106.uViewportX; 3140 a4 = (char *)v106.uViewportX;
3141 v107 = v18; 3141 v107 = v18;
3631 v59 = v121; 3631 v59 = v121;
3632 } 3632 }
3633 v60 = v59->pMonsterInfo.uSpell2ID; 3633 v60 = v59->pMonsterInfo.uSpell2ID;
3634 if ( v60 ) 3634 if ( v60 )
3635 { 3635 {
3636 sprintfex(pTmpBuf, &byte_4E3318, 0, pSpellStats->pInfos[v60].pShortName); 3636 __debugbreak();
3637 const char *fmt = "\xC\x25\x30\x35\x75\x9\x30\x36\x30\x25\x73\n";
3638 sprintfex(pTmpBuf, fmt, 0, pSpellStats->pInfos[v60].pShortName);
3637 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); 3639 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
3638 v58 = LOBYTE(v56->uFontHeight); 3640 v58 = LOBYTE(v56->uFontHeight);
3639 a4 = &a4[v58 - 3]; 3641 a4 = &a4[v58 - 3];
3640 v59 = v121; 3642 v59 = v121;
3641 } 3643 }
4978 } 4980 }
4979 4981
4980 //----- (00420EFF) -------------------------------------------------------- 4982 //----- (00420EFF) --------------------------------------------------------
4981 void __cdecl GameUI_WritePointedObjectStatusString() 4983 void __cdecl GameUI_WritePointedObjectStatusString()
4982 { 4984 {
4983 unsigned int zero; // edi@1
4984 int v1; // ebx@6 4985 int v1; // ebx@6
4985 GUIWindow *v2; // edi@7 4986 GUIWindow *v2; // edi@7
4986 GUIButton *i; // ecx@11 4987 GUIButton *i; // ecx@11
4987 Player *v4; // eax@19 4988 Player *v4; // eax@19
4988 char v5; // cl@19 4989 char v5; // cl@19
5025 char Str1[200]; // [sp+Ch] [bp-D4h]@129 5026 char Str1[200]; // [sp+Ch] [bp-D4h]@129
5026 unsigned int pX; // [sp+D4h] [bp-Ch]@1 5027 unsigned int pX; // [sp+D4h] [bp-Ch]@1
5027 unsigned int pY; // [sp+D8h] [bp-8h]@1 5028 unsigned int pY; // [sp+D8h] [bp-8h]@1
5028 unsigned int v45; // [sp+DCh] [bp-4h]@21 5029 unsigned int v45; // [sp+DCh] [bp-4h]@21
5029 5030
5030 zero = 0;
5031 pMouse->uPointingObjectID = 0; 5031 pMouse->uPointingObjectID = 0;
5032 pMouse->GetClickPos(&pX, &pY); 5032 pMouse->GetClickPos(&pX, &pY);
5033 if ( (pX & 0x80000000u) != 0 || (signed int)pX > 639 || (pY & 0x80000000u) != 0 || (signed int)pY > 479 ) 5033 if ( (pX & 0x80000000u) != 0 || (signed int)pX > 639 || (pY & 0x80000000u) != 0 || (signed int)pY > 479 )
5034 return; 5034 return;
5035 if ( !uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions ) 5035 if ( !uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions )
5144 goto _return; 5144 goto _return;
5145 } 5145 }
5146 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 13 ) 5146 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 13 )
5147 { 5147 {
5148 if ( dword_F8B19C != 2 5148 if ( dword_F8B19C != 2
5149 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == zero) 5149 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0)
5150 || v16 == -65536 ) 5150 || v16 == -65536 )
5151 goto _return; 5151 goto _return;
5152 v15 = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 4); 5152 v15 = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 4);
5153 LABEL_49: 5153 LABEL_49:
5154 v17 = v15->GetDisplayName(); 5154 v17 = v15->GetDisplayName();
5155 sub_41C0B8_set_status_string(v17); 5155 sub_41C0B8_set_status_string(v17);
5156 LABEL_50: 5156 LABEL_50:
5157 uLastPointedObjectID = 1; 5157 uLastPointedObjectID = 1;
5158 _return: 5158 _return:
5159 if ( pMouse->uPointingObjectID == zero ) 5159 if ( pMouse->uPointingObjectID == 0 )
5160 { 5160 {
5161 if ( uLastPointedObjectID != zero ) 5161 if ( uLastPointedObjectID != 0 )
5162 { 5162 {
5163 pStatusBarString[0] = 0; 5163 pStatusBarString[0] = 0;
5164 bForceDrawStatusBar = 1; 5164 bForceDrawStatusBar = 1;
5165 } 5165 }
5166 } 5166 }
5168 return; 5168 return;
5169 } 5169 }
5170 if ( (signed int)pY < 350 ) 5170 if ( (signed int)pY < 350 )
5171 { 5171 {
5172 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; 5172 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
5173 if ( v14 == zero || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) 5173 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 )
5174 goto _return; 5174 goto _return;
5175 v15 = (ItemGen *)&pPlayers[uActiveCharacter]->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v14 + 5]; 5175 v15 = (ItemGen *)&pPlayers[uActiveCharacter]->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v14 + 5];
5176 goto LABEL_49; 5176 goto LABEL_49;
5177 } 5177 }
5178 _click_on_game_ui: 5178 _click_on_game_ui:
5179 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX 5179 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX
5180 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ 5180 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ
5181 && (signed int)pY >= (signed int)pWindowList[0].uFrameY 5181 && (signed int)pY >= (signed int)pWindowList[0].uFrameY
5182 && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) 5182 && (signed int)pY <= (signed int)pWindowList[0].uFrameW )
5183 { 5183 {
5184 for ( i = pWindowList[0].pControlsHead; i != (GUIButton *)zero; i = i->pNext ) 5184 for ( i = pWindowList[0].pControlsHead; i != (GUIButton *)0; i = i->pNext )
5185 { 5185 {
5186 if ( i->uButtonType == 1 ) 5186 if ( i->uButtonType == 1 )
5187 { 5187 {
5188 if ( (signed int)pX >= (signed int)i->uX 5188 if ( (signed int)pX >= (signed int)i->uX
5189 && (signed int)pX <= (signed int)i->uZ 5189 && (signed int)pX <= (signed int)i->uZ
5190 && (signed int)pY >= (signed int)i->uY 5190 && (signed int)pY >= (signed int)i->uY
5191 && (signed int)pY <= (signed int)i->uW ) 5191 && (signed int)pY <= (signed int)i->uW )
5192 { 5192 {
5193 v37 = (UIMessageType)i->field_1C; 5193 v37 = (UIMessageType)i->field_1C;
5194 if ( v37 == zero ) 5194 if ( v37 == 0 )
5195 goto LABEL_28; 5195 goto LABEL_28;
5196 v38 = i->uControlParam; 5196 v38 = i->uControlParam;
5197 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 5197 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
5198 { 5198 {
5199 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v37; 5199 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v37;
5200 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38; 5200 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38;
5201 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = zero; 5201 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
5202 ++pMessageQueue_50CBD0->uNumMessages; 5202 ++pMessageQueue_50CBD0->uNumMessages;
5203 } 5203 }
5204 goto LABEL_131; 5204 goto LABEL_131;
5205 } 5205 }
5206 } 5206 }
5208 { 5208 {
5209 if ( i->uButtonType == 2 ) 5209 if ( i->uButtonType == 2 )
5210 { 5210 {
5211 v45 = pX - i->uX; 5211 v45 = pX - i->uX;
5212 v45 = pY - i->uY; 5212 v45 = pY - i->uY;
5213 if ( (double)(signed int)i->uWidth != 0.0 ) 5213
5214 { 5214 if (pX >= i->uX && pX <= i->uZ &&
5215 if ( (double)(signed int)i->uHeight != 0.0 ) 5215 pY >= i->uY && pY <= i->uW)
5216 { 5216 //if ( (double)(signed int)i->uWidth != 0.0 )
5217 //UNDEF(v32); 5217 //{
5218 if ( v33 | v34 ) 5218 // if ( (double)(signed int)i->uHeight != 0.0 )
5219 // {
5220 //UNDEF(v32);
5221 //if ( v33 | v34 )
5219 { 5222 {
5220 v35 = (UIMessageType)i->field_1C; 5223 v35 = (UIMessageType)i->field_1C;
5221 if ( v35 != zero ) 5224 if ( v35 != 0 )
5222 { 5225 {
5223 v36 = i->uControlParam; 5226 v36 = i->uControlParam;
5224 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 5227 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
5225 { 5228 {
5226 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v35; 5229 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v35;
5227 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36; 5230 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36;
5228 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = zero; 5231 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
5229 goto LABEL_27; 5232 goto LABEL_27;
5230 } 5233 }
5231 } 5234 }
5232 goto LABEL_28; 5235 goto LABEL_28;
5233 } 5236 //}
5234 } 5237 //}
5235 } 5238 }
5236 } 5239 }
5237 else 5240 else
5238 { 5241 {
5239 if ( i->uButtonType == 3 5242 if ( i->uButtonType == 3
5341 if ( v2->uFrameHeight == 480 ) 5344 if ( v2->uFrameHeight == 480 )
5342 break; 5345 break;
5343 --v1; 5346 --v1;
5344 if ( v1 <= 0 ) 5347 if ( v1 <= 0 )
5345 { 5348 {
5346 zero = 0;
5347 goto LABEL_38; 5349 goto LABEL_38;
5348 } 5350 }
5349 } 5351 }
5350 } 5352 }
5351 // 4E28F8: using guessed type int uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions; 5353
5352 // 506578: using guessed type int uLastPointedObjectID;
5353 // 5075E0: using guessed type int pVisibleWindowsIdxs[20];
5354 // 5C35BC: using guessed type int bForceDrawStatusBar;
5355 // F8B19C: using guessed type int dword_F8B19C;
5356 5354
5357 //----- (00421626) -------------------------------------------------------- 5355 //----- (00421626) --------------------------------------------------------
5358 GUIWindow *GameUI_InitializeCharacterWindow(unsigned int _this) 5356 GUIWindow *GameUI_InitializeCharacterWindow(unsigned int _this)
5359 { 5357 {
5360 unsigned int v1; // edi@1 5358 unsigned int v1; // edi@1