Luaで日本語がうまく表示されない場合があったのを修正
@@ -3275,74 +3275,39 @@ | ||
3275 | 3275 | // Rendering text; this takes it as a Pascal string (byte 0 = number of text bytes) |
3276 | 3276 | bool OGL_RenderText(short BaseX, short BaseY, const char *Text, unsigned char r, unsigned char g, unsigned char b) |
3277 | 3277 | { |
3278 | - if (!OGL_IsActive()) return false; | |
3279 | - | |
3280 | - // Create display list for the current text string; | |
3281 | - // use the "standard" text-font display list (display lists can be nested) | |
3282 | - GLuint TextDisplayList; | |
3283 | - TextDisplayList = glGenLists(1); | |
3284 | - glNewList(TextDisplayList,GL_COMPILE); | |
3285 | - GetOnScreenFont().OGL_Render(Text); | |
3286 | - glEndList(); | |
3287 | - | |
3288 | - // Place the text in the foreground of the display | |
3289 | - SetProjectionType(Projection_Screen); | |
3290 | - GLfloat Depth = 0; | |
3291 | - | |
3292 | - // Using a modelview matrix, of course | |
3293 | - glMatrixMode(GL_MODELVIEW); | |
3294 | - glPushMatrix(); | |
3295 | - | |
3296 | - // Background | |
3297 | - glColor3f(0,0,0); | |
3298 | - | |
3299 | - // Changed to drop shadow only for performance reasons | |
3300 | - /* | |
3301 | - glLoadIdentity(); | |
3302 | - glTranslatef(BaseX-1,BaseY-1,Depth); | |
3303 | - glCallList(TextDisplayList); | |
3304 | - | |
3305 | - glLoadIdentity(); | |
3306 | - glTranslatef(BaseX,BaseY-1,Depth); | |
3307 | - glCallList(TextDisplayList); | |
3308 | - | |
3309 | - glLoadIdentity(); | |
3310 | - glTranslatef(BaseX+1,BaseY-1,Depth); | |
3311 | - glCallList(TextDisplayList); | |
3312 | - | |
3313 | - glLoadIdentity(); | |
3314 | - glTranslatef(BaseX-1,BaseY,Depth); | |
3315 | - glCallList(TextDisplayList); | |
3316 | - | |
3317 | - glLoadIdentity(); | |
3318 | - glTranslatef(BaseX+1,BaseY,Depth); | |
3319 | - glCallList(TextDisplayList); | |
3320 | - | |
3321 | - glLoadIdentity(); | |
3322 | - glTranslatef(BaseX-1,BaseY+1,Depth); | |
3323 | - glCallList(TextDisplayList); | |
3324 | - | |
3325 | - glLoadIdentity(); | |
3326 | - glTranslatef(BaseX,BaseY+1,Depth); | |
3327 | - glCallList(TextDisplayList); | |
3328 | - */ | |
3329 | - | |
3330 | - glLoadIdentity(); | |
3331 | - glTranslatef(BaseX+1.0F,BaseY+1.0F,Depth); | |
3332 | - glCallList(TextDisplayList); | |
3333 | - | |
3334 | - // Foreground | |
3335 | - SglColor3f(r/255.0f,g/255.0f,b/255.0f); | |
3336 | - | |
3337 | - glLoadIdentity(); | |
3338 | - glTranslatef(BaseX,BaseY,Depth); | |
3339 | - glCallList(TextDisplayList); | |
3278 | + if (!OGL_IsActive()) return false; | |
3279 | + | |
3280 | + // Create display list for the current text string; | |
3281 | + // use the "standard" text-font display list (display lists can be nested) | |
3282 | + | |
3283 | + // Place the text in the foreground of the display | |
3284 | + SetProjectionType(Projection_Screen); | |
3285 | + GLfloat Depth = 0; | |
3286 | + | |
3287 | + // Using a modelview matrix, of course | |
3288 | + glMatrixMode(GL_MODELVIEW); | |
3289 | + glPushMatrix(); | |
3290 | + | |
3291 | + // Background | |
3292 | + glColor3f(0,0,0); | |
3293 | + | |
3294 | + | |
3295 | + | |
3296 | + glLoadIdentity(); | |
3297 | + glTranslatef(BaseX+1.0F,BaseY+1.0F,Depth); | |
3298 | + GetOnScreenFont().OGL_Render(Text); | |
3299 | + | |
3300 | + // Foreground | |
3301 | + SglColor3f(r/255.0f,g/255.0f,b/255.0f); | |
3302 | + | |
3303 | + glLoadIdentity(); | |
3304 | + glTranslatef(BaseX,BaseY,Depth); | |
3305 | + GetOnScreenFont().OGL_Render(Text); | |
3340 | 3306 | |
3341 | - // Clean up | |
3342 | - glDeleteLists(TextDisplayList,1); | |
3343 | - glPopMatrix(); | |
3344 | - | |
3345 | - return true; | |
3307 | + // Clean up | |
3308 | + glPopMatrix(); | |
3309 | + | |
3310 | + return true; | |
3346 | 3311 | } |
3347 | 3312 | |
3348 | 3313 |