https://github.com/libsdl-org/Maelstrom/commit/e2f33b5090a076e9ca32eb9ed0514f8eef1a3919
From e2f33b5090a076e9ca32eb9ed0514f8eef1a3919 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 1 Nov 2012 21:29:31 -0700
Subject: [PATCH] More Android compile fixes
---
screenlib/UIDialogButton.h | 4 +++-
screenlib/UIElementThumbstick.cpp | 8 ++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/screenlib/UIDialogButton.h b/screenlib/UIDialogButton.h
index 6804701c..bfe95c7c 100644
--- a/screenlib/UIDialogButton.h
+++ b/screenlib/UIDialogButton.h
@@ -31,7 +31,9 @@ DECLARE_TYPESAFE_CLASS(UIElementButton)
UIDialogButton(UIBaseElement *parent, const char *name, UIDrawEngine *drawEngine);
override bool Load(rapidxml::xml_node<> *node, const UITemplates *templates);
-
+
+ void SetCloseDialog(bool close) { m_closeDialog = close; }
+
bool IsDefault() const {
return m_default;
}
diff --git a/screenlib/UIElementThumbstick.cpp b/screenlib/UIElementThumbstick.cpp
index 7925ef43..9ba15c09 100644
--- a/screenlib/UIElementThumbstick.cpp
+++ b/screenlib/UIElementThumbstick.cpp
@@ -72,11 +72,11 @@ UIElementThumbstick::Load(rapidxml::xml_node<> *node, const UITemplates *templat
LoadNumber(child, "arc", arc);
action.arc_begin = DEGREES_TO_RADS(angle - arc/2);
if (action.arc_begin < 0) {
- action.arc_begin += 2 * M_PI;
+ action.arc_begin += (float)(2 * M_PI);
}
action.arc_end = DEGREES_TO_RADS(angle + arc/2);
if (action.arc_end > (2 * M_PI)) {
- action.arc_end -= 2 * M_PI;
+ action.arc_end -= (float)(2 * M_PI);
}
LoadNumber(child, "active_radius", action.active_radius);
@@ -186,8 +186,8 @@ UIElementThumbstick::GetTouchAngleAndDistance(int x, int y, float &angle, float
float b = (float)(y - m_startY);
// The angle is in the 0 - 2PI range with 0 being the +Y axis
- angle = M_PI - SDL_atan2(a, b);
- distance = SDL_sqrt((a*a) + (b*b));
+ angle = (float)(M_PI - SDL_atan2(a, b));
+ distance = (float)SDL_sqrt((a*a) + (b*b));
return true;
}