Skip to content
Permalink
Browse files

show detailed data of the cube inside editing focus

* shows all geometry data of the cube in editing focus in the hud
* can be toggled by F8 in editmode
* shows cuby type, floor and ceiling heights, vdelta and all textures

(if mipstats *and* edit focus details are requested: show focus detail)
  • Loading branch information...
ac-stef committed Feb 4, 2014
1 parent a37d437 commit 50b3f6867c4418b13ad52b6c6d316b76f073e3e5
Showing with 22 additions and 5 deletions.
  1. +1 −0 config/resetbinds.cfg
  2. +1 −1 source/src/editing.cpp
  3. +2 −0 source/src/protos.h
  4. +18 −4 source/src/rendercubes.cpp
@@ -152,6 +152,7 @@ editbind F6 showmip
bind F7 []
editbind F7 [ if $fullbright [ fullbright 0 ] [ fullbright 1 ] ]
bind F8 []
editbind F8 showfocuscubedetails
bind F9 []
bind F10 [ if (! (watchingdemo)) getdemo ]
bind F11 [ conskip -1000; toggleconsole ]
@@ -96,7 +96,7 @@ char *editinfo()
if(selset()) concatformatstring(info, "selection = (%d, %d)", (sels.last()).xs, (sels.last()).ys);
else concatformatstring(info, "no selection");
sqr *s;
if(!OUTBORD(cx, cy) && (s = S(cx,cy)) && !SOLID(s) && s->tag) concatformatstring(info, ", tag 0x%02X", s->tag);
if(!OUTBORD(cx, cy) && (s = S(cx,cy)) && !editfocusdetails(s) && !SOLID(s) && s->tag) concatformatstring(info, ", tag 0x%02X", s->tag);
return info;
}

@@ -345,6 +345,7 @@ struct zone { int x1, x2, y1, y2, color; }; // zones (drawn on the minimap)

// rendercubes
extern void mipstats(const int a[]);
extern bool editfocusdetails(sqr *s);
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);
@@ -594,6 +595,7 @@ enum
HUDMSG_INFO = 0,
HUDMSG_TIMER,
HUDMSG_MIPSTATS,
HUDMSG_EDITFOCUS,

HUDMSG_TYPE = 0xFF,
HUDMSG_OVERWRITE = 1<<8
@@ -133,12 +133,26 @@ int ol1r, ol1g, ol1b, ol2r, ol2g, ol2b;
float ofloor, oceil;
bool ohf;
int firstindex;
bool showm = false;
bool showm = false, showef = false;

void showmip() { showm = !showm; }
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]); }
COMMANDF(showmip, "",() { showm = !showm; });
COMMANDF(showfocuscubedetails, "",() { showef = !showef; });

COMMAND(showmip, "");
const char *cubetypes[] = {"SOLID", "CORNER", "FHF", "CHF", "SPACE"};
const char *cubetypename(int t) { return t >= 0 && t < SEMISOLID ? cubetypes[t] : "unknown"; }

void mipstats(const int a[]) { if(showm && !showef) hudeditf(HUDMSG_MIPSTATS, "1x1/2x2/4x4/8x8: %d / %d / %d / %d", a[0], a[1], a[2], a[3]); }

bool editfocusdetails(sqr *s)
{
if(showef)
{
const char *g = SOLID(s) ? "\f4" : "";
hudeditf(HUDMSG_EDITFOCUS, "%s: \fs%s%d..%d\fr W:%d \fs%sU:%d F:%d C:%d v:%d t:0x%X\fr", cubetypename(s->type), g, s->floor, s->ceil, s->wtex, g, s->utex, s->ftex, s->ctex, s->vdelta, s->tag);
return true;
}
return false;
}

VAR(mergestrips, 0, 1, 1);

0 comments on commit 50b3f68

Please sign in to comment.
You can’t perform that action at this time.