comparison Game.cpp @ 1449:27b7ee003c7c

Merge
author Gloval
date Tue, 06 Aug 2013 00:56:33 +0400
parents 5a5d0c713d47 4fff79f04dbd
children 7ef4b64f6329
comparison
equal deleted inserted replaced
1448:5a5d0c713d47 1449:27b7ee003c7c
14 #include "CShow.h" 14 #include "CShow.h"
15 #include "GammaControl.h" 15 #include "GammaControl.h"
16 #include "stru6.h" 16 #include "stru6.h"
17 #include "stru9.h" 17 #include "stru9.h"
18 #include "stru10.h" 18 #include "stru10.h"
19 #include "stru11.h"
20 #include "stru12.h"
21 19
22 #include "Game.h" 20 #include "Game.h"
23 #include "Party.h" 21 #include "Party.h"
24 #include "IndoorCamera.h" 22 #include "IndoorCamera.h"
25 #include "Viewport.h" 23 #include "Viewport.h"
89 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff(); 87 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff();
90 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum(); 88 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum();
91 89
92 if ( pVideoPlayer->AnyMovieLoaded() ) 90 if ( pVideoPlayer->AnyMovieLoaded() )
93 { 91 {
94 if ( pRenderer->pRenderD3D ) 92 if ( !pRenderer->pRenderD3D )
95 goto LABEL_22; 93 {
96 pRenderer->BeginSceneD3D(); 94 pRenderer->BeginSceneD3D();
97 pMouse->DrawCursorToTarget(); 95 pMouse->DrawCursorToTarget();
96 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
97 }
98 } 98 }
99 else 99 else
100 { 100 {
101 if ( pParty->vPosition.x != pParty->vPrevPosition.x || pParty->sRotationY != pParty->sPrevRotationY || pParty->vPosition.y != pParty->vPrevPosition.y 101 if ( pParty->vPosition.x != pParty->vPrevPosition.x || pParty->sRotationY != pParty->sPrevRotationY || pParty->vPosition.y != pParty->vPrevPosition.y
102 || pParty->sRotationX != pParty->sPrevRotationX || pParty->vPosition.z != pParty->vPrevPosition.z || pParty->sEyelevel != pParty->sPrevEyelevel ) 102 || pParty->sRotationX != pParty->sPrevRotationX || pParty->vPosition.z != pParty->vPrevPosition.z || pParty->sEyelevel != pParty->sPrevEyelevel )
130 else assert(false); 130 else assert(false);
131 131
132 if (pRenderer->pRenderD3D) 132 if (pRenderer->pRenderD3D)
133 { 133 {
134 pDecalBuilder->DrawBloodsplats(); 134 pDecalBuilder->DrawBloodsplats();
135 pGame->pLightmapBuilder->DrawLightmaps(2); 135 pGame->pLightmapBuilder->DrawLightmapsType(2);
136 } 136 }
137 } 137 }
138 } 138 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
139 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); 139 }
140 LABEL_22:
141 140
142 //DEBUG: force redraw gui 141 //DEBUG: force redraw gui
143 viewparams->bRedrawGameUI = true; 142 viewparams->bRedrawGameUI = true;
144 143
145 144
785 } 784 }
786 return true; 785 return true;
787 } 786 }
788 787
789 //----- (0044EC23) -------------------------------------------------------- 788 //----- (0044EC23) --------------------------------------------------------
790 int Game::_44EC23(stru148 *a2, int *a3, signed int a4) 789 int Game::_44EC23(struct Polygon *a2, int *a3, signed int a4)
791 { 790 {
792 double v4; // st7@4 791 double v4; // st7@4
793 //double v5; // ST00_8@4 792 //double v5; // ST00_8@4
794 signed int v6; // eax@5 793 signed int v6; // eax@5
795 //double v7; // ST00_8@6 794 //double v7; // ST00_8@6
941 uFlags = 0; 940 uFlags = 0;
942 uFlags2 = 0; 941 uFlags2 = 0;
943 uSomeGammaStartTime = 0; 942 uSomeGammaStartTime = 0;
944 uSomeGammaDeltaTime = 0; 943 uSomeGammaDeltaTime = 0;
945 944
946 pThreadWardInstance = new ThreadWard; 945 //pThreadWardInstance = new ThreadWard;
946 pThreadWardInstance = nullptr;
947 pParticleEngine = new ParticleEngine; 947 pParticleEngine = new ParticleEngine;
948 pMouse = pMouseInstance = new Mouse(pThreadWardInstance); 948 pMouse = pMouseInstance = new Mouse(pThreadWardInstance);
949 pLightmapBuilder = new LightmapBuilder; 949 pLightmapBuilder = new LightmapBuilder;
950 pVisInstance = new Vis; 950 pVisInstance = new Vis;
951 pStru6Instance = new stru6; 951 pStru6Instance = new stru6;
952 pIndoorCameraD3D = new IndoorCameraD3D; 952 pIndoorCameraD3D = new IndoorCameraD3D;
953 pStru9Instance = new stru9; 953 pStru9Instance = new stru9;
954 pStru10Instance = new stru10; 954 pStru10Instance = new stru10;
955 pStru11Instance = new stru11; 955 //pStru11Instance = new stru11;
956 pStru12Instance = new stru12(pStru11Instance); 956 pStru11Instance = nullptr;
957 pCShow = new CShow; 957 //pStru12Instance = new stru12(pStru11Instance);
958 pStru12Instance = nullptr;
959 //pCShow = new CShow;
960 pCShow = nullptr;
958 pKeyboardInstance = new Keyboard; 961 pKeyboardInstance = new Keyboard;
959 pGammaController = new GammaController; 962 pGammaController = new GammaController;
960 963
961 uFlags |= 0x0800; 964 uFlags |= 0x0800;
962 uFlags2 |= 0x24; 965 uFlags2 |= 0x24;
974 { 977 {
975 if (pGammaController) 978 if (pGammaController)
976 delete pGammaController; 979 delete pGammaController;
977 if (pKeyboardInstance) 980 if (pKeyboardInstance)
978 delete pKeyboardInstance; 981 delete pKeyboardInstance;
979 if (pCShow) 982 /*if (pCShow)
980 delete pCShow; 983 delete pCShow;
981 if (pStru12Instance) 984 if (pStru12Instance)
982 delete pStru12Instance; 985 delete pStru12Instance;
983 if (pStru11Instance) 986 if (pStru11Instance)
984 delete pStru11Instance; 987 delete pStru11Instance;*/
985 if (pStru10Instance) 988 if (pStru10Instance)
986 delete pStru10Instance; 989 delete pStru10Instance;
987 if (pStru9Instance) 990 if (pStru9Instance)
988 delete pStru9Instance; 991 delete pStru9Instance;
989 if (pIndoorCameraD3D) 992 if (pIndoorCameraD3D)
996 delete pLightmapBuilder; 999 delete pLightmapBuilder;
997 if (pMouseInstance) 1000 if (pMouseInstance)
998 delete pMouseInstance; 1001 delete pMouseInstance;
999 if (pParticleEngine) 1002 if (pParticleEngine)
1000 delete pParticleEngine; 1003 delete pParticleEngine;
1001 if (pThreadWardInstance) 1004 //if (pThreadWardInstance)
1002 delete pThreadWardInstance; 1005 // delete pThreadWardInstance;
1003 } 1006 }
1004 1007
1005 //----- (0044E904) -------------------------------------------------------- 1008 //----- (0044E904) --------------------------------------------------------
1006 void Game::_44E904() 1009 void Game::_44E904()
1007 { 1010 {
1021 v8 = v2 - uSomeGammaStartTime; 1024 v8 = v2 - uSomeGammaStartTime;
1022 if ( v4 < 0 1025 if ( v4 < 0
1023 || SHIDWORD(v2) < ((unsigned int)v2 < LODWORD(uSomeGammaStartTime)) + HIDWORD(uSomeGammaStartTime) | v4 == 0 1026 || SHIDWORD(v2) < ((unsigned int)v2 < LODWORD(uSomeGammaStartTime)) + HIDWORD(uSomeGammaStartTime) | v4 == 0
1024 && v3 <= 0x80 ) 1027 && v3 <= 0x80 )
1025 { 1028 {
1026 if ( v4 > 0 || v4 >= 0 ) 1029 if ( v4 < 0 )
1027 goto LABEL_12; 1030 {
1028 v3 = 0; 1031 v3 = 0;
1029 v4 = 0; 1032 v4 = 0;
1033 uSomeGammaStartTime = v2;
1034 v8 = __PAIR__(v4, v3);
1035 }
1030 } 1036 }
1031 else 1037 else
1032 { 1038 {
1033 if ( uSomeGammaDeltaTime ) 1039 if ( uSomeGammaDeltaTime )
1034 { 1040 {
1041 HIDWORD(uSomeGammaDeltaTime) = v4; 1047 HIDWORD(uSomeGammaDeltaTime) = v4;
1042 } 1048 }
1043 v5 = __CFADD__(v3, -128); 1049 v5 = __CFADD__(v3, -128);
1044 v3 -= 128; 1050 v3 -= 128;
1045 v4 = v5 + v4 - 1; 1051 v4 = v5 + v4 - 1;
1046 } 1052 uSomeGammaStartTime = v2;
1047 uSomeGammaStartTime = v2; 1053 v8 = __PAIR__(v4, v3);
1048 v8 = __PAIR__(v4, v3); 1054 }
1049 LABEL_12:
1050 if ( uSomeGammaDeltaTime ) 1055 if ( uSomeGammaDeltaTime )
1051 v6 = (double)(signed __int64)(uSomeGammaDeltaTime - __PAIR__(v4, v3)); 1056 v6 = (double)(signed __int64)(uSomeGammaDeltaTime - __PAIR__(v4, v3));
1052 else 1057 else
1053 v6 = (double)v8; 1058 v6 = (double)v8;
1054 v7 = v6 * 0.0078125; 1059 v7 = v6 * 0.0078125;