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"
2017-11-05 13:15:08 +00:00
# include "gl_draw.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 ] ;
2014-06-04 16:08:30 +00:00
int savedsamplerquant [ RQUANT_MAX ] ; //so we don't count the r_speeds debug spam in draw counts.
2007-05-25 22:16:29 +00:00
char * RSpNames [ RSPEED_MAX ] ;
char * RQntNames [ RQUANT_MAX ] ;
char * s ;
static int framecount ;
2016-07-12 00:40:13 +00:00
int frameinterval = 100 ;
2007-05-25 22:16:29 +00:00
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 ) ) ;
2017-08-29 02:29:06 +00:00
RSpNames [ RSPEED_TOTALREFRESH ] = " Total refresh " ;
RSpNames [ RSPEED_CSQCPHYSICS ] = " CSQC Physics " ;
RSpNames [ RSPEED_CSQCREDRAW ] = " CSQC Drawing " ;
RSpNames [ RSPEED_LINKENTITIES ] = " Entity setup " ;
RSpNames [ RSPEED_WORLDNODE ] = " World walking " ;
RSpNames [ RSPEED_DYNAMIC ] = " Lightmap updates " ;
RSpNames [ RSPEED_OPAQUE ] = " Opaque Batches " ;
RSpNames [ RSPEED_RTLIGHTS ] = " RT Lights " ;
RSpNames [ RSPEED_TRANSPARENTS ] = " Transparent Batches " ;
RSpNames [ RSPEED_PARTICLES ] = " Particle phys/sort " ;
RSpNames [ RSPEED_PARTICLESDRAW ] = " Particle drawing " ;
RSpNames [ RSPEED_2D ] = " 2d Elements " ;
RSpNames [ RSPEED_PALETTEFLASHES ] = " Palette flashes " ;
RSpNames [ RSPEED_SETUP ] = " Acquire Wait " ;
RSpNames [ RSPEED_SUBMIT ] = " submit/finish " ;
RSpNames [ RSPEED_PRESENT ] = " Present " ;
RSpNames [ RSPEED_ACQUIRE ] = " Acquire Request " ;
RSpNames [ RSPEED_PROTOCOL ] = " Client Protocol " ;
RSpNames [ RSPEED_SERVER ] = " Server " ;
2007-05-25 22:16:29 +00:00
2013-10-08 14:28:11 +00:00
memset ( RQntNames , 0 , sizeof ( RQntNames ) ) ;
2007-05-25 22:16:29 +00:00
RQntNames [ RQUANT_MSECS ] = " Microseconds " ;
2015-03-03 00:14:43 +00:00
RQntNames [ RQUANT_PRIMITIVEINDICIES ] = " Draw Indicies " ;
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 " ;
2015-03-03 00:14:43 +00:00
RQntNames [ RQUANT_SHADOWINDICIES ] = " Shadow Indicies " ;
2013-10-08 14:28:11 +00:00
RQntNames [ RQUANT_SHADOWEDGES ] = " Shadow Edges " ;
RQntNames [ RQUANT_SHADOWSIDES ] = " Shadowmap Sides " ;
2007-05-25 22:16:29 +00:00
RQntNames [ RQUANT_LITFACES ] = " Lit faces " ;
2013-10-08 14:28:11 +00:00
RQntNames [ RQUANT_RTLIGHT_DRAWN ] = " Lights Drawn " ;
RQntNames [ RQUANT_RTLIGHT_CULL_FRUSTUM ] = " Lights offscreen " ;
RQntNames [ RQUANT_RTLIGHT_CULL_PVS ] = " Lights PVS Culled " ;
RQntNames [ RQUANT_RTLIGHT_CULL_SCISSOR ] = " Lights Scissored " ;
2014-06-04 16:08:30 +00:00
memcpy ( savedsamplerquant , rquant , sizeof ( savedsamplerquant ) ) ;
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 + + )
{
2017-08-29 02:29:06 +00:00
Draw_FunStringWidth ( vid . width - 20 * 8 , i * 8 , RSpNames [ i ] , 20 * 8 , false , false ) ;
s = va ( " %g " , samplerspeeds [ i ] / ( float ) frameinterval ) ;
Draw_FunStringWidth ( 0 , i * 8 , s , vid . width - 20 * 8 , true , false ) ;
2011-02-25 04:22:14 +00:00
}
2007-05-25 22:16:29 +00:00
}
for ( i = 0 ; i < RQUANT_MAX ; i + + )
{
2016-07-12 00:40:13 +00:00
s = va ( " %u.%.3u %-20s " , samplerquant [ i ] / frameinterval , ( samplerquant [ i ] % 100 ) , RQntNames [ i ] ) ;
2013-10-08 14:28:11 +00:00
Draw_FunString ( vid . width - strlen ( s ) * 8 , ( i + RSPEED_MAX ) * 8 , s ) ;
}
if ( r_speeds . ival > 1 )
{
2017-08-29 02:29:06 +00:00
s = va ( " %f %-20s " , ( frameinterval * 1000 * 1000.0f ) / samplerspeeds [ RSPEED_TOTALREFRESH ] , " Framerate (refresh only) " ) ;
2009-11-04 21:16:50 +00:00
Draw_FunString ( vid . width - strlen ( s ) * 8 , ( i + RSPEED_MAX ) * 8 , s ) ;
2007-05-25 22:16:29 +00:00
}
2014-06-04 16:08:30 +00:00
memcpy ( rquant , savedsamplerquant , sizeof ( rquant ) ) ;
2007-05-25 22:16:29 +00:00
2016-07-12 00:40:13 +00:00
if ( + + framecount > = frameinterval )
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
*/
------------------------------------------------------------------------
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
2018-11-19 06:37:25 +00:00
float scr_con_current ; //current console lines shown
float scr_con_target ; //the target number of lines (not a local, because it helps to know if we're at the target yet, etc)
2004-08-23 00:15:46 +00:00
2006-02-25 21:03:56 +00:00
qboolean scr_con_forcedraw ;
2016-01-18 05:22:07 +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_logcenterprint ;
extern cvar_t scr_showturtle ;
2009-07-18 20:26:24 +00:00
extern cvar_t scr_turtlefps ;
2016-01-18 05:22:07 +00:00
extern cvar_t scr_showpause ;
extern cvar_t scr_printspeed ;
2004-08-23 00:15:46 +00:00
extern cvar_t scr_allowsnap ;
extern cvar_t scr_sshot_type ;
2014-04-12 03:31:59 +00:00
extern cvar_t scr_sshot_prefix ;
2016-01-18 05:22:07 +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 " ) ;
2017-12-15 06:56:40 +00:00
cvar_t scr_diskicontimeout = CVAR ( " scr_diskicontimeout " , " 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 ;
viddef_t vid ; // global video state
vrect_t scr_vrect ;
qboolean scr_disabled_for_loading ;
qboolean scr_drawloading ;
float scr_disabled_time ;
2018-11-19 06:37:25 +00:00
cvar_t con_stayhidden = CVARFD ( " con_stayhidden " , " 1 " , CVAR_NOTFROMSERVER , " 0: allow console to pounce on the user \n 1: console stays hidden unless explicitly invoked \n 2:toggleconsole command no longer works \n 3: shift+escape key no longer works " ) ;
2017-08-29 02:29:06 +00:00
cvar_t show_fps = CVARFD ( " show_fps " , " 0 " , CVAR_ARCHIVE , " Displays the current framerate on-screen. \n 1: framerate average over a second. \n 2: Slowest frame over the last second (the game will play like shit if this is significantly lower than the average). \n 3: Shows the rate of the fastest frame (not very useful). \n 4: Shows the current frame's timings (this depends upon timer precision). \n 5: Display a graph of how long it took to render each frame, large spikes are BAD BAD BAD. \n 6: Displays the standard deviation of the frame times, if its greater than 3 then something is probably badly made, or you've a virus scanner running... \n 7: Framegraph, for use with slower frames. " ) ;
2016-09-08 19:04:35 +00:00
cvar_t show_fps_x = CVAR ( " show_fps_x " , " -1 " ) ;
cvar_t show_fps_y = CVAR ( " show_fps_y " , " -1 " ) ;
cvar_t show_clock = CVAR ( " cl_clock " , " 0 " ) ;
cvar_t show_clock_x = CVAR ( " cl_clock_x " , " 0 " ) ;
cvar_t show_clock_y = CVAR ( " cl_clock_y " , " -1 " ) ;
cvar_t show_gameclock = CVAR ( " cl_gameclock " , " 0 " ) ;
cvar_t show_gameclock_x = CVAR ( " cl_gameclock_x " , " 0 " ) ;
cvar_t show_gameclock_y = CVAR ( " cl_gameclock_y " , " -1 " ) ;
cvar_t show_speed = CVAR ( " show_speed " , " 0 " ) ;
cvar_t show_speed_x = CVAR ( " show_speed_x " , " -1 " ) ;
cvar_t show_speed_y = CVAR ( " show_speed_y " , " -9 " ) ;
2017-12-15 06:56:40 +00:00
cvar_t scr_showdisk = CVAR ( " scr_showdisk " , " 0 " ) ;
cvar_t scr_showdisk_x = CVAR ( " scr_showdisk_x " , " -24 " ) ;
cvar_t scr_showdisk_y = CVAR ( " scr_showdisk_y " , " 0 " ) ;
2015-06-14 01:28:01 +00:00
cvar_t scr_showobituaries = CVAR ( " scr_showobituaries " , " 0 " ) ;
2005-01-23 17:49:42 +00:00
2017-11-05 13:15:08 +00:00
cvar_t scr_loadingrefresh = CVARD ( " scr_loadingrefresh " , " 0 " , " Force redrawing of the loading screen, in order to display EVERY resource that is loaded " ) ;
cvar_t scr_showloading = CVAR ( " scr_showloading " , " 1 " ) ;
//things to configure the legacy loading screen
cvar_t scr_loadingscreen_picture = CVAR ( " scr_loadingscreen_picture " , " gfx/loading " ) ;
cvar_t scr_loadingscreen_scale = CVAR ( " scr_loadingscreen_scale " , " 1 " ) ;
cvar_t scr_loadingscreen_scale_limit = CVAR ( " scr_loadingscreen_scale_limit " , " 2 " ) ;
2014-09-02 02:44:43 +00:00
void * scr_curcursor ;
2016-02-10 23:23:43 +00:00
static void SCR_CPrint_f ( void )
{
if ( Cmd_Argc ( ) = = 2 )
SCR_CenterPrint ( 0 , Cmd_Argv ( 1 ) , true ) ;
else
SCR_CenterPrint ( 0 , Cmd_Args ( ) , true ) ;
}
2005-01-23 17:49:42 +00:00
extern char cl_screengroup [ ] ;
void CLSCR_Init ( void )
{
2015-04-14 23:12:17 +00:00
int i ;
2009-04-19 00:50:42 +00:00
Cmd_AddCommand ( " cprint " , SCR_CPrint_f ) ;
2014-08-27 08:41:31 +00:00
Cvar_Register ( & con_stayhidden , cl_screengroup ) ;
2012-05-09 15:30:53 +00:00
Cvar_Register ( & scr_loadingrefresh , cl_screengroup ) ;
2015-07-31 13:23:32 +00:00
Cvar_Register ( & scr_showloading , cl_screengroup ) ;
2017-11-05 13:15:08 +00:00
Cvar_Register ( & scr_loadingscreen_picture , cl_screengroup ) ;
Cvar_Register ( & scr_loadingscreen_scale , cl_screengroup ) ;
Cvar_Register ( & scr_loadingscreen_scale_limit , 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 ) ;
2017-12-15 06:56:40 +00:00
Cvar_Register ( & scr_showdisk , cl_screengroup ) ;
Cvar_Register ( & scr_showdisk_x , cl_screengroup ) ;
Cvar_Register ( & scr_showdisk_y , cl_screengroup ) ;
Cvar_Register ( & scr_diskicontimeout , cl_screengroup ) ;
2015-06-14 01:28:01 +00:00
Cvar_Register ( & scr_showobituaries , cl_screengroup ) ;
2014-09-02 02:44:43 +00:00
memset ( & key_customcursor , 0 , sizeof ( key_customcursor ) ) ;
2015-04-14 23:12:17 +00:00
for ( i = 0 ; i < kc_max ; i + + )
key_customcursor [ i ] . dirty = true ;
2014-09-02 02:44:43 +00:00
scr_curcursor = NULL ;
if ( rf & & rf - > VID_SetCursor )
rf - > VID_SetCursor ( scr_curcursor ) ;
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 ;
2016-07-21 19:27:59 +00:00
conchar_t * string ;
2017-07-28 01:49:25 +00:00
conchar_t * cursorchar ; //pointer into string
2016-07-21 19:27:59 +00:00
size_t stringbytes ;
2017-07-28 01:49:25 +00:00
size_t charcount ;
2012-01-17 07:57:46 +00:00
char titleimage [ MAX_QPATH ] ;
2009-11-04 21:16:50 +00:00
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 ;
2015-06-15 20:11:27 +00:00
//hex values
if ( ! strncmp ( rgbstring , " 0x " , 2 ) )
{
char * end ;
unsigned int val = strtoul ( rgbstring + 2 , & end , 16 ) ;
if ( end = = rgbstring + 5 )
{
rgb [ 0 ] = ( ( val & 0xf00 ) > > 8 ) / 15.0 ;
rgb [ 1 ] = ( ( val & 0x0f0 ) > > 4 ) / 15.0 ;
rgb [ 2 ] = ( ( val & 0x00f ) > > 0 ) / 15.0 ;
}
else if ( end = = rgbstring + 8 )
{
rgb [ 0 ] = ( ( val & 0xff0000 ) > > 12 ) / 255.0 ;
rgb [ 1 ] = ( ( val & 0x00ff00 ) > > 8 ) / 255.0 ;
rgb [ 2 ] = ( ( val & 0x0000ff ) > > 0 ) / 255.0 ;
}
else
rgb [ 0 ] = rgb [ 1 ] = rgb [ 2 ] = 1 ;
return ;
}
2006-03-11 00:35:56 +00:00
t = strstr ( rgbstring , " " ) ;
2015-06-15 20:11:27 +00:00
if ( ! t ) // palette index
2006-03-11 00:35:56 +00:00
{
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 ) ;
}
2015-06-15 20:11:27 +00:00
else // use RGB coloring (input is scaled from 0-rgbinputscale)
2006-03-11 00:35:56 +00:00
{
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 ;
2015-06-15 20:11:27 +00:00
rgbinputscale = 1 / rgbinputscale ;
2006-03-11 00:35:56 +00:00
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
= = = = = = = = = = = = = =
*/
2017-08-14 16:38:44 +00:00
void SCR_CenterPrint ( int pnum , const char * str , qboolean skipgamecode )
2004-08-23 00:15:46 +00:00
{
2017-07-28 01:49:25 +00:00
size_t i ;
2009-11-04 21:16:50 +00:00
cprint_t * p ;
2016-11-20 20:52:41 +00:00
if ( ! str )
{
if ( cl . intermissionmode = = IM_NONE )
{
p = & scr_centerprint [ pnum ] ;
p - > flags = 0 ;
p - > time_off = 0 ;
}
return ;
}
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 )
2018-05-06 16:09:07 +00:00
var = Cvar_Get ( " scr_centerprinttext " , " " , 0 , " Script Notifications " ) ;
if ( var )
{
Cvar_Set ( var , str ) ;
Cbuf_AddText ( " f_centerprint \n " , RESTRICT_LOCAL ) ;
}
2005-10-28 01:33:19 +00:00
}
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 ;
2017-07-28 01:49:25 +00:00
p - > cursorchar = NULL ;
2015-09-01 04:45:15 +00:00
if ( * str ! = ' / ' )
2012-01-17 07:57:46 +00:00
{
2015-09-01 04:45:15 +00:00
if ( cl . intermissionmode ! = IM_NONE )
{
p - > flags | = CPRINT_TYPEWRITER | CPRINT_PERSIST | CPRINT_TALIGN ;
2016-07-12 00:40:13 +00:00
if ( cl . intermissionmode ! = IM_NQCUTSCENE )
Q_strncpyz ( p - > titleimage , " gfx/finale.lmp " , sizeof ( p - > titleimage ) ) ;
2015-09-01 04:45:15 +00:00
}
2012-01-17 07:57:46 +00:00
}
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 ;
}
2017-07-28 01:49:25 +00:00
else if ( str [ 1 ] = = ' C ' )
p - > flags | = CPRINT_CURSOR ; //this can be a little jarring if there's no links, so this forces consistent behaviour.
2014-10-05 20:04:11 +00:00
else if ( str [ 1 ] = = ' W ' ) //wait between each char
p - > flags ^ = CPRINT_TYPEWRITER ;
else if ( str [ 1 ] = = ' S ' ) //Stay
p - > flags ^ = CPRINT_PERSIST ;
else if ( str [ 1 ] = = ' M ' ) //'Mask' the background so that its readable.
p - > flags ^ = CPRINT_BACKGROUND ;
else if ( str [ 1 ] = = ' O ' ) //Obituaries are shown at the bottom, ish.
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 ;
2015-09-01 04:45:15 +00:00
else if ( str [ 1 ] = = ' F ' )
{ //'F' is reserved for special handling via svc_finale
if ( cl . intermissionmode = = IM_NONE )
cl . completed_time = cl . time ;
str + = 2 ;
switch ( * str + + )
{
2016-07-12 00:40:13 +00:00
case ' R ' : //remove intermission
2015-09-01 04:45:15 +00:00
cl . intermissionmode = IM_NONE ;
break ;
2016-07-12 00:40:13 +00:00
case ' I ' : //standard intermission
case ' S ' : //score board / map stats
2015-09-01 04:45:15 +00:00
cl . intermissionmode = IM_NQSCORES ;
break ;
2016-07-12 00:40:13 +00:00
case ' F ' : //finale
2015-09-01 04:45:15 +00:00
cl . intermissionmode = IM_NQFINALE ;
break ;
2016-07-12 00:40:13 +00:00
case ' f ' : //finale, but with the view offset properly
cl . intermissionmode = IM_H2FINALE ;
break ;
2015-09-01 04:45:15 +00:00
case 0 :
str - - ;
break ;
default :
break ; //no idea. suck it up for compat.
}
continue ;
}
2012-01-17 07:57:46 +00:00
else if ( str [ 1 ] = = ' I ' )
{
2017-08-14 16:38:44 +00:00
const char * e ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
int l ;
str + = 2 ;
e = strchr ( str , ' : ' ) ;
if ( ! e )
e = strchr ( str , ' ' ) ; //probably an error
if ( ! e )
e = str + strlen ( str ) - 1 ; //error
l = e - str ;
2012-01-17 07:57:46 +00:00
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
}
2016-01-18 05:22:07 +00:00
if ( ( ( scr_logcenterprint . ival & & ! cl . deathmatch ) | | scr_logcenterprint . ival = = 2 ) & & ! ( p - > flags & CPRINT_PERSIST ) )
{
//don't spam too much.
if ( * str & & strncmp ( cl . lastcenterprint , str , sizeof ( cl . lastcenterprint ) - 1 ) )
{
Q_strncpyz ( cl . lastcenterprint , str , sizeof ( cl . lastcenterprint ) ) ;
Con_CenterPrint ( str ) ;
}
}
2016-07-21 19:27:59 +00:00
for ( ; ; )
{
p - > charcount = COM_ParseFunString ( CON_WHITEMASK , str , p - > string , p - > stringbytes , false ) - p - > string ;
if ( ( p - > charcount + 1 ) * sizeof ( * p - > string ) < p - > stringbytes )
break ;
else
{
p - > stringbytes = p - > stringbytes * 2 + sizeof ( * p - > string ) ;
Z_Free ( p - > string ) ;
p - > string = Z_Malloc ( p - > stringbytes ) ;
}
}
2017-07-28 01:49:25 +00:00
if ( ! ( p - > flags & CPRINT_CURSOR ) )
{ //autodetect links
for ( i = 0 ; i < p - > charcount ; i + + )
{
if ( p - > string [ i ] = = CON_LINKSTART )
2018-05-06 16:09:07 +00:00
{
2017-07-28 01:49:25 +00:00
p - > flags | = CPRINT_CURSOR ;
2018-05-06 16:09:07 +00:00
break ;
}
2017-07-28 01:49:25 +00:00
}
}
2009-11-04 21:16:50 +00:00
p - > time_off = scr_centertime . value ;
p - > time_start = cl . time ;
2004-08-23 00:15:46 +00:00
}
2015-04-14 23:12:17 +00:00
void VARGS Stats_Message ( char * msg , . . . )
{
va_list argptr ;
char str [ 2048 ] ;
cprint_t * p = & scr_centerprint [ 0 ] ;
2015-06-14 01:28:01 +00:00
if ( ! scr_showobituaries . ival )
return ;
2015-04-14 23:12:17 +00:00
if ( p - > time_off > = 0 )
return ;
va_start ( argptr , msg ) ;
vsnprintf ( str , sizeof ( str ) - 1 , msg , argptr ) ;
va_end ( argptr ) ;
p - > flags = CPRINT_OBITUARTY ;
p - > titleimage [ 0 ] = 0 ;
2016-07-21 19:27:59 +00:00
for ( ; ; )
{
p - > charcount = COM_ParseFunString ( CON_WHITEMASK , str , p - > string , p - > stringbytes , false ) - p - > string ;
if ( ( p - > charcount + 1 ) * sizeof ( * p - > string ) < p - > stringbytes )
break ;
else
{
p - > stringbytes = p - > stringbytes * 2 + sizeof ( * p - > string ) ;
Z_Free ( p - > string ) ;
p - > string = Z_Malloc ( p - > stringbytes ) ;
}
}
2015-04-14 23:12:17 +00:00
p - > time_off = scr_centertime . value ;
p - > time_start = cl . time ;
}
2017-07-28 01:49:25 +00:00
static char * SCR_CopyCenterPrint ( cprint_t * p ) //reads the link under the mouse cursor. non-links are ignored.
{
size_t maxlen , outlen ;
char * result ;
conchar_t * start = p - > cursorchar , * end ;
if ( ! start ) //cursor isn't over anything.
return NULL ;
//scan backwards to find any link enclosure
for ( end = start - 1 ; end > = p - > string ; end - - )
{
if ( * end = = CON_LINKSTART )
{
//found one
start = end ;
break ;
}
if ( * end = = CON_LINKEND )
{
//some other link ended here. don't use its start.
break ;
}
}
//scan forwards to find the end of the selected link
if ( start < p - > string + p - > charcount & & * start = = CON_LINKSTART )
{
for ( end = start ; end < p - > string + p - > charcount ; end + + )
{
if ( * end = = CON_LINKEND )
{
end + + ;
break ;
}
}
}
else // if (onlyiflink)
return NULL ;
maxlen = 1024 * 1024 ;
result = Z_Malloc ( maxlen + 1 ) ;
outlen = COM_DeFunString ( start , end , result , maxlen , false , false ) - result ;
result [ outlen + + ] = 0 ;
return result ;
}
2017-06-22 10:29:06 +00:00
# define MAX_CPRINT_LINES 512
------------------------------------------------------------------------
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
{
2016-08-25 00:12:14 +00:00
int l ;
int y , x ;
2009-11-04 21:16:50 +00:00
int left ;
int right ;
int top ;
int bottom ;
2016-08-25 00:12:14 +00:00
int remaining ;
2012-01-17 07:57:46 +00:00
shader_t * pic ;
2017-07-28 01:49:25 +00:00
int ch ;
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.
2016-07-12 00:40:13 +00:00
int w = 320 , h = 200 ;
if ( pic )
R_GetShaderSizes ( pic , & w , & h , false ) ;
if ( rect - > width > w )
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
{
2016-07-12 00:40:13 +00:00
rect - > x = ( rect - > x + rect - > width / 2 ) - ( w / 2 ) ;
rect - > width = w ;
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 )
{
2016-07-12 00:40:13 +00:00
if ( rect - > height > h )
2012-01-17 07:57:46 +00:00
{
2016-07-12 00:40:13 +00:00
rect - > y = ( rect - > y + rect - > height / 2 ) - ( h / 2 ) ;
rect - > height = h ;
2012-01-17 07:57:46 +00:00
}
rect - > y + = 16 ;
rect - > height - = 32 ;
}
}
y = rect - > y ;
if ( pic )
{
2016-07-12 00:40:13 +00:00
//the pic is just a header
2012-01-17 07:57:46 +00:00
if ( ! ( p - > flags & CPRINT_BACKGROUND ) )
{
2014-10-05 20:04:11 +00:00
int w , h ;
R_GetShaderSizes ( pic , & w , & h , false ) ;
2015-08-20 03:17:47 +00:00
w * = 24.0 / h ;
h = 24 ;
2012-01-17 07:57:46 +00:00
y + = 16 ;
2014-10-05 20:04:11 +00:00
R2D_ScalePic ( ( vid . width - w ) / 2 , 16 , w , h , pic ) ;
y + = h ;
2012-01-17 07:57:46 +00:00
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 ) ;
2018-11-19 06:37:25 +00:00
linecount = Font_LineBreaks ( p - > string , p - > string + p - > charcount , ( p - > flags & CPRINT_NOWRAP ) ? 0x7fffffff : ( right - left ) , MAX_CPRINT_LINES , line_start , line_end ) ;
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
2017-07-28 01:49:25 +00:00
ch = Font_CharHeight ( ) ;
2009-11-04 21:16:50 +00:00
if ( p - > flags & CPRINT_TALIGN )
y = top ;
else if ( p - > flags & CPRINT_BALIGN )
2017-07-28 01:49:25 +00:00
y = bottom - ch * linecount ;
2009-11-04 21:16:50 +00:00
else if ( p - > flags & CPRINT_OBITUARTY )
//'obituary' messages appear at the bottom of the screen
2017-07-28 01:49:25 +00:00
y = ( bottom - top - ch * linecount ) * 0.65 + top ;
2004-08-23 00:15:46 +00:00
else
2004-09-02 00:34:10 +00:00
{
2014-10-05 20:04:11 +00:00
if ( linecount < = 5 )
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
2017-07-28 01:49:25 +00:00
y = ( bottom - top - ch * 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
2017-07-28 01:49:25 +00:00
y = ( bottom - top - ch * 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 ;
2016-07-12 00:40:13 +00:00
Font_EndString ( font ) ;
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 ) ;
2016-07-12 00:40:13 +00:00
Font_BeginString ( font , rect - > x , y , & left , & top ) ;
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
}
2017-07-28 01:49:25 +00:00
for ( l = 0 ; l < linecount ; l + + , y + = ch )
2004-08-23 00:15:46 +00:00
{
2015-04-27 06:19:33 +00:00
if ( y > = bottom )
break ;
2009-11-04 21:16:50 +00:00
if ( p - > flags & CPRINT_RALIGN )
2010-03-14 14:35:56 +00:00
x = right - Font_LineWidth ( line_start [ l ] , line_end [ l ] ) ;
2009-11-04 21:16:50 +00:00
else if ( p - > flags & CPRINT_LALIGN )
x = left ;
else
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
x = left + ( right - left - Font_LineWidth ( line_start [ l ] , line_end [ l ] ) ) / 2 ;
2009-11-04 21:16:50 +00:00
2017-07-28 01:49:25 +00:00
if ( mousecursor_y > = y & & mousecursor_y < y + ch )
{
p - > cursorchar = Font_CharAt ( mousecursor_x - x , line_start [ l ] , line_end [ l ] ) ;
}
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
}
2017-07-28 01:49:25 +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
}
2017-07-28 01:49:25 +00:00
qboolean Key_Centerprint ( int key , int unicode , unsigned int devid )
{
int pnum ;
cprint_t * p ;
char * link ;
if ( key = = K_MOUSE1 )
{
//figure out which player has the cursor
for ( pnum = 0 ; pnum < cl . splitclients ; pnum + + )
{
p = & scr_centerprint [ pnum ] ;
if ( cl . playerview [ pnum ] . gamerectknown = = cls . framecount )
{
link = SCR_CopyCenterPrint ( p ) ;
if ( link )
{
if ( link [ 0 ] = = ' ^ ' & & link [ 1 ] = = ' [ ' )
{
//looks like it might be a link!
char * end = NULL ;
char * info ;
for ( info = link + 2 ; * info ; )
{
if ( info [ 0 ] = = ' ^ ' & & info [ 1 ] = = ' ] ' )
break ; //end of tag, with no actual info, apparently
if ( * info = = ' \\ ' )
break ;
else if ( info [ 0 ] = = ' ^ ' & & info [ 1 ] = = ' ^ ' )
info + = 2 ;
else
info + + ;
}
for ( end = info ; * end ; )
{
if ( end [ 0 ] = = ' ^ ' & & end [ 1 ] = = ' ] ' )
{
//okay, its a valid link that they clicked
* end = 0 ;
# ifdef PLUGINS
if ( ! Plug_ConsoleLink ( link + 2 , info , " " ) )
# endif
# ifdef CSQC_DAT
if ( ! CSQC_ConsoleLink ( link + 2 , info ) )
# endif
Key_DefaultLinkClicked ( NULL , link + 2 , info ) ;
break ;
}
if ( end [ 0 ] = = ' ^ ' & & end [ 1 ] = = ' ^ ' )
end + = 2 ;
else
end + + ;
}
}
}
}
}
return true ; //handled
}
else if ( key = = K_MOUSE2 )
{
for ( pnum = 0 ; pnum < cl . splitclients ; pnum + + )
{
p = & scr_centerprint [ pnum ] ;
p - > flags & = ~ CPRINT_CURSOR ;
}
return true ;
}
return false ;
}
2004-08-23 00:15:46 +00:00
void SCR_CheckDrawCenterString ( void )
{
int pnum ;
2009-11-04 21:16:50 +00:00
cprint_t * p ;
2004-08-23 00:15:46 +00:00
2017-07-28 01:49:25 +00:00
Key_Dest_Remove ( kdm_centerprint ) ;
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 ] ;
2017-07-28 01:49:25 +00:00
p - > cursorchar = NULL ;
2004-08-23 00:15:46 +00:00
2015-09-01 04:45:15 +00:00
if ( p - > time_off < = 0 & & ! ( p - > flags & CPRINT_PERSIST ) )
2010-08-28 17:14:38 +00:00
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
2017-07-28 01:49:25 +00:00
if ( Key_Dest_Has ( ~ ( kdm_game | kdm_centerprint ) ) ) //don't let progs guis/centerprints interfere with the game menu
2016-07-12 00:40:13 +00:00
continue ; //should probably allow the console with a scissor region or something.
2004-08-23 00:15:46 +00:00
2015-09-01 04:45:15 +00:00
# ifdef QUAKEHUD
2017-05-28 15:42:32 +00:00
if ( cl . playerview [ pnum ] . sb_showscores ) //this was annoying
2004-08-23 00:15:46 +00:00
continue ;
2015-09-01 04:45:15 +00:00
# endif
2004-08-23 00:15:46 +00:00
2015-04-27 06:19:33 +00:00
if ( cl . playerview [ pnum ] . gamerectknown = = cls . framecount )
2017-07-28 01:49:25 +00:00
{
2015-04-27 06:19:33 +00:00
SCR_DrawCenterString ( & cl . playerview [ pnum ] . gamerect , p , font_default ) ;
2017-07-28 01:49:25 +00:00
if ( p - > flags & CPRINT_CURSOR )
Key_Dest_Add ( kdm_centerprint ) ;
}
2004-08-23 00:15:46 +00:00
}
}
2015-04-27 06:19:33 +00:00
void R_DrawTextField ( int x , int y , int w , int h , const char * text , unsigned int defaultmask , unsigned int fieldflags , struct font_s * font , vec2_t fontscale )
2010-07-11 02:22:39 +00:00
{
cprint_t p ;
vrect_t r ;
2016-07-21 19:27:59 +00:00
conchar_t buffer [ 16384 ] ; //FIXME: make dynamic.
2010-07-11 02:22:39 +00:00
2016-07-21 19:27:59 +00:00
p . string = buffer ;
p . stringbytes = sizeof ( buffer ) ;
2010-07-11 02:22:39 +00:00
r . x = x ;
r . y = y ;
r . width = w ;
r . height = h ;
p . flags = fieldflags ;
2016-07-21 19:27:59 +00:00
p . charcount = COM_ParseFunString ( defaultmask , text , p . string , p . stringbytes , false ) - p . string ;
2010-07-11 02:22:39 +00:00
p . time_off = scr_centertime . value ;
p . time_start = cl . time ;
2014-10-05 20:04:11 +00:00
* p . titleimage = 0 ;
2010-07-11 02:22:39 +00:00
2015-04-27 06:19:33 +00:00
SCR_DrawCenterString ( & r , & p , font ) ;
2010-07-11 02:22:39 +00:00
}
2014-09-02 02:44:43 +00:00
qboolean SCR_HardwareCursorIsActive ( void )
2009-11-04 21:16:50 +00:00
{
2014-09-02 02:44:43 +00:00
if ( Key_MouseShouldBeFree ( ) )
return ! ! scr_curcursor ;
return false ;
}
void SCR_DrawCursor ( void )
{
extern cvar_t cl_cursor , cl_cursorbiasx , cl_cursorbiasy , cl_cursorscale , cl_prydoncursor ;
2009-11-04 21:16:50 +00:00
mpic_t * p ;
2014-09-02 02:44:43 +00:00
char * newc ;
int prydoncursornum = 0 ;
extern qboolean cursor_active ;
int cmod = kc_console ;
void * oldcurs = NULL ;
if ( cursor_active & & cl_prydoncursor . ival > 0 )
prydoncursornum = cl_prydoncursor . ival ;
else if ( ! Key_MouseShouldBeFree ( ) )
return ;
2013-12-29 22:48:28 +00:00
2014-09-02 02:44:43 +00:00
//choose the cursor based upon the module that has primary focus
2015-04-14 23:12:17 +00:00
if ( key_dest_mask & key_dest_absolutemouse & ( kdm_console | kdm_cwindows | kdm_editor ) )
2014-09-02 02:44:43 +00:00
cmod = kc_console ;
2015-07-14 14:47:00 +00:00
else if ( ( key_dest_mask & key_dest_absolutemouse & kdm_emenu ) )
cmod = kc_console ;
else if ( ( key_dest_mask & key_dest_absolutemouse & kdm_gmenu ) )
cmod = kc_menu ;
2018-05-21 13:47:53 +00:00
# ifdef MENU_NATIVECODE
else if ( ( key_dest_mask & key_dest_absolutemouse & kdm_nmenu ) )
cmod = kc_nmenu ;
# endif
2014-09-02 02:44:43 +00:00
else // if (key_dest_mask & key_dest_absolutemouse)
cmod = prydoncursornum ? kc_console : kc_game ;
if ( cmod = = kc_console )
{
if ( ! * cl_cursor . string | | prydoncursornum > 1 )
newc = va ( " gfx/prydoncursor%03i.lmp " , prydoncursornum ) ;
else
newc = cl_cursor . string ;
if ( strcmp ( key_customcursor [ kc_console ] . name , newc ) | | key_customcursor [ kc_console ] . hotspot [ 0 ] ! = cl_cursorbiasx . value | | key_customcursor [ kc_console ] . hotspot [ 1 ] ! = cl_cursorbiasy . value | | key_customcursor [ kc_console ] . scale ! = cl_cursorscale . value )
{
key_customcursor [ kc_console ] . dirty = true ;
Q_strncpyz ( key_customcursor [ cmod ] . name , newc , sizeof ( key_customcursor [ cmod ] . name ) ) ;
key_customcursor [ kc_console ] . hotspot [ 0 ] = cl_cursorbiasx . value ;
key_customcursor [ kc_console ] . hotspot [ 1 ] = cl_cursorbiasy . value ;
key_customcursor [ kc_console ] . scale = cl_cursorscale . value ;
2013-12-29 22:48:28 +00:00
}
}
2014-09-02 02:44:43 +00:00
if ( key_customcursor [ cmod ] . dirty )
{
2015-07-31 13:23:32 +00:00
if ( key_customcursor [ cmod ] . scale < = 0 | | ! * key_customcursor [ cmod ] . name )
2015-04-14 23:12:17 +00:00
{
key_customcursor [ cmod ] . hotspot [ 0 ] = cl_cursorbiasx . value ;
key_customcursor [ cmod ] . hotspot [ 1 ] = cl_cursorbiasy . value ;
key_customcursor [ cmod ] . scale = cl_cursorscale . value ;
}
2014-09-02 02:44:43 +00:00
key_customcursor [ cmod ] . dirty = false ;
oldcurs = key_customcursor [ cmod ] . handle ;
2015-07-27 08:21:34 +00:00
if ( rf - > VID_CreateCursor & & strcmp ( key_customcursor [ cmod ] . name , " none " ) )
2014-09-02 02:44:43 +00:00
{
2018-10-23 07:09:06 +00:00
image_t dummytex ;
flocation_t loc ;
char bestname [ MAX_QPATH ] ;
unsigned int bestflags ;
qbyte * rgbadata ;
uploadfmt_t format ;
void * filedata = NULL ;
int filelen = 0 , width , height ;
2015-07-31 13:23:32 +00:00
key_customcursor [ cmod ] . handle = NULL ;
2018-10-23 07:09:06 +00:00
memset ( & dummytex , 0 , sizeof ( dummytex ) ) ;
dummytex . flags = IF_NOREPLACE ; //no dds files
* bestname = 0 ;
//first try the named image, if possible
if ( ! filedata & & * key_customcursor [ cmod ] . name )
2018-09-29 17:31:58 +00:00
{
dummytex . ident = key_customcursor [ cmod ] . name ;
if ( Image_LocateHighResTexture ( & dummytex , & loc , bestname , sizeof ( bestname ) , & bestflags ) )
2018-10-23 07:09:06 +00:00
filelen = FS_LoadFile ( bestname , & filedata ) ;
}
if ( ! filedata )
{
dummytex . ident = " gfx/cursor.lmp " ;
if ( Image_LocateHighResTexture ( & dummytex , & loc , bestname , sizeof ( bestname ) , & bestflags ) )
filelen = FS_LoadFile ( bestname , & filedata ) ;
}
if ( ! filedata )
{
static qbyte lamecursor [ ] =
{
# define W 0x8f,0x8f,0x8f,0xff,
# define B 0x00,0x00,0x00,0xff,
# define T 0x00,0x00,0x00,0x00,
W T T T T T T T
W W T T T T T T
W B W T T T T T
W B B W T T T T
W B B B W T T T
W B B B B W T T
W B B B B B W T
W B B B B B B W
W B B B B W W W
W B W B B W T T
W W T W B B W T
W T T W B B W T
T T T T W B B W
T T T T W B B W
T T T T T W W T
# undef W
# undef B
} ;
key_customcursor [ cmod ] . handle = rf - > VID_CreateCursor ( lamecursor , 8 , 15 , PTI_LLLA8 , 0 , 0 , 1 ) ; //try the fallback
}
else if ( ! filedata )
FS_FreeFile ( filedata ) ; //format not okay, just free it.
else
{ //raw file loaded.
rgbadata = ReadRawImageFile ( filedata , filelen , & width , & height , & format , true , bestname ) ;
FS_FreeFile ( filedata ) ;
if ( rgbadata )
{ //image loaded properly, yay
if ( ( format = = PTI_RGBX8 | | format = = PTI_LLLX8 ) & & ! strchr ( bestname , ' : ' ) )
{ //people seem to insist on using jpgs, which don't have alpha.
//so screw over the alpha channel if needed.
unsigned int alpha_width , alpha_height , p ;
char aname [ MAX_QPATH ] ;
unsigned char * alphadata ;
char * alph ;
size_t alphsize ;
char ext [ 8 ] ;
COM_StripExtension ( bestname , aname , sizeof ( aname ) ) ;
COM_FileExtension ( bestname , ext , sizeof ( ext ) ) ;
Q_strncatz ( aname , " _alpha. " , sizeof ( aname ) ) ;
Q_strncatz ( aname , ext , sizeof ( aname ) ) ;
alphsize = FS_LoadFile ( aname , ( void * * ) & alph ) ;
if ( alph )
{
if ( ( alphadata = ReadRawImageFile ( alph , alphsize , & alpha_width , & alpha_height , & format , true , aname ) ) )
{
if ( alpha_width = = width & & alpha_height = = height )
for ( p = 0 ; p < alpha_width * alpha_height ; p + + )
rgbadata [ ( p < < 2 ) + 3 ] = ( alphadata [ ( p < < 2 ) + 0 ] + alphadata [ ( p < < 2 ) + 1 ] + alphadata [ ( p < < 2 ) + 2 ] ) / 3 ;
BZ_Free ( alphadata ) ;
}
FS_FreeFile ( alph ) ;
}
format = ( format = = PTI_LLLX8 ) ? PTI_LLLA8 : PTI_RGBA8 ;
}
key_customcursor [ cmod ] . handle = rf - > VID_CreateCursor ( rgbadata , width , height , format , key_customcursor [ cmod ] . hotspot [ 0 ] , key_customcursor [ cmod ] . hotspot [ 1 ] , key_customcursor [ cmod ] . scale ) ; //try the fallback
BZ_Free ( rgbadata ) ;
}
2018-09-29 17:31:58 +00:00
}
2014-09-02 02:44:43 +00:00
}
2014-09-02 02:50:28 +00:00
else
key_customcursor [ cmod ] . handle = NULL ;
2014-09-02 02:44:43 +00:00
}
if ( scr_curcursor ! = key_customcursor [ cmod ] . handle )
{
scr_curcursor = key_customcursor [ cmod ] . handle ;
rf - > VID_SetCursor ( scr_curcursor ) ;
}
if ( oldcurs )
rf - > VID_DestroyCursor ( oldcurs ) ;
if ( scr_curcursor )
return ;
//system doesn't support a hardware cursor, so try to draw a software one.
2015-07-27 08:21:34 +00:00
if ( ! strcmp ( key_customcursor [ cmod ] . name , " none " ) )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
return ;
2014-09-02 02:44:43 +00:00
p = R2D_SafeCachePic ( key_customcursor [ cmod ] . name ) ;
2014-10-05 20:04:11 +00:00
if ( ! p | | ! R_GetShaderSizes ( p , NULL , NULL , false ) )
2012-01-17 07:57:46 +00:00
p = R2D_SafeCachePic ( " gfx/cursor.lmp " ) ;
2014-10-05 20:04:11 +00:00
if ( p & & R_GetShaderSizes ( p , NULL , NULL , false ) )
2009-11-04 21:16:50 +00:00
{
2011-03-31 01:14:01 +00:00
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
2014-09-02 02:44:43 +00:00
R2D_Image ( mousecursor_x - key_customcursor [ cmod ] . hotspot [ 0 ] , mousecursor_y - key_customcursor [ cmod ] . hotspot [ 1 ] , p - > width * cl_cursorscale . value , p - > height * cl_cursorscale . 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 ;
2013-12-29 22:48:28 +00:00
Font_BeginScaledString ( font_default , mousecursor_x , mousecursor_y , 8 , 8 , & x , & y ) ;
2015-07-14 14:47:00 +00:00
x - = Font_CharScaleWidth ( CON_WHITEMASK , ' + ' | 0xe000 ) / 2 ;
2009-11-04 21:16:50 +00:00
y - = Font_CharHeight ( ) / 2 ;
2015-07-14 14:47:00 +00:00
Font_DrawScaleChar ( x , y , CON_WHITEMASK , ' + ' | 0xe000 ) ;
2013-12-29 22:48:28 +00:00
Font_EndString ( font_default ) ;
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
}
static void SCR_DrawSimMTouchCursor ( void )
{
int i ;
float x , y ;
for ( i = 0 ; i < 8 ; i + + )
{
if ( multicursor_active [ i ] )
{
2013-12-29 22:48:28 +00:00
Font_BeginScaledString ( font_default , multicursor_x [ i ] , multicursor_y [ i ] , 8 , 8 , & x , & y ) ;
2015-07-14 14:47:00 +00:00
x - = Font_CharScaleWidth ( CON_WHITEMASK , ' + ' | 0xe000 ) / 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
y - = Font_CharHeight ( ) / 2 ;
2015-07-14 14:47:00 +00:00
Font_DrawScaleChar ( x , y , CON_WHITEMASK , ' + ' | 0xe000 ) ;
2013-12-29 22:48:28 +00:00
Font_EndString ( font_default ) ;
------------------------------------------------------------------------
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
}
}
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 ;
2014-03-30 08:55:06 +00:00
qboolean persist ;
short x , y , w , h ;
2004-09-01 00:01:08 +00:00
char * name ;
char * picname ;
2014-03-30 08:55:06 +00:00
char * tcommand ;
2004-09-01 00:01:08 +00:00
} 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
2015-06-14 09:34:55 +00:00
switch ( origin )
2004-09-01 00:01:08 +00:00
{
2015-06-14 09:34:55 +00:00
//tei's original encoding
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 ;
2015-06-14 09:34:55 +00:00
//spike's attempt to provide sane origins that are a little more predictable.
case SL_ORG_TL :
break ;
case SL_ORG_TR :
x + = vid . width ;
break ;
case SL_ORG_BL :
y + = vid . height ;
break ;
case SL_ORG_BR :
x + = vid . width ;
y + = vid . height ;
break ;
case SL_ORG_MM :
x + = midx ;
y + = midy ;
break ;
case SL_ORG_TM :
x + = midx ;
break ;
case SL_ORG_BM :
x + = midx ;
y + = vid . height ;
break ;
case SL_ORG_ML :
y + = midy ;
break ;
case SL_ORG_MR :
x + = vid . height ;
y + = midy ;
break ;
2004-09-01 00:01:08 +00:00
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 ;
2014-03-30 08:55:06 +00:00
R2D_ScalePic ( x , y , sp - > w ? sp - > w : p - > width , sp - > h ? sp - > h : p - > height , p ) ;
2004-09-01 00:01:08 +00:00
}
}
2014-03-30 08:55:06 +00:00
char * SCR_ShowPics_ClickCommand ( int cx , int cy )
2004-09-01 00:01:08 +00:00
{
2014-03-30 08:55:06 +00:00
downloadlist_t * failed ;
float x , y , w , h ;
2004-09-01 00:01:08 +00:00
showpic_t * sp ;
2014-03-30 08:55:06 +00:00
mpic_t * p ;
for ( sp = showpics ; sp ; sp = sp - > next )
{
if ( ! sp - > tcommand | | ! * sp - > tcommand )
continue ;
x = sp - > x ;
y = sp - > y ;
w = sp - > w ;
h = sp - > h ;
SP_RecalcXY ( & x , & y , sp - > zone ) ;
if ( ! w | | ! h )
{
if ( ! * sp - > picname )
continue ;
for ( failed = cl . faileddownloads ; failed ; failed = failed - > next )
{ //don't try displaying ones that we know to have failed.
if ( ! strcmp ( failed - > rname , sp - > picname ) )
break ;
}
if ( failed )
continue ;
p = R2D_SafeCachePic ( sp - > picname ) ;
if ( ! p )
continue ;
w = w ? w : sp - > w ;
h = h ? h : sp - > h ;
}
if ( cx > = x & & cx < x + w )
if ( cy > = y & & cy < y + h )
return sp - > tcommand ; //if they overlap, that's your own damn fault.
}
return NULL ;
}
//all=false clears only server pics, not ones from configs.
2016-10-22 07:06:51 +00:00
void SCR_ShowPic_ClearAll ( qboolean persistflag )
2014-03-30 08:55:06 +00:00
{
showpic_t * * link , * 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
2014-03-30 08:55:06 +00:00
for ( link = & showpics ; ( sp = * link ) ; )
2004-09-01 00:01:08 +00:00
{
2016-10-22 07:06:51 +00:00
if ( sp - > persist ! = persistflag )
2014-03-30 08:55:06 +00:00
{
link = & sp - > next ;
continue ;
}
* link = sp - > next ;
2004-09-01 00:01:08 +00:00
Z_Free ( sp - > name ) ;
Z_Free ( sp - > picname ) ;
2014-03-30 08:55:06 +00:00
Z_Free ( sp - > tcommand ) ;
2004-09-01 00:01:08 +00:00
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
}
2015-06-14 09:34:55 +00:00
static int SCR_ShowPic_MapZone ( char * zone )
{
//sane coding scheme
if ( ! Q_strcasecmp ( zone , " tr " ) )
return SL_ORG_TR ;
if ( ! Q_strcasecmp ( zone , " tl " ) )
return SL_ORG_TL ;
if ( ! Q_strcasecmp ( zone , " br " ) )
return SL_ORG_BR ;
if ( ! Q_strcasecmp ( zone , " bl " ) )
return SL_ORG_BL ;
if ( ! Q_strcasecmp ( zone , " mm " ) )
return SL_ORG_MM ;
if ( ! Q_strcasecmp ( zone , " tm " ) )
return SL_ORG_TM ;
if ( ! Q_strcasecmp ( zone , " bm " ) )
return SL_ORG_BM ;
if ( ! Q_strcasecmp ( zone , " mr " ) )
return SL_ORG_MR ;
if ( ! Q_strcasecmp ( zone , " ml " ) )
return SL_ORG_MR ;
//compasy directions (but uses tei's coding scheme...)
if ( ! Q_strcasecmp ( zone , " nw " ) )
return SL_ORG_NW ;
if ( ! Q_strcasecmp ( zone , " ne " ) )
return SL_ORG_NE ;
if ( ! Q_strcasecmp ( zone , " sw " ) )
return SL_ORG_SW ;
if ( ! Q_strcasecmp ( zone , " sw " ) )
return SL_ORG_SE ;
if ( ! Q_strcasecmp ( zone , " cc " ) )
return SL_ORG_CC ;
if ( ! Q_strcasecmp ( zone , " cn " ) )
return SL_ORG_CN ;
if ( ! Q_strcasecmp ( zone , " cs " ) )
return SL_ORG_CS ;
if ( ! Q_strcasecmp ( zone , " cw " ) )
return SL_ORG_CW ;
if ( ! Q_strcasecmp ( zone , " ce " ) )
return SL_ORG_CE ;
return atoi ( zone ) ;
}
2005-01-13 16:29:20 +00:00
void SCR_ShowPic_Script_f ( void )
{
char * imgname ;
char * name ;
2014-03-30 08:55:06 +00:00
char * tcommand ;
int x , y , w , h ;
2005-01-13 16:29:20 +00:00
int zone ;
showpic_t * sp ;
imgname = Cmd_Argv ( 1 ) ;
name = Cmd_Argv ( 2 ) ;
x = atoi ( Cmd_Argv ( 3 ) ) ;
y = atoi ( Cmd_Argv ( 4 ) ) ;
2015-06-14 09:34:55 +00:00
zone = SCR_ShowPic_MapZone ( Cmd_Argv ( 5 ) ) ;
2005-01-13 16:29:20 +00:00
2014-03-30 08:55:06 +00:00
w = atoi ( Cmd_Argv ( 6 ) ) ;
h = atoi ( Cmd_Argv ( 7 ) ) ;
tcommand = Cmd_Argv ( 8 ) ;
2005-01-13 16:29:20 +00:00
sp = SCR_ShowPic_Find ( name ) ;
Z_Free ( sp - > picname ) ;
2014-03-30 08:55:06 +00:00
Z_Free ( sp - > tcommand ) ;
sp - > picname = Z_StrDup ( imgname ) ;
sp - > tcommand = Z_StrDup ( tcommand ) ;
2005-01-13 16:29:20 +00:00
sp - > zone = zone ;
sp - > x = x ;
sp - > y = y ;
2014-03-30 08:55:06 +00:00
sp - > w = w ;
sp - > h = h ;
if ( ! sp - > persist )
sp - > persist = ! Cmd_FromGamecode ( ) ;
2005-01-13 16:29:20 +00:00
}
2015-06-14 09:34:55 +00:00
void SCR_ShowPic_Remove_f ( void )
{
2016-10-22 07:06:51 +00:00
SCR_ShowPic_ClearAll ( ! Cmd_FromGamecode ( ) ) ;
2015-06-14 09:34:55 +00:00
}
2004-08-23 00:15:46 +00:00
//=============================================================================
2015-04-21 04:12:00 +00:00
void QDECL SCR_Fov_Callback ( struct cvar_s * var , char * oldvalue )
2006-04-15 06:57:13 +00:00
{
if ( var - > value < 10 )
2015-07-03 02:07:41 +00:00
Cvar_ForceSet ( var , " 10 " ) ;
//highs are capped elsewhere. this allows fisheye to use this cvar automatically.
2006-04-15 06:57:13 +00:00
}
2015-04-21 04:12:00 +00:00
void QDECL SCR_Viewsize_Callback ( struct cvar_s * var , char * oldvalue )
2006-04-15 06:57:13 +00:00
{
if ( var - > value < 30 )
{
Cvar_ForceSet ( var , " 30 " ) ;
return ;
}
if ( var - > value > 120 )
{
Cvar_ForceSet ( var , " 120 " ) ;
return ;
}
}
2015-04-21 04:12:00 +00:00
void QDECL CL_Sbar_Callback ( struct cvar_s * var , char * oldvalue )
2006-04-15 06:57:13 +00:00
{
}
2013-08-27 13:18:09 +00:00
void SCR_CrosshairPosition ( playerview_t * pview , float * x , float * 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 ;
2017-01-29 13:10:53 +00:00
cl . worldmodel - > funcs . NativeTrace ( cl . worldmodel , 0 , NULLFRAMESTATE , NULL , start , end , vec3_origin , vec3_origin , false , MASK_WORLDSOLID , & tr ) ;
2005-01-28 04:20:50 +00:00
start [ 2 ] - = 16 ;
2014-08-15 02:20:41 +00:00
if ( tr . fraction ! = 1 )
2004-10-10 06:32:29 +00:00
{
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 ) ;
2014-08-15 02:20:41 +00:00
* x = rect . x + rect . width * end [ 0 ] + cl_crossx . value ;
* y = rect . y + rect . height * ( 1 - end [ 1 ] ) + cl_crossy . value ;
2004-10-10 06:32:29 +00:00
return ;
}
}
2014-08-15 02:20:41 +00:00
* x = rect . x + rect . width / 2 + cl_crossx . value ;
* y = rect . y + rect . height / 2 + cl_crossy . value ;
2004-10-10 06:32:29 +00:00
}
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
}
//============================================================================
2018-11-27 16:48:19 +00:00
void SCR_StringXY ( const char * str , float x , float y )
2017-12-15 06:56:40 +00:00
{
2018-11-27 16:48:19 +00:00
const char * s2 ;
2017-12-15 06:56:40 +00:00
int px , py ;
unsigned int codepoint ;
int error ;
Font_BeginString ( font_default , ( ( x < 0 ) ? vid . width : x ) , ( ( y < 0 ) ? vid . height - sb_lines : y ) , & px , & py ) ;
if ( x < 0 )
{
for ( s2 = str ; * s2 ; )
{
codepoint = unicode_decode ( & error , s2 , & s2 , true ) ;
px - = Font_CharWidth ( CON_WHITEMASK , codepoint ) ;
}
}
if ( y < 0 )
py + = y * Font_CharHeight ( ) ;
while ( * str )
{
codepoint = unicode_decode ( & error , str , & str , true ) ;
px = Font_DrawChar ( px , py , CON_WHITEMASK , codepoint ) ;
}
Font_EndString ( font_default ) ;
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = =
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
}
2014-10-05 20:04:11 +00:00
void SCR_DrawDisk ( void )
{
2017-12-15 06:56:40 +00:00
extern float fs_accessed_time ;
if ( ( float ) realtime - fs_accessed_time > scr_diskicontimeout . value )
return ;
if ( ! draw_disc | | ! scr_showdisk . ival )
2014-10-05 20:04:11 +00:00
return ;
2017-12-15 06:56:40 +00:00
if ( ! R_GetShaderSizes ( draw_disc , NULL , NULL , true ) )
SCR_StringXY ( " FS " , scr_showdisk_x . value , scr_showdisk_y . value ) ;
else
R2D_ScalePic ( scr_showdisk_x . value + ( scr_showdisk_x . value < 0 ? vid . width : 0 ) , scr_showdisk_y . value + ( scr_showdisk_y . value < 0 ? vid . height : 0 ) , 24 , 24 , draw_disc ) ;
2014-10-05 20:04:11 +00:00
}
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
}
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 ;
2016-12-13 11:50:15 +00:00
static double deviationtimes [ 64 ] ;
2009-11-04 21:16:50 +00:00
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 )
{
2017-11-05 13:15:08 +00:00
case 1 :
default :
break ;
2006-05-19 19:54:03 +00:00
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
}
2005-01-23 17:49:42 +00:00
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 ) ;
2016-09-01 14:31:24 +00:00
if ( show_clock . ival = = 2 )
strftime ( str , sizeof ( str ) - 1 , " %I:%M %p " , newtime ) ;
else
strftime ( str , sizeof ( str ) - 1 , " %H:%M " , newtime ) ;
2005-01-23 17:49:42 +00:00
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 )
{
2015-09-01 04:45:15 +00:00
# ifdef QUAKESTATS
2006-03-06 01:41:09 +00:00
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 )
2018-07-05 16:21:44 +00:00
timelimit = 60 * atof ( InfoBuf_ValueForKey ( & cl . serverinfo , " timelimit " ) ) ;
2006-03-06 01:41:09 +00:00
else
timelimit = 0 ;
2015-06-14 01:28:01 +00:00
if ( cl . matchstate = = MATCH_STANDBY )
showtime = cl . servertime ;
else if ( cl . playerview [ 0 ] . statsf [ STAT_MATCHSTARTTIME ] )
2015-07-04 02:04:46 +00:00
showtime = timelimit - ( cl . servertime - cl . playerview [ 0 ] . statsf [ STAT_MATCHSTARTTIME ] / 1000 ) ;
2015-06-14 01:28:01 +00:00
else
showtime = timelimit - ( cl . servertime - cl . matchgametimestart ) ;
2006-03-06 01:41:09 +00:00
if ( showtime < 0 )
showtime * = - 1 ;
2015-06-14 01:28:01 +00:00
minutes = showtime / 60 ;
seconds = ( int ) showtime - ( minutes * 60 ) ;
2017-02-11 16:14:06 +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 ) ;
2015-09-01 04:45:15 +00:00
# endif
2006-03-06 01:41:09 +00:00
}
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 ;
2016-08-25 00:12:14 +00:00
# ifndef CLIENTONLY
if ( sv . active & & sv . paused = = PAUSE_AUTO )
return ;
# endif
2015-07-14 14:47:00 +00:00
if ( Key_Dest_Has ( kdm_emenu ) | | Key_Dest_Has ( kdm_gmenu ) )
2010-08-16 02:03:02 +00:00
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 ;
2017-04-18 11:12:17 +00:00
scr_disabled_for_loading = scr_drawloading = false ;
2012-05-09 15:30:53 +00:00
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 :
2013-03-12 22:35:33 +00:00
SCR_SetLoadingFile ( " starting server... " ) ;
2012-05-09 15:30:53 +00:00
break ;
case LS_CLIENT :
2014-08-27 08:41:31 +00:00
SCR_SetLoadingFile ( " receiving map info " ) ;
2012-05-09 15:30:53 +00:00
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 )
{
2014-10-05 20:04:11 +00:00
if ( loadingfile & & ! strcmp ( loadingfile , str ) )
return ;
2012-05-09 15:30:53 +00:00
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
2014-03-30 00:39:37 +00:00
void SCR_DrawLoading ( qboolean opaque )
2004-08-23 00:15:46 +00:00
{
2014-10-05 20:04:11 +00:00
int sizex , x , y , w , h ;
2004-12-24 08:45:56 +00:00
mpic_t * pic ;
2009-04-06 00:34:32 +00:00
char * s ;
2014-12-11 16:26:26 +00:00
if ( CSQC_UseGamecodeLoadingScreen ( ) )
2017-01-24 10:27:39 +00:00
return ; //will be drawn as part of the regular screen updates
# ifdef MENU_DAT
if ( MP_UsingGamecodeLoadingScreen ( ) )
2017-01-24 20:15:14 +00:00
{
if ( opaque )
MP_Draw ( ) ;
2017-01-24 10:27:39 +00:00
return ; //menuqc should have just drawn whatever overlays it wanted.
2017-01-24 20:15:14 +00:00
}
2017-01-24 10:27:39 +00:00
# endif
2018-05-21 13:47:53 +00:00
# ifdef MENU_NATIVECODE
if ( mn_entry & & mn_entry - > DrawLoading )
{
2018-06-02 08:55:57 +00:00
mn_entry - > DrawLoading ( host_frametime ) ;
2018-05-21 13:47:53 +00:00
return ;
}
# endif
2014-12-11 16:26:26 +00:00
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 ) ;
2017-11-05 13:15:08 +00:00
if ( ! R_GetShaderSizes ( pic , & w , & h , true ) )
w = h = 1 ;
R2D_Letterbox ( 0 , 0 , vid . width , vid . height , pic , w , h ) ;
2012-02-27 12:23:15 +00:00
}
2014-03-30 00:39:37 +00:00
else if ( opaque )
2017-11-05 13:15:08 +00:00
{
R2D_ImageColours ( 0 , 0 , 0 , 1 ) ;
R2D_FillBlock ( 0 , 0 , vid . width , vid . height ) ;
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
2014-03-30 00:39:37 +00:00
R2D_ConsoleBackground ( 0 , vid . height , true ) ;
2017-11-05 13:15:08 +00:00
}
2012-02-27 12:23:15 +00:00
2015-07-31 13:23:32 +00:00
if ( scr_showloading . ival )
{
2017-11-05 13:15:08 +00:00
char * qname = scr_loadingscreen_picture . string ;
2009-04-06 00:34:32 +00:00
2017-11-05 13:15:08 +00:00
# ifdef HEXEN2
int qdepth = COM_FDepthFile ( qname , true ) ;
int h2depth = COM_FDepthFile ( " gfx/menu/loading.lmp " , true ) ;
2017-11-23 07:46:39 +00:00
if ( ! ( qdepth < h2depth | | h2depth > FDEPTH_MISSING ) )
2017-11-05 13:15:08 +00:00
{ //hexen2 files.
//hexen2 has some fancy sliders built into its graphics in specific places. so this is messy.
pic = R2D_SafeCachePic ( " gfx/menu/loading.lmp " ) ;
if ( R_GetShaderSizes ( pic , & w , & h , true ) )
{
int size , count , offset ;
if ( ! scr_drawloading & & loading_stage = = 0 )
return ;
offset = ( vid . width - w ) / 2 ;
R2D_ScalePic ( offset , 0 , w , h , pic ) ;
if ( loading_stage = = LS_NONE )
return ;
if ( total_loading_size )
size = current_loading_size * 106 / total_loading_size ;
else
size = 0 ;
if ( loading_stage = = LS_CLIENT )
count = size ;
else
count = 106 ;
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 ) ;
2006-05-07 07:17:34 +00:00
2017-11-05 13:15:08 +00:00
if ( loading_stage = = LS_SERVER )
count = size ;
else
count = 0 ;
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 ) ;
y = 104 ;
}
}
else
# endif
{ //quake files
pic = R2D_SafeCachePic ( qname ) ;
2015-07-31 13:23:32 +00:00
if ( R_GetShaderSizes ( pic , & w , & h , true ) )
2006-05-07 07:17:34 +00:00
{
2017-11-05 13:15:08 +00:00
float f = 1 ;
w * = scr_loadingscreen_scale . value ;
h * = scr_loadingscreen_scale . value ;
switch ( scr_loadingscreen_scale_limit . ival )
{
default :
break ;
case 1 :
f = max ( w / vid . width , h / vid . height ) ;
break ;
case 2 :
f = min ( w / vid . width , h / vid . height ) ;
break ;
case 3 :
f = w / vid . width ;
break ;
case 4 :
f = h / vid . height ;
break ;
}
if ( f > 1 )
{
w / = f ;
h / = f ;
}
x = ( ( int ) vid . width - w ) / 2 ;
y = ( ( int ) vid . height - 48 - h ) / 2 ;
2015-07-31 13:23:32 +00:00
R2D_ScalePic ( x , y , w , h , pic ) ;
x = ( vid . width / 2 ) - 96 ;
y + = h + 8 ;
2017-11-05 13:15:08 +00:00
//make sure our loading crap will be displayed.
if ( y > vid . height - 32 )
y = vid . height - 32 ;
2006-05-07 07:17:34 +00:00
}
else
{
2015-07-31 13:23:32 +00:00
x = ( vid . width / 2 ) - 96 ;
y = ( vid . height / 2 ) - 8 ;
Draw_FunString ( ( vid . width - 7 * 8 ) / 2 , y - 16 , " Loading " ) ;
2006-05-07 07:17:34 +00:00
}
2015-07-31 13:23:32 +00:00
if ( ! total_loading_size )
total_loading_size = 1 ;
if ( loading_stage > LS_CONNECTION )
{
sizex = current_loading_size * 192 / total_loading_size ;
if ( loading_stage = = LS_SERVER )
{
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 ) ;
}
else
{
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 ) ;
}
2015-12-12 19:25:15 +00:00
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
2015-07-31 13:23:32 +00:00
Draw_FunString ( x + 8 , y + 4 , va ( " Loading %s... %i%% " ,
( loading_stage = = LS_SERVER ) ? " server " : " client " ,
current_loading_size * 100 / total_loading_size ) ) ;
}
y + = 16 ;
2012-05-09 15:30:53 +00:00
2015-07-31 13:23:32 +00:00
if ( loadingfile )
{
Draw_FunString ( x + 8 , y + 4 , loadingfile ) ;
2017-11-05 13:15:08 +00:00
y + = 16 ;
2015-07-31 13:23:32 +00:00
}
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
2014-06-12 23:08:42 +00:00
if ( cl . downloadlist | | cls . download )
2009-04-06 00:34:32 +00:00
{
unsigned int fcount ;
2014-06-12 23:08:42 +00:00
qofs_t tsize ;
2009-04-06 00:34:32 +00:00
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?
2014-06-12 23:08:42 +00:00
if ( cls . download )
2010-11-26 06:58:48 +00:00
Draw_FunString ( x + 8 , y + 4 , va ( " Downloading %s... %i%% " ,
2014-06-12 23:08:42 +00:00
cls . download - > localname ,
( int ) cls . download - > percent ) ) ;
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 ) ,
2014-08-15 02:20:41 +00:00
( unsigned int ) ( tsize / ( 1024 * 1024 ) ) ,
2009-04-06 00:34:32 +00:00
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 ) ,
2014-08-15 02:20:41 +00:00
( unsigned int ) ( tsize / 1024 ) ,
2009-04-06 00:34:32 +00:00
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
2017-01-24 20:15:14 +00:00
if ( ! scr_disabled_for_loading )
{
Sbar_Changed ( ) ;
scr_drawloading = true ;
SCR_UpdateScreen ( ) ;
scr_drawloading = false ;
scr_disabled_for_loading = true ;
}
2004-08-23 00:15:46 +00:00
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
}
2016-01-18 05:22:07 +00:00
void SCR_ImageName ( const char * mapname )
2004-08-23 00:15:46 +00:00
{
2018-09-29 17:31:58 +00:00
//assume levelshots/foo
2004-08-23 00:15:46 +00:00
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
2015-08-04 15:16:24 +00:00
if ( qrenderer )
2004-08-23 00:15:46 +00:00
{
2015-10-27 15:20:15 +00:00
R_LoadHiResTexture ( levelshotname , NULL , IF_NOWORKER | IF_UIPIC | IF_NOPICMIP | IF_NOMIPMAP | IF_CLAMP ) ;
2014-10-05 20:04:11 +00:00
if ( ! R_GetShaderSizes ( R2D_SafeCachePic ( levelshotname ) , NULL , NULL , true ) )
2004-08-23 00:15:46 +00:00
{
2018-09-29 17:31:58 +00:00
//try maps/foo
strcpy ( levelshotname , " maps/ " ) ;
COM_FileBase ( mapname , levelshotname + strlen ( levelshotname ) , sizeof ( levelshotname ) - strlen ( levelshotname ) ) ;
if ( ! R_GetShaderSizes ( R2D_SafeCachePic ( levelshotname ) , NULL , NULL , true ) )
{
* levelshotname = ' \0 ' ;
if ( scr_disabled_for_loading )
return ;
}
2004-08-23 00:15:46 +00:00
}
}
else
{
* levelshotname = ' \0 ' ;
2017-01-24 20:15:14 +00:00
if ( scr_disabled_for_loading )
return ;
2004-08-23 00:15:46 +00:00
}
2017-11-05 13:15:08 +00:00
scr_drawloading = true ;
if ( qrenderer ! = QR_NONE )
2017-01-24 20:15:14 +00:00
{
2017-11-05 13:15:08 +00:00
Sbar_Changed ( ) ;
SCR_UpdateScreen ( ) ;
2017-01-24 20:15:14 +00:00
}
2004-08-23 00:15:46 +00:00
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 ;
}
//=============================================================================
/*
= = = = = = = = = = = = = = = = = =
SCR_SetUpToDrawConsole
= = = = = = = = = = = = = = = = = =
*/
void SCR_SetUpToDrawConsole ( void )
{
2015-04-14 23:12:17 +00:00
extern int startuppending ; //true if we're downloading media or something and have not yet triggered the startup action (read: main menu or cinematic)
2018-11-19 06:37:25 +00:00
float fullscreenpercent = 1 ;
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
# ifdef ANDROID
2018-11-19 06:37:25 +00:00
//android has an onscreen imm that we don't want to obscure
fullscreenpercent = scr_consize . value ;
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
# endif
2018-11-19 06:37:25 +00:00
if ( ! con_stayhidden . ival & & ( ! Key_Dest_Has ( ~ ( kdm_console | kdm_game ) ) ) & & ( ! cl . sendprespawn & & cl . worldmodel & & cl . worldmodel - > loadstate ! = MLS_LOADED ) )
{
//force console to fullscreen if we're loading stuff (but don't necessarily force focus)
// Key_Dest_Add(kdm_console);
scr_con_target = scr_con_current = vid . height * fullscreenpercent ;
}
else if ( ! startuppending & & ! Key_Dest_Has ( kdm_emenu | kdm_gmenu ) & & ( ! Key_Dest_Has ( ~ ( ( ! con_stayhidden . ival ? kdm_console : 0 ) | kdm_game ) ) ) & & SCR_GetLoadingStage ( ) = = LS_NONE & & cls . state < ca_active & & ! Media_PlayingFullScreen ( ) & & ! CSQC_UnconnectedOkay ( false ) )
{
//go fullscreen if we're not doing anything
if ( con_curwindow & & ! cls . state & & ! scr_drawloading & & ! Key_Dest_Has ( kdm_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
{
2018-11-19 06:37:25 +00:00
Key_Dest_Add ( kdm_cwindows ) ;
scr_con_target = 0 ; // not looking at an normal 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
}
2013-06-23 02:17:02 +00:00
# ifdef VM_UI
2018-11-19 06:37:25 +00:00
else if ( UI_MenuState ( ) | | UI_OpenMenu ( ) )
scr_con_current = scr_con_target = 0 ; //force instantly hidden.
2013-06-23 02:17:02 +00:00
# endif
2018-11-19 06:37:25 +00:00
else
{
qboolean legacyfullscreen = false ;
if ( cls . state < ca_demostart )
2014-08-27 08:41:31 +00:00
{
2018-11-19 06:37:25 +00:00
if ( con_stayhidden . ival )
{ //go to the menu instead of the console.
extern int startuppending ;
if ( ! scr_drawloading & & SCR_GetLoadingStage ( ) = = LS_NONE )
2014-08-27 08:41:31 +00:00
{
2018-11-19 06:37:25 +00:00
if ( CL_TryingToConnect ( ) ) //if we're trying to connect, make sure there's a loading/connecting screen showing instead of forcing the menu visible
SCR_SetLoadingStage ( LS_CONNECTION ) ;
else if ( ! Key_Dest_Has ( kdm_emenu ) & & ! startuppending ) //don't force anything until the startup stuff has been done
M_ToggleMenu_f ( ) ;
2014-08-27 08:41:31 +00:00
}
2018-11-19 06:37:25 +00:00
}
else
{ //nothing happening, make sure the console is visible or something.
if ( ! scr_drawloading )
2014-08-27 08:41:31 +00:00
Key_Dest_Add ( kdm_console ) ;
2018-11-19 06:37:25 +00:00
legacyfullscreen = true ;
2014-08-27 08:41:31 +00:00
}
}
2018-11-19 06:37:25 +00:00
if ( startuppending )
scr_con_target = 0 ; //not made any decisions yet
else if ( Key_Dest_Has ( kdm_console ) | | legacyfullscreen )
scr_con_current = scr_con_target = vid . height * fullscreenpercent ; // force instantly to fullscreen
2015-06-03 14:20:49 +00:00
else
2018-11-19 06:37:25 +00:00
scr_con_target = 0 ;
2012-07-20 01:46:05 +00:00
}
2018-10-11 10:31:23 +00:00
}
2018-11-19 06:37:25 +00:00
else if ( Key_Dest_Has ( kdm_console ) )
{
//go half-screen if we're meant to have the console visible
scr_con_target = vid . height * scr_consize . value ; // half screen
if ( scr_con_target < 32 )
scr_con_target = 32 ; //prevent total loss of console.
else if ( scr_con_target > vid . height )
scr_con_target = vid . height ;
}
else
scr_con_target = 0 ; // scroll to nothing
if ( scr_con_target < scr_con_current )
2018-10-11 10:31:23 +00:00
{
scr_con_current - = scr_conspeed . value * host_frametime * ( vid . height / 320.0f ) ;
2018-11-19 06:37:25 +00:00
if ( scr_con_target > scr_con_current )
scr_con_current = scr_con_target ;
2006-09-17 00:59:22 +00:00
2018-10-11 10:31:23 +00:00
}
2018-11-19 06:37:25 +00:00
else if ( scr_con_target > scr_con_current )
2018-10-11 10:31:23 +00:00
{
scr_con_current + = scr_conspeed . value * host_frametime * ( vid . height / 320.0f ) ;
2018-11-19 06:37:25 +00:00
if ( scr_con_target < scr_con_current )
scr_con_current = scr_con_target ;
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 )
{
2015-04-14 23:12:17 +00:00
if ( ! scr_con_current )
2004-08-23 00:15:46 +00:00
{
2015-07-14 14:47:00 +00:00
if ( ! Key_Dest_Has ( kdm_console | kdm_gmenu | kdm_emenu ) )
2004-08-23 00:15:46 +00:00
Con_DrawNotify ( ) ; // only draw notify in game
}
2016-07-12 00:40:13 +00:00
Con_DrawConsole ( scr_con_current , noback ) ;
2015-04-14 23:12:17 +00:00
if ( scr_con_current | | Key_Dest_Has ( kdm_cwindows ) )
clearconsole = 0 ;
2004-08-23 00:15:46 +00:00
}
2005-10-28 01:33:19 +00:00
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
SCREEN SHOTS
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
2004-08-23 00:15:46 +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
= = = = = = = = = = = = = = = = = =
*/
2016-02-10 23:23:43 +00:00
static void SCR_ScreenShot_f ( void )
2004-10-13 07:24:59 +00:00
{
2011-04-25 13:48:30 +00:00
char sysname [ 1024 ] ;
2014-04-12 03:31:59 +00:00
char pcxname [ MAX_QPATH ] ;
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 ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
int stride , width , height ;
2015-08-14 02:55:59 +00:00
enum uploadfmt fmt ;
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
{
2014-04-12 03:31:59 +00:00
int stop = 1000 ;
char date [ MAX_QPATH ] ;
time_t tm = time ( NULL ) ;
strftime ( date , sizeof ( date ) , " %Y%m%d%H%M%S " , localtime ( & tm ) ) ;
2005-10-28 01:33:19 +00:00
//
// find a file name to save it to
//
2014-04-12 03:31:59 +00:00
for ( i = 0 ; i < stop ; i + + )
2004-10-13 07:24:59 +00:00
{
2016-02-10 23:23:43 +00:00
Q_snprintfz ( pcxname , sizeof ( pcxname ) , " %s%s-%i.%s " , scr_sshot_prefix . string , date , i , scr_sshot_type . string ) ;
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
}
2014-04-12 03:31:59 +00:00
if ( i = = stop )
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 ) ) ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
rgbbuffer = VID_GetRGBInfo ( & stride , & width , & height , & fmt ) ;
2012-11-27 03:23:19 +00:00
if ( rgbbuffer )
{
2018-11-19 06:37:25 +00:00
//regarding metadata - we don't really know what's on the screen, so don't write something that may be wrong (eg: if there's only a console, don't claim that its a 360 image)
if ( SCR_ScreenShot ( pcxname , FS_GAMEONLY , & rgbbuffer , 1 , stride , width , height , fmt , false ) )
2012-11-27 03:23:19 +00:00
{
Con_Printf ( " Wrote %s \n " , sysname ) ;
BZ_Free ( rgbbuffer ) ;
return ;
}
BZ_Free ( rgbbuffer ) ;
}
2016-08-25 00:12:14 +00:00
Con_Printf ( CON_ERROR " Couldn't write %s \n " , sysname ) ;
2005-10-28 01:33:19 +00:00
}
2004-08-23 00:15:46 +00:00
2018-11-19 06:37:25 +00:00
void * SCR_ScreenShot_Capture ( int fbwidth , int fbheight , int * stride , enum uploadfmt * fmt , qboolean no2d )
2015-02-02 08:01:53 +00:00
{
2016-02-10 23:23:43 +00:00
int width , height ;
void * buf ;
qboolean okay = false ;
Q_strncpyz ( r_refdef . rt_destcolour [ 0 ] . texname , " megascreeny " , sizeof ( r_refdef . rt_destcolour [ 0 ] . texname ) ) ;
2016-10-22 07:06:51 +00:00
R2D_RT_Configure ( r_refdef . rt_destcolour [ 0 ] . texname , fbwidth , fbheight , 1 , RT_IMAGEFLAGS ) ;
2016-02-10 23:23:43 +00:00
BE_RenderToTextureUpdate2d ( true ) ;
R2D_FillBlock ( 0 , 0 , vid . fbvwidth , vid . fbvheight ) ;
# ifdef VM_CG
if ( ! okay & & CG_Refresh ( ) )
okay = true ;
# endif
# ifdef CSQC_DAT
if ( ! okay & & CSQC_DrawView ( ) )
okay = true ;
// if (!*r_refdef.rt_destcolour[0].texname)
{ //csqc protects its own. lazily.
Q_strncpyz ( r_refdef . rt_destcolour [ 0 ] . texname , " megascreeny " , sizeof ( r_refdef . rt_destcolour [ 0 ] . texname ) ) ;
BE_RenderToTextureUpdate2d ( true ) ;
}
# endif
if ( ! okay & & r_worldentity . model )
{
2018-11-19 06:37:25 +00:00
V_RenderView ( no2d ) ;
2016-02-10 23:23:43 +00:00
okay = true ;
}
//fixme: add a way to get+save the depth values too
if ( ! okay )
{
buf = NULL ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
* stride = width = height = 0 ;
2016-02-10 23:23:43 +00:00
* fmt = TF_INVALID ;
}
else
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
buf = VID_GetRGBInfo ( stride , & width , & height , fmt ) ;
2016-02-10 23:23:43 +00:00
2016-10-22 07:06:51 +00:00
R2D_RT_Configure ( r_refdef . rt_destcolour [ 0 ] . texname , 0 , 0 , 0 , RT_IMAGEFLAGS ) ;
2016-02-10 23:23:43 +00:00
Q_strncpyz ( r_refdef . rt_destcolour [ 0 ] . texname , " " , sizeof ( r_refdef . rt_destcolour [ 0 ] . texname ) ) ;
BE_RenderToTextureUpdate2d ( true ) ;
2016-02-15 06:01:17 +00:00
if ( ! buf | | width ! = fbwidth | | height ! = fbheight )
2016-02-10 23:23:43 +00:00
{
2016-02-15 06:01:17 +00:00
* fmt = TF_INVALID ;
2016-02-10 23:23:43 +00:00
BZ_Free ( buf ) ;
return NULL ;
}
return buf ;
}
static void SCR_ScreenShot_Mega_f ( void )
{
2018-11-19 06:37:25 +00:00
extern cvar_t r_projection ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
int stride [ 2 ] ;
2016-02-10 23:23:43 +00:00
int width [ 2 ] ;
int height [ 2 ] ;
void * buffers [ 2 ] ;
enum uploadfmt fmt [ 2 ] ;
int numbuffers = 0 ;
int buf ;
2015-02-02 08:01:53 +00:00
char filename [ MAX_QPATH ] ;
2016-02-10 23:23:43 +00:00
stereomethod_t osm = r_refdef . stereomethod ;
2018-11-19 06:37:25 +00:00
int projection = r_projection . ival ;
2015-02-02 08:01:53 +00:00
2016-02-10 23:23:43 +00:00
//massage the rendering code to redraw the screen with an fbo forced.
//this allows us to generate screenshots which are not otherwise possible to actually draw.
//this includes larger resolutions (although the lack of stiching leaves us subject to gpu limits of about 16k)
2015-02-02 08:01:53 +00:00
char * screenyname = Cmd_Argv ( 1 ) ;
unsigned int fbwidth = strtoul ( Cmd_Argv ( 2 ) , NULL , 0 ) ;
unsigned int fbheight = strtoul ( Cmd_Argv ( 3 ) , NULL , 0 ) ;
2016-02-10 23:23:43 +00:00
char ext [ 8 ] ;
2015-02-02 08:01:53 +00:00
2015-04-14 23:12:17 +00:00
if ( Cmd_IsInsecure ( ) )
return ;
2015-02-02 08:01:53 +00:00
if ( qrenderer < = QR_HEADLESS )
{
Con_Printf ( " No renderer active \n " ) ;
return ;
}
if ( ! fbwidth )
2017-12-28 16:24:50 +00:00
fbwidth = sh_config . texture2d_maxsize ;
fbwidth = bound ( 1 , fbwidth , sh_config . texture2d_maxsize ) ;
2015-02-02 08:01:53 +00:00
if ( ! fbheight )
fbheight = ( fbwidth * 3 ) / 4 ;
2017-12-28 16:24:50 +00:00
fbheight = bound ( 1 , fbheight , sh_config . texture2d_maxsize ) ;
2016-02-10 23:23:43 +00:00
if ( strstr ( screenyname , " .. " ) | | strchr ( screenyname , ' : ' ) | | * screenyname = = ' . ' | | * screenyname = = ' / ' )
screenyname = " " ;
2015-02-02 08:01:53 +00:00
if ( ! * screenyname )
2016-02-10 23:23:43 +00:00
{
2015-02-02 08:01:53 +00:00
screenyname = " megascreeny " ;
2016-02-10 23:23:43 +00:00
Q_snprintfz ( filename , sizeof ( filename ) , " %s%s " , scr_sshot_prefix . string , screenyname ) ;
}
else
{
char * mangle ;
Q_snprintfz ( filename , sizeof ( filename ) , " %s " , scr_sshot_prefix . string ) ;
mangle = COM_SkipPath ( filename ) ;
Q_snprintfz ( mangle , sizeof ( filename ) - ( mangle - filename ) , " %s " , screenyname ) ;
}
2018-11-19 06:37:25 +00:00
if ( ! strcmp ( Cmd_Argv ( 0 ) , " screenshot_360 " ) )
r_projection . ival = PROJ_EQUIRECTANGULAR ;
2016-02-10 23:23:43 +00:00
if ( ! strcmp ( Cmd_Argv ( 0 ) , " screenshot_stereo " ) )
2018-11-19 06:37:25 +00:00
COM_DefaultExtension ( filename , " png " , sizeof ( filename ) ) ; //png/pns is the only format that can really cope with this right now.
2016-02-10 23:23:43 +00:00
else
COM_DefaultExtension ( filename , scr_sshot_type . string , sizeof ( filename ) ) ;
2015-02-02 08:01:53 +00:00
2016-02-10 23:23:43 +00:00
COM_FileExtension ( filename , ext , sizeof ( ext ) ) ;
if ( ! strcmp ( Cmd_Argv ( 0 ) , " screenshot_stereo " ) | | ! strcmp ( ext , " pns " ) | | osm = = STEREO_QUAD )
numbuffers = 2 ; //stereo png
else
numbuffers = 1 ;
2015-02-02 08:01:53 +00:00
2016-02-10 23:23:43 +00:00
if ( numbuffers = = 2 & & Q_strcasecmp ( ext , " png " ) & & Q_strcasecmp ( ext , " pns " ) )
{
Con_Printf ( " Only png format is supported for stereo screenshots \n " ) ;
return ;
}
2015-02-02 08:01:53 +00:00
2016-02-10 23:23:43 +00:00
for ( buf = 0 ; buf < numbuffers ; buf + + )
{
if ( numbuffers = = 2 )
{
if ( buf )
r_refdef . stereomethod = STEREO_RIGHTONLY ;
else
r_refdef . stereomethod = STEREO_LEFTONLY ;
}
2015-02-02 08:01:53 +00:00
2018-11-19 06:37:25 +00:00
buffers [ buf ] = SCR_ScreenShot_Capture ( fbwidth , fbheight , & stride [ buf ] , & fmt [ buf ] , false ) ;
2016-07-12 00:40:13 +00:00
width [ buf ] = fbwidth ;
height [ buf ] = fbheight ;
2016-02-10 23:23:43 +00:00
if ( width [ buf ] ! = width [ 0 ] | | height [ buf ] ! = height [ 0 ] | | fmt [ buf ] ! = fmt [ 0 ] )
{ //invalid is better than unmatched.
BZ_Free ( buffers [ buf ] ) ;
buffers [ buf ] = NULL ;
}
2016-01-18 05:22:07 +00:00
}
2016-02-10 23:23:43 +00:00
if ( numbuffers = = 2 & & ! buffers [ 1 ] )
numbuffers = 1 ;
//okay, we drew something, we're good to save a screeny.
if ( buffers [ 0 ] )
2015-02-02 08:01:53 +00:00
{
2018-11-19 06:37:25 +00:00
if ( SCR_ScreenShot ( filename , FS_GAMEONLY , buffers , numbuffers , stride [ 0 ] , width [ 0 ] , height [ 0 ] , fmt [ 0 ] , true ) )
2016-02-10 23:23:43 +00:00
{
char sysname [ 1024 ] ;
FS_NativePath ( filename , FS_GAMEONLY , sysname , sizeof ( sysname ) ) ;
Con_Printf ( " Wrote %s \n " , sysname ) ;
}
2015-02-02 08:01:53 +00:00
}
2016-02-10 23:23:43 +00:00
else
Con_Printf ( " Unable to capture screenshot \n " ) ;
2015-02-02 08:01:53 +00:00
2016-02-10 23:23:43 +00:00
for ( buf = 0 ; buf < numbuffers ; buf + + )
BZ_Free ( buffers [ buf ] ) ;
r_refdef . stereomethod = osm ;
2018-11-19 06:37:25 +00:00
r_projection . ival = projection ;
2016-02-10 23:23:43 +00:00
}
static void SCR_ScreenShot_VR_f ( void )
{
char * screenyname = Cmd_Argv ( 1 ) ;
2018-11-19 06:37:25 +00:00
const char * ext ;
2016-02-10 23:23:43 +00:00
int width = atoi ( Cmd_Argv ( 2 ) ) ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
int stride = 0 ;
2016-02-10 23:23:43 +00:00
//we spin the camera around, taking slices from equirectangular screenshots
char filename [ MAX_QPATH ] ;
int height ; //equirectangular 360 * 180 gives a nice clean ratio
int px = 4 ;
int step = atof ( Cmd_Argv ( 3 ) ) ;
2018-11-19 06:37:25 +00:00
void * buffer [ 2 ] , * buf ;
2016-02-10 23:23:43 +00:00
enum uploadfmt fmt ;
int lx , rx , x , y ;
vec3_t baseang ;
float ang ;
2016-02-15 06:01:17 +00:00
qboolean fail = false ;
2018-11-19 06:37:25 +00:00
extern cvar_t r_projection , r_stereo_separation , r_stereo_convergence ;
qboolean stereo ;
2016-02-10 23:23:43 +00:00
VectorCopy ( r_refdef . viewangles , baseang ) ;
if ( width < = 2 )
width = 2048 ;
2017-12-28 16:24:50 +00:00
if ( width > sh_config . texture2d_maxsize )
width = sh_config . texture2d_maxsize ;
2016-02-10 23:23:43 +00:00
height = width / 2 ;
if ( step < = 0 )
step = 5 ;
2018-11-19 06:37:25 +00:00
buffer [ 0 ] = BZF_Malloc ( width * height * 2 * px ) ;
buffer [ 1 ] = ( qbyte * ) buffer [ 0 ] + width * height * px ;
2016-02-10 23:23:43 +00:00
if ( strstr ( screenyname , " .. " ) | | strchr ( screenyname , ' : ' ) | | * screenyname = = ' . ' | | * screenyname = = ' / ' )
screenyname = " " ;
if ( ! * screenyname )
{
screenyname = " vr " ;
Q_snprintfz ( filename , sizeof ( filename ) , " %s%s " , scr_sshot_prefix . string , screenyname ) ;
}
else
{
char * mangle ;
Q_snprintfz ( filename , sizeof ( filename ) , " %s " , scr_sshot_prefix . string ) ;
mangle = COM_SkipPath ( filename ) ;
Q_snprintfz ( mangle , sizeof ( filename ) - ( mangle - filename ) , " %s " , screenyname ) ;
}
COM_DefaultExtension ( filename , scr_sshot_type . string , sizeof ( filename ) ) ;
2018-11-19 06:37:25 +00:00
ext = COM_GetFileExtension ( filename , NULL ) ;
stereo = ! strcasecmp ( ext , " .pns " ) | | ! strcasecmp ( ext , " .jns " ) ;
2016-02-10 23:23:43 +00:00
2018-11-19 06:37:25 +00:00
if ( ! buffer [ 0 ] )
2016-02-10 23:23:43 +00:00
{
Con_Printf ( " out of memory \n " ) ;
return ;
}
r_projection . ival = PROJ_EQUIRECTANGULAR ;
for ( lx = 0 ; lx < width ; lx = rx )
2015-02-02 08:01:53 +00:00
{
2016-02-10 23:23:43 +00:00
rx = lx + step ;
if ( rx > width )
rx = width ;
r_refdef . stereomethod = STEREO_OFF ;
cl . playerview - > simangles [ 0 ] = 0 ; //pitch is BAD
2016-02-15 06:01:17 +00:00
cl . playerview - > simangles [ 1 ] = baseang [ 1 ] + r_stereo_convergence . value * 0.5 ;
2016-02-10 23:23:43 +00:00
cl . playerview - > simangles [ 2 ] = 0 ; //roll is BAD
VectorCopy ( cl . playerview - > simangles , cl . playerview - > viewangles ) ;
//FIXME: it should be possible to do this more inteligently, and get both strips with a single render.
2017-10-12 12:02:25 +00:00
//FIXME: we should render to a PBO instead, so that the gpu+cpu don't need to sync until the very end.
//FIXME: we should be using scissoring to avoid redrawing the entire screen (also tweak cull planes)
2016-02-10 23:23:43 +00:00
ang = M_PI * 2 * ( baseang [ 1 ] / 360.0 + ( lx + 0.5 * ( rx - lx ) ) / width ) ;
r_refdef . eyeoffset [ 0 ] = sin ( ang ) * r_stereo_separation . value * 0.5 ;
r_refdef . eyeoffset [ 1 ] = cos ( ang ) * r_stereo_separation . value * 0.5 ;
r_refdef . eyeoffset [ 2 ] = 0 ;
2018-11-19 06:37:25 +00:00
buf = SCR_ScreenShot_Capture ( width , height , & stride , & fmt , true ) ;
2016-02-15 06:01:17 +00:00
switch ( fmt )
2015-02-02 08:01:53 +00:00
{
2016-02-15 06:01:17 +00:00
case TF_BGRA32 :
for ( y = 0 ; y < height ; y + + )
for ( x = lx ; x < rx ; x + + )
2018-11-19 06:37:25 +00:00
( ( unsigned int * ) buffer [ 0 ] ) [ y * width + x ] = ( ( unsigned int * ) buf ) [ y * width + x ] ;
2016-02-15 06:01:17 +00:00
break ;
case TF_RGB24 :
2016-02-10 23:23:43 +00:00
for ( y = 0 ; y < height ; y + + )
for ( x = lx ; x < rx ; x + + )
2016-02-15 06:01:17 +00:00
{
2018-11-19 06:37:25 +00:00
( ( qbyte * ) buffer [ 0 ] ) [ ( y * width + x ) * 4 + 0 ] = ( ( qbyte * ) buf ) [ ( y * width + x ) * 3 + 2 ] ;
( ( qbyte * ) buffer [ 0 ] ) [ ( y * width + x ) * 4 + 1 ] = ( ( qbyte * ) buf ) [ ( y * width + x ) * 3 + 1 ] ;
( ( qbyte * ) buffer [ 0 ] ) [ ( y * width + x ) * 4 + 2 ] = ( ( qbyte * ) buf ) [ ( y * width + x ) * 3 + 0 ] ;
( ( qbyte * ) buffer [ 0 ] ) [ ( y * width + x ) * 4 + 3 ] = 255 ;
2016-02-15 06:01:17 +00:00
}
break ;
default :
fail = true ;
break ;
2016-02-10 23:23:43 +00:00
}
BZ_Free ( buf ) ;
2016-02-15 06:01:17 +00:00
cl . playerview - > simangles [ 0 ] = 0 ; //pitch is BAD
cl . playerview - > simangles [ 1 ] = baseang [ 1 ] - r_stereo_convergence . value * 0.5 ;
cl . playerview - > simangles [ 2 ] = 0 ; //roll is BAD
VectorCopy ( cl . playerview - > simangles , cl . playerview - > viewangles ) ;
2016-02-10 23:23:43 +00:00
r_refdef . eyeoffset [ 0 ] * = - 1 ;
r_refdef . eyeoffset [ 1 ] * = - 1 ;
r_refdef . eyeoffset [ 2 ] = 0 ;
2018-11-19 06:37:25 +00:00
buf = SCR_ScreenShot_Capture ( width , height , & stride , & fmt , true ) ;
2016-02-15 06:01:17 +00:00
switch ( fmt )
2016-02-10 23:23:43 +00:00
{
2016-02-15 06:01:17 +00:00
case TF_BGRA32 :
for ( y = 0 ; y < height ; y + + )
for ( x = lx ; x < rx ; x + + )
2018-11-19 06:37:25 +00:00
( ( unsigned int * ) buffer ) [ y * width + x ] = ( ( unsigned int * ) buf ) [ y * width + x ] ;
2016-02-15 06:01:17 +00:00
break ;
case TF_RGB24 :
2016-02-10 23:23:43 +00:00
for ( y = 0 ; y < height ; y + + )
for ( x = lx ; x < rx ; x + + )
2016-02-15 06:01:17 +00:00
{
2018-11-19 06:37:25 +00:00
( ( qbyte * ) buffer [ 1 ] ) [ ( y * width + x ) * 4 + 0 ] = ( ( qbyte * ) buf ) [ ( y * width + x ) * 3 + 2 ] ;
( ( qbyte * ) buffer [ 1 ] ) [ ( y * width + x ) * 4 + 1 ] = ( ( qbyte * ) buf ) [ ( y * width + x ) * 3 + 1 ] ;
( ( qbyte * ) buffer [ 1 ] ) [ ( y * width + x ) * 4 + 2 ] = ( ( qbyte * ) buf ) [ ( y * width + x ) * 3 + 0 ] ;
( ( qbyte * ) buffer [ 1 ] ) [ ( y * width + x ) * 4 + 3 ] = 255 ;
2016-02-15 06:01:17 +00:00
}
break ;
default :
fail = true ;
break ;
2015-02-02 08:01:53 +00:00
}
2016-02-10 23:23:43 +00:00
BZ_Free ( buf ) ;
2015-02-02 08:01:53 +00:00
}
2016-02-15 06:01:17 +00:00
if ( fail )
Con_Printf ( " Unable to capture suitable screen image \n " ) ;
2018-11-19 06:37:25 +00:00
else if ( SCR_ScreenShot ( filename , FS_GAMEONLY , buffer , ( stereo ? 2 : 1 ) , stride , width , height * ( stereo ? 1 : 2 ) , TF_BGRX32 , true ) )
2016-02-10 23:23:43 +00:00
{
char sysname [ 1024 ] ;
FS_NativePath ( filename , FS_GAMEONLY , sysname , sizeof ( sysname ) ) ;
Con_Printf ( " Wrote %s \n " , sysname ) ;
}
2018-11-19 06:37:25 +00:00
BZ_Free ( buffer [ 0 ] ) ;
2016-02-10 23:23:43 +00:00
r_projection . ival = r_projection . value ;
VectorCopy ( baseang , r_refdef . viewangles ) ;
VectorClear ( r_refdef . eyeoffset ) ;
}
2018-11-19 06:37:25 +00:00
//flips an image so that the result is always top-down
static void * SCR_ScreenShot_FixStride ( void * buffer , unsigned int fbwidth , unsigned int fbheight , int * stride , uploadfmt_t fmt , qboolean horizontalflip , qboolean verticalflip )
{
unsigned int bb , bw , bh ;
Image_BlockSizeForEncoding ( fmt , & bb , & bw , & bh ) ;
if ( bw = = 1 & & bh = = 1 )
{
if ( horizontalflip )
{
int y , x , p ;
char * bad = buffer ;
char * in = buffer , * out ;
buffer = out = BZ_Malloc ( fbwidth * fbheight * bb ) ;
if ( * stride < 0 )
in + = fbwidth * bb * ( fbheight - 1 ) ;
for ( y = 0 ; y < fbheight ; y + + , in + = * stride , out + = fbwidth * bb )
{
for ( x = 0 ; x < fbwidth * bb ; x + = bb )
{
for ( p = 0 ; p < bb ; p + + )
out [ x + p ] = in [ ( fbwidth - 1 ) * bb - x + p ] ;
}
}
BZ_Free ( bad ) ;
* stride = fbwidth * bb ;
}
if ( verticalflip & & bh = = 1 )
* stride = - * stride ;
if ( * stride ! = fbwidth * bw )
{
unsigned int y ;
char * tofree = buffer ;
char * out = BZ_Malloc ( fbwidth * fbheight * bb ) ;
char * in = buffer ;
buffer = out ;
if ( * stride < 0 )
in + = fbwidth * bb * ( fbheight - 1 ) ; //the memory pointer always starts at the lowest address regardless of bottom-up state.
for ( y = 0 ; y < fbheight ; y + + , in + = * stride , out + = fbwidth * bb )
{
memcpy ( out , in , fbwidth * bb ) ;
}
BZ_Free ( tofree ) ;
* stride = fbwidth * bb ;
}
}
return buffer ;
}
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
void SCR_ScreenShot_Cubemap_f ( void )
2016-02-10 23:23:43 +00:00
{
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
void * buffer ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
int stride , fbwidth , fbheight ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
uploadfmt_t fmt ;
char filename [ MAX_QPATH ] ;
2018-11-19 06:37:25 +00:00
char sysname [ 1024 ] ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
char * fname = Cmd_Argv ( 1 ) ;
2017-12-09 21:22:46 +00:00
int i , firstside ;
char olddrawviewmodel [ 64 ] ; //hack, so we can set r_drawviewmodel to 0 so that it doesn't appear in screenshots even if the csqc is generating new data.
vec3_t oldangles ;
2018-11-19 06:37:25 +00:00
struct pendingtextureinfo mips ;
static const struct
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
{
vec3_t angle ;
const char * postfix ;
2017-12-09 21:22:46 +00:00
qboolean verticalflip ;
qboolean horizontalflip ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
} sides [ ] =
{
2017-12-09 21:22:46 +00:00
//standard cubemap
{ { 0 , 0 , 90 } , " _px " , true } ,
{ { 0 , 180 , - 90 } , " _nx " , true } ,
{ { 0 , 90 , 0 } , " _py " , true } , //upside down
{ { 0 , 270 , 0 } , " _ny " , false , true } ,
{ { - 90 , 0 , 90 } , " _pz " , true } ,
{ { 90 , 0 , 90 } , " _nz " , true } ,
//annoying envmap (requires processing to flip/etc the images before they can be loaded into a texture)
{ { 0 , 270 , 0 } , " _ft " } ,
{ { 0 , 90 , 0 } , " _bk " } ,
{ { 0 , 0 , 0 } , " _rt " } ,
{ { 0 , 180 , 0 } , " _lf " } ,
{ { 90 , 0 , 0 } , " _dn " } ,
{ { - 90 , 0 , 0 } , " _up " }
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
} ;
2018-11-19 06:37:25 +00:00
const char * ext ;
unsigned int bb , bw , bh ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
2017-12-09 21:22:46 +00:00
if ( ! cls . state | | ! cl . worldmodel | | cl . worldmodel - > loadstate ! = MLS_LOADED )
{
Con_Printf ( " Please start a map first \n " ) ;
return ;
}
2018-07-24 13:59:42 +00:00
firstside = ( ! strcmp ( Cmd_Argv ( 0 ) , " envmap " ) ) ? 6 : 0 ;
2017-12-09 21:22:46 +00:00
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
r_refdef . stereomethod = STEREO_OFF ;
2017-12-09 21:22:46 +00:00
Q_strncpyz ( olddrawviewmodel , r_drawviewmodel . string , sizeof ( olddrawviewmodel ) ) ;
Cvar_Set ( & r_drawviewmodel , " 0 " ) ;
VectorCopy ( cl . playerview - > viewangles , oldangles ) ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
2017-12-09 21:22:46 +00:00
fbheight = atoi ( Cmd_Argv ( 2 ) ) & ~ 1 ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
if ( fbheight < 1 )
fbheight = 512 ;
fbwidth = fbheight ;
2018-11-19 06:37:25 +00:00
ext = COM_GetFileExtension ( fname , NULL ) ;
if ( ! * fname | | ext = = fname )
{ //generate a default filename if none exists yet.
char base [ MAX_QPATH ] ;
COM_FileBase ( cl . worldmodel - > name , base , sizeof ( base ) ) ;
fname = va ( " %s/%i_%i_%i " , base , ( int ) r_refdef . vieworg [ 0 ] , ( int ) r_refdef . vieworg [ 1 ] , ( int ) r_refdef . vieworg [ 2 ] ) ;
}
if ( ! strcmp ( ext , " .ktx " ) | | ! strcmp ( ext , " .dds " ) )
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
{
2018-11-19 06:37:25 +00:00
qboolean fail = false ;
mips . type = PTI_CUBEMAP ;
mips . encoding = 0 ;
mips . extrafree = NULL ;
mips . mipcount = 6 ;
for ( i = 0 ; i < 6 ; i + + )
2017-12-09 21:22:46 +00:00
{
2018-11-19 06:37:25 +00:00
VectorCopy ( sides [ i ] . angle , cl . playerview - > simangles ) ;
VectorCopy ( cl . playerview - > simangles , cl . playerview - > viewangles ) ;
mips . mip [ i ] . data = SCR_ScreenShot_Capture ( fbwidth , fbheight , & stride , & fmt , true ) ;
if ( ! mips . mip [ i ] . data )
fail = true ;
if ( ! i )
mips . encoding = fmt ;
else if ( fmt ! = mips . encoding | | fbwidth ! = mips . mip [ 0 ] . width | | fbheight ! = mips . mip [ 0 ] . height )
fail = true ; //zomgwtfbbq
mips . mip [ i ] . data = SCR_ScreenShot_FixStride ( mips . mip [ i ] . data , fbwidth , fbheight , & stride , fmt , sides [ i ] . horizontalflip , sides [ i ] . verticalflip ) ;
Image_BlockSizeForEncoding ( fmt , & bb , & bw , & bh ) ;
mips . mip [ i ] . datasize = bb * ( ( fbwidth + bw - 1 ) / bw ) * ( ( fbheight + bh - 1 ) / bh ) ;
mips . mip [ i ] . width = fbwidth ;
mips . mip [ i ] . height = fbheight ;
mips . mip [ i ] . depth = 0 ;
mips . mip [ i ] . needfree = true ;
}
/*FIXME:
while ( ! fail & & ( w > 1 | | h > 1 ) )
{ //warning: d3d is different
w = max ( 1 , w > > 1 ) ;
h = max ( 1 , h > > 1 ) ;
if ( mips . mipcount + 6 > countof ( mips . mip ) )
break ; //erk! how big was the original image?!?
for ( i = 0 ; i < 6 ; i + + )
{
mips . mip [ mips . mipcount ] = GenerateMip ( mips . mip [ mips . mipcount - 6 ] ) ;
mips . mipcount + + ;
}
2017-12-09 21:22:46 +00:00
}
2018-11-19 06:37:25 +00:00
*/
2017-12-09 21:22:46 +00:00
2018-11-19 06:37:25 +00:00
Q_snprintfz ( filename , sizeof ( filename ) , " textures/%s " , fname ) ;
COM_DefaultExtension ( filename , ext , sizeof ( filename ) ) ;
# ifdef IMAGEFMT_KTX
COM_DefaultExtension ( filename , " .ktx " , sizeof ( filename ) ) ;
# endif
# ifdef IMAGEFMT_DDS
COM_DefaultExtension ( filename , " .dds " , sizeof ( filename ) ) ;
# endif
ext = COM_GetFileExtension ( filename , NULL ) ;
if ( fail )
Con_Printf ( " Unable to generate cubemap data \n " ) ;
# ifdef IMAGEFMT_DDS
else if ( ! strcmp ( ext , " .dds " ) )
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
{
2018-11-19 06:37:25 +00:00
if ( Image_WriteDDSFile ( filename , FS_GAMEONLY , & mips ) )
2017-12-09 21:22:46 +00:00
{
2018-11-19 06:37:25 +00:00
FS_NativePath ( filename , FS_GAMEONLY , sysname , sizeof ( sysname ) ) ;
Con_Printf ( " Wrote %s \n " , sysname ) ;
2017-12-09 21:22:46 +00:00
}
2018-11-19 06:37:25 +00:00
}
# endif
# ifdef IMAGEFMT_KTX
else if ( ! strcmp ( ext , " .ktx " ) )
{
if ( Image_WriteKTXFile ( filename , FS_GAMEONLY , & mips ) )
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
{
FS_NativePath ( filename , FS_GAMEONLY , sysname , sizeof ( sysname ) ) ;
Con_Printf ( " Wrote %s \n " , sysname ) ;
}
2018-11-19 06:37:25 +00:00
}
# endif
else
Con_Printf ( " %s: Unknown format %s \n " , Cmd_Argv ( 0 ) , filename ) ;
while ( i - - > 0 )
if ( mips . mip [ i ] . needfree )
BZ_Free ( mips . mip [ i ] . data ) ;
}
else
{
for ( i = firstside ; i < firstside + 6 ; i + + )
{
VectorCopy ( sides [ i ] . angle , cl . playerview - > simangles ) ;
VectorCopy ( cl . playerview - > simangles , cl . playerview - > viewangles ) ;
buffer = SCR_ScreenShot_Capture ( fbwidth , fbheight , & stride , & fmt , true ) ;
if ( buffer )
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
{
2018-11-19 06:37:25 +00:00
Image_BlockSizeForEncoding ( fmt , & bb , & bw , & bh ) ;
if ( sides [ i ] . horizontalflip )
{
int y , x , p ;
char * bad = buffer ;
char * in = buffer , * out ;
buffer = out = BZ_Malloc ( fbwidth * fbheight * bb ) ;
for ( y = 0 ; y < fbheight ; y + + , in + = abs ( stride ) , out + = fbwidth * bb )
{
for ( x = 0 ; x < fbwidth * bb ; x + = bb )
{
for ( p = 0 ; p < bb ; p + + )
out [ x + p ] = in [ ( fbwidth - 1 ) * bb - x + p ] ;
}
}
BZ_Free ( bad ) ;
if ( stride < 0 )
stride = - fbwidth * bb ;
else
stride = fbwidth * bb ;
}
if ( sides [ i ] . verticalflip )
stride = - stride ;
Q_snprintfz ( filename , sizeof ( filename ) , " textures/%s%s " , fname , sides [ i ] . postfix ) ;
COM_DefaultExtension ( filename , scr_sshot_type . string , sizeof ( filename ) ) ;
if ( SCR_ScreenShot ( filename , FS_GAMEONLY , & buffer , 1 , stride , fbwidth , fbheight , fmt , false ) )
{
FS_NativePath ( filename , FS_GAMEONLY , sysname , sizeof ( sysname ) ) ;
Con_Printf ( " Wrote %s \n " , sysname ) ;
}
else
{
FS_NativePath ( filename , FS_GAMEONLY , sysname , sizeof ( sysname ) ) ;
Con_Printf ( " Failed to write %s \n " , sysname ) ;
}
BZ_Free ( buffer ) ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
}
}
}
2017-12-09 21:22:46 +00:00
Cvar_Set ( & r_drawviewmodel , olddrawviewmodel ) ;
VectorCopy ( oldangles , cl . playerview - > viewangles ) ;
2015-02-02 08:01:53 +00:00
}
2018-11-19 08:06:07 +00:00
# ifdef IMAGEFMT_PCX
2004-08-23 00:15:46 +00:00
// from gl_draw.c
qbyte * draw_chars ; // 8*8 graphic characters
2016-02-10 23:23:43 +00:00
static void SCR_DrawCharToSnap ( int num , qbyte * dest , int width )
2004-08-23 00:15:46 +00:00
{
int row , col ;
qbyte * source ;
int drawline ;
int x ;
2013-03-12 23:24:15 +00:00
if ( ! draw_chars )
{
2016-08-25 00:12:14 +00:00
size_t lumpsize ;
2017-12-09 21:22:46 +00:00
qbyte lumptype ;
draw_chars = W_GetLumpName ( " conchars " , & lumpsize , & lumptype ) ;
// if (lumptype != )
// draw_chars = NULL;
2016-08-25 00:12:14 +00:00
if ( ! draw_chars | | lumpsize ! = 128 * 128 )
2013-03-12 23:24:15 +00:00
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 + + )
2016-08-25 00:12:14 +00:00
if ( source [ x ] & & source [ x ] ! = 255 )
2004-08-23 00:15:46 +00:00
dest [ x ] = source [ x ] ;
source + = 128 ;
dest - = width ;
}
}
2016-02-10 23:23:43 +00:00
static void SCR_DrawStringToSnap ( const char * s , qbyte * buf , int x , int y , int width )
2004-08-23 00:15:46 +00:00
{
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
= = = = = = = = = = = = = = = = = =
*/
2018-11-19 08:06:07 +00:00
int MipColor ( int r , int g , int b ) ;
2005-10-28 01:33:19 +00:00
qboolean SCR_RSShot ( void )
{
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
int stride ;
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 ;
2015-08-14 02:46:38 +00:00
enum uploadfmt fmt ;
2017-02-19 00:15:42 +00:00
int src_size ;
int src_red ;
int src_green ;
int src_blue ;
2004-08-23 00:15:46 +00:00
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
//
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
newbuf = VID_GetRGBInfo ( & truewidth , & trueheight , & stride , & fmt ) ;
2015-08-14 02:46:38 +00:00
if ( fmt = = TF_INVALID )
return false ;
2017-02-19 00:15:42 +00:00
switch ( fmt )
{
case TF_RGB24 :
case TF_RGBA32 :
src_size = ( fmt = = TF_RGB24 ) ? 3 : 4 ;
src_red = 0 ;
src_green = 1 ;
src_blue = 2 ;
break ;
case TF_BGR24 :
case TF_BGRA32 :
src_size = ( fmt = = TF_BGR24 ) ? 3 : 4 ;
src_red = 2 ;
src_green = 1 ;
src_blue = 0 ;
break ;
default :
2015-08-14 02:46:38 +00:00
BZ_Free ( newbuf ) ;
return false ;
}
2016-02-10 23:23:43 +00:00
//FIXME: bgra
2004-08-23 00:15:46 +00:00
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 + + ) {
2017-02-19 00:15:42 +00:00
dest = newbuf + ( w * src_size * y ) ;
2004-08-23 00:15:46 +00:00
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 + + ) {
2017-02-19 00:15:42 +00:00
src = newbuf + ( truewidth * src_size * dy ) + dx * src_size ;
2004-08-23 00:15:46 +00:00
for ( nx = dx ; nx < dex ; nx + + ) {
2017-02-19 00:15:42 +00:00
r + = src [ src_red ] ;
g + = src [ src_green ] ;
b + = src [ src_blue ] ;
src + = src_size ;
2004-08-23 00:15:46 +00:00
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 + + ) {
2017-02-19 00:15:42 +00:00
src = newbuf + ( w * src_size * y ) ;
2004-08-23 00:15:46 +00:00
dest = newbuf + ( w * y ) ;
for ( x = 0 ; x < w ; x + + ) {
* dest + + = MipColor ( src [ 0 ] , src [ 1 ] , src [ 2 ] ) ;
2017-02-19 00:15:42 +00:00
src + = src_size ;
2004-08-23 00:15:46 +00:00
}
}
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 ) ;
2015-06-04 06:15:14 +00:00
WritePCXfile ( " snap.pcx " , FS_GAMEONLY , newbuf , w , h , w , host_basepal , true ) ;
2004-08-23 00:15:46 +00:00
BZ_Free ( newbuf ) ;
return true ;
}
2018-11-19 08:06:07 +00:00
# endif
2004-08-23 00:15:46 +00:00
//=============================================================================
//=============================================================================
/*
= = = = = = = = = = = = = = =
SCR_BringDownConsole
Brings the console down and fades the palettes back to normal
= = = = = = = = = = = = = = = =
*/
void SCR_BringDownConsole ( void )
{
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 + + )
2016-01-18 05:22:07 +00:00
{
2009-11-04 21:16:50 +00:00
scr_centerprint [ pnum ] . charcount = 0 ;
2016-01-18 05:22:07 +00:00
cl . playerview [ pnum ] . cshifts [ CSHIFT_CONTENTS ] . percent = 0 ; // no area contents palette on next frame
}
2004-08-23 00:15:46 +00:00
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
void SCR_TileClear ( int skipbottom )
2004-08-23 00:15:46 +00:00
{
2013-06-23 02:17:02 +00:00
if ( r_refdef . vrect . width < r_refdef . grect . width )
{
2015-04-27 06:19:33 +00:00
float w ;
2013-06-23 02:17:02 +00:00
// left
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
R2D_TileClear ( r_refdef . grect . x , r_refdef . grect . y , r_refdef . vrect . x - r_refdef . grect . x , r_refdef . grect . height - skipbottom ) ;
2013-06-23 02:17:02 +00:00
// right
w = ( r_refdef . grect . x + r_refdef . grect . width ) - ( r_refdef . vrect . x + r_refdef . vrect . width ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
R2D_TileClear ( ( r_refdef . grect . x + r_refdef . grect . width ) - ( w ) , r_refdef . grect . y , w , r_refdef . grect . height - skipbottom ) ;
2013-06-23 02:17:02 +00:00
}
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 ,
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
( r_refdef . grect . y + r_refdef . grect . height ) - skipbottom - ( 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 )
{
2015-04-27 06:19:33 +00:00
qboolean consolefocused = ! ! Key_Dest_Has ( kdm_console | kdm_cwindows ) ;
2005-01-23 17:49:42 +00:00
RSpeedMark ( ) ;
2005-04-26 16:04:12 +00:00
2015-07-04 02:04:46 +00:00
r_refdef . playerview = & cl . playerview [ 0 ] ;
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
{
2014-03-30 00:39:37 +00:00
SCR_DrawLoading ( false ) ;
2005-08-06 07:18:29 +00:00
2005-01-23 17:49:42 +00:00
SCR_ShowPics_Draw ( ) ;
2017-01-24 20:15:14 +00:00
if ( ! scr_disabled_for_loading )
consolefocused = false ;
2005-01-23 17:49:42 +00:00
}
2015-12-12 19:25:15 +00:00
else if ( nohud )
{
2017-12-15 06:56:40 +00:00
SCR_DrawDisk ( ) ;
2015-12-12 19:25:15 +00:00
SCR_DrawFPS ( ) ;
SCR_CheckDrawCenterString ( ) ;
}
2016-07-12 00:40:13 +00:00
else if ( cl . intermissionmode = = IM_NQFINALE | | cl . intermissionmode = = IM_NQCUTSCENE | | cl . intermissionmode = = IM_H2FINALE )
2005-01-23 17:49:42 +00:00
{
SCR_CheckDrawCenterString ( ) ;
}
2015-09-01 04:45:15 +00:00
else if ( cl . intermissionmode ! = IM_NONE )
{
2017-05-28 15:42:32 +00:00
Sbar_IntermissionOverlay ( r_refdef . playerview ) ;
2015-09-01 04:45:15 +00:00
}
2005-01-23 17:49:42 +00:00
else
{
2015-12-12 19:25:15 +00:00
SCR_DrawNet ( ) ;
SCR_DrawDisk ( ) ;
SCR_DrawFPS ( ) ;
SCR_DrawClock ( ) ;
SCR_DrawGameClock ( ) ;
SCR_DrawTurtle ( ) ;
SCR_DrawPause ( ) ;
SCR_ShowPics_Draw ( ) ;
2005-01-23 17:49:42 +00:00
SCR_CheckDrawCenterString ( ) ;
2009-04-06 00:34:32 +00:00
}
2016-07-12 00:40:13 +00:00
//#ifdef TEXTEDITOR
// if (editoractive)
// Editor_Draw();
//#endif
2009-04-06 00:34:32 +00:00
2013-10-08 14:28:11 +00:00
//if the console is not focused, show it scrolling back up behind the menu
if ( ! consolefocused )
2009-11-04 21:16:50 +00:00
SCR_DrawConsole ( false ) ;
2009-04-06 00:34:32 +00:00
2007-08-07 16:30:49 +00:00
# ifdef MENU_DAT
2009-04-06 00:34:32 +00:00
MP_Draw ( ) ;
2018-05-21 13:47:53 +00:00
# endif
# ifdef MENU_NATIVECODE
if ( mn_entry )
2018-06-02 08:55:57 +00:00
mn_entry - > Draw ( host_frametime ) ;
2007-08-07 16:30:49 +00:00
# endif
2015-07-14 14:47:00 +00:00
M_Draw ( uimenu ) ;
2010-11-26 06:58:48 +00:00
2013-10-08 14:28:11 +00:00
//but if the console IS focused, then always show it infront.
if ( consolefocused )
2009-11-04 21:16:50 +00:00
SCR_DrawConsole ( false ) ;
2005-01-23 17:49:42 +00:00
2014-09-02 02:44:43 +00:00
SCR_DrawCursor ( ) ;
------------------------------------------------------------------------
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_DrawSimMTouchCursor ( ) ;
2015-07-30 16:26:15 +00:00
if ( R2D_Flush )
R2D_Flush ( ) ;
2005-01-23 17:49:42 +00:00
RSpeedEnd ( RSPEED_2D ) ;
}
2016-02-10 23:23:43 +00:00
/*
= = = = = = = = = = = = = = = = = =
SCR_Init
= = = = = = = = = = = = = = = = = =
*/
void SCR_Init ( void )
{
//
// register our commands
//
Cmd_AddCommandD ( " screenshot_mega " , SCR_ScreenShot_Mega_f , " screenshot_mega <name> [width] [height] \n Takes a screenshot with explicit sizes that are not tied to the size of your monitor, allowing for true monstrosities. " ) ;
Cmd_AddCommandD ( " screenshot_stereo " , SCR_ScreenShot_Mega_f , " screenshot_stereo <name> [width] [height] \n Takes a simple stereo screenshot. " ) ;
2018-11-19 06:37:25 +00:00
Cmd_AddCommandD ( " screenshot_360 " , SCR_ScreenShot_Mega_f , " screenshot_360 <name> [width] [height] \n Takes an equirectangular screenshot. " ) ;
2016-02-10 23:23:43 +00:00
Cmd_AddCommandD ( " screenshot_vr " , SCR_ScreenShot_VR_f , " screenshot_vr <name> [width] \n Takes a spherical stereoscopic panorama image, for viewing with VR displays. " ) ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
Cmd_AddCommandD ( " screenshot_cubemap " , SCR_ScreenShot_Cubemap_f , " screenshot_cubemap <name> [size] \n Takes 6 screenshots forming a single cubemap. " ) ;
Cmd_AddCommandD ( " envmap " , SCR_ScreenShot_Cubemap_f , " Legacy name for the screenshot_cubemap command. " ) ; //legacy
2016-02-10 23:23:43 +00:00
Cmd_AddCommand ( " screenshot " , SCR_ScreenShot_f ) ;
Cmd_AddCommand ( " sizeup " , SCR_SizeUp_f ) ;
Cmd_AddCommand ( " sizedown " , SCR_SizeDown_f ) ;
scr_net = R2D_SafePicFromWad ( " net " ) ;
scr_turtle = R2D_SafePicFromWad ( " turtle " ) ;
scr_initialized = true ;
}
void SCR_DeInit ( void )
{
int i ;
if ( scr_curcursor )
{
rf - > VID_SetCursor ( scr_curcursor ) ;
scr_curcursor = NULL ;
}
for ( i = 0 ; i < countof ( key_customcursor ) ; i + + )
{
if ( key_customcursor [ i ] . handle )
{
rf - > VID_DestroyCursor ( key_customcursor [ i ] . handle ) ;
key_customcursor [ i ] . handle = NULL ;
}
key_customcursor [ i ] . dirty = true ;
}
2016-07-21 19:27:59 +00:00
for ( i = 0 ; i < countof ( scr_centerprint ) ; i + + )
{
Z_Free ( scr_centerprint [ i ] . string ) ;
2016-10-22 07:06:51 +00:00
memset ( & scr_centerprint [ i ] , 0 , sizeof ( scr_centerprint [ i ] ) ) ;
2016-07-21 19:27:59 +00:00
}
2016-02-10 23:23:43 +00:00
if ( scr_initialized )
{
scr_initialized = false ;
Cmd_RemoveCommand ( " screenshot " ) ;
Cmd_RemoveCommand ( " screenshot_mega " ) ;
Cmd_RemoveCommand ( " screenshot_stereo " ) ;
Cmd_RemoveCommand ( " screenshot_vr " ) ;
2018-11-27 16:48:19 +00:00
Cmd_RemoveCommand ( " screenshot_360 " ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
Cmd_RemoveCommand ( " screenshot_cubemap " ) ;
2016-02-10 23:23:43 +00:00
Cmd_RemoveCommand ( " envmap " ) ;
Cmd_RemoveCommand ( " sizeup " ) ;
Cmd_RemoveCommand ( " sizedown " ) ;
}
2017-09-02 05:13:33 +00:00
}