diff --git a/GUI/DeusEx/Classes/NewGamePlusCreditsWindow.uc b/GUI/DeusEx/Classes/NewGamePlusCreditsWindow.uc index 174a5d82e..69b7df8a7 100644 --- a/GUI/DeusEx/Classes/NewGamePlusCreditsWindow.uc +++ b/GUI/DeusEx/Classes/NewGamePlusCreditsWindow.uc @@ -63,6 +63,7 @@ function AddDXRCreditsGeneral() PrintText("WCCC for the OpenAugTree"); PrintText("Joe Wintergreen for the Lipsync fix"); PrintText("Kentie for DeusExe Launcher and D3D10"); + PrintText("Deus_nsf for the tweaked D3D10 Renderer"); PrintText("Han for Launchbox"); PrintText("Chris Dohnal for D3D9 and OpenGL2 Renderers"); PrintText("doitsujin for DXVK"); diff --git a/installer/Configs/DXRandoDefault.ini b/installer/Configs/DXRandoDefault.ini index 4408dc26e..08bdbe6b0 100644 --- a/installer/Configs/DXRandoDefault.ini +++ b/installer/Configs/DXRandoDefault.ini @@ -354,7 +354,7 @@ LODBias=0 BumpMapping=False ClassicLighting=True AlphaToCoverage=False -AutoFOV=True +AutoFOV=False FPSLimit=0 simulateMultipassTexturing=True unlimitedViewDistance=False diff --git a/installer/Configs/DeusExDefault.ini b/installer/Configs/DeusExDefault.ini index 784afe3b7..29f95411a 100644 --- a/installer/Configs/DeusExDefault.ini +++ b/installer/Configs/DeusExDefault.ini @@ -352,7 +352,7 @@ LODBias=0 BumpMapping=False ClassicLighting=True AlphaToCoverage=False -AutoFOV=True +AutoFOV=False FPSLimit=0 simulateMultipassTexturing=True unlimitedViewDistance=False diff --git a/installer/Configs/dxvk.conf b/installer/Configs/dxvk.conf new file mode 100644 index 000000000..2246a8fda --- /dev/null +++ b/installer/Configs/dxvk.conf @@ -0,0 +1,606 @@ +# Expose the HDR10 ColorSpace (DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020) +# to the application by default. +# This shows to the game that the global Windows 'HDR Mode' is enabled. +# Many (broken) games will need this to be set to consider exposing HDR output +# as determine it based on the DXGIOutput's current ColorSpace instead of +# using CheckColorSpaceSupport. +# This defaults to the value of the DXVK_HDR environment variable. +# +# Supported values: True, False + +# dxgi.enableHDR = True + +# Create the VkSurface on the first call to IDXGISwapChain::Present, +# rather than when creating the swap chain. Some games that start +# rendering with a different graphics API may require this option, +# or otherwise the window may stay black. +# +# Supported values: True, False + +# dxgi.deferSurfaceCreation = False +# d3d9.deferSurfaceCreation = False + + +# Enforce a stricter maximum frame latency. Overrides the application +# setting specified by calling IDXGIDevice::SetMaximumFrameLatency. +# Setting this to 0 will have no effect. +# +# Supported values : 0 - 16 + +dxgi.maxFrameLatency = 1 +# d3d9.maxFrameLatency = 0 + + +# Enables frame rate limiter. The main purpose of this is to work around +# bugs in games that have physics or other simulation tied to their frame +# rate, but do not provide their own limiter. +# +# Supported values : Any non-negative integer + +# dxgi.maxFrameRate = 60 +# d3d9.maxFrameRate = 120 + + +# Override PCI vendor and device IDs reported to the application. Can +# cause the app to adjust behaviour depending on the selected values. +# +# Supported values: Any four-digit hex number. + +# dxgi.customDeviceId = 0000 +# dxgi.customVendorId = 0000 + +# d3d9.customDeviceId = 0000 +# d3d9.customVendorId = 0000 + + +# Override the reported device description +# +# Supported values: Any string. + +# dxgi.customDeviceDesc = "" +# d3d9.customDeviceDesc = "" + + +# Report Nvidia GPUs as AMD GPUs by default. This is enabled by default +# to work around issues with NVAPI, but may cause issues in some games. +# +# Supported values: True, False + +# dxgi.nvapiHack = True + + + +# Override maximum amount of device memory and shared system memory +# reported to the application. This may fix texture streaming issues +# in games that do not support cards with large amounts of VRAM. +# +# Supported values: Any number in Megabytes. + +# dxgi.maxDeviceMemory = 0 +# dxgi.maxSharedMemory = 0 + + +# Some games think we are on Intel given a lack of NVAPI or +# AGS/atiadlxx support. Report our device memory as shared memory, +# and some small amount for a "carveout". + +# Supported values: True, False + +# dxgi.emulateUMA = False + + +# Override back buffer count for the Vulkan swap chain. +# Setting this to 0 or less will have no effect. +# +# Supported values: Any number greater than or equal to 2. + +# dxgi.numBackBuffers = 0 +# d3d9.numBackBuffers = 0 + + +# Overrides synchronization interval (Vsync) for presentation. +# Setting this to 0 disables vertical synchronization entirely. +# A positive value 'n' will enable Vsync and repeat the same +# image n times, and a negative value will have no effect. +# +# Supported values: Any non-negative number + +# dxgi.syncInterval = 1 +# d3d9.presentInterval = 1 + + +# True enables the mailbox present mode in case regular Vsync is disabled. +# This should avoid tearing, but may be unsupported on some systems +# or require setting dxgi.numBackBuffers to a higher value in order +# to work properly. +# +# False enables the relaxed fifo present mode in case regular Vsync is enabled. +# This should result in tearing but reduce stutter if FPS are too low, +# but may be unsupported on some systems. +# +# Please do not report issues with this option. +# +# Supported values: Auto, True, False + +# dxgi.tearFree = Auto +# d3d9.tearFree = Auto + + +# Assume single-use mode for command lists created on deferred contexts. +# This may need to be disabled for some applications to avoid rendering +# issues, which may come at a significant performance cost. +# +# Supported values: True, False + +# d3d11.dcSingleUseMode = True + + +# Override the maximum feature level that a D3D11 device can be created +# with. Setting this to a higher value may allow some applications to run +# that would otherwise fail to create a D3D11 device. +# +# Supported values: 9_1, 9_2, 9_3, 10_0, 10_1, 11_0, 11_1, 12_0, 12_1 + +# d3d11.maxFeatureLevel = 12_1 + + +# Overrides the maximum allowed tessellation factor. This can be used to +# improve performance in titles which overuse tessellation. +# +# Supported values: Any number between 8 and 64 + +# d3d11.maxTessFactor = 0 + + +# Enables relaxed pipeline barriers around UAV writes. +# +# This may improve performance in some games, but may also introduce +# rendering issues. Please don't report bugs with the option enabled. +# +# Supported values: True, False + +# d3d11.relaxedBarriers = False + + +# Ignores barriers around UAV writes from fragment shaders. +# +# This may improve performance in some games, but may also introduce +# rendering issues. Please don't report bugs with the option enabled. +# +# Supported values: True, False + +# d3d11.ignoreGraphicsBarriers = False + + +# Overrides anisotropic filtering for all samplers. Set this to a positive +# value to enable AF for all samplers in the game, or to 0 in order to +# disable AF entirely. Negative values will have no effect. +# +# Supported values: Any number between 0 and 16 + +d3d11.samplerAnisotropy = 16 +# d3d9.samplerAnisotropy = 16 + + +# Changes the mipmap LOD bias for all samplers. The given number will be +# added to the LOD bias provided by the application, rather than replacing +# it entirely. Positive values will reduce texture detail, while negative +# values may increase sharpness at the cost of shimmer. +# +# Supported values: Any number between -2.0 and 1.0 + +# d3d11.samplerLodBias = -1.5 + + +# Declares vertex positions as invariant in order to solve +# potential Z-fighting issues at a small performance cost. +# +# Supported values: True, False + +# d3d11.invariantPosition = True +# d3d9.invariantPosition = True + + +# Forces per-sample rate shading when MSAA is enabled, rather than per-pixel +# shading. May improve visual clarity at a significant performance cost, but +# may also introduce visual issues in some games. +# +# Supported values: True, False + +d3d11.forceSampleRateShading = True +# d3d9.forceSampleRateShading = True + + +# Forces the sample count of all textures to 1, and performs +# the needed fixups in resolve operations and shaders. +# +# Supported values: True, False + +# d3d11.disableMsaa = False + + +# Clears workgroup memory in compute shaders to zero. Some games don't do +# this and rely on undefined behaviour. Enabling may reduce performance. +# +# Supported values: True, False + +# d3d11.zeroWorkgroupMemory = False + + +# Resource size limit for implicit discards, in kilobytes. For small staging +# resources mapped with MAP_WRITE, DXVK will sometimes allocate new backing +# storage in order to avoid GPU synchronization, so setting this too high +# may cause memory issues, setting it to -1 disables the feature. + +# d3d11.maxImplicitDiscardSize = 256 + + +# Resource size limit for buffer-mapped dynamic images, in kilobytes. +# A higher threshold may reduce memory usage and PCI-E bandwidth in +# some games, but may also increase GPU synchronizations. Setting it +# to -1 disables the feature. + +# d3d11.maxDynamicImageBufferSize = -1 + + +# Allocates dynamic resources with the given set of bind flags in +# cached system memory rather than uncached memory or host-visible +# VRAM, in order to allow fast readback from the CPU. This is only +# useful for buggy applications, and may reduce GPU-bound performance. +# +# Supported values: Any combination of the following: +# - v: Vertex buffers +# - i: Index buffers +# - c: Constant buffers +# - r: Shader resources +# - a: All dynamic resources + +# d3d11.cachedDynamicResources = "" + + +# Force-enables the D3D11 context lock via the ID3D10Multithread +# interface. This may be useful to debug race conditions. +# +# Supported values: True, False + +# d3d11.enableContextLock = False + + +# Sets number of pipeline compiler threads. +# +# If the graphics pipeline library feature is enabled, the given +# number of threads will be used for shader compilation. Some of +# these threads will be reserved for high-priority work. +# +# Supported values: +# - 0 to use all available CPU cores +# - any positive number to enforce the thread count + +# dxvk.numCompilerThreads = 0 + + +# Toggles raw SSBO usage. +# +# Uses storage buffers to implement raw and structured buffer +# views. Enabled by default on hardware which has a storage +# buffer offset alignment requirement of 4 Bytes (e.g. AMD). +# Enabling this may improve performance, but is not safe on +# hardware with higher alignment requirements. +# +# Supported values: +# - Auto: Don't change the default +# - True, False: Always enable / disable + +# dxvk.useRawSsbo = Auto + + +# Controls graphics pipeline library behaviour +# +# Can be used to change VK_EXT_graphics_pipeline_library usage for +# debugging purpose. Doing so will likely result in increased stutter +# or degraded performance. +# +# Supported values: +# - Auto: Enable if supported, and compile optimized pipelines in the background +# - True: Enable if supported, but do not compile optimized pipelines +# - False: Always disable the feature + +# dxvk.enableGraphicsPipelineLibrary = Auto + + +# Controls pipeline lifetime tracking +# +# If enabled, pipeline libraries will be freed aggressively in order +# save memory and address space. Has no effect if graphics pipeline +# libraries are not supported or disabled. +# +# Supported values: +# - Auto: Enable tracking for 32-bit applications only +# - True: Always enable tracking +# - False: Always disable tracking + +# dxvk.trackPipelineLifetime = Auto + + +# Sets enabled HUD elements +# +# Behaves like the DXVK_HUD environment variable if the +# environment variable is not set, otherwise it will be +# ignored. The syntax is identical. + +# dxvk.hud = + + +# Reported shader model +# +# The shader model to state that we support in the device +# capabilities that the applicatation queries. +# +# Supported values: +# - 1: Shader Model 1 +# - 2: Shader Model 2 +# - 3: Shader Model 3 + +# d3d9.shaderModel = 3 + + +# DPI Awareness +# +# Decides whether we should call SetProcessDPIAware on device +# creation. Helps avoid upscaling blur in modern Windows on +# Hi-DPI screens/devices. +# +# Supported values: +# - True, False: Always enable / disable + +# d3d9.dpiAware = True + + +# Strict Constant Copies +# +# Decides whether we should always copy defined constants to +# the UBO when relative addressing is used, or only when the +# relative addressing starts a defined constant. +# +# Supported values: +# - True, False: Always enable / disable + +# d3d9.strictConstantCopies = False + + +# Strict Pow +# +# Decides whether we have an opSelect for handling pow(0,0) = 0 +# otherwise it becomes undefined. +# +# Supported values: +# - True, False: Always enable / disable + +# d3d9.strictPow = True + + +# Lenient Clear +# +# Decides whether or not we fastpath clear anyway if we are close enough to +# clearing a full render target. +# +# Supported values: +# - True, False: Always enable / disable + +# d3d9.lenientClear = False + + +# Max available memory +# +# Changes the max initial value used in tracking and GetAvailableTextureMem +# Value in Megabytes +# +# Supported values: +# - Max Available Memory: Any int32_t +# - Memory Tracking Testing: True, False + +# d3d9.maxAvailableMemory = 4096 +# d3d9.memoryTrackTest = False + + +# Force enable/disable floating point quirk emulation +# +# Force toggle anything * 0 emulation +# Setting it to True will use a faster but less accurate approach that works for most games. +# Supported values: +# - True: Use a faster but less accurate approach. Good enough for most games +# - False: Disable float emulation completely +# - Strict: Use a slower but more correct approach. Necessary for some games +# - Auto: DXVK will pick automatically + +# d3d9.floatEmulation = Auto + + +# Enable dialog box mode +# +# Changes the default state of dialog box mode. +# *Disables* exclusive fullscreen when enabled. +# +# Supported values: +# - True, False: Always enable / disable + +# d3d9.enableDialogMode = False + +# Overrides the application's MSAA level on the swapchain +# +# Supported values: -1 (application) and 0 to 16 (user override) + +# d3d9.forceSwapchainMSAA = 2 + + +# Long Mad +# +# Should we make our Mads a FFma or do it the long way with an FMul and an FAdd? +# This solves some rendering bugs in games that have z-pass shaders which +# don't match entirely to the regular vertex shader in this way. +# +# Supported values: +# - True/False + +# d3d9.longMad = False + +# Device Local Constant Buffers +# +# Enables using device local, host accessible memory for constant buffers in D3D9. +# This tends to actually be slower for some reason on AMD, +# and the exact same performance on NVIDIA. +# +# Supported values: +# - True/False + +# d3d9.deviceLocalConstantBuffers = False + +# No Explicit Front Buffer +# +# Disables the front buffer +# +# Supported values: +# - True/False + +# d3d9.noExplicitFrontBuffer = False + +# Support DF formats +# +# Support the vendor extension DF floating point depth formats +# +# Supported values: +# - True/False + +# d3d9.supportDFFormats = True + +# Use D32f for D24 +# +# Useful for reproducing AMD issues on other hw. +# +# Supported values: +# - True/False + +# d3d9.useD32forD24 = False + +# Support X4R4G4B4 +# +# Support the X4R4G4B4 format. +# The Sims 2 is a horrible game made by complete morons. +# +# Supported values: +# - True/False + +# d3d9.supportX4R4G4B4 = True + +# Support D32 +# +# Support the D32 format. +# +# Supported values: +# - True/False + +# d3d9.supportD32 = True + +# Disable A8 as a Render Target +# +# Disable support for A8 format render targets +# Once again, The Sims 2 is a horrible game made by complete morons. +# +# Supported values: +# - True/False + +# d3d9.disableA8RT = False + +# Support for VCache Query +# +# Support for the vcache query +# Not very important as a user config. +# Used internally. +# +# Supported values: +# - True/False + +# Defaults to True if vendorId == 0x10de +# d3d9.supportVCache = True + +# Force Sampler Type Spec Constants +# +# Useful if games use the wrong image and sampler +# type combo like Halo: CE or Spellforce. +# Can fix rendering in older, broken games in some instances. +# +# Supported values: +# - True/False + +# d3d9.forceSamplerTypeSpecConstants = False + +# Force Aspect Ratio +# +# Only exposes modes with a given aspect ratio. +# Useful for titles that break if they see ultra-wide. +# +# Supported values: +# - Any ratio, ie. "16:9", "4:3" + +# d3d9.forceAspectRatio = "" + +# Allow Discard +# +# Allow the discard lock flag to be used +# Useful if some apps use this incorrectly. +# +# Supported values: +# - True/False + +# d3d9.allowDiscard = True + +# Enumerate by Displays +# +# Whether we should enumerate D3D9 adapters by display (windows behaviour) +# or by physical adapter. +# May be useful in PRIME setups. +# +# Supported values: +# - True/False + +# d3d9.enumerateByDisplays = True + +# APITrace Mode +# +# Makes all host visible buffers cached and coherent +# Improves performance when apitracing, but also can impact +# some dumb games. +# +# Supported values: +# - True/False + +# d3d9.apitraceMode = False + +# Seamless Cubes +# +# Don't use non seamless cube maps even if they are supported. +# Non seamless cubes are correct d3d9 behavior, but can produce worse looking edges. +# +# Supported values: +# - True/False + +# d3d9.seamlessCubes = False + +# Debug Utils +# +# Enables debug utils as this is off by default, this enables user annotations like BeginEvent()/EndEvent(). +# Alternatively could be enabled with DXVK_DEBUG=markers environment variable. +# +# Supported values: +# - True/False + +# dxvk.enableDebugUtils = False + +# Memory limit for locked D3D9 textures +# +# How much virtual memory will be used for textures (in MB). +# 0 to disable the limit. +# THIS DOES NOT IMPACT ACTUAL MEMORY CONSUMPTION OR TEXTURE QUALITY. +# DO NOT CHANGE THIS UNLESS YOU HAVE A VERY GOOD REASON. + +# d3d9.textureMemory = 100 diff --git a/installer/GUI/InstallerWindow.py b/installer/GUI/InstallerWindow.py index f33ae1199..9d7f8cc8d 100644 --- a/installer/GUI/InstallerWindow.py +++ b/installer/GUI/InstallerWindow.py @@ -199,6 +199,18 @@ def GlobalFixes(self, row, pad): else: self.dxvkval = DummyCheckbox() + self.deus_nsf_d3d10val = BooleanVar(master=self.frame, value=False) + self.deus_nsf_d3d10 = Checkbutton(self.frame, text="Deus_nsf tweaked D3D10", variable=self.deus_nsf_d3d10val) + Hovertip(self.deus_nsf_d3d10, "Tweaked D3D10 shaders for a better retro look with more vivid lighting.") + self.deus_nsf_d3d10.grid(column=1,row=row, sticky='SW', padx=pad, pady=pad) + self.FixColors(self.deus_nsf_d3d10) + row+=1 + # TODO: option for tweaking the retro texture filtering + # in d3d10drv_deus_nsf/unrealpool.fhx change line 96 from + # return diffusePoint; + # to + # return diffuse; + self.ogl2val = BooleanVar(master=self.frame, value=self.ogl2_default) self.ogl2 = Checkbutton(self.frame, text="Updated OpenGL 2.0 Renderer", variable=self.ogl2val) Hovertip(self.ogl2, "Updated OpenGL Renderer for modern systems. An alternative to using D3D10 or D3D9.") @@ -235,8 +247,9 @@ def _Install(self): speedupfix = self.speedupfixval.get() dxvk = self.dxvkval.get() + deus_nsf_d3d10 = self.deus_nsf_d3d10val.get() ogl2 = self.ogl2val.get() - flavors = Install.Install(self.exe, flavors, speedupfix, dxvk, ogl2) + flavors = Install.Install(self.exe, flavors, speedupfix, dxvk, deus_nsf_d3d10, ogl2) flavorstext = ', '.join(flavors.keys()) extra = '' if 'Vanilla' in flavors and IsWindows(): diff --git a/installer/Install/Install.py b/installer/Install/Install.py index 826ccfbed..12bc6ce4b 100644 --- a/installer/Install/Install.py +++ b/installer/Install/Install.py @@ -43,7 +43,7 @@ def DetectFlavors(exe:Path) -> list: return _DetectFlavors(system) -def Install(exe:Path, flavors:dict, speedupfix:bool, dxvk:bool, OGL2:bool=False) -> dict: +def Install(exe:Path, flavors:dict, speedupfix:bool, dxvk:bool, deus_nsf_d3d10:bool=False, OGL2:bool=False) -> dict: assert exe.exists(), str(exe) assert exe.name.lower() == 'deusex.exe' system:Path = exe.parent @@ -59,7 +59,7 @@ def Install(exe:Path, flavors:dict, speedupfix:bool, dxvk:bool, OGL2:bool=False) continue if 'Vanilla'==f: - ret = InstallVanilla(system, settings, speedupfix, Vulkan=dxvk, OGL2=OGL2) + ret = InstallVanilla(system, settings, speedupfix, Vulkan=dxvk, deus_nsf_d3d10=deus_nsf_d3d10, OGL2=OGL2) if 'Vanilla? Madder.'==f: ret = CreateModConfigs(system, settings, 'VMD', 'VMDSim') if 'GMDX v9'==f: @@ -86,7 +86,7 @@ def Install(exe:Path, flavors:dict, speedupfix:bool, dxvk:bool, OGL2:bool=False) return flavors -def InstallVanilla(system:Path, settings:dict, speedupfix:bool, Vulkan:bool, OGL2:bool): +def InstallVanilla(system:Path, settings:dict, speedupfix:bool, Vulkan:bool, deus_nsf_d3d10:bool, OGL2:bool): gameroot = system.parent if not settings.get('install') and not settings.get('LDDP') and not settings.get('FixVanilla'): @@ -116,7 +116,9 @@ def InstallVanilla(system:Path, settings:dict, speedupfix:bool, Vulkan:bool, OGL exedest:Path = system / 'DeusEx.exe' CopyTo(exe_source, exedest) ini = GetSourcePath() / 'Configs' / "DeusExDefault.ini" - VanillaFixConfigs(system, 'DeusEx', kentie, Vulkan, OGL2, speedupfix, ini) + VanillaFixConfigs(system=system, exename='DeusEx', kentie=kentie, + Vulkan=Vulkan, deus_nsf_d3d10=deus_nsf_d3d10, OGL2=OGL2, + speedupfix=speedupfix, sourceINI=ini) else: info('skipping fixing of vanilla') @@ -136,19 +138,21 @@ def InstallVanilla(system:Path, settings:dict, speedupfix:bool, Vulkan:bool, OGL CopyTo(intfile, intdest) ini = GetSourcePath() / 'Configs' / "DXRandoDefault.ini" - VanillaFixConfigs(system, exename, kentie, Vulkan, OGL2, speedupfix, ini, settings.get('ZeroRando', False)) + VanillaFixConfigs(system=system, exename=exename, kentie=kentie, + Vulkan=Vulkan, deus_nsf_d3d10=deus_nsf_d3d10, OGL2=OGL2, + speedupfix=speedupfix, sourceINI=ini, ZeroRando=settings.get('ZeroRando', False)) dxrroot = gameroot / 'DXRando' Mkdir((dxrroot / 'Maps'), exist_ok=True, parents=True) Mkdir((dxrroot / 'System'), exist_ok=True, parents=True) CopyPackageFiles('vanilla', gameroot, ['DeusEx.u']) - CopyD3DRenderers(system) + CopyD3DRenderers(system, deus_nsf_d3d10) if settings.get('mirrors'): MapVariants.InstallMirrors(dxrroot / 'Maps', settings.get('downloadcallback'), 'Vanilla') -def VanillaFixConfigs(system, exename, kentie, Vulkan, OGL2, speedupfix, sourceINI: Path, ZeroRando=False): +def VanillaFixConfigs(system, exename, kentie, Vulkan, deus_nsf_d3d10, OGL2, speedupfix, sourceINI: Path, ZeroRando=False): defini_dest:Path = system / (exename+'Default.ini') # I don't think Kentie cares about this file, but Han's Launchbox does CopyTo(sourceINI, defini_dest) c = Config.Config(defini_dest.read_bytes()) @@ -194,6 +198,11 @@ def VanillaFixConfigs(system, exename, kentie, Vulkan, OGL2, speedupfix, sourceI changes['D3D10Drv.D3D10RenderDevice'] = {} changes['D3D10Drv.D3D10RenderDevice'].update({'FPSLimit': '0', 'VSync': 'False'}) + if deus_nsf_d3d10: + if 'D3D10Drv.D3D10RenderDevice' not in changes: + changes['D3D10Drv.D3D10RenderDevice'] = {} + changes['D3D10Drv.D3D10RenderDevice'].update({'ClassicLighting': 'False'}) + info('ZeroRando:', ZeroRando) if ZeroRando: if 'DeusEx.DXRFlags' not in changes: diff --git a/installer/Install/__init__.py b/installer/Install/__init__.py index 3c8a051fa..af4312509 100644 --- a/installer/Install/__init__.py +++ b/installer/Install/__init__.py @@ -322,7 +322,7 @@ def ModifyConfig(defconfig:Path, config:Path, outdefconfig:Path, outconfig:Path, WriteBytes(outconfig, c.GetBinary()) -def CopyD3DRenderers(system:Path): +def CopyD3DRenderers(system:Path, deus_nsf:bool): source = GetSourcePath() thirdparty = source / '3rdParty' info('CopyD3DRenderers from', thirdparty, ' to ', system) @@ -335,17 +335,28 @@ def CopyD3DRenderers(system:Path): CopyTo(thirdparty/'d3d10drv.dll', system/'d3d10drv.dll', True) CopyTo(thirdparty/'D3D10Drv.int', system/'D3D10Drv.int', True) - drvdir_source = thirdparty / 'd3d10drv' - drvdir_dest = system / 'd3d10drv' - Mkdir(drvdir_dest, exist_ok=True) - for f in drvdir_source.glob('*'): - CopyTo(f, drvdir_dest / f.name, True) + if deus_nsf: + Copyd3d10drv(thirdparty / 'd3d10drv_deus_nsf', system / 'd3d10drv') + Copyd3d10drv(thirdparty / 'd3d10drv', system / 'd3d10drv_kentie') + else: + Copyd3d10drv(thirdparty / 'd3d10drv_deus_nsf', system / 'd3d10drv_deus_nsf') + Copyd3d10drv(thirdparty / 'd3d10drv', system / 'd3d10drv') + + +def Copyd3d10drv(source, dest): + info('Copyd3d10drv from', source, 'to', dest) + Mkdir(dest, exist_ok=True) + for f in source.glob('*'): + CopyTo(f, dest / f.name, True) def CopyDXVK(system:Path, install:bool): dir = GetSourcePath() / '3rdParty' / 'dxvk' info('CopyDXVK from', dir, ' to ', system) num = 0 + # doesn't hurt to always have the dxvk.conf file? + CopyTo(GetSourcePath()/'Configs'/'dxvk.conf', system/'dxvk.conf') + # loop through all dxvk files and conditionally add or delete them for f in dir.glob('*'): dest = system / f.name if install: diff --git a/installer/build.py b/installer/build.py index e773135cf..2e65912e8 100644 --- a/installer/build.py +++ b/installer/build.py @@ -60,12 +60,22 @@ if not p.exists(): DownloadFile(Community_Update_url + url, basedest/dest) -# TODO: unzip dxglr21.zip +# extract OpenGL 2 zip = ZipFile(basedest/'dxglr21.zip', 'r') zip.extractall(basedest) zip.close() (basedest/'dxglr21.zip').unlink() +# Deus_nsf tweaked D3D10 shaders +if not (basedest/'d3d10drv_deus_nsf.zip').exists(): + DownloadFile('https://mods4ever.com/public/d3d10drv_deus_nsf.zip', basedest/'d3d10drv_deus_nsf.zip') +zip = ZipFile(basedest/'d3d10drv_deus_nsf.zip', 'r') +(basedest/'d3d10drv_deus_nsf').mkdir(exist_ok=True) +for name in zip.namelist(): + data = zip.read(name) + (basedest/'d3d10drv_deus_nsf'/Path(name).name).write_bytes(data) +zip.close() +(basedest/'d3d10drv_deus_nsf.zip').unlink() # # LDDP minimal install if not (basedest/'FemJC.u').exists():