Namespaces | |
namespace | FS |
Namespace for general filesystem functions for cross-platform compatability. | |
Enumerations | |
enum | MessageType { MESSAGE_CRITICAL = 0, MESSAGE_WARNING } |
Error message types. | |
Functions | |
void | alert (const ustring &text, const MessageType &type=MESSAGE_CRITICAL) |
Display an alert message to the user. | |
void | scriptToLimits (const ustring &str, UI::Limit &start, UI::Limit &end) |
Convert a court camera script string to animation limits. | |
Color | keyToColor (char ch) |
Map a char representing a text color to the actual color. | |
void | debugMessage (const ustring &msg) |
Print a debug message. | |
bool | pointInRect (const Point &p, const Rect &rect) |
See if a point is in a rectangle. | |
Point | calculateShakePoint (int highestRadius) |
Calculate a random offset point (used during shake animations). | |
int | randomRange (int min, int max) |
Get a random number in the provided range. | |
Point | getMouseLocation (Uint8 *modState=NULL) |
Get the location of the mouse pointer. | |
SDL_Surface * | createSurface (int width, int height) |
Create a blank surface. | |
ustring | ucharToStr (uchar ch) |
Convert a Unicode char to a string. | |
ustring | itoa (int num) |
Convert an integer to string. | |
StringVector | explodeString (const ustring &delimiter, const ustring &str) |
Break a string apart based on a delimiting substring. | |
StringVector | explodeString (uchar delimiter, const ustring &str) |
Break a string apart based on a delimiting character. | |
int | amountInString (const ustring &sub, const ustring &str) |
Count occurrences of a substring in a string. | |
Variables | |
bool | g_DebugOn = false |
Whether or not debugging is enabled in the player. | |
bool | g_DebugOn |
Whether or not debugging is enabled in the player. |
void Utils::alert | ( | const ustring & | text, | |
const MessageType & | type = MESSAGE_CRITICAL | |||
) |
Display an alert message to the user.
text | The text to display | |
type | The type of message |
int Utils::amountInString | ( | const ustring & | sub, | |
const ustring & | str | |||
) |
Count occurrences of a substring in a string.
sub | The substring to test | |
str | The string to test |
Point Utils::calculateShakePoint | ( | int | highestRadius | ) |
Calculate a random offset point (used during shake animations).
highestRadius | The largest radius to use in the calculation |
SDL_Surface * Utils::createSurface | ( | int | width, | |
int | height | |||
) |
Create a blank surface.
width | The width | |
height | The height |
void Utils::debugMessage | ( | const ustring & | msg | ) |
Print a debug message.
msg | The string to display |
StringVector Utils::explodeString | ( | uchar | delimiter, | |
const ustring & | str | |||
) |
Break a string apart based on a delimiting character.
delimiter | The character to use as a separator | |
str | The string to break apart |
StringVector Utils::explodeString | ( | const ustring & | delimiter, | |
const ustring & | str | |||
) |
Break a string apart based on a delimiting substring.
delimiter | The substring to use as a separator | |
str | The string to break apart |
Point Utils::getMouseLocation | ( | Uint8 * | modState = NULL |
) |
Get the location of the mouse pointer.
modState | Optional SDL mod button state |
ustring Utils::itoa | ( | int | num | ) |
Convert an integer to string.
num | The integer value |
Color Utils::keyToColor | ( | char | ch | ) |
Map a char representing a text color to the actual color.
ch | The color code character |
See if a point is in a rectangle.
p | The point to test | |
rect | The rect to test against |
int Utils::randomRange | ( | int | min, | |
int | max | |||
) |
Get a random number in the provided range.
min | The lower value in the range | |
max | The upper value in the range |
Convert a court camera script string to animation limits.
The provided string should be in the form of: "location1,location2" or the returned limits won't be correct
str | The string | |
start | The returned beginning location | |
end | The returned end location |
ustring Utils::ucharToStr | ( | uchar | ch | ) |
Convert a Unicode char to a string.
ch | The character |