Skip to content

fix(view): Call View::forceRedraw() instead of doing tricks to refresh the camera normally#2352

Merged
xezon merged 2 commits intoTheSuperHackers:mainfrom
xezon:xezon/fix-camera-redraw
Feb 26, 2026
Merged

fix(view): Call View::forceRedraw() instead of doing tricks to refresh the camera normally#2352
xezon merged 2 commits intoTheSuperHackers:mainfrom
xezon:xezon/fix-camera-redraw

Conversation

@xezon
Copy link

@xezon xezon commented Feb 25, 2026

This change calls View::forceRedraw() to refresh the camera instead of doing tricks.

TODO

  • Replicate in Generals

@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Fix Is fixing something, but is not user facing labels Feb 25, 2026
@greptile-apps
Copy link

greptile-apps bot commented Feb 25, 2026

Greptile Summary

Replaces hacky camera refresh workarounds with clean View::forceRedraw() calls across three files, completing the refactoring started in commit 1a249f1 by applying the same changes to the Generals (vanilla) version.

Key Changes:

  • adjustTerrainLOD(): Replaced angle increment/decrement trick with forceRedraw()
  • ReAcquireResources(): Reduced double forceRedraw() call to single call (already validated in previous commit)
  • doOversizeTheTerrain(): Replaced tiny scroll offset trick with forceRedraw() in Generals version

The refactoring improves code clarity by using the explicit forceRedraw() method instead of manipulating camera properties to trigger side-effect refreshes.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects that this is a straightforward replication of previously validated changes (commit 1a249f1) to complete cross-codebase consistency. The refactoring replaces hacky workarounds with proper API calls without introducing new logic or complexity.
  • No files require special attention

Important Files Changed

Filename Overview
Core/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp Replaced camera refresh tricks with forceRedraw() calls; removed second forceRedraw() call in ReAcquireResources() that was previously needed to prevent black map issues
Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp Replaced scroll trick with clean forceRedraw() call in doOversizeTheTerrain()
GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp Replaced scroll trick with clean forceRedraw() call in doOversizeTheTerrain()

Last reviewed commit: 4c018b8

Copy link

@Skyaero42 Skyaero42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@xezon
Copy link
Author

xezon commented Feb 26, 2026

Replicated to Generals without conflicts.

@xezon xezon changed the title fix(view): Call View::forceRedraw() to refresh the camera instead of doing tricks fix(view): Call View::forceRedraw() instead of doing tricks to refresh the camera normally Feb 26, 2026
@xezon xezon merged commit 747d249 into TheSuperHackers:main Feb 26, 2026
26 checks passed
@xezon xezon deleted the xezon/fix-camera-redraw branch February 26, 2026 18:43
@xezon xezon added this to the Camera Rework milestone Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix Is fixing something, but is not user facing Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants