- anm2.h/.cpp take over ANM2, AnimationState, LayerState, AnmCache and the frame data. They read Anm2Ed's JSON documents with simdjson and play them as the game does (interpolation baked at load). src/anm2/ and msvc.h are retired. - font, formatted_text, string_table and rich_text take over the text classes. FormattedText::parse is still bit-exact against its assembly. - options_config and challenge_params take over OptionsConfig, ChallengeParams and the .ini helpers. The tests include Save's exact bytes. - platform.h/.cpp and main.cpp run IsaacMain on SDL3: the window and GL context open, and the run stops at the first built-in shader (FUN_00a13fa0). - source_tree.py: a taken-over parent stays bytes, taken-over methods are not re-emitted as a namespace, and every address in a (a, b, c to d) list on a comment counts as taken over. - log.h: reconstruction_missing() for a taken-over class's methods that are not written yet. 206 functions taken over, boot path 89/615. The full build waits for wave B: item_config, entity_config and mod_manager still use the old APIs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "anm2.h"
|
|
#include "font.h"
|
|
#include <map>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
// What a rich text icon shows, each but the collectible an animation of gfx/ui/text_icons.anm2.
|
|
enum RichTextIconType : int
|
|
{
|
|
ICON_PLAYER,
|
|
ICON_PICKUP,
|
|
ICON_COLLECTIBLE,
|
|
ICON_ROOM
|
|
};
|
|
|
|
// The icons rich text draws inline from gfx/ui/text_icons.anm2: the sprite, the height icons are fit to, the icon last
|
|
// set and the collectible images loaded for it so far.
|
|
// Its drawing (render, get_size, set_icon) waits on the ANM2 and graphics rework and is not reconstructed yet.
|
|
struct RichTextIcon : ANM2
|
|
{
|
|
std::map<int, TexturePtr> images;
|
|
float maxHeight = 0;
|
|
int iconId = 0;
|
|
RichTextIconType iconType = ICON_PLAYER;
|
|
|
|
static std::string_view get_animation_name(RichTextIconType type);
|
|
};
|
|
|
|
// Text drawn in a font with icons inline (hearts, pickups, collectibles, rooms), its lines spaced by lineSpacing.
|
|
// Its layout and drawing (rich_text_layout, rich_text_render) are not reconstructed yet.
|
|
// Destruction (009efa10) is the default: the font unloads and the icons go with their pointer.
|
|
struct RichText
|
|
{
|
|
Font font;
|
|
std::string fontPath;
|
|
std::unique_ptr<RichTextIcon> icons;
|
|
float lineSpacing = 1;
|
|
|
|
void load_font(std::string_view path);
|
|
};
|