Curation round 2, wave B: ItemConfig, EntityConfig, mods, Manager and the KAGE platform on SDL3; boots to LuaEngine::Init
- item_config, entity_config and mod_manager take over their families as idiomatic classes (std containers, unique_ptr, bitset tear flags). Every big loader reads the imported JSON: entities2.xml gives 1349 entities. - manager.h/.cpp take over Manager (g_manager) and IsaacStartup. Members are the curated subsystems by value. - kage_graphics, kage_input and kage_sound take over KAGE's graphics (shaders, render targets, batches, PNG through stb_image), input (SDL3 keyboard, mouse, gamepads) and sound (SDL3 audio, wav and stb_vorbis ogg, pitch and volume). - source_tree.py: classes inside a namespace block in src/ headers count as taken over, and a still-generated class's vtable slot keeps its stub unless src/ defines that exact method. build/isaac opens the window, sets up GL 4.6, framebuffers and PulseAudio, logs the version, and stops at LuaEngine::Init. 522 functions taken over, boot path 156/615. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
346dc95e13
commit
28e2e48842
105 files changed
+7008
-31418
No files matched your search
+122
-8
@@ -1,7 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
// The sprites a mod can replace, by their slot in ModEntry::_contentSprites.
|
||||
enum ModContentSprite : int
|
||||
#include "anm2.h"
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
// The sprites a mod can replace, by their slot in ModEntry::contentSprites.
|
||||
enum ModContentSprite
|
||||
{
|
||||
MOD_SPRITE_CHARACTER_MENU,
|
||||
MOD_SPRITE_CHARACTER_PORTRAITS,
|
||||
@@ -19,11 +28,116 @@ enum ModContentSprite : int
|
||||
MOD_SPRITE_COUNT
|
||||
};
|
||||
|
||||
// What ModManager::_modBanStatus says about playing online, each with its own popup.
|
||||
enum ModBanStatus : int
|
||||
// What ModManager::modBanStatus says about playing online, each with its own popup.
|
||||
enum ModBanStatus
|
||||
{
|
||||
MOD_BAN_NONE = 1,
|
||||
MOD_BAN_ACTIVE = 2,
|
||||
MOD_BAN_PERMANENT = 3,
|
||||
MOD_BAN_NEEDS_RESTART = 4
|
||||
MOD_BAN_UNCHECKED,
|
||||
MOD_BAN_NONE,
|
||||
MOD_BAN_ACTIVE,
|
||||
MOD_BAN_PERMANENT,
|
||||
MOD_BAN_NEEDS_RESTART
|
||||
};
|
||||
|
||||
// A shader a mod's shaders.xml declares: its GLSL and the vertex parameters it takes, each with its float count.
|
||||
// The KAGE shader and render target it owns belong to the graphics round, so their members stop the game for now.
|
||||
struct ModShader
|
||||
{
|
||||
std::map<std::string, int> parameters;
|
||||
std::string fragmentSource;
|
||||
std::string name;
|
||||
std::string vertexSource;
|
||||
int parametersSize = 0;
|
||||
|
||||
void load();
|
||||
void render_target_create();
|
||||
void render_target_release();
|
||||
void render_target_push();
|
||||
};
|
||||
|
||||
// Construction (008f2d80) and destruction (008f2fb0) are the defaults.
|
||||
// A mod folder ListMods found: its metadata.xml, its folders, whether it loads, and what its content replaced.
|
||||
struct ModEntry
|
||||
{
|
||||
std::array<ANM2, MOD_SPRITE_COUNT> contentSprites;
|
||||
std::list<ModShader> shaders;
|
||||
std::map<int, int> collectibleIdMap;
|
||||
std::map<int, int> trinketIdMap;
|
||||
std::vector<std::string> tags;
|
||||
std::string contentDirectory;
|
||||
std::string dataDirectory;
|
||||
std::string directory;
|
||||
std::string metadataDescription;
|
||||
std::string metadataVersion;
|
||||
std::string metadataVisibility;
|
||||
std::string metadataWorkshopID;
|
||||
std::string name;
|
||||
std::string resourcesDirectory;
|
||||
bool isEnabled = true;
|
||||
bool isLoaded = true;
|
||||
bool isOutdated = false;
|
||||
|
||||
std::string GetContentPath(std::string_view fileName);
|
||||
void WriteMetadata();
|
||||
void load_content_anm2(ModContentSprite slot, std::string_view relativePath);
|
||||
void load_menu_sprites();
|
||||
};
|
||||
|
||||
// Rebirth's Mod names the same object: its methods (008f99c0, 008f9cb0, 008f9e50) are ModEntry's.
|
||||
struct Mod : ModEntry
|
||||
{
|
||||
};
|
||||
|
||||
// A game path a mod replaces, and the mod that does, or no mod when none does.
|
||||
struct RedirectedPath
|
||||
{
|
||||
ModEntry* modEntry = nullptr;
|
||||
std::string filePath;
|
||||
};
|
||||
|
||||
// Where and how a mod's sprite is drawn in a menu.
|
||||
struct ModSpriteDraw
|
||||
{
|
||||
std::array<int, BLEND_PART_COUNT> blendMode{};
|
||||
ColorMod color = COLOR_DEFAULT;
|
||||
Vector position{};
|
||||
Vector scale = vector_make(1, 1);
|
||||
};
|
||||
|
||||
// Destruction (008f2ff0, 008fc570) is the default.
|
||||
// The installed mods: listing them, loading their content into the game's configs, their shaders, the game paths
|
||||
// their resources replace, and what they mean for online play.
|
||||
// Steam Workshop downloads (008fa390, 008fb120, 008f9f40) are dropped, with the progress text and loading sprite
|
||||
// Manager::Render showed while they ran.
|
||||
struct ModManager
|
||||
{
|
||||
ANM2 modDefaultsSprite;
|
||||
std::unordered_map<std::string, RedirectedPath> redirectedPaths;
|
||||
std::vector<std::unique_ptr<ModEntry>> mods;
|
||||
ModEntry* loadingMod = nullptr;
|
||||
ModBanStatus modBanStatus = MOD_BAN_UNCHECKED;
|
||||
|
||||
ModManager();
|
||||
|
||||
void ListMods();
|
||||
void LoadModContent();
|
||||
void LoadModItemPools();
|
||||
void LoadModBossPools();
|
||||
void LoadModCurses();
|
||||
void LoadModRooms(int stageId, int mode);
|
||||
void LoadShaders();
|
||||
void Reset();
|
||||
void TriggerResize();
|
||||
std::string TryRedirectPath(std::string_view filePath);
|
||||
bool is_any_mod_loaded();
|
||||
void mods_unload();
|
||||
|
||||
void create_shader_render_targets();
|
||||
void shader_render_targets_push();
|
||||
void shader_render_targets_release();
|
||||
void unload_shaders();
|
||||
|
||||
static void RenderCustomCharacterMenu(int characterId, Vector& renderPos, ANM2& defaultSprite);
|
||||
static void RenderCustomGameOver(int playerType, Vector& position);
|
||||
void RenderCustomCharacterPortraits(int characterId, ModSpriteDraw& draw);
|
||||
void RenderCustomCollectionItem(unsigned int itemId, ModSpriteDraw& draw);
|
||||
};
|
||||
Reference in new issue
Block a user