about summary refs log tree commit diff
path: root/src/game
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2009-06-07 16:06:03 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2009-06-07 16:06:03 +0000
commit9254ca61f1e459cbaf137ce4511332365da9c225 (patch)
treeac23ac63c270d3426a6b7e9b39c104763ea701b5 /src/game
parentd754cd9d19334fcd0c956ec3074547c621b1bbab (diff)
downloadzcatch-9254ca61f1e459cbaf137ce4511332365da9c225.tar.gz
zcatch-9254ca61f1e459cbaf137ce4511332365da9c225.zip
fixed utf8 support
Diffstat (limited to 'src/game')
-rw-r--r--src/game/client/components/menus.cpp17
-rw-r--r--src/game/client/gameclient.cpp32
2 files changed, 49 insertions, 0 deletions
diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp
index 53b57e2c..050c7056 100644
--- a/src/game/client/components/menus.cpp
+++ b/src/game/client/components/menus.cpp
@@ -1003,6 +1003,23 @@ extern "C" void font_debug_render();
 
 void MENUS::on_render()
 {
+	/*
+	// text rendering test stuff
+	render_background();
+
+	TEXT_CURSOR cursor;
+	gfx_text_set_cursor(&cursor, 10, 10, 20, TEXTFLAG_RENDER);
+	gfx_text_ex(&cursor, "ようこそ - ガイド", -1);
+
+	gfx_text_set_cursor(&cursor, 10, 30, 15, TEXTFLAG_RENDER);
+	gfx_text_ex(&cursor, "ようこそ - ガイド", -1);
+	
+	//gfx_texture_set(-1);
+	gfx_quads_begin();
+	gfx_quads_drawTL(60, 60, 5000, 5000);
+	gfx_quads_end();
+	return;*/
+	
 	if(client_state() != CLIENTSTATE_ONLINE && client_state() != CLIENTSTATE_DEMOPLAYBACK)
 		set_active(true);
 
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp
index a90cdc49..70aee255 100644
--- a/src/game/client/gameclient.cpp
+++ b/src/game/client/gameclient.cpp
@@ -183,8 +183,39 @@ void GAMECLIENT::on_console_init()
 	suppress_events = false;
 }
 
+/*
+unsigned char utf8lut[] = {}
+
+static int utf8_decode(unsigned char **ptr)
+{
+	unsigned char first = **ptr;
+	if(first&0x80 == 0)
+	{
+		*ptr += 1;
+		return first;
+	}
+	
+	if(first&(0x80|0x40|0x20) == (0x80|0x40))
+	{
+		// two bytes
+	}
+
+	if(first&(0x80|0x40|0x20|0x10) == (0x80|0x40|0x20))
+	{
+		// three bytes
+	}
+}*/
+
+#include <stdio.h>
+
 void GAMECLIENT::on_init()
 {
+	/*const char *p = "Hello World åäö ようこそ - ガイド ";
+	for(; *p; )
+	{
+		dbg_msg("", "%d", utf8_decode(&p));
+	}*/
+	
 	// init all components
 	for(int i = 0; i < all.num; i++)
 		all.components[i]->on_init();
@@ -197,6 +228,7 @@ void GAMECLIENT::on_init()
 	
 	// load default font	
 	static FONT *default_font;
+	//default_font = gfx_font_load("data/fonts/sazanami-gothic.ttf");
 	default_font = gfx_font_load("data/fonts/vera.ttf");
 	gfx_text_set_default_font(default_font);