Curation round 6: boot finished, the run starts; HUD, pause screen, minimap, preloads, floor generation
Six agents took over OnlineEmotes (emote wheel), OnlineStatsScreen's deeds, VictoryRunPrompt, RevivePlayerMenu, HUD, PauseScreen, Minimap, PreloadManager, ProceduralItemManager, Game::LoadBossRushXml, GameState's loading, the menu loose ends, Manager::StartNewGame, LevelGenerator and Level (Game now derives from Level). Integration: completion_widget.h breaks an include loop, call sites moved to the new APIs. --mute (main.cpp) keeps the mixer running at zero gain. build/isaac reaches the main menu by itself (input skips the intro); under gdb, picking a character calls StartNewGame and stops at Game::Start. 1611 functions taken over, boot path 287/615. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fed6918a10
commit
addd027977
94 files changed
+7453
-43389
No files matched your search
+67
-14
@@ -3,6 +3,7 @@
|
||||
#include "log.h"
|
||||
#include "manager.h"
|
||||
#include "menu_manager.h"
|
||||
#include "victory_run_prompt.h"
|
||||
#include <optional>
|
||||
|
||||
constexpr const char* STAGES_XML = "stages.xml";
|
||||
@@ -12,6 +13,7 @@ constexpr const char* GIANTBOOK_XML = "giantbook.xml";
|
||||
constexpr const char* BOSS_OVERLAYS_XML = "bossoverlays.xml";
|
||||
constexpr const char* AMBUSH_XML = "ambush.xml";
|
||||
constexpr const char* PRELOAD_XML = "preload.xml";
|
||||
constexpr std::array<std::string_view, 4> PRELOAD_GROUPS = {"common", "enemy", "pickups", "icons"};
|
||||
constexpr const char* COMPLETION_WIDGET_ANM2 = "gfx/ui/completion_widget.anm2";
|
||||
constexpr const char* COMPLETION_WIDGET_ANIMATION = "Idle";
|
||||
constexpr const char* GIANTBOOK_CLICKER_PNG = "gfx/ui/giantbook/GiantBook_Clicker.png";
|
||||
@@ -134,23 +136,21 @@ void Game::LoadConfigXmls()
|
||||
// The original also zeroes GameOver's second int and the ints at Game+0x1d63c and Game+0x1d64c, not modeled yet.
|
||||
game.gameOver._state = 0;
|
||||
game.leaderboard.LoadAnm2();
|
||||
game.emotes.init();
|
||||
reconstruction_missing("OnlineStatsScreen's deeds widget 008ca2c0 (classes.h's CompletionWidget::Load) on Game's "
|
||||
"online stats screen: gfx/ui/DeedsMenu.anm2");
|
||||
reconstruction_missing("HUD's graphics reload 009a1970 on Game's HUD");
|
||||
game.emoteWheel.Init();
|
||||
game.onlineStatsScreen.Load();
|
||||
game.hud.graphics_reload();
|
||||
game.pauseScreen.Init();
|
||||
game.revivePlayerMenu.Init();
|
||||
game.minimap.Init();
|
||||
LoadBossRushXml(mods.TryRedirectPath(AMBUSH_XML));
|
||||
|
||||
std::string preloadPath = mods.TryRedirectPath(PRELOAD_XML);
|
||||
load_preloads_xml(&game.preloadManager, (uint8_t*)preloadPath.data());
|
||||
reconstruction_missing("PreloadManager::load_group 009c6c90 on Game's preloads: common, enemy, pickups, icons");
|
||||
init_procedural_item_surfaces(&game.proceduralItemManager);
|
||||
game.preloadManager.xml_load(mods.TryRedirectPath(PRELOAD_XML));
|
||||
for (std::string_view group : PRELOAD_GROUPS) game.preloadManager.group_load(group);
|
||||
game.proceduralItemManager.Init();
|
||||
game.bossRushParTime = BOSS_RUSH_PAR_TIME;
|
||||
game.blueWombParTime = BLUE_WOMB_PAR_TIME;
|
||||
game.genericPrompt.Initialize(PROMPT_LARGE);
|
||||
VictoryRunPrompt::Load();
|
||||
victory_run_prompt_load(game.genericPrompt);
|
||||
|
||||
game.completionWidgetSprite.Load(COMPLETION_WIDGET_ANM2, GRAPHICS_LOAD);
|
||||
game.completionWidgetSprite.SetFrame(COMPLETION_WIDGET_ANIMATION, 0);
|
||||
@@ -268,10 +268,63 @@ bool Game::load_bossoverlays_xml(std::string_view path)
|
||||
return true;
|
||||
}
|
||||
|
||||
// 00834680 Reads ambush.xml into the boss rush waves (its this is Ambush's wave list, which classes.h lost).
|
||||
void Game::LoadBossRushXml(std::string_view)
|
||||
// A boss a Boss Rush spawn slot holds: its type and variant, and the segments of a segmented boss.
|
||||
struct BossRushSpawn
|
||||
{
|
||||
reconstruction_missing("Game::LoadBossRushXml 00834680");
|
||||
int chunks = 1;
|
||||
int type = 0;
|
||||
int variant = 0;
|
||||
};
|
||||
|
||||
// ambush.xml's Boss Rush: the bosses of each spawn slot, how many waves it lasts and how many slots each wave draws.
|
||||
// The original keeps them in Ambush, which classes.h holds as bytes. They move there with its takeover.
|
||||
struct BossRushConfig
|
||||
{
|
||||
std::vector<std::vector<BossRushSpawn>> slots;
|
||||
int numWaves = 0;
|
||||
int spawnsPerWave = 0;
|
||||
};
|
||||
|
||||
static BossRushConfig bossRushConfig;
|
||||
|
||||
// 00834680 Reads ambush.xml's <bossrush> into the Boss Rush: its wave counts, then from its first <spawn> on, a slot
|
||||
// for each element, holding from its first <enemy> on each element's boss count times. A missing file changes nothing.
|
||||
// The original crashes on a file without <bossrush>. Here that leaves the Boss Rush empty.
|
||||
void Game::LoadBossRushXml(std::string_view path)
|
||||
{
|
||||
Data data;
|
||||
|
||||
data_load(data, path);
|
||||
if (!data.isLoaded) return;
|
||||
|
||||
bossRushConfig = {};
|
||||
std::optional<DataNode> root = root_find(data, "bossrush");
|
||||
if (!root) return;
|
||||
bossRushConfig.numWaves = std::atoi(node_attr(*root, "numWaves").data());
|
||||
bossRushConfig.spawnsPerWave = std::atoi(node_attr(*root, "spawnsPerWave").data());
|
||||
|
||||
bool isSlotStarted = false;
|
||||
for (DataNode slotNode : node_children(*root))
|
||||
{
|
||||
isSlotStarted = isSlotStarted || node_tag(slotNode) == "spawn";
|
||||
if (!isSlotStarted) continue;
|
||||
|
||||
std::vector<BossRushSpawn>& slot = bossRushConfig.slots.emplace_back();
|
||||
bool isEnemyStarted = false;
|
||||
for (DataNode enemyNode : node_children(slotNode))
|
||||
{
|
||||
isEnemyStarted = isEnemyStarted || node_tag(enemyNode) == "enemy";
|
||||
if (!isEnemyStarted) continue;
|
||||
|
||||
BossRushSpawn spawn;
|
||||
int count = 1;
|
||||
spawn.type = std::atoi(node_attr(enemyNode, "type").data());
|
||||
spawn.variant = std::atoi(node_attr(enemyNode, "variant").data());
|
||||
if (auto text = attr_find(enemyNode, "chunks")) spawn.chunks = std::atoi(text->data());
|
||||
if (auto text = attr_find(enemyNode, "count")) count = std::atoi(text->data());
|
||||
slot.insert(slot.end(), std::max(count, 0), spawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 006f43b0 Clears the run back to a fresh one: counters, fades, debug flags, the daily, score sheet and screen effects.
|
||||
@@ -428,8 +481,8 @@ bool Game::IsPaused()
|
||||
if (console.state != CONSOLE_CLOSED && isOffline) return true;
|
||||
return freezeFrames > 0 || gameOver._state != 0 || leaderboard.displayState != LEADERBOARD_HIDDEN ||
|
||||
stageTransition._state != 0 || roomTransition._mode != 0 || itemOverlay._state == ITEM_OVERLAY_ACTIVE ||
|
||||
(pauseScreen._state != 0 && isOffline) || g_manager->state != MANAGER_STATE_GAME ||
|
||||
genericPrompt.IsActive() || onlineStatsScreen._isActive;
|
||||
(pauseScreen.is_pausing() && isOffline) || g_manager->state != MANAGER_STATE_GAME ||
|
||||
genericPrompt.IsActive() || onlineStatsScreen.isActive;
|
||||
}
|
||||
|
||||
// 006f8120 Whether the run plays Greed mode.
|
||||
|
||||
Reference in new issue
Block a user