8000 refactor(view): Change scripted state booleans to enum flags in W3DView by xezon · Pull Request #2357 · TheSuperHackers/GeneralsGameCode · GitHub
[go: up one dir, main page]

Skip to content

refactor(view): Change scripted state booleans to enum flags in W3DView#2357

Merged
xezon merged 1 commit intoTheSuperHackers:mainfrom
xezon:xezon/refactor-view-scripted-state
Feb 27, 2026
Merged

refactor(view): Change scripted state booleans to enum flags in W3DView#2357
xezon merged 1 commit intoTheSuperHackers:mainfrom
xezon:xezon/refactor-view-scripted-state

Conversation

@xezon
Copy link
@xezon xezon commented Feb 26, 2026

This changes scripted state booleans to enum flags in W3DView. Functionality wise nothing should change.

This does not look like it makes much sense yet, but it will be useful in later changes when we can add additional logic into the new functions that now control the scripted camera states.

The nearby code formatting was also improved a bit for readability.

@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Refactor Edits the code with insignificant behavior changes, is never user facing labels Feb 26, 2026
@greptile-apps
Copy link
greptile-apps bot commented Feb 26, 2026

Greptile Summary

Refactored scripted camera state management from 5 separate boolean flags to a single bitfield enum, improving code maintainability while preserving identical functionality.

  • Replaced m_doingRotateCamera, m_doingPitchCamera, m_doingZoomCamera, m_doingScriptedCameraLock, and m_doingMoveCameraOnWaypointPath with m_scriptedState bitfield
  • Added Scripted enum with 5 flags using bit shifts (1<<0 through 1<<4)
  • Introduced helper methods hasScriptedState(), addScriptedState(), removeScriptedState() for cleaner state management
  • All boolean checks converted to bitwise operations correctly
  • Added virtual interface methods isDoingScriptedCamera() and stopDoingScriptedCamera() to base View class
  • Minor formatting improvements for consistency (bracing, indentation)
  • WorldBuilder implementations updated with appropriate stubs

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Clean refactoring that replaces boolean flags with enum bitfield without changing functionality. All bitwise operations are correct, logic is preserved exactly, and code follows project conventions.
  • No files require special attention

Important Files Changed

Filename Overview
Core/GameEngine/Include/GameClient/View.h Added two pure virtual methods for scripted camera state management
Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h Introduced enum flags to replace 5 separate boolean members, added helper methods for state management
Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp Replaced all boolean state checks with flag-based operations, improved code formatting

Last reviewed commit: 81313f5

@xezon xezon added this to the Camera Rework milestone Feb 26, 2026
Copy link
@Mauller Mauller left a comment

Choose a reason for hiding this comment

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

Looks good to me

@xezon xezon merged commit 0d746e5 into TheSuperHackers:main Feb 27, 2026
24 checks passed
@xezon xezon deleted the xezon/refactor-view-scripted-state branch February 27, 2026 18:36
CookieLandProjects pushed a commit to CookieLandProjects/CLP_AI that referenced this pull request Feb 28, 2026
Okladnoj pushed a commit to Okladnoj/GeneralsGameCode that referenced this pull request Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Refactor Edits the code with insignificant behavior changes, is never user facing ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0