Qt: More windows cleaning.

This commit is contained in:
BearOso 2023-08-08 16:15:49 -05:00
parent c8b21fa461
commit 2ea377cba1
6 changed files with 95 additions and 53 deletions

6
port.h
View File

@ -124,9 +124,15 @@ typedef size_t pint;
#define S9xDisplayString DisplayStringFromBottom
#ifdef __WIN32__
#ifndef snprintf
#define snprintf _snprintf
#endif
#ifndef strcasecmp
#define strcasecmp stricmp
#endif
#ifndef strncasecmp
#define strncasecmp strnicmp
#endif
#endif // __WIN32__
#if defined(__DJGPP) || defined(__WIN32__)

View File

@ -11,11 +11,6 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_GLOBAL_AUTOGEN_TARGET ON)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(CMAKE_PREFIX_PATH "../external/qt6-mingw-clang-bin")
endif()
set(DEFINES SNES9X_QT)
set(SNES9X_CORE_SOURCES
../fxinst.cpp
@ -81,15 +76,38 @@ add_library(snes9x-core ${SNES9X_CORE_SOURCES})
target_include_directories(snes9x-core PRIVATE ../)
target_compile_definitions(snes9x-core PRIVATE ZLIB HAVE_STDINT_H ALLOW_CPU_OVERCLOCK)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(CMAKE_PREFIX_PATH "../external/qt6-mingw-clang-bin")
endif()
find_package(Qt6 REQUIRED COMPONENTS Widgets Gui)
list(APPEND LIBS Qt6::Widgets Qt6::Gui)
list(APPEND INCLUDES ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
find_package(PkgConfig REQUIRED)
pkg_check_modules(SDL REQUIRED sdl2)
pkg_check_modules(ZLIB REQUIRED zlib)
list(APPEND LIBS Qt6::Widgets Qt6::Gui ${SDL_LIBRARIES} ${ZLIB_LIBRARIES})
list(APPEND INCLUDES ${SDL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}${Qt6Gui_PRIVATE_INCLUDE_DIRS})
list(APPEND INCLUDES ${SDL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
list(APPEND FLAGS ${SDL_COMPILE_FLAGS} ${ZLIB_COMPILE_FLAGS})
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
list(APPEND LIBS opengl32 libSDL2.a libz.a libc++.a)
list(APPEND DEFINES SDL_MAIN_HANDLED)
list(APPEND PLATFORM_SOURCES
../common/video/wgl_context.cpp
../external/glad/src/wgl.c
src/resources/snes9x_win32.rc)
else()
pkg_check_modules(WAYLAND REQUIRED wayland-client wayland-egl)
include(FindX11)
if(NOT X11_FOUND)
error()
endif()
list(APPEND INCLUDES ${WAYLAND_INCLUDE_DIRS} ${X11_INCLUDE_DIRS})
list(APPEND LIBS ${WAYLAND_LIBRARIES} ${X11_LIBRARIES} ${ZLIB_LIBRARIES ${SDL_LIBRARIES}})
list(APPEND FLAGS ${WAYLAND_CFLAGS})
pkg_check_modules(PULSEAUDIO libpulse)
if(PULSEAUDIO_FOUND)
list(APPEND LIBS ${PULSEAUDIO_LIBRARIES})
@ -98,6 +116,17 @@ if(PULSEAUDIO_FOUND)
list(APPEND PLATFORM_SOURCES ../common/audio/s9x_sound_driver_pulse.cpp)
endif()
list(APPEND PLATFORM_SOURCES
../common/video/glx_context.cpp
../common/video/wayland_egl_context.cpp
../common/video/wayland_surface.cpp
../common/video/fractional-scale-v1.c
../common/video/viewporter-client-protocol.c
../common/video/wayland-idle-inhibit-unstable-v1.c
../external/glad/src/glx.c
../external/glad/src/egl.c)
endif()
list(APPEND QT_GUI_SOURCES
src/main.cpp
src/EmuApplication.cpp
@ -135,36 +164,6 @@ list(APPEND QT_GUI_SOURCES
../filter/snes_ntsc_impl.h
../filter/snes_ntsc.c)
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
pkg_check_modules(WAYLAND REQUIRED wayland-client wayland-egl)
include(FindX11)
if(NOT X11_FOUND)
error()
endif()
list(APPEND INCLUDES ${WAYLAND_INCLUDE_DIRS} ${X11_INCLUDE_DIRS})
list(APPEND LIBS ${WAYLAND_LIBRARIES} ${X11_LIBRARIES})
list(APPEND FLAGS ${WAYLAND_CFLAGS})
list(APPEND PLATFORM_SOURCES
../common/video/glx_context.cpp
../common/video/wayland_egl_context.cpp
../common/video/wayland_surface.cpp
../common/video/fractional-scale-v1.c
../common/video/viewporter-client-protocol.c
../common/video/wayland-idle-inhibit-unstable-v1.c
../external/glad/src/glx.c
../external/glad/src/egl.c)
else()
list(APPEND PLATFORM_SOURCES
../common/video/wgl_context.cpp
../external/glad/src/wgl.c
src/resources/snes9x_icon.rc)
list(APPEND LIBS opengl32)
list(APPEND DEFINES SDL_MAIN_HANDLED)
endif()
set(QT_UI_FILES
src/GeneralPanel.ui
src/ControllerPanel.ui

View File

@ -4,16 +4,15 @@
#include "Snes9xController.hpp"
#include "common/audio/s9x_sound_driver_sdl.hpp"
#include "common/audio/s9x_sound_driver_cubeb.hpp"
#include <qlabel.h>
#include <qnamespace.h>
#ifdef USE_PULSEAUDIO
#include "common/audio/s9x_sound_driver_pulse.hpp"
#endif
#include <QTimer>
#include <QScreen>
#include <chrono>
#include <thread>
#include <QThread>
#include <thread>
#include <chrono>
using namespace std::chrono_literals;
#undef SOUND_BUFFER_WINDOW

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<application>
<windowsSettings>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
</assembly>

View File

@ -1 +0,0 @@
IDI_ICON1 ICON "snes9x.ico"

View File

@ -0,0 +1,29 @@
1 24 snes9x-qt.exe.manifest
IDI_ICON1 ICON "snes9x.ico"
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,62,3,0
PRODUCTVERSION 1,62,3,0
FILEFLAGSMASK 0x3fL
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "http://www.snes9x.com"
VALUE "FileDescription", "Snes9x"
VALUE "FileVersion", "1.62.3"
VALUE "InternalName", "Snes9x"
VALUE "LegalCopyright", "Copyright (C) 1996-2023"
VALUE "OriginalFilename", "snes9x-qt.exe"
VALUE "ProductName", "Snes9x Qt Interface"
VALUE "ProductVersion", "1.62.3"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 65001
END
END