2004-08-23 00:15:46 +00:00
|
|
|
/*
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2005-10-28 01:33:19 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
// cl_screen.c -- master for refresh, status bar, console, chat, notify, etc
|
|
|
|
|
|
|
|
#include "quakedef.h"
|
2009-11-04 21:16:50 +00:00
|
|
|
#ifdef GLQUAKE
|
2004-08-23 00:15:46 +00:00
|
|
|
#include "glquake.h"//would prefer not to have this
|
2004-09-20 23:25:38 +00:00
|
|
|
#endif
|
2009-11-04 21:16:50 +00:00
|
|
|
#include "shader.h"
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2009-04-06 00:34:32 +00:00
|
|
|
//name of the current backdrop for the loading screen
|
|
|
|
char levelshotname[MAX_QPATH];
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
|
2007-05-25 22:16:29 +00:00
|
|
|
void RSpeedShow(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
static int samplerspeeds[RSPEED_MAX];
|
|
|
|
static int samplerquant[RQUANT_MAX];
|
|
|
|
char *RSpNames[RSPEED_MAX];
|
|
|
|
char *RQntNames[RQUANT_MAX];
|
|
|
|
char *s;
|
|
|
|
static int framecount;
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (!r_speeds.ival)
|
2007-05-25 22:16:29 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
memset(RSpNames, 0, sizeof(RSpNames));
|
|
|
|
RSpNames[RSPEED_TOTALREFRESH] = "Total refresh";
|
|
|
|
RSpNames[RSPEED_PROTOCOL] = "Protocol";
|
|
|
|
RSpNames[RSPEED_LINKENTITIES] = "Entity setup";
|
|
|
|
RSpNames[RSPEED_WORLDNODE] = "World walking";
|
|
|
|
RSpNames[RSPEED_WORLD] = "World rendering";
|
|
|
|
RSpNames[RSPEED_DYNAMIC] = "Lightmap updates";
|
2009-11-04 21:16:50 +00:00
|
|
|
RSpNames[RSPEED_PARTICLES] = "Particle phys/sort";
|
2007-05-25 22:16:29 +00:00
|
|
|
RSpNames[RSPEED_PARTICLESDRAW] = "Particle drawing";
|
|
|
|
RSpNames[RSPEED_2D] = "2d elements";
|
|
|
|
RSpNames[RSPEED_SERVER] = "Server";
|
|
|
|
|
|
|
|
RSpNames[RSPEED_DRAWENTITIES] = "Entity rendering";
|
|
|
|
|
|
|
|
RSpNames[RSPEED_PALETTEFLASHES] = "Palette flashes";
|
|
|
|
RSpNames[RSPEED_STENCILSHADOWS] = "Stencil Shadows";
|
|
|
|
|
|
|
|
RSpNames[RSPEED_FULLBRIGHTS] = "World fullbrights";
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
RSpNames[RSPEED_FINISH] = "glFinish";
|
2007-05-25 22:16:29 +00:00
|
|
|
|
|
|
|
RQntNames[RQUANT_MSECS] = "Microseconds";
|
|
|
|
RQntNames[RQUANT_EPOLYS] = "Entity Polys";
|
|
|
|
RQntNames[RQUANT_WPOLYS] = "World Polys";
|
2011-02-25 04:22:14 +00:00
|
|
|
RQntNames[RQUANT_DRAWS] = "Draw Calls";
|
|
|
|
RQntNames[RQUANT_2DBATCHES] = "2d Batches";
|
|
|
|
RQntNames[RQUANT_WORLDBATCHES] = "World Batches";
|
|
|
|
RQntNames[RQUANT_ENTBATCHES] = "Ent Batches";
|
2007-05-25 22:16:29 +00:00
|
|
|
RQntNames[RQUANT_SHADOWFACES] = "Shadow Faces";
|
|
|
|
RQntNames[RQUANT_SHADOWEDGES] = "Shadow edges";
|
|
|
|
RQntNames[RQUANT_LITFACES] = "Lit faces";
|
|
|
|
|
2011-02-25 04:22:14 +00:00
|
|
|
if (r_speeds.ival > 1)
|
2007-05-25 22:16:29 +00:00
|
|
|
{
|
2011-02-25 04:22:14 +00:00
|
|
|
for (i = 0; i < RSPEED_MAX; i++)
|
|
|
|
{
|
|
|
|
s = va("%i %-20s", samplerspeeds[i], RSpNames[i]);
|
|
|
|
Draw_FunString(vid.width-strlen(s)*8, i*8, s);
|
|
|
|
}
|
2007-05-25 22:16:29 +00:00
|
|
|
}
|
|
|
|
for (i = 0; i < RQUANT_MAX; i++)
|
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
s = va("%i %-20s", samplerquant[i], RQntNames[i]);
|
|
|
|
Draw_FunString(vid.width-strlen(s)*8, (i+RSPEED_MAX)*8, s);
|
2007-05-25 22:16:29 +00:00
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
s = va("%f %-20s", 100000000.0f/samplerspeeds[RSPEED_TOTALREFRESH], "Framerate");
|
|
|
|
Draw_FunString(vid.width-strlen(s)*8, (i+RSPEED_MAX)*8, s);
|
2007-05-25 22:16:29 +00:00
|
|
|
|
2011-02-25 04:22:14 +00:00
|
|
|
if (++framecount>=100)
|
2007-05-25 22:16:29 +00:00
|
|
|
{
|
|
|
|
for (i = 0; i < RSPEED_MAX; i++)
|
|
|
|
{
|
|
|
|
samplerspeeds[i] = rspeeds[i];
|
|
|
|
rspeeds[i] = 0;
|
|
|
|
}
|
|
|
|
for (i = 0; i < RQUANT_MAX; i++)
|
|
|
|
{
|
|
|
|
samplerquant[i] = rquant[i];
|
|
|
|
rquant[i] = 0;
|
|
|
|
}
|
|
|
|
framecount=0;
|
|
|
|
}
|
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
background clear
|
|
|
|
rendering
|
|
|
|
turtle/net/ram icons
|
|
|
|
sbar
|
|
|
|
centerprint / slow centerprint
|
|
|
|
notify lines
|
|
|
|
intermission / finale overlay
|
|
|
|
loading plaque
|
|
|
|
console
|
|
|
|
menu
|
|
|
|
|
|
|
|
required background clears
|
|
|
|
required update regions
|
|
|
|
|
|
|
|
|
|
|
|
syncronous draw mode or async
|
|
|
|
One off screen buffer, with updates either copied or xblited
|
|
|
|
Need to double buffer?
|
|
|
|
|
|
|
|
|
|
|
|
async draw will require the refresh area to be cleared, because it will be
|
|
|
|
xblited, but sync draw can just ignore it.
|
|
|
|
|
|
|
|
sync
|
|
|
|
draw
|
|
|
|
|
|
|
|
CenterPrint ()
|
|
|
|
SlowPrint ()
|
|
|
|
Screen_Update ();
|
|
|
|
Con_Printf ();
|
|
|
|
|
2005-10-28 01:33:19 +00:00
|
|
|
net
|
2004-08-23 00:15:46 +00:00
|
|
|
turn off messages option
|
|
|
|
|
2005-07-28 15:33:27 +00:00
|
|
|
the refresh is always rendered, unless the console is full screen
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
console is:
|
|
|
|
notify lines
|
|
|
|
half
|
|
|
|
full
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int scr_chatmode;
|
|
|
|
extern cvar_t scr_chatmodecvar;
|
|
|
|
|
|
|
|
|
|
|
|
int mouseusedforgui;
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
float mousecursor_x, mousecursor_y;
|
|
|
|
float mousemove_x, mousemove_y;
|
|
|
|
|
|
|
|
float multicursor_x[8], multicursor_y[8];
|
|
|
|
qboolean multicursor_active[8];
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
float scr_con_current;
|
|
|
|
float scr_conlines; // lines of console to display
|
|
|
|
|
2006-02-25 21:03:56 +00:00
|
|
|
qboolean scr_con_forcedraw;
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
extern cvar_t scr_viewsize;
|
|
|
|
extern cvar_t scr_fov;
|
|
|
|
extern cvar_t scr_conspeed;
|
|
|
|
extern cvar_t scr_centertime;
|
|
|
|
extern cvar_t scr_showturtle;
|
2009-07-18 20:26:24 +00:00
|
|
|
extern cvar_t scr_turtlefps;
|
2004-08-23 00:15:46 +00:00
|
|
|
extern cvar_t scr_showpause;
|
|
|
|
extern cvar_t scr_printspeed;
|
|
|
|
extern cvar_t scr_allowsnap;
|
|
|
|
extern cvar_t scr_sshot_type;
|
2006-06-17 04:18:52 +00:00
|
|
|
extern cvar_t scr_sshot_compression;
|
2004-08-23 00:15:46 +00:00
|
|
|
extern cvar_t crosshair;
|
2005-06-14 04:52:10 +00:00
|
|
|
extern cvar_t scr_consize;
|
2011-10-27 15:46:36 +00:00
|
|
|
cvar_t scr_neticontimeout = CVAR("scr_neticontimeout", "0.3");
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
qboolean scr_initialized; // ready to draw
|
|
|
|
|
2004-12-24 08:45:56 +00:00
|
|
|
mpic_t *scr_net;
|
|
|
|
mpic_t *scr_turtle;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
int clearconsole;
|
|
|
|
int clearnotify;
|
|
|
|
|
2013-03-12 23:09:25 +00:00
|
|
|
extern int sb_lines;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
viddef_t vid; // global video state
|
|
|
|
|
|
|
|
vrect_t scr_vrect;
|
|
|
|
|
|
|
|
qboolean scr_disabled_for_loading;
|
|
|
|
qboolean scr_drawloading;
|
|
|
|
float scr_disabled_time;
|
|
|
|
|
|
|
|
float oldsbar = 0;
|
|
|
|
|
|
|
|
void SCR_ScreenShot_f (void);
|
|
|
|
void SCR_RSShot_f (void);
|
2009-04-19 00:50:42 +00:00
|
|
|
void SCR_CPrint_f(void);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2006-03-06 01:41:09 +00:00
|
|
|
cvar_t show_fps = SCVARF("show_fps", "0", CVAR_ARCHIVE);
|
2006-02-11 02:09:43 +00:00
|
|
|
cvar_t show_fps_x = SCVAR("show_fps_x", "-1");
|
|
|
|
cvar_t show_fps_y = SCVAR("show_fps_y", "-1");
|
|
|
|
cvar_t show_clock = SCVAR("cl_clock", "0");
|
|
|
|
cvar_t show_clock_x = SCVAR("cl_clock_x", "0");
|
|
|
|
cvar_t show_clock_y = SCVAR("cl_clock_y", "-1");
|
2006-03-06 01:41:09 +00:00
|
|
|
cvar_t show_gameclock = SCVAR("cl_gameclock", "0");
|
|
|
|
cvar_t show_gameclock_x = SCVAR("cl_gameclock_x", "0");
|
|
|
|
cvar_t show_gameclock_y = SCVAR("cl_gameclock_y", "-1");
|
2006-02-11 02:09:43 +00:00
|
|
|
cvar_t show_speed = SCVAR("show_speed", "0");
|
|
|
|
cvar_t show_speed_x = SCVAR("show_speed_x", "-1");
|
|
|
|
cvar_t show_speed_y = SCVAR("show_speed_y", "-9");
|
2012-05-09 15:30:53 +00:00
|
|
|
cvar_t scr_loadingrefresh = SCVAR("scr_loadingrefresh", "0");
|
2005-01-23 17:49:42 +00:00
|
|
|
|
|
|
|
extern char cl_screengroup[];
|
|
|
|
void CLSCR_Init(void)
|
|
|
|
{
|
2009-04-19 00:50:42 +00:00
|
|
|
Cmd_AddCommand("cprint", SCR_CPrint_f);
|
|
|
|
|
2012-05-09 15:30:53 +00:00
|
|
|
Cvar_Register(&scr_loadingrefresh, cl_screengroup);
|
2005-01-23 17:49:42 +00:00
|
|
|
Cvar_Register(&show_fps, cl_screengroup);
|
|
|
|
Cvar_Register(&show_fps_x, cl_screengroup);
|
|
|
|
Cvar_Register(&show_fps_y, cl_screengroup);
|
|
|
|
Cvar_Register(&show_clock, cl_screengroup);
|
|
|
|
Cvar_Register(&show_clock_x, cl_screengroup);
|
|
|
|
Cvar_Register(&show_clock_y, cl_screengroup);
|
2006-03-06 01:41:09 +00:00
|
|
|
Cvar_Register(&show_gameclock, cl_screengroup);
|
|
|
|
Cvar_Register(&show_gameclock_x, cl_screengroup);
|
|
|
|
Cvar_Register(&show_gameclock_y, cl_screengroup);
|
2005-01-23 17:49:42 +00:00
|
|
|
Cvar_Register(&show_speed, cl_screengroup);
|
|
|
|
Cvar_Register(&show_speed_x, cl_screengroup);
|
|
|
|
Cvar_Register(&show_speed_y, cl_screengroup);
|
2011-10-27 15:46:36 +00:00
|
|
|
Cvar_Register(&scr_neticontimeout, cl_screengroup);
|
2005-01-23 17:49:42 +00:00
|
|
|
}
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
/*
|
|
|
|
===============================================================================
|
|
|
|
|
|
|
|
CENTER PRINTING
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
*/
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
typedef struct {
|
|
|
|
unsigned int flags;
|
|
|
|
|
|
|
|
conchar_t string[1024];
|
2012-01-17 07:57:46 +00:00
|
|
|
char titleimage[MAX_QPATH];
|
2009-11-04 21:16:50 +00:00
|
|
|
unsigned int charcount;
|
|
|
|
float time_start; // for slow victory printing
|
|
|
|
float time_off;
|
|
|
|
int erase_lines;
|
|
|
|
int erase_center;
|
|
|
|
} cprint_t;
|
|
|
|
|
|
|
|
cprint_t scr_centerprint[MAX_SPLITS];
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2006-03-11 00:35:56 +00:00
|
|
|
// SCR_StringToRGB: takes in "<index>" or "<r> <g> <b>" and converts to an RGB vector
|
|
|
|
void SCR_StringToRGB (char *rgbstring, float *rgb, float rgbinputscale)
|
|
|
|
{
|
|
|
|
char *t;
|
|
|
|
|
|
|
|
rgbinputscale = 1/rgbinputscale;
|
|
|
|
t = strstr(rgbstring, " ");
|
|
|
|
|
|
|
|
if (!t) // use standard coloring
|
|
|
|
{
|
|
|
|
qbyte *pal;
|
|
|
|
int i = atoi(rgbstring);
|
|
|
|
i = bound(0, i, 255);
|
|
|
|
|
2006-04-12 00:17:02 +00:00
|
|
|
pal = host_basepal;
|
|
|
|
|
|
|
|
pal += (i * 3);
|
2006-03-11 00:35:56 +00:00
|
|
|
// convert r8g8b8 to rgb floats
|
|
|
|
rgb[0] = (float)(pal[0]);
|
|
|
|
rgb[1] = (float)(pal[1]);
|
|
|
|
rgb[2] = (float)(pal[2]);
|
|
|
|
|
|
|
|
VectorScale(rgb, 1/255.0, rgb);
|
|
|
|
}
|
|
|
|
else // use RGB coloring
|
|
|
|
{
|
|
|
|
t++;
|
|
|
|
rgb[0] = atof(rgbstring);
|
|
|
|
rgb[1] = atof(t);
|
|
|
|
t = strstr(t, " "); // find last value
|
|
|
|
if (t)
|
|
|
|
rgb[2] = atof(t+1);
|
|
|
|
else
|
|
|
|
rgb[2] = 0.0;
|
|
|
|
VectorScale(rgb, rgbinputscale, rgb);
|
|
|
|
} // i contains the crosshair color
|
|
|
|
}
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
/*
|
|
|
|
==============
|
|
|
|
SCR_CenterPrint
|
|
|
|
|
|
|
|
Called for important messages that should stay in the center of the screen
|
|
|
|
for a few moments
|
|
|
|
==============
|
|
|
|
*/
|
2009-04-19 00:50:42 +00:00
|
|
|
void SCR_CenterPrint (int pnum, char *str, qboolean skipgamecode)
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
cprint_t *p;
|
2009-04-19 00:50:42 +00:00
|
|
|
if (!skipgamecode)
|
2008-11-09 22:29:28 +00:00
|
|
|
{
|
2005-02-12 18:56:04 +00:00
|
|
|
#ifdef CSQC_DAT
|
2008-11-28 20:34:51 +00:00
|
|
|
if (CSQC_CenterPrint(pnum, str)) //csqc nabbed it.
|
2008-11-09 22:29:28 +00:00
|
|
|
return;
|
2005-02-12 18:56:04 +00:00
|
|
|
#endif
|
2008-11-09 22:29:28 +00:00
|
|
|
}
|
2005-02-12 18:56:04 +00:00
|
|
|
|
2005-10-28 01:33:19 +00:00
|
|
|
if (Cmd_AliasExist("f_centerprint", RESTRICT_LOCAL))
|
|
|
|
{
|
|
|
|
cvar_t *var;
|
|
|
|
var = Cvar_FindVar ("scr_centerprinttext");
|
|
|
|
if (!var)
|
|
|
|
Cvar_Get("scr_centerprinttext", "", 0, "Script Notifications");
|
|
|
|
Cvar_Set(var, str);
|
|
|
|
Cbuf_AddText("f_centerprint\n", RESTRICT_LOCAL);
|
|
|
|
}
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
p = &scr_centerprint[pnum];
|
|
|
|
p->flags = 0;
|
2012-01-17 07:57:46 +00:00
|
|
|
p->titleimage[0] = 0;
|
2009-11-04 21:16:50 +00:00
|
|
|
if (cl.intermission)
|
2012-01-17 07:57:46 +00:00
|
|
|
{
|
|
|
|
p->flags |= CPRINT_TYPEWRITER | CPRINT_PERSIST | CPRINT_TALIGN;
|
|
|
|
Q_strncpyz(p->titleimage, "gfx/finale.lmp", sizeof(p->titleimage));
|
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
while (*str == '/')
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
if (str[1] == '.')
|
|
|
|
{
|
|
|
|
/* /. means text actually starts after, no more flags */
|
|
|
|
str+=2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (str[1] == 'P')
|
2012-01-17 07:57:46 +00:00
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
p->flags |= CPRINT_PERSIST | CPRINT_BACKGROUND;
|
2012-01-17 07:57:46 +00:00
|
|
|
p->flags &= ~CPRINT_TALIGN;
|
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
else if (str[1] == 'O')
|
2012-01-17 07:57:46 +00:00
|
|
|
p->flags ^= CPRINT_OBITUARTY;
|
2009-11-04 21:16:50 +00:00
|
|
|
else if (str[1] == 'B')
|
2012-01-17 07:57:46 +00:00
|
|
|
p->flags ^= CPRINT_BALIGN; //Note: you probably want to add some blank lines...
|
2009-11-04 21:16:50 +00:00
|
|
|
else if (str[1] == 'T')
|
2012-01-17 07:57:46 +00:00
|
|
|
p->flags ^= CPRINT_TALIGN;
|
2009-11-04 21:16:50 +00:00
|
|
|
else if (str[1] == 'L')
|
2012-01-17 07:57:46 +00:00
|
|
|
p->flags ^= CPRINT_LALIGN;
|
2009-11-04 21:16:50 +00:00
|
|
|
else if (str[1] == 'R')
|
2012-01-17 07:57:46 +00:00
|
|
|
p->flags ^= CPRINT_RALIGN;
|
|
|
|
else if (str[1] == 'I')
|
|
|
|
{
|
|
|
|
char *e = strchr(str+=2, ':');
|
|
|
|
int l = e - str;
|
|
|
|
if (l >= sizeof(p->titleimage))
|
|
|
|
l = sizeof(p->titleimage)-1;
|
|
|
|
strncpy(p->titleimage, str, l);
|
|
|
|
p->titleimage[l] = 0;
|
|
|
|
str = e+1;
|
|
|
|
continue;
|
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
else
|
|
|
|
break;
|
|
|
|
str += 2;
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
p->charcount = COM_ParseFunString(CON_WHITEMASK, str, p->string, sizeof(p->string), false) - p->string;
|
|
|
|
p->time_off = scr_centertime.value;
|
|
|
|
p->time_start = cl.time;
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
2009-04-19 00:50:42 +00:00
|
|
|
void SCR_CPrint_f(void)
|
|
|
|
{
|
2009-04-19 01:02:56 +00:00
|
|
|
SCR_CenterPrint(0, Cmd_Args(), true);
|
2009-04-19 00:50:42 +00:00
|
|
|
}
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
void SCR_EraseCenterString (void)
|
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
cprint_t *p;
|
2004-08-23 00:15:46 +00:00
|
|
|
int pnum;
|
|
|
|
int y;
|
|
|
|
|
|
|
|
if (cl.splitclients>1)
|
|
|
|
return; //no viewsize with split
|
|
|
|
|
|
|
|
for (pnum = 0; pnum < cl.splitclients; pnum++)
|
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
p = &scr_centerprint[pnum];
|
|
|
|
|
|
|
|
if (p->erase_center++ > vid.numpages)
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
p->erase_lines = 0;
|
2004-08-23 00:15:46 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
y = vid.height>>1;
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_TileClear (0, y, vid.width, min(8*p->erase_lines, vid.height - y - 1));
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
#define MAX_CPRINT_LINES 128
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
void SCR_DrawCenterString (vrect_t *rect, cprint_t *p, struct font_s *font)
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
|
|
|
int l;
|
2009-11-04 21:16:50 +00:00
|
|
|
int y, x;
|
|
|
|
int left;
|
|
|
|
int right;
|
|
|
|
int top;
|
|
|
|
int bottom;
|
2004-08-23 00:15:46 +00:00
|
|
|
int remaining;
|
2012-01-17 07:57:46 +00:00
|
|
|
shader_t *pic;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
conchar_t *line_start[MAX_CPRINT_LINES];
|
|
|
|
conchar_t *line_end[MAX_CPRINT_LINES];
|
|
|
|
int linecount;
|
2004-09-02 00:34:10 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
// the finale prints the characters one at a time
|
2009-11-04 21:16:50 +00:00
|
|
|
if (p->flags & CPRINT_TYPEWRITER)
|
|
|
|
remaining = scr_printspeed.value * (cl.time - p->time_start);
|
2004-08-23 00:15:46 +00:00
|
|
|
else
|
|
|
|
remaining = 9999;
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
p->erase_center = 0;
|
|
|
|
|
2012-01-17 07:57:46 +00:00
|
|
|
if (*p->titleimage)
|
|
|
|
pic = R2D_SafeCachePic (p->titleimage);
|
|
|
|
else
|
|
|
|
pic = NULL;
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (p->flags & CPRINT_BACKGROUND)
|
|
|
|
{ //hexen2 style plaque.
|
2012-01-17 07:57:46 +00:00
|
|
|
if (rect->width > (pic?pic->width:320))
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
{
|
2012-01-17 07:57:46 +00:00
|
|
|
rect->x = (rect->x + rect->width/2) - ((pic?pic->width:320) / 2);
|
|
|
|
rect->width = pic?pic->width:320;
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
}
|
2012-01-17 07:57:46 +00:00
|
|
|
|
2010-08-17 02:44:21 +00:00
|
|
|
if (rect->width < 32)
|
|
|
|
return;
|
|
|
|
rect->x += 16;
|
|
|
|
rect->width -= 32;
|
2012-01-17 07:57:46 +00:00
|
|
|
|
|
|
|
/*keep the text inside the image too*/
|
|
|
|
if (pic)
|
|
|
|
{
|
|
|
|
if (rect->height > (pic->height))
|
|
|
|
{
|
|
|
|
rect->y = (rect->y + rect->height/2) - (pic->height/2);
|
|
|
|
rect->height = pic->height;
|
|
|
|
}
|
|
|
|
rect->y += 16;
|
|
|
|
rect->height -= 32;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
y = rect->y;
|
|
|
|
|
|
|
|
if (pic)
|
|
|
|
{
|
|
|
|
if (!(p->flags & CPRINT_BACKGROUND))
|
|
|
|
{
|
|
|
|
y+= 16;
|
|
|
|
R2D_ScalePic ( (vid.width-pic->width)/2, 16, pic->width, pic->height, pic);
|
|
|
|
y+= pic->height;
|
|
|
|
y+= 8;
|
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
}
|
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
Font_BeginString(font, rect->x, y, &left, &top);
|
|
|
|
Font_BeginString(font, rect->x+rect->width, rect->y+rect->height, &right, &bottom);
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
linecount = Font_LineBreaks(p->string, p->string + p->charcount, right - left, MAX_CPRINT_LINES, line_start, line_end);
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (p->flags & CPRINT_TALIGN)
|
|
|
|
y = top;
|
|
|
|
else if (p->flags & CPRINT_BALIGN)
|
|
|
|
y = bottom - Font_CharHeight()*linecount;
|
|
|
|
else if (p->flags & CPRINT_OBITUARTY)
|
|
|
|
//'obituary' messages appear at the bottom of the screen
|
|
|
|
y = (bottom-top - Font_CharHeight()*linecount) * 0.65 + top;
|
2004-08-23 00:15:46 +00:00
|
|
|
else
|
2004-09-02 00:34:10 +00:00
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
if (linecount <= 4)
|
2010-11-26 06:58:48 +00:00
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
//small messages appear above and away from the crosshair
|
|
|
|
y = (bottom-top - Font_CharHeight()*linecount) * 0.35 + top;
|
2004-11-17 18:00:21 +00:00
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
//longer messages are fully centered
|
|
|
|
y = (bottom-top - Font_CharHeight()*linecount) * 0.5 + top;
|
2004-11-17 18:00:21 +00:00
|
|
|
}
|
2004-09-02 00:34:10 +00:00
|
|
|
}
|
2010-11-26 06:58:48 +00:00
|
|
|
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
if (p->flags & CPRINT_BACKGROUND)
|
|
|
|
{ //hexen2 style plaque.
|
2010-08-17 02:44:21 +00:00
|
|
|
int px, py, pw;
|
|
|
|
px = rect->x;
|
|
|
|
py = ( y * vid.height) / (float)vid.pixelheight;
|
|
|
|
pw = rect->width+8;
|
2012-01-17 07:57:46 +00:00
|
|
|
if (*p->titleimage)
|
2012-01-21 07:53:49 +00:00
|
|
|
R2D_ScalePic (rect->x + ((int)rect->width - pic->width)/2, rect->y + ((int)rect->height - pic->height)/2, pic->width, pic->height, pic);
|
2012-01-17 07:57:46 +00:00
|
|
|
else
|
|
|
|
Draw_TextBox(px-16, py-8-8, pw/8, linecount+2);
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
}
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
for (l = 0; l < linecount; l++, y += Font_CharHeight())
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
if (p->flags & CPRINT_RALIGN)
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
2010-03-14 14:35:56 +00:00
|
|
|
x = right - Font_LineWidth(line_start[l], line_end[l]);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
else if (p->flags & CPRINT_LALIGN)
|
|
|
|
x = left;
|
|
|
|
else
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
2010-03-14 14:35:56 +00:00
|
|
|
x = (right + left - Font_LineWidth(line_start[l], line_end[l]))/2;
|
2009-11-04 21:16:50 +00:00
|
|
|
}
|
|
|
|
|
2010-03-14 14:35:56 +00:00
|
|
|
remaining -= line_end[l]-line_start[l];
|
|
|
|
if (remaining <= 0)
|
2009-11-04 21:16:50 +00:00
|
|
|
{
|
2010-03-14 14:35:56 +00:00
|
|
|
line_end[l] += remaining;
|
|
|
|
if (line_end[l] <= line_start[l])
|
2004-09-02 00:34:10 +00:00
|
|
|
break;
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
2010-03-14 14:35:56 +00:00
|
|
|
Font_LineDraw(x, y, line_start[l], line_end[l]);
|
2009-11-04 21:16:50 +00:00
|
|
|
}
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
Font_EndString(font);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_CheckDrawCenterString (void)
|
|
|
|
{
|
|
|
|
extern qboolean sb_showscores;
|
|
|
|
int pnum;
|
2009-11-04 21:16:50 +00:00
|
|
|
cprint_t *p;
|
|
|
|
vrect_t rect;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
for (pnum = 0; pnum < cl.splitclients; pnum++)
|
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
p = &scr_centerprint[pnum];
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2010-08-28 17:14:38 +00:00
|
|
|
if (p->time_off <= 0 && !cl.intermission && !(p->flags & CPRINT_PERSIST))
|
|
|
|
continue; //'/P' prefix doesn't time out
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
p->time_off -= host_frametime;
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
if (key_dest != key_game) //don't let progs guis/centerprints interfere with the game menu
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (sb_showscores) //this was annoying
|
|
|
|
continue;
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
SCR_VRectForPlayer(&rect, pnum);
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
SCR_DrawCenterString(&rect, p, font_conchar);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-07-11 02:22:39 +00:00
|
|
|
void R_DrawTextField(int x, int y, int w, int h, char *text, unsigned int defaultmask, unsigned int fieldflags)
|
|
|
|
{
|
|
|
|
cprint_t p;
|
|
|
|
vrect_t r;
|
|
|
|
|
|
|
|
r.x = x;
|
|
|
|
r.y = y;
|
|
|
|
r.width = w;
|
|
|
|
r.height = h;
|
|
|
|
|
|
|
|
p.flags = fieldflags;
|
|
|
|
p.charcount = COM_ParseFunString(defaultmask, text, p.string, sizeof(p.string), false) - p.string;
|
|
|
|
p.time_off = scr_centertime.value;
|
|
|
|
p.time_start = cl.time;
|
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
SCR_DrawCenterString(&r, &p, font_conchar);
|
2010-07-11 02:22:39 +00:00
|
|
|
}
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
void SCR_DrawCursor(int prydoncursornum)
|
|
|
|
{
|
|
|
|
extern cvar_t cl_cursor, cl_cursorbias, cl_cursorsize;
|
|
|
|
mpic_t *p;
|
|
|
|
if (!*cl_cursor.string || prydoncursornum>1)
|
2011-03-31 01:14:01 +00:00
|
|
|
p = R2D_SafeCachePic(va("gfx/prydoncursor%03i.lmp", prydoncursornum));
|
2009-11-04 21:16:50 +00:00
|
|
|
else
|
2011-03-31 01:14:01 +00:00
|
|
|
p = R2D_SafeCachePic(cl_cursor.string);
|
2012-01-17 07:57:46 +00:00
|
|
|
if (!p)
|
|
|
|
p = R2D_SafeCachePic("gfx/cursor.lmp");
|
2009-11-04 21:16:50 +00:00
|
|
|
if (p)
|
|
|
|
{
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ImageColours(1, 1, 1, 1);
|
|
|
|
R2D_Image(mousecursor_x-cl_cursorbias.value, mousecursor_y-cl_cursorbias.value, cl_cursorsize.value, cl_cursorsize.value, 0, 0, 1, 1, p);
|
2009-11-04 21:16:50 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
float x, y;
|
|
|
|
Font_BeginScaledString(font_conchar, mousecursor_x, mousecursor_y, 8, 8, &x, &y);
|
2009-11-04 21:16:50 +00:00
|
|
|
x -= Font_CharWidth('+' | 0xe000 | CON_WHITEMASK)/2;
|
|
|
|
y -= Font_CharHeight()/2;
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
Font_DrawScaleChar(x, y, '+' | 0xe000 | CON_WHITEMASK);
|
2009-11-04 21:16:50 +00:00
|
|
|
Font_EndString(font_conchar);
|
|
|
|
}
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
}
|
|
|
|
static void SCR_DrawSimMTouchCursor(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
float x, y;
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
if (multicursor_active[i])
|
|
|
|
{
|
|
|
|
Font_BeginScaledString(font_conchar, multicursor_x[i], multicursor_y[i], 8, 8, &x, &y);
|
|
|
|
x -= Font_CharWidth('+' | 0xe000 | CON_WHITEMASK)/2;
|
|
|
|
y -= Font_CharHeight()/2;
|
|
|
|
Font_DrawScaleChar(x, y, '+' | 0xe000 | CON_WHITEMASK);
|
|
|
|
Font_EndString(font_conchar);
|
|
|
|
}
|
|
|
|
}
|
2009-11-04 21:16:50 +00:00
|
|
|
}
|
2004-09-01 00:01:08 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////
|
|
|
|
//TEI_SHOWLMP2 (not 3)
|
|
|
|
//
|
|
|
|
typedef struct showpic_s {
|
|
|
|
struct showpic_s *next;
|
|
|
|
qbyte zone;
|
|
|
|
short x, y;
|
|
|
|
char *name;
|
|
|
|
char *picname;
|
|
|
|
} showpic_t;
|
|
|
|
showpic_t *showpics;
|
|
|
|
|
|
|
|
static void SP_RecalcXY ( float *xx, float *yy, int origin )
|
|
|
|
{
|
|
|
|
int midx, midy;
|
|
|
|
float x,y;
|
|
|
|
|
|
|
|
x = xx[0];
|
|
|
|
y = yy[0];
|
|
|
|
|
|
|
|
midy = vid.height * 0.5;// >>1
|
|
|
|
midx = vid.width * 0.5;// >>1
|
|
|
|
|
|
|
|
// Tei - new showlmp
|
2005-10-28 01:33:19 +00:00
|
|
|
switch ( origin )
|
2004-09-01 00:01:08 +00:00
|
|
|
{
|
|
|
|
case SL_ORG_NW:
|
|
|
|
break;
|
|
|
|
case SL_ORG_NE:
|
|
|
|
x = vid.width - x;//Inv
|
|
|
|
break;
|
|
|
|
case SL_ORG_SW:
|
|
|
|
y = vid.height - y;//Inv
|
|
|
|
break;
|
|
|
|
case SL_ORG_SE:
|
|
|
|
y = vid.height - y;//inv
|
|
|
|
x = vid.width - x;//Inv
|
|
|
|
break;
|
|
|
|
case SL_ORG_CC:
|
|
|
|
y = midy + (y - 8000);//NegCoded
|
|
|
|
x = midx + (x - 8000);//NegCoded
|
|
|
|
break;
|
|
|
|
case SL_ORG_CN:
|
|
|
|
x = midx + (x - 8000);//NegCoded
|
|
|
|
break;
|
|
|
|
case SL_ORG_CS:
|
|
|
|
x = midx + (x - 8000);//NegCoded
|
|
|
|
y = vid.height - y;//Inverse
|
|
|
|
break;
|
|
|
|
case SL_ORG_CW:
|
|
|
|
y = midy + (y - 8000);//NegCoded
|
|
|
|
break;
|
|
|
|
case SL_ORG_CE:
|
|
|
|
y = midy + (y - 8000);//NegCoded
|
|
|
|
x = vid.height - x; //Inverse
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
xx[0] = x;
|
|
|
|
yy[0] = y;
|
|
|
|
}
|
|
|
|
void SCR_ShowPics_Draw(void)
|
|
|
|
{
|
2004-10-10 06:32:29 +00:00
|
|
|
downloadlist_t *failed;
|
2004-09-01 00:01:08 +00:00
|
|
|
float x, y;
|
|
|
|
showpic_t *sp;
|
2004-12-24 08:45:56 +00:00
|
|
|
mpic_t *p;
|
2004-09-01 00:01:08 +00:00
|
|
|
for (sp = showpics; sp; sp = sp->next)
|
|
|
|
{
|
|
|
|
x = sp->x;
|
|
|
|
y = sp->y;
|
|
|
|
SP_RecalcXY(&x, &y, sp->zone);
|
|
|
|
if (!*sp->picname)
|
|
|
|
continue;
|
2004-10-10 06:32:29 +00:00
|
|
|
|
|
|
|
for (failed = cl.faileddownloads; failed; failed = failed->next)
|
|
|
|
{ //don't try displaying ones that we know to have failed.
|
2009-05-24 10:11:17 +00:00
|
|
|
if (!strcmp(failed->rname, sp->picname))
|
2004-10-10 06:32:29 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (failed)
|
|
|
|
continue;
|
|
|
|
|
2011-03-31 01:14:01 +00:00
|
|
|
p = R2D_SafeCachePic(sp->picname);
|
2004-09-01 00:01:08 +00:00
|
|
|
if (!p)
|
|
|
|
continue;
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ScalePic(x, y, p->width, p->height, p);
|
2004-09-01 00:01:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_ShowPic_Clear(void)
|
|
|
|
{
|
|
|
|
showpic_t *sp;
|
2004-11-17 18:00:21 +00:00
|
|
|
int pnum;
|
|
|
|
|
|
|
|
for (pnum = 0; pnum < MAX_SPLITS; pnum++)
|
2010-08-28 17:14:38 +00:00
|
|
|
{
|
|
|
|
scr_centerprint[pnum].flags = 0;
|
2009-11-04 21:16:50 +00:00
|
|
|
scr_centerprint[pnum].charcount = 0;
|
2010-08-28 17:14:38 +00:00
|
|
|
}
|
2004-11-17 18:00:21 +00:00
|
|
|
|
2004-09-13 04:16:52 +00:00
|
|
|
while((sp = showpics))
|
2004-09-01 00:01:08 +00:00
|
|
|
{
|
|
|
|
showpics = sp->next;
|
|
|
|
|
|
|
|
Z_Free(sp->name);
|
|
|
|
Z_Free(sp->picname);
|
|
|
|
Z_Free(sp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
showpic_t *SCR_ShowPic_Find(char *name)
|
|
|
|
{
|
|
|
|
showpic_t *sp, *last;
|
|
|
|
for (sp = showpics; sp; sp = sp->next)
|
|
|
|
{
|
|
|
|
if (!strcmp(sp->name, name))
|
|
|
|
return sp;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (showpics)
|
|
|
|
{
|
|
|
|
for (last = showpics; last->next; last = last->next)
|
|
|
|
;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
last = NULL;
|
|
|
|
sp = Z_Malloc(sizeof(showpic_t));
|
|
|
|
if (last)
|
|
|
|
{
|
|
|
|
last->next = sp;
|
|
|
|
sp->next = NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sp->next = showpics;
|
|
|
|
showpics = sp;
|
|
|
|
}
|
|
|
|
sp->name = Z_Malloc(strlen(name)+1);
|
|
|
|
strcpy(sp->name, name);
|
|
|
|
sp->picname = Z_Malloc(1);
|
|
|
|
sp->x = 0;
|
|
|
|
sp->y = 0;
|
|
|
|
sp->zone = 0;
|
|
|
|
|
|
|
|
return sp;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_ShowPic_Create(void)
|
|
|
|
{
|
|
|
|
int zone = MSG_ReadByte();
|
|
|
|
showpic_t *sp;
|
|
|
|
char *s;
|
|
|
|
|
|
|
|
sp = SCR_ShowPic_Find(MSG_ReadString());
|
|
|
|
|
|
|
|
s = MSG_ReadString();
|
|
|
|
|
|
|
|
Z_Free(sp->picname);
|
|
|
|
sp->picname = Z_Malloc(strlen(s)+1);
|
|
|
|
strcpy(sp->picname, s);
|
|
|
|
sp->zone = zone;
|
|
|
|
sp->x = MSG_ReadShort();
|
|
|
|
sp->y = MSG_ReadShort();
|
|
|
|
|
2008-11-09 22:29:28 +00:00
|
|
|
CL_CheckOrEnqueDownloadFile(sp->picname, sp->picname, 0);
|
2004-09-01 00:01:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_ShowPic_Hide(void)
|
|
|
|
{
|
|
|
|
showpic_t *sp, *prev;
|
|
|
|
|
|
|
|
sp = SCR_ShowPic_Find(MSG_ReadString());
|
|
|
|
|
|
|
|
if (sp == showpics)
|
|
|
|
showpics = sp->next;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (prev = showpics; prev->next != sp; prev = prev->next)
|
|
|
|
;
|
|
|
|
prev->next = sp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
Z_Free(sp->name);
|
|
|
|
Z_Free(sp->picname);
|
|
|
|
Z_Free(sp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_ShowPic_Move(void)
|
|
|
|
{
|
|
|
|
int zone = MSG_ReadByte();
|
|
|
|
showpic_t *sp;
|
|
|
|
|
|
|
|
sp = SCR_ShowPic_Find(MSG_ReadString());
|
|
|
|
|
|
|
|
sp->zone = zone;
|
|
|
|
sp->x = MSG_ReadShort();
|
|
|
|
sp->y = MSG_ReadShort();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_ShowPic_Update(void)
|
|
|
|
{
|
|
|
|
showpic_t *sp;
|
|
|
|
char *s;
|
|
|
|
|
|
|
|
sp = SCR_ShowPic_Find(MSG_ReadString());
|
|
|
|
|
|
|
|
s = MSG_ReadString();
|
|
|
|
|
|
|
|
Z_Free(sp->picname);
|
|
|
|
sp->picname = Z_Malloc(strlen(s)+1);
|
|
|
|
strcpy(sp->picname, s);
|
|
|
|
|
2008-11-09 22:29:28 +00:00
|
|
|
CL_CheckOrEnqueDownloadFile(sp->picname, sp->picname, 0);
|
2004-09-01 00:01:08 +00:00
|
|
|
}
|
|
|
|
|
2005-01-13 16:29:20 +00:00
|
|
|
void SCR_ShowPic_Script_f(void)
|
|
|
|
{
|
|
|
|
char *imgname;
|
|
|
|
char *name;
|
|
|
|
int x, y;
|
|
|
|
int zone;
|
|
|
|
showpic_t *sp;
|
|
|
|
|
|
|
|
imgname = Cmd_Argv(1);
|
|
|
|
name = Cmd_Argv(2);
|
|
|
|
x = atoi(Cmd_Argv(3));
|
|
|
|
y = atoi(Cmd_Argv(4));
|
|
|
|
zone = atoi(Cmd_Argv(5));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sp = SCR_ShowPic_Find(name);
|
|
|
|
|
|
|
|
Z_Free(sp->picname);
|
|
|
|
sp->picname = Z_Malloc(strlen(imgname)+1);
|
|
|
|
strcpy(sp->picname, imgname);
|
|
|
|
|
|
|
|
sp->zone = zone;
|
|
|
|
sp->x = x;
|
|
|
|
sp->y = y;
|
|
|
|
}
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
/*
|
|
|
|
====================
|
|
|
|
CalcFov
|
|
|
|
====================
|
|
|
|
*/
|
|
|
|
float CalcFov (float fov_x, float width, float height)
|
|
|
|
{
|
|
|
|
float a;
|
|
|
|
float x;
|
|
|
|
|
|
|
|
if (fov_x < 1 || fov_x > 179)
|
|
|
|
Sys_Error ("Bad fov: %f", fov_x);
|
|
|
|
|
2009-03-07 05:05:54 +00:00
|
|
|
x = fov_x/360*M_PI;
|
2009-03-07 05:22:17 +00:00
|
|
|
x = tan(x);
|
|
|
|
x = width/x;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
a = atan (height/x);
|
|
|
|
|
|
|
|
a = a*360/M_PI;
|
|
|
|
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2006-04-15 06:57:13 +00:00
|
|
|
void SCR_Fov_Callback (struct cvar_s *var, char *oldvalue)
|
|
|
|
{
|
|
|
|
if (var->value < 10)
|
|
|
|
{
|
|
|
|
Cvar_ForceSet (var, "10");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (var->value > 170)
|
|
|
|
{
|
|
|
|
Cvar_ForceSet (var, "170");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_Viewsize_Callback (struct cvar_s *var, char *oldvalue)
|
|
|
|
{
|
|
|
|
if (var->value < 30)
|
|
|
|
{
|
|
|
|
Cvar_ForceSet (var, "30");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (var->value > 120)
|
|
|
|
{
|
|
|
|
Cvar_ForceSet (var, "120");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CL_Sbar_Callback(struct cvar_s *var, char *oldvalue)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-06-23 02:17:02 +00:00
|
|
|
void SCR_CrosshairPosition(playerview_t *pview, int *x, int *y)
|
2004-10-10 06:32:29 +00:00
|
|
|
{
|
2005-01-13 16:29:20 +00:00
|
|
|
extern cvar_t cl_crossx, cl_crossy, crosshaircorrect, v_viewheight;
|
2004-10-10 06:32:29 +00:00
|
|
|
|
|
|
|
vrect_t rect;
|
2011-10-27 15:46:36 +00:00
|
|
|
rect = r_refdef.vrect;
|
2004-10-10 06:32:29 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (cl.worldmodel && crosshaircorrect.ival)
|
2004-10-10 06:32:29 +00:00
|
|
|
{
|
2005-01-13 16:29:20 +00:00
|
|
|
float adj;
|
2004-10-10 06:32:29 +00:00
|
|
|
trace_t tr;
|
|
|
|
vec3_t end;
|
|
|
|
vec3_t start;
|
|
|
|
vec3_t right, up, fwds;
|
|
|
|
|
2013-06-23 02:17:02 +00:00
|
|
|
AngleVectors(pview->simangles, fwds, right, up);
|
2004-12-24 08:45:56 +00:00
|
|
|
|
2013-06-23 02:17:02 +00:00
|
|
|
VectorCopy(pview->simorg, start);
|
2004-12-24 08:45:56 +00:00
|
|
|
start[2]+=16;
|
|
|
|
VectorMA(start, 100000, fwds, end);
|
2004-10-10 06:32:29 +00:00
|
|
|
|
|
|
|
memset(&tr, 0, sizeof(tr));
|
|
|
|
tr.fraction = 1;
|
2012-01-17 07:57:46 +00:00
|
|
|
cl.worldmodel->funcs.NativeTrace(cl.worldmodel, 0, 0, NULL, start, end, vec3_origin, vec3_origin, MASK_WORLDSOLID, &tr);
|
2005-01-28 04:20:50 +00:00
|
|
|
start[2]-=16;
|
2004-10-10 06:32:29 +00:00
|
|
|
if (tr.fraction == 1)
|
|
|
|
{
|
2005-10-28 01:33:19 +00:00
|
|
|
*x = rect.x + rect.width/2 + cl_crossx.value;
|
2004-10-10 06:32:29 +00:00
|
|
|
*y = rect.y + rect.height/2 + cl_crossy.value;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-06-23 02:17:02 +00:00
|
|
|
adj=pview->viewheight;
|
2005-01-13 16:29:20 +00:00
|
|
|
if (v_viewheight.value < -7)
|
|
|
|
adj+=-7;
|
|
|
|
else if (v_viewheight.value > 4)
|
|
|
|
adj+=4;
|
|
|
|
else
|
|
|
|
adj+=v_viewheight.value;
|
2005-01-28 04:20:50 +00:00
|
|
|
|
|
|
|
start[2]+=adj;
|
2013-06-23 02:17:02 +00:00
|
|
|
Matrix4x4_CM_Project(tr.endpos, end, pview->simangles, start, r_refdef.fov_x, r_refdef.fov_y);
|
2004-10-10 06:32:29 +00:00
|
|
|
*x = rect.x+rect.width*end[0];
|
2004-12-24 08:45:56 +00:00
|
|
|
*y = rect.y+rect.height*(1-end[1]);
|
2004-10-10 06:32:29 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-10-28 01:33:19 +00:00
|
|
|
*x = rect.x + rect.width/2 + cl_crossx.value;
|
2004-10-10 06:32:29 +00:00
|
|
|
*y = rect.y + rect.height/2 + cl_crossy.value;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
=================
|
|
|
|
SCR_SizeUp_f
|
|
|
|
|
|
|
|
Keybinding command
|
|
|
|
=================
|
|
|
|
*/
|
|
|
|
void SCR_SizeUp_f (void)
|
|
|
|
{
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
if (Cmd_FromGamecode())
|
|
|
|
Cvar_ForceSet(&scr_viewsize,va("%i", scr_viewsize.ival+10));
|
|
|
|
else
|
|
|
|
Cvar_SetValue (&scr_viewsize,scr_viewsize.value+10);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
=================
|
|
|
|
SCR_SizeDown_f
|
|
|
|
|
|
|
|
Keybinding command
|
|
|
|
=================
|
|
|
|
*/
|
|
|
|
void SCR_SizeDown_f (void)
|
|
|
|
{
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
if (Cmd_FromGamecode())
|
|
|
|
Cvar_ForceSet(&scr_viewsize,va("%i", scr_viewsize.ival-10));
|
|
|
|
else
|
|
|
|
Cvar_SetValue (&scr_viewsize,scr_viewsize.value-10);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SCR_Init
|
|
|
|
==================
|
|
|
|
*/
|
|
|
|
void SCR_Init (void)
|
|
|
|
{
|
|
|
|
//
|
|
|
|
// register our commands
|
|
|
|
//
|
2012-05-09 15:30:53 +00:00
|
|
|
Cmd_AddCommand ("screenshot",SCR_ScreenShot_f);
|
|
|
|
Cmd_AddCommand ("sizeup",SCR_SizeUp_f);
|
|
|
|
Cmd_AddCommand ("sizedown",SCR_SizeDown_f);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2011-03-31 01:14:01 +00:00
|
|
|
scr_net = R2D_SafePicFromWad ("net");
|
|
|
|
scr_turtle = R2D_SafePicFromWad ("turtle");
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
scr_initialized = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_DeInit (void)
|
|
|
|
{
|
|
|
|
if (scr_initialized)
|
|
|
|
{
|
|
|
|
scr_initialized = false;
|
|
|
|
|
|
|
|
Cmd_RemoveCommand ("screenshot");
|
|
|
|
Cmd_RemoveCommand ("sizeup");
|
|
|
|
Cmd_RemoveCommand ("sizedown");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
SCR_DrawTurtle
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
void SCR_DrawTurtle (void)
|
|
|
|
{
|
|
|
|
static int count;
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (!scr_showturtle.ival || !scr_turtle)
|
2004-08-23 00:15:46 +00:00
|
|
|
return;
|
|
|
|
|
2009-07-18 20:26:24 +00:00
|
|
|
if (host_frametime <= 1.0/scr_turtlefps.value)
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
|
|
|
count = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
count++;
|
|
|
|
if (count < 3)
|
|
|
|
return;
|
|
|
|
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ScalePic (scr_vrect.x, scr_vrect.y, 64, 64, scr_turtle);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
SCR_DrawNet
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
void SCR_DrawNet (void)
|
|
|
|
{
|
2011-10-27 15:46:36 +00:00
|
|
|
if (realtime - cls.netchan.last_received < scr_neticontimeout.value)
|
2004-08-23 00:15:46 +00:00
|
|
|
return;
|
|
|
|
if (cls.demoplayback || !scr_net)
|
|
|
|
return;
|
|
|
|
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ScalePic (scr_vrect.x+64, scr_vrect.y, 64, 64, scr_net);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
2005-01-23 17:49:42 +00:00
|
|
|
void SCR_StringXY(char *str, float x, float y)
|
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
char *s2;
|
|
|
|
int px, py;
|
|
|
|
|
|
|
|
Font_BeginString(font_conchar, ((x<0)?vid.width:x), ((y<0)?vid.height - sb_lines:y), &px, &py);
|
|
|
|
|
2005-01-23 17:49:42 +00:00
|
|
|
if (x < 0)
|
2009-11-04 21:16:50 +00:00
|
|
|
{
|
|
|
|
for (s2 = str; *s2; s2++)
|
|
|
|
px -= Font_CharWidth(*s2);
|
|
|
|
}
|
|
|
|
|
2005-01-23 17:49:42 +00:00
|
|
|
if (y < 0)
|
2009-11-04 21:16:50 +00:00
|
|
|
py += y*Font_CharHeight();
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
while (*str)
|
|
|
|
px = Font_DrawChar(px, py, CON_WHITEMASK|*str++);
|
|
|
|
Font_EndString(font_conchar);
|
2005-01-23 17:49:42 +00:00
|
|
|
}
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
void SCR_DrawFPS (void)
|
|
|
|
{
|
|
|
|
extern cvar_t show_fps;
|
2010-11-22 02:03:28 +00:00
|
|
|
static double lastupdatetime;
|
|
|
|
static double lastsystemtime;
|
2004-08-23 00:15:46 +00:00
|
|
|
double t;
|
|
|
|
extern int fps_count;
|
|
|
|
static float lastfps;
|
2009-11-04 21:16:50 +00:00
|
|
|
static float deviationtimes[64];
|
|
|
|
static int deviationframe;
|
2005-01-23 17:49:42 +00:00
|
|
|
char str[80];
|
2009-11-04 21:16:50 +00:00
|
|
|
int sfps, frame;
|
2006-05-19 19:54:03 +00:00
|
|
|
qboolean usemsecs = false;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2010-11-22 02:03:28 +00:00
|
|
|
float frametime;
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (!show_fps.ival)
|
2004-08-23 00:15:46 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
t = Sys_DoubleTime();
|
2010-11-22 02:03:28 +00:00
|
|
|
if ((t - lastupdatetime) >= 1.0)
|
2005-01-23 17:49:42 +00:00
|
|
|
{
|
2010-11-22 02:03:28 +00:00
|
|
|
lastfps = fps_count/(t - lastupdatetime);
|
2004-08-23 00:15:46 +00:00
|
|
|
fps_count = 0;
|
2010-11-22 02:03:28 +00:00
|
|
|
lastupdatetime = t;
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
2010-11-22 02:03:28 +00:00
|
|
|
frametime = t - lastsystemtime;
|
|
|
|
lastsystemtime = t;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
sfps = show_fps.ival;
|
2006-05-19 19:54:03 +00:00
|
|
|
if (sfps < 0)
|
2005-02-28 07:16:19 +00:00
|
|
|
{
|
2006-05-19 19:54:03 +00:00
|
|
|
sfps = -sfps;
|
|
|
|
usemsecs = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (sfps)
|
|
|
|
{
|
|
|
|
case 2: // lowest FPS, highest MS encountered
|
2010-11-22 02:03:28 +00:00
|
|
|
if (lastfps > 1/frametime)
|
2005-02-28 07:16:19 +00:00
|
|
|
{
|
2010-11-22 02:03:28 +00:00
|
|
|
lastfps = 1/frametime;
|
2005-02-28 07:16:19 +00:00
|
|
|
fps_count = 0;
|
2010-11-22 02:03:28 +00:00
|
|
|
lastupdatetime = t;
|
2005-02-28 07:16:19 +00:00
|
|
|
}
|
2006-05-19 19:54:03 +00:00
|
|
|
break;
|
|
|
|
case 3: // highest FPS, lowest MS encountered
|
2010-11-22 02:03:28 +00:00
|
|
|
if (lastfps < 1/frametime)
|
2005-04-16 16:21:27 +00:00
|
|
|
{
|
2010-11-22 02:03:28 +00:00
|
|
|
lastfps = 1/frametime;
|
2005-04-16 16:21:27 +00:00
|
|
|
fps_count = 0;
|
2010-11-22 02:03:28 +00:00
|
|
|
lastupdatetime = t;
|
2005-04-16 16:21:27 +00:00
|
|
|
}
|
2006-05-19 19:54:03 +00:00
|
|
|
break;
|
2006-05-19 21:00:55 +00:00
|
|
|
case 4: // immediate FPS/MS
|
2010-11-22 02:03:28 +00:00
|
|
|
lastfps = 1/frametime;
|
|
|
|
lastupdatetime = t;
|
2006-05-19 19:54:03 +00:00
|
|
|
break;
|
2009-04-01 22:03:56 +00:00
|
|
|
case 5:
|
2012-08-04 11:28:39 +00:00
|
|
|
R_FrameTimeGraph((int)(1000.0*2*frametime));
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
break;
|
|
|
|
case 7:
|
2012-08-04 11:28:39 +00:00
|
|
|
R_FrameTimeGraph((int)(1000.0*1*frametime));
|
2009-04-01 22:03:56 +00:00
|
|
|
break;
|
2009-11-04 21:16:50 +00:00
|
|
|
case 6:
|
|
|
|
{
|
|
|
|
float mean, deviation;
|
2010-11-22 02:03:28 +00:00
|
|
|
deviationtimes[deviationframe++&63] = frametime*1000;
|
2009-11-04 21:16:50 +00:00
|
|
|
mean = 0;
|
|
|
|
for (frame = 0; frame < 64; frame++)
|
|
|
|
{
|
|
|
|
mean += deviationtimes[frame];
|
|
|
|
}
|
|
|
|
mean /= 64;
|
|
|
|
deviation = 0;
|
|
|
|
for (frame = 0; frame < 64; frame++)
|
|
|
|
{
|
|
|
|
deviation += (deviationtimes[frame] - mean)*(deviationtimes[frame] - mean);
|
|
|
|
}
|
|
|
|
deviation /= 64;
|
|
|
|
deviation = sqrt(deviation);
|
|
|
|
|
|
|
|
|
|
|
|
SCR_StringXY(va("%f deviation", deviation), show_fps_x.value, show_fps_y.value-8);
|
|
|
|
}
|
|
|
|
break;
|
2011-02-25 04:22:14 +00:00
|
|
|
case 8:
|
|
|
|
if (cls.timedemo)
|
|
|
|
Con_Printf("%f\n", frametime);
|
|
|
|
break;
|
2005-05-08 05:57:15 +00:00
|
|
|
}
|
2005-02-28 07:16:19 +00:00
|
|
|
|
2006-05-19 19:54:03 +00:00
|
|
|
if (usemsecs)
|
|
|
|
sprintf(str, "%4.1f MS", 1000.0/lastfps);
|
|
|
|
else
|
|
|
|
sprintf(str, "%3.1f FPS", lastfps);
|
2005-01-23 17:49:42 +00:00
|
|
|
SCR_StringXY(str, show_fps_x.value, show_fps_y.value);
|
2004-11-17 18:00:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_DrawUPS (void)
|
|
|
|
{
|
2005-01-23 17:49:42 +00:00
|
|
|
extern cvar_t show_speed;
|
2004-11-17 18:00:21 +00:00
|
|
|
static double lastupstime;
|
|
|
|
double t;
|
|
|
|
static float lastups;
|
2005-01-23 17:49:42 +00:00
|
|
|
char str[80];
|
2009-11-04 21:16:50 +00:00
|
|
|
float *vel;
|
|
|
|
int track;
|
2004-11-17 18:00:21 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (!show_speed.ival)
|
2004-11-17 18:00:21 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
t = Sys_DoubleTime();
|
2005-01-29 02:17:25 +00:00
|
|
|
if ((t - lastupstime) >= 1.0/20)
|
2005-01-23 17:49:42 +00:00
|
|
|
{
|
2009-11-04 21:16:50 +00:00
|
|
|
if (cl.spectator)
|
2013-06-23 02:17:02 +00:00
|
|
|
track = Cam_TrackNum(&cl.playerview[0]);
|
2009-11-04 21:16:50 +00:00
|
|
|
else
|
|
|
|
track = -1;
|
|
|
|
if (track != -1)
|
2013-03-12 22:53:23 +00:00
|
|
|
vel = cl.inframes[cl.validsequence&UPDATE_MASK].playerstate[track].velocity;
|
2009-11-04 21:16:50 +00:00
|
|
|
else
|
2012-07-05 19:42:36 +00:00
|
|
|
vel = cl.playerview[0].simvel;
|
2009-11-04 21:16:50 +00:00
|
|
|
lastups = sqrt((vel[0]*vel[0]) + (vel[1]*vel[1]));
|
2004-11-17 18:00:21 +00:00
|
|
|
lastupstime = t;
|
|
|
|
}
|
2004-10-10 06:32:29 +00:00
|
|
|
|
2005-01-23 17:49:42 +00:00
|
|
|
sprintf(str, "%3.1f UPS", lastups);
|
|
|
|
SCR_StringXY(str, show_speed_x.value, show_speed_y.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_DrawClock(void)
|
|
|
|
{
|
|
|
|
struct tm *newtime;
|
|
|
|
time_t long_time;
|
|
|
|
char str[16];
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (!show_clock.ival)
|
2005-01-23 17:49:42 +00:00
|
|
|
return;
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2005-01-23 17:49:42 +00:00
|
|
|
time( &long_time );
|
|
|
|
newtime = localtime( &long_time );
|
|
|
|
strftime( str, sizeof(str)-1, "%H:%M ", newtime);
|
|
|
|
|
|
|
|
SCR_StringXY(str, show_clock_x.value, show_clock_y.value);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
2006-03-06 01:41:09 +00:00
|
|
|
void SCR_DrawGameClock(void)
|
|
|
|
{
|
|
|
|
float showtime;
|
2008-06-01 05:42:23 +00:00
|
|
|
int minutes;
|
2006-03-06 01:41:09 +00:00
|
|
|
int seconds;
|
|
|
|
char str[16];
|
|
|
|
int flags;
|
|
|
|
float timelimit;
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (!show_gameclock.ival)
|
2006-03-06 01:41:09 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
flags = (show_gameclock.value-1);
|
2010-11-26 06:58:48 +00:00
|
|
|
if (flags & 1)
|
2006-03-06 01:41:09 +00:00
|
|
|
timelimit = 60 * atof(Info_ValueForKey(cl.serverinfo, "timelimit"));
|
|
|
|
else
|
|
|
|
timelimit = 0;
|
|
|
|
|
2010-11-21 03:39:12 +00:00
|
|
|
showtime = timelimit - cl.matchgametime;
|
2006-03-06 01:41:09 +00:00
|
|
|
|
|
|
|
if (showtime < 0)
|
|
|
|
{
|
|
|
|
showtime *= -1;
|
2008-06-01 05:42:23 +00:00
|
|
|
minutes = showtime/60;
|
|
|
|
seconds = (int)showtime - (minutes*60);
|
2006-03-06 01:41:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-06-01 05:42:23 +00:00
|
|
|
minutes = showtime/60;
|
|
|
|
seconds = (int)showtime - (minutes*60);
|
2006-03-06 01:41:09 +00:00
|
|
|
}
|
|
|
|
|
2008-06-01 05:42:23 +00:00
|
|
|
sprintf(str, " %02i:%02i", minutes, seconds);
|
2006-03-06 01:41:09 +00:00
|
|
|
|
|
|
|
SCR_StringXY(str, show_gameclock_x.value, show_gameclock_y.value);
|
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
DrawPause
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
void SCR_DrawPause (void)
|
|
|
|
{
|
2004-12-24 08:45:56 +00:00
|
|
|
mpic_t *pic;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (!scr_showpause.ival) // turn off for screenshots
|
2004-08-23 00:15:46 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (!cl.paused)
|
|
|
|
return;
|
|
|
|
|
2010-08-16 02:03:02 +00:00
|
|
|
if (key_dest == key_menu)
|
|
|
|
return;
|
|
|
|
|
2011-03-31 01:14:01 +00:00
|
|
|
pic = R2D_SafeCachePic ("gfx/pause.lmp");
|
2004-08-23 00:15:46 +00:00
|
|
|
if (pic)
|
|
|
|
{
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ScalePic ( (vid.width - pic->width)/2,
|
2009-11-04 21:16:50 +00:00
|
|
|
(vid.height - 48 - pic->height)/2, pic->width, pic->height, pic);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
else
|
2009-11-04 21:16:50 +00:00
|
|
|
Draw_FunString((vid.width-strlen("Paused")*8)/2, (vid.height-8)/2, "Paused");
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
SCR_DrawLoading
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
|
|
|
|
int total_loading_size, current_loading_size, loading_stage;
|
2012-05-09 15:30:53 +00:00
|
|
|
char *loadingfile;
|
2009-04-06 00:34:32 +00:00
|
|
|
int CL_DownloadRate(void);
|
|
|
|
|
|
|
|
int SCR_GetLoadingStage(void)
|
|
|
|
{
|
|
|
|
return loading_stage;
|
|
|
|
}
|
|
|
|
void SCR_SetLoadingStage(int stage)
|
|
|
|
{
|
2012-05-09 15:30:53 +00:00
|
|
|
switch(stage)
|
|
|
|
{
|
|
|
|
case LS_NONE:
|
|
|
|
if (loadingfile)
|
|
|
|
Z_Free(loadingfile);
|
|
|
|
loadingfile = NULL;
|
|
|
|
break;
|
|
|
|
case LS_CONNECTION:
|
2013-03-12 22:35:33 +00:00
|
|
|
SCR_SetLoadingFile("waiting for connection...");
|
2012-05-09 15:30:53 +00:00
|
|
|
break;
|
|
|
|
case LS_SERVER:
|
|
|
|
if (scr_con_current > vid.height*scr_consize.value)
|
|
|
|
scr_con_current = vid.height*scr_consize.value;
|
2013-03-12 22:35:33 +00:00
|
|
|
SCR_SetLoadingFile("starting server...");
|
2012-05-09 15:30:53 +00:00
|
|
|
break;
|
|
|
|
case LS_CLIENT:
|
|
|
|
SCR_SetLoadingFile("initial state");
|
|
|
|
break;
|
|
|
|
}
|
2009-04-06 00:34:32 +00:00
|
|
|
loading_stage = stage;
|
|
|
|
}
|
2012-05-09 15:30:53 +00:00
|
|
|
void SCR_SetLoadingFile(char *str)
|
|
|
|
{
|
|
|
|
if (loadingfile)
|
|
|
|
Z_Free(loadingfile);
|
|
|
|
loadingfile = Z_Malloc(strlen(str)+1);
|
|
|
|
strcpy(loadingfile, str);
|
|
|
|
|
|
|
|
if (scr_loadingrefresh.ival)
|
|
|
|
{
|
|
|
|
SCR_UpdateScreen();
|
|
|
|
}
|
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
void SCR_DrawLoading (void)
|
|
|
|
{
|
2009-04-06 00:34:32 +00:00
|
|
|
int sizex, x, y;
|
2004-12-24 08:45:56 +00:00
|
|
|
mpic_t *pic;
|
2009-04-06 00:34:32 +00:00
|
|
|
char *s;
|
|
|
|
int qdepth;
|
|
|
|
int h2depth;
|
2011-05-15 13:23:13 +00:00
|
|
|
//int mtype = M_GameType(); //unused variable
|
2009-04-06 00:34:32 +00:00
|
|
|
y = vid.height/2;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2012-02-27 12:23:15 +00:00
|
|
|
if (*levelshotname)
|
|
|
|
{
|
|
|
|
pic = R2D_SafeCachePic (levelshotname);
|
|
|
|
R2D_ImageColours(1, 1, 1, 1);
|
|
|
|
R2D_ScalePic (0, 0, vid.width, vid.height, pic);
|
|
|
|
}
|
|
|
|
|
2009-04-06 00:34:32 +00:00
|
|
|
qdepth = COM_FDepthFile("gfx/loading.lmp", true);
|
|
|
|
h2depth = COM_FDepthFile("gfx/menu/loading.lmp", true);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2009-04-06 00:34:32 +00:00
|
|
|
if (qdepth < h2depth || h2depth > 0xffffff)
|
2006-09-17 00:59:22 +00:00
|
|
|
{ //quake files
|
2006-05-07 07:17:34 +00:00
|
|
|
|
2011-03-31 01:14:01 +00:00
|
|
|
pic = R2D_SafeCachePic ("gfx/loading.lmp");
|
2004-08-23 00:15:46 +00:00
|
|
|
if (pic)
|
2006-05-07 07:17:34 +00:00
|
|
|
{
|
|
|
|
x = (vid.width - pic->width)/2;
|
|
|
|
y = (vid.height - 48 - pic->height)/2;
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ScalePic (x, y, pic->width, pic->height, pic);
|
2006-05-07 07:25:18 +00:00
|
|
|
x = (vid.width/2) - 96;
|
2006-05-07 07:17:34 +00:00
|
|
|
y += pic->height + 8;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-05-07 07:25:18 +00:00
|
|
|
x = (vid.width/2) - 96;
|
2006-05-07 07:17:34 +00:00
|
|
|
y = (vid.height/2) - 8;
|
2009-04-06 00:34:32 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
Draw_FunString((vid.width-7*8)/2, y-16, "Loading");
|
2006-05-07 07:17:34 +00:00
|
|
|
}
|
|
|
|
|
2009-04-09 07:19:59 +00:00
|
|
|
if (!total_loading_size)
|
|
|
|
total_loading_size = 1;
|
2009-04-06 00:34:32 +00:00
|
|
|
if (loading_stage > LS_CONNECTION)
|
2006-05-07 07:17:34 +00:00
|
|
|
{
|
2006-05-07 07:25:18 +00:00
|
|
|
sizex = current_loading_size * 192 / total_loading_size;
|
2009-04-06 00:34:32 +00:00
|
|
|
if (loading_stage == LS_SERVER)
|
2006-05-07 07:17:34 +00:00
|
|
|
{
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ImageColours(1.0, 0.0, 0.0, 1.0);
|
|
|
|
R2D_FillBlock(x, y, sizex, 16);
|
|
|
|
R2D_ImageColours(0.0, 0.0, 0.0, 1.0);
|
|
|
|
R2D_FillBlock(x+sizex, y, 192-sizex, 16);
|
2006-05-07 07:17:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ImageColours(1.0, 1.0, 0.0, 1.0);
|
|
|
|
R2D_FillBlock(x, y, sizex, 16);
|
|
|
|
R2D_ImageColours(1.0, 0.0, 0.0, 1.0);
|
|
|
|
R2D_FillBlock(x+sizex, y, 192-sizex, 16);
|
2006-05-07 07:17:34 +00:00
|
|
|
}
|
|
|
|
|
2010-11-26 06:58:48 +00:00
|
|
|
Draw_FunString(x+8, y+4, va("Loading %s... %i%%",
|
2009-04-06 00:34:32 +00:00
|
|
|
(loading_stage == LS_SERVER) ? "server" : "client",
|
2006-05-07 07:17:34 +00:00
|
|
|
current_loading_size * 100 / total_loading_size));
|
|
|
|
}
|
2012-05-09 15:30:53 +00:00
|
|
|
y += 16;
|
|
|
|
|
|
|
|
if (loadingfile)
|
2013-03-12 22:35:33 +00:00
|
|
|
{
|
2012-05-09 15:30:53 +00:00
|
|
|
Draw_FunString(x+8, y+4, loadingfile);
|
2013-03-12 22:35:33 +00:00
|
|
|
y+=8;
|
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
else
|
2006-09-17 00:59:22 +00:00
|
|
|
{ //hexen2 files
|
2011-03-31 01:14:01 +00:00
|
|
|
pic = R2D_SafeCachePic ("gfx/menu/loading.lmp");
|
2004-08-23 00:15:46 +00:00
|
|
|
if (pic)
|
|
|
|
{
|
|
|
|
int size, count, offset;
|
|
|
|
|
|
|
|
if (!scr_drawloading && loading_stage == 0)
|
|
|
|
return;
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
offset = (vid.width - pic->width)/2;
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ScalePic (offset, 0, pic->width, pic->height, pic);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2009-04-06 00:34:32 +00:00
|
|
|
if (loading_stage == LS_NONE)
|
2004-08-23 00:15:46 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (total_loading_size)
|
|
|
|
size = current_loading_size * 106 / total_loading_size;
|
|
|
|
else
|
|
|
|
size = 0;
|
|
|
|
|
2009-04-06 00:34:32 +00:00
|
|
|
if (loading_stage == LS_CLIENT)
|
2004-08-23 00:15:46 +00:00
|
|
|
count = size;
|
|
|
|
else
|
|
|
|
count = 106;
|
|
|
|
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ImagePaletteColour (136, 1.0);
|
|
|
|
R2D_FillBlock (offset+42, 87, count, 1);
|
|
|
|
R2D_FillBlock (offset+42, 87+5, count, 1);
|
|
|
|
R2D_ImagePaletteColour (138, 1.0);
|
|
|
|
R2D_FillBlock (offset+42, 87+1, count, 4);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2009-04-06 00:34:32 +00:00
|
|
|
if (loading_stage == LS_SERVER)
|
2004-08-23 00:15:46 +00:00
|
|
|
count = size;
|
|
|
|
else
|
|
|
|
count = 0;
|
|
|
|
|
2011-03-31 01:14:01 +00:00
|
|
|
R2D_ImagePaletteColour(168, 1.0);
|
|
|
|
R2D_FillBlock (offset+42, 97, count, 1);
|
|
|
|
R2D_FillBlock (offset+42, 97+5, count, 1);
|
|
|
|
R2D_ImagePaletteColour(170, 1.0);
|
|
|
|
R2D_FillBlock (offset+42, 97+1, count, 4);
|
2009-04-06 00:34:32 +00:00
|
|
|
|
|
|
|
y = 104;
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
}
|
2012-02-27 12:23:15 +00:00
|
|
|
R2D_ImageColours(1, 1, 1, 1);
|
2006-09-17 00:59:22 +00:00
|
|
|
|
2009-04-06 00:34:32 +00:00
|
|
|
if (cl.downloadlist || cls.downloadmethod)
|
|
|
|
{
|
|
|
|
unsigned int fcount;
|
|
|
|
unsigned int tsize;
|
|
|
|
qboolean sizeextra;
|
2010-11-26 06:58:48 +00:00
|
|
|
|
2010-07-11 02:22:39 +00:00
|
|
|
x = vid.width/2 - 160;
|
2009-04-06 00:34:32 +00:00
|
|
|
|
|
|
|
CL_GetDownloadSizes(&fcount, &tsize, &sizeextra);
|
|
|
|
//downloading files?
|
|
|
|
if (cls.downloadmethod)
|
2010-11-26 06:58:48 +00:00
|
|
|
Draw_FunString(x+8, y+4, va("Downloading %s... %i%%",
|
2009-05-24 10:11:17 +00:00
|
|
|
cls.downloadlocalname,
|
2013-03-12 22:47:42 +00:00
|
|
|
(int)cls.downloadpercent));
|
2009-04-06 00:34:32 +00:00
|
|
|
|
|
|
|
if (tsize > 1024*1024*16)
|
|
|
|
{
|
2010-11-26 06:58:48 +00:00
|
|
|
Draw_FunString(x+8, y+8+4, va("%5ukbps %8umb%s remaining (%i files)",
|
2009-04-06 00:34:32 +00:00
|
|
|
(unsigned int)(CL_DownloadRate()/1000.0f),
|
|
|
|
tsize/(1024*1024),
|
|
|
|
sizeextra?"+":"",
|
|
|
|
fcount));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-26 06:58:48 +00:00
|
|
|
Draw_FunString(x+8, y+8+4, va("%5ukbps %8ukb%s remaining (%i files)",
|
2009-04-06 00:34:32 +00:00
|
|
|
(unsigned int)(CL_DownloadRate()/1000.0f),
|
|
|
|
tsize/1024,
|
|
|
|
sizeextra?"+":"",
|
|
|
|
fcount));
|
|
|
|
}
|
|
|
|
|
|
|
|
y+= 16+8;
|
|
|
|
}
|
|
|
|
else if (CL_TryingToConnect())
|
|
|
|
{
|
|
|
|
char dots[4];
|
|
|
|
|
|
|
|
s = CL_TryingToConnect();
|
|
|
|
x = (vid.width - (strlen(s)+15)*8) / 2;
|
|
|
|
dots[0] = '.';
|
|
|
|
dots[1] = '.';
|
|
|
|
dots[2] = '.';
|
|
|
|
dots[(int)realtime & 3] = 0;
|
2010-11-26 06:58:48 +00:00
|
|
|
Draw_FunString(x, y+4, va("Connecting to: %s%s", s, dots));
|
2009-04-06 00:34:32 +00:00
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_BeginLoadingPlaque (void)
|
|
|
|
{
|
2005-09-08 22:52:46 +00:00
|
|
|
if (cls.state != ca_active && cls.protocol != CP_QUAKE3)
|
2004-08-23 00:15:46 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (!scr_initialized)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// if (key_dest == key_console) //not really appropriate if client is to show it on a remote server.
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// redraw with no console and the loading plaque
|
|
|
|
Sbar_Changed ();
|
|
|
|
scr_drawloading = true;
|
|
|
|
SCR_UpdateScreen ();
|
|
|
|
scr_drawloading = false;
|
|
|
|
|
|
|
|
scr_disabled_for_loading = true;
|
|
|
|
scr_disabled_time = Sys_DoubleTime(); //realtime tends to change... Hmmm....
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_EndLoadingPlaque (void)
|
|
|
|
{
|
2005-02-12 18:56:04 +00:00
|
|
|
// if (!scr_initialized)
|
|
|
|
// return;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
scr_disabled_for_loading = false;
|
|
|
|
*levelshotname = '\0';
|
2013-03-12 22:35:33 +00:00
|
|
|
SCR_SetLoadingStage(0);
|
2009-11-04 21:16:50 +00:00
|
|
|
scr_drawloading = false;
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_ImageName (char *mapname)
|
|
|
|
{
|
|
|
|
strcpy(levelshotname, "levelshots/");
|
2006-03-11 03:12:10 +00:00
|
|
|
COM_FileBase(mapname, levelshotname + strlen(levelshotname), sizeof(levelshotname)-strlen(levelshotname));
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
#ifdef GLQUAKE
|
2004-08-23 00:15:46 +00:00
|
|
|
if (qrenderer == QR_OPENGL)
|
|
|
|
{
|
2011-03-31 01:14:01 +00:00
|
|
|
if (!R2D_SafeCachePic (levelshotname))
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
|
|
|
*levelshotname = '\0';
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*levelshotname = '\0';
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
scr_disabled_for_loading = false;
|
|
|
|
scr_drawloading = true;
|
2009-11-04 21:16:50 +00:00
|
|
|
GL_BeginRendering ();
|
2004-08-23 00:15:46 +00:00
|
|
|
SCR_DrawLoading();
|
|
|
|
SCR_SetUpToDrawConsole();
|
2012-02-27 12:23:15 +00:00
|
|
|
if (key_dest == key_console || !*levelshotname)
|
|
|
|
SCR_DrawConsole(!!*levelshotname);
|
2004-08-23 00:15:46 +00:00
|
|
|
GL_EndRendering();
|
|
|
|
scr_drawloading = false;
|
|
|
|
|
2006-09-17 00:59:22 +00:00
|
|
|
scr_disabled_time = Sys_DoubleTime(); //realtime tends to change... Hmmm....
|
2004-08-23 00:15:46 +00:00
|
|
|
scr_disabled_for_loading = true;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SCR_SetUpToDrawConsole
|
|
|
|
==================
|
|
|
|
*/
|
|
|
|
void SCR_SetUpToDrawConsole (void)
|
|
|
|
{
|
|
|
|
#ifdef TEXTEDITOR
|
2011-05-15 13:23:13 +00:00
|
|
|
//extern qboolean editoractive; //unused variable
|
2004-08-23 00:15:46 +00:00
|
|
|
#endif
|
|
|
|
if (scr_drawloading)
|
|
|
|
return; // never a console with loading plaque
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
// decide on the height of the console
|
2006-09-17 00:59:22 +00:00
|
|
|
if (!scr_disabled_for_loading)
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
|
|
|
float fullscreenpercent = 1;
|
|
|
|
#ifdef ANDROID
|
|
|
|
//android has an onscreen imm that we don't want to obscure
|
|
|
|
fullscreenpercent = scr_consize.value;
|
|
|
|
#endif
|
|
|
|
if ((key_dest == key_console || key_dest == key_game) && (!cl.sendprespawn && cl.worldmodel && cl.worldmodel->needload))
|
|
|
|
{
|
|
|
|
key_dest = key_console;
|
|
|
|
scr_conlines = scr_con_current = vid.height * fullscreenpercent;
|
|
|
|
}
|
2013-03-12 22:53:23 +00:00
|
|
|
else if ((key_dest == key_console || key_dest == key_game) && SCR_GetLoadingStage() == LS_NONE && cls.state < ca_active && !Media_PlayingFullScreen() && !CSQC_UnconnectedOkay(false))
|
2012-07-20 01:46:05 +00:00
|
|
|
{
|
2013-06-23 02:17:02 +00:00
|
|
|
#ifdef VM_UI
|
|
|
|
if (key_dest == key_game && (UI_MenuState() || UI_OpenMenu()))
|
|
|
|
;
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
if (cls.state < ca_demostart)
|
2012-07-20 01:46:05 +00:00
|
|
|
key_dest = key_console;
|
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
|
|
|
scr_con_current = scr_conlines = vid.height * fullscreenpercent;
|
2012-07-20 01:46:05 +00:00
|
|
|
}
|
2006-09-17 00:59:22 +00:00
|
|
|
else if (key_dest == key_console || scr_chatmode)
|
|
|
|
{
|
|
|
|
scr_conlines = vid.height*scr_consize.value; // half screen
|
|
|
|
if (scr_conlines < 32)
|
|
|
|
scr_conlines = 32; //prevent total loss of console.
|
|
|
|
else if (scr_conlines>vid.height)
|
|
|
|
scr_conlines = vid.height;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
scr_conlines = 0; // none visible
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
if (scr_conlines < scr_con_current)
|
2006-09-17 00:59:22 +00:00
|
|
|
{
|
2009-04-06 00:34:32 +00:00
|
|
|
scr_con_current -= scr_conspeed.value*host_frametime * (vid.height/320.0f);
|
2006-09-17 00:59:22 +00:00
|
|
|
if (scr_conlines > scr_con_current)
|
|
|
|
scr_con_current = scr_conlines;
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (scr_conlines > scr_con_current)
|
|
|
|
{
|
2009-04-06 00:34:32 +00:00
|
|
|
scr_con_current += scr_conspeed.value*host_frametime * (vid.height/320.0f);
|
2006-09-17 00:59:22 +00:00
|
|
|
if (scr_conlines < scr_con_current)
|
|
|
|
scr_con_current = scr_conlines;
|
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (scr_con_current>vid.height)
|
|
|
|
scr_con_current = vid.height;
|
|
|
|
|
|
|
|
if (clearconsole++ < vid.numpages)
|
|
|
|
{
|
|
|
|
Sbar_Changed ();
|
|
|
|
}
|
|
|
|
else if (clearnotify++ < vid.numpages)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SCR_DrawConsole
|
|
|
|
==================
|
|
|
|
*/
|
|
|
|
void SCR_DrawConsole (qboolean noback)
|
|
|
|
{
|
|
|
|
if (scr_con_current)
|
|
|
|
{
|
|
|
|
Con_DrawConsole (scr_con_current, noback);
|
|
|
|
clearconsole = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (key_dest == key_game || key_dest == key_message)
|
|
|
|
Con_DrawNotify (); // only draw notify in game
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-10-28 01:33:19 +00:00
|
|
|
/*
|
|
|
|
==============================================================================
|
|
|
|
|
|
|
|
SCREEN SHOTS
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
*/
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
typedef struct _TargaHeader {
|
|
|
|
unsigned char id_length, colormap_type, image_type;
|
|
|
|
unsigned short colormap_index, colormap_length;
|
|
|
|
unsigned char colormap_size;
|
|
|
|
unsigned short x_origin, y_origin, width, height;
|
|
|
|
unsigned char pixel_size, attributes;
|
|
|
|
} TargaHeader;
|
|
|
|
|
|
|
|
|
2010-11-26 06:58:48 +00:00
|
|
|
#if defined(AVAIL_JPEGLIB) && !defined(NO_JPEG)
|
|
|
|
void screenshotJPEG(char *filename, int compression, qbyte *screendata, int screenwidth, int screenheight);
|
2004-08-23 00:15:46 +00:00
|
|
|
#endif
|
|
|
|
#ifdef AVAIL_PNGLIB
|
|
|
|
int Image_WritePNG (char *filename, int compression, qbyte *pixels, int width, int height);
|
|
|
|
#endif
|
|
|
|
void WriteBMPFile(char *filename, qbyte *in, int width, int height);
|
|
|
|
|
|
|
|
/*
|
|
|
|
Find closest color in the palette for named color
|
|
|
|
*/
|
|
|
|
int MipColor(int r, int g, int b)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
float dist;
|
|
|
|
int best=15;
|
|
|
|
float bestdist;
|
|
|
|
int r1, g1, b1;
|
|
|
|
static int lr = -1, lg = -1, lb = -1;
|
|
|
|
static int lastbest;
|
|
|
|
|
|
|
|
if (r == lr && g == lg && b == lb)
|
|
|
|
return lastbest;
|
|
|
|
|
|
|
|
bestdist = 256*256*3;
|
|
|
|
|
|
|
|
for (i = 0; i < 256; i++) {
|
|
|
|
r1 = host_basepal[i*3] - r;
|
|
|
|
g1 = host_basepal[i*3+1] - g;
|
|
|
|
b1 = host_basepal[i*3+2] - b;
|
|
|
|
dist = r1*r1 + g1*g1 + b1*b1;
|
|
|
|
if (dist < bestdist) {
|
|
|
|
bestdist = dist;
|
|
|
|
best = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lr = r; lg = g; lb = b;
|
|
|
|
lastbest = best;
|
|
|
|
return best;
|
|
|
|
}
|
|
|
|
|
2012-11-27 03:23:19 +00:00
|
|
|
qboolean SCR_ScreenShot (char *filename, void *rgb_buffer, int width, int height)
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
|
|
|
int i, c, temp;
|
2007-08-07 17:49:35 +00:00
|
|
|
#if defined(AVAIL_PNGLIB) || defined(AVAIL_JPEGLIB)
|
2006-06-17 04:18:52 +00:00
|
|
|
extern cvar_t scr_sshot_compression;
|
2007-08-07 17:49:35 +00:00
|
|
|
#endif
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
char *ext;
|
|
|
|
|
2004-10-13 07:24:59 +00:00
|
|
|
ext = COM_FileExtension(filename);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2012-11-27 03:23:19 +00:00
|
|
|
if (!rgb_buffer)
|
2007-05-25 22:16:29 +00:00
|
|
|
return false;
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
#ifdef AVAIL_PNGLIB
|
|
|
|
if (!strcmp(ext, "png"))
|
|
|
|
{
|
2012-11-27 03:23:19 +00:00
|
|
|
Image_WritePNG(filename, scr_sshot_compression.value, rgb_buffer, width, height);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
#ifdef AVAIL_JPEGLIB
|
|
|
|
if (!strcmp(ext, "jpeg") || !strcmp(ext, "jpg"))
|
|
|
|
{
|
2012-11-27 03:23:19 +00:00
|
|
|
screenshotJPEG(filename, scr_sshot_compression.value, rgb_buffer, width, height);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
2005-10-28 01:33:19 +00:00
|
|
|
else
|
2004-08-23 00:15:46 +00:00
|
|
|
#endif
|
|
|
|
/* if (!strcmp(ext, "bmp"))
|
|
|
|
{
|
2012-11-27 03:23:19 +00:00
|
|
|
WriteBMPFile(pcxname, rgb_buffer, width, height);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
else*/
|
|
|
|
if (!strcmp(ext, "pcx"))
|
|
|
|
{
|
|
|
|
int y, x;
|
|
|
|
qbyte *src, *dest;
|
2012-11-27 03:23:19 +00:00
|
|
|
qbyte *newbuf = rgb_buffer;
|
|
|
|
// convert in-place to eight bit
|
|
|
|
for (y = 0; y < height; y++)
|
|
|
|
{
|
|
|
|
src = newbuf + (width * 3 * y);
|
|
|
|
dest = newbuf + (width * y);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2012-11-27 03:23:19 +00:00
|
|
|
for (x = 0; x < width; x++) {
|
2004-08-23 00:15:46 +00:00
|
|
|
*dest++ = MipColor(src[0], src[1], src[2]);
|
|
|
|
src += 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-27 03:23:19 +00:00
|
|
|
WritePCXfile (filename, newbuf, width, height, width, host_basepal, false);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
else //tga
|
|
|
|
{
|
2012-11-27 03:23:19 +00:00
|
|
|
vfsfile_t *vfs;
|
|
|
|
FS_CreatePath(filename, FS_GAMEONLY);
|
|
|
|
vfs = FS_OpenVFS(filename, "wb", FS_GAMEONLY);
|
|
|
|
if (vfs)
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
2012-11-27 03:23:19 +00:00
|
|
|
unsigned char header[18];
|
|
|
|
memset (header, 0, 18);
|
|
|
|
header[2] = 2; // uncompressed type
|
|
|
|
header[12] = width&255;
|
|
|
|
header[13] = width>>8;
|
|
|
|
header[14] = height&255;
|
|
|
|
header[15] = height>>8;
|
|
|
|
header[16] = 24; // pixel size
|
|
|
|
VFS_WRITE(vfs, header, sizeof(header));
|
|
|
|
|
|
|
|
// swap rgb to bgr
|
|
|
|
c = width*height*3;
|
|
|
|
for (i=0 ; i<c ; i+=3)
|
|
|
|
{
|
|
|
|
temp = ((qbyte*)rgb_buffer)[i];
|
|
|
|
((qbyte*)rgb_buffer)[i] = ((qbyte*)rgb_buffer)[i+2];
|
|
|
|
((qbyte*)rgb_buffer)[i+2] = temp;
|
|
|
|
}
|
|
|
|
VFS_WRITE(vfs, rgb_buffer, c);
|
|
|
|
VFS_CLOSE(vfs);
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
}
|
2007-05-25 22:16:29 +00:00
|
|
|
return true;
|
2004-10-13 07:24:59 +00:00
|
|
|
}
|
|
|
|
|
2005-10-28 01:33:19 +00:00
|
|
|
/*
|
|
|
|
==================
|
2004-10-13 07:24:59 +00:00
|
|
|
SCR_ScreenShot_f
|
2005-10-28 01:33:19 +00:00
|
|
|
==================
|
|
|
|
*/
|
|
|
|
void SCR_ScreenShot_f (void)
|
2004-10-13 07:24:59 +00:00
|
|
|
{
|
2011-04-25 13:48:30 +00:00
|
|
|
char sysname[1024];
|
2005-10-28 01:33:19 +00:00
|
|
|
char pcxname[80];
|
2004-10-13 07:24:59 +00:00
|
|
|
int i;
|
2005-12-21 03:07:33 +00:00
|
|
|
vfsfile_t *vfs;
|
2012-11-27 03:23:19 +00:00
|
|
|
void *rgbbuffer;
|
|
|
|
int width, height;
|
2004-10-13 07:24:59 +00:00
|
|
|
|
|
|
|
if (!VID_GetRGBInfo)
|
|
|
|
{
|
|
|
|
Con_Printf("Screenshots are not supported with the current renderer\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Cmd_Argc() == 2)
|
|
|
|
{
|
|
|
|
Q_strncpyz(pcxname, Cmd_Argv(1), sizeof(pcxname));
|
2004-11-29 01:21:00 +00:00
|
|
|
if (strstr (pcxname, "..") || strchr(pcxname, ':') || *pcxname == '.' || *pcxname == '/')
|
|
|
|
{
|
|
|
|
Con_Printf("Screenshot name refused\n");
|
|
|
|
return;
|
|
|
|
}
|
2006-03-11 03:12:10 +00:00
|
|
|
COM_DefaultExtension (pcxname, scr_sshot_type.string, sizeof(pcxname));
|
2004-10-13 07:24:59 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-10-28 01:33:19 +00:00
|
|
|
//
|
|
|
|
// find a file name to save it to
|
|
|
|
//
|
2011-07-22 15:11:35 +00:00
|
|
|
Q_snprintfz(pcxname, sizeof(pcxname), "screenshots/fte00000.%s", scr_sshot_type.string);
|
2005-10-28 01:33:19 +00:00
|
|
|
|
|
|
|
for (i=0 ; i<=100000 ; i++)
|
2004-10-13 07:24:59 +00:00
|
|
|
{
|
2004-11-29 01:21:00 +00:00
|
|
|
pcxname[16] = (i%10000)/1000 + '0';
|
|
|
|
pcxname[17] = (i%1000)/100 + '0';
|
|
|
|
pcxname[18] = (i%100)/10 + '0';
|
|
|
|
pcxname[19] = (i%10) + '0';
|
2009-04-01 22:03:56 +00:00
|
|
|
|
2006-01-02 23:01:54 +00:00
|
|
|
if (!(vfs = FS_OpenVFS(pcxname, "rb", FS_GAMEONLY)))
|
2004-10-13 07:24:59 +00:00
|
|
|
break; // file doesn't exist
|
2005-12-21 03:07:33 +00:00
|
|
|
VFS_CLOSE(vfs);
|
2005-10-28 01:33:19 +00:00
|
|
|
}
|
|
|
|
if (i==100000)
|
2004-10-13 07:24:59 +00:00
|
|
|
{
|
2005-10-28 01:33:19 +00:00
|
|
|
Con_Printf ("SCR_ScreenShot_f: Couldn't create sequentially named file\n");
|
2004-10-13 07:24:59 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-25 13:48:30 +00:00
|
|
|
FS_NativePath(pcxname, FS_GAMEONLY, sysname, sizeof(sysname));
|
|
|
|
|
2012-11-27 03:23:19 +00:00
|
|
|
rgbbuffer = VID_GetRGBInfo(0, &width, &height);
|
|
|
|
if (rgbbuffer)
|
|
|
|
{
|
|
|
|
if (SCR_ScreenShot(pcxname, rgbbuffer, width, height))
|
|
|
|
{
|
|
|
|
Con_Printf ("Wrote %s\n", sysname);
|
|
|
|
BZ_Free(rgbbuffer);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
BZ_Free(rgbbuffer);
|
|
|
|
}
|
|
|
|
Con_Printf ("Couldn't write %s\n", sysname);
|
2005-10-28 01:33:19 +00:00
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2004-10-13 07:24:59 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
// from gl_draw.c
|
|
|
|
qbyte *draw_chars; // 8*8 graphic characters
|
|
|
|
|
|
|
|
void SCR_DrawCharToSnap (int num, qbyte *dest, int width)
|
|
|
|
{
|
|
|
|
int row, col;
|
|
|
|
qbyte *source;
|
|
|
|
int drawline;
|
|
|
|
int x;
|
|
|
|
|
2013-03-12 23:24:15 +00:00
|
|
|
if (!draw_chars)
|
|
|
|
{
|
|
|
|
draw_chars = W_GetLumpName("conchars");
|
|
|
|
if (!draw_chars)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
row = num>>4;
|
|
|
|
col = num&15;
|
|
|
|
source = draw_chars + (row<<10) + (col<<3);
|
|
|
|
|
|
|
|
drawline = 8;
|
|
|
|
|
|
|
|
while (drawline--)
|
|
|
|
{
|
|
|
|
for (x=0 ; x<8 ; x++)
|
2005-07-01 19:23:00 +00:00
|
|
|
if (source[x]!=255)
|
2004-08-23 00:15:46 +00:00
|
|
|
dest[x] = source[x];
|
|
|
|
source += 128;
|
|
|
|
dest -= width;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_DrawStringToSnap (const char *s, qbyte *buf, int x, int y, int width)
|
|
|
|
{
|
|
|
|
qbyte *dest;
|
|
|
|
const unsigned char *p;
|
|
|
|
|
|
|
|
dest = buf + ((y * width) + x);
|
|
|
|
|
|
|
|
p = (const unsigned char *)s;
|
|
|
|
while (*p) {
|
|
|
|
SCR_DrawCharToSnap(*p++, dest, width);
|
|
|
|
dest += 8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-10-28 01:33:19 +00:00
|
|
|
/*
|
|
|
|
==================
|
2004-08-23 00:15:46 +00:00
|
|
|
SCR_RSShot
|
2005-10-28 01:33:19 +00:00
|
|
|
==================
|
|
|
|
*/
|
|
|
|
qboolean SCR_RSShot (void)
|
|
|
|
{
|
2004-08-23 00:15:46 +00:00
|
|
|
int truewidth;
|
|
|
|
int trueheight;
|
|
|
|
|
|
|
|
int x, y;
|
|
|
|
unsigned char *src, *dest;
|
|
|
|
unsigned char *newbuf;
|
|
|
|
int w, h;
|
|
|
|
int dx, dy, dex, dey, nx;
|
|
|
|
int r, b, g;
|
|
|
|
int count;
|
|
|
|
float fracw, frach;
|
|
|
|
char st[80];
|
|
|
|
time_t now;
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (!scr_allowsnap.ival)
|
2004-08-23 00:15:46 +00:00
|
|
|
return false;
|
|
|
|
|
|
|
|
if (CL_IsUploading())
|
|
|
|
return false; // already one pending
|
|
|
|
|
|
|
|
if (cls.state < ca_onserver)
|
|
|
|
return false; // gotta be connected
|
|
|
|
|
|
|
|
if (!VID_GetRGBInfo || !scr_initialized)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
Con_Printf("Remote screen shot requested.\n");
|
|
|
|
|
2005-10-28 01:33:19 +00:00
|
|
|
//
|
|
|
|
// save the pcx file
|
|
|
|
//
|
2004-08-23 00:15:46 +00:00
|
|
|
newbuf = VID_GetRGBInfo(0, &truewidth, &trueheight);
|
|
|
|
|
|
|
|
w = RSSHOT_WIDTH;
|
|
|
|
h = RSSHOT_HEIGHT;
|
|
|
|
|
|
|
|
fracw = (float)truewidth / (float)w;
|
|
|
|
frach = (float)trueheight / (float)h;
|
|
|
|
|
|
|
|
//scale down first.
|
|
|
|
for (y = 0; y < h; y++) {
|
|
|
|
dest = newbuf + (w*3 * y);
|
|
|
|
|
|
|
|
for (x = 0; x < w; x++) {
|
|
|
|
r = g = b = 0;
|
|
|
|
|
|
|
|
dx = x * fracw;
|
|
|
|
dex = (x + 1) * fracw;
|
|
|
|
if (dex == dx) dex++; // at least one
|
|
|
|
dy = y * frach;
|
|
|
|
dey = (y + 1) * frach;
|
|
|
|
if (dey == dy) dey++; // at least one
|
|
|
|
|
|
|
|
count = 0;
|
|
|
|
for (/* */; dy < dey; dy++) {
|
|
|
|
src = newbuf + (truewidth * 3 * dy) + dx * 3;
|
|
|
|
for (nx = dx; nx < dex; nx++) {
|
|
|
|
r += *src++;
|
|
|
|
g += *src++;
|
|
|
|
b += *src++;
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
r /= count;
|
|
|
|
g /= count;
|
|
|
|
b /= count;
|
|
|
|
*dest++ = r;
|
|
|
|
*dest++ = g;
|
2005-07-01 19:23:00 +00:00
|
|
|
*dest++ = b;
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// convert to eight bit
|
|
|
|
for (y = 0; y < h; y++) {
|
|
|
|
src = newbuf + (w * 3 * y);
|
|
|
|
dest = newbuf + (w * y);
|
|
|
|
|
|
|
|
for (x = 0; x < w; x++) {
|
|
|
|
*dest++ = MipColor(src[0], src[1], src[2]);
|
|
|
|
src += 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
time(&now);
|
|
|
|
strcpy(st, ctime(&now));
|
|
|
|
st[strlen(st) - 1] = 0;
|
|
|
|
SCR_DrawStringToSnap (st, newbuf, w - strlen(st)*8, h - 1, w);
|
|
|
|
|
|
|
|
Q_strncpyz(st, cls.servername, sizeof(st));
|
|
|
|
SCR_DrawStringToSnap (st, newbuf, w - strlen(st)*8, h - 11, w);
|
|
|
|
|
|
|
|
Q_strncpyz(st, name.string, sizeof(st));
|
|
|
|
SCR_DrawStringToSnap (st, newbuf, w - strlen(st)*8, h - 21, w);
|
|
|
|
|
2013-03-12 23:24:15 +00:00
|
|
|
WritePCXfile ("snap.pcx", newbuf, w, h, w, host_basepal, true);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
BZ_Free(newbuf);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
/*
|
|
|
|
===============
|
|
|
|
SCR_BringDownConsole
|
|
|
|
|
|
|
|
Brings the console down and fades the palettes back to normal
|
|
|
|
================
|
|
|
|
*/
|
|
|
|
void SCR_BringDownConsole (void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int pnum;
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
for (pnum = 0; pnum < cl.splitclients; pnum++)
|
2009-11-04 21:16:50 +00:00
|
|
|
scr_centerprint[pnum].charcount = 0;
|
2005-10-28 01:33:19 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
for (i=0 ; i<20 && scr_conlines != scr_con_current ; i++)
|
|
|
|
SCR_UpdateScreen ();
|
|
|
|
|
|
|
|
cl.cshifts[CSHIFT_CONTENTS].percent = 0; // no area contents palette on next frame
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCR_TileClear (void)
|
|
|
|
{
|
2013-06-23 02:17:02 +00:00
|
|
|
if (r_refdef.vrect.width < r_refdef.grect.width)
|
|
|
|
{
|
|
|
|
int w;
|
|
|
|
// left
|
|
|
|
R2D_TileClear (r_refdef.grect.x, r_refdef.grect.y, r_refdef.vrect.x-r_refdef.grect.x, r_refdef.grect.height - sb_lines);
|
|
|
|
// right
|
|
|
|
w = (r_refdef.grect.x+r_refdef.grect.width) - (r_refdef.vrect.x+r_refdef.vrect.width);
|
|
|
|
R2D_TileClear ((r_refdef.grect.x+r_refdef.grect.width) - (w), r_refdef.grect.y, w, r_refdef.grect.height - sb_lines);
|
|
|
|
}
|
|
|
|
if (r_refdef.vrect.height < r_refdef.grect.height)
|
|
|
|
{
|
|
|
|
// top
|
|
|
|
R2D_TileClear (r_refdef.vrect.x, r_refdef.grect.y,
|
|
|
|
r_refdef.vrect.width,
|
|
|
|
r_refdef.vrect.y - r_refdef.grect.y);
|
|
|
|
// bottom
|
|
|
|
R2D_TileClear (r_refdef.vrect.x,
|
|
|
|
r_refdef.vrect.y + r_refdef.vrect.height,
|
|
|
|
r_refdef.vrect.width,
|
|
|
|
(r_refdef.grect.y+r_refdef.grect.height) - sb_lines - (r_refdef.vrect.y + r_refdef.vrect.height));
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
}
|
2005-01-23 17:49:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// The 2d refresh stuff.
|
|
|
|
void SCR_DrawTwoDimensional(int uimenu, qboolean nohud)
|
|
|
|
{
|
|
|
|
RSpeedMark();
|
2005-04-26 16:04:12 +00:00
|
|
|
|
2013-06-23 02:17:02 +00:00
|
|
|
R2D_ImageColours(1, 1, 1, 1);
|
|
|
|
|
2005-01-23 17:49:42 +00:00
|
|
|
//
|
|
|
|
// draw any areas not covered by the refresh
|
|
|
|
//
|
2012-08-04 01:35:52 +00:00
|
|
|
if (r_netgraph.value)
|
2012-08-04 11:28:39 +00:00
|
|
|
R_NetGraph ();
|
2005-01-23 17:49:42 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (scr_drawloading || loading_stage)
|
2005-01-23 17:49:42 +00:00
|
|
|
{
|
2009-04-06 00:34:32 +00:00
|
|
|
SCR_DrawLoading();
|
2005-08-06 07:18:29 +00:00
|
|
|
|
2005-01-23 17:49:42 +00:00
|
|
|
SCR_ShowPics_Draw();
|
|
|
|
}
|
2009-04-06 00:34:32 +00:00
|
|
|
else if (cl.intermission == 1)
|
2005-01-23 17:49:42 +00:00
|
|
|
{
|
|
|
|
Sbar_IntermissionOverlay ();
|
|
|
|
}
|
2009-04-06 00:34:32 +00:00
|
|
|
else if (cl.intermission == 2)
|
2005-01-23 17:49:42 +00:00
|
|
|
{
|
|
|
|
Sbar_FinaleOverlay ();
|
|
|
|
SCR_CheckDrawCenterString ();
|
|
|
|
}
|
2009-04-06 00:34:32 +00:00
|
|
|
else if (cl.intermission == 3)
|
2005-01-23 17:49:42 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!nohud)
|
|
|
|
{
|
2011-03-31 19:46:26 +00:00
|
|
|
R2D_DrawCrosshair();
|
2005-01-23 17:49:42 +00:00
|
|
|
|
|
|
|
SCR_DrawNet ();
|
|
|
|
SCR_DrawFPS ();
|
|
|
|
SCR_DrawUPS ();
|
|
|
|
SCR_DrawClock();
|
2006-03-06 01:41:09 +00:00
|
|
|
SCR_DrawGameClock();
|
2005-01-23 17:49:42 +00:00
|
|
|
SCR_DrawTurtle ();
|
|
|
|
SCR_DrawPause ();
|
|
|
|
SCR_ShowPics_Draw();
|
2005-08-03 23:14:59 +00:00
|
|
|
|
|
|
|
CL_DrawPrydonCursor();
|
2005-01-23 17:49:42 +00:00
|
|
|
}
|
|
|
|
else
|
2010-12-05 02:46:07 +00:00
|
|
|
{
|
2005-01-23 17:49:42 +00:00
|
|
|
SCR_DrawFPS ();
|
2010-12-05 02:46:07 +00:00
|
|
|
SCR_DrawUPS ();
|
|
|
|
}
|
2005-01-23 17:49:42 +00:00
|
|
|
SCR_CheckDrawCenterString ();
|
2009-04-06 00:34:32 +00:00
|
|
|
}
|
|
|
|
|
2005-01-23 17:49:42 +00:00
|
|
|
#ifdef TEXTEDITOR
|
2009-04-06 00:34:32 +00:00
|
|
|
if (editoractive)
|
|
|
|
Editor_Draw();
|
2005-01-23 17:49:42 +00:00
|
|
|
#endif
|
2009-04-06 00:34:32 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (key_dest != key_console)
|
|
|
|
SCR_DrawConsole (false);
|
2009-04-06 00:34:32 +00:00
|
|
|
|
|
|
|
M_Draw (uimenu);
|
2007-08-07 16:30:49 +00:00
|
|
|
#ifdef MENU_DAT
|
2009-04-06 00:34:32 +00:00
|
|
|
MP_Draw();
|
2007-08-07 16:30:49 +00:00
|
|
|
#endif
|
2010-11-26 06:58:48 +00:00
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
if (key_dest == key_console)
|
|
|
|
SCR_DrawConsole (false);
|
2005-01-23 17:49:42 +00:00
|
|
|
|
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
|
|
|
if (Key_MouseShouldBeFree())
|
|
|
|
SCR_DrawCursor(0);
|
|
|
|
SCR_DrawSimMTouchCursor();
|
|
|
|
|
2005-01-23 17:49:42 +00:00
|
|
|
RSpeedEnd(RSPEED_2D);
|
|
|
|
}
|