update dungeon header
This commit is contained in:
100
incl/dungeon.h
100
incl/dungeon.h
@@ -8,58 +8,58 @@ extern "C" {
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
typedef enum background2 {
|
||||||
|
Off,
|
||||||
|
Parallax,
|
||||||
|
Dark,
|
||||||
|
OnTop,
|
||||||
|
Translucent,
|
||||||
|
Addition,
|
||||||
|
Normal,
|
||||||
|
Transparent,
|
||||||
|
DarkRoom
|
||||||
|
} background2;
|
||||||
|
|
||||||
|
typedef struct object_door {
|
||||||
|
short id;
|
||||||
|
uint8_t x;
|
||||||
|
uint8_t y;
|
||||||
|
uint8_t size;
|
||||||
|
uint8_t type;
|
||||||
|
uint8_t layer;
|
||||||
|
} object_door;
|
||||||
|
|
||||||
|
typedef struct staircase {
|
||||||
|
uint8_t id;
|
||||||
|
uint8_t room;
|
||||||
|
const char* label;
|
||||||
|
} staircase;
|
||||||
|
|
||||||
|
typedef struct chest {
|
||||||
|
uint8_t x;
|
||||||
|
uint8_t y;
|
||||||
|
uint8_t item;
|
||||||
|
bool picker;
|
||||||
|
bool big_chest;
|
||||||
|
} chest;
|
||||||
|
|
||||||
|
typedef struct chest_data {
|
||||||
|
uint8_t id;
|
||||||
|
bool size;
|
||||||
|
} chest_data;
|
||||||
|
|
||||||
|
typedef struct destination {
|
||||||
|
uint8_t index;
|
||||||
|
uint8_t target;
|
||||||
|
uint8_t target_layer;
|
||||||
|
} destination;
|
||||||
|
|
||||||
typedef struct z3_dungeon_room {
|
typedef struct z3_dungeon_room {
|
||||||
typedef struct object_door {
|
|
||||||
short id;
|
|
||||||
uint8_t x;
|
|
||||||
uint8_t y;
|
|
||||||
uint8_t size;
|
|
||||||
uint8_t type;
|
|
||||||
uint8_t layer;
|
|
||||||
} object_door;
|
|
||||||
object_door* doors;
|
|
||||||
|
|
||||||
typedef struct staircase {
|
|
||||||
uint8_t id;
|
|
||||||
uint8_t room;
|
|
||||||
const char* label;
|
|
||||||
} staircase;
|
|
||||||
staircase* staircases;
|
|
||||||
|
|
||||||
typedef struct chest {
|
|
||||||
uint8_t x;
|
|
||||||
uint8_t y;
|
|
||||||
uint8_t item;
|
|
||||||
bool picker;
|
|
||||||
bool big_chest;
|
|
||||||
} chest;
|
|
||||||
chest* chests;
|
|
||||||
|
|
||||||
typedef struct chest_data {
|
|
||||||
uint8_t id;
|
|
||||||
bool size;
|
|
||||||
} chest_data;
|
|
||||||
chest_data* chests;
|
|
||||||
|
|
||||||
typedef enum background2 {
|
|
||||||
Off,
|
|
||||||
Parallax,
|
|
||||||
Dark,
|
|
||||||
OnTop,
|
|
||||||
Translucent,
|
|
||||||
Addition,
|
|
||||||
Normal,
|
|
||||||
Transparent,
|
|
||||||
DarkRoom
|
|
||||||
} background2;
|
|
||||||
background2 bg2;
|
background2 bg2;
|
||||||
|
object_door* doors;
|
||||||
typedef struct destination {
|
staircase* staircases;
|
||||||
uint8_t index;
|
chest* chests;
|
||||||
uint8_t target;
|
chest_data* chests_in_room;
|
||||||
uint8_t target_layer;
|
|
||||||
} destination;
|
|
||||||
|
|
||||||
destination pits;
|
destination pits;
|
||||||
destination stairs[4];
|
destination stairs[4];
|
||||||
} z3_dungeon_room;
|
} z3_dungeon_room;
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ void Room::LoadHeader() {
|
|||||||
|
|
||||||
auto header_location = core::SnesToPc(address);
|
auto header_location = core::SnesToPc(address);
|
||||||
|
|
||||||
bg2_ = (z3_dungeon_room::background2)((rom()->data()[header_location] >> 5) &
|
bg2_ = (background2)((rom()->data()[header_location] >> 5) &
|
||||||
0x07);
|
0x07);
|
||||||
collision_ = (CollisionKey)((rom()->data()[header_location] >> 2) & 0x07);
|
collision_ = (CollisionKey)((rom()->data()[header_location] >> 2) & 0x07);
|
||||||
is_light_ = ((rom()->data()[header_location]) & 0x01) == 1;
|
is_light_ = ((rom()->data()[header_location]) & 0x01) == 1;
|
||||||
|
|
||||||
if (is_light_) {
|
if (is_light_) {
|
||||||
bg2_ = z3_dungeon_room::background2::DarkRoom;
|
bg2_ = background2::DarkRoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
palette = ((rom()->data()[header_location + 1] & 0x3F));
|
palette = ((rom()->data()[header_location + 1] & 0x3F));
|
||||||
@@ -374,7 +374,7 @@ void Room::LoadObjects() {
|
|||||||
if (nbr_of_staircase < 4) {
|
if (nbr_of_staircase < 4) {
|
||||||
tile_objects_.back().set_options(ObjectOption::Stairs |
|
tile_objects_.back().set_options(ObjectOption::Stairs |
|
||||||
tile_objects_.back().options());
|
tile_objects_.back().options());
|
||||||
z3_staircases_.push_back(z3_dungeon_room::staircase(
|
z3_staircases_.push_back(staircase(
|
||||||
posX, posY,
|
posX, posY,
|
||||||
absl::StrCat("To ", staircase_rooms_[nbr_of_staircase])
|
absl::StrCat("To ", staircase_rooms_[nbr_of_staircase])
|
||||||
.data()));
|
.data()));
|
||||||
@@ -383,7 +383,7 @@ void Room::LoadObjects() {
|
|||||||
tile_objects_.back().set_options(ObjectOption::Stairs |
|
tile_objects_.back().set_options(ObjectOption::Stairs |
|
||||||
tile_objects_.back().options());
|
tile_objects_.back().options());
|
||||||
z3_staircases_.push_back(
|
z3_staircases_.push_back(
|
||||||
z3_dungeon_room::staircase(posX, posY, "To ???"));
|
staircase(posX, posY, "To ???"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -479,7 +479,7 @@ void Room::LoadChests() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
chests_in_room_.emplace_back(
|
chests_in_room_.emplace_back(
|
||||||
z3_dungeon_room::chest_data(rom_data[cpos + (i * 3) + 2], big));
|
chest_data(rom_data[cpos + (i * 3) + 2], big));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,13 +177,13 @@ class Room : public SharedRom {
|
|||||||
int64_t room_size_pointer_;
|
int64_t room_size_pointer_;
|
||||||
|
|
||||||
std::array<uint8_t, 16> blocks_;
|
std::array<uint8_t, 16> blocks_;
|
||||||
std::array<z3_chest, 16> chest_list_;
|
std::array<chest, 16> chest_list_;
|
||||||
|
|
||||||
std::array<gfx::Bitmap, 3> background_bmps_;
|
std::array<gfx::Bitmap, 3> background_bmps_;
|
||||||
std::vector<RoomObject> tile_objects_;
|
std::vector<RoomObject> tile_objects_;
|
||||||
std::vector<zelda3::Sprite> sprites_;
|
std::vector<zelda3::Sprite> sprites_;
|
||||||
std::vector<z3_dungeon_room::staircase> z3_staircases_;
|
std::vector<staircase> z3_staircases_;
|
||||||
std::vector<z3_dungeon_room::chest_data> chests_in_room_;
|
std::vector<chest_data> chests_in_room_;
|
||||||
|
|
||||||
LayerMergeType layer_merging_;
|
LayerMergeType layer_merging_;
|
||||||
CollisionKey collision_;
|
CollisionKey collision_;
|
||||||
@@ -191,12 +191,12 @@ class Room : public SharedRom {
|
|||||||
TagKey tag1_;
|
TagKey tag1_;
|
||||||
TagKey tag2_;
|
TagKey tag2_;
|
||||||
|
|
||||||
z3_dungeon_room::background2 bg2_;
|
background2 bg2_;
|
||||||
z3_dungeon_room::destination pits_;
|
destination pits_;
|
||||||
z3_dungeon_room::destination stair1_;
|
destination stair1_;
|
||||||
z3_dungeon_room::destination stair2_;
|
destination stair2_;
|
||||||
z3_dungeon_room::destination stair3_;
|
destination stair3_;
|
||||||
z3_dungeon_room::destination stair4_;
|
destination stair4_;
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr std::string_view kRoomNames[] = {
|
constexpr std::string_view kRoomNames[] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user