Mercurial > mm7
comparison Outdoor.cpp @ 1391:cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
stru148 -> struct Polygon
author | Nomad |
---|---|
date | Thu, 18 Jul 2013 14:42:54 +0200 |
parents | 9749edd941c6 |
children | 38df78aba732 |
comparison
equal
deleted
inserted
replaced
1390:613c77e51e38 | 1391:cc9a3a24d61d |
---|---|
34 #include "Lights.h" | 34 #include "Lights.h" |
35 | 35 |
36 | 36 |
37 #include "MapInfo.h" | 37 #include "MapInfo.h" |
38 #include "OutdoorCamera.h" | 38 #include "OutdoorCamera.h" |
39 #include "Outdoor_stuff.h" | |
39 #include "BSPModel.h" | 40 #include "BSPModel.h" |
40 #include "GUIWindow.h" | 41 #include "GUIWindow.h" |
41 | 42 |
42 MapStartPoint uLevel_StartingPointType; // weak | 43 MapStartPoint uLevel_StartingPointType; // weak |
43 | 44 |
44 OutdoorLocation *pOutdoor = new OutdoorLocation; | 45 OutdoorLocation *pOutdoor = new OutdoorLocation; |
45 OutdoorCamera *pOutdoorCamera; | 46 OutdoorCamera *pOutdoorCamera; |
46 | 47 |
47 | 48 |
48 stru149 stru_8019C8; | 49 stru149 stru_8019C8; |
49 std::array<stru148, 2000 + 18000> array_77EC08; | 50 std::array<struct Polygon, 2000 + 18000> array_77EC08; |
50 Surf stru_80C980; | 51 Surf stru_80C980; |
51 Edge defaultEdge; // weak | 52 Edge defaultEdge; // weak |
52 Edge stru_80C9A4; | 53 Edge stru_80C9A4; |
53 Edge stru_80C9D8; | 54 Edge stru_80C9D8; |
54 | 55 |
104 pIndoorCamera->pos.x = pParty->vPosition.x - fixpoint_sub0(stru_5C6E00->Cos(pParty->sRotationY), pParty->y_rotation_granularity); | 105 pIndoorCamera->pos.x = pParty->vPosition.x - fixpoint_sub0(stru_5C6E00->Cos(pParty->sRotationY), pParty->y_rotation_granularity); |
105 pIndoorCamera->pos.y = pParty->vPosition.y - fixpoint_sub0(stru_5C6E00->Sin(pParty->sRotationY), pParty->y_rotation_granularity); | 106 pIndoorCamera->pos.y = pParty->vPosition.y - fixpoint_sub0(stru_5C6E00->Sin(pParty->sRotationY), pParty->y_rotation_granularity); |
106 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel; | 107 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel; |
107 if (bRedraw || pRenderer->pRenderD3D) | 108 if (bRedraw || pRenderer->pRenderD3D) |
108 { | 109 { |
109 ResetStru148s(); | 110 ResetPolygons(); |
110 pOutdoorCamera->RotationToInts(); | 111 pOutdoorCamera->RotationToInts(); |
111 sub_481ED9_MessWithOutdoorCamera(); | 112 sub_481ED9_MessWithOutdoorCamera(); |
112 } | 113 } |
113 | 114 |
114 pIndoorCamera->uMapGridCellX = WorldPosToGridCellX(pParty->vPosition.x); | 115 pIndoorCamera->uMapGridCellX = WorldPosToGridCellX(pParty->vPosition.x); |
123 ptr_80C978_Edges = pEdges; | 124 ptr_80C978_Edges = pEdges; |
124 } | 125 } |
125 if ( pParty->uCurrentMinute != pOutdoor->uLastSunlightUpdateMinute ) | 126 if ( pParty->uCurrentMinute != pOutdoor->uLastSunlightUpdateMinute ) |
126 pOutdoor->UpdateSunlightVectors(); | 127 pOutdoor->UpdateSunlightVectors(); |
127 pOutdoor->UpdateFog(); | 128 pOutdoor->UpdateFog(); |
128 pGame->pIndoorCameraD3D->Reset_list_0037C(); | 129 //pGame->pIndoorCameraD3D->sr_Reset_list_0037C(); |
129 if (!bRedraw) | 130 |
130 { | 131 if (pRenderer->pRenderD3D) // d3d - redraw always |
131 if ( !pRenderer->pRenderD3D ) | |
132 { | |
133 pRenderer->OnOutdoorRedrawSW(); | |
134 } | |
135 else | |
136 { | |
137 pRenderer->DrawSkyD3D(); | |
138 pRenderer->DrawBuildingsD3D(); | |
139 pRenderer->RenderTerrainD3D(); | |
140 //pRenderer->DrawBezierTerrain();// Ritor1: temporarily lag | |
141 } | |
142 } | |
143 else if (pRenderer->pRenderD3D) | |
144 { | 132 { |
145 pRenderer->DrawSkyD3D(); | 133 pRenderer->DrawSkyD3D(); |
146 pRenderer->DrawBuildingsD3D(); | 134 pRenderer->DrawBuildingsD3D(); |
147 pRenderer->RenderTerrainD3D(); | 135 pRenderer->RenderTerrainD3D(); |
148 //pRenderer->DrawBezierTerrain();// Ritor1: temporarily lag | |
149 } | 136 } |
150 else | 137 else |
151 { | 138 { |
152 pRenderer->DrawBuildingsSW(); | 139 __debugbreak(); // no SW Rendering |
153 pRenderer->RenderTerrainD3D(); | 140 /*if (!bRedraw) |
154 //pRenderer->DrawBezierTerrain();// Ritor1: temporarily lag | 141 pRenderer->OnOutdoorRedrawSW(); |
155 sr_sub_486F92_MessWithEdgesAndSpans(); | 142 else |
156 pOutdoorCamera->_487355(); | 143 { |
157 } | 144 pRenderer->DrawBuildingsSW(); |
145 pRenderer->DrawBezierTerrain(); | |
146 sr_sub_486F92_MessWithEdgesAndSpans(); | |
147 pOutdoorCamera->_487355(); | |
148 }*/ | |
149 } | |
150 | |
151 | |
158 pMobileLightsStack->uNumLightsActive = 0; | 152 pMobileLightsStack->uNumLightsActive = 0; |
159 pStationaryLightsStack->uNumLightsActive = 0; | 153 pStationaryLightsStack->uNumLightsActive = 0; |
160 if ( !pRenderer->pRenderD3D ) | 154 /*if ( !pRenderer->pRenderD3D ) |
161 { | 155 { |
162 pRenderer->ExecOutdoorDrawSW(); | 156 pRenderer->ExecOutdoorDrawSW(); |
163 pGame->pIndoorCameraD3D->_438240_draw_lits(); | 157 pGame->pIndoorCameraD3D->sr_438240_draw_lits(); |
164 } | 158 }*/ |
165 pGame->PushStationaryLights(-1); | 159 pGame->PushStationaryLights(-1); |
166 pGame->PrepareBloodsplats(); | 160 pGame->PrepareBloodsplats(); |
167 if (bRedraw) | 161 if (bRedraw) |
168 { | 162 { |
169 v4 = WorldPosToGridCellZ(pParty->vPosition.y); | 163 v4 = WorldPosToGridCellZ(pParty->vPosition.y); |
185 if (!pOutdoorCamera->bDoNotRenderDecorations) | 179 if (!pOutdoorCamera->bDoNotRenderDecorations) |
186 pRenderer->PrepareDecorationsRenderList_ODM(); | 180 pRenderer->PrepareDecorationsRenderList_ODM(); |
187 | 181 |
188 pRenderer->DrawSpriteObjects_ODM(); | 182 pRenderer->DrawSpriteObjects_ODM(); |
189 pRenderer->TransformBillboardsAndSetPalettesODM(); | 183 pRenderer->TransformBillboardsAndSetPalettesODM(); |
190 sub_485F53((Vec2_int_ *)unnamed_6BE060.data()); | 184 //sr_485F53((Vec2_int_ *)sr_6BE060.data()); |
191 } | 185 } |
192 | 186 |
193 | 187 |
194 //----- (00441CFF) -------------------------------------------------------- | 188 //----- (00441CFF) -------------------------------------------------------- |
195 void OutdoorLocation::Draw() | 189 void OutdoorLocation::Draw() |
693 pOutdoor->loc_time.day_fogrange_2 = ::day_fogrange_2; | 687 pOutdoor->loc_time.day_fogrange_2 = ::day_fogrange_2; |
694 pOutdoor->loc_time.day_attrib = ::day_attrib; | 688 pOutdoor->loc_time.day_attrib = ::day_attrib; |
695 } | 689 } |
696 | 690 |
697 //----- (00482170) -------------------------------------------------------- | 691 //----- (00482170) -------------------------------------------------------- |
698 bool ODMFace::IsBackfaceCulled(ODMFace *a1, RenderVertexSoft *a2, stru148 *a3) | 692 bool ODMFace::IsBackfaceCulled(ODMFace *a1, RenderVertexSoft *a2, struct Polygon *a3) |
699 { | 693 { |
700 stru148 *v3; // edi@1 | 694 struct Polygon *v3; // edi@1 |
701 RenderVertexSoft *v4; // esi@1 | 695 RenderVertexSoft *v4; // esi@1 |
702 unsigned int v5; // edx@1 | 696 unsigned int v5; // edx@1 |
703 RenderVertexSoft *v6; // ecx@2 | 697 RenderVertexSoft *v6; // ecx@2 |
704 double v7; // st7@5 | 698 double v7; // st7@5 |
705 double v8; // st6@5 | 699 double v8; // st6@5 |