1#ifndef YAZE_APP_ZELDA3_DUNGEON_ROOM_OBJECT_H
2#define YAZE_APP_ZELDA3_DUNGEON_ROOM_OBJECT_H
8#include "absl/strings/string_view.h"
61 RoomObject(int16_t
id, uint8_t x, uint8_t y, uint8_t size, uint8_t layer = 0)
79 for (
int i = 0; i < nbr; i++) {
86 std::vector<uint8_t>& current_gfx16,
87 std::vector<uint8_t>& tiles_bg1_buffer,
88 std::vector<uint8_t>& tiles_bg2_buffer,
89 uint16_t tile_under = 0xFFFF);
131 Subtype1(int16_t
id, uint8_t x, uint8_t y, uint8_t size, uint8_t layer,
134 auto rom_data =
rom()->data();
136 static_cast<int16_t
>(
143 void Draw(std::vector<uint8_t>& current_gfx16,
144 std::vector<uint8_t>& tiles_bg1_buffer,
145 std::vector<uint8_t>& tiles_bg2_buffer) {
149 tiles_bg1_buffer, tiles_bg2_buffer);
161 Subtype2(int16_t
id, uint8_t x, uint8_t y, uint8_t size, uint8_t layer)
163 auto rom_data =
rom()->data();
165 static_cast<int16_t
>(
172 void Draw(std::vector<uint8_t>& current_gfx16,
173 std::vector<uint8_t>& tiles_bg1_buffer,
174 std::vector<uint8_t>& tiles_bg2_buffer) {
175 for (
int i = 0; i < 8; i++) {
188 Subtype3(int16_t
id, uint8_t x, uint8_t y, uint8_t size, uint8_t layer)
190 auto rom_data =
rom()->data();
192 static_cast<int16_t
>(
199 void Draw(std::vector<uint8_t>& current_gfx16,
200 std::vector<uint8_t>& tiles_bg1_buffer,
201 std::vector<uint8_t>& tiles_bg2_buffer) {
202 for (
int i = 0; i < 8; i++) {
209constexpr static inline absl::string_view Type1RoomObjectNames[] = {
211 "Wall (top, north) ↔",
212 "Wall (top, south) ↔",
213 "Wall (bottom, north) ↔",
214 "Wall (bottom, south) ↔",
215 "Wall columns (north) ↔",
216 "Wall columns (south) ↔",
217 "Deep wall (north) ↔",
218 "Deep wall (south) ↔",
219 "Diagonal wall A ◤ (top) ↔",
220 "Diagonal wall A ◣ (top) ↔",
221 "Diagonal wall A ◥ (top) ↔",
222 "Diagonal wall A ◢ (top) ↔",
223 "Diagonal wall B ◤ (top) ↔",
224 "Diagonal wall B ◣ (top) ↔",
225 "Diagonal wall B ◥ (top) ↔",
226 "Diagonal wall B ◢ (top) ↔",
227 "Diagonal wall C ◤ (top) ↔",
228 "Diagonal wall C ◣ (top) ↔",
229 "Diagonal wall C ◥ (top) ↔",
230 "Diagonal wall C ◢ (top) ↔",
231 "Diagonal wall A ◤ (bottom) ↔",
232 "Diagonal wall A ◣ (bottom) ↔",
233 "Diagonal wall A ◥ (bottom) ↔",
234 "Diagonal wall A ◢ (bottom) ↔",
235 "Diagonal wall B ◤ (bottom) ↔",
236 "Diagonal wall B ◣ (bottom) ↔",
237 "Diagonal wall B ◥ (bottom) ↔",
238 "Diagonal wall B ◢ (bottom) ↔",
239 "Diagonal wall C ◤ (bottom) ↔",
240 "Diagonal wall C ◣ (bottom) ↔",
241 "Diagonal wall C ◥ (bottom) ↔",
242 "Diagonal wall C ◢ (bottom) ↔",
245 "Pit edge ┏━┓ A (north) ↔",
246 "Pit edge ┏━┓ B (north) ↔",
247 "Pit edge ┏━┓ C (north) ↔",
248 "Pit edge ┏━┓ D (north) ↔",
249 "Pit edge ┏━┓ E (north) ↔",
250 "Pit edge ┗━┛ (south) ↔",
251 "Pit edge ━━━ (south) ↔",
252 "Pit edge ━━━ (north) ↔",
253 "Pit edge ━━┛ (south) ↔",
254 "Pit edge ┗━━ (south) ↔",
255 "Pit edge ━━┓ (north) ↔",
256 "Pit edge ┏━━ (north) ↔",
257 "Rail wall (north) ↔",
258 "Rail wall (south) ↔",
265 "Drapes (west, odd) ↔",
268 "Wall decors (north) ↔",
269 "Wall decors (south) ↔",
272 "Supports (north) ↔",
273 "Water edge ┏━┓ (concave) ↔",
274 "Water edge ┗━┛ (concave) ↔",
275 "Water edge ┏━┓ (convex) ↔",
276 "Water edge ┗━┛ (convex) ↔",
277 "Water edge ┏━┛ (concave) ↔",
278 "Water edge ┗━┓ (concave) ↔",
279 "Water edge ┗━┓ (convex) ↔",
280 "Water edge ┏━┛ (convex) ↔",
285 "Supports (south) ↔",
291 "Cannon hole A (north) ↔",
292 "Cannon hole A (south) ↔",
295 "Wall torches (north) ↔",
296 "Wall torches (south) ↔",
301 "Cannon hole B (north) ↔",
302 "Cannon hole B (south) ↔",
307 "Wall (top, west) ↕",
308 "Wall (top, east) ↕",
309 "Wall (bottom, west) ↕",
310 "Wall (bottom, east) ↕",
311 "Wall columns (west) ↕",
312 "Wall columns (east) ↕",
313 "Deep wall (west) ↕",
314 "Deep wall (east) ↕",
318 "Rail wall (west) ↕",
319 "Rail wall (east) ↕",
328 "Wall decors (west) ↕",
329 "Wall decors (east) ↕",
331 "Water edge (west) ↕",
332 "Water edge (east) ↕",
337 "Wall torches (west) ↕",
338 "Wall torches (east) ↕",
339 "Wall decors tight A (west) ↕",
340 "Wall decors tight A (east) ↕",
341 "Wall decors tight B (west) ↕",
342 "Wall decors tight B (east) ↕",
343 "Cannon hole (west) ↕",
344 "Cannon hole (east) ↕",
349 "Jump ledge (west) ↕",
350 "Jump ledge (east) ↕",
354 "Wall flair (west) ↕",
355 "Wall flair (east) ↕",
370 "Diagonal ceiling A ◤",
371 "Diagonal ceiling A ◣",
372 "Diagonal ceiling A ◥",
373 "Diagonal ceiling A ◢",
375 "Diagonal layer 2 mask A ◤",
376 "Diagonal layer 2 mask A ◣",
377 "Diagonal layer 2 mask A ◥",
378 "Diagonal layer 2 mask A ◢",
379 "Diagonal layer 2 mask B ◤",
380 "Diagonal layer 2 mask B ◣",
381 "Diagonal layer 2 mask B ◥",
382 "Diagonal layer 2 mask B ◢",
386 "Jump ledge (north) ↔",
387 "Jump ledge (south) ↔",
389 "Rug trim (north) ↔",
390 "Rug trim (south) ↔",
391 "Archery game curtains ↔",
392 "Wall flair (north) ↔",
393 "Wall flair (south) ↔",
397 "Fake pressure plates ↔",
403 "Chest platform (tall) ⇲",
404 "Layer 2 pit mask (large) ⇲",
405 "Layer 2 pit mask (medium) ⇲",
408 "Layer 2 mask (large) ⇲",
411 "Flood water (medium) ⇲ ",
415 "Moving wall (west) ⇲",
416 "Moving wall (east) ⇲",
425 "Layer 2 mask (medium) ⇲",
426 "Flood water (large) ⇲",
427 "Layer 2 swim mask ⇲",
428 "Flood water B (large) ⇲",
430 "Chest platform (short) ⇲",
437 "Conveyor upwards ⇲",
438 "Conveyor downwards ⇲",
439 "Conveyor leftwards ⇲",
440 "Conveyor rightwards ⇲",
441 "Heavy current water ⇲",
460constexpr static inline absl::string_view Type2RoomObjectNames[] = {
461 "Corner (top, concave) ▛",
462 "Corner (top, concave) ▙",
463 "Corner (top, concave) ▜",
464 "Corner (top, concave) ▟",
465 "Corner (top, convex) ▟",
466 "Corner (top, convex) ▜",
467 "Corner (top, convex) ▙",
468 "Corner (top, convex) ▛",
469 "Corner (bottom, concave) ▛",
470 "Corner (bottom, concave) ▙",
471 "Corner (bottom, concave) ▜",
472 "Corner (bottom, concave) ▟",
473 "Corner (bottom, convex) ▟",
474 "Corner (bottom, convex) ▜",
475 "Corner (bottom, convex) ▙",
476 "Corner (bottom, convex) ▛",
477 "Kinked corner north (bottom) ▜",
478 "Kinked corner south (bottom) ▟",
479 "Kinked corner north (bottom) ▛",
480 "Kinked corner south (bottom) ▙",
481 "Kinked corner west (bottom) ▙",
482 "Kinked corner west (bottom) ▛",
483 "Kinked corner east (bottom) ▟",
484 "Kinked corner east (bottom) ▜",
485 "Deep corner (concave) ▛",
486 "Deep corner (concave) ▙",
487 "Deep corner (concave) ▜",
488 "Deep corner (concave) ▟",
491 "Star tile (disabled)",
492 "Star tile (enabled)",
506 "Interroom stairs (up)",
507 "Interroom stairs (down)",
508 "Interroom stairs B (down)",
509 "Intraroom stairs north B",
510 "Intraroom stairs north (separate layers)",
511 "Intraroom stairs north (merged layers)",
512 "Intraroom stairs north (swim layer)",
514 "Water ladder (north)",
515 "Water ladder (south)",
517 "Interroom spiral stairs up (top)",
518 "Interroom spiral stairs down (top)",
519 "Interroom spiral stairs up (bottom)",
520 "Interroom spiral stairs down (bottom)",
521 "Sanctuary wall (north)",
527constexpr static inline absl::string_view Type3RoomObjectNames[] = {
528 "Waterfall face (empty)",
529 "Waterfall face (short)",
530 "Waterfall face (long)",
531 "Somaria path endpoint",
532 "Somaria path intersection ╋",
533 "Somaria path corner ┏",
534 "Somaria path corner ┗",
535 "Somaria path corner ┓",
536 "Somaria path corner ┛",
537 "Somaria path intersection ┳",
538 "Somaria path intersection ┻",
539 "Somaria path intersection ┣",
540 "Somaria path intersection ┫",
542 "Somaria path 2-way endpoint",
543 "Somaria path crossover",
544 "Babasu hole (north)",
545 "Babasu hole (south)",
549 "Kholdstare's shell",
555 "Intraroom stairs south",
556 "Intraroom stairs south (separate layers)",
557 "Intraroom stairs south (merged layers)",
558 "Interroom straight stairs up (north, top)",
559 "Interroom straight stairs down (north, top)",
560 "Interroom straight stairs up (south, top)",
561 "Interroom straight stairs down (south, top)",
562 "Deep corner (convex) ▟",
563 "Deep corner (convex) ▜",
564 "Deep corner (convex) ▙",
565 "Deep corner (convex) ▛",
566 "Interroom straight stairs up (north, bottom)",
567 "Interroom straight stairs down (north, bottom)",
568 "Interroom straight stairs up (south, bottom)",
569 "Interroom straight stairs down (south, bottom)",
572 "Liftable large block",
574 "Agahnim's boss room",
579 "Intraroom stairs south (swim layer)",
594 "Pipe-rock intersection ⯊",
595 "Pipe-rock intersection ⯋",
596 "Pipe-rock intersection ◖",
597 "Pipe-rock intersection ◗",
600 "Fake bombable floor",
607 "Warp tile (disabled)",
612 "Fortune teller room",
624 "Arrow game hole (west)",
625 "Arrow game hole (east)",
627 "Fake pressure plate",
629 "4-way shooter block",
631 "Wall crack (north)",
632 "Wall crack (south)",
636 "Water grate (north)",
637 "Water grate (south)",
638 "Water grate (west)",
639 "Water grate (east)",
643 "Layer 2 mask (full)",
647 "Triforce wall ornament",
648 "Triforce floor tiles",
651 "Vitreous goo damage",
The Rom class is used to load, save, and modify Rom data.
Tile composition of four 8x8 tiles.
std::vector< uint8_t > preview_object_data_
void AddTiles(int nbr, int pos)
std::vector< gfx::Tile16 > tiles_
void DrawTile(gfx::Tile16 t, int xx, int yy, std::vector< uint8_t > ¤t_gfx16, std::vector< uint8_t > &tiles_bg1_buffer, std::vector< uint8_t > &tiles_bg2_buffer, uint16_t tile_under=0xFFFF)
RoomObject(int16_t id, uint8_t x, uint8_t y, uint8_t size, uint8_t layer=0)
void set_options(ObjectOption options)
Subtype1(int16_t id, uint8_t x, uint8_t y, uint8_t size, uint8_t layer, int tile_count)
void Draw(std::vector< uint8_t > ¤t_gfx16, std::vector< uint8_t > &tiles_bg1_buffer, std::vector< uint8_t > &tiles_bg2_buffer)
void Draw(std::vector< uint8_t > ¤t_gfx16, std::vector< uint8_t > &tiles_bg1_buffer, std::vector< uint8_t > &tiles_bg2_buffer)
Subtype2(int16_t id, uint8_t x, uint8_t y, uint8_t size, uint8_t layer)
void Draw(std::vector< uint8_t > ¤t_gfx16, std::vector< uint8_t > &tiles_bg1_buffer, std::vector< uint8_t > &tiles_bg2_buffer)
Subtype3(int16_t id, uint8_t x, uint8_t y, uint8_t size, uint8_t layer)
#define ASSIGN_OR_LOG_ERROR(type_variable_name, expression)
Zelda 3 specific classes and functions.
constexpr int kRoomObjectSubtype3
ObjectOption operator|(ObjectOption lhs, ObjectOption rhs)
ObjectOption operator^(ObjectOption lhs, ObjectOption rhs)
constexpr int kRoomObjectSubtype1
constexpr int kRoomObjectSubtype2
constexpr int kRoomObjectTileAddress
ObjectOption operator~(ObjectOption option)
SubtypeInfo FetchSubtypeInfo(uint16_t object_id)
ObjectOption operator&(ObjectOption lhs, ObjectOption rhs)
constexpr int kRoomObjectTileAddressFloor
Main namespace for the application.