Curation round 8: the first room plays: Isaac walks and shoots tears
Eight agents took over Room::Init's pieces, RailManager, Room::Render/render_lighting/Update, the GridEntity hierarchy (walls, doors, rocks, pits, poop ...), Game::Update and interpolate_update, the run's save, update_ingame_input, Game::Spawn with the entity factory and grid collision, the player's movement and tears through Weapon/Weapon_Tears, PlayerManager's positions, the camera focus, MinimapConfig, PlayerHUD, mod shader rendering, Entity_Tear and Entity_Effect. Integration wrote Level::get_secret_exit_kind, shared the secret-exit enum (four copies merged) and fixed the generator's vtable-stub check (word boundary and namespace, not a substring). Under gdb a run reaches the first room: doors, HUD with hearts and minimap, WASD movement with acceleration, arrow-key tears that fly and splash. Floor and walls (Backdrop::RenderFloor/RenderWalls) and room transitions are next. The official build/isaac reaches the start room and stops at Entity_NPC::Redirect. 2770 functions taken over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b85591bdf4
commit
69a354f843
140 files changed
+23561
-20206
No files matched your search
@@ -0,0 +1,88 @@
|
||||
#include "beast_arena.h"
|
||||
#include "game.h"
|
||||
#include "log.h"
|
||||
#include "room.h"
|
||||
|
||||
constexpr int STAGE_ID_HOME = 35;
|
||||
constexpr int BACKGROUND_LAYER_COUNT = 15;
|
||||
constexpr int BACKGROUND_GLOW_LAYER = 8;
|
||||
constexpr int BACKGROUND_ADDITIVE_LAYER = 13;
|
||||
constexpr int BACKGROUND_MULTIPLY_LAYER = 14;
|
||||
constexpr unsigned int WRAP_REPEAT = 0;
|
||||
constexpr unsigned int WRAP_CLAMP = 1;
|
||||
constexpr float BACKGROUND_PARALLAX = 0.1f;
|
||||
|
||||
// The background's layer blending: plain alpha, the glow over what is behind it, added light, and a darkening multiply.
|
||||
// The source factor takes premultiplied alpha into account.
|
||||
static std::array<int, BLEND_PART_COUNT> blend_get(int layerId)
|
||||
{
|
||||
int source = KAGE::Graphics::manager.isPremultipliedAlpha ? BLEND_FACTOR_ONE : BLEND_FACTOR_SRC_ALPHA;
|
||||
|
||||
if (layerId == BACKGROUND_GLOW_LAYER)
|
||||
return {BLEND_EQUATION_ADD, source, BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, BLEND_FACTOR_ONE,
|
||||
BLEND_FACTOR_ONE_MINUS_SRC_ALPHA};
|
||||
if (layerId == BACKGROUND_ADDITIVE_LAYER)
|
||||
return {BLEND_EQUATION_ADD, source, BLEND_FACTOR_ONE, BLEND_FACTOR_ONE, BLEND_FACTOR_ONE};
|
||||
if (layerId == BACKGROUND_MULTIPLY_LAYER)
|
||||
return {BLEND_EQUATION_ADD, BLEND_FACTOR_ZERO, BLEND_FACTOR_SRC_COLOR, BLEND_FACTOR_ZERO, BLEND_FACTOR_SRC_COLOR};
|
||||
return {BLEND_EQUATION_ADD, BLEND_FACTOR_ONE, BLEND_FACTOR_ZERO, BLEND_FACTOR_ONE, BLEND_FACTOR_ZERO};
|
||||
}
|
||||
|
||||
// 00839b80 Turns on in Home's Beast crawlspace: loads the hell background once, wraps its layers sideways, sets their
|
||||
// blending and stops the scroll.
|
||||
void BeastArena::init()
|
||||
{
|
||||
RoomConfig_Room* config = g_game->room->descriptor->data;
|
||||
|
||||
isActive = config && config->type == ROOM_DUNGEON && config->stageId == STAGE_ID_HOME;
|
||||
if (!isActive) return;
|
||||
|
||||
if (!background.isLoaded)
|
||||
{
|
||||
background.Load("gfx/backdrop/hell/background.anm2", GRAPHICS_DEFER);
|
||||
background.bitflags |= ANIM_RENDER_SHADER_KEPT;
|
||||
background.LoadGraphics();
|
||||
background.Play(background.GetDefaultAnimationName(), PLAY_FORCED);
|
||||
}
|
||||
for (LayerState& layer : background.layerStates)
|
||||
{
|
||||
layer.wrapSMode = WRAP_REPEAT;
|
||||
layer.wrapTMode = WRAP_CLAMP;
|
||||
}
|
||||
for (int i = 0; i < BACKGROUND_LAYER_COUNT; i++) background.GetLayer(i)->blendMode = blend_get(i);
|
||||
scrollRendered = 0;
|
||||
scrollSpeed = 0;
|
||||
scroll = 0;
|
||||
}
|
||||
|
||||
// 0083a080 Animates the background, scrolls it, and carries the room's entities along: a tenth as far on the
|
||||
// background sorting layer, the players and familiars not at all. The Beast's second variant moves its target too,
|
||||
// and the players collide with the grid where they are.
|
||||
void BeastArena::update()
|
||||
{
|
||||
if (!isActive) return;
|
||||
|
||||
background.Update();
|
||||
scroll += scrollSpeed;
|
||||
scrollRendered = scroll;
|
||||
|
||||
for (Entity* entity : g_game->room->entityList.updateEL)
|
||||
{
|
||||
if (entity->type == ENTITY_PLAYER)
|
||||
{
|
||||
entity->PlayerCollideWithGrid(GRID_COLLISION_APPLY);
|
||||
continue;
|
||||
}
|
||||
if (entity->type == ENTITY_FAMILIAR) continue;
|
||||
|
||||
float shift = entity->sortingLayer == SORTING_BACKGROUND ? scrollSpeed * BACKGROUND_PARALLAX : scrollSpeed;
|
||||
entity->pos.x += shift;
|
||||
if (entity->type == ENTITY_BEAST && entity->variant == 1) entity->targetPosition.x += scrollSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
// 0083a1b0 Draws the background's light layer over the screen, following the camera.
|
||||
void BeastArena::render_light()
|
||||
{
|
||||
reconstruction_missing("BeastArena::render_light 0083a1b0");
|
||||
}
|
||||
Reference in new issue
Block a user