mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-18 03:35:56 +02:00
fix(switch): extend NX-only asset prefix to audio and title/intro art
The previous NX gate only rewrote image paths that go through Assets.resolve. Pokemon Yellow still had no sound and a blank title screen because: - ChipSynth reads programs.bin directly via love.filesystem.read, bypassing Assets. On NX the unprefixed path is missing when the mount overlay fails, so the engine never built and every song/SFX was silent. - Sound.playPikaCry loads pika_cries WAVs with love.audio.newSource, also bypassing Assets.resolve. - TitleState, YellowIntro, and IntroMovie call love.graphics.newImage directly on unprefixed assets/generated paths, so the Pikachu title and intro atlases failed to load. Fix: apply the same NX-only prefix rewrite in those four places. Desktop/Android keep the existing mountVersion overlay behavior. Also add ChipSynth._loadBanksForTest and tests covering the new paths. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -136,7 +136,7 @@ local FIGHT_SCRIPT = {
|
||||
|
||||
local function tryImage(path)
|
||||
if not path then return nil end
|
||||
local ok, img = pcall(love.graphics.newImage, path)
|
||||
local ok, img = pcall(love.graphics.newImage, require("src.render.Assets").resolve(path))
|
||||
return ok and img or nil
|
||||
end
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ local CYCLE_FRAMES = 240 -- the original waits ~4s between picks
|
||||
|
||||
local function tryImage(path)
|
||||
if not path then return nil end
|
||||
local ok, img = pcall(love.graphics.newImage, path)
|
||||
local ok, img = pcall(love.graphics.newImage, require("src.render.Assets").resolve(path))
|
||||
return ok and img or nil
|
||||
end
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ local function bobOffset(phase)
|
||||
end
|
||||
|
||||
local function tryImage(path)
|
||||
local ok, img = pcall(love.graphics.newImage, path)
|
||||
local ok, img = pcall(love.graphics.newImage, require("src.render.Assets").resolve(path))
|
||||
return ok and img or nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user