2009-11-04 21:16:50 +00:00
# include "quakedef.h"
# ifndef SERVERONLY
# include "shader.h"
# include "gl_draw.h"
2015-08-04 15:16:24 +00:00
# define WIN32_BLOATED
# include "glquake.h"
2013-11-21 23:02:28 +00:00
qboolean r2d_canhwgamma ; //says the video code has successfully activated hardware gamma
2009-11-04 21:16:50 +00:00
texid_t missing_texture ;
2012-11-27 03:23:19 +00:00
texid_t missing_texture_gloss ;
2013-07-14 12:22:51 +00:00
texid_t missing_texture_normal ;
2011-03-31 11:00:23 +00:00
texid_t translate_texture ;
shader_t * translate_shader ;
2011-03-31 19:46:26 +00:00
texid_t ch_int_texture ;
vec3_t ch_color ;
shader_t * shader_crosshair ;
2009-11-04 21:16:50 +00:00
static mpic_t * conback ;
static mpic_t * draw_backtile ;
2015-08-20 03:17:47 +00:00
shader_t * shader_draw_fill , * shader_draw_fill_trans ;
2009-11-04 21:16:50 +00:00
mpic_t * draw_disc ;
2012-11-27 03:23:19 +00:00
shader_t * shader_contrastup ;
shader_t * shader_contrastdown ;
shader_t * shader_brightness ;
2013-05-11 14:02:55 +00:00
shader_t * shader_gammacb ;
2010-05-01 22:47:47 +00:00
shader_t * shader_polyblend ;
2011-03-12 13:51:40 +00:00
shader_t * shader_menutint ;
2010-05-01 22:47:47 +00:00
2015-08-04 15:16:24 +00:00
# define DRAW_QUADS 128
2015-08-14 02:46:38 +00:00
static int draw_active_flags ;
2015-08-04 15:16:24 +00:00
static shader_t * draw_active_shader ;
static avec4_t draw_active_colour ;
2009-11-04 21:16:50 +00:00
static mesh_t draw_mesh ;
2015-08-04 15:16:24 +00:00
static vecV_t draw_mesh_xyz [ DRAW_QUADS ] ;
vec2_t draw_mesh_st [ DRAW_QUADS ] ;
static avec4_t draw_mesh_colors [ DRAW_QUADS ] ;
index_t r_quad_indexes [ DRAW_QUADS * 6 ] ;
unsigned int r2d_be_flags ;
2009-11-04 21:16:50 +00:00
2015-08-04 15:16:24 +00:00
struct
{
lmalloc_t allocation ;
qboolean dirty ;
int lastid ;
unsigned int * data ;
shader_t * shader ;
texid_t tex ;
apic_t * pics ;
} atlas ;
2014-02-07 08:38:40 +00:00
2009-11-04 21:16:50 +00:00
extern cvar_t scr_conalpha ;
extern cvar_t gl_conback ;
extern cvar_t gl_font ;
2011-02-25 04:22:14 +00:00
extern cvar_t gl_screenangle ;
2010-07-11 02:22:39 +00:00
extern cvar_t vid_conautoscale ;
2010-11-22 02:03:28 +00:00
extern cvar_t vid_conheight ;
extern cvar_t vid_conwidth ;
2013-12-29 22:48:28 +00:00
extern cvar_t con_textsize ;
2015-04-21 04:12:00 +00:00
static void QDECL R2D_Font_Callback ( struct cvar_s * var , char * oldvalue ) ;
static void QDECL R2D_Conautoscale_Callback ( struct cvar_s * var , char * oldvalue ) ;
static void QDECL R2D_ScreenAngle_Callback ( struct cvar_s * var , char * oldvalue ) ;
static void QDECL R2D_Conheight_Callback ( struct cvar_s * var , char * oldvalue ) ;
static void QDECL R2D_Conwidth_Callback ( struct cvar_s * var , char * oldvalue ) ;
2009-11-04 21:16:50 +00:00
2011-03-31 19:46:26 +00:00
extern cvar_t crosshair ;
extern cvar_t crosshaircolor ;
extern cvar_t crosshairsize ;
extern cvar_t crosshairimage ;
extern cvar_t crosshairalpha ;
2015-04-21 04:12:00 +00:00
static void QDECL R2D_Crosshair_Callback ( struct cvar_s * var , char * oldvalue ) ;
static void QDECL R2D_CrosshairImage_Callback ( struct cvar_s * var , char * oldvalue ) ;
static void QDECL R2D_CrosshairColor_Callback ( struct cvar_s * var , char * oldvalue ) ;
2011-03-31 19:46:26 +00:00
2015-07-30 16:26:15 +00:00
void ( * R2D_Flush ) ( void ) ;
2011-03-31 19:46:26 +00:00
2009-11-04 21:16:50 +00:00
//We need this for minor things though, so we'll just use the slow accurate method.
2011-05-29 04:26:29 +00:00
//this is unlikly to be called too often.
2009-11-04 21:16:50 +00:00
qbyte GetPaletteIndex ( int red , int green , int blue )
{
//slow, horrible method.
{
int i , best = 15 ;
int bestdif = 256 * 256 * 256 , curdif ;
extern qbyte * host_basepal ;
qbyte * pa ;
# define _abs(x) ((x)*(x))
pa = host_basepal ;
for ( i = 0 ; i < 256 ; i + + , pa + = 3 )
{
curdif = _abs ( red - pa [ 0 ] ) + _abs ( green - pa [ 1 ] ) + _abs ( blue - pa [ 2 ] ) ;
if ( curdif < bestdif )
{
if ( curdif < 1 )
return i ;
bestdif = curdif ;
best = i ;
}
}
return best ;
}
}
2012-07-05 19:42:36 +00:00
void R2D_Shutdown ( void )
{
Cvar_Unhook ( & gl_font ) ;
Cvar_Unhook ( & vid_conautoscale ) ;
Cvar_Unhook ( & gl_screenangle ) ;
Cvar_Unhook ( & vid_conheight ) ;
Cvar_Unhook ( & vid_conwidth ) ;
Cvar_Unhook ( & crosshair ) ;
Cvar_Unhook ( & crosshairimage ) ;
Cvar_Unhook ( & crosshaircolor ) ;
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
BZ_Free ( cl_stris ) ;
cl_stris = NULL ;
BZ_Free ( cl_strisvertv ) ;
cl_strisvertv = NULL ;
BZ_Free ( cl_strisvertc ) ;
cl_strisvertc = NULL ;
BZ_Free ( cl_strisvertt ) ;
cl_strisvertt = NULL ;
BZ_Free ( cl_strisidx ) ;
cl_strisidx = NULL ;
cl_numstrisidx = 0 ;
cl_maxstrisidx = 0 ;
cl_numstrisvert = 0 ;
cl_maxstrisvert = 0 ;
cl_numstris = 0 ;
cl_maxstris = 0 ;
2012-09-30 05:52:03 +00:00
2014-02-07 08:38:40 +00:00
2013-12-29 22:48:28 +00:00
if ( font_console = = font_default )
font_console = NULL ;
if ( font_console )
Font_Free ( font_console ) ;
font_console = NULL ;
if ( font_default )
Font_Free ( font_default ) ;
font_default = NULL ;
2012-09-30 05:52:03 +00:00
if ( font_tiny )
Font_Free ( font_tiny ) ;
font_tiny = NULL ;
2015-01-21 18:18:37 +00:00
# if defined(MENU_DAT) || defined(CSQC_DAT)
PR_ReloadFonts ( false ) ;
# endif
2015-08-04 15:16:24 +00:00
while ( atlas . pics )
{
apic_t * a = atlas . pics ;
atlas . pics = a - > next ;
Z_Free ( a ) ;
}
Z_Free ( atlas . data ) ;
memset ( & atlas , 0 , sizeof ( atlas ) ) ;
2012-07-05 19:42:36 +00:00
}
2009-11-04 21:16:50 +00:00
/*
Iniitalise the 2 d rendering functions ( including font ) .
Image loading code must be ready for use at this point .
*/
void R2D_Init ( void )
{
2013-07-14 12:22:51 +00:00
unsigned int nonorm [ 4 * 4 ] ;
2012-11-27 03:23:19 +00:00
unsigned int nogloss [ 4 * 4 ] ;
2015-08-04 15:16:24 +00:00
int i , j ;
2012-12-04 19:37:57 +00:00
unsigned int glossval ;
2013-07-14 12:22:51 +00:00
unsigned int normval ;
2015-05-03 19:57:46 +00:00
extern cvar_t gl_specular_fallback , gl_specular_fallbackexp , gl_texturemode ;
2010-07-11 02:22:39 +00:00
conback = NULL ;
2010-05-01 22:47:47 +00:00
Shader_Init ( ) ;
2009-11-04 21:16:50 +00:00
BE_Init ( ) ;
2010-05-01 22:47:47 +00:00
draw_mesh . istrifan = true ;
2009-11-04 21:16:50 +00:00
draw_mesh . numvertexes = 4 ;
draw_mesh . numindexes = 6 ;
draw_mesh . xyz_array = draw_mesh_xyz ;
draw_mesh . st_array = draw_mesh_st ;
2013-08-27 13:18:09 +00:00
draw_mesh . colors4f_array [ 0 ] = draw_mesh_colors ;
2009-11-04 21:16:50 +00:00
draw_mesh . indexes = r_quad_indexes ;
2015-08-04 15:16:24 +00:00
for ( i = 0 , j = 0 ; i < countof ( r_quad_indexes ) ; i + = 6 , j + = 4 )
{
r_quad_indexes [ i + 0 ] = j + 0 ;
r_quad_indexes [ i + 1 ] = j + 1 ;
r_quad_indexes [ i + 2 ] = j + 2 ;
r_quad_indexes [ i + 3 ] = j + 2 ;
r_quad_indexes [ i + 4 ] = j + 3 ;
r_quad_indexes [ i + 5 ] = j + 0 ;
}
2009-11-04 21:16:50 +00:00
Font_Init ( ) ;
2011-10-27 15:46:36 +00:00
# ifdef warningmsg
# pragma warningmsg("Fixme: move conwidth handling into here")
2011-05-29 04:26:29 +00:00
# endif
2009-11-04 21:16:50 +00:00
2012-12-04 19:37:57 +00:00
glossval = min ( gl_specular_fallback . value * 255 , 255 ) ;
glossval * = 0x10101 ;
2014-10-05 20:04:11 +00:00
glossval | = 0x01000000 * bound ( 0 , ( int ) ( gl_specular_fallbackexp . value * 255 ) , 255 ) ;
2012-12-04 19:37:57 +00:00
glossval = LittleLong ( glossval ) ;
2013-07-14 12:22:51 +00:00
normval = 0xffff8080 ;
normval = LittleLong ( normval ) ;
2012-11-27 03:23:19 +00:00
for ( i = 0 ; i < 4 * 4 ; i + + )
2013-07-14 12:22:51 +00:00
{
2012-12-04 19:37:57 +00:00
nogloss [ i ] = glossval ;
2013-07-14 12:22:51 +00:00
nonorm [ i ] = normval ;
}
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
missing_texture = R_LoadTexture8 ( " no_texture " , 16 , 16 , ( unsigned char * ) ( r_notexture_mip + 1 ) , IF_NOALPHA | IF_NOGAMMA | IF_NOPURGE , 0 ) ;
missing_texture_gloss = R_LoadTexture ( " no_texture_gloss " , 4 , 4 , TF_RGBA32 , ( unsigned char * ) nogloss , IF_NOGAMMA | IF_NOPURGE ) ;
missing_texture_normal = R_LoadTexture ( " no_texture_normal " , 4 , 4 , TF_RGBA32 , ( unsigned char * ) nonorm , IF_NOGAMMA | IF_NOPURGE ) ;
2011-03-31 11:00:23 +00:00
translate_texture = r_nulltex ;
2011-03-31 19:46:26 +00:00
ch_int_texture = r_nulltex ;
2009-11-04 21:16:50 +00:00
2013-08-21 07:14:39 +00:00
draw_backtile = R_RegisterShader ( " gfx/backtile.lmp " , SUF_NONE ,
2011-03-31 02:32:32 +00:00
" { \n "
2011-05-20 04:10:46 +00:00
" if $nofixed \n "
" program default2d \n "
2013-03-12 23:16:55 +00:00
" endif \n "
2014-03-30 08:55:06 +00:00
" affine \n "
2011-03-31 02:32:32 +00:00
" nomipmaps \n "
" { \n "
" map $diffuse \n "
" } \n "
" } \n " ) ;
2015-05-03 19:57:46 +00:00
TEXDOWAIT ( draw_backtile - > defaulttextures - > base ) ;
if ( ! TEXLOADED ( draw_backtile - > defaulttextures - > base ) )
draw_backtile - > defaulttextures - > base = R_LoadHiResTexture ( " gfx/backtile " , NULL , IF_UIPIC | IF_NOPICMIP | IF_NOMIPMAP | IF_NOWORKER ) ;
if ( ! TEXLOADED ( draw_backtile - > defaulttextures - > base ) )
draw_backtile - > defaulttextures - > base = R_LoadHiResTexture ( " gfx/menu/backtile " , NULL , IF_UIPIC | IF_NOPICMIP | IF_NOMIPMAP | IF_NOWORKER ) ;
if ( ! TEXLOADED ( draw_backtile - > defaulttextures - > base ) )
draw_backtile - > defaulttextures - > base = R_LoadHiResTexture ( " pics/backtile " , NULL , IF_UIPIC | IF_NOPICMIP | IF_NOMIPMAP | IF_NOWORKER ) ;
2009-11-04 21:16:50 +00:00
2013-08-21 07:14:39 +00:00
shader_draw_fill = R_RegisterShader ( " fill_opaque " , SUF_NONE ,
2010-02-06 01:25:04 +00:00
" { \n "
2011-06-05 23:53:33 +00:00
" program defaultfill \n "
2010-02-06 01:25:04 +00:00
" { \n "
" map $whiteimage \n "
------------------------------------------------------------------------
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
" rgbgen exactvertex \n "
" alphagen vertex \n "
2010-02-06 01:25:04 +00:00
" } \n "
" } \n " ) ;
2013-08-21 07:14:39 +00:00
shader_draw_fill_trans = R_RegisterShader ( " fill_trans " , SUF_NONE ,
2010-02-06 01:25:04 +00:00
" { \n "
2011-06-05 23:53:33 +00:00
" program defaultfill \n "
2010-02-06 01:25:04 +00:00
" { \n "
" map $whiteimage \n "
" rgbgen vertex \n "
" alphagen vertex \n "
" blendfunc blend \n "
" } \n "
" } \n " ) ;
2014-03-30 00:39:37 +00:00
shader_contrastup = R_RegisterShader ( " contrastupshader " , SUF_NONE ,
2010-05-01 22:47:47 +00:00
" { \n "
2011-06-05 23:53:33 +00:00
" program defaultfill \n "
2010-05-01 22:47:47 +00:00
" { \n "
2012-11-27 03:23:19 +00:00
" nodepthtest \n "
2010-05-01 22:47:47 +00:00
" map $whiteimage \n "
" blendfunc gl_dst_color gl_one \n "
" rgbgen vertex \n "
" alphagen vertex \n "
" } \n "
" } \n "
) ;
2014-03-30 00:39:37 +00:00
shader_contrastdown = R_RegisterShader ( " contrastdownshader " , SUF_NONE ,
2012-11-27 03:23:19 +00:00
" { \n "
" program defaultfill \n "
" { \n "
" nodepthtest \n "
" map $whiteimage \n "
" blendfunc gl_dst_color gl_zero \n "
" rgbgen vertex \n "
" alphagen vertex \n "
" } \n "
" } \n "
) ;
2013-08-21 07:14:39 +00:00
shader_brightness = R_RegisterShader ( " brightnessshader " , SUF_NONE ,
2012-11-27 03:23:19 +00:00
" { \n "
" program defaultfill \n "
" { \n "
" nodepthtest \n "
" map $whiteimage \n "
" blendfunc gl_one gl_one \n "
" rgbgen vertex \n "
" alphagen vertex \n "
" } \n "
" } \n "
) ;
2013-08-21 07:14:39 +00:00
shader_gammacb = R_RegisterShader ( " gammacbshader " , SUF_NONE ,
2013-05-11 14:02:55 +00:00
" { \n "
" program defaultgammacb \n "
2014-03-30 08:55:06 +00:00
" affine \n "
2013-05-11 14:02:55 +00:00
" cull back \n "
" { \n "
" map $currentrender \n "
" nodepthtest \n "
" } \n "
" } \n "
) ;
2013-08-21 07:14:39 +00:00
shader_polyblend = R_RegisterShader ( " polyblendshader " , SUF_NONE ,
2010-05-01 22:47:47 +00:00
" { \n "
2011-06-05 23:53:33 +00:00
" program defaultfill \n "
2010-05-01 22:47:47 +00:00
" { \n "
" map $whiteimage \n "
" blendfunc gl_src_alpha gl_one_minus_src_alpha \n "
" rgbgen vertex \n "
" alphagen vertex \n "
" } \n "
" } \n "
) ;
2013-08-21 07:14:39 +00:00
shader_menutint = R_RegisterShader ( " menutint " , SUF_NONE ,
2011-03-12 13:51:40 +00:00
" { \n "
2014-03-30 08:55:06 +00:00
" affine \n "
2014-08-25 07:35:41 +00:00
# ifdef FTE_TARGET_WEB
//currentrender is problematic here, so avoid using it.
" program default2d \n "
" { \n "
" map $whiteimage \n "
" blendfunc gl_dst_color gl_zero \n "
" rgbgen const $r_menutint \n "
" } \n "
# else
2015-07-31 13:23:32 +00:00
" if gl_menutint_shader != 0 \n "
------------------------------------------------------------------------
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
" program menutint \n "
2015-07-31 13:23:32 +00:00
" endif \n "
" if $haveprogram \n "
2011-03-12 13:51:40 +00:00
" { \n "
" map $currentrender \n "
" } \n "
2013-03-12 23:16:55 +00:00
" else \n "
2011-03-12 13:51:40 +00:00
" { \n "
2011-10-27 15:46:36 +00:00
" map $whiteimage \n "
2011-03-12 13:51:40 +00:00
" blendfunc gl_dst_color gl_zero \n "
" rgbgen const $r_menutint \n "
" } \n "
2013-03-12 23:16:55 +00:00
" endif \n "
2014-08-25 07:35:41 +00:00
# endif
2011-03-12 13:51:40 +00:00
" } \n "
) ;
2013-08-21 07:14:39 +00:00
shader_crosshair = R_RegisterShader ( " crosshairshader " , SUF_NONE ,
2011-03-31 19:46:26 +00:00
" { \n "
2011-05-20 04:10:46 +00:00
" if $nofixed \n "
" program default2d \n "
2013-03-12 23:16:55 +00:00
" endif \n "
2014-03-30 08:55:06 +00:00
" affine \n "
2011-03-31 19:46:26 +00:00
" nomipmaps \n "
" { \n "
" map $diffuse \n "
" blendfunc blend \n "
" rgbgen vertex \n "
" alphagen vertex \n "
" } \n "
" } \n "
) ;
2010-02-06 01:25:04 +00:00
2010-11-02 23:17:25 +00:00
Cvar_Hook ( & gl_font , R2D_Font_Callback ) ;
2010-11-22 02:03:28 +00:00
Cvar_Hook ( & vid_conautoscale , R2D_Conautoscale_Callback ) ;
2011-02-25 04:22:14 +00:00
Cvar_Hook ( & gl_screenangle , R2D_ScreenAngle_Callback ) ;
2010-11-22 02:03:28 +00:00
Cvar_Hook ( & vid_conheight , R2D_Conheight_Callback ) ;
Cvar_Hook ( & vid_conwidth , R2D_Conwidth_Callback ) ;
2010-11-02 23:17:25 +00:00
2011-03-31 19:46:26 +00:00
Cvar_Hook ( & crosshair , R2D_Crosshair_Callback ) ;
Cvar_Hook ( & crosshairimage , R2D_CrosshairImage_Callback ) ;
Cvar_Hook ( & crosshaircolor , R2D_CrosshairColor_Callback ) ;
2010-07-11 02:22:39 +00:00
Cvar_ForceCallback ( & gl_conback ) ;
Cvar_ForceCallback ( & vid_conautoscale ) ;
Cvar_ForceCallback ( & gl_font ) ;
2015-05-03 19:57:46 +00:00
Cvar_ForceCallback ( & gl_texturemode ) ;
2011-03-31 19:46:26 +00:00
Cvar_ForceCallback ( & crosshair ) ;
Cvar_ForceCallback ( & crosshaircolor ) ;
2011-05-26 16:46:43 +00:00
# ifdef PLUGINS
Plug_DrawReloadImages ( ) ;
# endif
2014-02-09 05:55:55 +00:00
R2D_Font_Changed ( ) ;
2015-05-03 19:57:46 +00:00
R_NetgraphInit ( ) ;
2015-08-04 15:16:24 +00:00
atlas . lastid = - 1 ;
atlas . shader = NULL ;
atlas . data = NULL ;
atlas . dirty = false ;
Mod_LightmapAllocInit ( & atlas . allocation , false , min ( 512 , sh_config . texture_maxsize ) , min ( 512 , sh_config . texture_maxsize ) , 0 ) ;
2009-11-04 21:16:50 +00:00
}
2014-03-30 08:55:06 +00:00
mpic_t * R2D_SafeCachePic ( const char * path )
2009-11-04 21:16:50 +00:00
{
2011-04-23 20:37:20 +00:00
shader_t * s ;
if ( ! qrenderer )
return NULL ;
s = R_RegisterPic ( path ) ;
2011-05-20 04:10:46 +00:00
return s ;
2009-11-04 21:16:50 +00:00
}
2014-03-30 08:55:06 +00:00
mpic_t * R2D_SafePicFromWad ( const char * name )
2009-11-04 21:16:50 +00:00
{
2015-06-12 14:44:50 +00:00
void Shader_Default2D ( const char * shortname , shader_t * s , const void * genargs ) ;
2009-11-04 21:16:50 +00:00
shader_t * s ;
2015-06-12 14:44:50 +00:00
if ( ! qrenderer )
return NULL ;
s = R_RegisterCustom ( va ( " gfx/%s " , name ) , SUF_2D , Shader_Default2D , " wad " ) ;
return s ;
2009-11-04 21:16:50 +00:00
}
2015-08-04 15:16:24 +00:00
apic_t * R2D_LoadAtlasedPic ( const char * name )
{
apic_t * apic = Z_Malloc ( sizeof ( * apic ) ) ;
qpic_t * qp ;
int x , y ;
qbyte * indata = NULL ;
int atlasid ;
if ( ! gl_load24bit . ival )
{
qp = W_SafeGetLumpName ( name ) ;
if ( qp )
{
apic - > width = qp - > width ;
apic - > height = qp - > height ;
indata = qp - > data ;
}
}
if ( ! indata | | apic - > width > atlas . allocation . width | | apic - > height > atlas . allocation . height )
atlasid = - 1 ; //can happen on voodoo cards
else
Mod_LightmapAllocBlock ( & atlas . allocation , apic - > width + 2 , apic - > height + 2 , & apic - > x , & apic - > y , & atlasid ) ;
if ( atlasid > = 0 )
{
unsigned int * out ;
apic - > x + = 1 ;
apic - > y + = 1 ;
//FIXME: extend the atlas height instead, and keep going with a single atlas?
if ( atlasid ! = atlas . lastid )
{
atlas . lastid = atlasid ;
if ( atlas . dirty )
Image_Upload ( atlas . tex , TF_BGRA32 , atlas . data , NULL , atlas . allocation . width , atlas . allocation . height , IF_NOMIPMAP ) ;
atlas . tex = r_nulltex ;
atlas . shader = NULL ;
atlas . dirty = false ;
if ( atlas . data ) //clear atlas data instead of reallocating it.
memset ( atlas . data , 0 , sizeof ( * atlas . data ) * atlas . allocation . width * atlas . allocation . height ) ;
}
if ( ! atlas . tex )
atlas . tex = Image_CreateTexture ( va ( " fte_atlas%i " , atlasid ) , NULL , IF_NOMIPMAP ) ;
if ( ! atlas . shader )
{
atlas . shader = R_RegisterShader ( va ( " fte_atlas%i " , atlasid ) , SUF_NONE ,
" { \n "
" affine \n "
" program default2d \n "
" { \n "
" map $diffuse \n "
" rgbgen vertex \n "
" alphagen vertex \n "
" blendfunc gl_one gl_one_minus_src_alpha \n "
" } \n "
" } \n "
) ;
atlas . shader - > defaulttextures - > base = atlas . tex ;
}
if ( ! atlas . data )
atlas . data = Z_Malloc ( sizeof ( * atlas . data ) * atlas . allocation . width * atlas . allocation . height ) ;
out = atlas . data ;
out + = apic - > x ;
out + = apic - > y * atlas . allocation . width ;
apic - > atlas = atlas . shader ;
//pad above. extra casts because 64bit msvc is RETARDED.
out [ - 1 - ( qintptr_t ) atlas . allocation . width ] = ( indata [ 0 ] = = 255 ) ? 0 : d_8to24bgrtable [ indata [ 0 ] ] ; //pad left
for ( x = 0 ; x < apic - > width ; x + + )
out [ x - ( qintptr_t ) atlas . allocation . width ] = ( indata [ x ] = = 255 ) ? 0 : d_8to24bgrtable [ indata [ x ] ] ;
out [ x - ( qintptr_t ) atlas . allocation . width ] = ( indata [ x - 1 ] = = 255 ) ? 0 : d_8to24bgrtable [ indata [ x - 1 ] ] ; //pad right
for ( y = 0 ; y < apic - > height ; y + + )
{
out [ - 1 ] = ( indata [ 0 ] = = 255 ) ? 0 : d_8to24bgrtable [ indata [ 0 ] ] ; //pad left
for ( x = 0 ; x < apic - > width ; x + + )
out [ x ] = ( indata [ x ] = = 255 ) ? 0 : d_8to24bgrtable [ indata [ x ] ] ;
out [ x ] = ( indata [ x - 1 ] = = 255 ) ? 0 : d_8to24bgrtable [ indata [ x - 1 ] ] ; //pad right
indata + = x ;
out + = atlas . allocation . width ;
}
//pad below
out [ - 1 ] = ( indata [ 0 ] = = 255 ) ? 0 : d_8to24bgrtable [ indata [ 0 ] ] ; //pad left
for ( x = 0 ; x < apic - > width ; x + + )
out [ x ] = ( indata [ x ] = = 255 ) ? 0 : d_8to24bgrtable [ indata [ x ] ] ;
out [ x ] = ( indata [ x - 1 ] = = 255 ) ? 0 : d_8to24bgrtable [ indata [ x - 1 ] ] ; //pad right
//pinch inwards, for linear sampling
apic - > sl = ( apic - > x + 0.5 ) / ( float ) atlas . allocation . width ;
apic - > sh = ( apic - > width - 1.0 ) / ( float ) atlas . allocation . width ;
apic - > tl = ( apic - > y + 0.5 ) / ( float ) atlas . allocation . height ;
apic - > th = ( apic - > height - 1.0 ) / ( float ) atlas . allocation . height ;
atlas . dirty = true ;
apic - > next = atlas . pics ;
atlas . pics = apic ;
}
else if ( 1 )
{
apic - > atlas = R_RegisterPic ( va ( " gfx/%s " , name ) ) ;
apic - > sl = 0 ;
apic - > sh = 1 ;
apic - > tl = 0 ;
apic - > th = 1 ;
apic - > next = atlas . pics ;
atlas . pics = apic ;
}
else
{
Z_Free ( apic ) ;
return NULL ;
}
return apic ;
}
2009-11-04 21:16:50 +00:00
void R2D_ImageColours ( float r , float g , float b , float a )
{
2015-08-04 15:16:24 +00:00
draw_active_colour [ 0 ] = r ;
draw_active_colour [ 1 ] = g ;
draw_active_colour [ 2 ] = b ;
draw_active_colour [ 3 ] = a ;
2009-11-04 21:16:50 +00:00
}
2010-02-06 01:25:04 +00:00
void R2D_ImagePaletteColour ( unsigned int i , float a )
{
2015-08-04 15:16:24 +00:00
draw_active_colour [ 0 ] = host_basepal [ i * 3 + 0 ] / 255.0 ;
draw_active_colour [ 1 ] = host_basepal [ i * 3 + 1 ] / 255.0 ;
draw_active_colour [ 2 ] = host_basepal [ i * 3 + 2 ] / 255.0 ;
draw_active_colour [ 3 ] = a ;
2010-02-06 01:25:04 +00:00
}
2009-11-04 21:16:50 +00:00
2015-08-04 15:16:24 +00:00
//awkward and weird to use
void R2D_ImageAtlas ( float x , float y , float w , float h , float s1 , float t1 , float s2 , float t2 , apic_t * pic )
{
float newsl , newsh , newtl , newth ;
if ( ! pic )
return ;
if ( atlas . dirty )
{
Image_Upload ( atlas . tex , TF_BGRA32 , atlas . data , NULL , atlas . allocation . width , atlas . allocation . height , IF_NOMIPMAP ) ;
atlas . dirty = false ;
}
newsl = pic - > sl + s1 * pic - > sh ;
newsh = newsl + ( s2 - s1 ) * pic - > sh ;
newtl = pic - > tl + t1 * pic - > th ;
newth = newtl + ( t2 - t1 ) * pic - > th ;
R2D_Image ( x , y , w , h , newsl , newtl , newsh , newth , pic - > atlas ) ;
}
void R2D_ImageFlush ( void )
{
2015-08-14 02:46:38 +00:00
BE_DrawMesh_Single ( draw_active_shader , & draw_mesh , NULL , draw_active_flags ) ;
2015-08-04 15:16:24 +00:00
R2D_Flush = NULL ;
draw_active_shader = NULL ;
}
2009-11-04 21:16:50 +00:00
//awkward and weird to use
void R2D_Image ( float x , float y , float w , float h , float s1 , float t1 , float s2 , float t2 , mpic_t * pic )
{
2014-10-05 20:04:11 +00:00
int i ;
2009-11-04 21:16:50 +00:00
if ( ! pic )
return ;
2013-04-06 03:36:00 +00:00
2014-10-05 20:04:11 +00:00
//don't draw pics if they have an image which is still loading.
for ( i = 0 ; i < pic - > numpasses ; i + + )
{
if ( pic - > passes [ i ] . texgen = = T_GEN_SINGLEMAP & & pic - > passes [ i ] . anim_frames [ 0 ] & & pic - > passes [ i ] . anim_frames [ 0 ] - > status = = TEX_LOADING )
return ;
2015-05-03 19:57:46 +00:00
if ( pic - > passes [ i ] . texgen = = T_GEN_DIFFUSE & & pic - > defaulttextures - > base & & pic - > defaulttextures - > base - > status = = TEX_LOADING )
2014-10-05 20:04:11 +00:00
return ;
}
2015-08-14 02:46:38 +00:00
if ( draw_active_shader ! = pic | | draw_active_flags ! = r2d_be_flags | | draw_mesh . numvertexes + 4 > DRAW_QUADS )
2015-08-04 15:16:24 +00:00
{
if ( R2D_Flush )
R2D_Flush ( ) ;
2015-07-30 16:26:15 +00:00
2015-08-04 15:16:24 +00:00
draw_active_shader = pic ;
2015-08-14 02:46:38 +00:00
draw_active_flags = r2d_be_flags ;
2015-08-04 15:16:24 +00:00
R2D_Flush = R2D_ImageFlush ;
2009-11-04 21:16:50 +00:00
2015-08-04 15:16:24 +00:00
draw_mesh . numindexes = 0 ;
draw_mesh . numvertexes = 0 ;
}
2009-11-04 21:16:50 +00:00
2015-08-04 15:16:24 +00:00
Vector2Set ( draw_mesh_xyz [ draw_mesh . numvertexes + 0 ] , x , y ) ;
Vector2Set ( draw_mesh_st [ draw_mesh . numvertexes + 0 ] , s1 , t1 ) ;
Vector4Copy ( draw_active_colour , draw_mesh_colors [ draw_mesh . numvertexes + 0 ] ) ;
2009-11-04 21:16:50 +00:00
2015-08-04 15:16:24 +00:00
Vector2Set ( draw_mesh_xyz [ draw_mesh . numvertexes + 1 ] , x + w , y ) ;
Vector2Set ( draw_mesh_st [ draw_mesh . numvertexes + 1 ] , s2 , t1 ) ;
Vector4Copy ( draw_active_colour , draw_mesh_colors [ draw_mesh . numvertexes + 1 ] ) ;
2009-11-04 21:16:50 +00:00
2015-08-04 15:16:24 +00:00
Vector2Set ( draw_mesh_xyz [ draw_mesh . numvertexes + 2 ] , x + w , y + h ) ;
Vector2Set ( draw_mesh_st [ draw_mesh . numvertexes + 2 ] , s2 , t2 ) ;
Vector4Copy ( draw_active_colour , draw_mesh_colors [ draw_mesh . numvertexes + 2 ] ) ;
Vector2Set ( draw_mesh_xyz [ draw_mesh . numvertexes + 3 ] , x , y + h ) ;
Vector2Set ( draw_mesh_st [ draw_mesh . numvertexes + 3 ] , s1 , t2 ) ;
Vector4Copy ( draw_active_colour , draw_mesh_colors [ draw_mesh . numvertexes + 3 ] ) ;
draw_mesh . numvertexes + = 4 ;
draw_mesh . numindexes + = 6 ;
2009-11-04 21:16:50 +00:00
}
2015-02-02 08:01:53 +00:00
void R2D_Image2dQuad ( vec2_t points [ ] , vec2_t texcoords [ ] , mpic_t * pic )
{
int i ;
if ( ! pic )
return ;
//don't draw pics if they have an image which is still loading.
for ( i = 0 ; i < pic - > numpasses ; i + + )
{
if ( pic - > passes [ i ] . texgen = = T_GEN_SINGLEMAP & & pic - > passes [ i ] . anim_frames [ 0 ] & & pic - > passes [ i ] . anim_frames [ 0 ] - > status = = TEX_LOADING )
return ;
2015-05-03 19:57:46 +00:00
if ( pic - > passes [ i ] . texgen = = T_GEN_DIFFUSE & & pic - > defaulttextures - > base & & pic - > defaulttextures - > base - > status = = TEX_LOADING )
2015-02-02 08:01:53 +00:00
return ;
}
2015-07-30 16:26:15 +00:00
if ( R2D_Flush )
R2D_Flush ( ) ;
2015-02-02 08:01:53 +00:00
for ( i = 0 ; i < 4 ; i + + )
{
Vector2Copy ( points [ i ] , draw_mesh_xyz [ i ] ) ;
Vector2Copy ( texcoords [ i ] , draw_mesh_st [ i ] ) ;
}
2015-05-03 19:57:46 +00:00
BE_DrawMesh_Single ( pic , & draw_mesh , NULL , r2d_be_flags ) ;
2015-02-02 08:01:53 +00:00
}
2009-11-04 21:16:50 +00:00
2010-02-06 01:25:04 +00:00
/*draws a block of the current colour on the screen*/
2013-08-21 07:14:39 +00:00
void R2D_FillBlock ( float x , float y , float w , float h )
2010-02-06 01:25:04 +00:00
{
2015-08-04 15:16:24 +00:00
mpic_t * pic ;
if ( draw_active_colour [ 3 ] ! = 1 )
pic = shader_draw_fill_trans ;
else
pic = shader_draw_fill ;
2015-08-14 02:46:38 +00:00
if ( draw_active_shader ! = pic | | draw_active_flags ! = r2d_be_flags | | draw_mesh . numvertexes + 4 > DRAW_QUADS )
2015-08-04 15:16:24 +00:00
{
if ( R2D_Flush )
R2D_Flush ( ) ;
2015-07-30 16:26:15 +00:00
2015-08-04 15:16:24 +00:00
draw_active_shader = pic ;
2015-08-14 02:46:38 +00:00
draw_active_flags = r2d_be_flags ;
2015-08-04 15:16:24 +00:00
R2D_Flush = R2D_ImageFlush ;
2010-02-06 01:25:04 +00:00
2015-08-04 15:16:24 +00:00
draw_mesh . numindexes = 0 ;
draw_mesh . numvertexes = 0 ;
}
2010-02-06 01:25:04 +00:00
2015-08-04 15:16:24 +00:00
Vector2Set ( draw_mesh_xyz [ draw_mesh . numvertexes + 0 ] , x , y ) ;
Vector4Copy ( draw_active_colour , draw_mesh_colors [ draw_mesh . numvertexes + 0 ] ) ;
2010-02-06 01:25:04 +00:00
2015-08-04 15:16:24 +00:00
Vector2Set ( draw_mesh_xyz [ draw_mesh . numvertexes + 1 ] , x + w , y ) ;
Vector4Copy ( draw_active_colour , draw_mesh_colors [ draw_mesh . numvertexes + 1 ] ) ;
2010-02-06 01:25:04 +00:00
2015-08-04 15:16:24 +00:00
Vector2Set ( draw_mesh_xyz [ draw_mesh . numvertexes + 2 ] , x + w , y + h ) ;
Vector4Copy ( draw_active_colour , draw_mesh_colors [ draw_mesh . numvertexes + 2 ] ) ;
Vector2Set ( draw_mesh_xyz [ draw_mesh . numvertexes + 3 ] , x , y + h ) ;
Vector4Copy ( draw_active_colour , draw_mesh_colors [ draw_mesh . numvertexes + 3 ] ) ;
draw_mesh . numvertexes + = 4 ;
draw_mesh . numindexes + = 6 ;
2010-02-06 01:25:04 +00:00
}
2015-04-21 04:12:00 +00:00
void R2D_Line ( float x1 , float y1 , float x2 , float y2 , shader_t * shader )
{
2015-07-30 16:26:15 +00:00
if ( R2D_Flush )
R2D_Flush ( ) ;
2015-04-21 04:12:00 +00:00
VectorSet ( draw_mesh_xyz [ 0 ] , x1 , y1 , 0 ) ;
Vector2Set ( draw_mesh_st [ 0 ] , 0 , 0 ) ;
VectorSet ( draw_mesh_xyz [ 1 ] , x2 , y2 , 0 ) ;
Vector2Set ( draw_mesh_st [ 1 ] , 1 , 0 ) ;
if ( ! shader )
{
2015-08-04 15:16:24 +00:00
if ( draw_active_colour [ 3 ] ! = 1 )
2015-04-21 04:12:00 +00:00
shader = shader_draw_fill_trans ;
else
shader = shader_draw_fill ;
}
draw_mesh . numvertexes = 2 ;
draw_mesh . numindexes = 2 ;
2015-05-03 19:57:46 +00:00
BE_DrawMesh_Single ( shader , & draw_mesh , NULL , BEF_LINES ) ;
2015-04-21 04:12:00 +00:00
}
2013-08-21 07:14:39 +00:00
void R2D_ScalePic ( float x , float y , float width , float height , mpic_t * pic )
2009-11-04 21:16:50 +00:00
{
R2D_Image ( x , y , width , height , 0 , 0 , 1 , 1 , pic ) ;
}
2013-08-21 07:14:39 +00:00
void R2D_SubPic ( float x , float y , float width , float height , mpic_t * pic , float srcx , float srcy , float srcwidth , float srcheight )
2009-11-04 21:16:50 +00:00
{
float newsl , newtl , newsh , newth ;
newsl = ( srcx ) / ( float ) srcwidth ;
newsh = newsl + ( width ) / ( float ) srcwidth ;
newtl = ( srcy ) / ( float ) srcheight ;
newth = newtl + ( height ) / ( float ) srcheight ;
R2D_Image ( x , y , width , height , newsl , newtl , newsh , newth , pic ) ;
}
2011-03-31 11:00:23 +00:00
/* this is an ugly special case drawing func that's only used for the player color selection menu */
2014-03-30 08:55:06 +00:00
void R2D_TransPicTranslate ( float x , float y , int width , int height , qbyte * pic , unsigned int * palette )
2011-03-31 11:00:23 +00:00
{
2013-05-11 05:03:07 +00:00
int v , u ;
2011-03-31 11:00:23 +00:00
unsigned trans [ 64 * 64 ] , * dest ;
qbyte * src ;
dest = trans ;
for ( v = 0 ; v < 64 ; v + + , dest + = 64 )
{
src = & pic [ ( ( v * height ) > > 6 ) * width ] ;
for ( u = 0 ; u < 64 ; u + + )
2014-03-30 08:55:06 +00:00
dest [ u ] = palette [ src [ ( u * width ) > > 6 ] ] ;
2011-03-31 11:00:23 +00:00
}
if ( ! TEXVALID ( translate_texture ) )
{
2014-10-05 20:04:11 +00:00
translate_texture = Image_CreateTexture ( " ***translatedpic*** " , NULL , IF_UIPIC | IF_NOMIPMAP | IF_NOGAMMA ) ;
2013-08-21 07:14:39 +00:00
translate_shader = R_RegisterShader ( " translatedpic " , SUF_2D ,
2011-03-31 11:00:23 +00:00
" { \n "
2013-08-21 07:14:39 +00:00
" if $nofixed \n "
" program default2d \n "
" endif \n "
" nomipmaps \n "
" { \n "
" map $diffuse \n "
" blendfunc blend \n "
2014-03-30 08:55:06 +00:00
" rgbgen vertex \n "
" alphagen vertex \n "
2013-08-21 07:14:39 +00:00
" } \n "
" } \n " ) ;
2015-05-03 19:57:46 +00:00
translate_shader - > defaulttextures - > base = translate_texture ;
2011-03-31 11:00:23 +00:00
}
/* could avoid reuploading already translated textures but this func really isn't used enough anyway */
2014-10-05 20:04:11 +00:00
Image_Upload ( translate_texture , TF_RGBA32 , trans , NULL , 64 , 64 , IF_UIPIC | IF_NOMIPMAP | IF_NOGAMMA ) ;
2011-03-31 11:00:23 +00:00
R2D_ScalePic ( x , y , width , height , translate_shader ) ;
}
2009-11-04 21:16:50 +00:00
/*
= = = = = = = = = = = = = = = =
Draw_ConsoleBackground
= = = = = = = = = = = = = = = =
*/
void R2D_ConsoleBackground ( int firstline , int lastline , qboolean forceopaque )
{
float a ;
int w , h ;
2010-07-11 02:22:39 +00:00
w = vid . width ;
h = vid . height ;
2009-11-04 21:16:50 +00:00
if ( forceopaque )
{
a = 1 ; // console background is necessary
}
else
{
if ( ! scr_conalpha . value )
2011-05-29 04:26:29 +00:00
return ;
2009-11-04 21:16:50 +00:00
a = scr_conalpha . value ;
}
if ( scr_chatmode = = 2 )
{
h > > = 1 ;
w > > = 1 ;
}
2014-10-05 20:04:11 +00:00
if ( R_GetShaderSizes ( conback , NULL , NULL , false ) < = 0 )
2013-10-08 14:28:11 +00:00
{
R2D_ImageColours ( 0 , 0 , 0 , a ) ;
R2D_FillBlock ( 0 , lastline - ( int ) vid . height , w , h ) ;
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
}
else if ( a > = 1 )
2009-11-04 21:16:50 +00:00
{
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
2010-07-11 02:22:39 +00:00
R2D_ScalePic ( 0 , lastline - ( int ) vid . height , w , h , conback ) ;
2009-11-04 21:16:50 +00:00
}
else
{
R2D_ImageColours ( 1 , 1 , 1 , a ) ;
2010-07-11 02:22:39 +00:00
R2D_ScalePic ( 0 , lastline - ( int ) vid . height , w , h , conback ) ;
2009-11-04 21:16:50 +00:00
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
}
}
void R2D_EditorBackground ( void )
{
2012-11-27 03:23:19 +00:00
R2D_ImageColours ( 0 , 0 , 0 , 1 ) ;
R2D_FillBlock ( 0 , 0 , vid . width , vid . height ) ;
// R2D_ScalePic(0, 0, vid.width, vid.height, conback);
2009-11-04 21:16:50 +00:00
}
/*
= = = = = = = = = = = = =
Draw_TileClear
This repeats a 64 * 64 tile graphic to fill the screen around a sized down
refresh window .
= = = = = = = = = = = = =
*/
2013-08-21 07:14:39 +00:00
void R2D_TileClear ( float x , float y , float w , float h )
2009-11-04 21:16:50 +00:00
{
float newsl , newsh , newtl , newth ;
newsl = ( x ) / ( float ) 64 ;
newsh = newsl + ( w ) / ( float ) 64 ;
newtl = ( y ) / ( float ) 64 ;
newth = newtl + ( h ) / ( float ) 64 ;
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
2015-08-04 15:16:24 +00:00
R2D_Image ( x , y , w , h , newsl , newtl , newsh , newth , draw_backtile ) ;
2009-11-04 21:16:50 +00:00
}
2015-04-21 04:12:00 +00:00
void QDECL R2D_Conback_Callback ( struct cvar_s * var , char * oldvalue )
2009-11-04 21:16:50 +00:00
{
2013-10-08 14:28:11 +00:00
if ( qrenderer = = QR_NONE | | ! strcmp ( var - > string , " none " ) )
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
{
conback = NULL ;
return ;
}
2011-03-31 11:00:23 +00:00
2009-11-04 21:16:50 +00:00
if ( * var - > string )
conback = R_RegisterPic ( var - > string ) ;
2014-10-05 20:04:11 +00:00
if ( ! R_GetShaderSizes ( conback , NULL , NULL , true ) )
2010-07-11 02:22:39 +00:00
{
2014-10-05 20:04:11 +00:00
conback = R_RegisterCustom ( " console " , SUF_2D , NULL , NULL ) ; //quake3
if ( ! R_GetShaderSizes ( conback , NULL , NULL , true ) )
2010-07-11 02:22:39 +00:00
{
2014-10-05 20:04:11 +00:00
# ifdef HEXEN2
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 ( M_GameType ( ) = = MGT_HEXEN2 )
conback = R_RegisterPic ( " gfx/menu/conback.lmp " ) ;
2014-10-05 20:04:11 +00:00
else
# endif
if ( M_GameType ( ) = = MGT_QUAKE2 )
2010-07-11 02:22:39 +00:00
conback = R_RegisterPic ( " pics/conback.pcx " ) ;
else
conback = R_RegisterPic ( " gfx/conback.lmp " ) ;
}
}
}
2014-03-30 08:55:06 +00:00
# if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT)
2013-12-02 14:30:30 +00:00
qboolean R2D_Font_WasAdded ( char * buffer , char * fontfilename )
{
char * match ;
if ( ! fontfilename )
return true ;
match = strstr ( buffer , fontfilename ) ;
if ( ! match )
return false ;
if ( ! ( match = = buffer | | match [ - 1 ] = = ' , ' ) )
return false ;
match + = strlen ( fontfilename ) ;
if ( * match & & * match ! = ' , ' )
return false ;
return true ;
}
extern qboolean WinNT ;
void R2D_Font_AddFontLink ( char * buffer , int buffersize , char * fontname )
{
char link [ 1024 ] ;
char * res , * comma , * othercomma , * nl ;
if ( fontname )
if ( MyRegGetStringValueMultiSz ( HKEY_LOCAL_MACHINE , WinNT ? " SOFTWARE \\ Microsoft \\ Windows NT \\ CurrentVersion \\ FontLink \\ SystemLink " : " SOFTWARE \\ Microsoft \\ Windows \\ CurrentVersion \\ FontLink \\ SystemLink " , fontname , link , sizeof ( link ) ) )
{
res = nl = link ;
while ( * nl )
{
nl + = strlen ( nl ) ;
nl + + ;
comma = strchr ( res , ' , ' ) ;
if ( comma )
{
* comma + + = 0 ;
othercomma = strchr ( comma , ' , ' ) ;
if ( othercomma )
* othercomma = 0 ;
}
else
comma = " " ;
if ( ! R2D_Font_WasAdded ( buffer , res ) )
{
Q_strncatz ( buffer , " , " , buffersize ) ;
Q_strncatz ( buffer , res , buffersize ) ;
R2D_Font_AddFontLink ( buffer , buffersize , comma ) ;
}
res = nl ;
}
}
}
------------------------------------------------------------------------
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
# endif
2013-12-29 22:48:28 +00:00
void R2D_Font_Changed ( void )
2010-07-11 02:22:39 +00:00
{
2015-04-14 23:12:17 +00:00
float tsize ;
2013-12-29 22:48:28 +00:00
if ( ! con_textsize . modified )
return ;
con_textsize . modified = false ;
2015-04-14 23:12:17 +00:00
if ( con_textsize . value < 0 )
tsize = ( - con_textsize . value * vid . height ) / vid . pixelheight ;
else
tsize = con_textsize . value ;
if ( ! tsize )
tsize = 8 ;
2013-12-29 22:48:28 +00:00
if ( font_console = = font_default )
font_console = NULL ;
if ( font_console )
Font_Free ( font_console ) ;
font_console = NULL ;
if ( font_default )
Font_Free ( font_default ) ;
font_default = NULL ;
2014-03-30 08:55:06 +00:00
if ( font_tiny )
Font_Free ( font_tiny ) ;
font_tiny = NULL ;
2013-12-29 22:48:28 +00:00
# if defined(MENU_DAT) || defined(CSQC_DAT)
2015-01-21 18:18:37 +00:00
PR_ReloadFonts ( true ) ;
2013-12-29 22:48:28 +00:00
# endif
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 ( qrenderer = = QR_NONE )
------------------------------------------------------------------------
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
return ;
2014-03-30 08:55:06 +00:00
# if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT)
2013-12-29 22:48:28 +00:00
if ( ! strcmp ( gl_font . string , " ? " ) )
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
{
2015-05-14 03:06:58 +00:00
BOOL ( APIENTRY * pChooseFontW ) ( LPCHOOSEFONTW ) = NULL ;
2013-03-12 22:35:33 +00:00
dllfunction_t funcs [ ] =
{
2015-05-14 03:06:58 +00:00
{ ( void * ) & pChooseFontW , " ChooseFontW " } ,
2013-03-12 22:35:33 +00:00
{ NULL }
} ;
2015-05-14 03:06:58 +00:00
LOGFONTW lf = { 0 } ;
CHOOSEFONTW cf = { sizeof ( cf ) } ;
------------------------------------------------------------------------
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
extern HWND mainwindow ;
2013-12-29 22:48:28 +00:00
font_default = Font_LoadFont ( 8 , " " ) ;
2015-04-14 23:12:17 +00:00
if ( tsize ! = 8 )
font_console = Font_LoadFont ( tsize , " " ) ;
2013-12-29 22:48:28 +00:00
if ( ! font_console )
font_console = 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
cf . hwndOwner = mainwindow ;
cf . iPointSize = ( 8 * vid . rotpixelheight ) / vid . height ;
cf . Flags = CF_FORCEFONTEXIST | CF_TTONLY ;
cf . lpLogFont = & lf ;
2013-03-12 22:35:33 +00:00
2015-05-14 03:06:58 +00:00
Sys_LoadLibrary ( " comdlg32.dll " , funcs ) ;
------------------------------------------------------------------------
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
2015-05-14 03:06:58 +00:00
if ( pChooseFontW & & pChooseFontW ( & cf ) )
------------------------------------------------------------------------
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
{
2013-12-02 14:30:30 +00:00
char fname [ MAX_OSPATH * 8 ] ;
2015-05-14 03:06:58 +00:00
char lfFaceName [ MAX_OSPATH ] ;
------------------------------------------------------------------------
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
char * keyname ;
2015-05-14 03:06:58 +00:00
narrowen ( lfFaceName , sizeof ( lfFaceName ) , lf . lfFaceName ) ;
2013-12-02 14:30:30 +00:00
* fname = 0 ;
//FIXME: should enumerate and split & and ignore sizes and () crap.
if ( ! * fname )
------------------------------------------------------------------------
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
{
2015-05-14 03:06:58 +00:00
keyname = va ( " %s%s%s (TrueType) " , lfFaceName , lf . lfWeight > = FW_BOLD ? " Bold " : " " , lf . lfItalic ? " Italic " : " " ) ;
2013-12-02 14:30:30 +00:00
if ( ! MyRegGetStringValue ( HKEY_LOCAL_MACHINE , WinNT ? " SOFTWARE \\ Microsoft \\ Windows NT \\ CurrentVersion \\ Fonts " : " SOFTWARE \\ Microsoft \\ Windows \\ CurrentVersion \\ Fonts " , keyname , fname , sizeof ( fname ) ) )
* fname = 0 ;
------------------------------------------------------------------------
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
}
2013-12-02 14:30:30 +00:00
if ( ! * fname )
------------------------------------------------------------------------
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
{
2015-05-14 03:06:58 +00:00
keyname = va ( " %s (OpenType) " , lfFaceName ) ;
2013-12-02 14:30:30 +00:00
if ( ! MyRegGetStringValue ( HKEY_LOCAL_MACHINE , WinNT ? " SOFTWARE \\ Microsoft \\ Windows NT \\ CurrentVersion \\ Fonts " : " SOFTWARE \\ Microsoft \\ Windows \\ CurrentVersion \\ Fonts " , keyname , fname , sizeof ( fname ) ) )
* fname = 0 ;
------------------------------------------------------------------------
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
}
2013-12-02 14:30:30 +00:00
2015-05-14 03:06:58 +00:00
R2D_Font_AddFontLink ( fname , sizeof ( fname ) , lfFaceName ) ;
2013-12-29 22:48:28 +00:00
Cvar_Set ( & gl_font , fname ) ;
------------------------------------------------------------------------
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
}
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
return ;
}
------------------------------------------------------------------------
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
# endif
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
2013-12-29 22:48:28 +00:00
font_default = Font_LoadFont ( 8 , gl_font . string ) ;
if ( ! font_default & & * gl_font . string )
font_default = Font_LoadFont ( 8 , " " ) ;
2015-04-14 23:12:17 +00:00
if ( tsize ! = 8 )
2013-12-29 22:48:28 +00:00
{
2015-04-14 23:12:17 +00:00
font_console = Font_LoadFont ( tsize , gl_font . string ) ;
2013-12-29 22:48:28 +00:00
if ( ! font_console )
2015-04-14 23:12:17 +00:00
font_console = Font_LoadFont ( tsize , " " ) ;
2013-12-29 22:48:28 +00:00
}
if ( ! font_console )
font_console = font_default ;
}
2015-04-21 04:12:00 +00:00
static void QDECL R2D_Font_Callback ( struct cvar_s * var , char * oldvalue )
2013-12-29 22:48:28 +00:00
{
con_textsize . modified = true ;
2009-11-04 21:16:50 +00:00
}
2010-11-22 02:03:28 +00:00
// console size manipulation callbacks
void R2D_Console_Resize ( void )
{
extern cvar_t gl_font ;
extern cvar_t vid_conwidth , vid_conheight ;
int cwidth , cheight ;
float xratio ;
float yratio = 0 ;
2011-02-25 04:22:14 +00:00
float ang , rad ;
extern cvar_t gl_screenangle ;
2015-08-11 09:14:33 +00:00
int fbwidth = vid . pixelwidth ;
int fbheight = vid . pixelheight ;
if ( vid . framebuffer )
{
fbwidth = vid . framebuffer - > width ;
fbheight = vid . framebuffer - > height ;
}
2011-02-25 04:22:14 +00:00
ang = ( gl_screenangle . value > 0 ? ( gl_screenangle . value + 45 ) : ( gl_screenangle . value - 45 ) ) / 90 ;
ang = ( int ) ang * 90 ;
if ( ang )
{
rad = ( ang * M_PI ) / 180 ;
2015-08-11 09:14:33 +00:00
vid . rotpixelwidth = fabs ( cos ( rad ) ) * ( fbwidth ) + fabs ( sin ( rad ) ) * ( fbheight ) ;
vid . rotpixelheight = fabs ( sin ( rad ) ) * ( fbwidth ) + fabs ( cos ( rad ) ) * ( fbheight ) ;
2011-02-25 04:22:14 +00:00
}
else
{
2015-08-11 09:14:33 +00:00
vid . rotpixelwidth = fbwidth ;
vid . rotpixelheight = fbheight ;
2011-02-25 04:22:14 +00:00
}
2010-11-22 02:03:28 +00:00
cwidth = vid_conwidth . value ;
cheight = vid_conheight . value ;
xratio = vid_conautoscale . value ;
if ( xratio > 0 )
{
char * s = strchr ( vid_conautoscale . string , ' ' ) ;
if ( s )
yratio = atof ( s + 1 ) ;
2011-05-29 04:26:29 +00:00
2010-11-22 02:03:28 +00:00
if ( yratio < = 0 )
yratio = xratio ;
xratio = 1 / xratio ;
yratio = 1 / yratio ;
//autoscale overrides conwidth/height (without actually changing them)
2011-02-25 04:22:14 +00:00
cwidth = vid . rotpixelwidth ;
cheight = vid . rotpixelheight ;
2010-11-22 02:03:28 +00:00
}
else
{
xratio = 1 ;
yratio = 1 ;
}
2013-12-17 22:45:37 +00:00
if ( ! cwidth & & ! cheight )
cheight = 480 ;
2014-04-24 01:53:01 +00:00
if ( cheight & & ! cwidth & & vid . rotpixelheight )
2013-12-17 22:45:37 +00:00
cwidth = ( cheight * vid . rotpixelwidth ) / vid . rotpixelheight ;
2014-04-24 01:53:01 +00:00
if ( cwidth & & ! cheight & & vid . rotpixelwidth )
2013-12-17 22:45:37 +00:00
cheight = ( cwidth * vid . rotpixelheight ) / vid . rotpixelwidth ;
2010-11-22 02:03:28 +00:00
if ( ! cwidth )
2011-02-25 04:22:14 +00:00
cwidth = vid . rotpixelwidth ;
2010-11-22 02:03:28 +00:00
if ( ! cheight )
2011-02-25 04:22:14 +00:00
cheight = vid . rotpixelheight ;
2010-11-22 02:03:28 +00:00
cwidth * = xratio ;
cheight * = yratio ;
if ( cwidth < 320 )
cwidth = 320 ;
if ( cheight < 200 )
cheight = 200 ;
vid . width = cwidth ;
vid . height = cheight ;
Cvar_ForceCallback ( & gl_font ) ;
# ifdef PLUGINS
Plug_ResChanged ( ) ;
# endif
}
2015-04-21 04:12:00 +00:00
static void QDECL R2D_Conheight_Callback ( struct cvar_s * var , char * oldvalue )
2010-11-22 02:03:28 +00:00
{
if ( var - > value > 1536 ) //anything higher is unreadable.
{
Cvar_ForceSet ( var , " 1536 " ) ;
return ;
}
if ( var - > value < 200 & & var - > value ) //lower would be wrong
{
Cvar_ForceSet ( var , " 200 " ) ;
return ;
}
R2D_Console_Resize ( ) ;
}
2015-04-21 04:12:00 +00:00
static void QDECL R2D_Conwidth_Callback ( struct cvar_s * var , char * oldvalue )
2010-11-22 02:03:28 +00:00
{
//let let the user be too crazy
if ( var - > value > 2048 ) //anything higher is unreadable.
{
Cvar_ForceSet ( var , " 2048 " ) ;
return ;
}
if ( var - > value < 320 & & var - > value ) //lower would be wrong
{
Cvar_ForceSet ( var , " 320 " ) ;
return ;
}
R2D_Console_Resize ( ) ;
}
2015-04-21 04:12:00 +00:00
static void QDECL R2D_Conautoscale_Callback ( struct cvar_s * var , char * oldvalue )
2010-11-22 02:03:28 +00:00
{
R2D_Console_Resize ( ) ;
}
2015-04-21 04:12:00 +00:00
static void QDECL R2D_ScreenAngle_Callback ( struct cvar_s * var , char * oldvalue )
2011-02-25 04:22:14 +00:00
{
R2D_Console_Resize ( ) ;
}
2010-05-01 22:47:47 +00:00
/*
= = = = = = = = = = = =
R_PolyBlend
= = = = = = = = = = = =
*/
2012-01-17 07:57:46 +00:00
//bright flashes and stuff, game only, doesn't touch sbar
2010-05-01 22:47:47 +00:00
void R2D_PolyBlend ( void )
{
if ( ! sw_blend [ 3 ] )
return ;
2014-03-31 17:06:41 +00:00
if ( r_refdef . flags & RDF_NOWORLDMODEL )
2010-05-01 22:47:47 +00:00
return ;
R2D_ImageColours ( sw_blend [ 0 ] , sw_blend [ 1 ] , sw_blend [ 2 ] , sw_blend [ 3 ] ) ;
2012-01-17 07:57:46 +00:00
R2D_ScalePic ( r_refdef . vrect . x , r_refdef . vrect . y , r_refdef . vrect . width , r_refdef . vrect . height , shader_polyblend ) ;
2010-08-16 02:03:02 +00:00
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
2010-05-01 22:47:47 +00:00
}
//for lack of hardware gamma
void R2D_BrightenScreen ( void )
{
float f ;
RSpeedMark ( ) ;
2013-08-27 13:18:09 +00:00
if ( fabs ( v_contrast . value - 1.0 ) < 0.05 & & fabs ( v_brightness . value - 0 ) < 0.05 & & fabs ( v_gamma . value - 1 ) < 0.05 )
2010-05-01 22:47:47 +00:00
return ;
2013-12-17 22:45:37 +00:00
//don't go crazy with brightness. that makes it unusable and is thus unsafe - and worse, lots of people assume its based around 1 (like gamma and contrast are). cap to 0.5
if ( v_brightness . value > 0.5 )
v_brightness . value = 0.5 ;
2015-04-14 23:12:17 +00:00
if ( v_contrast . value < 0.5 )
v_contrast . value = 0.5 ;
2013-12-17 22:45:37 +00:00
2013-11-21 23:02:28 +00:00
if ( r2d_canhwgamma )
2013-05-11 14:02:55 +00:00
return ;
2010-05-01 22:47:47 +00:00
2014-03-30 00:39:37 +00:00
TRACE ( ( " R2D_BrightenScreen: brightening \n " ) ) ;
2013-05-11 14:02:55 +00:00
if ( v_gamma . value ! = 1 & & shader_gammacb - > prog )
2010-05-01 22:47:47 +00:00
{
2013-05-11 14:02:55 +00:00
//this should really be done properly, with render-to-texture
R2D_ImageColours ( v_gamma . value , v_contrast . value , v_brightness . value , 1 ) ;
R2D_ScalePic ( 0 , vid . height , vid . width , - ( int ) vid . height , shader_gammacb ) ;
}
else
{
f = v_contrast . value ;
f = min ( f , 3 ) ;
while ( f > 1 )
2012-11-27 03:23:19 +00:00
{
2013-05-11 14:02:55 +00:00
if ( f > = 2 )
{
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
f * = 0.5 ;
}
else
{
R2D_ImageColours ( f - 1 , f - 1 , f - 1 , 1 ) ;
f = 1 ;
}
R2D_ScalePic ( 0 , 0 , vid . width , vid . height , shader_contrastup ) ;
2012-11-27 03:23:19 +00:00
}
2013-05-11 14:02:55 +00:00
if ( f < 1 )
2012-11-27 03:23:19 +00:00
{
2013-05-11 14:02:55 +00:00
R2D_ImageColours ( f , f , f , 1 ) ;
R2D_ScalePic ( 0 , 0 , vid . width , vid . height , shader_contrastdown ) ;
2012-11-27 03:23:19 +00:00
}
2013-05-11 14:02:55 +00:00
if ( v_brightness . value )
{
R2D_ImageColours ( v_brightness . value , v_brightness . value , v_brightness . value , 1 ) ;
R2D_ScalePic ( 0 , 0 , vid . width , vid . height , shader_brightness ) ;
}
2010-05-01 22:47:47 +00:00
}
2010-08-16 02:03:02 +00:00
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
2010-05-01 22:47:47 +00:00
2013-05-11 14:02:55 +00:00
/*make sure the hud is redrawn after if needed*/
2012-01-17 07:57:46 +00:00
Sbar_Changed ( ) ;
2010-05-01 22:47:47 +00:00
RSpeedEnd ( RSPEED_PALETTEFLASHES ) ;
}
2011-03-12 13:51:40 +00:00
//for menus
void R2D_FadeScreen ( void )
{
R2D_ScalePic ( 0 , 0 , vid . width , vid . height , shader_menutint ) ;
Sbar_Changed ( ) ;
}
2011-03-31 19:46:26 +00:00
//crosshairs
# define CS_HEIGHT 8
# define CS_WIDTH 8
unsigned char crosshair_pixels [ ] =
{
// 2 + (spaced)
0x08 ,
0x00 ,
0x08 ,
0x55 ,
0x08 ,
0x00 ,
0x08 ,
0x00 ,
// 3 +
0x00 ,
0x08 ,
0x08 ,
0x36 ,
0x08 ,
0x08 ,
0x00 ,
0x00 ,
// 4 X
0x00 ,
0x22 ,
0x14 ,
0x00 ,
0x14 ,
0x22 ,
0x00 ,
0x00 ,
// 5 X (spaced)
0x41 ,
0x00 ,
0x14 ,
0x00 ,
0x14 ,
0x00 ,
0x41 ,
0x00 ,
// 6 diamond (unconnected)
0x00 ,
0x14 ,
0x22 ,
0x00 ,
0x22 ,
0x14 ,
0x00 ,
0x00 ,
// 7 diamond
0x00 ,
0x08 ,
0x14 ,
0x22 ,
0x14 ,
0x08 ,
0x00 ,
0x00 ,
// 8 four points
0x00 ,
0x08 ,
0x00 ,
0x22 ,
0x00 ,
0x08 ,
0x00 ,
0x00 ,
// 9 three points
0x00 ,
0x00 ,
0x08 ,
0x00 ,
0x22 ,
0x00 ,
0x00 ,
0x00 ,
// 10
0x08 ,
0x2a ,
0x00 ,
0x63 ,
0x00 ,
0x2a ,
0x08 ,
0x00 ,
// 11
0x49 ,
0x2a ,
0x00 ,
0x63 ,
0x00 ,
0x2a ,
0x49 ,
0x00 ,
// 12 horizontal line
0x00 ,
0x00 ,
0x00 ,
0x77 ,
0x00 ,
0x00 ,
0x00 ,
0x00 ,
// 13 vertical line
0x08 ,
0x08 ,
0x08 ,
0x00 ,
0x08 ,
0x08 ,
0x08 ,
0x00 ,
// 14 larger +
0x08 ,
0x08 ,
0x08 ,
0x77 ,
0x08 ,
0x08 ,
0x08 ,
0x00 ,
// 15 angle
0x00 ,
0x00 ,
0x00 ,
0x70 ,
0x08 ,
0x08 ,
0x08 ,
0x00 ,
// 16 dot
0x00 ,
0x00 ,
0x00 ,
0x08 ,
0x00 ,
0x00 ,
0x00 ,
0x00 ,
// 17 weird angle thing
0x00 ,
0x00 ,
0x00 ,
0x38 ,
0x48 ,
0x08 ,
0x10 ,
0x00 ,
// 18 circle w/ dot
0x00 ,
0x00 ,
0x00 ,
0x6b ,
0x41 ,
0x63 ,
0x3e ,
0x08 ,
// 19 tripoint
0x08 ,
0x08 ,
0x08 ,
0x00 ,
0x14 ,
0x22 ,
0x41 ,
0x00 ,
} ;
void R2D_Crosshair_Update ( void )
{
int crossdata [ CS_WIDTH * CS_HEIGHT ] ;
int c ;
int w , h ;
unsigned char * x ;
c = crosshair . ival ;
2011-04-30 17:21:10 +00:00
if ( ! crosshairimage . string )
return ;
else if ( crosshairimage . string [ 0 ] & & c = = 1 )
2011-03-31 19:46:26 +00:00
{
2015-05-03 19:57:46 +00:00
shader_crosshair - > defaulttextures - > base = R_LoadHiResTexture ( crosshairimage . string , " crosshairs " , IF_UIPIC | IF_NOMIPMAP | IF_NOGAMMA ) ;
if ( TEXVALID ( shader_crosshair - > defaulttextures - > base ) )
2011-03-31 19:46:26 +00:00
return ;
}
else if ( c < = 1 )
return ;
c - = 2 ;
c = c % ( sizeof ( crosshair_pixels ) / ( CS_HEIGHT * sizeof ( * crosshair_pixels ) ) ) ;
if ( ! TEXVALID ( ch_int_texture ) )
2014-10-05 20:04:11 +00:00
ch_int_texture = Image_CreateTexture ( " ***crosshair*** " , NULL , IF_UIPIC | IF_NOMIPMAP ) ;
2015-05-03 19:57:46 +00:00
shader_crosshair - > defaulttextures - > base = ch_int_texture ;
2011-03-31 19:46:26 +00:00
Q_memset ( crossdata , 0 , sizeof ( crossdata ) ) ;
x = crosshair_pixels + ( CS_HEIGHT * c ) ;
for ( h = 0 ; h < CS_HEIGHT ; h + + )
{
int pix = x [ h ] ;
for ( w = 0 ; w < CS_WIDTH ; w + + )
{
if ( pix & 0x1 )
crossdata [ CS_WIDTH * h + w ] = 0xffffffff ;
pix > > = 1 ;
}
}
2014-10-05 20:04:11 +00:00
Image_Upload ( ch_int_texture , TF_RGBA32 , crossdata , NULL , CS_WIDTH , CS_HEIGHT , IF_UIPIC | IF_NOMIPMAP | IF_NOGAMMA ) ;
2011-03-31 19:46:26 +00:00
}
2015-04-21 04:12:00 +00:00
static void QDECL R2D_CrosshairImage_Callback ( struct cvar_s * var , char * oldvalue )
2011-03-31 19:46:26 +00:00
{
R2D_Crosshair_Update ( ) ;
}
2015-04-21 04:12:00 +00:00
static void QDECL R2D_Crosshair_Callback ( struct cvar_s * var , char * oldvalue )
2011-03-31 19:46:26 +00:00
{
R2D_Crosshair_Update ( ) ;
}
2015-04-21 04:12:00 +00:00
static void QDECL R2D_CrosshairColor_Callback ( struct cvar_s * var , char * oldvalue )
2011-03-31 19:46:26 +00:00
{
SCR_StringToRGB ( var - > string , ch_color , 255 ) ;
ch_color [ 0 ] = bound ( 0 , ch_color [ 0 ] , 1 ) ;
ch_color [ 1 ] = bound ( 0 , ch_color [ 1 ] , 1 ) ;
ch_color [ 2 ] = bound ( 0 , ch_color [ 2 ] , 1 ) ;
}
void R2D_DrawCrosshair ( void )
{
int x , y ;
int sc ;
float sx , sy , sizex , sizey ;
2013-03-12 22:53:23 +00:00
float size ;
2011-03-31 19:46:26 +00:00
if ( crosshair . ival < 1 )
return ;
2011-05-29 04:26:29 +00:00
// old style
2011-03-31 19:46:26 +00:00
if ( crosshair . ival = = 1 & & ! crosshairimage . string [ 0 ] )
{
2011-06-24 01:05:43 +00:00
// adjust console crosshair scale to match default
2013-03-12 22:53:23 +00:00
size = crosshairsize . value ;
2011-06-24 01:05:43 +00:00
if ( size = = 0 )
size = 8 ;
else if ( size < 0 )
size = - size ;
2011-03-31 19:46:26 +00:00
for ( sc = 0 ; sc < cl . splitclients ; sc + + )
{
2013-08-27 13:18:09 +00:00
SCR_CrosshairPosition ( & cl . playerview [ sc ] , & sx , & sy ) ;
2013-12-29 22:48:28 +00:00
Font_BeginScaledString ( font_default , sx , sy , size , size , & sx , & sy ) ;
2015-07-14 14:47:00 +00:00
sx - = Font_CharScaleWidth ( CON_WHITEMASK , ' + ' | 0xe000 ) / 2 ;
2013-03-12 22:53:23 +00:00
sy - = Font_CharScaleHeight ( ) / 2 ;
2011-03-31 19:46:26 +00:00
Font_ForceColour ( ch_color [ 0 ] , ch_color [ 1 ] , ch_color [ 2 ] , crosshairalpha . value ) ;
2015-07-14 14:47:00 +00:00
Font_DrawScaleChar ( sx , sy , CON_WHITEMASK , ' + ' | 0xe000 ) ;
2011-03-31 19:46:26 +00:00
Font_InvalidateColour ( ) ;
2013-12-29 22:48:28 +00:00
Font_EndString ( font_default ) ;
2011-03-31 19:46:26 +00:00
}
return ;
}
size = crosshairsize . value ;
if ( size < 0 )
{
size = - size ;
sizex = size ;
sizey = size ;
}
else
{
sizex = ( size * vid . rotpixelwidth ) / ( float ) vid . width ;
sizey = ( size * vid . rotpixelheight ) / ( float ) vid . height ;
}
sizex = ( int ) sizex ;
sizex = ( ( sizex ) * ( int ) vid . width ) / ( float ) vid . rotpixelwidth ;
sizey = ( int ) sizey ;
sizey = ( ( sizey ) * ( int ) vid . height ) / ( float ) vid . rotpixelheight ;
R2D_ImageColours ( ch_color [ 0 ] , ch_color [ 1 ] , ch_color [ 2 ] , crosshairalpha . value ) ;
for ( sc = 0 ; sc < cl . splitclients ; sc + + )
{
2013-08-27 13:18:09 +00:00
SCR_CrosshairPosition ( & cl . playerview [ sc ] , & sx , & sy ) ;
2011-03-31 19:46:26 +00:00
//translate to pixel coord, for rounding
2013-08-27 13:18:09 +00:00
x = ( ( sx - sizex + ( sizex / CS_WIDTH ) ) * vid . rotpixelwidth ) / ( float ) vid . width ;
y = ( ( sy - sizey + ( sizey / CS_HEIGHT ) ) * vid . rotpixelheight ) / ( float ) vid . height ;
2011-03-31 19:46:26 +00:00
//translate to screen coords
sx = ( ( x ) * ( int ) vid . width ) / ( float ) vid . rotpixelwidth ;
sy = ( ( y ) * ( int ) vid . height ) / ( float ) vid . rotpixelheight ;
R2D_Image ( sx , sy , sizex * 2 , sizey * 2 , 0 , 0 , 1 , 1 , shader_crosshair ) ;
}
R2D_ImageColours ( 1 , 1 , 1 , 1 ) ;
}
2014-10-14 16:42:48 +00:00
# define RT_IMAGEFLAGS IF_NOMIPMAP|IF_CLAMP|IF_LINEAR|IF_RENDERTARGET
2014-08-03 14:47:47 +00:00
static texid_t internalrt ;
2014-02-07 08:38:40 +00:00
//resize a texture for a render target and specify the format of it.
//pass TF_INVALID and sizes=0 to get without configuring (shaders that hardcode an $rt1 etc).
2014-08-03 14:47:47 +00:00
texid_t R2D_RT_Configure ( const char * id , int width , int height , uploadfmt_t rtfmt )
2014-02-07 08:38:40 +00:00
{
2014-08-03 14:47:47 +00:00
texid_t tid ;
if ( ! strcmp ( id , " - " ) )
2014-02-07 08:38:40 +00:00
{
2014-10-05 20:04:11 +00:00
internalrt = tid = Image_CreateTexture ( " " , NULL , RT_IMAGEFLAGS ) ;
2014-08-03 14:47:47 +00:00
}
else
{
2014-10-05 20:04:11 +00:00
tid = Image_FindTexture ( id , NULL , RT_IMAGEFLAGS ) ;
2014-08-03 14:47:47 +00:00
if ( ! TEXVALID ( tid ) )
2014-10-05 20:04:11 +00:00
tid = Image_CreateTexture ( id , NULL , RT_IMAGEFLAGS ) ;
2014-02-07 08:38:40 +00:00
}
2014-10-05 20:04:11 +00:00
2014-02-07 08:38:40 +00:00
if ( rtfmt )
{
2014-10-05 20:04:11 +00:00
Image_Upload ( tid , rtfmt , NULL , NULL , width , height , RT_IMAGEFLAGS ) ;
tid - > width = width ;
tid - > height = height ;
2014-02-07 08:38:40 +00:00
}
2014-08-03 14:47:47 +00:00
return tid ;
2014-02-07 08:38:40 +00:00
}
2014-08-03 14:47:47 +00:00
texid_t R2D_RT_GetTexture ( const char * id , unsigned int * width , unsigned int * height )
2014-02-07 08:38:40 +00:00
{
2014-08-03 14:47:47 +00:00
texid_t tid ;
if ( ! strcmp ( id , " - " ) )
2014-10-05 20:04:11 +00:00
{
2014-08-03 14:47:47 +00:00
tid = internalrt ;
2014-10-05 20:04:11 +00:00
internalrt = r_nulltex ;
}
2014-08-03 14:47:47 +00:00
else
2014-10-05 20:04:11 +00:00
tid = Image_FindTexture ( id , NULL , RT_IMAGEFLAGS ) ;
2014-08-03 14:47:47 +00:00
2014-10-05 20:04:11 +00:00
if ( tid )
2014-02-07 08:38:40 +00:00
{
2014-10-05 20:04:11 +00:00
* width = tid - > width ;
* height = tid - > height ;
2014-02-07 08:38:40 +00:00
}
2014-08-03 14:47:47 +00:00
else
2014-02-07 08:38:40 +00:00
{
2014-08-03 14:47:47 +00:00
* width = 0 ;
* height = 0 ;
2014-02-07 08:38:40 +00:00
}
2014-08-03 14:47:47 +00:00
return tid ;
2014-03-30 08:55:06 +00:00
}
2009-11-04 21:16:50 +00:00
# endif
2013-03-12 22:35:33 +00:00