comparison mm7_5.cpp @ 158:f4ebd13c2a8e

13.02.13
author Ritor1
date Wed, 13 Feb 2013 01:26:49 +0600
parents 9abdd40a107b
children a0e7ad5425d4
comparison
equal deleted inserted replaced
157:8e0e2991f9d1 158:f4ebd13c2a8e
13295 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C2u, pTexture_50643C); 13295 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C2u, pTexture_50643C);
13296 pRenderer->DrawTextureIndexed(0x231u, 0x1C2u, pTexture_506448); 13296 pRenderer->DrawTextureIndexed(0x231u, 0x1C2u, pTexture_506448);
13297 } 13297 }
13298 13298
13299 //----- (00412B58) -------------------------------------------------------- 13299 //----- (00412B58) --------------------------------------------------------
13300 void __cdecl sub_412B58() 13300 void __cdecl DrawSpellBookContent()
13301 { 13301 {
13302 Player *v0; // ebx@1 13302 Player *v0; // ebx@1
13303 int v1; // ebp@1 13303 int v1; // ebp@1
13304 unsigned int v2; // eax@1 13304 unsigned int v2; // eax@1
13305 Texture *v3; // edi@1 13305 Texture *v3; // edi@1
13313 Texture *v11; // edx@14 13313 Texture *v11; // edx@14
13314 int v12; // eax@15 13314 int v12; // eax@15
13315 signed int v13; // ecx@18 13315 signed int v13; // ecx@18
13316 unsigned int v14; // esi@18 13316 unsigned int v14; // esi@18
13317 unsigned int v15; // edi@18 13317 unsigned int v15; // edi@18
13318 Texture *v16; // eax@21 13318 Texture *pPageTexture; // eax@21
13319 unsigned int v17; // [sp-Ch] [bp-2Ch]@8 13319 unsigned int v17; // [sp-Ch] [bp-2Ch]@8
13320 unsigned int v18; // [sp-Ch] [bp-2Ch]@15 13320 unsigned int v18; // [sp-Ch] [bp-2Ch]@15
13321 unsigned int v19; // [sp-8h] [bp-28h]@8 13321 unsigned int v19; // [sp-8h] [bp-28h]@8
13322 unsigned int v20; // [sp-8h] [bp-28h]@15 13322 unsigned int v20; // [sp-8h] [bp-28h]@15
13323 Texture *v21; // [sp-4h] [bp-24h]@15 13323 Texture *v21; // [sp-4h] [bp-24h]@15
13397 { 13397 {
13398 if ( *(short *)a2.x ) 13398 if ( *(short *)a2.x )
13399 { 13399 {
13400 if ( v0->pNumSpellBookPage == v13 ) 13400 if ( v0->pNumSpellBookPage == v13 )
13401 { 13401 {
13402 v16 = pTextures_tabs[v13][1]; 13402 pPageTexture = pTextures_tabs[v13][1];
13403 switch ( v13 ) 13403 switch ( v13 )
13404 { 13404 {
13405 case 0: 13405 case 0:
13406 v14 = 406; 13406 v14 = 406;
13407 v22 = 9; 13407 v22 = 9;
13437 break; 13437 break;
13438 } 13438 }
13439 } 13439 }
13440 else 13440 else
13441 { 13441 {
13442 v16 = pTextures_tabs[v13][0]; 13442 pPageTexture = pTextures_tabs[v13][0];
13443 switch ( v13 ) 13443 switch ( v13 )
13444 { 13444 {
13445 case 0: 13445 case 0:
13446 v14 = 415; 13446 v14 = 415;
13447 v22 = 10; 13447 v22 = 10;
13483 break; 13483 break;
13484 default: 13484 default:
13485 break; 13485 break;
13486 } 13486 }
13487 } 13487 }
13488 pRenderer->DrawTextureTransparent(v14, v15, v16); 13488 pRenderer->DrawTextureTransparent(v14, v15, pPageTexture);
13489 v13 = v25; 13489 v13 = v25;
13490 } 13490 }
13491 a2.x += 2; 13491 a2.x += 2;
13492 ++v13; 13492 ++v13;
13493 v25 = v13; 13493 v25 = v13;
15089 if ( v37 )//pWindowType > 103 15089 if ( v37 )//pWindowType > 103
15090 { 15090 {
15091 v38 = v37 - 2; 15091 v38 = v37 - 2;
15092 if ( v38 )//pWindowType > 105 15092 if ( v38 )//pWindowType > 105
15093 { 15093 {
15094 if ( v38 == 1 )//pWindowType == 106 (0x6A) WINDOW_VideoOptions 15094 if ( pWindowType == WINDOW_VideoOptions )
15095 GameMenuUI_DrawVideoOptions(); 15095 GameMenuUI_DrawVideoOptions();
15096 } 15096 }
15097 else//pWindowType == 105 (0x69) WINDOW_KeyMappingOptions 15097 else if ( pWindowType == WINDOW_KeyMappingOptions )
15098 { 15098 {
15099 GameMenuUI_DrawKeyBindings(); 15099 GameMenuUI_DrawKeyBindings();
15100 } 15100 }
15101 } 15101 }
15102 else//pWindowType == 103 (0x67) WINDOW_67 15102 else//pWindowType == WINDOW_67
15103 { 15103 {
15104 pWindow->DrawMessageBox(0); 15104 pWindow->DrawMessageBox(0);
15105 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); 15105 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
15106 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); 15106 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
15107 if ( !pKeyActionMap->field_204 ) 15107 if ( !pKeyActionMap->field_204 )
15147 pGUIWindow2 = pWindow; 15147 pGUIWindow2 = pWindow;
15148 //goto LABEL_110; 15148 //goto LABEL_110;
15149 pGUIWindow2->Release(); 15149 pGUIWindow2->Release();
15150 continue; 15150 continue;
15151 } 15151 }
15152 if ( pWindow->Hint != (char *)1 )//pWindowType == 97 (0x61) WINDOW_61 15152 if ( pWindow->Hint != (char *)1 )//pWindowType == WINDOW_61
15153 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); 15153 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
15154 v32 = pWindow->ptr_1C; 15154 v32 = pWindow->ptr_1C;
15155 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 16)); 15155 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 16));
15156 //goto LABEL_138; 15156 //goto LABEL_138;
15157 pHint = pWindow->Hint; 15157 pHint = pWindow->Hint;
15186 //LABEL_142: 15186 //LABEL_142:
15187 pNumMessages = pMessageQueue_50CBD0->uNumMessages; 15187 pNumMessages = pMessageQueue_50CBD0->uNumMessages;
15188 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 15188 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
15189 //goto LABEL_151; 15189 //goto LABEL_151;
15190 { 15190 {
15191 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; 15191 pMessageQueue_50CBD0->pMessages[pNumMessages].eType = (UIMessageType)113; //0x71
15192 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 15192 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
15193 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 15193 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
15194 ++pMessageQueue_50CBD0->uNumMessages; 15194 ++pMessageQueue_50CBD0->uNumMessages;
15195 continue; 15195 continue;
15196 } 15196 }
15198 } 15198 }
15199 v14 = pWindowType - 80; 15199 v14 = pWindowType - 80;
15200 if ( v14 )//pWindowType > 80 15200 if ( v14 )//pWindowType > 80
15201 { 15201 {
15202 v15 = v14 - 9; 15202 v15 = v14 - 9;
15203 if ( !v15 )//pWindowType == 89 (0x59) WINDOW_59 15203 if ( pWindowType == WINDOW_59)
15204 { 15204 {
15205 pWindow->DrawMessageBox(0); 15205 pWindow->DrawMessageBox(0);
15206 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); 15206 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
15207 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); 15207 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
15208 if ( !pKeyActionMap->field_204 ) 15208 if ( !pKeyActionMap->field_204 )
15235 } 15235 }
15236 } 15236 }
15237 continue; 15237 continue;
15238 } 15238 }
15239 v16 = v15 - 1; 15239 v16 = v15 - 1;
15240 if ( !v16 )// pWindowType == 90 (0x5A) WINDOW_5A 15240 if ( pWindowType == WINDOW_5A ) // Press buttons in title menu and in game, and escape in game
15241 { 15241 {
15242 if ( pWindow->Hint != (char *)1 ) 15242 if ( pWindow->Hint != (char *)1 )
15243 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); 15243 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
15244 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C; 15244 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
15245 if ( pButtonPtr_1C->uX >= 0 )//if ( (pButtonPtr_1C->uX & 0x80000000u) == 0 ) 15245 if ( pButtonPtr_1C->uX >= 0 )//if ( (pButtonPtr_1C->uX & 0x80000000u) == 0 )
15286 //goto LABEL_110; 15286 //goto LABEL_110;
15287 pGUIWindow2->Release(); 15287 pGUIWindow2->Release();
15288 continue; 15288 continue;
15289 } 15289 }
15290 v17 = v16 - 1; 15290 v17 = v16 - 1;
15291 if ( !v17 )//pWindowType == 91 (0x5B) WINDOW_5B 15291 if ( pWindowType == WINDOW_5B )//Change button in Character window
15292 { 15292 {
15293 if ( pWindow->Hint != (char *)1 ) 15293 if ( pWindow->Hint != (char *)1 )
15294 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); 15294 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
15295 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C; 15295 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
15296 pTexture2 = pButtonPtr_1C->pTextures[1]; 15296 pTexture2 = pButtonPtr_1C->pTextures[1];
15311 //goto LABEL_110; 15311 //goto LABEL_110;
15312 pGUIWindow2->Release(); 15312 pGUIWindow2->Release();
15313 continue; 15313 continue;
15314 } 15314 }
15315 v18 = v17 - 1; 15315 v18 = v17 - 1;
15316 if ( !v18 )//pWindowType == 92 (0x5C) WINDOW_5C 15316 if ( pWindowType == WINDOW_5C ) // Change page in AutonotesBook
15317 { 15317 {
15318 if ( pWindow->Hint != (char *)1 ) 15318 if ( pWindow->Hint != (char *)1 )
15319 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); 15319 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
15320 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C; 15320 pButtonPtr_1C = (GUIButton *)pWindow->ptr_1C;
15321 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButtonPtr_1C->pTextures[0]); 15321 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButtonPtr_1C->pTextures[0]);
15331 pGUIWindow2 = pWindow; 15331 pGUIWindow2 = pWindow;
15332 pGUIWindow2->Release(); 15332 pGUIWindow2->Release();
15333 continue; 15333 continue;
15334 } 15334 }
15335 v19 = v18 - 1; 15335 v19 = v18 - 1;
15336 if ( !v19 )//pWindowType == 93 (0x5D) WINDOW_5D 15336 if ( pWindowType == WINDOW_5D )
15337 { 15337 {
15338 if ( pWindow->Hint != (char *)1 ) 15338 if ( pWindow->Hint != (char *)1 )
15339 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); 15339 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
15340 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 16)); 15340 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 16));
15341 viewparams->bRedrawGameUI = 1; 15341 viewparams->bRedrawGameUI = 1;
15344 //goto LABEL_110; 15344 //goto LABEL_110;
15345 pGUIWindow2->Release(); 15345 pGUIWindow2->Release();
15346 continue; 15346 continue;
15347 } 15347 }
15348 } 15348 }
15349 else//pWindowType == 80 (0x50) WINDOW_50 15349 else if ( pWindowType == WINDOW_50 )
15350 { 15350 {
15351 v27 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 15351 v27 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
15352 if ( ptr_507BD0->field_40 == 1 ) 15352 if ( ptr_507BD0->field_40 == 1 )
15353 { 15353 {
15354 ptr_507BD0->DrawMessageBox(0); 15354 ptr_507BD0->DrawMessageBox(0);
15387 } 15387 }
15388 } 15388 }
15389 } 15389 }
15390 else 15390 else
15391 { 15391 {
15392 if ( pWindowType == 70 ) // 0x46 WINDOW_FinalWindow 15392 if ( pWindowType == WINDOW_FinalWindow )
15393 { 15393 {
15394 sub_41420D_press_esc(); 15394 sub_41420D_press_esc();
15395 continue; 15395 continue;
15396 } 15396 }
15397 if ( (signed int)pWindowType > 18 ) 15397 if ( (signed int)pWindowType > 18 )
15402 if ( v12 )// pWindowType > 26 15402 if ( v12 )// pWindowType > 26
15403 { 15403 {
15404 v13 = v12 - 4; 15404 v13 = v12 - 4;
15405 if ( v13 )//pWindowType > 30 15405 if ( v13 )//pWindowType > 30
15406 { 15406 {
15407 if ( v13 == 1 ) //pWindowType == 31 (0x1F) WINDOW_1F 15407 if ( pWindowType == WINDOW_1F)
15408 { 15408 {
15409 pRenderer->ClearZBuffer(0, 479); 15409 pRenderer->ClearZBuffer(0, 479);
15410 draw_leather(); 15410 draw_leather();
15411 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 15411 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
15412 CharacterUI_DrawPaperdoll(uActiveCharacter); 15412 CharacterUI_DrawPaperdoll(uActiveCharacter);
15413 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, 15413 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
15414 (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0)); 15414 (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
15415 } 15415 }
15416 } 15416 }
15417 else// pWindowType == 30 (0x1E) WINDOW_1E 15417 else if( pWindowType == WINDOW_Scroll)
15418 { 15418 {
15419 sub_467FB6(); 15419 CreateScrollWindow();
15420 } 15420 }
15421 } 15421 }
15422 else //pWindowType == 26 (0x1A) WINDOW_1A 15422 else if ( pWindowType == WINDOW_Transition )
15423 { 15423 {
15424 TransitionUI_Draw(); 15424 TransitionUI_Draw();
15425 } 15425 }
15426 continue; 15426 continue;
15427 } 15427 }
15437 if ( v9 )//pWindowType > 23 15437 if ( v9 )//pWindowType > 23
15438 { 15438 {
15439 //if ( v9 == 1 ) //pWindowType == 24 (0x18) WINDOW_MainMenu_Load 15439 //if ( v9 == 1 ) //pWindowType == 24 (0x18) WINDOW_MainMenu_Load
15440 // sub_4606F7(); 15440 // sub_4606F7();
15441 } 15441 }
15442 else//pWindowType == 23 (0x17) WINDOW_17 15442 else if ( pWindowType == WINDOW_17 )
15443 { 15443 {
15444 sub_4606FE(); 15444 sub_4606FE();
15445 } 15445 }
15446 } 15446 }
15447 else//pWindowType == 20 (0x14) WINDOW_Chest 15447 else if ( pWindowType == WINDOW_Chest )
15448 { 15448 {
15449 if ( pCurrentScreen == SCREEN_CHEST ) 15449 if ( pCurrentScreen == SCREEN_CHEST )
15450 { 15450 {
15451 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C); 15451 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C);
15452 } 15452 }
15461 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0)); 15461 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0));
15462 } 15462 }
15463 } 15463 }
15464 } 15464 }
15465 } 15465 }
15466 else//pWindowType == 19 (0x13) WINDOW_GreetingNPC 15466 else if (pWindowType == WINDOW_GreetingNPC )
15467 { 15467 {
15468 DrawBranchlessDialogueUI(); 15468 DrawBranchlessDialogueUI();
15469 } 15469 }
15470 continue; 15470 continue;
15471 } 15471 }
15498 ++pMessageQueue_50CBD0->uNumMessages; 15498 ++pMessageQueue_50CBD0->uNumMessages;
15499 continue; 15499 continue;
15500 } 15500 }
15501 continue; 15501 continue;
15502 } 15502 }
15503 if ( pWindowType == 18 ) //(0x12) WINDOW_SpellBook 15503 if ( pWindowType == WINDOW_SpellBook )
15504 { 15504 {
15505 sub_412B58(); 15505 DrawSpellBookContent();
15506 } 15506 }
15507 else 15507 else
15508 { 15508 {
15509 if ( (signed int)pWindowType > 10 ) 15509 if ( (signed int)pWindowType > 10 )
15510 { 15510 {
15512 if ( v5 )//pWindowType >12 15512 if ( v5 )//pWindowType >12
15513 { 15513 {
15514 v6 = v5 - 4; 15514 v6 = v5 - 4;
15515 if ( v6 )//pWindowType > 16 15515 if ( v6 )//pWindowType > 16
15516 { 15516 {
15517 if ( v6 == 1 )//pWindowType == 17 (0x11) WINDOW_ChangeLocation 15517 if ( pWindowType == WINDOW_ChangeLocation )
15518 TravelUI_Draw(); 15518 TravelUI_Draw();
15519 } 15519 }
15520 else//pWindowType == 16 (0x10) WINDOW_10 15520 else if ( pWindowType == WINDOW_Rest )
15521 { 15521 {
15522 RestUI_Draw(); 15522 RestUI_Draw();
15523 } 15523 }
15524 } 15524 }
15525 else// pWindowType == 12 (0xC) WINDOW_C 15525 else if (pWindowType == WINDOW_QuickReference )
15526 { 15526 {
15527 QuickRefDraw(); 15527 QuickRefDraw();
15528 } 15528 }
15529 continue; 15529 continue;
15530 } 15530 }
15537 if ( v3 )// pWindowType > 4 15537 if ( v3 )// pWindowType > 4
15538 { 15538 {
15539 v4 = v3 - 2; 15539 v4 = v3 - 2;
15540 if ( v4 )//pWindowType > 6 15540 if ( v4 )//pWindowType > 6
15541 { 15541 {
15542 if ( v4 == 3 )//pWindowType == 9 (0x9) WINDOW_Book 15542 if ( pWindowType == WINDOW_Book )
15543 SellectDrawBook((unsigned int)pWindow->ptr_1C); 15543 SellectDrawBook((unsigned int)pWindow->ptr_1C);
15544 } 15544 }
15545 else//pWindowType == 6 (0x6) WINDOW_Options 15545 else if (pWindowType == WINDOW_Options)
15546 { 15546 {
15547 sub_414F82_DrawGameOptions(); 15547 sub_414F82_DrawGameOptions();
15548 } 15548 }
15549 } 15549 }
15550 else//pWindowType == 4 (0x4) WINDOW_CharacterRecord 15550 else if (pWindowType == WINDOW_CharacterRecord)
15551 { 15551 {
15552 CharacterUI_CharacterScreen_Draw(uActiveCharacter); 15552 CharacterUI_CharacterScreen_Draw(uActiveCharacter);
15553 } 15553 }
15554 continue; 15554 continue;
15555 } 15555 }