Refactor assembly_editor.cc, dungeon_editor.h, and overworld_editor.cc
This commit is contained in:
@@ -58,11 +58,11 @@ core::FolderItem LoadFolder(const std::string& folder) {
|
|||||||
auto root_files = FileDialogWrapper::GetFilesInFolder(current_folder.name);
|
auto root_files = FileDialogWrapper::GetFilesInFolder(current_folder.name);
|
||||||
current_folder.files = RemoveIgnoredFiles(root_files, ignored_files);
|
current_folder.files = RemoveIgnoredFiles(root_files, ignored_files);
|
||||||
|
|
||||||
for (const auto& folder :
|
for (const auto& subfolder :
|
||||||
FileDialogWrapper::GetSubdirectoriesInFolder(current_folder.name)) {
|
FileDialogWrapper::GetSubdirectoriesInFolder(current_folder.name)) {
|
||||||
core::FolderItem folder_item;
|
core::FolderItem folder_item;
|
||||||
folder_item.name = folder;
|
folder_item.name = subfolder;
|
||||||
std::string full_folder = current_folder.name + "/" + folder;
|
std::string full_folder = current_folder.name + "/" + subfolder;
|
||||||
auto folder_files = FileDialogWrapper::GetFilesInFolder(full_folder);
|
auto folder_files = FileDialogWrapper::GetFilesInFolder(full_folder);
|
||||||
for (const auto& files : folder_files) {
|
for (const auto& files : folder_files) {
|
||||||
// Remove subdirectory files
|
// Remove subdirectory files
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ class DungeonEditor : public Editor,
|
|||||||
bool object_loaded_ = false;
|
bool object_loaded_ = false;
|
||||||
bool palette_showing_ = false;
|
bool palette_showing_ = false;
|
||||||
bool refresh_graphics_ = false;
|
bool refresh_graphics_ = false;
|
||||||
bool show_object_render_ = false;
|
|
||||||
|
|
||||||
uint16_t current_entrance_id_ = 0;
|
uint16_t current_entrance_id_ = 0;
|
||||||
uint16_t current_room_id_ = 0;
|
uint16_t current_room_id_ = 0;
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ absl::Status OverworldEditor::Update() {
|
|||||||
RETURN_IF_ERROR(tile16_editor_.InitBlockset(
|
RETURN_IF_ERROR(tile16_editor_.InitBlockset(
|
||||||
tile16_blockset_bmp_, current_gfx_bmp_, tile16_individual_,
|
tile16_blockset_bmp_, current_gfx_bmp_, tile16_individual_,
|
||||||
*overworld_.mutable_all_tiles_types()));
|
*overworld_.mutable_all_tiles_types()));
|
||||||
gfx_group_editor_.InitBlockset(&tile16_blockset_bmp_);
|
|
||||||
RETURN_IF_ERROR(LoadEntranceTileTypes(*rom()));
|
RETURN_IF_ERROR(LoadEntranceTileTypes(*rom()));
|
||||||
all_gfx_loaded_ = true;
|
all_gfx_loaded_ = true;
|
||||||
}
|
}
|
||||||
@@ -989,7 +988,7 @@ absl::Status OverworldEditor::LoadGraphics() {
|
|||||||
tile16_individual_.reserve(kNumTile16Individual);
|
tile16_individual_.reserve(kNumTile16Individual);
|
||||||
|
|
||||||
// Loop through the tiles and copy their pixel data into separate vectors
|
// Loop through the tiles and copy their pixel data into separate vectors
|
||||||
for (int i = 0; i < kNumTile16Individual; i++) {
|
for (uint i = 0; i < kNumTile16Individual; i++) {
|
||||||
std::vector<uint8_t> tile_data(kTile16Size * kTile16Size, 0x00);
|
std::vector<uint8_t> tile_data(kTile16Size * kTile16Size, 0x00);
|
||||||
|
|
||||||
// Copy the pixel data for the current tile into the vector
|
// Copy the pixel data for the current tile into the vector
|
||||||
|
|||||||
Reference in New Issue
Block a user