mirror of
				https://github.com/hedge-dev/UnleashedRecomp.git
				synced 2025-10-30 07:11:05 +00:00 
			
		
		
		
	Compare commits
	
		
			9 commits
		
	
	
		
			1c0900a10a
			...
			2afbf3bba8
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 2afbf3bba8 | ||
|   | 3c1badf183 | ||
|   | f590788379 | ||
|   | ceecdf8748 | ||
|   | b168872d8a | ||
|   | 27526bb41d | ||
|   | a07b6c05db | ||
|   | 382bf516f4 | ||
|   | 01b3fff8f1 | 
					 9 changed files with 40 additions and 26 deletions
				
			
		|  | @ -23,10 +23,6 @@ if (APPLE) | ||||||
|     enable_language(OBJC OBJCXX) |     enable_language(OBJC OBJCXX) | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| if (CMAKE_SYSTEM_NAME MATCHES "Linux") |  | ||||||
|     set(SDL_VULKAN_ENABLED ON CACHE BOOL "") |  | ||||||
| endif() |  | ||||||
| 
 |  | ||||||
| if (CMAKE_OSX_ARCHITECTURES) | if (CMAKE_OSX_ARCHITECTURES) | ||||||
|     set(UNLEASHED_RECOMP_ARCHITECTURE ${CMAKE_OSX_ARCHITECTURES}) |     set(UNLEASHED_RECOMP_ARCHITECTURE ${CMAKE_OSX_ARCHITECTURES}) | ||||||
| elseif(CMAKE_SYSTEM_PROCESSOR) | elseif(CMAKE_SYSTEM_PROCESSOR) | ||||||
|  |  | ||||||
|  | @ -352,23 +352,13 @@ if (UNLEASHED_RECOMP_FLATPAK) | ||||||
|     ) |     ) | ||||||
| endif() | endif() | ||||||
| 
 | 
 | ||||||
| if (UNLEASHED_RECOMP_D3D12) |  | ||||||
|     find_package(directx-headers CONFIG REQUIRED) |  | ||||||
|     find_package(directx12-agility CONFIG REQUIRED) |  | ||||||
|     target_compile_definitions(UnleashedRecomp PRIVATE  |  | ||||||
|         UNLEASHED_RECOMP_D3D12 |  | ||||||
|         D3D12MA_USING_DIRECTX_HEADERS |  | ||||||
|         D3D12MA_OPTIONS16_SUPPORTED |  | ||||||
|     ) |  | ||||||
| endif() |  | ||||||
| 
 |  | ||||||
| if (SDL_VULKAN_ENABLED) |  | ||||||
|     target_compile_definitions(UnleashedRecomp PRIVATE SDL_VULKAN_ENABLED) |  | ||||||
| endif() |  | ||||||
| 
 |  | ||||||
| find_package(CURL REQUIRED) | find_package(CURL REQUIRED) | ||||||
| 
 | 
 | ||||||
| if (UNLEASHED_RECOMP_D3D12) | if (UNLEASHED_RECOMP_D3D12) | ||||||
|  |     find_package(directx-headers CONFIG REQUIRED) | ||||||
|  |     find_package(directx12-agility CONFIG REQUIRED) | ||||||
|  |     target_compile_definitions(UnleashedRecomp PRIVATE UNLEASHED_RECOMP_D3D12) | ||||||
|  | 
 | ||||||
|     file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12) |     file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12) | ||||||
|     add_custom_command(TARGET UnleashedRecomp POST_BUILD |     add_custom_command(TARGET UnleashedRecomp POST_BUILD | ||||||
|         COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Core,IMPORTED_LOCATION_RELEASE> $<TARGET_FILE_DIR:UnleashedRecomp>/D3D12 |         COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Core,IMPORTED_LOCATION_RELEASE> $<TARGET_FILE_DIR:UnleashedRecomp>/D3D12 | ||||||
|  | @ -379,9 +369,6 @@ if (UNLEASHED_RECOMP_D3D12) | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|     target_link_libraries(UnleashedRecomp PRIVATE |     target_link_libraries(UnleashedRecomp PRIVATE | ||||||
|         Microsoft::DirectX-Headers  |  | ||||||
|         Microsoft::DirectX-Guids  |  | ||||||
|         Microsoft::DirectX12-Agility |  | ||||||
|         Microsoft::DirectXShaderCompiler |         Microsoft::DirectXShaderCompiler | ||||||
|         Microsoft::DXIL |         Microsoft::DXIL | ||||||
|         dxgi |         dxgi | ||||||
|  |  | ||||||
|  | @ -3053,6 +3053,24 @@ void Video::ComputeViewportDimensions() | ||||||
|         break; |         break; | ||||||
|     } |     } | ||||||
|      |      | ||||||
|  |     case EAspectRatio::Custom: | ||||||
|  |     { | ||||||
|  |         float customAspectRatio = Config::CustomAspectRatio; | ||||||
|  | 
 | ||||||
|  |         if (aspectRatio > customAspectRatio) | ||||||
|  |         { | ||||||
|  |             s_viewportWidth = height * customAspectRatio; | ||||||
|  |             s_viewportHeight = height; | ||||||
|  |         } | ||||||
|  |         else | ||||||
|  |         { | ||||||
|  |             s_viewportWidth = width; | ||||||
|  |             s_viewportHeight = width * (1. / customAspectRatio); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         break; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     default: |     default: | ||||||
|         s_viewportWidth = width; |         s_viewportWidth = width; | ||||||
|         s_viewportHeight = height; |         s_viewportHeight = height; | ||||||
|  |  | ||||||
|  | @ -546,7 +546,8 @@ CONFIG_DEFINE_ENUM_LOCALE(EAspectRatio) | ||||||
|             { EAspectRatio::Auto, { "AUTO", "Auto: the aspect ratio will dynamically adjust to the window size." } }, |             { EAspectRatio::Auto, { "AUTO", "Auto: the aspect ratio will dynamically adjust to the window size." } }, | ||||||
|             { EAspectRatio::Wide, { "16:9", "16:9: locks the game to a widescreen aspect ratio." } }, |             { EAspectRatio::Wide, { "16:9", "16:9: locks the game to a widescreen aspect ratio." } }, | ||||||
|             { EAspectRatio::Narrow, { "4:3", "4:3: locks the game to a narrow aspect ratio." } }, |             { EAspectRatio::Narrow, { "4:3", "4:3: locks the game to a narrow aspect ratio." } }, | ||||||
|             { EAspectRatio::OriginalNarrow, { "ORIGINAL 4:3", "Original 4:3: locks the game to a narrow aspect ratio and retains parity with the game's original implementation." } } |             { EAspectRatio::OriginalNarrow, { "ORIGINAL 4:3", "Original 4:3: locks the game to a narrow aspect ratio and retains parity with the game's original implementation." } }, | ||||||
|  |             { EAspectRatio::Custom, { "Custom", "Custom:\nThe aspect ratio is set by using the CustomAspectRatio value in the config.toml file." } } | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|  | @ -564,7 +565,8 @@ CONFIG_DEFINE_ENUM_LOCALE(EAspectRatio) | ||||||
|             { EAspectRatio::Auto, { "AUTO", "Auto: Das Seitenverhältnis passt sich automatisch der Fenstergröße an." } }, |             { EAspectRatio::Auto, { "AUTO", "Auto: Das Seitenverhältnis passt sich automatisch der Fenstergröße an." } }, | ||||||
|             { EAspectRatio::Wide, { "16:9", "16:9: Stellt das Spiel in einem Breitbildschirm-Format dar." } }, |             { EAspectRatio::Wide, { "16:9", "16:9: Stellt das Spiel in einem Breitbildschirm-Format dar." } }, | ||||||
|             { EAspectRatio::Narrow, { "4:3", "4:3: Stellt das Spiel in einem Mittel-Format dar." } }, |             { EAspectRatio::Narrow, { "4:3", "4:3: Stellt das Spiel in einem Mittel-Format dar." } }, | ||||||
|             { EAspectRatio::OriginalNarrow, { "ORIGINAL 4:3", "Original 4:3: Stellt das Spiel in einem Mittel-Format dar, was der ursprünglichen Implementation originalgetreut bleibt." } } |             { EAspectRatio::OriginalNarrow, { "ORIGINAL 4:3", "Original 4:3: Stellt das Spiel in einem Mittel-Format dar, was der ursprünglichen Implementation originalgetreut bleibt." } }, | ||||||
|  |             { EAspectRatio::Custom, { "Benutzerdefiniert", "Benutzerdefiniert:\nDas Seitenverhältnis entspricht dem Wert CustomAspectRatio in der Datei config.toml." } } | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|  |  | ||||||
|  | @ -322,6 +322,7 @@ CONFIG_DEFINE_ENUM_TEMPLATE(EAspectRatio) | ||||||
|     { "16:9", EAspectRatio::Wide }, |     { "16:9", EAspectRatio::Wide }, | ||||||
|     { "4:3",  EAspectRatio::Narrow }, |     { "4:3",  EAspectRatio::Narrow }, | ||||||
|     { "Original 4:3",  EAspectRatio::OriginalNarrow }, |     { "Original 4:3",  EAspectRatio::OriginalNarrow }, | ||||||
|  |     { "Custom",  EAspectRatio::Custom }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| CONFIG_DEFINE_ENUM_TEMPLATE(ETripleBuffering) | CONFIG_DEFINE_ENUM_TEMPLATE(ETripleBuffering) | ||||||
|  |  | ||||||
|  | @ -85,7 +85,8 @@ enum class EAspectRatio : uint32_t | ||||||
|     Auto, |     Auto, | ||||||
|     Wide, |     Wide, | ||||||
|     Narrow, |     Narrow, | ||||||
|     OriginalNarrow |     OriginalNarrow, | ||||||
|  |     Custom | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| enum class ETripleBuffering : uint32_t | enum class ETripleBuffering : uint32_t | ||||||
|  |  | ||||||
|  | @ -56,6 +56,7 @@ CONFIG_DEFINE("Video", int32_t, WindowHeight, 720); | ||||||
| CONFIG_DEFINE_ENUM("Video", EWindowState, WindowState, EWindowState::Normal); | CONFIG_DEFINE_ENUM("Video", EWindowState, WindowState, EWindowState::Normal); | ||||||
| CONFIG_DEFINE_LOCALISED("Video", int32_t, Monitor, 0); | CONFIG_DEFINE_LOCALISED("Video", int32_t, Monitor, 0); | ||||||
| CONFIG_DEFINE_ENUM_LOCALISED("Video", EAspectRatio, AspectRatio, EAspectRatio::Auto); | CONFIG_DEFINE_ENUM_LOCALISED("Video", EAspectRatio, AspectRatio, EAspectRatio::Auto); | ||||||
|  | CONFIG_DEFINE("Video", float, CustomAspectRatio, (16.0f / 9.0f)); | ||||||
| CONFIG_DEFINE_LOCALISED("Video", float, ResolutionScale, 1.0f); | CONFIG_DEFINE_LOCALISED("Video", float, ResolutionScale, 1.0f); | ||||||
| CONFIG_DEFINE_LOCALISED("Video", bool, Fullscreen, true); | CONFIG_DEFINE_LOCALISED("Video", bool, Fullscreen, true); | ||||||
| CONFIG_DEFINE_LOCALISED("Video", bool, VSync, true); | CONFIG_DEFINE_LOCALISED("Video", bool, VSync, true); | ||||||
|  |  | ||||||
							
								
								
									
										8
									
								
								thirdparty/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								thirdparty/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -15,6 +15,14 @@ set(SDL2MIXER_OPUS OFF) | ||||||
| set(SDL2MIXER_VORBIS "VORBISFILE") | set(SDL2MIXER_VORBIS "VORBISFILE") | ||||||
| set(SDL2MIXER_WAVPACK OFF) | set(SDL2MIXER_WAVPACK OFF) | ||||||
| 
 | 
 | ||||||
|  | if (CMAKE_SYSTEM_NAME MATCHES "Linux") | ||||||
|  |     set(SDL_VULKAN_ENABLED ON CACHE BOOL "") | ||||||
|  | endif() | ||||||
|  | 
 | ||||||
|  | if (WIN32) | ||||||
|  |     set(D3D12_AGILITY_SDK_ENABLED ON CACHE BOOL "") | ||||||
|  | endif() | ||||||
|  | 
 | ||||||
| add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/msdf-atlas-gen") | add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/msdf-atlas-gen") | ||||||
| add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/nativefiledialog-extended") | add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/nativefiledialog-extended") | ||||||
| add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/o1heap") | add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/o1heap") | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								thirdparty/plume
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								thirdparty/plume
									
										
									
									
										vendored
									
									
								
							|  | @ -1 +1 @@ | ||||||
| Subproject commit fffeb35f836d8c945697ec82b735e77db401e2de | Subproject commit 11926860e878e68626ea99ec88562ce2b8badc4f | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue