Skip to content

Commit

Permalink
[Client] Quick fixes to shaders and SPR2 save
Browse files Browse the repository at this point in the history
You will need to resave all sprite piff/iffs with Volcanic!
  • Loading branch information
riperiperi committed Aug 31, 2016
1 parent bcbd1e9 commit 103ee75
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 17 deletions.
12 changes: 0 additions & 12 deletions TSOClient/before.FreeSO.sln.targets

This file was deleted.

Binary file modified TSOClient/tso.client/Content/DX/Effects/2DWorldBatch.xnb
Binary file not shown.
Binary file modified TSOClient/tso.client/Content/OGL/Effects/2DWorldBatch.xnb
Binary file not shown.
4 changes: 3 additions & 1 deletion TSOClient/tso.client/ContentSrc/Effects/2DWorldBatch.fx
Expand Up @@ -285,7 +285,9 @@ void psZDepthSprite(ZVertexOut v, out float4 color:COLOR0, out float4 depthB:COL
if (depthOutMode == true) {
color = depthB;
} else {
color = pixel * tex2D(ambientSampler, v.roomVec);
if (floor(v.roomVec.x * 256) == 254 && floor(v.roomVec.y * 256) == 255) pixel = float4(float3(1.0, 1.0, 1.0) - pixel.xyz, pixel.a);
else if (v.roomVec.x != 0.0) pixel *= tex2D(ambientSampler, v.roomVec);
color = pixel;

color.rgb *= max(1, v.objectID); //hack - otherwise v.objectID always equals 0 on intel and 1 on nvidia (yeah i don't know)
color.rgb *= color.a; //"pre"multiply, just here for experimentation
Expand Down
Binary file modified TSOClient/tso.client/Icon.bmp
Binary file not shown.
8 changes: 5 additions & 3 deletions TSOClient/tso.client/TSOGame.cs
Expand Up @@ -55,9 +55,11 @@ public TSOGame() : base()
/// </summary>
protected override void Initialize()
{
Graphics.GraphicsDevice.PresentationParameters.PresentationInterval = PresentInterval.Two;
GlobalSettings.Default.GraphicsWidth = GraphicsDevice.Viewport.Width / FSOEnvironment.DPIScaleFactor;
GlobalSettings.Default.GraphicsHeight = GraphicsDevice.Viewport.Height / FSOEnvironment.DPIScaleFactor;
if (FSOEnvironment.DPIScaleFactor != 1 || FSOEnvironment.SoftwareDepth)
{
GlobalSettings.Default.GraphicsWidth = GraphicsDevice.Viewport.Width / FSOEnvironment.DPIScaleFactor;
GlobalSettings.Default.GraphicsHeight = GraphicsDevice.Viewport.Height / FSOEnvironment.DPIScaleFactor;
}

OperatingSystem os = Environment.OSVersion;
PlatformID pid = os.Platform;
Expand Down
2 changes: 1 addition & 1 deletion TSOClient/tso.files/formats/iff/chunks/SPR2.cs
Expand Up @@ -204,7 +204,7 @@ public void Write(IoWriter io)

var data = sprStream.ToArray();
io.WriteUInt32(1001);
io.WriteUInt32((uint)data.Length+8);
io.WriteUInt32((uint)data.Length);
io.WriteBytes(data);
}
}
Expand Down

0 comments on commit 103ee75

Please sign in to comment.