diff options
| author | 2014-04-08 23:18:23 -0400 | |
|---|---|---|
| committer | 2014-04-08 23:18:23 -0400 | |
| commit | 5da03e821ef281909e65c3df33f67596074ae98a (patch) | |
| tree | 15f1bb0f91a88082a21e4e2e4531e1f8dee026bf /src | |
| parent | fixed licensing and updated code style naming for arm_interface/arm_interpret... (diff) | |
| download | yuzu-5da03e821ef281909e65c3df33f67596074ae98a.tar.gz yuzu-5da03e821ef281909e65c3df33f67596074ae98a.tar.xz yuzu-5da03e821ef281909e65c3df33f67596074ae98a.zip | |
- removed deprecated version.h
- cleaned up window title
- cleaned up emu_window_glfw/emu_window
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra/citra.h | 12 | ||||
| -rw-r--r-- | src/citra/citra.vcxproj | 1 | ||||
| -rw-r--r-- | src/citra/citra.vcxproj.filters | 1 | ||||
| -rw-r--r-- | src/citra/emu_window/emu_window_glfw.cpp | 30 | ||||
| -rw-r--r-- | src/citra/emu_window/emu_window_glfw.h | 2 | ||||
| -rw-r--r-- | src/citra/version.h | 6 | ||||
| -rw-r--r-- | src/common/common.h | 4 | ||||
| -rw-r--r-- | src/common/emu_window.h | 100 | ||||
| -rw-r--r-- | src/common/scm_rev.h | 8 | ||||
| -rw-r--r-- | src/common/version.cpp | 12 |
10 files changed, 74 insertions, 102 deletions
diff --git a/src/citra/citra.h b/src/citra/citra.h index 5a2c60aac..b9254c5da 100644 --- a/src/citra/citra.h +++ b/src/citra/citra.h | |||
| @@ -4,10 +4,12 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "version.h" | 7 | #include <string> |
| 8 | 8 | ||
| 9 | #define APP_NAME "citra" | 9 | #include "common/common.h" |
| 10 | #define APP_VERSION "0.01-" VERSION | 10 | |
| 11 | #define APP_TITLE APP_NAME " " APP_VERSION | 11 | #define APP_NAME std::string("citra") |
| 12 | #define COPYRIGHT "Copyright (C) 2013 Citra Emulator" | 12 | #define APP_VERSION std::string("0.01-") + std::string(g_scm_rev_str) |
| 13 | #define APP_TITLE (APP_NAME + " " + APP_VERSION) | ||
| 14 | #define COPYRIGHT "Copyright (C) 2014 Citra Emulator" | ||
| 13 | 15 | ||
diff --git a/src/citra/citra.vcxproj b/src/citra/citra.vcxproj index 4ea222fcd..d81ac5bfc 100644 --- a/src/citra/citra.vcxproj +++ b/src/citra/citra.vcxproj | |||
| @@ -206,7 +206,6 @@ | |||
| 206 | <ClInclude Include="citra.h" /> | 206 | <ClInclude Include="citra.h" /> |
| 207 | <ClInclude Include="emu_window\emu_window_glfw.h" /> | 207 | <ClInclude Include="emu_window\emu_window_glfw.h" /> |
| 208 | <ClInclude Include="resource.h" /> | 208 | <ClInclude Include="resource.h" /> |
| 209 | <ClInclude Include="version.h" /> | ||
| 210 | </ItemGroup> | 209 | </ItemGroup> |
| 211 | <ItemGroup> | 210 | <ItemGroup> |
| 212 | <Text Include="CMakeLists.txt" /> | 211 | <Text Include="CMakeLists.txt" /> |
diff --git a/src/citra/citra.vcxproj.filters b/src/citra/citra.vcxproj.filters index b41cdf146..b2685691f 100644 --- a/src/citra/citra.vcxproj.filters +++ b/src/citra/citra.vcxproj.filters | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | <ItemGroup> | 14 | <ItemGroup> |
| 15 | <ClInclude Include="citra.h" /> | 15 | <ClInclude Include="citra.h" /> |
| 16 | <ClInclude Include="resource.h" /> | 16 | <ClInclude Include="resource.h" /> |
| 17 | <ClInclude Include="version.h" /> | ||
| 18 | <ClInclude Include="emu_window\emu_window_glfw.h"> | 17 | <ClInclude Include="emu_window\emu_window_glfw.h"> |
| 19 | <Filter>emu_window</Filter> | 18 | <Filter>emu_window</Filter> |
| 20 | </ClInclude> | 19 | </ClInclude> |
diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp index 442176d91..e6943f146 100644 --- a/src/citra/emu_window/emu_window_glfw.cpp +++ b/src/citra/emu_window/emu_window_glfw.cpp | |||
| @@ -3,7 +3,10 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/common.h" | 5 | #include "common/common.h" |
| 6 | |||
| 6 | #include "video_core/video_core.h" | 7 | #include "video_core/video_core.h" |
| 8 | |||
| 9 | #include "citra/citra.h" | ||
| 7 | #include "citra/emu_window/emu_window_glfw.h" | 10 | #include "citra/emu_window/emu_window_glfw.h" |
| 8 | 11 | ||
| 9 | static void OnKeyEvent(GLFWwindow* win, int key, int action) { | 12 | static void OnKeyEvent(GLFWwindow* win, int key, int action) { |
| @@ -11,9 +14,9 @@ static void OnKeyEvent(GLFWwindow* win, int key, int action) { | |||
| 11 | } | 14 | } |
| 12 | 15 | ||
| 13 | static void OnWindowSizeEvent(GLFWwindow* win, int width, int height) { | 16 | static void OnWindowSizeEvent(GLFWwindow* win, int width, int height) { |
| 14 | EmuWindow_GLFW* emuwin = (EmuWindow_GLFW*)glfwGetWindowUserPointer(win); | 17 | EmuWindow_GLFW* emu_window = (EmuWindow_GLFW*)glfwGetWindowUserPointer(win); |
| 15 | emuwin->set_client_area_width(width); | 18 | emu_window->SetClientAreaWidth(width); |
| 16 | emuwin->set_client_area_height(height); | 19 | emu_window->SetClientAreaHeight(height); |
| 17 | } | 20 | } |
| 18 | 21 | ||
| 19 | /// EmuWindow_GLFW constructor | 22 | /// EmuWindow_GLFW constructor |
| @@ -25,13 +28,14 @@ EmuWindow_GLFW::EmuWindow_GLFW() { | |||
| 25 | } | 28 | } |
| 26 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); | 29 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); |
| 27 | glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); | 30 | glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); |
| 28 | render_window_ = glfwCreateWindow(VideoCore::kScreenTopWidth, | 31 | m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth, |
| 29 | (VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight), "citra", NULL, NULL); | 32 | (VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight), |
| 33 | m_window_title.c_str(), NULL, NULL); | ||
| 30 | 34 | ||
| 31 | // Setup callbacks | 35 | // Setup callbacks |
| 32 | glfwSetWindowUserPointer(render_window_, this); | 36 | glfwSetWindowUserPointer(m_render_window, this); |
| 33 | //glfwSetKeyCallback(render_window_, OnKeyEvent); | 37 | //glfwSetKeyCallback(m_render_window, OnKeyEvent); |
| 34 | //glfwSetWindowSizeCallback(render_window_, OnWindowSizeEvent); | 38 | //glfwSetWindowSizeCallback(m_render_window, OnWindowSizeEvent); |
| 35 | 39 | ||
| 36 | DoneCurrent(); | 40 | DoneCurrent(); |
| 37 | } | 41 | } |
| @@ -43,23 +47,17 @@ EmuWindow_GLFW::~EmuWindow_GLFW() { | |||
| 43 | 47 | ||
| 44 | /// Swap buffers to display the next frame | 48 | /// Swap buffers to display the next frame |
| 45 | void EmuWindow_GLFW::SwapBuffers() { | 49 | void EmuWindow_GLFW::SwapBuffers() { |
| 46 | glfwSwapBuffers(render_window_); | 50 | glfwSwapBuffers(m_render_window); |
| 47 | } | 51 | } |
| 48 | 52 | ||
| 49 | /// Polls window events | 53 | /// Polls window events |
| 50 | void EmuWindow_GLFW::PollEvents() { | 54 | void EmuWindow_GLFW::PollEvents() { |
| 51 | // TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title | ||
| 52 | // from the main thread, but this should probably be in an event handler... | ||
| 53 | static char title[128]; | ||
| 54 | sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(), 0.0f); | ||
| 55 | glfwSetWindowTitle(render_window_, title); | ||
| 56 | |||
| 57 | glfwPollEvents(); | 55 | glfwPollEvents(); |
| 58 | } | 56 | } |
| 59 | 57 | ||
| 60 | /// Makes the GLFW OpenGL context current for the caller thread | 58 | /// Makes the GLFW OpenGL context current for the caller thread |
| 61 | void EmuWindow_GLFW::MakeCurrent() { | 59 | void EmuWindow_GLFW::MakeCurrent() { |
| 62 | glfwMakeContextCurrent(render_window_); | 60 | glfwMakeContextCurrent(m_render_window); |
| 63 | } | 61 | } |
| 64 | 62 | ||
| 65 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread | 63 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread |
diff --git a/src/citra/emu_window/emu_window_glfw.h b/src/citra/emu_window/emu_window_glfw.h index 6499315c8..5898ec177 100644 --- a/src/citra/emu_window/emu_window_glfw.h +++ b/src/citra/emu_window/emu_window_glfw.h | |||
| @@ -26,7 +26,7 @@ public: | |||
| 26 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread | 26 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread |
| 27 | void DoneCurrent(); | 27 | void DoneCurrent(); |
| 28 | 28 | ||
| 29 | GLFWwindow* render_window_; ///< Internal GLFW render window | 29 | GLFWwindow* m_render_window; ///< Internal GLFW render window |
| 30 | 30 | ||
| 31 | private: | 31 | private: |
| 32 | 32 | ||
diff --git a/src/citra/version.h b/src/citra/version.h deleted file mode 100644 index 07b88c641..000000000 --- a/src/citra/version.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | // GENERATED - Do not edit! | ||
| 2 | #ifndef VERSION_H_ | ||
| 3 | #define VERSION_H_ | ||
| 4 | #define __BUILD__ "122" | ||
| 5 | #define VERSION __BUILD__ | ||
| 6 | #endif // VERSION_H_ | ||
diff --git a/src/common/common.h b/src/common/common.h index 8795c8a0e..64a0d7812 100644 --- a/src/common/common.h +++ b/src/common/common.h | |||
| @@ -13,8 +13,8 @@ | |||
| 13 | #include <string.h> | 13 | #include <string.h> |
| 14 | 14 | ||
| 15 | // SVN version number | 15 | // SVN version number |
| 16 | extern const char *scm_rev_str; | 16 | extern const char *g_scm_rev_str; |
| 17 | extern const char *netplay_dolphin_ver; | 17 | extern const char *g_netplay_citra_ver; |
| 18 | 18 | ||
| 19 | // Force enable logging in the right modes. For some reason, something had changed | 19 | // Force enable logging in the right modes. For some reason, something had changed |
| 20 | // so that debugfast no longer logged. | 20 | // so that debugfast no longer logged. |
diff --git a/src/common/emu_window.h b/src/common/emu_window.h index 7f68c9237..731784756 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h | |||
| @@ -1,36 +1,10 @@ | |||
| 1 | /** | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | * Copyright (C) 2005-2012 Gekko Emulator | 2 | // Licensed under GPLv2 |
| 3 | * | 3 | // Refer to the license.txt file included. |
| 4 | * @file emu_window.h | ||
| 5 | * @author Neobrain | ||
| 6 | * @date 2012-06-01 | ||
| 7 | * @brief Interface for implementing an emulator window manager | ||
| 8 | * | ||
| 9 | * @section LICENSE | ||
| 10 | * This program is free software; you can redistribute it and/or | ||
| 11 | * modify it under the terms of the GNU General Public License as | ||
| 12 | * published by the Free Software Foundation; either version 2 of | ||
| 13 | * the License, or (at your option) any later version. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but | ||
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 18 | * General Public License for more details at | ||
| 19 | * http://www.gnu.org/copyleft/gpl.html | ||
| 20 | * | ||
| 21 | * Official project repository can be found at: | ||
| 22 | * http://code.google.com/p/gekko-gc-emu/ | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef CORE_EMUWINDOW_H_ | ||
| 26 | #define CORE_EMUWINDOW_H_ | ||
| 27 | 4 | ||
| 28 | #include "common/common.h" | 5 | #pragma once |
| 29 | 6 | ||
| 30 | //namespace input_common | 7 | #include "common/common.h" |
| 31 | //{ | ||
| 32 | //class KeyboardInput; | ||
| 33 | //} | ||
| 34 | 8 | ||
| 35 | // Abstraction class used to provide an interface between emulation code and the frontend (e.g. SDL, | 9 | // Abstraction class used to provide an interface between emulation code and the frontend (e.g. SDL, |
| 36 | // QGLWidget, GLFW, etc...) | 10 | // QGLWidget, GLFW, etc...) |
| @@ -57,46 +31,52 @@ public: | |||
| 57 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread | 31 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread |
| 58 | virtual void DoneCurrent() = 0; | 32 | virtual void DoneCurrent() = 0; |
| 59 | 33 | ||
| 60 | /** | 34 | Config GetConfig() const { |
| 61 | * @brief Called from KeyboardInput constructor to notify EmuWindow about its presence | 35 | return m_config; |
| 62 | * @param controller_interface Pointer to a running KeyboardInput interface | 36 | } |
| 63 | */ | 37 | |
| 64 | //void set_controller_interface(input_common::KeyboardInput* controller_interface) { | 38 | void SetConfig(const Config& val) { |
| 65 | // controller_interface_ = controller_interface; | 39 | m_config = val; |
| 66 | //} | 40 | } |
| 67 | //input_common::KeyboardInput* controller_interface() { return controller_interface_; } | ||
| 68 | |||
| 69 | Config config() { return config_; } | ||
| 70 | void set_config(Config val) { config_ = val; } | ||
| 71 | 41 | ||
| 72 | int client_area_width() { return client_area_width_; } | 42 | int GetClientAreaWidth() const { |
| 73 | void set_client_area_width(int val) { client_area_width_ = val; } | 43 | return m_client_area_width; |
| 44 | } | ||
| 74 | 45 | ||
| 75 | int client_area_height() { return client_area_height_; } | 46 | void SetClientAreaWidth(const int val) { |
| 76 | void set_client_area_height(int val) { client_area_height_ = val; } | 47 | m_client_area_width = val; |
| 48 | } | ||
| 77 | 49 | ||
| 78 | std::string window_title() { return window_title_; } | 50 | int GetClientAreaHeight() const { |
| 79 | void set_window_title(std::string val) { window_title_ = val; } | 51 | return m_client_area_height; |
| 52 | } | ||
| 53 | |||
| 54 | void SetClientAreaHeight(const int val) { | ||
| 55 | m_client_area_height = val; | ||
| 56 | } | ||
| 57 | |||
| 58 | std::string GetWindowTitle() { | ||
| 59 | return m_window_title; | ||
| 60 | } | ||
| 61 | |||
| 62 | void SetWindowTitle(std::string val) { | ||
| 63 | m_window_title = val; | ||
| 64 | } | ||
| 80 | 65 | ||
| 81 | protected: | 66 | protected: |
| 82 | EmuWindow() : client_area_width_(640), client_area_height_(480) { | 67 | EmuWindow() : m_client_area_width(640), m_client_area_height(480) { |
| 83 | char window_title[255]; | 68 | char window_title[255]; |
| 84 | sprintf(window_title, "citra [%s|%s] - %s", | 69 | sprintf(window_title, "citra-%s", g_scm_rev_str); |
| 85 | "null-cpu", | 70 | m_window_title = window_title; |
| 86 | "null-renderer", | ||
| 87 | __DATE__); | ||
| 88 | window_title_ = window_title; | ||
| 89 | } | 71 | } |
| 90 | virtual ~EmuWindow() {} | 72 | virtual ~EmuWindow() {} |
| 91 | 73 | ||
| 92 | std::string window_title_; ///< Current window title, should be used by window impl. | 74 | std::string m_window_title; ///< Current window title, should be used by window impl. |
| 93 | 75 | ||
| 94 | int client_area_width_; ///< Current client width, should be set by window impl. | 76 | int m_client_area_width; ///< Current client width, should be set by window impl. |
| 95 | int client_area_height_; ///< Current client height, should be set by window impl. | 77 | int m_client_area_height; ///< Current client height, should be set by window impl. |
| 96 | 78 | ||
| 97 | private: | 79 | private: |
| 98 | Config config_; ///< Internal configuration | 80 | Config m_config; ///< Internal configuration |
| 99 | 81 | ||
| 100 | }; | 82 | }; |
| 101 | |||
| 102 | #endif // CORE_EMUWINDOW_H_ | ||
diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h index 62a304f40..cd5df9ca8 100644 --- a/src/common/scm_rev.h +++ b/src/common/scm_rev.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | #define SCM_REV_STR "de0a034a849f5a1cbe2fed9ef2cc4095c56e672a" | 1 | #define SCM_REV_STR "d0674cc98bfa5729168274cde62a4e69343f8524" |
| 2 | #define SCM_DESC_STR "de0a034" | 2 | #define SCM_DESC_STR "d0674cc" |
| 3 | #define SCM_BRANCH_STR "fixed-directorys-for-neo" | 3 | #define SCM_BRANCH_STR "master" |
| 4 | #define SCM_IS_MASTER 0 | 4 | #define SCM_IS_MASTER 1 |
diff --git a/src/common/version.cpp b/src/common/version.cpp index f0df884d7..2e0c7390c 100644 --- a/src/common/version.cpp +++ b/src/common/version.cpp | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #define BUILD_TYPE_STR "" | 13 | #define BUILD_TYPE_STR "" |
| 14 | #endif | 14 | #endif |
| 15 | 15 | ||
| 16 | const char *scm_rev_str = "emu " | 16 | const char *g_scm_rev_str = |
| 17 | #if !SCM_IS_MASTER | 17 | #if !SCM_IS_MASTER |
| 18 | "[" SCM_BRANCH_STR "] " | 18 | "[" SCM_BRANCH_STR "] " |
| 19 | #endif | 19 | #endif |
| @@ -35,11 +35,11 @@ const char *scm_rev_str = "emu " | |||
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | #ifdef _WIN32 | 37 | #ifdef _WIN32 |
| 38 | const char *netplay_dolphin_ver = SCM_DESC_STR " W" NP_ARCH; | 38 | const char *g_netplay_citra_ver = SCM_DESC_STR " W" NP_ARCH; |
| 39 | #elif __APPLE__ | 39 | #elif __APPLE__ |
| 40 | const char *netplay_dolphin_ver = SCM_DESC_STR " M" NP_ARCH; | 40 | const char *g_netplay_citra_ver = SCM_DESC_STR " M" NP_ARCH; |
| 41 | #else | 41 | #else |
| 42 | const char *netplay_dolphin_ver = SCM_DESC_STR " L" NP_ARCH; | 42 | const char *g_netplay_citra_ver = SCM_DESC_STR " L" NP_ARCH; |
| 43 | #endif | 43 | #endif |
| 44 | 44 | ||
| 45 | const char *scm_rev_git_str = SCM_REV_STR; | 45 | const char *scm_rev_git_str = SCM_REV_STR; |