yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
object_drawer.h
Go to the documentation of this file.
1#ifndef YAZE_APP_ZELDA3_DUNGEON_OBJECT_DRAWER_H
2#define YAZE_APP_ZELDA3_DUNGEON_OBJECT_DRAWER_H
3
4#include <functional>
5#include <unordered_map>
6#include <vector>
7
8#include "absl/status/status.h"
12#include "rom/rom.h"
18
19namespace yaze {
20namespace zelda3 {
21
37 public:
38 explicit ObjectDrawer(Rom* rom, int room_id, const uint8_t* room_gfx_buffer = nullptr);
39
49 absl::Status DrawObject(const RoomObject& object, gfx::BackgroundBuffer& bg1,
51 const gfx::PaletteGroup& palette_group,
52 const DungeonState* state = nullptr,
53 gfx::BackgroundBuffer* layout_bg1 = nullptr);
54
55 struct DoorDef {
58 uint8_t position;
59
60 // Helper to get position coordinates using DoorPositionManager
61 std::pair<int, int> GetTileCoords() const {
63 }
64
65 // Helper to get door dimensions
69 };
70
71 // Chest index tracking for state queries
73
80 void DrawDoor(const DoorDef& door, int door_index, gfx::BackgroundBuffer& bg1,
81 gfx::BackgroundBuffer& bg2, const DungeonState* state = nullptr);
82
90 void DrawPotItem(uint8_t item_id, int x, int y, gfx::BackgroundBuffer& bg);
91
101 absl::Status DrawObjectList(const std::vector<RoomObject>& objects,
104 const gfx::PaletteGroup& palette_group,
105 const DungeonState* state = nullptr,
106 gfx::BackgroundBuffer* layout_bg1 = nullptr);
107
113 int GetDrawRoutineId(int16_t object_id) const;
114
119 return static_cast<int>(draw_routines_.size());
120 }
121
127
136 void DrawTileToBitmap(gfx::Bitmap& bitmap, const gfx::TileInfo& tile_info,
137 int pixel_x, int pixel_y, const uint8_t* tiledata);
138
144 std::pair<int, int> CalculateObjectDimensions(const RoomObject& object);
145
146 protected:
147 // Draw routine function type
148 using DrawRoutine = std::function<void(ObjectDrawer*, const RoomObject&,
150 std::span<const gfx::TileInfo>,
151 const DungeonState*)>;
152
153 // Core draw routines (based on ZScream's subtype1_routines table)
154 void DrawChest(const RoomObject& obj, gfx::BackgroundBuffer& bg,
155 std::span<const gfx::TileInfo> tiles,
156 const DungeonState* state = nullptr);
157
158 void DrawNothing(const RoomObject& obj, gfx::BackgroundBuffer& bg,
159 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
162 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
165 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
166 void DrawRightwards2x4_1to16(const RoomObject& obj,
168 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
170 const RoomObject& obj, gfx::BackgroundBuffer& bg,
171 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
173 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
175 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
177 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
180 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
183 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
186 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
188 const RoomObject& obj, gfx::BackgroundBuffer& bg,
189 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
191 const RoomObject& obj, gfx::BackgroundBuffer& bg,
192 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
194 const RoomObject& obj, gfx::BackgroundBuffer& bg,
195 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
197 const RoomObject& obj, gfx::BackgroundBuffer& bg,
198 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
199 void CustomDraw(const RoomObject& obj, gfx::BackgroundBuffer& bg,
200 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
202 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
205 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
207 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
209 const RoomObject& obj, gfx::BackgroundBuffer& bg,
210 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
212 const RoomObject& obj, gfx::BackgroundBuffer& bg,
213 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
215 const RoomObject& obj, gfx::BackgroundBuffer& bg,
216 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
218 const RoomObject& obj, gfx::BackgroundBuffer& bg,
219 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
221 const RoomObject& obj, gfx::BackgroundBuffer& bg,
222 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
224 const RoomObject& obj, gfx::BackgroundBuffer& bg,
225 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
227 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
229 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
231 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
232
233 // Additional Rightwards draw routines (0x47-0x5E range)
235 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
237 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
239 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
241 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
243 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
244
245 // Corner draw routines
247 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
248
249 // Downwards draw routines
252 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
255 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
258 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
261 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
263 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
265 const RoomObject& obj, gfx::BackgroundBuffer& bg,
266 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
268 const RoomObject& obj, gfx::BackgroundBuffer& bg,
269 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
272 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
274 const RoomObject& obj, gfx::BackgroundBuffer& bg,
275 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
277 const RoomObject& obj, gfx::BackgroundBuffer& bg,
278 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
279
280 // Additional Downwards draw routines (0x70-0x7F range)
283 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
286 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
289 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
292 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
295 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
298 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
301 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
304 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
305
306 // Phase 4 Step 2: Simple Variant Routines (0x80-0x96, 0xB0-0xBD range)
309 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
312 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
315 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
318 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
321 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
324 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
327 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
330 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
333 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
336 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
337
338 // Phase 4 Step 3: Diagonal Ceiling Routines (0xA0-0xAC range)
341 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
344 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
347 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
350 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
351
352 // Phase 4 Step 5: Special Routines (0xC1, 0xCD, 0xCE, 0xDC)
354 std::span<const gfx::TileInfo> tiles);
356 std::span<const gfx::TileInfo> tiles);
358 std::span<const gfx::TileInfo> tiles);
360 std::span<const gfx::TileInfo> tiles);
361
362 // Type 3 / Special Routines
364 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
366 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
368 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
371 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
374 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
376 std::span<const gfx::TileInfo> tiles, int width,
377 int height);
378
379 // Type 2 Special Object Routines (0x122, 0x12C, 0x13E, etc.)
380 void DrawBed4x5(const RoomObject& obj, gfx::BackgroundBuffer& bg,
381 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
383 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
385 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
387 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
388
389 // Type 3 Special Object Routines (pipes, shells, lighting, etc.)
391 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
393 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
395 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
397 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
399 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
401 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
403 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
405 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
407 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
409 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
411 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
413 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
415 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
416
417 // Custom Object Routine
419 std::span<const gfx::TileInfo> tiles, const DungeonState* state = nullptr);
420
421 // Utility methods
422 void WriteTile8(gfx::BackgroundBuffer& bg, int tile_x, int tile_y,
423 const gfx::TileInfo& tile_info);
424 bool IsValidTilePosition(int tile_x, int tile_y) const;
425
426 // Check if a draw routine should render to both BG1 and BG2
427 // Uses metadata instead of hardcoded routine IDs
428 static bool RoutineDrawsToBothBGs(int routine_id);
429
442 void MarkBG1Transparent(gfx::BackgroundBuffer& bg1, int tile_x, int tile_y,
443 int pixel_width, int pixel_height);
444
445 // Door indicator fallback when graphics unavailable
446 void DrawDoorIndicator(gfx::Bitmap& bitmap, int tile_x, int tile_y,
447 int width, int height, DoorType type, DoorDirection direction);
448
449 // Draw routine registry
450 std::unordered_map<int16_t, int> object_to_routine_map_;
451 std::vector<DrawRoutine> draw_routines_;
453
456 mutable int current_chest_index_ = 0;
457 const uint8_t*
458 room_gfx_buffer_; // Room-specific graphics buffer (current_gfx16_)
459
460 // Canvas dimensions in tiles (64x64 = 512x512 pixels)
461 static constexpr int kMaxTilesX = 64;
462 static constexpr int kMaxTilesY = 64;
463};
464
465} // namespace zelda3
466} // namespace yaze
467
468#endif // YAZE_APP_ZELDA3_DUNGEON_OBJECT_DRAWER_H
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:24
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:67
SNES 16-bit tile metadata container.
Definition snes_tile.h:52
static std::pair< int, int > PositionToTileCoords(uint8_t position, DoorDirection direction)
Convert encoded position to tile coordinates.
Interface for accessing dungeon game state.
Draws dungeon objects to background buffers using game patterns.
void DrawDiagonalAcute_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
int GetDrawRoutineId(int16_t object_id) const
Get draw routine ID for an object.
void WriteTile8(gfx::BackgroundBuffer &bg, int tile_x, int tile_y, const gfx::TileInfo &tile_info)
void DrawDiagonalGrave_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawBed4x5(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawClosedChestPlatform(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
void DrawRightwards2x4_1to15or26(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwards2x4_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawTileToBitmap(gfx::Bitmap &bitmap, const gfx::TileInfo &tile_info, int pixel_x, int pixel_y, const uint8_t *tiledata)
Draw a single tile directly to bitmap.
void InitializeDrawRoutines()
Initialize draw routine registry Must be called before drawing objects.
void DrawRightwardsPillar2x4spaced4_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsBottomCorners1x2_1to16_plus13(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwards4x4_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawUtility6x3(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
int GetDrawRoutineCount() const
Get the total number of registered draw routines.
void DrawRightwardsEdge1x1_1to16plus7(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
std::vector< DrawRoutine > draw_routines_
void DrawRightwardsDecor4x2spaced8_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsHammerPegs2x2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsPillar2x4spaced2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawHorizontalTurtleRockPipe(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwards2x2_1to15or32(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDiagonalCeilingBottomRight(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsBlock2x2spaced2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawSingle2x2(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
std::pair< int, int > CalculateObjectDimensions(const RoomObject &object)
Calculate the dimensions (width, height) of an object in pixels.
void DrawDoorSwitcherer(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwards2x2_1to15or32(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
const uint8_t * room_gfx_buffer_
void DrawUtility3x5(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawSingle4x3(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRupeeFloor(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsEdge1x1_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsBar2x3_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
static bool RoutineDrawsToBothBGs(int routine_id)
void DrawDownwardsDecor2x4spaced8_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawNothing(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
absl::Status DrawObjectList(const std::vector< RoomObject > &objects, gfx::BackgroundBuffer &bg1, gfx::BackgroundBuffer &bg2, const gfx::PaletteGroup &palette_group, const DungeonState *state=nullptr, gfx::BackgroundBuffer *layout_bg1=nullptr)
Draw all objects in a room.
void DrawDownwardsDecor4x2spaced4_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsLine1x1_1to16plus1(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDoor(const DoorDef &door, int door_index, gfx::BackgroundBuffer &bg1, gfx::BackgroundBuffer &bg2, const DungeonState *state=nullptr)
Draw a door to background buffers.
void DrawDiagonalCeilingTopLeft(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsTopCorners1x2_1to16_plus13(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsHasEdge1x1_1to16_plus3(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDiagonalAcute_1to16_BothBG(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwards2x2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawPotItem(uint8_t item_id, int x, int y, gfx::BackgroundBuffer &bg)
Draw a pot item visualization.
void DrawLargeCanvasObject(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, int width, int height)
void Draw4x4Corner_BothBG(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawBigLightBeam(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsCannonHole3x6_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwards2x2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsLine1x1_1to16plus1(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawVerticalTurtleRockPipe(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwards4x2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawCorner4x4(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsHasEdge1x1_1to16_plus3(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsHammerPegs2x2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwards2x4_1to16_BothBG(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawCustomObject(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsStatue2x3spaced2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDiagonalCeilingTopRight(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawWaterFace(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsDecor4x3spaced4_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsShelf4x4_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDiagonalGrave_1to16_BothBG(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawMovingWallEast(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
void DrawDownwardsPots2x2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
std::unordered_map< int16_t, int > object_to_routine_map_
void DrawDownwardsFloor4x4_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsDecor3x4spaced2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
static constexpr int kMaxTilesX
void DrawRightwardsPots2x2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawActual4x4(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawOpenChestPlatform(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
void DrawRightwards1x1Solid_1to16_plus3(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void MarkBG1Transparent(gfx::BackgroundBuffer &bg1, int tile_x, int tile_y, int pixel_width, int pixel_height)
Mark BG1 pixels as transparent where BG2 overlay objects are drawn.
void DrawChest(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsDecor4x4spaced2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void CustomDraw(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawSolidWallDecor3x4(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDiagonalCeilingBottomLeft(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsCannonHole4x3_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawWeirdCornerBottom_BothBG(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwards3x6(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsHasEdge1x1_1to16_plus2(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwards4x2_1to15or26(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
ObjectDrawer(Rom *rom, int room_id, const uint8_t *room_gfx_buffer=nullptr)
void DrawRightwardsDecor4x4spaced2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawSingle4x4(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawLightBeam(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
absl::Status DrawObject(const RoomObject &object, gfx::BackgroundBuffer &bg1, gfx::BackgroundBuffer &bg2, const gfx::PaletteGroup &palette_group, const DungeonState *state=nullptr, gfx::BackgroundBuffer *layout_bg1=nullptr)
Draw a room object to background buffers.
void DrawWeirdCornerTop_BothBG(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwards4x2_1to16_BothBG(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsDecor3x4spaced4_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsRightCorners2x1_1to16_plus12(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
static constexpr int kMaxTilesY
void DrawRightwardsDoubled2x2spaced2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawBossShell4x4(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwards1x2_1to16_plus2(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawGanonTriforceFloorDecor(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsBar4x3_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
bool IsValidTilePosition(int tile_x, int tile_y) const
void DrawRightwardsDecor2x2spaced12_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsBlock2x2spaced2_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDoorIndicator(gfx::Bitmap &bitmap, int tile_x, int tile_y, int width, int height, DoorType type, DoorDirection direction)
void DrawDownwardsHasEdge1x1_1to16_plus23(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
std::function< void(ObjectDrawer *, const RoomObject &, gfx::BackgroundBuffer &, std::span< const gfx::TileInfo >, const DungeonState *)> DrawRoutine
void DrawDownwards1x1Solid_1to16_plus3(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawSomariaLine(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawArcheryGameTargetDoor(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawRightwardsBigRail1x3_1to16plus5(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawMovingWallWest(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
void DrawDownwardsLeftCorners2x1_1to16_plus12(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsDecor2x2spaced12_1to16(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
void DrawDownwardsBigRail3x1_1to16plus5(const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles, const DungeonState *state=nullptr)
constexpr DoorDimensions GetDoorDimensions(DoorDirection dir)
Get door dimensions based on direction.
Definition door_types.h:192
DoorType
Door types from ALTTP.
Definition door_types.h:33
DoorDirection
Door direction on room walls.
Definition door_types.h:18
Represents a group of palettes.
Door dimensions in tiles (8x8 pixel tiles)
Definition door_types.h:178
std::pair< int, int > GetTileCoords() const
DoorDimensions GetDimensions() const