Skip to content

Conversation

Copy link

Copilot AI commented Nov 5, 2025

Closes:

Four RenderSystem implementations (Tiny, GL, GL3Plus, GLES2) contained identical 9-line blocks for capability initialization, each marked with TODO comments about the duplication.

Changes

  • Added RenderSystem::initialiseRenderSystemCapabilities() protected helper method encapsulating the common pattern:

    • Create capabilities via createRenderSystemCapabilities()
    • Set mCurrentCapabilities from mRealCapabilities if custom capabilities disabled
    • Fire RenderSystemCapabilitiesCreated event
    • Initialize from capabilities
  • Refactored all four implementations to call the helper method

Before:

// TODO: fire this from emulation options, and don't duplicate Real and Current capabilities
mRealCapabilities = createRenderSystemCapabilities();

// use real capabilities if custom capabilities are not available
if (!mUseCustomCapabilities)
    mCurrentCapabilities = mRealCapabilities;

fireEvent("RenderSystemCapabilitiesCreated");

initialiseFromRenderSystemCapabilities(mCurrentCapabilities, win);

After:

initialiseRenderSystemCapabilities(win);

Net: -17 lines, removed 4 TODO markers.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • download.savannah.gnu.org
    • Triggering command: cmake -DCMAKE_BUILD_TYPE=Debug -DOGRE_BUILD_TESTS=OFF -DOGRE_BUILD_RENDERSYSTEM_TINY=TRUE -DOGRE_BUILD_RENDERSYSTEM_GL=TRUE -DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=TRUE -DOGRE_BUILD_RENDERSYSTEM_GLES2=TRUE -DOGRE_BUILD_DEPENDENCIES=TRUE .. (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Find and refactor duplicated code


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Refactor duplicated code for better maintainability Refactor duplicated RenderSystem capability initialization Nov 5, 2025
Copilot finished work on behalf of paroj November 5, 2025 23:31
Copilot AI requested a review from paroj November 5, 2025 23:31
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.

2 participants