yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
object_layer_semantics.h
Go to the documentation of this file.
1#ifndef YAZE_ZELDA3_DUNGEON_OBJECT_LAYER_SEMANTICS_H_
2#define YAZE_ZELDA3_DUNGEON_OBJECT_LAYER_SEMANTICS_H_
3
4#include <cstdint>
5
8
9namespace yaze {
10namespace zelda3 {
11
12enum class EffectiveBgLayer {
13 kBg1,
14 kBg2,
16};
17
23
24inline bool UsesRoomObjectStream(const RoomObject& object) {
25 const auto options = object.options();
26 return (options & ObjectOption::Torch) == ObjectOption::Nothing &&
28}
29
30inline bool UsesSpecialLayerSelector(const RoomObject& object) {
31 return !UsesRoomObjectStream(object);
32}
33
36
38 const bool routine_both =
39 (out.routine_id >= 0) &&
41 out.draws_to_both_bgs = object.all_bgs_ || routine_both;
42
43 if (out.draws_to_both_bgs) {
45 return out;
46 }
47
48 out.effective_bg_layer = (object.layer_ == RoomObject::LayerType::BG2)
51 return out;
52}
53
54inline const char* EffectiveBgLayerLabel(EffectiveBgLayer layer) {
55 switch (layer) {
57 return "BG1";
59 return "BG2";
61 return "Both BGs";
62 }
63 return "Unknown";
64}
65
66} // namespace zelda3
67} // namespace yaze
68
69#endif // YAZE_ZELDA3_DUNGEON_OBJECT_LAYER_SEMANTICS_H_
bool RoutineDrawsToBothBGs(int routine_id) const
int GetRoutineIdForObject(int16_t object_id) const
static DrawRoutineRegistry & Get()
ObjectLayerSemantics GetObjectLayerSemantics(const RoomObject &object)
bool UsesRoomObjectStream(const RoomObject &object)
bool UsesSpecialLayerSelector(const RoomObject &object)
const char * EffectiveBgLayerLabel(EffectiveBgLayer layer)