diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e37c40c..581b4c3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,9 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS ON) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) # Project Files add_subdirectory(src) diff --git a/src/Application/Core/Controller.cc b/src/Application/Core/Controller.cc index 9fca7c9e..bb70885c 100644 --- a/src/Application/Core/Controller.cc +++ b/src/Application/Core/Controller.cc @@ -1,23 +1,30 @@ -#include "Controller.h" +#include "controller.h" + +#include +#include +#include + +#include "core/renderer.h" +#include "core/window.h" +#include "editor/editor.h" namespace yaze { namespace Application { namespace Core { -bool Controller::isActive() const { return active; } +bool Controller::isActive() const { return active_; } -void Controller::onEntry() noexcept(false) { - window.Create(); - renderer.Create(window.Get()); +void Controller::onEntry() { + window_.Create(); + renderer_.Create(window_.Get()); ImGuiIO &io = ImGui::GetIO(); - io.KeyMap[ImGuiKey_Backspace] = SDL_GetScancodeFromKey(SDLK_BACKSPACE); io.KeyMap[ImGuiKey_Enter] = SDL_GetScancodeFromKey(SDLK_RETURN); io.KeyMap[ImGuiKey_UpArrow] = SDL_GetScancodeFromKey(SDLK_UP); io.KeyMap[ImGuiKey_DownArrow] = SDL_GetScancodeFromKey(SDLK_DOWN); io.KeyMap[ImGuiKey_Tab] = SDL_GetScancodeFromKey(SDLK_TAB); io.KeyMap[ImGuiKey_LeftCtrl] = SDL_GetScancodeFromKey(SDLK_LCTRL); - active = true; + active_ = true; } void Controller::onInput() { @@ -55,7 +62,7 @@ void Controller::onInput() { case SDL_WINDOWEVENT: switch (event.window.event) { case SDL_WINDOWEVENT_CLOSE: - active = false; + active_ = false; break; case SDL_WINDOWEVENT_SIZE_CHANGED: io.DisplaySize.x = static_cast(event.window.data1); @@ -86,19 +93,19 @@ void Controller::onInput() { io.MouseWheel = static_cast(wheel); } -void Controller::onLoad() { editor.UpdateScreen(); } +void Controller::onLoad() { editor_.UpdateScreen(); } void Controller::doRender() { SDL_Delay(10); - renderer.Render(); + renderer_.Render(); } void Controller::onExit() { ImGui_ImplSDLRenderer_Shutdown(); ImGui_ImplSDL2_Shutdown(); ImGui::DestroyContext(); - window.Destroy(); - renderer.Destroy(); + window_.Destroy(); + renderer_.Destroy(); SDL_Quit(); } diff --git a/src/Application/Core/Controller.h b/src/Application/Core/Controller.h index 198226b3..40e54d47 100644 --- a/src/Application/Core/Controller.h +++ b/src/Application/Core/Controller.h @@ -3,17 +3,12 @@ #define SDL_MAIN_HANDLED #include +#include +#include -#include - -#include "Editor/Editor.h" -#include "Renderer.h" -#include "Window.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" +#include "core/renderer.h" +#include "core/window.h" +#include "editor/editor.h" int main(int argc, char** argv); @@ -26,7 +21,6 @@ class Controller { Controller() = default; bool isActive() const; - void onEntry(); void onInput(); void onLoad(); @@ -34,12 +28,13 @@ class Controller { void onExit(); private: - Window window; - Renderer renderer; - Editor::Editor editor; - bool active = false; - void quit() { active = false; } + inline void quit() { active_ = false; } friend int ::main(int argc, char** argv); + + bool active_; + Window window_; + Renderer renderer_; + Editor::Editor editor_; }; } // namespace Core diff --git a/src/Application/Core/Renderer.cc b/src/Application/Core/Renderer.cc index 11ea1883..68e36fd9 100644 --- a/src/Application/Core/Renderer.cc +++ b/src/Application/Core/Renderer.cc @@ -1,5 +1,13 @@ #include "Renderer.h" +#include +#include +#include +#include + +#include "graphics/icons.h" +#include "graphics/style.h" + namespace yaze { namespace Application { namespace Core { @@ -29,7 +37,7 @@ void Renderer::Create(SDL_Window* window) { // Load available fonts const ImGuiIO& io = ImGui::GetIO(); - io.Fonts->AddFontFromFileTTF("assets/Fonts/Karla-Regular.ttf", 14.0f); + io.Fonts->AddFontFromFileTTF("assets/Fonts/Karla-Regular.ttf", 14.0f); // merge in icons from Google Material Design static const ImWchar icons_ranges[] = {ICON_MIN_MD, 0xf900, 0}; @@ -42,10 +50,10 @@ void Renderer::Create(SDL_Window* window) { icons_ranges); io.Fonts->AddFontFromFileTTF("assets/Fonts/Roboto-Medium.ttf", 14.0f); io.Fonts->AddFontFromFileTTF("assets/Fonts/Cousine-Regular.ttf", 14.0f); - io.Fonts->AddFontFromFileTTF("assets/Fonts/DroidSans.ttf", 16.0f); + io.Fonts->AddFontFromFileTTF("assets/Fonts/DroidSans.ttf", 16.0f); - - Style::StyleColorsYaze(); + // Set the default style + Style::ColorsYaze(); // Build a new ImGui frame ImGui_ImplSDLRenderer_NewFrame(); diff --git a/src/Application/Core/Renderer.h b/src/Application/Core/Renderer.h index 69abde01..b922c466 100644 --- a/src/Application/Core/Renderer.h +++ b/src/Application/Core/Renderer.h @@ -2,13 +2,12 @@ #define YAZE_APPLICATION_CORE_RENDERER_H #include - -#include "Graphics/Icons.h" -#include "Graphics/Style.h" -#include "imgui/backends/imgui_impl_sdl.h" -#include "imgui/backends/imgui_impl_sdlrenderer.h" +#include +#include #include -// #include "imgui/imgui_internal.h" + +#include "graphics/icons.h" +#include "graphics/style.h" namespace yaze { namespace Application { diff --git a/src/Application/Core/EntryPoint.h b/src/Application/Core/entry_point.h similarity index 94% rename from src/Application/Core/EntryPoint.h rename to src/Application/Core/entry_point.h index 24b8395e..d94fa3cb 100644 --- a/src/Application/Core/EntryPoint.h +++ b/src/Application/Core/entry_point.h @@ -1,11 +1,10 @@ #ifndef YAZE_APPLICATION_CONTROLLER_ENTRYPOINT_H #define YAZE_APPLICATION_CONTROLLER_ENTRYPOINT_H -#include "Controller.h" +#include "controller.h" int main(int argc, char** argv) { yaze::Application::Core::Controller controller; - controller.onEntry(); while (controller.isActive()) { controller.onInput(); @@ -13,7 +12,6 @@ int main(int argc, char** argv) { controller.doRender(); } controller.onExit(); - return EXIT_SUCCESS; } diff --git a/src/Application/Data/OW/Overworld.cc b/src/Application/Data/OW/Overworld.cc index 1fefb77c..84426cbc 100644 --- a/src/Application/Data/OW/Overworld.cc +++ b/src/Application/Data/OW/Overworld.cc @@ -1,6 +1,6 @@ -#include "Overworld.h" +#include "overworld.h" -#include "Graphics/Tile.h" +#include "graphics/tile.h" namespace yaze { namespace Application { diff --git a/src/Application/Data/OW/Overworld.h b/src/Application/Data/OW/Overworld.h index 13461cb3..68d271fe 100644 --- a/src/Application/Data/OW/Overworld.h +++ b/src/Application/Data/OW/Overworld.h @@ -1,16 +1,16 @@ #ifndef YAZE_APPLICATION_DATA_OVERWORLD_H #define YAZE_APPLICATION_DATA_OVERWORLD_H -#include -#include #include -#include "Core/Constants.h" -#include "Graphics/Bitmap.h" -#include "Graphics/Tile.h" -#include "OverworldMap.h" +#include +#include -#include "Data/ROM.h" +#include "core/constants.h" +#include "data/rom.h" +#include "graphics/bitmap.h" +#include "graphics/tile.h" +#include "overworld_map.h" namespace yaze { namespace Application { @@ -40,9 +40,9 @@ class Overworld { bool isLoaded = false; byte mapParent[160]; - ushort **allmapsTilesLW; // 64 maps * (32*32 tiles) - ushort **allmapsTilesDW; // 64 maps * (32*32 tiles) - ushort **allmapsTilesSP; // 32 maps * (32*32 tiles) + ushort** allmapsTilesLW; // 64 maps * (32*32 tiles) + ushort** allmapsTilesDW; // 64 maps * (32*32 tiles) + ushort** allmapsTilesSP; // 32 maps * (32*32 tiles) std::vector tiles16; std::vector tiles32; diff --git a/src/Application/Data/OW/OverworldMap.cc b/src/Application/Data/OW/overworld_map.cc similarity index 96% rename from src/Application/Data/OW/OverworldMap.cc rename to src/Application/Data/OW/overworld_map.cc index 6521e895..c18c30dc 100644 --- a/src/Application/Data/OW/OverworldMap.cc +++ b/src/Application/Data/OW/overworld_map.cc @@ -1,7 +1,7 @@ -#include "OverworldMap.h" +#include "overworld_map.h" -#include "Data/ROM.h" -#include "Graphics/Tile.h" +#include "data/rom.h" +#include "graphics/tile.h" namespace yaze { namespace Application { diff --git a/src/Application/Data/OW/OverworldMap.h b/src/Application/Data/OW/overworld_map.h similarity index 94% rename from src/Application/Data/OW/OverworldMap.h rename to src/Application/Data/OW/overworld_map.h index e535297e..ad3cbebe 100644 --- a/src/Application/Data/OW/OverworldMap.h +++ b/src/Application/Data/OW/overworld_map.h @@ -1,8 +1,8 @@ #include -#include "Data/ROM.h" +#include "data/rom.h" #include "Graphics/Bitmap.h" -#include "Graphics/Tile.h" +#include "graphics/tile.h" #include "imgui/imgui.h" diff --git a/src/Application/Data/ROM.h b/src/Application/Data/ROM.h index 1e29fe76..d8070e67 100644 --- a/src/Application/Data/ROM.h +++ b/src/Application/Data/ROM.h @@ -10,7 +10,7 @@ #include #include "Core/Constants.h" -#include "Graphics/Tile.h" +#include "graphics/tile.h" #include "compressions/alttpcompression.h" #include "compressions/stdnintendo.h" #include "rommapping.h" diff --git a/src/Application/Editor/Editor.h b/src/Application/Editor/Editor.h index 65084f89..b3f24200 100644 --- a/src/Application/Editor/Editor.h +++ b/src/Application/Editor/Editor.h @@ -9,10 +9,10 @@ #include -#include "Core/Constants.h" -#include "Data/ROM.h" -#include "Graphics/Icons.h" -#include "OverworldEditor.h" +#include "Core/constants.h" +#include "Data/rom.h" +#include "Graphics/icons.h" +#include "overworld_editor.h" namespace yaze { namespace Application { diff --git a/src/Application/Editor/OverworldEditor.cc b/src/Application/Editor/overworld_editor.cc similarity index 96% rename from src/Application/Editor/OverworldEditor.cc rename to src/Application/Editor/overworld_editor.cc index e06745e8..ccbf3c9a 100644 --- a/src/Application/Editor/OverworldEditor.cc +++ b/src/Application/Editor/overworld_editor.cc @@ -1,4 +1,4 @@ -#include "OverworldEditor.h" +#include "overworld_editor.h" #include @@ -6,7 +6,7 @@ #include "Graphics/Bitmap.h" #include "Graphics/Icons.h" -#include "Graphics/Tile.h" +#include "graphics/tile.h" // first step would be to decompress all graphics data from the game // (in alttp that's easy they're all located in the same location all the diff --git a/src/Application/Editor/OverworldEditor.h b/src/Application/Editor/overworld_editor.h similarity index 94% rename from src/Application/Editor/OverworldEditor.h rename to src/Application/Editor/overworld_editor.h index b71de1a3..45487a5e 100644 --- a/src/Application/Editor/OverworldEditor.h +++ b/src/Application/Editor/overworld_editor.h @@ -7,7 +7,7 @@ #include "Data/OW/Overworld.h" #include "Graphics/Palette.h" #include "Graphics/Scene.h" -#include "Graphics/Tile.h" +#include "graphics/tile.h" namespace yaze { namespace Application { diff --git a/src/Application/Graphics/Bitmap.cc b/src/Application/Graphics/Bitmap.cc index 51a55c19..23e9eda8 100644 --- a/src/Application/Graphics/Bitmap.cc +++ b/src/Application/Graphics/Bitmap.cc @@ -1,6 +1,6 @@ #include "Bitmap.h" -#include "Data/ROM.h" +#include "data/rom.h" #include "rommapping.h" namespace yaze { diff --git a/src/Application/Graphics/Scene.h b/src/Application/Graphics/Scene.h index c60c8db3..28a4feaa 100644 --- a/src/Application/Graphics/Scene.h +++ b/src/Application/Graphics/Scene.h @@ -8,7 +8,7 @@ #include #include "Core/Renderer.h" -#include "Graphics/Tile.h" +#include "graphics/tile.h" namespace yaze { namespace Application { diff --git a/src/Application/Graphics/Style.h b/src/Application/Graphics/Style.h index 8699df13..1b2df2a9 100644 --- a/src/Application/Graphics/Style.h +++ b/src/Application/Graphics/Style.h @@ -9,108 +9,11 @@ namespace Application { namespace Core { namespace Style { -inline static void StyleColorsYaze() { - ImGuiStyle *style = &ImGui::GetStyle(); - ImVec4 *colors = style->Colors; +void ColorsYaze(); - style->WindowPadding = ImVec2(10.f, 10.f); - style->FramePadding = ImVec2(10.f, 3.f); - style->CellPadding = ImVec2(4.f, 5.f); - style->ItemSpacing = ImVec2(10.f, 5.f); - style->ItemInnerSpacing = ImVec2(5.f, 5.f); - style->TouchExtraPadding = ImVec2(0.f, 0.f); - style->IndentSpacing = 20.f; - style->ScrollbarSize = 14.f; - style->GrabMinSize = 15.f; - - style->WindowBorderSize = 0.f; - style->ChildBorderSize = 1.f; - style->PopupBorderSize = 1.f; - style->FrameBorderSize = 0.f; - style->TabBorderSize = 0.f; - - style->WindowRounding = 0.f; - style->ChildRounding = 0.f; - style->FrameRounding = 5.4; - style->PopupRounding = 0.f; - style->ScrollbarRounding = 5.f; - - ImVec4 alttpDarkGreen = ImVec4(0.18f, 0.26f, 0.18f, 1.0f); - ImVec4 alttpMidGreen = ImVec4(0.28f, 0.36f, 0.28f, 1.0f); - ImVec4 allttpLightGreen = ImVec4(0.36f, 0.45f, 0.36f, 1.0f); - ImVec4 allttpLightestGreen = ImVec4(0.49f, 0.57f, 0.49f, 1.0f); - - colors[ImGuiCol_MenuBarBg] = alttpDarkGreen; - colors[ImGuiCol_TitleBg] = alttpMidGreen; - - colors[ImGuiCol_Header] = alttpDarkGreen; - colors[ImGuiCol_HeaderHovered] = allttpLightGreen; - colors[ImGuiCol_HeaderActive] = alttpMidGreen; - - colors[ImGuiCol_TitleBgActive] = alttpDarkGreen; - colors[ImGuiCol_TitleBgCollapsed] = alttpMidGreen; - - colors[ImGuiCol_Tab] = alttpDarkGreen; - colors[ImGuiCol_TabHovered] = alttpMidGreen; - colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], - colors[ImGuiCol_TitleBgActive], 0.60f); - - colors[ImGuiCol_Button] = alttpMidGreen; - colors[ImGuiCol_ButtonHovered] = allttpLightestGreen; - colors[ImGuiCol_ButtonActive] = allttpLightGreen; - - colors[ImGuiCol_ScrollbarBg] = ImVec4(0.36f, 0.45f, 0.36f, 0.60f); - colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.36f, 0.45f, 0.36f, 0.30f); - colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.36f, 0.45f, 0.36f, 0.40f); - colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.36f, 0.45f, 0.36f, 0.60f); - - colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f); - colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f); - colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.85f); - colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - colors[ImGuiCol_PopupBg] = ImVec4(0.11f, 0.11f, 0.14f, 0.92f); - colors[ImGuiCol_Border] = allttpLightGreen; - colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - - colors[ImGuiCol_FrameBg] = ImVec4(0.43f, 0.43f, 0.43f, 0.39f); - colors[ImGuiCol_FrameBgHovered] = ImVec4(0.28f, 0.36f, 0.28f, 0.40f); - colors[ImGuiCol_FrameBgActive] = ImVec4(0.28f, 0.36f, 0.28f, 0.69f); - - colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.50f); - colors[ImGuiCol_SliderGrab] = ImVec4(1.00f, 1.00f, 1.00f, 0.30f); - colors[ImGuiCol_SliderGrabActive] = ImVec4(0.36f, 0.45f, 0.36f, 0.60f); - - colors[ImGuiCol_Separator] = ImVec4(0.50f, 0.50f, 0.50f, 0.60f); - colors[ImGuiCol_SeparatorHovered] = ImVec4(0.60f, 0.60f, 0.70f, 1.00f); - colors[ImGuiCol_SeparatorActive] = ImVec4(0.70f, 0.70f, 0.90f, 1.00f); - colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f); - colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.78f, 0.82f, 1.00f, 0.60f); - colors[ImGuiCol_ResizeGripActive] = ImVec4(0.78f, 0.82f, 1.00f, 0.90f); - - colors[ImGuiCol_TabUnfocused] = - ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); - colors[ImGuiCol_TabUnfocusedActive] = - ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f); - colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); - colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); - colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); - colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); - colors[ImGuiCol_TableHeaderBg] = alttpDarkGreen; - colors[ImGuiCol_TableBorderStrong] = alttpMidGreen; - colors[ImGuiCol_TableBorderLight] = - ImVec4(0.26f, 0.26f, 0.28f, 1.00f); // Prefer using Alpha=1.0 here - colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.07f); - colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f); - colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); - colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered]; - colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); - colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); - colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f); -} -} // namespace Style -} // namespace Core -} // namespace Application -} // namespace yaze +} // namespace Style +} // namespace Core +} // namespace Application +} // namespace yaze #endif \ No newline at end of file diff --git a/src/Application/Graphics/style.cc b/src/Application/Graphics/style.cc new file mode 100644 index 00000000..c762f915 --- /dev/null +++ b/src/Application/Graphics/style.cc @@ -0,0 +1,113 @@ +#include "Style.h" + +#include "imgui/imgui.h" +#include "imgui/imgui_internal.h" + +namespace yaze { +namespace Application { +namespace Core { +namespace Style { + +void ColorsYaze() { + ImGuiStyle *style = &ImGui::GetStyle(); + ImVec4 *colors = style->Colors; + + style->WindowPadding = ImVec2(10.f, 10.f); + style->FramePadding = ImVec2(10.f, 3.f); + style->CellPadding = ImVec2(4.f, 5.f); + style->ItemSpacing = ImVec2(10.f, 5.f); + style->ItemInnerSpacing = ImVec2(5.f, 5.f); + style->TouchExtraPadding = ImVec2(0.f, 0.f); + style->IndentSpacing = 20.f; + style->ScrollbarSize = 14.f; + style->GrabMinSize = 15.f; + + style->WindowBorderSize = 0.f; + style->ChildBorderSize = 1.f; + style->PopupBorderSize = 1.f; + style->FrameBorderSize = 0.f; + style->TabBorderSize = 0.f; + + style->WindowRounding = 0.f; + style->ChildRounding = 0.f; + style->FrameRounding = 5.4; + style->PopupRounding = 0.f; + style->ScrollbarRounding = 5.f; + + ImVec4 alttpDarkGreen = ImVec4(0.18f, 0.26f, 0.18f, 1.0f); + ImVec4 alttpMidGreen = ImVec4(0.28f, 0.36f, 0.28f, 1.0f); + ImVec4 allttpLightGreen = ImVec4(0.36f, 0.45f, 0.36f, 1.0f); + ImVec4 allttpLightestGreen = ImVec4(0.49f, 0.57f, 0.49f, 1.0f); + + colors[ImGuiCol_MenuBarBg] = alttpDarkGreen; + colors[ImGuiCol_TitleBg] = alttpMidGreen; + + colors[ImGuiCol_Header] = alttpDarkGreen; + colors[ImGuiCol_HeaderHovered] = allttpLightGreen; + colors[ImGuiCol_HeaderActive] = alttpMidGreen; + + colors[ImGuiCol_TitleBgActive] = alttpDarkGreen; + colors[ImGuiCol_TitleBgCollapsed] = alttpMidGreen; + + colors[ImGuiCol_Tab] = alttpDarkGreen; + colors[ImGuiCol_TabHovered] = alttpMidGreen; + colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive], + colors[ImGuiCol_TitleBgActive], 0.60f); + + colors[ImGuiCol_Button] = alttpMidGreen; + colors[ImGuiCol_ButtonHovered] = allttpLightestGreen; + colors[ImGuiCol_ButtonActive] = allttpLightGreen; + + colors[ImGuiCol_ScrollbarBg] = ImVec4(0.36f, 0.45f, 0.36f, 0.60f); + colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.36f, 0.45f, 0.36f, 0.30f); + colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.36f, 0.45f, 0.36f, 0.40f); + colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.36f, 0.45f, 0.36f, 0.60f); + + colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f); + colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f); + colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.85f); + colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); + colors[ImGuiCol_PopupBg] = ImVec4(0.11f, 0.11f, 0.14f, 0.92f); + colors[ImGuiCol_Border] = allttpLightGreen; + colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); + + colors[ImGuiCol_FrameBg] = ImVec4(0.43f, 0.43f, 0.43f, 0.39f); + colors[ImGuiCol_FrameBgHovered] = ImVec4(0.28f, 0.36f, 0.28f, 0.40f); + colors[ImGuiCol_FrameBgActive] = ImVec4(0.28f, 0.36f, 0.28f, 0.69f); + + colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.50f); + colors[ImGuiCol_SliderGrab] = ImVec4(1.00f, 1.00f, 1.00f, 0.30f); + colors[ImGuiCol_SliderGrabActive] = ImVec4(0.36f, 0.45f, 0.36f, 0.60f); + + colors[ImGuiCol_Separator] = ImVec4(0.50f, 0.50f, 0.50f, 0.60f); + colors[ImGuiCol_SeparatorHovered] = ImVec4(0.60f, 0.60f, 0.70f, 1.00f); + colors[ImGuiCol_SeparatorActive] = ImVec4(0.70f, 0.70f, 0.90f, 1.00f); + colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f); + colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.78f, 0.82f, 1.00f, 0.60f); + colors[ImGuiCol_ResizeGripActive] = ImVec4(0.78f, 0.82f, 1.00f, 0.90f); + + colors[ImGuiCol_TabUnfocused] = + ImLerp(colors[ImGuiCol_Tab], colors[ImGuiCol_TitleBg], 0.80f); + colors[ImGuiCol_TabUnfocusedActive] = + ImLerp(colors[ImGuiCol_TabActive], colors[ImGuiCol_TitleBg], 0.40f); + colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); + colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); + colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); + colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); + colors[ImGuiCol_TableHeaderBg] = alttpDarkGreen; + colors[ImGuiCol_TableBorderStrong] = alttpMidGreen; + colors[ImGuiCol_TableBorderLight] = + ImVec4(0.26f, 0.26f, 0.28f, 1.00f); // Prefer using Alpha=1.0 here + colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); + colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.07f); + colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f); + colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); + colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered]; + colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); + colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); + colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f); +} +} // namespace Style +} // namespace Core +} // namespace Application +} // namespace yaze \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3fee1c0d..43c8c699 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,8 +5,8 @@ find_package(OpenGL REQUIRED) find_package(GLEW REQUIRED) # gui libraries --------------------------------------------------------------------------------------------------- -set(IMGUI_PATH "Library/imgui") # Set where the ImGui files are stored -file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp) # Compile as static library +set(IMGUI_PATH "Library/imgui") +file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp) add_library("ImGui" STATIC ${IMGUI_SOURCES}) target_include_directories("ImGui" PUBLIC ${IMGUI_PATH}) target_include_directories(ImGui PUBLIC ${SDL2_INCLUDE_DIR}) @@ -34,18 +34,19 @@ add_library("NintendoCompression" STATIC ${SNESHACKING_SOURCES}) add_executable( yaze yaze.cc - Application/Core/Controller.cc - Application/Core/Renderer.cc - Application/Core/Window.cc - Application/Data/ROM.cc - Application/Data/OW/Overworld.cc - Application/Data/OW/OverworldMap.cc - Application/Graphics/Bitmap.cc - Application/Graphics/Tile.cc - Application/Graphics/Palette.cc - Application/Graphics/Scene.cc - Application/Editor/Editor.cc - Application/Editor/OverworldEditor.cc + Application/Core/controller.cc + Application/Core/renderer.cc + Application/Core/window.cc + Application/Data/rom.cc + Application/Data/OW/overworld.cc + Application/Data/OW/overworld_map.cc + Application/Graphics/bitmap.cc + Application/Graphics/tile.cc + Application/Graphics/palette.cc + Application/Graphics/style.cc + Application/Graphics/scene.cc + Application/Editor/editor.cc + Application/Editor/overworld_editor.cc # GUI libraries ${IMGUI_PATH}/imgui.cpp ${IMGUI_PATH}/imgui_demo.cpp @@ -92,6 +93,13 @@ target_link_libraries( NintendoCompression ) +set_target_properties(yaze + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" +) + set (source "${CMAKE_SOURCE_DIR}/assets") set (destination "${CMAKE_CURRENT_BINARY_DIR}/assets") add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD diff --git a/src/yaze.h b/src/yaze.h index 78fb74c8..2bb46b55 100644 --- a/src/yaze.h +++ b/src/yaze.h @@ -14,7 +14,7 @@ #include #include -#include "Application/Core/Controller.h" -#include "Application/Core/EntryPoint.h" +#include "Application/Core/controller.h" +#include "Application/Core/entry_point.h" #endif // YAZE_YAZE_H \ No newline at end of file