diff options
| author | Japa | 2010-06-12 07:34:56 +0000 |
|---|---|---|
| committer | Japa | 2010-06-12 07:34:56 +0000 |
| commit | 3edbe67cfc3e31331e291efbf8e5c54c9cdaa0fa (patch) | |
| tree | 46aa9f089f0d00064f6b9a70557a2666d902be02 /Creatures.cpp | |
| parent | 7f64b9b4b8a89f094ab914fcda93cf377ef03402 (diff) | |
| download | stonesense-3edbe67cfc3e31331e291efbf8e5c54c9cdaa0fa.tar.gz stonesense-3edbe67cfc3e31331e291efbf8e5c54c9cdaa0fa.tar.bz2 stonesense-3edbe67cfc3e31331e291efbf8e5c54c9cdaa0fa.tar.xz | |
Fixed upper-case names.
Diffstat (limited to 'Creatures.cpp')
| -rw-r--r-- | Creatures.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Creatures.cpp b/Creatures.cpp index a08106e..8fe9b43 100644 --- a/Creatures.cpp +++ b/Creatures.cpp @@ -11,6 +11,19 @@ //vector<t_matgloss> v_creatureNames;
//vector<CreatureConfiguration> creatureTypes;
+int32_t charToUpper(int32_t c)
+{
+ if(c >= 0x61 && c <= 0x7A)
+ return c-0x20;
+ else if(c >= 0xE0 && c <= 0xF6)
+ return c-0x20;
+ else if(c >= 0xF8 && c <= 0xFE)
+ return c-0x20;
+ else return c;
+}
+
+
+
ALLEGRO_USTR* bufferToUstr(const char* buffer, int length)
{
ALLEGRO_USTR* temp = al_ustr_new("");
@@ -262,10 +275,10 @@ void DrawCreatureText(int drawx, int drawy, t_creature* creature ){ strncpy(buffer,creature->name.first_name,127);
buffer[127]=0;
ALLEGRO_USTR* temp = bufferToUstr(buffer, 128);
- if (buffer[0]>90)
- buffer[0] -= 32;
+ al_ustr_set_chr(temp, 0, charToUpper(al_ustr_get(temp, 0)));
draw_ustr_border(font, drawx, drawy-(20+al_get_font_line_height(font)), 0,
temp );
+ al_ustr_free(temp);
}
else if (config.names_use_species)
{
|
