From a37d437a2f3b57fea085c88cb890b28709ed36c1 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Tue, 4 Feb 2014 13:53:36 +0100 Subject: [PATCH] nicer mipstat display * display mistats in the hud instead of having them flood the console * added display of 8x8 mips, just to show that they are possible press F6 in editmode to see the difference --- source/src/protos.h | 3 ++- source/src/rendercubes.cpp | 2 +- source/src/worldrender.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/src/protos.h b/source/src/protos.h index e6e8929a..1327abd1 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -344,7 +344,7 @@ extern void setuptmu(int n, const char *rgbfunc = NULL, const char *alphafunc = struct zone { int x1, x2, y1, y2, color; }; // zones (drawn on the minimap) // rendercubes -extern void mipstats(int a, int b, int c); +extern void mipstats(const int a[]); extern void render_flat(int tex, int x, int y, int size, int h, sqr *l1, sqr *l2, sqr *l3, sqr *l4, bool isceil); extern void render_flatdelta(int wtex, int x, int y, int size, float h1, float h2, float h3, float h4, sqr *l1, sqr *l2, sqr *l3, sqr *l4, bool isceil); extern void render_square(int wtex, float floor1, float floor2, float ceil1, float ceil2, int x1, int y1, int x2, int y2, int size, sqr *l1, sqr *l2, bool topleft, int dir); @@ -593,6 +593,7 @@ enum { HUDMSG_INFO = 0, HUDMSG_TIMER, + HUDMSG_MIPSTATS, HUDMSG_TYPE = 0xFF, HUDMSG_OVERWRITE = 1<<8 diff --git a/source/src/rendercubes.cpp b/source/src/rendercubes.cpp index b6b364d0..ad5fcbce 100644 --- a/source/src/rendercubes.cpp +++ b/source/src/rendercubes.cpp @@ -136,7 +136,7 @@ int firstindex; bool showm = false; void showmip() { showm = !showm; } -void mipstats(int a, int b, int c) { if(showm) conoutf("1x1/2x2/4x4: %d / %d / %d", a, b, c); } +void mipstats(const int a[]) { if(showm) hudeditf(HUDMSG_MIPSTATS, "1x1/2x2/4x4/8x8: %d / %d / %d / %d", a[0], a[1], a[2], a[3]); } COMMAND(showmip, ""); diff --git a/source/src/worldrender.cpp b/source/src/worldrender.cpp index e15c3f46..70e79e29 100644 --- a/source/src/worldrender.cpp +++ b/source/src/worldrender.cpp @@ -325,6 +325,6 @@ void render_world(float vx, float vy, float vh, float changelod, int yaw, int pi render_ceil = -pitch<0.5f*fovy; render_seg_new(vx, vy, vh, MAX_MIP, 0, 0, ssize>>MAX_MIP, ssize>>MAX_MIP); - mipstats(stats[0], stats[1], stats[2]); + mipstats(stats); }