From a8724370c587e437fb76e18cbb45c1a10e1229b0 Mon Sep 17 00:00:00 2001 From: Joel Teichroeb Date: Mon, 23 May 2011 20:03:46 -0700 Subject: [PATCH] A bit of cleanup. --- engines/grim/gfx_opengl.cpp | 10 ++-------- engines/grim/lua_v1_text.cpp | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/engines/grim/gfx_opengl.cpp b/engines/grim/gfx_opengl.cpp index cfb4b95a36a..a74febabd3e 100644 --- a/engines/grim/gfx_opengl.cpp +++ b/engines/grim/gfx_opengl.cpp @@ -808,7 +808,7 @@ void GfxOpenGL::createFont(Font *font) { int size = 0; for (int i = 0; i < 256; ++i) { int width = font->getCharDataWidth(i), height = font->getCharDataHeight(i); - int m = width > height ? width : height; + int m = MAX(width, height); if (m > size) size = m; } @@ -838,15 +838,11 @@ void GfxOpenGL::createFont(Font *font) { glGenTextures(1, texture); - uint start = (int)font->getCharData(0); + uint start = (uint)font->getCharData(0); for (int i = 0, row = 0; i < 256; ++i) { - int width = font->getCharDataWidth(i), height = font->getCharDataHeight(i); - uint d = (uint)font->getCharData(i) - start; for (int x = 0; x < height; ++x) { - - // TODO: Make this line use less magic uint a = row * size * size * bpp * charsHigh; uint b = x * size * charsWide * bpp; uint c = 0; @@ -870,8 +866,6 @@ void GfxOpenGL::createFont(Font *font) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size * charsWide, size * charsHigh, 0, GL_RGBA, GL_UNSIGNED_BYTE, temp); - - delete[] data; delete[] temp; } diff --git a/engines/grim/lua_v1_text.cpp b/engines/grim/lua_v1_text.cpp index 40788a3b905..733917627d8 100644 --- a/engines/grim/lua_v1_text.cpp +++ b/engines/grim/lua_v1_text.cpp @@ -177,7 +177,6 @@ void L1_BlastText() { setTextObjectParams(textObject, tableObj); textObject->setText(text.c_str()); - //textObject->createBitmap(); textObject->draw(); delete textObject; }