[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/video font.c
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus/src/video font.c |
Date: |
16 Jan 2004 16:55:59 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/01/16 16:55:59
Modified files:
src/video : font.c
Log message:
Fixed clipping chars with opengl
Patches:
Index: stratagus/src/video/font.c
diff -u stratagus/src/video/font.c:1.79 stratagus/src/video/font.c:1.80
--- stratagus/src/video/font.c:1.79 Fri Jan 16 07:33:52 2004
+++ stratagus/src/video/font.c Fri Jan 16 16:55:58 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: font.c,v 1.79 2004/01/15 20:33:52 jsalmon3 Exp $
+// $Id: font.c,v 1.80 2004/01/16 05:55:58 jsalmon3 Exp $
//@{
@@ -151,12 +151,15 @@
{
SDL_Color* c;
int i;
+ int fy;
glDisable(GL_TEXTURE_2D);
if (y + h >= VideoHeight) {
h = VideoHeight - y - 1;
}
+ fy = gy / Fonts[CurrentFont].Height * Fonts[CurrentFont].Height;
+ fy = fy + Fonts[CurrentFont].Height - (gy - fy) - h;
for (i = 0; i < NumFontColors; ++i) {
c = FontColor->Color + i;
glColor3ub(c->r, c->g, c->b);
@@ -164,7 +167,7 @@
glBitmap(FontBitmapWidths[CurrentFont] * 8, h,
0.0f, 0.0f, 0.0f, 0.0f,
FontBitmaps[CurrentFont][i] +
- (gy + Fonts[CurrentFont].Height - h) *
FontBitmapWidths[CurrentFont]);
+ fy * FontBitmapWidths[CurrentFont]);
}
glEnable(GL_TEXTURE_2D);