From 794d1749a76abd39d88b33b9cfe63f7a1b5793fd Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Thu, 20 May 2004 07:02:54 +0000 Subject: [PATCH] use GL_INDEX_BITS to get bpp for color buffer for renderstats (d1x r1.33) --- ChangeLog | 5 +++++ arch/ogl/ogl.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98a82c20..d0e82829 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-05-20 Matthew Mueller + + * arch/ogl/ogl.c: use GL_INDEX_BITS to get bpp for color buffer + for renderstats (d1x r1.33) + 2004-05-19 Matthew Mueller * arch/ogl/gr.c, arch/ogl/ogl.c, include/ogl_init.h, diff --git a/arch/ogl/ogl.c b/arch/ogl/ogl.c index 5957ae0a..9a36072a 100644 --- a/arch/ogl/ogl.c +++ b/arch/ogl/ogl.c @@ -1,4 +1,4 @@ -/* $Id: ogl.c,v 1.20 2004-05-20 05:16:00 btb Exp $ */ +/* $Id: ogl.c,v 1.21 2004-05-20 07:02:54 btb Exp $ */ /* * * Graphics support functions for OpenGL. @@ -207,8 +207,10 @@ int ogl_texture_stats(void){ } if (gr_renderstats) { - int r, g, b, a, dbl, depth, res, colorsize, depthsize; + int idx, r, g, b, a, dbl, depth, res, colorsize, depthsize; + res = SWIDTH * SHEIGHT; + glGetIntegerv(GL_INDEX_BITS, &idx); glGetIntegerv(GL_RED_BITS, &r); glGetIntegerv(GL_GREEN_BITS, &g); glGetIntegerv(GL_BLUE_BITS, &b); @@ -216,10 +218,10 @@ int ogl_texture_stats(void){ glGetIntegerv(GL_DOUBLEBUFFER, &dbl); dbl += 1; glGetIntegerv(GL_DEPTH_BITS, &depth); - colorsize = ((r + g + b + a) * res * dbl) / 8; + colorsize = (idx * res * dbl) / 8; depthsize = res * depth / 8; gr_printf(5, GAME_FONT->ft_h * 14 + 3 * 14, "%i(%i,%i) %iK(%iK wasted)", used, usedrgba, usedl4a4, truebytes / 1024, (truebytes - databytes) / 1024); - gr_printf(5, GAME_FONT->ft_h * 15 + 3 * 15, "r%i,g%i,b%i,a%ix%i=%iK depth%i=%iK", r, g, b, a, dbl, colorsize / 1024, depth, depthsize / 1024); + gr_printf(5, GAME_FONT->ft_h * 15 + 3 * 15, "%ibpp(r%i,g%i,b%i,a%i)x%i=%iK depth%i=%iK", idx, r, g, b, a, dbl, colorsize / 1024, depth, depthsize / 1024); gr_printf(5, GAME_FONT->ft_h * 16 + 3 * 16, "total=%iK", (colorsize + depthsize + truebytes) / 1024); } // glmprintf((0,"ogl tex stats: %i(%i,%i|%i,%i,%i,%i,%i) %i(%i)b (%i(%i)wasted)\n",used,usedrgba,usedl4a4,prio0,prio1,prio2,prio3,prioh,truebytes,truetexel,truebytes-databytes,truetexel-datatexel)); -- 2.39.2