From ebe936f03f4e900b4f53b879e3192d2406f3c488 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 23 Apr 2020 22:58:02 +0200 Subject: [PATCH] - moved platform backend code to 'common'. --- source/CMakeLists.txt | 122 ++++++----- source/common/engine/g_input.h | 9 + source/common/engine/i_interface.h | 1 + .../platform/posix/cocoa/gl_sysfb.h | 0 .../platform/posix/cocoa/i_common.h | 0 .../platform/posix/cocoa/i_input.mm | 0 .../platform/posix/cocoa/i_joystick.cpp | 0 .../platform/posix/cocoa/i_main.mm | 0 .../platform/posix/cocoa/i_system.mm | 0 .../platform/posix/cocoa/i_video.mm | 0 .../platform/posix/cocoa/st_console.h | 0 .../platform/posix/cocoa/st_console.mm | 0 .../platform/posix/cocoa/st_start.mm | 0 source/{ => common}/platform/posix/dikeys.h | 0 source/{ => common}/platform/posix/hardware.h | 0 source/{ => common}/platform/posix/i_system.h | 17 +- .../platform/posix/i_system_posix.cpp | 0 .../platform/posix/osx/i_specialpaths.mm | 0 .../platform/posix/osx/iwadpicker_cocoa.mm | 0 source/{ => common}/platform/posix/readme.md | 0 .../platform/posix/sdl/crashcatcher.c | 0 .../platform/posix/sdl/gl_sysfb.h | 0 .../platform/posix/sdl/hardware.cpp | 0 .../{ => common}/platform/posix/sdl/i_gui.cpp | 0 .../platform/posix/sdl/i_input.cpp | 0 .../platform/posix/sdl/i_joystick.cpp | 0 .../platform/posix/sdl/i_main.cpp | 0 .../platform/posix/sdl/i_system.cpp | 0 .../platform/posix/sdl/i_system.mm | 0 .../platform/posix/sdl/sdlglvideo.cpp | 0 .../platform/posix/sdl/st_start.cpp | 0 .../platform/posix/unix/gtk_dialogs.cpp | 0 .../platform/posix/unix/i_specialpaths.cpp | 0 source/{ => common}/platform/win32/afxres.h | 0 .../platform/win32/base_sysfb.cpp | 0 .../{ => common}/platform/win32/base_sysfb.h | 0 .../{ => common}/platform/win32/gl_sysfb.cpp | 0 source/{ => common}/platform/win32/gl_sysfb.h | 0 .../{ => common}/platform/win32/hardware.cpp | 0 source/{ => common}/platform/win32/hardware.h | 0 .../{ => common}/platform/win32/i_crash.cpp | 0 .../{ => common}/platform/win32/i_dijoy.cpp | 0 .../{ => common}/platform/win32/i_input.cpp | 0 source/{ => common}/platform/win32/i_input.h | 0 .../platform/win32/i_keyboard.cpp | 0 source/{ => common}/platform/win32/i_main.cpp | 0 .../{ => common}/platform/win32/i_mouse.cpp | 0 .../{ => common}/platform/win32/i_rawps2.cpp | 0 .../platform/win32/i_specialpaths.cpp | 0 .../{ => common}/platform/win32/i_system.cpp | 0 source/{ => common}/platform/win32/i_system.h | 36 ---- .../{ => common}/platform/win32/i_xinput.cpp | 0 .../platform/win32/manifest.xml} | 0 source/{ => common}/platform/win32/resource.h | 0 .../{ => common}/platform/win32/st_start.cpp | 0 .../platform/win32/st_start_util.cpp | 3 +- source/{ => common}/platform/win32/wglext.h | 0 .../platform/win32/win32basevideo.cpp | 0 .../platform/win32/win32basevideo.h | 0 .../platform/win32/win32glvideo.cpp | 0 .../platform/win32/win32glvideo.h | 0 .../common/platform/win32/win32polyvideo.cpp | 199 ++++++++++++++++++ source/common/platform/win32/win32polyvideo.h | 21 ++ .../platform/win32/win32vulkanvideo.cpp | 4 +- .../platform/win32/win32vulkanvideo.h | 4 +- source/{ => common}/platform/win32/winres.h | 0 .../{ => common}/platform/win32/zutil.natvis | 0 source/core/console/c_console.cpp | 1 + source/core/searchpaths.cpp | 1 + source/platform/win32/gameres.rc | 2 +- 70 files changed, 305 insertions(+), 115 deletions(-) create mode 100644 source/common/engine/g_input.h rename source/{ => common}/platform/posix/cocoa/gl_sysfb.h (100%) rename source/{ => common}/platform/posix/cocoa/i_common.h (100%) rename source/{ => common}/platform/posix/cocoa/i_input.mm (100%) rename source/{ => common}/platform/posix/cocoa/i_joystick.cpp (100%) rename source/{ => common}/platform/posix/cocoa/i_main.mm (100%) rename source/{ => common}/platform/posix/cocoa/i_system.mm (100%) rename source/{ => common}/platform/posix/cocoa/i_video.mm (100%) rename source/{ => common}/platform/posix/cocoa/st_console.h (100%) rename source/{ => common}/platform/posix/cocoa/st_console.mm (100%) rename source/{ => common}/platform/posix/cocoa/st_start.mm (100%) rename source/{ => common}/platform/posix/dikeys.h (100%) rename source/{ => common}/platform/posix/hardware.h (100%) rename source/{ => common}/platform/posix/i_system.h (75%) rename source/{ => common}/platform/posix/i_system_posix.cpp (100%) rename source/{ => common}/platform/posix/osx/i_specialpaths.mm (100%) rename source/{ => common}/platform/posix/osx/iwadpicker_cocoa.mm (100%) rename source/{ => common}/platform/posix/readme.md (100%) rename source/{ => common}/platform/posix/sdl/crashcatcher.c (100%) rename source/{ => common}/platform/posix/sdl/gl_sysfb.h (100%) rename source/{ => common}/platform/posix/sdl/hardware.cpp (100%) rename source/{ => common}/platform/posix/sdl/i_gui.cpp (100%) rename source/{ => common}/platform/posix/sdl/i_input.cpp (100%) rename source/{ => common}/platform/posix/sdl/i_joystick.cpp (100%) rename source/{ => common}/platform/posix/sdl/i_main.cpp (100%) rename source/{ => common}/platform/posix/sdl/i_system.cpp (100%) rename source/{ => common}/platform/posix/sdl/i_system.mm (100%) rename source/{ => common}/platform/posix/sdl/sdlglvideo.cpp (100%) rename source/{ => common}/platform/posix/sdl/st_start.cpp (100%) rename source/{ => common}/platform/posix/unix/gtk_dialogs.cpp (100%) rename source/{ => common}/platform/posix/unix/i_specialpaths.cpp (100%) rename source/{ => common}/platform/win32/afxres.h (100%) rename source/{ => common}/platform/win32/base_sysfb.cpp (100%) rename source/{ => common}/platform/win32/base_sysfb.h (100%) rename source/{ => common}/platform/win32/gl_sysfb.cpp (100%) rename source/{ => common}/platform/win32/gl_sysfb.h (100%) rename source/{ => common}/platform/win32/hardware.cpp (100%) rename source/{ => common}/platform/win32/hardware.h (100%) rename source/{ => common}/platform/win32/i_crash.cpp (100%) rename source/{ => common}/platform/win32/i_dijoy.cpp (100%) rename source/{ => common}/platform/win32/i_input.cpp (100%) rename source/{ => common}/platform/win32/i_input.h (100%) rename source/{ => common}/platform/win32/i_keyboard.cpp (100%) rename source/{ => common}/platform/win32/i_main.cpp (100%) rename source/{ => common}/platform/win32/i_mouse.cpp (100%) rename source/{ => common}/platform/win32/i_rawps2.cpp (100%) rename source/{ => common}/platform/win32/i_specialpaths.cpp (100%) rename source/{ => common}/platform/win32/i_system.cpp (100%) rename source/{ => common}/platform/win32/i_system.h (65%) rename source/{ => common}/platform/win32/i_xinput.cpp (100%) rename source/{platform/win32/manifest.game.xml => common/platform/win32/manifest.xml} (100%) rename source/{ => common}/platform/win32/resource.h (100%) rename source/{ => common}/platform/win32/st_start.cpp (100%) rename source/{ => common}/platform/win32/st_start_util.cpp (99%) rename source/{ => common}/platform/win32/wglext.h (100%) rename source/{ => common}/platform/win32/win32basevideo.cpp (100%) rename source/{ => common}/platform/win32/win32basevideo.h (100%) rename source/{ => common}/platform/win32/win32glvideo.cpp (100%) rename source/{ => common}/platform/win32/win32glvideo.h (100%) create mode 100644 source/common/platform/win32/win32polyvideo.cpp create mode 100644 source/common/platform/win32/win32polyvideo.h rename source/{ => common}/platform/win32/win32vulkanvideo.cpp (99%) rename source/{ => common}/platform/win32/win32vulkanvideo.h (85%) rename source/{ => common}/platform/win32/winres.h (100%) rename source/{ => common}/platform/win32/zutil.natvis (100%) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 41a357154..059fd8202 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -462,84 +462,85 @@ if( ${HAVE_VM_JIT} ) set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "${ASMJIT_LIBRARIES}") endif() +# Start defining source files for ZDoom +set( PLAT_WIN32_SOURCES + platform/win32/i_steam.cpp + common/platform/win32/hardware.cpp + common/platform/win32/i_crash.cpp + common/platform/win32/i_input.cpp + common/platform/win32/i_keyboard.cpp + common/platform/win32/i_mouse.cpp + common/platform/win32/i_dijoy.cpp + common/platform/win32/i_rawps2.cpp + common/platform/win32/i_xinput.cpp + common/platform/win32/i_main.cpp + common/platform/win32/i_system.cpp + common/platform/win32/i_specialpaths.cpp + common/platform/win32/st_start.cpp + common/platform/win32/st_start_util.cpp + common/platform/win32/gl_sysfb.cpp + common/platform/win32/base_sysfb.cpp + common/platform/win32/win32basevideo.cpp + common/platform/win32/win32glvideo.cpp + common/platform/win32/win32polyvideo.cpp) +if (HAVE_VULKAN) + set (PLAT_WIN32_SOURCES ${PLAT_WIN32_SOURCES} common/platform/win32/win32vulkanvideo.cpp ) +endif() + set( PLAT_POSIX_SOURCES platform/posix/i_steam.cpp - platform/posix/i_system_posix.cpp ) + common/platform/posix/i_system_posix.cpp ) set( PLAT_SDL_SOURCES - platform/posix/sdl/crashcatcher.c - platform/posix/sdl/hardware.cpp - platform/posix/sdl/i_gui.cpp - platform/posix/sdl/i_input.cpp - platform/posix/sdl/i_joystick.cpp - platform/posix/sdl/i_main.cpp - platform/posix/sdl/i_system.cpp - platform/posix/sdl/sdlglvideo.cpp - platform/posix/sdl/st_start.cpp ) + common/platform/posix/sdl/crashcatcher.c + common/platform/posix/sdl/hardware.cpp + common/platform/posix/sdl/i_gui.cpp + common/platform/posix/sdl/i_input.cpp + common/platform/posix/sdl/i_joystick.cpp + common/platform/posix/sdl/i_main.cpp + common/platform/posix/sdl/i_system.cpp + common/platform/posix/sdl/sdlglvideo.cpp + common/platform/posix/sdl/st_start.cpp ) set( PLAT_UNIX_SOURCES - platform/posix/unix/i_specialpaths.cpp - platform/posix/unix/gtk_dialogs.cpp ) + common/platform/posix/unix/i_specialpaths.cpp + common/platform/posix/unix/gtk_dialogs.cpp ) set( PLAT_OSX_SOURCES - platform/posix/osx/iwadpicker_cocoa.mm - platform/posix/osx/i_specialpaths.mm + common/platform/posix/osx/iwadpicker_cocoa.mm + common/platform/posix/osx/i_specialpaths.mm platform/posix/osx/raze.icns ) set( PLAT_COCOA_SOURCES - platform/posix/cocoa/i_input.mm - platform/posix/cocoa/i_joystick.cpp - platform/posix/cocoa/i_main.mm - platform/posix/cocoa/i_system.mm - platform/posix/cocoa/i_video.mm - platform/posix/cocoa/st_console.mm - platform/posix/cocoa/st_start.mm ) - -# Start defining source files -set( PLAT_WIN32_SOURCES - platform/win32/base_sysfb.cpp - platform/win32/gl_sysfb.cpp - platform/win32/hardware.cpp - platform/win32/i_crash.cpp - platform/win32/i_dijoy.cpp - platform/win32/i_input.cpp - platform/win32/i_keyboard.cpp - platform/win32/i_main.cpp - platform/win32/i_mouse.cpp - platform/win32/i_rawps2.cpp - platform/win32/i_specialpaths.cpp - platform/win32/i_system.cpp - platform/win32/i_xinput.cpp - platform/win32/st_start.cpp - platform/win32/st_start_util.cpp - platform/win32/win32basevideo.cpp - platform/win32/win32glvideo.cpp - platform/win32/win32vulkanvideo.cpp - platform/win32/i_steam.cpp - ) - + common/platform/posix/cocoa/i_input.mm + common/platform/posix/cocoa/i_joystick.cpp + common/platform/posix/cocoa/i_main.mm + common/platform/posix/cocoa/i_system.mm + common/platform/posix/cocoa/i_video.mm + common/platform/posix/cocoa/st_console.mm + common/platform/posix/cocoa/st_start.mm ) if( WIN32 ) - set( SYSTEM_SOURCES_DIR platform/win32 ) + set( SYSTEM_SOURCES_DIR common/platform/win32 ) set( SYSTEM_SOURCES ${PLAT_WIN32_SOURCES} ) set( OTHER_SYSTEM_SOURCES ${PLAT_POSIX_SOURCES} ${PLAT_SDL_SOURCES} ${PLAT_OSX_SOURCES} ${PLAT_COCOA_SOURCES} ${PLAT_UNIX_SOURCES} ) set( SYSTEM_SOURCES ${SYSTEM_SOURCES} platform/win32/gameres.rc ) elseif( APPLE ) if( OSX_COCOA_BACKEND ) - set( SYSTEM_SOURCES_DIR platform/posix/cocoa ) + set( SYSTEM_SOURCES_DIR common/platform/posix common/platform/posix/cocoa ) set( SYSTEM_SOURCES ${PLAT_COCOA_SOURCES} ) set( OTHER_SYSTEM_SOURCES ${PLAT_WIN32_SOURCES} ${PLAT_SDL_SOURCES} ${PLAT_UNIX_SOURCES} ) else() - set( SYSTEM_SOURCES_DIR platform/posix/sdl ) + set( SYSTEM_SOURCES_DIR common/platform/posix common/platform/posix/sdl ) set( SYSTEM_SOURCES ${PLAT_SDL_SOURCES} ) - set( PLAT_OSX_SOURCES ${PLAT_OSX_SOURCES} platform/posix/sdl/i_system.mm ) + set( PLAT_OSX_SOURCES ${PLAT_OSX_SOURCES} common/platform/posix/sdl/i_system.mm ) set( OTHER_SYSTEM_SOURCES ${PLAT_WIN32_SOURCES} ${PLAT_COCOA_SOURCES} ${PLAT_UNIX_SOURCES} ) endif() set( SYSTEM_SOURCES ${SYSTEM_SOURCES} ${PLAT_POSIX_SOURCES} ${PLAT_OSX_SOURCES} ) set_source_files_properties( platform/posix/osx/${PROJECT_NAME}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) - set_source_files_properties( platform/posix/osx/iwadpicker_cocoa.mm PROPERTIES COMPILE_FLAGS -fobjc-exceptions ) + set_source_files_properties( common/platform/posix/osx/iwadpicker_cocoa.mm PROPERTIES COMPILE_FLAGS -fobjc-exceptions ) else() - set( SYSTEM_SOURCES_DIR platform/posix/sdl ) + set( SYSTEM_SOURCES_DIR common/platform/posix common/platform/posix/sdl ) set( SYSTEM_SOURCES ${PLAT_POSIX_SOURCES} ${PLAT_SDL_SOURCES} ${PLAT_UNIX_SOURCES} ) set( OTHER_SYSTEM_SOURCES ${PLAT_WIN32_SOURCES} ${PLAT_OSX_SOURCES} ${PLAT_COCOA_SOURCES} ) endif() @@ -628,9 +629,13 @@ file( GLOB HEADER_FILES common/console/*.h common/utility/*.h common/engine/*.h + common/menu/*.h common/fonts/*.h common/objects/*.h common/filesystem/*.h + common/platform/posix/cocoa/*.h + common/platform/posix/sdl/*.h + common/platform/win32/*.h common/textures/*.h common/textures/hires/hqnx/*.h common/textures/hires/hqnx_asm/*.h @@ -666,7 +671,7 @@ set( NOT_COMPILED_SOURCE_FILES common/scripting/frontend/zcc-parse.lemon zcc-parse.c zcc-parse.h - platform/win32/zutil.natvis + common/platform/win32/zutil.natvis ) set( VM_JIT_SOURCES @@ -1026,6 +1031,7 @@ include_directories( common/utility common/console common/engine + common/menu common/fonts common/objects common/rendering @@ -1037,7 +1043,6 @@ include_directories( common/scripting/frontend common/scripting/backend ${CMAKE_BINARY_DIR}/libraries/gdtoa - ${SYSTEM_SOURCES_DIR} ) @@ -1076,7 +1081,7 @@ if( MSVC ) set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS ${LINKERSTUFF}) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD - COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\platform\\win32\\manifest.game.xml\" -outputresource:\"$\"\;\#1 + COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\common\\platform\\win32\\manifest.xml\" -outputresource:\"$\"\;\#1 COMMENT "Adding manifest..." ) @@ -1148,6 +1153,7 @@ source_group("Common\\Utility" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/ source_group("Common\\Engine" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/engine/.+") source_group("Common\\2D" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/2d/.+") source_group("Common\\Objects" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/objects/.+") +source_group("Common\\Menu" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/menu/.+") source_group("Common\\Fonts" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/fonts/.+") source_group("Common\\File System" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/filesystem/.+") source_group("Common\\Scripting" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/scripting/.+") @@ -1157,6 +1163,11 @@ source_group("Common\\Scripting\\Backend" REGULAR_EXPRESSION "^${CMAKE_CURRENT_S source_group("Common\\Scripting\\Core" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/scripting/core/.+") source_group("Common\\Scripting\\JIT" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/scripting/jit/.+") source_group("Common\\Scripting\\VM" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/scripting/vm/.+") +source_group("Common\\Platforms\\Cocoa Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/platform/posix/cocoa/.+") +source_group("Common\\Platforms\\OS X Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/platform/posix/osx/.+") +source_group("Common\\Platforms\\Unix Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/platform/posix/unix/.+") +source_group("Common\\Platforms\\SDL Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/platform/posix/sdl/.+") +source_group("Common\\Platforms\\Win32 Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/platform/win32/.+") source_group("Common\\Rendering" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/rendering/.+") source_group("Common\\Rendering\\OpenGL Loader" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/rendering/gl_load/.+") source_group("Common\\Textures" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/common/textures/.+") @@ -1172,9 +1183,6 @@ source_group("Common\\Third Party\\SFMT" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SO source_group("Utility\\Smackerdec" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/smackerdec/.+") source_group("Utility\\Smackerdec\\Headers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/libsmackerdec/include/.+") source_group("Utility\\Smackerdec\\Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/libsmackerdec/src/.+") -source_group("Utility\\XMP-Lite" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/libxmp-lite/.+") -source_group("Utility\\XMP-Lite Headers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/libxmp-lite/include/libxmp-lite/.+") -source_group("Utility\\XMP-Lite Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/libxmp-lite/src/.+") source_group("Utility\\Third Party" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/.+") source_group("Utility\\Third Party Headers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/include/.+") source_group("Utility\\Third Party Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/src/.+") diff --git a/source/common/engine/g_input.h b/source/common/engine/g_input.h new file mode 100644 index 000000000..1a998014b --- /dev/null +++ b/source/common/engine/g_input.h @@ -0,0 +1,9 @@ +#pragma once + +// These were in i_input.h, which differed between platforms and on Windows caused problems with its +// inclusion of system specific data, so it has been separated into this platform independent file. +void I_PutInClipboard (const char *str); +FString I_GetFromClipboard (bool use_primary_selection); +void I_SetMouseCapture(); +void I_ReleaseMouseCapture(); + diff --git a/source/common/engine/i_interface.h b/source/common/engine/i_interface.h index c862feb20..d992203d9 100644 --- a/source/common/engine/i_interface.h +++ b/source/common/engine/i_interface.h @@ -10,6 +10,7 @@ struct SystemCallbacks bool (*WantNativeMouse)(); bool (*CaptureModeInGame)(); void (*CrashInfo)(char* buffer, size_t bufflen, const char* lfstr); + void (*PlayStartupSound)(const char* name); }; diff --git a/source/platform/posix/cocoa/gl_sysfb.h b/source/common/platform/posix/cocoa/gl_sysfb.h similarity index 100% rename from source/platform/posix/cocoa/gl_sysfb.h rename to source/common/platform/posix/cocoa/gl_sysfb.h diff --git a/source/platform/posix/cocoa/i_common.h b/source/common/platform/posix/cocoa/i_common.h similarity index 100% rename from source/platform/posix/cocoa/i_common.h rename to source/common/platform/posix/cocoa/i_common.h diff --git a/source/platform/posix/cocoa/i_input.mm b/source/common/platform/posix/cocoa/i_input.mm similarity index 100% rename from source/platform/posix/cocoa/i_input.mm rename to source/common/platform/posix/cocoa/i_input.mm diff --git a/source/platform/posix/cocoa/i_joystick.cpp b/source/common/platform/posix/cocoa/i_joystick.cpp similarity index 100% rename from source/platform/posix/cocoa/i_joystick.cpp rename to source/common/platform/posix/cocoa/i_joystick.cpp diff --git a/source/platform/posix/cocoa/i_main.mm b/source/common/platform/posix/cocoa/i_main.mm similarity index 100% rename from source/platform/posix/cocoa/i_main.mm rename to source/common/platform/posix/cocoa/i_main.mm diff --git a/source/platform/posix/cocoa/i_system.mm b/source/common/platform/posix/cocoa/i_system.mm similarity index 100% rename from source/platform/posix/cocoa/i_system.mm rename to source/common/platform/posix/cocoa/i_system.mm diff --git a/source/platform/posix/cocoa/i_video.mm b/source/common/platform/posix/cocoa/i_video.mm similarity index 100% rename from source/platform/posix/cocoa/i_video.mm rename to source/common/platform/posix/cocoa/i_video.mm diff --git a/source/platform/posix/cocoa/st_console.h b/source/common/platform/posix/cocoa/st_console.h similarity index 100% rename from source/platform/posix/cocoa/st_console.h rename to source/common/platform/posix/cocoa/st_console.h diff --git a/source/platform/posix/cocoa/st_console.mm b/source/common/platform/posix/cocoa/st_console.mm similarity index 100% rename from source/platform/posix/cocoa/st_console.mm rename to source/common/platform/posix/cocoa/st_console.mm diff --git a/source/platform/posix/cocoa/st_start.mm b/source/common/platform/posix/cocoa/st_start.mm similarity index 100% rename from source/platform/posix/cocoa/st_start.mm rename to source/common/platform/posix/cocoa/st_start.mm diff --git a/source/platform/posix/dikeys.h b/source/common/platform/posix/dikeys.h similarity index 100% rename from source/platform/posix/dikeys.h rename to source/common/platform/posix/dikeys.h diff --git a/source/platform/posix/hardware.h b/source/common/platform/posix/hardware.h similarity index 100% rename from source/platform/posix/hardware.h rename to source/common/platform/posix/hardware.h diff --git a/source/platform/posix/i_system.h b/source/common/platform/posix/i_system.h similarity index 75% rename from source/platform/posix/i_system.h rename to source/common/platform/posix/i_system.h index 9c84ee28c..1988d16be 100644 --- a/source/platform/posix/i_system.h +++ b/source/common/platform/posix/i_system.h @@ -24,23 +24,13 @@ void CalculateCPUSpeed(void); // Return a seed value for the RNG. unsigned int I_MakeRNGSeed(); -void I_ShowFatalError(const char* msg); -void I_DetectOS (void); + + void I_StartFrame (void); void I_StartTic (void); -// Asynchronous interrupt functions should maintain private queues -// that are read by the synchronous functions -// to be converted into events. - -// Either returns a null ticcmd, -// or calls a loadable driver to build it. -// This ticcmd will then be modified by the gameloop -// for normal input. -ticcmd_t *I_BaseTiccmd (void); - // Print a console string void I_PrintStr (const char *str); @@ -77,7 +67,4 @@ inline int I_GetNumaNodeCount() { return 1; } inline int I_GetNumaNodeThreadCount(int numaNode) { return std::max(std::thread::hardware_concurrency(), 1); } inline void I_SetThreadNumaNode(std::thread &thread, int numaNode) { } -void I_PutInClipboard(const char* str); -FString I_GetFromClipboard (bool use_primary_selection); - #endif diff --git a/source/platform/posix/i_system_posix.cpp b/source/common/platform/posix/i_system_posix.cpp similarity index 100% rename from source/platform/posix/i_system_posix.cpp rename to source/common/platform/posix/i_system_posix.cpp diff --git a/source/platform/posix/osx/i_specialpaths.mm b/source/common/platform/posix/osx/i_specialpaths.mm similarity index 100% rename from source/platform/posix/osx/i_specialpaths.mm rename to source/common/platform/posix/osx/i_specialpaths.mm diff --git a/source/platform/posix/osx/iwadpicker_cocoa.mm b/source/common/platform/posix/osx/iwadpicker_cocoa.mm similarity index 100% rename from source/platform/posix/osx/iwadpicker_cocoa.mm rename to source/common/platform/posix/osx/iwadpicker_cocoa.mm diff --git a/source/platform/posix/readme.md b/source/common/platform/posix/readme.md similarity index 100% rename from source/platform/posix/readme.md rename to source/common/platform/posix/readme.md diff --git a/source/platform/posix/sdl/crashcatcher.c b/source/common/platform/posix/sdl/crashcatcher.c similarity index 100% rename from source/platform/posix/sdl/crashcatcher.c rename to source/common/platform/posix/sdl/crashcatcher.c diff --git a/source/platform/posix/sdl/gl_sysfb.h b/source/common/platform/posix/sdl/gl_sysfb.h similarity index 100% rename from source/platform/posix/sdl/gl_sysfb.h rename to source/common/platform/posix/sdl/gl_sysfb.h diff --git a/source/platform/posix/sdl/hardware.cpp b/source/common/platform/posix/sdl/hardware.cpp similarity index 100% rename from source/platform/posix/sdl/hardware.cpp rename to source/common/platform/posix/sdl/hardware.cpp diff --git a/source/platform/posix/sdl/i_gui.cpp b/source/common/platform/posix/sdl/i_gui.cpp similarity index 100% rename from source/platform/posix/sdl/i_gui.cpp rename to source/common/platform/posix/sdl/i_gui.cpp diff --git a/source/platform/posix/sdl/i_input.cpp b/source/common/platform/posix/sdl/i_input.cpp similarity index 100% rename from source/platform/posix/sdl/i_input.cpp rename to source/common/platform/posix/sdl/i_input.cpp diff --git a/source/platform/posix/sdl/i_joystick.cpp b/source/common/platform/posix/sdl/i_joystick.cpp similarity index 100% rename from source/platform/posix/sdl/i_joystick.cpp rename to source/common/platform/posix/sdl/i_joystick.cpp diff --git a/source/platform/posix/sdl/i_main.cpp b/source/common/platform/posix/sdl/i_main.cpp similarity index 100% rename from source/platform/posix/sdl/i_main.cpp rename to source/common/platform/posix/sdl/i_main.cpp diff --git a/source/platform/posix/sdl/i_system.cpp b/source/common/platform/posix/sdl/i_system.cpp similarity index 100% rename from source/platform/posix/sdl/i_system.cpp rename to source/common/platform/posix/sdl/i_system.cpp diff --git a/source/platform/posix/sdl/i_system.mm b/source/common/platform/posix/sdl/i_system.mm similarity index 100% rename from source/platform/posix/sdl/i_system.mm rename to source/common/platform/posix/sdl/i_system.mm diff --git a/source/platform/posix/sdl/sdlglvideo.cpp b/source/common/platform/posix/sdl/sdlglvideo.cpp similarity index 100% rename from source/platform/posix/sdl/sdlglvideo.cpp rename to source/common/platform/posix/sdl/sdlglvideo.cpp diff --git a/source/platform/posix/sdl/st_start.cpp b/source/common/platform/posix/sdl/st_start.cpp similarity index 100% rename from source/platform/posix/sdl/st_start.cpp rename to source/common/platform/posix/sdl/st_start.cpp diff --git a/source/platform/posix/unix/gtk_dialogs.cpp b/source/common/platform/posix/unix/gtk_dialogs.cpp similarity index 100% rename from source/platform/posix/unix/gtk_dialogs.cpp rename to source/common/platform/posix/unix/gtk_dialogs.cpp diff --git a/source/platform/posix/unix/i_specialpaths.cpp b/source/common/platform/posix/unix/i_specialpaths.cpp similarity index 100% rename from source/platform/posix/unix/i_specialpaths.cpp rename to source/common/platform/posix/unix/i_specialpaths.cpp diff --git a/source/platform/win32/afxres.h b/source/common/platform/win32/afxres.h similarity index 100% rename from source/platform/win32/afxres.h rename to source/common/platform/win32/afxres.h diff --git a/source/platform/win32/base_sysfb.cpp b/source/common/platform/win32/base_sysfb.cpp similarity index 100% rename from source/platform/win32/base_sysfb.cpp rename to source/common/platform/win32/base_sysfb.cpp diff --git a/source/platform/win32/base_sysfb.h b/source/common/platform/win32/base_sysfb.h similarity index 100% rename from source/platform/win32/base_sysfb.h rename to source/common/platform/win32/base_sysfb.h diff --git a/source/platform/win32/gl_sysfb.cpp b/source/common/platform/win32/gl_sysfb.cpp similarity index 100% rename from source/platform/win32/gl_sysfb.cpp rename to source/common/platform/win32/gl_sysfb.cpp diff --git a/source/platform/win32/gl_sysfb.h b/source/common/platform/win32/gl_sysfb.h similarity index 100% rename from source/platform/win32/gl_sysfb.h rename to source/common/platform/win32/gl_sysfb.h diff --git a/source/platform/win32/hardware.cpp b/source/common/platform/win32/hardware.cpp similarity index 100% rename from source/platform/win32/hardware.cpp rename to source/common/platform/win32/hardware.cpp diff --git a/source/platform/win32/hardware.h b/source/common/platform/win32/hardware.h similarity index 100% rename from source/platform/win32/hardware.h rename to source/common/platform/win32/hardware.h diff --git a/source/platform/win32/i_crash.cpp b/source/common/platform/win32/i_crash.cpp similarity index 100% rename from source/platform/win32/i_crash.cpp rename to source/common/platform/win32/i_crash.cpp diff --git a/source/platform/win32/i_dijoy.cpp b/source/common/platform/win32/i_dijoy.cpp similarity index 100% rename from source/platform/win32/i_dijoy.cpp rename to source/common/platform/win32/i_dijoy.cpp diff --git a/source/platform/win32/i_input.cpp b/source/common/platform/win32/i_input.cpp similarity index 100% rename from source/platform/win32/i_input.cpp rename to source/common/platform/win32/i_input.cpp diff --git a/source/platform/win32/i_input.h b/source/common/platform/win32/i_input.h similarity index 100% rename from source/platform/win32/i_input.h rename to source/common/platform/win32/i_input.h diff --git a/source/platform/win32/i_keyboard.cpp b/source/common/platform/win32/i_keyboard.cpp similarity index 100% rename from source/platform/win32/i_keyboard.cpp rename to source/common/platform/win32/i_keyboard.cpp diff --git a/source/platform/win32/i_main.cpp b/source/common/platform/win32/i_main.cpp similarity index 100% rename from source/platform/win32/i_main.cpp rename to source/common/platform/win32/i_main.cpp diff --git a/source/platform/win32/i_mouse.cpp b/source/common/platform/win32/i_mouse.cpp similarity index 100% rename from source/platform/win32/i_mouse.cpp rename to source/common/platform/win32/i_mouse.cpp diff --git a/source/platform/win32/i_rawps2.cpp b/source/common/platform/win32/i_rawps2.cpp similarity index 100% rename from source/platform/win32/i_rawps2.cpp rename to source/common/platform/win32/i_rawps2.cpp diff --git a/source/platform/win32/i_specialpaths.cpp b/source/common/platform/win32/i_specialpaths.cpp similarity index 100% rename from source/platform/win32/i_specialpaths.cpp rename to source/common/platform/win32/i_specialpaths.cpp diff --git a/source/platform/win32/i_system.cpp b/source/common/platform/win32/i_system.cpp similarity index 100% rename from source/platform/win32/i_system.cpp rename to source/common/platform/win32/i_system.cpp diff --git a/source/platform/win32/i_system.h b/source/common/platform/win32/i_system.h similarity index 65% rename from source/platform/win32/i_system.h rename to source/common/platform/win32/i_system.h index 88a76caf7..b0d9b702f 100644 --- a/source/platform/win32/i_system.h +++ b/source/common/platform/win32/i_system.h @@ -19,46 +19,11 @@ void CalculateCPUSpeed (void); // Return a seed value for the RNG. unsigned int I_MakeRNGSeed(); -void I_ShowFatalError(const char* msg); - -void I_PutInClipboard(const char* str); -FString I_GetFromClipboard(bool use_primary_selection); -// -// Called by D_DoomLoop, -// called before processing any tics in a frame -// (just after displaying a frame). -// Time consuming syncronous operations -// are performed here (joystick reading). -// Can call D_PostEvent. -// void I_StartFrame (void); - - -// -// Called by D_DoomLoop, -// called before processing each tic in a frame. -// Quick syncronous operations are performed here. -// Can call D_PostEvent. void I_StartTic (void); -// Asynchronous interrupt functions should maintain private queues -// that are read by the synchronous functions -// to be converted into events. - -// Either returns a null ticcmd, -// or calls a loadable driver to build it. -// This ticcmd will then be modified by the gameloop -// for normal input. -ticcmd_t *I_BaseTiccmd (void); - - -// Called by M_Responder when quit is selected. -// Clean exit, displays sell blurb. -void I_Quit (void); - - // Set the mouse cursor. The texture must be 32x32. class FGameTexture; bool I_SetCursor(FGameTexture *cursor); @@ -113,6 +78,5 @@ FString I_GetLongPathName(const FString &shortpath); int I_GetNumaNodeCount(); int I_GetNumaNodeThreadCount(int numaNode); void I_SetThreadNumaNode(std::thread &thread, int numaNode); -bool I_QueryPathKey(const wchar_t* keypath, const wchar_t* valname, FString& value); #endif diff --git a/source/platform/win32/i_xinput.cpp b/source/common/platform/win32/i_xinput.cpp similarity index 100% rename from source/platform/win32/i_xinput.cpp rename to source/common/platform/win32/i_xinput.cpp diff --git a/source/platform/win32/manifest.game.xml b/source/common/platform/win32/manifest.xml similarity index 100% rename from source/platform/win32/manifest.game.xml rename to source/common/platform/win32/manifest.xml diff --git a/source/platform/win32/resource.h b/source/common/platform/win32/resource.h similarity index 100% rename from source/platform/win32/resource.h rename to source/common/platform/win32/resource.h diff --git a/source/platform/win32/st_start.cpp b/source/common/platform/win32/st_start.cpp similarity index 100% rename from source/platform/win32/st_start.cpp rename to source/common/platform/win32/st_start.cpp diff --git a/source/platform/win32/st_start_util.cpp b/source/common/platform/win32/st_start_util.cpp similarity index 99% rename from source/platform/win32/st_start_util.cpp rename to source/common/platform/win32/st_start_util.cpp index 11a0b146c..047aa8310 100644 --- a/source/platform/win32/st_start_util.cpp +++ b/source/common/platform/win32/st_start_util.cpp @@ -396,7 +396,8 @@ static const int StrifeStartupPicSizes[4 + 2 + 1] = static void ST_Sound(const char* sndname) { - //S_Sound(CHAN_BODY, 0, sndname, 1, ATTN_NONE); + if (sysCallbacks && sysCallbacks->PlayStartupSound) + sysCallbacks->PlayStartupSound(sndname); } //========================================================================== diff --git a/source/platform/win32/wglext.h b/source/common/platform/win32/wglext.h similarity index 100% rename from source/platform/win32/wglext.h rename to source/common/platform/win32/wglext.h diff --git a/source/platform/win32/win32basevideo.cpp b/source/common/platform/win32/win32basevideo.cpp similarity index 100% rename from source/platform/win32/win32basevideo.cpp rename to source/common/platform/win32/win32basevideo.cpp diff --git a/source/platform/win32/win32basevideo.h b/source/common/platform/win32/win32basevideo.h similarity index 100% rename from source/platform/win32/win32basevideo.h rename to source/common/platform/win32/win32basevideo.h diff --git a/source/platform/win32/win32glvideo.cpp b/source/common/platform/win32/win32glvideo.cpp similarity index 100% rename from source/platform/win32/win32glvideo.cpp rename to source/common/platform/win32/win32glvideo.cpp diff --git a/source/platform/win32/win32glvideo.h b/source/common/platform/win32/win32glvideo.h similarity index 100% rename from source/platform/win32/win32glvideo.h rename to source/common/platform/win32/win32glvideo.h diff --git a/source/common/platform/win32/win32polyvideo.cpp b/source/common/platform/win32/win32polyvideo.cpp new file mode 100644 index 000000000..9a4538d29 --- /dev/null +++ b/source/common/platform/win32/win32polyvideo.cpp @@ -0,0 +1,199 @@ + +#include +#include "hardware.h" +#include "engineerrors.h" +#include + +#ifdef HAVE_SOFTPOLY + +EXTERN_CVAR(Bool, vid_vsync) + +bool ViewportLinearScale(); + +extern HWND Window; + +#include +#pragma comment(lib, "d3d9.lib") + +#ifndef D3DPRESENT_FORCEIMMEDIATE +#define D3DPRESENT_FORCEIMMEDIATE 0x00000100L // MinGW +#endif + +namespace +{ + int SrcWidth = 0; + int SrcHeight = 0; + int ClientWidth = 0; + int ClientHeight = 0; + bool CurrentVSync = false; + + IDirect3D9Ex *d3d9 = nullptr; + IDirect3DDevice9Ex *device = nullptr; + IDirect3DSurface9* surface = nullptr; +} + +void I_PolyPresentInit() +{ + Direct3DCreate9Ex(D3D_SDK_VERSION, &d3d9); + if (!d3d9) + { + I_FatalError("Direct3DCreate9 failed"); + } + + RECT rect = {}; + GetClientRect(Window, &rect); + + ClientWidth = rect.right; + ClientHeight = rect.bottom; + + D3DPRESENT_PARAMETERS pp = {}; + pp.Windowed = true; + pp.SwapEffect = D3DSWAPEFFECT_FLIPEX; + pp.BackBufferWidth = ClientWidth; + pp.BackBufferHeight = ClientHeight; + pp.BackBufferCount = 1; + pp.hDeviceWindow = Window; + pp.PresentationInterval = CurrentVSync ? D3DPRESENT_INTERVAL_DEFAULT : D3DPRESENT_INTERVAL_IMMEDIATE; + + HRESULT result = d3d9->CreateDeviceEx(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Window, D3DCREATE_HARDWARE_VERTEXPROCESSING, &pp, nullptr, &device); + if (FAILED(result)) + { + I_FatalError("IDirect3D9.CreateDevice failed"); + } +} + +uint8_t *I_PolyPresentLock(int w, int h, bool vsync, int &pitch) +{ + HRESULT result; + + RECT rect = {}; + GetClientRect(Window, &rect); + if (rect.right != ClientWidth || rect.bottom != ClientHeight || CurrentVSync != vsync) + { + if (surface) + { + surface->Release(); + surface = nullptr; + } + + CurrentVSync = vsync; + ClientWidth = rect.right; + ClientHeight = rect.bottom; + + D3DPRESENT_PARAMETERS pp = {}; + pp.Windowed = true; + pp.SwapEffect = D3DSWAPEFFECT_FLIPEX; + pp.BackBufferWidth = ClientWidth; + pp.BackBufferHeight = ClientHeight; + pp.BackBufferCount = 1; + pp.hDeviceWindow = Window; + pp.PresentationInterval = CurrentVSync ? D3DPRESENT_INTERVAL_DEFAULT : D3DPRESENT_INTERVAL_IMMEDIATE; + device->Reset(&pp); + } + + if (SrcWidth != w || SrcHeight != h || !surface) + { + if (surface) + { + surface->Release(); + surface = nullptr; + } + + SrcWidth = w; + SrcHeight = h; + result = device->CreateOffscreenPlainSurface(SrcWidth, SrcHeight, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &surface, 0); + if (FAILED(result)) + { + I_FatalError("IDirect3DDevice9.CreateOffscreenPlainSurface failed"); + } + } + + D3DLOCKED_RECT lockrect = {}; + result = surface->LockRect(&lockrect, nullptr, D3DLOCK_DISCARD); + if (FAILED(result)) + { + pitch = 0; + return nullptr; + } + + pitch = lockrect.Pitch; + return (uint8_t*)lockrect.pBits; +} + +void I_PolyPresentUnlock(int x, int y, int width, int height) +{ + surface->UnlockRect(); + + IDirect3DSurface9 *backbuffer = nullptr; + HRESULT result = device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + if (FAILED(result)) + return; + + result = device->BeginScene(); + if (SUCCEEDED(result)) + { + int count = 0; + D3DRECT clearrects[4]; + if (y > 0) + { + clearrects[count].x1 = 0; + clearrects[count].y1 = 0; + clearrects[count].x2 = ClientWidth; + clearrects[count].y2 = y; + count++; + } + if (y + height < ClientHeight) + { + clearrects[count].x1 = 0; + clearrects[count].y1 = y + height; + clearrects[count].x2 = ClientWidth; + clearrects[count].y2 = ClientHeight; + count++; + } + if (x > 0) + { + clearrects[count].x1 = 0; + clearrects[count].y1 = y; + clearrects[count].x2 = x; + clearrects[count].y2 = y + height; + count++; + } + if (x + width < ClientWidth) + { + clearrects[count].x1 = x + width; + clearrects[count].y1 = y; + clearrects[count].x2 = ClientWidth; + clearrects[count].y2 = y + height; + count++; + } + if (count > 0) + device->Clear(count, clearrects, D3DCLEAR_TARGET, 0, 0.0f, 0); + + RECT srcrect = {}, dstrect = {}; + srcrect.right = SrcWidth; + srcrect.bottom = SrcHeight; + dstrect.left = x; + dstrect.top = y; + dstrect.right = x + width; + dstrect.bottom = y + height; + if (ViewportLinearScale()) + device->StretchRect(surface, &srcrect, backbuffer, &dstrect, D3DTEXF_LINEAR); + else + device->StretchRect(surface, &srcrect, backbuffer, &dstrect, D3DTEXF_POINT); + + result = device->EndScene(); + if (SUCCEEDED(result)) + device->PresentEx(nullptr, nullptr, 0, nullptr, CurrentVSync ? 0 : D3DPRESENT_FORCEIMMEDIATE); + } + + backbuffer->Release(); +} + +void I_PolyPresentDeinit() +{ + if (surface) surface->Release(); + if (device) device->Release(); + if (d3d9) d3d9->Release(); +} + +#endif \ No newline at end of file diff --git a/source/common/platform/win32/win32polyvideo.h b/source/common/platform/win32/win32polyvideo.h new file mode 100644 index 000000000..6d1648d0c --- /dev/null +++ b/source/common/platform/win32/win32polyvideo.h @@ -0,0 +1,21 @@ +#pragma once + +#include "win32basevideo.h" +#include "c_cvars.h" +#include "rendering/polyrenderer/backend/poly_framebuffer.h" + +EXTERN_CVAR(Bool, vid_fullscreen) + +class Win32PolyVideo : public Win32BaseVideo +{ +public: + void Shutdown() override + { + } + + DFrameBuffer *CreateFrameBuffer() override + { + auto fb = new PolyFrameBuffer(m_hMonitor, vid_fullscreen); + return fb; + } +}; diff --git a/source/platform/win32/win32vulkanvideo.cpp b/source/common/platform/win32/win32vulkanvideo.cpp similarity index 99% rename from source/platform/win32/win32vulkanvideo.cpp rename to source/common/platform/win32/win32vulkanvideo.cpp index bab8dc25e..d2c2e7b40 100644 --- a/source/platform/win32/win32vulkanvideo.cpp +++ b/source/common/platform/win32/win32vulkanvideo.cpp @@ -6,10 +6,9 @@ #define VK_USE_PLATFORM_WIN32_KHR #endif - -#if 0 #include "volk/volk.h" + extern HWND Window; void I_GetVulkanDrawableSize(int *width, int *height) @@ -74,4 +73,3 @@ bool I_CreateVulkanSurface(VkInstance instance, VkSurfaceKHR *surface) const VkResult result = vkCreateWin32SurfaceKHR(instance, &windowCreateInfo, nullptr, surface); return result == VK_SUCCESS; } -#endif \ No newline at end of file diff --git a/source/platform/win32/win32vulkanvideo.h b/source/common/platform/win32/win32vulkanvideo.h similarity index 85% rename from source/platform/win32/win32vulkanvideo.h rename to source/common/platform/win32/win32vulkanvideo.h index 05e5c2d55..c34c41d72 100644 --- a/source/platform/win32/win32vulkanvideo.h +++ b/source/common/platform/win32/win32vulkanvideo.h @@ -5,7 +5,7 @@ #include "rendering/vulkan/system/vk_framebuffer.h" -EXTERN_CVAR(Bool, fullscreen) +EXTERN_CVAR(Bool, vid_fullscreen) //========================================================================== // @@ -35,7 +35,7 @@ public: DFrameBuffer *CreateFrameBuffer() override { - auto fb = new VulkanFrameBuffer(m_hMonitor, fullscreen, device); + auto fb = new VulkanFrameBuffer(m_hMonitor, vid_fullscreen, device); return fb; } diff --git a/source/platform/win32/winres.h b/source/common/platform/win32/winres.h similarity index 100% rename from source/platform/win32/winres.h rename to source/common/platform/win32/winres.h diff --git a/source/platform/win32/zutil.natvis b/source/common/platform/win32/zutil.natvis similarity index 100% rename from source/platform/win32/zutil.natvis rename to source/common/platform/win32/zutil.natvis diff --git a/source/core/console/c_console.cpp b/source/core/console/c_console.cpp index 71c5452ef..b37ffda99 100644 --- a/source/core/console/c_console.cpp +++ b/source/core/console/c_console.cpp @@ -62,6 +62,7 @@ #include "gamecontrol.h" #include "v_video.h" #include "v_draw.h" +#include "g_input.h" #define LEFTMARGIN 8 #define RIGHTMARGIN 8 diff --git a/source/core/searchpaths.cpp b/source/core/searchpaths.cpp index d95dba02e..31e0c341f 100644 --- a/source/core/searchpaths.cpp +++ b/source/core/searchpaths.cpp @@ -139,6 +139,7 @@ static const RegistryPathInfo paths[] = { { nullptr} }; +bool I_QueryPathKey(const wchar_t* keypath, const wchar_t* valname, FString& value); void G_AddExternalSearchPaths(TArray &searchpaths) { diff --git a/source/platform/win32/gameres.rc b/source/platform/win32/gameres.rc index a4e7f1b00..2077254ee 100644 --- a/source/platform/win32/gameres.rc +++ b/source/platform/win32/gameres.rc @@ -114,4 +114,4 @@ BEGIN END END -1 24 "manifest.game.xml" +1 24 "..\\..\\common\\platform\\win32\\manifest.xml"