Curation round 3: Lua engine, Manager, sound, menus, cutscenes, rooms, item pools, saves; boots past LuaEngine::Init

Seven agents took over LuaEngine (the mod API registration deferred), the rest of Manager (LoadConfigs, fonts, render
surfaces, Update/Render), MusicManager/SFXManager, MenuManager with the title/save/game menus, Cutscene/NightmareScene/
Backdrop, RoomConfig (src/rooms ported and retired) with ItemPool, and PersistentGameData (the original binary save
format) with InfoDisplay. An integration pass moved call sites to the new APIs, declared the taken-over free functions,
fixed two data.cpp crashes (an empty children array, null attribute strings), and made the generator keep a header's own
name where a prototype names another address. Clean build (0 warnings with -Wall -Wextra). build/isaac runs the game's
Lua scripts (without the mod API yet) and stops at reload_resource_paths. 901 functions taken over, boot path 204/615.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-11-20 00:53:08 -05:00
1 parent a7061306fa
commit ddf913f304
137 files changed
+12684 -50687

No files matched your search

+84
View File
@@ -0,0 +1,84 @@
#pragma once
#include "anm2.h"
#include "kage_graphics.h"
#include <array>
#include <cstdint>
#include <string>
#include <string_view>
// backdrops.xml fills ids 1 to 62. Id 0 is the default the others start from.
constexpr int BACKDROP_COUNT = 63;
// Construction, copies, assignment and destruction (00931de0, 00934600, 00934430, 009324f0) are the defaults.
// A room background of backdrops.xml: its wall and floor sheet and how many walls and floors it cuts into, the floor
// overlays, the water, and the grid graphics (rocks, pits, doors ...) rooms of it use. Paths are under resources/.
struct BackdropConfig
{
std::string bridge;
std::string door;
std::string gfx;
std::string holeInWall;
std::string lFloorGfx;
std::string nFloorGfx;
std::string pit;
std::string props;
std::string rocks;
std::string spikes;
std::string waterGfx;
std::string waterPit;
int backdropId = 0;
int floors = 0;
int floorVariants = 0;
int walls = 0;
int wallVariants = 0;
uint8_t waterPitsMode = 0;
bool isFullImage = false;
bool isReverseWaterGfx = false;
};
// Destruction (00932570) is the default.
// A room's background (Room's backdrop): the configs of backdrops.xml, and the walls, floor and water of the
// room's backdrop, drawn once into surfaces the room renders from.
struct Backdrop
{
std::array<BackdropConfig, BACKDROP_COUNT> configs;
KAGE::Graphics::ImagePtr floorBuffer;
KAGE::Graphics::ImagePtr floorSurface2;
KAGE::Graphics::ImagePtr gfx;
KAGE::Graphics::ImagePtr nlFloorGfx;
KAGE::Graphics::ImagePtr tempBackdropSurface;
KAGE::Graphics::ImagePtr wallsBuffer;
KAGE::Graphics::ImagePtr waterGfx;
ANM2 controlsButtonsSprite;
ANM2 controlsSprite;
ANM2 floorSprite;
ANM2 wallDetailSprite;
RNG rng = {};
Vector roomBottomRight{};
Vector roomTopLeft{};
uint32_t backdropId = 0;
uint32_t seed = 0;
bool isTempSurfaceUsed = false;
Backdrop();
bool LoadConfig(std::string_view path);
void Init(uint32_t id, bool isLoadGraphics);
uint32_t get_random_floor_variant();
KAGE::Graphics::ColorQuad render_grid_rect(int x, int y, int width, int height);
void load_details();
void pre_render_walls();
void PreRenderControls();
void render_control_icon();
void render_ashpit_ash();
void render_floor_to_target();
void spawn_detail_effects(Vector offset, bool isFlipX, bool isFlipY);
void spawn_wall_details();
void render_wall_detail();
void render_wall_borders(Vector roomTopLeftPos, Vector roomSize);
void RenderFloor(Vector renderOffset, ColorMod color);
void render_floor_surface(Vector renderOffset, ColorMod color);
void RenderWalls(Vector renderOffset, ColorMod color);
void RenderWater(Vector renderOffset);
};