comparison Outdoor.cpp @ 121:3471df3713e2

Teal line at game's viewport bottom fix
author Nomad
date Mon, 11 Feb 2013 17:29:51 +0200
parents fe0e317c0de0
children a8ec7e1e18b6
comparison
equal deleted inserted replaced
120:fe0e317c0de0 121:3471df3713e2
45 45
46 //----- (0047A59E) -------------------------------------------------------- 46 //----- (0047A59E) --------------------------------------------------------
47 void OutdoorLocation::ExecDraw(unsigned int bRedraw) 47 void OutdoorLocation::ExecDraw(unsigned int bRedraw)
48 { 48 {
49 int v1; // edi@1 49 int v1; // edi@1
50 unsigned int v2; // ebx@1 50 //unsigned int v2; // ebx@1
51 int v3; // ST18_4@3 51 int v3; // ST18_4@3
52 int v4; // ST04_4@19 52 int v4; // ST04_4@19
53 int v5; // eax@19 53 int v5; // eax@19
54 54
55 v1 = 0; 55 v1 = 0;
56 v2 = bRedraw; 56 //v2 = bRedraw;
57 if ( viewparams->field_54 ) 57 if ( viewparams->field_54 )
58 v1 = 2; 58 v1 = 2;
59 pIndoorCamera->sRotationX = pParty->sRotationX; 59 pIndoorCamera->sRotationX = pParty->sRotationX;
60 pIndoorCamera->sRotationY = pParty->sRotationY; 60 pIndoorCamera->sRotationY = pParty->sRotationY;
61 pIndoorCamera->pos.x = pParty->vPosition.x 61 pIndoorCamera->pos.x = pParty->vPosition.x
63 * (signed __int64)pParty->y_rotation_granularity) >> 16); 63 * (signed __int64)pParty->y_rotation_granularity) >> 16);
64 //v3 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi); 64 //v3 = stru_5C6E00->SinCos(pParty->sRotationY - stru_5C6E00->uIntegerHalfPi);
65 pIndoorCamera->field_4C = v1; 65 pIndoorCamera->field_4C = v1;
66 pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16); 66 pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * ((stru_5C6E00->SinCos(pParty->sRotationY)) >> 16);
67 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel; 67 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel;
68 if ( v2 || pRenderer->pRenderD3D ) 68 if (bRedraw || pRenderer->pRenderD3D)
69 { 69 {
70 ResetStru148s(); 70 ResetStru148s();
71 pOutdoorCamera->RotationToInts(); 71 pOutdoorCamera->RotationToInts();
72 sub_481ED9_MessWithOutdoorCamera(); 72 sub_481ED9_MessWithOutdoorCamera();
73 } 73 }
74 pIndoorCamera->uMapGridCellX = WorldPosToGridCellX(pParty->vPosition.x); 74 pIndoorCamera->uMapGridCellX = WorldPosToGridCellX(pParty->vPosition.x);
75 pIndoorCamera->uMapGridCellZ = WorldPosToGridCellZ(pParty->vPosition.y); 75 pIndoorCamera->uMapGridCellZ = WorldPosToGridCellZ(pParty->vPosition.y);
76 if ( v2 ) 76 if (bRedraw)
77 { 77 {
78 Software_ResetNewEdges(); 78 Software_ResetNewEdges();
79 sub_487DA9(); 79 sub_487DA9();
80 ptr_80C97C_Surfs = pSurfs; 80 ptr_80C97C_Surfs = pSurfs;
81 ptr_80C978_Edges = pEdges; 81 ptr_80C978_Edges = pEdges;
82 } 82 }
83 if ( pParty->uCurrentMinute != pOutdoor->uLastSunlightUpdateMinute ) 83 if ( pParty->uCurrentMinute != pOutdoor->uLastSunlightUpdateMinute )
84 pOutdoor->UpdateSunlightVectors(); 84 pOutdoor->UpdateSunlightVectors();
85 pOutdoor->UpdateFog(); 85 pOutdoor->UpdateFog();
86 pGame->pIndoorCameraD3D->Reset_list_0037C(); 86 pGame->pIndoorCameraD3D->Reset_list_0037C();
87 if ( !v2 ) 87 if (!bRedraw)
88 { 88 {
89 if ( !pRenderer->pRenderD3D ) 89 if ( !pRenderer->pRenderD3D )
90 { 90 {
91 pRenderer->OnOutdoorRedrawSW(); 91 pRenderer->OnOutdoorRedrawSW();
92 } 92 }
95 pRenderer->DrawSkyD3D(); 95 pRenderer->DrawSkyD3D();
96 pRenderer->DrawBuildingsD3D(); 96 pRenderer->DrawBuildingsD3D();
97 pRenderer->RenderTerrainD3D();//pRenderer->DrawBezierTerrain();// Ritor1: temporarily lag 97 pRenderer->RenderTerrainD3D();//pRenderer->DrawBezierTerrain();// Ritor1: temporarily lag
98 } 98 }
99 } 99 }
100 else if ( pRenderer->pRenderD3D ) 100 else if (pRenderer->pRenderD3D)
101 { 101 {
102 pRenderer->DrawSkyD3D(); 102 pRenderer->DrawSkyD3D();
103 pRenderer->DrawBuildingsD3D(); 103 pRenderer->DrawBuildingsD3D();
104 pRenderer->RenderTerrainD3D();//pRenderer->DrawBezierTerrain();// Ritor1: temporarily lag 104 pRenderer->RenderTerrainD3D();//pRenderer->DrawBezierTerrain();// Ritor1: temporarily lag
105 } 105 }
117 pRenderer->ExecOutdoorDrawSW(); 117 pRenderer->ExecOutdoorDrawSW();
118 pGame->pIndoorCameraD3D->_438240_draw_lits(); 118 pGame->pIndoorCameraD3D->_438240_draw_lits();
119 } 119 }
120 pGame->PushStationaryLights(-1); 120 pGame->PushStationaryLights(-1);
121 pGame->PrepareBloodsplats(); 121 pGame->PrepareBloodsplats();
122 if ( v2 ) 122 if (bRedraw)
123 { 123 {
124 v4 = WorldPosToGridCellZ(pParty->vPosition.y); 124 v4 = WorldPosToGridCellZ(pParty->vPosition.y);
125 v5 = WorldPosToGridCellX(pParty->vPosition.x); 125 v5 = WorldPosToGridCellX(pParty->vPosition.x);
126 pOutdoor->_47EF60(v5, v4, 1); 126 pOutdoor->_47EF60(v5, v4, 1);
127 } 127 }
145 145
146 146
147 //----- (00441CFF) -------------------------------------------------------- 147 //----- (00441CFF) --------------------------------------------------------
148 void OutdoorLocation::Draw() 148 void OutdoorLocation::Draw()
149 { 149 {
150 unsigned int v0; // ecx@1 150 bool redrawWorld = true;
151
152 v0 = 1;
153 if ( !(pParty->uFlags & 2) && !(pGame->uFlags2 & 1) ) 151 if ( !(pParty->uFlags & 2) && !(pGame->uFlags2 & 1) )
154 v0 = 0; 152 redrawWorld = false;
155 pOutdoor->ExecDraw(v0); 153 pOutdoor->ExecDraw(redrawWorld);
154
156 pGame->DrawParticles(); 155 pGame->DrawParticles();
157 pWeather->Draw(); 156 pWeather->Draw();
158 array_5118E8._440F07(); 157 array_5118E8._440F07();
159 } 158 }
160 159