summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-07-12 20:18:25 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-07-12 20:18:25 +0000
commitd8715ab4acf1ea315614372ca3410fbc598bc4cd (patch)
tree28590f0f16e19d71c9d726883ce9cb6e23dc7a85 /src/lib
parent465010dc114464564a5b7920dcb2f08338992b25 (diff)
Note: I have done some testing, but there are probably more bugs
lurking. If you run into anything odd, please let me know. Added new module uiinput.c which manages input for the user interface. The OSD is responsible for pushing mouse events and character events to this interface in order to support mouse movement and text-based input (currently only used for the select game menu). Added support for navigating through the menus using the mouse. [Nathan Woods, Aaron Giles] Redesigned the UI menus so that they can maintain a richer state. Now the menus can be generated once and reused, rather than requiring them to be regenerated on each frame. All menus also share a comment eventing system and navigation through them is managed centrally. Rewrote all the menus to use the new system, apart from the cheat menus, which are now disabled. Reorganized the video menu to make it easier to understand. [Aaron Giles]
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/astring.c22
-rw-r--r--src/lib/util/astring.h3
-rw-r--r--src/lib/util/unicode.h1
3 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/util/astring.c b/src/lib/util/astring.c
index 20d12401d28..5be6de07a84 100644
--- a/src/lib/util/astring.c
+++ b/src/lib/util/astring.c
@@ -335,6 +335,28 @@ int astring_printf(astring *dst, const char *format, ...)
}
+/*-------------------------------------------------
+ astring_catprintf - formatted printf to
+ the end of an astring
+-------------------------------------------------*/
+
+int astring_catprintf(astring *dst, const char *format, ...)
+{
+ char tempbuf[4096];
+ va_list args;
+ int result;
+
+ /* sprintf into the temporary buffer */
+ va_start(args, format);
+ result = vsprintf(tempbuf, format, args);
+ va_end(args);
+
+ /* append the result */
+ astring_catc(dst, tempbuf);
+ return result;
+}
+
+
/***************************************************************************
ASTRING QUERIES
diff --git a/src/lib/util/astring.h b/src/lib/util/astring.h
index 854ea876248..2b18bd1182d 100644
--- a/src/lib/util/astring.h
+++ b/src/lib/util/astring.h
@@ -75,6 +75,9 @@ astring *astring_del(astring *str, int start, int count);
/* formatted printf to an astring */
int astring_printf(astring *dst, const char *format, ...) ATTR_PRINTF(2,3);
+/* formatted printf to the end of an astring */
+int astring_catprintf(astring *dst, const char *format, ...) ATTR_PRINTF(2,3);
+
/* ----- astring queries ----- */
diff --git a/src/lib/util/unicode.h b/src/lib/util/unicode.h
index 78aa3c6cc33..74105b810e0 100644
--- a/src/lib/util/unicode.h
+++ b/src/lib/util/unicode.h
@@ -38,6 +38,7 @@
/* these are UTF-8 encoded strings for common characters */
#define UTF8_NBSP "\xc2\xa0" /* non-breaking space */
#define UTF8_MULTIPLY "\xc3\x97" /* multiplication symbol */
+#define UTF8_DEGREES "\xc2\xb0" /* degrees symbol */