mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-10-09 01:59:15 -04:00
795276935c
- Shared render: cache Font encode/width, skip unchanged palette/ShaderFX uniform sends, reuse quads and scratch tables, cheaper sprite palettes - Mods: fast path for loaded requires, memoized sandbox verdicts, fewer Hooks:call allocations, drop emptied hook chains - Audio: bulk PCM writes, cry/SFX prewarm on the worker, sliced sync fallback, cached Gen 3 SE sources - Gen 1: per-frame SGB battle palettes, hoisted overworld FX, cached menus - Gen 2: numeric attr grid, indexed anim cells, entity culling, memoized cache keys, palette shader set once per tile run - Gen 3: reuse native tile batches, per-cell metatile rebuilds, partial FRLG tile anim uploads, near-view ghost ticking, packed FRLG font atlas - Fixes: emergency quit timer, Gen 3 batch regression and stale sprite index, trainer card texture leak, missing pic re-reads, anim tint cache, Crystal ghost grass overdraw, refresh-rate dependent counters, pad swap
22 lines
788 B
Lua
22 lines
788 B
Lua
-- Generic process-lifecycle mod hooks so a platform-specific launcher
|
|
-- integration (a native shell embedding this engine, e.g. wrapping the
|
|
-- window in a platform UI) can live entirely in a mod instead of
|
|
-- hand-patching main.lua, which every other engine change also touches.
|
|
-- See docs/modding.md's "Process-lifecycle hooks" section.
|
|
local ModRuntime = require("src.mods.Runtime")
|
|
|
|
local PlatformHooks = {}
|
|
|
|
-- hoisted: update runs every frame, and the vanilla step closes over nothing
|
|
local function vanillaUpdate(g, d) g:update(d) end
|
|
|
|
function PlatformHooks.update(game, dt)
|
|
return ModRuntime.call("core.update", vanillaUpdate, game, dt)
|
|
end
|
|
|
|
function PlatformHooks.quitToLauncher(vanilla)
|
|
return ModRuntime.call("core.quit_to_launcher", vanilla)
|
|
end
|
|
|
|
return PlatformHooks
|