diff --git a/ClassicalSharp/2D/Drawing/IDrawer2D.cs b/ClassicalSharp/2D/Drawing/IDrawer2D.cs
index 70dfbc8b4..b83f00860 100644
--- a/ClassicalSharp/2D/Drawing/IDrawer2D.cs
+++ b/ClassicalSharp/2D/Drawing/IDrawer2D.cs
@@ -231,6 +231,8 @@ namespace ClassicalSharp {
public void ReducePadding( ref Texture tex, int point ) {
if( !UseBitmappedChat ) return;
+ point = AdjTextSize( point );
+
int padding = (tex.Height - point) / 4;
float vAdj = (float)padding / Utils.NextPowerOf2( tex.Height );
tex.V1 += vAdj; tex.V2 -= vAdj;
@@ -239,6 +241,8 @@ namespace ClassicalSharp {
public void ReducePadding( ref int height, int point ) {
if( !UseBitmappedChat ) return;
+ point = AdjTextSize( point );
+
int padding = (height - point) / 4;
height -= padding * 2;
}
diff --git a/ClassicalSharp/Audio/AudioPlayer.Sounds.cs b/ClassicalSharp/Audio/AudioPlayer.Sounds.cs
index 521e9ee26..fc08c2015 100644
--- a/ClassicalSharp/Audio/AudioPlayer.Sounds.cs
+++ b/ClassicalSharp/Audio/AudioPlayer.Sounds.cs
@@ -43,6 +43,8 @@ namespace ClassicalSharp.Audio {
if( type == SoundType.None || monoOutputs == null )
return;
Sound snd = board.PickRandomSound( type );
+ if( snd == null ) return;
+
chunk.Channels = snd.Channels;
chunk.Frequency = snd.SampleRate;
chunk.BitsPerSample = snd.BitsPerSample;
diff --git a/ClassicalSharp/Game/Game.cs b/ClassicalSharp/Game/Game.cs
index 6bd2a0364..2a1d4d672 100644
--- a/ClassicalSharp/Game/Game.cs
+++ b/ClassicalSharp/Game/Game.cs
@@ -153,7 +153,10 @@ namespace ClassicalSharp {
LoadIcon();
string connectString = "Connecting to " + IPAddress + ":" + Port + "..";
- Graphics.WarnIfNecessary( Chat );
+ if( Graphics.WarnIfNecessary( Chat ) ) {
+ MapBordersRenderer.SetUseLegacyMode( true );
+ ((StandardEnvRenderer)EnvRenderer).SetUseLegacyMode( true );
+ }
SetNewScreen( new LoadingMapScreen( this, connectString, "Waiting for handshake" ) );
Network.Connect( IPAddress, Port );
}
diff --git a/ClassicalSharp/GraphicsAPI/IGraphicsApi.cs b/ClassicalSharp/GraphicsAPI/IGraphicsApi.cs
index b8dbd3610..342a8f4bb 100644
--- a/ClassicalSharp/GraphicsAPI/IGraphicsApi.cs
+++ b/ClassicalSharp/GraphicsAPI/IGraphicsApi.cs
@@ -222,8 +222,7 @@ namespace ClassicalSharp.GraphicsAPI {
}
/// Adds a warning to chat if this graphics API has problems with the current user's GPU.
- public virtual void WarnIfNecessary( Chat chat ) {
- }
+ public virtual bool WarnIfNecessary( Chat chat ) { return false; }
/// Informs the graphic api to update its state in preparation for a new frame.
public abstract void BeginFrame( Game game );
diff --git a/ClassicalSharp/GraphicsAPI/OpenGLApi.cs b/ClassicalSharp/GraphicsAPI/OpenGLApi.cs
index 5c0b1e383..4f968ef08 100644
--- a/ClassicalSharp/GraphicsAPI/OpenGLApi.cs
+++ b/ClassicalSharp/GraphicsAPI/OpenGLApi.cs
@@ -386,15 +386,13 @@ namespace ClassicalSharp.GraphicsAPI {
isIntelRenderer = renderer.Contains( "Intel" );
}
- public override void WarnIfNecessary( Chat chat ) {
- if( !isIntelRenderer ) return;
+ public override bool WarnIfNecessary( Chat chat ) {
+ if( !isIntelRenderer ) return false;
chat.Add( "&cIntel graphics cards are known to have issues with the OpenGL build." );
chat.Add( "&cVSync may not work, and you may see disappearing clouds and map edges." );
- chat.Add( " " );
- chat.Add( "&cFor Windows, try downloading the Direct3D 9 build as it doesn't have" );
- chat.Add( "&cthese problems. Alternatively, the disappearing graphics can be" );
- chat.Add( "&cpartially fixed by typing \"/client render legacy\" into chat." );
+ chat.Add( "&cFor Windows, try downloading the Direct3D 9 build instead.");
+ return true;
}
// Based on http://www.opentk.com/doc/graphics/save-opengl-rendering-to-disk