Skip to content

Commit 747d249

Browse files
authored
fix(view): Call View::forceRedraw() instead of doing tricks to refresh the camera normally (TheSuperHackers#2352)
1 parent ba85aae commit 747d249

3 files changed

Lines changed: 5 additions & 21 deletions

File tree

Core/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,7 @@ void BaseHeightMapRenderObjClass::adjustTerrainLOD(Int adj)
375375
newROBJ->m_roadBuffer->loadRoads();
376376
}
377377
if (TheTacticalView) {
378-
TheTacticalView->setAngle(TheTacticalView->getAngle() + 1);
379-
TheTacticalView->setAngle(TheTacticalView->getAngle() - 1);
378+
TheTacticalView->forceRedraw();
380379
}
381380
}
382381

@@ -485,11 +484,8 @@ void BaseHeightMapRenderObjClass::ReAcquireResources()
485484
}
486485
#endif
487486

488-
if (TheTacticalView)
489-
{ TheTacticalView->forceRedraw(); //force map to update itself for the current camera position.
490-
//for some reason we need to do it twice otherwise we sometimes end up with a black map until
491-
//the player moves.
492-
TheTacticalView->forceRedraw();
487+
if (TheTacticalView) {
488+
TheTacticalView->forceRedraw(); //force map to update itself for the current camera position.
493489
}
494490
}
495491

Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -806,13 +806,7 @@ void ScriptActions::doPitchCamera(Real pitch, Real sec)
806806
void ScriptActions::doOversizeTheTerrain(Int amount)
807807
{
808808
oversizeTheTerrain(amount);
809-
Coord2D offset;
810-
offset.x = 0.0001f;
811-
offset.y = 0.0001f;
812-
TheTacticalView->scrollBy(&offset);
813-
offset.x = -0.0001f;
814-
offset.y = -0.0001f;
815-
TheTacticalView->scrollBy(&offset);
809+
TheTacticalView->forceRedraw();
816810
}
817811

818812
//-------------------------------------------------------------------------------------------------

GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -833,13 +833,7 @@ void ScriptActions::doPitchCamera(Real pitch, Real sec, Real easeIn, Real easeOu
833833
void ScriptActions::doOversizeTheTerrain(Int amount)
834834
{
835835
oversizeTheTerrain(amount);
836-
Coord2D offset;
837-
offset.x = 0.0001f;
838-
offset.y = 0.0001f;
839-
TheTacticalView->scrollBy(&offset);
840-
offset.x = -0.0001f;
841-
offset.y = -0.0001f;
842-
TheTacticalView->scrollBy(&offset);
836+
TheTacticalView->forceRedraw();
843837
}
844838

845839
//-------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)