Mercurial > mm7
comparison mm7_5.cpp @ 973:ec7568e13b24
Minor code cleaning.
author | Nomad |
---|---|
date | Wed, 08 May 2013 21:37:12 +0200 |
parents | c8a0f6d89c70 |
children | ac85898f5903 |
comparison
equal
deleted
inserted
replaced
972:c8a0f6d89c70 | 973:ec7568e13b24 |
---|---|
2862 pCurrentScreen = SCREEN_QUICK_REFERENCE; | 2862 pCurrentScreen = SCREEN_QUICK_REFERENCE; |
2863 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_QuickReference, 5, 0); | 2863 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_QuickReference, 5, 0); |
2864 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); | 2864 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); |
2865 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, v0, 0, UIMSG_Escape, 0, 0, | 2865 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, v0, 0, UIMSG_Escape, 0, 0, |
2866 pGlobalTXT_LocalizationStrings[79],// "Exit" | 2866 pGlobalTXT_LocalizationStrings[79],// "Exit" |
2867 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), 0); //, v179); | 2867 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179); |
2868 continue; | 2868 continue; |
2869 case UIMSG_GameMenuButton: | 2869 case UIMSG_GameMenuButton: |
2870 if ( pCurrentScreen ) | 2870 if ( pCurrentScreen ) |
2871 { | 2871 { |
2872 pGUIWindow_CurrentMenu->Release(); | 2872 pGUIWindow_CurrentMenu->Release(); |
2907 bRingsShownInCharScreen ^= v0; | 2907 bRingsShownInCharScreen ^= v0; |
2908 pCharacterScreen_DetalizBtn->Release(); | 2908 pCharacterScreen_DetalizBtn->Release(); |
2909 pCharacterScreen_DollBtn->Release(); | 2909 pCharacterScreen_DollBtn->Release(); |
2910 if ( bRingsShownInCharScreen ) | 2910 if ( bRingsShownInCharScreen ) |
2911 { | 2911 { |
2912 v128 = (uTextureID_detaliz_close_button != -1 ? pIcons_LOD->pTextures[uTextureID_detaliz_close_button].uTextureHeight : 26); | 2912 v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight; |
2913 v125 = (uTextureID_detaliz_close_button != -1 ? pIcons_LOD->pTextures[uTextureID_detaliz_close_button].uTextureWidth : 24); | 2913 v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth; |
2914 v123 = 445; | 2914 v123 = 445; |
2915 v121 = 470; | 2915 v121 = 470; |
2916 } | 2916 } |
2917 else | 2917 else |
2918 { | 2918 { |
9448 } | 9448 } |
9449 | 9449 |
9450 //----- (0040F82D) -------------------------------------------------------- | 9450 //----- (0040F82D) -------------------------------------------------------- |
9451 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue) | 9451 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue) |
9452 { | 9452 { |
9453 ZBuffer_DoFill(pZBuffer, (Texture *)(uTextureId != -1 ? (int)&pIcons_LOD->pTextures[uTextureId] : 0), iZValue); | 9453 assert(uTextureId != -1); |
9454 ZBuffer_DoFill(pZBuffer, pIcons_LOD->GetTexture(uTextureId), iZValue); | |
9454 } | 9455 } |
9455 | 9456 |
9456 //----- (0040F845) -------------------------------------------------------- | 9457 //----- (0040F845) -------------------------------------------------------- |
9457 __int16 __fastcall sub_40F845(int a1, int a2, int a3, int a4, int a5, __int16 a6, int a7) | 9458 __int16 __fastcall sub_40F845(int a1, int a2, int a3, int a4, int a5, __int16 a6, int a7) |
9458 { | 9459 { |
10199 int v31; // eax@115 | 10200 int v31; // eax@115 |
10200 GUIButton *pButton; // ebp@118 | 10201 GUIButton *pButton; // ebp@118 |
10201 int v39; // eax@129 | 10202 int v39; // eax@129 |
10202 unsigned int pNumMessages; // eax@142 | 10203 unsigned int pNumMessages; // eax@142 |
10203 GUIButton *pGUIButton; // ebp@146 | 10204 GUIButton *pGUIButton; // ebp@146 |
10204 unsigned int pX; // [sp-1Ch] [bp-124h]@17 | 10205 //unsigned int pX; // [sp-1Ch] [bp-124h]@17 |
10205 unsigned int pY; // [sp-18h] [bp-120h]@17 | 10206 //unsigned int pY; // [sp-18h] [bp-120h]@17 |
10206 Texture *pTexture; // [sp-14h] [bp-11Ch]@17 | 10207 //Texture *pTexture; // [sp-14h] [bp-11Ch]@17 |
10207 Texture *pTexture2; // [sp-14h] [bp-11Ch]@86 | 10208 //Texture *pTexture2; // [sp-14h] [bp-11Ch]@86 |
10208 int i; // [sp+0h] [bp-108h]@3 | 10209 int i; // [sp+0h] [bp-108h]@3 |
10209 ItemGen pItemGen; // [sp+4h] [bp-104h]@98 | 10210 ItemGen pItemGen; // [sp+4h] [bp-104h]@98 |
10210 GUIButton GUIButton2; // [sp+28h] [bp-E0h]@133 | 10211 GUIButton GUIButton2; // [sp+28h] [bp-E0h]@133 |
10211 ItemGen ItemGen2; // [sp+E4h] [bp-24h]@129 | 10212 ItemGen ItemGen2; // [sp+E4h] [bp-24h]@129 |
10212 | 10213 |
10219 pWindowType = pWindow->eWindowType; | 10220 pWindowType = pWindow->eWindowType; |
10220 switch (pWindow->eWindowType) | 10221 switch (pWindow->eWindowType) |
10221 { | 10222 { |
10222 case WINDOW_OptionsButtons: | 10223 case WINDOW_OptionsButtons: |
10223 { | 10224 { |
10224 pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0); | 10225 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_Y, |
10225 pY = pViewport->uViewportTL_Y; | 10226 pViewport->uViewportTL_X, pIcons_LOD->GetTexture(uTextureID_Options)); |
10226 pX = pViewport->uViewportTL_X; | |
10227 pRenderer->DrawTextureIndexed(pX, pY, pTexture); | |
10228 viewparams->bRedrawGameUI = 1; | 10227 viewparams->bRedrawGameUI = 1; |
10229 continue; | 10228 continue; |
10230 } | 10229 } |
10231 case WINDOW_CharacterRecord: | 10230 case WINDOW_CharacterRecord: |
10232 { | 10231 { |
10282 else if ( pCurrentScreen == SCREEN_F ) | 10281 else if ( pCurrentScreen == SCREEN_F ) |
10283 { | 10282 { |
10284 pRenderer->ClearZBuffer(0, 479); | 10283 pRenderer->ClearZBuffer(0, 479); |
10285 draw_leather(); | 10284 draw_leather(); |
10286 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 10285 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
10287 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, | 10286 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); |
10288 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); | |
10289 } | 10287 } |
10290 continue; | 10288 continue; |
10291 } | 10289 } |
10292 case WINDOW_SaveLoadButtons: | 10290 case WINDOW_SaveLoadButtons: |
10293 { | 10291 { |
10332 { | 10330 { |
10333 pRenderer->ClearZBuffer(0, 479); | 10331 pRenderer->ClearZBuffer(0, 479); |
10334 draw_leather(); | 10332 draw_leather(); |
10335 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); | 10333 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); |
10336 CharacterUI_DrawPaperdoll(uActiveCharacter); | 10334 CharacterUI_DrawPaperdoll(uActiveCharacter); |
10337 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, | 10335 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); |
10338 (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0)); | |
10339 continue; | 10336 continue; |
10340 } | 10337 } |
10341 case WINDOW_FinalWindow: | 10338 case WINDOW_FinalWindow: |
10342 { | 10339 { |
10343 sub_41420D_press_esc(); | 10340 sub_41420D_press_esc(); |
10556 continue; | 10553 continue; |
10557 } | 10554 } |
10558 case WINDOW_BooksWindow: | 10555 case WINDOW_BooksWindow: |
10559 { | 10556 { |
10560 pButton = (GUIButton *)pWindow->ptr_1C; | 10557 pButton = (GUIButton *)pWindow->ptr_1C; |
10561 pY = pWindow->uFrameY; | 10558 pRenderer->DrawTextureIndexed(pWindow->uFrameY, |
10562 pX = pWindow->uFrameX; | 10559 pWindow->uFrameX, pButton->pTextures[0]); |
10563 pRenderer->DrawTextureIndexed(pX, pY, pButton->pTextures[0]); | |
10564 viewparams->bRedrawGameUI = 1; | 10560 viewparams->bRedrawGameUI = 1; |
10565 continue; | 10561 continue; |
10566 } | 10562 } |
10567 case WINDOW_CharacterWindow_Inventory: | 10563 case WINDOW_CharacterWindow_Inventory: |
10568 { | 10564 { |
11528 i->uZ = 0; | 11524 i->uZ = 0; |
11529 i->uY = 0; | 11525 i->uY = 0; |
11530 i->uX = 0; | 11526 i->uX = 0; |
11531 } | 11527 } |
11532 } | 11528 } |
11533 pBtn_Up = pGUIWindow_CurrentMenu->CreateButton(438, 46, (uTextureID_ar_up_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_up_up].uTextureWidth : 24), | 11529 pBtn_Up = pGUIWindow_CurrentMenu->CreateButton(438, 46, |
11534 (uTextureID_ar_up_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_up_up].uTextureHeight : 26), | 11530 pIcons_LOD->GetTexture(uTextureID_ar_up_up)->uTextureWidth, |
11535 1, 0, UIMSG_ClickAwardsUpBtn, 0, 0, "", (Texture *)(uTextureID_ar_up_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_up_up] : 0), | 11531 pIcons_LOD->GetTexture(uTextureID_ar_up_up)->uTextureHeight, |
11536 uTextureID_ar_up_dn != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_up_dn] : 0, 0); | 11532 1, 0, UIMSG_ClickAwardsUpBtn, 0, 0, "", |
11537 pBtn_Down = pGUIWindow_CurrentMenu->CreateButton(438, 292, (uTextureID_ar_dn_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_dn_up].uTextureWidth : 24), | 11533 pIcons_LOD->GetTexture(uTextureID_ar_up_up), |
11538 (uTextureID_ar_dn_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_dn_up].uTextureHeight : 26), | 11534 pIcons_LOD->GetTexture(uTextureID_ar_up_dn), 0); |
11539 1, 0, UIMSG_ClickAwardsDownBtn, 0, 0, "", (Texture *)(uTextureID_ar_dn_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_dn_up] : 0), | 11535 pBtn_Down = pGUIWindow_CurrentMenu->CreateButton(438, 292, |
11540 uTextureID_ar_dn_dn != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_dn_dn] : 0, 0); | 11536 pIcons_LOD->GetTexture(uTextureID_ar_dn_up)->uTextureWidth, |
11537 pIcons_LOD->GetTexture(uTextureID_ar_dn_up)->uTextureHeight, | |
11538 1, 0, UIMSG_ClickAwardsDownBtn, 0, 0, "", | |
11539 pIcons_LOD->GetTexture(uTextureID_ar_dn_up), | |
11540 pIcons_LOD->GetTexture(uTextureID_ar_dn_dn), 0); | |
11541 ptr_507BA4 = pGUIWindow_CurrentMenu->CreateButton(440, 62, 16, 232, 1, 0, UIMSG_C0, 0, 0, "", 0); | 11541 ptr_507BA4 = pGUIWindow_CurrentMenu->CreateButton(440, 62, 16, 232, 1, 0, UIMSG_C0, 0, 0, "", 0); |
11542 } | 11542 } |
11543 } | 11543 } |
11544 | 11544 |
11545 | 11545 |