Curation round 9: floors and walls, room transitions, collision, the first enemies, saving, damage, pickups
Seven agents took over the backdrop's floor and wall rendering, room transitions (StartRoomTransition, on_leave, room_enter), grid collision with tear hits and decal baking, Entity_NPC's core with the AI dispatch and the first enemies (flies, Gaper, Pooter, Clotty, Horf, Dip, Spider), the run's save, player damage, PlayerManager::Update, ShowName, pickups, slots and the common effects. Integration added LuaEngine::PostNewLevel/PostNewRoom, one shared lua_callback_check (4 copies merged) and the enemy type range the original checks. Under gdb a run draws its rooms with floors and walls, walks between rooms, fights Gapers with contact damage and the damage flash, and collects pickups. Next: tears hitting enemies, pathfinding, item pedestals, death. 2891 functions taken over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
69a354f843
commit
48933cd312
59 files changed
+13387
-6056
No files matched your search
+66
-9
@@ -6,10 +6,30 @@
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
// backdrops.xml fills ids 1 to 62. Id 0 is the default the others start from.
|
||||
constexpr int BACKDROP_COUNT = 63;
|
||||
|
||||
// How a piece of a backdrop sheet is mirrored as it is drawn, by bit.
|
||||
enum Flip
|
||||
{
|
||||
FLIP_NONE,
|
||||
FLIP_X,
|
||||
FLIP_Y,
|
||||
FLIP_XY
|
||||
};
|
||||
|
||||
// Which walls a wall detail sprite shows its layers on, by bit: the layers named h... on the top and bottom walls, the
|
||||
// layers named v... on the side walls.
|
||||
enum WallSides
|
||||
{
|
||||
WALL_SIDES_NONE,
|
||||
WALL_SIDES_HORIZONTAL,
|
||||
WALL_SIDES_VERTICAL,
|
||||
WALL_SIDES_ALL
|
||||
};
|
||||
|
||||
// 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/.
|
||||
@@ -37,6 +57,38 @@ struct BackdropConfig
|
||||
bool isReverseWaterGfx = false;
|
||||
};
|
||||
|
||||
// A cell of wall drawn into the wall surface, for the effects its backdrop adds there: where it was drawn, its place on
|
||||
// the sheet's block (slotX along the top wall, slotY down the side wall), the sheet's wall row and its variant.
|
||||
struct WallSlot
|
||||
{
|
||||
DestinationQuad quad{};
|
||||
int slotX = 0;
|
||||
int slotY = 0;
|
||||
int variant = 0;
|
||||
int wallRow = 0;
|
||||
Flip flip = FLIP_NONE;
|
||||
};
|
||||
|
||||
// A corner of the room's walls a wall detail sprite is drawn at, and how likely each of its layers shows.
|
||||
struct WallDetail
|
||||
{
|
||||
Vector position{};
|
||||
float chance = 0;
|
||||
Flip flip = FLIP_NONE;
|
||||
WallSides sides = WALL_SIDES_NONE;
|
||||
};
|
||||
|
||||
// One row of the start room's control icons, laid out from the left: each icon's button frame and position, the
|
||||
// cursor the icons are drawn from, and the controller whose bindings they show.
|
||||
struct ControlRow
|
||||
{
|
||||
std::vector<int> frames;
|
||||
std::vector<float> positions;
|
||||
float cursorX = 0;
|
||||
float x = 0;
|
||||
int controllerIndex = 0;
|
||||
};
|
||||
|
||||
// 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.
|
||||
@@ -65,20 +117,25 @@ struct 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);
|
||||
DestinationQuad 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 render_floor_to_target(uint32_t variant, const KAGE::Graphics::ImagePtr& sheet,
|
||||
const KAGE::Graphics::ImagePtr& alternate);
|
||||
void PreRenderControls();
|
||||
void render_control_icon(ControlRow& row, int action);
|
||||
void pre_render_walls();
|
||||
void spawn_wall_details(const WallSlot& slot);
|
||||
void render_wall_detail(const WallDetail& detail);
|
||||
|
||||
void RenderFloor(Vector renderOffset, ColorMod color);
|
||||
void render_floor_surface(Vector renderOffset, ColorMod color);
|
||||
void RenderWalls(Vector renderOffset, ColorMod color);
|
||||
void render_wall_borders(Vector roomTopLeftPos, Vector roomSize);
|
||||
void RenderWater(Vector renderOffset);
|
||||
};
|
||||
|
||||
int controller_button_to_glyph_frame(int button);
|
||||
Vector backdrop_detail_to_world_pos(Vector position);
|
||||
Vector backdrop_wall_normal(int slotX, Flip flip);
|
||||
Reference in new issue
Block a user