1#ifndef YAZE_ZELDA3_DUNGEON_GEOMETRY_OBJECT_GEOMETRY_H
2#define YAZE_ZELDA3_DUNGEON_GEOMETRY_OBJECT_GEOMETRY_H
6#include <unordered_map>
9#include "absl/status/statusor.h"
125 int routine_id,
const RoomObject&
object)
const;
143 int routine_id,
const RoomObject&
object)
const;
Side-car geometry engine that replays draw routines against an off-screen buffer to calculate real ex...
static bool IsDiagonalCeilingRoutine(int routine_id)
Check if a routine ID corresponds to a diagonal ceiling.
std::vector< DrawRoutineInfo > routines_
absl::StatusOr< GeometryBounds > MeasureForLayerCompositing(int routine_id, const RoomObject &object) const
Measure bounds for a BG2 overlay object and mark it for masking.
absl::StatusOr< GeometryBounds > MeasureRoutine(const DrawRoutineInfo &routine, const RoomObject &object) const
std::unordered_map< int, DrawRoutineInfo > routine_map_
const DrawRoutineInfo * LookupRoutine(int routine_id) const
absl::StatusOr< GeometryBounds > MeasureByRoutineId(int routine_id, const RoomObject &object) const
static GeometryBounds ApplySelectionBounds(GeometryBounds render_bounds, int routine_id)
Compute tighter selection bounds for diagonal shapes.
static ObjectGeometry & Get()
static bool IsLayerOneRoutine(int routine_id)
Get list of routine IDs that draw to BG2 layer.
Metadata about a draw routine.
Bounding box result for a draw routine execution.
std::tuple< int, int, int, int > GetBG1MaskRect(int obj_x, int obj_y) const
Get the BG1 mask rectangle in pixel coordinates.
std::optional< SelectionRect > selection_bounds
SelectionRect GetSelectionBounds() const
Get the selection bounds for hit testing.
int height_pixels() const
bool RequiresBG1Mask() const
Check if this object requires BG1 masking.
bool HasTighterSelectionBounds() const
Check if this object has a tighter selection hitbox.
Simple rectangle for selection bounds.
int height_pixels() const