Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Regalis11 committed Mar 18, 2019
1 parent 23687fb commit 63eb4d6
Show file tree
Hide file tree
Showing 103 changed files with 1,377 additions and 4,691 deletions.
Binary file added Barotrauma/BarotraumaClient/Icon.bmp
Binary file not shown.
12 changes: 11 additions & 1 deletion Barotrauma/BarotraumaClient/LinuxClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<ApplicationIcon>..\BarotraumaShared\IconBmp.bmp</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>
Expand Down Expand Up @@ -103,6 +104,7 @@
<Content Include="OpenTK.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Shaders\solidcolor_opengl.fx" />
<Content Include="SharpFont.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -152,13 +154,16 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="app.config" />
<Content Include="Shaders\blurshader_opengl.fx" />
<Content Include="Shaders\damageshader_opengl.fx" />
<Content Include="Shaders\deformshader_opengl.fx" />
<Content Include="Shaders\losshader_opengl.fx" />
<Content Include="Shaders\postprocess_opengl.fx" />
<Content Include="Shaders\watershader_opengl.fx" />
<None Include="Content\Effects\solidcolor_opengl.xnb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shaders\Content_opengl.mgcb" />
<None Include="Content\Effects\blurshader_opengl.xnb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down Expand Up @@ -187,6 +192,11 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<EmbeddedResource Include="Icon.bmp">
<LogicalName>Icon.bmp</LogicalName>
</EmbeddedResource>
</ItemGroup>
<Import Project="ClientCode.projitems" Label="Shared" />
<Import Project="..\BarotraumaShared\SharedCode.projitems" Label="Shared" />
<Import Project="..\BarotraumaShared\SharedContent.projitems" Label="Shared" />
Expand Down
4 changes: 4 additions & 0 deletions Barotrauma/BarotraumaClient/MacClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<Content Include="OpenTK.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Shaders\solidcolor_opengl.fx" />
<Content Include="SharpFont.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -159,6 +160,9 @@
<Content Include="Shaders\losshader_opengl.fx" />
<Content Include="Shaders\postprocess_opengl.fx" />
<Content Include="Shaders\watershader_opengl.fx" />
<None Include="Content\Effects\solidcolor_opengl.xnb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Shaders\Content_opengl.mgcb" />
<None Include="Content\Effects\blurshader_opengl.xnb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
4 changes: 2 additions & 2 deletions Barotrauma/BarotraumaClient/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.8.9.5")]
[assembly: AssemblyFileVersion("0.8.9.5")]
[assembly: AssemblyVersion("0.8.9.6")]
[assembly: AssemblyFileVersion("0.8.9.6")]
57 changes: 57 additions & 0 deletions Barotrauma/BarotraumaClient/Shaders/Content.mgcb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

#----------------------------- Global Properties ----------------------------#

/outputDir:bin/$(Platform)
/intermediateDir:obj/$(Platform)
/platform:Windows
/config:
/profile:Reach
/compress:False

#-------------------------------- References --------------------------------#


#---------------------------------- Content ---------------------------------#

#begin blurshader.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:blurshader.fx

#begin damageshader.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:damageshader.fx

#begin deformshader.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:deformshader.fx

#begin losshader.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:losshader.fx

#begin postprocess.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:postprocess.fx

#begin watershader.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:watershader.fx

#begin solidcolor.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:solidcolor.fx

62 changes: 62 additions & 0 deletions Barotrauma/BarotraumaClient/Shaders/Content_opengl.mgcb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

#----------------------------- Global Properties ----------------------------#

/outputDir:bin/$(Platform)
/intermediateDir:obj/$(Platform)
/platform:DesktopGL
/config:
/profile:Reach
/compress:False

#-------------------------------- References --------------------------------#


#---------------------------------- Content ---------------------------------#

#begin blurshader_opengl.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:blurshader_opengl.fx

#begin Content_opengl.mgcb
/importer:
/processor:
/build:Content_opengl.mgcb

#begin damageshader_opengl.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:damageshader_opengl.fx

#begin deformshader_opengl.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:deformshader_opengl.fx

#begin losshader_opengl.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:losshader_opengl.fx

#begin postprocess_opengl.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:postprocess_opengl.fx

#begin solidcolor_opengl.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:solidcolor_opengl.fx

#begin watershader_opengl.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:watershader_opengl.fx

38 changes: 38 additions & 0 deletions Barotrauma/BarotraumaClient/Shaders/solidcolor.fx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Texture2D xTexture;
sampler TextureSampler = sampler_state { Texture = <xTexture>; };

float blurDistance;
float4 color;

float4 solidColor(float4 position : SV_Position, float4 clr : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float a = tex2D(TextureSampler, texCoord).a;
return color * a;
}

float4 solidColorBlur(float4 position : SV_Position, float4 clr : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float sample;
sample = tex2D(TextureSampler, float2(texCoord.x + blurDistance, texCoord.y + blurDistance)).a;
sample += tex2D(TextureSampler, float2(texCoord.x - blurDistance, texCoord.y - blurDistance)).a;
sample += tex2D(TextureSampler, float2(texCoord.x + blurDistance, texCoord.y - blurDistance)).a;
sample += tex2D(TextureSampler, float2(texCoord.x - blurDistance, texCoord.y + blurDistance)).a;
sample = sample * 0.25f;

return color * sample;
}

technique SolidColor
{
pass Pass1
{
PixelShader = compile ps_4_0_level_9_1 solidColor();
}
}
technique SolidColorBlur
{
pass Pass1
{
PixelShader = compile ps_4_0_level_9_1 solidColorBlur();
}
}
38 changes: 38 additions & 0 deletions Barotrauma/BarotraumaClient/Shaders/solidcolor_opengl.fx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Texture xTexture;
sampler TextureSampler = sampler_state { Texture = <xTexture>; };

float blurDistance;
float4 color;

float4 solidColor(float4 position : SV_Position, float4 clr : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float a = tex2D(TextureSampler, texCoord).a;
return color * a;
}

float4 solidColorBlur(float4 position : SV_Position, float4 clr : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float sample;
sample = tex2D(TextureSampler, float2(texCoord.x + blurDistance, texCoord.y + blurDistance)).a;
sample += tex2D(TextureSampler, float2(texCoord.x - blurDistance, texCoord.y - blurDistance)).a;
sample += tex2D(TextureSampler, float2(texCoord.x + blurDistance, texCoord.y - blurDistance)).a;
sample += tex2D(TextureSampler, float2(texCoord.x - blurDistance, texCoord.y + blurDistance)).a;
sample = sample * 0.25f;

return color * sample;
}

technique SolidColor
{
pass Pass1
{
PixelShader = compile ps_3_0 solidColor();
}
}
technique SolidColorBlur
{
pass Pass1
{
PixelShader = compile ps_3_0 solidColorBlur();
}
}
6 changes: 2 additions & 4 deletions Barotrauma/BarotraumaClient/Source/Characters/CharacterHUD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public static void Draw(SpriteBatch spriteBatch, Character character, Camera cam
GUI.Style.FocusIndicator.Draw(spriteBatch,
(int)((focusedItemOverlayTimer - 1.0f) * GUI.Style.FocusIndicator.FrameCount * 3.0f),
circlePos,
Color.Orange * 0.3f,
Color.LightBlue * 0.3f,
origin: GUI.Style.FocusIndicator.FrameSize.ToVector2() / 2,
rotate: (float)Timing.TotalTime,
scale: scale);
Expand Down Expand Up @@ -274,9 +274,7 @@ public static void Draw(SpriteBatch spriteBatch, Character character, Camera cam
GUI.DrawString(spriteBatch, textPos, coloredText.Text, coloredText.Color * alpha, Color.Black * alpha * 0.7f, 2, GUI.SmallFont);
textPos.Y += 20;
}
}


}
}

foreach (HUDProgressBar progressBar in character.HUDProgressBars.Values)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,10 @@ public void UpdateHUD(float deltaTime)
{
healthBar.Color = healthWindowHealthBar.Color = ToolBox.GradientLerp(Vitality / MaxVitality, Color.Red, Color.Orange, Color.Green);
healthBar.HoverColor = healthWindowHealthBar.HoverColor = healthBar.Color * 2.0f;
healthBar.BarSize = healthWindowHealthBar.BarSize = (Vitality > 0.0f) ? Vitality / MaxVitality : 1.0f - Vitality / MinVitality;
healthBar.BarSize = healthWindowHealthBar.BarSize =
(Vitality > 0.0f) ?
(MaxVitality > 0.0f ? Vitality / MaxVitality : 0.0f) :
(Math.Abs(MinVitality) > 0.0f ? 1.0f - Vitality / MinVitality : 0.0f);

if (healthBarPulsateTimer > 0.0f)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public static Character ReadSpawnData(NetBuffer inc, bool spawn = true)
character.ID = id;
character.TeamID = (TeamType)teamID;

if (configPath == HumanConfigFile)
if (configPath == HumanConfigFile && character.TeamID != TeamType.FriendlyNPC)
{
CharacterInfo duplicateCharacterInfo = GameMain.GameSession.CrewManager.GetCharacterInfos().FirstOrDefault(c => c.ID == info.ID);
GameMain.GameSession.CrewManager.RemoveCharacterInfo(duplicateCharacterInfo);
Expand Down
Loading

0 comments on commit 63eb4d6

Please sign in to comment.