Files
isaac-port/src/minimap.h
T
shweetandClaude Opus 5.5 69a354f843 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>
2026-11-20 06:43:01 -05:00

80 lines
2.2 KiB
C++

#pragma once
#include "anm2.h"
#include "kage_graphics.h"
#include <array>
// How the map shows: the small one in the corner, the large one while the map button is held, or the large one left
// open by a tap.
enum MinimapState : int
{
MINIMAP_SMALL,
MINIMAP_HELD,
MINIMAP_PINNED
};
// The two maps, by their index in Minimap::configs.
enum MinimapSize : int
{
MINIMAP_SIZE_SMALL,
MINIMAP_SIZE_LARGE,
MINIMAP_SIZE_COUNT
};
// Copies and destruction are the defaults.
// One of the two maps (MinimapConfig): its frame sheet, the surface the rooms are drawn on, the room cell size and the
// gap between cells, how many cells fit across and down, the margin around them, the room icons' size and how many
// a cell shows, the point of the surface the map centers on, the drawn rooms' bounds and its alpha.
struct MinimapConfig
{
ANM2 mapSprite;
KAGE::Graphics::ImagePtr surface;
Vector boundsMax{};
Vector boundsMin{};
Vector cellSize{};
Vector center{};
Vector iconSize{};
float alpha = 0;
float gap = 0;
float margin = 0;
int columns = 0;
int iconLimit = 0;
int rows = 0;
void refresh();
};
// Destruction (0098b1d0) is the default.
// The floor map (Minimap): the small and large maps, how long the map button is held, the item and curse icons beside
// the map, the question mark the curse of the lost shows instead, the shake when it is hit, and the time and score
// written under it. largeMapOffset and largeMapScale move and shrink the large map's surface.
class Minimap
{
public:
std::array<MinimapConfig, MINIMAP_SIZE_COUNT> configs;
KAGE::Graphics::ImagePtr questionMarkImage;
ANM2 hudPickupSprite;
ANM2 iconsSprite;
ANM2 itemIconsSprite;
Vector largeMapOffset{};
Vector shakeOffset{};
MinimapState state = MINIMAP_SMALL;
float largeMapScale = 1;
int holdTime = 0;
int shakeDuration = 0;
bool isPinned = false;
void Init();
void Refresh();
void Update();
void Render();
Vector GetDisplayedSize();
private:
bool state_update(bool isHeld);
void render_small(float alpha, bool isLost);
void render_large(float alpha, bool isLost);
void render_icons(Vector position, float alpha);
void render_score_time(float alpha);
};