Skip to content

Commit

Permalink
Merge pull request #19 from jakobharder/devel/fix-scaling-issue
Browse files Browse the repository at this point in the history
enforce dot as decimal separator
  • Loading branch information
jakobharder authored Oct 18, 2023
2 parents bba4891 + 13eb2a8 commit c451877
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
6 changes: 6 additions & 0 deletions resources/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## 0.5 - Remastered Characters (2023-10-15)

### 0.5.1

- Fixed scaling issue in environments using comma as decimal separator (e.g. German)

### Changes

- Toggle fullscreen/windows with Alt+Enter
- Remastered graphics
- All remaining location maps
Expand Down
8 changes: 4 additions & 4 deletions source/Burntime.MonoGame/BurntimeGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ public void DecreaseLoadingCount()

public bool IsLoading { get; set; }

#if (DEBUG)
// #if (DEBUG)
public bool FullScreen { get; set; } = false;
#else
public bool FullScreen { get; set; } = true;
#endif
// #else
// public bool FullScreen { get; set; } = true;
// #endif
bool _initialized = false;

public BurntimeGame()
Expand Down
14 changes: 8 additions & 6 deletions source/Burntime.Platform/IO/ConfigSection.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Burntime.Platform.IO;
using System.Globalization;

namespace Burntime.Platform.IO;

public class ConfigSection
{
Expand Down Expand Up @@ -227,15 +229,15 @@ public Vector2f GetVector2f(string key, Vector2f defaultValue)
string[] token = str.Split(new char[] { 'x' });
if (token.Length == 1)
{
if (!float.TryParse(token[0], out v.x))
if (!float.TryParse(token[0], NumberStyles.Float, CultureInfo.InvariantCulture, out v.x))
return defaultValue;
return v;
}
if (token.Length != 2)
return v;
if (!float.TryParse(token[0], out v.x))
if (!float.TryParse(token[0], NumberStyles.Float, CultureInfo.InvariantCulture, out v.x))
return defaultValue;
if (!float.TryParse(token[1], out v.y))
if (!float.TryParse(token[1], NumberStyles.Float, CultureInfo.InvariantCulture, out v.y))
return defaultValue;
return v;
}
Expand All @@ -246,7 +248,7 @@ public float GetFloat(string key)
return 0;

float res = 0;
if (!float.TryParse(Get(key), System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out res))
if (!float.TryParse(Get(key), NumberStyles.Float, CultureInfo.InvariantCulture, out res))
return 0;
return res;
}
Expand All @@ -263,7 +265,7 @@ public float[] GetFloats(string key)
float[] floats = new float[strs.Length];
for (int i = 0; i < strs.Length; i++)
{
if (!float.TryParse(strs[i], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out floats[i]))
if (!float.TryParse(strs[i], NumberStyles.Float, CultureInfo.InvariantCulture, out floats[i]))
floats[i] = 0;
}
return floats;
Expand Down

0 comments on commit c451877

Please sign in to comment.