comparison Game.cpp @ 49:25fabc49627b

Слияние
author Ritor1
date Tue, 23 Oct 2012 17:34:20 +0600
parents 8a8dd0164b12
children 0f4ed4f0f472
comparison
equal deleted inserted replaced
48:6a62c4005f0e 49:25fabc49627b
46 } 46 }
47 47
48 //----- (0044103C) -------------------------------------------------------- 48 //----- (0044103C) --------------------------------------------------------
49 void Game::Draw() 49 void Game::Draw()
50 { 50 {
51 Render *v0; // esi@3
52 int _null; // ebx@6
53 float v2; // ST24_4@11 51 float v2; // ST24_4@11
54 //double v3; // ST28_8@11 52 //double v3; // ST28_8@11
55 int v4; // edi@26 53 int v4; // edi@26
56 int v5; // eax@35 54 int v5; // eax@35
57 55
69 * (signed __int64)pParty->field_18) >> 16); 67 * (signed __int64)pParty->field_18) >> 16);
70 pIndoorCamera->pos.z = pParty->vPosition.y + pParty->sEyelevel; 68 pIndoorCamera->pos.z = pParty->vPosition.y + pParty->sEyelevel;
71 pIndoorCamera->Initialize2(); 69 pIndoorCamera->Initialize2();
72 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff(); 70 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff();
73 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum(); 71 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum();
74 //v0 = &pRenderer; 72
75 if ( pVideoPlayer->AnyMovieLoaded() ) 73 if ( pVideoPlayer->AnyMovieLoaded() )
76 { 74 {
77 _null = 0;
78 if ( pRenderer->pRenderD3D ) 75 if ( pRenderer->pRenderD3D )
79 goto LABEL_22; 76 goto LABEL_22;
80 pRenderer->SetGameRenderStates(); 77 pRenderer->BeginSceneD3D();
81 pMouse->_469E3B(); 78 pMouse->DrawCursorToTarget();
82 } 79 }
83 else 80 else
84 { 81 {
85 if ( pParty->vPosition.x != pParty->vPrevPosition.x | pParty->sRotationY != pParty->sPrevRotationY | pParty->vPosition.z != pParty->vPrevPosition.z | pParty->sRotationX != pParty->sPrevRotationX | pParty->vPosition.y != pParty->vPrevPosition.y | pParty->sEyelevel != pParty->sPrevEyelevel ) 82 if ( pParty->vPosition.x != pParty->vPrevPosition.x | pParty->sRotationY != pParty->sPrevRotationY | pParty->vPosition.z != pParty->vPrevPosition.z | pParty->sRotationX != pParty->sPrevRotationX | pParty->vPosition.y != pParty->vPrevPosition.y | pParty->sEyelevel != pParty->sPrevEyelevel )
86 pParty->uFlags |= 2u; 83 pParty->uFlags |= 2u;
89 //v0 = &pRenderer; 86 //v0 = &pRenderer;
90 pParty->sPrevRotationY = pParty->sRotationY; 87 pParty->sPrevRotationY = pParty->sRotationY;
91 pParty->vPrevPosition.z = pParty->vPosition.z; 88 pParty->vPrevPosition.z = pParty->vPosition.z;
92 pParty->sPrevRotationX = pParty->sRotationX; 89 pParty->sPrevRotationX = pParty->sRotationX;
93 pParty->sPrevEyelevel = pParty->sEyelevel; 90 pParty->sPrevEyelevel = pParty->sEyelevel;
94 pRenderer->SetGameRenderStates(); 91 pRenderer->BeginSceneD3D();
95 _null = 0; 92
96 if ( !pRenderer->pRenderD3D ) 93 if ( !pRenderer->pRenderD3D )
97 pMouse->_469E3B(); 94 pMouse->DrawCursorToTarget();
98 if ( !sub_4226C2() || viewparams->field_48 == 1 ) 95 if ( !sub_4226C2() || viewparams->field_48 == 1 )
99 { 96 {
100 if ( pRenderer->pRenderD3D ) 97 if ( pRenderer->pRenderD3D )
101 { 98 {
102 v2 = (double)(((signed int)pMiscTimer->uTotalGameTimeElapsed >> 2) & 0x1F) * 0.032258064 * 6.0; 99 v2 = (double)(((signed int)pMiscTimer->uTotalGameTimeElapsed >> 2) & 0x1F) * 0.032258064 * 6.0;
103 //v3 = v2 + 6.7553994e15; 100 //v3 = v2 + 6.7553994e15;
104 //pRenderer->field_1036A8_bitmapid = LODWORD(v3); 101 //pRenderer->field_1036A8_bitmapid = LODWORD(v3);
105 pRenderer->field_1036A8_bitmapid = floorf(v2 + 0.5f); 102 pRenderer->field_1036A8_bitmapid = floorf(v2 + 0.5f);
106 } 103 }
107 104
108 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) 105 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
109 pIndoor->Draw(); 106 pIndoor->Draw();
110 else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) 107 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
111 pOutdoor->Draw(); 108 pOutdoor->Draw();
112 109
113 if ( pRenderer->pRenderD3D ) 110 if (pRenderer->pRenderD3D)
114 { 111 {
115 pDecalBuilder->DrawBloodsplats(); 112 pDecalBuilder->DrawBloodsplats();
116 if ( pRenderer->pRenderD3D ) 113 if (pRenderer->pRenderD3D)
117 pGame->pLightmapBuilder->DrawLightmaps(2); 114 pGame->pLightmapBuilder->DrawLightmaps(2);
118 } 115 }
119 } 116 }
120 } 117 }
121 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); 118 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
122 LABEL_22: 119 LABEL_22:
123 pRenderer->BeginScene(); 120 pRenderer->BeginScene();
124 if ( pRenderer->pRenderD3D != (RenderD3D *)_null ) 121 if (pRenderer->pRenderD3D)
125 pMouse->_469E3B(); 122 pMouse->DrawCursorToTarget();
126 if ( pOtherOverlayList->field_3EC != _null ) 123 if (pOtherOverlayList->field_3EC)
127 viewparams->bRedrawGameUI = 1; 124 viewparams->bRedrawGameUI = 1;
128 v4 = viewparams->bRedrawGameUI; 125 v4 = viewparams->bRedrawGameUI;
129 GameUI_DrawStatusBar(); 126 GameUI_DrawStatusBar();
130 if ( viewparams->bRedrawGameUI == _null ) 127 if (!viewparams->bRedrawGameUI)
131 { 128 {
132 //nullsub_1();
133 GameUI_DrawRightPanelItems(); 129 GameUI_DrawRightPanelItems();
134 } 130 }
135 else 131 else
136 { 132 {
137 GameUI_DrawRightPanelFrames(); 133 GameUI_DrawRightPanelFrames();
138 GameUI_DrawStatusBar_2(); 134 GameUI_DrawStatusBar_2();
139 viewparams->bRedrawGameUI = _null; 135 viewparams->bRedrawGameUI = false;
140 } 136 }
141 if ( pVideoPlayer->pSmackerMovie == (_SMACK *)_null ) 137 if (!pVideoPlayer->pSmackerMovie)
142 { 138 {
143 GameUI_DrawMinimap(0x1E8u, 0x10u, 0x271u, 0x85u, viewparams->uMinimapZoom, pParty->uFlags & 2); 139 GameUI_DrawMinimap(0x1E8u, 0x10u, 0x271u, 0x85u, viewparams->uMinimapZoom, pParty->uFlags & 2);
144 if ( v4 != _null ) 140 if (v4)
145 { 141 {
146 if ( !sub_4226C2() && pRenderer->pRenderD3D != (RenderD3D *)_null ) 142 if ( !sub_4226C2() && pRenderer->pRenderD3D)
147 pRenderer->FillRect2( 143 pRenderer->FillRect2(
148 _null, 144 0,
149 pViewport->uViewportX, 145 pViewport->uViewportX,
150 pViewport->uViewportY, 146 pViewport->uViewportY,
151 pViewport->uViewportZ - pViewport->uViewportX, 147 pViewport->uViewportZ - pViewport->uViewportX,
152 pViewport->uViewportW - pViewport->uViewportY + 1, 148 pViewport->uViewportW - pViewport->uViewportY + 1,
153 LOWORD(pRenderer->uTargetGMask) | LOWORD(pRenderer->uTargetBMask)); 149 LOWORD(pRenderer->uTargetGMask) | LOWORD(pRenderer->uTargetBMask));
154 viewparams->field_48 = _null; 150 viewparams->field_48 = 0;
155 } 151 }
156 } 152 }
157 v5 = pOtherOverlayList->field_3EC; 153 v5 = pOtherOverlayList->field_3EC;
158 pOtherOverlayList->field_3EC = _null; 154 pOtherOverlayList->field_3EC = 0;
159 viewparams->bRedrawGameUI = v5; 155 viewparams->bRedrawGameUI = v5;
160 GameUI_DrawPartySpells(); 156 GameUI_DrawPartySpells();
161 if ( v4 != _null || pParty->pHirelings[0].evtc != _null || pParty->pHirelings[1].evtc != _null ) 157 if (v4 || pParty->pHirelings[0].evtc || pParty->pHirelings[1].evtc )
162 DrawHiredNPCs(); 158 DrawHiredNPCs();
163 GameUI_DrawPortraits(v4); 159 GameUI_DrawPortraits(v4);
164 GameUI_DrawLifeManaBars(); 160 GameUI_DrawLifeManaBars();
165 GameUI_DrawCharacterSelectionFrame(); 161 GameUI_DrawCharacterSelectionFrame();
166 if ( sub_44100D() ) 162 if ( sub_44100D() )
172 GameUI_DrawTorchlightAndWizardEye(); 168 GameUI_DrawTorchlightAndWizardEye();
173 } 169 }
174 GUI_UpdateWindows(); 170 GUI_UpdateWindows();
175 pParty->_4909F4(); 171 pParty->_4909F4();
176 ++stru_51076C.field_8; 172 ++stru_51076C.field_8;
177 dword_5B5924 = _null; 173 dword_5B5924 = 0;
178 if ( v4 != _null ) 174 if (v4)
179 pMouse->field_14 = 1; 175 pMouse->field_14 = 1;
180 pMouse->_469EA4(); 176 pMouse->_469EA4();
181 pMouse->DrawCursor(); 177 pMouse->DrawCursor();
182 pMouse->_469E1C(); 178 pMouse->_469E1C();
183 pRenderer->EndScene(); 179 pRenderer->EndScene();
184 pRenderer->Present(); 180 pRenderer->Present();
185 pParty->uFlags &= 0xFFFFFFFDu; 181 pParty->uFlags &= 0xFFFFFFFDu;
186 } 182 }
187 // 5B5924: using guessed type int dword_5B5924;
188 183
189 184
190 //----- (0047A815) -------------------------------------------------------- 185 //----- (0047A815) --------------------------------------------------------
191 void Game::DrawParticles() 186 void Game::DrawParticles()
192 { 187 {
291 if (pAsyncMouse) 286 if (pAsyncMouse)
292 pAsyncMouse->_46B736_consume_click_lists(1); 287 pAsyncMouse->_46B736_consume_click_lists(1);
293 if ( pVideoPlayer->pSmackerMovie && !SmackWait(pVideoPlayer->pSmackerMovie) ) 288 if ( pVideoPlayer->pSmackerMovie && !SmackWait(pVideoPlayer->pSmackerMovie) )
294 { 289 {
295 pRenderer->BeginScene(); 290 pRenderer->BeginScene();
296 pMouse->_469E3B(); 291 pMouse->DrawCursorToTarget();
297 pVideoPlayer->SmackUpdatePalette(pVideoPlayer->hWindow); 292 pVideoPlayer->SmackUpdatePalette(pVideoPlayer->hWindow);
298 pMouse->_469EA4(); 293 pMouse->_469EA4();
299 pRenderer->EndScene(); 294 pRenderer->EndScene();
300 } 295 }
301 if ( pVideoPlayer->pBinkMovie && !BinkWait(pVideoPlayer->pBinkMovie) ) 296 if ( pVideoPlayer->pBinkMovie && !BinkWait(pVideoPlayer->pBinkMovie) )
302 { 297 {
303 pRenderer->BeginScene(); 298 pRenderer->BeginScene();
304 pMouse->_469E3B(); 299 pMouse->DrawCursorToTarget();
305 pVideoPlayer->BinkUpdatePalette(pVideoPlayer->hWindow); 300 pVideoPlayer->BinkUpdatePalette(pVideoPlayer->hWindow);
306 pMouse->_469EA4(); 301 pMouse->_469EA4();
307 pRenderer->EndScene(); 302 pRenderer->EndScene();
308 } 303 }
309 pEventTimer->Update(); 304 pEventTimer->Update();
493 488
494 489
495 490
496 491
497 //----- (0044F192) -------------------------------------------------------- 492 //----- (0044F192) --------------------------------------------------------
498 void Game::PushStru165s() 493 void Game::PrepareBloodsplats()
499 { 494 {
500 Game *v1; // edi@1 495 for (uint i = 0; i < uNumBloodsplats; ++i)
501 int v2; // ebx@1 496 {
502 float *v3; // esi@2 497 pBloodsplatContainer->AddBloodsplat(
503 498 pBloodsplats[i].x,
504 auto a1 = this; 499 pBloodsplats[i].y,
505 v1 = a1; 500 pBloodsplats[i].z,
506 v2 = 0; 501 pBloodsplats[i].radius,
507 if ( a1->array_708_size > 0 ) 502 pBloodsplats[i].r,
508 { 503 pBloodsplats[i].g,
509 v3 = &a1->array_708[0].flt_10; 504 pBloodsplats[i].b);
510 do 505 }
511 {
512 pBloodsplatContainer->AddBloodsplat(
513 *(v3 - 4),
514 *(v3 - 3),
515 *(v3 - 2),
516 v3[2],
517 (signed __int64)*(v3 - 1),
518 (signed __int64)*v3,
519 (signed __int64)v3[1]);
520 ++v2;
521 v3 += 7;
522 }
523 while ( v2 < v1->array_708_size );
524 }
525 } 506 }
526 507
527 508
528 //----- (0044F120) -------------------------------------------------------- 509 //----- (0044F120) --------------------------------------------------------
529 void Game::PushStationaryLights(int a2) 510 void Game::PushStationaryLights(int a2)
560 { 541 {
561 ToggleFlags(0x40u); 542 ToggleFlags(0x40u);
562 543
563 if ( !(uFlags & 0x40) ) 544 if ( !(uFlags & 0x40) )
564 { 545 {
565 array_708_size = 0; 546 uNumBloodsplats = 0;
566 field_E0C = 0; 547 field_E0C = 0;
567 } 548 }
568 } 549 }
569 550
570 //----- (0044F0D8) -------------------------------------------------------- 551 //----- (0044F0D8) --------------------------------------------------------
591 } 572 }
592 573
593 //----- (0044EEA7) -------------------------------------------------------- 574 //----- (0044EEA7) --------------------------------------------------------
594 bool Game::_44EEA7() 575 bool Game::_44EEA7()
595 { 576 {
596 Game *v1; // esi@1 577 //Game *v1; // esi@1
597 double v2; // st7@2 578 double v2; // st7@2
598 float depth; // ST00_4@9 579 float depth; // ST00_4@9
599 bool result; // eax@9 580 bool result; // eax@9
600 unsigned int v5; // eax@14 581 unsigned int v5; // eax@14
601 __int64 v6; // kr00_8@21 582 __int64 v6; // kr00_8@21
604 bool v9; // [sp+Ch] [bp-1Ch]@2 585 bool v9; // [sp+Ch] [bp-1Ch]@2
605 stru157 *v10; // [sp+10h] [bp-18h]@2 586 stru157 *v10; // [sp+10h] [bp-18h]@2
606 stru157 *v11; // [sp+14h] [bp-14h]@2 587 stru157 *v11; // [sp+14h] [bp-14h]@2
607 POINT a2; // [sp+20h] [bp-8h]@1 588 POINT a2; // [sp+20h] [bp-8h]@1
608 589
609 v1 = this; 590 //v1 = this;
610 ++qword_5C6DF0; 591 ++qword_5C6DF0;
611 pParticleEngine->UpdateParticles(); 592 pParticleEngine->UpdateParticles();
612 pMouseInstance->GetCursorPos(&a2); 593 pMouseInstance->GetCursorPos(&a2);
613 if ( sub_4637E0_is_there_popup_onscreen() ) 594 if ( sub_4637E0_is_there_popup_onscreen() )
614 { 595 {
619 y = a2.x; 600 y = a2.x;
620 v2 = GetPickDepth(); 601 v2 = GetPickDepth();
621 } 602 }
622 else 603 else
623 { 604 {
624 if ( v1->uFlags2 & 0x10 ) 605 if ( uFlags2 & 0x10 )
625 { 606 {
626 v11 = &a5; 607 v11 = &a5;
627 v10 = &stru_F93E1C; 608 v10 = &stru_F93E1C;
628 } 609 }
629 else 610 else
648 y = a2.x; 629 y = a2.x;
649 } 630 }
650 depth = v2; 631 depth = v2;
651 632
652 PickMouse(depth, y, x, v9, v10, v11); 633 PickMouse(depth, y, x, v9, v10, v11);
653 v1->pLightmapBuilder->std__vector_000004_size = 0; 634 pLightmapBuilder->std__vector_000004_size = 0;
654 v1->pLightmapBuilder->std__vector_183808_size = 0; 635 pLightmapBuilder->std__vector_183808_size = 0;
655 pDecalBuilder->std__vector_pDecals_size = 0; 636 pDecalBuilder->std__vector_pDecals_size = 0;
656 pDecalBuilder->field_308008 = 0; 637 pDecalBuilder->field_308008 = 0;
657 result = _44F07B(); 638 result = _44F07B();
658 if ( result ) 639 if ( result )
659 { 640 {
660 if ( uFlags & 8 ) 641 if ( uFlags & 8 )
661 LOBYTE(pStru10Instance->field_4) = 0; 642 LOBYTE(pStru10Instance->field_4) = 0;
662 if ( pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor) 643 if ( pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor)
663 { 644 {
664 v5 = GetLevelFogColor(); 645 v5 = GetLevelFogColor();
665 LODWORD(pRenderer->uFogColor) = v5 & 0xFFFFFF; 646 pRenderer->uFogColor = v5 & 0xFFFFFF;
666 } 647 }
667 if (uFlags & 0x0400) 648 if (uFlags & 0x0400)
668 uFlags2 |= 0x01; 649 uFlags2 |= 0x01;
669 if ( !pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor && uNumMobileLightsApplied ) 650 if ( !pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor && uNumMobileLightsApplied )
670 { 651 {
671 uFlags2 |= 0x01; 652 uFlags2 |= 0x01;
672 field_E10 = qword_5C6DF0; 653 field_E10 = qword_5C6DF0;
673 } 654 }
674 v6 = qword_5C6DF0 - v1->field_E10; 655 v6 = qword_5C6DF0 - field_E10;
675 if ( qword_5C6DF0 - v1->field_E10 == 1 ) 656 if ( qword_5C6DF0 - field_E10 == 1 )
676 v1->uFlags2 |= v6; 657 uFlags2 |= v6;
677 if ( v1->uNumStationaryLights_in_pStationaryLightsStack != uNumStationaryLightsApplied ) 658 if (uNumStationaryLights_in_pStationaryLightsStack != uNumStationaryLightsApplied )
678 { 659 {
679 v1->uFlags2 |= 1u; 660 uFlags2 |= 1u;
680 v1->uNumStationaryLights_in_pStationaryLightsStack = uNumStationaryLightsApplied; 661 uNumStationaryLights_in_pStationaryLightsStack = uNumStationaryLightsApplied;
681 } 662 }
682 _44E904(); 663 _44E904();
683 LOBYTE(result) = 1; 664 LOBYTE(result) = 1;
684 } 665 }
685 return result; 666 return result;
686 } 667 }
687 // 519AB4: using guessed type int uNumStationaryLightsApplied; 668
688 // 5C6DEC: using guessed type char static_sub_44EEA7_byte_5C6DEC__init_flag;
689 // 5C6DF0: using guessed type __int64 qword_5C6DF0;
690 // F93E1C: using guessed type stru157 stru_F93E1C;
691 // F93E30: using guessed type stru157 stru_F93E30;
692 669
693 //----- (0044EDE4) -------------------------------------------------------- 670 //----- (0044EDE4) --------------------------------------------------------
694 bool Game::_44EDE4(BLVFace *pFace, int *a3) 671 bool Game::_44EDE4(BLVFace *pFace, int *a3)
695 { 672 {
696 bool result; // eax@1 673 bool result; // eax@1
911 888
912 //----- (0044E4B7) -------------------------------------------------------- 889 //----- (0044E4B7) --------------------------------------------------------
913 Game::Game() 890 Game::Game()
914 { 891 {
915 uNumStationaryLights = 0; 892 uNumStationaryLights = 0;
916 array_708_size = 0; 893 uNumBloodsplats = 0;
917 field_E0C = 0; 894 field_E0C = 0;
918 field_E10 = 0; 895 field_E10 = 0;
919 uNumStationaryLights_in_pStationaryLightsStack = 0; 896 uNumStationaryLights_in_pStationaryLightsStack = 0;
920 bGammaControlInitialized = false; 897 bGammaControlInitialized = false;
921 uFlags = 0; 898 uFlags = 0;
923 uSomeGammaStartTime = 0; 900 uSomeGammaStartTime = 0;
924 uSomeGammaDeltaTime = 0; 901 uSomeGammaDeltaTime = 0;
925 902
926 pThreadWardInstance = new ThreadWard; 903 pThreadWardInstance = new ThreadWard;
927 pParticleEngine = new ParticleEngine; 904 pParticleEngine = new ParticleEngine;
928 pMouseInstance = new Mouse(pThreadWardInstance); 905 pMouse = pMouseInstance = new Mouse(pThreadWardInstance);
929 pLightmapBuilder = new LightmapBuilder; 906 pLightmapBuilder = new LightmapBuilder;
930 pVisInstance = new Vis; 907 pVisInstance = new Vis;
931 pStru6Instance = new stru6; 908 pStru6Instance = new stru6;
932 pIndoorCameraD3D = new IndoorCameraD3D; 909 pIndoorCameraD3D = new IndoorCameraD3D;
933 pStru9Instance = new stru9; 910 pStru9Instance = new stru9;
983 } 960 }
984 961
985 //----- (0044E904) -------------------------------------------------------- 962 //----- (0044E904) --------------------------------------------------------
986 void Game::_44E904() 963 void Game::_44E904()
987 { 964 {
988 Game *v1; // esi@1 965 //Game *v1; // esi@1
989 unsigned __int64 v2; // qax@1 966 unsigned __int64 v2; // qax@1
990 unsigned int v3; // ecx@1 967 unsigned int v3; // ecx@1
991 int v4; // edi@1 968 int v4; // edi@1
992 unsigned __int8 v5; // cf@7 969 unsigned __int8 v5; // cf@7
993 double v6; // st7@13 970 double v6; // st7@13
994 double v7; // st7@15 971 double v7; // st7@15
995 signed __int64 v8; // [sp+Ch] [bp-8h]@1 972 signed __int64 v8; // [sp+Ch] [bp-8h]@1
996 973
997 v1 = this; 974 //v1 = this;
998 v2 = pEventTimer->Time(); 975 v2 = pEventTimer->Time();
999 v4 = (v2 - v1->uSomeGammaStartTime) >> 32; 976 v4 = (v2 - uSomeGammaStartTime) >> 32;
1000 v3 = v2 - LODWORD(v1->uSomeGammaStartTime); 977 v3 = v2 - LODWORD(uSomeGammaStartTime);
1001 v8 = v2 - v1->uSomeGammaStartTime; 978 v8 = v2 - uSomeGammaStartTime;
1002 if ( v4 < 0 979 if ( v4 < 0
1003 || SHIDWORD(v2) < ((unsigned int)v2 < LODWORD(v1->uSomeGammaStartTime)) + HIDWORD(v1->uSomeGammaStartTime) | v4 == 0 980 || SHIDWORD(v2) < ((unsigned int)v2 < LODWORD(uSomeGammaStartTime)) + HIDWORD(uSomeGammaStartTime) | v4 == 0
1004 && v3 <= 0x80 ) 981 && v3 <= 0x80 )
1005 { 982 {
1006 if ( v4 > 0 || v4 >= 0 ) 983 if ( v4 > 0 || v4 >= 0 )
1007 goto LABEL_12; 984 goto LABEL_12;
1008 v3 = 0; 985 v3 = 0;
1009 v4 = 0; 986 v4 = 0;
1010 } 987 }
1011 else 988 else
1012 { 989 {
1013 if ( v1->uSomeGammaDeltaTime ) 990 if ( uSomeGammaDeltaTime )
1014 { 991 {
1015 LODWORD(v1->uSomeGammaDeltaTime) = 0; 992 LODWORD(uSomeGammaDeltaTime) = 0;
1016 HIDWORD(v1->uSomeGammaDeltaTime) = 0; 993 HIDWORD(uSomeGammaDeltaTime) = 0;
1017 } 994 }
1018 else 995 else
1019 { 996 {
1020 LODWORD(v1->uSomeGammaDeltaTime) = v3; 997 LODWORD(uSomeGammaDeltaTime) = v3;
1021 HIDWORD(v1->uSomeGammaDeltaTime) = v4; 998 HIDWORD(uSomeGammaDeltaTime) = v4;
1022 } 999 }
1023 v5 = __CFADD__(v3, -128); 1000 v5 = __CFADD__(v3, -128);
1024 v3 -= 128; 1001 v3 -= 128;
1025 v4 = v5 + v4 - 1; 1002 v4 = v5 + v4 - 1;
1026 } 1003 }
1027 v1->uSomeGammaStartTime = v2; 1004 uSomeGammaStartTime = v2;
1028 v8 = __PAIR__(v4, v3); 1005 v8 = __PAIR__(v4, v3);
1029 LABEL_12: 1006 LABEL_12:
1030 if ( v1->uSomeGammaDeltaTime ) 1007 if ( uSomeGammaDeltaTime )
1031 v6 = (double)(signed __int64)(v1->uSomeGammaDeltaTime - __PAIR__(v4, v3)); 1008 v6 = (double)(signed __int64)(uSomeGammaDeltaTime - __PAIR__(v4, v3));
1032 else 1009 else
1033 v6 = (double)v8; 1010 v6 = (double)v8;
1034 v7 = v6 * 0.0078125; 1011 v7 = v6 * 0.0078125;
1035 if ( v7 < 0.0 || v7 <= 1.0 ) 1012 if ( v7 < 0.0 || v7 <= 1.0 )
1036 { 1013 {
1040 else 1017 else
1041 { 1018 {
1042 v7 = 1.0; 1019 v7 = 1.0;
1043 } 1020 }
1044 if ( pRenderer->pRenderD3D ) 1021 if ( pRenderer->pRenderD3D )
1045 v1->_E28_timed_gamma_strength = v7; 1022 _E28_timed_gamma_strength = v7;
1046 else 1023 else
1047 v1->_E28_timed_gamma_strength = (1.0 - 0.5) * v7 + 0.5; 1024 _E28_timed_gamma_strength = (1.0 - 0.5) * v7 + 0.5;
1048 } 1025 }
1049 1026
1050 //----- (0044EA17) -------------------------------------------------------- 1027 //----- (0044EA17) --------------------------------------------------------
1051 bool Game::InitializeGammaController() 1028 bool Game::InitializeGammaController()
1052 { 1029 {