From 20c92e836afe5a1ec298bb276d507ddd7168ca1a Mon Sep 17 00:00:00 2001 From: Robert Vokac Date: Sat, 21 Dec 2024 20:56:20 +0100 Subject: [PATCH] Refactoring II --- Decor.cs | 702 ++++++++++++++++++++++++++-------------------------- Game1.cs | 132 +++++----- InputPad.cs | 345 +++++++++++++------------- Jauge.cs | 16 +- Misc.cs | 34 ++- Pixmap.cs | 58 ++--- Slider.cs | 40 +-- TinyRect.cs | 14 +- 8 files changed, 669 insertions(+), 672 deletions(-) diff --git a/Decor.cs b/Decor.cs index 7aa6752..c32aa81 100644 --- a/Decor.cs +++ b/Decor.cs @@ -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); @@ -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) { @@ -3459,15 +3459,15 @@ namespace WindowsPhoneSpeedyBlupi if (ButtonPressed == Def.ButtonGlyph.PlayAction && !flag2 && m_blupiTransport == -1) { ButtonPressed = Def.ButtonGlyph.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; + 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) @@ -3580,15 +3580,15 @@ namespace WindowsPhoneSpeedyBlupi if (ButtonPressed == Def.ButtonGlyph.PlayAction && !flag2 && m_blupiTransport == -1) { ButtonPressed = Def.ButtonGlyph.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; + 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) { @@ -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) { @@ -4351,15 +4351,15 @@ namespace WindowsPhoneSpeedyBlupi if (m_blupiDynamite > 0) { ButtonPressed = Def.ButtonGlyph.None; - 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); if (!bVertigoLeft && !bVertigoRight && ObjectStart(end, 56, 0) != -1) { @@ -4376,15 +4376,15 @@ namespace WindowsPhoneSpeedyBlupi 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(); @@ -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/Game1.cs b/Game1.cs index 28676ea..b9eaef4 100644 --- a/Game1.cs +++ b/Game1.cs @@ -503,10 +503,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; } @@ -514,10 +514,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; } @@ -543,10 +543,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); } @@ -558,10 +558,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); } @@ -570,10 +570,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); } @@ -590,10 +590,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) @@ -626,23 +626,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; @@ -653,10 +653,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) @@ -672,10 +672,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); } @@ -689,17 +689,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); } @@ -788,26 +788,26 @@ 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); @@ -825,8 +825,8 @@ namespace WindowsPhoneSpeedyBlupi 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; @@ -835,8 +835,8 @@ 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); } @@ -846,8 +846,8 @@ namespace WindowsPhoneSpeedyBlupi { 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); diff --git a/InputPad.cs b/InputPad.cs index 5e752d0..3952e78 100644 --- a/InputPad.cs +++ b/InputPad.cs @@ -13,7 +13,7 @@ namespace WindowsPhoneSpeedyBlupi { public class InputPad { - private static readonly int padSize = 140; + private static readonly int padRadius = 140; private readonly Game1 game1; @@ -314,32 +314,32 @@ namespace WindowsPhoneSpeedyBlupi Boolean keyPressedDown = false; Boolean keyPressedLeft = false; Boolean keyPressedRight = false; - foreach (TinyPoint touchOrClick in touchesOrClicks) + foreach (TinyPoint touchOrClickItem in touchesOrClicks) { Boolean keyboardPressed = false; - if (touchOrClick.X == -1) + if (touchOrClickItem.X == -1) { keyboardPressed = true; } - Keys keyPressed = keyboardPressed ? (Keys)touchOrClick.Y : Keys.None; + 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 tinyPoint2 = keyboardPressed ? new TinyPoint(1, 1) : touchOrClick; - if (!accelStarted && Misc.IsInside(GetPadBounds(PadCenter, padSize), tinyPoint2)) + TinyPoint touchOrClick = keyboardPressed ? new TinyPoint(1, 1) : touchOrClickItem; + if (!accelStarted && Misc.IsInside(GetPadBounds(PadCenter, padRadius), touchOrClick)) { padPressed = true; - padTouchPos = tinyPoint2; + padTouchPos = touchOrClick; } - if (keyPressed == Keys.Up || keyPressed == Keys.Right || keyPressed == Keys.Down || keyPressed == Keys.Left) + if (keyPressedUp || keyPressedDown || keyPressedLeft || keyPressedRight) { padPressed = true; } Debug.WriteLine("padPressed=" + padPressed); - Def.ButtonGlyph buttonGlyph2 = ButtonDetect(tinyPoint2); + Def.ButtonGlyph buttonGlyph2 = ButtonDetect(touchOrClick); Debug.WriteLine("buttonGlyph2 =" + buttonGlyph2); if (buttonGlyph2 != 0) { @@ -354,7 +354,7 @@ namespace WindowsPhoneSpeedyBlupi } } - if ((Phase == Def.Phase.MainSetup || Phase == Def.Phase.PlaySetup) && accelSlider.Move(tinyPoint2)) + if ((Phase == Def.Phase.MainSetup || Phase == Def.Phase.PlaySetup) && accelSlider.Move(touchOrClick)) { gameData.AccelSensitivity = accelSlider.Value; } @@ -508,19 +508,20 @@ namespace WindowsPhoneSpeedyBlupi decor.KeyChange(num3); } - private Def.ButtonGlyph ButtonDetect(TinyPoint pos) + private Def.ButtonGlyph ButtonDetect(TinyPoint touchOrClick) { - foreach (Def.ButtonGlyph item in ButtonGlyphs.Reverse()) + foreach (Def.ButtonGlyph buttonGlyph in ButtonGlyphs.Reverse()) { - int value = 0; - if (item == Def.ButtonGlyph.PlayJump || item == Def.ButtonGlyph.PlayAction || item == Def.ButtonGlyph.PlayDown || item == Def.ButtonGlyph.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.ButtonGlyph.None; @@ -530,9 +531,9 @@ namespace WindowsPhoneSpeedyBlupi { 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.ButtonGlyph buttonGlyph in ButtonGlyphs) { @@ -570,10 +571,10 @@ 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; + result.LeftX = center.X - radius; + result.RightX = center.X + radius; + result.TopY = center.Y - radius; + result.BottomY = center.Y + radius; return result; } @@ -589,10 +590,10 @@ namespace WindowsPhoneSpeedyBlupi { int num6 = (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 * num6; + result.RightX = 80 * (num6 + 1); + result.TopY = 0; + result.BottomY = 80; return result; } switch (glyph) @@ -600,218 +601,218 @@ namespace WindowsPhoneSpeedyBlupi 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 = (int)(20.0 + num4 * 0.0); + result19.RightX = (int)(20.0 + num4 * 0.5); + result19.TopY = (int)(num2 - 20.0 - num4 * 2.1); + result19.BottomY = (int)(num2 - 20.0 - num4 * 1.6); return result19; } 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 = (int)(20.0 + num4 * 0.0); + result18.RightX = (int)(20.0 + num4 * 0.5); + result18.TopY = (int)(num2 - 20.0 - num4 * 1.6); + result18.BottomY = (int)(num2 - 20.0 - num4 * 1.1); return result18; } 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 = (int)(20.0 + num4 * 0.0); + result15.RightX = (int)(20.0 + num4 * 0.5); + result15.TopY = (int)(num2 - 20.0 - num4 * 1.1); + result15.BottomY = (int)(num2 - 20.0 - num4 * 0.6); return result15; } 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 = (int)(20.0 + num4 * 0.0); + result14.RightX = (int)(20.0 + num4 * 0.5); + result14.TopY = (int)(num2 - 20.0 - num4 * 0.5); + result14.BottomY = (int)(num2 - 20.0 - num4 * 0.0); return result14; } 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)(num - 20.0 - num4 * 1.0); + result11.RightX = (int)(num - 20.0 - num4 * 0.0); + result11.TopY = (int)(num2 - 40.0 - num4 * 1.0); + result11.BottomY = (int)(num2 - 40.0 - num4 * 0.0); return result11; } 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)(num - 20.0 - num4 * 0.75); + result10.RightX = (int)(num - 20.0 - num4 * 0.25); + result10.TopY = (int)(num2 - 20.0 - num4 * 2.1); + result10.BottomY = (int)(num2 - 20.0 - num4 * 1.6); return result10; } 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 + num4 * -0.21); + result37.RightX = (int)((double)PixmapOrigin.X + num4 * 0.79); + result37.TopY = (int)((double)PixmapOrigin.Y + num4 * 2.2); + result37.BottomY = (int)((double)PixmapOrigin.Y + num4 * 3.2); return result37; } 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 + num4 * 0.79); + result36.RightX = (int)((double)PixmapOrigin.X + num4 * 1.79); + result36.TopY = (int)((double)PixmapOrigin.Y + num4 * 2.2); + result36.BottomY = (int)((double)PixmapOrigin.Y + num4 * 3.2); return result36; } 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 + num4 * 1.79); + result35.RightX = (int)((double)PixmapOrigin.X + num4 * 2.79); + result35.TopY = (int)((double)PixmapOrigin.Y + num4 * 2.2); + result35.BottomY = (int)((double)PixmapOrigin.Y + num4 * 3.2); return result35; } 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 + num4 * 2.79); + result34.RightX = (int)((double)PixmapOrigin.X + num4 * 3.79); + result34.TopY = (int)((double)PixmapOrigin.Y + num4 * 2.2); + result34.BottomY = (int)((double)PixmapOrigin.Y + num4 * 3.2); return result34; } 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 + num4 * 3.79); + result33.RightX = (int)((double)PixmapOrigin.X + num4 * 4.79); + result33.TopY = (int)((double)PixmapOrigin.Y + num4 * 2.2); + result33.BottomY = (int)((double)PixmapOrigin.Y + num4 * 3.2); return result33; } 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 + num4 * 1.29); + result32.RightX = (int)((double)PixmapOrigin.X + num4 * 2.29); + result32.TopY = (int)((double)PixmapOrigin.Y + num4 * 2.2); + result32.BottomY = (int)((double)PixmapOrigin.Y + num4 * 3.2); return result32; } 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 + num4 * 2.29); + result31.RightX = (int)((double)PixmapOrigin.X + num4 * 3.29); + result31.TopY = (int)((double)PixmapOrigin.Y + num4 * 2.2); + result31.BottomY = (int)((double)PixmapOrigin.Y + num4 * 3.2); return result31; } 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 + num - num3 * 2.2); + result30.RightX = (int)((double)PixmapOrigin.X + num - num3 * 1.2); + result30.TopY = (int)((double)PixmapOrigin.Y + num3 * 0.2); + result30.BottomY = (int)((double)PixmapOrigin.Y + num3 * 1.2); return result30; } 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 + num4 * 2.5); + result29.RightX = (int)((double)PixmapOrigin.X + num4 * 3.5); + result29.TopY = (int)((double)PixmapOrigin.Y + num4 * 2.1); + result29.BottomY = (int)((double)PixmapOrigin.Y + num4 * 3.1); return result29; } 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 + num4 * 3.5); + result28.RightX = (int)((double)PixmapOrigin.X + num4 * 4.5); + result28.TopY = (int)((double)PixmapOrigin.Y + num4 * 2.1); + result28.BottomY = (int)((double)PixmapOrigin.Y + num4 * 3.1); return result28; } 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 + num4 * 3.5); + result27.RightX = (int)((double)PixmapOrigin.X + num4 * 4.5); + result27.TopY = (int)((double)PixmapOrigin.Y + num4 * 2.1); + result27.BottomY = (int)((double)PixmapOrigin.Y + num4 * 3.1); return result27; } 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 = (int)(20.0 + num4 * 0.0); + result26.RightX = (int)(20.0 + num4 * 0.5); + result26.TopY = (int)(num2 - 20.0 - num4 * 2.0); + result26.BottomY = (int)(num2 - 20.0 - num4 * 1.5); return result26; } 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 = (int)(20.0 + num4 * 0.0); + result25.RightX = (int)(20.0 + num4 * 0.5); + result25.TopY = (int)(num2 - 20.0 - num4 * 1.5); + result25.BottomY = (int)(num2 - 20.0 - num4 * 1.0); return result25; } 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 = (int)(20.0 + num4 * 0.0); + result24.RightX = (int)(20.0 + num4 * 0.5); + result24.TopY = (int)(num2 - 20.0 - num4 * 1.0); + result24.BottomY = (int)(num2 - 20.0 - num4 * 0.5); return result24; } 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 = (int)(20.0 + num4 * 0.0); + result23.RightX = (int)(20.0 + num4 * 0.5); + result23.TopY = (int)(num2 - 20.0 - num4 * 0.5); + result23.BottomY = (int)(num2 - 20.0 - num4 * 0.0); return result23; } 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 + num4 * 0.0); + result22.RightX = (int)(450.0 + num4 * 0.5); + result22.TopY = (int)(num2 - 20.0 - num4 * 2.0); + result22.BottomY = (int)(num2 - 20.0 - num4 * 1.5); return result22; } 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)(num - 20.0 - num4 * 0.8); + result21.RightX = (int)(num - 20.0 - num4 * 0.0); + result21.TopY = (int)(num2 - 20.0 - num4 * 0.8); + result21.BottomY = (int)(num2 - 20.0 - num4 * 0.0); return result21; } 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)(num - num3 * 0.7); + result20.RightX = (int)(num - num3 * 0.2); + result20.TopY = (int)(num3 * 0.2); + result20.BottomY = (int)(num3 * 0.7); return result20; } case Def.ButtonGlyph.PlayAction: @@ -819,17 +820,17 @@ namespace WindowsPhoneSpeedyBlupi 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 - num3 * 1.2); + result16.RightX = (int)((double)drawBounds.Width - num3 * 0.2); + result16.TopY = (int)(num2 - num3 * 2.6); + result16.BottomY = (int)(num2 - num3 * 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)(num3 * 0.2); + result17.RightX = (int)(num3 * 1.2); + result17.TopY = (int)(num2 - num3 * 2.6); + result17.BottomY = (int)(num2 - num3 * 1.6); return result17; } case Def.ButtonGlyph.PlayJump: @@ -837,17 +838,17 @@ namespace WindowsPhoneSpeedyBlupi 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 - num3 * 1.2); + result12.RightX = (int)((double)drawBounds.Width - num3 * 0.2); + result12.TopY = (int)(num2 - num3 * 1.2); + result12.BottomY = (int)(num2 - num3 * 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)(num3 * 0.2); + result13.RightX = (int)(num3 * 1.2); + result13.TopY = (int)(num2 - num3 * 1.2); + result13.BottomY = (int)(num2 - num3 * 0.2); return result13; } case Def.ButtonGlyph.PlayDown: @@ -855,71 +856,71 @@ namespace WindowsPhoneSpeedyBlupi 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)(num3 * 0.2); + result8.RightX = (int)(num3 * 1.2); + result8.TopY = (int)(num2 - num3 * 1.2); + result8.BottomY = (int)(num2 - num3 * 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 - num3 * 1.2); + result9.RightX = (int)((double)drawBounds.Width - num3 * 0.2); + result9.TopY = (int)(num2 - num3 * 1.2); + result9.BottomY = (int)(num2 - num3 * 0.2); return result9; } 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)(num5 * 0.0); + result7.RightX = (int)(num5 * 1.0); + result7.TopY = (int)(num5 * 0.0); + result7.BottomY = (int)(num5 * 1.0); return result7; } 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)(num5 * 0.0); + result6.RightX = (int)(num5 * 1.0); + result6.TopY = (int)(num5 * 1.0); + result6.BottomY = (int)(num5 * 2.0); return result6; } 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)(num5 * 1.0); + result5.RightX = (int)(num5 * 2.0); + result5.TopY = (int)(num5 * 0.0); + result5.BottomY = (int)(num5 * 1.0); return result5; } 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)(num5 * 1.0); + result4.RightX = (int)(num5 * 2.0); + result4.TopY = (int)(num5 * 1.0); + result4.BottomY = (int)(num5 * 2.0); return result4; } 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)(num5 * 2.0); + result3.RightX = (int)(num5 * 3.0); + result3.TopY = (int)(num5 * 0.0); + result3.BottomY = (int)(num5 * 1.0); return result3; } 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)(num5 * 2.0); + result2.RightX = (int)(num5 * 3.0); + result2.TopY = (int)(num5 * 1.0); + result2.BottomY = (int)(num5 * 2.0); return result2; } default: diff --git a/Jauge.cs b/Jauge.cs index c479539..58f26f8 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 9aa372a..d11d263 100644 --- a/Misc.cs +++ b/Misc.cs @@ -77,47 +77,43 @@ 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; } diff --git a/Pixmap.cs b/Pixmap.cs index eecee8a..38b9658 100644 --- a/Pixmap.cs +++ b/Pixmap.cs @@ -83,10 +83,10 @@ namespace WindowsPhoneSpeedyBlupi 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; } @@ -210,8 +210,8 @@ namespace WindowsPhoneSpeedyBlupi { 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; @@ -294,10 +294,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); } @@ -307,10 +307,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); } @@ -320,10 +320,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); } @@ -331,10 +331,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); } @@ -342,10 +342,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); } @@ -367,7 +367,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); @@ -510,8 +510,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/Slider.cs b/Slider.cs index 57a0104..4783e62 100644 --- a/Slider.cs +++ b/Slider.cs @@ -38,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); } @@ -73,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/TinyRect.cs b/TinyRect.cs index d3678de..8a50f3a 100644 --- a/TinyRect.cs +++ b/TinyRect.cs @@ -5,19 +5,19 @@ 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 int Width { get { - return Right - Left; + return RightX - LeftX; } } @@ -25,13 +25,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); } }