Curation round 4: popups, Seeds/Random, Game, KeyConfigs, offline NetplayManager, Console, TextureCache, render passes
Six agents took over PopupButtons/PopupQueue/AchievementOverlay, Seeds with the global Random (now seeded from the clock as in the original), Game (g_game exists from Manager::Init on), KeyConfigs, an offline NetplayManager, Console's output and printing, TextureCache, the color-mod and sprite shader passes, mod shaders and reload_resource_paths. An integration pass moved callers to the new APIs (0 errors, 0 warnings with -Wall -Wextra). build/isaac loads the 34 installed mods and stops at ScoreSheet::ScoreSheet in Game's constructor; with the remaining stubs skipped under gdb the intro cutscene plays through and the main menu's frame loop runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ddf913f304
commit
fd8b965350
110 files changed
+6500
-40129
No files matched your search
+230
@@ -0,0 +1,230 @@
|
||||
#pragma once
|
||||
|
||||
#include "anm2.h"
|
||||
#include "console.h"
|
||||
#include "item_pool.h"
|
||||
#include "kage_graphics.h"
|
||||
#include "room_config.h"
|
||||
#include "seeds.h"
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
constexpr int ROOM_GRID_SIZE = 507;
|
||||
constexpr int OFF_GRID_ROOM_COUNT = 20;
|
||||
constexpr int ROOM_LIST_SIZE = ROOM_GRID_SIZE + OFF_GRID_ROOM_COUNT;
|
||||
constexpr int GREED_WAVE_SLOTS = 12;
|
||||
constexpr int BACKWARDS_STAGE_COUNT = 7;
|
||||
constexpr int GLOWING_HOURGLASS_SLOTS = 2;
|
||||
|
||||
// The xorshift every RNG of Game starts on, before a run seeds it (shift index 35).
|
||||
constexpr RNG RNG_DEFAULT = {0xaa17414f, 5, 9, 7};
|
||||
|
||||
// A screen color modifier that changes nothing.
|
||||
constexpr ColorModState COLOR_MOD_NEUTRAL = {1, 1, 1, 0, 0, 1};
|
||||
|
||||
// The difficulty a run is played on. The two Greed ones play Greed mode.
|
||||
enum Difficulty : uint32_t
|
||||
{
|
||||
DIFFICULTY_NORMAL,
|
||||
DIFFICULTY_HARD,
|
||||
DIFFICULTY_GREED,
|
||||
DIFFICULTY_GREEDIER
|
||||
};
|
||||
|
||||
// A boss by type and variant, as the run's encountered list holds it.
|
||||
struct BossId
|
||||
{
|
||||
int type = 0;
|
||||
int variant = 0;
|
||||
};
|
||||
|
||||
// An enemy the Eraser removed for the rest of the run.
|
||||
struct ErasedEnemy
|
||||
{
|
||||
int type = 0;
|
||||
int subtype = 0;
|
||||
int variant = 0;
|
||||
};
|
||||
|
||||
// The run (g_game): the floor and its rooms (the front of the class is Rebirth's Level), the configs and pools a run
|
||||
// draws from, the UI overlays and menus of a run, and the screen effects, counters and history of the run so far.
|
||||
// Members of classes not taken over yet keep their generated types and start zeroed.
|
||||
// The render surfaces were file globals of the original, created once by the first Game.
|
||||
class Game
|
||||
{
|
||||
public:
|
||||
std::array<RoomDescriptor, ROOM_LIST_SIZE> roomList{};
|
||||
std::array<int, ROOM_GRID_SIZE> roomMap{};
|
||||
std::array<uint32_t, GREED_WAVE_SLOTS> greedWaveSeeds{};
|
||||
std::array<BackwardsStageDesc, BACKWARDS_STAGE_COUNT> backwardsStages{};
|
||||
std::vector<EntitySaveState> myosotisPickups;
|
||||
std::unique_ptr<Room> room;
|
||||
int* currentRoomMap = nullptr;
|
||||
RNG devilAngelRoomRNG = RNG_DEFAULT;
|
||||
RNG generationRNG = RNG_DEFAULT;
|
||||
Vector dungeonReturnPosition{};
|
||||
Vector mamaMegaPosition{};
|
||||
float angelRoomChance = 0;
|
||||
int bombPickupsSpawned = 0;
|
||||
int currentDimensionIdx = 0;
|
||||
int currentRoomIdx = 0;
|
||||
int dungeonReturnRoomIndex = 0;
|
||||
int enterDoor = 0;
|
||||
int greedLastBeatenWave = 0;
|
||||
int greedLastPaidWave = 0;
|
||||
int greedModeWave = 0;
|
||||
int greedWavesClearedWithoutRedHeartDamage = 0;
|
||||
int lastBossRoomListIdx = 0;
|
||||
int lastRoomDimensionIdx = 0;
|
||||
int lastRoomIdx = 0;
|
||||
int leaveDoor = 0;
|
||||
int nbRooms = 0;
|
||||
int startingRoomIdx = 0;
|
||||
uint32_t curses = 0;
|
||||
uint32_t dungeonPlacementSeed = 0;
|
||||
uint32_t greedModeTreasureRoomIdx = 0;
|
||||
uint32_t levelStateFlags = 0;
|
||||
uint32_t stage = 0;
|
||||
uint32_t stageType = 0;
|
||||
bool isBossChallenge = false;
|
||||
bool isCanSeeEverything = false;
|
||||
bool isDevilRoomDisabled = false;
|
||||
bool isHeartPicked = false;
|
||||
bool isLevelGenerating = false;
|
||||
|
||||
RoomConfig roomConfig;
|
||||
ItemPool itemPool;
|
||||
Seeds seedEffects;
|
||||
Console console;
|
||||
std::unique_ptr<EntityFactory> entityFactory = std::make_unique<EntityFactory>();
|
||||
PreloadManager preloadManager{};
|
||||
BossPool bossPool{};
|
||||
PlayerManager playerManager{};
|
||||
Ambush ambush{};
|
||||
DeathmatchManager deathmatchManager{};
|
||||
DailyChallenge dailyChallenge{};
|
||||
ProceduralItemManager proceduralItemManager{};
|
||||
std::array<GlowingHourglassState, GLOWING_HOURGLASS_SLOTS> glowingHourglassStates{};
|
||||
std_vector onlinePlayerStats{};
|
||||
std::vector<BossId> encounteredBosses;
|
||||
std::vector<ErasedEnemy> erasedEntities;
|
||||
|
||||
RoomTransition roomTransition{};
|
||||
StageTransition stageTransition{};
|
||||
ItemOverlay itemOverlay{};
|
||||
BossOverlay bossOverlay{};
|
||||
GameOver gameOver{};
|
||||
Leaderboard leaderboard{};
|
||||
HUD hud{};
|
||||
PauseScreen pauseScreen{};
|
||||
RevivePlayerMenu revivePlayerMenu{};
|
||||
OnlineStatsScreen onlineStatsScreen{};
|
||||
Minimap minimap{};
|
||||
ScoreSheet scoreSheet{};
|
||||
GenericPrompt genericPrompt{};
|
||||
DebugRenderer debugRenderer{};
|
||||
ANM2 completionWidgetSprite;
|
||||
|
||||
KAGE::Graphics::ImagePtr giantBookClickerImage;
|
||||
KAGE::Graphics::ImagePtr bloomSurface;
|
||||
KAGE::Graphics::ImagePtr colormodSurface;
|
||||
KAGE::Graphics::ImagePtr hallucinationSnapshot;
|
||||
KAGE::Graphics::ImagePtr hallucinationSurface;
|
||||
KAGE::Graphics::ImagePtr oldTvSurface;
|
||||
KAGE::Graphics::ImagePtr pixelationSurface;
|
||||
|
||||
ColorModState currentColorModifier = COLOR_MOD_NEUTRAL;
|
||||
ColorModState lerpColorModifier = COLOR_MOD_NEUTRAL;
|
||||
ColorModState targetColorModifier = COLOR_MOD_NEUTRAL;
|
||||
KColor fadeInColor{};
|
||||
KColor fadeOutColor{};
|
||||
RNG fortuneRNG = RNG_DEFAULT;
|
||||
Vector screenShakeOffset{};
|
||||
Difficulty difficulty = DIFFICULTY_NORMAL;
|
||||
float bloomStrength = 0;
|
||||
float darknessModifier = 0;
|
||||
float darknessStrength = 0;
|
||||
float dizzyIntensity = 0;
|
||||
float dizzyIntensityChangeSpeed = 0;
|
||||
float dizzyTargetIntensity = 0;
|
||||
float fadeSpeed = 0;
|
||||
float lightningIntensity = 0;
|
||||
float trapdoorLoopVolume = 0;
|
||||
int ascentTimer = 0;
|
||||
int blueWombParTime = 0;
|
||||
int bloomDuration = 0;
|
||||
int bloomTimer = 0;
|
||||
int bossRushParTime = 0;
|
||||
int currentGlowingHourglassSlot = 0;
|
||||
int darknessTimeout = 0;
|
||||
int deathCertificateExitTimer = 0;
|
||||
int devilRoomDeals = 0;
|
||||
int donationModAngel = 0;
|
||||
int donationModGreed = 0;
|
||||
int emoteMenuState = 0;
|
||||
int fadeOutTarget = 0;
|
||||
int frameCount = 0;
|
||||
int framesSinceRoomTransition = 0;
|
||||
int freezeFrames = 0;
|
||||
int hallucinationDuration = 0;
|
||||
int hallucinationTimer = 0;
|
||||
int lastDevilRoomStage = 0;
|
||||
int lastLevelWithDamage = 0;
|
||||
int lastLevelWithoutHalfHp = 0;
|
||||
int magicSkinUses = 0;
|
||||
int pixelationDuration = 0;
|
||||
int pixelationTimer = 0;
|
||||
int planetariumsVisited = 0;
|
||||
int reviveMachineCoinsLeft = 0;
|
||||
int reviveMachineUses = 0;
|
||||
int rewindsThisFloor = 0;
|
||||
int screenShakeTimer = 0;
|
||||
int shopVisits = 0;
|
||||
int stageNameNumeral = 0;
|
||||
int stagesWithoutDamage = 0;
|
||||
int stagesWithoutHeartsPicked = 0;
|
||||
int timeCounter = 0;
|
||||
int treasureRoomsVisited = 0;
|
||||
int victoryLap = 0;
|
||||
uint32_t challenge = 0;
|
||||
uint32_t debugCurses = 0;
|
||||
uint32_t debugFlags = 0;
|
||||
uint64_t gameStateFlags = 0;
|
||||
uint8_t restartHoldFrames = 0;
|
||||
|
||||
bool isColorModifierLerped = false;
|
||||
bool isConsoleUsedThisRun = false;
|
||||
bool isDebug = false;
|
||||
bool isFadeInIconShown = false;
|
||||
bool isInstantFadeIn = false;
|
||||
bool isPocketItemRewindSaved = false;
|
||||
bool isRerun = false;
|
||||
bool isRestoringGlowingHourglassState = false;
|
||||
bool isRoomRespawned = false;
|
||||
bool isRoomSnapshotTaken = false;
|
||||
bool isStarted = false;
|
||||
bool isStartingFromState = false;
|
||||
bool isStoringGlowingHourglassState = false;
|
||||
bool isWindowResizePending = false;
|
||||
|
||||
Game();
|
||||
~Game();
|
||||
|
||||
static void LoadConfigXmls();
|
||||
static uint32_t load_bossoverlays_xml(std::string_view path);
|
||||
static void LoadBossRushXml(std::string_view path);
|
||||
void reset_run_state();
|
||||
void ResetState();
|
||||
void level_reset();
|
||||
void create_render_surfaces();
|
||||
|
||||
static void Exit(bool isSaving);
|
||||
void Update();
|
||||
void Render();
|
||||
bool IsPaused();
|
||||
bool IsGreedMode();
|
||||
int GetStageID();
|
||||
};
|
||||
Reference in new issue
Block a user