Skip to content

refactor: Add override keyword to virtual function overrides in GameEngineDevice#2393

Merged
xezon merged 7 commits intoTheSuperHackers:mainfrom
bobtista:bobtista/override-keyword-gameenginedevice
Mar 26, 2026
Merged

refactor: Add override keyword to virtual function overrides in GameEngineDevice#2393
xezon merged 7 commits intoTheSuperHackers:mainfrom
bobtista:bobtista/override-keyword-gameenginedevice

Conversation

@bobtista
Copy link
Copy Markdown

@bobtista bobtista commented Mar 3, 2026

Summary

  • Add override keyword to virtual function overrides in GameEngineDevice
  • Covers W3DDevice, Win32Device, StdDevice, VideoDevice
  • Changes across Core, Generals, and GeneralsMD

Context

Part 5/6 of splitting #2101. Depends on #2389 merging first.

Notes

  • 113 files changed, purely mechanical override keyword additions
  • Includes bugfix: remove incorrect override from methods without matching virtual base class
  • All lines retain the virtual keyword

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 3, 2026

Greptile Summary

This PR (part 5/6 of splitting #2101) performs a purely mechanical addition of the override keyword to virtual function overrides across 113 files in Core/, Generals/, and GeneralsMD/ GameEngineDevice code. The changes cover W3DDevice, Win32Device, StdDevice, and VideoDevice subsystems.

Key observations:

  • All changes are additive — no logic is altered, only override specifiers are appended to existing virtual method declarations.
  • Several methods that were implicitly virtual through inheritance (lacking the virtual keyword in the derived class) also gain explicit virtual alongside override (e.g., getTerrainColorAt, addFactionBib, ~BinkVideoPlayer, Thread_Function in MouseThreadClass). This is stylistically consistent with the codebase convention of retaining virtual on all overrides.
  • The "bugfix" mentioned in the PR description is correctly applied: non-overriding virtual methods (e.g., findPlayingAudioFrom, processPlayingList, initializeBinkWithMiles, isDoingScriptedCamera) are left without override, avoiding compile errors.
  • Generals/ and GeneralsMD/ changes are symmetric, reflecting the parallel vanilla/Zero Hour codebase split.
  • No functional, behavioral, or ABI changes are introduced.

Confidence Score: 5/5

  • Safe to merge — purely mechanical keyword additions with no logic changes and correct handling of non-overriding virtuals.
  • All 113 files change only override keyword placement. The author correctly distinguished overriding from non-overriding virtuals. Where virtual was also added alongside override it reflects inherited-but-implicit virtualness made explicit. No copyright headers, include guards, or logic paths are touched.
  • No files require special attention.

Important Files Changed

Filename Overview
Core/GameEngineDevice/Include/MilesAudioDevice/MilesAudioManager.h Adds override to all overriding virtual methods. Non-overriding virtuals (findPlayingAudioFrom, processPlayingList, processFadingList, processStoppedList) are correctly left without override.
Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h Large file with ~107 virtual methods updated with override. Methods like isDoingScriptedCamera, cameraModFreezeTime, isTimeFrozen, cameraEnableRealZoomMode, and cameraDisableRealZoomMode are correctly left without override as they are declarations not matching a base class virtual.
Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DTerrainVisual.h Some previously non-virtual methods (getTerrainColorAt, getTerrainTile, addFactionBib, removeFactionBib, addFactionBibDrawable, removeFactionBibDrawable, getLogicHeightMap, getClientHeightMap) are now correctly marked virtual ... override, making the implicit inheritance explicit.
Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp MouseThreadClass::Thread_Function was non-virtual; now correctly declared virtual ... override, making the implicit override of ThreadClass::Thread_Function explicit.
Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp Several file-local shader classes (ScreenDefaultFilter, ShroudTextureShader, FlatShroudTextureShader, MaskTextureShader, TerrainShader8Stage, etc.) all get override added cleanly.
Core/GameEngineDevice/Include/VideoDevice/Bink/BinkVideoPlayer.h ~BinkVideoPlayer() gains both virtual and override (was undecorated); initializeBinkWithMiles() is correctly left without override as it is specific to BinkVideoPlayer and has no matching base class virtual.
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp W3DShadowTexture and MissingTextureClass destructors and Get_Key() correctly gain virtual + override.
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp W3DPrototypeClass methods (Get_Name, Get_Class_ID, Create, DeleteSelf) gain override, aligning with PrototypeClass base interface.
Core/GameEngineDevice/Include/W3DDevice/GameClient/Module/W3DModelDraw.h All overriding virtual methods in W3DModelDraw and W3DModelDrawModuleData gain override. getRenderCost inside the #if defined(RTS_DEBUG) block is correctly left without override.
Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp TestSeismicFilter::filterCallback and applyGravityCallback gain override cleanly.

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class AudioManager {
        +virtual init()
        +virtual update()
        +virtual reset()
    }
    class MilesAudioManager {
        +virtual init() override
        +virtual update() override
        +virtual reset() override
    }
    AudioManager <|-- MilesAudioManager

    class VideoPlayer {
        +virtual init()
        +virtual update()
        +virtual open()
    }
    class BinkVideoPlayer {
        +virtual init() override
        +virtual update() override
        +virtual open() override
        +virtual ~BinkVideoPlayer() override
        +virtual initializeBinkWithMiles()
    }
    VideoPlayer <|-- BinkVideoPlayer

    class TerrainVisual {
        +virtual load()
        +virtual getTerrainColorAt()
        +virtual addFactionBib()
    }
    class W3DTerrainVisual {
        +virtual load() override
        +virtual getTerrainColorAt() override
        +virtual addFactionBib() override
    }
    TerrainVisual <|-- W3DTerrainVisual

    class View {
        +virtual init()
        +virtual drawView()
        +virtual lookAt()
    }
    class W3DView {
        +virtual init() override
        +virtual drawView() override
        +virtual lookAt() override
        +virtual isDoingScriptedCamera()
    }
    View <|-- W3DView

    class GhostObject {
        +virtual snapShot()
        +virtual updateParentObject()
    }
    class W3DGhostObject {
        +virtual snapShot() override
        +virtual updateParentObject() override
    }
    GhostObject <|-- W3DGhostObject
Loading

Reviews (6): Last reviewed commit: "fix: Add missing virtual keyword to dest..." | Re-trigger Greptile

@bobtista bobtista force-pushed the bobtista/override-keyword-gameenginedevice branch from 1c9931f to 37bcbc7 Compare March 9, 2026 20:09
@xezon xezon added the Refactor Edits the code with insignificant behavior changes, is never user facing label Mar 10, 2026
Copy link
Copy Markdown

@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.

Looks good

@xezon xezon changed the title refactor(GameEngineDevice): Add override keyword to virtual function overrides refactor: Add override keyword to virtual function overrides in GameEngineDevice Mar 17, 2026
@bobtista bobtista force-pushed the bobtista/override-keyword-gameenginedevice branch from 47bfd7e to 52c92bf Compare March 24, 2026 15:40
@xezon xezon merged commit 6e4e5f0 into TheSuperHackers:main Mar 26, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Edits the code with insignificant behavior changes, is never user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants