Refactor and add default values to various structs
- Removed `FindMatchingCharacter` declaration from `message_data.h` - Added default values to `DictionaryEntry` and `MessageData` members - Marked several methods in `DictionaryEntry`, `MessageData`, and `TextElement` as `const` - Updated `TextElement` constructor to take `const std::string&` - Added string constants for text descriptions in `TextElement` - Updated `TextCommands` vector to use new string constants - Declared new function `FindMatchingCommand` - Included `<array>` header in `message_editor.h` - Changed `width_array` in `MessageEditor` to `std::array` with default initialization - Removed `list_of_texts_` and `all_dictionaries_` vectors from `MessageEditor` - Added default values to `GameEntity` members - Initialized `sheets` array in `PseudoVram` - Initialized `map_parent_` and `all_tiles_types_` arrays in `Overworld`
This commit is contained in:
@@ -30,12 +30,12 @@ class GameEntity {
|
||||
kProperties = 7,
|
||||
kDungeonSprite = 8,
|
||||
} entity_type_;
|
||||
int x_;
|
||||
int y_;
|
||||
int game_x_;
|
||||
int game_y_;
|
||||
int entity_id_;
|
||||
uint16_t map_id_;
|
||||
int x_ = 0;
|
||||
int y_ = 0;
|
||||
int game_x_ = 0;
|
||||
int game_y_ = 0;
|
||||
int entity_id_ = 0;
|
||||
uint16_t map_id_ = 0;
|
||||
|
||||
auto set_x(int x) { x_ = x; }
|
||||
auto set_y(int y) { y_ = y; }
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace yaze {
|
||||
namespace zelda3 {
|
||||
|
||||
struct PseudoVram {
|
||||
std::array<uint8_t, 16> sheets;
|
||||
std::array<uint8_t, 16> sheets = { 0 };
|
||||
std::vector<gfx::SnesPalette> palettes;
|
||||
};
|
||||
|
||||
|
||||
@@ -240,8 +240,8 @@ class Overworld : public SharedRom {
|
||||
|
||||
OverworldMapTiles map_tiles_;
|
||||
|
||||
std::array<uint8_t, kNumOverworldMaps> map_parent_;
|
||||
std::array<uint8_t, kNumTileTypes> all_tiles_types_;
|
||||
std::array<uint8_t, kNumOverworldMaps> map_parent_ = { 0 };
|
||||
std::array<uint8_t, kNumTileTypes> all_tiles_types_ = { 0 };
|
||||
std::vector<gfx::Tile16> tiles16_;
|
||||
std::vector<gfx::Tile32> tiles32_;
|
||||
std::vector<uint16_t> tiles32_list_;
|
||||
|
||||
Reference in New Issue
Block a user