Skip to content

Add TextureReplacer unit test; make replacer testable standalone - #22015

Open
hrydgard wants to merge 1 commit into
masterfrom
texture-replacement-unittest
Open

Add TextureReplacer unit test; make replacer testable standalone#22015
hrydgard wants to merge 1 commit into
masterfrom
texture-replacement-unittest

Conversation

@hrydgard

@hrydgard hrydgard commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Add unittest/TestTextureReplacer which creates a fictive texture pack (textures.ini with readable invented hashes plus real PNG files), loads it via the replacer, and verifies lookups, filtering, hashranges, mip levels, and missing/ignored entries.

To make the replacer runnable outside the emulator:

  • The constructor now accepts a null DrawContext (formats just default to unsupported).
  • FindReplacement/FindFiltering use the replaceEnabled_ member instead of the global config.
  • Added TextureReplacer::LoadPackForTesting() to load an ini from a path directly.

Created by DeepSeek under guidance

Add unittest/TestTextureReplacer which creates a fictive texture pack
(textures.ini with readable invented hashes plus real PNG files), loads
it via the replacer, and verifies lookups, filtering, hashranges, mip
levels, and missing/ignored entries.

To make the replacer runnable outside the emulator:
- The constructor now accepts a null DrawContext (formats just default
  to unsupported).
- FindReplacement/FindFiltering use the replaceEnabled_ member instead
  of the global config.
- Added TextureReplacer::LoadPackForTesting() to load an ini from a
  path directly.
@hrydgard hrydgard added this to the v1.21 milestone Aug 1, 2026
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