diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 23ca160..e797616 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -2,7 +2,7 @@ name: .NET env: PACK_ID: Sims1WidescreenPatcher - PACK_VER: 3.13.0 + PACK_VER: 3.14.0 on: push: @@ -26,7 +26,7 @@ jobs: run: dotnet publish Sims1WidescreenPatcher/Sims1WidescreenPatcher.csproj -c Release -o artifacts -p:VersionPrefix=${{ env.PACK_VER }} -p:PublishSingleFile=true -p:SelfContained=true -p:DebugType=embedded -p:IncludeNativeLibrariesForSelfExtract=true -p:EnableCompressionInSingleFile=true -p:PublishTrimmed=true -p:RuntimeIdentifier=linux-x64 - name: Upload a Build Artifact if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' - uses: actions/upload-artifact@v3.1.0 + uses: actions/upload-artifact@v4.6.2 with: name: ${{ env.PACK_ID }}.${{ env.PACK_VER }}+linux.x64 path: artifacts/Sims1WidescreenPatcher @@ -45,7 +45,7 @@ jobs: run: dotnet publish Sims1WidescreenPatcher/Sims1WidescreenPatcher.csproj -c Release -o artifacts -p:VersionPrefix=${{ env.PACK_VER }} -p:PublishSingleFile=true -p:SelfContained=true -p:DebugType=embedded -p:IncludeNativeLibrariesForSelfExtract=true -p:EnableCompressionInSingleFile=true -p:PublishTrimmed=true -p:RuntimeIdentifier=win-x64 - name: Upload a Build Artifact if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' - uses: actions/upload-artifact@v3.1.0 + uses: actions/upload-artifact@v4.6.2 with: name: ${{ env.PACK_ID }}.${{ env.PACK_VER }}+win.x64 path: artifacts/Sims1WidescreenPatcher.exe @@ -70,7 +70,7 @@ jobs: run: tar -cvf Sims1WidescreenPatcher.${{ env.PACK_VER }}+macOS.x64.tar artifacts/ - name: Upload a Build Artifact if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' - uses: actions/upload-artifact@v3.1.0 + uses: actions/upload-artifact@v4.6.2 with: name: ${{ env.PACK_ID }}.${{ env.PACK_VER }}+macOS.x64 path: ${{ env.PACK_ID }}.${{ env.PACK_VER }}+macOS.x64.tar diff --git a/Sims1WidescreenPatcher.Core/Factories/CareerEditorViewModelFactory.cs b/Sims1WidescreenPatcher.Core/Factories/CareerEditorViewModelFactory.cs index bd2102e..8b61ed9 100644 --- a/Sims1WidescreenPatcher.Core/Factories/CareerEditorViewModelFactory.cs +++ b/Sims1WidescreenPatcher.Core/Factories/CareerEditorViewModelFactory.cs @@ -13,16 +13,14 @@ public interface ICareerEditorViewModelFactory public class CareerEditorViewModelFactory : ICareerEditorViewModelFactory { private readonly IAppState _appState; - private readonly IFar _far; private readonly IIffService _iffService; - public CareerEditorViewModelFactory(IAppState appState, IFar far, IIffService iffService) + public CareerEditorViewModelFactory(IAppState appState, IIffService iffService) { _appState = appState; - _far = far; _iffService = iffService; } public CareerEditorDialogViewModel Create() => - new CareerEditorDialogViewModel(_appState, _far, _iffService); + new CareerEditorDialogViewModel(_appState, _iffService); } diff --git a/Sims1WidescreenPatcher.Core/Models/DDrawCompatWrapper.cs b/Sims1WidescreenPatcher.Core/Models/DDrawCompatWrapper.cs index 3b9657e..6531ad6 100644 --- a/Sims1WidescreenPatcher.Core/Models/DDrawCompatWrapper.cs +++ b/Sims1WidescreenPatcher.Core/Models/DDrawCompatWrapper.cs @@ -33,10 +33,16 @@ public override string ToString() public class DgVoodoo2Wrapper : IWrapper { + public DgVoodoo2Wrapper(string version) + { + Version = version; + } + + public string Version { get; } public string Name => "DgVoodoo2"; public override string ToString() { - return Name; + return $"{Name} ({Version})"; } } diff --git a/Sims1WidescreenPatcher.Core/Models/ScalePanelBackJob.cs b/Sims1WidescreenPatcher.Core/Models/ScalePanelBackJob.cs index 9459337..a4583dd 100644 --- a/Sims1WidescreenPatcher.Core/Models/ScalePanelBackJob.cs +++ b/Sims1WidescreenPatcher.Core/Models/ScalePanelBackJob.cs @@ -9,9 +9,9 @@ public override void Run() base.Run(); using var image = new MagickImage(ImageBytes!); - var left = image.Clone(0, 0, 286, 100); - var middle = image.Clone((int)left.Width, 0, 500, 100); - var right = image.Clone((int)left.Width + (int)middle.Width, 0, 18, 100); + var left = image.CloneArea(0, 0, 286, 100); + var middle = image.CloneArea((int)left.Width, 0, 500, 100); + var right = image.CloneArea((int)left.Width + (int)middle.Width, 0, 18, 100); middle.Resize( new MagickGeometry((uint)Width - left.Width - right.Width, (uint)Height) { diff --git a/Sims1WidescreenPatcher.Core/Resources/DDrawCompat/0.5.4/ddraw.dll b/Sims1WidescreenPatcher.Core/Resources/DDrawCompat/0.5.4/ddraw.dll deleted file mode 100644 index a80b57c..0000000 Binary files a/Sims1WidescreenPatcher.Core/Resources/DDrawCompat/0.5.4/ddraw.dll and /dev/null differ diff --git a/Sims1WidescreenPatcher.Core/Resources/DDrawCompat/0.6.0/ddraw.dll b/Sims1WidescreenPatcher.Core/Resources/DDrawCompat/0.6.0/ddraw.dll new file mode 100644 index 0000000..d47a6f7 Binary files /dev/null and b/Sims1WidescreenPatcher.Core/Resources/DDrawCompat/0.6.0/ddraw.dll differ diff --git a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/D3D8.dll b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/D3D8.dll new file mode 100644 index 0000000..2165ee8 Binary files /dev/null and b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/D3D8.dll differ diff --git a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/D3DImm.dll b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/D3DImm.dll new file mode 100644 index 0000000..0c1d178 Binary files /dev/null and b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/D3DImm.dll differ diff --git a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/DDraw.dll b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/DDraw.dll new file mode 100644 index 0000000..8cacb54 Binary files /dev/null and b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/DDraw.dll differ diff --git a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/dgVoodoo.conf b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/dgVoodoo.conf similarity index 87% rename from Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/dgVoodoo.conf rename to Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/dgVoodoo.conf index 4b1f68d..96f2c55 100644 --- a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/dgVoodoo.conf +++ b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/dgVoodoo.conf @@ -4,7 +4,7 @@ ; want to modify some advanced properties not available via the CPL. ;========================================================================== -Version = 0x280 +Version = 0x286 ;-------------------------------------------------------------------------- @@ -22,6 +22,8 @@ Version = 0x280 ; is explicitly selected. Disabled case is intended for avoiding extra ; rendering resources on old hardware for better performance, if required. +; DisableScreenSaver: If true then screen saver and monitor sleep mode are disabled while rendering through dgVoodoo is active + OutputAPI = bestavailable Adapters = all FullScreenOutput = default @@ -38,6 +40,7 @@ InheritColorProfileInFullScreenMode = true KeepWindowAspectRatio = true CaptureMouse = true CenterAppWindow = false +DisableScreenSaver = false ;-------------------------------------------------------------------------- @@ -81,6 +84,13 @@ CenterAppWindow = false ; while plain legacy models provide the best presentation performance under ideal conditions ; Not all model + output API + OS version combinations are supported. ; "auto", "discard", "seq", "flip_discard", "flip_seq" +; ColorSpace: Color space of the swap chain: +; "appdriven" - an application can choose argb2101010 through D3D9, but it means +; the legacy argb8888_srgb in any other case +; "argb8888_srgb" - Legacy 32 bit output for SDR displays +; "argb2101010_sdr" - 32 bit extended precision for SDR displays +; "argb2101010_sdr_wcg" - Wide Color Gamut format for SDR displays (available from Windows 11 22H2) +; "argb16161616_hdr" - Float16 HDR output (available from Windows 10 1709) ; FreeMouse: If true then physical mouse is free to move inside the game window ; when using emulated scaling and/or application and forced resolution ; differs; can be useful when a game relies on the physical window size @@ -106,6 +116,7 @@ CursorScaleFactor = 0 DisplayROI = Resampling = bilinear PresentationModel = auto +ColorSpace = appdriven FreeMouse = false WindowedAttributes = FullscreenAttributes = @@ -174,18 +185,21 @@ DitherOrderedMatrixSizeScale = 0 ; VideoCard: "svga", "internal3D", "geforce_ti_4800", "ati_radeon_8500", ; "matrox_parhelia-512", "geforce_fx_5700_ultra", "geforce_9800_gt" ; VRAM: in MBs (default) or in GBs (e.g. VRAM = 2GB) -; Filtering: "appdriven", "pointsampled", "bilinear", "linearmip", "trilinear" +; Filtering: "appdriven", "pointsampled", "bilinear", "pointmip", "linearmip", "trilinear" ; or the integer value of an anisotropic filtering level (1-16) +; Mipmapping: "appdriven", "disabled", "autogen_point", "autogen_bilinear" ; KeepFilterIfPointSampled: if enabled then forced filtering affects only non-point sampled textures ; Bilinear2DOperations: if enabled then DirectDraw Blit and CPU-written data is transferred with bilinear scaling +; DisableD3DTnLDevice: if disabled then D3D TnL device is not enumerated and hardware Transform&Light vertex processing +; is not available DisableAndPassThru = false VideoCard = internal3D VRAM = 256 Filtering = appdriven +Mipmapping = appdriven KeepFilterIfPointSampled = false -DisableMipmapping = false Resolution = unforced Antialiasing = appdriven @@ -196,7 +210,8 @@ Bilinear2DOperations = false PhongShadingWhenPossible = false ForceVerticalSync = false dgVoodooWatermark = false -FastVideoMemoryAccess = true +FastVideoMemoryAccess = false +DisableD3DTnLDevice = false ;-------------------------------------------------------------------------- @@ -230,7 +245,7 @@ FastVideoMemoryAccess = true ; EnumeratedResolutionBitdepths: you can filter what bitdepths are included in the resolution enumeration ; any subset of {"8", "16", "32"}, or "all" -; DitheringEffect: "pure32bit", "ordered2x2", "ordered4x4" +; DitheringEffect: "high_quality", "ordered2x2", "ordered4x4" ; Dithering: "disabled", "appdriven", "forceon16bit", "forcealways" ; DitherOrderedMatrixSizeScale: integer scale value for dither matrix size ; 1 = normal, 2 = double size, etc. @@ -238,12 +253,18 @@ FastVideoMemoryAccess = true ; DepthBuffersBitDepth: internal bit depth of depth/stencil buffers for 3D rendering (32 bit is not recommended) ; "appdriven", "forcemin24bit", "force32bit" ; Default3DRenderFormat: default format of 3D rendering -; argb2101010 gives higher dynamic range but it can break the rendering -; "argb8888", "argb2101010" +; "auto", "argb8888", "argb2101010", "argb16161616" +; auto corresponds to the selected color space +; argb2101010 has the benefit that it is still 32 bit but it can corrupt the rendering +; because of the lowered alpha bits, not recommended ; MaxVSConstRegisters: Max number of vertex shader constant registers (DX8/9 only) ; Can be defined only for SVGA and Internal3D card types ; Valid values are 256 (default), 512 or 1024 +; D3D12BoundsChecking: If enabled then the D3D12 backend does bound checking on vs const register file accesses (D3D8/9 only) +; It should always be enabled to be fully compatible with the D3D8/9 specs but unfortunately that can cause +; performance loss while the vast majority of games do not need it; try to enable it if you experience a +; GPU crash with a D3D8/9 game ; NPatchTesselationLevel: Force N-Patch tesselation level (D3D8/9) ; 0 = app driven @@ -278,6 +299,9 @@ FastVideoMemoryAccess = true ; PrimarySurfaceBatchedUpdate: If true then direct changes of the primary surface are batched together for presenting them ; If false then each change is instantly presented (debug-like mode) +; SuppressAMDBlacklist: Some AMD GPU models are blacklisted to workaround the solid-color-textures driver issue +; You can suppress it to check out if the problem is fixed in your current driver + AdapterIDType = VendorID = DeviceID = @@ -288,13 +312,14 @@ DefaultEnumeratedResolutions = all ExtraEnumeratedResolutions = EnumeratedResolutionBitdepths = all -DitheringEffect = pure32bit +DitheringEffect = high_quality Dithering = forcealways DitherOrderedMatrixSizeScale = 0 DepthBuffersBitDepth = appdriven -Default3DRenderFormat = argb8888 +Default3DRenderFormat = auto MaxVSConstRegisters = 256 +D3D12BoundsChecking = false NPatchTesselationLevel = 0 @@ -305,6 +330,7 @@ RTTexturesForceScaleAndMSAA = true SmoothedDepthSampling = true DeferredScreenModeSwitch = false PrimarySurfaceBatchedUpdate = false +SuppressAMDBlacklist = false ;-------------------------------------------------------------------------- diff --git a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/dgVoodooCpl.exe b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/dgVoodooCpl.exe similarity index 61% rename from Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/dgVoodooCpl.exe rename to Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/dgVoodooCpl.exe index 191de39..14c59b7 100644 Binary files a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/dgVoodooCpl.exe and b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/2_86/dgVoodooCpl.exe differ diff --git a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/D3D8.dll b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/D3D8.dll deleted file mode 100644 index df3c3c8..0000000 Binary files a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/D3D8.dll and /dev/null differ diff --git a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/D3DImm.dll b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/D3DImm.dll deleted file mode 100644 index 7ecfef0..0000000 Binary files a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/D3DImm.dll and /dev/null differ diff --git a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/DDraw.dll b/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/DDraw.dll deleted file mode 100644 index cb20181..0000000 Binary files a/Sims1WidescreenPatcher.Core/Resources/DgVoodoo2/DDraw.dll and /dev/null differ diff --git a/Sims1WidescreenPatcher.Core/Services/DomCalService.cs b/Sims1WidescreenPatcher.Core/Services/DomCalService.cs index 871e04a..d9b7992 100644 --- a/Sims1WidescreenPatcher.Core/Services/DomCalService.cs +++ b/Sims1WidescreenPatcher.Core/Services/DomCalService.cs @@ -20,13 +20,11 @@ public class DomCalService : IDomCalService { private const string DomcalName = "dd_domcal.iff"; private readonly IAppState _appState; - private readonly IFar _far; private readonly IIffService _iffService; - public DomCalService(IAppState appState, IFar far, IIffService iffService) + public DomCalService(IAppState appState, IIffService iffService) { _appState = appState; - _far = far; _iffService = iffService; } @@ -135,9 +133,10 @@ public void IncreaseSalaries() { throw new FileNotFoundException(expansionSharedFile); } - _far.PathToFar = expansionSharedFile; - _far.ParseFar(); - _far.Extract("work.iff", expansionSharedFolder); + + var far = Far.Read(expansionSharedFile); + var workIffFarFile = far.Files.First(x => x.Name == "work.iff"); + workIffFarFile.Extract(Path.Combine(expansionSharedFolder, "work.iff")); if (!File.Exists(workIffFile)) { throw new FileNotFoundException(workIffFile); diff --git a/Sims1WidescreenPatcher.Core/Services/IffService.cs b/Sims1WidescreenPatcher.Core/Services/IffService.cs index cb00f25..a605b0e 100644 --- a/Sims1WidescreenPatcher.Core/Services/IffService.cs +++ b/Sims1WidescreenPatcher.Core/Services/IffService.cs @@ -1,7 +1,5 @@ -using System.Runtime.Serialization; using sims_iff.Models; using Sims1WidescreenPatcher.Core.ViewModels.Sims_Iff; -using Sims1WidescreenPatcher.Core.ViewModels.Sims_Iff.ResourceContent.CARR; namespace Sims1WidescreenPatcher.Core.Services; @@ -9,7 +7,6 @@ public interface IIffService { IffViewModel Load(string pathToIff); void Write(string pathToIff, IffViewModel viewModel); - Task LoadAsync(string pathToIff); } public class IffService : IIffService @@ -19,11 +16,6 @@ public IffViewModel Load(string pathToIff) return new IffViewModel(Iff.Read(pathToIff)); } - public async Task LoadAsync(string pathToIff) - { - return await Task.Run(() => Load(pathToIff)); - } - public void Write(string pathToIff, IffViewModel viewModel) { var iff = viewModel.MapToIff(); diff --git a/Sims1WidescreenPatcher.Core/Services/ImagesService.cs b/Sims1WidescreenPatcher.Core/Services/ImagesService.cs index 7b3e63f..ea4aa68 100644 --- a/Sims1WidescreenPatcher.Core/Services/ImagesService.cs +++ b/Sims1WidescreenPatcher.Core/Services/ImagesService.cs @@ -40,13 +40,11 @@ public class ImagesService : IImagesService private readonly IAppState _appState; private readonly IProgressService _progressService; - private readonly IFar _far; - public ImagesService(IAppState appState, IProgressService progressService, IFar far) + public ImagesService(IAppState appState, IProgressService progressService) { _appState = appState; _progressService = progressService; - _far = far; } private const string TallSubPanel = @"cpanel\Backgrounds\TallSubPanel.TGA"; @@ -56,8 +54,8 @@ public ImagesService(IAppState appState, IProgressService progressService, IFar public void Install() { _uiGraphicsPath = GetUiGraphicsFolder(); - _far.PathToFar = CombineWithUiGraphicsPath("UIGraphics.far"); - var jobs = GetJobs(); + var far = Far.Read(Path.Combine(_uiGraphicsPath, "UIGraphics.far")); + var jobs = GetJobs(far); var totalJobs = jobs.Count; var current = 0; @@ -96,9 +94,8 @@ var i in _blackBackground } } - private List GetJobs() + private List GetJobs(Far far) { - _far.ParseFar(); var jobs = new List(); if (_appState.Resolution is null) @@ -106,12 +103,13 @@ private List GetJobs() return jobs; } - if (_far.TryGetBytes(PanelBack, out var bytes)) + var panelBack = far.Files.FirstOrDefault(x => x.Name == PanelBack); + if (panelBack is not null) { jobs.Add( new ScalePanelBackJob { - ImageBytes = bytes, + ImageBytes = panelBack.Bytes, Output = CombineWithUiGraphicsPath(PanelBack), Width = _appState.Resolution.Width, Height = 100, @@ -119,16 +117,17 @@ private List GetJobs() ); } - jobs.AddRange(GetCompositeJobs(_blackBackground, "#000000")); + jobs.AddRange(GetCompositeJobs(far, _blackBackground, "#000000")); - jobs.AddRange(GetCompositeJobs(_blueBackground, "#000052")); + jobs.AddRange(GetCompositeJobs(far, _blueBackground, "#000052")); - if (_far.TryGetBytes(TallSubPanel, out bytes)) + var tallSubPanel = far.Files.FirstOrDefault(x => x.Name == TallSubPanel); + if (tallSubPanel is not null) { jobs.Add( new ScaleTallSubPanelJob { - ImageBytes = bytes, + ImageBytes = tallSubPanel.Bytes, Output = CombineWithUiGraphicsPath(TallSubPanel), Width = _appState.Resolution.Width, Height = 150, @@ -140,6 +139,7 @@ private List GetJobs() } private IEnumerable GetCompositeJobs( + Far far, IEnumerable images, string color ) @@ -150,7 +150,8 @@ string color } foreach (var i in images) { - if (_far.TryGetBytes(i, out var bytes)) + var img = far.Files.FirstOrDefault(x => x.Name == i); + if (img is not null) { yield return new CompositeImageJob { @@ -158,7 +159,7 @@ string color Height = _appState.Resolution.Height, Output = CombineWithUiGraphicsPath(i), Width = _appState.Resolution.Width, - ImageBytes = bytes, + ImageBytes = img.Bytes, }; } } diff --git a/Sims1WidescreenPatcher.Core/Services/WrapperService.cs b/Sims1WidescreenPatcher.Core/Services/WrapperService.cs index 375d811..4f30022 100644 --- a/Sims1WidescreenPatcher.Core/Services/WrapperService.cs +++ b/Sims1WidescreenPatcher.Core/Services/WrapperService.cs @@ -20,10 +20,11 @@ public WrapperService(IAppState appState) _appState = appState; } - private static readonly string[] DdrawCompat054Resources = + private static readonly string[] DdrawCompat060Resources = { - @"DDrawCompat._0._5._4.ddraw.dll", + @"DDrawCompat._0._6._0.ddraw.dll", }; + private static readonly string[] DdrawCompat032Resources = { @"DDrawCompat._0._3._2.ddraw.dll", @@ -31,11 +32,11 @@ public WrapperService(IAppState appState) private static readonly string[] DgvoodooResources = { - @"DgVoodoo2.D3D8.dll", - @"DgVoodoo2.D3DImm.dll", - @"DgVoodoo2.DDraw.dll", - @"DgVoodoo2.dgVoodoo.conf", - @"DgVoodoo2.dgVoodooCpl.exe", + @"DgVoodoo2._2_86.D3D8.dll", + @"DgVoodoo2._2_86.D3DImm.dll", + @"DgVoodoo2._2_86.DDraw.dll", + @"DgVoodoo2._2_86.dgVoodoo.conf", + @"DgVoodoo2._2_86.dgVoodooCpl.exe", }; public List GetWrappers() @@ -43,27 +44,27 @@ public List GetWrappers() if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { /* Return different ddrawcompat versions depending on Windows version. - Windows 10 and newer get ddrawcompat 0.5.4 + Windows 10 and newer get ddrawcompat 0.6.0 Windows 8.1 and older get ddrawcompat 0.3.2 */ return Environment.OSVersion.Version.Major >= 10 ? new List { - new DDrawCompatWrapper("0.5.4"), - new DgVoodoo2Wrapper(), + new DDrawCompatWrapper("0.6.0"), + new DgVoodoo2Wrapper("2_86"), new NoneWrapper(), } : new List { new DDrawCompatWrapper("0.3.2"), - new DgVoodoo2Wrapper(), + new DgVoodoo2Wrapper("2_86"), new NoneWrapper(), }; } if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { - return new List { new NoneWrapper(), new DgVoodoo2Wrapper() }; + return new List { new NoneWrapper(), new DgVoodoo2Wrapper("2_86") }; } return new List { new NoneWrapper() }; @@ -79,10 +80,13 @@ public async Task Install(IWrapper wrapper) { case DDrawCompatWrapper w: resources = - w.Version == "0.5.4" ? DdrawCompat054Resources : DdrawCompat032Resources; + w.Version == "0.6.0" ? DdrawCompat060Resources : DdrawCompat032Resources; break; - case DgVoodoo2Wrapper: - resources = DgvoodooResources; + case DgVoodoo2Wrapper w: + resources = + w.Version == "2_86" + ? DgvoodooResources + : throw new ArgumentOutOfRangeException(nameof(w.Version)); break; case NoneWrapper: break; @@ -108,7 +112,7 @@ public void Uninstall() { var simsInstallDir = GetSimsInstallDirectory(); foreach ( - var item in DdrawCompat054Resources + var item in DdrawCompat060Resources .Concat(DdrawCompat032Resources) .Concat(DgvoodooResources) ) diff --git a/Sims1WidescreenPatcher.Core/Sims1WidescreenPatcher.Core.csproj b/Sims1WidescreenPatcher.Core/Sims1WidescreenPatcher.Core.csproj index 42af044..84835c7 100644 --- a/Sims1WidescreenPatcher.Core/Sims1WidescreenPatcher.Core.csproj +++ b/Sims1WidescreenPatcher.Core/Sims1WidescreenPatcher.Core.csproj @@ -16,30 +16,35 @@ - + - - - + + + - - + + - - - - - - + + + + + + + + + + + diff --git a/Sims1WidescreenPatcher.Core/Tabs/MainTabViewModel.cs b/Sims1WidescreenPatcher.Core/Tabs/MainTabViewModel.cs index 3768887..40e8111 100644 --- a/Sims1WidescreenPatcher.Core/Tabs/MainTabViewModel.cs +++ b/Sims1WidescreenPatcher.Core/Tabs/MainTabViewModel.cs @@ -375,16 +375,13 @@ private void GetNewSelectedResolution(IChangeSet changeSet) break; case ListChangeReason.Replace: - break; case ListChangeReason.Remove: break; case ListChangeReason.RemoveRange: SelectedResolution = FilteredResolutions?.First(); return; case ListChangeReason.Refresh: - break; case ListChangeReason.Moved: - break; case ListChangeReason.Clear: break; default: @@ -393,15 +390,8 @@ private void GetNewSelectedResolution(IChangeSet changeSet) } } - private Func CreateResolutionPredicate(AspectRatio? ar) - { - if (ar is null) - { - return _ => true; - } - - return resolution => resolution.AspectRatio == ar; - } + private Func CreateResolutionPredicate(AspectRatio? ar) => + ar is null ? _ => true : resolution => resolution.AspectRatio == ar; private async Task OpenCustomInformationDialogAsync(string title, string message) { @@ -446,7 +436,7 @@ private async Task OnClickedPatch() var selectedWrapper = Wrappers[SelectedWrapperIndex]; - if (selectedWrapper is DDrawCompatWrapper { Version: "0.5.4" }) + if (selectedWrapper is DDrawCompatWrapper { Version: "0.6.0" }) { var result = await OpenCustomYesNoDialogAsync( "DDrawCompat Settings", diff --git a/Sims1WidescreenPatcher.Core/ViewModels/CareerEditorDialogViewModel.cs b/Sims1WidescreenPatcher.Core/ViewModels/CareerEditorDialogViewModel.cs index b7eb6b3..fab56c2 100644 --- a/Sims1WidescreenPatcher.Core/ViewModels/CareerEditorDialogViewModel.cs +++ b/Sims1WidescreenPatcher.Core/ViewModels/CareerEditorDialogViewModel.cs @@ -23,13 +23,12 @@ public class CareerEditorDialogViewModel : ViewModelBase, ICareerEditorTabViewMo private const string AboutLink = "https://github.com/FaithBeam/Sims-1-Complete-Collection-Widescreen-Patcher/wiki/Career-Editor"; private IAppState AppState { get; } - private readonly IFar _far; private readonly ObservableAsPropertyHelper _pathToExpansionShared; private readonly ObservableAsPropertyHelper _pathToExpansionSharedFar; private readonly ObservableAsPropertyHelper _pathToWorkIff; - private readonly ReadOnlyObservableCollection _careers; + private readonly ReadOnlyObservableCollection _careers; private readonly ReadOnlyObservableCollection _jobs; - private ResourceViewModel? _selectedCareer; + private CarrViewModel? _selectedCareer; private JobInfoViewModel? _selectedJob; private readonly ObservableAsPropertyHelper? _workIff; private readonly ObservableAsPropertyHelper _windowTitle; @@ -43,10 +42,9 @@ public class CareerEditorDialogViewModel : ViewModelBase, ICareerEditorTabViewMo private readonly ObservableAsPropertyHelper _shiftFunDecay; private readonly ObservableAsPropertyHelper _shiftSocialDecay; - public CareerEditorDialogViewModel(IAppState appState, IFar far, IIffService iffService) + public CareerEditorDialogViewModel(IAppState appState, IIffService iffService) { AppState = appState; - _far = far; _pathToExpansionShared = this.WhenAnyValue(x => x.AppState.SimsExePath) .Select(GetPathToExpansionSharedDir) @@ -145,15 +143,14 @@ public CareerEditorDialogViewModel(IAppState appState, IFar far, IIffService iff var myOp = iffSourceCache .Connect() .Filter(x => x.TypeCode.Value == "CARR") + .Cast(x => (CarrViewModel)x.Content) .SortAndBind( out _careers, - SortExpressionComparer.Ascending(x => - ((CarrViewModel)x.Content).CareerInfo.CareerName - ) + SortExpressionComparer.Ascending(x => x.CareerInfo.CareerName) ) .Subscribe(); this.WhenAnyValue(x => x.SelectedCareer) - .Select(x => ((CarrViewModel?)x?.Content)?.JobInfos) + .Select(x => x?.JobInfos) .Subscribe(x => { jobInfoSourceList.Edit(updater => @@ -255,7 +252,7 @@ public CareerEditorDialogViewModel(IAppState appState, IFar far, IIffService iff return endTime - startTime; } - public ReadOnlyObservableCollection Careers => _careers; + public ReadOnlyObservableCollection Careers => _careers; public ReadOnlyObservableCollection Jobs => _jobs; private string? PathToExpansionShared => _pathToExpansionShared.Value; @@ -263,7 +260,7 @@ public CareerEditorDialogViewModel(IAppState appState, IFar far, IIffService iff private string? PathToExpansionSharedFar => _pathToExpansionSharedFar.Value; private IffViewModel? WorkIff => _workIff?.Value; - public ResourceViewModel? SelectedCareer + public CarrViewModel? SelectedCareer { get => _selectedCareer; set => this.RaiseAndSetIfChanged(ref _selectedCareer, value); @@ -338,12 +335,9 @@ public JobInfoViewModel? SelectedJob return pathToWorkIff; } - _far.PathToFar = PathToExpansionSharedFar; - _far.ParseFar(); - _far.Extract( - _far.Manifest.ManifestEntries.First(x => x.Filename == "work.iff"), - pathToExpansionShared - ); + var far = Far.Read(pathToExpansionSharedFar); + far.Files.First(x => x.Name == "work.iff").Extract(pathToWorkIff); + return pathToWorkIff; } diff --git a/Sims1WidescreenPatcher.Linux/Services/ResolutionServiceX11.cs b/Sims1WidescreenPatcher.Linux/Services/ResolutionServiceX11.cs index ed5d0f4..c1fd2ca 100644 --- a/Sims1WidescreenPatcher.Linux/Services/ResolutionServiceX11.cs +++ b/Sims1WidescreenPatcher.Linux/Services/ResolutionServiceX11.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Runtime.InteropServices; using Serilog; +// using Serilog; using Sims1WidescreenPatcher.Core.Models; using Sims1WidescreenPatcher.Core.Services.Interfaces; diff --git a/Sims1WidescreenPatcher.MacOS/Services/MacOSResolutionService.cs b/Sims1WidescreenPatcher.MacOS/Services/MacOSResolutionService.cs index 7b51c87..db930f5 100644 --- a/Sims1WidescreenPatcher.MacOS/Services/MacOSResolutionService.cs +++ b/Sims1WidescreenPatcher.MacOS/Services/MacOSResolutionService.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Runtime.InteropServices; using Serilog; +// using Serilog; using Sims1WidescreenPatcher.Core.Models; using Sims1WidescreenPatcher.Core.Services; using Sims1WidescreenPatcher.Core.Services.Interfaces; diff --git a/Sims1WidescreenPatcher.UI/Dialogs/CareerEditorDialog.axaml b/Sims1WidescreenPatcher.UI/Dialogs/CareerEditorDialog.axaml index 8e3f22d..4ce7d51 100644 --- a/Sims1WidescreenPatcher.UI/Dialogs/CareerEditorDialog.axaml +++ b/Sims1WidescreenPatcher.UI/Dialogs/CareerEditorDialog.axaml @@ -3,8 +3,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:Sims1WidescreenPatcher.Core.ViewModels;assembly=Sims1WidescreenPatcher.Core" + xmlns:carrCont="clr-namespace:sims_iff.Models.ResourceContent.CARR;assembly=sims-iff" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Sims1WidescreenPatcher.UI.Dialogs.CareerEditorDialog" + x:DataType="vm:CareerEditorDialogViewModel" SizeToContent="WidthAndHeight" CanResize="False" Title="{Binding WindowTitle}"> @@ -69,7 +71,7 @@ PlaceholderText="Career Name" HorizontalAlignment="Stretch"> - + diff --git a/Sims1WidescreenPatcher.UI/Dialogs/CustomInformationDialog.axaml b/Sims1WidescreenPatcher.UI/Dialogs/CustomInformationDialog.axaml index c87bbcc..a7bc6e2 100644 --- a/Sims1WidescreenPatcher.UI/Dialogs/CustomInformationDialog.axaml +++ b/Sims1WidescreenPatcher.UI/Dialogs/CustomInformationDialog.axaml @@ -5,6 +5,7 @@ xmlns:vm="clr-namespace:Sims1WidescreenPatcher.Core.ViewModels;assembly=Sims1WidescreenPatcher.Core" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Sims1WidescreenPatcher.UI.Dialogs.CustomInformationDialog" + x:DataType="vm:CustomInformationDialogViewModel" Icon="/Assets/SimsICO.ico" MinWidth="300" MinHeight="100" diff --git a/Sims1WidescreenPatcher.UI/Dialogs/CustomResolutionDialog.axaml b/Sims1WidescreenPatcher.UI/Dialogs/CustomResolutionDialog.axaml index 1a49896..24c00f8 100644 --- a/Sims1WidescreenPatcher.UI/Dialogs/CustomResolutionDialog.axaml +++ b/Sims1WidescreenPatcher.UI/Dialogs/CustomResolutionDialog.axaml @@ -10,6 +10,7 @@ d:DesignWidth="450" d:DesignHeight="80" x:Class="Sims1WidescreenPatcher.UI.Dialogs.CustomResolutionDialog" + x:DataType="viewModels:CustomResolutionDialogViewModel" Title="Enter Custom Resolution" SizeToContent="Height" Icon="/Assets/SimsICO.ico"> diff --git a/Sims1WidescreenPatcher.UI/Dialogs/CustomYesNoDialog.axaml b/Sims1WidescreenPatcher.UI/Dialogs/CustomYesNoDialog.axaml index 196dfee..ce9821a 100644 --- a/Sims1WidescreenPatcher.UI/Dialogs/CustomYesNoDialog.axaml +++ b/Sims1WidescreenPatcher.UI/Dialogs/CustomYesNoDialog.axaml @@ -11,6 +11,7 @@ MinHeight="100" CanResize="False" x:Class="Sims1WidescreenPatcher.UI.Dialogs.CustomYesNoDialog" + x:DataType="vm:CustomYesNoDialogViewModel" Title="{Binding Title}"> diff --git a/Sims1WidescreenPatcher.UI/Sims1WidescreenPatcher.UI.csproj b/Sims1WidescreenPatcher.UI/Sims1WidescreenPatcher.UI.csproj index 26ef9dd..b59b526 100644 --- a/Sims1WidescreenPatcher.UI/Sims1WidescreenPatcher.UI.csproj +++ b/Sims1WidescreenPatcher.UI/Sims1WidescreenPatcher.UI.csproj @@ -4,6 +4,7 @@ net6.0 enable default + true @@ -24,13 +25,13 @@ - - - - - - - + + + + + + + @@ -39,7 +40,7 @@ - ..\..\Sims.Iff\sims-iff\bin\Debug\net6.0\sims-iff.dll + ..\..\Sims.Iff\sims-iff\bin\Debug\net9.0\sims-iff.dll diff --git a/Sims1WidescreenPatcher.UI/Tabs/ExtrasTab.axaml b/Sims1WidescreenPatcher.UI/Tabs/ExtrasTab.axaml index 7d09b5f..a2cebba 100644 --- a/Sims1WidescreenPatcher.UI/Tabs/ExtrasTab.axaml +++ b/Sims1WidescreenPatcher.UI/Tabs/ExtrasTab.axaml @@ -6,6 +6,7 @@ xmlns:customcontrols="clr-namespace:Sims1WidescreenPatcher.UI.UserControls" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Sims1WidescreenPatcher.UI.Tabs.ExtrasTab" + x:DataType="viewModels:ExtrasTabViewModel" x:Name="ExtrasTabUserControl"> diff --git a/Sims1WidescreenPatcher.UI/Tabs/MainTab.axaml b/Sims1WidescreenPatcher.UI/Tabs/MainTab.axaml index 23a6298..159c0fb 100644 --- a/Sims1WidescreenPatcher.UI/Tabs/MainTab.axaml +++ b/Sims1WidescreenPatcher.UI/Tabs/MainTab.axaml @@ -6,7 +6,8 @@ xmlns:userControls="clr-namespace:Sims1WidescreenPatcher.UI.UserControls" xmlns:converters="clr-namespace:Sims1WidescreenPatcher.UI.Converters" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" - x:Class="Sims1WidescreenPatcher.UI.Tabs.MainTab"> + x:Class="Sims1WidescreenPatcher.UI.Tabs.MainTab" + x:DataType="viewModels:MainTabViewModel"> diff --git a/Sims1WidescreenPatcher.UI/UserControls/Checkbox.axaml b/Sims1WidescreenPatcher.UI/UserControls/Checkbox.axaml index 34fdbc3..4f95922 100644 --- a/Sims1WidescreenPatcher.UI/UserControls/Checkbox.axaml +++ b/Sims1WidescreenPatcher.UI/UserControls/Checkbox.axaml @@ -5,7 +5,8 @@ xmlns:viewModels="clr-namespace:Sims1WidescreenPatcher.Core.ViewModels;assembly=Sims1WidescreenPatcher.Core" xmlns:converters="clr-namespace:Sims1WidescreenPatcher.UI.Converters" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" - x:Class="Sims1WidescreenPatcher.UI.UserControls.Checkbox"> + x:Class="Sims1WidescreenPatcher.UI.UserControls.Checkbox" + x:DataType="viewModels:CheckboxViewModel"> diff --git a/Sims1WidescreenPatcher.UI/UserControls/Notification.axaml b/Sims1WidescreenPatcher.UI/UserControls/Notification.axaml index e36b7cd..89f7bd3 100644 --- a/Sims1WidescreenPatcher.UI/UserControls/Notification.axaml +++ b/Sims1WidescreenPatcher.UI/UserControls/Notification.axaml @@ -4,7 +4,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:Sims1WidescreenPatcher.Core.ViewModels;assembly=Sims1WidescreenPatcher.Core" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" - x:Class="Sims1WidescreenPatcher.UI.UserControls.Notification"> + x:Class="Sims1WidescreenPatcher.UI.UserControls.Notification" + x:DataType="vm:NotificationViewModel"> diff --git a/Sims1WidescreenPatcher.UI/Views/MainWindow.axaml b/Sims1WidescreenPatcher.UI/Views/MainWindow.axaml index 151fdeb..c15113b 100644 --- a/Sims1WidescreenPatcher.UI/Views/MainWindow.axaml +++ b/Sims1WidescreenPatcher.UI/Views/MainWindow.axaml @@ -10,6 +10,7 @@ Width="600" CanResize="False" x:Class="Sims1WidescreenPatcher.UI.Views.MainWindow" + x:DataType="viewModels:MainWindowViewModel" Icon="/Assets/SimsICO.ico" SizeToContent="Height" Title="Sims 1 Widescreen Patcher"> diff --git a/Sims1WidescreenPatcher.Windows/Services/ResolutionsService.cs b/Sims1WidescreenPatcher.Windows/Services/ResolutionsService.cs index e4cfbd6..8cdf1b0 100644 --- a/Sims1WidescreenPatcher.Windows/Services/ResolutionsService.cs +++ b/Sims1WidescreenPatcher.Windows/Services/ResolutionsService.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Runtime.Versioning; using Serilog; +// using Serilog; using Sims1WidescreenPatcher.Core.Models; using Sims1WidescreenPatcher.Core.Services.Interfaces; using Windows.Win32; diff --git a/Sims1WidescreenPatcher/DependencyInjection/ServicesBootstrapper.cs b/Sims1WidescreenPatcher/DependencyInjection/ServicesBootstrapper.cs index d1a762b..1370519 100644 --- a/Sims1WidescreenPatcher/DependencyInjection/ServicesBootstrapper.cs +++ b/Sims1WidescreenPatcher/DependencyInjection/ServicesBootstrapper.cs @@ -52,7 +52,6 @@ private static void RegisterPlatformSpecificServices(IServiceCollection services private static void RegisterCommonServices(IServiceCollection services) { services - .AddScoped() .AddScoped() .AddScoped() .AddScoped() diff --git a/Sims1WidescreenPatcher/Program.cs b/Sims1WidescreenPatcher/Program.cs index 0b68ec0..43b45f8 100644 --- a/Sims1WidescreenPatcher/Program.cs +++ b/Sims1WidescreenPatcher/Program.cs @@ -6,6 +6,8 @@ using ReactiveUI; using Serilog; using Serilog.Formatting.Compact; +// using Serilog; +// using Serilog.Formatting.Compact; using Sims1WidescreenPatcher.DependencyInjection; using Sims1WidescreenPatcher.UI; using Splat; diff --git a/Sims1WidescreenPatcher/Sims1WidescreenPatcher.csproj b/Sims1WidescreenPatcher/Sims1WidescreenPatcher.csproj index ef6acb3..839d484 100644 --- a/Sims1WidescreenPatcher/Sims1WidescreenPatcher.csproj +++ b/Sims1WidescreenPatcher/Sims1WidescreenPatcher.csproj @@ -15,11 +15,11 @@ - + - - - + + + @@ -39,8 +39,8 @@ Sims1WidescreenPatcher com.example - 3.13.0 - 3.13.0 + 3.14.0 + 3.14.0 APPL Sims1WidescreenPatcher SimsICO.ico