Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: .NET

env:
PACK_ID: Sims1WidescreenPatcher
PACK_VER: 3.13.0
PACK_VER: 3.14.0

on:
push:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
8 changes: 7 additions & 1 deletion Sims1WidescreenPatcher.Core/Models/DDrawCompatWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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})";
}
}
6 changes: 3 additions & 3 deletions Sims1WidescreenPatcher.Core/Models/ScalePanelBackJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; want to modify some advanced properties not available via the CPL.
;==========================================================================

Version = 0x280
Version = 0x286

;--------------------------------------------------------------------------

Expand All @@ -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
Expand All @@ -38,6 +40,7 @@ InheritColorProfileInFullScreenMode = true
KeepWindowAspectRatio = true
CaptureMouse = true
CenterAppWindow = false
DisableScreenSaver = false

;--------------------------------------------------------------------------

Expand Down Expand Up @@ -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
Expand All @@ -106,6 +116,7 @@ CursorScaleFactor = 0
DisplayROI =
Resampling = bilinear
PresentationModel = auto
ColorSpace = appdriven
FreeMouse = false
WindowedAttributes =
FullscreenAttributes =
Expand Down Expand Up @@ -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

Expand All @@ -196,7 +210,8 @@ Bilinear2DOperations = false
PhongShadingWhenPossible = false
ForceVerticalSync = false
dgVoodooWatermark = false
FastVideoMemoryAccess = true
FastVideoMemoryAccess = false
DisableD3DTnLDevice = false

;--------------------------------------------------------------------------

Expand Down Expand Up @@ -230,20 +245,26 @@ 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.
; 0 = automatic
; 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
Expand Down Expand Up @@ -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 =
Expand All @@ -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

Expand All @@ -305,6 +330,7 @@ RTTexturesForceScaleAndMSAA = true
SmoothedDepthSampling = true
DeferredScreenModeSwitch = false
PrimarySurfaceBatchedUpdate = false
SuppressAMDBlacklist = false

;--------------------------------------------------------------------------

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 5 additions & 6 deletions Sims1WidescreenPatcher.Core/Services/DomCalService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down
8 changes: 0 additions & 8 deletions Sims1WidescreenPatcher.Core/Services/IffService.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
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;

public interface IIffService
{
IffViewModel Load(string pathToIff);
void Write(string pathToIff, IffViewModel viewModel);
Task<IffViewModel> LoadAsync(string pathToIff);
}

public class IffService : IIffService
Expand All @@ -19,11 +16,6 @@ public IffViewModel Load(string pathToIff)
return new IffViewModel(Iff.Read(pathToIff));
}

public async Task<IffViewModel> LoadAsync(string pathToIff)
{
return await Task.Run(() => Load(pathToIff));
}

public void Write(string pathToIff, IffViewModel viewModel)
{
var iff = viewModel.MapToIff();
Expand Down
31 changes: 16 additions & 15 deletions Sims1WidescreenPatcher.Core/Services/ImagesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
Expand Down Expand Up @@ -96,39 +94,40 @@ var i in _blackBackground
}
}

private List<BaseImageProcessingJob> GetJobs()
private List<BaseImageProcessingJob> GetJobs(Far far)
{
_far.ParseFar();
var jobs = new List<BaseImageProcessingJob>();

if (_appState.Resolution is null)
{
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,
}
);
}

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,
Expand All @@ -140,6 +139,7 @@ private List<BaseImageProcessingJob> GetJobs()
}

private IEnumerable<BaseImageProcessingJob> GetCompositeJobs(
Far far,
IEnumerable<string> images,
string color
)
Expand All @@ -150,15 +150,16 @@ 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
{
Color = color,
Height = _appState.Resolution.Height,
Output = CombineWithUiGraphicsPath(i),
Width = _appState.Resolution.Width,
ImageBytes = bytes,
ImageBytes = img.Bytes,
};
}
}
Expand Down
Loading