Refactoring

This commit is contained in:
Robert Vokac 2025-01-07 20:36:35 +01:00
parent 7acaf8ebe9
commit 1b895dc4f2
19 changed files with 739 additions and 750 deletions

View File

@ -3,6 +3,7 @@ using Android.Content.PM;
using Android.OS; using Android.OS;
using Android.Views; using Android.Views;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using WindowsPhoneSpeedyBlupi;
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
{ {

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,23 @@
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
// WindowsPhoneSpeedyBlupi.Def // WindowsPhoneSpeedyBlupi.Def
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
{ {
public static class Def public static class Def
{ {
public const bool DETAILED_DEBUGGING = false; public const bool DETAILED_DEBUGGING = false;
public const Platform PLATFORM = Platform.Android; public const Platform PLATFORM = Platform.Android;
public enum Platform public enum Platform
{ {
Desktop, Desktop,
Android, Android,
iOS, iOS,
Web Web
} }
public enum Phase public enum Phase
{ {
None, None,
@ -37,7 +35,7 @@ namespace WindowsPhoneSpeedyBlupi
Ranking Ranking
} }
public enum ButtonGlygh public enum ButtonGlyph
{ {
None, None,
InitGamerA, InitGamerA,

View File

@ -6,7 +6,6 @@ using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch; using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Media;
using WindowsPhoneSpeedyBlupi;
using static System.Net.Mime.MediaTypeNames; using static System.Net.Mime.MediaTypeNames;
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
@ -20,18 +19,18 @@ namespace WindowsPhoneSpeedyBlupi
0.94, 91.0, 1.0, 100.0 0.94, 91.0, 1.0, 100.0
}; };
private static readonly Def.ButtonGlygh[] cheatGeste = new Def.ButtonGlygh[10] private static readonly Def.ButtonGlyph[] cheatGeste = new Def.ButtonGlyph[10]
{ {
Def.ButtonGlygh.Cheat12, Def.ButtonGlyph.Cheat12,
Def.ButtonGlygh.Cheat22, Def.ButtonGlyph.Cheat22,
Def.ButtonGlygh.Cheat32, Def.ButtonGlyph.Cheat32,
Def.ButtonGlygh.Cheat12, Def.ButtonGlyph.Cheat12,
Def.ButtonGlygh.Cheat11, Def.ButtonGlyph.Cheat11,
Def.ButtonGlygh.Cheat21, Def.ButtonGlyph.Cheat21,
Def.ButtonGlygh.Cheat22, Def.ButtonGlyph.Cheat22,
Def.ButtonGlygh.Cheat21, Def.ButtonGlyph.Cheat21,
Def.ButtonGlygh.Cheat31, Def.ButtonGlyph.Cheat31,
Def.ButtonGlygh.Cheat32 Def.ButtonGlyph.Cheat32
}; };
private readonly GraphicsDeviceManager graphics; private readonly GraphicsDeviceManager graphics;
@ -99,16 +98,16 @@ namespace WindowsPhoneSpeedyBlupi
public Game1() public Game1()
{ {
Exiting += OnExiting; Exiting += OnExiting;
if(!TouchPanel.GetCapabilities().IsConnected) if (!TouchPanel.GetCapabilities().IsConnected)
{ {
this.IsMouseVisible = true; IsMouseVisible = true;
Mouse.SetCursor(MouseCursor.Arrow); Mouse.SetCursor(MouseCursor.Arrow);
} }
graphics = new GraphicsDeviceManager(this); graphics = new GraphicsDeviceManager(this);
graphics.IsFullScreen = false; graphics.IsFullScreen = false;
base.Content.RootDirectory = "Content"; Content.RootDirectory = "Content";
base.TargetElapsedTime = TimeSpan.FromTicks(500000L); TargetElapsedTime = TimeSpan.FromTicks(500000L);
base.InactiveSleepTime = TimeSpan.FromSeconds(1.0); InactiveSleepTime = TimeSpan.FromSeconds(1.0);
missionToStart1 = -1; missionToStart1 = -1;
missionToStart2 = -1; missionToStart2 = -1;
gameData = new GameData(); gameData = new GameData();
@ -227,7 +226,7 @@ namespace WindowsPhoneSpeedyBlupi
} }
} }
long num = gameTime.TotalGameTime.Ticks - startTime.Ticks; long num = gameTime.TotalGameTime.Ticks - startTime.Ticks;
waitProgress = (double)num / 50000000.0; waitProgress = num / 50000000.0;
if (waitProgress > 1.0) if (waitProgress > 1.0)
{ {
SetPhase(Def.Phase.Init); SetPhase(Def.Phase.Init);
@ -235,41 +234,41 @@ namespace WindowsPhoneSpeedyBlupi
return; return;
} }
inputPad.Update(); inputPad.Update();
Def.ButtonGlygh buttonPressed = inputPad.ButtonPressed; Def.ButtonGlyph buttonPressed = inputPad.ButtonPressed;
if (buttonPressed >= Def.ButtonGlygh.InitGamerA && buttonPressed <= Def.ButtonGlygh.InitGamerC) if (buttonPressed >= Def.ButtonGlyph.InitGamerA && buttonPressed <= Def.ButtonGlyph.InitGamerC)
{ {
SetGamer((int)(buttonPressed - 1)); SetGamer((int)(buttonPressed - 1));
return; return;
} }
switch (buttonPressed) switch (buttonPressed)
{ {
case Def.ButtonGlygh.InitSetup: case Def.ButtonGlyph.InitSetup:
SetPhase(Def.Phase.MainSetup); SetPhase(Def.Phase.MainSetup);
return; return;
case Def.ButtonGlygh.PauseSetup: case Def.ButtonGlyph.PauseSetup:
SetPhase(Def.Phase.PlaySetup); SetPhase(Def.Phase.PlaySetup);
return; return;
case Def.ButtonGlygh.SetupSounds: case Def.ButtonGlyph.SetupSounds:
gameData.Sounds = !gameData.Sounds; gameData.Sounds = !gameData.Sounds;
gameData.Write(); gameData.Write();
return; return;
case Def.ButtonGlygh.SetupJump: case Def.ButtonGlyph.SetupJump:
gameData.JumpRight = !gameData.JumpRight; gameData.JumpRight = !gameData.JumpRight;
gameData.Write(); gameData.Write();
return; return;
case Def.ButtonGlygh.SetupZoom: case Def.ButtonGlyph.SetupZoom:
gameData.AutoZoom = !gameData.AutoZoom; gameData.AutoZoom = !gameData.AutoZoom;
gameData.Write(); gameData.Write();
return; return;
case Def.ButtonGlygh.SetupAccel: case Def.ButtonGlyph.SetupAccel:
gameData.AccelActive = !gameData.AccelActive; gameData.AccelActive = !gameData.AccelActive;
gameData.Write(); gameData.Write();
return; return;
case Def.ButtonGlygh.SetupReset: case Def.ButtonGlyph.SetupReset:
gameData.Reset(); gameData.Reset();
gameData.Write(); gameData.Write();
return; return;
case Def.ButtonGlygh.SetupReturn: case Def.ButtonGlyph.SetupReturn:
if (playSetup) if (playSetup)
{ {
SetPhase(Def.Phase.Play, -1); SetPhase(Def.Phase.Play, -1);
@ -279,50 +278,50 @@ namespace WindowsPhoneSpeedyBlupi
SetPhase(Def.Phase.Init); SetPhase(Def.Phase.Init);
} }
return; return;
case Def.ButtonGlygh.InitPlay: case Def.ButtonGlyph.InitPlay:
SetPhase(Def.Phase.Play, 1); SetPhase(Def.Phase.Play, 1);
return; return;
case Def.ButtonGlygh.PlayPause: case Def.ButtonGlyph.PlayPause:
SetPhase(Def.Phase.Pause); SetPhase(Def.Phase.Pause);
return; return;
case Def.ButtonGlygh.WinLostReturn: case Def.ButtonGlyph.WinLostReturn:
case Def.ButtonGlygh.PauseMenu: case Def.ButtonGlyph.PauseMenu:
case Def.ButtonGlygh.ResumeMenu: case Def.ButtonGlyph.ResumeMenu:
SetPhase(Def.Phase.Init); SetPhase(Def.Phase.Init);
break; break;
} }
switch (buttonPressed) switch (buttonPressed)
{ {
case Def.ButtonGlygh.ResumeContinue: case Def.ButtonGlyph.ResumeContinue:
ContinueMission(); ContinueMission();
return; return;
case Def.ButtonGlygh.InitBuy: case Def.ButtonGlyph.InitBuy:
case Def.ButtonGlygh.TrialBuy: case Def.ButtonGlyph.TrialBuy:
Guide.Show(PlayerIndex.One); Guide.Show(PlayerIndex.One);
SetPhase(Def.Phase.Init); SetPhase(Def.Phase.Init);
return; return;
case Def.ButtonGlygh.InitRanking: case Def.ButtonGlyph.InitRanking:
SetPhase(Def.Phase.Ranking); SetPhase(Def.Phase.Ranking);
return; return;
case Def.ButtonGlygh.TrialCancel: case Def.ButtonGlyph.TrialCancel:
case Def.ButtonGlygh.RankingContinue: case Def.ButtonGlyph.RankingContinue:
SetPhase(Def.Phase.Init); SetPhase(Def.Phase.Init);
return; return;
case Def.ButtonGlygh.PauseBack: case Def.ButtonGlyph.PauseBack:
MissionBack(); MissionBack();
return; return;
case Def.ButtonGlygh.PauseRestart: case Def.ButtonGlyph.PauseRestart:
SetPhase(Def.Phase.Play, mission); SetPhase(Def.Phase.Play, mission);
return; return;
case Def.ButtonGlygh.PauseContinue: case Def.ButtonGlyph.PauseContinue:
SetPhase(Def.Phase.Play, -1); SetPhase(Def.Phase.Play, -1);
return; return;
case Def.ButtonGlygh.Cheat11: case Def.ButtonGlyph.Cheat11:
case Def.ButtonGlygh.Cheat12: case Def.ButtonGlyph.Cheat12:
case Def.ButtonGlygh.Cheat21: case Def.ButtonGlyph.Cheat21:
case Def.ButtonGlygh.Cheat22: case Def.ButtonGlyph.Cheat22:
case Def.ButtonGlygh.Cheat31: case Def.ButtonGlyph.Cheat31:
case Def.ButtonGlygh.Cheat32: case Def.ButtonGlyph.Cheat32:
if (buttonPressed == cheatGeste[cheatGesteIndex]) if (buttonPressed == cheatGeste[cheatGesteIndex])
{ {
cheatGesteIndex++; cheatGesteIndex++;
@ -344,7 +343,7 @@ namespace WindowsPhoneSpeedyBlupi
} }
break; break;
} }
if (buttonPressed >= Def.ButtonGlygh.Cheat1 && buttonPressed <= Def.ButtonGlygh.Cheat9) if (buttonPressed >= Def.ButtonGlyph.Cheat1 && buttonPressed <= Def.ButtonGlyph.Cheat9)
{ {
CheatAction(buttonPressed); CheatAction(buttonPressed);
} }
@ -380,7 +379,7 @@ namespace WindowsPhoneSpeedyBlupi
SetPhase(Def.Phase.Init); SetPhase(Def.Phase.Init);
return; return;
} }
num = ((num % 10 == 0) ? 1 : (num / 10 * 10)); num = num % 10 == 0 ? 1 : num / 10 * 10;
SetPhase(Def.Phase.Play, num); SetPhase(Def.Phase.Play, num);
} }
@ -421,35 +420,35 @@ namespace WindowsPhoneSpeedyBlupi
inputPad.StartMission(mission); inputPad.StartMission(mission);
} }
private void CheatAction(Def.ButtonGlygh glyph) private void CheatAction(Def.ButtonGlyph glyph)
{ {
switch (glyph) switch (glyph)
{ {
case Def.ButtonGlygh.Cheat1: case Def.ButtonGlyph.Cheat1:
decor.CheatAction(Tables.CheatCodes.OpenDoors); decor.CheatAction(Tables.CheatCodes.OpenDoors);
break; break;
case Def.ButtonGlygh.Cheat2: case Def.ButtonGlyph.Cheat2:
decor.CheatAction(Tables.CheatCodes.SuperBlupi); decor.CheatAction(Tables.CheatCodes.SuperBlupi);
break; break;
case Def.ButtonGlygh.Cheat3: case Def.ButtonGlyph.Cheat3:
decor.CheatAction(Tables.CheatCodes.ShowSecret); decor.CheatAction(Tables.CheatCodes.ShowSecret);
break; break;
case Def.ButtonGlygh.Cheat4: case Def.ButtonGlyph.Cheat4:
decor.CheatAction(Tables.CheatCodes.LayEgg); decor.CheatAction(Tables.CheatCodes.LayEgg);
break; break;
case Def.ButtonGlygh.Cheat5: case Def.ButtonGlyph.Cheat5:
gameData.Reset(); gameData.Reset();
break; break;
case Def.ButtonGlygh.Cheat6: case Def.ButtonGlyph.Cheat6:
simulateTrialMode = !simulateTrialMode; simulateTrialMode = !simulateTrialMode;
break; break;
case Def.ButtonGlygh.Cheat7: case Def.ButtonGlyph.Cheat7:
decor.CheatAction(Tables.CheatCodes.CleanAll); decor.CheatAction(Tables.CheatCodes.CleanAll);
break; break;
case Def.ButtonGlygh.Cheat8: case Def.ButtonGlyph.Cheat8:
decor.CheatAction(Tables.CheatCodes.AllTreasure); decor.CheatAction(Tables.CheatCodes.AllTreasure);
break; break;
case Def.ButtonGlygh.Cheat9: case Def.ButtonGlyph.Cheat9:
decor.CheatAction(Tables.CheatCodes.EndGoal); decor.CheatAction(Tables.CheatCodes.EndGoal);
break; break;
} }
@ -496,13 +495,13 @@ namespace WindowsPhoneSpeedyBlupi
{ {
if (phase == Def.Phase.Init) if (phase == Def.Phase.Init)
{ {
double num = Math.Min((double)phaseTime / 20.0, 1.0); double num = Math.Min(phaseTime / 20.0, 1.0);
TinyRect rect; TinyRect rect;
double opacity; double opacity;
if (fadeOutPhase == Def.Phase.MainSetup) if (fadeOutPhase == Def.Phase.MainSetup)
{ {
num = (1.0 - num) * (1.0 - num); num = (1.0 - num) * (1.0 - num);
TinyRect tinyRect = default(TinyRect); TinyRect tinyRect = default;
tinyRect.Left = (int)(720.0 - 640.0 * num); tinyRect.Left = (int)(720.0 - 640.0 * num);
tinyRect.Right = (int)(1360.0 - 640.0 * num); tinyRect.Right = (int)(1360.0 - 640.0 * num);
tinyRect.Top = 0; tinyRect.Top = 0;
@ -512,8 +511,8 @@ namespace WindowsPhoneSpeedyBlupi
} }
else else
{ {
num = ((fadeOutPhase != 0) ? (1.0 - num * 2.0) : (1.0 - (1.0 - num) * (1.0 - num))); num = fadeOutPhase != 0 ? 1.0 - num * 2.0 : 1.0 - (1.0 - num) * (1.0 - num);
TinyRect tinyRect2 = default(TinyRect); TinyRect tinyRect2 = default;
tinyRect2.Left = 80; tinyRect2.Left = 80;
tinyRect2.Right = 720; tinyRect2.Right = 720;
tinyRect2.Top = (int)(-160.0 + num * 160.0); tinyRect2.Top = (int)(-160.0 + num * 160.0);
@ -525,7 +524,7 @@ namespace WindowsPhoneSpeedyBlupi
} }
if (phase == Def.Phase.Init) if (phase == Def.Phase.Init)
{ {
double num = Math.Min((double)phaseTime / 20.0, 1.0); double num = Math.Min(phaseTime / 20.0, 1.0);
double opacity; double opacity;
if (fadeOutPhase == Def.Phase.MainSetup) if (fadeOutPhase == Def.Phase.MainSetup)
{ {
@ -542,7 +541,7 @@ namespace WindowsPhoneSpeedyBlupi
opacity = 1.0 - num; opacity = 1.0 - num;
num = 1.0 + num * 10.0; num = 1.0 + num * 10.0;
} }
TinyRect tinyRect3 = default(TinyRect); TinyRect tinyRect3 = default;
tinyRect3.Left = (int)(468.0 - 205.0 * num); tinyRect3.Left = (int)(468.0 - 205.0 * num);
tinyRect3.Right = (int)(468.0 + 205.0 * num); tinyRect3.Right = (int)(468.0 + 205.0 * num);
tinyRect3.Top = (int)(280.0 - 190.0 * num); tinyRect3.Top = (int)(280.0 - 190.0 * num);
@ -554,10 +553,10 @@ namespace WindowsPhoneSpeedyBlupi
{ {
if (fadeOutPhase == Def.Phase.Play) if (fadeOutPhase == Def.Phase.Play)
{ {
double num = Math.Min((double)phaseTime / 20.0, 1.0); double num = Math.Min(phaseTime / 20.0, 1.0);
double opacity = 1.0 - num; double opacity = 1.0 - num;
num = 1.0 + num * 10.0; num = 1.0 + num * 10.0;
TinyRect tinyRect4 = default(TinyRect); TinyRect tinyRect4 = default;
tinyRect4.Left = (int)(418.0 - 205.0 * num); tinyRect4.Left = (int)(418.0 - 205.0 * num);
tinyRect4.Right = (int)(418.0 + 205.0 * num); tinyRect4.Right = (int)(418.0 + 205.0 * num);
tinyRect4.Top = (int)(190.0 - 190.0 * num); tinyRect4.Top = (int)(190.0 - 190.0 * num);
@ -567,9 +566,9 @@ namespace WindowsPhoneSpeedyBlupi
} }
else if (fadeOutPhase == Def.Phase.PlaySetup) else if (fadeOutPhase == Def.Phase.PlaySetup)
{ {
double num = Math.Min((double)phaseTime / 20.0, 1.0); double num = Math.Min(phaseTime / 20.0, 1.0);
num *= num; num *= num;
TinyRect tinyRect5 = default(TinyRect); TinyRect tinyRect5 = default;
tinyRect5.Left = (int)(213.0 + 800.0 * num); tinyRect5.Left = (int)(213.0 + 800.0 * num);
tinyRect5.Right = (int)(623.0 + 800.0 * num); tinyRect5.Right = (int)(623.0 + 800.0 * num);
tinyRect5.Top = 0; tinyRect5.Top = 0;
@ -582,14 +581,14 @@ namespace WindowsPhoneSpeedyBlupi
double num; double num;
if (fadeOutPhase == Def.Phase.None) if (fadeOutPhase == Def.Phase.None)
{ {
num = Math.Min((double)phaseTime / 15.0, 1.0); num = Math.Min(phaseTime / 15.0, 1.0);
} }
else else
{ {
num = Math.Min((double)phaseTime / 15.0, 1.0); num = Math.Min(phaseTime / 15.0, 1.0);
num = 1.0 - num; num = 1.0 - num;
} }
TinyRect tinyRect6 = default(TinyRect); TinyRect tinyRect6 = default;
tinyRect6.Left = (int)(418.0 - 205.0 * num); tinyRect6.Left = (int)(418.0 - 205.0 * num);
tinyRect6.Right = (int)(418.0 + 205.0 * num); tinyRect6.Right = (int)(418.0 + 205.0 * num);
tinyRect6.Top = (int)(190.0 - 190.0 * num); tinyRect6.Top = (int)(190.0 - 190.0 * num);
@ -608,37 +607,37 @@ namespace WindowsPhoneSpeedyBlupi
} }
if (phase == Def.Phase.MainSetup || phase == Def.Phase.PlaySetup) if (phase == Def.Phase.MainSetup || phase == Def.Phase.PlaySetup)
{ {
double num = Math.Min((double)phaseTime / 20.0, 1.0); double num = Math.Min(phaseTime / 20.0, 1.0);
num = 1.0 - (1.0 - num) * (1.0 - num); num = 1.0 - (1.0 - num) * (1.0 - num);
double num2; double num2;
if (phaseTime < 20) if (phaseTime < 20)
{ {
num2 = (double)phaseTime / 20.0; num2 = phaseTime / 20.0;
num2 = 1.0 - (1.0 - num2) * (1.0 - num2); num2 = 1.0 - (1.0 - num2) * (1.0 - num2);
} }
else else
{ {
num2 = 1.0 + ((double)phaseTime - 20.0) / 400.0; num2 = 1.0 + (phaseTime - 20.0) / 400.0;
} }
if (fadeOutPhase != 0) if (fadeOutPhase != 0)
{ {
num = 1.0 - num; num = 1.0 - num;
num2 = 1.0 - num2; num2 = 1.0 - num2;
} }
TinyRect tinyRect7 = default(TinyRect); TinyRect tinyRect7 = default;
tinyRect7.Left = (int)(720.0 - 640.0 * num); tinyRect7.Left = (int)(720.0 - 640.0 * num);
tinyRect7.Right = (int)(1360.0 - 640.0 * num); tinyRect7.Right = (int)(1360.0 - 640.0 * num);
tinyRect7.Top = 0; tinyRect7.Top = 0;
tinyRect7.Bottom = 160; tinyRect7.Bottom = 160;
TinyRect rect = tinyRect7; TinyRect rect = tinyRect7;
pixmap.DrawIcon(15, 0, rect, num * num, false); pixmap.DrawIcon(15, 0, rect, num * num, false);
TinyRect tinyRect8 = default(TinyRect); TinyRect tinyRect8 = default;
tinyRect8.Left = 487; tinyRect8.Left = 487;
tinyRect8.Right = 713; tinyRect8.Right = 713;
tinyRect8.Top = 148; tinyRect8.Top = 148;
tinyRect8.Bottom = 374; tinyRect8.Bottom = 374;
TinyRect rect2 = tinyRect8; TinyRect rect2 = tinyRect8;
TinyRect tinyRect9 = default(TinyRect); TinyRect tinyRect9 = default;
tinyRect9.Left = 118; tinyRect9.Left = 118;
tinyRect9.Right = 570; tinyRect9.Right = 570;
tinyRect9.Top = 268; tinyRect9.Top = 268;
@ -651,8 +650,8 @@ namespace WindowsPhoneSpeedyBlupi
} }
if (phase == Def.Phase.Lost) if (phase == Def.Phase.Lost)
{ {
double num = Math.Min((double)phaseTime / 100.0, 1.0); double num = Math.Min(phaseTime / 100.0, 1.0);
TinyRect tinyRect10 = default(TinyRect); TinyRect tinyRect10 = default;
tinyRect10.Left = (int)(418.0 - 205.0 * num); tinyRect10.Left = (int)(418.0 - 205.0 * num);
tinyRect10.Right = (int)(418.0 + 205.0 * num); tinyRect10.Right = (int)(418.0 + 205.0 * num);
tinyRect10.Top = (int)(238.0 - 190.0 * num); tinyRect10.Top = (int)(238.0 - 190.0 * num);
@ -670,8 +669,8 @@ namespace WindowsPhoneSpeedyBlupi
} }
if (phase == Def.Phase.Win) if (phase == Def.Phase.Win)
{ {
double num = Math.Sin((double)phaseTime / 3.0) / 2.0 + 1.0; double num = Math.Sin(phaseTime / 3.0) / 2.0 + 1.0;
TinyRect tinyRect11 = default(TinyRect); TinyRect tinyRect11 = default;
tinyRect11.Left = (int)(418.0 - 205.0 * num); tinyRect11.Left = (int)(418.0 - 205.0 * num);
tinyRect11.Right = (int)(418.0 + 205.0 * num); tinyRect11.Right = (int)(418.0 + 205.0 * num);
tinyRect11.Top = (int)(238.0 - 190.0 * num); tinyRect11.Top = (int)(238.0 - 190.0 * num);
@ -688,17 +687,17 @@ namespace WindowsPhoneSpeedyBlupi
TinyRect drawBounds = pixmap.DrawBounds; TinyRect drawBounds = pixmap.DrawBounds;
int width = drawBounds.Width; int width = drawBounds.Width;
int height = drawBounds.Height; int height = drawBounds.Height;
TinyRect tinyRect = default(TinyRect); TinyRect tinyRect = default;
tinyRect.Left = 10; tinyRect.Left = 10;
tinyRect.Right = 260; tinyRect.Right = 260;
tinyRect.Top = height - 325; tinyRect.Top = height - 325;
tinyRect.Bottom = height - 10; tinyRect.Bottom = height - 10;
TinyRect rect = tinyRect; TinyRect rect = tinyRect;
pixmap.DrawIcon(14, 15, rect, 0.3, false); pixmap.DrawIcon(14, 15, rect, 0.3, false);
TinyRect tinyRect2 = default(TinyRect); TinyRect tinyRect2 = default;
tinyRect2.Left = width - 170; tinyRect2.Left = width - 170;
tinyRect2.Right = width - 10; tinyRect2.Right = width - 10;
tinyRect2.Top = height - ((IsTrialMode || IsRankingMode) ? 325 : 195); tinyRect2.Top = height - (IsTrialMode || IsRankingMode ? 325 : 195);
tinyRect2.Bottom = height - 10; tinyRect2.Bottom = height - 10;
rect = tinyRect2; rect = tinyRect2;
pixmap.DrawIcon(14, 15, rect, 0.3, false); pixmap.DrawIcon(14, 15, rect, 0.3, false);
@ -709,54 +708,54 @@ namespace WindowsPhoneSpeedyBlupi
{ {
if (phase == Def.Phase.Init) if (phase == Def.Phase.Init)
{ {
DrawButtonGamerText(Def.ButtonGlygh.InitGamerA, 0); DrawButtonGamerText(Def.ButtonGlyph.InitGamerA, 0);
DrawButtonGamerText(Def.ButtonGlygh.InitGamerB, 1); DrawButtonGamerText(Def.ButtonGlyph.InitGamerB, 1);
DrawButtonGamerText(Def.ButtonGlygh.InitGamerC, 2); DrawButtonGamerText(Def.ButtonGlyph.InitGamerC, 2);
DrawTextUnderButton(Def.ButtonGlygh.InitPlay, MyResource.TX_BUTTON_PLAY); DrawTextUnderButton(Def.ButtonGlyph.InitPlay, MyResource.TX_BUTTON_PLAY);
DrawTextRightButton(Def.ButtonGlygh.InitSetup, MyResource.TX_BUTTON_SETUP); DrawTextRightButton(Def.ButtonGlyph.InitSetup, MyResource.TX_BUTTON_SETUP);
if (IsTrialMode) if (IsTrialMode)
{ {
DrawTextUnderButton(Def.ButtonGlygh.InitBuy, MyResource.TX_BUTTON_BUY); DrawTextUnderButton(Def.ButtonGlyph.InitBuy, MyResource.TX_BUTTON_BUY);
} }
if (IsRankingMode) if (IsRankingMode)
{ {
DrawTextUnderButton(Def.ButtonGlygh.InitRanking, MyResource.TX_BUTTON_RANKING); DrawTextUnderButton(Def.ButtonGlyph.InitRanking, MyResource.TX_BUTTON_RANKING);
} }
} }
if (phase == Def.Phase.Pause) if (phase == Def.Phase.Pause)
{ {
DrawTextUnderButton(Def.ButtonGlygh.PauseMenu, MyResource.TX_BUTTON_MENU); DrawTextUnderButton(Def.ButtonGlyph.PauseMenu, MyResource.TX_BUTTON_MENU);
if (mission != 1) if (mission != 1)
{ {
DrawTextUnderButton(Def.ButtonGlygh.PauseBack, MyResource.TX_BUTTON_BACK); DrawTextUnderButton(Def.ButtonGlyph.PauseBack, MyResource.TX_BUTTON_BACK);
} }
DrawTextUnderButton(Def.ButtonGlygh.PauseSetup, MyResource.TX_BUTTON_SETUP); DrawTextUnderButton(Def.ButtonGlyph.PauseSetup, MyResource.TX_BUTTON_SETUP);
if (mission != 1 && mission % 10 != 0) if (mission != 1 && mission % 10 != 0)
{ {
DrawTextUnderButton(Def.ButtonGlygh.PauseRestart, MyResource.TX_BUTTON_RESTART); DrawTextUnderButton(Def.ButtonGlyph.PauseRestart, MyResource.TX_BUTTON_RESTART);
} }
DrawTextUnderButton(Def.ButtonGlygh.PauseContinue, MyResource.TX_BUTTON_CONTINUE); DrawTextUnderButton(Def.ButtonGlyph.PauseContinue, MyResource.TX_BUTTON_CONTINUE);
} }
if (phase == Def.Phase.Resume) if (phase == Def.Phase.Resume)
{ {
DrawTextUnderButton(Def.ButtonGlygh.ResumeMenu, MyResource.TX_BUTTON_MENU); DrawTextUnderButton(Def.ButtonGlyph.ResumeMenu, MyResource.TX_BUTTON_MENU);
DrawTextUnderButton(Def.ButtonGlygh.ResumeContinue, MyResource.TX_BUTTON_CONTINUE); DrawTextUnderButton(Def.ButtonGlyph.ResumeContinue, MyResource.TX_BUTTON_CONTINUE);
} }
if (phase == Def.Phase.MainSetup || phase == Def.Phase.PlaySetup) if (phase == Def.Phase.MainSetup || phase == Def.Phase.PlaySetup)
{ {
DrawTextRightButton(Def.ButtonGlygh.SetupSounds, MyResource.TX_BUTTON_SETUP_SOUNDS); DrawTextRightButton(Def.ButtonGlyph.SetupSounds, MyResource.TX_BUTTON_SETUP_SOUNDS);
DrawTextRightButton(Def.ButtonGlygh.SetupJump, MyResource.TX_BUTTON_SETUP_JUMP); DrawTextRightButton(Def.ButtonGlyph.SetupJump, MyResource.TX_BUTTON_SETUP_JUMP);
DrawTextRightButton(Def.ButtonGlygh.SetupZoom, MyResource.TX_BUTTON_SETUP_ZOOM); DrawTextRightButton(Def.ButtonGlyph.SetupZoom, MyResource.TX_BUTTON_SETUP_ZOOM);
DrawTextRightButton(Def.ButtonGlygh.SetupAccel, MyResource.TX_BUTTON_SETUP_ACCEL); DrawTextRightButton(Def.ButtonGlyph.SetupAccel, MyResource.TX_BUTTON_SETUP_ACCEL);
if (phase == Def.Phase.MainSetup) if (phase == Def.Phase.MainSetup)
{ {
string text = string.Format(MyResource.LoadString(MyResource.TX_BUTTON_SETUP_RESET), new string((char)(65 + gameData.SelectedGamer), 1)); string text = string.Format(MyResource.LoadString(MyResource.TX_BUTTON_SETUP_RESET), new string((char)(65 + gameData.SelectedGamer), 1));
DrawTextRightButton(Def.ButtonGlygh.SetupReset, text); DrawTextRightButton(Def.ButtonGlyph.SetupReset, text);
} }
} }
if (phase == Def.Phase.Trial) if (phase == Def.Phase.Trial)
{ {
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default;
tinyPoint.X = 360; tinyPoint.X = 360;
tinyPoint.Y = 50; tinyPoint.Y = 50;
TinyPoint pos = tinyPoint; TinyPoint pos = tinyPoint;
@ -771,41 +770,41 @@ namespace WindowsPhoneSpeedyBlupi
Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL5), 0.7); Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL5), 0.7);
pos.Y += 25; pos.Y += 25;
Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL6), 0.7); Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL6), 0.7);
DrawTextUnderButton(Def.ButtonGlygh.TrialBuy, MyResource.TX_BUTTON_BUY); DrawTextUnderButton(Def.ButtonGlyph.TrialBuy, MyResource.TX_BUTTON_BUY);
DrawTextUnderButton(Def.ButtonGlygh.TrialCancel, MyResource.TX_BUTTON_BACK); DrawTextUnderButton(Def.ButtonGlyph.TrialCancel, MyResource.TX_BUTTON_BACK);
} }
if (phase == Def.Phase.Ranking) if (phase == Def.Phase.Ranking)
{ {
DrawTextUnderButton(Def.ButtonGlygh.RankingContinue, MyResource.TX_BUTTON_BACK); DrawTextUnderButton(Def.ButtonGlyph.RankingContinue, MyResource.TX_BUTTON_BACK);
} }
} }
private void DrawButtonGamerText(Def.ButtonGlygh glyph, int gamer) private void DrawButtonGamerText(Def.ButtonGlyph glyph, int gamer)
{ {
TinyRect buttonRect = inputPad.GetButtonRect(glyph); TinyRect buttonRect = inputPad.GetButtonRect(glyph);
int nbVies; int nbVies;
int mainDoors; int mainDoors;
int secondaryDoors; int secondaryDoors;
gameData.GetGamerInfo(gamer, out nbVies, out mainDoors, out secondaryDoors); gameData.GetGamerInfo(gamer, out nbVies, out mainDoors, out secondaryDoors);
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default;
tinyPoint.X = buttonRect.Right + 5 - pixmap.Origin.X; tinyPoint.X = buttonRect.Right + 5 - pixmap.Origin.X;
tinyPoint.Y = buttonRect.Top + 3 - pixmap.Origin.Y; tinyPoint.Y = buttonRect.Top + 3 - pixmap.Origin.Y;
TinyPoint pos = tinyPoint; TinyPoint pos = tinyPoint;
string text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_TITLE), new string((char)(65 + gamer), 1)); string text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_TITLE), new string((char)(65 + gamer), 1));
Text.DrawText(pixmap, pos, text, 0.7); Text.DrawText(pixmap, pos, text, 0.7);
TinyPoint tinyPoint2 = default(TinyPoint); TinyPoint tinyPoint2 = default;
tinyPoint2.X = buttonRect.Right + 5 - pixmap.Origin.X; tinyPoint2.X = buttonRect.Right + 5 - pixmap.Origin.X;
tinyPoint2.Y = buttonRect.Top + 25 - pixmap.Origin.Y; tinyPoint2.Y = buttonRect.Top + 25 - pixmap.Origin.Y;
pos = tinyPoint2; pos = tinyPoint2;
text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_MDOORS), mainDoors); text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_MDOORS), mainDoors);
Text.DrawText(pixmap, pos, text, 0.45); Text.DrawText(pixmap, pos, text, 0.45);
TinyPoint tinyPoint3 = default(TinyPoint); TinyPoint tinyPoint3 = default;
tinyPoint3.X = buttonRect.Right + 5 - pixmap.Origin.X; tinyPoint3.X = buttonRect.Right + 5 - pixmap.Origin.X;
tinyPoint3.Y = buttonRect.Top + 39 - pixmap.Origin.Y; tinyPoint3.Y = buttonRect.Top + 39 - pixmap.Origin.Y;
pos = tinyPoint3; pos = tinyPoint3;
text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_SDOORS), secondaryDoors); text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_SDOORS), secondaryDoors);
Text.DrawText(pixmap, pos, text, 0.45); Text.DrawText(pixmap, pos, text, 0.45);
TinyPoint tinyPoint4 = default(TinyPoint); TinyPoint tinyPoint4 = default;
tinyPoint4.X = buttonRect.Right + 5 - pixmap.Origin.X; tinyPoint4.X = buttonRect.Right + 5 - pixmap.Origin.X;
tinyPoint4.Y = buttonRect.Top + 53 - pixmap.Origin.Y; tinyPoint4.Y = buttonRect.Top + 53 - pixmap.Origin.Y;
pos = tinyPoint4; pos = tinyPoint4;
@ -813,18 +812,18 @@ namespace WindowsPhoneSpeedyBlupi
Text.DrawText(pixmap, pos, text, 0.45); Text.DrawText(pixmap, pos, text, 0.45);
} }
private void DrawTextRightButton(Def.ButtonGlygh glyph, int res) private void DrawTextRightButton(Def.ButtonGlyph glyph, int res)
{ {
DrawTextRightButton(glyph, MyResource.LoadString(res)); DrawTextRightButton(glyph, MyResource.LoadString(res));
} }
private void DrawTextRightButton(Def.ButtonGlygh glyph, string text) private void DrawTextRightButton(Def.ButtonGlyph glyph, string text)
{ {
TinyRect buttonRect = inputPad.GetButtonRect(glyph); TinyRect buttonRect = inputPad.GetButtonRect(glyph);
string[] array = text.Split('\n'); string[] array = text.Split('\n');
if (array.Length == 2) if (array.Length == 2)
{ {
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default;
tinyPoint.X = buttonRect.Right + 10 - pixmap.Origin.X; tinyPoint.X = buttonRect.Right + 10 - pixmap.Origin.X;
tinyPoint.Y = (buttonRect.Top + buttonRect.Bottom) / 2 - 20 - pixmap.Origin.Y; tinyPoint.Y = (buttonRect.Top + buttonRect.Bottom) / 2 - 20 - pixmap.Origin.Y;
TinyPoint pos = tinyPoint; TinyPoint pos = tinyPoint;
@ -834,7 +833,7 @@ namespace WindowsPhoneSpeedyBlupi
} }
else else
{ {
TinyPoint tinyPoint2 = default(TinyPoint); TinyPoint tinyPoint2 = default;
tinyPoint2.X = buttonRect.Right + 10 - pixmap.Origin.X; tinyPoint2.X = buttonRect.Right + 10 - pixmap.Origin.X;
tinyPoint2.Y = (buttonRect.Top + buttonRect.Bottom) / 2 - 8 - pixmap.Origin.Y; tinyPoint2.Y = (buttonRect.Top + buttonRect.Bottom) / 2 - 8 - pixmap.Origin.Y;
TinyPoint pos2 = tinyPoint2; TinyPoint pos2 = tinyPoint2;
@ -842,10 +841,10 @@ namespace WindowsPhoneSpeedyBlupi
} }
} }
private void DrawTextUnderButton(Def.ButtonGlygh glyph, int res) private void DrawTextUnderButton(Def.ButtonGlyph glyph, int res)
{ {
TinyRect buttonRect = inputPad.GetButtonRect(glyph); TinyRect buttonRect = inputPad.GetButtonRect(glyph);
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default;
tinyPoint.X = (buttonRect.Left + buttonRect.Right) / 2 - pixmap.Origin.X; tinyPoint.X = (buttonRect.Left + buttonRect.Right) / 2 - pixmap.Origin.X;
tinyPoint.Y = buttonRect.Bottom + 2 - pixmap.Origin.Y; tinyPoint.Y = buttonRect.Bottom + 2 - pixmap.Origin.Y;
TinyPoint pos = tinyPoint; TinyPoint pos = tinyPoint;
@ -872,7 +871,7 @@ namespace WindowsPhoneSpeedyBlupi
private void DrawDebug() private void DrawDebug()
{ {
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default;
tinyPoint.X = 10; tinyPoint.X = 10;
tinyPoint.Y = 20; tinyPoint.Y = 20;
TinyPoint pos = tinyPoint; TinyPoint pos = tinyPoint;
@ -972,9 +971,9 @@ namespace WindowsPhoneSpeedyBlupi
public void ToggleFullScreen() public void ToggleFullScreen()
{ {
this.graphics.ToggleFullScreen(); graphics.ToggleFullScreen();
} }
public bool IsFullScreen() { return this.graphics.IsFullScreen; } public bool IsFullScreen() { return graphics.IsFullScreen; }
public GraphicsDeviceManager getGraphics() public GraphicsDeviceManager getGraphics()
{ {

View File

@ -1,7 +1,6 @@
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
// WindowsPhoneSpeedyBlupi.GameData // WindowsPhoneSpeedyBlupi.GameData
using System; using System;
using WindowsPhoneSpeedyBlupi;
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
{ {
@ -84,7 +83,7 @@ namespace WindowsPhoneSpeedyBlupi
{ {
get get
{ {
return (double)(int)data[7] / 100.0; return data[7] / 100.0;
} }
set set
{ {

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,6 @@
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
// WindowsPhoneSpeedyBlupi.Jauge // WindowsPhoneSpeedyBlupi.Jauge
using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Media;
using WindowsPhoneSpeedyBlupi;
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
{ {
@ -65,7 +64,7 @@ namespace WindowsPhoneSpeedyBlupi
public void Draw() public void Draw()
{ {
TinyRect rect = default(TinyRect); TinyRect rect = default;
if (m_bMinimizeRedraw && !m_bRedraw) if (m_bMinimizeRedraw && !m_bRedraw)
{ {
return; return;

View File

@ -3,7 +3,6 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using WindowsPhoneSpeedyBlupi;
using static WindowsPhoneSpeedyBlupi.Def; using static WindowsPhoneSpeedyBlupi.Def;
@ -13,7 +12,7 @@ namespace WindowsPhoneSpeedyBlupi
{ {
public static Rectangle RotateAdjust(Rectangle rect, double angle) public static Rectangle RotateAdjust(Rectangle rect, double angle)
{ {
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default;
tinyPoint.X = rect.Width / 2; tinyPoint.X = rect.Width / 2;
tinyPoint.Y = rect.Height / 2; tinyPoint.Y = rect.Height / 2;
TinyPoint p = tinyPoint; TinyPoint p = tinyPoint;
@ -25,19 +24,19 @@ namespace WindowsPhoneSpeedyBlupi
public static TinyPoint RotatePointRad(double angle, TinyPoint p) public static TinyPoint RotatePointRad(double angle, TinyPoint p)
{ {
return RotatePointRad(default(TinyPoint), angle, p); return RotatePointRad(default, angle, p);
} }
public static TinyPoint RotatePointRad(TinyPoint center, double angle, TinyPoint p) public static TinyPoint RotatePointRad(TinyPoint center, double angle, TinyPoint p)
{ {
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default;
TinyPoint result = default(TinyPoint); TinyPoint result = default;
tinyPoint.X = p.X - center.X; tinyPoint.X = p.X - center.X;
tinyPoint.Y = p.Y - center.Y; tinyPoint.Y = p.Y - center.Y;
double num = Math.Sin(angle); double num = Math.Sin(angle);
double num2 = Math.Cos(angle); double num2 = Math.Cos(angle);
result.X = (int)((double)tinyPoint.X * num2 - (double)tinyPoint.Y * num); result.X = (int)(tinyPoint.X * num2 - tinyPoint.Y * num);
result.Y = (int)((double)tinyPoint.X * num + (double)tinyPoint.Y * num2); result.Y = (int)(tinyPoint.X * num + tinyPoint.Y * num2);
result.X += center.X; result.X += center.X;
result.Y += center.Y; result.Y += center.Y;
return result; return result;
@ -65,18 +64,18 @@ namespace WindowsPhoneSpeedyBlupi
{ {
if (speed > 0.0) if (speed > 0.0)
{ {
return Math.Max((int)(speed * (double)max), 1); return Math.Max((int)(speed * max), 1);
} }
if (speed < 0.0) if (speed < 0.0)
{ {
return Math.Min((int)(speed * (double)max), -1); return Math.Min((int)(speed * max), -1);
} }
return 0; return 0;
} }
public static TinyRect Inflate(TinyRect rect, int value) public static TinyRect Inflate(TinyRect rect, int value)
{ {
TinyRect result = default(TinyRect); TinyRect result = default;
result.Left = rect.Left - value; result.Left = rect.Left - value;
result.Right = rect.Right + value; result.Right = rect.Right + value;
result.Top = rect.Top - value; result.Top = rect.Top - value;
@ -95,7 +94,7 @@ namespace WindowsPhoneSpeedyBlupi
public static bool IntersectRect(out TinyRect dst, TinyRect src1, TinyRect src2) public static bool IntersectRect(out TinyRect dst, TinyRect src1, TinyRect src2)
{ {
dst = default(TinyRect); dst = default;
dst.Left = Math.Max(src1.Left, src2.Left); dst.Left = Math.Max(src1.Left, src2.Left);
dst.Right = Math.Min(src1.Right, src2.Right); dst.Right = Math.Min(src1.Right, src2.Right);
dst.Top = Math.Max(src1.Top, src2.Top); dst.Top = Math.Max(src1.Top, src2.Top);
@ -105,7 +104,7 @@ namespace WindowsPhoneSpeedyBlupi
public static bool UnionRect(out TinyRect dst, TinyRect src1, TinyRect src2) public static bool UnionRect(out TinyRect dst, TinyRect src1, TinyRect src2)
{ {
dst = default(TinyRect); dst = default;
dst.Left = Math.Min(src1.Left, src2.Left); dst.Left = Math.Min(src1.Left, src2.Left);
dst.Right = Math.Max(src1.Right, src2.Right); dst.Right = Math.Max(src1.Right, src2.Right);
dst.Top = Math.Min(src1.Top, src2.Top); dst.Top = Math.Min(src1.Top, src2.Top);

View File

@ -4,7 +4,6 @@ using System;
using System.Diagnostics; using System.Diagnostics;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using WindowsPhoneSpeedyBlupi;
using static System.Net.Mime.MediaTypeNames; using static System.Net.Mime.MediaTypeNames;
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
@ -63,10 +62,11 @@ namespace WindowsPhoneSpeedyBlupi
{ {
get get
{ {
TinyRect result = default(TinyRect); TinyRect result = default;
double screenWidth = graphics.GraphicsDevice.Viewport.Width; double screenWidth = graphics.GraphicsDevice.Viewport.Width;
double screenHeight = graphics.GraphicsDevice.Viewport.Height; double screenHeight = graphics.GraphicsDevice.Viewport.Height;
if(Def.PLATFORM == Def.Platform.Android && screenHeight > 480) { if (Def.PLATFORM == Def.Platform.Android && screenHeight > 480)
{
screenWidth = screenHeight * (640f / 480f); screenWidth = screenHeight * (640f / 480f);
} }
if (screenWidth != 0.0 && screenHeight != 0.0) if (screenWidth != 0.0 && screenHeight != 0.0)
@ -96,7 +96,7 @@ namespace WindowsPhoneSpeedyBlupi
{ {
get get
{ {
TinyPoint result = default(TinyPoint); TinyPoint result = default;
result.X = (int)originX; result.X = (int)originX;
result.Y = (int)originY; result.Y = (int)originY;
return result; return result;
@ -113,9 +113,9 @@ namespace WindowsPhoneSpeedyBlupi
public TinyPoint HotSpotToHud(TinyPoint pos) public TinyPoint HotSpotToHud(TinyPoint pos)
{ {
TinyPoint result = default(TinyPoint); TinyPoint result = default;
result.X = (int)((double)(pos.X - (int)hotSpotX) / hotSpotZoom) + (int)hotSpotX - (int)originX; result.X = (int)((pos.X - (int)hotSpotX) / hotSpotZoom) + (int)hotSpotX - (int)originX;
result.Y = (int)((double)(pos.Y - (int)hotSpotY) / hotSpotZoom) + (int)hotSpotY - (int)originY; result.Y = (int)((pos.Y - (int)hotSpotY) / hotSpotZoom) + (int)hotSpotY - (int)originY;
return result; return result;
} }
@ -126,102 +126,102 @@ namespace WindowsPhoneSpeedyBlupi
hotSpotY = y; hotSpotY = y;
} }
public void DrawInputButton(TinyRect rect, Def.ButtonGlygh glyph, bool pressed, bool selected) public void DrawInputButton(TinyRect rect, Def.ButtonGlyph glyph, bool pressed, bool selected)
{ {
switch (glyph) switch (glyph)
{ {
case Def.ButtonGlygh.InitGamerA: case Def.ButtonGlyph.InitGamerA:
DrawIcon(14, selected ? 16 : 4, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, selected ? 16 : 4, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.InitGamerB: case Def.ButtonGlyph.InitGamerB:
DrawIcon(14, selected ? 17 : 5, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, selected ? 17 : 5, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.InitGamerC: case Def.ButtonGlyph.InitGamerC:
DrawIcon(14, selected ? 18 : 6, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, selected ? 18 : 6, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.InitSetup: case Def.ButtonGlyph.InitSetup:
case Def.ButtonGlygh.PauseSetup: case Def.ButtonGlyph.PauseSetup:
DrawIcon(14, 19, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 19, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.InitPlay: case Def.ButtonGlyph.InitPlay:
DrawIcon(14, 7, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 7, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.PauseMenu: case Def.ButtonGlyph.PauseMenu:
case Def.ButtonGlygh.ResumeMenu: case Def.ButtonGlyph.ResumeMenu:
DrawIcon(14, 11, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 11, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.PauseBack: case Def.ButtonGlyph.PauseBack:
DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.PauseRestart: case Def.ButtonGlyph.PauseRestart:
DrawIcon(14, 9, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 9, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.PauseContinue: case Def.ButtonGlyph.PauseContinue:
case Def.ButtonGlygh.ResumeContinue: case Def.ButtonGlyph.ResumeContinue:
DrawIcon(14, 10, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 10, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.WinLostReturn: case Def.ButtonGlyph.WinLostReturn:
DrawIcon(14, 3, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 3, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.InitBuy: case Def.ButtonGlyph.InitBuy:
case Def.ButtonGlygh.TrialBuy: case Def.ButtonGlyph.TrialBuy:
DrawIcon(14, 22, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 22, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.InitRanking: case Def.ButtonGlyph.InitRanking:
DrawIcon(14, 12, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 12, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.TrialCancel: case Def.ButtonGlyph.TrialCancel:
case Def.ButtonGlygh.RankingContinue: case Def.ButtonGlyph.RankingContinue:
DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.SetupSounds: case Def.ButtonGlyph.SetupSounds:
case Def.ButtonGlygh.SetupJump: case Def.ButtonGlyph.SetupJump:
case Def.ButtonGlygh.SetupZoom: case Def.ButtonGlyph.SetupZoom:
case Def.ButtonGlygh.SetupAccel: case Def.ButtonGlyph.SetupAccel:
DrawIcon(14, selected ? 13 : 21, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, selected ? 13 : 21, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.SetupReset: case Def.ButtonGlyph.SetupReset:
DrawIcon(14, 20, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 20, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.SetupReturn: case Def.ButtonGlyph.SetupReturn:
DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false); DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false);
break; break;
case Def.ButtonGlygh.PlayJump: case Def.ButtonGlyph.PlayJump:
DrawIcon(14, 2, rect, pressed ? 0.6 : 1.0, false); DrawIcon(14, 2, rect, pressed ? 0.6 : 1.0, false);
break; break;
case Def.ButtonGlygh.PlayAction: case Def.ButtonGlyph.PlayAction:
DrawIcon(14, 12, rect, pressed ? 0.6 : 1.0, false); DrawIcon(14, 12, rect, pressed ? 0.6 : 1.0, false);
break; break;
case Def.ButtonGlygh.PlayDown: case Def.ButtonGlyph.PlayDown:
DrawIcon(14, 23, rect, pressed ? 0.6 : 1.0, false); DrawIcon(14, 23, rect, pressed ? 0.6 : 1.0, false);
break; break;
case Def.ButtonGlygh.PlayPause: case Def.ButtonGlyph.PlayPause:
DrawIcon(14, 3, rect, pressed ? 0.6 : 1.0, false); DrawIcon(14, 3, rect, pressed ? 0.6 : 1.0, false);
break; break;
case Def.ButtonGlygh.Cheat1: case Def.ButtonGlyph.Cheat1:
case Def.ButtonGlygh.Cheat2: case Def.ButtonGlyph.Cheat2:
case Def.ButtonGlygh.Cheat3: case Def.ButtonGlyph.Cheat3:
case Def.ButtonGlygh.Cheat4: case Def.ButtonGlyph.Cheat4:
case Def.ButtonGlygh.Cheat5: case Def.ButtonGlyph.Cheat5:
case Def.ButtonGlygh.Cheat6: case Def.ButtonGlyph.Cheat6:
case Def.ButtonGlygh.Cheat7: case Def.ButtonGlyph.Cheat7:
case Def.ButtonGlygh.Cheat8: case Def.ButtonGlyph.Cheat8:
case Def.ButtonGlygh.Cheat9: case Def.ButtonGlyph.Cheat9:
{ {
DrawIcon(14, 0, rect, pressed ? 0.6 : 1.0, false); DrawIcon(14, 0, rect, pressed ? 0.6 : 1.0, false);
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default;
tinyPoint.X = rect.Left + rect.Width / 2 - (int)originX; tinyPoint.X = rect.Left + rect.Width / 2 - (int)originX;
tinyPoint.Y = rect.Top + 28; tinyPoint.Y = rect.Top + 28;
TinyPoint pos = tinyPoint; TinyPoint pos = tinyPoint;
Text.DrawTextCenter(this, pos, Decor.GetCheatTinyText(glyph), 1.0); Text.DrawTextCenter(this, pos, Decor.GetCheatTinyText(glyph), 1.0);
break; break;
} }
case Def.ButtonGlygh.Cheat11: case Def.ButtonGlyph.Cheat11:
case Def.ButtonGlygh.Cheat12: case Def.ButtonGlyph.Cheat12:
case Def.ButtonGlygh.Cheat21: case Def.ButtonGlyph.Cheat21:
case Def.ButtonGlygh.Cheat22: case Def.ButtonGlyph.Cheat22:
case Def.ButtonGlygh.Cheat31: case Def.ButtonGlyph.Cheat31:
case Def.ButtonGlygh.Cheat32: case Def.ButtonGlyph.Cheat32:
break; break;
} }
} }
@ -289,11 +289,11 @@ namespace WindowsPhoneSpeedyBlupi
spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
spriteBatch.Draw(bitmap, destinationRectangle, srcRectangle, Color.White); spriteBatch.Draw(bitmap, destinationRectangle, srcRectangle, Color.White);
spriteBatch.End(); spriteBatch.End();
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default;
tinyPoint.X = (int)originX; tinyPoint.X = (int)originX;
tinyPoint.Y = (int)originY; tinyPoint.Y = (int)originY;
TinyPoint dest = tinyPoint; TinyPoint dest = tinyPoint;
TinyRect tinyRect = default(TinyRect); TinyRect tinyRect = default;
tinyRect.Left = 0; tinyRect.Left = 0;
tinyRect.Top = 0; tinyRect.Top = 0;
tinyRect.Right = 640; tinyRect.Right = 640;
@ -304,9 +304,9 @@ namespace WindowsPhoneSpeedyBlupi
public void DrawChar(int rank, TinyPoint pos, double size) public void DrawChar(int rank, TinyPoint pos, double size)
{ {
pos.X = (int)((double)pos.X + originX); pos.X = (int)(pos.X + originX);
pos.Y = (int)((double)pos.Y + originY); pos.Y = (int)(pos.Y + originY);
TinyRect tinyRect = default(TinyRect); TinyRect tinyRect = default;
tinyRect.Left = pos.X; tinyRect.Left = pos.X;
tinyRect.Top = pos.Y; tinyRect.Top = pos.Y;
tinyRect.Right = pos.X + (int)(32.0 * size); tinyRect.Right = pos.X + (int)(32.0 * size);
@ -317,9 +317,9 @@ namespace WindowsPhoneSpeedyBlupi
public void HudIcon(int channel, int rank, TinyPoint pos) public void HudIcon(int channel, int rank, TinyPoint pos)
{ {
pos.X = (int)((double)pos.X + originX); pos.X = (int)(pos.X + originX);
pos.Y = (int)((double)pos.Y + originY); pos.Y = (int)(pos.Y + originY);
TinyRect tinyRect = default(TinyRect); TinyRect tinyRect = default;
tinyRect.Left = pos.X; tinyRect.Left = pos.X;
tinyRect.Top = pos.Y; tinyRect.Top = pos.Y;
tinyRect.Right = pos.X; tinyRect.Right = pos.X;
@ -330,7 +330,7 @@ namespace WindowsPhoneSpeedyBlupi
public void QuickIcon(int channel, int rank, TinyPoint pos) public void QuickIcon(int channel, int rank, TinyPoint pos)
{ {
TinyRect tinyRect = default(TinyRect); TinyRect tinyRect = default;
tinyRect.Left = pos.X; tinyRect.Left = pos.X;
tinyRect.Top = pos.Y; tinyRect.Top = pos.Y;
tinyRect.Right = pos.X; tinyRect.Right = pos.X;
@ -341,7 +341,7 @@ namespace WindowsPhoneSpeedyBlupi
public void QuickIcon(int channel, int rank, TinyPoint pos, double opacity, double rotation) public void QuickIcon(int channel, int rank, TinyPoint pos, double opacity, double rotation)
{ {
TinyRect tinyRect = default(TinyRect); TinyRect tinyRect = default;
tinyRect.Left = pos.X; tinyRect.Left = pos.X;
tinyRect.Top = pos.Y; tinyRect.Top = pos.Y;
tinyRect.Right = pos.X; tinyRect.Right = pos.X;
@ -364,11 +364,11 @@ namespace WindowsPhoneSpeedyBlupi
} }
if (channel == 5) if (channel == 5)
{ {
dest.X = (int)((double)dest.X + originX); dest.X = (int)(dest.X + originX);
dest.Y = (int)((double)dest.Y + originY); dest.Y = (int)(dest.Y + originY);
} }
Rectangle value = new Rectangle(rect.Left, rect.Top, rect.Width, rect.Height); Rectangle value = new Rectangle(rect.Left, rect.Top, rect.Width, rect.Height);
Rectangle destinationRectangle = new Rectangle(dest.X, dest.Y, (int)((double)rect.Width * zoom), (int)((double)rect.Height * zoom)); Rectangle destinationRectangle = new Rectangle(dest.X, dest.Y, (int)(rect.Width * zoom), (int)(rect.Height * zoom));
spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
spriteBatch.Draw(bitmap, destinationRectangle, value, Color.White); spriteBatch.Draw(bitmap, destinationRectangle, value, Color.White);
spriteBatch.End(); spriteBatch.End();
@ -508,22 +508,22 @@ namespace WindowsPhoneSpeedyBlupi
private Rectangle GetDstRectangle(TinyRect rect, int iconWidth, int iconHeight, bool useHotSpot) private Rectangle GetDstRectangle(TinyRect rect, int iconWidth, int iconHeight, bool useHotSpot)
{ {
int num = ((rect.Width == 0) ? iconWidth : rect.Width); int num = rect.Width == 0 ? iconWidth : rect.Width;
int num2 = ((rect.Height == 0) ? iconHeight : rect.Height); int num2 = rect.Height == 0 ? iconHeight : rect.Height;
int num3 = (int)((double)rect.Left * zoom); int num3 = (int)(rect.Left * zoom);
int num4 = (int)((double)rect.Top * zoom); int num4 = (int)(rect.Top * zoom);
int num5 = (int)((double)num3 + (double)num * zoom); int num5 = (int)(num3 + num * zoom);
int num6 = (int)((double)num4 + (double)num2 * zoom); int num6 = (int)(num4 + num2 * zoom);
if (useHotSpot && hotSpotZoom > 1.0) if (useHotSpot && hotSpotZoom > 1.0)
{ {
num3 -= (int)hotSpotX; num3 -= (int)hotSpotX;
num4 -= (int)hotSpotY; num4 -= (int)hotSpotY;
num5 -= (int)hotSpotX; num5 -= (int)hotSpotX;
num6 -= (int)hotSpotY; num6 -= (int)hotSpotY;
num3 = (int)((double)num3 * hotSpotZoom); num3 = (int)(num3 * hotSpotZoom);
num4 = (int)((double)num4 * hotSpotZoom); num4 = (int)(num4 * hotSpotZoom);
num5 = (int)((double)num5 * hotSpotZoom); num5 = (int)(num5 * hotSpotZoom);
num6 = (int)((double)num6 * hotSpotZoom); num6 = (int)(num6 * hotSpotZoom);
num3 += (int)hotSpotX; num3 += (int)hotSpotX;
num4 += (int)hotSpotY; num4 += (int)hotSpotY;
num5 += (int)hotSpotX; num5 += (int)hotSpotX;

View File

@ -6,7 +6,6 @@ using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.Resources; using System.Resources;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using WindowsPhoneSpeedyBlupi;
//[DebuggerNonUserCode] //[DebuggerNonUserCode]
//[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] //[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
@ -25,7 +24,7 @@ namespace WindowsPhoneSpeedyBlupi
{ {
get get
{ {
if (object.ReferenceEquals(resourceMan, null)) if (ReferenceEquals(resourceMan, null))
{ {
ResourceManager resourceManager = new ResourceManager("WindowsPhoneSpeedyBlupi.Resource", typeof(Resource).Assembly); ResourceManager resourceManager = new ResourceManager("WindowsPhoneSpeedyBlupi.Resource", typeof(Resource).Assembly);
resourceMan = resourceManager; resourceMan = resourceManager;

View File

@ -1,7 +1,6 @@
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
// WindowsPhoneSpeedyBlupi.Slider // WindowsPhoneSpeedyBlupi.Slider
using System; using System;
using WindowsPhoneSpeedyBlupi;
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
{ {
@ -29,35 +28,35 @@ namespace WindowsPhoneSpeedyBlupi
public void Draw(Pixmap pixmap) public void Draw(Pixmap pixmap)
{ {
TinyPoint tinyPoint = default(TinyPoint); TinyPoint tinyPoint = default;
tinyPoint.X = TopLeftCorner.X - pixmap.Origin.X; tinyPoint.X = TopLeftCorner.X - pixmap.Origin.X;
tinyPoint.Y = TopLeftCorner.Y - pixmap.Origin.Y; tinyPoint.Y = TopLeftCorner.Y - pixmap.Origin.Y;
TinyPoint dest = tinyPoint; TinyPoint dest = tinyPoint;
TinyRect tinyRect = default(TinyRect); TinyRect tinyRect = default;
tinyRect.Left = 0; tinyRect.Left = 0;
tinyRect.Right = 124; tinyRect.Right = 124;
tinyRect.Top = 0; tinyRect.Top = 0;
tinyRect.Bottom = 22; tinyRect.Bottom = 22;
TinyRect rect = tinyRect; TinyRect rect = tinyRect;
pixmap.DrawPart(5, dest, rect, 2.0); pixmap.DrawPart(5, dest, rect, 2.0);
int num = (int)((double)(PosRight - PosLeft) * Value); int num = (int)((PosRight - PosLeft) * Value);
int num2 = TopLeftCorner.Y + 22; int num2 = TopLeftCorner.Y + 22;
int num3 = 94; int num3 = 94;
TinyRect tinyRect2 = default(TinyRect); TinyRect tinyRect2 = default;
tinyRect2.Left = PosLeft + num - num3 / 2; tinyRect2.Left = PosLeft + num - num3 / 2;
tinyRect2.Right = PosLeft + num + num3 / 2; tinyRect2.Right = PosLeft + num + num3 / 2;
tinyRect2.Top = num2 - num3 / 2; tinyRect2.Top = num2 - num3 / 2;
tinyRect2.Bottom = num2 + num3 / 2; tinyRect2.Bottom = num2 + num3 / 2;
rect = tinyRect2; rect = tinyRect2;
pixmap.DrawIcon(14, 1, rect, 1.0, false); pixmap.DrawIcon(14, 1, rect, 1.0, false);
TinyRect tinyRect3 = default(TinyRect); TinyRect tinyRect3 = default;
tinyRect3.Left = TopLeftCorner.X - 65; tinyRect3.Left = TopLeftCorner.X - 65;
tinyRect3.Right = TopLeftCorner.X - 65 + 60; tinyRect3.Right = TopLeftCorner.X - 65 + 60;
tinyRect3.Top = TopLeftCorner.Y - 10; tinyRect3.Top = TopLeftCorner.Y - 10;
tinyRect3.Bottom = TopLeftCorner.Y - 10 + 60; tinyRect3.Bottom = TopLeftCorner.Y - 10 + 60;
rect = tinyRect3; rect = tinyRect3;
pixmap.DrawIcon(10, 37, rect, 1.0, false); pixmap.DrawIcon(10, 37, rect, 1.0, false);
TinyRect tinyRect4 = default(TinyRect); TinyRect tinyRect4 = default;
tinyRect4.Left = TopLeftCorner.X + 248 + 5; tinyRect4.Left = TopLeftCorner.X + 248 + 5;
tinyRect4.Right = TopLeftCorner.X + 248 + 5 + 60; tinyRect4.Right = TopLeftCorner.X + 248 + 5 + 60;
tinyRect4.Top = TopLeftCorner.Y - 10; tinyRect4.Top = TopLeftCorner.Y - 10;
@ -68,7 +67,7 @@ namespace WindowsPhoneSpeedyBlupi
public bool Move(TinyPoint pos) public bool Move(TinyPoint pos)
{ {
TinyRect tinyRect = default(TinyRect); TinyRect tinyRect = default;
tinyRect.Left = TopLeftCorner.X - 50; tinyRect.Left = TopLeftCorner.X - 50;
tinyRect.Right = TopLeftCorner.X + 248 + 50; tinyRect.Right = TopLeftCorner.X + 248 + 50;
tinyRect.Top = TopLeftCorner.Y - 50; tinyRect.Top = TopLeftCorner.Y - 50;
@ -76,7 +75,7 @@ namespace WindowsPhoneSpeedyBlupi
TinyRect rect = tinyRect; TinyRect rect = tinyRect;
if (Misc.IsInside(rect, pos)) if (Misc.IsInside(rect, pos))
{ {
double val = ((double)pos.X - (double)PosLeft) / (double)(PosRight - PosLeft); double val = (pos.X - (double)PosLeft) / (PosRight - PosLeft);
val = Math.Max(val, 0.0); val = Math.Max(val, 0.0);
val = Math.Min(val, 1.0); val = Math.Min(val, 1.0);
if (Value != val) if (Value != val)

View File

@ -4,7 +4,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Audio;
using WindowsPhoneSpeedyBlupi;
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
{ {
@ -134,12 +133,12 @@ namespace WindowsPhoneSpeedyBlupi
public void SetAudioVolume(int volume) public void SetAudioVolume(int volume)
{ {
this.volume = (double)volume / (double)MAXVOLUME; this.volume = volume / (double)MAXVOLUME;
} }
public int GetAudioVolume() public int GetAudioVolume()
{ {
return (int)(volume * (double)MAXVOLUME); return (int)(volume * MAXVOLUME);
} }
public void SetMidiVolume(int volume) public void SetMidiVolume(int volume)
@ -173,7 +172,7 @@ namespace WindowsPhoneSpeedyBlupi
} }
if (channel >= 0 && channel < soundEffects.Count) if (channel >= 0 && channel < soundEffects.Count)
{ {
if (channel != 10 && plays.Where((Play x) => x.Channel == channel && !x.IsFree).Any()) if (channel != 10 && plays.Where((x) => x.Channel == channel && !x.IsFree).Any())
{ {
return true; return true;
} }
@ -226,24 +225,24 @@ namespace WindowsPhoneSpeedyBlupi
double val = 1.0; double val = 1.0;
if (pos.X < 0) if (pos.X < 0)
{ {
val = 1.0 + (double)(pos.X / 640) * 2.0; val = 1.0 + pos.X / 640 * 2.0;
} }
if (pos.X > 640) if (pos.X > 640)
{ {
pos.X -= 640; pos.X -= 640;
val = 1.0 - (double)(pos.X / 640) * 2.0; val = 1.0 - pos.X / 640 * 2.0;
} }
val = Math.Max(val, 0.0); val = Math.Max(val, 0.0);
val = Math.Min(val, 1.0); val = Math.Min(val, 1.0);
double val2 = 1.0; double val2 = 1.0;
if (pos.Y < 0) if (pos.Y < 0)
{ {
val2 = 1.0 + (double)(pos.Y / 480) * 3.0; val2 = 1.0 + pos.Y / 480 * 3.0;
} }
if (pos.Y > 480) if (pos.Y > 480)
{ {
pos.Y -= 480; pos.Y -= 480;
val2 = 1.0 - (double)(pos.Y / 480) * 3.0; val2 = 1.0 - pos.Y / 480 * 3.0;
} }
val2 = Math.Max(val2, 0.0); val2 = Math.Max(val2, 0.0);
val2 = Math.Min(val2, 1.0); val2 = Math.Min(val2, 1.0);
@ -252,7 +251,7 @@ namespace WindowsPhoneSpeedyBlupi
private double GetBalance(TinyPoint pos) private double GetBalance(TinyPoint pos)
{ {
double val = (double)pos.X * 2.0 / 640.0 - 1.0; double val = pos.X * 2.0 / 640.0 - 1.0;
val = Math.Max(val, -1.0); val = Math.Max(val, -1.0);
return Math.Min(val, 1.0); return Math.Min(val, 1.0);
} }

View File

@ -1,7 +1,5 @@
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
// WindowsPhoneSpeedyBlupi.Tables // WindowsPhoneSpeedyBlupi.Tables
using WindowsPhoneSpeedyBlupi;
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
{ {
public static class Tables public static class Tables

View File

@ -1,7 +1,5 @@
// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439
// WindowsPhoneSpeedyBlupi.Text // WindowsPhoneSpeedyBlupi.Text
using WindowsPhoneSpeedyBlupi;
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
{ {
public static class Text public static class Text
@ -226,7 +224,7 @@ namespace WindowsPhoneSpeedyBlupi
{ {
if (!string.IsNullOrEmpty(text)) if (!string.IsNullOrEmpty(text))
{ {
TinyPoint pos2 = default(TinyPoint); TinyPoint pos2 = default;
pos2.X = pos.X - GetTextWidth(text, size) / 2; pos2.X = pos.X - GetTextWidth(text, size) / 2;
pos2.Y = pos.Y; pos2.Y = pos.Y;
DrawText(pixmap, pos2, text, size); DrawText(pixmap, pos2, text, size);
@ -265,7 +263,7 @@ namespace WindowsPhoneSpeedyBlupi
private static void DrawChar(Pixmap pixmap, ref TinyPoint pos, char car, double size) private static void DrawChar(Pixmap pixmap, ref TinyPoint pos, char car, double size)
{ {
TinyPoint pos2 = default(TinyPoint); TinyPoint pos2 = default;
int num = (short)car * 6; int num = (short)car * 6;
int rank = table_char[num]; int rank = table_char[num];
pos2.X = pos.X + table_char[num + 1]; pos2.X = pos.X + table_char[num + 1];
@ -283,7 +281,7 @@ namespace WindowsPhoneSpeedyBlupi
private static int GetCharWidth(char c, double size) private static int GetCharWidth(char c, double size)
{ {
return (int)((double)(table_width[table_char[(short)c * 6]] + 1) * size); return (int)((table_width[table_char[(short)c * 6]] + 1) * size);
} }
private static void DrawCharSingle(Pixmap pixmap, TinyPoint pos, int rank, double size) private static void DrawCharSingle(Pixmap pixmap, TinyPoint pos, int rank, double size)

View File

@ -7,7 +7,6 @@ using System.IO;
using System.IO.IsolatedStorage; using System.IO.IsolatedStorage;
using System.Text; using System.Text;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using WindowsPhoneSpeedyBlupi;
namespace WindowsPhoneSpeedyBlupi namespace WindowsPhoneSpeedyBlupi
{ {
@ -275,38 +274,38 @@ namespace WindowsPhoneSpeedyBlupi
int num = text.IndexOf(name + "="); int num = text.IndexOf(name + "=");
if (num == -1) if (num == -1)
{ {
return default(TinyPoint); return default;
} }
num += name.Length + 1; num += name.Length + 1;
int num2 = text.IndexOf(";", num); int num2 = text.IndexOf(";", num);
if (num2 == -1) if (num2 == -1)
{ {
return default(TinyPoint); return default;
} }
int num3 = text.IndexOf(" ", num); int num3 = text.IndexOf(" ", num);
if (num3 == -1) if (num3 == -1)
{ {
return default(TinyPoint); return default;
} }
string s = text.Substring(num, num2 - num); string s = text.Substring(num, num2 - num);
string s2 = text.Substring(num2 + 1, num3 - num2 - 1); string s2 = text.Substring(num2 + 1, num3 - num2 - 1);
int result; int result;
if (!int.TryParse(s, out result)) if (!int.TryParse(s, out result))
{ {
return default(TinyPoint); return default;
} }
int result2; int result2;
if (!int.TryParse(s2, out result2)) if (!int.TryParse(s2, out result2))
{ {
return default(TinyPoint); return default;
} }
TinyPoint result3 = default(TinyPoint); TinyPoint result3 = default;
result3.X = result; result3.X = result;
result3.Y = result2; result3.Y = result2;
return result3; return result3;
} }
} }
return default(TinyPoint); return default;
} }
public static int? GetDecorField(string[] lines, string section, int x, int y) public static int? GetDecorField(string[] lines, string section, int x, int y)