Mercurial > mm7
comparison mm7_5.cpp @ 948:5a2dbb00c399
Code cleaning.
author | Nomad |
---|---|
date | Wed, 01 May 2013 17:31:10 +0200 |
parents | 016e3577865c |
children | c0d0656aa662 |
comparison
equal
deleted
inserted
replaced
947:99aa9c8464cf | 948:5a2dbb00c399 |
---|---|
527 if ( pMessageQueue_50CBD0->uNumMessages ) | 527 if ( pMessageQueue_50CBD0->uNumMessages ) |
528 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 528 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
529 pGUIWindow_CurrentMenu->Release(); | 529 pGUIWindow_CurrentMenu->Release(); |
530 viewparams->field_48 = v0; | 530 viewparams->field_48 = v0; |
531 pCurrentScreen = SCREEN_OPTIONS; | 531 pCurrentScreen = SCREEN_OPTIONS; |
532 uTextureID_ControlBG[0] = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE); | 532 |
533 uTextureID_ControlBG[3] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE); | 533 options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE); |
534 uTextureID_ControlBG[2] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE); | 534 options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE); |
535 uTextureID_ControlBG[4] = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); | 535 options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE); |
536 uTextureID_ControlBG[5] = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); | 536 options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE); |
537 uTextureID_ControlBG[1] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE); | 537 options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); |
538 uTextureID_ControlBG[19] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); | 538 options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); |
539 uTextureID_ControlBG[10] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); | 539 options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); |
540 uTextureID_ControlBG[11] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); | 540 options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); |
541 uTextureID_ControlBG[12] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); | 541 options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); |
542 uTextureID_ControlBG[13] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); | 542 options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); |
543 uTextureID_ControlBG[14] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); | 543 options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); |
544 uTextureID_ControlBG[15] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); | 544 options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); |
545 uTextureID_ControlBG[16] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); | 545 options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); |
546 uTextureID_ControlBG[17] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); | 546 options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); |
547 uTextureID_ControlBG[18] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); | 547 options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); |
548 uTextureID_ControlBG[9] = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE); | 548 options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); |
549 uTextureID_ControlBG[20] = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE); | 549 options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE); |
550 uTextureID_ControlBG[22] = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE); | 550 options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE); |
551 uTextureID_ControlBG[21] = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE); | 551 options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE); |
552 options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE); | |
553 | |
552 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0); | 554 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0); |
553 pGUIWindow_CurrentMenu->CreateButton(22, 270, | 555 pGUIWindow_CurrentMenu->CreateButton(22, 270, |
554 pIcons_LOD->GetTexture(uTextureID_ControlBG[3])->uTextureWidth, | 556 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth, |
555 pIcons_LOD->GetTexture(uTextureID_ControlBG[3])->uTextureHeight, | 557 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight, |
556 v0, 0, | 558 v0, 0, UIMSG_SetTurnSpeed, 0x80, 0, v1, 0); |
557 UIMSG_SetTurnSpeed, 0x80, | 559 pGUIWindow_CurrentMenu->CreateButton(93, 270, |
558 0, v1, 0); | 560 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth, |
559 pGUIWindow_CurrentMenu->CreateButton(0x5Du, 270, | 561 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight, |
560 pIcons_LOD->GetTexture(uTextureID_ControlBG[2])->uTextureWidth, | |
561 pIcons_LOD->GetTexture(uTextureID_ControlBG[2])->uTextureHeight, | |
562 v0, 0, UIMSG_SetTurnSpeed, 0x40u, 0, v1, 0); | 562 v0, 0, UIMSG_SetTurnSpeed, 0x40u, 0, v1, 0); |
563 pGUIWindow_CurrentMenu->CreateButton(0xA4u, 270, | 563 pGUIWindow_CurrentMenu->CreateButton(164, 270, |
564 pIcons_LOD->GetTexture(uTextureID_ControlBG[1])->uTextureWidth, | 564 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth, |
565 pIcons_LOD->GetTexture(uTextureID_ControlBG[1])->uTextureHeight, | 565 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight, |
566 v0, 0, UIMSG_SetTurnSpeed, 0, 0, v1, 0); | 566 v0, 0, UIMSG_SetTurnSpeed, 0, 0, v1, 0); |
567 pGUIWindow_CurrentMenu->CreateButton(0x14u, 0x12Fu, | 567 |
568 pIcons_LOD->GetTexture(uTextureID_ControlBG[21])->uTextureWidth, | 568 pGUIWindow_CurrentMenu->CreateButton(20, 303, |
569 pIcons_LOD->GetTexture(uTextureID_ControlBG[21])->uTextureHeight, | 569 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth, |
570 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight, | |
570 v0, 0, UIMSG_ToggleWalkSound, 0, 0, v1, 0); | 571 v0, 0, UIMSG_ToggleWalkSound, 0, 0, v1, 0); |
571 pGUIWindow_CurrentMenu->CreateButton(0x80u, 0x12Fu, | 572 pGUIWindow_CurrentMenu->CreateButton(128, 303, |
572 (uTextureID_ControlBG[22] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[22]].uTextureWidth : 24), | 573 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth, |
573 (uTextureID_ControlBG[22] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[22]].uTextureHeight : 26), | 574 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight, |
574 v0, 0, UIMSG_ToggleShowDamage, 0, 0, v1, 0); | 575 v0, 0, UIMSG_ToggleShowDamage, 0, 0, v1, 0); |
575 pGUIWindow_CurrentMenu->CreateButton(0x14u, 0x145u, | 576 pGUIWindow_CurrentMenu->CreateButton(20, 325, |
576 (uTextureID_ControlBG[20] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[20]].uTextureWidth : 24), | 577 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth, |
577 (uTextureID_ControlBG[20] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[20]].uTextureHeight : 26), | 578 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight, |
578 v0, 0, UIMSG_ToggleAlwaysRun, 0, 0, v1, 0); | 579 v0, 0, UIMSG_ToggleAlwaysRun, 0, 0, v1, 0); |
579 pGUIWindow_CurrentMenu->CreateButton(0x80u, 0x145u, | 580 pGUIWindow_CurrentMenu->CreateButton(128, 325, |
580 (uTextureID_ControlBG[9] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[9]].uTextureWidth : 24), | 581 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth, |
581 (uTextureID_ControlBG[9] != -1 ? pIcons_LOD->pTextures[uTextureID_ControlBG[9]].uTextureHeight : 26), | 582 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight, |
582 v0, 0, UIMSG_ToggleFlipOnExit, 0, 0, v1, 0); | 583 v0, 0, UIMSG_ToggleFlipOnExit, 0, 0, v1, 0); |
583 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, v0, 0, UIMSG_ChangeSoundVolume, 4, 0, v1, | 584 |
584 &pIcons_LOD->pTextures[uTextureID_ControlBG[4]], 0); | 585 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, v0, 0, UIMSG_ChangeSoundVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); |
585 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0xA2u, 0x10u, 0x10u, v0, 0, UIMSG_ChangeSoundVolume, 5, 0, v1, | 586 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 162, 16, 16, v0, 0, UIMSG_ChangeSoundVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); |
586 &pIcons_LOD->pTextures[uTextureID_ControlBG[5]], 0); | 587 pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, v0, 0, UIMSG_ChangeSoundVolume, 0, 0, v1, 0); |
587 pGUIWindow_CurrentMenu->CreateButton(0x107u, 0xA2u, 0xACu, 0x11u, v0, 0, UIMSG_ChangeSoundVolume, 0, 0, v1, 0); | 588 |
588 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0xF3u, 0xD8u, 0x10u, 0x10u, v0, 0, UIMSG_ChangeMusicVolume, 4, 0, v1, | 589 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 216, 16, 16, v0, 0, UIMSG_ChangeMusicVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); |
589 &pIcons_LOD->pTextures[uTextureID_ControlBG[4]], 0); | 590 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 216, 16, 16, v0, 0, UIMSG_ChangeMusicVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); |
590 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0xD8u, 0x10u, 0x10u, v0, 0, UIMSG_ChangeMusicVolume, 5, 0, v1, | 591 pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, v0, 0, UIMSG_ChangeMusicVolume, 0, 0, v1, 0); |
591 &pIcons_LOD->pTextures[uTextureID_ControlBG[5]], 0); | 592 |
592 pGUIWindow_CurrentMenu->CreateButton(0x107u, 0xD8u, 0xACu, 0x11u, v0, 0, UIMSG_ChangeMusicVolume, 0, 0, v1, 0); | 593 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 270, 16, 16, v0, 0, UIMSG_ChangeVoiceVolume, 4, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); |
593 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0xF3u, 0x10Eu, 0x10u, 0x10u, v0, 0, UIMSG_ChangeVoiceVolume, 4, 0, v1, | 594 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 270, 16, 16, v0, 0, UIMSG_ChangeVoiceVolume, 5, 0, v1, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); |
594 &pIcons_LOD->pTextures[uTextureID_ControlBG[4]], 0); | 595 pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, v0, 0, UIMSG_ChangeVoiceVolume, 0, 0, v1, 0); |
595 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0x10Eu, 0x10u, 0x10u, v0, 0, UIMSG_ChangeVoiceVolume, 5u, 0, v1, | 596 |
596 &pIcons_LOD->pTextures[uTextureID_ControlBG[5]], 0); | 597 pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, v0, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game" |
597 pGUIWindow_CurrentMenu->CreateButton(0x107u, 0x10Eu, 0xACu, 0x11u, v0, 0, UIMSG_ChangeVoiceVolume, 0, 0, v1, 0); | 598 pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, v0, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, v1, 0); |
598 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, v0, 0, UIMSG_Escape, 0, 0, | 599 pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, v0, 0, UIMSG_OpenVideoOptions, 0, 86, v1, 0); |
599 pGlobalTXT_LocalizationStrings[619],// "Return to Game" | |
600 0); | |
601 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x8Cu, 0xD6u, 0x28u, v0, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, v1, 0); | |
602 pGUIWindow_CurrentMenu->CreateButton(19, 194, 214, 40, v0, 0, UIMSG_OpenVideoOptions, 0, 86, v1, 0); | |
603 continue; | 600 continue; |
601 | |
604 case UIMSG_OpenKeyMappingOptions://Open | 602 case UIMSG_OpenKeyMappingOptions://Open |
605 if ( pMessageQueue_50CBD0->uNumMessages ) | 603 if ( pMessageQueue_50CBD0->uNumMessages ) |
606 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 604 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
607 pGUIWindow_CurrentMenu->Release(); | 605 pGUIWindow_CurrentMenu->Release(); |
608 viewparams->field_48 = 1; | 606 viewparams->field_48 = 1; |
1124 pCurrentScreen = SCREEN_GAME; | 1122 pCurrentScreen = SCREEN_GAME; |
1125 viewparams->bRedrawGameUI = v0; | 1123 viewparams->bRedrawGameUI = v0; |
1126 pEventTimer->Resume(); | 1124 pEventTimer->Resume(); |
1127 continue; | 1125 continue; |
1128 case SCREEN_OPTIONS://Close | 1126 case SCREEN_OPTIONS://Close |
1129 thisa = (signed int)&uTextureID_ControlBG; | 1127 options_menu_skin.Relaease(); |
1130 do | 1128 |
1131 { | |
1132 if ( *(int *)thisa ) | |
1133 pIcons_LOD->pTextures[*(int *)thisa].Release(); | |
1134 thisa += 4; | |
1135 } | |
1136 while ( thisa < (signed int)&dword_507CBC ); | |
1137 memset(&uTextureID_ControlBG, 0, 0x5Cu); | |
1138 pIcons_LOD->_40F9C5(); | 1129 pIcons_LOD->_40F9C5(); |
1139 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier); | 1130 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier); |
1140 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier); | 1131 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier); |
1141 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier); | 1132 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier); |
1142 WriteWindowsRegistryInt("WalkSound", bWalkSound); | 1133 WriteWindowsRegistryInt("WalkSound", bWalkSound); |
10484 DrawGameOptions(); | 10475 DrawGameOptions(); |
10485 break; | 10476 break; |
10486 } | 10477 } |
10487 case WINDOW_Book: | 10478 case WINDOW_Book: |
10488 { | 10479 { |
10489 SellectDrawBook((unsigned int)pWindow->ptr_1C); | 10480 DrawCurrentBook((unsigned int)pWindow->ptr_1C); |
10490 break; | 10481 break; |
10491 } | 10482 } |
10492 case WINDOW_QuickReference: | 10483 case WINDOW_QuickReference: |
10493 { | 10484 { |
10494 QuickRefDraw(); | 10485 QuickRefDraw(); |