-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cff7a1
commit 2f135c3
Showing
7 changed files
with
154 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
Index: src/engine/console.cpp | ||
=================================================================== | ||
--- src/engine/console.cpp (revision 6479) | ||
+++ src/engine/console.cpp (working copy) | ||
@@ -48,7 +48,10 @@ | ||
} | ||
|
||
VAR(fullconsole, 0, 0, 1); | ||
-ICOMMAND(toggleconsole, "", (), { fullconsole ^= 1; }); | ||
+ICOMMAND(toggleconsole, "", (), { | ||
+ fullconsole ^= 1; | ||
+ if(fullconsole) game::showscores(false); | ||
+}); | ||
|
||
int rendercommand(int x, int y, int w) | ||
{ | ||
@@ -67,7 +70,7 @@ | ||
VARP(miniconwidth, 0, 40, 100); | ||
VARP(confade, 0, 30, 60); | ||
VARP(miniconfade, 0, 30, 60); | ||
-VARP(fullconsize, 0, 75, 100); | ||
+VARP(fullconsize, 0, 75, 100); // unused | ||
HVARP(confilter, 0, 0x7FFFFFF, 0x7FFFFFF); | ||
HVARP(fullconfilter, 0, 0x7FFFFFF, 0x7FFFFFF); | ||
HVARP(miniconfilter, 0, 0, 0x7FFFFFF); | ||
@@ -140,18 +143,20 @@ | ||
|
||
int renderconsole(int w, int h, int abovehud) // render buffer taking into account time & scrolling | ||
{ | ||
- int conpad = fullconsole ? 0 : FONTH/4, | ||
- conoff = fullconsole ? FONTH : FONTH/3, | ||
- conheight = min(fullconsole ? ((h*fullconsize/100)/FONTH)*FONTH : FONTH*consize, h - 2*(conpad + conoff)), | ||
+ int conpad = FONTH/4, | ||
+ conoff = FONTH/3, | ||
conwidth = w - 2*(conpad + conoff) - (fullconsole ? 0 : game::clipconsole(w, h)); | ||
|
||
- extern void consolebox(int x1, int y1, int x2, int y2); | ||
- if(fullconsole) consolebox(conpad, conpad, conwidth+conpad+2*conoff, conheight+conpad+2*conoff); | ||
+ if(fullconsole) | ||
+ { | ||
+ drawconlines(conskip, 0, conwidth, abovehud, conpad+conoff, fullconfilter); | ||
+ return abovehud; | ||
+ } | ||
|
||
- int y = drawconlines(conskip, fullconsole ? 0 : confade, conwidth, conheight, conpad+conoff, fullconsole ? fullconfilter : confilter); | ||
- if(!fullconsole && (miniconsize && miniconwidth)) | ||
- drawconlines(miniconskip, miniconfade, (miniconwidth*(w - 2*(conpad + conoff)))/100, min(FONTH*miniconsize, abovehud - y), conpad+conoff, miniconfilter, abovehud, -1); | ||
- return fullconsole ? conheight + 2*(conpad + conoff) : y; | ||
+ int conheight = min(FONTH*consize, h - 2*(conpad + conoff)); | ||
+ int y = drawconlines(conskip, confade, conwidth, conheight, conpad+conoff, confilter); | ||
+ if(miniconsize && miniconwidth) drawconlines(miniconskip, miniconfade, (miniconwidth*(w - 2*(conpad + conoff)))/100, min(FONTH*miniconsize, abovehud - y), conpad+conoff, miniconfilter, abovehud, -1); | ||
+ return y; | ||
} | ||
|
||
// keymap is defined externally in keymap.cfg | ||
Index: src/fpsgame/scoreboard.cpp | ||
=================================================================== | ||
--- src/fpsgame/scoreboard.cpp (revision 6479) | ||
+++ src/fpsgame/scoreboard.cpp (working copy) | ||
@@ -461,14 +461,25 @@ | ||
scoreboard.render(); | ||
} | ||
|
||
- VARFN(scoreboard, showscoreboard, 0, 0, 1, scoreboard.show(showscoreboard!=0)); | ||
- | ||
+ int wasfullconsole = 0; | ||
void showscores(bool on) | ||
{ | ||
+ if(on && !wasfullconsole) | ||
+ { | ||
+ wasfullconsole = fullconsole; | ||
+ fullconsole = 0; | ||
+ } | ||
+ if(!on) | ||
+ { | ||
+ if(!fullconsole && wasfullconsole) fullconsole = 1; | ||
+ wasfullconsole = 0; | ||
+ } | ||
+ extern int showscoreboard; | ||
showscoreboard = on ? 1 : 0; | ||
scoreboard.show(on); | ||
} | ||
ICOMMAND(showscores, "D", (int *down), showscores(*down!=0)); | ||
+ VARFN(scoreboard, showscoreboard, 0, 0, 1, showscores(showscoreboard!=0)); | ||
|
||
VARP(hudscore, 0, 0, 1); | ||
FVARP(hudscorescale, 1e-3f, 1.0f, 1e3f); | ||
Index: src/shared/iengine.h | ||
=================================================================== | ||
--- src/shared/iengine.h (revision 6479) | ||
+++ src/shared/iengine.h (working copy) | ||
@@ -199,6 +199,8 @@ | ||
CON_TAG_MASK = (0x7FFF << CON_TAG_SHIFT) | ||
}; | ||
|
||
+extern int fullconsole; | ||
+ | ||
extern void conoutf(const char *s, ...) PRINTFARGS(1, 2); | ||
extern void conoutf(int type, const char *s, ...) PRINTFARGS(2, 3); | ||
extern void conoutf(int type, int tag, const char *s, ...) PRINTFARGS(3, 4); | ||
Index: src/shared/igame.h | ||
=================================================================== | ||
--- src/shared/igame.h (revision 6479) | ||
+++ src/shared/igame.h (working copy) | ||
@@ -80,6 +80,7 @@ | ||
extern void readgamedata(vector<char> &extras); | ||
extern int clipconsole(int w, int h); | ||
extern void g3d_gamemenus(); | ||
+ extern void showscores(bool on); | ||
extern const char *defaultcrosshair(int index); | ||
extern int selectcrosshair(vec &color); | ||
extern void lighteffects(dynent *d, vec &color, vec &dir); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters