diff options
-rw-r--r-- | src/core/core.cpp | 4 | ||||
-rw-r--r-- | src/core/core.h | 9 | ||||
-rw-r--r-- | src/core/frontend/emu_window.cpp | 4 | ||||
-rw-r--r-- | src/core/frontend/emu_window.h | 4 | ||||
-rw-r--r-- | src/video_core/renderer_base.cpp | 2 | ||||
-rw-r--r-- | src/video_core/renderer_base.h | 6 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 2 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 9 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 8 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.h | 8 | ||||
-rw-r--r-- | src/video_core/video_core.cpp | 2 | ||||
-rw-r--r-- | src/video_core/video_core.h | 4 | ||||
-rw-r--r-- | src/yuzu/bootmanager.h | 2 | ||||
-rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.h | 2 |
14 files changed, 44 insertions, 22 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 6b8004eb2..83d4d742b 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -88,7 +88,7 @@ System::ResultStatus System::SingleStep() { return RunLoop(false); } -System::ResultStatus System::Load(EmuWindow& emu_window, const std::string& filepath) { +System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath) { app_loader = Loader::GetLoader(virtual_filesystem->OpenFile(filepath, FileSys::Mode::Read)); if (!app_loader) { @@ -151,7 +151,7 @@ Cpu& System::CpuCore(size_t core_index) { return *cpu_cores[core_index]; } -System::ResultStatus System::Init(EmuWindow& emu_window) { +System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) { LOG_DEBUG(HW_Memory, "initialized OK"); CoreTiming::Init(); diff --git a/src/core/core.h b/src/core/core.h index 2944b09cd..d98b15a71 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -22,9 +22,12 @@ #include "video_core/debug_utils/debug_utils.h" #include "video_core/gpu.h" -class EmuWindow; class ARM_Interface; +namespace Core::Frontend { +class EmuWindow; +} + namespace Service::SM { class ServiceManager; } @@ -99,7 +102,7 @@ public: * @param filepath String path to the executable application to load on the host file system. * @returns ResultStatus code, indicating if the operation succeeded. */ - ResultStatus Load(EmuWindow& emu_window, const std::string& filepath); + ResultStatus Load(Frontend::EmuWindow& emu_window, const std::string& filepath); /** * Indicates if the emulated system is powered on (all subsystems initialized and able to run an @@ -227,7 +230,7 @@ private: * input. * @return ResultStatus code, indicating if the operation succeeded. */ - ResultStatus Init(EmuWindow& emu_window); + ResultStatus Init(Frontend::EmuWindow& emu_window); /// RealVfsFilesystem instance FileSys::VirtualFilesystem virtual_filesystem; diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 2d776c693..9dd493efb 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp @@ -8,6 +8,8 @@ #include "core/frontend/input.h" #include "core/settings.h" +namespace Core::Frontend { + class EmuWindow::TouchState : public Input::Factory<Input::TouchDevice>, public std::enable_shared_from_this<TouchState> { public: @@ -108,3 +110,5 @@ void EmuWindow::TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y) { void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) { NotifyFramebufferLayoutChanged(Layout::DefaultFrameLayout(width, height)); } + +} // namespace Core::Frontend diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h index e8c29adfb..384dc7822 100644 --- a/src/core/frontend/emu_window.h +++ b/src/core/frontend/emu_window.h @@ -10,6 +10,8 @@ #include "common/common_types.h" #include "core/frontend/framebuffer_layout.h" +namespace Core::Frontend { + /** * Abstraction class used to provide an interface between emulation code and the frontend * (e.g. SDL, QGLWidget, GLFW, etc...). @@ -166,3 +168,5 @@ private: */ std::tuple<unsigned, unsigned> ClipToTouchScreen(unsigned new_x, unsigned new_y); }; + +} // namespace Core::Frontend diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp index e87016429..afd86a83a 100644 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp @@ -10,7 +10,7 @@ namespace VideoCore { -RendererBase::RendererBase(EmuWindow& window) : render_window{window} { +RendererBase::RendererBase(Core::Frontend::EmuWindow& window) : render_window{window} { RefreshBaseSettings(); } diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index fd8c47592..d9f16b8e6 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -11,7 +11,9 @@ #include "video_core/gpu.h" #include "video_core/rasterizer_interface.h" +namespace Core::Frontend { class EmuWindow; +} namespace VideoCore { @@ -21,7 +23,7 @@ struct RendererSettings { class RendererBase : NonCopyable { public: - explicit RendererBase(EmuWindow& window); + explicit RendererBase(Core::Frontend::EmuWindow& window); virtual ~RendererBase(); /// Swap buffers (render frame) @@ -59,7 +61,7 @@ protected: /// Refreshes settings specific to the rasterizer. void RefreshRasterizerSetting(); - EmuWindow& render_window; ///< Reference to the render window handle. + Core::Frontend::EmuWindow& render_window; ///< Reference to the render window handle. std::unique_ptr<RasterizerInterface> rasterizer; f32 m_current_fps = 0.0f; ///< Current framerate, should be set by the renderer int m_current_frame = 0; ///< Current frame, should be set by the renderer diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 8360feb5d..b97e892e6 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -36,7 +36,7 @@ MICROPROFILE_DEFINE(OpenGL_Drawing, "OpenGL", "Drawing", MP_RGB(128, 128, 192)); MICROPROFILE_DEFINE(OpenGL_Blits, "OpenGL", "Blits", MP_RGB(100, 100, 255)); MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100)); -RasterizerOpenGL::RasterizerOpenGL(EmuWindow& window) : emu_window{window} { +RasterizerOpenGL::RasterizerOpenGL(Core::Frontend::EmuWindow& window) : emu_window{window} { // Create sampler objects for (size_t i = 0; i < texture_samplers.size(); ++i) { texture_samplers[i].Create(); diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 6d6d85cc1..bd01dc0ae 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -21,12 +21,15 @@ #include "video_core/renderer_opengl/gl_state.h" #include "video_core/renderer_opengl/gl_stream_buffer.h" -class EmuWindow; struct ScreenInfo; +namespace Core::Frontend { +class EmuWindow; +} + class RasterizerOpenGL : public VideoCore::RasterizerInterface { public: - explicit RasterizerOpenGL(EmuWindow& renderer); + explicit RasterizerOpenGL(Core::Frontend::EmuWindow& renderer); ~RasterizerOpenGL() override; void DrawArrays() override; @@ -145,7 +148,7 @@ private: RasterizerCacheOpenGL res_cache; - EmuWindow& emu_window; + Core::Frontend::EmuWindow& emu_window; std::unique_ptr<GLShader::ProgramManager> shader_program_manager; OGLVertexArray sw_vao; diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 899865e3b..95f1aa0fe 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -18,7 +18,6 @@ #include "core/tracer/recorder.h" #include "video_core/renderer_opengl/renderer_opengl.h" #include "video_core/utils.h" -#include "video_core/video_core.h" static const char vertex_shader[] = R"( #version 150 core @@ -92,7 +91,8 @@ static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, cons return matrix; } -ScopeAcquireGLContext::ScopeAcquireGLContext(EmuWindow& emu_window_) : emu_window{emu_window_} { +ScopeAcquireGLContext::ScopeAcquireGLContext(Core::Frontend::EmuWindow& emu_window_) + : emu_window{emu_window_} { if (Settings::values.use_multi_core) { emu_window.MakeCurrent(); } @@ -103,7 +103,9 @@ ScopeAcquireGLContext::~ScopeAcquireGLContext() { } } -RendererOpenGL::RendererOpenGL(EmuWindow& window) : VideoCore::RendererBase{window} {} +RendererOpenGL::RendererOpenGL(Core::Frontend::EmuWindow& window) + : VideoCore::RendererBase{window} {} + RendererOpenGL::~RendererOpenGL() = default; /// Swap buffers (render frame) diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 428afa3b7..a5eab6997 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -12,7 +12,9 @@ #include "video_core/renderer_opengl/gl_resource_manager.h" #include "video_core/renderer_opengl/gl_state.h" +namespace Core::Frontend { class EmuWindow; +} /// Structure used for storing information about the textures for the Switch screen struct TextureInfo { @@ -34,16 +36,16 @@ struct ScreenInfo { /// Helper class to acquire/release OpenGL context within a given scope class ScopeAcquireGLContext : NonCopyable { public: - explicit ScopeAcquireGLContext(EmuWindow& window); + explicit ScopeAcquireGLContext(Core::Frontend::EmuWindow& window); ~ScopeAcquireGLContext(); private: - EmuWindow& emu_window; + Core::Frontend::EmuWindow& emu_window; }; class RendererOpenGL : public VideoCore::RendererBase { public: - explicit RendererOpenGL(EmuWindow& window); + explicit RendererOpenGL(Core::Frontend::EmuWindow& window); ~RendererOpenGL() override; /// Swap buffers (render frame) diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 1e686b89e..6780d1c16 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -9,7 +9,7 @@ namespace VideoCore { -std::unique_ptr<RendererBase> CreateRenderer(EmuWindow& emu_window) { +std::unique_ptr<RendererBase> CreateRenderer(Core::Frontend::EmuWindow& emu_window) { return std::make_unique<RendererOpenGL>(emu_window); } diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h index 2dc07540f..f79f85dfe 100644 --- a/src/video_core/video_core.h +++ b/src/video_core/video_core.h @@ -6,7 +6,9 @@ #include <memory> +namespace Core::Frontend { class EmuWindow; +} namespace VideoCore { @@ -18,6 +20,6 @@ class RendererBase; * @note The returned renderer instance is simply allocated. Its Init() * function still needs to be called to fully complete its setup. */ -std::unique_ptr<RendererBase> CreateRenderer(EmuWindow& emu_window); +std::unique_ptr<RendererBase> CreateRenderer(Core::Frontend::EmuWindow& emu_window); } // namespace VideoCore diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index d0f990c64..f133bfadf 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h @@ -101,7 +101,7 @@ signals: void ErrorThrown(Core::System::ResultStatus, std::string); }; -class GRenderWindow : public QWidget, public EmuWindow { +class GRenderWindow : public QWidget, public Core::Frontend::EmuWindow { Q_OBJECT public: diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.h b/src/yuzu_cmd/emu_window/emu_window_sdl2.h index 1d835c3c6..d34902109 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.h @@ -10,7 +10,7 @@ struct SDL_Window; -class EmuWindow_SDL2 : public EmuWindow { +class EmuWindow_SDL2 : public Core::Frontend::EmuWindow { public: explicit EmuWindow_SDL2(bool fullscreen); ~EmuWindow_SDL2(); |