Bounding box result for a draw routine execution. More...
#include <object_geometry.h>
Public Member Functions | |
| int | max_x_tiles () const |
| int | max_y_tiles () const |
| int | width_pixels () const |
| int | height_pixels () const |
| int | min_x_pixels () const |
| int | min_y_pixels () const |
| bool | RequiresBG1Mask () const |
| Check if this object requires BG1 masking. | |
| bool | HasTighterSelectionBounds () const |
| Check if this object has a tighter selection hitbox. | |
| SelectionRect | GetSelectionBounds () const |
| Get the selection bounds for hit testing. | |
| std::tuple< int, int, int, int > | GetBG1MaskRect (int obj_x, int obj_y) const |
| Get the BG1 mask rectangle in pixel coordinates. | |
Public Attributes | |
| int | min_x_tiles = 0 |
| int | min_y_tiles = 0 |
| int | width_tiles = 0 |
| int | height_tiles = 0 |
| bool | is_bg2_overlay = false |
| std::optional< SelectionRect > | selection_bounds |
Bounding box result for a draw routine execution.
All values are in tile units. Convenience helpers expose pixel sizes for callers that need screen-space values.
For BG2 overlay objects (Layer 1 objects), the bounds also serve as the BG1 mask rectangle - the area where BG1 pixels should be transparent to allow BG2 content to show through during compositing.
For triangular shapes (diagonal ceilings 0xA0-0xA3), the selection_bounds provides a tighter hitbox than the full render_bounds bounding box.
Definition at line 42 of file object_geometry.h.
|
inline |
Definition at line 56 of file object_geometry.h.
References min_x_tiles, and width_tiles.
|
inline |
Definition at line 57 of file object_geometry.h.
References height_tiles, and min_y_tiles.
|
inline |
Definition at line 58 of file object_geometry.h.
References width_tiles.
Referenced by GetBG1MaskRect().
|
inline |
Definition at line 59 of file object_geometry.h.
References height_tiles.
Referenced by GetBG1MaskRect().
|
inline |
Definition at line 62 of file object_geometry.h.
References min_x_tiles.
|
inline |
Definition at line 63 of file object_geometry.h.
References min_y_tiles.
|
inline |
Check if this object requires BG1 masking.
BG2 overlay objects need corresponding pixels in BG1 marked as transparent so the BG2 content shows through during layer compositing. 94 rooms in vanilla ALTTP have such objects.
Definition at line 72 of file object_geometry.h.
References is_bg2_overlay, and width_tiles.
|
inline |
Check if this object has a tighter selection hitbox.
For non-rectangular shapes like diagonal ceilings, the selection_bounds provides a more accurate hitbox for mouse interaction.
Definition at line 80 of file object_geometry.h.
References selection_bounds.
|
inline |
Get the selection bounds for hit testing.
Returns selection_bounds if set, otherwise returns the full render bounds.
Definition at line 87 of file object_geometry.h.
References height_tiles, min_x_tiles, min_y_tiles, selection_bounds, and width_tiles.
|
inline |
Get the BG1 mask rectangle in pixel coordinates.
| obj_x | Object's base X position in tiles |
| obj_y | Object's base Y position in tiles |
Definition at line 101 of file object_geometry.h.
References height_pixels(), min_x_tiles, min_y_tiles, and width_pixels().

| int yaze::zelda3::GeometryBounds::min_x_tiles = 0 |
Definition at line 44 of file object_geometry.h.
Referenced by yaze::zelda3::ObjectGeometry::ApplySelectionBounds(), GetBG1MaskRect(), GetSelectionBounds(), max_x_tiles(), yaze::zelda3::ObjectGeometry::MeasureRoutine(), and min_x_pixels().
| int yaze::zelda3::GeometryBounds::min_y_tiles = 0 |
Definition at line 45 of file object_geometry.h.
Referenced by yaze::zelda3::ObjectGeometry::ApplySelectionBounds(), GetBG1MaskRect(), GetSelectionBounds(), max_y_tiles(), yaze::zelda3::ObjectGeometry::MeasureRoutine(), and min_y_pixels().
| int yaze::zelda3::GeometryBounds::width_tiles = 0 |
Definition at line 46 of file object_geometry.h.
Referenced by yaze::zelda3::ObjectGeometry::ApplySelectionBounds(), GetSelectionBounds(), max_x_tiles(), yaze::zelda3::ObjectGeometry::MeasureRoutine(), RequiresBG1Mask(), and width_pixels().
| int yaze::zelda3::GeometryBounds::height_tiles = 0 |
Definition at line 47 of file object_geometry.h.
Referenced by yaze::zelda3::ObjectGeometry::ApplySelectionBounds(), GetSelectionBounds(), height_pixels(), max_y_tiles(), and yaze::zelda3::ObjectGeometry::MeasureRoutine().
| bool yaze::zelda3::GeometryBounds::is_bg2_overlay = false |
Definition at line 50 of file object_geometry.h.
Referenced by yaze::zelda3::ObjectGeometry::MeasureForLayerCompositing(), yaze::zelda3::ObjectGeometry::MeasureRoutine(), and RequiresBG1Mask().
| std::optional<SelectionRect> yaze::zelda3::GeometryBounds::selection_bounds |
Definition at line 54 of file object_geometry.h.
Referenced by yaze::zelda3::ObjectGeometry::ApplySelectionBounds(), GetSelectionBounds(), and HasTighterSelectionBounds().