Changed filenames to match google style and adjusted some header includes
This commit is contained in:
@@ -10,6 +10,9 @@ set(CMAKE_CXX_STANDARD 20)
|
|||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS ON)
|
set(CMAKE_CXX_EXTENSIONS ON)
|
||||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
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
|
# Project Files
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|||||||
@@ -1,23 +1,30 @@
|
|||||||
#include "Controller.h"
|
#include "controller.h"
|
||||||
|
|
||||||
|
#include <SDL2/SDL.h>
|
||||||
|
#include <imgui/imgui.h>
|
||||||
|
#include <imgui/imgui_internal.h>
|
||||||
|
|
||||||
|
#include "core/renderer.h"
|
||||||
|
#include "core/window.h"
|
||||||
|
#include "editor/editor.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace Application {
|
namespace Application {
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
bool Controller::isActive() const { return active; }
|
bool Controller::isActive() const { return active_; }
|
||||||
|
|
||||||
void Controller::onEntry() noexcept(false) {
|
void Controller::onEntry() {
|
||||||
window.Create();
|
window_.Create();
|
||||||
renderer.Create(window.Get());
|
renderer_.Create(window_.Get());
|
||||||
ImGuiIO &io = ImGui::GetIO();
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
|
|
||||||
io.KeyMap[ImGuiKey_Backspace] = SDL_GetScancodeFromKey(SDLK_BACKSPACE);
|
io.KeyMap[ImGuiKey_Backspace] = SDL_GetScancodeFromKey(SDLK_BACKSPACE);
|
||||||
io.KeyMap[ImGuiKey_Enter] = SDL_GetScancodeFromKey(SDLK_RETURN);
|
io.KeyMap[ImGuiKey_Enter] = SDL_GetScancodeFromKey(SDLK_RETURN);
|
||||||
io.KeyMap[ImGuiKey_UpArrow] = SDL_GetScancodeFromKey(SDLK_UP);
|
io.KeyMap[ImGuiKey_UpArrow] = SDL_GetScancodeFromKey(SDLK_UP);
|
||||||
io.KeyMap[ImGuiKey_DownArrow] = SDL_GetScancodeFromKey(SDLK_DOWN);
|
io.KeyMap[ImGuiKey_DownArrow] = SDL_GetScancodeFromKey(SDLK_DOWN);
|
||||||
io.KeyMap[ImGuiKey_Tab] = SDL_GetScancodeFromKey(SDLK_TAB);
|
io.KeyMap[ImGuiKey_Tab] = SDL_GetScancodeFromKey(SDLK_TAB);
|
||||||
io.KeyMap[ImGuiKey_LeftCtrl] = SDL_GetScancodeFromKey(SDLK_LCTRL);
|
io.KeyMap[ImGuiKey_LeftCtrl] = SDL_GetScancodeFromKey(SDLK_LCTRL);
|
||||||
active = true;
|
active_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::onInput() {
|
void Controller::onInput() {
|
||||||
@@ -55,7 +62,7 @@ void Controller::onInput() {
|
|||||||
case SDL_WINDOWEVENT:
|
case SDL_WINDOWEVENT:
|
||||||
switch (event.window.event) {
|
switch (event.window.event) {
|
||||||
case SDL_WINDOWEVENT_CLOSE:
|
case SDL_WINDOWEVENT_CLOSE:
|
||||||
active = false;
|
active_ = false;
|
||||||
break;
|
break;
|
||||||
case SDL_WINDOWEVENT_SIZE_CHANGED:
|
case SDL_WINDOWEVENT_SIZE_CHANGED:
|
||||||
io.DisplaySize.x = static_cast<float>(event.window.data1);
|
io.DisplaySize.x = static_cast<float>(event.window.data1);
|
||||||
@@ -86,19 +93,19 @@ void Controller::onInput() {
|
|||||||
io.MouseWheel = static_cast<float>(wheel);
|
io.MouseWheel = static_cast<float>(wheel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::onLoad() { editor.UpdateScreen(); }
|
void Controller::onLoad() { editor_.UpdateScreen(); }
|
||||||
|
|
||||||
void Controller::doRender() {
|
void Controller::doRender() {
|
||||||
SDL_Delay(10);
|
SDL_Delay(10);
|
||||||
renderer.Render();
|
renderer_.Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::onExit() {
|
void Controller::onExit() {
|
||||||
ImGui_ImplSDLRenderer_Shutdown();
|
ImGui_ImplSDLRenderer_Shutdown();
|
||||||
ImGui_ImplSDL2_Shutdown();
|
ImGui_ImplSDL2_Shutdown();
|
||||||
ImGui::DestroyContext();
|
ImGui::DestroyContext();
|
||||||
window.Destroy();
|
window_.Destroy();
|
||||||
renderer.Destroy();
|
renderer_.Destroy();
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,17 +3,12 @@
|
|||||||
#define SDL_MAIN_HANDLED
|
#define SDL_MAIN_HANDLED
|
||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
#include <imgui/imgui.h>
|
||||||
|
#include <imgui/imgui_internal.h>
|
||||||
|
|
||||||
#include <memory>
|
#include "core/renderer.h"
|
||||||
|
#include "core/window.h"
|
||||||
#include "Editor/Editor.h"
|
#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"
|
|
||||||
|
|
||||||
int main(int argc, char** argv);
|
int main(int argc, char** argv);
|
||||||
|
|
||||||
@@ -26,7 +21,6 @@ class Controller {
|
|||||||
Controller() = default;
|
Controller() = default;
|
||||||
|
|
||||||
bool isActive() const;
|
bool isActive() const;
|
||||||
|
|
||||||
void onEntry();
|
void onEntry();
|
||||||
void onInput();
|
void onInput();
|
||||||
void onLoad();
|
void onLoad();
|
||||||
@@ -34,12 +28,13 @@ class Controller {
|
|||||||
void onExit();
|
void onExit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Window window;
|
inline void quit() { active_ = false; }
|
||||||
Renderer renderer;
|
|
||||||
Editor::Editor editor;
|
|
||||||
bool active = false;
|
|
||||||
void quit() { active = false; }
|
|
||||||
friend int ::main(int argc, char** argv);
|
friend int ::main(int argc, char** argv);
|
||||||
|
|
||||||
|
bool active_;
|
||||||
|
Window window_;
|
||||||
|
Renderer renderer_;
|
||||||
|
Editor::Editor editor_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
|
|
||||||
|
#include <SDL2/SDL.h>
|
||||||
|
#include <imgui/backends/imgui_impl_sdl.h>
|
||||||
|
#include <imgui/backends/imgui_impl_sdlrenderer.h>
|
||||||
|
#include <imgui/imgui.h>
|
||||||
|
|
||||||
|
#include "graphics/icons.h"
|
||||||
|
#include "graphics/style.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace Application {
|
namespace Application {
|
||||||
namespace Core {
|
namespace Core {
|
||||||
@@ -29,7 +37,7 @@ void Renderer::Create(SDL_Window* window) {
|
|||||||
|
|
||||||
// Load available fonts
|
// Load available fonts
|
||||||
const ImGuiIO& io = ImGui::GetIO();
|
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
|
// merge in icons from Google Material Design
|
||||||
static const ImWchar icons_ranges[] = {ICON_MIN_MD, 0xf900, 0};
|
static const ImWchar icons_ranges[] = {ICON_MIN_MD, 0xf900, 0};
|
||||||
@@ -42,10 +50,10 @@ void Renderer::Create(SDL_Window* window) {
|
|||||||
icons_ranges);
|
icons_ranges);
|
||||||
io.Fonts->AddFontFromFileTTF("assets/Fonts/Roboto-Medium.ttf", 14.0f);
|
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/Cousine-Regular.ttf", 14.0f);
|
||||||
io.Fonts->AddFontFromFileTTF("assets/Fonts/DroidSans.ttf", 16.0f);
|
io.Fonts->AddFontFromFileTTF("assets/Fonts/DroidSans.ttf", 16.0f);
|
||||||
|
|
||||||
|
// Set the default style
|
||||||
Style::StyleColorsYaze();
|
Style::ColorsYaze();
|
||||||
|
|
||||||
// Build a new ImGui frame
|
// Build a new ImGui frame
|
||||||
ImGui_ImplSDLRenderer_NewFrame();
|
ImGui_ImplSDLRenderer_NewFrame();
|
||||||
|
|||||||
@@ -2,13 +2,12 @@
|
|||||||
#define YAZE_APPLICATION_CORE_RENDERER_H
|
#define YAZE_APPLICATION_CORE_RENDERER_H
|
||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
#include <imgui/backends/imgui_impl_sdl.h>
|
||||||
#include "Graphics/Icons.h"
|
#include <imgui/backends/imgui_impl_sdlrenderer.h>
|
||||||
#include "Graphics/Style.h"
|
|
||||||
#include "imgui/backends/imgui_impl_sdl.h"
|
|
||||||
#include "imgui/backends/imgui_impl_sdlrenderer.h"
|
|
||||||
#include <imgui/imgui.h>
|
#include <imgui/imgui.h>
|
||||||
// #include "imgui/imgui_internal.h"
|
|
||||||
|
#include "graphics/icons.h"
|
||||||
|
#include "graphics/style.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace Application {
|
namespace Application {
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
#ifndef YAZE_APPLICATION_CONTROLLER_ENTRYPOINT_H
|
#ifndef YAZE_APPLICATION_CONTROLLER_ENTRYPOINT_H
|
||||||
#define YAZE_APPLICATION_CONTROLLER_ENTRYPOINT_H
|
#define YAZE_APPLICATION_CONTROLLER_ENTRYPOINT_H
|
||||||
|
|
||||||
#include "Controller.h"
|
#include "controller.h"
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
yaze::Application::Core::Controller controller;
|
yaze::Application::Core::Controller controller;
|
||||||
|
|
||||||
controller.onEntry();
|
controller.onEntry();
|
||||||
while (controller.isActive()) {
|
while (controller.isActive()) {
|
||||||
controller.onInput();
|
controller.onInput();
|
||||||
@@ -13,7 +12,6 @@ int main(int argc, char** argv) {
|
|||||||
controller.doRender();
|
controller.doRender();
|
||||||
}
|
}
|
||||||
controller.onExit();
|
controller.onExit();
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Overworld.h"
|
#include "overworld.h"
|
||||||
|
|
||||||
#include "Graphics/Tile.h"
|
#include "graphics/tile.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace Application {
|
namespace Application {
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
#ifndef YAZE_APPLICATION_DATA_OVERWORLD_H
|
#ifndef YAZE_APPLICATION_DATA_OVERWORLD_H
|
||||||
#define YAZE_APPLICATION_DATA_OVERWORLD_H
|
#define YAZE_APPLICATION_DATA_OVERWORLD_H
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <vector>
|
|
||||||
#include <rommapping.h>
|
#include <rommapping.h>
|
||||||
|
|
||||||
#include "Core/Constants.h"
|
#include <memory>
|
||||||
#include "Graphics/Bitmap.h"
|
#include <vector>
|
||||||
#include "Graphics/Tile.h"
|
|
||||||
#include "OverworldMap.h"
|
|
||||||
|
|
||||||
#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 yaze {
|
||||||
namespace Application {
|
namespace Application {
|
||||||
@@ -40,9 +40,9 @@ class Overworld {
|
|||||||
bool isLoaded = false;
|
bool isLoaded = false;
|
||||||
byte mapParent[160];
|
byte mapParent[160];
|
||||||
|
|
||||||
ushort **allmapsTilesLW; // 64 maps * (32*32 tiles)
|
ushort** allmapsTilesLW; // 64 maps * (32*32 tiles)
|
||||||
ushort **allmapsTilesDW; // 64 maps * (32*32 tiles)
|
ushort** allmapsTilesDW; // 64 maps * (32*32 tiles)
|
||||||
ushort **allmapsTilesSP; // 32 maps * (32*32 tiles)
|
ushort** allmapsTilesSP; // 32 maps * (32*32 tiles)
|
||||||
|
|
||||||
std::vector<Graphics::Tile16> tiles16;
|
std::vector<Graphics::Tile16> tiles16;
|
||||||
std::vector<Graphics::Tile32> tiles32;
|
std::vector<Graphics::Tile32> tiles32;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "OverworldMap.h"
|
#include "overworld_map.h"
|
||||||
|
|
||||||
#include "Data/ROM.h"
|
#include "data/rom.h"
|
||||||
#include "Graphics/Tile.h"
|
#include "graphics/tile.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace Application {
|
namespace Application {
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Data/ROM.h"
|
#include "data/rom.h"
|
||||||
#include "Graphics/Bitmap.h"
|
#include "Graphics/Bitmap.h"
|
||||||
#include "Graphics/Tile.h"
|
#include "graphics/tile.h"
|
||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Core/Constants.h"
|
#include "Core/Constants.h"
|
||||||
#include "Graphics/Tile.h"
|
#include "graphics/tile.h"
|
||||||
#include "compressions/alttpcompression.h"
|
#include "compressions/alttpcompression.h"
|
||||||
#include "compressions/stdnintendo.h"
|
#include "compressions/stdnintendo.h"
|
||||||
#include "rommapping.h"
|
#include "rommapping.h"
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Core/Constants.h"
|
#include "Core/constants.h"
|
||||||
#include "Data/ROM.h"
|
#include "Data/rom.h"
|
||||||
#include "Graphics/Icons.h"
|
#include "Graphics/icons.h"
|
||||||
#include "OverworldEditor.h"
|
#include "overworld_editor.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace Application {
|
namespace Application {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "OverworldEditor.h"
|
#include "overworld_editor.h"
|
||||||
|
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "Graphics/Bitmap.h"
|
#include "Graphics/Bitmap.h"
|
||||||
#include "Graphics/Icons.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
|
// 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
|
// (in alttp that's easy they're all located in the same location all the
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
#include "Data/OW/Overworld.h"
|
#include "Data/OW/Overworld.h"
|
||||||
#include "Graphics/Palette.h"
|
#include "Graphics/Palette.h"
|
||||||
#include "Graphics/Scene.h"
|
#include "Graphics/Scene.h"
|
||||||
#include "Graphics/Tile.h"
|
#include "graphics/tile.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace Application {
|
namespace Application {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "Bitmap.h"
|
#include "Bitmap.h"
|
||||||
|
|
||||||
#include "Data/ROM.h"
|
#include "data/rom.h"
|
||||||
#include "rommapping.h"
|
#include "rommapping.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Core/Renderer.h"
|
#include "Core/Renderer.h"
|
||||||
#include "Graphics/Tile.h"
|
#include "graphics/tile.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace Application {
|
namespace Application {
|
||||||
|
|||||||
@@ -9,108 +9,11 @@ namespace Application {
|
|||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Style {
|
namespace Style {
|
||||||
|
|
||||||
inline static void StyleColorsYaze() {
|
void ColorsYaze();
|
||||||
ImGuiStyle *style = &ImGui::GetStyle();
|
|
||||||
ImVec4 *colors = style->Colors;
|
|
||||||
|
|
||||||
style->WindowPadding = ImVec2(10.f, 10.f);
|
} // namespace Style
|
||||||
style->FramePadding = ImVec2(10.f, 3.f);
|
} // namespace Core
|
||||||
style->CellPadding = ImVec2(4.f, 5.f);
|
} // namespace Application
|
||||||
style->ItemSpacing = ImVec2(10.f, 5.f);
|
} // namespace yaze
|
||||||
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
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
113
src/Application/Graphics/style.cc
Normal file
113
src/Application/Graphics/style.cc
Normal file
@@ -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
|
||||||
@@ -5,8 +5,8 @@ find_package(OpenGL REQUIRED)
|
|||||||
find_package(GLEW REQUIRED)
|
find_package(GLEW REQUIRED)
|
||||||
|
|
||||||
# gui libraries ---------------------------------------------------------------------------------------------------
|
# gui libraries ---------------------------------------------------------------------------------------------------
|
||||||
set(IMGUI_PATH "Library/imgui") # Set where the ImGui files are stored
|
set(IMGUI_PATH "Library/imgui")
|
||||||
file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp) # Compile as static library
|
file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp)
|
||||||
add_library("ImGui" STATIC ${IMGUI_SOURCES})
|
add_library("ImGui" STATIC ${IMGUI_SOURCES})
|
||||||
target_include_directories("ImGui" PUBLIC ${IMGUI_PATH})
|
target_include_directories("ImGui" PUBLIC ${IMGUI_PATH})
|
||||||
target_include_directories(ImGui PUBLIC ${SDL2_INCLUDE_DIR})
|
target_include_directories(ImGui PUBLIC ${SDL2_INCLUDE_DIR})
|
||||||
@@ -34,18 +34,19 @@ add_library("NintendoCompression" STATIC ${SNESHACKING_SOURCES})
|
|||||||
add_executable(
|
add_executable(
|
||||||
yaze
|
yaze
|
||||||
yaze.cc
|
yaze.cc
|
||||||
Application/Core/Controller.cc
|
Application/Core/controller.cc
|
||||||
Application/Core/Renderer.cc
|
Application/Core/renderer.cc
|
||||||
Application/Core/Window.cc
|
Application/Core/window.cc
|
||||||
Application/Data/ROM.cc
|
Application/Data/rom.cc
|
||||||
Application/Data/OW/Overworld.cc
|
Application/Data/OW/overworld.cc
|
||||||
Application/Data/OW/OverworldMap.cc
|
Application/Data/OW/overworld_map.cc
|
||||||
Application/Graphics/Bitmap.cc
|
Application/Graphics/bitmap.cc
|
||||||
Application/Graphics/Tile.cc
|
Application/Graphics/tile.cc
|
||||||
Application/Graphics/Palette.cc
|
Application/Graphics/palette.cc
|
||||||
Application/Graphics/Scene.cc
|
Application/Graphics/style.cc
|
||||||
Application/Editor/Editor.cc
|
Application/Graphics/scene.cc
|
||||||
Application/Editor/OverworldEditor.cc
|
Application/Editor/editor.cc
|
||||||
|
Application/Editor/overworld_editor.cc
|
||||||
# GUI libraries
|
# GUI libraries
|
||||||
${IMGUI_PATH}/imgui.cpp
|
${IMGUI_PATH}/imgui.cpp
|
||||||
${IMGUI_PATH}/imgui_demo.cpp
|
${IMGUI_PATH}/imgui_demo.cpp
|
||||||
@@ -92,6 +93,13 @@ target_link_libraries(
|
|||||||
NintendoCompression
|
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 (source "${CMAKE_SOURCE_DIR}/assets")
|
||||||
set (destination "${CMAKE_CURRENT_BINARY_DIR}/assets")
|
set (destination "${CMAKE_CURRENT_BINARY_DIR}/assets")
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
#include "Application/Core/Controller.h"
|
#include "Application/Core/controller.h"
|
||||||
#include "Application/Core/EntryPoint.h"
|
#include "Application/Core/entry_point.h"
|
||||||
|
|
||||||
#endif // YAZE_YAZE_H
|
#endif // YAZE_YAZE_H
|
||||||
Reference in New Issue
Block a user