Added support for FNA

This commit is contained in:
Robert Vokac 2025-01-14 18:36:10 +01:00
parent 62241e8f94
commit f38980e4e6
Signed by: robertvokac
GPG Key ID: FB9CE8E20AADA55F
4 changed files with 16 additions and 8 deletions

View File

@ -1,4 +1,4 @@
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
// WindowsPhoneSpeedyBlupi.Def
using static WindowsPhoneSpeedyBlupi.EnvClasses;

View File

@ -112,7 +112,9 @@ namespace WindowsPhoneSpeedyBlupi
if (Env.IMPL.isNotKNI() && !TouchPanel.GetCapabilities().IsConnected)
{
this.IsMouseVisible = true;
#if !FNA
Mouse.SetCursor(MouseCursor.Arrow);
#endif
}
graphics = new GraphicsDeviceManager(this);

View File

@ -186,7 +186,7 @@ namespace WindowsPhoneSpeedyBlupi
}
}
/// <summary>
/// Returns the point of the cente of the pad on the screen.
/// Returns the point of the center of the pad on the screen.
/// </summary>
private TinyPoint PadCenter
{

View File

@ -66,7 +66,7 @@ namespace WindowsPhoneSpeedyBlupi
{
return null;
}
return text.Split("\n");
return text.Split('\n');
}
private static string GetWorldFilename(int gamer, int rank)
@ -79,7 +79,7 @@ namespace WindowsPhoneSpeedyBlupi
Debug.WriteLine("ReadGameData");
#if !(KNI && WEB)
IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFile userStoreForApplication = getUserStoreForApplication();
if (userStoreForApplication.FileExists(GameDataFilename))
{
IsolatedStorageFileStream isolatedStorageFileStream = null;
@ -120,7 +120,7 @@ namespace WindowsPhoneSpeedyBlupi
#if !(KNI && WEB)
IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFile userStoreForApplication = getUserStoreForApplication();
IsolatedStorageFileStream isolatedStorageFileStream = userStoreForApplication.OpenFile(GameDataFilename, FileMode.Create);
if (isolatedStorageFileStream != null)
{
@ -138,7 +138,7 @@ namespace WindowsPhoneSpeedyBlupi
#if !KNI
IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFile userStoreForApplication = getUserStoreForApplication();
try
{
userStoreForApplication.DeleteFile(CurrentGameFilename);
@ -157,7 +157,7 @@ namespace WindowsPhoneSpeedyBlupi
{
Debug.WriteLine("ReadCurrentGame");
#if !(KNI && WEB)
IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFile userStoreForApplication = getUserStoreForApplication();
if (userStoreForApplication.FileExists(CurrentGameFilename))
{
IsolatedStorageFileStream isolatedStorageFileStream = null;
@ -188,7 +188,7 @@ namespace WindowsPhoneSpeedyBlupi
{
Debug.WriteLine("WriteCurrentGame");
#if !(KNI && WEB)
IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFile userStoreForApplication = getUserStoreForApplication();
IsolatedStorageFileStream isolatedStorageFileStream = userStoreForApplication.OpenFile(CurrentGameFilename, FileMode.Create);
if (isolatedStorageFileStream != null)
{
@ -200,6 +200,12 @@ namespace WindowsPhoneSpeedyBlupi
#endif
}
private static IsolatedStorageFile getUserStoreForApplication() {
if(Env.IMPL.isFNA()) {
return IsolatedStorageFile.GetUserStoreForAssembly();
}
return IsolatedStorageFile.GetUserStoreForApplication();
}
public static void GetIntArrayField(string[] lines, string section, int rank, string name, int[] array)
{
foreach (string text in lines)