From deddab45c14b6ec21a224852c7ae234d19183352 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 7 Nov 2006 02:43:44 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@513 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/console.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/source/src/console.cpp b/source/src/console.cpp index 9eb98904..811753c3 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -56,18 +56,30 @@ void conoutf(const char *s, ...) }; }; +bool fullconsole = false; +void toggleconsole() { fullconsole = !fullconsole; }; +COMMAND(toggleconsole, ARG_NONE); + void renderconsole() // render buffer taking into account time & scrolling { - int nd = 0; - char *refs[ndraw]; - loopv(conlines) if(conskip ? i>=conskip-1 || i>=conlines.length()-ndraw : lastmillis-conlines[i].outtime<20000) + if(fullconsole) { - refs[nd++] = conlines[i].cref; - if(nd==ndraw) break; - }; - loopj(nd) + int w = VIRTW*4/3, h = VIRTH*4/3; + int numl = h/3/FONTH; + int offset = min(conskip, max(conlines.length() - numl, 0)); + blendbox(0, 0, w, (numl+1)*FONTH*5/4, true); + loopi(numl) draw_text(offset+i>=conlines.length() ? "" : conlines[offset+i].cref, FONTH/3, (FONTH*5/4)*(numl-i-1)+FONTH/3); + } + else { - draw_text(refs[j], FONTH/3, (FONTH/4*5)*(nd-j-1)+FONTH/3); + int nd = 0; + char *refs[ndraw]; + loopv(conlines) if(conskip ? i>=conskip-1 || i>=conlines.length()-ndraw : lastmillis-conlines[i].outtime<20000) + { + refs[nd++] = conlines[i].cref; + if(nd==ndraw) break; + }; + loopj(nd) draw_text(refs[j], FONTH/3, (FONTH*5/4)*(nd-j-1)+FONTH/3); }; };