Cache canvas in ogl/ogl.cpp

This commit is contained in:
Kp 2017-03-10 01:22:26 +00:00
parent f080508d6c
commit 242c96b679

View file

@ -322,17 +322,18 @@ static void ogl_texture_stats(void)
dbl += 1;
glGetIntegerv(GL_DEPTH_BITS, &depth);
gr_set_current_canvas(NULL);
gr_set_curfont(*grd_curcanv, GAME_FONT);
gr_set_fontcolor(*grd_curcanv, BM_XRGB(255, 255, 255), -1);
auto &canvas = *grd_curcanv;
gr_set_curfont(canvas, GAME_FONT);
gr_set_fontcolor(canvas, BM_XRGB(255, 255, 255), -1);
colorsize = (idx * res * dbl) / 8;
depthsize = res * depth / 8;
const auto &&fspacx2 = FSPACX(2);
const auto &&fspacy1 = FSPACY(1);
const auto &&line_spacing = LINE_SPACING(*grd_curcanv);
gr_printf(*grd_curcanv, fspacx2, fspacy1, "%i flat %i tex %i bitmaps", r_polyc, r_tpolyc, r_bitmapc);
gr_printf(*grd_curcanv, fspacx2, fspacy1 + line_spacing, "%i(%i,%i,%i,%i) %iK(%iK wasted) (%i postcachedtex)", used, usedrgba, usedrgb, usedidx, usedother, truebytes / 1024, (truebytes - databytes) / 1024, r_texcount - r_cachedtexcount);
gr_printf(*grd_curcanv, fspacx2, fspacy1 + (line_spacing * 2), "%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(*grd_curcanv, fspacx2, fspacy1 + (line_spacing * 3), "total=%iK", (colorsize + depthsize + truebytes) / 1024);
const auto &&line_spacing = LINE_SPACING(canvas);
gr_printf(canvas, fspacx2, fspacy1, "%i flat %i tex %i bitmaps", r_polyc, r_tpolyc, r_bitmapc);
gr_printf(canvas, fspacx2, fspacy1 + line_spacing, "%i(%i,%i,%i,%i) %iK(%iK wasted) (%i postcachedtex)", used, usedrgba, usedrgb, usedidx, usedother, truebytes / 1024, (truebytes - databytes) / 1024, r_texcount - r_cachedtexcount);
gr_printf(canvas, fspacx2, fspacy1 + (line_spacing * 2), "%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(canvas, fspacx2, fspacy1 + (line_spacing * 3), "total=%iK", (colorsize + depthsize + truebytes) / 1024);
}
static void ogl_bindbmtex(grs_bitmap &bm, bool edgepad){