mirror of
https://github.com/glest/glest-source.git
synced 2025-08-25 17:20:43 +02:00
- attempt to NOT convert to utf8 twice
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user