diff --git a/.gitignore b/.gitignore index e7dd979..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,242 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -[Xx]64/ -[Xx]86/ -[Bb]uild/ -bld/ -[Bb]in/ -[Oo]bj/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml - -# TODO: Un-comment the next line if you do not want to checkin -# your web deploy settings because they may include unencrypted -# passwords -#*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# LightSwitch generated files -GeneratedArtifacts/ -ModelManifest.xml - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/AssemblyInfo.cs b/AssemblyInfo.cs deleted file mode 100644 index f8fc83b..0000000 --- a/AssemblyInfo.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Resources; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Speedy Blupi")] -[assembly: AssemblyProduct("Speedy Blupi")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("Dada Games")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en-US")] - -// Configuration -[assembly: AssemblyConfiguration("")] -[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] -[assembly: CompilationRelaxations(8)] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4b6c546f-6967-447a-8eda-c3236043dcf7")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.5")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Decor.cs b/Decor.cs index c93665b..76be219 100644 --- a/Decor.cs +++ b/Decor.cs @@ -342,7 +342,7 @@ namespace WindowsPhoneSpeedyBlupi } } - public Def.ButtonGlygh ButtonPressed { get; set; } + public Def.ButtonGlyph ButtonPressed { get; set; } private static void MoveObjectCopy(ref MoveObject dst, MoveObject src) { @@ -367,10 +367,10 @@ namespace WindowsPhoneSpeedyBlupi { m_lastDecorIcon[i] = 0; } - m_drawBounds.Left = 0; - m_drawBounds.Right = 640; - m_drawBounds.Top = 0; - m_drawBounds.Bottom = 480; + m_drawBounds.LeftX = 0; + m_drawBounds.RightX = 640; + m_drawBounds.TopY = 0; + m_drawBounds.BottomY = 480; m_time = 0; m_bCheatDoors = false; m_bSuperBlupi = false; @@ -750,34 +750,34 @@ namespace WindowsPhoneSpeedyBlupi pos.Y = posDecor.Y * 2 / 3; int num = 1; TinyPoint tinyPoint = default(TinyPoint); - tinyPoint.X = m_drawBounds.Left; + tinyPoint.X = m_drawBounds.LeftX; TinyRect rect = default(TinyRect); - rect.Left = pos.X % 640; - rect.Right = 640; + rect.LeftX = pos.X % 640; + rect.RightX = 640; for (int i = 0; i < 3; i++) { - tinyPoint.Y = m_drawBounds.Top; - rect.Top = pos.Y % 480; - rect.Bottom = 480; + tinyPoint.Y = m_drawBounds.TopY; + rect.TopY = pos.Y % 480; + rect.BottomY = 480; for (int j = 0; j < 2; j++) { m_pixmap.DrawPart(3, tinyPoint, rect); tinyPoint.Y += rect.Height - num; - rect.Top = 0; - rect.Bottom = 480; + rect.TopY = 0; + rect.BottomY = 480; } tinyPoint.X += rect.Width - num; - rect.Left = 0; - rect.Right = 640; - if (tinyPoint.X > m_drawBounds.Right) + rect.LeftX = 0; + rect.RightX = 640; + if (tinyPoint.X > m_drawBounds.RightX) { break; } } - tinyPoint.X = m_drawBounds.Left - posDecor.X % 64 - 64; + tinyPoint.X = m_drawBounds.LeftX - posDecor.X % 64 - 64; for (int i = posDecor.X / 64 - 1; i < posDecor.X / 64 + m_drawBounds.Width / 64 + 3; i++) { - tinyPoint.Y = m_drawBounds.Top - posDecor.Y % 64 + 2 - 64; + tinyPoint.Y = m_drawBounds.TopY - posDecor.Y % 64 + 2 - 64; for (int j = posDecor.Y / 64 - 1; j < posDecor.Y / 64 + m_drawBounds.Height / 64 + 2; j++) { if (i >= 0 && i < 100 && j >= 0 && j < 100) @@ -808,10 +808,10 @@ namespace WindowsPhoneSpeedyBlupi } tinyPoint.X += 64; } - tinyPoint.X = m_drawBounds.Left - posDecor.X % 64; + tinyPoint.X = m_drawBounds.LeftX - posDecor.X % 64; for (int i = posDecor.X / 64; i < posDecor.X / 64 + m_drawBounds.Width / 64 + 2; i++) { - tinyPoint.Y = m_drawBounds.Top - posDecor.Y % 64; + tinyPoint.Y = m_drawBounds.TopY - posDecor.Y % 64; for (int j = posDecor.Y / 64; j < posDecor.Y / 64 + m_drawBounds.Height / 64 + 2; j++) { if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i, j].icon != -1) @@ -834,8 +834,8 @@ namespace WindowsPhoneSpeedyBlupi { rotation = m_blupiRealRotation; } - tinyPoint.X = m_drawBounds.Left + m_blupiPos.X - posDecor.X; - tinyPoint.Y = m_drawBounds.Top + m_blupiPos.Y - posDecor.Y; + tinyPoint.X = m_drawBounds.LeftX + m_blupiPos.X - posDecor.X; + tinyPoint.Y = m_drawBounds.TopY + m_blupiPos.Y - posDecor.Y; if (m_blupiJeep) { tinyPoint.Y += m_blupiOffsetY; @@ -900,8 +900,8 @@ namespace WindowsPhoneSpeedyBlupi { if (m_moveObject[num3].type != 0 && m_moveObject[num3].posCurrent.X >= posDecor.X - 64 && m_moveObject[num3].posCurrent.Y >= posDecor.Y - 64 && m_moveObject[num3].posCurrent.X <= posDecor.X + m_drawBounds.Width && m_moveObject[num3].posCurrent.Y <= posDecor.Y + m_drawBounds.Height && (m_moveObject[num3].type < 8 || m_moveObject[num3].type > 11) && (m_moveObject[num3].type < 90 || m_moveObject[num3].type > 95) && (m_moveObject[num3].type < 98 || m_moveObject[num3].type > 100) && m_moveObject[num3].type != 53 && m_moveObject[num3].type != 1 && m_moveObject[num3].type != 47 && m_moveObject[num3].type != 48) { - tinyPoint.X = m_drawBounds.Left + m_moveObject[num3].posCurrent.X - posDecor.X; - tinyPoint.Y = m_drawBounds.Top + m_moveObject[num3].posCurrent.Y - posDecor.Y; + tinyPoint.X = m_drawBounds.LeftX + m_moveObject[num3].posCurrent.X - posDecor.X; + tinyPoint.Y = m_drawBounds.TopY + m_moveObject[num3].posCurrent.Y - posDecor.Y; if (m_moveObject[num3].type == 4 || m_moveObject[num3].type == 32 || m_moveObject[num3].type == 33) { tinyPoint.X += 2; @@ -937,10 +937,10 @@ namespace WindowsPhoneSpeedyBlupi } } } - tinyPoint.X = m_drawBounds.Left - posDecor.X % 64; + tinyPoint.X = m_drawBounds.LeftX - posDecor.X % 64; for (int i = posDecor.X / 64; i < posDecor.X / 64 + m_drawBounds.Width / 64 + 2; i++) { - tinyPoint.Y = m_drawBounds.Top - posDecor.Y % 64; + tinyPoint.Y = m_drawBounds.TopY - posDecor.Y % 64; for (int j = posDecor.Y / 64; j < posDecor.Y / 64 + m_drawBounds.Height / 64 + 2; j++) { if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i, j].icon != -1) @@ -1020,15 +1020,15 @@ namespace WindowsPhoneSpeedyBlupi { if ((m_moveObject[num3].type == 1 || m_moveObject[num3].type == 47 || m_moveObject[num3].type == 48) && m_moveObject[num3].posCurrent.X >= posDecor.X - 64 && m_moveObject[num3].posCurrent.Y >= posDecor.Y - 64 && m_moveObject[num3].posCurrent.X <= posDecor.X + m_drawBounds.Width && m_moveObject[num3].posCurrent.Y <= posDecor.Y + m_drawBounds.Height) { - tinyPoint.X = m_drawBounds.Left + m_moveObject[num3].posCurrent.X - posDecor.X; - tinyPoint.Y = m_drawBounds.Top + m_moveObject[num3].posCurrent.Y - posDecor.Y; + tinyPoint.X = m_drawBounds.LeftX + m_moveObject[num3].posCurrent.X - posDecor.X; + tinyPoint.Y = m_drawBounds.TopY + m_moveObject[num3].posCurrent.Y - posDecor.Y; m_pixmap.QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); } } - tinyPoint.X = m_drawBounds.Left - posDecor.X % 64; + tinyPoint.X = m_drawBounds.LeftX - posDecor.X % 64; for (int i = posDecor.X / 64; i < posDecor.X / 64 + m_drawBounds.Width / 64 + 2; i++) { - tinyPoint.Y = m_drawBounds.Top - posDecor.Y % 64; + tinyPoint.Y = m_drawBounds.TopY - posDecor.Y % 64; for (int j = posDecor.Y / 64; j < posDecor.Y / 64 + m_drawBounds.Height / 64 + 2; j++) { if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i, j].icon != -1) @@ -1140,15 +1140,15 @@ namespace WindowsPhoneSpeedyBlupi { if (m_moveObject[num3].type != 0 && m_moveObject[num3].posCurrent.X >= posDecor.X - 64 && m_moveObject[num3].posCurrent.Y >= posDecor.Y - 64 && m_moveObject[num3].posCurrent.X <= posDecor.X + m_drawBounds.Width && m_moveObject[num3].posCurrent.Y <= posDecor.Y + m_drawBounds.Height && ((m_moveObject[num3].type >= 8 && m_moveObject[num3].type <= 11) || (m_moveObject[num3].type >= 90 && m_moveObject[num3].type <= 95) || (m_moveObject[num3].type >= 98 && m_moveObject[num3].type <= 100) || m_moveObject[num3].type == 53)) { - tinyPoint.X = m_drawBounds.Left + m_moveObject[num3].posCurrent.X - posDecor.X; - tinyPoint.Y = m_drawBounds.Top + m_moveObject[num3].posCurrent.Y - posDecor.Y; + tinyPoint.X = m_drawBounds.LeftX + m_moveObject[num3].posCurrent.X - posDecor.X; + tinyPoint.Y = m_drawBounds.TopY + m_moveObject[num3].posCurrent.Y - posDecor.Y; m_pixmap.QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); } } if (m_blupiFront) { - tinyPoint.X = m_drawBounds.Left + m_blupiPos.X - posDecor.X; - tinyPoint.Y = m_drawBounds.Top + m_blupiPos.Y - posDecor.Y; + tinyPoint.X = m_drawBounds.LeftX + m_blupiPos.X - posDecor.X; + tinyPoint.Y = m_drawBounds.TopY + m_blupiPos.Y - posDecor.Y; m_pixmap.QuickIcon(m_blupiChannel, m_blupiIcon, tinyPoint); } DrawInfo(); @@ -1210,10 +1210,10 @@ namespace WindowsPhoneSpeedyBlupi if ((m_mission != 1 && m_mission % 10 != 0) || m_bPrivate) { TinyRect tinyRect = default(TinyRect); - tinyRect.Left = 410 + m_pixmap.Origin.X; - tinyRect.Right = 510 + m_pixmap.Origin.X; - tinyRect.Top = 445; - tinyRect.Bottom = 480; + tinyRect.LeftX = 410 + m_pixmap.Origin.X; + tinyRect.RightX = 510 + m_pixmap.Origin.X; + tinyRect.TopY = 445; + tinyRect.BottomY = 480; TinyRect rect = tinyRect; m_pixmap.DrawIcon(14, 15, rect, 0.6, false); string text = string.Format("{0}/{1}", m_nbTresor.ToString(), m_totalTresor.ToString()); @@ -1265,10 +1265,10 @@ namespace WindowsPhoneSpeedyBlupi { TinyRect drawBounds = m_pixmap.DrawBounds; TinyRect tinyRect2 = default(TinyRect); - tinyRect2.Left = 0; - tinyRect2.Right = drawBounds.Width; - tinyRect2.Top = 0; - tinyRect2.Bottom = 40; + tinyRect2.LeftX = 0; + tinyRect2.RightX = drawBounds.Width; + tinyRect2.TopY = 0; + tinyRect2.BottomY = 40; TinyRect rect2 = tinyRect2; m_pixmap.DrawIcon(14, 15, rect2, 1.0, false); double num4 = Text.GetTextWidth(text, 1.0); @@ -1598,27 +1598,27 @@ namespace WindowsPhoneSpeedyBlupi gameData.SetDoors(m_doors); } - public static string GetCheatTinyText(Def.ButtonGlygh glyph) + public static string GetCheatTinyText(Def.ButtonGlyph glyph) { switch (glyph) { - case Def.ButtonGlygh.Cheat1: + case Def.ButtonGlyph.Cheat1: return "D"; - case Def.ButtonGlygh.Cheat2: + case Def.ButtonGlyph.Cheat2: return "B"; - case Def.ButtonGlygh.Cheat3: + case Def.ButtonGlyph.Cheat3: return "S"; - case Def.ButtonGlygh.Cheat4: + case Def.ButtonGlyph.Cheat4: return "E"; - case Def.ButtonGlygh.Cheat5: + case Def.ButtonGlyph.Cheat5: return "R"; - case Def.ButtonGlygh.Cheat6: + case Def.ButtonGlyph.Cheat6: return "T"; - case Def.ButtonGlygh.Cheat7: + case Def.ButtonGlyph.Cheat7: return "C"; - case Def.ButtonGlygh.Cheat8: + case Def.ButtonGlyph.Cheat8: return "T"; - case Def.ButtonGlygh.Cheat9: + case Def.ButtonGlyph.Cheat9: return "G"; default: return ""; @@ -2220,8 +2220,8 @@ namespace WindowsPhoneSpeedyBlupi if (m_blupiTransport == -1) { TinyRect rect = BlupiRect(m_blupiPos); - rect.Top = m_blupiPos.Y + 60 - 2; - rect.Bottom = m_blupiPos.Y + 60 - 1; + rect.TopY = m_blupiPos.Y + 60 - 2; + rect.BottomY = m_blupiPos.Y + 60 - 1; return DecorDetect(rect); } return false; @@ -2232,60 +2232,60 @@ namespace WindowsPhoneSpeedyBlupi TinyRect result = default(TinyRect); if (m_blupiNage || m_blupiSurf) { - result.Left = pos.X + 12; - result.Right = pos.X + 60 - 12; + result.LeftX = pos.X + 12; + result.RightX = pos.X + 60 - 12; if (m_blupiAction == 1) { - result.Top = pos.Y + 5; - result.Bottom = pos.Y + 60 - 10; + result.TopY = pos.Y + 5; + result.BottomY = pos.Y + 60 - 10; } else { - result.Top = pos.Y + 15; - result.Bottom = pos.Y + 60 - 10; + result.TopY = pos.Y + 15; + result.BottomY = pos.Y + 60 - 10; } } else if (m_blupiJeep) { - result.Left = pos.X + 2; - result.Right = pos.X + 60 - 2; - result.Top = pos.Y + 10; - result.Bottom = pos.Y + 60 - 2; + result.LeftX = pos.X + 2; + result.RightX = pos.X + 60 - 2; + result.TopY = pos.Y + 10; + result.BottomY = pos.Y + 60 - 2; } else if (m_blupiTank) { - result.Left = pos.X + 2; - result.Right = pos.X + 60 - 2; - result.Top = pos.Y + 10; - result.Bottom = pos.Y + 60 - 2; + result.LeftX = pos.X + 2; + result.RightX = pos.X + 60 - 2; + result.TopY = pos.Y + 10; + result.BottomY = pos.Y + 60 - 2; } else if (m_blupiOver) { - result.Left = pos.X + 2; - result.Right = pos.X + 60 - 2; - result.Top = pos.Y + 2; - result.Bottom = pos.Y + 60 - 2; + result.LeftX = pos.X + 2; + result.RightX = pos.X + 60 - 2; + result.TopY = pos.Y + 2; + result.BottomY = pos.Y + 60 - 2; } else if (m_blupiBalloon) { - result.Left = pos.X + 10; - result.Right = pos.X + 60 - 10; - result.Top = pos.Y + 5; - result.Bottom = pos.Y + 60 - 2; + result.LeftX = pos.X + 10; + result.RightX = pos.X + 60 - 10; + result.TopY = pos.Y + 5; + result.BottomY = pos.Y + 60 - 2; } else if (m_blupiEcrase) { - result.Left = pos.X + 5; - result.Right = pos.X + 60 - 5; - result.Top = pos.Y + 39; - result.Bottom = pos.Y + 60 - 2; + result.LeftX = pos.X + 5; + result.RightX = pos.X + 60 - 5; + result.TopY = pos.Y + 39; + result.BottomY = pos.Y + 60 - 2; } else { - result.Left = pos.X + 12; - result.Right = pos.X + 60 - 12; - result.Top = pos.Y + 11; - result.Bottom = pos.Y + 60 - 2; + result.LeftX = pos.X + 12; + result.RightX = pos.X + 60 - 12; + result.TopY = pos.Y + 11; + result.BottomY = pos.Y + 60 - 2; } return result; } @@ -2300,67 +2300,67 @@ namespace WindowsPhoneSpeedyBlupi for (int i = 0; i < 50; i++) { TinyRect rect = tinyRect; - rect.Bottom = rect.Top + 2; - rect.Left = m_blupiPos.X + 12; - rect.Right = m_blupiPos.X + 60 - 12; + rect.BottomY = rect.TopY + 2; + rect.LeftX = m_blupiPos.X + 12; + rect.RightX = m_blupiPos.X + 60 - 12; if (!DecorDetect(rect)) { break; } - tinyRect.Top += 2; - tinyRect.Bottom += 2; + tinyRect.TopY += 2; + tinyRect.BottomY += 2; m_blupiPos.Y += 2; } for (int i = 0; i < 50; i++) { TinyRect rect = tinyRect; - rect.Right = rect.Left + 2; - rect.Top = m_blupiPos.Y + 11; - rect.Bottom = m_blupiPos.Y + 60 - 2; + rect.RightX = rect.LeftX + 2; + rect.TopY = m_blupiPos.Y + 11; + rect.BottomY = m_blupiPos.Y + 60 - 2; if (!DecorDetect(rect)) { break; } - tinyRect.Left += 2; - tinyRect.Right += 2; + tinyRect.LeftX += 2; + tinyRect.RightX += 2; m_blupiPos.X += 2; } for (int i = 0; i < 50; i++) { TinyRect rect = tinyRect; - rect.Left = rect.Right - 2; - rect.Top = m_blupiPos.Y + 11; - rect.Bottom = m_blupiPos.Y + 60 - 2; + rect.LeftX = rect.RightX - 2; + rect.TopY = m_blupiPos.Y + 11; + rect.BottomY = m_blupiPos.Y + 60 - 2; if (!DecorDetect(rect)) { break; } - tinyRect.Left -= 2; - tinyRect.Right -= 2; + tinyRect.LeftX -= 2; + tinyRect.RightX -= 2; m_blupiPos.X -= 2; } for (int i = 0; i < 50; i++) { TinyRect rect = tinyRect; - rect.Right = rect.Left + 2; + rect.RightX = rect.LeftX + 2; if (!DecorDetect(rect)) { break; } - tinyRect.Left += 2; - tinyRect.Right += 2; + tinyRect.LeftX += 2; + tinyRect.RightX += 2; m_blupiPos.X += 2; } for (int i = 0; i < 50; i++) { TinyRect rect = tinyRect; - rect.Left = rect.Right - 2; + rect.LeftX = rect.RightX - 2; if (!DecorDetect(rect)) { break; } - tinyRect.Left -= 2; - tinyRect.Right -= 2; + tinyRect.LeftX -= 2; + tinyRect.RightX -= 2; m_blupiPos.X -= 2; } } @@ -2368,15 +2368,15 @@ namespace WindowsPhoneSpeedyBlupi private bool BlupiBloque(TinyPoint pos, int dir) { TinyRect rect = BlupiRect(pos); - rect.Top = rect.Bottom - 20; - rect.Bottom -= 2; + rect.TopY = rect.BottomY - 20; + rect.BottomY -= 2; if (dir > 0) { - rect.Left = rect.Right - 2; + rect.LeftX = rect.RightX - 2; } if (dir < 0) { - rect.Right = rect.Left + 2; + rect.RightX = rect.LeftX + 2; } return DecorDetect(rect); } @@ -2407,8 +2407,8 @@ namespace WindowsPhoneSpeedyBlupi if (m_blupiVector.X != 0 || m_blupiVector.Y != 0) { rect = BlupiRect(m_blupiPos); - rect.Top = m_blupiPos.Y + 11; - rect.Bottom = m_blupiPos.Y + 60 - 2; + rect.TopY = m_blupiPos.Y + 11; + rect.BottomY = m_blupiPos.Y + 60 - 2; TestPath(rect, m_blupiPos, ref end); } m_blupiVent = false; @@ -2435,10 +2435,10 @@ namespace WindowsPhoneSpeedyBlupi if (icon >= 110 && icon <= 125) { m_blupiVent = true; - rect.Left = m_blupiPos.X + 12; - rect.Right = m_blupiPos.X + 60 - 12; - rect.Top = m_blupiPos.Y + 11; - rect.Bottom = m_blupiPos.Y + 60 - 2; + rect.LeftX = m_blupiPos.X + 12; + rect.RightX = m_blupiPos.X + 60 - 12; + rect.TopY = m_blupiPos.Y + 11; + rect.BottomY = m_blupiPos.Y + 60 - 2; TestPath(rect, m_blupiPos, ref end); } } @@ -2446,8 +2446,8 @@ namespace WindowsPhoneSpeedyBlupi if (m_blupiTransport == -1) { rect = BlupiRect(end); - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60 - 1; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60 - 1; flag2 = !DecorDetect(rect); } else @@ -2455,8 +2455,8 @@ namespace WindowsPhoneSpeedyBlupi flag2 = false; } rect = BlupiRect(end); - rect.Top = end.Y + 10; - rect.Bottom = end.Y + 20; + rect.TopY = end.Y + 10; + rect.BottomY = end.Y + 20; bool flag3 = DecorDetect(rect); int detectIcon = m_detectIcon; if (!m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && flag2 && m_blupiFocus) @@ -2599,8 +2599,8 @@ namespace WindowsPhoneSpeedyBlupi m_blupiVitesseY += 2.0; } rect = BlupiRect(end); - rect.Top = end.Y + 60 - 30; - rect.Bottom = end.Y + 60 - 1; + rect.TopY = end.Y + 60 - 30; + rect.BottomY = end.Y + 60 - 1; if (m_blupiVitesseY >= 0.0 && DecorDetect(rect)) { end.Y = end.Y / 32 * 32 + BLUPIOFFY; @@ -2628,10 +2628,10 @@ namespace WindowsPhoneSpeedyBlupi m_blupiPhase = 0; } } - rect.Left = end.X + 20; - rect.Right = end.X + 60 - 20; - rect.Top = end.Y + 60 - 33; - rect.Bottom = end.Y + 60 - 1; + rect.LeftX = end.X + 20; + rect.RightX = end.X + 60 - 20; + rect.TopY = end.Y + 60 - 33; + rect.BottomY = end.Y + 60 - 1; icon = AscenseurDetect(rect, m_blupiPos, end); if (m_blupiVitesseY >= 0.0 && icon != -1) { @@ -3456,18 +3456,18 @@ namespace WindowsPhoneSpeedyBlupi end.X += (int)m_blupiVitesseX; } MoveObjectPollution(); - if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag2 && m_blupiTransport == -1) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && !flag2 && m_blupiTransport == -1) { - ButtonPressed = Def.ButtonGlygh.None; - rect.Left = m_blupiPos.X + 20; - rect.Right = m_blupiPos.X + 22; - rect.Top = m_blupiPos.Y + 60 - 2; - rect.Bottom = m_blupiPos.Y + 60; + ButtonPressed = Def.ButtonGlyph.None; + rect.LeftX = m_blupiPos.X + 20; + rect.RightX = m_blupiPos.X + 22; + rect.TopY = m_blupiPos.Y + 60 - 2; + rect.BottomY = m_blupiPos.Y + 60; bVertigoLeft = !DecorDetect(rect); - rect.Left = m_blupiPos.X + 60 - 22; - rect.Right = m_blupiPos.X + 60 - 20; - rect.Top = m_blupiPos.Y + 60 - 2; - rect.Bottom = m_blupiPos.Y + 60; + rect.LeftX = m_blupiPos.X + 60 - 22; + rect.RightX = m_blupiPos.X + 60 - 20; + rect.TopY = m_blupiPos.Y + 60 - 2; + rect.BottomY = m_blupiPos.Y + 60; bVertigoRight = !DecorDetect(rect); if (!bVertigoLeft && !bVertigoRight) { @@ -3505,8 +3505,8 @@ namespace WindowsPhoneSpeedyBlupi } } rect = BlupiRect(end); - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60 + OVERHEIGHT - 1; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60 + OVERHEIGHT - 1; bool flag4 = !DecorDetect(rect); icon = MoveAscenseurDetect(m_blupiPos, OVERHEIGHT); if (icon != -1) @@ -3577,18 +3577,18 @@ namespace WindowsPhoneSpeedyBlupi } end.X += (int)m_blupiVitesseX; MoveObjectPollution(); - if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag2 && m_blupiTransport == -1) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && !flag2 && m_blupiTransport == -1) { - ButtonPressed = Def.ButtonGlygh.None; - rect.Left = m_blupiPos.X + 20; - rect.Right = m_blupiPos.X + 22; - rect.Top = m_blupiPos.Y + 60 - 2; - rect.Bottom = m_blupiPos.Y + 60; + ButtonPressed = Def.ButtonGlyph.None; + rect.LeftX = m_blupiPos.X + 20; + rect.RightX = m_blupiPos.X + 22; + rect.TopY = m_blupiPos.Y + 60 - 2; + rect.BottomY = m_blupiPos.Y + 60; bVertigoLeft = !DecorDetect(rect); - rect.Left = m_blupiPos.X + 60 - 22; - rect.Right = m_blupiPos.X + 60 - 20; - rect.Top = m_blupiPos.Y + 60 - 2; - rect.Bottom = m_blupiPos.Y + 60; + rect.LeftX = m_blupiPos.X + 60 - 22; + rect.RightX = m_blupiPos.X + 60 - 20; + rect.TopY = m_blupiPos.Y + 60 - 2; + rect.BottomY = m_blupiPos.Y + 60; bVertigoRight = !DecorDetect(rect); if (!bVertigoLeft && !bVertigoRight) { @@ -3753,12 +3753,12 @@ namespace WindowsPhoneSpeedyBlupi } m_blupiMotorHigh = m_blupiAction != 1; rect = BlupiRect(end); - rect.Right -= 40; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60 - 1; + rect.RightX -= 40; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60 - 1; bool flag5 = !DecorDetect(rect); - rect.Left += 40; - rect.Right += 40; + rect.LeftX += 40; + rect.RightX += 40; bool flag6 = !DecorDetect(rect); if (flag2) { @@ -3778,10 +3778,10 @@ namespace WindowsPhoneSpeedyBlupi end.Y += (int)m_blupiVitesseY; if (m_blupiTransport == -1) { - rect.Left = end.X + 20; - rect.Right = end.X + 60 - 20; - rect.Top = end.Y + 60 - 35; - rect.Bottom = end.Y + 60 - 1; + rect.LeftX = end.X + 20; + rect.RightX = end.X + 60 - 20; + rect.TopY = end.Y + 60 - 35; + rect.BottomY = end.Y + 60 - 1; icon = AscenseurDetect(rect, m_blupiPos, end); if (m_blupiVitesseY >= 0.0 && icon != -1) { @@ -3861,9 +3861,9 @@ namespace WindowsPhoneSpeedyBlupi } m_blupiOffsetY = Math.Abs(m_blupiRealRotation / 2); MoveObjectPollution(); - if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag2 && m_blupiTransport == -1) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && !flag2 && m_blupiTransport == -1) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; celSwitch.X = m_blupiPos.X; celSwitch.Y = m_blupiPos.Y - BLUPIFLOOR; ObjectStart(celSwitch, 19, 0); @@ -3939,10 +3939,10 @@ namespace WindowsPhoneSpeedyBlupi end.Y += (int)m_blupiVitesseY; if (m_blupiTransport == -1) { - rect.Left = end.X + 20; - rect.Right = end.X + 60 - 20; - rect.Top = end.Y + 60 - 35; - rect.Bottom = end.Y + 60 - 1; + rect.LeftX = end.X + 20; + rect.RightX = end.X + 60 - 20; + rect.TopY = end.Y + 60 - 35; + rect.BottomY = end.Y + 60 - 1; icon = AscenseurDetect(rect, m_blupiPos, end); if (m_blupiVitesseY >= 0.0 && icon != -1) { @@ -3993,9 +3993,9 @@ namespace WindowsPhoneSpeedyBlupi } end.X += (int)m_blupiVitesseX; MoveObjectPollution(); - if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag2 && m_blupiTransport == -1) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && !flag2 && m_blupiTransport == -1) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; celSwitch.X = m_blupiPos.X; celSwitch.Y = m_blupiPos.Y; ObjectStart(celSwitch, 28, 0); @@ -4055,9 +4055,9 @@ namespace WindowsPhoneSpeedyBlupi m_blupiVitesseX = 0.0; } end.X += (int)m_blupiVitesseX; - if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag2 && !m_blupiAir && m_blupiTransport == -1 && m_blupiVitesseX < 8.0) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && !flag2 && !m_blupiAir && m_blupiTransport == -1 && m_blupiVitesseX < 8.0) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; m_blupiSkate = false; m_blupiAction = 43; m_blupiPhase = 0; @@ -4318,7 +4318,7 @@ namespace WindowsPhoneSpeedyBlupi m_blupiSuspend = false; m_blupiAir = true; m_blupiAction = 5; - end.Y = end.Y; + end.Y = end.Y;//Todo : check : Assignment made to same variable; did you mean to assign something else? m_blupiVitesseY = 0.0; m_blupiNoBarre = 5; m_blupiActionOuf = 65; @@ -4346,20 +4346,20 @@ namespace WindowsPhoneSpeedyBlupi PlaySound(35, end); } } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiTank && !m_blupiJeep && !m_blupiSkate && !flag2 && m_blupiTransport == -1 && m_blupiFocus) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiTank && !m_blupiJeep && !m_blupiSkate && !flag2 && m_blupiTransport == -1 && m_blupiFocus) { if (m_blupiDynamite > 0) { - ButtonPressed = Def.ButtonGlygh.None; - rect.Left = end.X + 18; - rect.Right = end.X + 20; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + ButtonPressed = Def.ButtonGlyph.None; + rect.LeftX = end.X + 18; + rect.RightX = end.X + 20; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoLeft = !DecorDetect(rect); - rect.Left = end.X + 60 - 20; - rect.Right = end.X + 60 - 18; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 60 - 20; + rect.RightX = end.X + 60 - 18; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoRight = !DecorDetect(rect); if (!bVertigoLeft && !bVertigoRight && ObjectStart(end, 56, 0) != -1) { @@ -4372,19 +4372,19 @@ namespace WindowsPhoneSpeedyBlupi } else if (m_blupiPerso > 0) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; icon = MoveObjectDetect(end, out bNear); if (icon == -1 || m_moveObject[icon].type != 200) { - rect.Left = end.X + 18; - rect.Right = end.X + 20; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 18; + rect.RightX = end.X + 20; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoLeft = !DecorDetect(rect); - rect.Left = end.X + 60 - 20; - rect.Right = end.X + 60 - 18; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 60 - 20; + rect.RightX = end.X + 60 - 18; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoRight = !DecorDetect(rect); icon = MoveChargeDetect(end); if (icon == -1 && !bVertigoLeft && !bVertigoRight && ObjectStart(end, 200, 0) != -1) @@ -4445,15 +4445,15 @@ namespace WindowsPhoneSpeedyBlupi } else { - rect.Left = end.X + 24; - rect.Right = end.X + 26; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 24; + rect.RightX = end.X + 26; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoLeft = !DecorDetect(rect); - rect.Left = end.X + 60 - 26; - rect.Right = end.X + 60 - 24; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 60 - 26; + rect.RightX = end.X + 60 - 24; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoRight = !DecorDetect(rect); } if (m_blupiDir == 1 && bVertigoLeft && !bVertigoRight) @@ -4502,15 +4502,15 @@ namespace WindowsPhoneSpeedyBlupi } else { - rect.Left = end.X + 2; - rect.Right = end.X + 18; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 2; + rect.RightX = end.X + 18; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoLeft = !DecorDetect(rect); - rect.Left = end.X + 60 - 18; - rect.Right = end.X + 60 - 2; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 60 - 18; + rect.RightX = end.X + 60 - 2; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoRight = !DecorDetect(rect); } if (bVertigoLeft && !bVertigoRight) @@ -4532,15 +4532,15 @@ namespace WindowsPhoneSpeedyBlupi } else { - rect.Left = end.X + 2; - rect.Right = end.X + 18; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 2; + rect.RightX = end.X + 18; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoLeft = !DecorDetect(rect); - rect.Left = end.X + 60 - 18; - rect.Right = end.X + 60 - 2; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 60 - 18; + rect.RightX = end.X + 60 - 2; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoRight = !DecorDetect(rect); } if (bVertigoLeft && !bVertigoRight) @@ -4562,15 +4562,15 @@ namespace WindowsPhoneSpeedyBlupi } else { - rect.Left = end.X + 12; - rect.Right = end.X + 19; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 12; + rect.RightX = end.X + 19; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoLeft = !DecorDetect(rect); - rect.Left = end.X + 60 - 19; - rect.Right = end.X + 60 - 12; - rect.Top = end.Y + 60 - 2; - rect.Bottom = end.Y + 60; + rect.LeftX = end.X + 60 - 19; + rect.RightX = end.X + 60 - 12; + rect.TopY = end.Y + 60 - 2; + rect.BottomY = end.Y + 60; bVertigoRight = !DecorDetect(rect); } if (bVertigoLeft && !bVertigoRight) @@ -4807,8 +4807,8 @@ namespace WindowsPhoneSpeedyBlupi if (m_blupiHelico && m_blupiPos.Y > 2 && m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) { rect = BlupiRect(end); - rect.Top = end.Y + 4; - rect.Bottom = end.Y + 20; + rect.TopY = end.Y + 4; + rect.BottomY = end.Y + 20; if (DecorDetect(rect)) { ByeByeHelico(); @@ -5063,9 +5063,9 @@ namespace WindowsPhoneSpeedyBlupi m_blupiRestart = true; m_blupiAir = true; } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && (num26 == -1 || !bNear) && IsSwitch(m_blupiPos, ref celSwitch) && !m_blupiOver && !m_blupiBalloon && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && (num26 == -1 || !bNear) && IsSwitch(m_blupiPos, ref celSwitch) && !m_blupiOver && !m_blupiBalloon && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; ActiveSwitch(m_decor[celSwitch.X, celSwitch.Y].icon == 385, celSwitch); m_blupiAction = 82; m_blupiPhase = 0; @@ -5173,9 +5173,9 @@ namespace WindowsPhoneSpeedyBlupi } if (icon != -1 && bNear) { - if (m_moveObject[icon].type == 13 && (ButtonPressed == Def.ButtonGlygh.PlayAction || IsFloatingObject(icon)) && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + if (m_moveObject[icon].type == 13 && (ButtonPressed == Def.ButtonGlyph.PlayAction || IsFloatingObject(icon)) && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; ObjectDelete(m_moveObject[icon].posCurrent, m_moveObject[icon].type); m_scrollAdd.X = 0; m_scrollAdd.Y = 0; @@ -5190,9 +5190,9 @@ namespace WindowsPhoneSpeedyBlupi m_jauges[1].SetHide(true); } } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[icon].type == 46 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && m_moveObject[icon].type == 46 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; ObjectDelete(m_moveObject[icon].posCurrent, m_moveObject[icon].type); m_scrollAdd.X = 0; m_scrollAdd.Y = 0; @@ -5206,9 +5206,9 @@ namespace WindowsPhoneSpeedyBlupi m_jauges[1].SetHide(true); } } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[icon].type == 19 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && m_moveObject[icon].type == 19 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; ObjectDelete(m_moveObject[icon].posCurrent, m_moveObject[icon].type); m_scrollAdd.X = 0; m_scrollAdd.Y = 0; @@ -5224,9 +5224,9 @@ namespace WindowsPhoneSpeedyBlupi m_jauges[1].SetHide(true); } } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[icon].type == 28 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && m_moveObject[icon].type == 28 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; ObjectDelete(m_moveObject[icon].posCurrent, m_moveObject[icon].type); m_scrollAdd.X = 0; m_scrollAdd.Y = 0; @@ -5256,9 +5256,9 @@ namespace WindowsPhoneSpeedyBlupi m_blupiBullet = 10; } } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[icon].type == 24 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && m_moveObject[icon].type == 24 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; m_scrollAdd.X = 0; m_scrollAdd.Y = 0; m_blupiAction = 42; @@ -5518,9 +5518,9 @@ namespace WindowsPhoneSpeedyBlupi m_blupiPosMagic = m_blupiPos; m_jauges[1].SetHide(false); } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[icon].type == 26 && !m_blupiShield && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && m_moveObject[icon].type == 26 && !m_blupiShield && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; m_sucettePos = m_moveObject[icon].posCurrent; m_sucetteType = m_moveObject[icon].type; ObjectDelete(m_moveObject[icon].posCurrent, m_moveObject[icon].type); @@ -5544,9 +5544,9 @@ namespace WindowsPhoneSpeedyBlupi ObjectStart(m_blupiPos, 41, 10); ObjectStart(m_blupiPos, 41, -10); } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[icon].type == 30 && !m_blupiShield && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && m_moveObject[icon].type == 30 && !m_blupiShield && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; m_sucettePos = m_moveObject[icon].posCurrent; m_sucetteType = m_moveObject[icon].type; ObjectDelete(m_moveObject[icon].posCurrent, m_moveObject[icon].type); @@ -5579,9 +5579,9 @@ namespace WindowsPhoneSpeedyBlupi { if (m_moveObject[icon].type == 200) { - if (m_blupiPerso < 5 && ButtonPressed == Def.ButtonGlygh.PlayAction) + if (m_blupiPerso < 5 && ButtonPressed == Def.ButtonGlyph.PlayAction) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; ObjectDelete(m_moveObject[icon].posCurrent, m_moveObject[icon].type); celSwitch.X = m_moveObject[icon].posCurrent.X - m_posDecor.X; celSwitch.Y = m_moveObject[icon].posCurrent.Y - m_posDecor.Y; @@ -5603,9 +5603,9 @@ namespace WindowsPhoneSpeedyBlupi m_decorPhase = 0; } } - if (m_moveObject[icon].type == 55 && m_blupiFocus && m_blupiDynamite == 0 && (m_voyageIcon != 252 || m_voyageChannel != 10) && ButtonPressed == Def.ButtonGlygh.PlayAction) + if (m_moveObject[icon].type == 55 && m_blupiFocus && m_blupiDynamite == 0 && (m_voyageIcon != 252 || m_voyageChannel != 10) && ButtonPressed == Def.ButtonGlyph.PlayAction) { - ButtonPressed = Def.ButtonGlygh.None; + ButtonPressed = Def.ButtonGlyph.None; ObjectDelete(m_moveObject[icon].posCurrent, m_moveObject[icon].type); celSwitch.X = m_moveObject[icon].posCurrent.X - m_posDecor.X; celSwitch.Y = m_moveObject[icon].posCurrent.Y - m_posDecor.Y; @@ -5849,7 +5849,7 @@ namespace WindowsPhoneSpeedyBlupi m_blupiPhase = 0; m_blupiFocus = true; } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_blupiAction == 1) + if (ButtonPressed == Def.ButtonGlyph.PlayAction && m_blupiAction == 1) { m_blupiAction = 84; m_blupiPhase = 0; @@ -6132,27 +6132,27 @@ namespace WindowsPhoneSpeedyBlupi private bool DecorDetect(TinyRect rect, bool bCaisse) { m_detectIcon = -1; - if (rect.Left < 0 || rect.Top < 0) + if (rect.LeftX < 0 || rect.TopY < 0) { return true; } int num = ((m_dimDecor.X != 0) ? 6400 : 640); - if (rect.Right > num) + if (rect.RightX > num) { return true; } if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiNage || m_blupiSurf) { num = ((m_dimDecor.Y != 0) ? 6400 : 480); - if (rect.Bottom > num) + if (rect.BottomY > num) { return true; } } - int num2 = rect.Left / 16; - int num3 = (rect.Right + 16 - 1) / 16; - int num4 = rect.Top / 16; - int num5 = (rect.Bottom + 16 - 1) / 16; + int num2 = rect.LeftX / 16; + int num3 = (rect.RightX + 16 - 1) / 16; + int num4 = rect.TopY / 16; + int num5 = (rect.BottomY + 16 - 1) / 16; TinyRect src = default(TinyRect); TinyRect dst; for (int i = num4; i <= num5; i++) @@ -6174,10 +6174,10 @@ namespace WindowsPhoneSpeedyBlupi num7 = i % 4; if (Tables.table_decor_quart[icon * 16 + num7 * 4 + num6] != 0) { - src.Left = j * 16; - src.Right = src.Left + 16; - src.Top = i * 16; - src.Bottom = src.Top + 16; + src.LeftX = j * 16; + src.RightX = src.LeftX + 16; + src.TopY = i * 16; + src.BottomY = src.TopY + 16; if (Misc.IntersectRect(out dst, src, rect)) { m_detectIcon = icon; @@ -6193,10 +6193,10 @@ namespace WindowsPhoneSpeedyBlupi for (int k = 0; k < m_nbRankCaisse; k++) { int num8 = m_rankCaisse[k]; - src.Left = m_moveObject[num8].posCurrent.X; - src.Right = m_moveObject[num8].posCurrent.X + 64; - src.Top = m_moveObject[num8].posCurrent.Y; - src.Bottom = m_moveObject[num8].posCurrent.Y + 64; + src.LeftX = m_moveObject[num8].posCurrent.X; + src.RightX = m_moveObject[num8].posCurrent.X + 64; + src.TopY = m_moveObject[num8].posCurrent.Y; + src.BottomY = m_moveObject[num8].posCurrent.Y + 64; if (Misc.IntersectRect(out dst, src, rect)) { m_detectIcon = m_moveObject[num8].icon; @@ -6219,10 +6219,10 @@ namespace WindowsPhoneSpeedyBlupi for (int i = 0; i <= num; i++) { int num3 = i * (end.Y - start.Y) / num; - rect2.Left = rect.Left + i; - rect2.Right = rect.Right + i; - rect2.Top = rect.Top + num3; - rect2.Bottom = rect.Bottom + num3; + rect2.LeftX = rect.LeftX + i; + rect2.RightX = rect.RightX + i; + rect2.TopY = rect.TopY + num3; + rect2.BottomY = rect.BottomY + num3; if (DecorDetect(rect2)) { end = tinyPoint; @@ -6237,10 +6237,10 @@ namespace WindowsPhoneSpeedyBlupi for (int i = 0; i >= -num; i--) { int num3 = i * (start.Y - end.Y) / num; - rect2.Left = rect.Left + i; - rect2.Right = rect.Right + i; - rect2.Top = rect.Top + num3; - rect2.Bottom = rect.Bottom + num3; + rect2.LeftX = rect.LeftX + i; + rect2.RightX = rect.RightX + i; + rect2.TopY = rect.TopY + num3; + rect2.BottomY = rect.BottomY + num3; if (DecorDetect(rect2)) { end = tinyPoint; @@ -6258,10 +6258,10 @@ namespace WindowsPhoneSpeedyBlupi for (int num3 = 0; num3 <= num2; num3++) { int i = num3 * (end.X - start.X) / num2; - rect2.Left = rect.Left + i; - rect2.Right = rect.Right + i; - rect2.Top = rect.Top + num3; - rect2.Bottom = rect.Bottom + num3; + rect2.LeftX = rect.LeftX + i; + rect2.RightX = rect.RightX + i; + rect2.TopY = rect.TopY + num3; + rect2.BottomY = rect.BottomY + num3; if (DecorDetect(rect2)) { end = tinyPoint; @@ -6276,10 +6276,10 @@ namespace WindowsPhoneSpeedyBlupi for (int num3 = 0; num3 >= -num2; num3--) { int i = num3 * (start.X - end.X) / num2; - rect2.Left = rect.Left + i; - rect2.Right = rect.Right + i; - rect2.Top = rect.Top + num3; - rect2.Bottom = rect.Bottom + num3; + rect2.LeftX = rect.LeftX + i; + rect2.RightX = rect.RightX + i; + rect2.TopY = rect.TopY + num3; + rect2.BottomY = rect.BottomY + num3; if (DecorDetect(rect2)) { end = tinyPoint; @@ -6570,8 +6570,8 @@ namespace WindowsPhoneSpeedyBlupi return 2; } TinyRect rect = BlupiRect(pos2); - rect.Top = pos2.Y + 60 - 2; - rect.Bottom = pos2.Y + 60 - 1; + rect.TopY = pos2.Y + 60 - 2; + rect.BottomY = pos2.Y + 60 - 1; if (DecorDetect(rect, true)) { return 2; @@ -7289,14 +7289,14 @@ namespace WindowsPhoneSpeedyBlupi if ((m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48) && !m_blupiSuspend) { TinyRect src = default(TinyRect); - src.Left = m_blupiPos.X + 20; - src.Right = m_blupiPos.X + 60 - 20; - src.Top = m_blupiPos.Y + 60 - 2; - src.Bottom = m_blupiPos.Y + 60 - 1; - tinyRect.Left = m_moveObject[i].posCurrent.X; - tinyRect.Right = m_moveObject[i].posCurrent.X + 64; - tinyRect.Top = m_moveObject[i].posCurrent.Y; - tinyRect.Bottom = m_moveObject[i].posCurrent.Y + 16; + src.LeftX = m_blupiPos.X + 20; + src.RightX = m_blupiPos.X + 60 - 20; + src.TopY = m_blupiPos.Y + 60 - 2; + src.BottomY = m_blupiPos.Y + 60 - 1; + tinyRect.LeftX = m_moveObject[i].posCurrent.X; + tinyRect.RightX = m_moveObject[i].posCurrent.X + 64; + tinyRect.TopY = m_moveObject[i].posCurrent.Y; + tinyRect.BottomY = m_moveObject[i].posCurrent.Y + 16; TinyRect dst; flag = Misc.IntersectRect(out dst, tinyRect, src); tinyPoint = m_moveObject[i].posCurrent; @@ -7321,10 +7321,10 @@ namespace WindowsPhoneSpeedyBlupi { end.Y--; } - tinyRect.Left = end.X + 10; - tinyRect.Right = end.X + 60 - 10; - tinyRect.Top = end.Y + 10; - tinyRect.Bottom = end.Y + 60 - 10; + tinyRect.LeftX = end.X + 10; + tinyRect.RightX = end.X + 60 - 10; + tinyRect.TopY = end.Y + 10; + tinyRect.BottomY = end.Y + 60 - 10; if (TestPath(tinyRect, m_moveObject[i].posCurrent, ref end)) { m_moveObject[i].posCurrent = end; @@ -8315,10 +8315,10 @@ namespace WindowsPhoneSpeedyBlupi m_decorPhase = 0; } TinyRect src = default(TinyRect); - src.Left = posStart.X; - src.Right = posStart.X + 128; - src.Top = posStart.Y; - src.Bottom = posStart.Y + 128; + src.LeftX = posStart.X; + src.RightX = posStart.X + 128; + src.TopY = posStart.Y; + src.BottomY = posStart.Y + 128; TinyPoint tinyPoint = default(TinyPoint); tinyPoint.Y = posStart.Y / 64; TinyPoint pos = default(TinyPoint); @@ -8346,10 +8346,10 @@ namespace WindowsPhoneSpeedyBlupi { if (m_moveObject[i].type == 2 || m_moveObject[i].type == 3 || m_moveObject[i].type == 96 || m_moveObject[i].type == 97 || m_moveObject[i].type == 4 || m_moveObject[i].type == 6 || m_moveObject[i].type == 12 || m_moveObject[i].type == 13 || m_moveObject[i].type == 16 || m_moveObject[i].type == 17 || m_moveObject[i].type == 18 || m_moveObject[i].type == 19 || m_moveObject[i].type == 20 || m_moveObject[i].type == 24 || m_moveObject[i].type == 25 || m_moveObject[i].type == 26 || m_moveObject[i].type == 28 || m_moveObject[i].type == 30 || m_moveObject[i].type == 32 || m_moveObject[i].type == 33 || m_moveObject[i].type == 34 || m_moveObject[i].type == 40 || m_moveObject[i].type == 44 || m_moveObject[i].type == 46 || m_moveObject[i].type == 52 || m_moveObject[i].type == 54 || m_moveObject[i].type == 200 || m_moveObject[i].type == 201 || m_moveObject[i].type == 202 || m_moveObject[i].type == 203) { - src2.Left = m_moveObject[i].posCurrent.X; - src2.Right = m_moveObject[i].posCurrent.X + 60; - src2.Top = m_moveObject[i].posCurrent.Y; - src2.Bottom = m_moveObject[i].posCurrent.Y + 60; + src2.LeftX = m_moveObject[i].posCurrent.X; + src2.RightX = m_moveObject[i].posCurrent.X + 60; + src2.TopY = m_moveObject[i].posCurrent.Y; + src2.BottomY = m_moveObject[i].posCurrent.Y + 60; TinyRect dst; if (Misc.IntersectRect(out dst, src2, src)) { @@ -8402,10 +8402,10 @@ namespace WindowsPhoneSpeedyBlupi { continue; } - src.Left = m_moveObject[i].posCurrent.X; - src.Right = m_moveObject[i].posCurrent.X + 64; - src.Top = m_moveObject[i].posCurrent.Y; - src.Bottom = m_moveObject[i].posCurrent.Y + 16; + src.LeftX = m_moveObject[i].posCurrent.X; + src.RightX = m_moveObject[i].posCurrent.X + 64; + src.TopY = m_moveObject[i].posCurrent.Y; + src.BottomY = m_moveObject[i].posCurrent.Y + 16; TinyRect dst; if (num < 30) { @@ -8416,16 +8416,16 @@ namespace WindowsPhoneSpeedyBlupi continue; } TinyRect src2 = rect; - src2.Top -= num / 30 * num2; - src2.Bottom -= num / 30 * num2; + src2.TopY -= num / 30 * num2; + src2.BottomY -= num / 30 * num2; for (int j = 0; j <= num / 30; j++) { if (Misc.IntersectRect(out dst, src, src2)) { return i; } - src2.Top += num2; - src2.Bottom += num2; + src2.TopY += num2; + src2.BottomY += num2; } } return -1; @@ -8524,10 +8524,10 @@ namespace WindowsPhoneSpeedyBlupi private bool TestPushOneCaisse(int i, TinyPoint move, int b) { TinyRect rect = default(TinyRect); - int num = (rect.Left = m_moveObject[i].posCurrent.X + move.X); - rect.Right = num + 64; - rect.Top = m_moveObject[i].posCurrent.Y; - rect.Bottom = m_moveObject[i].posCurrent.Y + 64; + int num = (rect.LeftX = m_moveObject[i].posCurrent.X + move.X); + rect.RightX = num + 64; + rect.TopY = m_moveObject[i].posCurrent.Y; + rect.BottomY = m_moveObject[i].posCurrent.Y + 64; if (DecorDetect(rect, false)) { return false; @@ -8536,18 +8536,18 @@ namespace WindowsPhoneSpeedyBlupi { return true; } - rect.Left = num; - rect.Right = num + 20; - rect.Top = m_moveObject[i].posCurrent.Y + 64; - rect.Bottom = m_moveObject[i].posCurrent.Y + 64 + 2; + rect.LeftX = num; + rect.RightX = num + 20; + rect.TopY = m_moveObject[i].posCurrent.Y + 64; + rect.BottomY = m_moveObject[i].posCurrent.Y + 64 + 2; if (!DecorDetect(rect)) { return false; } - rect.Left = num + 64 - 20; - rect.Right = num + 64; - rect.Top = m_moveObject[i].posCurrent.Y + 64; - rect.Bottom = m_moveObject[i].posCurrent.Y + 64 + 2; + rect.LeftX = num + 64 - 20; + rect.RightX = num + 64; + rect.TopY = m_moveObject[i].posCurrent.Y + 64; + rect.BottomY = m_moveObject[i].posCurrent.Y + 64 + 2; if (!DecorDetect(rect)) { return false; @@ -8573,19 +8573,19 @@ namespace WindowsPhoneSpeedyBlupi { continue; } - src.Left = m_moveObject[num].posCurrent.X - 1; - src.Top = m_moveObject[num].posCurrent.Y - 1; - src.Right = src.Left + 64 + 1; - src.Bottom = src.Top + 64 + 1; + src.LeftX = m_moveObject[num].posCurrent.X - 1; + src.TopY = m_moveObject[num].posCurrent.Y - 1; + src.RightX = src.LeftX + 64 + 1; + src.BottomY = src.TopY + 64 + 1; for (int j = 0; j < m_nbRankCaisse; j++) { int num2 = m_rankCaisse[j]; if (num2 != num && m_moveObject[num2].posCurrent.Y <= posCurrent.Y && (!bPop || (m_moveObject[num2].posCurrent.X >= posCurrent.X - 32 && m_moveObject[num2].posCurrent.X <= posCurrent.X + 32))) { - src2.Left = m_moveObject[num2].posCurrent.X - 1; - src2.Top = m_moveObject[num2].posCurrent.Y - 1; - src2.Right = src2.Left + 64 + 1; - src2.Bottom = src2.Top + 64 + 1; + src2.LeftX = m_moveObject[num2].posCurrent.X - 1; + src2.TopY = m_moveObject[num2].posCurrent.Y - 1; + src2.RightX = src2.LeftX + 64 + 1; + src2.BottomY = src2.TopY + 64 + 1; TinyRect dst; if (Misc.IntersectRect(out dst, src2, src) && AddLinkCaisse(num2)) { @@ -8688,13 +8688,13 @@ namespace WindowsPhoneSpeedyBlupi } } TinyRect src = default(TinyRect); - src.Left = pos.X; - src.Right = pos.X + 60; - src.Top = pos.Y + 11; - src.Bottom = pos.Y + 60; + src.LeftX = pos.X; + src.RightX = pos.X + 60; + src.TopY = pos.Y + 11; + src.BottomY = pos.Y + 60; if (m_blupiAir) { - src.Bottom += 90; + src.BottomY += 90; } TinyRect src2 = default(TinyRect); for (int i = 0; i < MAXMOVEOBJECT; i++) @@ -8703,10 +8703,10 @@ namespace WindowsPhoneSpeedyBlupi { continue; } - src2.Left = m_moveObject[i].posCurrent.X; - src2.Right = m_moveObject[i].posCurrent.X + 60; - src2.Top = m_moveObject[i].posCurrent.Y + 36; - src2.Bottom = m_moveObject[i].posCurrent.Y + 60; + src2.LeftX = m_moveObject[i].posCurrent.X; + src2.RightX = m_moveObject[i].posCurrent.X + 60; + src2.TopY = m_moveObject[i].posCurrent.Y + 36; + src2.BottomY = m_moveObject[i].posCurrent.Y + 60; TinyRect dst; if (!Misc.IntersectRect(out dst, src2, src)) { @@ -8718,7 +8718,7 @@ namespace WindowsPhoneSpeedyBlupi } if (m_blupiDir == 2) { - if (pos.X < src2.Left) + if (pos.X < src2.LeftX) { if (m_moveObject[i].type == 2) { @@ -8728,7 +8728,7 @@ namespace WindowsPhoneSpeedyBlupi } return 64; } - if (pos.X < src2.Left) + if (pos.X < src2.LeftX) { return 64; } @@ -8748,15 +8748,15 @@ namespace WindowsPhoneSpeedyBlupi return false; } TinyRect src = default(TinyRect); - src.Left = pos.X + 16; - src.Right = pos.X + 60 - 16; - src.Top = pos.Y + 11; - src.Bottom = pos.Y + 60 - 2; + src.LeftX = pos.X + 16; + src.RightX = pos.X + 60 - 16; + src.TopY = pos.Y + 11; + src.BottomY = pos.Y + 60 - 2; TinyRect src2 = default(TinyRect); - src2.Left = m_blupiPos.X - 16 - 40; - src2.Right = m_blupiPos.X + 60 + 16 + 40; - src2.Top = m_blupiPos.Y + 11 - 40; - src2.Bottom = m_blupiPos.Y + 60 - 2 + 40; + src2.LeftX = m_blupiPos.X - 16 - 40; + src2.RightX = m_blupiPos.X + 60 + 16 + 40; + src2.TopY = m_blupiPos.Y + 11 - 40; + src2.BottomY = m_blupiPos.Y + 60 - 2 + 40; TinyRect dst; if (Misc.IntersectRect(out dst, src, src2)) { @@ -8772,17 +8772,17 @@ namespace WindowsPhoneSpeedyBlupi return; } TinyRect src = BlupiRect(pos); - src.Left = pos.X + 16; - src.Right = pos.X + 60 - 16; + src.LeftX = pos.X + 16; + src.RightX = pos.X + 60 - 16; TinyRect src2 = default(TinyRect); for (int i = 0; i < MAXMOVEOBJECT; i++) { if (m_moveObject[i].type == 96) { - src2.Left = m_moveObject[i].posCurrent.X - 100; - src2.Right = m_moveObject[i].posCurrent.X + 60 + 100; - src2.Top = m_moveObject[i].posCurrent.Y - 100; - src2.Bottom = m_moveObject[i].posCurrent.Y + 60 + 100; + src2.LeftX = m_moveObject[i].posCurrent.X - 100; + src2.RightX = m_moveObject[i].posCurrent.X + 60 + 100; + src2.TopY = m_moveObject[i].posCurrent.Y - 100; + src2.BottomY = m_moveObject[i].posCurrent.Y + 60 + 100; TinyRect dst; if (Misc.IntersectRect(out dst, src2, src)) { @@ -8796,13 +8796,13 @@ namespace WindowsPhoneSpeedyBlupi private int MoveObjectDetect(TinyPoint pos, out bool bNear) { TinyRect src = BlupiRect(pos); - src.Left = pos.X + 16; - src.Right = pos.X + 60 - 16; + src.LeftX = pos.X + 16; + src.RightX = pos.X + 60 - 16; TinyRect src2 = default(TinyRect); - src2.Left = src.Left - 20; - src2.Right = src.Right + 20; - src2.Top = src.Top - 40; - src2.Bottom = src.Bottom + 30; + src2.LeftX = src.LeftX - 20; + src2.RightX = src.RightX + 20; + src2.TopY = src.TopY - 40; + src2.BottomY = src.BottomY + 30; TinyRect src3 = default(TinyRect); for (int i = 0; i < MAXMOVEOBJECT; i++) { @@ -8810,45 +8810,45 @@ namespace WindowsPhoneSpeedyBlupi { continue; } - src3.Left = m_moveObject[i].posCurrent.X + 16; - src3.Right = m_moveObject[i].posCurrent.X + 60 - 16; - src3.Top = m_moveObject[i].posCurrent.Y + 36; - src3.Bottom = m_moveObject[i].posCurrent.Y + 60; + src3.LeftX = m_moveObject[i].posCurrent.X + 16; + src3.RightX = m_moveObject[i].posCurrent.X + 60 - 16; + src3.TopY = m_moveObject[i].posCurrent.Y + 36; + src3.BottomY = m_moveObject[i].posCurrent.Y + 60; if (m_moveObject[i].type == 3) { if (m_blupiAction == 6) { continue; } - src3.Top = m_moveObject[i].posCurrent.Y; - src3.Bottom = m_moveObject[i].posCurrent.Y + 60 - 36; + src3.TopY = m_moveObject[i].posCurrent.Y; + src3.BottomY = m_moveObject[i].posCurrent.Y + 60 - 36; } if (m_moveObject[i].type == 12) { - src3.Left = m_moveObject[i].posCurrent.X - 16; - src3.Right = m_moveObject[i].posCurrent.X + 64 + 16; - src3.Top = m_moveObject[i].posCurrent.Y; - src3.Bottom = m_moveObject[i].posCurrent.Y + 64; + src3.LeftX = m_moveObject[i].posCurrent.X - 16; + src3.RightX = m_moveObject[i].posCurrent.X + 64 + 16; + src3.TopY = m_moveObject[i].posCurrent.Y; + src3.BottomY = m_moveObject[i].posCurrent.Y + 64; if (m_blupiDir == 1) { - src3.Left += 20; + src3.LeftX += 20; } else { - src3.Right -= 20; + src3.RightX -= 20; } } if (m_moveObject[i].type == 17 || m_moveObject[i].type == 20 || m_moveObject[i].type == 44 || m_moveObject[i].type == 54) { - src3.Top = m_moveObject[i].posCurrent.Y + 16; - src3.Bottom = m_moveObject[i].posCurrent.Y + 60 - 16; + src3.TopY = m_moveObject[i].posCurrent.Y + 16; + src3.BottomY = m_moveObject[i].posCurrent.Y + 60 - 16; } if (m_moveObject[i].type == 23) { - src3.Left = m_moveObject[i].posCurrent.X + 24; - src3.Right = m_moveObject[i].posCurrent.X + 64 - 24; - src3.Top = m_moveObject[i].posCurrent.Y + 10; - src3.Bottom = m_moveObject[i].posCurrent.Y + 60 - 32; + src3.LeftX = m_moveObject[i].posCurrent.X + 24; + src3.RightX = m_moveObject[i].posCurrent.X + 64 - 24; + src3.TopY = m_moveObject[i].posCurrent.Y + 10; + src3.BottomY = m_moveObject[i].posCurrent.Y + 60 - 32; } TinyRect dst; if (Misc.IntersectRect(out dst, src3, src)) @@ -8873,19 +8873,19 @@ namespace WindowsPhoneSpeedyBlupi return -1; } TinyRect src = default(TinyRect); - src.Left = pos.X + 12; - src.Right = pos.X + 60 - 12; - src.Top = pos.Y + 60 - 2; - src.Bottom = pos.Y + 60 + height - 1; + src.LeftX = pos.X + 12; + src.RightX = pos.X + 60 - 12; + src.TopY = pos.Y + 60 - 2; + src.BottomY = pos.Y + 60 + height - 1; TinyRect src2 = default(TinyRect); for (int i = 0; i < MAXMOVEOBJECT; i++) { if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48) { - src2.Left = m_moveObject[i].posCurrent.X; - src2.Right = m_moveObject[i].posCurrent.X + 64; - src2.Top = m_moveObject[i].posCurrent.Y; - src2.Bottom = m_moveObject[i].posCurrent.Y + 16; + src2.LeftX = m_moveObject[i].posCurrent.X; + src2.RightX = m_moveObject[i].posCurrent.X + 64; + src2.TopY = m_moveObject[i].posCurrent.Y; + src2.BottomY = m_moveObject[i].posCurrent.Y + 16; TinyRect dst; if (Misc.IntersectRect(out dst, src2, src)) { @@ -8899,19 +8899,19 @@ namespace WindowsPhoneSpeedyBlupi private int MoveChargeDetect(TinyPoint pos) { TinyRect src = default(TinyRect); - src.Left = pos.X + 16; - src.Right = pos.X + 60 - 16; - src.Top = pos.Y + 11; - src.Bottom = pos.Y + 60 - 2; + src.LeftX = pos.X + 16; + src.RightX = pos.X + 60 - 16; + src.TopY = pos.Y + 11; + src.BottomY = pos.Y + 60 - 2; TinyRect src2 = default(TinyRect); for (int i = 0; i < MAXMOVEOBJECT; i++) { if (m_moveObject[i].type == 31) { - src2.Left = m_moveObject[i].posCurrent.X - 10; - src2.Right = m_moveObject[i].posCurrent.X + 60 + 10; - src2.Top = m_moveObject[i].posCurrent.Y + 36; - src2.Bottom = m_moveObject[i].posCurrent.Y + 60; + src2.LeftX = m_moveObject[i].posCurrent.X - 10; + src2.RightX = m_moveObject[i].posCurrent.X + 60 + 10; + src2.TopY = m_moveObject[i].posCurrent.Y + 36; + src2.BottomY = m_moveObject[i].posCurrent.Y + 60; TinyRect dst; if (Misc.IntersectRect(out dst, src2, src)) { @@ -8925,19 +8925,19 @@ namespace WindowsPhoneSpeedyBlupi private int MovePersoDetect(TinyPoint pos) { TinyRect src = default(TinyRect); - src.Left = pos.X + 16; - src.Right = pos.X + 60 - 16; - src.Top = pos.Y + 11; - src.Bottom = pos.Y + 60 - 2; + src.LeftX = pos.X + 16; + src.RightX = pos.X + 60 - 16; + src.TopY = pos.Y + 11; + src.BottomY = pos.Y + 60 - 2; TinyRect src2 = default(TinyRect); for (int i = 0; i < MAXMOVEOBJECT; i++) { if (m_moveObject[i].type >= 200 && m_moveObject[i].type <= 203) { - src2.Left = m_moveObject[i].posCurrent.X + 16; - src2.Right = m_moveObject[i].posCurrent.X + 60 - 16; - src2.Top = m_moveObject[i].posCurrent.Y + 36; - src2.Bottom = m_moveObject[i].posCurrent.Y + 60; + src2.LeftX = m_moveObject[i].posCurrent.X + 16; + src2.RightX = m_moveObject[i].posCurrent.X + 60 - 16; + src2.TopY = m_moveObject[i].posCurrent.Y + 36; + src2.BottomY = m_moveObject[i].posCurrent.Y + 60; TinyRect dst; if (Misc.IntersectRect(out dst, src2, src)) { @@ -9178,8 +9178,8 @@ namespace WindowsPhoneSpeedyBlupi foreach (ByeByeObject byeByeObject in byeByeObjects) { TinyPoint tinyPoint = default(TinyPoint); - tinyPoint.X = m_drawBounds.Left + (int)byeByeObject.posX - posDecor.X; - tinyPoint.Y = m_drawBounds.Top + (int)byeByeObject.posY - posDecor.Y; + tinyPoint.X = m_drawBounds.LeftX + (int)byeByeObject.posX - posDecor.X; + tinyPoint.Y = m_drawBounds.TopY + (int)byeByeObject.posY - posDecor.Y; TinyPoint pos = tinyPoint; m_pixmap.QuickIcon(byeByeObject.channel, byeByeObject.icon, pos, 1.0, byeByeObject.rotation); } diff --git a/Def.cs b/Def.cs index db874fc..aa0be4d 100644 --- a/Def.cs +++ b/Def.cs @@ -1,12 +1,15 @@ // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi.Def +using Microsoft.Xna.Framework.Input; +using static WindowsPhoneSpeedyBlupi.Def; namespace WindowsPhoneSpeedyBlupi { public static class Def { + public enum Phase { None, @@ -24,7 +27,7 @@ namespace WindowsPhoneSpeedyBlupi Ranking } - public enum ButtonGlygh + public enum ButtonGlyph { None, InitGamerA, diff --git a/Env.cs b/Env.cs new file mode 100644 index 0000000..aa84cf1 --- /dev/null +++ b/Env.cs @@ -0,0 +1,25 @@ +using System; +using static WindowsPhoneSpeedyBlupi.Xna; + +namespace WindowsPhoneSpeedyBlupi +{ + public static class Env + { + public static bool DETAILED_DEBUGGING { get; set; } + + public static Platform PLATFORM { get; private set; } + public static XnaImpl XNA_IMPL { get; private set; } + public static bool INITIALIZED { get; private set; } + + public static void init(XnaImpl xnaImpl, Platform platformIn) + { + if(INITIALIZED) + { + throw new Exception("Env was already initialized. Cannot call the init method again."); + } + XNA_IMPL = xnaImpl; + PLATFORM = platformIn; + INITIALIZED = true; + } + } +} diff --git a/Game1.cs b/Game1.cs index b3e3624..aab4510 100644 --- a/Game1.cs +++ b/Game1.cs @@ -4,6 +4,7 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Input.Touch; using Microsoft.Xna.Framework.Media; using WindowsPhoneSpeedyBlupi; using static System.Net.Mime.MediaTypeNames; @@ -19,18 +20,18 @@ namespace WindowsPhoneSpeedyBlupi 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.ButtonGlygh.Cheat22, - Def.ButtonGlygh.Cheat32, - Def.ButtonGlygh.Cheat12, - Def.ButtonGlygh.Cheat11, - Def.ButtonGlygh.Cheat21, - Def.ButtonGlygh.Cheat22, - Def.ButtonGlygh.Cheat21, - Def.ButtonGlygh.Cheat31, - Def.ButtonGlygh.Cheat32 + Def.ButtonGlyph.Cheat12, + Def.ButtonGlyph.Cheat22, + Def.ButtonGlyph.Cheat32, + Def.ButtonGlyph.Cheat12, + Def.ButtonGlyph.Cheat11, + Def.ButtonGlyph.Cheat21, + Def.ButtonGlyph.Cheat22, + Def.ButtonGlyph.Cheat21, + Def.ButtonGlyph.Cheat31, + Def.ButtonGlyph.Cheat32 }; private readonly GraphicsDeviceManager graphics; @@ -97,8 +98,18 @@ namespace WindowsPhoneSpeedyBlupi public Game1() { + if(!Env.INITIALIZED) + { + throw new Exception("Fatal error: Not initialized. Env.init() was not called."); + } + Exiting += OnExiting; + if(!TouchPanel.GetCapabilities().IsConnected) + { + this.IsMouseVisible = true; + Mouse.SetCursor(MouseCursor.Arrow); + } graphics = new GraphicsDeviceManager(this); - graphics.IsFullScreen = true; + graphics.IsFullScreen = false; base.Content.RootDirectory = "Content"; base.TargetElapsedTime = TimeSpan.FromTicks(500000L); base.InactiveSleepTime = TimeSpan.FromSeconds(1.0); @@ -157,10 +168,9 @@ namespace WindowsPhoneSpeedyBlupi base.OnActivated(sender, args); } - protected override void OnExiting(object sender, EventArgs args) + protected void OnExiting(object sender, EventArgs args) { decor.CurrentDelete(); - base.OnExiting(sender, args); } protected override void Update(GameTime gameTime) @@ -229,41 +239,41 @@ namespace WindowsPhoneSpeedyBlupi return; } inputPad.Update(); - Def.ButtonGlygh buttonPressed = inputPad.ButtonPressed; - if (buttonPressed >= Def.ButtonGlygh.InitGamerA && buttonPressed <= Def.ButtonGlygh.InitGamerC) + Def.ButtonGlyph buttonPressed = inputPad.ButtonPressed; + if (buttonPressed >= Def.ButtonGlyph.InitGamerA && buttonPressed <= Def.ButtonGlyph.InitGamerC) { SetGamer((int)(buttonPressed - 1)); return; } switch (buttonPressed) { - case Def.ButtonGlygh.InitSetup: + case Def.ButtonGlyph.InitSetup: SetPhase(Def.Phase.MainSetup); return; - case Def.ButtonGlygh.PauseSetup: + case Def.ButtonGlyph.PauseSetup: SetPhase(Def.Phase.PlaySetup); return; - case Def.ButtonGlygh.SetupSounds: + case Def.ButtonGlyph.SetupSounds: gameData.Sounds = !gameData.Sounds; gameData.Write(); return; - case Def.ButtonGlygh.SetupJump: + case Def.ButtonGlyph.SetupJump: gameData.JumpRight = !gameData.JumpRight; gameData.Write(); return; - case Def.ButtonGlygh.SetupZoom: + case Def.ButtonGlyph.SetupZoom: gameData.AutoZoom = !gameData.AutoZoom; gameData.Write(); return; - case Def.ButtonGlygh.SetupAccel: + case Def.ButtonGlyph.SetupAccel: gameData.AccelActive = !gameData.AccelActive; gameData.Write(); return; - case Def.ButtonGlygh.SetupReset: + case Def.ButtonGlyph.SetupReset: gameData.Reset(); gameData.Write(); return; - case Def.ButtonGlygh.SetupReturn: + case Def.ButtonGlyph.SetupReturn: if (playSetup) { SetPhase(Def.Phase.Play, -1); @@ -273,50 +283,50 @@ namespace WindowsPhoneSpeedyBlupi SetPhase(Def.Phase.Init); } return; - case Def.ButtonGlygh.InitPlay: + case Def.ButtonGlyph.InitPlay: SetPhase(Def.Phase.Play, 1); return; - case Def.ButtonGlygh.PlayPause: + case Def.ButtonGlyph.PlayPause: SetPhase(Def.Phase.Pause); return; - case Def.ButtonGlygh.WinLostReturn: - case Def.ButtonGlygh.PauseMenu: - case Def.ButtonGlygh.ResumeMenu: + case Def.ButtonGlyph.WinLostReturn: + case Def.ButtonGlyph.PauseMenu: + case Def.ButtonGlyph.ResumeMenu: SetPhase(Def.Phase.Init); break; } switch (buttonPressed) { - case Def.ButtonGlygh.ResumeContinue: + case Def.ButtonGlyph.ResumeContinue: ContinueMission(); return; - case Def.ButtonGlygh.InitBuy: - case Def.ButtonGlygh.TrialBuy: - Guide.ShowMarketplace(PlayerIndex.One); + case Def.ButtonGlyph.InitBuy: + case Def.ButtonGlyph.TrialBuy: + Guide.Show(PlayerIndex.One); SetPhase(Def.Phase.Init); return; - case Def.ButtonGlygh.InitRanking: + case Def.ButtonGlyph.InitRanking: SetPhase(Def.Phase.Ranking); return; - case Def.ButtonGlygh.TrialCancel: - case Def.ButtonGlygh.RankingContinue: + case Def.ButtonGlyph.TrialCancel: + case Def.ButtonGlyph.RankingContinue: SetPhase(Def.Phase.Init); return; - case Def.ButtonGlygh.PauseBack: + case Def.ButtonGlyph.PauseBack: MissionBack(); return; - case Def.ButtonGlygh.PauseRestart: + case Def.ButtonGlyph.PauseRestart: SetPhase(Def.Phase.Play, mission); return; - case Def.ButtonGlygh.PauseContinue: + case Def.ButtonGlyph.PauseContinue: SetPhase(Def.Phase.Play, -1); return; - case Def.ButtonGlygh.Cheat11: - case Def.ButtonGlygh.Cheat12: - case Def.ButtonGlygh.Cheat21: - case Def.ButtonGlygh.Cheat22: - case Def.ButtonGlygh.Cheat31: - case Def.ButtonGlygh.Cheat32: + case Def.ButtonGlyph.Cheat11: + case Def.ButtonGlyph.Cheat12: + case Def.ButtonGlyph.Cheat21: + case Def.ButtonGlyph.Cheat22: + case Def.ButtonGlyph.Cheat31: + case Def.ButtonGlyph.Cheat32: if (buttonPressed == cheatGeste[cheatGesteIndex]) { cheatGesteIndex++; @@ -338,7 +348,7 @@ namespace WindowsPhoneSpeedyBlupi } break; } - if (buttonPressed >= Def.ButtonGlygh.Cheat1 && buttonPressed <= Def.ButtonGlygh.Cheat9) + if (buttonPressed >= Def.ButtonGlyph.Cheat1 && buttonPressed <= Def.ButtonGlyph.Cheat9) { CheatAction(buttonPressed); } @@ -415,35 +425,35 @@ namespace WindowsPhoneSpeedyBlupi inputPad.StartMission(mission); } - private void CheatAction(Def.ButtonGlygh glyph) + private void CheatAction(Def.ButtonGlyph glyph) { switch (glyph) { - case Def.ButtonGlygh.Cheat1: + case Def.ButtonGlyph.Cheat1: decor.CheatAction(Tables.CheatCodes.OpenDoors); break; - case Def.ButtonGlygh.Cheat2: + case Def.ButtonGlyph.Cheat2: decor.CheatAction(Tables.CheatCodes.SuperBlupi); break; - case Def.ButtonGlygh.Cheat3: + case Def.ButtonGlyph.Cheat3: decor.CheatAction(Tables.CheatCodes.ShowSecret); break; - case Def.ButtonGlygh.Cheat4: + case Def.ButtonGlyph.Cheat4: decor.CheatAction(Tables.CheatCodes.LayEgg); break; - case Def.ButtonGlygh.Cheat5: + case Def.ButtonGlyph.Cheat5: gameData.Reset(); break; - case Def.ButtonGlygh.Cheat6: + case Def.ButtonGlyph.Cheat6: simulateTrialMode = !simulateTrialMode; break; - case Def.ButtonGlygh.Cheat7: + case Def.ButtonGlyph.Cheat7: decor.CheatAction(Tables.CheatCodes.CleanAll); break; - case Def.ButtonGlygh.Cheat8: + case Def.ButtonGlyph.Cheat8: decor.CheatAction(Tables.CheatCodes.AllTreasure); break; - case Def.ButtonGlygh.Cheat9: + case Def.ButtonGlyph.Cheat9: decor.CheatAction(Tables.CheatCodes.EndGoal); break; } @@ -497,10 +507,10 @@ namespace WindowsPhoneSpeedyBlupi { num = (1.0 - num) * (1.0 - num); TinyRect tinyRect = default(TinyRect); - tinyRect.Left = (int)(720.0 - 640.0 * num); - tinyRect.Right = (int)(1360.0 - 640.0 * num); - tinyRect.Top = 0; - tinyRect.Bottom = 160; + tinyRect.LeftX = (int)(720.0 - 640.0 * num); + tinyRect.RightX = (int)(1360.0 - 640.0 * num); + tinyRect.TopY = 0; + tinyRect.BottomY = 160; rect = tinyRect; opacity = num * num; } @@ -508,10 +518,10 @@ namespace WindowsPhoneSpeedyBlupi { num = ((fadeOutPhase != 0) ? (1.0 - num * 2.0) : (1.0 - (1.0 - num) * (1.0 - num))); TinyRect tinyRect2 = default(TinyRect); - tinyRect2.Left = 80; - tinyRect2.Right = 720; - tinyRect2.Top = (int)(-160.0 + num * 160.0); - tinyRect2.Bottom = (int)(0.0 + num * 160.0); + tinyRect2.LeftX = 80; + tinyRect2.RightX = 720; + tinyRect2.TopY = (int)(-160.0 + num * 160.0); + tinyRect2.BottomY = (int)(0.0 + num * 160.0); rect = tinyRect2; opacity = 1.0; } @@ -537,10 +547,10 @@ namespace WindowsPhoneSpeedyBlupi num = 1.0 + num * 10.0; } TinyRect tinyRect3 = default(TinyRect); - tinyRect3.Left = (int)(468.0 - 205.0 * num); - tinyRect3.Right = (int)(468.0 + 205.0 * num); - tinyRect3.Top = (int)(280.0 - 190.0 * num); - tinyRect3.Bottom = (int)(280.0 + 190.0 * num); + tinyRect3.LeftX = (int)(468.0 - 205.0 * num); + tinyRect3.RightX = (int)(468.0 + 205.0 * num); + tinyRect3.TopY = (int)(280.0 - 190.0 * num); + tinyRect3.BottomY = (int)(280.0 + 190.0 * num); TinyRect rect = tinyRect3; pixmap.DrawIcon(16, 0, rect, opacity, 0.0, false); } @@ -552,10 +562,10 @@ namespace WindowsPhoneSpeedyBlupi double opacity = 1.0 - num; num = 1.0 + num * 10.0; TinyRect tinyRect4 = default(TinyRect); - tinyRect4.Left = (int)(418.0 - 205.0 * num); - tinyRect4.Right = (int)(418.0 + 205.0 * num); - tinyRect4.Top = (int)(190.0 - 190.0 * num); - tinyRect4.Bottom = (int)(190.0 + 190.0 * num); + tinyRect4.LeftX = (int)(418.0 - 205.0 * num); + tinyRect4.RightX = (int)(418.0 + 205.0 * num); + tinyRect4.TopY = (int)(190.0 - 190.0 * num); + tinyRect4.BottomY = (int)(190.0 + 190.0 * num); TinyRect rect = tinyRect4; pixmap.DrawIcon(16, 0, rect, opacity, 0.0, false); } @@ -564,10 +574,10 @@ namespace WindowsPhoneSpeedyBlupi double num = Math.Min((double)phaseTime / 20.0, 1.0); num *= num; TinyRect tinyRect5 = default(TinyRect); - tinyRect5.Left = (int)(213.0 + 800.0 * num); - tinyRect5.Right = (int)(623.0 + 800.0 * num); - tinyRect5.Top = 0; - tinyRect5.Bottom = 0; + tinyRect5.LeftX = (int)(213.0 + 800.0 * num); + tinyRect5.RightX = (int)(623.0 + 800.0 * num); + tinyRect5.TopY = 0; + tinyRect5.BottomY = 0; TinyRect rect = tinyRect5; pixmap.DrawIcon(16, 0, rect, 1.0, 0.0, false); } @@ -584,10 +594,10 @@ namespace WindowsPhoneSpeedyBlupi num = 1.0 - num; } TinyRect tinyRect6 = default(TinyRect); - tinyRect6.Left = (int)(418.0 - 205.0 * num); - tinyRect6.Right = (int)(418.0 + 205.0 * num); - tinyRect6.Top = (int)(190.0 - 190.0 * num); - tinyRect6.Bottom = (int)(190.0 + 190.0 * num); + tinyRect6.LeftX = (int)(418.0 - 205.0 * num); + tinyRect6.RightX = (int)(418.0 + 205.0 * num); + tinyRect6.TopY = (int)(190.0 - 190.0 * num); + tinyRect6.BottomY = (int)(190.0 + 190.0 * num); TinyRect rect = tinyRect6; double rotation = 0.0; if (num < 1.0) @@ -620,23 +630,23 @@ namespace WindowsPhoneSpeedyBlupi num2 = 1.0 - num2; } TinyRect tinyRect7 = default(TinyRect); - tinyRect7.Left = (int)(720.0 - 640.0 * num); - tinyRect7.Right = (int)(1360.0 - 640.0 * num); - tinyRect7.Top = 0; - tinyRect7.Bottom = 160; + tinyRect7.LeftX = (int)(720.0 - 640.0 * num); + tinyRect7.RightX = (int)(1360.0 - 640.0 * num); + tinyRect7.TopY = 0; + tinyRect7.BottomY = 160; TinyRect rect = tinyRect7; pixmap.DrawIcon(15, 0, rect, num * num, false); TinyRect tinyRect8 = default(TinyRect); - tinyRect8.Left = 487; - tinyRect8.Right = 713; - tinyRect8.Top = 148; - tinyRect8.Bottom = 374; + tinyRect8.LeftX = 487; + tinyRect8.RightX = 713; + tinyRect8.TopY = 148; + tinyRect8.BottomY = 374; TinyRect rect2 = tinyRect8; TinyRect tinyRect9 = default(TinyRect); - tinyRect9.Left = 118; - tinyRect9.Right = 570; - tinyRect9.Top = 268; - tinyRect9.Bottom = 720; + tinyRect9.LeftX = 118; + tinyRect9.RightX = 570; + tinyRect9.TopY = 268; + tinyRect9.BottomY = 720; TinyRect rect3 = tinyRect9; double opacity = 0.5 - num * 0.4; double rotation = (0.0 - num2) * 100.0 * 2.5; @@ -647,10 +657,10 @@ namespace WindowsPhoneSpeedyBlupi { double num = Math.Min((double)phaseTime / 100.0, 1.0); TinyRect tinyRect10 = default(TinyRect); - tinyRect10.Left = (int)(418.0 - 205.0 * num); - tinyRect10.Right = (int)(418.0 + 205.0 * num); - tinyRect10.Top = (int)(238.0 - 190.0 * num); - tinyRect10.Bottom = (int)(238.0 + 190.0 * num); + tinyRect10.LeftX = (int)(418.0 - 205.0 * num); + tinyRect10.RightX = (int)(418.0 + 205.0 * num); + tinyRect10.TopY = (int)(238.0 - 190.0 * num); + tinyRect10.BottomY = (int)(238.0 + 190.0 * num); TinyRect rect = tinyRect10; double rotation = 0.0; if (num < 1.0) @@ -666,10 +676,10 @@ namespace WindowsPhoneSpeedyBlupi { double num = Math.Sin((double)phaseTime / 3.0) / 2.0 + 1.0; TinyRect tinyRect11 = default(TinyRect); - tinyRect11.Left = (int)(418.0 - 205.0 * num); - tinyRect11.Right = (int)(418.0 + 205.0 * num); - tinyRect11.Top = (int)(238.0 - 190.0 * num); - tinyRect11.Bottom = (int)(238.0 + 190.0 * num); + tinyRect11.LeftX = (int)(418.0 - 205.0 * num); + tinyRect11.RightX = (int)(418.0 + 205.0 * num); + tinyRect11.TopY = (int)(238.0 - 190.0 * num); + tinyRect11.BottomY = (int)(238.0 + 190.0 * num); TinyRect rect = tinyRect11; pixmap.DrawIcon(16, 0, rect, 1.0, 0.0, false); } @@ -683,17 +693,17 @@ namespace WindowsPhoneSpeedyBlupi int width = drawBounds.Width; int height = drawBounds.Height; TinyRect tinyRect = default(TinyRect); - tinyRect.Left = 10; - tinyRect.Right = 260; - tinyRect.Top = height - 325; - tinyRect.Bottom = height - 10; + tinyRect.LeftX = 10; + tinyRect.RightX = 260; + tinyRect.TopY = height - 325; + tinyRect.BottomY = height - 10; TinyRect rect = tinyRect; pixmap.DrawIcon(14, 15, rect, 0.3, false); TinyRect tinyRect2 = default(TinyRect); - tinyRect2.Left = width - 170; - tinyRect2.Right = width - 10; - tinyRect2.Top = height - ((IsTrialMode || IsRankingMode) ? 325 : 195); - tinyRect2.Bottom = height - 10; + tinyRect2.LeftX = width - 170; + tinyRect2.RightX = width - 10; + tinyRect2.TopY = height - ((IsTrialMode || IsRankingMode) ? 325 : 195); + tinyRect2.BottomY = height - 10; rect = tinyRect2; pixmap.DrawIcon(14, 15, rect, 0.3, false); } @@ -703,49 +713,49 @@ namespace WindowsPhoneSpeedyBlupi { if (phase == Def.Phase.Init) { - DrawButtonGamerText(Def.ButtonGlygh.InitGamerA, 0); - DrawButtonGamerText(Def.ButtonGlygh.InitGamerB, 1); - DrawButtonGamerText(Def.ButtonGlygh.InitGamerC, 2); - DrawTextUnderButton(Def.ButtonGlygh.InitPlay, MyResource.TX_BUTTON_PLAY); - DrawTextRightButton(Def.ButtonGlygh.InitSetup, MyResource.TX_BUTTON_SETUP); + DrawButtonGamerText(Def.ButtonGlyph.InitGamerA, 0); + DrawButtonGamerText(Def.ButtonGlyph.InitGamerB, 1); + DrawButtonGamerText(Def.ButtonGlyph.InitGamerC, 2); + DrawTextUnderButton(Def.ButtonGlyph.InitPlay, MyResource.TX_BUTTON_PLAY); + DrawTextRightButton(Def.ButtonGlyph.InitSetup, MyResource.TX_BUTTON_SETUP); if (IsTrialMode) { - DrawTextUnderButton(Def.ButtonGlygh.InitBuy, MyResource.TX_BUTTON_BUY); + DrawTextUnderButton(Def.ButtonGlyph.InitBuy, MyResource.TX_BUTTON_BUY); } if (IsRankingMode) { - DrawTextUnderButton(Def.ButtonGlygh.InitRanking, MyResource.TX_BUTTON_RANKING); + DrawTextUnderButton(Def.ButtonGlyph.InitRanking, MyResource.TX_BUTTON_RANKING); } } if (phase == Def.Phase.Pause) { - DrawTextUnderButton(Def.ButtonGlygh.PauseMenu, MyResource.TX_BUTTON_MENU); + DrawTextUnderButton(Def.ButtonGlyph.PauseMenu, MyResource.TX_BUTTON_MENU); 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) { - 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) { - DrawTextUnderButton(Def.ButtonGlygh.ResumeMenu, MyResource.TX_BUTTON_MENU); - DrawTextUnderButton(Def.ButtonGlygh.ResumeContinue, MyResource.TX_BUTTON_CONTINUE); + DrawTextUnderButton(Def.ButtonGlyph.ResumeMenu, MyResource.TX_BUTTON_MENU); + DrawTextUnderButton(Def.ButtonGlyph.ResumeContinue, MyResource.TX_BUTTON_CONTINUE); } if (phase == Def.Phase.MainSetup || phase == Def.Phase.PlaySetup) { - DrawTextRightButton(Def.ButtonGlygh.SetupSounds, MyResource.TX_BUTTON_SETUP_SOUNDS); - DrawTextRightButton(Def.ButtonGlygh.SetupJump, MyResource.TX_BUTTON_SETUP_JUMP); - DrawTextRightButton(Def.ButtonGlygh.SetupZoom, MyResource.TX_BUTTON_SETUP_ZOOM); - DrawTextRightButton(Def.ButtonGlygh.SetupAccel, MyResource.TX_BUTTON_SETUP_ACCEL); + DrawTextRightButton(Def.ButtonGlyph.SetupSounds, MyResource.TX_BUTTON_SETUP_SOUNDS); + DrawTextRightButton(Def.ButtonGlyph.SetupJump, MyResource.TX_BUTTON_SETUP_JUMP); + DrawTextRightButton(Def.ButtonGlyph.SetupZoom, MyResource.TX_BUTTON_SETUP_ZOOM); + DrawTextRightButton(Def.ButtonGlyph.SetupAccel, MyResource.TX_BUTTON_SETUP_ACCEL); if (phase == Def.Phase.MainSetup) { 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) @@ -765,16 +775,16 @@ namespace WindowsPhoneSpeedyBlupi Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL5), 0.7); pos.Y += 25; Text.DrawText(pixmap, pos, MyResource.LoadString(MyResource.TX_TRIAL6), 0.7); - DrawTextUnderButton(Def.ButtonGlygh.TrialBuy, MyResource.TX_BUTTON_BUY); - DrawTextUnderButton(Def.ButtonGlygh.TrialCancel, MyResource.TX_BUTTON_BACK); + DrawTextUnderButton(Def.ButtonGlyph.TrialBuy, MyResource.TX_BUTTON_BUY); + DrawTextUnderButton(Def.ButtonGlyph.TrialCancel, MyResource.TX_BUTTON_BACK); } 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); int nbVies; @@ -782,45 +792,45 @@ namespace WindowsPhoneSpeedyBlupi int secondaryDoors; gameData.GetGamerInfo(gamer, out nbVies, out mainDoors, out secondaryDoors); TinyPoint tinyPoint = default(TinyPoint); - tinyPoint.X = buttonRect.Right + 5 - pixmap.Origin.X; - tinyPoint.Y = buttonRect.Top + 3 - pixmap.Origin.Y; + tinyPoint.X = buttonRect.RightX + 5 - pixmap.Origin.X; + tinyPoint.Y = buttonRect.TopY + 3 - pixmap.Origin.Y; TinyPoint pos = tinyPoint; string text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_TITLE), new string((char)(65 + gamer), 1)); Text.DrawText(pixmap, pos, text, 0.7); TinyPoint tinyPoint2 = default(TinyPoint); - tinyPoint2.X = buttonRect.Right + 5 - pixmap.Origin.X; - tinyPoint2.Y = buttonRect.Top + 25 - pixmap.Origin.Y; + tinyPoint2.X = buttonRect.RightX + 5 - pixmap.Origin.X; + tinyPoint2.Y = buttonRect.TopY + 25 - pixmap.Origin.Y; pos = tinyPoint2; text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_MDOORS), mainDoors); Text.DrawText(pixmap, pos, text, 0.45); TinyPoint tinyPoint3 = default(TinyPoint); - tinyPoint3.X = buttonRect.Right + 5 - pixmap.Origin.X; - tinyPoint3.Y = buttonRect.Top + 39 - pixmap.Origin.Y; + tinyPoint3.X = buttonRect.RightX + 5 - pixmap.Origin.X; + tinyPoint3.Y = buttonRect.TopY + 39 - pixmap.Origin.Y; pos = tinyPoint3; text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_SDOORS), secondaryDoors); Text.DrawText(pixmap, pos, text, 0.45); TinyPoint tinyPoint4 = default(TinyPoint); - tinyPoint4.X = buttonRect.Right + 5 - pixmap.Origin.X; - tinyPoint4.Y = buttonRect.Top + 53 - pixmap.Origin.Y; + tinyPoint4.X = buttonRect.RightX + 5 - pixmap.Origin.X; + tinyPoint4.Y = buttonRect.TopY + 53 - pixmap.Origin.Y; pos = tinyPoint4; text = string.Format(MyResource.LoadString(MyResource.TX_GAMER_LIFES), nbVies); 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)); } - private void DrawTextRightButton(Def.ButtonGlygh glyph, string text) + private void DrawTextRightButton(Def.ButtonGlyph glyph, string text) { TinyRect buttonRect = inputPad.GetButtonRect(glyph); string[] array = text.Split('\n'); if (array.Length == 2) { TinyPoint tinyPoint = default(TinyPoint); - tinyPoint.X = buttonRect.Right + 10 - pixmap.Origin.X; - tinyPoint.Y = (buttonRect.Top + buttonRect.Bottom) / 2 - 20 - pixmap.Origin.Y; + tinyPoint.X = buttonRect.RightX + 10 - pixmap.Origin.X; + tinyPoint.Y = (buttonRect.TopY + buttonRect.BottomY) / 2 - 20 - pixmap.Origin.Y; TinyPoint pos = tinyPoint; Text.DrawText(pixmap, pos, array[0], 0.7); pos.Y += 24; @@ -829,19 +839,19 @@ namespace WindowsPhoneSpeedyBlupi else { TinyPoint tinyPoint2 = default(TinyPoint); - tinyPoint2.X = buttonRect.Right + 10 - pixmap.Origin.X; - tinyPoint2.Y = (buttonRect.Top + buttonRect.Bottom) / 2 - 8 - pixmap.Origin.Y; + tinyPoint2.X = buttonRect.RightX + 10 - pixmap.Origin.X; + tinyPoint2.Y = (buttonRect.TopY + buttonRect.BottomY) / 2 - 8 - pixmap.Origin.Y; TinyPoint pos2 = tinyPoint2; Text.DrawText(pixmap, pos2, text, 0.7); } } - private void DrawTextUnderButton(Def.ButtonGlygh glyph, int res) + private void DrawTextUnderButton(Def.ButtonGlyph glyph, int res) { TinyRect buttonRect = inputPad.GetButtonRect(glyph); TinyPoint tinyPoint = default(TinyPoint); - tinyPoint.X = (buttonRect.Left + buttonRect.Right) / 2 - pixmap.Origin.X; - tinyPoint.Y = buttonRect.Bottom + 2 - pixmap.Origin.Y; + tinyPoint.X = (buttonRect.LeftX + buttonRect.RightX) / 2 - pixmap.Origin.X; + tinyPoint.Y = buttonRect.BottomY + 2 - pixmap.Origin.Y; TinyPoint pos = tinyPoint; string text = MyResource.LoadString(res); Text.DrawTextCenter(pixmap, pos, text, 0.7); @@ -963,5 +973,16 @@ namespace WindowsPhoneSpeedyBlupi decor.MemorizeDoors(gameData); gameData.Write(); } + + public void ToggleFullScreen() + { + this.graphics.ToggleFullScreen(); + } + public bool IsFullScreen() { return this.graphics.IsFullScreen; } + + public GraphicsDeviceManager getGraphics() + { + return graphics; + } } } \ No newline at end of file diff --git a/InputPad.cs b/InputPad.cs index c1aefe2..8c90776 100644 --- a/InputPad.cs +++ b/InputPad.cs @@ -2,16 +2,18 @@ // WindowsPhoneSpeedyBlupi.InputPad using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using Microsoft.Devices.Sensors; +using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input.Touch; -using WindowsPhoneSpeedyBlupi; +using static WindowsPhoneSpeedyBlupi.Xna; namespace WindowsPhoneSpeedyBlupi { public class InputPad { - private static readonly int padSize = 140; + private static readonly int padRadius = 140; private readonly Game1 game1; @@ -23,7 +25,7 @@ namespace WindowsPhoneSpeedyBlupi private readonly GameData gameData; - private readonly List pressedGlyphs; + private readonly List pressedGlyphs; private readonly Accelerometer accelSensor; @@ -35,11 +37,11 @@ namespace WindowsPhoneSpeedyBlupi private TinyPoint padTouchPos; - private Def.ButtonGlygh lastButtonDown; + private Def.ButtonGlyph lastButtonDown; - private Def.ButtonGlygh buttonPressed; + private Def.ButtonGlyph buttonPressed; - private int totalTouch; + private int touchCount; private bool accelStarted; @@ -63,16 +65,16 @@ namespace WindowsPhoneSpeedyBlupi { get { - return totalTouch; + return touchCount; } } - public Def.ButtonGlygh ButtonPressed + public Def.ButtonGlyph ButtonPressed { get { - Def.ButtonGlygh result = buttonPressed; - buttonPressed = Def.ButtonGlygh.None; + Def.ButtonGlyph result = buttonPressed; + buttonPressed = Def.ButtonGlyph.None; return result; } } @@ -89,117 +91,110 @@ namespace WindowsPhoneSpeedyBlupi } } - private IEnumerable ButtonGlyphs + private IEnumerable ButtonGlyphs { get { switch (Phase) { case Def.Phase.Init: - yield return Def.ButtonGlygh.InitGamerA; - yield return Def.ButtonGlygh.InitGamerB; - yield return Def.ButtonGlygh.InitGamerC; - yield return Def.ButtonGlygh.InitSetup; - yield return Def.ButtonGlygh.InitPlay; + yield return Def.ButtonGlyph.InitGamerA; + yield return Def.ButtonGlyph.InitGamerB; + yield return Def.ButtonGlyph.InitGamerC; + yield return Def.ButtonGlyph.InitSetup; + yield return Def.ButtonGlyph.InitPlay; if (game1.IsTrialMode) { - yield return Def.ButtonGlygh.InitBuy; + yield return Def.ButtonGlyph.InitBuy; } if (game1.IsRankingMode) { - yield return Def.ButtonGlygh.InitRanking; + yield return Def.ButtonGlyph.InitRanking; } break; case Def.Phase.Play: - yield return Def.ButtonGlygh.PlayPause; - yield return Def.ButtonGlygh.PlayAction; - yield return Def.ButtonGlygh.PlayJump; + yield return Def.ButtonGlyph.PlayPause; + yield return Def.ButtonGlyph.PlayAction; + yield return Def.ButtonGlyph.PlayJump; if (accelStarted) { - yield return Def.ButtonGlygh.PlayDown; + yield return Def.ButtonGlyph.PlayDown; } - yield return Def.ButtonGlygh.Cheat11; - yield return Def.ButtonGlygh.Cheat12; - yield return Def.ButtonGlygh.Cheat21; - yield return Def.ButtonGlygh.Cheat22; - yield return Def.ButtonGlygh.Cheat31; - yield return Def.ButtonGlygh.Cheat32; + yield return Def.ButtonGlyph.Cheat11; + yield return Def.ButtonGlyph.Cheat12; + yield return Def.ButtonGlyph.Cheat21; + yield return Def.ButtonGlyph.Cheat22; + yield return Def.ButtonGlyph.Cheat31; + yield return Def.ButtonGlyph.Cheat32; break; case Def.Phase.Pause: - yield return Def.ButtonGlygh.PauseMenu; + yield return Def.ButtonGlyph.PauseMenu; if (mission != 1) { - yield return Def.ButtonGlygh.PauseBack; + yield return Def.ButtonGlyph.PauseBack; } - yield return Def.ButtonGlygh.PauseSetup; + yield return Def.ButtonGlyph.PauseSetup; if (mission != 1 && mission % 10 != 0) { - yield return Def.ButtonGlygh.PauseRestart; + yield return Def.ButtonGlyph.PauseRestart; } - yield return Def.ButtonGlygh.PauseContinue; + yield return Def.ButtonGlyph.PauseContinue; break; case Def.Phase.Resume: - yield return Def.ButtonGlygh.ResumeMenu; - yield return Def.ButtonGlygh.ResumeContinue; + yield return Def.ButtonGlyph.ResumeMenu; + yield return Def.ButtonGlyph.ResumeContinue; break; case Def.Phase.Lost: case Def.Phase.Win: - yield return Def.ButtonGlygh.WinLostReturn; + yield return Def.ButtonGlyph.WinLostReturn; break; case Def.Phase.Trial: - yield return Def.ButtonGlygh.TrialBuy; - yield return Def.ButtonGlygh.TrialCancel; + yield return Def.ButtonGlyph.TrialBuy; + yield return Def.ButtonGlyph.TrialCancel; break; case Def.Phase.MainSetup: - yield return Def.ButtonGlygh.SetupSounds; - yield return Def.ButtonGlygh.SetupJump; - yield return Def.ButtonGlygh.SetupZoom; - yield return Def.ButtonGlygh.SetupAccel; - yield return Def.ButtonGlygh.SetupReset; - yield return Def.ButtonGlygh.SetupReturn; + yield return Def.ButtonGlyph.SetupSounds; + yield return Def.ButtonGlyph.SetupJump; + yield return Def.ButtonGlyph.SetupZoom; + yield return Def.ButtonGlyph.SetupAccel; + yield return Def.ButtonGlyph.SetupReset; + yield return Def.ButtonGlyph.SetupReturn; break; case Def.Phase.PlaySetup: - yield return Def.ButtonGlygh.SetupSounds; - yield return Def.ButtonGlygh.SetupJump; - yield return Def.ButtonGlygh.SetupZoom; - yield return Def.ButtonGlygh.SetupAccel; - yield return Def.ButtonGlygh.SetupReturn; + yield return Def.ButtonGlyph.SetupSounds; + yield return Def.ButtonGlyph.SetupJump; + yield return Def.ButtonGlyph.SetupZoom; + yield return Def.ButtonGlyph.SetupAccel; + yield return Def.ButtonGlyph.SetupReturn; break; case Def.Phase.Ranking: - yield return Def.ButtonGlygh.RankingContinue; + yield return Def.ButtonGlyph.RankingContinue; break; } if (showCheatMenu) { - yield return Def.ButtonGlygh.Cheat1; - yield return Def.ButtonGlygh.Cheat2; - yield return Def.ButtonGlygh.Cheat3; - yield return Def.ButtonGlygh.Cheat4; - yield return Def.ButtonGlygh.Cheat5; - yield return Def.ButtonGlygh.Cheat6; - yield return Def.ButtonGlygh.Cheat7; - yield return Def.ButtonGlygh.Cheat8; - yield return Def.ButtonGlygh.Cheat9; + yield return Def.ButtonGlyph.Cheat1; + yield return Def.ButtonGlyph.Cheat2; + yield return Def.ButtonGlyph.Cheat3; + yield return Def.ButtonGlyph.Cheat4; + yield return Def.ButtonGlyph.Cheat5; + yield return Def.ButtonGlyph.Cheat6; + yield return Def.ButtonGlyph.Cheat7; + yield return Def.ButtonGlyph.Cheat8; + yield return Def.ButtonGlyph.Cheat9; } } } - + /// + /// Returns the point of the cente of the pad on the screen. + /// private TinyPoint PadCenter { get { TinyRect drawBounds = pixmap.DrawBounds; - if (gameData.JumpRight) - { - TinyPoint result = default(TinyPoint); - result.X = 100; - result.Y = drawBounds.Height - 100; - return result; - } - TinyPoint result2 = default(TinyPoint); - result2.X = drawBounds.Width - 100; - result2.Y = drawBounds.Height - 100; - return result2; + int x = gameData.JumpRight ? 100 : drawBounds.Width - 100; + return new TinyPoint(x, drawBounds.Height - 100); } } @@ -212,20 +207,12 @@ namespace WindowsPhoneSpeedyBlupi this.pixmap = pixmap; this.sound = sound; this.gameData = gameData; - pressedGlyphs = new List(); + pressedGlyphs = new List(); accelSensor = new Accelerometer(); ((SensorBase)(object)accelSensor).CurrentValueChanged += HandleAccelSensorCurrentValueChanged; - accelSlider = new Slider - { - TopLeftCorner = new TinyPoint - { - X = 320, - Y = 400 - }, - Value = this.gameData.AccelSensitivity - }; - lastButtonDown = Def.ButtonGlygh.None; - buttonPressed = Def.ButtonGlygh.None; + accelSlider = new Slider(new TinyPoint(320, 400), this.gameData.AccelSensitivity); + lastButtonDown = Def.ButtonGlyph.None; + buttonPressed = Def.ButtonGlyph.None; } public void StartMission(int mission) @@ -249,189 +236,324 @@ namespace WindowsPhoneSpeedyBlupi StopAccel(); } } - double num = 0.0; - double num2 = 0.0; - int num3 = 0; + double horizontalChange = 0.0; + double verticalChange = 0.0; + int keyPress = 0; padPressed = false; - Def.ButtonGlygh buttonGlygh = Def.ButtonGlygh.None; - TouchCollection state = TouchPanel.GetState(); - totalTouch = state.Count; - foreach (TouchLocation item in state) + Def.ButtonGlyph buttonGlyph = Def.ButtonGlyph.None; + TouchCollection touches = TouchPanel.GetState(); + touchCount = touches.Count; + List touchesOrClicks = new List(); + foreach (TouchLocation item in touches) { if (item.State == TouchLocationState.Pressed || item.State == TouchLocationState.Moved) { - TinyPoint tinyPoint = default(TinyPoint); - tinyPoint.X = (int)item.Position.X; - tinyPoint.Y = (int)item.Position.Y; - TinyPoint tinyPoint2 = tinyPoint; - if (!accelStarted && Misc.IsInside(GetPadBounds(PadCenter, padSize), tinyPoint2)) + TinyPoint touchPress = new TinyPoint((int)item.Position.X, (int)item.Position.Y); + touchesOrClicks.Add(touchPress); + } + } + + MouseState mouseState = Mouse.GetState(); + if (mouseState.LeftButton == ButtonState.Pressed) + { + touchCount++; + TinyPoint mouseClick = new TinyPoint(mouseState.X, mouseState.Y); + touchesOrClicks.Add(mouseClick); + } + + float screenWidth = game1.getGraphics().GraphicsDevice.Viewport.Width; + float screenHeight = game1.getGraphics().GraphicsDevice.Viewport.Height; + float screenRatio = screenWidth / screenHeight; + + if (Env.PLATFORM == Platform.Android &&screenRatio > 1.3333333333333333) + { + for (int i = 0; i < touchesOrClicks.Count; i++) + { + + var touchOrClick = touchesOrClicks[i]; + if (touchOrClick.X == -1) continue; + + float originalX = touchOrClick.X; + float originalY = touchOrClick.Y; + + float widthHeightRatio = screenWidth / screenHeight; + float heightRatio = 480 / screenHeight; + float widthRatio = 640 / screenWidth; + if(Env.DETAILED_DEBUGGING) + { + Debug.WriteLine("-----"); + Debug.WriteLine("originalX=" + originalX); + Debug.WriteLine("originalY=" + originalY); + Debug.WriteLine("heightRatio=" + heightRatio); + Debug.WriteLine("widthRatio=" + widthRatio); + Debug.WriteLine("widthHeightRatio=" + widthHeightRatio); + } + if (screenHeight> 480) { + touchOrClick.X = (int)(originalX * heightRatio); + touchOrClick.Y = (int)(originalY * heightRatio); + touchesOrClicks[i] = touchOrClick; + } + + if(Env.DETAILED_DEBUGGING) Debug.WriteLine("new X" + touchOrClick.X); + if(Env.DETAILED_DEBUGGING) Debug.WriteLine("new Y" + touchOrClick.Y); + } + } + + KeyboardState newKeyboardState = Keyboard.GetState(); + Keys[] keysToBeChecked = new Keys[6] { Keys.LeftControl, Keys.Up, Keys.Right, Keys.Down, Keys.Left, Keys.Space }; + foreach(Keys keys in keysToBeChecked) { + if (newKeyboardState.IsKeyDown(keys)) touchesOrClicks.Add(new TinyPoint(-1, (int)keys)); + } + if (newKeyboardState.IsKeyDown(Keys.F11)) + { + game1.ToggleFullScreen (); + Debug.WriteLine("F11 was pressed."); + } + + Boolean keyPressedUp = false; + Boolean keyPressedDown = false; + Boolean keyPressedLeft = false; + Boolean keyPressedRight = false; + foreach (TinyPoint touchOrClickItem in touchesOrClicks) + { + Boolean keyboardPressed = false; + if (touchOrClickItem.X == -1) + { + keyboardPressed = true; + } + Keys keyPressed = keyboardPressed ? (Keys)touchOrClickItem.Y : Keys.None; + keyPressedUp = keyPressed == Keys.Up ? true : keyPressedUp; + keyPressedDown = keyPressed == Keys.Down ? true : keyPressedDown; + keyPressedLeft = keyPressed == Keys.Left ? true : keyPressedLeft; + keyPressedRight = keyPressed == Keys.Right ? true : keyPressedRight; + + { + TinyPoint touchOrClick = keyboardPressed ? new TinyPoint(1, 1) : touchOrClickItem; + if (!accelStarted && Misc.IsInside(GetPadBounds(PadCenter, padRadius), touchOrClick)) { padPressed = true; - padTouchPos = tinyPoint2; + padTouchPos = touchOrClick; } - Def.ButtonGlygh buttonGlygh2 = ButtonDetect(tinyPoint2); - if (buttonGlygh2 != 0) + if (keyPressedUp || keyPressedDown || keyPressedLeft || keyPressedRight) { - pressedGlyphs.Add(buttonGlygh2); + padPressed = true; } - if ((Phase == Def.Phase.MainSetup || Phase == Def.Phase.PlaySetup) && accelSlider.Move(tinyPoint2)) + Debug.WriteLine("padPressed=" + padPressed); + Def.ButtonGlyph pressedGlyph = ButtonDetect(touchOrClick); + Debug.WriteLine("buttonGlyph2 =" + pressedGlyph); + if (pressedGlyph != 0) + { + pressedGlyphs.Add(pressedGlyph); + } + if (keyboardPressed) + { + switch (keyPressed) + { + case Keys.LeftControl: pressedGlyph = Def.ButtonGlyph.PlayJump; pressedGlyphs.Add(pressedGlyph); break; + case Keys.Space: pressedGlyph = Def.ButtonGlyph.PlayAction; pressedGlyphs.Add(pressedGlyph); break; + } + } + + if ((Phase == Def.Phase.MainSetup || Phase == Def.Phase.PlaySetup) && accelSlider.Move(touchOrClick)) { gameData.AccelSensitivity = accelSlider.Value; } - switch (buttonGlygh2) + switch (pressedGlyph) { - case Def.ButtonGlygh.PlayJump: + case Def.ButtonGlyph.PlayJump: + Debug.WriteLine("Jumping detected"); accelWaitZero = false; - num3 |= 1; + keyPress |= 1; break; - case Def.ButtonGlygh.PlayDown: + case Def.ButtonGlyph.PlayDown: accelWaitZero = false; - num3 |= 4; + keyPress |= 4; break; - case Def.ButtonGlygh.InitGamerA: - case Def.ButtonGlygh.InitGamerB: - case Def.ButtonGlygh.InitGamerC: - case Def.ButtonGlygh.InitSetup: - case Def.ButtonGlygh.InitPlay: - case Def.ButtonGlygh.InitBuy: - case Def.ButtonGlygh.InitRanking: - case Def.ButtonGlygh.WinLostReturn: - case Def.ButtonGlygh.TrialBuy: - case Def.ButtonGlygh.TrialCancel: - case Def.ButtonGlygh.SetupSounds: - case Def.ButtonGlygh.SetupJump: - case Def.ButtonGlygh.SetupZoom: - case Def.ButtonGlygh.SetupAccel: - case Def.ButtonGlygh.SetupReset: - case Def.ButtonGlygh.SetupReturn: - case Def.ButtonGlygh.PauseMenu: - case Def.ButtonGlygh.PauseBack: - case Def.ButtonGlygh.PauseSetup: - case Def.ButtonGlygh.PauseRestart: - case Def.ButtonGlygh.PauseContinue: - case Def.ButtonGlygh.PlayPause: - case Def.ButtonGlygh.PlayAction: - case Def.ButtonGlygh.ResumeMenu: - case Def.ButtonGlygh.ResumeContinue: - case Def.ButtonGlygh.RankingContinue: - case Def.ButtonGlygh.Cheat11: - case Def.ButtonGlygh.Cheat12: - case Def.ButtonGlygh.Cheat21: - case Def.ButtonGlygh.Cheat22: - case Def.ButtonGlygh.Cheat31: - case Def.ButtonGlygh.Cheat32: - case Def.ButtonGlygh.Cheat1: - case Def.ButtonGlygh.Cheat2: - case Def.ButtonGlygh.Cheat3: - case Def.ButtonGlygh.Cheat4: - case Def.ButtonGlygh.Cheat5: - case Def.ButtonGlygh.Cheat6: - case Def.ButtonGlygh.Cheat7: - case Def.ButtonGlygh.Cheat8: - case Def.ButtonGlygh.Cheat9: + case Def.ButtonGlyph.InitGamerA: + case Def.ButtonGlyph.InitGamerB: + case Def.ButtonGlyph.InitGamerC: + case Def.ButtonGlyph.InitSetup: + case Def.ButtonGlyph.InitPlay: + case Def.ButtonGlyph.InitBuy: + case Def.ButtonGlyph.InitRanking: + case Def.ButtonGlyph.WinLostReturn: + case Def.ButtonGlyph.TrialBuy: + case Def.ButtonGlyph.TrialCancel: + case Def.ButtonGlyph.SetupSounds: + case Def.ButtonGlyph.SetupJump: + case Def.ButtonGlyph.SetupZoom: + case Def.ButtonGlyph.SetupAccel: + case Def.ButtonGlyph.SetupReset: + case Def.ButtonGlyph.SetupReturn: + case Def.ButtonGlyph.PauseMenu: + case Def.ButtonGlyph.PauseBack: + case Def.ButtonGlyph.PauseSetup: + case Def.ButtonGlyph.PauseRestart: + case Def.ButtonGlyph.PauseContinue: + case Def.ButtonGlyph.PlayPause: + case Def.ButtonGlyph.PlayAction: + case Def.ButtonGlyph.ResumeMenu: + case Def.ButtonGlyph.ResumeContinue: + case Def.ButtonGlyph.RankingContinue: + case Def.ButtonGlyph.Cheat11: + case Def.ButtonGlyph.Cheat12: + case Def.ButtonGlyph.Cheat21: + case Def.ButtonGlyph.Cheat22: + case Def.ButtonGlyph.Cheat31: + case Def.ButtonGlyph.Cheat32: + case Def.ButtonGlyph.Cheat1: + case Def.ButtonGlyph.Cheat2: + case Def.ButtonGlyph.Cheat3: + case Def.ButtonGlyph.Cheat4: + case Def.ButtonGlyph.Cheat5: + case Def.ButtonGlyph.Cheat6: + case Def.ButtonGlyph.Cheat7: + case Def.ButtonGlyph.Cheat8: + case Def.ButtonGlyph.Cheat9: accelWaitZero = false; - buttonGlygh = buttonGlygh2; + buttonGlyph = pressedGlyph; showCheatMenu = false; break; } } } - if (buttonGlygh != 0 && buttonGlygh != Def.ButtonGlygh.PlayAction && buttonGlygh != Def.ButtonGlygh.Cheat11 && buttonGlygh != Def.ButtonGlygh.Cheat12 && buttonGlygh != Def.ButtonGlygh.Cheat21 && buttonGlygh != Def.ButtonGlygh.Cheat22 && buttonGlygh != Def.ButtonGlygh.Cheat31 && buttonGlygh != Def.ButtonGlygh.Cheat32 && lastButtonDown == Def.ButtonGlygh.None) + if (buttonGlyph != 0 && buttonGlyph != Def.ButtonGlyph.PlayAction && buttonGlyph != Def.ButtonGlyph.Cheat11 && buttonGlyph != Def.ButtonGlyph.Cheat12 && buttonGlyph != Def.ButtonGlyph.Cheat21 && buttonGlyph != Def.ButtonGlyph.Cheat22 && buttonGlyph != Def.ButtonGlyph.Cheat31 && buttonGlyph != Def.ButtonGlyph.Cheat32 && lastButtonDown == Def.ButtonGlyph.None) { - TinyPoint tinyPoint3 = default(TinyPoint); - tinyPoint3.X = 320; - tinyPoint3.Y = 240; - TinyPoint pos = tinyPoint3; + TinyPoint pos = new TinyPoint(320, 240); sound.PlayImage(0, pos); } - if (buttonGlygh == Def.ButtonGlygh.None && lastButtonDown != 0) + if (buttonGlyph == Def.ButtonGlyph.None && lastButtonDown != 0) { buttonPressed = lastButtonDown; } - lastButtonDown = buttonGlygh; + lastButtonDown = buttonGlyph; if (padPressed) { - double num4 = padTouchPos.X - PadCenter.X; - double num5 = padTouchPos.Y - PadCenter.Y; - if (num4 > 20.0) + Debug.WriteLine("PadCenter.X=" + PadCenter.X); + Debug.WriteLine("PadCenter.Y=" + PadCenter.Y); + Debug.WriteLine("padTouchPos.X=" + padTouchPos.X); + Debug.WriteLine("padTouchPos.Y=" + padTouchPos.Y); + Debug.WriteLine("keyPressedUp=" + keyPressedUp); + Debug.WriteLine("keyPressedDown=" + keyPressedDown); + Debug.WriteLine("keyPressedLeft=" + keyPressedLeft); + Debug.WriteLine(" keyPressedRight=" + keyPressedRight); { - num += 1.0; + if (keyPressedUp) + { + padTouchPos.Y = PadCenter.Y - 30; + padTouchPos.X = PadCenter.X; + if (keyPressedLeft) padTouchPos.X = PadCenter.X - 30; + if (keyPressedRight) padTouchPos.X = PadCenter.X + 30; + } + if (keyPressedDown) { + padTouchPos.Y = PadCenter.Y + 30; + padTouchPos.X = PadCenter.X; + if (keyPressedLeft) padTouchPos.X = PadCenter.X - 30; + if (keyPressedRight) padTouchPos.X = PadCenter.X + 30; + } + if (keyPressedLeft) { + padTouchPos.X = PadCenter.X - 30; + padTouchPos.Y = PadCenter.Y; + if (keyPressedUp) padTouchPos.Y = PadCenter.Y - 30; + if (keyPressedDown) padTouchPos.Y = PadCenter.Y + 30; + } + if (keyPressedRight) { + padTouchPos.X = PadCenter.X + 30; + padTouchPos.Y = PadCenter.Y; + if (keyPressedUp) padTouchPos.Y = PadCenter.Y - 30; + if (keyPressedDown) padTouchPos.Y = PadCenter.Y + 30; + } } - if (num4 < -20.0) + double horizontalPosition = padTouchPos.X - PadCenter.X; + double verticalPosition = padTouchPos.Y - PadCenter.Y; + + if (horizontalPosition > 20.0) { - num -= 1.0; + horizontalChange += 1.0; + Debug.WriteLine(" horizontalChange += 1.0;"); } - if (num5 > 20.0) + if (horizontalPosition < -20.0) { - num2 += 1.0; + horizontalChange -= 1.0; + Debug.WriteLine(" horizontalChange -= 1.0;"); + } - if (num5 < -20.0) + if (verticalPosition > 20.0) { - num2 -= 1.0; + verticalChange += 1.0; + Debug.WriteLine(" verticalPosition += 1.0;"); + } + if (verticalPosition < -20.0) + { + verticalChange -= 1.0; + Debug.WriteLine(" verticalPosition -= 1.0;"); + } + } if (accelStarted) { - num = accelSpeedX; - num2 = 0.0; - if (((uint)num3 & 4u) != 0) + horizontalChange = accelSpeedX; + verticalChange = 0.0; + if (((uint)keyPress & 4u) != 0) { - num2 = 1.0; + verticalChange = 1.0; } } - decor.SetSpeedX(num); - decor.SetSpeedY(num2); - decor.KeyChange(num3); + decor.SetSpeedX(horizontalChange); + decor.SetSpeedY(verticalChange); + decor.KeyChange(keyPress); } - private Def.ButtonGlygh ButtonDetect(TinyPoint pos) + private Def.ButtonGlyph ButtonDetect(TinyPoint touchOrClick) { - foreach (Def.ButtonGlygh item in ButtonGlyphs.Reverse()) + foreach (Def.ButtonGlyph buttonGlyph in ButtonGlyphs.Reverse()) { - int value = 0; - if (item == Def.ButtonGlygh.PlayJump || item == Def.ButtonGlygh.PlayAction || item == Def.ButtonGlygh.PlayDown || item == Def.ButtonGlygh.PlayPause) + TinyRect buttonRect = GetButtonRect(buttonGlyph); + + if (buttonGlyph == Def.ButtonGlyph.PlayJump || buttonGlyph == Def.ButtonGlyph.PlayAction || buttonGlyph == Def.ButtonGlyph.PlayDown || buttonGlyph == Def.ButtonGlyph.PlayPause) { - value = 20; + buttonRect = Misc.Inflate(buttonRect, 20); } - TinyRect rect = Misc.Inflate(GetButtonRect(item), value); - if (Misc.IsInside(rect, pos)) + + if (Misc.IsInside(buttonRect, touchOrClick)) { - return item; + return buttonGlyph; } } - return Def.ButtonGlygh.None; + return Def.ButtonGlyph.None; } public void Draw() { if (!accelStarted && Phase == Def.Phase.Play) { - pixmap.DrawIcon(14, 0, GetPadBounds(PadCenter, padSize / 2), 1.0, false); + pixmap.DrawIcon(14, 0, GetPadBounds(PadCenter, padRadius / 2), 1.0, false); TinyPoint center = (padPressed ? padTouchPos : PadCenter); - pixmap.DrawIcon(14, 1, GetPadBounds(center, padSize / 2), 1.0, false); + pixmap.DrawIcon(14, 1, GetPadBounds(center, padRadius / 2), 1.0, false); } - foreach (Def.ButtonGlygh buttonGlyph in ButtonGlyphs) + foreach (Def.ButtonGlyph buttonGlyph in ButtonGlyphs) { bool pressed = pressedGlyphs.Contains(buttonGlyph); bool selected = false; - if (buttonGlyph >= Def.ButtonGlygh.InitGamerA && buttonGlyph <= Def.ButtonGlygh.InitGamerC) + if (buttonGlyph >= Def.ButtonGlyph.InitGamerA && buttonGlyph <= Def.ButtonGlyph.InitGamerC) { - int num = (int)(buttonGlyph - 1); - selected = num == gameData.SelectedGamer; + int selectedGamer = (int)(buttonGlyph - 1); + selected = selectedGamer == gameData.SelectedGamer; } - if (buttonGlyph == Def.ButtonGlygh.SetupSounds) + if (buttonGlyph == Def.ButtonGlyph.SetupSounds) { selected = gameData.Sounds; } - if (buttonGlyph == Def.ButtonGlygh.SetupJump) + if (buttonGlyph == Def.ButtonGlyph.SetupJump) { selected = gameData.JumpRight; } - if (buttonGlyph == Def.ButtonGlygh.SetupZoom) + if (buttonGlyph == Def.ButtonGlyph.SetupZoom) { selected = gameData.AutoZoom; } - if (buttonGlyph == Def.ButtonGlygh.SetupAccel) + if (buttonGlyph == Def.ButtonGlyph.SetupAccel) { selected = gameData.AccelActive; } @@ -445,357 +567,354 @@ namespace WindowsPhoneSpeedyBlupi private TinyRect GetPadBounds(TinyPoint center, int radius) { - TinyRect result = default(TinyRect); - result.Left = center.X - radius; - result.Right = center.X + radius; - result.Top = center.Y - radius; - result.Bottom = center.Y + radius; - return result; + return new TinyRect(center.X - radius, center.X + radius, center.Y - radius, center.Y + radius); } - public TinyRect GetButtonRect(Def.ButtonGlygh glyph) + public TinyRect GetButtonRect(Def.ButtonGlyph glyph) { TinyRect drawBounds = pixmap.DrawBounds; - double num = drawBounds.Width; - double num2 = drawBounds.Height; - double num3 = num2 / 5.0; - double num4 = num2 * 140.0 / 480.0; - double num5 = num2 / 3.5; - if (glyph >= Def.ButtonGlygh.Cheat1 && glyph <= Def.ButtonGlygh.Cheat9) + double drawBoundsWidth = drawBounds.Width; + double drawBoundsHeight = drawBounds.Height; + double buttonSizeFactor1 = drawBoundsHeight / 5.0; + double buttonSizeFactor2 = drawBoundsHeight * 140.0 / 480.0; + double cheatButtonSizeFactor = drawBoundsHeight / 3.5; + if (glyph >= Def.ButtonGlyph.Cheat1 && glyph <= Def.ButtonGlyph.Cheat9) { - int num6 = (int)(glyph - 35); + int cheatNumber = (int)(glyph - 35); TinyRect result = default(TinyRect); - result.Left = 80 * num6; - result.Right = 80 * (num6 + 1); - result.Top = 0; - result.Bottom = 80; + result.LeftX = 80 * cheatNumber; + result.RightX = 80 * (cheatNumber + 1); + result.TopY = 0; + result.BottomY = 80; return result; } + int leftXForButtonsInLeftColumn = (int)(20.0 + buttonSizeFactor2 * 0.0); + int rightXForButtonsInLeftColumn = (int)(20.0 + buttonSizeFactor2 * 0.5); switch (glyph) { - case Def.ButtonGlygh.InitGamerA: + case Def.ButtonGlyph.InitGamerA: { TinyRect result19 = default(TinyRect); - result19.Left = (int)(20.0 + num4 * 0.0); - result19.Right = (int)(20.0 + num4 * 0.5); - result19.Top = (int)(num2 - 20.0 - num4 * 2.1); - result19.Bottom = (int)(num2 - 20.0 - num4 * 1.6); + result19.LeftX = leftXForButtonsInLeftColumn; + result19.RightX = rightXForButtonsInLeftColumn; + result19.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 2.1); + result19.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.6); return result19; } - case Def.ButtonGlygh.InitGamerB: + case Def.ButtonGlyph.InitGamerB: { TinyRect result18 = default(TinyRect); - result18.Left = (int)(20.0 + num4 * 0.0); - result18.Right = (int)(20.0 + num4 * 0.5); - result18.Top = (int)(num2 - 20.0 - num4 * 1.6); - result18.Bottom = (int)(num2 - 20.0 - num4 * 1.1); + result18.LeftX = leftXForButtonsInLeftColumn; + result18.RightX = rightXForButtonsInLeftColumn; + result18.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.6); + result18.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.1); return result18; } - case Def.ButtonGlygh.InitGamerC: + case Def.ButtonGlyph.InitGamerC: { TinyRect result15 = default(TinyRect); - result15.Left = (int)(20.0 + num4 * 0.0); - result15.Right = (int)(20.0 + num4 * 0.5); - result15.Top = (int)(num2 - 20.0 - num4 * 1.1); - result15.Bottom = (int)(num2 - 20.0 - num4 * 0.6); + result15.LeftX = leftXForButtonsInLeftColumn; + result15.RightX = rightXForButtonsInLeftColumn; + result15.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.1); + result15.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.6); return result15; } - case Def.ButtonGlygh.InitSetup: + case Def.ButtonGlyph.InitSetup: { TinyRect result14 = default(TinyRect); - result14.Left = (int)(20.0 + num4 * 0.0); - result14.Right = (int)(20.0 + num4 * 0.5); - result14.Top = (int)(num2 - 20.0 - num4 * 0.5); - result14.Bottom = (int)(num2 - 20.0 - num4 * 0.0); + result14.LeftX = leftXForButtonsInLeftColumn; + result14.RightX = rightXForButtonsInLeftColumn; + result14.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.5); + result14.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.0); return result14; } - case Def.ButtonGlygh.InitPlay: + case Def.ButtonGlyph.InitPlay: { TinyRect result11 = default(TinyRect); - result11.Left = (int)(num - 20.0 - num4 * 1.0); - result11.Right = (int)(num - 20.0 - num4 * 0.0); - result11.Top = (int)(num2 - 40.0 - num4 * 1.0); - result11.Bottom = (int)(num2 - 40.0 - num4 * 0.0); + result11.LeftX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 1.0); + result11.RightX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 0.0); + result11.TopY = (int)(drawBoundsHeight - 40.0 - buttonSizeFactor2 * 1.0); + result11.BottomY = (int)(drawBoundsHeight - 40.0 - buttonSizeFactor2 * 0.0); return result11; } - case Def.ButtonGlygh.InitBuy: - case Def.ButtonGlygh.InitRanking: + case Def.ButtonGlyph.InitBuy: + case Def.ButtonGlyph.InitRanking: { TinyRect result10 = default(TinyRect); - result10.Left = (int)(num - 20.0 - num4 * 0.75); - result10.Right = (int)(num - 20.0 - num4 * 0.25); - result10.Top = (int)(num2 - 20.0 - num4 * 2.1); - result10.Bottom = (int)(num2 - 20.0 - num4 * 1.6); + result10.LeftX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 0.75); + result10.RightX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 0.25); + result10.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 2.1); + result10.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.6); return result10; } - case Def.ButtonGlygh.PauseMenu: + case Def.ButtonGlyph.PauseMenu: { TinyRect result37 = default(TinyRect); - result37.Left = (int)((double)PixmapOrigin.X + num4 * -0.21); - result37.Right = (int)((double)PixmapOrigin.X + num4 * 0.79); - result37.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2); - result37.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2); + result37.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * -0.21); + result37.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 0.79); + result37.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2); + result37.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2); return result37; } - case Def.ButtonGlygh.PauseBack: + case Def.ButtonGlyph.PauseBack: { TinyRect result36 = default(TinyRect); - result36.Left = (int)((double)PixmapOrigin.X + num4 * 0.79); - result36.Right = (int)((double)PixmapOrigin.X + num4 * 1.79); - result36.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2); - result36.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2); + result36.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 0.79); + result36.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 1.79); + result36.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2); + result36.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2); return result36; } - case Def.ButtonGlygh.PauseSetup: + case Def.ButtonGlyph.PauseSetup: { TinyRect result35 = default(TinyRect); - result35.Left = (int)((double)PixmapOrigin.X + num4 * 1.79); - result35.Right = (int)((double)PixmapOrigin.X + num4 * 2.79); - result35.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2); - result35.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2); + result35.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 1.79); + result35.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 2.79); + result35.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2); + result35.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2); return result35; } - case Def.ButtonGlygh.PauseRestart: + case Def.ButtonGlyph.PauseRestart: { TinyRect result34 = default(TinyRect); - result34.Left = (int)((double)PixmapOrigin.X + num4 * 2.79); - result34.Right = (int)((double)PixmapOrigin.X + num4 * 3.79); - result34.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2); - result34.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2); + result34.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 2.79); + result34.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.79); + result34.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2); + result34.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2); return result34; } - case Def.ButtonGlygh.PauseContinue: + case Def.ButtonGlyph.PauseContinue: { TinyRect result33 = default(TinyRect); - result33.Left = (int)((double)PixmapOrigin.X + num4 * 3.79); - result33.Right = (int)((double)PixmapOrigin.X + num4 * 4.79); - result33.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2); - result33.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2); + result33.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.79); + result33.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 4.79); + result33.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2); + result33.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2); return result33; } - case Def.ButtonGlygh.ResumeMenu: + case Def.ButtonGlyph.ResumeMenu: { TinyRect result32 = default(TinyRect); - result32.Left = (int)((double)PixmapOrigin.X + num4 * 1.29); - result32.Right = (int)((double)PixmapOrigin.X + num4 * 2.29); - result32.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2); - result32.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2); + result32.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 1.29); + result32.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 2.29); + result32.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2); + result32.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2); return result32; } - case Def.ButtonGlygh.ResumeContinue: + case Def.ButtonGlyph.ResumeContinue: { TinyRect result31 = default(TinyRect); - result31.Left = (int)((double)PixmapOrigin.X + num4 * 2.29); - result31.Right = (int)((double)PixmapOrigin.X + num4 * 3.29); - result31.Top = (int)((double)PixmapOrigin.Y + num4 * 2.2); - result31.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.2); + result31.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 2.29); + result31.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.29); + result31.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.2); + result31.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.2); return result31; } - case Def.ButtonGlygh.WinLostReturn: + case Def.ButtonGlyph.WinLostReturn: { TinyRect result30 = default(TinyRect); - result30.Left = (int)((double)PixmapOrigin.X + num - num3 * 2.2); - result30.Right = (int)((double)PixmapOrigin.X + num - num3 * 1.2); - result30.Top = (int)((double)PixmapOrigin.Y + num3 * 0.2); - result30.Bottom = (int)((double)PixmapOrigin.Y + num3 * 1.2); + result30.LeftX = (int)((double)PixmapOrigin.X + drawBoundsWidth - buttonSizeFactor1 * 2.2); + result30.RightX = (int)((double)PixmapOrigin.X + drawBoundsWidth - buttonSizeFactor1 * 1.2); + result30.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor1 * 0.2); + result30.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor1 * 1.2); return result30; } - case Def.ButtonGlygh.TrialBuy: + case Def.ButtonGlyph.TrialBuy: { TinyRect result29 = default(TinyRect); - result29.Left = (int)((double)PixmapOrigin.X + num4 * 2.5); - result29.Right = (int)((double)PixmapOrigin.X + num4 * 3.5); - result29.Top = (int)((double)PixmapOrigin.Y + num4 * 2.1); - result29.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.1); + result29.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 2.5); + result29.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.5); + result29.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.1); + result29.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.1); return result29; } - case Def.ButtonGlygh.TrialCancel: + case Def.ButtonGlyph.TrialCancel: { TinyRect result28 = default(TinyRect); - result28.Left = (int)((double)PixmapOrigin.X + num4 * 3.5); - result28.Right = (int)((double)PixmapOrigin.X + num4 * 4.5); - result28.Top = (int)((double)PixmapOrigin.Y + num4 * 2.1); - result28.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.1); + result28.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.5); + result28.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 4.5); + result28.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.1); + result28.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.1); return result28; } - case Def.ButtonGlygh.RankingContinue: + case Def.ButtonGlyph.RankingContinue: { TinyRect result27 = default(TinyRect); - result27.Left = (int)((double)PixmapOrigin.X + num4 * 3.5); - result27.Right = (int)((double)PixmapOrigin.X + num4 * 4.5); - result27.Top = (int)((double)PixmapOrigin.Y + num4 * 2.1); - result27.Bottom = (int)((double)PixmapOrigin.Y + num4 * 3.1); + result27.LeftX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 3.5); + result27.RightX = (int)((double)PixmapOrigin.X + buttonSizeFactor2 * 4.5); + result27.TopY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 2.1); + result27.BottomY = (int)((double)PixmapOrigin.Y + buttonSizeFactor2 * 3.1); return result27; } - case Def.ButtonGlygh.SetupSounds: + case Def.ButtonGlyph.SetupSounds: { TinyRect result26 = default(TinyRect); - result26.Left = (int)(20.0 + num4 * 0.0); - result26.Right = (int)(20.0 + num4 * 0.5); - result26.Top = (int)(num2 - 20.0 - num4 * 2.0); - result26.Bottom = (int)(num2 - 20.0 - num4 * 1.5); + result26.LeftX = leftXForButtonsInLeftColumn; + result26.RightX = rightXForButtonsInLeftColumn; + result26.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 2.0); + result26.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.5); return result26; } - case Def.ButtonGlygh.SetupJump: + case Def.ButtonGlyph.SetupJump: { TinyRect result25 = default(TinyRect); - result25.Left = (int)(20.0 + num4 * 0.0); - result25.Right = (int)(20.0 + num4 * 0.5); - result25.Top = (int)(num2 - 20.0 - num4 * 1.5); - result25.Bottom = (int)(num2 - 20.0 - num4 * 1.0); + result25.LeftX = leftXForButtonsInLeftColumn; + result25.RightX = rightXForButtonsInLeftColumn; + result25.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.5); + result25.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.0); return result25; } - case Def.ButtonGlygh.SetupZoom: + case Def.ButtonGlyph.SetupZoom: { TinyRect result24 = default(TinyRect); - result24.Left = (int)(20.0 + num4 * 0.0); - result24.Right = (int)(20.0 + num4 * 0.5); - result24.Top = (int)(num2 - 20.0 - num4 * 1.0); - result24.Bottom = (int)(num2 - 20.0 - num4 * 0.5); + result24.LeftX = leftXForButtonsInLeftColumn; + result24.RightX = rightXForButtonsInLeftColumn; + result24.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.0); + result24.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.5); return result24; } - case Def.ButtonGlygh.SetupAccel: + case Def.ButtonGlyph.SetupAccel: { TinyRect result23 = default(TinyRect); - result23.Left = (int)(20.0 + num4 * 0.0); - result23.Right = (int)(20.0 + num4 * 0.5); - result23.Top = (int)(num2 - 20.0 - num4 * 0.5); - result23.Bottom = (int)(num2 - 20.0 - num4 * 0.0); + result23.LeftX = leftXForButtonsInLeftColumn; + result23.RightX = rightXForButtonsInLeftColumn; + result23.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.5); + result23.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.0); return result23; } - case Def.ButtonGlygh.SetupReset: + case Def.ButtonGlyph.SetupReset: { TinyRect result22 = default(TinyRect); - result22.Left = (int)(450.0 + num4 * 0.0); - result22.Right = (int)(450.0 + num4 * 0.5); - result22.Top = (int)(num2 - 20.0 - num4 * 2.0); - result22.Bottom = (int)(num2 - 20.0 - num4 * 1.5); + result22.LeftX = (int)(450.0 + buttonSizeFactor2 * 0.0); + result22.RightX = (int)(450.0 + buttonSizeFactor2 * 0.5); + result22.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 2.0); + result22.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 1.5); return result22; } - case Def.ButtonGlygh.SetupReturn: + case Def.ButtonGlyph.SetupReturn: { TinyRect result21 = default(TinyRect); - result21.Left = (int)(num - 20.0 - num4 * 0.8); - result21.Right = (int)(num - 20.0 - num4 * 0.0); - result21.Top = (int)(num2 - 20.0 - num4 * 0.8); - result21.Bottom = (int)(num2 - 20.0 - num4 * 0.0); + result21.LeftX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 0.8); + result21.RightX = (int)(drawBoundsWidth - 20.0 - buttonSizeFactor2 * 0.0); + result21.TopY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.8); + result21.BottomY = (int)(drawBoundsHeight - 20.0 - buttonSizeFactor2 * 0.0); return result21; } - case Def.ButtonGlygh.PlayPause: + case Def.ButtonGlyph.PlayPause: { TinyRect result20 = default(TinyRect); - result20.Left = (int)(num - num3 * 0.7); - result20.Right = (int)(num - num3 * 0.2); - result20.Top = (int)(num3 * 0.2); - result20.Bottom = (int)(num3 * 0.7); + result20.LeftX = (int)(drawBoundsWidth - buttonSizeFactor1 * 0.7); + result20.RightX = (int)(drawBoundsWidth - buttonSizeFactor1 * 0.2); + result20.TopY = (int)(buttonSizeFactor1 * 0.2); + result20.BottomY = (int)(buttonSizeFactor1 * 0.7); return result20; } - case Def.ButtonGlygh.PlayAction: + case Def.ButtonGlyph.PlayAction: { if (gameData.JumpRight) { TinyRect result16 = default(TinyRect); - result16.Left = (int)((double)drawBounds.Width - num3 * 1.2); - result16.Right = (int)((double)drawBounds.Width - num3 * 0.2); - result16.Top = (int)(num2 - num3 * 2.6); - result16.Bottom = (int)(num2 - num3 * 1.6); + result16.LeftX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 1.2); + result16.RightX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 0.2); + result16.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 2.6); + result16.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.6); return result16; } TinyRect result17 = default(TinyRect); - result17.Left = (int)(num3 * 0.2); - result17.Right = (int)(num3 * 1.2); - result17.Top = (int)(num2 - num3 * 2.6); - result17.Bottom = (int)(num2 - num3 * 1.6); + result17.LeftX = (int)(buttonSizeFactor1 * 0.2); + result17.RightX = (int)(buttonSizeFactor1 * 1.2); + result17.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 2.6); + result17.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.6); return result17; } - case Def.ButtonGlygh.PlayJump: + case Def.ButtonGlyph.PlayJump: { if (gameData.JumpRight) { TinyRect result12 = default(TinyRect); - result12.Left = (int)((double)drawBounds.Width - num3 * 1.2); - result12.Right = (int)((double)drawBounds.Width - num3 * 0.2); - result12.Top = (int)(num2 - num3 * 1.2); - result12.Bottom = (int)(num2 - num3 * 0.2); + result12.LeftX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 1.2); + result12.RightX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 0.2); + result12.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.2); + result12.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 0.2); return result12; } TinyRect result13 = default(TinyRect); - result13.Left = (int)(num3 * 0.2); - result13.Right = (int)(num3 * 1.2); - result13.Top = (int)(num2 - num3 * 1.2); - result13.Bottom = (int)(num2 - num3 * 0.2); + result13.LeftX = (int)(buttonSizeFactor1 * 0.2); + result13.RightX = (int)(buttonSizeFactor1 * 1.2); + result13.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.2); + result13.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 0.2); return result13; } - case Def.ButtonGlygh.PlayDown: + case Def.ButtonGlyph.PlayDown: { if (gameData.JumpRight) { TinyRect result8 = default(TinyRect); - result8.Left = (int)(num3 * 0.2); - result8.Right = (int)(num3 * 1.2); - result8.Top = (int)(num2 - num3 * 1.2); - result8.Bottom = (int)(num2 - num3 * 0.2); + result8.LeftX = (int)(buttonSizeFactor1 * 0.2); + result8.RightX = (int)(buttonSizeFactor1 * 1.2); + result8.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.2); + result8.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 0.2); return result8; } TinyRect result9 = default(TinyRect); - result9.Left = (int)((double)drawBounds.Width - num3 * 1.2); - result9.Right = (int)((double)drawBounds.Width - num3 * 0.2); - result9.Top = (int)(num2 - num3 * 1.2); - result9.Bottom = (int)(num2 - num3 * 0.2); + result9.LeftX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 1.2); + result9.RightX = (int)((double)drawBounds.Width - buttonSizeFactor1 * 0.2); + result9.TopY = (int)(drawBoundsHeight - buttonSizeFactor1 * 1.2); + result9.BottomY = (int)(drawBoundsHeight - buttonSizeFactor1 * 0.2); return result9; } - case Def.ButtonGlygh.Cheat11: + case Def.ButtonGlyph.Cheat11: { TinyRect result7 = default(TinyRect); - result7.Left = (int)(num5 * 0.0); - result7.Right = (int)(num5 * 1.0); - result7.Top = (int)(num5 * 0.0); - result7.Bottom = (int)(num5 * 1.0); + result7.LeftX = (int)(cheatButtonSizeFactor * 0.0); + result7.RightX = (int)(cheatButtonSizeFactor * 1.0); + result7.TopY = (int)(cheatButtonSizeFactor * 0.0); + result7.BottomY = (int)(cheatButtonSizeFactor * 1.0); return result7; } - case Def.ButtonGlygh.Cheat12: + case Def.ButtonGlyph.Cheat12: { TinyRect result6 = default(TinyRect); - result6.Left = (int)(num5 * 0.0); - result6.Right = (int)(num5 * 1.0); - result6.Top = (int)(num5 * 1.0); - result6.Bottom = (int)(num5 * 2.0); + result6.LeftX = (int)(cheatButtonSizeFactor * 0.0); + result6.RightX = (int)(cheatButtonSizeFactor * 1.0); + result6.TopY = (int)(cheatButtonSizeFactor * 1.0); + result6.BottomY = (int)(cheatButtonSizeFactor * 2.0); return result6; } - case Def.ButtonGlygh.Cheat21: + case Def.ButtonGlyph.Cheat21: { TinyRect result5 = default(TinyRect); - result5.Left = (int)(num5 * 1.0); - result5.Right = (int)(num5 * 2.0); - result5.Top = (int)(num5 * 0.0); - result5.Bottom = (int)(num5 * 1.0); + result5.LeftX = (int)(cheatButtonSizeFactor * 1.0); + result5.RightX = (int)(cheatButtonSizeFactor * 2.0); + result5.TopY = (int)(cheatButtonSizeFactor * 0.0); + result5.BottomY = (int)(cheatButtonSizeFactor * 1.0); return result5; } - case Def.ButtonGlygh.Cheat22: + case Def.ButtonGlyph.Cheat22: { TinyRect result4 = default(TinyRect); - result4.Left = (int)(num5 * 1.0); - result4.Right = (int)(num5 * 2.0); - result4.Top = (int)(num5 * 1.0); - result4.Bottom = (int)(num5 * 2.0); + result4.LeftX = (int)(cheatButtonSizeFactor * 1.0); + result4.RightX = (int)(cheatButtonSizeFactor * 2.0); + result4.TopY = (int)(cheatButtonSizeFactor * 1.0); + result4.BottomY = (int)(cheatButtonSizeFactor * 2.0); return result4; } - case Def.ButtonGlygh.Cheat31: + case Def.ButtonGlyph.Cheat31: { TinyRect result3 = default(TinyRect); - result3.Left = (int)(num5 * 2.0); - result3.Right = (int)(num5 * 3.0); - result3.Top = (int)(num5 * 0.0); - result3.Bottom = (int)(num5 * 1.0); + result3.LeftX = (int)(cheatButtonSizeFactor * 2.0); + result3.RightX = (int)(cheatButtonSizeFactor * 3.0); + result3.TopY = (int)(cheatButtonSizeFactor * 0.0); + result3.BottomY = (int)(cheatButtonSizeFactor * 1.0); return result3; } - case Def.ButtonGlygh.Cheat32: + case Def.ButtonGlyph.Cheat32: { TinyRect result2 = default(TinyRect); - result2.Left = (int)(num5 * 2.0); - result2.Right = (int)(num5 * 3.0); - result2.Top = (int)(num5 * 1.0); - result2.Bottom = (int)(num5 * 2.0); + result2.LeftX = (int)(cheatButtonSizeFactor * 2.0); + result2.RightX = (int)(cheatButtonSizeFactor * 3.0); + result2.TopY = (int)(cheatButtonSizeFactor * 1.0); + result2.BottomY = (int)(cheatButtonSizeFactor * 2.0); return result2; } default: @@ -835,21 +954,23 @@ namespace WindowsPhoneSpeedyBlupi } } + private void HandleAccelSensorCurrentValueChanged(object sender, SensorReadingEventArgs e) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) + AccelerometerReading sensorReading = e.SensorReading; - float y = ((AccelerometerReading)(ref sensorReading)).Acceleration.Y; - float num = (1f - (float)gameData.AccelSensitivity) * 0.06f + 0.04f; - float num2 = (accelLastState ? (num * 0.6f) : num); - if (y > num2) + float y = ((AccelerometerReading)(sensorReading)).Acceleration.Y; + float sensitivityThreshold = (1f - (float)gameData.AccelSensitivity) * 0.06f + 0.04f; + float adjustedThreshold = (accelLastState ? (sensitivityThreshold * 0.6f) : sensitivityThreshold); + if (y > adjustedThreshold) { - accelSpeedX = 0.0 - Math.Min((double)y * 0.25 / (double)num + 0.25, 1.0); + accelSpeedX = 0.0 - Math.Min((double)y * 0.25 / (double)sensitivityThreshold + 0.25, 1.0); } - else if (y < 0f - num2) + else if (y < 0f - adjustedThreshold) { - accelSpeedX = Math.Min((double)(0f - y) * 0.25 / (double)num + 0.25, 1.0); + accelSpeedX = Math.Min((double)(0f - y) * 0.25 / (double)sensitivityThreshold + 0.25, 1.0); } else { diff --git a/Jauge.cs b/Jauge.cs index 4ac9464..e953fd5 100644 --- a/Jauge.cs +++ b/Jauge.cs @@ -74,17 +74,17 @@ namespace WindowsPhoneSpeedyBlupi if (!m_bHide) { int num = m_level * 114 / 100; - rect.Left = 0; - rect.Right = 124; - rect.Top = 0; - rect.Bottom = 22; + rect.LeftX = 0; + rect.RightX = 124; + rect.TopY = 0; + rect.BottomY = 22; m_pixmap.DrawPart(5, m_pos, rect, m_zoom); if (num > 0) { - rect.Left = 0; - rect.Right = 6 + num; - rect.Top = 22 * m_mode; - rect.Bottom = 22 * (m_mode + 1); + rect.LeftX = 0; + rect.RightX = 6 + num; + rect.TopY = 22 * m_mode; + rect.BottomY = 22 * (m_mode + 1); m_pixmap.DrawPart(5, m_pos, rect, m_zoom); } } diff --git a/Misc.cs b/Misc.cs index 8379bf5..c9b9728 100644 --- a/Misc.cs +++ b/Misc.cs @@ -1,8 +1,10 @@ // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi.Misc using System; +using System.Diagnostics; using Microsoft.Xna.Framework; using WindowsPhoneSpeedyBlupi; +using static WindowsPhoneSpeedyBlupi.Def; namespace WindowsPhoneSpeedyBlupi @@ -75,49 +77,46 @@ namespace WindowsPhoneSpeedyBlupi public static TinyRect Inflate(TinyRect rect, int value) { TinyRect result = default(TinyRect); - result.Left = rect.Left - value; - result.Right = rect.Right + value; - result.Top = rect.Top - value; - result.Bottom = rect.Bottom + value; + result.LeftX = rect.LeftX - value; + result.RightX = rect.RightX + value; + result.TopY = rect.TopY - value; + result.BottomY = rect.BottomY + value; return result; } public static bool IsInside(TinyRect rect, TinyPoint p) { - if (p.X >= rect.Left && p.X <= rect.Right && p.Y >= rect.Top) - { - return p.Y <= rect.Bottom; - } - return false; + return p.X >= rect.LeftX && p.X <= rect.RightX && p.Y >= rect.TopY && p.Y <= rect.BottomY; } public static bool IntersectRect(out TinyRect dst, TinyRect src1, TinyRect src2) { dst = default(TinyRect); - dst.Left = Math.Max(src1.Left, src2.Left); - dst.Right = Math.Min(src1.Right, src2.Right); - dst.Top = Math.Max(src1.Top, src2.Top); - dst.Bottom = Math.Min(src1.Bottom, src2.Bottom); + dst.LeftX = Math.Max(src1.LeftX, src2.LeftX); + dst.RightX = Math.Min(src1.RightX, src2.RightX); + dst.TopY = Math.Max(src1.TopY, src2.TopY); + dst.BottomY = Math.Min(src1.BottomY, src2.BottomY); return !IsRectEmpty(dst); } public static bool UnionRect(out TinyRect dst, TinyRect src1, TinyRect src2) { dst = default(TinyRect); - dst.Left = Math.Min(src1.Left, src2.Left); - dst.Right = Math.Max(src1.Right, src2.Right); - dst.Top = Math.Min(src1.Top, src2.Top); - dst.Bottom = Math.Max(src1.Bottom, src2.Bottom); + dst.LeftX = Math.Min(src1.LeftX, src2.LeftX); + dst.RightX = Math.Max(src1.RightX, src2.RightX); + dst.TopY = Math.Min(src1.TopY, src2.TopY); + dst.BottomY = Math.Max(src1.BottomY, src2.BottomY); return !IsRectEmpty(dst); } private static bool IsRectEmpty(TinyRect rect) { - if (rect.Left < rect.Right) + if (rect.LeftX < rect.RightX) { - return rect.Top >= rect.Bottom; + return rect.TopY >= rect.BottomY; } return true; } + } } \ No newline at end of file diff --git a/Pixmap.cs b/Pixmap.cs index 545c35b..2dcd22b 100644 --- a/Pixmap.cs +++ b/Pixmap.cs @@ -1,10 +1,13 @@ // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi.Pixmap using System; +using System.Diagnostics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using WindowsPhoneSpeedyBlupi; using static System.Net.Mime.MediaTypeNames; +using static WindowsPhoneSpeedyBlupi.Def; +using static WindowsPhoneSpeedyBlupi.Xna; namespace WindowsPhoneSpeedyBlupi { @@ -63,26 +66,29 @@ namespace WindowsPhoneSpeedyBlupi get { TinyRect result = default(TinyRect); - double num = graphics.GraphicsDevice.Viewport.Width; - double num2 = graphics.GraphicsDevice.Viewport.Height; - if (num != 0.0 && num2 != 0.0) + double screenWidth = graphics.GraphicsDevice.Viewport.Width; + double screenHeight = graphics.GraphicsDevice.Viewport.Height; + if(Env.PLATFORM == Platform.Android && screenHeight > 480) { + screenWidth = screenHeight * (640f / 480f); + } + if (screenWidth != 0.0 && screenHeight != 0.0) { double num3; double num4; - if (num / num2 < 1.3333333333333333) + if (screenWidth / screenHeight < 1.3333333333333333) { num3 = 640.0; - num4 = 640.0 * (num2 / num); + num4 = 640.0 * (screenHeight / screenWidth); } else { - num3 = 480.0 * (num / num2); + num3 = 480.0 * (screenWidth / screenHeight); num4 = 480.0; } - result.Left = 0; - result.Right = (int)num3; - result.Top = 0; - result.Bottom = (int)num4; + result.LeftX = 0; + result.RightX = (int)num3; + result.TopY = 0; + result.BottomY = (int)num4; } return result; } @@ -122,102 +128,102 @@ namespace WindowsPhoneSpeedyBlupi 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) { - case Def.ButtonGlygh.InitGamerA: + case Def.ButtonGlyph.InitGamerA: DrawIcon(14, selected ? 16 : 4, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.InitGamerB: + case Def.ButtonGlyph.InitGamerB: DrawIcon(14, selected ? 17 : 5, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.InitGamerC: + case Def.ButtonGlyph.InitGamerC: DrawIcon(14, selected ? 18 : 6, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.InitSetup: - case Def.ButtonGlygh.PauseSetup: + case Def.ButtonGlyph.InitSetup: + case Def.ButtonGlyph.PauseSetup: DrawIcon(14, 19, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.InitPlay: + case Def.ButtonGlyph.InitPlay: DrawIcon(14, 7, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.PauseMenu: - case Def.ButtonGlygh.ResumeMenu: + case Def.ButtonGlyph.PauseMenu: + case Def.ButtonGlyph.ResumeMenu: DrawIcon(14, 11, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.PauseBack: + case Def.ButtonGlyph.PauseBack: DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.PauseRestart: + case Def.ButtonGlyph.PauseRestart: DrawIcon(14, 9, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.PauseContinue: - case Def.ButtonGlygh.ResumeContinue: + case Def.ButtonGlyph.PauseContinue: + case Def.ButtonGlyph.ResumeContinue: DrawIcon(14, 10, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.WinLostReturn: + case Def.ButtonGlyph.WinLostReturn: DrawIcon(14, 3, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.InitBuy: - case Def.ButtonGlygh.TrialBuy: + case Def.ButtonGlyph.InitBuy: + case Def.ButtonGlyph.TrialBuy: DrawIcon(14, 22, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.InitRanking: + case Def.ButtonGlyph.InitRanking: DrawIcon(14, 12, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.TrialCancel: - case Def.ButtonGlygh.RankingContinue: + case Def.ButtonGlyph.TrialCancel: + case Def.ButtonGlyph.RankingContinue: DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.SetupSounds: - case Def.ButtonGlygh.SetupJump: - case Def.ButtonGlygh.SetupZoom: - case Def.ButtonGlygh.SetupAccel: + case Def.ButtonGlyph.SetupSounds: + case Def.ButtonGlyph.SetupJump: + case Def.ButtonGlyph.SetupZoom: + case Def.ButtonGlyph.SetupAccel: DrawIcon(14, selected ? 13 : 21, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.SetupReset: + case Def.ButtonGlyph.SetupReset: DrawIcon(14, 20, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.SetupReturn: + case Def.ButtonGlyph.SetupReturn: DrawIcon(14, 8, rect, pressed ? 0.8 : 1.0, false); break; - case Def.ButtonGlygh.PlayJump: + case Def.ButtonGlyph.PlayJump: DrawIcon(14, 2, rect, pressed ? 0.6 : 1.0, false); break; - case Def.ButtonGlygh.PlayAction: + case Def.ButtonGlyph.PlayAction: DrawIcon(14, 12, rect, pressed ? 0.6 : 1.0, false); break; - case Def.ButtonGlygh.PlayDown: + case Def.ButtonGlyph.PlayDown: DrawIcon(14, 23, rect, pressed ? 0.6 : 1.0, false); break; - case Def.ButtonGlygh.PlayPause: + case Def.ButtonGlyph.PlayPause: DrawIcon(14, 3, rect, pressed ? 0.6 : 1.0, false); break; - case Def.ButtonGlygh.Cheat1: - case Def.ButtonGlygh.Cheat2: - case Def.ButtonGlygh.Cheat3: - case Def.ButtonGlygh.Cheat4: - case Def.ButtonGlygh.Cheat5: - case Def.ButtonGlygh.Cheat6: - case Def.ButtonGlygh.Cheat7: - case Def.ButtonGlygh.Cheat8: - case Def.ButtonGlygh.Cheat9: + case Def.ButtonGlyph.Cheat1: + case Def.ButtonGlyph.Cheat2: + case Def.ButtonGlyph.Cheat3: + case Def.ButtonGlyph.Cheat4: + case Def.ButtonGlyph.Cheat5: + case Def.ButtonGlyph.Cheat6: + case Def.ButtonGlyph.Cheat7: + case Def.ButtonGlyph.Cheat8: + case Def.ButtonGlyph.Cheat9: { DrawIcon(14, 0, rect, pressed ? 0.6 : 1.0, false); TinyPoint tinyPoint = default(TinyPoint); - tinyPoint.X = rect.Left + rect.Width / 2 - (int)originX; - tinyPoint.Y = rect.Top + 28; + tinyPoint.X = rect.LeftX + rect.Width / 2 - (int)originX; + tinyPoint.Y = rect.TopY + 28; TinyPoint pos = tinyPoint; Text.DrawTextCenter(this, pos, Decor.GetCheatTinyText(glyph), 1.0); break; } - case Def.ButtonGlygh.Cheat11: - case Def.ButtonGlygh.Cheat12: - case Def.ButtonGlygh.Cheat21: - case Def.ButtonGlygh.Cheat22: - case Def.ButtonGlygh.Cheat31: - case Def.ButtonGlygh.Cheat32: + case Def.ButtonGlyph.Cheat11: + case Def.ButtonGlyph.Cheat12: + case Def.ButtonGlyph.Cheat21: + case Def.ButtonGlyph.Cheat22: + case Def.ButtonGlyph.Cheat31: + case Def.ButtonGlyph.Cheat32: break; } } @@ -242,13 +248,17 @@ namespace WindowsPhoneSpeedyBlupi private void UpdateGeometry() { - double num = graphics.GraphicsDevice.Viewport.Width; - double num2 = graphics.GraphicsDevice.Viewport.Height; - double val = num / 640.0; - double val2 = num2 / 480.0; + double screenWidth = graphics.GraphicsDevice.Viewport.Width; + double screenHeight = graphics.GraphicsDevice.Viewport.Height; + if (Env.PLATFORM == Platform.Android && screenHeight > 480) + { + screenWidth = screenHeight * (640f / 480f); + } + double val = screenWidth / 640.0; + double val2 = screenHeight / 480.0; zoom = Math.Min(val, val2); - originX = (num - 640.0 * zoom) / 2.0; - originY = (num2 - 480.0 * zoom) / 2.0; + originX = (screenWidth - 640.0 * zoom) / 2.0; + originY = (screenHeight - 480.0 * zoom) / 2.0; } public void BackgroundCache(string name) @@ -269,11 +279,15 @@ namespace WindowsPhoneSpeedyBlupi public void DrawBackground() { - double num = graphics.GraphicsDevice.Viewport.Width; - double num2 = graphics.GraphicsDevice.Viewport.Height; + double screenWidth = graphics.GraphicsDevice.Viewport.Width; + double screenHeight = graphics.GraphicsDevice.Viewport.Height; + if (Env.PLATFORM == Platform.Android && screenHeight > 480) + { + screenWidth = screenHeight * (640f / 480f); + } Texture2D bitmap = GetBitmap(3); Rectangle srcRectangle = GetSrcRectangle(bitmap, 10, 10, 10, 10, 0, 0); - Rectangle destinationRectangle = new Rectangle(0, 0, (int)num, (int)num2); + Rectangle destinationRectangle = new Rectangle(0, 0, (int)screenWidth, (int)screenHeight); spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.Draw(bitmap, destinationRectangle, srcRectangle, Color.White); spriteBatch.End(); @@ -282,10 +296,10 @@ namespace WindowsPhoneSpeedyBlupi tinyPoint.Y = (int)originY; TinyPoint dest = tinyPoint; TinyRect tinyRect = default(TinyRect); - tinyRect.Left = 0; - tinyRect.Top = 0; - tinyRect.Right = 640; - tinyRect.Bottom = 480; + tinyRect.LeftX = 0; + tinyRect.TopY = 0; + tinyRect.RightX = 640; + tinyRect.BottomY = 480; TinyRect rect = tinyRect; DrawPart(3, dest, rect); } @@ -295,10 +309,10 @@ namespace WindowsPhoneSpeedyBlupi pos.X = (int)((double)pos.X + originX); pos.Y = (int)((double)pos.Y + originY); TinyRect tinyRect = default(TinyRect); - tinyRect.Left = pos.X; - tinyRect.Top = pos.Y; - tinyRect.Right = pos.X + (int)(32.0 * size); - tinyRect.Bottom = pos.Y + (int)(32.0 * size); + tinyRect.LeftX = pos.X; + tinyRect.TopY = pos.Y; + tinyRect.RightX = pos.X + (int)(32.0 * size); + tinyRect.BottomY = pos.Y + (int)(32.0 * size); TinyRect rect = tinyRect; DrawIcon(6, rank, rect, 1.0, false); } @@ -308,10 +322,10 @@ namespace WindowsPhoneSpeedyBlupi pos.X = (int)((double)pos.X + originX); pos.Y = (int)((double)pos.Y + originY); TinyRect tinyRect = default(TinyRect); - tinyRect.Left = pos.X; - tinyRect.Top = pos.Y; - tinyRect.Right = pos.X; - tinyRect.Bottom = pos.Y; + tinyRect.LeftX = pos.X; + tinyRect.TopY = pos.Y; + tinyRect.RightX = pos.X; + tinyRect.BottomY = pos.Y; TinyRect rect = tinyRect; DrawIcon(channel, rank, rect, 1.0, false); } @@ -319,10 +333,10 @@ namespace WindowsPhoneSpeedyBlupi public void QuickIcon(int channel, int rank, TinyPoint pos) { TinyRect tinyRect = default(TinyRect); - tinyRect.Left = pos.X; - tinyRect.Top = pos.Y; - tinyRect.Right = pos.X; - tinyRect.Bottom = pos.Y; + tinyRect.LeftX = pos.X; + tinyRect.TopY = pos.Y; + tinyRect.RightX = pos.X; + tinyRect.BottomY = pos.Y; TinyRect rect = tinyRect; DrawIcon(channel, rank, rect, 1.0, true); } @@ -330,10 +344,10 @@ namespace WindowsPhoneSpeedyBlupi public void QuickIcon(int channel, int rank, TinyPoint pos, double opacity, double rotation) { TinyRect tinyRect = default(TinyRect); - tinyRect.Left = pos.X; - tinyRect.Top = pos.Y; - tinyRect.Right = pos.X; - tinyRect.Bottom = pos.Y; + tinyRect.LeftX = pos.X; + tinyRect.TopY = pos.Y; + tinyRect.RightX = pos.X; + tinyRect.BottomY = pos.Y; TinyRect rect = tinyRect; DrawIcon(channel, rank, rect, opacity, rotation, true); } @@ -355,7 +369,7 @@ namespace WindowsPhoneSpeedyBlupi dest.X = (int)((double)dest.X + originX); dest.Y = (int)((double)dest.Y + originY); } - Rectangle value = new Rectangle(rect.Left, rect.Top, rect.Width, rect.Height); + Rectangle value = new Rectangle(rect.LeftX, rect.TopY, rect.Width, rect.Height); Rectangle destinationRectangle = new Rectangle(dest.X, dest.Y, (int)((double)rect.Width * zoom), (int)((double)rect.Height * zoom)); spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); spriteBatch.Draw(bitmap, destinationRectangle, value, Color.White); @@ -498,8 +512,8 @@ namespace WindowsPhoneSpeedyBlupi { int num = ((rect.Width == 0) ? iconWidth : rect.Width); int num2 = ((rect.Height == 0) ? iconHeight : rect.Height); - int num3 = (int)((double)rect.Left * zoom); - int num4 = (int)((double)rect.Top * zoom); + int num3 = (int)((double)rect.LeftX * zoom); + int num4 = (int)((double)rect.TopY * zoom); int num5 = (int)((double)num3 + (double)num * zoom); int num6 = (int)((double)num4 + (double)num2 * zoom); if (useHotSpot && hotSpotZoom > 1.0) diff --git a/Program.cs b/Program.cs deleted file mode 100644 index 58f9f65..0000000 --- a/Program.cs +++ /dev/null @@ -1,2 +0,0 @@ -using var game = new Speedy_Blupi.Game1(); -game.Run(); diff --git a/Resource.cs b/Resource.cs index f04bcee..86aebbf 100644 --- a/Resource.cs +++ b/Resource.cs @@ -6,11 +6,10 @@ using System.Diagnostics; using System.Globalization; using System.Resources; using System.Runtime.CompilerServices; -using WindowsPhoneSpeedyBlupi; -[DebuggerNonUserCode] -[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] -[CompilerGenerated] +//[DebuggerNonUserCode] +//[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] +//[CompilerGenerated] namespace WindowsPhoneSpeedyBlupi { @@ -25,7 +24,7 @@ namespace WindowsPhoneSpeedyBlupi { get { - if (object.ReferenceEquals(resourceMan, null)) + if (ReferenceEquals(resourceMan, null)) { ResourceManager resourceManager = new ResourceManager("WindowsPhoneSpeedyBlupi.Resource", typeof(Resource).Assembly); resourceMan = resourceManager; diff --git a/Slider.cs b/Slider.cs index a1838f7..2096ac0 100644 --- a/Slider.cs +++ b/Slider.cs @@ -1,12 +1,16 @@ // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi.Slider using System; -using WindowsPhoneSpeedyBlupi; namespace WindowsPhoneSpeedyBlupi { public class Slider { + public Slider(TinyPoint topLeftCorner, double value) { + TopLeftCorner = topLeftCorner; + value = Value; + + } public TinyPoint TopLeftCorner { get; set; } public double Value { get; set; } @@ -34,34 +38,34 @@ namespace WindowsPhoneSpeedyBlupi tinyPoint.Y = TopLeftCorner.Y - pixmap.Origin.Y; TinyPoint dest = tinyPoint; TinyRect tinyRect = default(TinyRect); - tinyRect.Left = 0; - tinyRect.Right = 124; - tinyRect.Top = 0; - tinyRect.Bottom = 22; + tinyRect.LeftX = 0; + tinyRect.RightX = 124; + tinyRect.TopY = 0; + tinyRect.BottomY = 22; TinyRect rect = tinyRect; pixmap.DrawPart(5, dest, rect, 2.0); int num = (int)((double)(PosRight - PosLeft) * Value); int num2 = TopLeftCorner.Y + 22; int num3 = 94; TinyRect tinyRect2 = default(TinyRect); - tinyRect2.Left = PosLeft + num - num3 / 2; - tinyRect2.Right = PosLeft + num + num3 / 2; - tinyRect2.Top = num2 - num3 / 2; - tinyRect2.Bottom = num2 + num3 / 2; + tinyRect2.LeftX = PosLeft + num - num3 / 2; + tinyRect2.RightX = PosLeft + num + num3 / 2; + tinyRect2.TopY = num2 - num3 / 2; + tinyRect2.BottomY = num2 + num3 / 2; rect = tinyRect2; pixmap.DrawIcon(14, 1, rect, 1.0, false); TinyRect tinyRect3 = default(TinyRect); - tinyRect3.Left = TopLeftCorner.X - 65; - tinyRect3.Right = TopLeftCorner.X - 65 + 60; - tinyRect3.Top = TopLeftCorner.Y - 10; - tinyRect3.Bottom = TopLeftCorner.Y - 10 + 60; + tinyRect3.LeftX = TopLeftCorner.X - 65; + tinyRect3.RightX = TopLeftCorner.X - 65 + 60; + tinyRect3.TopY = TopLeftCorner.Y - 10; + tinyRect3.BottomY = TopLeftCorner.Y - 10 + 60; rect = tinyRect3; pixmap.DrawIcon(10, 37, rect, 1.0, false); TinyRect tinyRect4 = default(TinyRect); - tinyRect4.Left = TopLeftCorner.X + 248 + 5; - tinyRect4.Right = TopLeftCorner.X + 248 + 5 + 60; - tinyRect4.Top = TopLeftCorner.Y - 10; - tinyRect4.Bottom = TopLeftCorner.Y - 10 + 60; + tinyRect4.LeftX = TopLeftCorner.X + 248 + 5; + tinyRect4.RightX = TopLeftCorner.X + 248 + 5 + 60; + tinyRect4.TopY = TopLeftCorner.Y - 10; + tinyRect4.BottomY = TopLeftCorner.Y - 10 + 60; rect = tinyRect4; pixmap.DrawIcon(10, 38, rect, 1.0, false); } @@ -69,10 +73,10 @@ namespace WindowsPhoneSpeedyBlupi public bool Move(TinyPoint pos) { TinyRect tinyRect = default(TinyRect); - tinyRect.Left = TopLeftCorner.X - 50; - tinyRect.Right = TopLeftCorner.X + 248 + 50; - tinyRect.Top = TopLeftCorner.Y - 50; - tinyRect.Bottom = TopLeftCorner.Y + 44 + 50; + tinyRect.LeftX = TopLeftCorner.X - 50; + tinyRect.RightX = TopLeftCorner.X + 248 + 50; + tinyRect.TopY = TopLeftCorner.Y - 50; + tinyRect.BottomY = TopLeftCorner.Y + 44 + 50; TinyRect rect = tinyRect; if (Misc.IsInside(rect, pos)) { diff --git a/TinyPoint.cs b/TinyPoint.cs index 2ffb4f1..e81d9dd 100644 --- a/TinyPoint.cs +++ b/TinyPoint.cs @@ -9,6 +9,11 @@ namespace WindowsPhoneSpeedyBlupi public int Y; + public TinyPoint(int x, int y) + { + X = x; Y = y; + } + public override string ToString() { return string.Format("{0};{1}", X, Y); diff --git a/TinyRect.cs b/TinyRect.cs index 51127c8..4f5ab51 100644 --- a/TinyRect.cs +++ b/TinyRect.cs @@ -5,19 +5,27 @@ namespace WindowsPhoneSpeedyBlupi { public struct TinyRect { - public int Left; + public int LeftX; - public int Right; + public int RightX; - public int Top; + public int TopY; - public int Bottom; + public int BottomY; + + public TinyRect(int leftX, int rightX, int topY, int bottomY) + { + LeftX = leftX; + RightX = rightX; + TopY = topY; + BottomY = bottomY; + } public int Width { get { - return Right - Left; + return RightX - LeftX; } } @@ -25,13 +33,13 @@ namespace WindowsPhoneSpeedyBlupi { get { - return Bottom - Top; + return BottomY - TopY; } } public override string ToString() { - return string.Format("{0};{1};{2};{3}", Left, Top, Right, Bottom); + return string.Format("{0};{1};{2};{3}", LeftX, TopY, RightX, BottomY); } } diff --git a/Worlds.cs b/Worlds.cs index 198b446..dd58677 100644 --- a/Worlds.cs +++ b/Worlds.cs @@ -1,6 +1,7 @@ // WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 // WindowsPhoneSpeedyBlupi.Worlds using System; +using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.IsolatedStorage; @@ -41,14 +42,17 @@ namespace WindowsPhoneSpeedyBlupi text = streamReader.ReadToEnd(); stream.Close(); } - catch + catch (Exception e) { + Debug.Write(e.Message); + Debug.Write("Fatal error. Loading world failed: " + worldFilename + "\n"); + //Environment.Exit(1); } if (text == null) { return null; } - return text.Split('\n'); + return text.Split("\n"); } private static string GetWorldFilename(int gamer, int rank) @@ -271,38 +275,38 @@ namespace WindowsPhoneSpeedyBlupi int num = text.IndexOf(name + "="); if (num == -1) { - return default(TinyPoint); + return default; } num += name.Length + 1; int num2 = text.IndexOf(";", num); if (num2 == -1) { - return default(TinyPoint); + return default; } int num3 = text.IndexOf(" ", num); if (num3 == -1) { - return default(TinyPoint); + return default; } string s = text.Substring(num, num2 - num); string s2 = text.Substring(num2 + 1, num3 - num2 - 1); int result; if (!int.TryParse(s, out result)) { - return default(TinyPoint); + return default; } int result2; if (!int.TryParse(s2, out result2)) { - return default(TinyPoint); + return default; } - TinyPoint result3 = default(TinyPoint); + TinyPoint result3 = default; result3.X = result; result3.Y = result2; return result3; } } - return default(TinyPoint); + return default; } public static int? GetDecorField(string[] lines, string section, int x, int y) diff --git a/Xna.cs b/Xna.cs new file mode 100644 index 0000000..64598d3 --- /dev/null +++ b/Xna.cs @@ -0,0 +1,61 @@ +// WindowsPhoneSpeedyBlupi, Version=1.0.0.5, Culture=neutral, PublicKeyToken=6db12cd62dbec439 +// WindowsPhoneSpeedyBlupi.Def + +using static WindowsPhoneSpeedyBlupi.Xna; + +namespace WindowsPhoneSpeedyBlupi +{ + + public static class Xna + { + public enum Platform + { + Desktop, + Android, + iOS, + Web + } + + public enum XnaImpl + { + MonoGame = ProgrammingLanguage.CSharp, + Fna = ProgrammingLanguage.CSharp, + Kni = ProgrammingLanguage.CSharp, + JXNA = ProgrammingLanguage.Java, + JSXN = ProgrammingLanguage.JavaScript + } + + public enum ProgrammingLanguage + { + CSharp, + Java, + JavaScript + } + + + } + + public static class Extensions + { + public static ProgrammingLanguage getProgrammingLanguage(this XnaImpl xnaImpl) + { + return (ProgrammingLanguage)((int)xnaImpl); + } + public static bool isDesktop(this Platform platform) + { + return platform == Platform.Desktop; + } + public static bool isAndroid(this Platform platform) + { + return platform == Platform.Android; + } + public static bool isIOS(this Platform platform) + { + return platform == Platform.iOS; + } + public static bool isWeb(this Platform platform) + { + return platform == Platform.Web; + } + } +} \ No newline at end of file