Upgraded to MonoGame v0.3.4: rebuilt shaders, removed the old content project, added a default config file
This commit is contained in:
@@ -301,6 +301,9 @@
|
||||
<Content Include="changelog.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="config.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\BackgroundSprites\BackgroundCreaturePrefabs.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
@@ -971,6 +974,9 @@
|
||||
<None Include="Content\Characters\Scorpion\scorpionidle2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Content.mgcb">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\effects.mgfx">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
@@ -1064,6 +1070,9 @@
|
||||
<None Include="Content\Items\Weapons\stungrenade.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\LargeFont.xnb">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\Map\TutorialSub.sub">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
@@ -1250,7 +1259,7 @@
|
||||
<None Include="Content\Sounds\Water\WaterAmbience1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Content\watershader.mgfx">
|
||||
<None Include="Content\watershader.xnb">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
@@ -1272,10 +1281,6 @@
|
||||
<Project>{49ba1c69-6104-41ac-a5d8-b54fa9f696e8}</Project>
|
||||
<Name>Lidgren.Network</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Subsurface_content\Subsurface_content\Barotrauma_content.csproj">
|
||||
<Project>{1e6bf44d-6e31-40cc-8321-3d5958c983e7}</Project>
|
||||
<Name>Barotrauma_content</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#----------------------------- Global Properties ----------------------------#
|
||||
|
||||
#----------------------------- Global Properties ----------------------------#
|
||||
|
||||
/outputDir:bin/$(Platform)
|
||||
/intermediateDir:obj/$(Platform)
|
||||
@@ -11,3 +12,28 @@
|
||||
|
||||
|
||||
#---------------------------------- Content ---------------------------------#
|
||||
|
||||
#begin LargeFont.spritefont
|
||||
/importer:FontDescriptionImporter
|
||||
/processor:FontDescriptionProcessor
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:LargeFont.spritefont
|
||||
|
||||
#begin SmallFont.spritefont
|
||||
/importer:FontDescriptionImporter
|
||||
/processor:FontDescriptionProcessor
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:SmallFont.spritefont
|
||||
|
||||
#begin SpriteFont1.spritefont
|
||||
/importer:FontDescriptionImporter
|
||||
/processor:FontDescriptionProcessor
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:SpriteFont1.spritefont
|
||||
|
||||
#begin watershader.fx
|
||||
/importer:EffectImporter
|
||||
/processor:EffectProcessor
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:watershader.fx
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file contains an xml description of a font, and will be read by the XNA
|
||||
Framework Content Pipeline. Follow the comments to customize the appearance
|
||||
of the font in your game, and to change the characters which are available to draw
|
||||
with.
|
||||
-->
|
||||
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
|
||||
<Asset Type="Graphics:FontDescription">
|
||||
|
||||
<FontName>Verdana</FontName>
|
||||
|
||||
<Size>16</Size>
|
||||
|
||||
<Spacing>0</Spacing>
|
||||
|
||||
<UseKerning>true</UseKerning>
|
||||
|
||||
<Style>Bold</Style>
|
||||
|
||||
<DefaultCharacter>_</DefaultCharacter>
|
||||
|
||||
<!--
|
||||
CharacterRegions control what letters are available in the font. Every
|
||||
character from Start to End will be built and made available for drawing. The
|
||||
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
|
||||
character set. The characters are ordered according to the Unicode standard.
|
||||
See the documentation for more information.
|
||||
-->
|
||||
<CharacterRegions>
|
||||
<CharacterRegion>
|
||||
<Start> </Start>
|
||||
<End>Ұ</End>
|
||||
</CharacterRegion>
|
||||
|
||||
<CharacterRegion>
|
||||
<Start>À</Start>
|
||||
<End>ə</End>
|
||||
</CharacterRegion>
|
||||
</CharacterRegions>
|
||||
</Asset>
|
||||
</XnaContent>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file contains an xml description of a font, and will be read by the XNA
|
||||
Framework Content Pipeline. Follow the comments to customize the appearance
|
||||
of the font in your game, and to change the characters which are available to draw
|
||||
with.
|
||||
-->
|
||||
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
|
||||
<Asset Type="Graphics:FontDescription">
|
||||
|
||||
<FontName>Verdana</FontName>
|
||||
|
||||
<Size>7</Size>
|
||||
|
||||
<Spacing>0</Spacing>
|
||||
|
||||
<UseKerning>true</UseKerning>
|
||||
|
||||
<Style>Regular</Style>
|
||||
|
||||
<DefaultCharacter>_</DefaultCharacter>
|
||||
|
||||
<!--
|
||||
CharacterRegions control what letters are available in the font. Every
|
||||
character from Start to End will be built and made available for drawing. The
|
||||
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
|
||||
character set. The characters are ordered according to the Unicode standard.
|
||||
See the documentation for more information.
|
||||
-->
|
||||
<CharacterRegions>
|
||||
<CharacterRegion>
|
||||
<Start> </Start>
|
||||
<End>Ұ</End>
|
||||
</CharacterRegion>
|
||||
|
||||
<CharacterRegion>
|
||||
<Start>À</Start>
|
||||
<End>ə</End>
|
||||
</CharacterRegion>
|
||||
</CharacterRegions>
|
||||
</Asset>
|
||||
</XnaContent>
|
||||
@@ -41,7 +41,7 @@ with.
|
||||
If you uncomment this line, the default character will be substituted if you draw
|
||||
or measure text that contains characters which were not included in the font.
|
||||
-->
|
||||
<!-- <DefaultCharacter>*</DefaultCharacter> -->
|
||||
<DefaultCharacter>_</DefaultCharacter>
|
||||
|
||||
<!--
|
||||
CharacterRegions control what letters are available in the font. Every
|
||||
@@ -53,8 +53,13 @@ with.
|
||||
<CharacterRegions>
|
||||
<CharacterRegion>
|
||||
<Start> </Start>
|
||||
<End>Ÿ</End>
|
||||
<End>Ұ</End>
|
||||
</CharacterRegion>
|
||||
|
||||
<CharacterRegion>
|
||||
<Start>À</Start>
|
||||
<End>ə</End>
|
||||
</CharacterRegion>
|
||||
</CharacterRegions>
|
||||
</Asset>
|
||||
</XnaContent>
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,72 @@
|
||||
float xBlurDistance;
|
||||
|
||||
Texture xTexture;
|
||||
sampler TextureSampler = sampler_state { Texture = <xTexture>; };
|
||||
|
||||
Texture xLosTexture;
|
||||
sampler LosSampler = sampler_state { Texture = <xLosTexture>; };
|
||||
|
||||
|
||||
Texture xWaterBumpMap;
|
||||
sampler WaterBumpSampler =
|
||||
sampler_state
|
||||
{
|
||||
Texture = <xWaterBumpMap>;
|
||||
MagFilter = LINEAR;
|
||||
MinFilter = LINEAR;
|
||||
MipFilter = LINEAR;
|
||||
AddressU = WRAP;
|
||||
AddressV = WRAP;
|
||||
};
|
||||
|
||||
float xWaveWidth;
|
||||
float xWaveHeight;
|
||||
float2 xWavePos;
|
||||
float2 xBumpPos;
|
||||
|
||||
float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float4 bumpColor = tex2D(WaterBumpSampler, texCoord+xWavePos+xBumpPos);
|
||||
bumpColor = (bumpColor + tex2D(WaterBumpSampler, texCoord-xWavePos*2.0f+xBumpPos))/2.0f;
|
||||
|
||||
float2 samplePos = texCoord;
|
||||
|
||||
samplePos.x+=(bumpColor.r-0.5f)*xWaveWidth;
|
||||
samplePos.y+=(bumpColor.g-0.5f)*xWaveHeight;
|
||||
|
||||
float4 sample;
|
||||
sample = tex2D( TextureSampler, float2(samplePos.x+xBlurDistance, samplePos.y+xBlurDistance));
|
||||
sample += tex2D( TextureSampler, float2(samplePos.x-xBlurDistance, samplePos.y-xBlurDistance));
|
||||
sample += tex2D( TextureSampler, float2(samplePos.x+xBlurDistance, samplePos.y-xBlurDistance));
|
||||
sample += tex2D( TextureSampler, float2(samplePos.x-xBlurDistance, samplePos.y+xBlurDistance));
|
||||
|
||||
sample = sample / 4;
|
||||
|
||||
return sample;
|
||||
}
|
||||
|
||||
float4 main2(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float4 losColor = tex2D(LosSampler, texCoord);
|
||||
|
||||
float4 outColor = float4(losColor.x, losColor.y, losColor.z, color.w);
|
||||
|
||||
return outColor;
|
||||
}
|
||||
|
||||
|
||||
technique WaterShader
|
||||
{
|
||||
pass Pass1
|
||||
{
|
||||
PixelShader = compile ps_4_0_level_9_1 main();
|
||||
}
|
||||
}
|
||||
|
||||
technique LosShader
|
||||
{
|
||||
pass Pass1
|
||||
{
|
||||
PixelShader = compile ps_4_0_level_9_1 main2();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -195,7 +195,7 @@ namespace Barotrauma
|
||||
|
||||
|
||||
|
||||
Hull.renderer = new WaterRenderer(GraphicsDevice);
|
||||
Hull.renderer = new WaterRenderer(GraphicsDevice, Content);
|
||||
TitleScreen.LoadState = 1.0f;
|
||||
yield return CoroutineStatus.Running;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.IO;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -25,20 +26,20 @@ namespace Barotrauma
|
||||
get { return waterTexture; }
|
||||
}
|
||||
|
||||
public WaterRenderer(GraphicsDevice graphicsDevice)
|
||||
public WaterRenderer(GraphicsDevice graphicsDevice, ContentManager content)
|
||||
{
|
||||
#if WINDOWS
|
||||
byte[] bytecode = File.ReadAllBytes("Content/watershader.mgfx");
|
||||
waterEffect = content.Load<Effect>("watershader");
|
||||
#endif
|
||||
#if LINUX
|
||||
byte[] bytecode = File.ReadAllBytes("Content/watershader_opengl.mgfx");
|
||||
#endif
|
||||
|
||||
waterEffect = new Effect(graphicsDevice, bytecode);
|
||||
waterEffect = content.Load<Effect>("watershader_opengl");
|
||||
#endif
|
||||
|
||||
waterTexture = TextureLoader.FromFile("Content/waterbump.png");
|
||||
waterEffect.Parameters["xWaveWidth"].SetValue(0.05f);
|
||||
waterEffect.Parameters["xWaveHeight"].SetValue(0.05f);
|
||||
|
||||
#if WINDOWS
|
||||
//waterEffect.Parameters["xTexture"].SetValue(waterTexture);
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config masterserverurl="http://www.undertowgames.com/baromaster" autocheckupdates="true" musicvolume="0.0" soundvolume="0.0">
|
||||
<graphicsmode width="1280" height="720" fullscreen="false" />
|
||||
<contentpackage path="Data/ContentPackages/Vanilla 0.3.xml" />
|
||||
<keymapping Select="E" Use="0" Aim="1" Up="W" Down="S" Left="A" Right="D" Run="LeftShift" Chat="Tab" CrewOrders="C" />
|
||||
</config>
|
||||
Reference in New Issue
Block a user