housekeeping

This commit is contained in:
Justin Scofield
2022-06-20 14:28:04 -04:00
parent 89c5dcfec6
commit 9c7c9bc1e4
15 changed files with 84 additions and 66 deletions

View File

@@ -15,16 +15,14 @@
#include "rom.h"
namespace yaze {
namespace app {
namespace Editor {
using namespace core;
namespace gui {
namespace editor {
Editor::Editor() {
for (auto &k : core::constants::kKeywords)
for (auto &k : app::core::constants::kKeywords)
language_65816_.mKeywords.emplace(k);
for (auto &k : core::constants::kIdentifiers) {
for (auto &k : app::core::constants::kIdentifiers) {
TextEditor::Identifier id;
id.mDeclaration = "Built-in function";
language_65816_.mIdentifiers.insert(std::make_pair(std::string(k), id));

View File

@@ -15,8 +15,8 @@
#include "rom.h"
namespace yaze {
namespace app {
namespace Editor {
namespace gui {
namespace editor {
class Editor {
public:
@@ -45,20 +45,18 @@ class Editor {
void *rom_data_;
bool is_loaded_ = true;
std::vector<tile8> tiles_;
std::vector<std::vector<tile8>> arranged_tiles_;
std::unordered_map<unsigned int, std::shared_ptr<SDL_Texture>> texture_cache_;
std::unordered_map<unsigned int, SDL_Texture *> imagesCache;
std::shared_ptr<SDL_Renderer> sdl_renderer_;
Data::ROM rom_;
app::ROM rom_;
TextEditor asm_editor_;
TextEditor::LanguageDefinition language_65816_;
OverworldEditor overworld_editor_;
std::vector<tile8> tiles_;
std::vector<std::vector<tile8>> arranged_tiles_;
std::unordered_map<uint, SDL_Texture *> imagesCache;
std::shared_ptr<SDL_Renderer> sdl_renderer_;
ImVec4 current_palette_[8];
gfx::TilePreset current_set_;
app::gfx::TilePreset current_set_;
ImGuiWindowFlags main_editor_flags_ =
ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse |
@@ -67,7 +65,7 @@ class Editor {
ImGuiTableFlags toolset_table_flags_ = ImGuiTableFlags_SizingFixedFit;
};
} // namespace Editor
} // namespace editor
} // namespace app
} // namespace yaze

View File

@@ -28,10 +28,10 @@
// have an overworld map viewer, in less than few hours if are able to
// understand the data quickly
namespace yaze {
namespace app {
namespace Editor {
namespace gui {
namespace editor {
void OverworldEditor::SetupROM(Data::ROM &rom) { rom_ = rom; }
void OverworldEditor::SetupROM(app::ROM &rom) { rom_ = rom; }
void OverworldEditor::Update() {
if (rom_.isLoaded()) {

View File

@@ -3,21 +3,20 @@
#include <imgui/imgui.h>
#include "zelda3/overworld.h"
#include "gfx/palette.h"
#include "gfx/tile.h"
#include "gui/icons.h"
#include "zelda3/overworld.h"
namespace yaze {
namespace app {
namespace Editor {
namespace gui {
namespace editor {
static constexpr unsigned int k4BPP = 4;
class OverworldEditor {
public:
void SetupROM(Data::ROM &rom);
void SetupROM(app::ROM &rom);
void Update();
private:
@@ -30,11 +29,11 @@ class OverworldEditor {
void Loadgfx();
Data::ROM rom_;
Data::Overworld overworld_;
gfx::Bitmap allgfxBitmap;
gfx::SNESPalette palette_;
gfx::TilePreset current_set_;
app::ROM rom_;
app::zelda3::Overworld overworld_;
app::gfx::Bitmap allgfxBitmap;
app::gfx::SNESPalette palette_;
app::gfx::TilePreset current_set_;
std::unordered_map<unsigned int, SDL_Texture *> all_texture_sheet_;
SDL_Texture *gfx_texture = nullptr;
@@ -72,8 +71,8 @@ class OverworldEditor {
ImGuiTableFlags_Resizable |
ImGuiTableFlags_SizingStretchSame;
};
} // namespace Editor
} // namespace app
} // namespace editor
} // namespace gui
} // namespace yaze
#endif