Add CalculateRoomSize to Room
This commit is contained in:
@@ -53,6 +53,10 @@ void Room::LoadHeader() {
|
|||||||
staircase_rooms_[2] = (rom()->data()[header_location + 12]);
|
staircase_rooms_[2] = (rom()->data()[header_location + 12]);
|
||||||
staircase_rooms_[3] = (rom()->data()[header_location + 13]);
|
staircase_rooms_[3] = (rom()->data()[header_location + 13]);
|
||||||
|
|
||||||
|
CalculateRoomSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Room::CalculateRoomSize() {
|
||||||
// Calculate the size of the room based on how many objects are used per room
|
// Calculate the size of the room based on how many objects are used per room
|
||||||
// Some notes from hacker Zarby89
|
// Some notes from hacker Zarby89
|
||||||
// vanilla rooms are using in average ~0x80 bytes
|
// vanilla rooms are using in average ~0x80 bytes
|
||||||
@@ -119,7 +123,6 @@ void Room::LoadHeader() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Room::LoadRoomFromROM() {
|
void Room::LoadRoomFromROM() {
|
||||||
// Load dungeon header
|
|
||||||
auto rom_data = rom()->vector();
|
auto rom_data = rom()->vector();
|
||||||
int header_pointer = core::SnesToPc(kRoomHeaderPointer);
|
int header_pointer = core::SnesToPc(kRoomHeaderPointer);
|
||||||
|
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ class Room : public SharedRom {
|
|||||||
~Room() = default;
|
~Room() = default;
|
||||||
|
|
||||||
void LoadHeader();
|
void LoadHeader();
|
||||||
|
void CalculateRoomSize();
|
||||||
void LoadRoomFromROM();
|
void LoadRoomFromROM();
|
||||||
|
|
||||||
void LoadRoomGraphics(uchar entrance_blockset = 0xFF);
|
void LoadRoomGraphics(uchar entrance_blockset = 0xFF);
|
||||||
@@ -161,9 +162,6 @@ class Room : public SharedRom {
|
|||||||
int room_id_;
|
int room_id_;
|
||||||
int animated_frame_;
|
int animated_frame_;
|
||||||
|
|
||||||
uchar tag1_;
|
|
||||||
uchar tag2_;
|
|
||||||
|
|
||||||
uint8_t staircase_plane_[4];
|
uint8_t staircase_plane_[4];
|
||||||
uint8_t staircase_rooms_[4];
|
uint8_t staircase_rooms_[4];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user