Skip to content

Revert the workaround of loading of hd textures#999

Merged
codeHusky merged 1 commit intosmartcmd:mainfrom
MrTheShy:fix-any-res
Mar 9, 2026
Merged

Revert the workaround of loading of hd textures#999
codeHusky merged 1 commit intosmartcmd:mainfrom
MrTheShy:fix-any-res

Conversation

@MrTheShy
Copy link
Contributor

@MrTheShy MrTheShy commented Mar 9, 2026

Description

Fix blurry UI at sub-HD resolutions on Win64 by loading both HD and non-HD skin sets and picking the right scene SWF based on actual screen height.

Changes

Previous Behavior

The earlier crash fix (from #981) forced HD skins at every resolution to prevent Iggy from failing to resolve platformskinHD.swf. This fixed the crash but at 720p and below Iggy was downscaling 1080p assets and everything looked blurry.

Root Cause

Two issues, both from 4J's original code:

  1. The HD skin libraries (skinHD.swf, skinHDHud.swf, etc.) are loaded unconditionally on Win64/Durango/Orbis. These SWFs internally import platformskinHD.swf. But the platform skin registration was behind a runtime resolution check — at <=720p it registered skinWin.swf as platformskin.swf instead of platformskinHD.swf, so Iggy couldn't resolve the import and crashed.

  2. loadMovie() on Win64 was hardcoded to always load the 1080p scene SWF variant (*1080.swf), regardless of actual window size. The 1080p scenes import HD skins, so even if you fixed the platform skin you'd still be using HD assets at low resolutions.

4J actually started building a solution for this — they defined eLibraryFallback_* enum slots (including eLibraryFallback_Platform) and had code to load the non-HD skins into them, but it was gated behind #ifndef _FINAL_BUILD (debug only) and the platform skin slot was never actually loaded. So the fallback was incomplete and non-functional.

New Behavior

The game starts and runs correctly at any resolution on Win64. Above 720p it uses 1080p scene SWFs with HD skins (same as before). At 720p and below it uses 720p scene SWFs with non-HD skins — native assets for the resolution, no downscaling, no blurriness. No crash at any resolution.

Fix Implementation

UIController.h: Removed the _FINAL_BUILD preprocessor guard around the eLibraryFallback_* enum entries so they're available in release builds, not just debug.

UIController.cpploadSkins(): Rewrote the Win64 path to load both skin sets at startup:

  • eLibrary_Platform = skinHDWin.swf registered as platformskinHD.swf
  • eLibraryFallback_Platform = skinWin.swf registered as platformskin.swf (this was the 4J bug — slot existed but was never loaded)
  • eLibrary_* = all HD skins (skinHDGraphics.swf, skinHD.swf, etc.)
  • eLibraryFallback_* = all non-HD skins (skinGraphics.swf, skin.swf, etc.)

Both sets use distinct registered names so they coexist in the same Iggy session without conflicts.

UIScene.cpploadMovie(): On Win64 the scene SWF resolution is now chosen based on actual screen height instead of being hardcoded to 1080p:

  • >720p loads *1080.swf (these import HD skins which import platformskinHD.swf)
  • <=720p loads *720.swf (these import non-HD skins which import platformskin.swf)

The existing fallback (try 720 if 1080 file is missing) still works as a safety net.

AI Use Disclosure

Ai was used to write this pr description.

Related Issues

The previous crash fix forced HD skins at every resolution which made everything blurry at 720p and below because Iggy was downscaling 1080p assets.

The real problem was that 4J loaded the HD skin libraries (skinHD.swf, skinHDHud.swf etc) unconditionally on Win64 but the HD platform skin was only registered above 720p. At 720p or lower Iggy couldnt find platformskinHD.swf and crashed.

Now on Win64 we load both skin sets at startup, HD and non-HD, each with their own registered name so they dont conflict. loadMovie() picks 1080.swf or 720.swf based on actual screen height, and each scene SWF naturally imports the right skin chain. No crash, no blurriness.

4J already had the eLibraryFallback enum slots for this (including eLibraryFallback_Platform) but it was behind a debug-only guard and the platform skin slot was never actually loaded. Removed the guard and added the missing load.
@codeHusky
Copy link
Collaborator

Tested and seems to work

@codeHusky codeHusky merged commit af5d5a0 into smartcmd:main Mar 9, 2026
1 check passed
piebotc pushed a commit to piebotc/LegacyEvolved that referenced this pull request Mar 9, 2026
The previous crash fix forced HD skins at every resolution which made everything blurry at 720p and below because Iggy was downscaling 1080p assets.

The real problem was that 4J loaded the HD skin libraries (skinHD.swf, skinHDHud.swf etc) unconditionally on Win64 but the HD platform skin was only registered above 720p. At 720p or lower Iggy couldnt find platformskinHD.swf and crashed.

Now on Win64 we load both skin sets at startup, HD and non-HD, each with their own registered name so they dont conflict. loadMovie() picks 1080.swf or 720.swf based on actual screen height, and each scene SWF naturally imports the right skin chain. No crash, no blurriness.

4J already had the eLibraryFallback enum slots for this (including eLibraryFallback_Platform) but it was behind a debug-only guard and the platform skin slot was never actually loaded. Removed the guard and added the missing load.
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