- attempt to NOT convert to utf8 twice

This commit is contained in:
Mark Vejvoda
2011-06-26 03:38:28 +00:00
parent fd8ed536bb
commit aa677cfc97
8 changed files with 57 additions and 23 deletions

View File

@@ -67,9 +67,9 @@ void TextRenderer2DGl::render(const string &text, float x, float y, bool centere
Vec2f rasterPos;
if(font->getTextHandler() != NULL) {
char *utfStr = String::ConvertToUTF8(renderText.c_str());
renderText = utfStr;
delete [] utfStr;
//char *utfStr = String::ConvertToUTF8(renderText.c_str());
//renderText = utfStr;
//delete [] utfStr;
if(centered) {
rasterPos.x= x - font->getTextHandler()->Advance(renderText.c_str()) / 2.f;
@@ -455,9 +455,9 @@ void TextRenderer3DGl::internalRender(const string &text, float x, float y, boo
FontMetrics *metrics= font->getMetrics();
if(font->getTextHandler() != NULL) {
char *utfStr = String::ConvertToUTF8(renderText.c_str());
renderText = utfStr;
delete [] utfStr;
//char *utfStr = String::ConvertToUTF8(renderText.c_str());
//renderText = utfStr;
//delete [] utfStr;
//centered = false;
if(centered) {

View File

@@ -990,7 +990,8 @@ bool isKeyPressed(SDLKey compareKey, SDL_KeyboardEvent input) {
SDLKey extractKeyPressed(SDL_KeyboardEvent input) {
SDLKey c = SDLK_UNKNOWN;
if(input.keysym.unicode > 0 && input.keysym.unicode < 0x80) {
//if(input.keysym.unicode > 0 && input.keysym.unicode < 0x80) {
if(input.keysym.unicode > 0) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
c = (SDLKey)input.keysym.unicode;
//c = toupper(c);