Skip to content

refactor(scriptengine): Remove ReloadAllTextures and call the asset manager directly - #3672

Open
OmarAglan wants to merge 1 commit into
TheSuperHackers:mainfrom
OmarAglan:refactor/remove-reload-all-textures
Open

OmarAglan wants to merge 1 commit into
TheSuperHackers:mainfrom
OmarAglan:refactor/remove-reload-all-textures

Conversation

@OmarAglan

Copy link
Copy Markdown

ReloadAllTextures() is a one line wrapper in GameEngineDevice around W3DAssetManager::Get_Instance()->Release_All_Textures(). Its only caller is the particle editor hook in ScriptEngine.cpp, which is in GameEngine.

This change calls WW3DAssetManager::Get_Instance()->Release_All_Textures() directly and deletes W3DAssetManagerExposed.h and W3DAssetManagerExposed.cpp in both games.

Release_All_Textures is a virtual function of WW3DAssetManager, and W3DAssetManager does not override it, so the behavior is the same.

This removes one of the calls from GameEngine into GameEngineDevice, as discussed in #3552.

AI USE

Used AI to make the change and to check the callers.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T09:26:26.142799Z 0ff4356 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Both game variants now release all textures directly through WW3DAssetManager. The change removes the exposed wrapper and updates the related source lists.

Changes

Texture release migration

Layer / File(s) Summary
Direct asset-manager texture release
Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp, GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp, Generals*/Code/GameEngineDevice/.../W3DAssetManagerExposed.*, Generals*/Code/GameEngineDevice/CMakeLists.txt, Core/GameEngineDevice/CMakeLists.txt
Both ScriptEngine implementations include WW3D2/assetmgr.h and call WW3DAssetManager::Get_Instance()->Release_All_Textures(). The exposed wrapper files are deleted. The game-variant source lists use W3DAssetManager.h and W3DAssetManager.cpp; Core removes the commented-out wrapper entries.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Possibly related PRs

Suggested labels: Refactor, Minor, Gen, ZH

Suggested reviewers: xezon

Merge Risk: Minimal · up to 0ff43

Texture release behavior is unchanged, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly summarizes the main change: ScriptEngine calls the asset manager directly instead of using ReloadAllTextures().
Description check Passed The description explains the direct asset-manager call, the removal of the wrapper files, and the intended reduction in GameEngine-to-GameEngineDevice calls.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d2d8455d-c6db-4d91-977d-f331a4556e3b
Commits

Reviewing files that changed from the base of the PR and between 998f337 and 0ff4356.

Files selected for processing: 9

  • Core/GameEngineDevice/CMakeLists.txt
  • Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp
  • Generals/Code/GameEngineDevice/CMakeLists.txt
  • Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DAssetManagerExposed.h
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManagerExposed.cpp
  • GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp
  • GeneralsMD/Code/GameEngineDevice/CMakeLists.txt
  • GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DAssetManagerExposed.h
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManagerExposed.cpp
Files with no reviewable changes: 7

  • Generals/Code/GameEngineDevice/CMakeLists.txt
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManagerExposed.cpp
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManagerExposed.cpp
  • Core/GameEngineDevice/CMakeLists.txt
  • Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DAssetManagerExposed.h
  • GeneralsMD/Code/GameEngineDevice/CMakeLists.txt
  • GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DAssetManagerExposed.h

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the direct calls preserve the wrapper’s behavior.

Summary

Both games now call WW3DAssetManager::Get_Instance()->Release_All_Textures() directly from the particle editor hook.

  • The particle editor releases textures through the asset manager directly.

Reviews (1) · Last reviewed commit: "refactor(scriptengine): Remove ReloadAll..." · Reviewed by Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant