1#ifndef YAZE_APP_ZELDA3_DUNGEON_ROOM_OBJECT_H
2#define YAZE_APP_ZELDA3_DUNGEON_ROOM_OBJECT_H
75 uint8_t
x()
const {
return x_; }
76 uint8_t
y()
const {
return y_; }
87 const std::vector<gfx::TileInfo>&
tiles()
const {
return tiles_; }
91 absl::StatusOr<std::span<const gfx::TileInfo>>
GetTiles()
const;
94 absl::StatusOr<const gfx::TileInfo*>
GetTile(
int index)
const;
164 mutable std::vector<gfx::TileInfo>
tiles_;
179constexpr static inline const char* Type1RoomObjectNames[] = {
181 "Wall (top, north) ↔",
182 "Wall (top, south) ↔",
183 "Wall (bottom, north) ↔",
184 "Wall (bottom, south) ↔",
185 "Wall columns (north) ↔",
186 "Wall columns (south) ↔",
187 "Deep wall (north) ↔",
188 "Deep wall (south) ↔",
189 "Diagonal wall A ◤ (top) ↔",
190 "Diagonal wall A ◣ (top) ↔",
191 "Diagonal wall A ◥ (top) ↔",
192 "Diagonal wall A ◢ (top) ↔",
193 "Diagonal wall B ◤ (top) ↔",
194 "Diagonal wall B ◣ (top) ↔",
195 "Diagonal wall B ◥ (top) ↔",
196 "Diagonal wall B ◢ (top) ↔",
197 "Diagonal wall C ◤ (top) ↔",
198 "Diagonal wall C ◣ (top) ↔",
199 "Diagonal wall C ◥ (top) ↔",
200 "Diagonal wall C ◢ (top) ↔",
201 "Diagonal wall A ◤ (bottom) ↔",
202 "Diagonal wall A ◣ (bottom) ↔",
203 "Diagonal wall A ◥ (bottom) ↔",
204 "Diagonal wall A ◢ (bottom) ↔",
205 "Diagonal wall B ◤ (bottom) ↔",
206 "Diagonal wall B ◣ (bottom) ↔",
207 "Diagonal wall B ◥ (bottom) ↔",
208 "Diagonal wall B ◢ (bottom) ↔",
209 "Diagonal wall C ◤ (bottom) ↔",
210 "Diagonal wall C ◣ (bottom) ↔",
211 "Diagonal wall C ◥ (bottom) ↔",
212 "Diagonal wall C ◢ (bottom) ↔",
215 "Pit edge ┏━┓ A (north) ↔",
216 "Pit edge ┏━┓ B (north) ↔",
217 "Pit edge ┏━┓ C (north) ↔",
218 "Pit edge ┏━┓ D (north) ↔",
219 "Pit edge ┏━┓ E (north) ↔",
220 "Pit edge ┗━┛ (south) ↔",
221 "Pit edge ━━━ (south) ↔",
222 "Pit edge ━━━ (north) ↔",
223 "Pit edge ━━┛ (south) ↔",
224 "Pit edge ┗━━ (south) ↔",
225 "Pit edge ━━┓ (north) ↔",
226 "Pit edge ┏━━ (north) ↔",
227 "Rail wall (north) ↔",
228 "Rail wall (south) ↔",
235 "Drapes (west, odd) ↔",
238 "Wall decors (north) ↔",
239 "Wall decors (south) ↔",
242 "Supports (north) ↔",
243 "Water edge ┏━┓ (concave) ↔",
244 "Water edge ┗━┛ (concave) ↔",
245 "Water edge ┏━┓ (convex) ↔",
246 "Water edge ┗━┛ (convex) ↔",
247 "Water edge ┏━┛ (concave) ↔",
248 "Water edge ┗━┓ (concave) ↔",
249 "Water edge ┗━┓ (convex) ↔",
250 "Water edge ┏━┛ (convex) ↔",
255 "Supports (south) ↔",
261 "Cannon hole A (north) ↔",
262 "Cannon hole A (south) ↔",
265 "Wall torches (north) ↔",
266 "Wall torches (south) ↔",
271 "Cannon hole B (north) ↔",
272 "Cannon hole B (south) ↔",
277 "Wall (top, west) ↕",
278 "Wall (top, east) ↕",
279 "Wall (bottom, west) ↕",
280 "Wall (bottom, east) ↕",
281 "Wall columns (west) ↕",
282 "Wall columns (east) ↕",
283 "Deep wall (west) ↕",
284 "Deep wall (east) ↕",
288 "Rail wall (west) ↕",
289 "Rail wall (east) ↕",
298 "Wall decors (west) ↕",
299 "Wall decors (east) ↕",
301 "Water edge (west) ↕",
302 "Water edge (east) ↕",
307 "Wall torches (west) ↕",
308 "Wall torches (east) ↕",
309 "Wall decors tight A (west) ↕",
310 "Wall decors tight A (east) ↕",
311 "Wall decors tight B (west) ↕",
312 "Wall decors tight B (east) ↕",
313 "Cannon hole (west) ↕",
314 "Cannon hole (east) ↕",
319 "Jump ledge (west) ↕",
320 "Jump ledge (east) ↕",
324 "Wall flair (west) ↕",
325 "Wall flair (east) ↕",
340 "Diagonal ceiling A ◤",
341 "Diagonal ceiling A ◣",
342 "Diagonal ceiling A ◥",
343 "Diagonal ceiling A ◢",
345 "Diagonal layer 2 mask A ◤",
346 "Diagonal layer 2 mask A ◣",
347 "Diagonal layer 2 mask A ◥",
348 "Diagonal layer 2 mask A ◢",
349 "Diagonal layer 2 mask B ◤",
350 "Diagonal layer 2 mask B ◣",
351 "Diagonal layer 2 mask B ◥",
352 "Diagonal layer 2 mask B ◢",
356 "Jump ledge (north) ↔",
357 "Jump ledge (south) ↔",
359 "Rug trim (north) ↔",
360 "Rug trim (south) ↔",
361 "Archery game curtains ↔",
362 "Wall flair (north) ↔",
363 "Wall flair (south) ↔",
367 "Fake pressure plates ↔",
373 "Chest platform (tall) ⇲",
374 "Layer 2 pit mask (large) ⇲",
375 "Layer 2 pit mask (medium) ⇲",
378 "Layer 2 mask (large) ⇲",
381 "Flood water (medium) ⇲ ",
385 "Moving wall (west) ⇲",
386 "Moving wall (east) ⇲",
395 "Layer 2 mask (medium) ⇲",
396 "Flood water (large) ⇲",
397 "Layer 2 swim mask ⇲",
398 "Flood water B (large) ⇲",
400 "Chest platform (short) ⇲",
407 "Conveyor upwards ⇲",
408 "Conveyor downwards ⇲",
409 "Conveyor leftwards ⇲",
410 "Conveyor rightwards ⇲",
411 "Heavy current water ⇲",
430constexpr static inline const char* Type2RoomObjectNames[] = {
431 "Corner (top, concave) ▛",
432 "Corner (top, concave) ▙",
433 "Corner (top, concave) ▜",
434 "Corner (top, concave) ▟",
435 "Corner (top, convex) ▟",
436 "Corner (top, convex) ▜",
437 "Corner (top, convex) ▙",
438 "Corner (top, convex) ▛",
439 "Corner (bottom, concave) ▛",
440 "Corner (bottom, concave) ▙",
441 "Corner (bottom, concave) ▜",
442 "Corner (bottom, concave) ▟",
443 "Corner (bottom, convex) ▟",
444 "Corner (bottom, convex) ▜",
445 "Corner (bottom, convex) ▙",
446 "Corner (bottom, convex) ▛",
447 "Kinked corner north (bottom) ▜",
448 "Kinked corner south (bottom) ▟",
449 "Kinked corner north (bottom) ▛",
450 "Kinked corner south (bottom) ▙",
451 "Kinked corner west (bottom) ▙",
452 "Kinked corner west (bottom) ▛",
453 "Kinked corner east (bottom) ▟",
454 "Kinked corner east (bottom) ▜",
455 "Deep corner (concave) ▛",
456 "Deep corner (concave) ▙",
457 "Deep corner (concave) ▜",
458 "Deep corner (concave) ▟",
461 "Star tile (disabled)",
462 "Star tile (enabled)",
476 "Interroom stairs (up)",
477 "Interroom stairs (down)",
478 "Interroom stairs B (down)",
479 "Intraroom stairs north B",
480 "Intraroom stairs north (separate layers)",
481 "Intraroom stairs north (merged layers)",
482 "Intraroom stairs north (swim layer)",
484 "Water ladder (north)",
485 "Water ladder (south)",
487 "Interroom spiral stairs up (top)",
488 "Interroom spiral stairs down (top)",
489 "Interroom spiral stairs up (bottom)",
490 "Interroom spiral stairs down (bottom)",
491 "Sanctuary wall (north)",
497constexpr static inline const char* Type3RoomObjectNames[] = {
498 "Waterfall face (empty)",
499 "Waterfall face (short)",
500 "Waterfall face (long)",
501 "Somaria path endpoint",
502 "Somaria path intersection ╋",
503 "Somaria path corner ┏",
504 "Somaria path corner ┗",
505 "Somaria path corner ┓",
506 "Somaria path corner ┛",
507 "Somaria path intersection ┳",
508 "Somaria path intersection ┻",
509 "Somaria path intersection ┣",
510 "Somaria path intersection ┫",
512 "Somaria path 2-way endpoint",
513 "Somaria path crossover",
514 "Babasu hole (north)",
515 "Babasu hole (south)",
519 "Kholdstare's shell",
525 "Intraroom stairs south",
526 "Intraroom stairs south (separate layers)",
527 "Intraroom stairs south (merged layers)",
528 "Interroom straight stairs up (north, top)",
529 "Interroom straight stairs down (north, top)",
530 "Interroom straight stairs up (south, top)",
531 "Interroom straight stairs down (south, top)",
532 "Deep corner (convex) ▟",
533 "Deep corner (convex) ▜",
534 "Deep corner (convex) ▙",
535 "Deep corner (convex) ▛",
536 "Interroom straight stairs up (north, bottom)",
537 "Interroom straight stairs down (north, bottom)",
538 "Interroom straight stairs up (south, bottom)",
539 "Interroom straight stairs down (south, bottom)",
542 "Liftable large block",
544 "Agahnim's boss room",
549 "Intraroom stairs south (swim layer)",
564 "Pipe-rock intersection ⯊",
565 "Pipe-rock intersection ⯋",
566 "Pipe-rock intersection ◖",
567 "Pipe-rock intersection ◗",
570 "Fake bombable floor",
577 "Warp tile (disabled)",
582 "Fortune teller room",
594 "Arrow game hole (west)",
595 "Arrow game hole (east)",
597 "Fake pressure plate",
599 "4-way shooter block",
601 "Wall crack (north)",
602 "Wall crack (south)",
606 "Water grate (north)",
607 "Water grate (south)",
608 "Water grate (west)",
609 "Water grate (east)",
613 "Layer 2 mask (full)",
617 "Triforce wall ornament",
618 "Triforce floor tiles",
621 "Vitreous goo damage",
The Rom class is used to load, save, and modify Rom data.
absl::StatusOr< const gfx::TileInfo * > GetTile(int index) const
static RoomObject DecodeObjectFromBytes(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t layer)
std::vector< uint8_t > preview_object_data_
std::vector< gfx::TileInfo > tiles_
void set_size(uint8_t size)
std::vector< gfx::TileInfo > & mutable_tiles()
ObjectBytes EncodeObjectToBytes() const
const std::vector< gfx::TileInfo > & tiles() const
static int DetermineObjectType(uint8_t b1, uint8_t b3)
absl::Status LoadTilesWithParser()
absl::StatusOr< std::span< const gfx::TileInfo > > GetTiles() const
RoomObject(int16_t id, uint8_t x, uint8_t y, uint8_t size, uint8_t layer=0)
uint8_t GetLayerValue() const
void set_options(ObjectOption options)
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)
ObjectOption operator&(ObjectOption lhs, ObjectOption rhs)
constexpr int kRoomObjectTileAddressFloor
Main namespace for the application.