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. | |
| 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 |
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.
Selection uses this full rendered footprint. Shape-aware pixel hit testing belongs in the editor; shrinking this rectangle can make visible edge tiles impossible to select.
Definition at line 45 of file object_geometry.h.
|
inline |
Definition at line 55 of file object_geometry.h.
References min_x_tiles, and width_tiles.
|
inline |
Definition at line 56 of file object_geometry.h.
References height_tiles, and min_y_tiles.
|
inline |
Definition at line 57 of file object_geometry.h.
References width_tiles.
Referenced by GetBG1MaskRect().
|
inline |
Definition at line 58 of file object_geometry.h.
References height_tiles.
Referenced by GetBG1MaskRect().
|
inline |
Definition at line 61 of file object_geometry.h.
References min_x_tiles.
|
inline |
Definition at line 62 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 71 of file object_geometry.h.
References is_bg2_overlay, and width_tiles.
|
inline |
Get the selection bounds for hit testing.
Definition at line 76 of file object_geometry.h.
References height_tiles, min_x_tiles, min_y_tiles, 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 87 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 47 of file object_geometry.h.
Referenced by GetBG1MaskRect(), GetSelectionBounds(), max_x_tiles(), yaze::zelda3::ObjectGeometry::MeasureRoutineForState(), and min_x_pixels().
| int yaze::zelda3::GeometryBounds::min_y_tiles = 0 |
Definition at line 48 of file object_geometry.h.
Referenced by GetBG1MaskRect(), GetSelectionBounds(), max_y_tiles(), yaze::zelda3::ObjectGeometry::MeasureRoutineForState(), and min_y_pixels().
| int yaze::zelda3::GeometryBounds::width_tiles = 0 |
Definition at line 49 of file object_geometry.h.
Referenced by GetSelectionBounds(), max_x_tiles(), yaze::zelda3::ObjectGeometry::MeasureRoutineForState(), RequiresBG1Mask(), and width_pixels().
| int yaze::zelda3::GeometryBounds::height_tiles = 0 |
Definition at line 50 of file object_geometry.h.
Referenced by GetSelectionBounds(), height_pixels(), max_y_tiles(), and yaze::zelda3::ObjectGeometry::MeasureRoutineForState().
| bool yaze::zelda3::GeometryBounds::is_bg2_overlay = false |
Definition at line 53 of file object_geometry.h.
Referenced by yaze::zelda3::ObjectGeometry::MeasureForLayerCompositing(), yaze::zelda3::ObjectGeometry::MeasureRoutineForState(), and RequiresBG1Mask().