comparison mm7_5.cpp @ 1025:8b492d4722d4

Intersection
author Ritor1
date Tue, 21 May 2013 12:42:57 +0600
parents 54f74d2c894f
children 6afa77761a00
comparison
equal deleted inserted replaced
1024:d353bd3009d9 1025:8b492d4722d4
45 45
46 //----- (004304E7) -------------------------------------------------------- 46 //----- (004304E7) --------------------------------------------------------
47 void __cdecl GameUI_MsgProc() 47 void __cdecl GameUI_MsgProc()
48 { 48 {
49 //signed int v0; // edi@6 49 //signed int v0; // edi@6
50 char *v1; // esi@6 50 //char *v1; // esi@6
51 unsigned int v2; // edx@7 51 unsigned int v2; // edx@7
52 Actor *pActor; // ecx@13 52 Actor *pActor; // ecx@13
53 int v4; // ecx@18 53 int v4; // ecx@18
54 //NPCData *pNPCData0; // eax@18 54 //NPCData *pNPCData0; // eax@18
55 //int v6; // edx@20 55 //int v6; // edx@20
278 actor.InitializeDialogue(0); 278 actor.InitializeDialogue(0);
279 bDialogueUI_InitializeActor_NPC_ID = 0; 279 bDialogueUI_InitializeActor_NPC_ID = 0;
280 } 280 }
281 if ( pMessageQueue_50CBD0->uNumMessages ) 281 if ( pMessageQueue_50CBD0->uNumMessages )
282 { 282 {
283 v1 = ""; 283 //v1 = "";
284 while ( 2 ) 284 while ( 2 )
285 { 285 {
286 if ( !pMessageQueue_50CBD0->uNumMessages ) 286 if ( !pMessageQueue_50CBD0->uNumMessages )
287 break; 287 break;
288 288
547 547
548 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0); 548 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0);
549 pGUIWindow_CurrentMenu->CreateButton(22, 270, 549 pGUIWindow_CurrentMenu->CreateButton(22, 270,
550 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth, 550 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth,
551 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight, 551 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight,
552 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, v1, 0); 552 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0);
553 pGUIWindow_CurrentMenu->CreateButton(93, 270, 553 pGUIWindow_CurrentMenu->CreateButton(93, 270,
554 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth, 554 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth,
555 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight, 555 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight,
556 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, v1, 0); 556 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0);
557 pGUIWindow_CurrentMenu->CreateButton(164, 270, 557 pGUIWindow_CurrentMenu->CreateButton(164, 270,
558 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth, 558 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth,
559 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight, 559 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight,
560 1, 0, UIMSG_SetTurnSpeed, 0, 0, v1, 0); 560 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0);
561 561
562 pGUIWindow_CurrentMenu->CreateButton(20, 303, 562 pGUIWindow_CurrentMenu->CreateButton(20, 303,
563 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth, 563 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth,
564 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight, 564 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight,
565 1, 0, UIMSG_ToggleWalkSound, 0, 0, v1, 0); 565 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0);
566 pGUIWindow_CurrentMenu->CreateButton(128, 303, 566 pGUIWindow_CurrentMenu->CreateButton(128, 303,
567 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth, 567 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth,
568 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight, 568 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight,
569 1, 0, UIMSG_ToggleShowDamage, 0, 0, v1, 0); 569 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0);
570 pGUIWindow_CurrentMenu->CreateButton(20, 325, 570 pGUIWindow_CurrentMenu->CreateButton(20, 325,
571 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth, 571 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth,
572 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight, 572 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight,
573 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, v1, 0); 573 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0);
574 pGUIWindow_CurrentMenu->CreateButton(128, 325, 574 pGUIWindow_CurrentMenu->CreateButton(128, 325,
575 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth, 575 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth,
576 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight, 576 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight,
577 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, v1, 0); 577 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0);
578 578
579 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); 579 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
580 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); 580 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
581 pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, v1, 0); 581 pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0);
582 582
583 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); 583 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
584 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); 584 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
585 pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, v1, 0); 585 pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0);
586 586
587 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); 587 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
588 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); 588 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
589 pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, v1, 0); 589 pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0);
590 590
591 pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game" 591 pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game"
592 pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, v1, 0); 592 pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, "", 0);
593 pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, v1, 0); 593 pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, "", 0);
594 continue; 594 continue;
595 595
596 case UIMSG_OpenKeyMappingOptions://Open 596 case UIMSG_OpenKeyMappingOptions://Open
597 if ( pMessageQueue_50CBD0->uNumMessages ) 597 if ( pMessageQueue_50CBD0->uNumMessages )
598 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 598 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
627 dword_506E68 = -1; 627 dword_506E68 = -1;
628 KeyboardPageNum = 1; 628 KeyboardPageNum = 1;
629 memset(KeyButtonFlagChangesArray, 0, sizeof(KeyButtonFlagChangesArray)); 629 memset(KeyButtonFlagChangesArray, 0, sizeof(KeyButtonFlagChangesArray));
630 //*(_WORD *)KeyButtonArray[28] = 0; 630 //*(_WORD *)KeyButtonArray[28] = 0;
631 memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u); 631 memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
632 v1 = ""; 632 //v1 = "";
633 //v0 = 1; 633 //v0 = 1;
634 continue; 634 continue;
635 case UIMSG_ChangeKeyButton: 635 case UIMSG_ChangeKeyButton:
636 if ( dword_506E68 != -1 ) 636 if ( dword_506E68 != -1 )
637 { 637 {
704 pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); 704 pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
705 uTextureID_507C50 = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE); 705 uTextureID_507C50 = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE);
706 uTextureID_507C54 = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE); 706 uTextureID_507C54 = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE);
707 uTextureID_507C58 = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE); 707 uTextureID_507C58 = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE);
708 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_VideoOptions, 0, 0); 708 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_VideoOptions, 0, 0);
709 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, v1, 0); 709 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0);
710 if ( pRenderer->pRenderD3D ) 710 if ( pRenderer->pRenderD3D )
711 { 711 {
712 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, v1, 0); 712 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, "", 0);
713 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, v1, 0); 713 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0);
714 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, v1, 0); 714 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0);
715 } 715 }
716 if ( !pRenderer->bWindowMode ) 716 if ( !pRenderer->bWindowMode )
717 { 717 {
718 //v0 = 1; 718 //v0 = 1;
719 if ( GammaController::IsGammaSupported() ) 719 if ( GammaController::IsGammaSupported() )
720 { 720 {
721 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, v1, pIcons_LOD->GetTexture(uTextureID_507C20), 0); 721 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C20), 0);
722 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, v1, pIcons_LOD->GetTexture(uTextureID_507C24), 0); 722 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C24), 0);
723 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, v1, 0); 723 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0);
724 } 724 }
725 } 725 }
726 continue; 726 continue;
727 case UIMSG_1A9: 727 case UIMSG_1A9:
728 __debugbreak(); 728 __debugbreak();
2292 if ( v216.uPropCount == 1 ) 2292 if ( v216.uPropCount == 1 )
2293 { 2293 {
2294 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2); 2294 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2);
2295 v70 = atoi(v216.pProperties[0]); 2295 v70 = atoi(v216.pProperties[0]);
2296 if ( v70 <= 0 || v70 >= 77 ) 2296 if ( v70 <= 0 || v70 >= 77 )
2297 {
2298 v1 = "";
2299 continue; 2297 continue;
2300 }
2301 v71 = v70; 2298 v71 = v70;
2302 strcpy(Str2, pMapStats->pInfos[v70].pFilename); 2299 strcpy(Str2, pMapStats->pInfos[v70].pFilename);
2303 pNPCData3 = 0; 2300 pNPCData3 = 0;
2304 if ( (signed int)pNPCData4 > 0 ) 2301 if ( (signed int)pNPCData4 > 0 )
2305 { 2302 {
2316 { 2313 {
2317 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); 2314 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]);
2318 dword_6BE364_game_settings_1 |= 1u; 2315 dword_6BE364_game_settings_1 |= 1u;
2319 uGameState = GAME_STATE_2; 2316 uGameState = GAME_STATE_2;
2320 OnMapLeave(); 2317 OnMapLeave();
2321 v1 = "";
2322 continue; 2318 continue;
2323 } 2319 }
2324 } 2320 }
2325 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName); 2321 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName);
2326 v73 = Str2; 2322 v73 = Str2;
2327 } 2323 }
2328 else 2324 else
2329 { 2325 {
2330 if ( v216.uPropCount != 3 ) 2326 if ( v216.uPropCount != 3 )
2331 {
2332 v1 = "";
2333 continue; 2327 continue;
2334 }
2335 v74 = atoi(v216.pProperties[0]); 2328 v74 = atoi(v216.pProperties[0]);
2336 thisi = atoi(v216.pProperties[1]); 2329 thisi = atoi(v216.pProperties[1]);
2337 v75 = atoi(v216.pProperties[2]); 2330 v75 = atoi(v216.pProperties[2]);
2338 v76 = v75; 2331 v76 = v75;
2339 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) 2332 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
2343 v77 = thisi; 2336 v77 = thisi;
2344 pParty->vPosition.x = v74; 2337 pParty->vPosition.x = v74;
2345 pParty->vPosition.y = v77; 2338 pParty->vPosition.y = v77;
2346 pParty->vPosition.z = v76; 2339 pParty->vPosition.z = v76;
2347 pParty->uFallStartY = v76; 2340 pParty->uFallStartY = v76;
2348 v1 = "";
2349 continue; 2341 continue;
2350 } 2342 }
2351 } 2343 }
2352 else 2344 else
2353 { 2345 {
2362 { 2354 {
2363 pParty->vPosition.x = v74; 2355 pParty->vPosition.x = v74;
2364 pParty->vPosition.y = v77; 2356 pParty->vPosition.y = v77;
2365 pParty->vPosition.z = v76; 2357 pParty->vPosition.z = v76;
2366 pParty->uFallStartY = v76; 2358 pParty->uFallStartY = v76;
2367 v1 = "";
2368 continue; 2359 continue;
2369 } 2360 }
2370 } 2361 }
2371 } 2362 }
2372 } 2363 }
2373 } 2364 }
2374 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2365 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2375 v73 = "Can't jump to that location!"; 2366 v73 = "Can't jump to that location!";
2376 } 2367 }
2377 ShowStatusBarString(v73, 6u); 2368 ShowStatusBarString(v73, 6u);
2378 v1 = "";
2379 continue; 2369 continue;
2380 case UIMSG_CastQuickSpell: 2370 case UIMSG_CastQuickSpell:
2381 if ( bUnderwater == 1 ) 2371 if ( bUnderwater == 1 )
2382 { 2372 {
2383 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" 2373 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
2384 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 2374 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
2385 continue; 2375 continue;
2386 } 2376 }
2387 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) 2377 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) )
2388 {
2389 v1 = "";
2390 continue; 2378 continue;
2391 }
2392 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); 2379 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
2393 continue; 2380 continue;
2394 case UIMSG_CastSpell_Monster_Improvement: 2381 case UIMSG_CastSpell_Monster_Improvement:
2395 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm, 2382 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm,
2396 if ( pRenderer->pRenderD3D ) 2383 if ( pRenderer->pRenderD3D )
2405 } 2392 }
2406 v83 = v81; 2393 v83 = v81;
2407 v44 = (unsigned __int16)v81; 2394 v44 = (unsigned __int16)v81;
2408 v84 = v83 >> 16; 2395 v84 = v83 >> 16;
2409 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) 2396 if ( PID_TYPE(v44) != 3 || v84 >= 5120 )
2410 {
2411 v1 = "";
2412 continue; 2397 continue;
2413 }
2414 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; 2398 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
2415 if ( uMessage == UIMSG_CastSpell_Shoot_Monster ) 2399 if ( uMessage == UIMSG_CastSpell_Shoot_Monster )
2416 { 2400 {
2417 LOBYTE(pSpellInfo->field_8) &= 0xF7; 2401 LOBYTE(pSpellInfo->field_8) &= 0xF7;
2418 } 2402 }
2434 back_to_game(); 2418 back_to_game();
2435 continue; 2419 continue;
2436 case UIMSG_1C: 2420 case UIMSG_1C:
2437 __debugbreak(); 2421 __debugbreak();
2438 if ( !uActiveCharacter || pCurrentScreen ) 2422 if ( !uActiveCharacter || pCurrentScreen )
2439 {
2440 v1 = "";
2441 continue; 2423 continue;
2442 }
2443 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0); 2424 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0);
2444 pCurrentScreen = SCREEN_19; 2425 pCurrentScreen = SCREEN_19;
2445 pEventTimer->Pause(); 2426 pEventTimer->Pause();
2446 continue; 2427 continue;
2447 case UIMSG_1B: 2428 case UIMSG_1B:
2448 __debugbreak(); 2429 __debugbreak();
2449 if ( !uActiveCharacter ) 2430 if ( !uActiveCharacter )
2450 {
2451 v1 = "";
2452 continue; 2431 continue;
2453 }
2454 if ( pParty->bTurnBasedModeOn != 1 ) 2432 if ( pParty->bTurnBasedModeOn != 1 )
2455 { 2433 {
2456 if ( pActors[uMessageParam].uAIState == 5 ) 2434 if ( pActors[uMessageParam].uAIState == 5 )
2457 stru_50C198.LootActor(&pActors[uMessageParam]); 2435 stru_50C198.LootActor(&pActors[uMessageParam]);
2458 else 2436 else
2459 Actor::StealFrom(uMessageParam); 2437 Actor::StealFrom(uMessageParam);
2460 continue; 2438 continue;
2461 } 2439 }
2462 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 ) 2440 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 )
2463 {
2464 v1 = "";
2465 continue; 2441 continue;
2466 }
2467 if ( !(pTurnEngine->field_18 & 2) ) 2442 if ( !(pTurnEngine->field_18 & 2) )
2468 { 2443 {
2469 if ( pActors[uMessageParam].uAIState == 5 ) 2444 if ( pActors[uMessageParam].uAIState == 5 )
2470 stru_50C198.LootActor(&pActors[uMessageParam]); 2445 stru_50C198.LootActor(&pActors[uMessageParam]);
2471 else 2446 else
2473 } 2448 }
2474 continue; 2449 continue;
2475 2450
2476 case UIMSG_Attack: 2451 case UIMSG_Attack:
2477 if ( !uActiveCharacter ) 2452 if ( !uActiveCharacter )
2478 {
2479 v1 = "";
2480 continue; 2453 continue;
2481 }
2482 if ( pParty->bTurnBasedModeOn != 1 ) 2454 if ( pParty->bTurnBasedModeOn != 1 )
2483 { 2455 {
2484 _42ECB5_PlayerAttacksActor(); 2456 _42ECB5_PlayerAttacksActor();
2485 continue; 2457 continue;
2486 } 2458 }
2487 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 ) 2459 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 )
2488 {
2489 v1 = "";
2490 continue; 2460 continue;
2491 }
2492 if ( !(pTurnEngine->field_18 & 2) ) 2461 if ( !(pTurnEngine->field_18 & 2) )
2493 _42ECB5_PlayerAttacksActor(); 2462 _42ECB5_PlayerAttacksActor();
2494 continue; 2463 continue;
2495 case UIMSG_ExitRest: 2464 case UIMSG_ExitRest:
2496 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" 2465 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]);// "Exit Rest"
2549 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" 2518 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
2550 if ( pParty->uFlags & 0x88 ) 2519 if ( pParty->uFlags & 0x88 )
2551 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" 2520 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
2552 ShowStatusBarString(v88, 2); 2521 ShowStatusBarString(v88, 2);
2553 if ( !uActiveCharacter ) 2522 if ( !uActiveCharacter )
2554 {
2555 v1 = "";
2556 continue; 2523 continue;
2557 }
2558 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); 2524 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
2559 continue; 2525 continue;
2560 } 2526 }
2561 if ( pParty->bTurnBasedModeOn == 1 ) 2527 if ( pParty->bTurnBasedModeOn == 1 )
2562 { 2528 {
2576 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" 2542 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
2577 if ( pParty->uFlags & 0x88 ) 2543 if ( pParty->uFlags & 0x88 )
2578 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" 2544 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
2579 ShowStatusBarString(v88, 2u); 2545 ShowStatusBarString(v88, 2u);
2580 if ( !uActiveCharacter ) 2546 if ( !uActiveCharacter )
2581 {
2582 v1 = "";
2583 continue; 2547 continue;
2584 }
2585 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); 2548 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
2586 continue; 2549 continue;
2587 case UIMSG_Rest8Hour: 2550 case UIMSG_Rest8Hour:
2588 if ( dword_506F14 ) 2551 if ( dword_506F14 )
2589 { 2552 {
2940 v121 = 600; 2903 v121 = 600;
2941 } 2904 }
2942 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0, 2905 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0,
2943 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle" 2906 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle"
2944 0); 2907 0);
2945 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, v1, 0); 2908 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0);
2946 viewparams->bRedrawGameUI = 1; 2909 viewparams->bRedrawGameUI = 1;
2947 continue; 2910 continue;
2948 case UIMSG_ClickPaperdoll: 2911 case UIMSG_ClickPaperdoll:
2949 OnPaperdollLeftClick(); 2912 OnPaperdollLeftClick();
2950 continue; 2913 continue;
3662 } 3625 }
3663 3626
3664 //----- (004369DB) -------------------------------------------------------- 3627 //----- (004369DB) --------------------------------------------------------
3665 void Vec3_float_::Normalize() 3628 void Vec3_float_::Normalize()
3666 { 3629 {
3667 Vec3_float_ *v1; // esi@1 3630 this->x = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->x;
3668 double v2; // st7@1 3631 this->y = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->y;
3669 3632 this->z = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->z;
3670 auto a1 = this;
3671 v1 = a1;
3672 v2 = 1.0 / sqrt(a1->x * a1->x + a1->y * a1->y + a1->z * a1->z);
3673 v1->x = v2 * v1->x;
3674 v1->y = v2 * v1->y;
3675 v1->z = v2 * v1->z;
3676 } 3633 }
3677 3634
3678 //----- (004385B5) -------------------------------------------------------- 3635 //----- (004385B5) --------------------------------------------------------
3679 void stru11::CheckCPU() 3636 void stru11::CheckCPU()
3680 { 3637 {
5394 { 5351 {
5395 /* int v7; // ebx@1 5352 /* int v7; // ebx@1
5396 int v8; // ST14_4@1 5353 int v8; // ST14_4@1
5397 int v9; // edi@1 5354 int v9; // edi@1
5398 int anglea; // [sp+20h] [bp+8h]@1 5355 int anglea; // [sp+20h] [bp+8h]@1
5356
5399 v7 = sRotX; 5357 v7 = sRotX;
5400 v8 = sDepth; 5358 v8 = sDepth;
5401 v9 = sRotY; 5359 v9 = sRotY;
5402 anglea = (unsigned __int64)(stru_5C6E00->SinCos(sRotX) * (signed __int64)sDepth) >> 16; 5360 anglea = (unsigned __int64)(stru_5C6E00->SinCos(sRotX) * (signed __int64)sDepth) >> 16;
5403 *outx = v.x + ((unsigned __int64)(stru_5C6E00->SinCos(v9) * (signed __int64)anglea) >> 16); 5361 *outx = v.x + ((unsigned __int64)(stru_5C6E00->SinCos(sRotY) * (signed __int64)anglea) >> 16);
5404 *outy = v.y 5362 *outy = v.y + ((unsigned __int64)(stru_5C6E00->SinCos(sRotY - stru_5C6E00->uIntegerHalfPi) * (signed __int64)anglea) >> 16);
5405 + ((unsigned __int64)(stru_5C6E00->SinCos(v9 - stru_5C6E00->uIntegerHalfPi) 5363 *outz = v.z + ((unsigned __int64)(stru_5C6E00->SinCos(sRotX - stru_5C6E00->uIntegerHalfPi) * (signed __int64)sDepth) >> 16);*/
5406 * (signed __int64)anglea) >> 16);
5407 *outz = v.z
5408 + ((unsigned __int64)(stru_5C6E00->SinCos(v7 - stru_5C6E00->uIntegerHalfPi) * (signed __int64)v8) >> 16);*/
5409 5364
5410 float cosf_x = cosf(3.14159265f * sRotX / 1024.0f), 5365 float cosf_x = cosf(3.14159265f * sRotX / 1024.0f),
5366 sinf_x = sinf(3.14159265f * sRotX / 1024.0f),
5411 cosf_y = cosf(3.14159265f * sRotY / 1024.0f), 5367 cosf_y = cosf(3.14159265f * sRotY / 1024.0f),
5412 sinf_x = sinf(3.14159265f * sRotX / 1024.0f),
5413 sinf_y = sinf(3.14159265f * sRotY / 1024.0f); 5368 sinf_y = sinf(3.14159265f * sRotY / 1024.0f);
5414 5369 sDepth = 14000000;
5415 *outx = v.x + ((unsigned __int64)((double)sDepth * cosf_y * cosf_x) >> 16); 5370 *outx = v.x + ((unsigned __int64)(sinf_y * (signed __int64)((unsigned __int64)(cosf_x * (signed __int64)sDepth)>> 16)));
5416 *outy = v.y + ((unsigned __int64)((double)sDepth * sinf_y * cosf_x) >> 16); 5371 *outy = v.y + ((unsigned __int64)(cosf_y * (signed __int64)((unsigned __int64)(cosf_x * (signed __int64)sDepth)>> 16)));
5417 *outz = v.z + ((unsigned __int64)((double)sDepth * sinf_x) >> 16); 5372 *outz = v.z + ((unsigned __int64)(sinf_x * (signed __int64)sDepth) >> 16);
5418 5373
5419 } 5374 }
5420 5375
5421 //----- (0043AB61) -------------------------------------------------------- 5376 //----- (0043AB61) --------------------------------------------------------
5422 void Vec3_int_::Normalize(int *x, int *y, int *z) 5377 void Vec3_int_::Normalize(int *x, int *y, int *z)
5423 { 5378 {
5424 int *v3; // edi@1 5379 *x *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1);
5425 int *v4; // esi@1 5380 *y *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1);
5426 signed int v5; // eax@1 5381 *z *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1);
5427
5428 v3 = x;
5429 v4 = y;
5430 v5 = integer_sqrt(*y * *y + *z * *z + *x * *x);
5431 *v3 *= 65536 / (v5 | 1);
5432 *v4 *= 65536 / (v5 | 1);
5433 *z *= 65536 / (v5 | 1);
5434 } 5382 }
5435 5383
5436 //----- (0043AE12) -------------------------------------------------------- 5384 //----- (0043AE12) --------------------------------------------------------
5437 double __fastcall sub_43AE12(signed int a1) 5385 double __fastcall sub_43AE12(signed int a1)
5438 { 5386 {