From d8af0138bf8898c0542fb995a9afd4bccb06c317 Mon Sep 17 00:00:00 2001 From: Justin Scofield Date: Fri, 10 Jun 2022 01:09:41 -0400 Subject: [PATCH] Rearranging structure --- src/Application/{View => Editor}/Editor.cc | 10 +++++-- src/Application/{View => Editor}/Editor.h | 2 ++ src/Application/{Utils => Graphics}/Bitmap.cc | 0 src/Application/{Utils => Graphics}/Bitmap.h | 6 +--- src/Application/View/Debug.cc | 29 ------------------- src/Application/View/Debug.h | 28 ------------------ 6 files changed, 10 insertions(+), 65 deletions(-) rename src/Application/{View => Editor}/Editor.cc (98%) rename src/Application/{View => Editor}/Editor.h (92%) rename src/Application/{Utils => Graphics}/Bitmap.cc (100%) rename src/Application/{Utils => Graphics}/Bitmap.h (79%) delete mode 100644 src/Application/View/Debug.cc delete mode 100644 src/Application/View/Debug.h diff --git a/src/Application/View/Editor.cc b/src/Application/Editor/Editor.cc similarity index 98% rename from src/Application/View/Editor.cc rename to src/Application/Editor/Editor.cc index fac1114b..d06cdac0 100644 --- a/src/Application/View/Editor.cc +++ b/src/Application/Editor/Editor.cc @@ -20,10 +20,14 @@ void Editor::UpdateScreen() { return; } DrawYazeMenu(); + if (ImGui::BeginTabBar("##TabBar")) { DrawOverworldEditor(); ImGui::EndTabBar(); } + + ImGui::ShowDemoWindow(); + ImGui::End(); } @@ -124,11 +128,11 @@ void Editor::DrawEditMenu() const { // 4) get the tiles32 data // 5) get the tiles16 data // 6) get the map32 data (they must be decompressed as well with a lz2 variant -// not the same as gfx compression but pretty similar) -// 7) get the gfx data of the map +// not the same as gfx compression but pretty similar) +// 7) get the gfx data of the map // yeah i forgot that one and load 4bpp in a pseudo vram and use that to // render tiles on screen -// 8) try to render the tiles on the bitmap in black & white to start +// 8) try to render the tiles on the bitmap in black & white to start // 9) get the palettes data and try to find how they're loaded in // the game that's a big puzzle to solve then 9 you'll have an overworld map // viewer, in less than few hours if are able to understand the data quickly diff --git a/src/Application/View/Editor.h b/src/Application/Editor/Editor.h similarity index 92% rename from src/Application/View/Editor.h rename to src/Application/Editor/Editor.h index 55d7f084..1112bb27 100644 --- a/src/Application/View/Editor.h +++ b/src/Application/Editor/Editor.h @@ -3,6 +3,7 @@ #include +#include "Data/Overworld.h" #include "ImGuiFileDialog/ImGuiFileDialog.h" #include "Utils/ROM.h" #include "imgui/backends/imgui_impl_sdl.h" @@ -26,6 +27,7 @@ class Editor { void DrawOverworldEditor(); + Data::Overworld overworld; Utils::ROM rom; }; diff --git a/src/Application/Utils/Bitmap.cc b/src/Application/Graphics/Bitmap.cc similarity index 100% rename from src/Application/Utils/Bitmap.cc rename to src/Application/Graphics/Bitmap.cc diff --git a/src/Application/Utils/Bitmap.h b/src/Application/Graphics/Bitmap.h similarity index 79% rename from src/Application/Utils/Bitmap.h rename to src/Application/Graphics/Bitmap.h index 42346275..e27445ef 100644 --- a/src/Application/Utils/Bitmap.h +++ b/src/Application/Graphics/Bitmap.h @@ -1,17 +1,13 @@ #ifndef YAZE_APPLICATION_UTILS_BITMAP_H #define YAZE_APPLICATION_UTILS_BITMAP_H -#include -#include - namespace yaze { namespace Application { namespace Utils { class Bitmap { - + }; - } // namespace Utils } // namespace Application } // namespace yaze diff --git a/src/Application/View/Debug.cc b/src/Application/View/Debug.cc deleted file mode 100644 index b52f91e8..00000000 --- a/src/Application/View/Debug.cc +++ /dev/null @@ -1,29 +0,0 @@ -#include "Debug.h" - -namespace yaze { -namespace Application { -namespace View { - -void Debug::UpdateScreen() const -{ - const ImGuiIO& io = ImGui::GetIO(); - ImGui::NewFrame(); - ImGui::SetNextWindowPos(ImVec2(0, 0)); - ImVec2 dimensions(io.DisplaySize.x, io.DisplaySize.y); - ImGui::SetNextWindowSize(dimensions, ImGuiCond_Always); - - - if (!ImGui::Begin("Main", nullptr, flags)) { - ImGui::End(); - return; - } - - ImGui::ShowDemoWindow(); - - - ImGui::End(); -} - -} -} -} \ No newline at end of file diff --git a/src/Application/View/Debug.h b/src/Application/View/Debug.h deleted file mode 100644 index ec09cc4f..00000000 --- a/src/Application/View/Debug.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef YAZE_APPLICATION_DEBUG_DEBUG_H -#define YAZE_APPLICATION_DEBUG_DEBUG_H - -#include "imgui/backends/imgui_impl_sdl.h" -#include "imgui/backends/imgui_impl_sdlrenderer.h" -#include "imgui/imgui.h" -#include "imgui/imgui_internal.h" -#include "imgui/misc/cpp/imgui_stdlib.h" - -namespace yaze { -namespace Application { -namespace View { - -class Debug { - public: - Debug()=default; - void UpdateScreen() const; - private: - ImGuiWindowFlags flags = - ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse | - ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoScrollbar; -}; - -} -} -} - -#endif \ No newline at end of file