yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
moving_wall_semantics.h
Go to the documentation of this file.
1#ifndef YAZE_ZELDA3_DUNGEON_MOVING_WALL_SEMANTICS_H_
2#define YAZE_ZELDA3_DUNGEON_MOVING_WALL_SEMANTICS_H_
3
4#include <array>
5
6namespace yaze {
7namespace zelda3 {
8namespace moving_wall {
9
10// USDASM uses the high two size bits for the vertical platform repetition and
11// the low two bits for the horizontal fill-column count.
12inline constexpr std::array<int, 4> kDirections = {5, 7, 11, 15};
13inline constexpr std::array<int, 4> kObjectCounts = {8, 16, 24, 32};
14
15constexpr int DirectionForSize(int size) {
16 return kDirections[(size >> 2) & 0x03];
17}
18
19constexpr int ObjectCountForSize(int size) {
20 return kObjectCounts[size & 0x03];
21}
22
23} // namespace moving_wall
24} // namespace zelda3
25} // namespace yaze
26
27#endif // YAZE_ZELDA3_DUNGEON_MOVING_WALL_SEMANTICS_H_
constexpr int DirectionForSize(int size)
constexpr std::array< int, 4 > kObjectCounts
constexpr std::array< int, 4 > kDirections
constexpr int ObjectCountForSize(int size)