2016-07-12 00:40:13 +00:00
# ifdef VKQUAKE
# if defined(__LP64__) || defined(_WIN64)
2017-08-14 16:38:44 +00:00
# define VulkanAPIRandomness void*
2016-08-25 00:12:14 +00:00
# elif defined(_MSC_VER) && _MSC_VER < 1300
2017-08-14 16:38:44 +00:00
# define VulkanAPIRandomness __int64
2016-07-12 00:40:13 +00:00
# else
2017-08-14 16:38:44 +00:00
# define VulkanAPIRandomness long long
2016-07-12 00:40:13 +00:00
# endif
2017-08-14 16:38:44 +00:00
# define VkRetardedDescriptorSet VulkanAPIRandomness
# define VkRetardedShaderModule VulkanAPIRandomness
# define VkRetardedPipelineLayout VulkanAPIRandomness
# define VkRetardedDescriptorSetLayout VulkanAPIRandomness
# define VkRetardedBuffer VulkanAPIRandomness
# define VkRetardedDeviceMemory VulkanAPIRandomness
2016-07-12 00:40:13 +00:00
# endif
2004-08-23 00:15:46 +00:00
//These are defined later in the source tree. This file should probably be moved to a later spot.
------------------------------------------------------------------------
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
struct pubprogfuncs_s ;
2004-08-23 00:15:46 +00:00
struct globalvars_s ;
struct texture_s ;
2011-01-23 03:51:27 +00:00
struct texnums_s ;
struct vbo_s ;
struct mesh_s ;
struct batch_s ;
struct entity_s ;
2011-10-27 16:42:53 +00:00
struct dlight_s ;
2011-12-05 15:23:40 +00:00
struct galiasbone_s ;
2014-10-05 20:04:11 +00:00
struct dlight_s ;
2015-04-27 06:19:33 +00:00
struct font_s ;
2004-08-23 00:15:46 +00:00
2014-03-30 08:55:06 +00:00
typedef enum
{
SKEL_RELATIVE , //relative to parent.
SKEL_ABSOLUTE , //relative to model. doesn't blend very well.
SKEL_INVERSE_RELATIVE , //pre-inverted. faster than regular relative but has weirdness with skeletal objects. blends okay.
2015-02-07 22:34:22 +00:00
SKEL_INVERSE_ABSOLUTE , //final renderable type.
2016-07-12 00:40:13 +00:00
SKEL_IDENTITY , //PANIC
SKEL_QUATS //quat+org, 7 floats rather than 12. better lerping.
2014-03-30 08:55:06 +00:00
} skeltype_t ;
2008-12-23 02:55:20 +00:00
# ifdef HALFLIFEMODELS
# define MAX_BONE_CONTROLLERS 5
# endif
2015-02-02 08:01:53 +00:00
# define FRAME_BLENDS 4
2008-12-23 02:55:20 +00:00
# define FST_BASE 0 //base frames
# define FS_REG 1 //regular frames
# define FS_COUNT 2 //regular frames
typedef struct {
2015-02-02 08:01:53 +00:00
struct framestateregion_s {
int frame [ FRAME_BLENDS ] ;
float frametime [ FRAME_BLENDS ] ;
float lerpweight [ FRAME_BLENDS ] ;
2008-12-23 02:55:20 +00:00
# ifdef HALFLIFEMODELS
2017-11-30 17:59:11 +00:00
float subblendfrac ; //hl models are weird
float subblend2frac ; //very weird.
2008-12-23 02:55:20 +00:00
# endif
int endbone ;
------------------------------------------------------------------------
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
} g [ FS_COUNT ] ;
2008-12-23 02:55:20 +00:00
2014-03-30 08:55:06 +00:00
# ifdef SKELETALOBJECTS
2008-12-23 02:55:20 +00:00
float * bonestate ;
int bonecount ;
2014-03-30 08:55:06 +00:00
skeltype_t skeltype ;
# endif
2008-12-23 02:55:20 +00:00
# ifdef HALFLIFEMODELS
float bonecontrols [ MAX_BONE_CONTROLLERS ] ; //hl special bone controllers
# endif
} framestate_t ;
2017-01-29 13:10:53 +00:00
# define NULLFRAMESTATE (framestate_t*)NULL
2008-12-23 02:55:20 +00:00
2004-08-23 00:15:46 +00:00
//function prototypes
# if defined(SERVERONLY)
# define qrenderer QR_NONE
2005-07-16 00:53:08 +00:00
# define FNC(n) (n) //FNC is defined as 'pointer if client build, direct if dedicated server'
2009-07-06 07:45:46 +00:00
2004-08-23 00:15:46 +00:00
# else
# define FNC(n) (*n)
extern r_qrenderer_t qrenderer ;
extern char * q_renderername ;
2015-08-04 15:16:24 +00:00
apic_t * R2D_LoadAtlasedPic ( const char * name ) ;
void R2D_ImageAtlas ( float x , float y , float w , float h , float s1 , float t1 , float s2 , float t2 , apic_t * pic ) ;
# define R2D_ScalePicAtlas(x,y,w,h,p) R2D_ImageAtlas(x,y,w,h,0,0,1,1,p)
2014-03-30 08:55:06 +00:00
mpic_t * R2D_SafeCachePic ( const char * path ) ;
mpic_t * R2D_SafePicFromWad ( const char * name ) ;
2011-03-31 19:46:26 +00:00
void R2D_DrawCrosshair ( void ) ;
2013-08-21 07:14:39 +00:00
void R2D_ScalePic ( float x , float y , float width , float height , mpic_t * pic ) ;
void R2D_SubPic ( float x , float y , float width , float height , mpic_t * pic , float srcx , float srcy , float srcwidth , float srcheight ) ;
2014-03-30 08:55:06 +00:00
void R2D_TransPicTranslate ( float x , float y , int width , int height , qbyte * pic , unsigned int * palette ) ;
2013-08-21 07:14:39 +00:00
void R2D_TileClear ( float x , float y , float w , float h ) ;
2011-03-31 01:14:01 +00:00
void R2D_FadeScreen ( void ) ;
2013-12-29 22:48:28 +00:00
void R2D_Font_Changed ( void ) ;
2011-03-31 01:14:01 +00:00
void R2D_ConsoleBackground ( int firstline , int lastline , qboolean forceopaque ) ;
void R2D_EditorBackground ( void ) ;
void R2D_Image ( float x , float y , float w , float h , float s1 , float t1 , float s2 , float t2 , mpic_t * pic ) ;
2018-06-02 08:55:57 +00:00
void R2D_Image2dQuad ( vec2_t const * points , vec2_t const * texcoords , mpic_t * pic ) ;
2011-03-31 01:14:01 +00:00
void R2D_ImageColours ( float r , float g , float b , float a ) ;
void R2D_ImagePaletteColour ( unsigned int i , float a ) ;
2013-08-21 07:14:39 +00:00
void R2D_FillBlock ( float x , float y , float w , float h ) ;
2015-04-21 04:12:00 +00:00
void R2D_Line ( float x1 , float y1 , float x2 , float y2 , mpic_t * pic ) ;
2015-08-11 09:14:33 +00:00
extern void ( * R2D_Flush ) ( void ) ;
2011-03-31 01:14:01 +00:00
2004-08-23 00:15:46 +00:00
extern void ( * Draw_Init ) ( void ) ;
2004-11-23 01:10:10 +00:00
2004-08-23 00:15:46 +00:00
extern void ( * R_Init ) ( void ) ;
extern void ( * R_DeInit ) ( void ) ;
extern void ( * R_RenderView ) ( void ) ; // must set r_refdef first
extern qboolean ( * VID_Init ) ( rendererstate_t * info , unsigned char * palette ) ;
extern void ( * VID_DeInit ) ( void ) ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
extern char * ( * VID_GetRGBInfo ) ( int * stride , int * truevidwidth , int * truevidheight , enum uploadfmt * fmt ) ; //if stride is negative, then the return value points to the last line intead of the first. this allows it to be freed normally.
2016-07-12 00:40:13 +00:00
extern void ( * VID_SetWindowCaption ) ( const char * msg ) ;
2004-08-23 00:15:46 +00:00
extern void SCR_Init ( void ) ;
extern void SCR_DeInit ( void ) ;
2016-07-12 00:40:13 +00:00
extern qboolean ( * SCR_UpdateScreen ) ( void ) ;
2004-08-23 00:15:46 +00:00
extern void SCR_BeginLoadingPlaque ( void ) ;
extern void SCR_EndLoadingPlaque ( void ) ;
extern void SCR_DrawConsole ( qboolean noback ) ;
extern void SCR_SetUpToDrawConsole ( void ) ;
2017-08-14 16:38:44 +00:00
extern void SCR_CenterPrint ( int pnum , const char * str , qboolean skipgamecode ) ;
2004-08-23 00:15:46 +00:00
2015-04-27 06:19:33 +00:00
void R_DrawTextField ( int x , int y , int w , int h , const char * text , unsigned int defaultmask , unsigned int fieldflags , struct font_s * font , vec2_t fontscale ) ;
2015-02-02 08:01:53 +00:00
# define CPRINT_LALIGN (1<<0) //L
2010-07-11 02:22:39 +00:00
# define CPRINT_TALIGN (1<<1) //T
2015-02-02 08:01:53 +00:00
# define CPRINT_RALIGN (1<<2) //R
# define CPRINT_BALIGN (1<<3) //B
2010-07-11 02:22:39 +00:00
# define CPRINT_BACKGROUND (1<<4) //P
# define CPRINT_OBITUARTY (1<<16) //O (show at 2/3rds from top)
# define CPRINT_PERSIST (1<<17) //P (doesn't time out)
# define CPRINT_TYPEWRITER (1<<18) // (char at a time)
2017-07-28 01:49:25 +00:00
# define CPRINT_CURSOR (1<<19) //C (use a mouse cursor, also enabled by the presence of a (auto) link)
2010-07-11 02:22:39 +00:00
2004-08-23 00:15:46 +00:00
# endif
2013-10-29 17:38:22 +00:00
//mod_purge flags
enum mod_purge_e
{
2017-05-23 07:03:07 +00:00
MP_MAPCHANGED , //new map. old stuff no longer needed, can skip stuff if it'll be expensive.
2013-10-29 17:38:22 +00:00
MP_FLUSH , //user flush command. anything flushable goes.
2017-05-23 07:03:07 +00:00
MP_RESET //*everything* is destroyed. renderer is going down, or at least nothing depends upon it.
2013-10-29 17:38:22 +00:00
} ;
2014-03-30 08:55:06 +00:00
enum mlverbosity_e
{
MLV_SILENT ,
MLV_WARN ,
2015-10-27 15:20:15 +00:00
MLV_WARNSYNC ,
2014-03-30 08:55:06 +00:00
MLV_ERROR
} ;
2013-10-29 17:38:22 +00:00
2016-11-25 08:14:54 +00:00
const char * Mod_GetEntitiesString ( struct model_s * mod ) ;
void Mod_SetEntitiesStringLen ( struct model_s * mod , const char * str , size_t strsize ) ;
void Mod_SetEntitiesString ( struct model_s * mod , const char * str , qboolean docopy ) ;
2016-12-07 18:45:25 +00:00
void Mod_ParseEntities ( struct model_s * mod ) ;
2013-07-14 12:22:51 +00:00
extern void Mod_ClearAll ( void ) ;
2013-10-29 17:38:22 +00:00
extern void Mod_Purge ( enum mod_purge_e type ) ;
2017-05-23 07:03:07 +00:00
extern qboolean Mod_PurgeModel ( struct model_s * mod , enum mod_purge_e ptype ) ;
2014-03-30 08:55:06 +00:00
extern struct model_s * Mod_FindName ( const char * name ) ; //find without loading. needload should be set.
extern struct model_s * Mod_ForName ( const char * name , enum mlverbosity_e verbosity ) ; //finds+loads
extern struct model_s * Mod_LoadModel ( struct model_s * mod , enum mlverbosity_e verbose ) ; //makes sure a model is loaded
2013-07-14 12:22:51 +00:00
extern void * Mod_Extradata ( struct model_s * mod ) ; // handles caching
2014-03-30 08:55:06 +00:00
extern void Mod_TouchModel ( const char * name ) ;
2014-10-05 20:04:11 +00:00
extern const char * Mod_FixName ( const char * modname , const char * worldname ) ; //remaps the name appropriately
2016-11-25 08:14:54 +00:00
const char * Mod_ParseWorldspawnKey ( struct model_s * mod , const char * key , char * buffer , size_t sizeofbuffer ) ;
2004-08-23 00:15:46 +00:00
2017-01-13 00:39:50 +00:00
extern long relitsurface ;
extern struct model_s * lightmodel ;
2013-07-14 12:22:51 +00:00
extern void Mod_Think ( void ) ;
2017-01-13 00:39:50 +00:00
extern qboolean Mod_GetModelEvent ( struct model_s * model , int animation , int eventidx , float * timestamp , int * eventcode , char * * eventdata ) ;
2015-06-24 17:59:57 +00:00
extern int Mod_SkinNumForName ( struct model_s * model , int surfaceidx , const char * name ) ;
extern int Mod_FrameNumForName ( struct model_s * model , int surfaceidx , const char * name ) ;
extern float Mod_GetFrameDuration ( struct model_s * model , int surfaceidx , int framenum ) ;
2016-12-13 11:50:15 +00:00
extern int Mod_GetFrameCount ( struct model_s * model ) ;
2004-08-23 00:15:46 +00:00
# undef FNC
2008-12-23 02:55:20 +00:00
extern qboolean Mod_GetTag ( struct model_s * model , int tagnum , framestate_t * framestate , float * transforms ) ;
2014-03-30 08:55:06 +00:00
extern int Mod_TagNumForName ( struct model_s * model , const char * name ) ;
2007-05-25 23:03:49 +00:00
2017-01-13 00:39:50 +00:00
void Mod_AddSingleSurface ( struct entity_s * ent , int surfaceidx , shader_t * shader ) ;
2008-12-23 02:55:20 +00:00
int Mod_GetNumBones ( struct model_s * model , qboolean allowtags ) ;
2009-04-19 00:50:42 +00:00
int Mod_GetBoneRelations ( struct model_s * model , int firstbone , int lastbone , framestate_t * fstate , float * result ) ;
2008-12-23 02:55:20 +00:00
int Mod_GetBoneParent ( struct model_s * model , int bonenum ) ;
2013-05-03 04:28:08 +00:00
struct galiasbone_s * Mod_GetBoneInfo ( struct model_s * model , int * numbones ) ;
2016-12-13 11:50:15 +00:00
const char * Mod_GetBoneName ( struct model_s * model , int bonenum ) ;
2008-12-23 02:55:20 +00:00
2013-08-27 13:18:09 +00:00
void Draw_FunString ( float x , float y , const void * str ) ;
void Draw_AltFunString ( float x , float y , const void * str ) ;
2015-08-02 11:36:46 +00:00
void Draw_FunStringWidth ( float x , float y , const void * str , int width , int rightalign , qboolean highlight ) ;
2005-01-24 23:47:32 +00:00
2013-03-12 23:09:25 +00:00
extern int r_regsequence ;
2004-08-23 00:15:46 +00:00
# ifdef SERVERONLY
# define Mod_Q1LeafPVS Mod_LeafPVS
2005-09-08 01:47:48 +00:00
// qbyte *Mod_LeafPVS (struct mleaf_s *leaf, struct model_s *model, qbyte *buffer);
2004-08-23 00:15:46 +00:00
# endif
2005-06-22 17:10:13 +00:00
2014-10-05 20:04:11 +00:00
enum
{
TEX_NOTLOADED ,
TEX_LOADING ,
TEX_LOADED ,
TEX_FAILED
} ;
typedef struct image_s
2011-10-27 15:46:36 +00:00
{
2015-10-27 15:20:15 +00:00
# ifdef _DEBUG
char dbgident [ 32 ] ;
# endif
2014-10-05 20:04:11 +00:00
char * ident ; //allocated on end
char * subpath ; //allocated on end
2011-10-27 15:46:36 +00:00
int regsequence ;
2015-08-11 09:14:33 +00:00
int width ; //this is the logical size. the physical size is not considered important (except for render targets, which should not be loaded from disk).
2013-05-11 14:02:55 +00:00
int height ;
2018-03-04 14:41:16 +00:00
int depth ;
uploadfmt_t format ;
2014-10-05 20:04:11 +00:00
int status ; //TEX_
unsigned int flags ;
struct image_s * next ;
struct image_s * prev ;
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
struct image_s * aliasof ;
2016-07-12 00:40:13 +00:00
union
{
int nosyntaxerror ;
2012-05-09 15:30:53 +00:00
# if defined(D3DQUAKE) || defined(SWQUAKE)
2016-07-12 00:40:13 +00:00
struct
{
void * ptr ; //texture
void * ptr2 ; //view
} ;
2011-10-27 15:46:36 +00:00
# endif
2014-10-05 20:04:11 +00:00
# ifdef GLQUAKE
2016-07-12 00:40:13 +00:00
int num ;
# endif
# ifdef VKQUAKE
struct
{
VkRetardedDescriptorSet vkdescriptor ;
struct vk_image_s * vkimage ;
} ;
2014-10-05 20:04:11 +00:00
# endif
2016-07-12 00:40:13 +00:00
} ;
2014-10-05 20:04:11 +00:00
void * fallbackdata ;
int fallbackwidth ;
int fallbackheight ;
uploadfmt_t fallbackfmt ;
} image_t ;
2011-10-27 15:46:36 +00:00
# if 1
2014-10-05 20:04:11 +00:00
typedef image_t * texid_t ;
2011-10-27 15:46:36 +00:00
# define texid_tf texid_t
# define TEXASSIGN(d,s) d=s
# define TEXASSIGNF(d,s) d=s
2014-10-05 20:04:11 +00:00
# define TEXVALID(t) ((t))
# define TEXLOADED(tex) ((tex) && (tex)->status == TEX_LOADED)
2016-07-12 00:40:13 +00:00
# define TEXDOWAIT(tex) do{if ((tex) && (tex)->status == TEX_LOADING) COM_WorkerPartialSync((tex), &(tex)->status, TEX_LOADING);}while(0)
2011-10-27 15:46:36 +00:00
# else
typedef struct texid_s texid_t [ 1 ] ;
typedef struct texid_s texid_tf ;
# define TEXASSIGN(d,s) memcpy(&d,&s,sizeof(d))
# define TEXASSIGNF(d,s) memcpy(&d,&s,sizeof(d))
# define TEXVALID(t) 1
2010-10-02 02:25:39 +00:00
# endif
2013-04-06 03:36:00 +00:00
2017-07-12 08:15:27 +00:00
# define Image_LinearFloatFromsRGBFloat(c) (((c) <= 0.04045f) ? (c) * (1.0f / 12.92f) : (float)pow(((c) + 0.055f)*(1.0f / 1.055f), 2.4f))
# define Image_sRGBFloatFromLinearFloat(c) (((c) < 0.0031308f) ? (c) * 12.92f : 1.055f * (float)pow((c), 1.0f / 2.4f) - 0.055f)
2014-10-05 20:04:11 +00:00
struct pendingtextureinfo
{
enum
{
PTI_2D ,
PTI_3D ,
2018-03-04 14:41:16 +00:00
PTI_CUBEMAP , //mips are packed (to make d3d11 happy)
PTI_2D_ARRAY , //looks like a 3d texture, but depth doesn't change.
PTI_CUBEMAP_ARRAY , //looks like PTI_2D_ARRAY, with depth*6
2014-10-05 20:04:11 +00:00
} type ;
2017-07-12 08:15:27 +00:00
2018-03-04 14:41:16 +00:00
uploadfmt_t encoding ; //0
2017-12-28 16:24:50 +00:00
void * extrafree ;
2014-10-05 20:04:11 +00:00
int mipcount ;
struct
{
void * data ;
size_t datasize ;
int width ;
int height ;
2018-03-04 14:41:16 +00:00
int depth ;
2014-10-05 20:04:11 +00:00
qboolean needfree ;
2017-12-28 16:24:50 +00:00
} mip [ 72 ] ; //enough for a 4096 cubemap. or a really smegging big 2d texture...
2014-10-05 20:04:11 +00:00
} ;
2013-04-06 03:36:00 +00:00
//small context for easy vbo creation.
typedef struct
{
2013-05-11 05:03:07 +00:00
size_t maxsize ;
size_t pos ;
2013-04-06 03:36:00 +00:00
int vboid [ 2 ] ;
2015-08-04 15:16:24 +00:00
void * vboptr [ 2 ] ;
2013-05-11 05:03:07 +00:00
void * fallback ;
2013-04-06 03:36:00 +00:00
} vbobctx_t ;
2016-07-12 00:40:13 +00:00
typedef union vboarray_s
2013-04-06 03:36:00 +00:00
{
2016-07-12 00:40:13 +00:00
void * sysptr ;
2013-04-06 03:36:00 +00:00
# ifdef GLQUAKE
2016-07-12 00:40:13 +00:00
struct
{
int vbo ;
void * addr ;
} gl ;
2013-04-06 03:36:00 +00:00
# endif
2017-03-21 17:35:27 +00:00
# if defined(D3D8QUAKE) || defined(D3D9QUAKE) || defined(D3D11QUAKE)
2016-07-12 00:40:13 +00:00
struct
{
void * buff ;
unsigned int offs ;
} d3d ;
# endif
# ifdef VKQUAKE
struct
{
VkRetardedBuffer buff ;
unsigned int offs ;
} vk ;
2013-04-06 03:36:00 +00:00
# endif
2017-11-14 14:37:04 +00:00
struct
{ //matches the biggest version. currently vulkan. this ensures that plugins can allocate model data without caring about renderers.
qint64_t buff ;
unsigned int offs ;
} pad ;
2013-04-06 03:36:00 +00:00
} vboarray_t ;
2013-06-23 02:17:02 +00:00
//scissor rects
typedef struct
{
float x ;
float y ;
float width ;
float height ;
double dmin ;
double dmax ;
} srect_t ;
2013-03-12 22:56:10 +00:00
typedef struct texnums_s {
2015-05-03 19:57:46 +00:00
char mapname [ MAX_QPATH ] ; //the 'official' name of the diffusemap. used to generate filenames for other textures.
2015-02-07 22:34:22 +00:00
texid_t base ; //regular diffuse texture. may have alpha if surface is transparent
texid_t bump ; //normalmap. height values packed in alpha.
texid_t specular ; //specular lighting values.
texid_t upperoverlay ; //diffuse texture for the upper body(shirt colour). no alpha channel. added to base.rgb
texid_t loweroverlay ; //diffuse texture for the lower body(trouser colour). no alpha channel. added to base.rgb
texid_t paletted ; //8bit paletted data, just because.
2013-03-12 22:56:10 +00:00
texid_t fullbright ;
2015-05-03 19:57:46 +00:00
texid_t reflectcube ;
texid_t reflectmask ;
2013-03-12 22:56:10 +00:00
} texnums_t ;
2011-10-29 19:01:33 +00:00
2011-01-29 19:53:38 +00:00
//not all modes accept meshes - STENCIL(intentional) and DEPTHONLY(not implemented)
typedef enum backendmode_e
{
2016-08-25 00:12:14 +00:00
BEM_STANDARD , //regular mode to draw surfaces akin to q3 (aka: legacy mode). lightmaps+delux+ambient
BEM_DEPTHONLY , //just a quick depth pass. textures used only for alpha test (shadowmaps).
BEM_WIREFRAME , //for debugging or something
BEM_STENCIL , //used for drawing shadow volumes to the stencil buffer.
BEM_DEPTHDARK , //a quick depth pass. textures used only for alpha test. additive textures still shown as normal.
BEM_CREPUSCULAR , //sky is special, everything else completely black
2016-11-20 20:52:41 +00:00
BEM_GBUFFER , //
2016-08-25 00:12:14 +00:00
BEM_FOG , //drawing a fog volume
BEM_LIGHT , //we have a valid light
2011-01-29 19:53:38 +00:00
} backendmode_t ;
2005-06-22 17:10:13 +00:00
2010-02-06 01:25:04 +00:00
typedef struct rendererinfo_s {
2005-06-22 17:10:13 +00:00
char * description ;
2018-07-05 16:21:44 +00:00
char * name [ 5 ] ;
2005-06-22 17:10:13 +00:00
r_qrenderer_t rtype ;
2016-07-12 00:40:13 +00:00
//FIXME: all but the vid stuff really should be filled in by the video code, simplifying system-specific stuff.
2005-06-22 17:10:13 +00:00
2018-03-24 04:02:09 +00:00
//FIXME: remove these...
2005-06-22 17:10:13 +00:00
void ( * Draw_Init ) ( void ) ;
2009-11-04 21:16:50 +00:00
void ( * Draw_Shutdown ) ( void ) ;
2005-06-22 17:10:13 +00:00
2016-08-25 00:12:14 +00:00
void ( * IMG_UpdateFiltering ) ( image_t * imagelist , int filtermip [ 3 ] , int filterpic [ 3 ] , int mipcap [ 2 ] , float anis ) ;
2017-08-14 16:38:44 +00:00
qboolean ( * IMG_LoadTextureMips ) ( texid_t tex , const struct pendingtextureinfo * mips ) ;
2016-08-25 00:12:14 +00:00
void ( * IMG_DestroyTexture ) ( texid_t tex ) ;
2010-10-02 02:25:39 +00:00
2016-08-25 00:12:14 +00:00
void ( * R_Init ) ( void ) ; //FIXME - merge implementations
void ( * R_DeInit ) ( void ) ; //FIXME - merge implementations
void ( * R_RenderView ) ( void ) ; // must set r_refdef first
2005-06-22 17:10:13 +00:00
2018-03-24 04:02:09 +00:00
//FIXME: keep these...
2005-06-22 17:10:13 +00:00
qboolean ( * VID_Init ) ( rendererstate_t * info , unsigned char * palette ) ;
void ( * VID_DeInit ) ( void ) ;
2016-08-25 00:12:14 +00:00
void ( * VID_SwapBuffers ) ( void ) ; //force a buffer swap, regardless of what's displayed.
2016-07-28 15:57:22 +00:00
qboolean ( * VID_ApplyGammaRamps ) ( unsigned int size , unsigned short * ramps ) ;
2014-09-02 02:44:43 +00:00
2016-08-25 00:12:14 +00:00
void * ( * VID_CreateCursor ) ( const char * filename , float hotx , float hoty , float scale ) ; //may be null, stub returns null
2014-09-02 02:44:43 +00:00
qboolean ( * VID_SetCursor ) ( void * cursor ) ; //may be null
2016-08-25 00:12:14 +00:00
void ( * VID_DestroyCursor ) ( void * cursor ) ; //may be null
2014-09-02 02:44:43 +00:00
2016-08-25 00:12:14 +00:00
void ( * VID_SetWindowCaption ) ( const char * msg ) ;
2018-03-24 04:02:09 +00:00
//FIXME: remove these...
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
char * ( * VID_GetRGBInfo ) ( int * bytestride , int * truevidwidth , int * truevidheight , enum uploadfmt * fmt ) ;
2005-06-22 17:10:13 +00:00
2016-07-12 00:40:13 +00:00
qboolean ( * SCR_UpdateScreen ) ( void ) ;
2005-06-22 17:10:13 +00:00
2011-01-04 02:56:16 +00:00
//Select the current render mode and modifier flags
2011-04-20 23:34:13 +00:00
void ( * BE_SelectMode ) ( backendmode_t mode ) ;
2011-01-04 02:56:16 +00:00
/*Draws an entire mesh list from a VBO. vbo can be null, in which case the chain may be drawn without batching.
Rules for using a list : Every mesh must be part of the same VBO , shader , lightmap , and must have the same pointers set */
2011-04-20 23:34:13 +00:00
void ( * BE_DrawMesh_List ) ( shader_t * shader , int nummeshes , struct mesh_s * * mesh , struct vbo_s * vbo , struct texnums_s * texnums , unsigned int be_flags ) ;
2015-05-03 19:57:46 +00:00
void ( * BE_DrawMesh_Single ) ( shader_t * shader , struct mesh_s * meshchain , struct vbo_s * vbo , unsigned int be_flags ) ;
2011-01-04 02:56:16 +00:00
void ( * BE_SubmitBatch ) ( struct batch_s * batch ) ;
struct batch_s * ( * BE_GetTempBatch ) ( void ) ;
//Asks the backend to invoke DrawMeshChain for each surface, and to upload lightmaps as required
2016-11-20 20:52:41 +00:00
void ( * BE_DrawWorld ) ( struct batch_s * * worldbatches ) ;
2011-01-04 02:56:16 +00:00
//called at init, force the display to the right defaults etc
void ( * BE_Init ) ( void ) ;
//Generates an optimised VBO, one for each texture on the map
2016-08-25 00:12:14 +00:00
void ( * BE_GenBrushModelVBO ) ( struct model_s * mod ) ;
2011-01-04 02:56:16 +00:00
//Destroys the given vbo
2017-11-30 17:59:11 +00:00
void ( * BE_ClearVBO ) ( struct vbo_s * vbo , qboolean dataonly ) ;
2011-01-04 02:56:16 +00:00
//Uploads all modified lightmaps
2016-08-25 00:12:14 +00:00
void ( * BE_UploadAllLightmaps ) ( void ) ;
void ( * BE_SelectEntity ) ( struct entity_s * ent ) ;
2014-10-05 20:04:11 +00:00
qboolean ( * BE_SelectDLight ) ( struct dlight_s * dl , vec3_t colour , vec3_t axis [ 3 ] , unsigned int lmode ) ;
2016-08-25 00:12:14 +00:00
void ( * BE_Scissor ) ( srect_t * rect ) ;
2011-01-04 02:56:16 +00:00
/*check to see if an ent should be drawn for the selected light*/
qboolean ( * BE_LightCullModel ) ( vec3_t org , struct model_s * model ) ;
2016-08-25 00:12:14 +00:00
void ( * BE_VBO_Begin ) ( vbobctx_t * ctx , size_t maxsize ) ;
void ( * BE_VBO_Data ) ( vbobctx_t * ctx , void * data , size_t size , vboarray_t * varray ) ;
void ( * BE_VBO_Finish ) ( vbobctx_t * ctx , void * edata , size_t esize , vboarray_t * earray , void * * vbomem , void * * ebomem ) ;
void ( * BE_VBO_Destroy ) ( vboarray_t * vearray , void * mem ) ;
void ( * BE_RenderToTextureUpdate2d ) ( qboolean destchanged ) ;
char * alignment ; //just to make sure that added functions cause compile warnings.
2018-03-24 04:02:09 +00:00
//FIXME: keep this...
2018-04-19 17:30:39 +00:00
int ( * VID_GetPriority ) ( void ) ; //so that eg x11 or wayland can be prioritised depending on environment settings. assumed to be 1.
2018-03-24 04:02:09 +00:00
//FIXME: add getdestopres
//FIXME: add clipboard handling
2005-06-22 17:10:13 +00:00
} rendererinfo_t ;
2010-10-02 02:25:39 +00:00
# define rf currentrendererstate.renderer
2014-03-30 00:39:37 +00:00
# define VID_SwapBuffers rf->VID_SwapBuffers
2011-01-04 02:56:16 +00:00
# define BE_Init rf->BE_Init
# define BE_SelectMode rf->BE_SelectMode
# define BE_GenBrushModelVBO rf->BE_GenBrushModelVBO
# define BE_ClearVBO rf->BE_ClearVBO
# define BE_UploadAllLightmaps rf->BE_UploadAllLightmaps
# define BE_LightCullModel rf->BE_LightCullModel
# define BE_SelectEntity rf->BE_SelectEntity
2011-10-27 15:46:36 +00:00
# define BE_SelectDLight rf->BE_SelectDLight
2011-01-04 02:56:16 +00:00
# define BE_GetTempBatch rf->BE_GetTempBatch
# define BE_SubmitBatch rf->BE_SubmitBatch
# define BE_DrawMesh_List rf->BE_DrawMesh_List
# define BE_DrawMesh_Single rf->BE_DrawMesh_Single
2011-12-05 15:23:40 +00:00
# define BE_SubmitMeshes rf->BE_SubmitMeshes
2011-01-29 19:53:38 +00:00
# define BE_DrawWorld rf->BE_DrawWorld
2013-04-06 03:36:00 +00:00
# define BE_VBO_Begin rf->BE_VBO_Begin
# define BE_VBO_Data rf->BE_VBO_Data
# define BE_VBO_Finish rf->BE_VBO_Finish
# define BE_VBO_Destroy rf->BE_VBO_Destroy
2013-06-23 02:17:02 +00:00
# define BE_Scissor rf->BE_Scissor
2014-02-07 08:38:40 +00:00
2014-02-07 14:57:07 +00:00
# define BE_RenderToTextureUpdate2d rf->BE_RenderToTextureUpdate2d
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
# define RT_IMAGEFLAGS (IF_NOMIPMAP|IF_CLAMP|IF_LINEAR|IF_RENDERTARGET)
2016-10-22 07:06:51 +00:00
texid_t R2D_RT_Configure ( const char * id , int width , int height , uploadfmt_t rtfmt , unsigned int imageflags ) ;
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