From 5a9c2ce5ea1b272d73001acaf9ec15f1c0e5e041 Mon Sep 17 00:00:00 2001 From: archshift Date: Mon, 28 Apr 2014 19:40:39 -0700 Subject: IT'S ALIVE! --- src/citra/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/citra') diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index 0023da2b..d7478a2d 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -1,12 +1,14 @@ set(SRCS citra.cpp emu_window/emu_window_glfw.cpp) +set(HEADS citra.h + resource.h) # NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable) if (NOT X11_xf86vmode_LIB) set(X11_xv86vmode_LIB Xxf86vm) endif() -add_executable(citra ${SRCS}) +add_executable(citra ${SRCS} ${HEADS}) target_link_libraries(citra core common video_core GLEW pthread X11 Xxf86vm Xi ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) #install(TARGETS citra RUNTIME DESTINATION ${bindir}) -- cgit v1.2.3 From 52377cf0d2e29143717898e82f09349d417da1a0 Mon Sep 17 00:00:00 2001 From: archshift Date: Tue, 29 Apr 2014 19:27:01 -0700 Subject: Some more experimentation --- CMakeLists.txt | 6 +++++- src/citra/CMakeLists.txt | 2 +- src/common/common.h | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/citra') diff --git a/CMakeLists.txt b/CMakeLists.txt index bd21af25..49c1a384 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6) project(citra) +SET(CMAKE_CXX_FLAGS "-std=c++11 -fpermissive") SET(CMAKE_CXX_FLAGS_DEBUG "-std=c++11 -fpermissive") SET(CMAKE_CXX_FLAGS_RELEASE "-std=c++11 -fpermissive") @@ -19,7 +20,10 @@ find_package(OpenGL REQUIRED) pkg_search_module(GLFW REQUIRED glfw3) IF (APPLE) - FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) + FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) + SET(CMAKE_CXX_FLAGS "-stdlib=libc++") + SET(CMAKE_CXX_FLAGS_DEBUG "-stdlib=libc++") + SET(CMAKE_CXX_FLAGS_RELEASE "-stdlib=libc++") ENDIF (APPLE) include_directories(${GLFW_INCLUDE_DIRS}) diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index ca272249..25f47689 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -9,6 +9,6 @@ if (NOT X11_xf86vmode_LIB) endif() add_executable(citra ${SRCS} ${HEADS}) -target_link_libraries(citra core common video_core GLEW pthread X11 Xxf86vm Xi Xcursor ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) +target_link_libraries(citra core common video_core iconv pthread ${COREFOUNDATION_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES}) #install(TARGETS citra RUNTIME DESTINATION ${bindir}) diff --git a/src/common/common.h b/src/common/common.h index 58de0c7d..30a6761b 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -21,11 +21,11 @@ #define STACKALIGN -#if __cplusplus >= 201103 || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__) +#if __cplusplus >= 201103L || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__) #define HAVE_CXX11_SYNTAX 1 #endif -#if HAVE_CXX11_SYNTAX +//#if HAVE_CXX11_SYNTAX // An inheritable class to disallow the copy constructor and operator= functions class NonCopyable { @@ -37,7 +37,7 @@ private: NonCopyable(NonCopyable&); NonCopyable& operator=(NonCopyable& other); }; -#endif +//#endif #include "common/log.h" #include "common/common_types.h" -- cgit v1.2.3 From a7f3ed003d03c79f83c1c354329e5ce47f6940e7 Mon Sep 17 00:00:00 2001 From: archshift Date: Wed, 30 Apr 2014 16:56:25 -0700 Subject: A bit of Cmake love --- CMakeLists.txt | 11 +++++++---- src/citra/CMakeLists.txt | 12 ++++++------ src/citra_qt/CMakeLists.txt | 4 ++-- src/core/CMakeLists.txt | 39 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 53 insertions(+), 13 deletions(-) (limited to 'src/citra') diff --git a/CMakeLists.txt b/CMakeLists.txt index 49c1a384..6837d36f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,14 @@ IF (APPLE) SET(CMAKE_CXX_FLAGS_RELEASE "-stdlib=libc++") ENDIF (APPLE) +#external includes include_directories(${GLFW_INCLUDE_DIRS}) +include_directories(${OPENGL_INCLUDE_DIR}) +include_directories(${GLEW_INCLUDE_DIR}) + +#use pkg_search_module library dirs +link_directories(${GLFW_LIBRARY_DIRS}) + option(DISABLE_QT4 "Disable Qt4 GUI" OFF) if(NOT DISABLE_QT4) include(FindQt4) @@ -47,10 +54,6 @@ include(GetGitRevisionDescription) get_git_head_revision(GIT_REF_SPEC GIT_REV) git_describe(GIT_DESC --always --long --dirty) git_branch_name(GIT_BRANCH) - -# external includes -include_directories(${OPENGL_INCLUDE_DIR}) -include_directories(${GLEW_INCLUDE_DIR}) # internal includes include_directories(src) diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index 25f47689..ee3cb55c 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -3,12 +3,12 @@ set(SRCS citra.cpp set(HEADS citra.h resource.h) -# NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable) -if (NOT X11_xf86vmode_LIB) - set(X11_xv86vmode_LIB Xxf86vm) -endif() - add_executable(citra ${SRCS} ${HEADS}) -target_link_libraries(citra core common video_core iconv pthread ${COREFOUNDATION_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES}) + +if (APPLE) + target_link_libraries(citra core common video_core iconv pthread ${COREFOUNDATION_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES}) +else() + target_link_libraries(citra core common video_core pthread ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES}) +endif() #install(TARGETS citra RUNTIME DESTINATION ${bindir}) diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index abca202e..b06be56f 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -51,9 +51,9 @@ include_directories(./) add_executable(citra-qt ${SRCS} ${HEADS} ${MOC_SRCS} ${UI_HDRS}) if (APPLE) - target_link_libraries(citra-qt core common video_core qhexedit iconv ${COREFOUNDATION_LIBRARY} ${QT_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) + target_link_libraries(citra-qt core common video_core qhexedit iconv ${COREFOUNDATION_LIBRARY} ${QT_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) else() - + target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) endif() #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 314f6e64..c8d95ba5 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -29,4 +29,41 @@ set(SRCS core.cpp hw/lcd.cpp hw/ndma.cpp) -add_library(core STATIC ${SRCS}) +set(HEADS core.h + core_timing.h + loader.h + mem_map.h + system.h + arm/disassembler/arm_disasm.h + arm/interpreter/arm_interpreter.h + arm/interpreter/arm_regformat.h + arm/interpreter/armcpu.h + arm/interpreter/armdefs.h + arm/interpreter/armemu.h + arm/interpreter/armmmu.h + arm/interpreter/armos.h + arm/interpreter/skyeye_defs.h + arm/mmu/arm1176jzf_s_mmu.h + arm/mmu/cache.h + arm/mmu/rb.h + arm/mmu/tlb.h + arm/mmu/wb.h + elf/elf_reader.h + elf/elf_types.h + file_sys/directory_file_system.h + file_sys/file_sys.h + file_sys/meta_file_system.h + hle/hle.h + hle/mrc.h + hle/syscall.h + hle/function_wrappers.h + hle/service/apt.h + hle/service/gsp.h + hle/service/hid.h + hle/service/service.h + hle/service/srv.h + hw/hw.h + hw/lcd.h + hw/ndma.h) + +add_library(core STATIC ${SRCS} ${HEADS}) -- cgit v1.2.3 From c1b770cc0db5649c4b9dc52f5e31105b2bc88eb6 Mon Sep 17 00:00:00 2001 From: archshift Date: Wed, 30 Apr 2014 17:00:36 -0700 Subject: OpenGL 3+ on OSX with GLFW --- src/citra/emu_window/emu_window_glfw.cpp | 9 ++++++++- src/video_core/video_core.cpp | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/citra') diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp index e6943f14..ea1499e7 100644 --- a/src/citra/emu_window/emu_window_glfw.cpp +++ b/src/citra/emu_window/emu_window_glfw.cpp @@ -27,11 +27,18 @@ EmuWindow_GLFW::EmuWindow_GLFW() { exit(1); } glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); + glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth, (VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight), m_window_title.c_str(), NULL, NULL); + if (m_render_window == NULL) { + printf("Failed to create GLFW window! Exiting..."); + exit(1); + } + // Setup callbacks glfwSetWindowUserPointer(m_render_window, this); //glfwSetKeyCallback(m_render_window, OnKeyEvent); diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index f2e17f9f..4e9cd70b 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -30,6 +30,8 @@ void Start() { /// Initialize the video core void Init(EmuWindow* emu_window) { + glewExperimental = GL_TRUE; + g_emu_window = emu_window; g_emu_window->MakeCurrent(); g_renderer = new RendererOpenGL(); -- cgit v1.2.3 From fb47258af76898f9f495e3da1a7db03a724cc9b3 Mon Sep 17 00:00:00 2001 From: archshift Date: Wed, 30 Apr 2014 18:34:49 -0700 Subject: TGA dumps work, courtesy of @bunnei --- src/citra/citra.cpp | 2 +- src/video_core/renderer_opengl/renderer_opengl.cpp | 2 + src/video_core/utils.cpp | 72 +++++++++++----------- 3 files changed, 39 insertions(+), 37 deletions(-) (limited to 'src/citra') diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index d55b9739..458695ca 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -24,7 +24,7 @@ int __cdecl main(int argc, char **argv) { System::Init(emu_window); - std::string boot_filename = "homebrew.elf"; + std::string boot_filename = "/Users/gandrade-air/Downloads/homebrew/yeti3DS-master.elf"; std::string error_str; bool res = Loader::LoadFile(boot_filename, &error_str); diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 314b1a8e..5407c483 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -6,6 +6,7 @@ #include "video_core/video_core.h" #include "video_core/renderer_opengl/renderer_opengl.h" +#include "video_core/utils.h" #include "core/mem_map.h" @@ -49,6 +50,7 @@ void RendererOpenGL::SwapBuffers() { // Switch back to EFB and clear glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fbo[kFramebuffer_EFB]); + VideoCore::DumpTGA("dump.tga", 400, 240, m_xfb_top_flipped); } /** diff --git a/src/video_core/utils.cpp b/src/video_core/utils.cpp index 67d74a2d..9fcefaad 100644 --- a/src/video_core/utils.cpp +++ b/src/video_core/utils.cpp @@ -8,39 +8,39 @@ #include "video_core/utils.h" namespace VideoCore { - -/** - * Dumps a texture to TGA - * @param filename String filename to dump texture to - * @param width Width of texture in pixels - * @param height Height of texture in pixels - * @param raw_data Raw RGBA8 texture data to dump - * @todo This should be moved to some general purpose/common code - */ -void DumpTGA(std::string filename, int width, int height, u8* raw_data) { - TGAHeader hdr; - FILE* fout; - u8 r, g, b; - - memset(&hdr, 0, sizeof(hdr)); - hdr.datatypecode = 2; // uncompressed RGB - hdr.bitsperpixel = 24; // 24 bpp - hdr.width = width; - hdr.height = height; - - fout = fopen(filename.c_str(), "wb"); - fwrite(&hdr, sizeof(TGAHeader), 1, fout); - for (int i = 0; i < height; i++) { - for (int j = 0; j < width; j++) { - r = raw_data[(4 * (i * width)) + (4 * j) + 0]; - g = raw_data[(4 * (i * width)) + (4 * j) + 1]; - b = raw_data[(4 * (i * width)) + (4 * j) + 2]; - putc(b, fout); - putc(g, fout); - putc(r, fout); - } - } - fclose(fout); -} - -} // namespace + + /** + * Dumps a texture to TGA + * @param filename String filename to dump texture to + * @param width Width of texture in pixels + * @param height Height of texture in pixels + * @param raw_data Raw RGBA8 texture data to dump + * @todo This should be moved to some general purpose/common code + */ + void DumpTGA(std::string filename, int width, int height, u8* raw_data) { + TGAHeader hdr; + FILE* fout; + u8 r, g, b; + + memset(&hdr, 0, sizeof(hdr)); + hdr.datatypecode = 2; // uncompressed RGB + hdr.bitsperpixel = 24; // 24 bpp + hdr.width = width; + hdr.height = height; + + fout = fopen(filename.c_str(), "wb"); + fwrite(&hdr, sizeof(TGAHeader), 1, fout); + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + b = raw_data[(3 * (i * width)) + (3 * j) + 0]; + g = raw_data[(3 * (i * width)) + (3 * j) + 1]; + r = raw_data[(3 * (i * width)) + (3 * j) + 2]; + putc(b, fout); + putc(g, fout); + putc(r, fout); + } + } + fclose(fout); + } + +} // namespace \ No newline at end of file -- cgit v1.2.3 From dade106aa92cd82864aeda2f17ef10da1ed8b49d Mon Sep 17 00:00:00 2001 From: archshift Date: Wed, 30 Apr 2014 18:44:48 -0700 Subject: Linux support --- src/citra/CMakeLists.txt | 7 ++++++- src/citra_qt/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/citra') diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index ee3cb55c..2e4fbe35 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -3,12 +3,17 @@ set(SRCS citra.cpp set(HEADS citra.h resource.h) +# NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable) +if (NOT X11_xf86vmode_LIB) + set(X11_xv86vmode_LIB Xxf86vm) +endif() + add_executable(citra ${SRCS} ${HEADS}) if (APPLE) target_link_libraries(citra core common video_core iconv pthread ${COREFOUNDATION_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES}) else() - target_link_libraries(citra core common video_core pthread ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES}) + target_link_libraries(citra core common video_core GLEW pthread X11 Xxf86vm Xi Xcursor ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) endif() #install(TARGETS citra RUNTIME DESTINATION ${bindir}) diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index b06be56f..3a133554 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -53,7 +53,7 @@ add_executable(citra-qt ${SRCS} ${HEADS} ${MOC_SRCS} ${UI_HDRS}) if (APPLE) target_link_libraries(citra-qt core common video_core qhexedit iconv ${COREFOUNDATION_LIBRARY} ${QT_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) else() - target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) + target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES}) endif() #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) -- cgit v1.2.3 From 948cfe6d37558ee3a98649d88655a08774f09e3e Mon Sep 17 00:00:00 2001 From: archshift Date: Wed, 30 Apr 2014 20:00:44 -0700 Subject: Reverse debugging changes --- src/citra/citra.cpp | 2 +- src/video_core/renderer_opengl/renderer_opengl.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/citra') diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 458695ca..d55b9739 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -24,7 +24,7 @@ int __cdecl main(int argc, char **argv) { System::Init(emu_window); - std::string boot_filename = "/Users/gandrade-air/Downloads/homebrew/yeti3DS-master.elf"; + std::string boot_filename = "homebrew.elf"; std::string error_str; bool res = Loader::LoadFile(boot_filename, &error_str); diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 5407c483..314b1a8e 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -6,7 +6,6 @@ #include "video_core/video_core.h" #include "video_core/renderer_opengl/renderer_opengl.h" -#include "video_core/utils.h" #include "core/mem_map.h" @@ -50,7 +49,6 @@ void RendererOpenGL::SwapBuffers() { // Switch back to EFB and clear glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fbo[kFramebuffer_EFB]); - VideoCore::DumpTGA("dump.tga", 400, 240, m_xfb_top_flipped); } /** -- cgit v1.2.3 From 704075f04a8adda82141f3c68addfd6c34a08765 Mon Sep 17 00:00:00 2001 From: archshift Date: Wed, 30 Apr 2014 20:12:01 -0700 Subject: Fixed indents --- src/citra/CMakeLists.txt | 2 +- src/citra/emu_window/emu_window_glfw.cpp | 14 +++---- src/citra_qt/CMakeLists.txt | 2 +- src/citra_qt/bootmanager.cpp | 38 +++++++++--------- src/common/CMakeLists.txt | 2 +- src/core/CMakeLists.txt | 4 +- src/video_core/utils.cpp | 68 ++++++++++++++++---------------- src/video_core/video_core.cpp | 4 +- 8 files changed, 66 insertions(+), 68 deletions(-) (limited to 'src/citra') diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index 2e4fbe35..7787d6a7 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -13,7 +13,7 @@ add_executable(citra ${SRCS} ${HEADS}) if (APPLE) target_link_libraries(citra core common video_core iconv pthread ${COREFOUNDATION_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES}) else() - target_link_libraries(citra core common video_core GLEW pthread X11 Xxf86vm Xi Xcursor ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) + target_link_libraries(citra core common video_core GLEW pthread X11 Xxf86vm Xi Xcursor ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) endif() #install(TARGETS citra RUNTIME DESTINATION ${bindir}) diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp index ea1499e7..73c11637 100644 --- a/src/citra/emu_window/emu_window_glfw.cpp +++ b/src/citra/emu_window/emu_window_glfw.cpp @@ -28,17 +28,17 @@ EmuWindow_GLFW::EmuWindow_GLFW() { } glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); + glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth, (VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight), m_window_title.c_str(), NULL, NULL); - if (m_render_window == NULL) { - printf("Failed to create GLFW window! Exiting..."); - exit(1); - } - + if (m_render_window == NULL) { + printf("Failed to create GLFW window! Exiting..."); + exit(1); + } + // Setup callbacks glfwSetWindowUserPointer(m_render_window, this); //glfwSetKeyCallback(m_render_window, OnKeyEvent); diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 3a133554..9d983c0f 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -53,7 +53,7 @@ add_executable(citra-qt ${SRCS} ${HEADS} ${MOC_SRCS} ${UI_HDRS}) if (APPLE) target_link_libraries(citra-qt core common video_core qhexedit iconv ${COREFOUNDATION_LIBRARY} ${QT_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) else() - target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES}) + target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES}) endif() #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 52b39eb2..bd01b78c 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -47,7 +47,7 @@ void EmuThread::run() void EmuThread::Stop() { - if (!isRunning()) + if (!isRunning()) { INFO_LOG(MASTER_LOG, "EmuThread::Stop called while emu thread wasn't running, returning..."); return; @@ -62,7 +62,7 @@ void EmuThread::Stop() terminate(); wait(1000); if (isRunning()) - WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here..."); + WARN_LOG(MASTER_LOG, "EmuThread STILL running, something is wrong here..."); } INFO_LOG(MASTER_LOG, "EmuThread stopped"); } @@ -75,8 +75,8 @@ class GGLWidgetInternal : public QGLWidget public: GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) : QGLWidget(parent) { - doneCurrent(); - parent_ = parent; + doneCurrent(); + parent_ = parent; } void paintEvent(QPaintEvent* ev) @@ -102,12 +102,12 @@ EmuThread& GRenderWindow::GetEmuThread() GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this) { // TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, WA_DontShowOnScreen, WA_DeleteOnClose - QGLFormat fmt; - fmt.setProfile(QGLFormat::CoreProfile); - fmt.setVersion(4,1); - fmt.setSampleBuffers(true); - fmt.setSamples(4); - + QGLFormat fmt; + fmt.setProfile(QGLFormat::CoreProfile); + fmt.setVersion(4,1); + fmt.setSampleBuffers(true); + fmt.setSamples(4); + child = new GGLWidgetInternal(fmt, this); QBoxLayout* layout = new QHBoxLayout(this); resize(VideoCore::kScreenTopWidth, VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight); @@ -148,12 +148,12 @@ void GRenderWindow::DoneCurrent() void GRenderWindow::PollEvents() { // TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title // from the main thread, but this should probably be in an event handler... - /* - static char title[128]; + /* + static char title[128]; sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(), video_core::g_renderer->current_fps()); setWindowTitle(title); - */ + */ } void GRenderWindow::BackupGeometry() @@ -186,26 +186,26 @@ QByteArray GRenderWindow::saveGeometry() void GRenderWindow::keyPressEvent(QKeyEvent* event) { - /* - bool key_processed = false; + /* + bool key_processed = false; for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel) if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::PRESSED)) key_processed = true; if (!key_processed) QWidget::keyPressEvent(event); - */ + */ } void GRenderWindow::keyReleaseEvent(QKeyEvent* event) { - /* - bool key_processed = false; + /* + bool key_processed = false; for (unsigned int channel = 0; channel < 4 && controller_interface(); ++channel) if (controller_interface()->SetControllerStatus(channel, event->key(), input_common::GCController::RELEASED)) key_processed = true; if (!key_processed) QWidget::keyPressEvent(event); - */ + */ } \ No newline at end of file diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 48f30de4..ae233107 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -45,7 +45,7 @@ set(HEADS atomic.h memory_util.h msg_handler.h platform.h - scm_rev.h + scm_rev.h std_condition_variable.h std_mutex.h std_thread.h diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index c8d95ba5..11b90434 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -50,10 +50,10 @@ set(HEADS core.h arm/mmu/wb.h elf/elf_reader.h elf/elf_types.h - file_sys/directory_file_system.h + file_sys/directory_file_system.h file_sys/file_sys.h file_sys/meta_file_system.h - hle/hle.h + hle/hle.h hle/mrc.h hle/syscall.h hle/function_wrappers.h diff --git a/src/video_core/utils.cpp b/src/video_core/utils.cpp index 9fcefaad..29382c81 100644 --- a/src/video_core/utils.cpp +++ b/src/video_core/utils.cpp @@ -8,39 +8,37 @@ #include "video_core/utils.h" namespace VideoCore { - - /** - * Dumps a texture to TGA - * @param filename String filename to dump texture to - * @param width Width of texture in pixels - * @param height Height of texture in pixels - * @param raw_data Raw RGBA8 texture data to dump - * @todo This should be moved to some general purpose/common code - */ - void DumpTGA(std::string filename, int width, int height, u8* raw_data) { - TGAHeader hdr; - FILE* fout; - u8 r, g, b; - - memset(&hdr, 0, sizeof(hdr)); - hdr.datatypecode = 2; // uncompressed RGB - hdr.bitsperpixel = 24; // 24 bpp - hdr.width = width; - hdr.height = height; - - fout = fopen(filename.c_str(), "wb"); - fwrite(&hdr, sizeof(TGAHeader), 1, fout); - for (int i = 0; i < height; i++) { - for (int j = 0; j < width; j++) { - b = raw_data[(3 * (i * width)) + (3 * j) + 0]; - g = raw_data[(3 * (i * width)) + (3 * j) + 1]; - r = raw_data[(3 * (i * width)) + (3 * j) + 2]; - putc(b, fout); - putc(g, fout); - putc(r, fout); - } - } - fclose(fout); - } - + /** + * Dumps a texture to TGA + * @param filename String filename to dump texture to + * @param width Width of texture in pixels + * @param height Height of texture in pixels + * @param raw_data Raw RGBA8 texture data to dump + * @todo This should be moved to some general purpose/common code + */ + void DumpTGA(std::string filename, int width, int height, u8* raw_data) { + TGAHeader hdr; + FILE* fout; + u8 r, g, b; + + memset(&hdr, 0, sizeof(hdr)); + hdr.datatypecode = 2; // uncompressed RGB + hdr.bitsperpixel = 24; // 24 bpp + hdr.width = width; + hdr.height = height; + + fout = fopen(filename.c_str(), "wb"); + fwrite(&hdr, sizeof(TGAHeader), 1, fout); + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + b = raw_data[(3 * (i * width)) + (3 * j) + 0]; + g = raw_data[(3 * (i * width)) + (3 * j) + 1]; + r = raw_data[(3 * (i * width)) + (3 * j) + 2]; + putc(b, fout); + putc(g, fout); + putc(r, fout); + } + } + fclose(fout); + } } // namespace \ No newline at end of file diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 4e9cd70b..5f1933b1 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -30,8 +30,8 @@ void Start() { /// Initialize the video core void Init(EmuWindow* emu_window) { - glewExperimental = GL_TRUE; - + glewExperimental = GL_TRUE; + g_emu_window = emu_window; g_emu_window->MakeCurrent(); g_renderer = new RendererOpenGL(); -- cgit v1.2.3 From 403e4bf837c47c7e10dc006fafffea8c160c890f Mon Sep 17 00:00:00 2001 From: archshift Date: Mon, 19 May 2014 15:19:36 -0700 Subject: CMakeLists: rename HEADS, improved comments Changes for clarity of comments, removed redundant compiler flags. --- CMakeLists.txt | 5 ++--- src/citra/CMakeLists.txt | 4 ++-- src/citra_qt/CMakeLists.txt | 4 ++-- src/common/CMakeLists.txt | 4 ++-- src/core/CMakeLists.txt | 4 ++-- src/video_core/CMakeLists.txt | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src/citra') diff --git a/CMakeLists.txt b/CMakeLists.txt index b4665640..76190c5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,6 @@ cmake_minimum_required(VERSION 2.6) project(citra) SET(CMAKE_CXX_FLAGS "-std=c++11 -fpermissive") -SET(CMAKE_CXX_FLAGS_DEBUG "-std=c++11 -fpermissive") -SET(CMAKE_CXX_FLAGS_RELEASE "-std=c++11 -fpermissive") # silence some spam add_definitions(-Wno-attributes) @@ -20,6 +18,7 @@ find_package(GLEW REQUIRED) find_package(OpenGL REQUIRED) pkg_search_module(GLFW REQUIRED glfw3) +# corefoundation is required only on OSX IF (APPLE) FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) SET(CMAKE_CXX_FLAGS "-stdlib=libc++") @@ -31,7 +30,7 @@ include_directories(${GLFW_INCLUDE_DIRS}) include_directories(${OPENGL_INCLUDE_DIR}) include_directories(${GLEW_INCLUDE_DIR}) -#use pkg_search_module library dirs +# workaround for GLFW linking on OSX link_directories(${GLFW_LIBRARY_DIRS}) option(DISABLE_QT4 "Disable Qt4 GUI" OFF) diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index 7787d6a7..1ad607d7 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -1,6 +1,6 @@ set(SRCS citra.cpp emu_window/emu_window_glfw.cpp) -set(HEADS citra.h +set(HEADERS citra.h resource.h) # NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable) @@ -8,7 +8,7 @@ if (NOT X11_xf86vmode_LIB) set(X11_xv86vmode_LIB Xxf86vm) endif() -add_executable(citra ${SRCS} ${HEADS}) +add_executable(citra ${SRCS} ${HEADERS}) if (APPLE) target_link_libraries(citra core common video_core iconv pthread ${COREFOUNDATION_LIBRARY} ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} ${GLFW_LIBRARIES}) diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 9d983c0f..549f6921 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -8,7 +8,7 @@ set(SRCS main.cpp config/controller_config.cpp config/controller_config_util.cpp) -set (HEADS +set (HEADERS bootmanager.hxx debugger/callstack.hxx debugger/disassembler.hxx @@ -49,7 +49,7 @@ qt4_wrap_cpp(MOC_SRCS include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(./) -add_executable(citra-qt ${SRCS} ${HEADS} ${MOC_SRCS} ${UI_HDRS}) +add_executable(citra-qt ${SRCS} ${HEADERS} ${MOC_SRCS} ${UI_HDRS}) if (APPLE) target_link_libraries(citra-qt core common video_core qhexedit iconv ${COREFOUNDATION_LIBRARY} ${QT_LIBRARIES} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) else() diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 0027ae2b..aae18339 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -19,7 +19,7 @@ set(SRCS break_points.cpp timer.cpp utf8.cpp) -set(HEADS atomic.h +set(HEADERS atomic.h atomic_gcc.h atomic_win32.h bit_field.h @@ -58,4 +58,4 @@ set(HEADS atomic.h timer.h utf8.h) -add_library(common STATIC ${SRCS} ${HEADS}) +add_library(common STATIC ${SRCS} ${HEADERS}) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ddf6bf79..14c598bf 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -43,7 +43,7 @@ set(SRCS core.cpp hw/lcd.cpp hw/ndma.cpp) -set(HEADS core.h +set(HEADERS core.h core_timing.h loader.h mem_map.h @@ -86,4 +86,4 @@ set(HEADS core.h hw/lcd.h hw/ndma.h) -add_library(core STATIC ${SRCS} ${HEADS}) +add_library(core STATIC ${SRCS} ${HEADERS}) diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 8d04d381..e43e6e1b 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -2,9 +2,9 @@ set(SRCS video_core.cpp utils.cpp renderer_opengl/renderer_opengl.cpp) -set(HEADS video_core.h +set(HEADERS video_core.h utils.h renderer_base.h renderer_opengl/renderer_opengl.h) -add_library(video_core STATIC ${SRCS} ${HEADS}) +add_library(video_core STATIC ${SRCS} ${HEADERS}) -- cgit v1.2.3