From eb10f250254a0153abd789e49a36945d996631a7 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 27 May 2017 18:06:59 -0700 Subject: Move screen size constants from video_core to core video_core didn't even properly use them, and they were the source of many otherwise-unnecessary dependencies from core to video_core. --- src/citra/emu_window/emu_window_sdl2.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/citra') diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 6bc0b0d00..47aadd60c 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -12,10 +12,10 @@ #include "common/logging/log.h" #include "common/scm_rev.h" #include "common/string_util.h" +#include "core/3ds.h" #include "core/settings.h" #include "input_common/keyboard.h" #include "input_common/main.h" -#include "video_core/video_core.h" void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) { TouchMoved((unsigned)std::max(x, 0), (unsigned)std::max(y, 0)); @@ -80,12 +80,12 @@ EmuWindow_SDL2::EmuWindow_SDL2() { std::string window_title = Common::StringFromFormat("Citra %s| %s-%s ", Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc); - render_window = SDL_CreateWindow( - window_title.c_str(), - SDL_WINDOWPOS_UNDEFINED, // x position - SDL_WINDOWPOS_UNDEFINED, // y position - VideoCore::kScreenTopWidth, VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight, - SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); + render_window = + SDL_CreateWindow(window_title.c_str(), + SDL_WINDOWPOS_UNDEFINED, // x position + SDL_WINDOWPOS_UNDEFINED, // y position + Core::kScreenTopWidth, Core::kScreenTopHeight + Core::kScreenBottomHeight, + SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); if (render_window == nullptr) { LOG_CRITICAL(Frontend, "Failed to create SDL2 window! Exiting..."); -- cgit v1.2.3 From e91f2b7663e8be445761b21c26a3a861b6794b04 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 27 May 2017 18:07:53 -0700 Subject: Remove some unnecessary inclusions of video_core.h --- src/citra/citra.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/citra') diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 76f5caeb1..c0dac9e8f 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -33,7 +33,6 @@ #include "core/gdbstub/gdbstub.h" #include "core/loader/loader.h" #include "core/settings.h" -#include "video_core/video_core.h" static void PrintHelp(const char* argv0) { std::cout << "Usage: " << argv0 -- cgit v1.2.3 From 62f34c8e5ce94adeb24d985f8d2c32b1ece37a3c Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 27 May 2017 18:14:00 -0700 Subject: Citra: Convert include into forward declaration --- src/citra/config.cpp | 4 +++- src/citra/config.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/citra') diff --git a/src/citra/config.cpp b/src/citra/config.cpp index a4162e9ad..f08b4069c 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -5,11 +5,11 @@ #include #include #include +#include "citra/config.h" #include "citra/default_ini.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/param_package.h" -#include "config.h" #include "core/settings.h" #include "input_common/main.h" @@ -21,6 +21,8 @@ Config::Config() { Reload(); } +Config::~Config() = default; + bool Config::LoadINI(const std::string& default_contents, bool retry) { const char* location = this->sdl2_config_loc.c_str(); if (sdl2_config->ParseError() < 0) { diff --git a/src/citra/config.h b/src/citra/config.h index b1c31f59c..abc90f642 100644 --- a/src/citra/config.h +++ b/src/citra/config.h @@ -6,7 +6,8 @@ #include #include -#include + +class INIReader; class Config { std::unique_ptr sdl2_config; @@ -17,6 +18,7 @@ class Config { public: Config(); + ~Config(); void Reload(); }; -- cgit v1.2.3 From 7b81903756451281bd1f07d8e9a2dceeff79df08 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 27 May 2017 18:26:55 -0700 Subject: CMake: Correct inter-module dependencies and library visibility Modules didn't correctly define their dependencies before, which relied on the frontends implicitly including every module for linking to succeed. Also changed every target_link_libraries call to specify visibility of dependencies to avoid leaking definitions to dependents when not necessary. --- src/citra/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/citra') diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index 47231ba71..9eddb342b 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -18,12 +18,12 @@ create_directory_groups(${SRCS} ${HEADERS}) include_directories(${SDL2_INCLUDE_DIR}) add_executable(citra ${SRCS} ${HEADERS}) -target_link_libraries(citra core video_core audio_core common input_common) -target_link_libraries(citra ${SDL2_LIBRARY} ${OPENGL_gl_LIBRARY} inih glad) +target_link_libraries(citra PRIVATE common core input_common) +target_link_libraries(citra PRIVATE ${SDL2_LIBRARY} ${OPENGL_gl_LIBRARY} inih glad) if (MSVC) - target_link_libraries(citra getopt) + target_link_libraries(citra PRIVATE getopt) endif() -target_link_libraries(citra ${PLATFORM_LIBRARIES} Threads::Threads) +target_link_libraries(citra PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) if(UNIX AND NOT APPLE) install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") -- cgit v1.2.3