2013-04-02 05:18:17 +00:00
# if !defined(MINIMAL) && !defined(OMIT_QCC)
2004-09-07 18:16:59 +00:00
# define PROGSUSED
# include "qcc.h"
2010-07-18 10:01:57 +00:00
# include <sys/stat.h>
2010-07-18 12:14:36 +00:00
# ifdef _WIN32
# include <direct.h>
# endif
------------------------------------------------------------------------
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
# include <time.h>
2004-09-07 18:16:59 +00:00
2011-05-30 04:32:04 +00:00
# include "errno.h"
2020-09-11 01:18:32 +00:00
# define countof(array) (sizeof(array) / sizeof(array[0]))
2017-02-19 00:15:42 +00:00
//#define TODO_READWRITETRACK
2015-04-14 12:24:05 +00:00
//#define DEBUG_DUMP
//#define DISASM "M_Preset"
extern QCC_def_t tempsdef ;
2004-09-07 18:16:59 +00:00
char QCC_copyright [ 1024 ] ;
int QCC_packid ;
char QCC_Packname [ 5 ] [ 128 ] ;
extern int optres_test1 ;
extern int optres_test2 ;
2015-04-14 12:24:05 +00:00
pbool writeasm ;
2022-08-08 22:45:19 +00:00
int verbose ;
# define VERBOSE_WARNINGSONLY -1
# define VERBOSE_PROGRESS 0
2017-03-04 19:36:06 +00:00
# define VERBOSE_STANDARD 1
2020-09-08 04:44:07 +00:00
# define VERBOSE_DEBUG 2
# define VERBOSE_DEBUGSTATEMENTS 3 //figuring out the files can be expensive.
2013-06-13 22:45:15 +00:00
pbool qcc_nopragmaoptimise ;
2015-04-14 12:24:05 +00:00
pbool opt_stripunusedfields ;
2013-09-26 14:36:52 +00:00
extern unsigned int locals_marshalled ;
2015-02-02 08:01:53 +00:00
extern int qccpersisthunk ;
2004-09-07 18:16:59 +00:00
pbool QCC_PR_SimpleGetToken ( void ) ;
2013-12-29 22:48:28 +00:00
void QCC_PR_LexWhitespace ( pbool inhibitpreprocessor ) ;
2022-01-16 18:41:25 +00:00
static char * QCC_PR_String ( char * string ) ;
2004-09-07 18:16:59 +00:00
2018-01-22 19:18:04 +00:00
void * FS_ReadToMem ( char * fname , size_t * len ) ;
2004-09-07 18:16:59 +00:00
void FS_CloseFromMem ( void * mem ) ;
2004-11-04 04:19:10 +00:00
unsigned int MAX_REGS ;
2013-03-12 22:32:25 +00:00
unsigned int MAX_LOCALS = 0x10000 ;
unsigned int MAX_TEMPS = 0x10000 ;
2004-09-07 18:16:59 +00:00
2004-11-04 04:19:10 +00:00
int MAX_STRINGS ;
int MAX_GLOBALS ;
int MAX_FIELDS ;
int MAX_STATEMENTS ;
int MAX_FUNCTIONS ;
2004-09-07 18:16:59 +00:00
int MAX_CONSTANTS ;
int max_temps ;
int * qcc_tempofs ;
int tempsstart ;
2008-11-09 22:29:28 +00:00
# define MAXSOURCEFILESLIST 8
char sourcefileslist [ MAXSOURCEFILESLIST ] [ 1024 ] ;
2020-09-11 01:18:32 +00:00
QCC_def_t * sourcefilesdefs [ MAXSOURCEFILESLIST ] ; //for the gui to peek at.
int sourcefilesnumdefs ; //maximum used...
int currentsourcefile ; //currently compiling file.
int numsourcefiles ; //count pending.
2015-07-06 14:47:46 +00:00
extern char * compilingfile ; //file currently being compiled
char compilingrootfile [ 1024 ] ; //the .src file we started from (the current one, not original)
char qccmsourcedir [ 1024 ] ; //the -src path, for #includes
2008-11-09 22:29:28 +00:00
2006-01-27 08:17:59 +00:00
void QCC_PR_ResetErrorScope ( void ) ;
2018-10-11 10:31:23 +00:00
static void StartNewStyleCompile ( void ) ;
2006-01-27 08:17:59 +00:00
2005-02-28 07:16:19 +00:00
pbool compressoutput ;
2004-09-07 18:16:59 +00:00
pbool newstylesource ;
2015-07-06 14:47:46 +00:00
char destfile [ 1024 ] ; //the file we're going to output to
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
pbool destfile_explicit ; //destfile was override on the commandline, don't let qc change it.
2004-09-07 18:16:59 +00:00
2020-09-29 07:09:01 +00:00
QCC_eval_basic_t * qcc_pr_globals ;
2004-09-07 18:16:59 +00:00
unsigned int numpr_globals ;
char * strings ;
int strofs ;
2014-04-12 03:31:59 +00:00
QCC_statement_t * statements ;
2004-09-07 18:16:59 +00:00
int numstatements ;
2015-04-14 12:24:05 +00:00
QCC_function_t * functions ;
2016-09-08 19:04:35 +00:00
//dfunction_t *dfunctions;
2004-09-07 18:16:59 +00:00
int numfunctions ;
QCC_ddef_t * qcc_globals ;
int numglobaldefs ;
QCC_ddef_t * fields ;
int numfielddefs ;
//typedef char PATHSTRING[MAX_DATA_PATH];
2013-03-12 22:35:33 +00:00
precache_t * precache_sound ;
2004-09-07 18:16:59 +00:00
int numsounds ;
2013-03-12 22:35:33 +00:00
precache_t * precache_texture ;
2004-09-07 18:16:59 +00:00
int numtextures ;
2013-03-12 22:35:33 +00:00
precache_t * precache_model ;
2004-09-07 18:16:59 +00:00
int nummodels ;
2013-03-12 22:35:33 +00:00
precache_t * precache_file ;
2004-09-07 18:16:59 +00:00
int numfiles ;
extern int numCompilerConstants ;
hashtable_t compconstantstable ;
hashtable_t globalstable ;
hashtable_t localstable ;
2017-10-31 22:52:58 +00:00
hashtable_t typedeftable ;
2012-01-01 17:34:32 +00:00
# ifdef WRITEASM
FILE * asmfile ;
2013-06-02 06:03:54 +00:00
pbool asmfilebegun ;
2012-01-01 17:34:32 +00:00
# endif
2004-09-07 18:16:59 +00:00
hashtable_t floatconstdefstable ;
hashtable_t stringconstdefstable ;
2011-10-03 02:45:44 +00:00
hashtable_t stringconstdefstable_trans ;
extern int dotranslate_count ;
2004-09-07 18:16:59 +00:00
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
unsigned char qccwarningaction [ WARN_MAX ] ; //0 = disabled, 1 = warn, 2 = error.
2004-09-07 18:16:59 +00:00
2020-07-13 17:48:16 +00:00
unsigned int qcc_targetversion ;
2004-09-07 18:16:59 +00:00
qcc_targetformat_t qcc_targetformat ;
pbool bodylessfuncs ;
QCC_type_t * qcc_typeinfo ;
int numtypeinfos ;
int maxtypeinfos ;
2018-10-11 10:31:23 +00:00
pbool preprocessonly ;
2020-09-08 04:44:07 +00:00
static pbool flag_dumpfilenames ;
static pbool flag_dumpfields ;
static pbool flag_dumpsymbols ;
static pbool flag_dumpautocvars ;
2021-05-27 11:34:22 +00:00
static pbool flag_dumplocalisation ;
2021-07-06 00:12:27 +00:00
static pbool flag_dumptags ;
2020-09-08 04:44:07 +00:00
2004-09-07 18:16:59 +00:00
struct {
char * name ;
int index ;
} warningnames [ ] =
{
// {"", WARN_NOTREFERENCEDCONST},
// {"", WARN_CONFLICTINGRETURNS},
------------------------------------------------------------------------
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
{ " Q100 " , WARN_PRECOMPILERMESSAGE } ,
{ " Q101 " , WARN_TOOMANYPARAMS } ,
//102: Indirect function: too many parameters
//103: vararg func cannot have more than
//104: type mismatch on parm %i
{ " Q105 " , WARN_TOOFEWPARAMS } ,
2004-09-07 18:16:59 +00:00
// {"", WARN_UNEXPECTEDPUNCT},
------------------------------------------------------------------------
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
{ " Q106 " , WARN_ASSIGNMENTTOCONSTANT } ,
//107: Array index should be type int
//108: Mixed float and int types
//109: Expecting int, float a parameter found
//110: Expecting int, float b parameter found
//112: Null 'if' statement
//113: Null 'else' statement
//114: Type mismatch on redeclaration
//115: redeclared with different number of parms
//116: Local %s redeclared
//117: too many initializers
//118: Too many closing braces
//119: Too many #endifs
{ " Q120 " , WARN_BADPRAGMA } ,
//121: unknown directive
//122: strofs exceeds limit
//123: numstatements exceeds limit
//124: numfunctions exceeds limit
//125: numglobaldefs exceeds limit
//126: numfielddefs exceeds limit
//127: numpr_globals exceeds limit
//128: rededeclared with different parms
2015-07-03 22:00:45 +00:00
{ " F129 " , WARN_COMPATIBILITYHACK } , //multiple errors are replaced by this, for compat purposes.
------------------------------------------------------------------------
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
{ " Q203 " , WARN_MISSINGRETURNVALUE } ,
{ " Q204 " , WARN_WRONGRETURNTYPE } ,
{ " Q205 " , WARN_POINTLESSSTATEMENT } ,
{ " Q206 " , WARN_MISSINGRETURN } ,
{ " Q207 " , WARN_DUPLICATEDEFINITION } , //redeclared different scope
{ " Q208 " , WARN_SYSTEMCRC } ,
2004-09-07 18:16:59 +00:00
// {"", WARN_STRINGTOOLONG},
// {"", WARN_BADTARGET},
------------------------------------------------------------------------
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
//301: %s defined as local in %s
{ " Q302 " , WARN_NOTREFERENCED } , //302: Unreferenced local variable %s from line %i
//401: In function %s parameter %s is unused
2004-09-07 18:16:59 +00:00
// {"", WARN_HANGINGSLASHR},
// {"", WARN_NOTDEFINED},
// {"", WARN_SWITCHTYPEMISMATCH},
// {"", WARN_CONFLICTINGUNIONMEMBER},
// {"", WARN_KEYWORDDISABLED},
// {"", WARN_ENUMFLAGS_NOTINTEGER},
// {"", WARN_ENUMFLAGS_NOTBINARY},
------------------------------------------------------------------------
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
{ " Q111 " , WARN_DUPLICATELABEL } ,
{ " Q201 " , WARN_ASSIGNMENTINCONDITIONAL } ,
{ " F300 " , WARN_DEADCODE } ,
2013-03-12 22:32:25 +00:00
{ " F301 " , WARN_NOTUTF8 } ,
{ " F302 " , WARN_UNINITIALIZED } ,
2013-06-23 02:17:02 +00:00
{ " F303 " , WARN_EVILPREPROCESSOR } ,
2013-07-29 17:34:19 +00:00
{ " F304 " , WARN_UNARYNOTSCOPE } ,
2014-03-30 08:55:06 +00:00
{ " F305 " , WARN_CASEINSENSITIVEFRAMEMACRO } ,
2013-07-29 17:34:19 +00:00
{ " F306 " , WARN_SAMENAMEASGLOBAL } ,
{ " F307 " , WARN_STRICTTYPEMISMATCH } ,
2015-02-02 08:01:53 +00:00
{ " F308 " , WARN_TYPEMISMATCHREDECOPTIONAL } ,
2015-04-14 12:24:05 +00:00
{ " F309 " , WARN_IGNORECOMMANDLINE } ,
2015-07-03 22:00:45 +00:00
{ " F310 " , WARN_MISUSEDAUTOCVAR } ,
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
{ " F311 " , WARN_FTE_SPECIFIC } ,
2016-07-12 00:40:13 +00:00
{ " F312 " , WARN_OVERFLOW } ,
{ " F313 " , WARN_DENORMAL } ,
{ " F314 " , WARN_LAXCAST } ,
2016-09-08 19:04:35 +00:00
{ " F315 " , WARN_DUPLICATEPRECOMPILER } ,
{ " F316 " , WARN_IDENTICALPRECOMPILER } ,
2017-02-01 04:42:33 +00:00
{ " F317 " , WARN_STALEMACRO } ,
{ " F318 " , WARN_DUPLICATEMACRO } ,
2017-08-14 16:38:44 +00:00
{ " F319 " , WARN_CONSTANTCOMPARISON } ,
{ " F320 " , WARN_PARAMWITHNONAME } ,
2017-10-12 12:02:25 +00:00
{ " F321 " , WARN_GMQCC_SPECIFIC } ,
2017-10-31 22:52:58 +00:00
{ " F322 " , WARN_IFSTRING_USED } ,
{ " F323 " , WARN_UNREACHABLECODE } ,
2018-06-06 08:27:53 +00:00
{ " F324 " , WARN_FORMATSTRING } ,
2018-08-18 13:33:50 +00:00
{ " F325 " , WARN_NESTEDCOMMENT } ,
2020-05-20 02:00:37 +00:00
{ " F326 " , WARN_DEPRECATEDVARIABLE } ,
2020-07-13 17:48:16 +00:00
{ " F327 " , WARN_ENUMFLAGS_NOTINTEGER } ,
2020-08-16 04:41:11 +00:00
{ " F328 " , WARN_DEPRECACTEDSYNTAX } ,
2020-09-08 04:44:07 +00:00
{ " F329 " , WARN_REDECLARATIONMISMATCH } ,
{ " F330 " , WARN_MUTEDEPRECATEDVARIABLE } ,
{ " F331 " , WARN_SELFNOTTHIS } ,
2020-09-11 01:18:32 +00:00
{ " F332 " , WARN_DIVISIONBY0 } ,
2020-09-29 07:09:01 +00:00
{ " F333 " , WARN_ARGUMENTCHECK } ,
2023-01-09 05:13:12 +00:00
{ " F334 " , WARN_MISSINGMEMBERQUALIFIER } ,
{ " F335 " , WARN_MEMBERNOTDEFINED } , //defining a new member function inside a class that didn't list it.
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
2017-11-14 14:37:04 +00:00
{ " F207 " , WARN_NOTREFERENCEDFIELD } ,
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
{ " F208 " , WARN_NOTREFERENCEDCONST } ,
{ " F209 " , WARN_EXTRAPRECACHE } ,
{ " F210 " , WARN_NOTPRECACHED } ,
2017-05-22 05:12:01 +00:00
{ " F211 " , WARN_SYSTEMCRC2 } ,
------------------------------------------------------------------------
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
//frikqcc errors
//Q608: PrecacheSound: numsounds
//Q609: PrecacheModels: nummodels
//Q610: PrecacheFile: numfiles
//Q611: Bad parm order
//Q612: PR_CompileFile: Didn't clear (internal error)
//Q614: PR_DefForFieldOfs: couldn't find
//Q613: Error writing error.log
//Q615: Error writing
//Q616: No function named
//Q617: Malloc failure
//Q618: Ran out of mem pointer space (malloc failure again)
2017-10-31 22:52:58 +00:00
//we can put longer alternative names here...
2020-05-20 02:00:37 +00:00
{ " field-redeclared " , WARN_REMOVEDWARNING } ,
2020-09-08 04:44:07 +00:00
{ " deprecated " , WARN_DEPRECATEDVARIABLE } ,
2017-10-31 22:52:58 +00:00
2004-09-07 18:16:59 +00:00
{ NULL }
} ;
------------------------------------------------------------------------
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 * QCC_NameForWarning ( int idx )
{
int i ;
for ( i = 0 ; warningnames [ i ] . name ; i + + )
{
if ( warningnames [ i ] . index = = idx )
return warningnames [ i ] . name ;
}
return NULL ;
}
2015-04-14 12:24:05 +00:00
int QCC_WarningForName ( const char * name )
2004-11-13 17:18:34 +00:00
{
int i ;
for ( i = 0 ; warningnames [ i ] . name ; i + + )
{
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( ! stricmp ( name , warningnames [ i ] . name + 1 ) )
2004-11-13 17:18:34 +00:00
return warningnames [ i ] . index ;
}
return - 1 ;
}
2004-09-07 18:16:59 +00:00
optimisations_t optimisations [ ] =
{
//level 0 = no optimisations
//level 1 = size optimisations
//level 2 = speed optimisations
2013-09-26 14:36:52 +00:00
//level 3 = unsafe optimisations (they break multiprogs).
//level 4 = experimental or extreeme features... must be used explicitly
2005-02-28 07:16:19 +00:00
{ & opt_assignments , " t " , 1 , FLAG_ASDEFAULT , " assignments " , " c = a*b is performed in one operation rather than two, and can cause older decompilers to fail. " } ,
{ & opt_shortenifnots , " i " , 1 , FLAG_ASDEFAULT , " shortenifs " , " if (!a) was traditionally compiled in two statements. This optimisation does it in one, but can cause some decompilers to get confused. " } ,
2005-07-28 15:52:31 +00:00
{ & opt_nonvec_parms , " p " , 1 , FLAG_ASDEFAULT , " nonvec_parms " , " In the original qcc, function parameters were specified as a vector store even for floats. This fixes that. " } ,
2005-02-28 07:16:19 +00:00
{ & opt_constant_names , " c " , 2 , FLAG_KILLSDEBUGGERS , " constant_names " , " This optimisation strips out the names of constants (but not strings) from your progs, resulting in smaller files. It makes decompilers leave out names or fabricate numerical ones. " } ,
{ & opt_constant_names_strings , " cs " , 3 , FLAG_KILLSDEBUGGERS , " constant_names_strings " , " This optimisation strips out the names of string constants from your progs. However, this can break addons, so don't use it in those cases. " } ,
{ & opt_dupconstdefs , " d " , 1 , FLAG_ASDEFAULT , " dupconstdefs " , " This will merge definitions of constants which are the same value. Pay extra attention to assignment to constant warnings. " } ,
2013-09-26 14:36:52 +00:00
{ & opt_noduplicatestrings , " s " , 1 , FLAG_ASDEFAULT , " noduplicatestrings " , " This will compact the string table that is stored in the progs. It will be considerably smaller with this. " } ,
{ & opt_locals , " l " , 1 , FLAG_KILLSDEBUGGERS , " locals " , " Strips out local names and definitions. Most decompiles will break on this. " } ,
2005-02-28 07:16:19 +00:00
{ & opt_function_names , " n " , 1 , FLAG_KILLSDEBUGGERS , " function_names " , " This strips out the names of functions which are never called. Doesn't make much of an impact though. " } ,
{ & opt_filenames , " f " , 1 , FLAG_KILLSDEBUGGERS , " filenames " , " This strips out the filenames of the progs. This can confuse the really old decompilers, but is nothing to the more recent ones. " } ,
2021-06-21 13:44:22 +00:00
// {&opt_unreferenced, "u", 1, FLAG_ASDEFAULT, "unreferenced", "Removes the entries of unreferenced variables. Doesn't make a difference in well maintained code."},
2005-02-28 07:16:19 +00:00
{ & opt_overlaptemps , " r " , 1 , FLAG_ASDEFAULT , " overlaptemps " , " Optimises the pr_globals count by overlapping temporaries. In QC, every multiplication, division or operation in general produces a temporary variable. This optimisation prevents excess, and in the case of Hexen2's gamecode, reduces the count by 50k. This is the most important optimisation, ever. " } ,
{ & opt_constantarithmatic , " a " , 1 , FLAG_ASDEFAULT , " constantarithmatic " , " 5*6 actually emits an operation into the progs. This prevents that happening, effectivly making the compiler see 30 " } ,
{ & opt_precache_file , " pf " , 2 , 0 , " precache_file " , " Strip out stuff wasted used in function calls and strings to the precache_file builtin (which is actually a stub in quake). " } ,
2015-04-14 12:24:05 +00:00
{ & opt_return_only , " ro " , 2 , FLAG_KILLSDEBUGGERS , " return_only " , " Functions ending in a return statement do not need a done statement at the end of the function. This can confuse some decompilers, making functions appear larger than they were. " } ,
{ & opt_compound_jumps , " cj " , 2 , FLAG_KILLSDEBUGGERS , " compound_jumps " , " This optimisation plays an effect mostly with nested if/else statements, instead of jumping to an unconditional jump statement, it'll jump to the final destination instead. This will bewilder decompilers. " } ,
2005-02-28 07:16:19 +00:00
// {&opt_comexprremoval, "cer", 4, 0, "expression_removal", "Eliminate common sub-expressions"}, //this would be too hard...
2018-09-19 02:49:08 +00:00
{ & opt_stripfunctions , " sf " , 3 , FLAG_KILLSDEBUGGERS , " strip_functions " , " Strips out the 'defs' of functions that were only ever called directly. This does not affect saved games, but will prevent FTE_MULTIPROGS/mutators from being able to hook functions. " } ,
2015-04-14 12:24:05 +00:00
{ & opt_locals_overlapping , " lo " , 2 , FLAG_KILLSDEBUGGERS , " locals_overlapping " , " Store all locals in a single section of the pr_globals. Vastly reducing it. This effectivly does the job of overlaptemps. \n However, locals are no longer automatically initialised to 0 (and never were in the case of recursion, but at least then its the same type). \n If locals appear uninitialised, fteqcc will disable this optimisation for the affected functions, you can optionally get a warning about these locals using: #pragma warning enable F302 " } ,
2013-09-26 14:36:52 +00:00
{ & opt_vectorcalls , " vc " , 4 , FLAG_KILLSDEBUGGERS , " vectorcalls " , " Where a function is called with just a vector, this causes the function call to store three floats instead of one vector. This can save a good number of pr_globals where those vectors contain many duplicate coordinates but do not match entirly. " } ,
2014-05-30 03:57:30 +00:00
{ & opt_classfields , " cf " , 2 , FLAG_KILLSDEBUGGERS , " class_fields " , " Strip class field names. This will harm debugging and can result in 'gibberish' names appearing in saved games. Has no effect on engines other than FTEQW, which will not recognise these anyway. " } ,
2018-08-03 11:08:04 +00:00
{ & opt_stripunusedfields , " uf " , 4 , FLAG_KILLSDEBUGGERS , " strip_unused_fields " , " Strips any fields that have no references. This may result in extra warnings at load time, or disabling support for mapper-specified alpha in engines that do not provide that. FIXME: this is a little pointless until relocs are properly implemented. " } ,
2004-09-07 18:16:59 +00:00
{ NULL }
} ;
2017-10-31 22:52:58 +00:00
# define defaultkeyword FLAG_HIDDENINGUI|FLAG_ASDEFAULT|FLAG_MIDCOMPILE
2020-09-08 04:44:07 +00:00
# define typekeyword FLAG_HIDDENINGUI|FLAG_ASDEFAULT
2017-10-31 22:52:58 +00:00
# define nondefaultkeyword FLAG_HIDDENINGUI|0|FLAG_MIDCOMPILE
# define hideflag FLAG_HIDDENINGUI|FLAG_MIDCOMPILE
# define defaultflag FLAG_ASDEFAULT|FLAG_MIDCOMPILE
# define hidedefaultflag FLAG_HIDDENINGUI|FLAG_ASDEFAULT|FLAG_MIDCOMPILE
2005-04-16 16:21:27 +00:00
//global to store useage to, flags, codename, human-readable name, help text
2005-02-28 07:16:19 +00:00
compiler_flag_t compiler_flag [ ] = {
2004-09-07 18:16:59 +00:00
//keywords
2005-04-16 16:21:27 +00:00
{ & keyword_asm , defaultkeyword , " asm " , " Keyword: asm " , " Disables the 'asm' keyword. Use the writeasm flag to see an example of the asm. " } ,
{ & keyword_break , defaultkeyword , " break " , " Keyword: break " , " Disables the 'break' keyword. " } ,
{ & keyword_case , defaultkeyword , " case " , " Keyword: case " , " Disables the 'case' keyword. " } ,
{ & keyword_class , defaultkeyword , " class " , " Keyword: class " , " Disables the 'class' keyword. " } ,
2020-07-13 17:48:16 +00:00
{ & keyword_accessor , defaultkeyword , " accessor " , " Keyword: accessor " , " Disables the 'accessor' keyword. " } ,
2005-04-16 16:21:27 +00:00
{ & keyword_const , defaultkeyword , " const " , " Keyword: const " , " Disables the 'const' keyword. " } ,
{ & keyword_continue , defaultkeyword , " continue " , " Keyword: continue " , " Disables the 'continue' keyword. " } ,
{ & keyword_default , defaultkeyword , " default " , " Keyword: default " , " Disables the 'default' keyword. " } ,
{ & keyword_entity , defaultkeyword , " entity " , " Keyword: entity " , " Disables the 'entity' keyword. " } ,
{ & keyword_enum , defaultkeyword , " enum " , " Keyword: enum " , " Disables the 'enum' keyword. " } , //kinda like in c, but typedef not supported.
{ & keyword_enumflags , defaultkeyword , " enumflags " , " Keyword: enumflags " , " Disables the 'enumflags' keyword. " } , //like enum, but doubles instead of adds 1.
{ & keyword_extern , defaultkeyword , " extern " , " Keyword: extern " , " Disables the 'extern' keyword. Use only on functions inside addons. " } , //function is external, don't error or warn if the body was not found
{ & keyword_float , defaultkeyword , " float " , " Keyword: float " , " Disables the 'float' keyword. (Disables the float keyword without 'local' preceeding it) " } ,
{ & keyword_for , defaultkeyword , " for " , " Keyword: for " , " Disables the 'for' keyword. Syntax: for(assignment; while; increment) {codeblock;} " } ,
{ & keyword_goto , defaultkeyword , " goto " , " Keyword: goto " , " Disables the 'goto' keyword. " } ,
2020-09-08 04:44:07 +00:00
{ & keyword_int , typekeyword , " int " , " Keyword: int " , " Disables the 'int' keyword. " } ,
{ & keyword_integer , typekeyword , " integer " , " Keyword: integer " , " Disables the 'integer' keyword. " } ,
2020-10-06 03:17:28 +00:00
{ & keyword_double , nondefaultkeyword , " double " , " Keyword: double " , " Disables the 'double' keyword. " } ,
{ & keyword_long , nondefaultkeyword , " long " , " Keyword: long " , " Disables the 'long' keyword. " } ,
{ & keyword_short , nondefaultkeyword , " short " , " Keyword: short " , " Disables the 'short' keyword. " } ,
{ & keyword_char , nondefaultkeyword , " char " , " Keyword: char " , " Disables the 'char' keyword. " } ,
{ & keyword_signed , nondefaultkeyword , " signed " , " Keyword: signed " , " Disables the 'signed' keyword. " } ,
2020-09-29 07:09:01 +00:00
{ & keyword_unsigned , defaultkeyword , " unsigned " , " Keyword: unsigned " , " Disables the 'unsigned' keyword. " } ,
2015-06-04 06:15:14 +00:00
{ & keyword_noref , defaultkeyword , " noref " , " Keyword: noref " , " Disables the 'noref' keyword. " } , //nowhere else references this, don't warn about it.
{ & keyword_unused , nondefaultkeyword , " unused " , " Keyword: unused " , " Disables the 'unused' keyword. 'unused' means that the variable is unused, you're aware that its unused, and you'd rather not know about all the warnings this results in. " } ,
{ & keyword_used , nondefaultkeyword , " used " , " Keyword: used " , " Disables the 'used' keyword. 'used' means that the variable is used even if the qcc can't see how - thus preventing it from ever being stripped. " } ,
{ & keyword_static , defaultkeyword , " static " , " Keyword: static " , " Disables the 'static' keyword. 'static' means that a variable has altered scope. On globals, the variable is visible only to the current .qc file. On locals, the variable's value does not change between calls to the function. On class variables, specifies that the field is a scoped global instead of a local. On class functions, specifies that 'this' is expected to be invalid and that the function will access any memembers via it. " } ,
{ & keyword_nonstatic , defaultkeyword , " nonstatic " , " Keyword: nonstatic " , " Disables the 'nonstatic' keyword. 'nonstatic' acts upon globals+functions, reverting the defaultstatic pragma on a per-variable basis. For use by people who prefer to keep their APIs explicit. " } ,
{ & keyword_ignore , nondefaultkeyword , " ignore " , " Keyword: ignore " , " Disables the 'ignore' keyword. 'ignore' is expected to typically be hidden behind a 'csqconly' define, and in such a context can be used to conditionally compile functions a little more gracefully. The opposite of the 'used' keyword. These variables/functions/members are ALWAYS stripped, and effectively ignored. " } ,
2005-04-16 16:21:27 +00:00
{ & keyword_nosave , defaultkeyword , " nosave " , " Keyword: nosave " , " Disables the 'nosave' keyword. " } , //don't write the def to the output.
2015-04-14 12:24:05 +00:00
{ & keyword_inline , defaultkeyword , " inline " , " Keyword: inline " , " Disables the 'inline' keyword. " } , //don't write the def to the output.
{ & keyword_strip , defaultkeyword , " strip " , " Keyword: strip " , " Disables the 'strip' keyword. " } , //don't write the def to the output.
2005-04-16 16:21:27 +00:00
{ & keyword_shared , defaultkeyword , " shared " , " Keyword: shared " , " Disables the 'shared' keyword. " } , //mark global to be copied over when progs changes (part of FTE_MULTIPROGS)
{ & keyword_state , nondefaultkeyword , " state " , " Keyword: state " , " Disables the 'state' keyword. " } ,
2011-11-08 06:00:35 +00:00
{ & keyword_optional , defaultkeyword , " optional " , " Keyword: optional " , " Disables the 'optional' keyword. " } ,
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
{ & keyword_inout , nondefaultkeyword , " inout " , " Keyword: inout " , " Disables the 'inout' keyword. " } ,
2005-04-16 16:21:27 +00:00
{ & keyword_string , defaultkeyword , " string " , " Keyword: string " , " Disables the 'string' keyword. " } ,
{ & keyword_struct , defaultkeyword , " struct " , " Keyword: struct " , " Disables the 'struct' keyword. " } ,
{ & keyword_switch , defaultkeyword , " switch " , " Keyword: switch " , " Disables the 'switch' keyword. " } ,
{ & keyword_thinktime , nondefaultkeyword , " thinktime " , " Keyword: thinktime " , " Disables the 'thinktime' keyword which is used in HexenC " } ,
2013-07-31 00:28:22 +00:00
{ & keyword_until , nondefaultkeyword , " until " , " Keyword: until " , " Disables the 'until' keyword which is used in HexenC " } ,
{ & keyword_loop , nondefaultkeyword , " loop " , " Keyword: loop " , " Disables the 'loop' keyword which is used in HexenC " } ,
2005-04-16 16:21:27 +00:00
{ & keyword_typedef , defaultkeyword , " typedef " , " Keyword: typedef " , " Disables the 'typedef' keyword. " } , //fixme
{ & keyword_union , defaultkeyword , " union " , " Keyword: union " , " Disables the 'union' keyword. " } , //you surly know what a union is!
{ & keyword_var , defaultkeyword , " var " , " Keyword: var " , " Disables the 'var' keyword. " } ,
{ & keyword_vector , defaultkeyword , " vector " , " Keyword: vector " , " Disables the 'vector' keyword. " } ,
2016-09-08 19:04:35 +00:00
{ & keyword_wrap , defaultkeyword , " wrap " , " Keyword: wrap " , " Disables the 'wrap' keyword. " } ,
{ & keyword_weak , defaultkeyword , " weak " , " Keyword: weak " , " Disables the 'weak' keyword. " } ,
2017-10-12 12:02:25 +00:00
{ & keyword_accumulate , nondefaultkeyword , " accumulate " , " Keyword: accumulate " , " Disables the 'accumulate' keyword. " } ,
2020-09-08 04:44:07 +00:00
{ & keyword_using , nondefaultkeyword , " using " , " Keyword: using " , " Disables the 'using' keyword. " } ,
2004-09-07 18:16:59 +00:00
//options
2018-06-18 16:44:29 +00:00
{ & flag_acc , 0 , " acc " , " Reacc support " , " Reacc is a pascall like compiler. It was released before the Quake source was released. This flag has a few effects. It sorts all qc files in the current directory into alphabetical order to compile them. It also allows Reacc global/field distinctions, as well as allows | for linebreaks. Whilst case insensitivity and lax type checking are supported by reacc, they are seperate compiler flags in fteqcc. " } , //reacc like behaviour of src files.
2017-10-31 22:52:58 +00:00
{ & flag_qccx , FLAG_MIDCOMPILE , " qccx " , " QCCX syntax " , " WARNING: This syntax makes mods inherantly engine specific. \n Do NOT use unless you know what you're doing.This is provided for compatibility only \n Any entity hacks will be unsupported in FTEQW, DP, and others, resulting in engine crashes if the code in question is executed. " } ,
2020-09-29 07:09:01 +00:00
{ & keywords_coexist , defaultflag , " kce " , " Keywords Coexist " , " If you want keywords to NOT be disabled when they a variable by the same name is defined, check here. " } ,
2018-09-19 02:49:08 +00:00
// {&flag_lno, defaultflag, "lno", "Write Line Numbers", "Writes line number information. This is required for any real kind of debugging. Will be ignored if filenames were stripped."},
2005-02-28 07:16:19 +00:00
{ & output_parms , 0 , " parms " , " Define offset parms " , " if PARM0 PARM1 etc should be defined by the compiler. These are useful if you make use of the asm keyword for function calls, or you wish to create your own variable arguments. This is an easy way to break decompilers. " } , //controls weather to define PARMx for the parms (note - this can screw over some decompilers)
{ & autoprototype , 0 , " autoproto " , " Automatic Prototyping " , " Causes compilation to take two passes instead of one. The first pass, only the definitions are read. The second pass actually compiles your code. This means you never have to remember to prototype functions again. " } , //so you no longer need to prototype functions and things in advance.
{ & writeasm , 0 , " wasm " , " Dump Assembler " , " Writes out a qc.asm which contains all your functions but in assembler. This is a great way to look for bugs in fteqcc, but can also be used to see exactly what your functions turn into, and thus how to optimise statements better. " } , //spit out a qc.asm file, containing an assembler dump of the ENTIRE progs. (Doesn't include initialisation of constants)
2015-02-02 08:01:53 +00:00
{ & flag_guiannotate , FLAG_MIDCOMPILE , " annotate " , " Annotate Sourcecode " , " Annotate source code with assembler statements on compile (requires gui). " } ,
2015-04-14 12:24:05 +00:00
{ & flag_nullemptystr , FLAG_MIDCOMPILE , " nullemptystr " , " Null String Immediates " , " Empty string immediates will have the raw value 0 instead of 1. " } ,
2005-04-16 16:21:27 +00:00
{ & flag_ifstring , FLAG_MIDCOMPILE , " ifstring " , " if(string) fix " , " Causes if(string) to behave identically to if(string!= " " ) This is most useful with addons of course, but also has adverse effects with FRIK_FILE's fgets, where it becomes impossible to determin the end of the file. In such a case, you can still use asm {IF string 2;RETURN} to detect eof and leave the function. " } , //correction for if(string) no-ifstring to get the standard behaviour.
2017-10-31 22:52:58 +00:00
{ & flag_iffloat , FLAG_MIDCOMPILE , " iffloat " , " if(-0.0) fix " , " Fixes certain floating point logic. " } ,
{ & flag_ifvector , defaultflag , " ifvector " , " if('0 1 0') fix " , " Fixes conditional vector logic. " } ,
{ & flag_vectorlogic , defaultflag , " vectorlogic " , " v&&v||v fix " , " Fixes conditional vector logic. " } ,
2015-07-28 03:13:00 +00:00
{ & flag_brokenarrays , FLAG_MIDCOMPILE , " brokenarray " , " array[0] omission " , " Treat references to arrays as references to the first index of said array, to replicate an old fteqcc bug. " } ,
2015-09-10 10:16:26 +00:00
{ & flag_rootconstructor , FLAG_MIDCOMPILE , " rootconstructor " , " root constructor first " , " When enabled, the root constructor should be called first like in c++. " } ,
2014-03-30 08:55:06 +00:00
{ & flag_caseinsensitive , 0 , " caseinsens " , " Case insensitivity " , " Causes fteqcc to become case insensitive whilst compiling names. It's generally not advised to use this as it compiles a little more slowly and provides little benefit. However, it is required for full reacc support. " } , //symbols will be matched to an insensitive case if the specified case doesn't exist. This should b usable for any mod
2007-10-05 18:08:47 +00:00
{ & flag_laxcasts , FLAG_MIDCOMPILE , " lax " , " Lax type checks " , " Disables many errors (generating warnings instead) when function calls or operations refer to two normally incompatible types. This is required for reacc support, and can also allow certain (evil) mods to compile that were originally written for frikqcc. " } , //Allow lax casting. This'll produce loadsa warnings of course. But allows compilation of certain dodgy code.
2009-08-29 14:56:42 +00:00
{ & flag_hashonly , FLAG_MIDCOMPILE , " hashonly " , " Hash-only constants " , " Allows use of only #constant for precompiler constants, allows certain preqcc using mods to compile " } ,
2021-07-03 01:47:16 +00:00
{ & flag_macroinstrings , FLAG_MIDCOMPILE , " macroinstrings " , " Expand macros in strings " , " Allows the use #constant inside string immediates. This is a feature of preqcc, but should otherwise probably be left disabled. " } ,
2009-08-29 14:56:42 +00:00
{ & opt_logicops , FLAG_MIDCOMPILE , " lo " , " Logic ops " , " This changes the behaviour of your code. It generates additional if operations to early-out in if statements. With this flag, the line if (0 && somefunction()) will never call the function. It can thus be considered an optimisation. However, due to the change of behaviour, it is not considered so by fteqcc. Note that due to inprecisions with floats, this flag can cause runaway loop errors within the player walk and run functions (without iffloat also enabled). This code is advised: \n player_stand1: \n if (self.velocity_x || self.velocity_y) \n player_run \n if (!(self.velocity_x || self.velocity_y)) " } ,
2009-11-04 21:16:50 +00:00
{ & flag_msvcstyle , FLAG_MIDCOMPILE , " msvcstyle " , " MSVC-style errors " , " Generates warning and error messages in a format that msvc understands, to facilitate ide integration. " } ,
2015-04-14 12:24:05 +00:00
{ & flag_debugmacros , FLAG_MIDCOMPILE , " debugmacros " , " Verbose Macro Expansion " , " Print out the contents of macros that are expanded. This can help look inside macros that are expanded and is especially handy if people are using preprocessor hacks. " } ,
2010-07-18 10:01:57 +00:00
{ & flag_filetimes , 0 , " filetimes " , " Check Filetimes " , " Recompiles the progs only if the file times are modified. " } ,
2015-07-03 22:00:45 +00:00
{ & flag_fasttrackarrays , FLAG_MIDCOMPILE , " fastarrays " , " fast arrays where possible " , " Generates extra instructions inside array handling functions to detect engine and use extension opcodes only in supporting engines. \n Adds a global which is set by the engine if the engine supports the extra opcodes. Note that this applies to all arrays or none. " } ,
2009-08-29 14:56:42 +00:00
{ & flag_assume_integer , FLAG_MIDCOMPILE , " assumeint " , " Assume Integers " , " Numerical constants are assumed to be integers, instead of floats. " } ,
2011-09-03 03:49:43 +00:00
{ & pr_subscopedlocals , FLAG_MIDCOMPILE , " subscope " , " Subscoped Locals " , " Restrict the scope of locals to the block they are actually defined within, as in C. " } ,
{ & verbose , FLAG_MIDCOMPILE , " verbose " , " Verbose " , " Lots of extra compiler messages. " } ,
2012-01-17 07:57:46 +00:00
{ & flag_typeexplicit , FLAG_MIDCOMPILE , " typeexplicit " , " Explicit types " , " All type conversions must be explicit or directly supported by instruction set. " } ,
2020-10-26 06:30:35 +00:00
{ & flag_boundchecks , defaultflag , " boundchecks " , " Enforce Bound Checks " , " Enforce array index checks to avoid accessing arrays out of bounds. This can be disabled for a speedup (the qcvm will still verify that the access is within the qcvm's memory, but it can't verify that its within the intended array). " } ,
2017-10-31 22:52:58 +00:00
{ & flag_attributes , hideflag , " attributes " , " [[attributes]] " , " WARNING: This syntax conflicts with vector constructors. " } ,
{ & flag_assumevar , hideflag , " assumevar " , " explicit consts " , " Initialised globals will be considered non-const by default. " } ,
{ & flag_dblstarexp , hideflag , " ssp " , " ** exponent " , " Treat ** as an operator for exponents, instead of multiplying by a dereferenced pointer. " } ,
{ & flag_cpriority , hideflag , " cpriority " , " C Operator Priority " , " QC treats !a&&b as equivelent to !(a&&b). When this is set, behaviour will be (!a)&&b as in C. Other operators are also affected in similar ways. " } ,
2020-09-29 07:09:01 +00:00
{ & flag_assume_double , hideflag , " assumedouble " , " Assume Doubles " , " Floating point immediates will be treated as doubles, for C compat. " } ,
{ & flag_qcfuncs , hidedefaultflag , " qcfuncs " , " Parse QC-style funcs " , " Recognise void() as a function type. Required for QC compat. " } ,
2017-10-31 22:52:58 +00:00
{ & flag_allowuninit , hideflag , " allowuninit " , " Uninitialised Locals " , " Permit optimisations that may result in locals being uninitialised. This may allow for greater reductions in temps. " } ,
{ & flag_nopragmafileline , FLAG_MIDCOMPILE , " nofileline " , " Ignore #pragma file " , " Ignores #pragma file(foo) and #pragma line(foo), so that errors and symbols reflect the actual lines, instead of the original source. " } ,
// {&flag_lno, hidedefaultflag,"lno", "Gen Debugging Info", "Writes debugging info."},
2018-09-29 03:40:50 +00:00
{ & flag_utf8strings , FLAG_MIDCOMPILE , " utf8 " , " Unicode " , " String immediates will use utf-8 encoding, instead of quake's encoding. " } ,
2017-10-31 22:52:58 +00:00
{ & flag_embedsrc , FLAG_MIDCOMPILE , " embedsrc " , " Embed Sources " , " Write the sourcecode into the output file. The resulting .dat can be opened as a standard zip archive (or by fteqccgui). \n Good for GPL compliance! " } ,
2015-04-14 12:24:05 +00:00
// {&flag_noreflection, FLAG_MIDCOMPILE,"omitinternals","Omit Reflection Info", "Keeps internal symbols private (equivelent to unix's hidden visibility). This has the effect of reducing filesize, thwarting debuggers, and breaking saved games. This allows you to use arrays without massively bloating the size of your progs.\nWARNING: The bit about breaking saved games was NOT a joke, but does not apply to menuqc or csqc. It also interferes with FTE_MULTIPROGS."},
2020-09-08 04:44:07 +00:00
{ & flag_dumpfilenames , FLAG_MIDCOMPILE , " dumpfilenames " , " Write a .lst file " , " Writes a .lst file which contains a list of all file names that we can detect from the qc. This file list can then be passed into external compression tools. " } ,
{ & flag_dumpfields , FLAG_MIDCOMPILE , " dumpfields " , " Write a .fld file " , " Writes a .fld file that shows which fields are defined, along with their offsets etc, for weird debugging. " } ,
{ & flag_dumpsymbols , FLAG_MIDCOMPILE , " dumpsymbols " , " Write a .sym file " , " Writes a .sym file alongside the dat which contains a list of all global symbols defined in the code (before stripping) " } ,
{ & flag_dumpautocvars , FLAG_MIDCOMPILE , " dumpautocvars " , " Write a .cfg file " , " Writes a .cfg file that contains a default value for each autocvar listed in the code " } ,
2021-05-27 11:34:22 +00:00
{ & flag_dumplocalisation , FLAG_MIDCOMPILE , " dumplocalisation " , " Write a .pot file " , " Writes a .po template file from your _( " " ) strings that can be edited (with eg gettext's tools) for translations, resulting in eg csprogs.en_US.po vs csprogs.en.po and other various other dialects vs languages. " } ,
2021-07-06 00:12:27 +00:00
{ & flag_dumptags , FLAG_MIDCOMPILE , " dumptags " , " Write vi's tags file " , " Writes a .tags file for text editors compatible with vi to locate symbols by name. This file is unsorted and per-module, so you will need to 'cat ../*.tags|LC_COLLATE=C sort>tags' for it to be used. " } ,
{ & flag_dumptags , FLAG_MIDCOMPILE | FLAG_HIDDENINGUI , " tags " , " aka dumptags " , " See dumptags " } ,
2004-09-07 18:16:59 +00:00
{ NULL }
} ;
2018-10-11 10:31:23 +00:00
static const char * QCC_VersionString ( void )
2015-02-02 08:01:53 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# if defined(SVNREVISION) && defined(SVNDATE)
return " FTEQCC: " STRINGIFY ( SVNREVISION ) " ( " STRINGIFY ( SVNDATE ) " ) " ;
# elif defined(SVNREVISION)
return " FTEQCC: " STRINGIFY ( SVNREVISION ) " ( " __DATE__ " ) " ;
# else
2015-02-02 08:01:53 +00:00
return " FTEQCC: " __DATE__ ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# endif
2015-02-02 08:01:53 +00:00
}
2004-09-07 18:16:59 +00:00
/*
= = = = = = = = = = = = = = = = =
BspModels
Runs qbsp and light on all of the models with a . bsp extension
= = = = = = = = = = = = = = = = =
*/
2018-10-11 10:31:23 +00:00
static void QCC_BspModels ( void )
2004-09-07 18:16:59 +00:00
{
2012-04-24 07:59:11 +00:00
/*
2004-09-07 18:16:59 +00:00
int p ;
char * gamedir ;
int i ;
char * m ;
char cmd [ 1024 ] ;
char name [ 256 ] ;
2011-05-15 13:23:13 +00:00
size_t result ;
2004-09-07 18:16:59 +00:00
p = QCC_CheckParm ( " -bspmodels " ) ;
if ( ! p )
return ;
if ( p = = myargc - 1 )
QCC_Error ( ERR_BADPARMS , " -bspmodels must preceed a game directory " ) ;
gamedir = myargv [ p + 1 ] ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < nummodels ; i + + )
{
m = precache_models [ i ] ;
if ( strcmp ( m + strlen ( m ) - 4 , " .bsp " ) )
continue ;
strcpy ( name , m ) ;
name [ strlen ( m ) - 4 ] = 0 ;
sprintf ( cmd , " qbsp %s/%s ; light -extra %s/%s " , gamedir , name , gamedir , name ) ;
2011-05-15 13:23:13 +00:00
result = system ( cmd ) ; // do something with the result
2011-05-30 04:32:04 +00:00
if ( result ! = 0 )
QCC_Error ( ERR_INTERNAL , " QCC_BspModels() system returned non zero (failure) with: qbsp %s/%s ; light -extra %s/%s (%i) \n " , gamedir , name , gamedir , name , errno ) ;
2004-09-07 18:16:59 +00:00
}
2012-04-24 07:59:11 +00:00
*/
2004-09-07 18:16:59 +00:00
}
2013-03-12 22:32:25 +00:00
typedef struct stringtab_s
{
struct stringtab_s * prev ;
char * ofs ;
int len ;
} stringtab_t ;
stringtab_t * stringtablist [ 256 ] ;
2004-09-07 18:16:59 +00:00
// CopyString returns an offset from the string heap
2018-05-28 10:12:10 +00:00
int QCC_CopyString ( const char * str )
2004-09-07 18:16:59 +00:00
{
int old ;
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
size_t len ;
2004-09-07 18:16:59 +00:00
2012-01-24 04:24:14 +00:00
if ( ! str )
return 0 ;
if ( ! * str )
2015-04-14 12:24:05 +00:00
return ! flag_nullemptystr ;
2012-01-24 04:24:14 +00:00
2013-06-13 22:45:15 +00:00
if ( opt_noduplicatestrings | | ! strcmp ( str , " IMMEDIATE " ) )
2004-09-07 18:16:59 +00:00
{
2013-03-12 22:32:25 +00:00
# if 1
//more scalable (faster) version.
stringtab_t * t ;
int len = strlen ( str ) ;
unsigned char key = str [ len - 1 ] ;
for ( t = stringtablist [ key ] ; t ; t = t - > prev )
{
if ( t - > len > = len )
if ( ! strcmp ( t - > ofs + t - > len - len , str ) )
{
optres_noduplicatestrings + = len ;
return ( t - > ofs + t - > len - len ) - strings ;
}
}
t = qccHunkAlloc ( sizeof ( * t ) ) ;
t - > prev = stringtablist [ key ] ;
stringtablist [ key ] = t ;
t - > ofs = strings + strofs ;
t - > len = len ;
# elif 1
//bruteforce
char * s ;
2004-09-07 18:16:59 +00:00
for ( s = strings ; s < strings + strofs ; s + + )
if ( ! strcmp ( s , str ) )
{
optres_noduplicatestrings + = strlen ( str ) ;
return s - strings ;
}
2013-03-12 22:32:25 +00:00
# endif
2004-09-07 18:16:59 +00:00
}
old = strofs ;
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
len = strlen ( str ) + 1 ;
2017-03-27 21:45:45 +00:00
if ( ( strofs + len ) > MAX_STRINGS )
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
QCC_Error ( ERR_INTERNAL , " QCC_CopyString: stringtable size limit exceeded \n " ) ;
memcpy ( strings + strofs , str , len ) ;
strofs + = len ;
2004-09-07 18:16:59 +00:00
return old ;
}
2018-05-28 10:12:10 +00:00
int QCC_CopyStringLength ( const char * str , size_t length )
2016-07-12 00:40:13 +00:00
{
int old ;
if ( ! str )
return 0 ;
if ( ! * str & & length = = 1 )
return ! flag_nullemptystr ;
old = strofs ;
2017-03-27 21:45:45 +00:00
if ( ( strofs + length ) > MAX_STRINGS )
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
QCC_Error ( ERR_INTERNAL , " QCC_CopyString: stringtable size limit exceeded \n " ) ;
2016-07-12 00:40:13 +00:00
memcpy ( strings + strofs , str , length ) ;
2018-05-28 10:12:10 +00:00
strings [ strofs + length ] = 0 ;
strofs + = length + 1 ;
2016-07-12 00:40:13 +00:00
return old ;
}
2018-10-11 10:31:23 +00:00
/*static int QCC_CopyDupBackString (const char *str)
2004-09-07 18:16:59 +00:00
{
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
size_t length ;
2004-09-07 18:16:59 +00:00
int old ;
char * s ;
for ( s = strings + strofs - 1 ; s > strings ; s - - )
if ( ! strcmp ( s , str ) )
return s - strings ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
old = strofs ;
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
length = strlen ( str ) + 1 ;
2017-03-27 21:45:45 +00:00
if ( ( strofs + length ) > MAX_STRINGS )
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
QCC_Error ( ERR_INTERNAL , " QCC_CopyString: stringtable size limit exceeded \n " ) ;
2004-09-07 18:16:59 +00:00
strcpy ( strings + strofs , str ) ;
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
strofs + = length ;
2004-09-07 18:16:59 +00:00
return old ;
}
2018-10-11 10:31:23 +00:00
static void QCC_PrintStrings ( void )
2004-09-07 18:16:59 +00:00
{
int i , l , j ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < strofs ; i + = l )
{
l = strlen ( strings + i ) + 1 ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %5i : " , i ) ;
2004-09-07 18:16:59 +00:00
for ( j = 0 ; j < l ; j + + )
{
if ( strings [ i + j ] = = ' \n ' )
{
putchar ( ' \\ ' ) ;
putchar ( ' n ' ) ;
}
else
putchar ( strings [ i + j ] ) ;
}
2018-10-11 10:31:23 +00:00
externs - > Printf ( " \n " ) ;
2004-09-07 18:16:59 +00:00
}
}
2018-10-11 10:31:23 +00:00
void QCC_PrintFunctions ( void )
2004-09-07 18:16:59 +00:00
{
int i , j ;
QCC_dfunction_t * d ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < numfunctions ; i + + )
{
d = & functions [ i ] ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s : %s : %i %i ( " , strings + d - > s_file , strings + d - > s_name , d - > first_statement , d - > parm_start ) ;
2004-09-07 18:16:59 +00:00
for ( j = 0 ; j < d - > numparms ; j + + )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %i " , d - > parm_size [ j ] ) ;
externs - > Printf ( " ) \n " ) ;
2004-09-07 18:16:59 +00:00
}
} */
2018-10-11 10:31:23 +00:00
static void QCC_SortFields ( void )
2018-08-04 07:05:20 +00:00
{
int i , j ;
QCC_ddef32_t t ;
2018-09-19 02:49:08 +00:00
//insertion sort, of sorts.
2018-08-04 07:05:20 +00:00
//(qsort doesn't guarentee ordering)
2018-09-19 02:49:08 +00:00
for ( i = 1 ; i < numfielddefs ; i + + )
2018-08-04 07:05:20 +00:00
{
2018-09-19 02:49:08 +00:00
if ( fields [ i ] . ofs < fields [ i - 1 ] . ofs )
{ //this entry is out of order
for ( j = i - 1 ; j > 0 ; j - - )
2018-08-04 07:05:20 +00:00
{
2018-09-19 02:49:08 +00:00
if ( fields [ j ] . ofs < = fields [ i ] . ofs )
{ //okay, so we're putting it after this element.
j + + ;
break ;
}
2018-08-04 07:05:20 +00:00
}
2018-09-19 02:49:08 +00:00
t = fields [ i ] ;
memmove ( & fields [ j + 1 ] , & fields [ j ] , ( i - j ) * sizeof ( t ) ) ;
fields [ j ] = t ;
}
2018-08-04 07:05:20 +00:00
}
}
2020-09-08 04:44:07 +00:00
static void QCC_DumpFields ( const char * outputname )
2004-09-07 18:16:59 +00:00
{
2020-09-08 04:44:07 +00:00
char line [ 1024 ] ;
2013-09-26 16:43:11 +00:00
extern char * basictypenames [ ] ;
2004-09-07 18:16:59 +00:00
int i ;
QCC_ddef_t * d ;
2020-09-08 04:44:07 +00:00
int h ;
snprintf ( line , sizeof ( line ) , " %s.fld " , outputname ) ;
h = SafeOpenWrite ( line , 2 * 1024 * 1024 ) ;
if ( h > = 0 )
{
for ( i = 0 ; i < numfielddefs ; i + + )
{
d = & fields [ i ] ;
snprintf ( line , sizeof ( line ) , " %5i : (%s) %s \n " , d - > ofs , basictypenames [ d - > type ] , strings + d - > s_name ) ;
2022-01-16 18:41:25 +00:00
SafeWrite ( h , line , strlen ( line ) ) ;
2020-09-08 04:44:07 +00:00
}
2011-05-15 13:23:13 +00:00
2020-09-08 04:44:07 +00:00
SafeClose ( h ) ;
}
}
2015-07-03 22:00:45 +00:00
2022-01-16 18:41:25 +00:00
static void QCC_DumpSymbolNames ( const char * outputname )
2020-09-08 04:44:07 +00:00
{
char line [ 1024 ] ;
QCC_def_t * def ;
int h ;
snprintf ( line , sizeof ( line ) , " %s.sym " , outputname ) ;
h = SafeOpenWrite ( line , 2 * 1024 * 1024 ) ;
if ( h > = 0 )
2004-09-07 18:16:59 +00:00
{
2020-09-08 04:44:07 +00:00
for ( def = pr . def_head . next ; def ; def = def - > next )
{
if ( ( def - > scope & & ! def - > isstatic ) | | ! strcmp ( def - > name , " IMMEDIATE " ) )
continue ;
if ( def - > symbolheader ! = def & & def - > symbolheader - > type ! = def - > type )
continue ; //try to exclude vector components.
snprintf ( line , sizeof ( line ) , " %s \n " , def - > name ) ;
SafeWrite ( h , line , strlen ( line ) ) ;
}
SafeClose ( h ) ;
2004-09-07 18:16:59 +00:00
}
}
2022-01-16 18:41:25 +00:00
/*static void QCC_DumpSymbolInfo (const char *outputname)
{
char line [ 1024 ] ;
char tname [ 512 ] ;
QCC_def_t * def ;
int h ;
snprintf ( line , sizeof ( line ) , " %s.sym " , outputname ) ;
h = SafeOpenWrite ( line , 2 * 1024 * 1024 ) ;
if ( h > = 0 )
{
for ( def = pr . def_head . next ; def ; def = def - > next )
{
// if ((def->scope && !def->isstatic) || !strcmp(def->name, "IMMEDIATE"))
// continue;
// if (def->symbolheader != def && def->symbolheader->type != def->type)
// continue; //try to exclude vector components.
if ( def - > arraysize )
snprintf ( line , sizeof ( line ) , " %s%i: %s[%i] %s = " , def - > used ? " " : " (unused) " , def - > ofs , TypeName ( def - > type , tname , sizeof ( tname ) ) , def - > arraysize , def - > name ) ;
else
snprintf ( line , sizeof ( line ) , " %s%i: %s %s = " , def - > used ? " " : " (unused) " , def - > ofs , TypeName ( def - > type , tname , sizeof ( tname ) ) , def - > name ) ;
SafeWrite ( h , line , strlen ( line ) ) ;
switch ( def - > type - > type )
{
case ev_vector :
snprintf ( line , sizeof ( line ) , " %g %g %g \n " , def - > symboldata [ 0 ] . _float , def - > symboldata [ 1 ] . _float , def - > symboldata [ 2 ] . _float ) ;
break ;
case ev_float :
snprintf ( line , sizeof ( line ) , " %g \n " , def - > symboldata [ 0 ] . _float ) ;
break ;
case ev_double :
snprintf ( line , sizeof ( line ) , " %g \n " , def - > symboldata [ 0 ] . _float ) ;
break ;
case ev_string :
snprintf ( line , sizeof ( line ) , " %+i, %s \n " , def - > symboldata [ 0 ] . string , QCC_PR_String ( strings + def - > symboldata [ 0 ] . string ) ) ;
break ;
case ev_function :
snprintf ( line , sizeof ( line ) , " %+i, %s \n " , def - > symboldata [ 0 ] . _int , functions [ def - > symboldata [ 0 ] . _int ] . name ) ;
break ;
case ev_int64 :
case ev_uint64 :
snprintf ( line , sizeof ( line ) , " %i \n " , def - > symboldata [ 0 ] . _int ) ;
break ;
default :
snprintf ( line , sizeof ( line ) , " %i \n " , def - > symboldata [ 0 ] . _int ) ;
break ;
}
SafeWrite ( h , line , strlen ( line ) ) ;
}
SafeClose ( h ) ;
}
} */
2020-09-08 04:44:07 +00:00
2018-10-11 10:31:23 +00:00
/*
static void QCC_PrintGlobals ( void )
2004-09-07 18:16:59 +00:00
{
int i ;
QCC_ddef_t * d ;
2011-05-15 13:23:13 +00:00
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Globals Listing: \n " ) ;
2015-07-03 22:00:45 +00:00
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < numglobaldefs ; i + + )
{
d = & qcc_globals [ i ] ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %5i : (%i) %s \n " , d - > ofs , d - > type , strings + d - > s_name ) ;
2004-09-07 18:16:59 +00:00
}
2018-10-11 10:31:23 +00:00
} */
2004-09-07 18:16:59 +00:00
2020-09-08 04:44:07 +00:00
static void QCC_DumpAutoCvars ( const char * outputname )
2015-07-03 22:00:45 +00:00
{
2020-09-08 04:44:07 +00:00
char line [ 1024 ] ;
int i , h ;
2015-07-03 22:00:45 +00:00
QCC_ddef_t * d ;
char * n ;
2020-09-08 04:44:07 +00:00
snprintf ( line , sizeof ( line ) , " %s.cfg " , outputname ) ;
h = SafeOpenWrite ( line , 2 * 1024 * 1024 ) ;
if ( h > = 0 )
2015-07-03 22:00:45 +00:00
{
2020-09-08 04:44:07 +00:00
for ( i = 0 ; i < numglobaldefs ; i + + )
2015-07-03 22:00:45 +00:00
{
2020-09-08 04:44:07 +00:00
d = & qcc_globals [ i ] ;
n = strings + d - > s_name ;
if ( ! strncmp ( n , " autocvar_ " , 9 ) )
{
char * desc ;
2020-09-29 07:09:01 +00:00
const QCC_eval_t * val = ( const QCC_eval_t * ) & qcc_pr_globals [ d - > ofs ] ;
2020-09-08 04:44:07 +00:00
QCC_def_t * def = QCC_PR_GetDef ( NULL , n , NULL , false , 0 , 0 ) ;
n + = 9 ;
2015-07-03 22:00:45 +00:00
2021-05-27 11:34:22 +00:00
if ( ! def )
continue ; //erk?
2020-09-08 04:44:07 +00:00
if ( def - > comment )
desc = def - > comment ;
else
desc = NULL ;
2015-07-03 22:00:45 +00:00
2020-09-08 04:44:07 +00:00
switch ( d - > type & ~ ( DEF_SAVEGLOBAL | DEF_SHARED ) )
{
case ev_float :
snprintf ( line , sizeof ( line ) , " set %s \t %g%s%s \n " , n , val - > _float , desc ? " \t // " : " " , desc ? desc : " " ) ;
break ;
2020-09-29 07:09:01 +00:00
case ev_double :
snprintf ( line , sizeof ( line ) , " set %s \t %g%s%s \n " , n , val - > _double , desc ? " \t // " : " " , desc ? desc : " " ) ;
break ;
2020-09-08 04:44:07 +00:00
case ev_vector :
2020-09-29 07:09:01 +00:00
snprintf ( line , sizeof ( line ) , " set %s \t \" %g %g %g \" %s%s \n " , n , val - > vector [ 0 ] , val - > vector [ 1 ] , val - > vector [ 2 ] , desc ? " \t // " : " " , desc ? desc : " " ) ;
2020-09-08 04:44:07 +00:00
break ;
case ev_integer :
2020-09-29 07:09:01 +00:00
snprintf ( line , sizeof ( line ) , " set %s \t % " pPRIi " %s%s \n " , n , val - > _int , desc ? " \t // " : " " , desc ? desc : " " ) ;
break ;
case ev_uint :
snprintf ( line , sizeof ( line ) , " set %s \t % " pPRIu " %s%s \n " , n , val - > _uint , desc ? " \t // " : " " , desc ? desc : " " ) ;
break ;
case ev_int64 :
2021-08-04 21:17:31 +00:00
snprintf ( line , sizeof ( line ) , " set %s \t % " pPRIi64 " %s%s \n " , n , val - > i64 , desc ? " \t // " : " " , desc ? desc : " " ) ;
2020-09-29 07:09:01 +00:00
break ;
case ev_uint64 :
2021-08-04 21:17:31 +00:00
snprintf ( line , sizeof ( line ) , " set %s \t % " pPRIu64 " %s%s \n " , n , val - > u64 , desc ? " \t // " : " " , desc ? desc : " " ) ;
2020-09-08 04:44:07 +00:00
break ;
case ev_string :
snprintf ( line , sizeof ( line ) , " set %s \t \" %s \" %s%s \n " , n , strings + val - > _int , desc ? " \t // " : " " , desc ? desc : " " ) ;
break ;
default :
2020-09-29 07:09:01 +00:00
snprintf ( line , sizeof ( line ) , " //set %s \t ?%s%s \n " , n , desc ? " \t // " : " " , desc ? desc : " " ) ;
2020-09-08 04:44:07 +00:00
break ;
}
SafeWrite ( h , line , strlen ( line ) ) ;
2015-07-03 22:00:45 +00:00
}
}
}
}
2021-05-27 11:34:22 +00:00
static void QCC_DumpLocalisation ( const char * outputname )
{
char line [ 65536 ] ;
int h , o ;
QCC_def_t * def ;
char * n ;
snprintf ( line , sizeof ( line ) , " %s.pot " , outputname ) ;
h = SafeOpenWrite ( line , 2 * 1024 * 1024 ) ;
if ( h > = 0 )
{
for ( def = pr . def_head . next ; def ; def = def - > next )
{
if ( ! strncmp ( def - > name , " dotranslate_ " , 12 ) )
{
const QCC_eval_t * val = ( const QCC_eval_t * ) def - > symboldata ;
if ( def - > type - > type ! = ev_string )
continue ;
if ( def - > comment )
{
n = def - > comment ;
snprintf ( line , sizeof ( line ) , " #. " ) ;
for ( o = strlen ( line ) ; * n & & o < countof ( line ) - 10 ; n + + )
{
if ( * n = = ' \n ' )
{
if ( n [ 1 ] )
{
line [ o + + ] = ' \n ' ;
line [ o + + ] = ' # ' ;
line [ o + + ] = ' . ' ;
line [ o + + ] = ' ' ;
continue ;
}
else line [ + + o ] = ' n ' ;
}
else if ( * n = = ' \\ ' ) line [ + + o ] = ' \\ ' ;
else if ( * n = = ' \" ' ) line [ + + o ] = ' \" ' ;
else if ( * n = = ' \n ' ) line [ + + o ] = ' n ' ;
else if ( * n = = ' \r ' ) line [ + + o ] = ' r ' ;
else if ( * n = = ' \t ' ) line [ + + o ] = ' t ' ;
else
{ //hopefully the programmer used utf-8...
line [ o + + ] = * n ;
continue ;
}
line [ o + + - 1 ] = ' \\ ' ;
}
line [ o + + ] = ' \n ' ;
line [ o + + ] = 0 ;
SafeWrite ( h , line , strlen ( line ) ) ;
}
if ( def - > filen )
{ //strip any extra macro info there...
char * c = strchr ( def - > filen , ' : ' ) ;
if ( c & & ( c [ 1 ] < ' 0 ' | | c [ 1 ] > ' 9 ' ) ) //don't get fooled by windows paths...
c = strchr ( c + 1 , ' : ' ) ;
if ( c )
{
* c = 0 ;
snprintf ( line , sizeof ( line ) , " #: %s:%i \n " , def - > filen , def - > s_line ) ;
* c = ' : ' ;
}
else
snprintf ( line , sizeof ( line ) , " #: %s:%i \n " , def - > filen , def - > s_line ) ;
SafeWrite ( h , line , strlen ( line ) ) ;
}
n = strings + val - > _int ;
snprintf ( line , sizeof ( line ) , " msgid \" " ) ;
for ( o = strlen ( line ) ; * n & & o < countof ( line ) - 5 ; n + + )
{
if ( * n = = ' \n ' & & n [ 1 ] & & o < countof ( line ) - 10 )
{ //split multi-line stuff onto multiple lines, becase we can.
line [ o + + ] = ' \\ ' ;
line [ o + + ] = ' n ' ;
line [ o + + ] = ' \" ' ;
line [ o + + ] = ' \n ' ;
line [ o + + ] = ' \" ' ;
continue ;
}
else if ( * n = = ' \\ ' ) line [ + + o ] = ' \\ ' ;
else if ( * n = = ' \" ' ) line [ + + o ] = ' \" ' ;
else if ( * n = = ' \n ' ) line [ + + o ] = ' n ' ;
else if ( * n = = ' \r ' ) line [ + + o ] = ' r ' ;
else if ( * n = = ' \t ' ) line [ + + o ] = ' t ' ;
else
{ //hopefully the programmer used utf-8...
line [ o + + ] = * n ;
continue ;
}
line [ o + + - 1 ] = ' \\ ' ;
}
line [ o + + ] = ' \" ' ;
line [ o + + ] = ' \n ' ;
line [ o + + ] = 0 ;
SafeWrite ( h , line , strlen ( line ) ) ;
snprintf ( line , sizeof ( line ) , " msgstr \" \" \n \n " ) ;
SafeWrite ( h , line , strlen ( line ) ) ;
}
}
}
SafeClose ( h ) ;
}
2020-09-08 04:44:07 +00:00
static void QCC_DumpFiles ( const char * outputname )
2015-07-03 22:00:45 +00:00
{
struct
{
precache_t * list ;
int count ;
} precaches [ ] =
{
{ precache_sound , numsounds } ,
{ precache_texture , numtextures } ,
{ precache_model , nummodels } ,
{ precache_file , numfiles }
} ;
int g , i , b ;
pbool header ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " \n File lists: \n " ) ;
2015-07-03 22:00:45 +00:00
for ( b = 0 ; b < 64 ; b + + )
{
for ( header = false , g = 0 ; g < sizeof ( precaches ) / sizeof ( precaches [ 0 ] ) ; g + + )
{
for ( i = 0 ; i < precaches [ g ] . count ; i + + )
{
if ( precaches [ g ] . list [ i ] . block = = b )
{
if ( * precaches [ g ] . list [ i ] . name = = ' * ' )
continue ; //*-prefixed models are not real, and shouldn't be included in file lists.
if ( ! header )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " pak%i: \n " , b - 1 ) ;
2015-07-03 22:00:45 +00:00
header = true ;
}
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s \n " , precaches [ g ] . list [ i ] . name ) ;
2015-07-03 22:00:45 +00:00
}
}
}
if ( header )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " \n " ) ;
2015-07-03 22:00:45 +00:00
}
}
2021-07-06 00:12:27 +00:00
void QCC_DumpPreProcTags ( void * ctx , void * data )
{
char line [ 2048 ] ;
int h = * ( int * ) ctx ;
CompilerConstant_t * def = data ;
if ( def - > fromfile )
{
snprintf ( line , sizeof ( line ) , " %s \t %s \t %i; \" \t d \n " , def - > name , def - > fromfile , def - > fromline ) ;
SafeWrite ( h , line , strlen ( line ) ) ;
}
}
static void QCC_DumpTags ( const char * outputname )
{
char line [ 65536 ] ;
char scope [ 2048 ] ;
int h ;
QCC_def_t * def ;
QCC_function_t * fnc ;
int i ;
QCC_type_t * t ;
snprintf ( line , sizeof ( line ) , " %s.tags " , outputname ) ;
h = SafeOpenWrite ( line , 2 * 1024 * 1024 ) ;
if ( h > = 0 )
{
Hash_Enumerate ( & compconstantstable , QCC_DumpPreProcTags , & h ) ;
for ( i = 0 ; i < numtypeinfos ; i + + )
{
t = & qcc_typeinfo [ i ] ;
if ( ! t - > line | | ! t - > filen )
continue ; //predefined type, not from any file.
if ( ! * t - > name | | strchr ( t - > name , ' < ' ) )
continue ; //anonymous stuff happens.
if ( t - > typedefed )
snprintf ( line , sizeof ( line ) , " %s \t %s \t %i; \" \t t \n " , t - > name , t - > filen , t - > line ) ;
else if ( t - > type = = ev_struct )
snprintf ( line , sizeof ( line ) , " %s \t %s \t %i; \" \t s \n " , t - > name , t - > filen , t - > line ) ;
else if ( t - > type = = ev_union )
snprintf ( line , sizeof ( line ) , " %s \t %s \t %i; \" \t u \n " , t - > name , t - > filen , t - > line ) ;
else if ( t - > type = = ev_enum )
snprintf ( line , sizeof ( line ) , " %s \t %s \t %i; \" \t g \n " , t - > name , t - > filen , t - > line ) ;
else if ( ( t - > type = = ev_entity | | t - > type = = ev_accessor ) & & t - > parentclass )
snprintf ( line , sizeof ( line ) , " %s \t %s \t %i; \" \t c \n " , t - > name , t - > filen , t - > line ) ;
else
continue ;
SafeWrite ( h , line , strlen ( line ) ) ;
}
for ( def = pr . def_head . next ; def ; def = def - > next )
{
//immediates are uninteresting...
if ( ! strcmp ( def - > name , " IMMEDIATE " ) )
continue ;
if ( strchr ( def - > name , ' . ' ) | | strchr ( def - > name , ' [ ' ) | | strchr ( def - > name , ' * ' ) )
continue ; //weird symbols, listed for savedgames only...
if ( def - > scope & & ! strchr ( def - > scope - > name , ' : ' ) )
snprintf ( scope , sizeof ( scope ) , " \t function:%s \n " , def - > scope - > name ) ;
else if ( def - > isstatic )
snprintf ( scope , sizeof ( scope ) , " \f ile: \n " ) ; //local scope
else
* scope = 0 ;
if ( def - > type - > type = = ev_function & & def - > constant & & ! def - > arraysize )
{
int fnum = def - > symboldata [ 0 ] . function ;
if ( fnum > 0 & & fnum < numfunctions )
{
fnc = & functions [ fnum ] ;
if ( fnc - > code > = 0 & & fnc - > filen )
{
snprintf ( line , sizeof ( line ) , " %s \t %s \t %i; \" \t f%s \n " , def - > name , fnc - > filen , fnc - > line , scope ) ;
SafeWrite ( h , line , strlen ( line ) ) ;
}
}
if ( def - > filen )
{
snprintf ( line , sizeof ( line ) , " %s \t %s \t %i; \" \t p%s \n " , def - > name , def - > filen , def - > s_line , scope ) ;
SafeWrite ( h , line , strlen ( line ) ) ;
}
}
else if ( def - > filen )
{
snprintf ( line , sizeof ( line ) , " %s \t %s \t %i; \" \t v%s \n " , def - > name , def - > filen , def - > s_line , scope ) ;
SafeWrite ( h , line , strlen ( line ) ) ;
}
}
}
SafeClose ( h ) ;
}
2016-11-20 20:52:41 +00:00
int WriteSourceFiles ( qcc_cachedsourcefile_t * filelist , int h , pbool sourceaswell , pbool legacyembed )
2004-09-07 18:16:59 +00:00
{
2016-09-01 14:31:24 +00:00
//helpers to deal with misaligned data. writes little-endian.
# define misbyte(ptr,ofs,data) ((unsigned char*)(ptr))[ofs] = (data)&0xff;
# define misshort(ptr,ofs,data) misbyte((ptr),(ofs),(data));misbyte((ptr),(ofs)+1,(data)>>8);
# define misint(ptr,ofs,data) misshort((ptr),(ofs),(data));misshort((ptr),(ofs)+2,(data)>>16);
2004-09-07 18:16:59 +00:00
includeddatafile_t * idf ;
qcc_cachedsourcefile_t * f ;
int num = 0 ;
int ofs ;
2016-09-01 14:31:24 +00:00
pbool zipembed = true ;
int startofs ;
sourceaswell | = flag_embedsrc ;
2004-09-07 18:16:59 +00:00
2016-11-20 20:52:41 +00:00
for ( f = filelist , num = 0 ; f ; f = f - > next )
2004-09-07 18:16:59 +00:00
{
if ( f - > type = = FT_CODE & & ! sourceaswell )
continue ;
num + + ;
}
if ( ! num )
2016-09-01 14:31:24 +00:00
{
if ( zipembed )
{ //zips are found by scanning. so make sure something can be found so noone will erroneously find something
char centralheader [ 22 ] ;
int centraldirofs = SafeSeek ( h , 0 , SEEK_CUR ) ;
misint ( centralheader , 0 , 0x06054b50 ) ;
misshort ( centralheader , 4 , 0 ) ; //this disk number
misshort ( centralheader , 6 , 0 ) ; //centraldir first disk
misshort ( centralheader , 8 , 0 ) ; //centraldir entries
misshort ( centralheader , 10 , 0 ) ; //total centraldir entries
misint ( centralheader , 12 , 0 ) ; //centraldir size
misint ( centralheader , 16 , centraldirofs ) ; //centraldir offset
misshort ( centralheader , 20 , 0 ) ; //comment length
SafeWrite ( h , centralheader , 22 ) ;
}
2004-09-07 18:16:59 +00:00
return 0 ;
2016-09-01 14:31:24 +00:00
}
startofs = SafeSeek ( h , 0 , SEEK_CUR ) ;
2004-09-07 18:16:59 +00:00
idf = qccHunkAlloc ( sizeof ( includeddatafile_t ) * num ) ;
2016-11-20 20:52:41 +00:00
for ( f = filelist , num = 0 ; f ; f = f - > next )
2004-09-07 18:16:59 +00:00
{
if ( f - > type = = FT_CODE & & ! sourceaswell )
continue ;
2016-09-01 14:31:24 +00:00
if ( zipembed )
{
size_t end ;
2018-07-05 16:21:44 +00:00
char header [ 32 ] ;
2016-09-01 14:31:24 +00:00
size_t fnamelen = strlen ( f - > filename ) ;
f - > zcrc = QC_encodecrc ( f - > size , f - > file ) ;
misint ( header , 0 , 0x04034b50 ) ;
misshort ( header , 4 , 0 ) ; //minver
misshort ( header , 6 , 0 ) ; //general purpose flags
misshort ( header , 8 , 0 ) ; //compression method, 0=store, 8=deflate
misshort ( header , 10 , 0 ) ; //lastmodfiletime
misshort ( header , 12 , 0 ) ; //lastmodfiledate
misint ( header , 14 , f - > zcrc ) ; //crc32
misint ( header , 18 , f - > size ) ; //compressed size
misint ( header , 22 , f - > size ) ; //uncompressed size
misshort ( header , 26 , fnamelen ) ; //filename length
misshort ( header , 28 , 0 ) ; //extradata length
f - > zhdrofs = SafeSeek ( h , 0 , SEEK_CUR ) ;
2018-07-05 16:21:44 +00:00
SafeWrite ( h , header , 30 ) ;
SafeWrite ( h , f - > filename , fnamelen ) ;
2016-09-01 14:31:24 +00:00
strcpy ( idf [ num ] . filename , f - > filename ) ;
idf [ num ] . size = f - > size ;
idf [ num ] . compmethod = 8 ; //must be 0(raw) or 8(raw deflate) for zips to work
idf [ num ] . ofs = SafeSeek ( h , 0 , SEEK_CUR ) ;
if ( idf [ num ] . compmethod = = 0 )
SafeWrite ( h , f - > file , f - > size ) ;
else
{
idf [ num ] . compsize = QC_encode ( progfuncs , f - > size , idf [ num ] . compmethod , f - > file , h ) ;
misshort ( header , 8 , idf [ num ] . compmethod ) ; //compression method, 0=store, 8=deflate
misint ( header , 18 , idf [ num ] . compsize ) ;
end = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , f - > zhdrofs , SEEK_SET ) ;
2018-07-05 16:21:44 +00:00
SafeWrite ( h , header , 30 ) ;
2016-09-01 14:31:24 +00:00
SafeSeek ( h , end , SEEK_SET ) ;
}
}
else
{
2018-07-05 16:21:44 +00:00
if ( strlen ( f - > filename ) > = sizeof ( idf [ num ] . filename ) )
2016-09-01 14:31:24 +00:00
continue ;
strcpy ( idf [ num ] . filename , f - > filename ) ;
idf [ num ] . size = f - > size ;
# ifdef AVAIL_ZLIB
idf [ num ] . compmethod = 2 ;
# else
2016-09-08 19:04:35 +00:00
idf [ num ] . compmethod = 0 ;
2016-09-01 14:31:24 +00:00
# endif
idf [ num ] . ofs = SafeSeek ( h , 0 , SEEK_CUR ) ;
idf [ num ] . compsize = QC_encode ( progfuncs , f - > size , idf [ num ] . compmethod , f - > file , h ) ;
}
2004-09-07 18:16:59 +00:00
num + + ;
}
2016-09-01 14:31:24 +00:00
if ( zipembed )
{
2018-07-05 16:21:44 +00:00
char centralheader [ 46 ] ;
2016-09-01 14:31:24 +00:00
int centraldirsize ;
ofs = SafeSeek ( h , 0 , SEEK_CUR ) ;
2016-11-20 20:52:41 +00:00
for ( f = filelist , num = 0 ; f ; f = f - > next )
2016-09-01 14:31:24 +00:00
{
size_t fnamelen ;
if ( f - > type = = FT_CODE & & ! sourceaswell )
continue ;
fnamelen = strlen ( f - > filename ) ;
misint ( centralheader , 0 , 0x02014b50 ) ;
misshort ( centralheader , 4 , 0 ) ; //ourver
misshort ( centralheader , 6 , 0 ) ; //minver
misshort ( centralheader , 8 , 0 ) ; //general purpose flags
misshort ( centralheader , 10 , idf [ num ] . compmethod ) ; //compression method, 0=store, 8=deflate
misshort ( centralheader , 12 , 0 ) ; //lastmodfiletime
misshort ( centralheader , 14 , 0 ) ; //lastmodfiledate
misint ( centralheader , 16 , f - > zcrc ) ; //crc32
misint ( centralheader , 20 , idf [ num ] . compsize ) ; //compressed size
misint ( centralheader , 24 , f - > size ) ; //uncompressed size
misshort ( centralheader , 28 , fnamelen ) ; //filename length
misshort ( centralheader , 30 , 0 ) ; //extradata length
misshort ( centralheader , 32 , 0 ) ; //comment length
misshort ( centralheader , 34 , 0 ) ; //first disk number
misshort ( centralheader , 36 , 0 ) ; //internal file attribs
misint ( centralheader , 38 , 0 ) ; //external file attribs
misint ( centralheader , 42 , f - > zhdrofs ) ; //local header offset
2018-07-05 16:21:44 +00:00
SafeWrite ( h , centralheader , 46 ) ;
SafeWrite ( h , f - > filename , fnamelen ) ;
2016-09-01 14:31:24 +00:00
num + + ;
}
centraldirsize = SafeSeek ( h , 0 , SEEK_CUR ) - ofs ;
misint ( centralheader , 0 , 0x06054b50 ) ;
misshort ( centralheader , 4 , 0 ) ; //this disk number
misshort ( centralheader , 6 , 0 ) ; //centraldir first disk
misshort ( centralheader , 8 , num ) ; //centraldir entries
misshort ( centralheader , 10 , num ) ; //total centraldir entries
misint ( centralheader , 12 , centraldirsize ) ; //centraldir size
misint ( centralheader , 16 , ofs ) ; //centraldir offset
misshort ( centralheader , 20 , 0 ) ; //comment length
SafeWrite ( h , centralheader , 22 ) ;
ofs = 0 ;
}
else if ( legacyembed )
{
ofs = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeWrite ( h , & num , sizeof ( int ) ) ;
SafeWrite ( h , idf , sizeof ( includeddatafile_t ) * num ) ;
}
else
ofs = 0 ;
2004-09-07 18:16:59 +00:00
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Embedded files take %u bytes \n " , SafeSeek ( h , 0 , SEEK_CUR ) - startofs ) ;
2016-09-01 14:31:24 +00:00
2004-09-07 18:16:59 +00:00
return ofs ;
}
2018-10-11 10:31:23 +00:00
static void QCC_InitData ( void )
2004-09-07 18:16:59 +00:00
{
static char parmname [ 12 ] [ MAX_PARMS ] ;
int i ;
qcc_sourcefile = NULL ;
2011-05-15 13:23:13 +00:00
2013-03-12 22:32:25 +00:00
memset ( stringtablist , 0 , sizeof ( stringtablist ) ) ;
2014-02-07 08:38:40 +00:00
numstatements = 1 ; //first statement should be an OP_DONE, matching the null function(ish), in case it somehow doesn't get caught by the vm.
strofs = 2 ; //null, empty, *other stuff*
numfunctions = 1 ; //first function is a null function.
numglobaldefs = 1 ; //first globaldef is a null def. just because. doesn't include parms+ret. is there any point to this?
numfielddefs = 0 ;
fields [ numfielddefs ] . type = ev_void ;
fields [ numfielddefs ] . s_name = 0 ; //should map to null
fields [ numfielddefs ] . ofs = 0 ;
numfielddefs + + ; //FIXME: do we actually need a null field? is there any point to this at all?
2004-10-01 22:20:19 +00:00
2015-04-14 12:24:05 +00:00
memset ( & def_ret , 0 , sizeof ( def_ret ) ) ;
2004-09-07 18:16:59 +00:00
def_ret . ofs = OFS_RETURN ;
def_ret . name = " return " ;
def_ret . constant = false ;
2004-10-01 22:20:19 +00:00
def_ret . type = NULL ;
2015-04-14 12:24:05 +00:00
def_ret . symbolheader = & def_ret ;
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < MAX_PARMS ; i + + )
{
2016-09-01 14:31:24 +00:00
def_parms [ i ] . symbolheader = & def_parms [ i ] ;
2004-10-01 22:20:19 +00:00
def_parms [ i ] . temp = NULL ;
def_parms [ i ] . type = NULL ;
2004-09-07 18:16:59 +00:00
def_parms [ i ] . ofs = OFS_PARM0 + 3 * i ;
def_parms [ i ] . name = parmname [ i ] ;
sprintf ( parmname [ i ] , " parm%i " , i ) ;
}
}
2018-10-11 10:31:23 +00:00
static int WriteBodylessFuncs ( int handle )
2004-09-07 18:16:59 +00:00
{
QCC_def_t * d ;
int ret = 0 ;
for ( d = pr . def_head . next ; d ; d = d - > next )
{
2020-09-11 01:18:32 +00:00
if ( ! d - > used | | ! d - > constant | | d - > symbolheader ! = d )
2016-09-08 19:04:35 +00:00
continue ;
2004-09-07 18:16:59 +00:00
if ( d - > type - > type = = ev_function & & ! d - > scope ) // function parms are ok
{
2018-10-11 10:31:23 +00:00
if ( d - > isextern )
2004-09-07 18:16:59 +00:00
{
SafeWrite ( handle , d - > name , strlen ( d - > name ) + 1 ) ;
ret + + ;
}
2016-09-08 19:04:35 +00:00
if ( d - > initialized = = 0 )
{
QCC_PR_Warning ( ERR_NOFUNC , d - > filen , d - > s_line , " function %s has no body " , d - > name ) ;
QCC_PR_ParsePrintDef ( ERR_NOFUNC , d ) ;
}
2004-09-07 18:16:59 +00:00
}
}
return ret ;
}
2018-10-11 10:31:23 +00:00
static void QCC_DetermineNeededSymbols ( QCC_def_t * endsyssym )
2004-09-07 18:16:59 +00:00
{
2015-07-06 14:47:46 +00:00
QCC_def_t * sym = pr . def_head . next ;
2015-04-14 12:24:05 +00:00
size_t i ;
//make sure system defs are not hurt by this.
2015-07-06 14:47:46 +00:00
if ( endsyssym )
2015-04-14 12:24:05 +00:00
{
2015-07-06 14:47:46 +00:00
for ( ; sym ; sym = sym - > next )
{
2017-10-12 12:02:25 +00:00
if ( sym - > unused & & ! sym - > initialized )
sym - > initialized = 1 ; //even if its not.
2015-07-06 14:47:46 +00:00
sym - > used = true ;
sym - > referenced = true ; //silence warnings about unreferenced things that can't be stripped
if ( sym = = endsyssym )
break ;
}
2015-04-14 12:24:05 +00:00
}
//non-system fields should maybe be present too.
2018-08-03 11:08:04 +00:00
if ( ! opt_stripunusedfields )
2015-04-14 12:24:05 +00:00
{
2018-08-03 11:08:04 +00:00
for ( ; sym ; sym = sym - > next )
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
{
2018-08-03 11:08:04 +00:00
if ( sym - > constant & & sym - > type - > type = = ev_field )
{
2022-01-16 18:41:25 +00:00
sym - > used = true ;
2018-08-03 11:08:04 +00:00
sym - > referenced = true ;
}
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
}
2015-04-14 12:24:05 +00:00
}
2018-08-03 11:08:04 +00:00
2004-09-07 18:16:59 +00:00
2015-04-14 12:24:05 +00:00
for ( i = 0 ; i < numstatements ; i + + )
{
if ( ( sym = statements [ i ] . a . sym ) )
if ( sym - > symbolheader )
2022-01-16 18:41:25 +00:00
sym - > used = true ;
2015-04-14 12:24:05 +00:00
if ( ( sym = statements [ i ] . b . sym ) )
if ( sym - > symbolheader )
2022-01-16 18:41:25 +00:00
sym - > used = true ;
2015-04-14 12:24:05 +00:00
if ( ( sym = statements [ i ] . c . sym ) )
if ( sym - > symbolheader )
2022-01-16 18:41:25 +00:00
sym - > used = true ;
2015-04-14 12:24:05 +00:00
}
}
2004-09-07 18:16:59 +00:00
2015-04-14 12:24:05 +00:00
//allocates final space for the def, making it a true def
2018-10-11 10:31:23 +00:00
static void QCC_FinaliseDef ( QCC_def_t * def )
2015-04-14 12:24:05 +00:00
{
2017-10-12 12:02:25 +00:00
//#define DEBUG_DUMP_GLOBALMAP
# if defined(DEBUG_DUMP) || defined(DEBUG_DUMP_GLOBALMAP)
int ssize = def - > symbolsize ;
const QCC_eval_t * v ;
QCC_sref_t sr ;
# endif
if ( def - > symboldata = = qcc_pr_globals + def - > ofs )
2020-09-11 01:18:32 +00:00
{
# ifdef DEBUG_DUMP_GLOBALMAP
externs - > Printf ( " Prefinalised %s @ %i+%i \n " , def - > name , def - > ofs , ssize ) ;
# endif
2017-10-12 12:02:25 +00:00
return ; //was already finalised.
2020-09-11 01:18:32 +00:00
}
2017-10-12 12:02:25 +00:00
if ( def - > symbolheader ! = def )
2017-11-14 14:37:04 +00:00
{
2022-01-16 18:41:25 +00:00
def - > symbolheader - > used | = def - > used ;
2017-10-12 12:02:25 +00:00
QCC_FinaliseDef ( def - > symbolheader ) ;
2017-11-14 14:37:04 +00:00
def - > referenced = true ;
}
2015-04-14 12:24:05 +00:00
if ( def - > symbolheader = = def & & def - > deftail )
2004-09-07 18:16:59 +00:00
{
2015-04-14 12:24:05 +00:00
//for head symbols, we go through and touch all of their children
QCC_def_t * prev , * sub ;
2017-11-14 14:37:04 +00:00
if ( def - > used & & ! def - > referenced )
2015-04-14 12:24:05 +00:00
{
pbool ignoreone = true ;
//touch all but one child
for ( prev = def , sub = prev - > next ; prev ! = def - > deftail ; sub = ( prev = sub ) - > next )
{
if ( sub - > referenced )
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
def - > referenced = true ; //if one child is referenced, the composite is referenced
2015-04-14 12:24:05 +00:00
else if ( ! sub - > referenced & & ignoreone )
2016-07-12 00:40:13 +00:00
ignoreone = false ; //this is the one we're going to warn about
2015-04-14 12:24:05 +00:00
}
2017-11-14 14:37:04 +00:00
// if (def->referenced) //no child defs were referenced at all. if we're going to be warning about this then at least mute warnings for any other fields
// for (prev = def, sub = prev->next; prev != def->deftail; sub = (prev=sub)->next)
// sub->referenced = true;
2015-04-14 12:24:05 +00:00
}
else
2004-09-07 18:16:59 +00:00
{
2017-11-14 14:37:04 +00:00
//touch children to silence annoying warnings.
2015-04-14 12:24:05 +00:00
for ( prev = def , sub = prev - > next ; prev ! = def - > deftail ; sub = ( prev = sub ) - > next )
2017-11-14 14:37:04 +00:00
sub - > referenced | = true ;
2004-09-07 18:16:59 +00:00
}
2017-02-19 00:15:42 +00:00
# ifdef TODO_READWRITETRACK
if ( ! def - > read )
{
pbool ignoreone = true ;
//touch all but one child
for ( prev = def , sub = prev - > next ; prev ! = def - > deftail ; sub = ( prev = sub ) - > next )
{
if ( sub - > read )
def - > read = true ; //if one child is referenced, the composite is referenced
else if ( ! sub - > read & & ignoreone )
ignoreone = false ; //this is the one we're going to warn about
else
sub - > read | = def - > read ;
}
if ( ! def - > read ) //no child defs were referenced at all. if we're going to be warning about this then at least mute warnings for any other fields
for ( prev = def , sub = prev - > next ; prev ! = def - > deftail ; sub = ( prev = sub ) - > next )
sub - > read = true ;
}
else
{
//touch children
for ( prev = def , sub = prev - > next ; prev ! = def - > deftail ; sub = ( prev = sub ) - > next )
sub - > read | = def - > read ;
}
if ( ! def - > written )
{
pbool ignoreone = true ;
//touch all but one child
for ( prev = def , sub = prev - > next ; prev ! = def - > deftail ; sub = ( prev = sub ) - > next )
{
if ( sub - > written )
def - > written = true ; //if one child is referenced, the composite is referenced
else if ( ! sub - > written & & ignoreone )
ignoreone = false ; //this is the one we're going to warn about
else
sub - > written | = def - > written ;
}
if ( ! def - > written ) //no child defs were referenced at all. if we're going to be warning about this then at least mute warnings for any other fields
for ( prev = def , sub = prev - > next ; prev ! = def - > deftail ; sub = ( prev = sub ) - > next )
sub - > written = true ;
}
else
{
//touch children
for ( prev = def , sub = prev - > next ; prev ! = def - > deftail ; sub = ( prev = sub ) - > next )
sub - > written | = def - > written ;
}
# endif
2004-09-07 18:16:59 +00:00
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
// else if (def->symbolheader) //if a child symbol is referenced, mark the entire parent as referenced too. this avoids vec_x+vec_y with no vec or vec_z from generating warnings about vec being unreferenced
// def->symbolheader->referenced |= def->referenced;
2004-09-07 18:16:59 +00:00
2015-04-14 12:24:05 +00:00
if ( ! def - > symbolheader - > used )
2004-09-07 18:16:59 +00:00
{
2022-01-16 18:41:25 +00:00
if ( def - > symboldata ! = qcc_pr_globals + def - > ofs & & def - > symbolheader ! = def & & def - > symbolheader - > symboldata = = qcc_pr_globals + def - > symbolheader - > ofs )
{
def - > ofs + = def - > symbolheader - > ofs ;
def - > symboldata = qcc_pr_globals + def - > ofs ;
}
2017-03-04 19:36:06 +00:00
if ( verbose > = VERBOSE_DEBUG )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " not needed: %s \n " , def - > name ) ;
2015-04-14 12:24:05 +00:00
return ;
2004-09-07 18:16:59 +00:00
}
2022-01-16 18:41:25 +00:00
else if ( def - > symbolheader ! = def & & def - > symbolheader - > symboldata = = qcc_pr_globals + def - > symbolheader - > ofs )
{
2015-04-14 12:24:05 +00:00
def - > ofs + = def - > symbolheader - > ofs ;
2022-01-16 18:41:25 +00:00
}
2015-04-14 12:24:05 +00:00
else
{
2017-10-12 12:02:25 +00:00
/* globalspertype[def->type->type].size += def->symbolsize;
globalspertype [ def - > type - > type ] . entries + = 1 ;
globalspertype [ def - > type - > type ] . vars + = ! def - > constant ;
globalspertype [ def - > type - > type ] . consts + = def - > constant ;
*/
if ( def - > ofs )
2022-01-16 18:41:25 +00:00
{
if ( def - > symbolheader = = def )
QCC_Error ( ERR_INTERNAL , " root symbol %s has an offset " , def - > name ) ;
else
def - > ofs = 0 ;
}
2017-10-12 12:02:25 +00:00
2016-07-12 00:40:13 +00:00
if ( def - > arraylengthprefix )
2015-04-14 12:24:05 +00:00
{
2017-10-12 12:02:25 +00:00
//for hexen2 arrays, we need to emit a length first
2015-04-14 12:24:05 +00:00
if ( numpr_globals + 1 + def - > symbolsize > = MAX_REGS )
{
if ( ! opt_overlaptemps | | ! opt_locals_overlapping )
QCC_Error ( ERR_TOOMANYGLOBALS , " numpr_globals exceeded MAX_REGS - you'll need to use more optimisations " ) ;
else
2020-07-15 23:50:30 +00:00
QCC_Error ( ERR_TOOMANYGLOBALS , " numpr_globals exceeded MAX_REGS of %u. Increase with eg: -max_regs %u " , MAX_REGS , MAX_REGS * 2 ) ;
2015-04-14 12:24:05 +00:00
}
if ( def - > type - > type = = ev_vector )
( ( int * ) qcc_pr_globals ) [ numpr_globals ] = def - > arraysize - 1 ;
else
( ( int * ) qcc_pr_globals ) [ numpr_globals ] = ( def - > arraysize * def - > type - > size ) - 1 ; //using float arrays for structs.
numpr_globals + = 1 ;
}
2017-10-12 12:02:25 +00:00
else
2015-04-14 12:24:05 +00:00
{
2017-10-12 12:02:25 +00:00
if ( numpr_globals + def - > symbolsize > = MAX_REGS )
{
if ( ! opt_overlaptemps | | ! opt_locals_overlapping )
QCC_Error ( ERR_TOOMANYGLOBALS , " numpr_globals exceeded MAX_REGS - you'll need to use more optimisations " ) ;
else
2020-07-15 23:50:30 +00:00
QCC_Error ( ERR_TOOMANYGLOBALS , " numpr_globals exceeded MAX_REGS of %u. Increase with eg: -max_regs %u " , MAX_REGS , MAX_REGS * 2 ) ;
2017-10-12 12:02:25 +00:00
}
2015-04-14 12:24:05 +00:00
}
def - > ofs + = numpr_globals ;
numpr_globals + = def - > symbolsize ;
2004-09-07 18:16:59 +00:00
2015-04-14 12:24:05 +00:00
if ( def - > symboldata )
memcpy ( qcc_pr_globals + def - > ofs , def - > symboldata , def - > symbolsize * sizeof ( float ) ) ;
else
memset ( qcc_pr_globals + def - > ofs , 0 , def - > symbolsize * sizeof ( float ) ) ;
}
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
def - > symboldata = qcc_pr_globals + def - > ofs ;
def - > symbolsize = numpr_globals - def - > ofs ;
2015-04-14 12:24:05 +00:00
2020-07-13 17:48:16 +00:00
if ( def - > reloc )
{
def - > reloc - > used = true ;
QCC_FinaliseDef ( def - > reloc ) ;
qcc_pr_globals [ def - > ofs ] . _int + = def - > reloc - > ofs ;
}
2017-10-12 12:02:25 +00:00
# ifdef DEBUG_DUMP_GLOBALMAP
2015-04-14 12:24:05 +00:00
if ( ! def - > referenced )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Unreferenced " ) ;
2017-10-12 12:02:25 +00:00
sr . sym = def ;
sr . ofs = 0 ;
sr . cast = def - > type ;
2022-01-16 18:41:25 +00:00
v = ( QCC_eval_t * ) & sr . sym - > symboldata [ sr . ofs ] ;
2017-10-12 12:02:25 +00:00
if ( v & & def - > type - > type = = ev_float )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Finalise %s(%f) @ %i+%i \n " , def - > name , v - > _float , def - > ofs , ssize ) ;
2017-10-12 12:02:25 +00:00
else if ( v & & def - > type - > type = = ev_vector )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Finalise %s(%f %f %f) @ %i+%i \n " , def - > name , v - > vector [ 0 ] , v - > vector [ 1 ] , v - > vector [ 2 ] , def - > ofs , ssize ) ;
2017-10-12 12:02:25 +00:00
else if ( v & & def - > type - > type = = ev_integer )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Finalise %s(%i) @ %i+%i \n " , def - > name , v - > _int , def - > ofs , ssize ) ;
2017-10-12 12:02:25 +00:00
else if ( v & & def - > type - > type = = ev_function )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Finalise %s(@%i) @ %i+%i \n " , def - > name , v - > _int , def - > ofs , ssize ) ;
2017-10-12 12:02:25 +00:00
else if ( v & & def - > type - > type = = ev_field )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Finalise %s(.%i) @ %i+%i \n " , def - > name , v - > _int , def - > ofs , ssize ) ;
2017-10-12 12:02:25 +00:00
else if ( v & & def - > type - > type = = ev_string )
2020-08-03 10:34:44 +00:00
externs - > Printf ( " Finalise %s( \" %s \" ) @ %i+%i \n " , def - > name , strings + v - > _int , def - > ofs , ssize ) ;
2017-10-12 12:02:25 +00:00
else
2020-08-03 10:34:44 +00:00
externs - > Printf ( " Finalise %s(?) @ %i+%i \n " , def - > name , def - > ofs , ssize ) ;
2015-04-14 12:24:05 +00:00
# endif
2004-09-07 18:16:59 +00:00
}
2015-04-14 12:24:05 +00:00
//marshalled locals still point to the FIRST_LOCAL range.
//this function remaps all the locals back into actual usable defs.
2018-10-11 10:31:23 +00:00
static void QCC_UnmarshalLocals ( void )
2015-04-14 12:24:05 +00:00
{
QCC_def_t * d ;
2017-10-12 12:02:25 +00:00
unsigned int onum , biggest , eog ;
2015-04-14 12:24:05 +00:00
size_t i ;
2017-10-12 12:02:25 +00:00
//finalise all the globals that we've seen so far
for ( d = pr . def_head . next ; d ; d = d - > next )
{
if ( ! d - > localscope | | d - > isstatic )
QCC_FinaliseDef ( d ) ;
}
//first, finalize all static locals that shouldn't form part of the local defs.
for ( i = 0 ; i < numfunctions ; i + + )
{
2020-09-11 01:18:32 +00:00
// if (functions[i].privatelocals)
2017-10-12 12:02:25 +00:00
{
for ( d = functions [ i ] . firstlocal ; d ; d = d - > nextlocal )
if ( d - > isstatic | | ( d - > constant & & d - > initialized ) )
QCC_FinaliseDef ( d ) ;
}
}
eog = numpr_globals ;
2017-11-15 12:38:20 +00:00
//next, finalize non-static non-shared locals.
2015-04-14 12:24:05 +00:00
for ( i = 0 ; i < numfunctions ; i + + )
{
if ( functions [ i ] . privatelocals )
{
2016-07-12 00:40:13 +00:00
onum = numpr_globals ;
2015-04-14 12:24:05 +00:00
# ifdef DEBUG_DUMP
2018-10-11 10:31:23 +00:00
externs - > Printf ( " function %s locals: \n " , functions [ i ] . name ) ;
2015-04-14 12:24:05 +00:00
# endif
for ( d = functions [ i ] . firstlocal ; d ; d = d - > nextlocal )
2017-10-12 12:02:25 +00:00
if ( ! d - > isstatic & & ! ( d - > constant & & d - > initialized ) )
QCC_FinaliseDef ( d ) ;
2017-03-04 19:36:06 +00:00
if ( verbose > = VERBOSE_DEBUG )
2016-07-12 00:40:13 +00:00
{
if ( onum = = numpr_globals )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: function %s no private locals \n " , functions [ i ] . filen , functions [ i ] . line , functions [ i ] . name ) ;
2016-07-12 00:40:13 +00:00
else
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: function %s private locals %i-%i \n " , functions [ i ] . filen , functions [ i ] . line , functions [ i ] . name , onum , numpr_globals ) ;
2016-07-12 00:40:13 +00:00
}
2015-04-14 12:24:05 +00:00
}
}
2016-07-12 00:40:13 +00:00
//these functions don't have any initialisation issues, allowing us to merge them
2015-04-14 12:24:05 +00:00
onum = biggest = numpr_globals ;
for ( i = 0 ; i < numfunctions ; i + + )
{
if ( ! functions [ i ] . privatelocals )
{
numpr_globals = onum ;
for ( d = functions [ i ] . firstlocal ; d ; d = d - > nextlocal )
2017-11-15 12:38:20 +00:00
if ( ! d - > isstatic & & ! ( d - > constant & & d - > initialized ) )
QCC_FinaliseDef ( d ) ;
2015-04-14 12:24:05 +00:00
if ( biggest < numpr_globals )
biggest = numpr_globals ;
2016-07-12 00:40:13 +00:00
2017-03-04 19:36:06 +00:00
if ( verbose > = VERBOSE_DEBUG )
2016-07-12 00:40:13 +00:00
{
if ( onum = = numpr_globals )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: function %s no locals \n " , functions [ i ] . filen , functions [ i ] . line , functions [ i ] . name ) ;
2016-07-12 00:40:13 +00:00
else
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: function %s overlapped locals %i-%i \n " , functions [ i ] . filen , functions [ i ] . line , functions [ i ] . name , onum , numpr_globals ) ;
2016-07-12 00:40:13 +00:00
for ( d = functions [ i ] . firstlocal ; d ; d = d - > nextlocal )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: %s @%i \n " , functions [ i ] . filen , functions [ i ] . line , d - > name , d - > ofs ) ;
2016-07-12 00:40:13 +00:00
}
}
}
2015-04-14 12:24:05 +00:00
}
}
numpr_globals = biggest ;
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %i shared locals, %i private, %i total \n " , biggest - onum , onum - eog , numpr_globals - eog ) ;
2015-04-14 12:24:05 +00:00
}
2016-02-10 23:23:43 +00:00
static void QCC_GenerateFieldDefs ( QCC_def_t * def , char * fieldname , int ofs , QCC_type_t * type )
{
string_t sname ;
QCC_ddef32_t * dd ;
if ( type - > type = = ev_struct | | type - > type = = ev_union )
{ //the qcvm cannot cope with struct fields. so we need to generate lots of fake ones.
char sub [ 256 ] ;
unsigned int p , a ;
2018-01-23 01:22:29 +00:00
unsigned int parms = type - > num_parms ;
2016-02-10 23:23:43 +00:00
if ( type - > type = = ev_union )
parms = 1 ; //unions only generate the first element. it simplifies things (should really just be the biggest).
for ( p = 0 ; p < parms ; p + + )
{
if ( type - > params [ p ] . arraysize )
{
for ( a = 0 ; a < type - > params [ p ] . arraysize ; a + + )
{
QC_snprintfz ( sub , sizeof ( sub ) , " %s.%s[%u] " , fieldname , type - > params [ p ] . paramname , a ) ;
QCC_GenerateFieldDefs ( def , sub , ofs + type - > params [ p ] . ofs + a * type - > params [ p ] . type - > size , type - > params [ p ] . type ) ;
}
}
else
{
QC_snprintfz ( sub , sizeof ( sub ) , " %s.%s " , fieldname , type - > params [ p ] . paramname ) ;
QCC_GenerateFieldDefs ( def , sub , ofs + type - > params [ p ] . ofs , type - > params [ p ] . type ) ;
}
}
return ;
}
if ( numfielddefs > = MAX_FIELDS )
QCC_PR_ParseError ( 0 , " Too many fields. Limit is %u \n " , MAX_FIELDS ) ;
dd = & fields [ numfielddefs ] ;
numfielddefs + + ;
dd - > type = type - > type ;
dd - > s_name = sname = QCC_CopyString ( fieldname ) ;
dd - > ofs = def - > symboldata [ ofs ] . _int ;
if ( numglobaldefs > = MAX_GLOBALS )
QCC_PR_ParseError ( 0 , " Too many globals. Limit is %u \n " , MAX_GLOBALS ) ;
//and make sure that there's a global defined too, so field remapping isn't screwed.
dd = & qcc_globals [ numglobaldefs ] ;
numglobaldefs + + ;
dd - > type = ev_field ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
dd - > ofs = def - > ofs + ofs ;
2016-02-10 23:23:43 +00:00
dd - > s_name = sname ;
}
2015-04-14 12:24:05 +00:00
2018-10-11 10:31:23 +00:00
static const char * QCC_FileForStatement ( int st )
2017-03-04 19:36:06 +00:00
{
2017-03-04 19:49:40 +00:00
const char * ret = " ??? " ;
2017-03-04 19:36:06 +00:00
int i ;
for ( i = 0 ; i < numfunctions ; i + + )
{
if ( functions [ i ] . code > 0 )
{
if ( st < functions [ i ] . code )
break ;
ret = functions [ i ] . filen ;
}
}
return ret ;
}
2018-10-11 10:31:23 +00:00
static const char * QCC_FunctionForStatement ( int st )
2017-03-30 18:37:16 +00:00
{
const char * ret = " ??? " ;
int i ;
for ( i = 0 ; i < numfunctions ; i + + )
{
if ( functions [ i ] . code > 0 )
{
if ( st < functions [ i ] . code )
break ;
2021-08-27 04:29:31 +00:00
ret = functions [ i ] . name ;
2017-03-30 18:37:16 +00:00
}
}
return ret ;
}
2017-03-04 19:36:06 +00:00
2020-09-08 04:44:07 +00:00
static void QCC_PR_CRCMessages ( unsigned short crc ) ;
2004-09-07 18:16:59 +00:00
CompilerConstant_t * QCC_PR_CheckCompConstDefined ( char * def ) ;
2018-10-11 10:31:23 +00:00
static pbool QCC_WriteData ( int crc )
2004-09-07 18:16:59 +00:00
{
2015-04-14 12:24:05 +00:00
QCC_def_t * def ;
2004-09-07 18:16:59 +00:00
QCC_ddef_t * dd ;
dprograms_t progs ;
int h ;
int i , len ;
2005-02-28 07:16:19 +00:00
pbool debugtarget = false ;
2004-09-07 18:16:59 +00:00
pbool types = false ;
2011-03-04 13:59:06 +00:00
int outputsttype = PST_DEFAULT ;
2016-07-12 00:40:13 +00:00
int dupewarncount = 0 , extwarncount = 0 ;
2014-04-12 03:31:59 +00:00
int * statement_linenums ;
2015-04-14 12:24:05 +00:00
void * funcdata ;
size_t funcdatasize ;
2017-03-30 18:37:16 +00:00
const char * bigjumps = NULL ;
2015-04-14 12:24:05 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2015-04-14 12:24:05 +00:00
extern char * basictypenames [ ] ;
2004-09-07 18:16:59 +00:00
2016-09-01 14:31:24 +00:00
memset ( & progs , 0 , sizeof ( progs ) ) ;
2008-11-09 22:29:28 +00:00
if ( numstatements = = 1 & & numfunctions = = 1 & & numglobaldefs = = 1 & & numfielddefs = = 1 )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " nothing to write \n " ) ;
2008-11-09 22:29:28 +00:00
return false ;
}
2004-09-07 18:16:59 +00:00
progs . blockscompressed = 0 ;
if ( numstatements > MAX_STATEMENTS )
2018-04-20 19:09:14 +00:00
QCC_Error ( ERR_TOOMANYSTATEMENTS , " Too many statements - %i \n Add '-max_statements %i' to the commandline " , numstatements , ( numstatements + 32768 ) & ~ 32767 ) ;
2004-09-07 18:16:59 +00:00
if ( strofs > MAX_STRINGS )
2018-04-20 19:09:14 +00:00
QCC_Error ( ERR_TOOMANYSTRINGS , " Too many strings - %i \n Add '-max_strings %i' to the commandline " , strofs , ( strofs + 32768 ) & ~ 32767 ) ;
2004-09-07 18:16:59 +00:00
2015-04-14 12:24:05 +00:00
//part of how compilation works. This def is always present, and never used.
def = QCC_PR_GetDef ( NULL , " end_sys_globals " , NULL , false , 0 , false ) ;
if ( def )
def - > referenced = true ;
def = QCC_PR_GetDef ( NULL , " end_sys_fields " , NULL , false , 0 , false ) ;
if ( def )
def - > referenced = true ;
2017-10-12 12:02:25 +00:00
QCC_PR_FinaliseFunctions ( ) ;
2015-04-14 12:24:05 +00:00
QCC_DetermineNeededSymbols ( def ) ;
2004-09-07 18:16:59 +00:00
QCC_UnmarshalLocals ( ) ;
2015-04-14 12:24:05 +00:00
QCC_FinaliseTemps ( ) ;
2004-09-07 18:16:59 +00:00
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
for ( i = 0 ; i < numstatements ; i + + )
{
2017-03-30 18:37:16 +00:00
if ( ! statements [ i ] . a . sym & & ( ( int ) statements [ i ] . a . ofs > 0x7fff | | ( int ) statements [ i ] . a . ofs < - 0x7fff ) )
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
break ;
2017-03-30 18:37:16 +00:00
if ( ! statements [ i ] . a . sym & & ( ( int ) statements [ i ] . a . ofs > 0x7fff | | ( int ) statements [ i ] . a . ofs < - 0x7fff ) )
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
break ;
2017-03-30 18:37:16 +00:00
if ( ! statements [ i ] . a . sym & & ( ( int ) statements [ i ] . a . ofs > 0x7fff | | ( int ) statements [ i ] . a . ofs < - 0x7fff ) )
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
break ;
}
2017-03-30 18:37:16 +00:00
if ( i < numstatements )
bigjumps = QCC_FunctionForStatement ( i ) ;
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
2020-09-08 04:44:07 +00:00
QCC_PR_CRCMessages ( crc ) ;
2004-09-07 18:16:59 +00:00
switch ( qcc_targetformat )
{
case QCF_HEXEN2 :
case QCF_STANDARD :
2020-07-13 17:48:16 +00:00
case QCF_DARKPLACES : //grr.
2004-09-07 18:16:59 +00:00
if ( bodylessfuncs )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Warning: There are some functions without bodies. \n " ) ;
2004-09-07 18:16:59 +00:00
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
if ( bigjumps )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Forcing target to FTE32 due to large function %s \n " , bigjumps ) ;
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
outputsttype = PST_FTE32 ;
}
else if ( numpr_globals > 65530 )
2004-09-07 18:16:59 +00:00
{
2020-07-01 05:32:21 +00:00
if ( qcc_targetformat = = QCF_HEXEN2 )
{
externs - > Printf ( " Forcing target to uHexen2 due to numpr_globals \n " ) ;
outputsttype = PST_UHEXEN2 ;
}
else
{
externs - > Printf ( " Forcing target to FTE32 due to numpr_globals \n " ) ;
outputsttype = PST_FTE32 ;
}
2004-09-07 18:16:59 +00:00
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
else if ( qcc_targetformat = = QCF_FTEH2 )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Progs execution will require FTE \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
break ;
}
2004-09-07 18:16:59 +00:00
else if ( qcc_targetformat = = QCF_HEXEN2 )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Progs execution requires a Hexen2 compatible HCVM \n " ) ;
2004-09-07 18:16:59 +00:00
break ;
}
2020-07-13 17:48:16 +00:00
else if ( qcc_targetformat = = QCF_DARKPLACES )
{
externs - > Printf ( " Progs execution uses extended opcodes. \n " ) ;
break ;
}
2004-09-07 18:16:59 +00:00
else
{
2005-07-28 15:52:31 +00:00
if ( numpr_globals > = 32768 ) //not much of a different format. Rewrite output to get it working on original executors?
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Globals exceeds 32k - an enhanced QCVM will be required \n " ) ;
2022-08-08 22:45:19 +00:00
else if ( verbose > = VERBOSE_STANDARD )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Progs should run on any QuakeC VM \n " ) ;
2004-09-07 18:16:59 +00:00
break ;
}
2020-07-13 17:48:16 +00:00
QCC_OPCodeSetTarget ( ( qcc_targetformat = = QCF_HEXEN2 ) ? QCF_FTEH2 : QCF_FTE , 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
//intentional fallthrough
2004-09-07 18:16:59 +00:00
case QCF_FTEDEBUG :
case QCF_FTE :
------------------------------------------------------------------------
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
case QCF_FTEH2 :
2020-07-13 17:48:16 +00:00
case QCF_QSS :
2005-02-28 07:16:19 +00:00
if ( qcc_targetformat = = QCF_FTEDEBUG )
debugtarget = true ;
2020-07-01 05:32:21 +00:00
if ( outputsttype ! = PST_FTE32 & & outputsttype ! = PST_UHEXEN2 )
2004-09-07 18:16:59 +00:00
{
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
if ( bigjumps )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Using 32 bit target due to large function %s \n " , bigjumps ) ;
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
outputsttype = PST_FTE32 ;
}
else if ( numpr_globals > 65530 )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Using 32 bit target due to numpr_globals \n " ) ;
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
outputsttype = PST_FTE32 ;
}
2004-09-07 18:16:59 +00:00
}
2020-07-13 17:48:16 +00:00
if ( qcc_targetformat = = QCF_QSS | | qcc_targetformat = = QCF_DARKPLACES )
2009-04-01 22:03:56 +00:00
compressoutput = 0 ;
2004-09-07 18:16:59 +00:00
//compression of blocks?
2005-02-28 07:16:19 +00:00
if ( compressoutput ) progs . blockscompressed | = 1 ; //statements
if ( compressoutput ) progs . blockscompressed | = 2 ; //defs
if ( compressoutput ) progs . blockscompressed | = 4 ; //fields
if ( compressoutput ) progs . blockscompressed | = 8 ; //functions
if ( compressoutput ) progs . blockscompressed | = 16 ; //strings
if ( compressoutput ) progs . blockscompressed | = 32 ; //globals
if ( compressoutput ) progs . blockscompressed | = 64 ; //line numbers
if ( compressoutput ) progs . blockscompressed | = 128 ; //types
2004-09-07 18:16:59 +00:00
//include a type block?
2013-05-11 05:03:07 +00:00
//types = debugtarget;
2011-12-23 03:12:29 +00:00
if ( types & & sizeof ( char * ) ! = sizeof ( string_t ) )
2010-11-02 23:17:25 +00:00
{
//qcc_typeinfo_t has a char* inside it, which changes size
2018-10-11 10:31:23 +00:00
externs - > Printf ( " AMD64 builds cannot write typeinfo structures \n " ) ;
2010-11-02 23:17:25 +00:00
types = false ;
}
2004-09-07 18:16:59 +00:00
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2009-11-04 21:16:50 +00:00
{
2020-07-13 17:48:16 +00:00
if ( qcc_targetformat = = QCF_QSS )
externs - > Printf ( " QSS or FTE will be required \n " ) ;
else if ( qcc_targetformat = = QCF_DARKPLACES )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " DarkPlaces or FTE will be required \n " ) ;
2020-07-01 05:32:21 +00:00
else if ( outputsttype = = PST_UHEXEN2 )
externs - > Printf ( " FTE or uHexen2 will be required \n " ) ;
2009-11-04 21:16:50 +00:00
else
2018-10-11 10:31:23 +00:00
externs - > Printf ( " FTE's QCLib will be required \n " ) ;
2009-11-04 21:16:50 +00:00
}
2004-09-07 18:16:59 +00:00
break ;
2020-07-01 05:32:21 +00:00
case QCF_UHEXEN2 :
debugtarget = false ;
outputsttype = PST_UHEXEN2 ;
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2020-07-01 05:32:21 +00:00
externs - > Printf ( " uHexen2 will be required \n " ) ;
if ( numpr_globals < 65535 )
externs - > Printf ( " Warning: outputting 32 uHexen2 format when 16bit would suffice \n " ) ;
break ;
2004-09-07 18:16:59 +00:00
case QCF_KK7 :
if ( bodylessfuncs )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Warning: There are some functions without bodies. \n " ) ;
2005-02-28 07:16:19 +00:00
if ( numpr_globals > 65530 )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Warning: Saving is not fully supported. Ensure all engine read fields and globals are defined early on. \n " ) ;
2004-09-07 18:16:59 +00:00
2018-10-11 10:31:23 +00:00
externs - > Printf ( " A KK compatible executor will be required (FTE/KK) \n " ) ;
2011-03-04 13:59:06 +00:00
outputsttype = PST_KKQWSV ;
2004-09-07 18:16:59 +00:00
break ;
2011-03-04 13:59:06 +00:00
case QCF_QTEST :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Compiled QTest progs will most likely not work at all. YOU'VE BEEN WARNED! \n " ) ;
2011-03-04 13:59:06 +00:00
outputsttype = PST_QTEST ;
break ;
default :
2019-09-25 20:23:24 +00:00
externs - > Sys_Error ( " invalid progs type chosen! " ) ;
2004-09-07 18:16:59 +00:00
}
2015-04-14 12:24:05 +00:00
switch ( outputsttype )
{
case PST_QTEST :
{
// this sucks but the structures are just too different
qtest_function_t * funcs = ( qtest_function_t * ) qccHunkAlloc ( sizeof ( qtest_function_t ) * numfunctions ) ;
for ( i = 0 ; i < numfunctions ; i + + )
{
int j ;
funcs [ i ] . unused1 = 0 ;
funcs [ i ] . profile = 0 ;
if ( functions [ i ] . code = = - 1 )
funcs [ i ] . first_statement = PRLittleLong ( - functions [ i ] . builtin ) ;
else
funcs [ i ] . first_statement = PRLittleLong ( functions [ i ] . code ) ;
funcs [ i ] . first_statement = PRLittleLong ( functions [ i ] . code ) ;
funcs [ i ] . parm_start = 0 ; //PRLittleLong (functions[i].parm_start);
funcs [ i ] . s_name = PRLittleLong ( QCC_CopyString ( functions [ i ] . name ) ) ;
2016-09-08 19:04:35 +00:00
funcs [ i ] . s_file = PRLittleLong ( functions [ i ] . s_filed ) ;
2015-04-14 12:24:05 +00:00
funcs [ i ] . numparms = 0 ; //PRLittleLong ((functions[i].numparms>MAX_PARMS)?MAX_PARMS:functions[i].numparms);
funcs [ i ] . locals = 0 ; //PRLittleLong (functions[i].locals);
for ( j = 0 ; j < MAX_PARMS ; j + + )
funcs [ i ] . parm_size [ j ] = 0 ; //PRLittleLong((int)functions[i].parm_size[j]);
}
funcdata = funcs ;
funcdatasize = numfunctions * sizeof ( * funcs ) ;
}
break ;
2020-07-01 05:32:21 +00:00
case PST_UHEXEN2 :
2015-04-14 12:24:05 +00:00
case PST_DEFAULT :
case PST_KKQWSV :
case PST_FTE32 :
{
dfunction_t * funcs = ( dfunction_t * ) qccHunkAlloc ( sizeof ( dfunction_t ) * numfunctions ) ;
for ( i = 0 ; i < numfunctions ; i + + )
{
QCC_def_t * local ;
2016-07-12 00:40:13 +00:00
unsigned int p , a ;
2015-04-14 12:24:05 +00:00
if ( functions [ i ] . code = = - 1 )
funcs [ i ] . first_statement = PRLittleLong ( - functions [ i ] . builtin ) ;
else
funcs [ i ] . first_statement = PRLittleLong ( functions [ i ] . code ) ;
if ( opt_function_names & & functions [ i ] . builtin )
{
//builtins don't need a name entry. the def is constant, so no string need be emitted at all.
optres_function_names + = strlen ( functions [ i ] . name ) + 1 ;
funcs [ i ] . s_name = 0 ;
}
else
funcs [ i ] . s_name = PRLittleLong ( QCC_CopyString ( functions [ i ] . name ) ) ;
2016-09-08 19:04:35 +00:00
funcs [ i ] . s_file = PRLittleLong ( functions [ i ] . s_filed ) ;
2015-04-14 12:24:05 +00:00
2016-09-08 19:04:35 +00:00
if ( functions [ i ] . merged )
{
funcs [ i ] . parm_start = functions [ i ] . merged - > parm_start ;
funcs [ i ] . locals = functions [ i ] . merged - > locals ;
funcs [ i ] . numparms = functions [ i ] . merged - > numparms ;
2018-01-23 01:22:29 +00:00
for ( p = 0 ; p < ( unsigned ) funcs [ i ] . numparms ; p + + )
2016-09-08 19:04:35 +00:00
funcs [ i ] . parm_size [ p ] = functions [ i ] . merged - > parm_size [ p ] ;
}
else if ( functions [ i ] . code = = - 1 )
2015-04-14 12:24:05 +00:00
{
funcs [ i ] . parm_start = 0 ;
funcs [ i ] . locals = 0 ;
funcs [ i ] . numparms = functions [ i ] . type - > num_parms ;
if ( funcs [ i ] . numparms > MAX_PARMS )
funcs [ i ] . numparms = MAX_PARMS ; //shouldn't happen for builtins.
p = 0 ;
}
else if ( functions [ i ] . firstlocal )
{
2016-07-12 00:40:13 +00:00
unsigned int size ;
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
funcs [ i ] . parm_start = 0 ;
2016-07-12 00:40:13 +00:00
for ( local = functions [ i ] . firstlocal , a = 0 , p = 0 ; local & & a < MAX_PARMS & & a < functions [ i ] . type - > num_parms ; local = local - > deftail - > nextlocal )
2015-04-14 12:24:05 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( ! local - > used )
{ //all params should have been assigned space. logically we could have safely omitted the last ones, but blurgh.
2016-09-08 19:04:35 +00:00
QCC_PR_Warning ( ERR_INTERNAL , local - > filen , local - > s_line , " Argument %s was not marked used. \n " , local - > name ) ;
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
continue ;
}
if ( ! p )
funcs [ i ] . parm_start = local - > ofs ;
2016-07-12 00:40:13 +00:00
size = local - > type - > size ;
if ( local - > arraysize ) //arrays are annoying
size = local - > arraylengthprefix + size * local - > arraysize ;
funcs [ i ] . locals + = size ;
for ( ; size > 3 & & p < MAX_PARMS ; size - = 3 )
funcs [ i ] . parm_size [ p + + ] = 3 ; //the engine will copy PARMi over, it can't cope with larger types, the following args would be wrong.
if ( p < MAX_PARMS )
funcs [ i ] . parm_size [ p + + ] = size ;
a + + ;
2015-04-14 12:24:05 +00:00
}
2017-11-15 12:38:20 +00:00
for ( ; local & & ( ! local - > used | | local - > isstatic | | ( local - > constant & & local - > initialized ) ) ; local = local - > nextlocal )
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
;
if ( ! p & & local )
funcs [ i ] . parm_start = local - > ofs ;
2015-04-14 12:24:05 +00:00
for ( ; local ; local = local - > nextlocal )
2016-07-12 00:40:13 +00:00
{
2017-11-15 12:38:20 +00:00
if ( ! local - > used | | local - > isstatic | | ( local - > constant & & local - > initialized ) )
continue ;
2016-07-12 00:40:13 +00:00
size = local - > type - > size ;
if ( local - > arraysize ) //arrays are annoying
size = local - > arraylengthprefix + size * local - > arraysize ;
2017-11-15 12:38:20 +00:00
funcs [ i ] . locals + = size ;
2016-07-12 00:40:13 +00:00
}
2015-04-14 12:24:05 +00:00
funcs [ i ] . numparms = p ;
}
else
{
//fucked up functions with no params.
funcs [ i ] . parm_start = 0 ;
funcs [ i ] . locals = 0 ;
funcs [ i ] . numparms = 0 ;
p = 0 ;
}
while ( p < MAX_PARMS )
funcs [ i ] . parm_size [ p + + ] = 0 ;
funcs [ i ] . parm_start = PRLittleLong ( funcs [ i ] . parm_start ) ;
funcs [ i ] . locals = PRLittleLong ( funcs [ i ] . locals ) ;
funcs [ i ] . numparms = PRLittleLong ( funcs [ i ] . numparms ) ;
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
if ( funcs [ i ] . locals & & ! funcs [ i ] . parm_start )
2016-09-08 19:04:35 +00:00
QCC_PR_Warning ( 0 , strings + funcs [ i ] . s_file , functions [ i ] . line , " %s:%i: func %s @%i locals@%i+%i, %i parms \n " , functions [ i ] . filen , functions [ i ] . line , strings + funcs [ i ] . s_name , funcs [ i ] . first_statement , funcs [ i ] . parm_start , funcs [ i ] . locals , funcs [ i ] . numparms ) ;
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
2017-03-04 19:36:06 +00:00
if ( verbose > = VERBOSE_DEBUG )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: func %s @%i locals@%i+%i, %i parms \n " , functions [ i ] . filen , functions [ i ] . line , strings + funcs [ i ] . s_name , funcs [ i ] . first_statement , funcs [ i ] . parm_start , funcs [ i ] . locals , funcs [ i ] . numparms ) ;
externs - > Printf ( " code: %s:%i: (%i,%i,%i,%i,%i,%i,%i,%i) \n " , functions [ i ] . filen , functions [ i ] . line , funcs [ i ] . parm_size [ 0 ] , funcs [ i ] . parm_size [ 1 ] , funcs [ i ] . parm_size [ 2 ] , funcs [ i ] . parm_size [ 3 ] , funcs [ i ] . parm_size [ 4 ] , funcs [ i ] . parm_size [ 5 ] , funcs [ i ] . parm_size [ 6 ] , funcs [ i ] . parm_size [ 7 ] ) ;
2017-03-04 19:36:06 +00:00
}
2015-04-14 12:24:05 +00:00
}
funcdata = funcs ;
funcdatasize = numfunctions * sizeof ( * funcs ) ;
}
break ;
default :
2019-09-25 20:23:24 +00:00
externs - > Sys_Error ( " structtype error " ) ;
2018-01-22 19:18:04 +00:00
funcdata = NULL ;
funcdatasize = 0 ;
2015-04-14 12:24:05 +00:00
}
2004-09-07 18:16:59 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
for ( dupewarncount = 0 , def = pr . def_head . next ; def ; def = def - > next )
2004-09-07 18:16:59 +00:00
{
2017-10-31 22:52:58 +00:00
if ( def - > scope & & ! def - > isstatic & & ! def - > scope - > privatelocals )
{ //if we're merging locals, then we shouldn't ever bother writing those globals. it just confuses debuggers etc. they're utterly pointless.
//which may be a problem if they're things that the engine is going to be swapping around... which they shouldn't be.
continue ;
}
2015-04-14 12:24:05 +00:00
/* if (def->type->type == ev_vector || (def->type->type == ev_field && def->type->aux_type->type == ev_vector))
2004-09-07 18:16:59 +00:00
{ //do the references, so we don't get loadsa not referenced VEC_HULL_MINS_x
2013-12-07 18:32:55 +00:00
s_file = def - > s_file ;
2015-02-02 08:01:53 +00:00
QC_snprintfz ( element , sizeof ( element ) , " %s_x " , def - > name ) ;
2008-10-05 02:55:01 +00:00
comp_x = QCC_PR_GetDef ( NULL , element , def - > scope , false , 0 , false ) ;
2015-02-02 08:01:53 +00:00
QC_snprintfz ( element , sizeof ( element ) , " %s_y " , def - > name ) ;
2008-10-05 02:55:01 +00:00
comp_y = QCC_PR_GetDef ( NULL , element , def - > scope , false , 0 , false ) ;
2015-02-02 08:01:53 +00:00
QC_snprintfz ( element , sizeof ( element ) , " %s_z " , def - > name ) ;
2008-10-05 02:55:01 +00:00
comp_z = QCC_PR_GetDef ( NULL , element , def - > scope , false , 0 , false ) ;
2004-09-07 18:16:59 +00:00
h = def - > references ;
if ( comp_x & & comp_y & & comp_z )
{
h + = comp_x - > references ;
h + = comp_y - > references ;
h + = comp_z - > references ;
if ( ! def - > references )
if ( ! comp_x - > references | | ! comp_y - > references | | ! comp_z - > references ) //one of these vars is useless...
h = 0 ;
def - > references = h ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
if ( ! h )
h = 1 ;
if ( comp_x )
comp_x - > references = h ;
if ( comp_y )
comp_y - > references = h ;
if ( comp_z )
comp_z - > references = h ;
}
}
2015-04-14 12:24:05 +00:00
*/
2017-02-19 00:15:42 +00:00
# ifdef TODO_READWRITETRACK
if ( def - > symbolheader - > read & & ! def - > symbolheader - > written & & ! def - > symbolheader - > referenced )
{
char typestr [ 256 ] ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
QCC_sref_t sr = { def , 0 , def - > type } ;
2017-02-19 00:15:42 +00:00
QCC_PR_Warning ( WARN_READNOTWRITTEN , def - > filen , def - > s_line , " %s %s = %s read, but not writte. " , TypeName ( def - > type , typestr , sizeof ( typestr ) ) , def - > name , QCC_VarAtOffset ( sr ) ) ;
}
if ( def - > symbolheader - > written & & ! def - > symbolheader - > read & & ! def - > symbolheader - > referenced )
{
char typestr [ 256 ] ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
QCC_sref_t sr = { def , 0 , def - > type } ;
2017-02-19 00:15:42 +00:00
QCC_PR_Warning ( WARN_WRITTENNOTREAD , def - > filen , def - > s_line , " %s %s = %s written, but not read. " , TypeName ( def - > type , typestr , sizeof ( typestr ) ) , def - > name , QCC_VarAtOffset ( sr ) ) ;
}
# endif
2017-11-14 14:37:04 +00:00
if ( ! def - > symbolheader - > read & & ! def - > symbolheader - > written & & ! def - > referenced )
2004-09-07 18:16:59 +00:00
{
2011-10-03 02:45:44 +00:00
int wt = def - > constant ? WARN_NOTREFERENCEDCONST : WARN_NOTREFERENCED ;
2017-11-14 14:37:04 +00:00
if ( def - > type - > type = = ev_field & & def - > constant )
wt = WARN_NOTREFERENCEDFIELD ;
2013-06-02 06:03:54 +00:00
pr_scope = def - > scope ;
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
if ( ! strncmp ( def - > name , " spawnfunc_ " , 10 ) )
; //no warnings from unreferenced entry points.
else if ( strcmp ( def - > name , " IMMEDIATE " ) & & qccwarningaction [ wt ] & & ! ( def - > type - > type = = ev_function & & def - > symbolheader - > timescalled ) & & ! def - > symbolheader - > used )
2010-05-01 22:47:47 +00:00
{
2014-03-01 11:38:53 +00:00
char typestr [ 256 ] ;
2022-08-08 22:45:19 +00:00
if ( QC_strcasestr ( def - > filen , " extensions " ) & & verbose < VERBOSE_STANDARD )
2016-07-12 00:40:13 +00:00
{ //try to avoid annoying warnings from dpextensions.qc
extwarncount + + ;
2016-09-08 19:04:35 +00:00
QCC_PR_Warning ( wt , def - > filen , def - > s_line , NULL ) ;
2016-07-12 00:40:13 +00:00
}
else if ( def - > arraysize )
2022-08-08 22:45:19 +00:00
QCC_PR_Warning ( wt , def - > filen , def - > s_line , ( dupewarncount + + > = 10 & & verbose < VERBOSE_STANDARD ) ? NULL : " %s %s%s%s[%i] no references. " , TypeName ( def - > type , typestr , sizeof ( typestr ) ) , col_symbol , def - > name , col_none , def - > arraysize ) ;
2016-07-12 00:40:13 +00:00
else
2022-08-08 22:45:19 +00:00
QCC_PR_Warning ( wt , def - > filen , def - > s_line , ( dupewarncount + + > = 10 & & verbose < VERBOSE_STANDARD ) ? NULL : " %s %s%s%s no references. " , TypeName ( def - > type , typestr , sizeof ( typestr ) ) , col_symbol , def - > name , col_none ) ;
2010-05-01 22:47:47 +00:00
}
2013-06-02 06:03:54 +00:00
pr_scope = NULL ;
2004-09-07 18:16:59 +00:00
2017-02-19 00:15:42 +00:00
if ( def - > symbolheader - > used )
{
char typestr [ 256 ] ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
QCC_sref_t sr = { def , 0 , def - > type } ;
2018-09-29 03:40:50 +00:00
QCC_PR_Warning ( WARN_NOTREFERENCED , def - > filen , def - > s_line , " %s %s%s%s = %s used, but not referenced. " , TypeName ( def - > type , typestr , sizeof ( typestr ) ) , col_symbol , def - > name , col_none , QCC_VarAtOffset ( sr ) ) ;
2017-02-19 00:15:42 +00:00
}
/*if (opt_unreferenced && def->type->type != ev_field)
2004-09-07 18:16:59 +00:00
{
optres_unreferenced + + ;
2015-04-14 12:24:05 +00:00
# ifdef DEBUG_DUMP
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: strip noref %s %s@%i; \n " , def - > filen , def - > s_line , def - > type - > name , def - > name , def - > ofs ) ;
2015-04-14 12:24:05 +00:00
# endif
2004-09-07 18:16:59 +00:00
continue ;
2017-02-19 00:15:42 +00:00
} */
2004-09-07 18:16:59 +00:00
}
2016-07-12 00:40:13 +00:00
if ( ( def - > type - > type = = ev_struct | | def - > type - > type = = ev_union | | def - > arraysize ) & & def - > deftail )
{
# ifdef DEBUG_DUMP
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: strip struct %s %s@%i; \n " , def - > filen , def - > s_line , def - > type - > name , def - > name , def - > ofs ) ;
2016-07-12 00:40:13 +00:00
# endif
//the head of an array/struct is never written. only, its member fields are.
continue ;
}
2004-09-07 18:16:59 +00:00
2015-04-14 12:24:05 +00:00
if ( def - > strip | | ! def - > symbolheader - > used )
{
2017-02-19 00:15:42 +00:00
optres_unreferenced + + ;
2015-04-14 12:24:05 +00:00
# ifdef DEBUG_DUMP
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: strip %s %s@%i; \n " , def - > filen , def - > s_line , def - > type - > name , def - > name , def - > ofs ) ;
2015-04-14 12:24:05 +00:00
# endif
2014-04-14 09:16:41 +00:00
continue ;
2015-04-14 12:24:05 +00:00
}
2014-04-14 09:16:41 +00:00
2004-09-07 18:16:59 +00:00
if ( def - > type - > type = = ev_function )
{
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
if ( opt_function_names & & def - > initialized & & functions [ def - > symboldata [ 0 ] . function ] . code < 0 )
2004-09-07 18:16:59 +00:00
{
optres_function_names + + ;
def - > name = " " ;
}
2015-04-14 12:24:05 +00:00
# if IAMNOTLAZY
2004-09-07 18:16:59 +00:00
if ( ! def - > timescalled )
{
2013-06-02 06:03:54 +00:00
if ( def - > references < = 1 & & strncmp ( def - > name , " spawnfunc_ " , 10 ) )
2004-09-07 18:16:59 +00:00
QCC_PR_Warning ( WARN_DEADCODE , strings + def - > s_file , def - > s_line , " %s is never directly called or referenced (spawn function or dead code) " , def - > name ) ;
2005-02-09 19:32:30 +00:00
// else
// QCC_PR_Warning(WARN_DEADCODE, strings + def->s_file, def->s_line, "%s is never directly called", def->name);
2004-09-07 18:16:59 +00:00
}
2014-09-14 01:45:11 +00:00
if ( opt_stripfunctions & & def - > constant & & def - > timescalled > = def - > references - 1 ) //make sure it's not copied into a different var.
2004-09-07 18:16:59 +00:00
{ //if it ever does self.think then it could be needed for saves.
optres_stripfunctions + + ; //if it's only ever called explicitly, the engine doesn't need to know.
2015-04-14 12:24:05 +00:00
# ifdef DEBUG_DUMP
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: strip const %s %s@%i; \n " , strings + def - > s_file , def - > s_line , def - > type - > name , def - > name , def - > ofs ) ;
2015-04-14 12:24:05 +00:00
# endif
2004-09-07 18:16:59 +00:00
continue ;
}
2015-04-14 12:24:05 +00:00
# endif
2004-09-07 18:16:59 +00:00
}
2013-09-26 14:36:52 +00:00
else if ( def - > type - > type = = ev_field & & def - > constant & & ( ! def - > scope | | def - > isstatic | | def - > initialized ) )
2004-09-07 18:16:59 +00:00
{
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
QCC_GenerateFieldDefs ( def , def - > name , 0 , def - > type - > aux_type ) ;
2016-02-10 23:23:43 +00:00
continue ;
2004-09-07 18:16:59 +00:00
}
2012-01-24 04:24:14 +00:00
else if ( ( def - > scope | | def - > constant ) & & ( def - > type - > type ! = ev_string | | ( strncmp ( def - > name , " dotranslate_ " , 12 ) & & opt_constant_names_strings ) ) )
2004-09-07 18:16:59 +00:00
{
if ( opt_constant_names )
{
if ( def - > type - > type = = ev_string )
optres_constant_names_strings + = strlen ( def - > name ) ;
else
optres_constant_names + = strlen ( def - > name ) ;
2015-04-14 12:24:05 +00:00
# ifdef DEBUG_DUMP
if ( def - > scope )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: strip local %s %s@%i; \n " , def - > filen , def - > s_line , def - > type - > name , def - > name , def - > ofs ) ;
2015-04-14 12:24:05 +00:00
else if ( def - > constant )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: strip const %s %s@%i; \n " , def - > filen , def - > s_line , def - > type - > name , def - > name , def - > ofs ) ;
2015-04-14 12:24:05 +00:00
# endif
2004-09-07 18:16:59 +00:00
continue ;
}
}
// if (!def->saved && def->type->type != ev_string)
// continue;
dd = & qcc_globals [ numglobaldefs ] ;
numglobaldefs + + ;
if ( types )
dd - > type = def - > type - qcc_typeinfo ;
else
dd - > type = def - > type - > type ;
# ifdef DEF_SAVEGLOBAL
2015-04-14 12:24:05 +00:00
if ( def - > saved & & ! def - > constant // || def->type->type == ev_function)
2004-09-07 18:16:59 +00:00
// && def->type->type != ev_function
& & def - > type - > type ! = ev_field
2015-04-14 12:24:05 +00:00
& & def - > scope = = NULL )
2008-11-09 22:29:28 +00:00
{
2004-09-07 18:16:59 +00:00
dd - > type | = DEF_SAVEGLOBAL ;
2008-11-09 22:29:28 +00:00
}
2004-09-07 18:16:59 +00:00
# endif
if ( def - > shared )
dd - > type | = DEF_SHARED ;
2017-10-31 22:52:58 +00:00
if ( opt_locals & & ( ( def - > scope & & ! def - > isstatic ) | | ! strcmp ( def - > name , " IMMEDIATE " ) ) )
2004-09-07 18:16:59 +00:00
{
dd - > s_name = 0 ;
optres_locals + = strlen ( def - > name ) ;
}
else
dd - > s_name = QCC_CopyString ( def - > name ) ;
dd - > ofs = def - > ofs ;
2015-04-14 12:24:05 +00:00
# ifdef DEBUG_DUMP
if ( ( dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ) = = ev_string )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: %s%s%s %s@%i = \" %s \" \n " , def - > filen , def - > s_line , dd - > type & DEF_SAVEGLOBAL ? " save " : " nosave " , dd - > type & DEF_SHARED ? " shared " : " " , basictypenames [ dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ] , strings + dd - > s_name , dd - > ofs , ( ( unsigned ) def - > symboldata [ 0 ] . string > = ( unsigned ) strofs ) ? " ??? " : ( strings + def - > symboldata [ 0 ] . string ) ) ;
2015-04-14 12:24:05 +00:00
else if ( ( dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ) = = ev_float )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: %s%s%s %s@%i = %g \n " , def - > filen , def - > s_line , dd - > type & DEF_SAVEGLOBAL ? " save " : " nosave " , dd - > type & DEF_SHARED ? " shared " : " " , basictypenames [ dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ] , strings + dd - > s_name , dd - > ofs , def - > symboldata [ 0 ] . _float ) ;
2015-04-14 12:24:05 +00:00
else if ( ( dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ) = = ev_integer )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: %s%s%s %s@%i = %i \n " , def - > filen , def - > s_line , dd - > type & DEF_SAVEGLOBAL ? " save " : " nosave " , dd - > type & DEF_SHARED ? " shared " : " " , basictypenames [ dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ] , strings + dd - > s_name , dd - > ofs , def - > symboldata [ 0 ] . _int ) ;
2015-04-14 12:24:05 +00:00
else if ( ( dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ) = = ev_vector )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: %s%s%s %s@%i = '%g %g %g' \n " , def - > filen , def - > s_line , dd - > type & DEF_SAVEGLOBAL ? " save " : " nosave " , dd - > type & DEF_SHARED ? " shared " : " " , basictypenames [ dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ] , strings + dd - > s_name , dd - > ofs , def - > symboldata [ 0 ] . vector [ 0 ] , def - > symboldata [ 0 ] . vector [ 1 ] , def - > symboldata [ 0 ] . vector [ 2 ] ) ;
2015-04-14 12:24:05 +00:00
else if ( ( dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ) = = ev_function )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: %s%s%s %s@%i = %i(%s) \n " , def - > filen , def - > s_line , dd - > type & DEF_SAVEGLOBAL ? " save " : " nosave " , dd - > type & DEF_SHARED ? " shared " : " " , basictypenames [ dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ] , strings + dd - > s_name , dd - > ofs , def - > symboldata [ 0 ] . function , def - > symboldata [ 0 ] . function > = numfunctions ? " ??? " : functions [ def - > symboldata [ 0 ] . function ] . name ) ;
2015-04-14 12:24:05 +00:00
else if ( ( dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ) = = ev_field )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: %s%s%s %s@%i = @%i \n " , def - > filen , def - > s_line , dd - > type & DEF_SAVEGLOBAL ? " save " : " nosave " , dd - > type & DEF_SHARED ? " shared " : " " , basictypenames [ dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ] , strings + dd - > s_name , dd - > ofs , def - > symboldata [ 0 ] . _int ) ;
2015-04-14 12:24:05 +00:00
else
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: %s%s%s %s@%i \n " , def - > filen , def - > s_line , dd - > type & DEF_SAVEGLOBAL ? " save " : " nosave " , dd - > type & DEF_SHARED ? " shared " : " " , basictypenames [ dd - > type & ~ ( DEF_SHARED | DEF_SAVEGLOBAL ) ] , strings + dd - > s_name , dd - > ofs ) ;
2015-04-14 12:24:05 +00:00
# endif
2004-09-07 18:16:59 +00:00
}
2018-08-04 07:05:20 +00:00
QCC_SortFields ( ) ;
2004-09-07 18:16:59 +00:00
2022-08-08 22:45:19 +00:00
if ( dupewarncount > 10 & & verbose < VERBOSE_STANDARD )
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
QCC_PR_Note ( WARN_NOTREFERENCED , NULL , 0 , " suppressed %i more warnings about unreferenced variables, as you clearly don't care about the first 10. " , dupewarncount - 10 ) ;
2016-07-12 00:40:13 +00:00
if ( extwarncount )
QCC_PR_Note ( WARN_NOTREFERENCED , NULL , 0 , " suppressed %i warnings about unused extensions. " , extwarncount ) ;
2015-07-03 22:00:45 +00:00
2008-11-09 22:29:28 +00:00
for ( i = 0 ; i < numglobaldefs ; i + + )
{
dd = & qcc_globals [ i ] ;
if ( ! ( dd - > type & DEF_SAVEGLOBAL ) ) //only warn about saved ones.
continue ;
for ( h = 0 ; h < numglobaldefs ; h + + )
{
2013-12-17 22:45:37 +00:00
if ( i = = h | | ! ( qcc_globals [ h ] . type & DEF_SAVEGLOBAL ) )
2008-11-09 22:29:28 +00:00
continue ;
if ( dd - > ofs = = qcc_globals [ h ] . ofs )
{
2012-02-13 09:24:01 +00:00
if ( ( dd - > type & ~ DEF_SAVEGLOBAL ) ! = ( qcc_globals [ h ] . type & ~ DEF_SAVEGLOBAL ) )
2008-11-09 22:29:28 +00:00
{
2012-02-13 09:24:01 +00:00
if ( ! ( ( ( dd - > type & ~ DEF_SAVEGLOBAL ) = = ev_vector & & ( qcc_globals [ h ] . type & ~ DEF_SAVEGLOBAL ) = = ev_float ) | |
( ( dd - > type & ~ DEF_SAVEGLOBAL ) = = ev_struct | | ( dd - > type & ~ DEF_SAVEGLOBAL ) = = ev_union ) ) )
2008-11-09 22:29:28 +00:00
QCC_PR_Warning ( 0 , NULL , 0 , " Mismatched union global types (%s and %s) " , strings + dd - > s_name , strings + qcc_globals [ h ] . s_name ) ;
}
//remove the saveglobal flag on the duplicate globals.
qcc_globals [ h ] . type & = ~ DEF_SAVEGLOBAL ;
}
}
}
for ( i = 1 ; i < numfielddefs ; i + + )
{
dd = & fields [ i ] ;
2013-12-17 22:45:37 +00:00
if ( dd - > type = = ev_vector | | dd - > type = = ev_struct | | dd - > type = = ev_union ) //just ignore vectors, structs, and unions.
2008-11-09 22:29:28 +00:00
continue ;
for ( h = 1 ; h < numfielddefs ; h + + )
{
if ( i = = h )
continue ;
if ( dd - > ofs = = fields [ h ] . ofs )
{
if ( dd - > type ! = fields [ h ] . type )
{
2013-12-17 22:45:37 +00:00
if ( fields [ h ] . type ! = ev_vector & & fields [ h ] . type ! = ev_struct & & fields [ h ] . type ! = ev_union )
2008-11-09 22:29:28 +00:00
{
2015-04-14 12:24:05 +00:00
QCC_PR_Warning ( 0 , NULL , 0 , " Mismatched union field types (%s and %s @%i) " , strings + dd - > s_name , strings + fields [ h ] . s_name , dd - > ofs ) ;
2008-11-09 22:29:28 +00:00
}
}
}
}
}
2004-09-07 18:16:59 +00:00
if ( numglobaldefs > MAX_GLOBALS )
2018-04-20 19:09:14 +00:00
QCC_Error ( ERR_TOOMANYGLOBALS , " Too many globals - %i \n Add '-max_globals %i' to the commandline " , numglobaldefs , ( numglobaldefs + 32768 ) & ~ 32767 ) ;
2004-09-07 18:16:59 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
dupewarncount = 0 ;
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < nummodels ; i + + )
{
2013-03-12 22:35:33 +00:00
if ( ! precache_model [ i ] . used )
2022-08-08 22:45:19 +00:00
dupewarncount + = QCC_PR_Warning ( WARN_EXTRAPRECACHE , precache_model [ i ] . filename , precache_model [ i ] . fileline , ( dupewarncount > 10 & & verbose < VERBOSE_STANDARD ) ? NULL : " Model \" %s \" was precached but not directly used%s " , precache_model [ i ] . name , dupewarncount ? " " : " (annotate the usage with the used_model intrinsic to silence this warning) " ) ;
2013-03-12 22:35:33 +00:00
else if ( ! precache_model [ i ] . block )
2022-08-08 22:45:19 +00:00
dupewarncount + = QCC_PR_Warning ( WARN_NOTPRECACHED , precache_model [ i ] . filename , precache_model [ i ] . fileline , ( dupewarncount > 10 & & verbose < VERBOSE_STANDARD ) ? NULL : " Model \" %s \" was used but not directly precached " , precache_model [ i ] . name ) ;
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
}
for ( i = 0 ; i < numsounds ; i + + )
{
if ( ! precache_sound [ i ] . used )
2022-08-08 22:45:19 +00:00
dupewarncount + = QCC_PR_Warning ( WARN_EXTRAPRECACHE , precache_sound [ i ] . filename , precache_sound [ i ] . fileline , ( dupewarncount > 10 & & verbose < VERBOSE_STANDARD ) ? NULL : " Sound \" %s \" was precached but not directly used " , precache_sound [ i ] . name , dupewarncount ? " " : " (annotate the usage with the used_sound intrinsic to silence this warning) " ) ;
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
else if ( ! precache_sound [ i ] . block )
2022-08-08 22:45:19 +00:00
dupewarncount + = QCC_PR_Warning ( WARN_NOTPRECACHED , precache_sound [ i ] . filename , precache_sound [ i ] . fileline , ( dupewarncount > 10 & & verbose < VERBOSE_STANDARD ) ? NULL : " Sound \" %s \" was used but not directly precached " , precache_sound [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2022-08-08 22:45:19 +00:00
if ( dupewarncount > 10 & & verbose < VERBOSE_STANDARD )
2018-09-29 03:40:50 +00:00
QCC_PR_Note ( WARN_NOTREFERENCED , NULL , 0 , " suppressed %i more %swarnings%s about precaches. " , dupewarncount - 10 , col_warning , col_none ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2004-09-07 18:16:59 +00:00
//PrintStrings ();
//PrintFunctions ();
//PrintFields ();
//PrintGlobals ();
strofs = ( strofs + 3 ) & ~ 3 ;
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2009-11-04 21:16:50 +00:00
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %6i strofs (of %i) \n " , strofs , MAX_STRINGS ) ;
externs - > Printf ( " %6i numstatements (of %i) \n " , numstatements , MAX_STATEMENTS ) ;
externs - > Printf ( " %6i numfunctions (of %i) \n " , numfunctions , MAX_FUNCTIONS ) ;
externs - > Printf ( " %6i numglobaldefs (of %i) \n " , numglobaldefs , MAX_GLOBALS ) ;
externs - > Printf ( " %6i numfielddefs (%i unique) (of %i) \n " , numfielddefs , pr . size_fields , MAX_FIELDS ) ;
externs - > Printf ( " %6i numpr_globals (of %i) \n " , numpr_globals , MAX_REGS ) ;
externs - > Printf ( " %6i nummodels \n " , nummodels ) ;
externs - > Printf ( " %6i numsounds \n " , numsounds ) ;
2009-11-04 21:16:50 +00:00
}
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
if ( ! * destfile )
strcpy ( destfile , " progs.dat " ) ;
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_PROGRESS )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Writing %s \n " , destfile ) ;
2004-09-07 18:16:59 +00:00
h = SafeOpenWrite ( destfile , 2 * 1024 * 1024 ) ;
SafeWrite ( h , & progs , sizeof ( progs ) ) ;
2006-06-02 17:42:36 +00:00
SafeWrite ( h , " \r \n \r \n " , 4 ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , QCC_copyright , strlen ( QCC_copyright ) + 1 ) ;
SafeWrite ( h , " \r \n \r \n " , 4 ) ;
2006-05-30 22:21:10 +00:00
while ( SafeSeek ( h , 0 , SEEK_CUR ) & 3 ) //this is a lame way to do it
{
SafeWrite ( h , " \0 " , 1 ) ;
}
2004-09-07 18:16:59 +00:00
progs . ofs_strings = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numstrings = strofs ;
if ( progs . blockscompressed & 16 )
2011-05-15 13:23:13 +00:00
{
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , strofs * sizeof ( char ) , 2 , ( char * ) strings , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_strings , SEEK_SET ) ; //seek back
2005-05-22 13:42:10 +00:00
len = PRLittleLong ( len ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , strings , strofs ) ;
progs . ofs_statements = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numstatements = numstatements ;
2020-07-01 05:32:21 +00:00
if ( qcc_targetformat = = QCF_HEXEN2 | | qcc_targetformat = = QCF_UHEXEN2 | | qcc_targetformat = = QCF_FTEH2 )
2004-09-07 18:16:59 +00:00
{
for ( i = 0 ; i < numstatements ; i + + )
{
if ( statements [ i ] . op > = OP_CALL1 & & statements [ i ] . op < = OP_CALL8 )
2007-10-05 18:08:47 +00:00
QCC_Error ( ERR_BADTARGETSWITCH , " Target switching produced incompatible instructions " ) ;
2004-09-07 18:16:59 +00:00
else if ( statements [ i ] . op > = OP_CALL1H & & statements [ i ] . op < = OP_CALL8H )
statements [ i ] . op = statements [ i ] . op - OP_CALL1H + OP_CALL1 ;
}
}
2014-04-24 01:53:01 +00:00
if ( ! opt_filenames )
2014-04-12 03:31:59 +00:00
{
statement_linenums = qccHunkAlloc ( sizeof ( statement_linenums ) * numstatements ) ;
for ( i = 0 ; i < numstatements ; i + + )
statement_linenums [ i ] = statements [ i ] . linenum ;
}
else
statement_linenums = NULL ;
2011-03-04 13:59:06 +00:00
switch ( outputsttype )
2004-09-07 18:16:59 +00:00
{
2020-07-01 05:32:21 +00:00
case PST_UHEXEN2 :
{
QCC_dstatement32_t * statements32 = qccHunkAlloc ( sizeof ( * statements32 ) * numstatements ) ;
for ( i = 0 ; i < numstatements ; i + + )
{
statements32 [ i ] . op = PRLittleLong ( statements [ i ] . op < < 16 ) ;
statements32 [ i ] . a = PRLittleLong ( ( statements [ i ] . a . sym ? statements [ i ] . a . sym - > ofs : 0 ) + statements [ i ] . a . ofs ) ;
statements32 [ i ] . b = PRLittleLong ( ( statements [ i ] . b . sym ? statements [ i ] . b . sym - > ofs : 0 ) + statements [ i ] . b . ofs ) ;
statements32 [ i ] . c = PRLittleLong ( ( statements [ i ] . c . sym ? statements [ i ] . c . sym - > ofs : 0 ) + statements [ i ] . c . ofs ) ;
if ( verbose > = VERBOSE_DEBUGSTATEMENTS )
externs - > Printf ( " code: %s:%i: @%i %s %i %i %i \n " , QCC_FileForStatement ( i ) , statements [ i ] . linenum , i , pr_opcodes [ statements [ i ] . op ] . name , statements32 [ i ] . a , statements32 [ i ] . b , statements32 [ i ] . c ) ;
}
SafeWrite ( h , statements32 , numstatements * sizeof ( QCC_dstatement32_t ) ) ;
}
break ;
2011-03-04 13:59:06 +00:00
case PST_KKQWSV :
case PST_FTE32 :
2004-09-07 18:16:59 +00:00
{
2015-01-07 13:34:05 +00:00
QCC_dstatement32_t * statements32 = qccHunkAlloc ( sizeof ( * statements32 ) * numstatements ) ;
for ( i = 0 ; i < numstatements ; i + + )
{
2015-04-14 12:24:05 +00:00
statements32 [ i ] . op = PRLittleLong ( statements [ i ] . op ) ;
statements32 [ i ] . a = PRLittleLong ( ( statements [ i ] . a . sym ? statements [ i ] . a . sym - > ofs : 0 ) + statements [ i ] . a . ofs ) ;
statements32 [ i ] . b = PRLittleLong ( ( statements [ i ] . b . sym ? statements [ i ] . b . sym - > ofs : 0 ) + statements [ i ] . b . ofs ) ;
statements32 [ i ] . c = PRLittleLong ( ( statements [ i ] . c . sym ? statements [ i ] . c . sym - > ofs : 0 ) + statements [ i ] . c . ofs ) ;
2017-03-04 19:36:06 +00:00
if ( verbose > = VERBOSE_DEBUGSTATEMENTS )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " code: %s:%i: @%i %s %i %i %i \n " , QCC_FileForStatement ( i ) , statements [ i ] . linenum , i , pr_opcodes [ statements [ i ] . op ] . name , statements32 [ i ] . a , statements32 [ i ] . b , statements32 [ i ] . c ) ;
2015-01-07 13:34:05 +00:00
}
2011-05-15 13:23:13 +00:00
2015-01-07 13:34:05 +00:00
if ( progs . blockscompressed & 1 )
{
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numstatements * sizeof ( QCC_dstatement32_t ) , 2 , ( char * ) statements , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_statements , SEEK_SET ) ; //seek back
len = PRLittleLong ( len ) ;
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , statements32 , numstatements * sizeof ( QCC_dstatement32_t ) ) ;
2004-09-07 18:16:59 +00:00
}
break ;
2011-03-04 13:59:06 +00:00
case PST_QTEST :
{
2015-01-07 13:34:05 +00:00
qtest_statement_t * qtst = qccHunkAlloc ( sizeof ( * qtst ) * numstatements ) ;
for ( i = 0 ; i < numstatements ; i + + ) // scale down from 16-byte internal to 12-byte qtest
{
2015-04-14 12:24:05 +00:00
unsigned int a = ( statements [ i ] . a . sym ? statements [ i ] . a . sym - > ofs : 0 ) + statements [ i ] . a . ofs ;
unsigned int b = ( statements [ i ] . b . sym ? statements [ i ] . b . sym - > ofs : 0 ) + statements [ i ] . b . ofs ;
unsigned int c = ( statements [ i ] . c . sym ? statements [ i ] . c . sym - > ofs : 0 ) + statements [ i ] . c . ofs ;
qtst [ i ] . line = statements [ i ] . linenum ;
qtst [ i ] . op = PRLittleShort ( ( unsigned short ) statements [ i ] . op ) ;
2018-06-18 16:44:29 +00:00
qtst [ i ] . a = ( unsigned short ) PRLittleShort ( ( unsigned short ) a ) ;
qtst [ i ] . b = ( unsigned short ) PRLittleShort ( ( unsigned short ) b ) ;
qtst [ i ] . c = ( unsigned short ) PRLittleShort ( ( unsigned short ) c ) ;
2015-01-07 13:34:05 +00:00
}
2011-03-04 13:59:06 +00:00
2015-01-07 13:34:05 +00:00
// no compression
SafeWrite ( h , qtst , numstatements * sizeof ( qtest_statement_t ) ) ;
}
2011-03-04 13:59:06 +00:00
break ;
case PST_DEFAULT :
2004-09-07 18:16:59 +00:00
{
2015-01-07 13:34:05 +00:00
QCC_dstatement16_t * statements16 = qccHunkAlloc ( sizeof ( * statements16 ) * numstatements ) ;
2015-04-14 12:24:05 +00:00
# ifdef DISASM
int start , end ;
for ( i = 1 ; i < numfunctions ; i + + )
{
if ( ! strcmp ( functions [ i ] . name , DISASM ) )
{
start = functions [ i ] . code ;
end = functions [ i + 1 ] . code ;
}
}
# endif
2015-01-07 13:34:05 +00:00
for ( i = 0 ; i < numstatements ; i + + ) //resize as we go - scaling down
{
2015-04-14 12:24:05 +00:00
unsigned int a = ( statements [ i ] . a . sym ? statements [ i ] . a . sym - > ofs : 0 ) + statements [ i ] . a . ofs ;
unsigned int b = ( statements [ i ] . b . sym ? statements [ i ] . b . sym - > ofs : 0 ) + statements [ i ] . b . ofs ;
unsigned int c = ( statements [ i ] . c . sym ? statements [ i ] . c . sym - > ofs : 0 ) + statements [ i ] . c . ofs ;
2015-01-07 13:34:05 +00:00
statements16 [ i ] . op = PRLittleShort ( ( unsigned short ) statements [ i ] . op ) ;
2015-04-14 12:24:05 +00:00
2017-03-04 19:36:06 +00:00
if (
# if defined(DISASM)
( i > = start & & i < end ) | |
2015-04-14 12:24:05 +00:00
# endif
2017-03-04 19:36:06 +00:00
verbose > = VERBOSE_DEBUGSTATEMENTS )
2015-04-14 12:24:05 +00:00
{
2017-03-04 19:36:06 +00:00
char line [ 2048 ] ;
2017-10-12 12:02:25 +00:00
QC_snprintfz ( line , sizeof ( line ) , " code: %s:%i: @%i %s %i %i %i (%s " , QCC_FileForStatement ( i ) , statements [ i ] . linenum , i , pr_opcodes [ statements [ i ] . op ] . opname , a , b , c , QCC_VarAtOffset ( statements [ i ] . a ) ) ;
2017-03-04 19:36:06 +00:00
QC_snprintfz ( line + strlen ( line ) , sizeof ( line ) - strlen ( line ) , " %s " , QCC_VarAtOffset ( statements [ i ] . b ) ) ;
QC_snprintfz ( line + strlen ( line ) , sizeof ( line ) - strlen ( line ) , " %s) \n " , QCC_VarAtOffset ( statements [ i ] . c ) ) ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s " , line ) ;
2015-04-14 12:24:05 +00:00
}
2015-07-06 14:47:46 +00:00
# ifdef _DEBUG
if ( ( ( signed ) a > = ( signed ) numpr_globals & & statements [ i ] . a . sym ) | | ( ( signed ) b > = ( signed ) numpr_globals & & statements [ i ] . b . sym ) | | ( ( signed ) c > = ( signed ) numpr_globals & & statements [ i ] . c . sym ) )
2020-07-07 22:01:53 +00:00
externs - > Printf ( " invalid offset on %s instruction (from line %i) \n " , pr_opcodes [ statements [ i ] . op ] . opname , statements [ i ] . linenum ) ;
2015-07-06 14:47:46 +00:00
# endif
2018-06-18 16:44:29 +00:00
//truncate to 16bit. should probably warn if the high bits are not 0x0000 or 0xffff
statements16 [ i ] . a = ( unsigned short ) PRLittleShort ( ( unsigned short ) a ) ;
statements16 [ i ] . b = ( unsigned short ) PRLittleShort ( ( unsigned short ) b ) ;
statements16 [ i ] . c = ( unsigned short ) PRLittleShort ( ( unsigned short ) c ) ;
2015-01-07 13:34:05 +00:00
}
2011-05-15 13:23:13 +00:00
2015-01-07 13:34:05 +00:00
if ( progs . blockscompressed & 1 )
{
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numstatements * sizeof ( QCC_dstatement16_t ) , 2 , ( char * ) statements16 , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_statements , SEEK_SET ) ; //seek back
len = PRLittleLong ( len ) ;
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , statements16 , numstatements * sizeof ( QCC_dstatement16_t ) ) ;
2004-09-07 18:16:59 +00:00
}
break ;
default :
2019-09-25 20:23:24 +00:00
externs - > Sys_Error ( " structtype error " ) ;
2004-09-07 18:16:59 +00:00
}
progs . ofs_functions = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numfunctions = numfunctions ;
2015-04-14 12:24:05 +00:00
if ( progs . blockscompressed & 8 )
2004-09-07 18:16:59 +00:00
{
2015-04-14 12:24:05 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , funcdatasize , 2 , ( char * ) funcdata , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_functions , SEEK_SET ) ; //seek back
len = PRLittleLong ( len ) ;
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
2004-09-07 18:16:59 +00:00
}
2015-04-14 12:24:05 +00:00
else
SafeWrite ( h , funcdata , funcdatasize ) ;
2004-09-07 18:16:59 +00:00
2020-09-08 04:44:07 +00:00
if ( flag_dumpfilenames )
QCC_DumpFiles ( destfile ) ;
2015-07-03 22:00:45 +00:00
2020-09-08 04:44:07 +00:00
if ( flag_dumpfields )
QCC_DumpFields ( destfile ) ;
2013-03-12 22:32:25 +00:00
2020-09-08 04:44:07 +00:00
if ( flag_dumpsymbols )
2022-01-16 18:41:25 +00:00
QCC_DumpSymbolNames ( destfile ) ;
// QCC_DumpSymbolInfo(destfile);
2020-09-08 04:44:07 +00:00
if ( flag_dumpautocvars )
QCC_DumpAutoCvars ( destfile ) ;
2021-05-27 11:34:22 +00:00
if ( flag_dumplocalisation )
QCC_DumpLocalisation ( destfile ) ;
2021-07-06 00:12:27 +00:00
if ( flag_dumptags )
QCC_DumpTags ( destfile ) ;
2015-07-03 22:00:45 +00:00
2011-03-04 13:59:06 +00:00
switch ( outputsttype )
2004-09-07 18:16:59 +00:00
{
2011-03-04 13:59:06 +00:00
case PST_QTEST :
// qtest needs a struct remap but should be able to get away with a simple swap here
for ( i = 0 ; i < numglobaldefs ; i + + )
{
qtest_def_t qtdef = ( ( qtest_def_t * ) qcc_globals ) [ i ] ;
qcc_globals [ i ] . type = qtdef . type ;
qcc_globals [ i ] . ofs = qtdef . ofs ;
qcc_globals [ i ] . s_name = qtdef . s_name ;
}
for ( i = 0 ; i < numfielddefs ; i + + )
{
qtest_def_t qtdef = ( ( qtest_def_t * ) fields ) [ i ] ;
fields [ i ] . type = qtdef . type ;
fields [ i ] . ofs = qtdef . ofs ;
fields [ i ] . s_name = qtdef . s_name ;
}
// passthrough.. reuse FTE32 code
case PST_FTE32 :
2004-09-07 18:16:59 +00:00
progs . ofs_globaldefs = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numglobaldefs = numglobaldefs ;
for ( i = 0 ; i < numglobaldefs ; i + + )
{
2005-05-22 13:42:10 +00:00
qcc_globals [ i ] . type = PRLittleLong /*PRLittleShort*/ ( qcc_globals [ i ] . type ) ;
qcc_globals [ i ] . ofs = PRLittleLong /*PRLittleShort*/ ( qcc_globals [ i ] . ofs ) ;
qcc_globals [ i ] . s_name = PRLittleLong ( qcc_globals [ i ] . s_name ) ;
2004-09-07 18:16:59 +00:00
}
if ( progs . blockscompressed & 2 )
2011-05-15 13:23:13 +00:00
{
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numglobaldefs * sizeof ( QCC_ddef_t ) , 2 , ( char * ) qcc_globals , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_globaldefs , SEEK_SET ) ; //seek back
2005-05-22 13:42:10 +00:00
len = PRLittleLong ( len ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , qcc_globals , numglobaldefs * sizeof ( QCC_ddef_t ) ) ;
progs . ofs_fielddefs = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numfielddefs = numfielddefs ;
for ( i = 0 ; i < numfielddefs ; i + + )
{
2005-05-22 13:42:10 +00:00
fields [ i ] . type = PRLittleLong /*PRLittleShort*/ ( fields [ i ] . type ) ;
fields [ i ] . ofs = PRLittleLong /*PRLittleShort*/ ( fields [ i ] . ofs ) ;
fields [ i ] . s_name = PRLittleLong ( fields [ i ] . s_name ) ;
2004-09-07 18:16:59 +00:00
}
2020-07-01 05:32:21 +00:00
if ( progs . blockscompressed & 4 )
{
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numfielddefs * sizeof ( QCC_ddef_t ) , 2 , ( char * ) fields , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_fielddefs , SEEK_SET ) ; //seek back
len = PRLittleLong ( len ) ;
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , fields , numfielddefs * sizeof ( QCC_ddef_t ) ) ;
break ;
case PST_UHEXEN2 :
progs . ofs_globaldefs = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numglobaldefs = numglobaldefs ;
for ( i = 0 ; i < numglobaldefs ; i + + )
{
qcc_globals [ i ] . type = PRLittleLong ( qcc_globals [ i ] . type < < 16 ) ;
qcc_globals [ i ] . ofs = PRLittleLong ( qcc_globals [ i ] . ofs ) ;
qcc_globals [ i ] . s_name = PRLittleLong ( qcc_globals [ i ] . s_name ) ;
}
if ( progs . blockscompressed & 2 )
{
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numglobaldefs * sizeof ( QCC_ddef_t ) , 2 , ( char * ) qcc_globals , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_globaldefs , SEEK_SET ) ; //seek back
len = PRLittleLong ( len ) ;
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , qcc_globals , numglobaldefs * sizeof ( QCC_ddef_t ) ) ;
progs . ofs_fielddefs = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numfielddefs = numfielddefs ;
for ( i = 0 ; i < numfielddefs ; i + + )
{
fields [ i ] . type = PRLittleLong /*PRLittleShort*/ ( fields [ i ] . type < < 16 ) ;
fields [ i ] . ofs = PRLittleLong /*PRLittleShort*/ ( fields [ i ] . ofs ) ;
fields [ i ] . s_name = PRLittleLong ( fields [ i ] . s_name ) ;
}
2004-09-07 18:16:59 +00:00
if ( progs . blockscompressed & 4 )
2011-05-15 13:23:13 +00:00
{
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numfielddefs * sizeof ( QCC_ddef_t ) , 2 , ( char * ) fields , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_fielddefs , SEEK_SET ) ; //seek back
2005-05-22 13:42:10 +00:00
len = PRLittleLong ( len ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , fields , numfielddefs * sizeof ( QCC_ddef_t ) ) ;
break ;
2011-03-04 13:59:06 +00:00
case PST_KKQWSV :
case PST_DEFAULT :
2004-09-07 18:16:59 +00:00
# define qcc_globals16 ((QCC_ddef16_t*)qcc_globals)
# define fields16 ((QCC_ddef16_t*)fields)
progs . ofs_globaldefs = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numglobaldefs = numglobaldefs ;
for ( i = 0 ; i < numglobaldefs ; i + + )
{
2005-05-22 13:42:10 +00:00
qcc_globals16 [ i ] . type = ( unsigned short ) PRLittleShort ( ( unsigned short ) qcc_globals [ i ] . type ) ;
qcc_globals16 [ i ] . ofs = ( unsigned short ) PRLittleShort ( ( unsigned short ) qcc_globals [ i ] . ofs ) ;
qcc_globals16 [ i ] . s_name = PRLittleLong ( qcc_globals [ i ] . s_name ) ;
2004-09-07 18:16:59 +00:00
}
if ( progs . blockscompressed & 2 )
2011-05-15 13:23:13 +00:00
{
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numglobaldefs * sizeof ( QCC_ddef16_t ) , 2 , ( char * ) qcc_globals16 , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_globaldefs , SEEK_SET ) ; //seek back
2005-05-22 13:42:10 +00:00
len = PRLittleLong ( len ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , qcc_globals16 , numglobaldefs * sizeof ( QCC_ddef16_t ) ) ;
progs . ofs_fielddefs = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numfielddefs = numfielddefs ;
for ( i = 0 ; i < numfielddefs ; i + + )
{
2005-05-22 13:42:10 +00:00
fields16 [ i ] . type = ( unsigned short ) PRLittleShort ( ( unsigned short ) fields [ i ] . type ) ;
2015-04-14 12:24:05 +00:00
if ( fields [ i ] . ofs > 0xffff )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Offset for field %s overflowed 16 bits. \n " , strings + fields [ i ] . s_name ) ;
2015-04-14 12:24:05 +00:00
fields16 [ i ] . ofs = 0 ;
}
else
fields16 [ i ] . ofs = ( unsigned short ) PRLittleShort ( ( unsigned short ) fields [ i ] . ofs ) ;
2005-05-22 13:42:10 +00:00
fields16 [ i ] . s_name = PRLittleLong ( fields [ i ] . s_name ) ;
2004-09-07 18:16:59 +00:00
}
if ( progs . blockscompressed & 4 )
2011-05-15 13:23:13 +00:00
{
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numfielddefs * sizeof ( QCC_ddef16_t ) , 2 , ( char * ) fields16 , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_fielddefs , SEEK_SET ) ; //seek back
2005-05-22 13:42:10 +00:00
len = PRLittleLong ( len ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , fields16 , numfielddefs * sizeof ( QCC_ddef16_t ) ) ;
break ;
default :
2019-09-25 20:23:24 +00:00
externs - > Sys_Error ( " structtype error " ) ;
2004-09-07 18:16:59 +00:00
}
progs . ofs_globals = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numglobals = numpr_globals ;
for ( i = 0 ; ( unsigned ) i < numpr_globals ; i + + )
2005-05-22 13:42:10 +00:00
( ( int * ) qcc_pr_globals ) [ i ] = PRLittleLong ( ( ( int * ) qcc_pr_globals ) [ i ] ) ;
2004-09-07 18:16:59 +00:00
if ( progs . blockscompressed & 32 )
2011-05-15 13:23:13 +00:00
{
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numpr_globals * 4 , 2 , ( char * ) qcc_pr_globals , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_globals , SEEK_SET ) ; //seek back
2005-05-22 13:42:10 +00:00
len = PRLittleLong ( len ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
2011-05-15 13:23:13 +00:00
SafeWrite ( h , qcc_pr_globals , numpr_globals * 4 ) ;
2004-09-07 18:16:59 +00:00
2013-05-11 05:03:07 +00:00
/*
2004-09-07 18:16:59 +00:00
if ( types )
for ( i = 0 ; i < numtypeinfos ; i + + )
{
if ( qcc_typeinfo [ i ] . aux_type )
2004-09-20 23:25:38 +00:00
qcc_typeinfo [ i ] . aux_type = ( QCC_type_t * ) ( qcc_typeinfo [ i ] . aux_type - qcc_typeinfo ) ;
2004-09-07 18:16:59 +00:00
if ( qcc_typeinfo [ i ] . next )
2004-09-20 23:25:38 +00:00
qcc_typeinfo [ i ] . next = ( QCC_type_t * ) ( qcc_typeinfo [ i ] . next - qcc_typeinfo ) ;
2010-11-02 23:17:25 +00:00
qcc_typeinfo [ i ] . name = ( char * ) QCC_CopyDupBackString ( qcc_typeinfo [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
}
2013-05-11 05:03:07 +00:00
*/
2004-09-07 18:16:59 +00:00
progs . ofsfiles = 0 ;
progs . ofslinenums = 0 ;
progs . secondaryversion = 0 ;
progs . ofsbodylessfuncs = 0 ;
progs . numbodylessfuncs = 0 ;
progs . ofs_types = 0 ;
progs . numtypes = 0 ;
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
progs . ofsbodylessfuncs = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numbodylessfuncs = WriteBodylessFuncs ( h ) ;
2005-02-28 07:16:19 +00:00
switch ( qcc_targetformat )
2004-09-07 18:16:59 +00:00
{
2011-03-04 13:59:06 +00:00
case QCF_QTEST :
progs . version = PROG_QTESTVERSION ;
2016-11-20 20:52:41 +00:00
progs . ofsfiles = WriteSourceFiles ( qcc_sourcefile , h , debugtarget , false ) ;
2011-03-04 13:59:06 +00:00
break ;
2016-09-01 14:31:24 +00:00
default :
2005-02-28 07:16:19 +00:00
case QCF_STANDARD :
case QCF_HEXEN2 : //urgh
progs . version = PROG_VERSION ;
2016-11-20 20:52:41 +00:00
progs . ofsfiles = WriteSourceFiles ( qcc_sourcefile , h , debugtarget , false ) ;
2005-02-28 07:16:19 +00:00
break ;
2008-10-16 23:04:36 +00:00
case QCF_DARKPLACES :
2005-02-28 07:16:19 +00:00
case QCF_FTE :
2013-03-12 22:47:42 +00:00
case QCF_FTEH2 :
2005-02-28 07:16:19 +00:00
case QCF_FTEDEBUG :
2020-07-13 17:48:16 +00:00
case QCF_QSS :
2020-07-01 05:32:21 +00:00
case QCF_UHEXEN2 :
case QCF_KK7 :
2005-02-28 07:16:19 +00:00
2020-07-13 17:48:16 +00:00
progs . version = PROG_EXTENDEDVERSION ;
2020-07-01 05:32:21 +00:00
if ( outputsttype = = PST_UHEXEN2 )
progs . secondaryversion = PROG_SECONDARYUHEXEN2 ; //prepadded...
2020-07-13 17:48:16 +00:00
else if ( outputsttype = = PST_KKQWSV )
2020-07-01 05:32:21 +00:00
progs . secondaryversion = PROG_SECONDARYKKQWSV ; //messed up
else if ( outputsttype = = PST_FTE32 )
progs . secondaryversion = PROG_SECONDARYVERSION32 ; //post-extended.
2004-09-07 18:16:59 +00:00
else
2020-07-13 17:48:16 +00:00
{
2004-09-07 18:16:59 +00:00
progs . secondaryversion = PROG_SECONDARYVERSION16 ;
2020-07-13 17:48:16 +00:00
if ( qcc_targetformat = = QCF_DARKPLACES )
progs . version = PROG_VERSION ;
}
2004-09-07 18:16:59 +00:00
2014-04-24 01:53:01 +00:00
if ( debugtarget & & statement_linenums )
2004-09-07 18:16:59 +00:00
{
progs . ofslinenums = SafeSeek ( h , 0 , SEEK_CUR ) ;
if ( progs . blockscompressed & 64 )
2011-05-15 13:23:13 +00:00
{
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numstatements * sizeof ( int ) , 2 , ( char * ) statement_linenums , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofslinenums , SEEK_SET ) ; //seek back
2005-05-22 13:42:10 +00:00
len = PRLittleLong ( len ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , statement_linenums , numstatements * sizeof ( int ) ) ;
2014-04-24 01:53:01 +00:00
statement_linenums = NULL ;
2004-09-07 18:16:59 +00:00
}
else
progs . ofslinenums = 0 ;
if ( types )
{
progs . ofs_types = SafeSeek ( h , 0 , SEEK_CUR ) ;
if ( progs . blockscompressed & 128 )
2011-05-15 13:23:13 +00:00
{
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , sizeof ( QCC_type_t ) * numtypeinfos , 2 , ( char * ) qcc_typeinfo , h ) ; //write
i = SafeSeek ( h , 0 , SEEK_CUR ) ;
SafeSeek ( h , progs . ofs_types , SEEK_SET ) ; //seek back#
2005-05-22 13:42:10 +00:00
len = PRLittleLong ( len ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //write size.
SafeSeek ( h , i , SEEK_SET ) ;
}
else
SafeWrite ( h , qcc_typeinfo , sizeof ( QCC_type_t ) * numtypeinfos ) ;
2011-05-15 13:23:13 +00:00
progs . numtypes = numtypeinfos ;
2004-09-07 18:16:59 +00:00
}
else
{
progs . ofs_types = 0 ;
progs . numtypes = 0 ;
}
2016-11-20 20:52:41 +00:00
progs . ofsfiles = WriteSourceFiles ( qcc_sourcefile , h , debugtarget , true ) ;
2005-02-28 07:16:19 +00:00
break ;
2004-09-07 18:16:59 +00:00
}
2016-11-20 20:52:41 +00:00
qcc_sourcefile = NULL ;
2004-09-07 18:16:59 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( progs . version ! = PROG_EXTENDEDVERSION & & progs . numbodylessfuncs )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " WARNING: progs format cannot handle extern functions \n " ) ;
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
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %6i TOTAL SIZE \n " , ( int ) SafeSeek ( h , 0 , SEEK_CUR ) ) ;
2004-09-07 18:16:59 +00:00
progs . entityfields = pr . size_fields ;
progs . crc = crc ;
2020-08-03 10:34:44 +00:00
if ( flag_qccx )
2016-07-12 00:40:13 +00:00
{
2020-08-03 10:34:44 +00:00
def = QCC_PR_GetDef ( NULL , " progs " , NULL , false , 0 , 0 ) ; //this is for qccx support
if ( def & & ( def - > type - > type = = ev_entity | | ( def - > type - > type = = ev_accessor & & def - > type - > parentclass - > type = = ev_entity ) ) )
{
int size = SafeSeek ( h , 0 , SEEK_CUR ) ;
size + = 1 ; //the engine will add a null terminator
size = ( size + 15 ) & ( ~ 15 ) ; //and will allocate it on the hunk with 16-byte alignment
//this global receives the offset from world to the start of the progs def _IN VANILLA QUAKE_.
//this is a negative index due to allocation ordering with the assumption that the progs.dat was loaded on the heap directly followed by the entities.
//this will NOT work in FTE, DP, QuakeForge due to entity indexes. Various other engines will likely mess up too, if they change the allocation order or sizes etc. 64bit is screwed.
if ( progs . blockscompressed & 32 )
externs - > Printf ( " unable to write value for 'entity progs' \n " ) ; //would not work anyway
2016-07-12 00:40:13 +00:00
else
2020-08-03 10:34:44 +00:00
{
QCC_PR_Warning ( WARN_DENORMAL , def - > filen , def - > s_line , " 'entity progs' is non-portable and will not work across engines nor cpus. " ) ;
if ( def - > initialized )
i = PRLittleLong ( qcc_pr_globals [ def - > ofs ] . _int ) ;
else
{ //entsize(=96)+hunk header size(=32)
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2020-08-03 10:34:44 +00:00
externs - > Printf ( " qccx hack - 'entity progs' uninitialised. Assuming 112. \n " ) ;
i = 112 ; //match qccx.
}
i = - ( size + i ) ;
i = PRLittleLong ( i ) ;
SafeSeek ( h , progs . ofs_globals + 4 * def - > ofs , SEEK_SET ) ;
SafeWrite ( h , & i , 4 ) ;
2016-07-12 00:40:13 +00:00
}
}
}
2004-09-07 18:16:59 +00:00
2016-07-12 00:40:13 +00:00
// qbyte swap the header and write it out
for ( i = 0 ; i < sizeof ( progs ) / 4 ; i + + )
( ( int * ) & progs ) [ i ] = PRLittleLong ( ( ( int * ) & progs ) [ i ] ) ;
2004-09-07 18:16:59 +00:00
SafeSeek ( h , 0 , SEEK_SET ) ;
SafeWrite ( h , & progs , sizeof ( progs ) ) ;
2016-07-12 00:40:13 +00:00
2013-09-26 14:36:52 +00:00
if ( ! SafeClose ( h ) )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %sError%s while writing output %s \n " , col_error , col_none , destfile ) ;
2013-09-26 14:36:52 +00:00
return false ;
}
2015-04-14 12:24:05 +00:00
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_PROGRESS )
2015-04-14 12:24:05 +00:00
switch ( qcc_targetformat )
{
case QCF_QTEST :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Compile finished: %s (qtest format) \n " , destfile ) ;
2015-04-14 12:24:05 +00:00
break ;
case QCF_KK7 :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Compile finished: %s (kk7 format) \n " , destfile ) ;
2015-04-14 12:24:05 +00:00
break ;
case QCF_STANDARD :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Compile finished: %s (id format) \n " , destfile ) ;
2015-04-14 12:24:05 +00:00
break ;
case QCF_HEXEN2 :
2020-07-01 05:32:21 +00:00
case QCF_UHEXEN2 :
if ( progs . version = = PROG_VERSION )
externs - > Printf ( " Compile finished: %s (hexen2 format) \n " , destfile ) ;
else
externs - > Printf ( " Compile finished: %s (uhexen2 format) \n " , destfile ) ;
2015-04-14 12:24:05 +00:00
break ;
case QCF_DARKPLACES :
2020-09-29 07:09:01 +00:00
externs - > Printf ( " Compile finished: %s (fte+dp format) \n " , destfile ) ;
2015-04-14 12:24:05 +00:00
break ;
2020-07-13 17:48:16 +00:00
case QCF_QSS :
externs - > Printf ( " Compile finished: %s (fte+qss format) \n " , destfile ) ;
break ;
2015-04-14 12:24:05 +00:00
case QCF_FTE :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Compile finished: %s (fte format) \n " , destfile ) ;
2015-04-14 12:24:05 +00:00
break ;
case QCF_FTEH2 :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Compile finished: %s (fteh2 format) \n " , destfile ) ;
2015-04-14 12:24:05 +00:00
break ;
case QCF_FTEDEBUG :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Compile finished: %s (ftedbg format) \n " , destfile ) ;
2015-04-14 12:24:05 +00:00
break ;
default :
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Compile finished: %s \n " , destfile ) ;
2015-04-14 12:24:05 +00:00
break ;
}
2004-10-13 07:24:59 +00:00
2014-04-14 09:16:41 +00:00
if ( statement_linenums )
2004-10-13 07:24:59 +00:00
{
2014-04-14 09:16:41 +00:00
unsigned int lnotype = * ( unsigned int * ) " LNOF " ;
unsigned int version = 1 ;
pbool gz = false ;
while ( 1 )
2004-10-13 07:24:59 +00:00
{
2014-04-14 09:16:41 +00:00
char * ext ;
ext = strrchr ( destfile , ' . ' ) ;
2020-09-11 01:18:32 +00:00
if ( ! ext | | strchr ( ext , ' / ' ) | | strchr ( ext , ' \\ ' ) )
2013-09-26 14:36:52 +00:00
break ;
2014-04-14 09:16:41 +00:00
if ( ! stricmp ( ext , " .gz " ) )
2013-09-26 14:36:52 +00:00
{
2014-04-14 09:16:41 +00:00
* ext = 0 ;
gz = true ;
continue ;
2013-09-26 14:36:52 +00:00
}
2014-04-14 09:16:41 +00:00
* ext = 0 ;
break ;
}
if ( strlen ( destfile ) < sizeof ( destfile ) - ( 4 + 3 ) )
{
strcat ( destfile , " .lno " ) ;
if ( gz )
strcat ( destfile , " .gz " ) ;
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Writing %s for debugging \n " , destfile ) ;
2014-04-14 09:16:41 +00:00
h = SafeOpenWrite ( destfile , 2 * 1024 * 1024 ) ;
SafeWrite ( h , & lnotype , sizeof ( int ) ) ;
SafeWrite ( h , & version , sizeof ( int ) ) ;
SafeWrite ( h , & numglobaldefs , sizeof ( int ) ) ;
SafeWrite ( h , & numpr_globals , sizeof ( int ) ) ;
SafeWrite ( h , & numfielddefs , sizeof ( int ) ) ;
SafeWrite ( h , & numstatements , sizeof ( int ) ) ;
SafeWrite ( h , statement_linenums , numstatements * sizeof ( int ) ) ;
SafeClose ( h ) ;
2004-10-13 07:24:59 +00:00
}
}
2008-11-09 22:29:28 +00:00
return true ;
2004-09-07 18:16:59 +00:00
}
2016-09-08 19:04:35 +00:00
/*
# merge "oldprogs"
wrap void ( ) worldspawn =
{
print ( " hello world \n " ) ;
prior ( ) ;
} ;
Progs merging is done by loading in an existing progs . dat and essentially appending new stuff on the end .
The resulting output should be the same , other than wraps ( which replaces the previous function global with the new one ) .
*/
static void QCC_MergeStrings ( char * in , unsigned int num )
{
memcpy ( strings , in , num ) ;
strofs = num ;
}
2018-10-11 10:31:23 +00:00
static int QCC_MergeValidateString ( int str )
2016-09-08 19:04:35 +00:00
{
if ( str < 0 | | str > = strofs )
str = 0 ;
return str ;
}
static void QCC_MergeFunctions ( dfunction_t * in , unsigned int num )
{
numfunctions = 0 ;
while ( num - - > 0 )
{
if ( in - > first_statement < = 0 )
{
functions [ numfunctions ] . builtin = - in - > first_statement ;
functions [ numfunctions ] . code = - 1 ;
}
else
{
functions [ numfunctions ] . builtin = 0 ;
functions [ numfunctions ] . code = in - > first_statement ;
}
functions [ numfunctions ] . s_filed = QCC_MergeValidateString ( in - > s_file ) ;
functions [ numfunctions ] . filen = strings + functions [ numfunctions ] . s_filed ;
functions [ numfunctions ] . line = 0 ;
functions [ numfunctions ] . name = strings + QCC_MergeValidateString ( in - > s_name ) ;
functions [ numfunctions ] . parentscope = NULL ;
functions [ numfunctions ] . type = NULL ;
functions [ numfunctions ] . def = NULL ;
functions [ numfunctions ] . firstlocal = NULL ;
functions [ numfunctions ] . privatelocals = true ;
functions [ numfunctions ] . merged = in ;
numfunctions + + ;
in + + ;
}
}
static void QCC_MergeStatements16 ( dstatement16_t * in , unsigned int num )
{
QCC_statement_t * out = statements ;
numstatements = num ;
for ( ; num - - > 0 ; out + + , in + + )
{
out - > op = in - > op ;
out - > a . sym = NULL ;
out - > a . cast = NULL ;
out - > a . ofs = in - > a ;
out - > b . sym = NULL ;
out - > b . cast = NULL ;
out - > b . ofs = in - > b ;
out - > c . sym = NULL ;
out - > c . cast = NULL ;
out - > c . ofs = in - > c ;
out - > linenum = 0 ;
2021-08-27 04:29:31 +00:00
if ( in - > op < OP_NUMREALOPS )
{
if ( ! pr_opcodes [ in - > op ] . type_a )
out - > a . ofs = ( short ) in - > a ;
if ( ! pr_opcodes [ in - > op ] . type_b )
out - > b . ofs = ( short ) in - > b ;
if ( ! pr_opcodes [ in - > op ] . type_c )
out - > c . ofs = ( short ) in - > c ;
}
2016-09-08 19:04:35 +00:00
}
out - > op = OP_DONE ;
out - > a . ofs = 0 ;
out - > b . ofs = 0 ;
out - > c . ofs = 0 ;
out - > linenum = 0 ;
numstatements + + ;
}
static etype_t QCC_MergeFindFieldType ( unsigned int ofs , const char * fldname , ddef16_t * fields , size_t numfields )
{
size_t i ;
etype_t best = ev_void ;
for ( i = 0 ; i < numfields ; i + + )
{
if ( fields [ i ] . ofs = = ofs )
{ //sometimes we have field unions. go for the exact name match if we can so we don't get confused over vectors/floats. otherwise just go with the first (and hope they're correctly ordered)
char * name = strings + QCC_MergeValidateString ( fields [ i ] . s_name ) ;
if ( ! strcmp ( name , fldname ) )
return fields [ i ] . type ;
if ( best = = ev_void )
best = fields [ i ] . type ;
}
}
return best ;
}
static void QCC_MergeUnstrip ( dfunction_t * in , unsigned int num )
{
size_t i ;
char * name ;
QCC_def_t * def ;
//functions may have been stripped. this results in an annoying lack of errors, and will likely confuse function wrapping...
//generate a new def for each function, if it doesn't already exist.
//these are probably going to be wasteful dupes, but they'll just get stripped again if they're still not used.
for ( i = 0 ; i < num ; i + + )
{
if ( ! in [ i ] . s_name )
continue ;
name = strings + QCC_MergeValidateString ( in [ i ] . s_name ) ;
def = QCC_PR_GetDef ( NULL , name , NULL , false , 0 , GDF_BASICTYPE ) ;
if ( ! def )
{
def = QCC_PR_GetDef ( type_function , name , NULL , true , 0 , GDF_BASICTYPE ) ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
def - > symboldata [ 0 ] . function = i ;
2016-09-08 19:04:35 +00:00
def - > initialized = true ;
def - > referenced = true ;
def - > assumedtype = true ;
}
QCC_FreeDef ( def ) ;
}
}
QCC_type_t * QCC_PR_FieldType ( QCC_type_t * pointsto ) ;
static void QCC_MergeGlobalDefs16 ( ddef16_t * in , size_t num , void * values , size_t defscount , ddef16_t * fields , size_t numfields )
{
QCC_def_t * root , * def ;
QCC_type_t * type ;
etype_t evt ;
char * name ;
unsigned int flags ;
pbool referrable ;
numpr_globals = 0 ; //that root object will replace the normal reserved globals.
root = QCC_PR_GetDef ( type_void , " " , NULL , true , 0 , GDF_USED ) ;
root - > symboldata = values ;
root - > symbolsize = defscount ;
for ( ; num - - > 0 ; in + + )
{
name = strings + QCC_MergeValidateString ( in - > s_name ) ;
flags = GDF_USED ;
if ( in - > type & DEF_SAVEGLOBAL )
flags | = GDF_SAVED ;
evt = in - > type & ~ DEF_SAVEGLOBAL ;
if ( evt = = ev_field )
evt = QCC_MergeFindFieldType ( root - > symboldata [ in - > ofs ] . _int , name , fields , numfields ) ;
switch ( evt )
{
case ev_void :
type = type_void ;
break ;
case ev_vector :
type = type_vector ;
break ;
case ev_float :
type = type_float ;
break ;
case ev_string :
type = type_string ;
break ;
case ev_entity :
type = type_entity ;
break ;
case ev_integer :
type = type_integer ;
break ;
case ev_function :
type = type_function ;
break ;
default :
type = type_variant ;
break ;
}
if ( ( in - > type & ~ DEF_SAVEGLOBAL ) = = ev_field )
{
type = QCC_PR_FieldType ( type ) ;
flags | = GDF_CONST ;
}
referrable = true ; //fixme: disable if this appears to be within a function's local storage
def = QCC_PR_DummyDef ( type , name , NULL , 0 , root , in - > ofs , referrable , flags ) ;
def - > initialized = 1 ;
def - > referenced = true ;
def - > assumedtype = true ;
if ( evt = = ev_vector )
{
int j = 3 ;
if ( ( in - > type & ~ DEF_SAVEGLOBAL ) = = ev_field )
{
for ( j = 0 ; j < 3 ; j + + )
{
if ( in [ j + 1 ] . ofs = = in - > ofs + j & & ( in [ j + 1 ] . type & ~ DEF_SAVEGLOBAL ) = = ev_field & & QCC_MergeFindFieldType ( root - > symboldata [ in [ j + 1 ] . ofs ] . _int , strings + QCC_MergeValidateString ( in [ j + 1 ] . s_name ) , fields , numfields ) = = ev_float )
continue ;
break ;
}
}
else
{
for ( j = 0 ; j < 3 ; j + + )
{
if ( in [ j + 1 ] . ofs = = in - > ofs + j & & ( in [ j + 1 ] . type & ~ DEF_SAVEGLOBAL ) = = ev_float )
continue ;
break ;
}
}
in + = j ;
num - = j ;
}
}
QCC_FreeDef ( root ) ;
}
2018-04-19 17:30:39 +00:00
static unsigned char * PDECL QCC_LoadFileHunkAlloc ( void * ctx , size_t size )
2018-01-22 19:18:04 +00:00
{
return ( unsigned char * ) qccHunkAlloc ( size + 1 ) ;
}
2016-09-08 19:04:35 +00:00
/*load a progs into the current compile state.*/
void QCC_ImportProgs ( const char * filename )
{
2018-01-23 01:22:29 +00:00
size_t flen ;
2016-09-08 19:04:35 +00:00
dprograms_t * prog ;
//these keywords are implicitly enabled by #merge
keyword_weak = true ;
keyword_wrap = true ;
// if (strofs != 0) //could be fixed with relocs
// QCC_Error(ERR_BADEXTENSION, "#merge used too late. It must be used before any other definitions.");
if ( numstatements ! = 1 ) //should be easy to deal with.
QCC_Error ( ERR_BADEXTENSION , " #merge used too late. It must be used before any other definitions. " ) ;
if ( numfunctions ! = 1 ) //could be fixed with relocs
QCC_Error ( ERR_BADEXTENSION , " #merge used too late. It must be used before any other definitions. " ) ;
if ( numglobaldefs ! = 1 ) //could be fixed by inserting it properly. any already-defined defs must have their parentdef changed to union them with imported ones.
QCC_Error ( ERR_BADEXTENSION , " #merge used too late. It must be used before any other definitions (globals). " ) ;
if ( numfielddefs ! = 1 ) //could be fixed with relocs
QCC_Error ( ERR_BADEXTENSION , " #merge used too late. It must be used before any other definitions (fields). " ) ;
if ( numpr_globals ! = RESERVED_OFS ) //not normally changed until after compiling
QCC_Error ( ERR_BADEXTENSION , " #merge used too late. It must be used before any other definitions (regs). " ) ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " \n note: The #merge feature is still experimental \n \n " ) ;
2016-09-08 19:04:35 +00:00
//FIXME: find overlapped locals. strip them. merge with new ones.
//FIXME: find temps. strip them. you get the idea.
//FIXME: find immediates. set up hash tables for them for reuse. HAH!
2018-04-20 19:09:14 +00:00
prog = externs - > ReadFile ( filename , QCC_LoadFileHunkAlloc , NULL , & flen , false ) ;
2018-01-22 19:18:04 +00:00
if ( ! prog )
{
QCC_Error ( ERR_COULDNTOPENFILE , " Couldn't open file %s " , filename ) ;
return ;
}
2016-09-08 19:04:35 +00:00
if ( prog - > version = = 7 & & prog - > secondaryversion = = PROG_SECONDARYVERSION16 & & ! prog - > blockscompressed & & ! prog - > numtypes )
;
else if ( prog - > version = = 7 & & prog - > secondaryversion = = PROG_SECONDARYVERSION32 & & ! prog - > blockscompressed & & ! prog - > numtypes )
;
else if ( prog - > version ! = 6 )
{
QCC_Error ( ERR_COULDNTOPENFILE , " Unsupported version: %s " , filename ) ;
return ;
}
QCC_MergeStrings ( ( ( char * ) prog + prog - > ofs_strings ) , prog - > numstrings ) ;
QCC_MergeFunctions ( ( dfunction_t * ) ( ( char * ) prog + prog - > ofs_functions ) , prog - > numfunctions ) ;
pr . size_fields = prog - > entityfields ;
if ( prog - > version = = 7 & & prog - > secondaryversion = = PROG_SECONDARYVERSION32 )
{
// QCC_MergeStatements32((dstatement32_t*)((char*)prog+prog->ofs_statements), prog->numstatements);
// QCC_MergeGlobalDefs32((ddef32_t*)((char*)prog+prog->ofs_globaldefs), prog->numglobaldefs, ((char*)prog)+prog->ofs_globals, prog->numglobals, (ddef16_t*)((char*)prog+prog->ofs_fielddefs), prog->numfielddefs);
QCC_Error ( ERR_COULDNTOPENFILE , " 32bit versions not supported: %s " , filename ) ;
}
else
{
QCC_MergeStatements16 ( ( dstatement16_t * ) ( ( char * ) prog + prog - > ofs_statements ) , prog - > numstatements ) ;
QCC_MergeGlobalDefs16 ( ( ddef16_t * ) ( ( char * ) prog + prog - > ofs_globaldefs ) , prog - > numglobaldefs , ( ( char * ) prog ) + prog - > ofs_globals , prog - > numglobals , ( ddef16_t * ) ( ( char * ) prog + prog - > ofs_fielddefs ) , prog - > numfielddefs ) ;
}
QCC_MergeUnstrip ( ( dfunction_t * ) ( ( char * ) prog + prog - > ofs_functions ) , prog - > numfunctions ) ;
}
2004-09-07 18:16:59 +00:00
/*
= = = = = = = = = = = = = = =
PR_String
Returns a string suitable for printing ( no newlines , max 60 chars length )
= = = = = = = = = = = = = = =
*/
2018-10-11 10:31:23 +00:00
static char * QCC_PR_String ( char * string )
2004-09-07 18:16:59 +00:00
{
static char buf [ 80 ] ;
char * s ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
s = buf ;
* s + + = ' " ' ;
while ( string & & * string )
{
if ( s = = buf + sizeof ( buf ) - 2 )
break ;
if ( * string = = ' \n ' )
{
* s + + = ' \\ ' ;
* s + + = ' n ' ;
}
else if ( * string = = ' " ' )
{
* s + + = ' \\ ' ;
* s + + = ' " ' ;
}
else
* s + + = * string ;
string + + ;
if ( s - buf > 60 )
{
* s + + = ' . ' ;
* s + + = ' . ' ;
* s + + = ' . ' ;
break ;
}
}
* s + + = ' " ' ;
* s + + = 0 ;
return buf ;
}
2018-10-11 10:31:23 +00:00
static QCC_def_t * QCC_PR_DefForFieldOfs ( gofs_t ofs )
2004-09-07 18:16:59 +00:00
{
QCC_def_t * d ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
for ( d = pr . def_head . next ; d ; d = d - > next )
{
if ( d - > type - > type ! = ev_field )
continue ;
if ( * ( ( unsigned int * ) & qcc_pr_globals [ d - > ofs ] ) = = ofs )
return d ;
}
QCC_Error ( ERR_NOTDEFINED , " PR_DefForFieldOfs: couldn't find %i " , ofs ) ;
return NULL ;
}
/*
= = = = = = = = = = = =
PR_ValueString
Returns a string describing * data in a type specific manner
= = = = = = = = = = = = =
*/
char * QCC_PR_ValueString ( etype_t type , void * val )
{
static char line [ 256 ] ;
QCC_def_t * def ;
2015-04-14 12:24:05 +00:00
QCC_function_t * f ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
switch ( type )
{
case ev_string :
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " %s " , QCC_PR_String ( strings + * ( int * ) val ) ) ;
2004-09-07 18:16:59 +00:00
break ;
2011-05-15 13:23:13 +00:00
case ev_entity :
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " entity %i " , * ( int * ) val ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_function :
f = functions + * ( int * ) val ;
if ( ! f )
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " undefined function " ) ;
2004-09-07 18:16:59 +00:00
else
2015-04-14 12:24:05 +00:00
QC_snprintfz ( line , sizeof ( line ) , " %s() " , f - > name ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_field :
def = QCC_PR_DefForFieldOfs ( * ( int * ) val ) ;
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " .%s " , def - > name ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_void :
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " void " ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_float :
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " %5.1f " , * ( float * ) val ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_integer :
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " %i " , * ( int * ) val ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_vector :
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " '%5.1f %5.1f %5.1f' " , ( ( float * ) val ) [ 0 ] , ( ( float * ) val ) [ 1 ] , ( ( float * ) val ) [ 2 ] ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_pointer :
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " pointer " ) ;
2004-09-07 18:16:59 +00:00
break ;
default :
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " bad type %i " , type ) ;
2004-09-07 18:16:59 +00:00
break ;
}
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
return line ;
}
/*
= = = = = = = = = = = =
PR_GlobalString
Returns a string with a description and the contents of a global ,
padded to 20 field width
= = = = = = = = = = = =
*/
/*char *QCC_PR_GlobalStringNoContents (gofs_t ofs)
{
int i ;
QCC_def_t * def ;
void * val ;
static char line [ 128 ] ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
val = ( void * ) & qcc_pr_globals [ ofs ] ;
def = pr_global_defs [ ofs ] ;
if ( ! def )
// Error ("PR_GlobalString: no def for %i", ofs);
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " %i(? " " ? " " ?) " , ofs ) ;
2004-09-07 18:16:59 +00:00
else
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " %i(%s) " , ofs , def - > name ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
i = strlen ( line ) ;
for ( ; i < 16 ; i + + )
2015-02-02 08:01:53 +00:00
Q_strlcat ( line , " " , sizeof ( line ) ) ;
Q_strlcat ( line , " " , sizeof ( line ) ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
return line ;
}
char * QCC_PR_GlobalString ( gofs_t ofs )
{
char * s ;
int i ;
QCC_def_t * def ;
void * val ;
static char line [ 128 ] ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
val = ( void * ) & qcc_pr_globals [ ofs ] ;
def = pr_global_defs [ ofs ] ;
if ( ! def )
return QCC_PR_GlobalStringNoContents ( ofs ) ;
if ( def - > initialized & & def - > type - > type ! = ev_function )
{
s = QCC_PR_ValueString ( def - > type - > type , & qcc_pr_globals [ ofs ] ) ;
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " %i(%s) " , ofs , s ) ;
2004-09-07 18:16:59 +00:00
}
else
2015-02-02 08:01:53 +00:00
QC_snprintfz ( line , sizeof ( line ) , " %i(%s) " , ofs , def - > name ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
i = strlen ( line ) ;
for ( ; i < 16 ; i + + )
strcat ( line , " " ) ;
strcat ( line , " " ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
return line ;
} */
/*
= = = = = = = = = = = =
PR_PrintOfs
= = = = = = = = = = = =
*/
/*void QCC_PR_PrintOfs (gofs_t ofs)
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s \n " , QCC_PR_GlobalString ( ofs ) ) ;
2004-09-07 18:16:59 +00:00
} */
/*
= = = = = = = = = = = = = = = = =
PR_PrintStatement
= = = = = = = = = = = = = = = = =
*/
/*void QCC_PR_PrintStatement (QCC_dstatement_t *s)
{
int i ;
2011-05-15 13:23:13 +00:00
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %4i : %4i : %s " , ( int ) ( s - statements ) , statement_linenums [ s - statements ] , pr_opcodes [ s - > op ] . opname ) ;
2004-09-07 18:16:59 +00:00
i = strlen ( pr_opcodes [ s - > op ] . opname ) ;
for ( ; i < 10 ; i + + )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " " ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
if ( s - > op = = OP_IF | | s - > op = = OP_IFNOT )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %sbranch %i " , QCC_PR_GlobalString ( s - > a ) , s - > b ) ;
2004-09-07 18:16:59 +00:00
else if ( s - > op = = OP_GOTO )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " branch %i " , s - > a ) ;
2004-09-07 18:16:59 +00:00
}
else if ( ( unsigned ) ( s - > op - OP_STORE_F ) < 6 )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s " , QCC_PR_GlobalString ( s - > a ) ) ;
externs - > Printf ( " %s " , QCC_PR_GlobalStringNoContents ( s - > b ) ) ;
2004-09-07 18:16:59 +00:00
}
else
{
if ( s - > a )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s " , QCC_PR_GlobalString ( s - > a ) ) ;
2004-09-07 18:16:59 +00:00
if ( s - > b )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s " , QCC_PR_GlobalString ( s - > b ) ) ;
2004-09-07 18:16:59 +00:00
if ( s - > c )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s " , QCC_PR_GlobalStringNoContents ( s - > c ) ) ;
2004-09-07 18:16:59 +00:00
}
2018-10-11 10:31:23 +00:00
externs - > Printf ( " \n " ) ;
2004-09-07 18:16:59 +00:00
} */
/*
= = = = = = = = = = = =
PR_PrintDefs
= = = = = = = = = = = =
*/
/*void QCC_PR_PrintDefs (void)
{
QCC_def_t * d ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
for ( d = pr . def_head . next ; d ; d = d - > next )
QCC_PR_PrintOfs ( d - > ofs ) ;
} */
2018-07-14 18:50:20 +00:00
QCC_type_t * QCC_PR_NewType ( const char * name , int basictype , pbool typedefed )
2004-09-07 18:16:59 +00:00
{
if ( numtypeinfos > = maxtypeinfos )
QCC_Error ( ERR_TOOMANYTYPES , " Too many types " ) ;
memset ( & qcc_typeinfo [ numtypeinfos ] , 0 , sizeof ( QCC_type_t ) ) ;
qcc_typeinfo [ numtypeinfos ] . type = basictype ;
qcc_typeinfo [ numtypeinfos ] . name = name ;
qcc_typeinfo [ numtypeinfos ] . num_parms = 0 ;
2013-06-02 06:03:54 +00:00
qcc_typeinfo [ numtypeinfos ] . params = NULL ;
2011-05-15 13:23:13 +00:00
qcc_typeinfo [ numtypeinfos ] . size = type_size [ basictype ] ;
2012-02-05 01:38:51 +00:00
qcc_typeinfo [ numtypeinfos ] . typedefed = typedefed ;
2004-09-07 18:16:59 +00:00
2021-07-06 00:12:27 +00:00
qcc_typeinfo [ numtypeinfos ] . filen = s_filen ;
qcc_typeinfo [ numtypeinfos ] . line = pr_source_line ;
2017-10-31 22:52:58 +00:00
if ( typedefed )
pHash_Add ( & typedeftable , name , & qcc_typeinfo [ numtypeinfos ] , qccHunkAlloc ( sizeof ( bucket_t ) ) ) ;
2004-09-07 18:16:59 +00:00
numtypeinfos + + ;
return & qcc_typeinfo [ numtypeinfos - 1 ] ;
}
/*
= = = = = = = = = = = = = =
PR_BeginCompilation
called before compiling a batch of files , clears the pr struct
= = = = = = = = = = = = = =
*/
2018-10-11 10:31:23 +00:00
static void QCC_PR_BeginCompilation ( void * memory , int memsize )
2004-09-07 18:16:59 +00:00
{
extern int recursivefunctiontype ;
int i ;
char name [ 16 ] ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
pr . memory = memory ;
pr . max_memory = memsize ;
pr . def_tail = & pr . def_head ;
2015-04-14 12:24:05 +00:00
pr . local_tail = & pr . local_head ;
2004-09-07 18:16:59 +00:00
2006-01-14 03:37:22 +00:00
QCC_PR_ResetErrorScope ( ) ;
2006-01-28 06:41:20 +00:00
pr_scope = NULL ;
2006-01-14 03:37:22 +00:00
2011-05-15 13:23:13 +00:00
/* numpr_globals = RESERVED_OFS;
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < RESERVED_OFS ; i + + )
pr_global_defs [ i ] = & def_void ;
*/
2011-05-15 13:23:13 +00:00
2012-02-05 01:38:51 +00:00
type_void = QCC_PR_NewType ( " void " , ev_void , true ) ;
type_string = QCC_PR_NewType ( " string " , ev_string , true ) ;
type_float = QCC_PR_NewType ( " float " , ev_float , true ) ;
2020-09-29 07:09:01 +00:00
type_double = QCC_PR_NewType ( " __double " , ev_double , true ) ;
2012-02-05 01:38:51 +00:00
type_vector = QCC_PR_NewType ( " vector " , ev_vector , true ) ;
type_entity = QCC_PR_NewType ( " entity " , ev_entity , true ) ;
type_field = QCC_PR_NewType ( " __field " , ev_field , false ) ;
2021-04-14 05:21:04 +00:00
type_field - > aux_type = type_void ;
2012-02-05 01:38:51 +00:00
type_function = QCC_PR_NewType ( " __function " , ev_function , false ) ;
2014-04-03 02:39:51 +00:00
type_function - > aux_type = type_void ;
2012-02-05 01:38:51 +00:00
type_pointer = QCC_PR_NewType ( " __pointer " , ev_pointer , false ) ;
2020-07-13 17:48:16 +00:00
type_integer = QCC_PR_NewType ( " __int " , ev_integer , true ) ;
2020-09-29 07:09:01 +00:00
type_uint = QCC_PR_NewType ( " __uint " , ev_uint , true ) ;
type_int64 = QCC_PR_NewType ( " __int64 " , ev_int64 , true ) ;
2021-02-15 21:44:50 +00:00
type_uint64 = QCC_PR_NewType ( " __uint64 " , ev_uint64 , true ) ;
2012-02-05 01:38:51 +00:00
type_variant = QCC_PR_NewType ( " __variant " , ev_variant , true ) ;
2023-01-09 05:13:12 +00:00
type_invalid = QCC_PR_NewType ( " invalid " , ev_void , false ) ;
2018-10-11 10:31:23 +00:00
type_floatfield = QCC_PR_NewType ( " __fieldfloat " , ev_field , false ) ;
2004-09-07 18:16:59 +00:00
type_floatfield - > aux_type = type_float ;
2018-10-11 10:31:23 +00:00
type_pointer - > aux_type = QCC_PR_NewType ( " __pointeraux " , ev_float , false ) ;
2004-09-07 18:16:59 +00:00
2012-02-05 01:38:51 +00:00
type_intpointer = QCC_PR_NewType ( " __intpointer " , ev_pointer , false ) ;
2012-01-28 10:30:44 +00:00
type_intpointer - > aux_type = type_integer ;
2012-02-05 01:38:51 +00:00
type_floatpointer = QCC_PR_NewType ( " __floatpointer " , ev_pointer , false ) ;
2012-01-28 10:30:44 +00:00
type_floatpointer - > aux_type = type_float ;
2014-04-03 02:39:51 +00:00
type_floatfunction = QCC_PR_NewType ( " __floatfunction " , ev_function , false ) ;
type_floatfunction - > aux_type = type_float ;
2004-09-07 18:16:59 +00:00
2022-06-19 15:18:00 +00:00
type_bfloat = QCC_PR_NewType ( " __bfloat " , ev_boolean , true ) ;
2020-09-29 07:09:01 +00:00
type_bfloat - > parentclass = type_float ;
2022-06-19 15:18:00 +00:00
type_bint = QCC_PR_NewType ( " __bint " , ev_boolean , true ) ;
type_bint - > parentclass = type_uint ;
2020-09-29 07:09:01 +00:00
2004-09-07 18:16:59 +00:00
//type_field->aux_type = type_float;
2018-10-11 10:31:23 +00:00
// QCC_PR_NewType("_Bool", ev_boolean, true);
// QCC_PR_NewType("bool", ev_boolean, true);
// QCC_PR_NewType("__int", ev_integer, keyword_integer?true:false);
QCC_PR_NewType ( " variant " , ev_variant , true ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
if ( output_parms )
{ //this tends to confuse the brains out of decompilers. :)
numpr_globals = 1 ;
2015-04-14 12:24:05 +00:00
QCC_PR_GetDef ( type_vector , " RETURN " , NULL , true , 0 , false ) - > referenced = true ;
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < MAX_PARMS ; i + + )
{
2015-02-02 08:01:53 +00:00
QC_snprintfz ( name , sizeof ( name ) , " PARM%i " , i ) ;
2015-04-14 12:24:05 +00:00
QCC_PR_GetDef ( type_vector , name , NULL , true , 0 , false ) - > referenced = true ;
2004-09-07 18:16:59 +00:00
}
}
else
{
numpr_globals = RESERVED_OFS ;
// for (i=0 ; i<RESERVED_OFS ; i++)
// pr_global_defs[i] = NULL;
}
// link the function type in so state forward declarations match proper type
pr . types = NULL ;
// type_function->next = NULL;
pr_error_count = 0 ;
2005-12-16 17:15:43 +00:00
pr_warning_count = 0 ;
2004-09-07 18:16:59 +00:00
recursivefunctiontype = 0 ;
2017-10-31 22:52:58 +00:00
QCC_PrioritiseOpcodes ( ) ;
2004-09-07 18:16:59 +00:00
}
2018-10-11 10:31:23 +00:00
static void QCC_PR_FinishFieldDef ( QCC_def_t * d )
2018-07-18 13:02:03 +00:00
{
int i ;
if ( d - > symboldata )
return ; //nothing to finish
d - > symbolsize = ( d - > arraysize ? d - > arraysize : 1 ) * d - > type - > size ;
if ( d - > symbolheader ! = d )
{
QCC_PR_FinishFieldDef ( d - > symbolheader ) ;
d - > symboldata = d - > symbolheader - > symboldata + d - > ofs ;
}
else
{
d - > symboldata = qccHunkAlloc ( d - > symbolsize * sizeof ( float ) ) ;
for ( i = 0 ; i < d - > symbolsize ; i + + )
d - > symboldata [ i ] . _int = pr . size_fields + + ;
}
}
2004-09-07 18:16:59 +00:00
/*
= = = = = = = = = = = = = =
PR_FinishCompilation
called after all files are compiled to check for errors
Returns false if errors were detected .
= = = = = = = = = = = = = =
*/
2018-10-11 10:31:23 +00:00
static int QCC_PR_FinishCompilation ( void )
2004-09-07 18:16:59 +00:00
{
QCC_def_t * d ;
2013-06-11 02:06:06 +00:00
QCC_type_t * t ;
2004-09-07 18:16:59 +00:00
int errors ;
2011-05-15 13:23:13 +00:00
2016-09-08 19:04:35 +00:00
pbool externokay = false ;
2004-09-07 18:16:59 +00:00
errors = false ;
2011-05-15 13:23:13 +00:00
2016-10-22 07:06:51 +00:00
if ( pr_error_count )
return false ;
2016-09-08 19:04:35 +00:00
if ( qcc_targetformat = = QCF_FTE | | qcc_targetformat = = QCF_FTEDEBUG | | qcc_targetformat = = QCF_FTEH2 )
externokay = true ;
2004-09-07 18:16:59 +00:00
// check to make sure all functions prototyped have code
for ( d = pr . def_head . next ; d ; d = d - > next )
{
2018-07-18 13:02:03 +00:00
if ( d - > type - > type = = ev_field & & ! d - > symboldata )
QCC_PR_FinishFieldDef ( d ) ;
2020-09-11 01:18:32 +00:00
if ( d - > type - > type = = ev_function & & d - > constant & & d - > symbolheader = = d ) // function parms are ok
2004-09-07 18:16:59 +00:00
{
2018-10-11 10:31:23 +00:00
if ( d - > isextern )
{
if ( ! externokay )
{
QCC_PR_Warning ( ERR_NOFUNC , d - > filen , d - > s_line , " extern is not supported with this target format " , d - > name ) ;
QCC_PR_ParsePrintDef ( ERR_NOFUNC , d ) ;
errors = true ;
}
bodylessfuncs = true ;
}
if ( ! d - > initialized )
2004-09-07 18:16:59 +00:00
{
if ( ! strncmp ( d - > name , " ArrayGet* " , 9 ) )
{
2013-12-29 22:48:28 +00:00
QCC_PR_EmitArrayGetFunction ( d , d - > generatedfor , d - > name + 9 ) ;
2004-11-04 04:19:10 +00:00
pr_scope = NULL ;
2013-06-11 02:06:06 +00:00
continue ;
2004-09-07 18:16:59 +00:00
}
2013-06-11 02:06:06 +00:00
if ( ! strncmp ( d - > name , " ArraySet* " , 9 ) )
2004-09-07 18:16:59 +00:00
{
2013-12-29 22:48:28 +00:00
QCC_PR_EmitArraySetFunction ( d , d - > generatedfor , d - > name + 9 ) ;
2004-11-04 04:19:10 +00:00
pr_scope = NULL ;
2013-06-11 02:06:06 +00:00
continue ;
2004-09-07 18:16:59 +00:00
}
2013-06-11 02:06:06 +00:00
if ( ! strncmp ( d - > name , " spawnfunc_ " , 10 ) )
2004-09-07 18:16:59 +00:00
{
2013-12-29 22:48:28 +00:00
//not all of these will have a class defined, as some will be regular spawn functions, so don't error on that
2013-06-11 02:06:06 +00:00
t = QCC_TypeForName ( d - > name + 10 ) ;
2015-04-21 04:12:00 +00:00
if ( t & & t - > type = = ev_entity )
2013-06-11 02:06:06 +00:00
{
QCC_PR_EmitClassFromFunction ( d , t ) ;
pr_scope = NULL ;
continue ;
}
2004-09-07 18:16:59 +00:00
}
2017-10-12 12:02:25 +00:00
if ( d - > unused )
{
d - > initialized = 1 ;
continue ;
}
2016-09-08 19:04:35 +00:00
QCC_PR_Warning ( ERR_NOFUNC , d - > filen , d - > s_line , " function %s has no body " , d - > name ) ;
2013-06-11 02:06:06 +00:00
QCC_PR_ParsePrintDef ( ERR_NOFUNC , d ) ;
bodylessfuncs = true ;
errors = true ;
2004-09-07 18:16:59 +00:00
}
}
}
2004-11-04 04:19:10 +00:00
pr_scope = NULL ;
2004-09-07 18:16:59 +00:00
return ! errors ;
}
//=============================================================================
// FIXME: byte swap?
// this is a 16 bit, non-reflected CRC using the polynomial 0x1021
// and the initial and final xor values shown below... in other words, the
// CCITT standard CRC used by XMODEM
# define CRC_INIT_VALUE 0xffff
# define CRC_XOR_VALUE 0x0000
static unsigned short QCC_crctable [ 256 ] =
{
0x0000 , 0x1021 , 0x2042 , 0x3063 , 0x4084 , 0x50a5 , 0x60c6 , 0x70e7 ,
0x8108 , 0x9129 , 0xa14a , 0xb16b , 0xc18c , 0xd1ad , 0xe1ce , 0xf1ef ,
0x1231 , 0x0210 , 0x3273 , 0x2252 , 0x52b5 , 0x4294 , 0x72f7 , 0x62d6 ,
0x9339 , 0x8318 , 0xb37b , 0xa35a , 0xd3bd , 0xc39c , 0xf3ff , 0xe3de ,
0x2462 , 0x3443 , 0x0420 , 0x1401 , 0x64e6 , 0x74c7 , 0x44a4 , 0x5485 ,
0xa56a , 0xb54b , 0x8528 , 0x9509 , 0xe5ee , 0xf5cf , 0xc5ac , 0xd58d ,
0x3653 , 0x2672 , 0x1611 , 0x0630 , 0x76d7 , 0x66f6 , 0x5695 , 0x46b4 ,
0xb75b , 0xa77a , 0x9719 , 0x8738 , 0xf7df , 0xe7fe , 0xd79d , 0xc7bc ,
0x48c4 , 0x58e5 , 0x6886 , 0x78a7 , 0x0840 , 0x1861 , 0x2802 , 0x3823 ,
0xc9cc , 0xd9ed , 0xe98e , 0xf9af , 0x8948 , 0x9969 , 0xa90a , 0xb92b ,
0x5af5 , 0x4ad4 , 0x7ab7 , 0x6a96 , 0x1a71 , 0x0a50 , 0x3a33 , 0x2a12 ,
0xdbfd , 0xcbdc , 0xfbbf , 0xeb9e , 0x9b79 , 0x8b58 , 0xbb3b , 0xab1a ,
0x6ca6 , 0x7c87 , 0x4ce4 , 0x5cc5 , 0x2c22 , 0x3c03 , 0x0c60 , 0x1c41 ,
0xedae , 0xfd8f , 0xcdec , 0xddcd , 0xad2a , 0xbd0b , 0x8d68 , 0x9d49 ,
0x7e97 , 0x6eb6 , 0x5ed5 , 0x4ef4 , 0x3e13 , 0x2e32 , 0x1e51 , 0x0e70 ,
0xff9f , 0xefbe , 0xdfdd , 0xcffc , 0xbf1b , 0xaf3a , 0x9f59 , 0x8f78 ,
0x9188 , 0x81a9 , 0xb1ca , 0xa1eb , 0xd10c , 0xc12d , 0xf14e , 0xe16f ,
0x1080 , 0x00a1 , 0x30c2 , 0x20e3 , 0x5004 , 0x4025 , 0x7046 , 0x6067 ,
0x83b9 , 0x9398 , 0xa3fb , 0xb3da , 0xc33d , 0xd31c , 0xe37f , 0xf35e ,
0x02b1 , 0x1290 , 0x22f3 , 0x32d2 , 0x4235 , 0x5214 , 0x6277 , 0x7256 ,
0xb5ea , 0xa5cb , 0x95a8 , 0x8589 , 0xf56e , 0xe54f , 0xd52c , 0xc50d ,
0x34e2 , 0x24c3 , 0x14a0 , 0x0481 , 0x7466 , 0x6447 , 0x5424 , 0x4405 ,
0xa7db , 0xb7fa , 0x8799 , 0x97b8 , 0xe75f , 0xf77e , 0xc71d , 0xd73c ,
0x26d3 , 0x36f2 , 0x0691 , 0x16b0 , 0x6657 , 0x7676 , 0x4615 , 0x5634 ,
0xd94c , 0xc96d , 0xf90e , 0xe92f , 0x99c8 , 0x89e9 , 0xb98a , 0xa9ab ,
0x5844 , 0x4865 , 0x7806 , 0x6827 , 0x18c0 , 0x08e1 , 0x3882 , 0x28a3 ,
0xcb7d , 0xdb5c , 0xeb3f , 0xfb1e , 0x8bf9 , 0x9bd8 , 0xabbb , 0xbb9a ,
0x4a75 , 0x5a54 , 0x6a37 , 0x7a16 , 0x0af1 , 0x1ad0 , 0x2ab3 , 0x3a92 ,
0xfd2e , 0xed0f , 0xdd6c , 0xcd4d , 0xbdaa , 0xad8b , 0x9de8 , 0x8dc9 ,
0x7c26 , 0x6c07 , 0x5c64 , 0x4c45 , 0x3ca2 , 0x2c83 , 0x1ce0 , 0x0cc1 ,
0xef1f , 0xff3e , 0xcf5d , 0xdf7c , 0xaf9b , 0xbfba , 0x8fd9 , 0x9ff8 ,
0x6e17 , 0x7e36 , 0x4e55 , 0x5e74 , 0x2e93 , 0x3eb2 , 0x0ed1 , 0x1ef0
} ;
2018-10-11 10:31:23 +00:00
static void QCC_CRC_Init ( unsigned short * crcvalue )
2004-09-07 18:16:59 +00:00
{
* crcvalue = CRC_INIT_VALUE ;
}
2020-06-27 19:32:49 +00:00
static void QCC_CRC_ProcessByte ( unsigned short * crcvalue , pbyte data )
2004-09-07 18:16:59 +00:00
{
2014-02-07 14:57:07 +00:00
* crcvalue = ( ( * crcvalue < < 8 ) ^ QCC_crctable [ ( * crcvalue > > 8 ) ^ data ] ) & 0xffff ;
2004-09-07 18:16:59 +00:00
}
2018-10-11 10:31:23 +00:00
/*static unsigned short QCC_CRC_Value(unsigned short crcvalue)
2004-09-07 18:16:59 +00:00
{
return crcvalue ^ CRC_XOR_VALUE ;
2018-10-11 10:31:23 +00:00
} */
2004-09-07 18:16:59 +00:00
//=============================================================================
/*
= = = = = = = = = = = =
PR_WriteProgdefs
Writes the global and entity structures out
Returns a crc of the header , to be stored in the progs file for comparison
at load time .
= = = = = = = = = = = =
*/
/*
char * Sva ( char * msg , . . . )
{
va_list l ;
static char buf [ 1024 ] ;
va_start ( l , msg ) ;
QC_vsnprintf ( buf , sizeof ( buf ) - 1 , msg , l ) ;
va_end ( l ) ;
return buf ;
}
*/
2005-02-09 19:32:30 +00:00
# define PROGDEFS_MAX_SIZE 16384
2004-09-07 18:16:59 +00:00
//write (to file buf) and add to the crc
2015-04-21 04:12:00 +00:00
static void Add_WithCRC ( char * p , unsigned short * crc , char * file )
2004-09-07 18:16:59 +00:00
{
char * s ;
int i = strlen ( file ) ;
2005-02-09 19:32:30 +00:00
if ( i + strlen ( p ) + 1 > = PROGDEFS_MAX_SIZE )
return ;
2004-09-07 18:16:59 +00:00
for ( s = p ; * s ; s + + , i + + )
{
QCC_CRC_ProcessByte ( crc , * s ) ;
file [ i ] = * s ;
}
file [ i ] = ' \0 ' ;
}
2015-04-21 04:12:00 +00:00
# define ADD_CRC(p) Add_WithCRC(p, &crc, file)
2004-09-07 18:16:59 +00:00
//#define ADD(p) {char *s;int i = strlen(p);for(s=p;*s;s++,i++){QCC_CRC_ProcessByte(&crc, *s);file[i] = *s;}file[i]='\0';}
2015-04-21 04:12:00 +00:00
static void Add_CrcOnly ( char * p , unsigned short * crc , char * file )
2004-09-07 18:16:59 +00:00
{
char * s ;
for ( s = p ; * s ; s + + )
2011-05-15 13:23:13 +00:00
QCC_CRC_ProcessByte ( crc , * s ) ;
2004-09-07 18:16:59 +00:00
}
2015-04-21 04:12:00 +00:00
# define EAT_CRC(p) Add_CrcOnly(p, &crc, file)
2004-09-07 18:16:59 +00:00
2020-09-08 04:44:07 +00:00
static void QCC_PR_CRCMessages ( unsigned short crc )
{
switch ( crc )
{
case 12923 : //#pragma sourcefile usage
break ;
case 54730 :
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2020-09-08 04:44:07 +00:00
externs - > Printf ( " Recognised progs as QuakeWorld \n " ) ;
break ;
case 5927 :
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2020-09-08 04:44:07 +00:00
externs - > Printf ( " Recognised progs as NetQuake server gamecode \n " ) ;
break ;
case 26940 :
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2020-09-08 04:44:07 +00:00
externs - > Printf ( " Recognised progs as Quake pre-release... \n " ) ;
break ;
case 38488 :
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2020-09-08 04:44:07 +00:00
externs - > Printf ( " Recognised progs as original Hexen2 \n " ) ;
break ;
case 26905 :
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2020-09-08 04:44:07 +00:00
externs - > Printf ( " Recognised progs as Hexen2 Mission Pack \n " ) ;
break ;
case 14046 :
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2020-09-08 04:44:07 +00:00
externs - > Printf ( " Recognised progs as Hexen2 (demo) \n " ) ;
break ;
case 22390 : //EXT_CSQC_1
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2020-09-08 04:44:07 +00:00
externs - > Printf ( " Recognised progs as an EXT_CSQC_1 module \n " ) ;
break ;
case 17105 :
case 32199 : //outdated ext_csqc
2022-08-08 22:45:19 +00:00
QCC_PR_Warning ( WARN_SYSTEMCRC2 , NULL , 0 , " Recognised progs as outdated CSQC module " ) ;
2020-09-08 04:44:07 +00:00
break ;
case 52195 : //this is what DP requires. don't print it as the warning that it is as that would royally piss off xonotic and their use of -Werror.
2022-08-19 13:29:27 +00:00
if ( verbose > = VERBOSE_PROGRESS )
2020-09-08 04:44:07 +00:00
externs - > Printf ( " Recognised progs as DP-specific CSQC module \n " ) ;
break ;
case 10020 :
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2020-09-08 04:44:07 +00:00
externs - > Printf ( " Recognised progs as a MenuQC module \n " ) ;
break ;
case 32401 :
2022-08-08 22:45:19 +00:00
QCC_PR_Warning ( WARN_SYSTEMCRC , NULL , 0 , " please update your tenebrae system defs. " ) ;
2020-09-08 04:44:07 +00:00
break ;
default :
2022-08-08 22:45:19 +00:00
QCC_PR_Warning ( WARN_SYSTEMCRC , NULL , 0 , " system defs not recognised from quake nor clones, probably buggy (sys)defs.qc " ) ;
2020-09-08 04:44:07 +00:00
break ;
}
}
2018-10-11 10:31:23 +00:00
static unsigned short QCC_PR_WriteProgdefs ( char * filename )
2004-09-07 18:16:59 +00:00
{
2015-04-21 04:12:00 +00:00
# define ADD_ONLY(p) QC_strlcat(file, p, sizeof(file)) //no crc (later changes)
2005-02-09 19:32:30 +00:00
char file [ PROGDEFS_MAX_SIZE ] ;
2004-09-07 18:16:59 +00:00
QCC_def_t * d ;
int f ;
unsigned short crc ;
// int c;
file [ 0 ] = ' \0 ' ;
QCC_CRC_Init ( & crc ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
// print global vars until the first field is defined
2007-06-19 23:55:04 +00:00
2015-04-21 04:12:00 +00:00
ADD_CRC ( " \n /* " ) ;
2020-07-01 05:32:21 +00:00
if ( qcc_targetformat = = QCF_HEXEN2 | | qcc_targetformat = = QCF_UHEXEN2 | | qcc_targetformat = = QCF_FTEH2 )
2015-04-21 04:12:00 +00:00
EAT_CRC ( " generated by hcc, do not modify " ) ;
2004-09-07 18:16:59 +00:00
else
2015-04-21 04:12:00 +00:00
EAT_CRC ( " file generated by qcc, do not modify " ) ;
ADD_ONLY ( " File generated by FTEQCC, relevent for engine modding only, the generated crc must be the same as your engine expects. " ) ;
ADD_CRC ( " */ \n \n typedef struct " ) ;
ADD_ONLY ( " globalvars_s " ) ;
ADD_CRC ( qcva ( " \n { " ) ) ;
ADD_ONLY ( " \t int pad; \n "
2004-09-07 18:16:59 +00:00
" \t int ofs_return[3]; \n " //makes it easier with the get globals func
" \t int ofs_parm0[3]; \n "
" \t int ofs_parm1[3]; \n "
" \t int ofs_parm2[3]; \n "
" \t int ofs_parm3[3]; \n "
" \t int ofs_parm4[3]; \n "
" \t int ofs_parm5[3]; \n "
" \t int ofs_parm6[3]; \n "
" \t int ofs_parm7[3]; \n " ) ;
2015-04-21 04:12:00 +00:00
EAT_CRC ( qcva ( " \t int \t pad[%i]; \n " , RESERVED_OFS ) ) ;
2004-09-07 18:16:59 +00:00
for ( d = pr . def_head . next ; d ; d = d - > next )
{
if ( ! strcmp ( d - > name , " end_sys_globals " ) )
break ;
2016-09-08 19:04:35 +00:00
if ( ! * d - > name )
continue ;
// if (d->symbolheader->ofs<RESERVED_OFS)
2015-04-14 12:24:05 +00:00
// continue;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
switch ( d - > type - > type )
{
case ev_float :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t float \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_vector :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t vec3_t \t %s; \n " , d - > name ) ) ;
2011-12-05 15:23:40 +00:00
if ( d - > deftail )
d = d - > deftail ; // skip the elements
2004-09-07 18:16:59 +00:00
break ;
case ev_string :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t string_t \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_function :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t func_t \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_entity :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_integer :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
default :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
}
}
2015-04-21 04:12:00 +00:00
ADD_CRC ( " } globalvars_t; \n \n " ) ;
2004-09-07 18:16:59 +00:00
// print all fields
2015-04-21 04:12:00 +00:00
ADD_CRC ( " typedef struct " ) ;
ADD_ONLY ( " entvars_s " ) ;
ADD_CRC ( " \n { \n " ) ;
2004-09-07 18:16:59 +00:00
for ( d = pr . def_head . next ; d ; d = d - > next )
{
if ( ! strcmp ( d - > name , " end_sys_fields " ) )
break ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
if ( d - > type - > type ! = ev_field )
continue ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
switch ( d - > type - > aux_type - > type )
{
case ev_float :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t float \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_vector :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t vec3_t \t %s; \n " , d - > name ) ) ;
2011-12-05 15:23:40 +00:00
if ( d - > deftail )
d = d - > deftail ; // skip the elements
2004-09-07 18:16:59 +00:00
break ;
case ev_string :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t string_t \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_function :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t func_t \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_entity :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
case ev_integer :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
default :
2015-04-21 04:12:00 +00:00
ADD_CRC ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
break ;
}
}
2015-04-21 04:12:00 +00:00
ADD_CRC ( " } entvars_t; \n \n " ) ;
2004-09-07 18:16:59 +00:00
2012-11-27 03:23:19 +00:00
/*
2004-09-07 18:16:59 +00:00
///temp
2015-04-21 04:12:00 +00:00
ADD_ONLY ( " //with this the crc isn't needed for fields. \n #ifdef FIELDSSTRUCT \n struct fieldvars_s { \n \t int ofs; \n \t int type; \n \t char *name; \n } fieldvars[] = { \n " ) ;
2004-09-07 18:16:59 +00:00
f = 0 ;
for ( d = pr . def_head . next ; d ; d = d - > next )
{
if ( ! strcmp ( d - > name , " end_sys_fields " ) )
break ;
if ( d - > type - > type ! = ev_field )
continue ;
if ( f )
2015-04-21 04:12:00 +00:00
ADD_ONLY ( " , \n " ) ;
ADD_ONLY ( qcva ( " \t {%i, \t %i, \t \" %s \" } " , G_INT ( d - > ofs ) , d - > type - > aux_type - > type , d - > name ) ) ;
2004-09-07 18:16:59 +00:00
f = 1 ;
}
2015-04-21 04:12:00 +00:00
ADD_ONLY ( " \n }; \n #endif \n \n " ) ;
2004-09-07 18:16:59 +00:00
//end temp
2012-11-27 03:23:19 +00:00
*/
2004-09-07 18:16:59 +00:00
2015-04-21 04:12:00 +00:00
ADD_ONLY ( qcva ( " #define PROGHEADER_CRC %i \n " , crc ) ) ;
2004-09-07 18:16:59 +00:00
if ( QCC_CheckParm ( " -progdefs " ) )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " writing %s \n " , filename ) ;
2005-02-09 19:32:30 +00:00
f = SafeOpenWrite ( filename , 16384 ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( f , file , strlen ( file ) ) ;
SafeClose ( f ) ;
}
if ( ForcedCRC )
2005-03-01 15:36:23 +00:00
crc = ForcedCRC ;
2004-09-07 18:16:59 +00:00
return crc ;
}
/*void QCC_PrintFunction (char *name)
{
int i ;
QCC_dstatement_t * ds ;
QCC_dfunction_t * df ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < numfunctions ; i + + )
if ( ! strcmp ( name , strings + functions [ i ] . s_name ) )
break ;
if ( i = = numfunctions )
QCC_Error ( ERR_NOFUNC , " No function named \" %s \" " , name ) ;
2011-05-15 13:23:13 +00:00
df = functions + i ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Statements for function %s: \n " , name ) ;
2004-09-07 18:16:59 +00:00
ds = statements + df - > first_statement ;
while ( 1 )
{
QCC_PR_PrintStatement ( ds ) ;
if ( ! ds - > op )
break ;
ds + + ;
}
} */
/*
void QCC_PrintOfs ( unsigned int ofs )
{
int i ;
bool printfunc ;
QCC_dstatement_t * ds ;
QCC_dfunction_t * df ;
for ( i = 0 ; i < numfunctions ; i + + )
{
df = functions + i ;
ds = statements + df - > first_statement ;
printfunc = false ;
while ( 1 )
{
if ( ! ds - > op )
break ;
if ( ds - > a = = ofs | | ds - > b = = ofs | | ds - > c = = ofs )
{
QCC_PR_PrintStatement ( ds ) ;
printfunc = true ;
}
ds + + ;
}
if ( printfunc )
{
QCC_PrintFunction ( strings + functions [ i ] . s_name ) ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " \n \n " ) ;
2004-09-07 18:16:59 +00:00
}
}
}
*/
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
DIRECTORY COPYING / PACKFILE CREATION
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
2018-10-11 10:31:23 +00:00
static packfile_t pfiles [ 4096 ] , * pf ;
static int packhandle ;
static int packbytes ;
2004-09-07 18:16:59 +00:00
/*
= = = = = = = = = = =
PackFile
Copy a file into the pak file
= = = = = = = = = = =
*/
2018-10-11 10:31:23 +00:00
static void QCC_PackFile ( char * src , char * name )
2004-09-07 18:16:59 +00:00
{
2018-01-23 01:22:29 +00:00
size_t remaining ;
2004-09-07 18:16:59 +00:00
# if 1
char * f ;
# else
2011-05-15 13:23:13 +00:00
int in ;
2004-09-07 18:16:59 +00:00
int count ;
char buf [ 4096 ] ;
# endif
2011-05-15 13:23:13 +00:00
2020-06-27 19:32:49 +00:00
if ( ( pbyte * ) pf - ( pbyte * ) pfiles > sizeof ( pfiles ) )
2004-09-07 18:16:59 +00:00
QCC_Error ( ERR_TOOMANYPAKFILES , " Too many files in pak file " ) ;
# if 1
2018-01-22 19:18:04 +00:00
f = FS_ReadToMem ( src , & remaining ) ;
2004-09-07 18:16:59 +00:00
if ( ! f )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %64s : %7s \n " , name , " " ) ;
2004-09-07 18:16:59 +00:00
// QCC_Error("Failed to open file %s", src);
return ;
}
2005-05-22 13:42:10 +00:00
pf - > filepos = PRLittleLong ( SafeSeek ( packhandle , 0 , SEEK_CUR ) ) ;
pf - > filelen = PRLittleLong ( remaining ) ;
2004-09-07 18:16:59 +00:00
strcpy ( pf - > name , name ) ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %64s : %7u \n " , pf - > name , ( unsigned int ) remaining ) ;
2004-09-07 18:16:59 +00:00
packbytes + = remaining ;
SafeWrite ( packhandle , f , remaining ) ;
FS_CloseFromMem ( f ) ;
# else
in = SafeOpenRead ( src ) ;
remaining = filelength ( in ) ;
2005-05-22 13:42:10 +00:00
pf - > filepos = PRLittleLong ( lseek ( packhandle , 0 , SEEK_CUR ) ) ;
pf - > filelen = PRLittleLong ( remaining ) ;
2004-09-07 18:16:59 +00:00
strcpy ( pf - > name , name ) ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %64s : %7u \n " , pf - > name , ( unsigned int ) remaining ) ;
2004-09-07 18:16:59 +00:00
packbytes + = remaining ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
while ( remaining )
{
if ( remaining < sizeof ( buf ) )
count = remaining ;
else
count = sizeof ( buf ) ;
SafeRead ( in , buf , count ) ;
SafeWrite ( packhandle , buf , count ) ;
remaining - = count ;
}
close ( in ) ;
# endif
pf + + ;
}
/*
= = = = = = = = = = =
CopyFile
Copies a file , creating any directories needed
= = = = = = = = = = =
*/
2018-10-11 10:31:23 +00:00
static void QCC_CopyFile ( char * src , char * dest )
2004-09-07 18:16:59 +00:00
{
/*
int in , out ;
int remaining , count ;
char buf [ 4096 ] ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
print ( " %s to %s \n " , src , dest ) ;
in = SafeOpenRead ( src ) ;
remaining = filelength ( in ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
QCC_CreatePath ( dest ) ;
out = SafeOpenWrite ( dest , remaining + 10 ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
while ( remaining )
{
if ( remaining < sizeof ( buf ) )
count = remaining ;
else
count = sizeof ( buf ) ;
SafeRead ( in , buf , count ) ;
SafeWrite ( out , buf , count ) ;
remaining - = count ;
}
close ( in ) ;
2011-05-15 13:23:13 +00:00
SafeClose ( out ) ;
2004-09-07 18:16:59 +00:00
*/
}
/*
= = = = = = = = = = =
CopyFiles
= = = = = = = = = = =
*/
2018-10-11 10:31:23 +00:00
static void _QCC_CopyFiles ( int blocknum , int copytype , char * srcdir , char * destdir )
2004-09-07 18:16:59 +00:00
{
int i ;
int dirlen ;
unsigned short crc ;
packheader_t header ;
char name [ 1024 ] ;
char srcfile [ 1024 ] , destfile [ 1024 ] ;
packbytes = 0 ;
if ( copytype = = 2 )
{
pf = pfiles ;
packhandle = SafeOpenWrite ( destdir , 1024 * 1024 ) ;
SafeWrite ( packhandle , & header , sizeof ( header ) ) ;
}
for ( i = 0 ; i < numsounds ; i + + )
{
2013-03-12 22:35:33 +00:00
if ( precache_sound [ i ] . block ! = blocknum )
2011-05-15 13:23:13 +00:00
continue ;
2013-03-12 22:35:33 +00:00
sprintf ( srcfile , " %s%s " , srcdir , precache_sound [ i ] . name ) ;
sprintf ( destfile , " %s%s " , destdir , precache_sound [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
if ( copytype = = 1 )
QCC_CopyFile ( srcfile , destfile ) ;
else
2013-03-12 22:35:33 +00:00
QCC_PackFile ( srcfile , precache_sound [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
}
for ( i = 0 ; i < nummodels ; i + + )
{
2013-03-12 22:35:33 +00:00
if ( precache_model [ i ] . block ! = blocknum )
2004-09-07 18:16:59 +00:00
continue ;
2013-03-12 22:35:33 +00:00
sprintf ( srcfile , " %s%s " , srcdir , precache_model [ i ] . name ) ;
sprintf ( destfile , " %s%s " , destdir , precache_model [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
if ( copytype = = 1 )
QCC_CopyFile ( srcfile , destfile ) ;
else
2013-03-12 22:35:33 +00:00
QCC_PackFile ( srcfile , precache_model [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
}
for ( i = 0 ; i < numtextures ; i + + )
{
2013-03-12 22:35:33 +00:00
if ( precache_texture [ i ] . block ! = blocknum )
2004-09-07 18:16:59 +00:00
continue ;
{
2013-03-12 22:35:33 +00:00
sprintf ( name , " %s " , precache_texture [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
sprintf ( srcfile , " %s%s " , srcdir , name ) ;
sprintf ( destfile , " %s%s " , destdir , name ) ;
if ( copytype = = 1 )
QCC_CopyFile ( srcfile , destfile ) ;
else
QCC_PackFile ( srcfile , name ) ;
}
{
2013-03-12 22:35:33 +00:00
sprintf ( name , " %s.bmp " , precache_texture [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
sprintf ( srcfile , " %s%s " , srcdir , name ) ;
sprintf ( destfile , " %s%s " , destdir , name ) ;
if ( copytype = = 1 )
QCC_CopyFile ( srcfile , destfile ) ;
else
QCC_PackFile ( srcfile , name ) ;
}
{
2013-03-12 22:35:33 +00:00
sprintf ( name , " %s.tga " , precache_texture [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
sprintf ( srcfile , " %s%s " , srcdir , name ) ;
sprintf ( destfile , " %s%s " , destdir , name ) ;
if ( copytype = = 1 )
QCC_CopyFile ( srcfile , destfile ) ;
else
QCC_PackFile ( srcfile , name ) ;
}
}
for ( i = 0 ; i < numfiles ; i + + )
{
2013-03-12 22:35:33 +00:00
if ( precache_file [ i ] . block ! = blocknum )
2004-09-07 18:16:59 +00:00
continue ;
2013-03-12 22:35:33 +00:00
sprintf ( srcfile , " %s%s " , srcdir , precache_file [ i ] . name ) ;
sprintf ( destfile , " %s%s " , destdir , precache_file [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
if ( copytype = = 1 )
QCC_CopyFile ( srcfile , destfile ) ;
else
2013-03-12 22:35:33 +00:00
QCC_PackFile ( srcfile , precache_file [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
}
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
if ( copytype = = 2 )
{
header . id [ 0 ] = ' P ' ;
header . id [ 1 ] = ' A ' ;
header . id [ 2 ] = ' C ' ;
header . id [ 3 ] = ' K ' ;
2020-06-27 19:32:49 +00:00
dirlen = ( pbyte * ) pf - ( pbyte * ) pfiles ;
2005-05-22 13:42:10 +00:00
header . dirofs = PRLittleLong ( SafeSeek ( packhandle , 0 , SEEK_CUR ) ) ;
header . dirlen = PRLittleLong ( dirlen ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
SafeWrite ( packhandle , pfiles , dirlen ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
SafeSeek ( packhandle , 0 , SEEK_SET ) ;
SafeWrite ( packhandle , & header , sizeof ( header ) ) ;
2011-05-15 13:23:13 +00:00
SafeClose ( packhandle ) ;
2004-09-07 18:16:59 +00:00
// do a crc of the file
QCC_CRC_Init ( & crc ) ;
for ( i = 0 ; i < dirlen ; i + + )
2020-06-27 19:32:49 +00:00
QCC_CRC_ProcessByte ( & crc , ( ( pbyte * ) pfiles ) [ i ] ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
i = pf - pfiles ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %i files packed in %i bytes (%i crc) \n " , i , packbytes , crc ) ;
2004-09-07 18:16:59 +00:00
}
}
2018-10-11 10:31:23 +00:00
static void QCC_CopyFiles ( void )
2004-09-07 18:16:59 +00:00
{
char * s ;
char srcdir [ 1024 ] , destdir [ 1024 ] ;
2011-05-15 13:23:13 +00:00
int p ;
2004-09-07 18:16:59 +00:00
2009-11-04 21:16:50 +00:00
if ( verbose )
{
if ( numsounds > 0 )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %3i unique precache_sounds \n " , numsounds ) ;
2009-11-04 21:16:50 +00:00
if ( nummodels > 0 )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %3i unique precache_models \n " , nummodels ) ;
2009-11-04 21:16:50 +00:00
if ( numtextures > 0 )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %3i unique precache_textures \n " , numtextures ) ;
2009-11-04 21:16:50 +00:00
if ( numfiles > 0 )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %3i unique precache_files \n " , numfiles ) ;
2009-11-04 21:16:50 +00:00
}
2004-09-07 18:16:59 +00:00
p = QCC_CheckParm ( " -copy " ) ;
if ( p & & p < myargc - 2 )
{ // create a new directory tree
strcpy ( srcdir , myargv [ p + 1 ] ) ;
strcpy ( destdir , myargv [ p + 2 ] ) ;
if ( srcdir [ strlen ( srcdir ) - 1 ] ! = ' / ' )
strcat ( srcdir , " / " ) ;
if ( destdir [ strlen ( destdir ) - 1 ] ! = ' / ' )
strcat ( destdir , " / " ) ;
_QCC_CopyFiles ( 0 , 1 , srcdir , destdir ) ;
return ;
}
2020-10-26 06:30:35 +00:00
for ( p = 0 ; p < countof ( QCC_Packname ) ; p + + )
2004-09-07 18:16:59 +00:00
{
2011-05-15 13:23:13 +00:00
s = QCC_Packname [ p ] ;
2004-09-07 18:16:59 +00:00
if ( ! * s )
continue ;
strcpy ( destdir , s ) ;
strcpy ( srcdir , " " ) ;
_QCC_CopyFiles ( p + 1 , 2 , srcdir , destdir ) ;
}
return ;
/*
blocknum = 1 ;
p = QCC_CheckParm ( " -pak2 " ) ;
if ( p & & p < myargc - 2 )
blocknum = 2 ;
else
p = QCC_CheckParm ( " -pak " ) ;
if ( p & & p < myargc - 2 )
{ // create a pak file
strcpy ( srcdir , myargv [ p + 1 ] ) ;
strcpy ( destdir , myargv [ p + 2 ] ) ;
if ( srcdir [ strlen ( srcdir ) - 1 ] ! = ' / ' )
strcat ( srcdir , " / " ) ;
DefaultExtension ( destdir , " .pak " ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
copytype = 2 ;
_QCC_CopyFiles ( blocknum , copytype , srcdir , destdir ) ;
}
*/
}
//============================================================================
2016-09-08 19:04:35 +00:00
# ifdef _WIN32
# define WINDOWSARG(x) x
# else
# define WINDOWSARG(x) false
# endif
2004-09-07 18:16:59 +00:00
2020-09-11 01:18:32 +00:00
pbool QCC_RegisterSourceFile ( const char * filename )
{
int i ;
for ( i = 0 ; i < numsourcefiles ; i + + )
{
if ( ! strcmp ( sourcefileslist [ i ] , filename ) )
return true ;
}
if ( numsourcefiles < MAXSOURCEFILESLIST )
{
strcpy ( sourcefileslist [ numsourcefiles + + ] , filename ) ;
return true ;
}
return false ;
}
2018-10-11 10:31:23 +00:00
static void QCC_PR_CommandLinePrecompilerOptions ( void )
2004-09-07 18:16:59 +00:00
{
CompilerConstant_t * cnst ;
------------------------------------------------------------------------
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
int i , j , p ;
2019-01-20 01:00:18 +00:00
const char * name , * val ;
------------------------------------------------------------------------
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
pbool werror = false ;
2013-06-13 22:45:15 +00:00
qcc_nopragmaoptimise = false ;
2004-09-07 18:16:59 +00:00
for ( i = 1 ; i < myargc ; i + + )
{
2016-09-08 19:04:35 +00:00
if ( ! strcmp ( myargv [ i ] , " -v " ) )
verbose + + ; //verbose
else if ( ! strcmp ( myargv [ i ] , " -srcfile " ) )
{
if ( + + i = = myargc )
break ;
2020-09-11 01:18:32 +00:00
if ( ! QCC_RegisterSourceFile ( myargv [ i ] ) )
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " too many -srcfile arguments " ) ;
2016-09-08 19:04:35 +00:00
}
else if ( ! strcmp ( myargv [ i ] , " -src " ) )
{
i + + ;
strcpy ( qccmsourcedir , myargv [ i ] ) ;
strcat ( qccmsourcedir , " / " ) ;
}
else if ( ! strcmp ( myargv [ i ] , " -o " ) )
2017-08-14 16:38:44 +00:00
{ //explicit output file
i + + ;
strcpy ( destfile , myargv [ i ] ) ;
2022-08-08 22:45:19 +00:00
if ( ! destfile_explicit )
verbose - - ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
destfile_explicit = true ;
2017-08-14 16:38:44 +00:00
}
else if ( ! strncmp ( myargv [ i ] , " -o " , 2 ) )
{ //explicit output file
strcpy ( destfile , myargv [ i ] + 2 ) ;
2022-08-08 22:45:19 +00:00
if ( ! destfile_explicit )
verbose - - ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
destfile_explicit = true ;
2017-08-14 16:38:44 +00:00
}
2016-09-08 19:04:35 +00:00
else if ( ! strcmp ( myargv [ i ] , " -qc " ) )
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Argument %s is experimental " , myargv [ i ] ) ; //compile without linking. output cannot be read by engines.
2018-10-11 10:31:23 +00:00
else if ( ! strcmp ( myargv [ i ] , " -E " ) )
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Argument %s is experimental " , myargv [ i ] ) ; //preprocess only
2016-09-08 19:04:35 +00:00
else if ( ! strcmp ( myargv [ i ] , " -progdefs " ) )
; //write progdefs.h
else if ( ! strcmp ( myargv [ i ] , " -copy " ) )
; //copy files / write pak files
else if ( ! strcmp ( myargv [ i ] , " -bspmodels " ) )
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Argument %s is not supported " , myargv [ i ] ) ;
2016-09-08 19:04:35 +00:00
else if ( ! strcmp ( myargv [ i ] , " -h2 " ) | | ! strcmp ( myargv [ i ] , " -fteh2 " ) | | ! strcmp ( myargv [ i ] , " -fte " ) | | ! strcmp ( myargv [ i ] , " -dp " ) )
; //various targets
else if ( ! strcmp ( myargv [ i ] , " -pak " ) | | ! strcmp ( myargv [ i ] , " -pak2 " ) )
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Argument %s is not supported " , myargv [ i ] ) ;
2016-09-08 19:04:35 +00:00
else
2004-09-07 18:16:59 +00:00
//compiler constant
if ( ! strncmp ( myargv [ i ] , " -D " , 2 ) )
{
name = myargv [ i ] + 2 ;
val = strchr ( name , ' = ' ) ;
if ( val )
{
2019-01-20 01:00:18 +00:00
char * t = malloc ( val - name + 1 ) ;
memcpy ( t , name , val - name ) ;
t [ val - name ] = 0 ;
cnst = QCC_PR_DefineName ( t ) ;
free ( t ) ;
2004-09-07 18:16:59 +00:00
val + + ;
}
2019-01-20 01:00:18 +00:00
else
cnst = QCC_PR_DefineName ( name ) ;
2004-09-07 18:16:59 +00:00
if ( val )
{
2010-07-03 21:49:48 +00:00
cnst - > value = qccHunkAlloc ( strlen ( val ) + 1 ) ;
memcpy ( cnst - > value , val , strlen ( val ) + 1 ) ;
2004-09-07 18:16:59 +00:00
}
}
2016-02-10 23:23:43 +00:00
else if ( ! strncmp ( myargv [ i ] , " -I " , 2 ) )
{
name = myargv [ i ] + 2 ;
if ( ! * name & & i + 1 < myargc )
name = myargv [ + + i ] ;
QCC_PR_AddIncludePath ( name ) ;
}
2004-09-07 18:16:59 +00:00
//optimisations.
2016-09-08 19:04:35 +00:00
else if ( ! strnicmp ( myargv [ i ] , " -O " , 2 ) | | WINDOWSARG ( ! strnicmp ( myargv [ i ] , " /O " , 2 ) ) )
2004-09-07 18:16:59 +00:00
{
2013-06-13 22:45:15 +00:00
qcc_nopragmaoptimise = true ;
2004-09-20 23:25:38 +00:00
p = 0 ;
2004-09-07 18:16:59 +00:00
if ( myargv [ i ] [ 2 ] > = ' 0 ' & & myargv [ i ] [ 2 ] < = ' 3 ' )
{
}
2017-10-31 22:52:58 +00:00
else
2004-09-07 18:16:59 +00:00
{
2019-01-20 01:00:18 +00:00
const char * a = myargv [ i ] + 2 ;
2017-10-31 22:52:58 +00:00
pbool state = true ;
if ( ! strnicmp ( a , " no- " , 3 ) )
2004-09-22 15:31:19 +00:00
{
2017-10-31 22:52:58 +00:00
a + = 3 ;
state = false ;
}
for ( p = 0 ; optimisations [ p ] . enabled ; p + + )
{
if ( ( * optimisations [ p ] . abbrev & & ! stricmp ( a , optimisations [ p ] . abbrev ) ) | | ! stricmp ( a , optimisations [ p ] . fullname ) )
2004-09-22 15:31:19 +00:00
{
2017-10-31 22:52:58 +00:00
* optimisations [ p ] . enabled = state ;
break ;
2004-09-22 15:31:19 +00:00
}
}
2017-10-31 22:52:58 +00:00
if ( ! optimisations [ p ] . enabled )
{
if ( ! stricmp ( a , " overlap-locals " ) )
opt_locals_overlapping = state ;
else
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Unrecognised optimisation parameter (%s) " , myargv [ i ] ) ;
2017-10-31 22:52:58 +00:00
}
2004-09-07 18:16:59 +00:00
}
}
2011-05-15 13:23:13 +00:00
2016-09-08 19:04:35 +00:00
else if ( ! strnicmp ( myargv [ i ] , " -K " , 2 ) | | WINDOWSARG ( ! strnicmp ( myargv [ i ] , " /K " , 2 ) ) )
2004-09-07 18:16:59 +00:00
{
2004-09-20 23:25:38 +00:00
p = 0 ;
2004-09-07 18:16:59 +00:00
if ( ! strnicmp ( myargv [ i ] + 2 , " no- " , 3 ) )
{
for ( p = 0 ; compiler_flag [ p ] . enabled ; p + + )
2005-02-28 07:16:19 +00:00
if ( ! stricmp ( myargv [ i ] + 5 , compiler_flag [ p ] . abbrev ) )
2004-09-07 18:16:59 +00:00
{
* compiler_flag [ p ] . enabled = false ;
break ;
}
}
else
{
for ( p = 0 ; compiler_flag [ p ] . enabled ; p + + )
2005-02-28 07:16:19 +00:00
if ( ! stricmp ( myargv [ i ] + 2 , compiler_flag [ p ] . abbrev ) )
2004-09-07 18:16:59 +00:00
{
* compiler_flag [ p ] . enabled = true ;
break ;
}
}
if ( ! compiler_flag [ p ] . enabled )
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Unrecognised keyword parameter (%s) " , myargv [ i ] ) ;
2004-09-07 18:16:59 +00:00
}
2017-08-14 16:38:44 +00:00
else if ( ! strnicmp ( myargv [ i ] , " -std= " , 5 ) )
{
for ( p = 0 ; compiler_flag [ p ] . enabled ; p + + )
{
if ( compiler_flag [ p ] . flags & FLAG_ASDEFAULT )
* compiler_flag [ p ] . enabled = true ;
else
* compiler_flag [ p ] . enabled = false ;
}
2023-01-09 05:13:12 +00:00
if ( ! stricmp ( myargv [ i ] + 5 , " C " ) | | ! stricmp ( myargv [ i ] + 5 , " c++ " ) | | ! stricmp ( myargv [ i ] + 5 , " c89 " ) | | ! stricmp ( myargv [ i ] + 5 , " c90 " ) | | ! stricmp ( myargv [ i ] + 5 , " c99 " ) | | ! stricmp ( myargv [ i ] + 5 , " c11 " ) | | ! stricmp ( myargv [ i ] + 5 , " c17 " ) )
2020-07-13 17:48:16 +00:00
{ //set up for greatest C compatibility... variations from C are bugs, not features.
keyword_asm = false ;
keyword_break = keyword_continue = keyword_for = keyword_goto = keyword_const = keyword_extern = keyword_static = true ;
keyword_switch = keyword_case = keyword_default = true ;
keyword_accessor = keyword_class = keyword_var = keyword_inout = keyword_optional = keyword_state = keyword_inline = keyword_nosave = keyword_shared = keyword_noref = keyword_unused = keyword_used = keyword_nonstatic = keyword_ignore = keyword_strip = false ;
keyword_vector = keyword_entity = keyword_float = keyword_string = false ; //not to be confused with actual types, but rather the absence of the keyword local.
keyword_integer = keyword_enumflags = false ;
keyword_float = keyword_int = keyword_typedef = keyword_struct = keyword_union = keyword_enum = true ;
2020-10-06 03:17:28 +00:00
keyword_double = keyword_long = keyword_short = keyword_char = keyword_signed = keyword_unsigned = true ;
2020-07-13 17:48:16 +00:00
keyword_thinktime = keyword_until = keyword_loop = false ;
keyword_integer = true ;
opt_logicops = true ; //early out like C.
flag_assumevar = true ; //const only if explicitly const.
pr_subscopedlocals = true ; //locals shadow other locals rather than being the same one.
flag_cpriority = true ; //fiddle with operator precedence.
2020-09-29 07:09:01 +00:00
flag_assume_integer = true ; //unqualified numeric constants are assumed to be ints, consistent with C.
flag_assume_double = true ; //and any immediates with a decimal points are assumed to be doubles, consistent with C.
flag_qcfuncs = false ;
2021-07-03 01:47:16 +00:00
flag_macroinstrings = false ;
2020-07-13 17:48:16 +00:00
qccwarningaction [ WARN_UNINITIALIZED ] = WA_WARN ; //C doesn't like that, might as well warn here too.
qccwarningaction [ WARN_TOOMANYPARAMS ] = WA_ERROR ; //too many args to function is weeeeird.
qccwarningaction [ WARN_TOOFEWPARAMS ] = WA_ERROR ; //missing args should be fatal.
qccwarningaction [ WARN_ASSIGNMENTTOCONSTANT ] = WA_ERROR ; //const is const. at least its not const by default.
qccwarningaction [ WARN_SAMENAMEASGLOBAL ] = WA_IGNORE ; //shadowing of globals.
2020-09-29 07:09:01 +00:00
2023-01-09 05:13:12 +00:00
if ( ! stricmp ( myargv [ i ] + 5 , " c++ " ) )
{
keyword_class = /*keyword_new =*/ keyword_inline = true ;
cnst = QCC_PR_DefineName ( " __cplusplus " ) ;
val = NULL ;
}
else if ( ! stricmp ( myargv [ i ] + 5 , " c89 " ) | | ! stricmp ( myargv [ i ] + 5 , " c90 " ) )
2020-09-29 07:09:01 +00:00
val = " 199409L " ; //it was ammended, apparently.
else if ( ! stricmp ( myargv [ i ] + 5 , " c99 " ) )
val = " 199901L " ;
else if ( ! stricmp ( myargv [ i ] + 5 , " c11 " ) )
val = " 201112L " ;
else if ( ! stricmp ( myargv [ i ] + 5 , " c17 " ) )
val = " 201710L " ;
else
val = NULL ;
cnst = QCC_PR_DefineName ( " __STDC_VERSION__ " ) ;
if ( val )
{
cnst - > value = qccHunkAlloc ( strlen ( val ) + 1 ) ;
memcpy ( cnst - > value , val , strlen ( val ) + 1 ) ;
}
2020-07-13 17:48:16 +00:00
}
else if ( ! strcmp ( myargv [ i ] + 5 , " qccx " ) )
2017-10-12 12:02:25 +00:00
{
flag_qccx = true ; //fixme: extra stuff
qccwarningaction [ WARN_DENORMAL ] = WA_IGNORE ; //this is just too spammy
qccwarningaction [ WARN_LAXCAST ] = WA_IGNORE ; //more plausable, but still too spammy. easier to fix at least.
}
else if ( ! strcmp ( myargv [ i ] + 5 , " preqcc " ) )
{
flag_hashonly = true ;
2021-07-03 01:47:16 +00:00
flag_macroinstrings = true ;
2017-10-12 12:02:25 +00:00
}
else if ( ! strcmp ( myargv [ i ] + 5 , " reacc " ) )
{
flag_acc = true ;
2021-07-03 01:47:16 +00:00
flag_macroinstrings = false ;
2017-10-12 12:02:25 +00:00
}
2018-05-21 13:47:53 +00:00
else if ( ! strcmp ( myargv [ i ] + 5 , " frikqcc " ) )
2021-07-03 01:47:16 +00:00
{
2018-05-21 13:47:53 +00:00
keyword_state = true ;
2021-07-03 01:47:16 +00:00
flag_macroinstrings = false ;
}
2017-10-12 12:02:25 +00:00
else if ( ! strcmp ( myargv [ i ] + 5 , " fteqcc " ) )
2017-08-14 16:38:44 +00:00
; //as above, its the default.
2018-08-18 13:33:50 +00:00
else if ( ! strcmp ( myargv [ i ] + 5 , " qcc " ) | | ! strcmp ( myargv [ i ] + 5 , " id " ) )
2017-08-14 16:38:44 +00:00
{
flag_ifvector = flag_vectorlogic = false ;
keyword_asm = keyword_break = keyword_continue = keyword_for = keyword_goto = false ;
keyword_const = keyword_var = keyword_inout = keyword_optional = keyword_state = keyword_inline = keyword_nosave = keyword_extern = keyword_shared = keyword_noref = keyword_unused = keyword_used = keyword_static = keyword_nonstatic = keyword_ignore = keyword_strip = false ;
2020-07-13 17:48:16 +00:00
keyword_switch = keyword_case = keyword_default = keyword_accessor = keyword_class = keyword_const = false ;
2017-08-14 16:38:44 +00:00
keyword_vector = keyword_entity = keyword_float = keyword_string = false ; //not to be confused with actual types, but rather the absence of the keyword local.
keyword_int = keyword_integer = keyword_typedef = keyword_struct = keyword_union = keyword_enum = keyword_enumflags = false ;
keyword_thinktime = keyword_until = keyword_loop = false ;
keyword_wrap = keyword_weak = false ;
2020-09-11 01:18:32 +00:00
qccwarningaction [ WARN_PARAMWITHNONAME ] = WA_ERROR ;
2017-08-14 16:38:44 +00:00
}
2018-08-18 13:33:50 +00:00
else if ( ! strcmp ( myargv [ i ] + 5 , " hcc " ) | | ! strcmp ( myargv [ i ] + 5 , " hexenc " ) )
{
flag_ifvector = flag_vectorlogic = false ;
2021-07-03 01:47:16 +00:00
flag_macroinstrings = false ;
2018-08-18 13:33:50 +00:00
keyword_asm = keyword_continue = keyword_for = keyword_goto = false ;
keyword_const = keyword_var = keyword_inout = keyword_optional = keyword_state = keyword_inline = keyword_nosave = keyword_extern = keyword_shared = keyword_noref = keyword_unused = keyword_used = keyword_static = keyword_nonstatic = keyword_ignore = keyword_strip = false ;
2020-07-13 17:48:16 +00:00
keyword_accessor = keyword_class = keyword_const = false ;
2018-08-18 13:33:50 +00:00
keyword_vector = keyword_entity = keyword_float = keyword_string = false ; //not to be confused with actual types, but rather the absence of the keyword local.
keyword_int = keyword_integer = keyword_typedef = keyword_struct = keyword_union = keyword_enum = keyword_enumflags = false ;
keyword_wrap = keyword_weak = false ;
keyword_thinktime = keyword_until = keyword_loop = true ;
keyword_switch = keyword_case = keyword_default = keyword_break = true ;
}
2017-08-14 16:38:44 +00:00
else if ( ! strcmp ( myargv [ i ] + 5 , " gmqcc " ) )
{
flag_ifvector = flag_vectorlogic = true ;
2017-10-31 22:52:58 +00:00
flag_dblstarexp = flag_attributes = flag_assumevar = pr_subscopedlocals = flag_cpriority = flag_allowuninit = true ;
2018-10-23 07:09:06 +00:00
flag_boundchecks = false ; //gmqcc doesn't support dynamic bound checks, so xonotic is buggy shite. we don't want to generate code that will crash.
2021-07-03 01:47:16 +00:00
flag_macroinstrings = false ;
2017-10-31 22:52:58 +00:00
opt_logicops = true ;
2018-10-23 07:09:06 +00:00
//we have to disable some of these warnings, because xonotic insists on using -Werror. use -Wextra to override.
qccwarningaction [ WARN_NOTREFERENCEDCONST ] = WA_IGNORE ; //gmqcc doesn't warn about function prototypes without any names
qccwarningaction [ WARN_CONSTANTCOMPARISON ] = WA_IGNORE ; //xonotic abuses this, and gmqcc doesn't warn.
qccwarningaction [ WARN_POINTLESSSTATEMENT ] = WA_IGNORE ; //so many macro expansions that we can't mute because of xonotic using an external preprocessor.
qccwarningaction [ WARN_OVERFLOW ] = WA_IGNORE ; //xonotic has data loss from implicit conversions too.
qccwarningaction [ WARN_STRICTTYPEMISMATCH ] = WA_IGNORE ; //gmqcc doesn't enforce checks on auxilliary types.
qccwarningaction [ WARN_PARAMWITHNONAME ] = WA_IGNORE ; //nor does it care if a parameter isn't named.
qccwarningaction [ WARN_IFSTRING_USED ] = WA_IGNORE ; //and many people would argue that this was a feature rather than a bug
qccwarningaction [ WARN_UNINITIALIZED ] = WA_IGNORE ; //all locals get 0-initialised anyway, and our checks are not quite up to scratch.
qccwarningaction [ WARN_GMQCC_SPECIFIC ] = WA_IGNORE ; //we shouldn't warn about gmqcc syntax when we're trying to be compatible with it. there's always -Wextra.
2020-09-11 01:18:32 +00:00
qccwarningaction [ WARN_SYSTEMCRC ] = WA_IGNORE ; //lameness
qccwarningaction [ WARN_SYSTEMCRC2 ] = WA_IGNORE ; //extra lameness
2021-07-03 01:47:16 +00:00
qccwarningaction [ WARN_ARGUMENTCHECK ] = WA_IGNORE ; //gmqcc is often used on DP mods, and DP is just too horrible to fix its problems. Also there's a good chance its using some undocumented/new thing.
2020-09-11 01:18:32 +00:00
qccwarningaction [ WARN_ASSIGNMENTTOCONSTANT ] = WA_ERROR ; //some sanity.
2017-08-14 16:38:44 +00:00
keyword_asm = false ;
keyword_inout = keyword_optional = keyword_state = keyword_inline = keyword_nosave = keyword_extern = keyword_shared = keyword_unused = keyword_used = keyword_nonstatic = keyword_ignore = keyword_strip = false ;
2020-07-13 17:48:16 +00:00
keyword_accessor = keyword_class = false ;
2017-08-14 16:38:44 +00:00
keyword_vector = keyword_entity = keyword_float = keyword_string = false ; //not to be confused with actual types, but rather the absence of the keyword local.
keyword_int = keyword_integer = keyword_struct = keyword_union = keyword_enum = keyword_enumflags = false ;
keyword_thinktime = keyword_until = keyword_loop = false ;
2017-10-31 22:52:58 +00:00
keyword_wrap = keyword_weak = false ;
2017-08-14 16:38:44 +00:00
keyword_enum = true ;
keyword_break = keyword_continue = keyword_for = keyword_goto = true ;
keyword_typedef = true ;
keyword_switch = keyword_case = keyword_default = true ;
keyword_const = keyword_var = keyword_static = keyword_noref = true ;
}
else
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Unrecognised std parameter (%s) " , myargv [ i ] ) ;
2017-08-14 16:38:44 +00:00
}
2023-04-01 12:59:07 +00:00
else if ( ! strnicmp ( myargv [ i ] , " -state-fps= " , 11 ) )
{
qcc_framerate = atof ( myargv [ i ] + 11 ) ;
}
2016-09-08 19:04:35 +00:00
else if ( ! strnicmp ( myargv [ i ] , " -F " , 2 ) | | WINDOWSARG ( ! strnicmp ( myargv [ i ] , " /F " , 2 ) ) )
2004-09-07 18:16:59 +00:00
{
2015-04-14 12:24:05 +00:00
pbool state ;
const char * arg ;
2004-09-20 23:25:38 +00:00
p = 0 ;
2004-09-07 18:16:59 +00:00
if ( ! strnicmp ( myargv [ i ] + 2 , " no- " , 3 ) )
{
2015-04-14 12:24:05 +00:00
arg = myargv [ i ] + 5 ;
state = false ;
2004-09-07 18:16:59 +00:00
}
else
{
2015-04-14 12:24:05 +00:00
arg = myargv [ i ] + 2 ;
state = true ;
2004-09-07 18:16:59 +00:00
}
2015-04-14 12:24:05 +00:00
for ( p = 0 ; compiler_flag [ p ] . enabled ; p + + )
if ( ! stricmp ( arg , compiler_flag [ p ] . abbrev ) )
{
* compiler_flag [ p ] . enabled = state ;
break ;
}
2004-09-07 18:16:59 +00:00
if ( ! compiler_flag [ p ] . enabled )
2015-04-14 12:24:05 +00:00
{
//compat flags.
if ( ! stricmp ( arg , " short-logic " ) )
opt_logicops = state ;
else if ( ! stricmp ( arg , " correct-logic " ) )
flag_ifvector = flag_vectorlogic = state ;
else if ( ! stricmp ( arg , " false-empty-strings " ) )
flag_ifstring = state ;
else if ( ! stricmp ( arg , " true-empty-strings " ) )
2015-08-02 11:36:46 +00:00
flag_brokenifstring = state ;
2023-04-01 12:59:07 +00:00
else if ( ! stricmp ( arg , " emulate-state " ) )
{
if ( qcc_framerate > 0 & & state )
; //already on, don't force if they already gave it an actual rate.
else
qcc_framerate = state ? 10 : 0 ;
}
2020-09-11 01:18:32 +00:00
else if ( ! stricmp ( arg , " arithmetic-exceptions " ) )
qccwarningaction [ WARN_DIVISIONBY0 ] = state ? WA_ERROR : WA_IGNORE ;
2017-10-31 22:52:58 +00:00
else if ( ! stricmp ( arg , " lno " ) )
2018-09-18 02:05:35 +00:00
{
//currently we always try to write lno files, when filename info isn't stripped
if ( opt_filenames )
{
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Disabling -Ofilenames to satisfy -flno request " ) ;
2018-09-18 02:05:35 +00:00
opt_filenames = false ;
}
}
2017-10-31 22:52:58 +00:00
else if ( ! stricmp ( arg , " return-assignments " ) )
; //should really be a warning instead
else if ( ! stricmp ( arg , " relaxed-switch " ) )
; //again should be a warning/werror
else if ( ! stricmp ( arg , " bail-on-werror " ) )
;
2015-04-14 12:24:05 +00:00
else
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Unrecognised flag parameter (%s) " , myargv [ i ] ) ;
2015-04-14 12:24:05 +00:00
}
2004-09-07 18:16:59 +00:00
}
2016-09-08 19:04:35 +00:00
else if ( ! strncmp ( myargv [ i ] , " -T " , 2 ) | | WINDOWSARG ( ! strncmp ( myargv [ i ] , " /T " , 2 ) ) )
2004-09-07 18:16:59 +00:00
{
2004-09-20 23:25:38 +00:00
p = 0 ;
2015-01-12 12:28:13 +00:00
if ( ! strcmp ( " parse " , myargv [ i ] + 2 ) )
parseonly = true ;
else
{
2020-07-13 17:48:16 +00:00
if ( ! QCC_OPCodeSetTargetName ( myargv [ i ] + 2 ) )
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Unrecognised target parameter (%s) " , myargv [ i ] ) ;
2015-01-12 12:28:13 +00:00
}
2004-09-07 18:16:59 +00:00
}
2016-09-08 19:04:35 +00:00
else if ( ! strnicmp ( myargv [ i ] , " -W " , 2 ) | | WINDOWSARG ( ! strnicmp ( myargv [ i ] , " /W " , 2 ) ) )
2004-09-07 18:16:59 +00:00
{
2019-01-20 01:00:18 +00:00
const char * a = myargv [ i ] + 2 ;
2017-10-31 22:52:58 +00:00
if ( ! stricmp ( a , " all " ) )
------------------------------------------------------------------------
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
{
for ( j = 0 ; j < ERR_PARSEERRORS ; j + + )
2013-09-26 14:36:52 +00:00
if ( qccwarningaction [ j ] = = WA_IGNORE )
{
2018-10-23 07:09:06 +00:00
switch ( j )
{
//these warnings do not get switched on with -Wall when using -std=gmqcc, because mods that use -Werror would screw up too much
case WARN_CONSTANTCOMPARISON :
case WARN_POINTLESSSTATEMENT :
case WARN_OVERFLOW :
case WARN_STRICTTYPEMISMATCH :
case WARN_PARAMWITHNONAME :
case WARN_IFSTRING_USED :
2023-01-09 05:13:12 +00:00
// case WARN_UNINITIALIZED:
2018-10-23 07:09:06 +00:00
case WARN_GMQCC_SPECIFIC :
2020-09-11 01:18:32 +00:00
case WARN_SYSTEMCRC :
case WARN_SYSTEMCRC2 :
2023-01-09 05:13:12 +00:00
if ( qccwarningaction [ WARN_GMQCC_SPECIFIC ] )
qccwarningaction [ j ] = WA_WARN ;
2018-10-23 07:09:06 +00:00
break ;
//these warnings require -Wextra to enable, as they're too annoying to have to fix
2020-09-08 04:44:07 +00:00
case WARN_NOTREFERENCEDCONST : //warning about every single constant is annoying as heck. note that this includes both stuff like MOVETYPE_ and builtins.
case WARN_EXTRAPRECACHE : //we can't guarentee that we can parse this correctly. this warning is thus a common false positive. its available with -Wextra, and there's intrinsics to reduce false positives.
case WARN_FTE_SPECIFIC : //kinda annoying when its actually valid code.
case WARN_MUTEDEPRECATEDVARIABLE : //these were explicitly muted by the user using checkbuiltin/etc to mute specific symbols.
2020-09-11 01:18:32 +00:00
case WARN_DIVISIONBY0 : //breaks xonotic, which seems to want nans.
2018-10-23 07:09:06 +00:00
break ;
default :
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
qccwarningaction [ j ] = WA_WARN ;
2018-10-23 07:09:06 +00:00
break ;
}
2013-09-26 14:36:52 +00:00
}
}
2017-10-31 22:52:58 +00:00
else if ( ! stricmp ( a , " extra " ) )
2013-09-26 14:36:52 +00:00
{
for ( j = 0 ; j < ERR_PARSEERRORS ; j + + )
if ( qccwarningaction [ j ] = = WA_IGNORE )
qccwarningaction [ j ] = WA_WARN ;
------------------------------------------------------------------------
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
}
2017-10-31 22:52:58 +00:00
else if ( ! stricmp ( a , " 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
{
for ( j = 0 ; j < ERR_PARSEERRORS ; j + + )
qccwarningaction [ j ] = WA_IGNORE ;
}
2017-10-31 22:52:58 +00:00
else if ( ! stricmp ( a , " error " ) )
------------------------------------------------------------------------
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
{
werror = true ;
}
2017-10-31 22:52:58 +00:00
else if ( ! stricmp ( a , " no-mundane " ) )
2005-09-28 16:57:10 +00:00
{ //disable mundane performance/efficiency/blah warnings that don't affect code.
------------------------------------------------------------------------
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
qccwarningaction [ WARN_SAMENAMEASGLOBAL ] = WA_IGNORE ;
qccwarningaction [ WARN_DUPLICATEDEFINITION ] = WA_IGNORE ;
qccwarningaction [ WARN_CONSTANTCOMPARISON ] = WA_IGNORE ;
qccwarningaction [ WARN_ASSIGNMENTINCONDITIONAL ] = WA_IGNORE ;
qccwarningaction [ WARN_DEADCODE ] = WA_IGNORE ;
qccwarningaction [ WARN_NOTREFERENCEDCONST ] = WA_IGNORE ;
qccwarningaction [ WARN_NOTREFERENCED ] = WA_IGNORE ;
qccwarningaction [ WARN_POINTLESSSTATEMENT ] = WA_IGNORE ;
qccwarningaction [ WARN_ASSIGNMENTTOCONSTANTFUNC ] = WA_IGNORE ;
qccwarningaction [ WARN_BADPRAGMA ] = WA_IGNORE ; //C specs say that these should be ignored. We're close enough to C that I consider that a valid statement.
qccwarningaction [ WARN_IDENTICALPRECOMPILER ] = WA_IGNORE ;
qccwarningaction [ WARN_UNDEFNOTDEFINED ] = WA_IGNORE ;
qccwarningaction [ WARN_EXTRAPRECACHE ] = WA_IGNORE ;
qccwarningaction [ WARN_CORRECTEDRETURNTYPE ] = WA_IGNORE ;
2013-03-12 22:32:25 +00:00
qccwarningaction [ WARN_NOTUTF8 ] = WA_IGNORE ;
2013-06-02 06:03:54 +00:00
qccwarningaction [ WARN_SELFNOTTHIS ] = WA_IGNORE ;
2005-09-28 16:57:10 +00:00
}
2004-09-07 18:16:59 +00:00
else
{
2017-10-31 22:52:58 +00:00
unsigned char action = WA_WARN ;
------------------------------------------------------------------------
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
p = - 1 ;
2017-10-31 22:52:58 +00:00
if ( ! strnicmp ( a , " error- " , 6 ) )
2004-09-07 18:16:59 +00:00
{
2017-10-31 22:52:58 +00:00
a + = 6 ;
action = WA_ERROR ;
------------------------------------------------------------------------
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
}
2017-10-31 22:52:58 +00:00
else if ( ! strnicmp ( a , " no- " , 3 ) )
2004-09-07 18:16:59 +00:00
{
2017-10-31 22:52:58 +00:00
a + = 3 ;
action = WA_IGNORE ;
2004-09-07 18:16:59 +00:00
}
2017-10-31 22:52:58 +00:00
p = QCC_WarningForName ( a ) ;
if ( p > = 0 )
qccwarningaction [ p ] = action ;
2020-09-08 04:44:07 +00:00
else
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Unrecognised warning parameter (%s) " , myargv [ i ] ) ;
2004-09-07 18:16:59 +00:00
}
}
2017-08-14 16:38:44 +00:00
else if ( ! strcmp ( myargv [ i ] , " -stdout " ) )
{
}
2020-05-29 10:27:43 +00:00
else if ( ! strcmp ( myargv [ i ] , " -log " ) | | ! strcmp ( myargv [ i ] , " -nolog " ) )
{
}
2020-07-15 23:50:30 +00:00
else if ( ! strcmp ( myargv [ i ] , " -max_regs " ) | | ! strcmp ( myargv [ i ] , " -max_strings " ) | | ! strcmp ( myargv [ i ] , " -max_globals " )
| | ! strcmp ( myargv [ i ] , " -max_fields " ) | | ! strcmp ( myargv [ i ] , " -max_statements " ) | | ! strcmp ( myargv [ i ] , " -max_functions " )
| | ! strcmp ( myargv [ i ] , " -max_types " ) | | ! strcmp ( myargv [ i ] , " -max_temps " ) | | ! strcmp ( myargv [ i ] , " -max_macros " ) )
{
2020-09-11 01:18:32 +00:00
if ( + + i = = myargc )
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Missing value for %s arg " , myargv [ - - i ] ) ;
2020-07-15 23:50:30 +00:00
}
2017-08-14 16:38:44 +00:00
else if ( ! strcmp ( myargv [ i ] , " --version " ) )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s \n " , QCC_VersionString ( ) ) ;
2017-08-14 16:38:44 +00:00
exit ( EXIT_SUCCESS ) ;
}
2016-09-08 19:04:35 +00:00
else if ( * myargv [ i ] = = ' - ' | | WINDOWSARG ( * myargv [ i ] = = ' / ' ) )
2020-07-15 23:50:30 +00:00
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " Unrecognised parameter (%s) " , myargv [ i ] ) ;
2017-08-14 16:38:44 +00:00
else
{
2020-09-11 01:18:32 +00:00
if ( ! QCC_RegisterSourceFile ( myargv [ i ] ) )
QCC_PR_Warning ( WARN_BADPARAMS , " cmdline " , 0 , " too many source filename arguments " ) ;
2017-08-14 16:38:44 +00:00
}
2004-09-07 18:16:59 +00:00
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
if ( werror )
{
for ( j = 0 ; j < ERR_PARSEERRORS ; j + + )
if ( qccwarningaction [ j ] )
qccwarningaction [ j ] = WA_ERROR ;
}
2004-09-07 18:16:59 +00:00
}
/*
= = = = = = = = = = = =
main
= = = = = = = = = = = =
*/
2017-05-23 07:03:07 +00:00
int qccmline ;
2004-09-07 18:16:59 +00:00
char * qccmsrc ;
2017-05-23 07:03:07 +00:00
//char *qccmsrc2;
2004-09-07 18:16:59 +00:00
char qccmfilename [ 1024 ] ;
2018-08-04 19:00:19 +00:00
char qccmprogsdat [ 1024 * 2 ] ;
2004-09-07 18:16:59 +00:00
void QCC_FinishCompile ( void ) ;
void SetEndian ( void ) ;
2018-10-11 10:31:23 +00:00
static void QCC_SetDefaultProperties ( void )
2004-09-07 18:16:59 +00:00
{
int level ;
int i ;
2015-04-14 12:24:05 +00:00
# ifdef _WIN32
# define FWDSLASHARGS 1
# else
# define FWDSLASHARGS 0
# endif
2005-02-09 19:32:30 +00:00
Hash_InitTable ( & compconstantstable , MAX_CONSTANTS , qccHunkAlloc ( Hash_BytesForBuckets ( MAX_CONSTANTS ) ) ) ;
2021-04-14 05:21:04 +00:00
qcc_framerate = 0 ; //depends on target (engine's OP_STATE)
2005-02-09 19:32:30 +00:00
ForcedCRC = 0 ;
2009-03-29 23:47:29 +00:00
defaultstatic = 0 ;
2022-08-08 22:45:19 +00:00
verbose = VERBOSE_PROGRESS ;
2016-09-08 19:04:35 +00:00
* qccmsourcedir = 0 ;
QCC_PR_CloseProcessor ( ) ;
2005-02-09 19:32:30 +00:00
2004-09-07 18:16:59 +00:00
QCC_PR_DefineName ( " FTEQCC " ) ;
2020-09-29 07:09:01 +00:00
QCC_PR_DefineName ( " __FTEQCC__ " ) ;
2004-09-07 18:16:59 +00:00
2015-04-14 12:24:05 +00:00
if ( ( FWDSLASHARGS & & QCC_CheckParm ( " /O0 " ) ) | | QCC_CheckParm ( " -O0 " ) )
2004-09-07 18:16:59 +00:00
level = 0 ;
2015-04-14 12:24:05 +00:00
else if ( ( FWDSLASHARGS & & QCC_CheckParm ( " /O1 " ) ) | | QCC_CheckParm ( " -O1 " ) )
2004-09-07 18:16:59 +00:00
level = 1 ;
2015-04-14 12:24:05 +00:00
else if ( ( FWDSLASHARGS & & QCC_CheckParm ( " /O2 " ) ) | | QCC_CheckParm ( " -O2 " ) )
2004-09-07 18:16:59 +00:00
level = 2 ;
2015-04-14 12:24:05 +00:00
else if ( ( FWDSLASHARGS & & QCC_CheckParm ( " /O3 " ) ) | | QCC_CheckParm ( " -O3 " ) )
2004-09-07 18:16:59 +00:00
level = 3 ;
else
level = - 1 ;
if ( level = = - 1 )
{
for ( i = 0 ; optimisations [ i ] . enabled ; i + + )
{
2005-02-28 07:16:19 +00:00
if ( optimisations [ i ] . flags & FLAG_ASDEFAULT )
2004-09-07 18:16:59 +00:00
* optimisations [ i ] . enabled = true ;
else
* optimisations [ i ] . enabled = false ;
}
}
else
{
for ( i = 0 ; optimisations [ i ] . enabled ; i + + )
{
if ( level > = optimisations [ i ] . optimisationlevel )
* optimisations [ i ] . enabled = true ;
else
* optimisations [ i ] . enabled = false ;
}
}
2020-07-13 17:48:16 +00:00
{ //FIXME: outdated, should be using -Tfte
2020-06-27 19:32:26 +00:00
qcc_targetformat_t targ ;
if ( QCC_CheckParm ( " -h2 " ) )
2020-07-01 05:32:21 +00:00
targ = QCF_HEXEN2 ;
2020-06-27 19:32:26 +00:00
else if ( QCC_CheckParm ( " -fte " ) )
targ = QCF_FTE ;
else if ( QCC_CheckParm ( " -fteh2 " ) )
targ = QCF_FTEH2 ;
else if ( QCC_CheckParm ( " -dp " ) )
targ = QCF_DARKPLACES ;
else
targ = QCF_STANDARD ;
2020-08-16 04:41:11 +00:00
QCC_OPCodeSetTarget ( targ , 0 ) ;
2020-06-27 19:32:26 +00:00
}
2004-09-07 18:16:59 +00:00
//enable all warnings
------------------------------------------------------------------------
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
for ( i = 0 ; i < ERR_PARSEERRORS ; i + + )
qccwarningaction [ i ] = WA_WARN ;
for ( ; i < WARN_MAX ; i + + )
qccwarningaction [ i ] = WA_ERROR ;
2004-09-07 18:16:59 +00:00
//play with default warnings.
2020-09-08 04:44:07 +00:00
qccwarningaction [ WARN_NOTREFERENCEDCONST ] = WA_IGNORE ;
qccwarningaction [ WARN_MACROINSTRING ] = WA_IGNORE ;
// qccwarningaction[WARN_ASSIGNMENTTOCONSTANT] = WA_IGNORE;
qccwarningaction [ WARN_EXTRAPRECACHE ] = WA_IGNORE ;
qccwarningaction [ WARN_DEADCODE ] = WA_IGNORE ;
qccwarningaction [ WARN_FTE_SPECIFIC ] = WA_IGNORE ;
2020-09-11 01:18:32 +00:00
qccwarningaction [ WARN_DIVISIONBY0 ] = WA_IGNORE ;
2020-09-08 04:44:07 +00:00
qccwarningaction [ WARN_MUTEDEPRECATEDVARIABLE ] = WA_IGNORE ;
qccwarningaction [ WARN_EXTENSION_USED ] = WA_IGNORE ;
qccwarningaction [ WARN_IFSTRING_USED ] = WA_IGNORE ;
qccwarningaction [ WARN_CORRECTEDRETURNTYPE ] = WA_IGNORE ;
qccwarningaction [ WARN_NOTUTF8 ] = WA_IGNORE ;
qccwarningaction [ WARN_UNINITIALIZED ] = WA_IGNORE ; //not sure about this being ignored by default.
qccwarningaction [ WARN_SELFNOTTHIS ] = WA_IGNORE ;
qccwarningaction [ WARN_EVILPREPROCESSOR ] = WA_ERROR ; //evil people do evil things. evil must be thwarted!
qccwarningaction [ WARN_IDENTICALPRECOMPILER ] = WA_IGNORE ;
qccwarningaction [ WARN_DENORMAL ] = WA_ERROR ; //DAZ provides a speedup on modern machines, so any engine compiled for sse2+ will have problems with denormals, so make their use look serious.
2004-09-07 18:16:59 +00:00
2020-07-01 05:32:21 +00:00
if ( qcc_targetformat = = QCF_HEXEN2 | | qcc_targetformat = = QCF_UHEXEN2 | | qcc_targetformat = = QCF_FTEH2 )
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
qccwarningaction [ WARN_CASEINSENSITIVEFRAMEMACRO ] = WA_IGNORE ; //hexenc consides these fair game.
2004-09-07 18:16:59 +00:00
2016-07-12 00:40:13 +00:00
if ( QCC_CheckParm ( " -Fqccx " ) )
{
qccwarningaction [ WARN_DENORMAL ] = WA_IGNORE ; //this is just too spammy
qccwarningaction [ WARN_LAXCAST ] = WA_IGNORE ; //more plausable, but still too spammy. easier to fix at least.
}
2004-09-07 18:16:59 +00:00
//Check the command line
QCC_PR_CommandLinePrecompilerOptions ( ) ;
2020-07-01 05:32:21 +00:00
if ( qcc_targetformat = = QCF_HEXEN2 | | qcc_targetformat = = QCF_UHEXEN2 | | qcc_targetformat = = QCF_FTEH2 ) //force on the thinktime keyword if hexen2 progs.
2013-07-31 00:28:22 +00:00
{
2017-04-18 11:12:17 +00:00
keyword_thinktime = true ; //thinktime self : 0.1;
keyword_until = true ; //until(cond) {code}; or do{code}until(cond);
keyword_loop = true ; //loop {code};
2013-07-31 00:28:22 +00:00
}
2004-09-07 18:16:59 +00:00
2015-04-14 12:24:05 +00:00
if ( ( FWDSLASHARGS & & QCC_CheckParm ( " /Debug " ) ) ) //disable any debug optimisations
2004-09-07 18:16:59 +00:00
{
for ( i = 0 ; optimisations [ i ] . enabled ; i + + )
{
2005-02-28 07:16:19 +00:00
if ( optimisations [ i ] . flags & FLAG_KILLSDEBUGGERS )
2004-09-07 18:16:59 +00:00
* optimisations [ i ] . enabled = false ;
}
}
}
2005-02-09 19:32:30 +00:00
//builds a list of files, pretends that they came from a progs.src
2014-03-30 08:55:06 +00:00
//FIXME: use sourcedir!
2018-10-11 10:31:23 +00:00
static int QCC_FindQCFiles ( const char * sourcedir )
2005-02-09 19:32:30 +00:00
{
# ifdef _WIN32
WIN32_FIND_DATA fd ;
HANDLE h ;
# endif
int numfiles = 0 , i , j ;
char * filelist [ 256 ] , * temp ;
qccmsrc = qccHunkAlloc ( 8192 ) ;
strcat ( qccmsrc , " progs.dat \n " ) ; //"#pragma PROGS_DAT progs.dat\n");
2014-03-30 08:55:06 +00:00
# if defined(_WIN32) && !defined(WINRT)
2005-02-09 19:32:30 +00:00
h = FindFirstFile ( " *.qc " , & fd ) ;
if ( h = = INVALID_HANDLE_VALUE )
return 0 ;
do
{
filelist [ numfiles ] = qccHunkAlloc ( strlen ( fd . cFileName ) + 1 ) ;
strcpy ( filelist [ numfiles ] , fd . cFileName ) ;
numfiles + + ;
} while ( FindNextFile ( h , & fd ) ! = 0 ) ;
FindClose ( h ) ;
# else
2018-10-11 10:31:23 +00:00
externs - > Printf ( " -Facc is not supported on this platform. Please make a progs.src file instead \n " ) ;
2005-02-09 19:32:30 +00:00
# endif
//Sort alphabetically.
//bubble. :(
for ( i = 0 ; i < numfiles - 1 ; i + + )
{
for ( j = i + 1 ; j < numfiles ; j + + )
{
if ( stricmp ( filelist [ i ] , filelist [ j ] ) > 0 )
{
temp = filelist [ j ] ;
filelist [ j ] = filelist [ i ] ;
filelist [ i ] = temp ;
}
}
}
for ( i = 0 ; i < numfiles ; i + + )
{
strcat ( qccmsrc , filelist [ i ] ) ;
strcat ( qccmsrc , " \n " ) ;
// strcat(qccmsrc, "#include \"");
// strcat(qccmsrc, filelist[i]);
// strcat(qccmsrc, "\"\n");
}
return numfiles ;
}
2015-07-06 14:47:46 +00:00
2018-10-13 06:20:49 +00:00
static pbool QCC_GenerateRelativePath ( char * dest , size_t destsize , char * base , char * relative )
2015-07-06 14:47:46 +00:00
{
int p ;
char * s1 , * s2 ;
2018-10-13 06:20:49 +00:00
if ( ! QC_strlcpy ( dest , base , destsize ) )
return false ;
2015-07-06 14:47:46 +00:00
s1 = strchr ( dest , ' \\ ' ) ;
s2 = strchr ( dest , ' / ' ) ;
if ( s2 > s1 )
s1 = s2 ;
if ( s1 )
* s1 = 0 ;
else
* dest = 0 ;
p = 0 ;
s2 = relative ;
for ( ; ; )
{
if ( ! strncmp ( s2 , " ./ " , 2 ) )
s2 + = 2 ;
else if ( ! strncmp ( s2 , " ../ " , 3 ) )
{
s2 + = 3 ;
p + + ;
}
else
break ;
}
for ( s1 = dest + strlen ( dest ) - 1 ; p & & s1 > = dest ; s1 - - )
{
if ( * s1 = = ' / ' | | * s1 = = ' \\ ' )
{
* s1 = ' \0 ' ;
p - - ;
}
}
if ( * dest )
{
if ( p )
{ //we were still looking for a separator, but didn't find one, so kill the entire path.
2018-10-13 06:20:49 +00:00
( void ) QC_strlcpy ( dest , " " , destsize ) ;
2015-07-06 14:47:46 +00:00
p - - ;
}
2018-10-13 06:20:49 +00:00
else if ( ! QC_strlcat ( dest , " / " , destsize ) )
return false ;
2015-07-06 14:47:46 +00:00
}
2018-10-13 06:20:49 +00:00
if ( ! QC_strlcat ( dest , s2 , destsize ) )
return false ;
2015-07-06 14:47:46 +00:00
2018-10-13 06:20:49 +00:00
while ( p > 0 )
2015-07-06 14:47:46 +00:00
{
2018-10-13 06:20:49 +00:00
if ( strlen ( dest ) + 3 > = destsize )
return false ;
2015-07-06 14:47:46 +00:00
memmove ( dest + 3 , dest , strlen ( dest ) + 1 ) ;
dest [ 0 ] = ' . ' ;
dest [ 1 ] = ' . ' ;
dest [ 2 ] = ' / ' ;
p - - ;
}
2018-10-13 06:20:49 +00:00
return true ;
2015-07-06 14:47:46 +00:00
}
2018-09-29 03:40:50 +00:00
const char * qcccol [ COL_MAX ] ;
2004-09-07 18:16:59 +00:00
int qcc_compileactive = false ;
2005-02-09 19:32:30 +00:00
extern int accglobalsblock ;
2005-07-28 15:52:31 +00:00
char * originalqccmsrc ; //for autoprototype.
2019-01-20 01:00:18 +00:00
pbool QCC_main ( int argc , const char * * argv ) //as part of the quake engine
2004-09-07 18:16:59 +00:00
{
2015-04-14 12:24:05 +00:00
extern int pr_bracelevel ;
------------------------------------------------------------------------
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
time_t long_time ;
2014-04-06 15:16:39 +00:00
extern QCC_type_t * pr_classtype ;
2004-09-07 18:16:59 +00:00
2018-01-23 01:22:29 +00:00
size_t p ;
2015-02-02 08:01:53 +00:00
extern int qccpersisthunk ;
2018-04-20 19:09:14 +00:00
const char * arg ;
2004-09-07 18:16:59 +00:00
char * s ;
2018-09-29 03:40:50 +00:00
//make sure any print colours are set up properly.
for ( p = 0 ; p < COL_MAX ; p + + )
if ( ! qcccol [ p ] )
qcccol [ p ] = " " ;
2016-09-08 19:04:35 +00:00
s_filen = " cmdline " ;
s_filed = 0 ;
pr_source_line = 0 ;
2014-05-30 03:57:30 +00:00
if ( numsourcefiles & & currentsourcefile = = numsourcefiles )
{
numsourcefiles = 0 ;
return false ;
}
2016-09-08 19:04:35 +00:00
else if ( ! numsourcefiles )
currentsourcefile = 0 ;
2014-05-30 03:57:30 +00:00
2015-02-02 08:01:53 +00:00
if ( currentsourcefile & & qccpersisthunk & & numsourcefiles )
QCC_PR_ResetErrorScope ( ) ; //don't clear the ram if we're retaining def info
else
{
memset ( sourcefilesdefs , 0 , sizeof ( sourcefilesdefs ) ) ;
sourcefilesnumdefs = 0 ;
if ( ! PreCompile ( ) )
return false ;
}
2014-05-30 03:57:30 +00:00
2005-05-22 13:42:10 +00:00
SetEndian ( ) ;
2004-09-07 18:16:59 +00:00
myargc = argc ;
myargv = argv ;
2013-03-12 22:32:25 +00:00
pr_scope = NULL ;
2014-04-06 15:16:39 +00:00
pr_classtype = NULL ;
2013-09-26 14:36:52 +00:00
locals_marshalled = 0 ;
2004-09-07 18:16:59 +00:00
qcc_compileactive = true ;
2005-02-09 19:32:30 +00:00
pHash_Get = & Hash_Get ;
pHash_GetNext = & Hash_GetNext ;
pHash_Add = & Hash_Add ;
2014-03-01 11:38:53 +00:00
pHash_RemoveData = & Hash_RemoveData ;
2005-02-09 19:32:30 +00:00
2011-09-03 03:49:43 +00:00
MAX_REGS = 1 < < 17 ;
2017-10-31 22:52:58 +00:00
MAX_STRINGS = 1 < < 21 ;
2011-09-03 03:49:43 +00:00
MAX_GLOBALS = 1 < < 17 ;
2017-10-31 22:52:58 +00:00
MAX_FIELDS = 1 < < 13 ;
2019-02-16 19:09:07 +00:00
MAX_STATEMENTS = 1 < < 20 ;
2017-10-31 22:52:58 +00:00
MAX_FUNCTIONS = 1 < < 15 ;
maxtypeinfos = 1 < < 16 ;
MAX_CONSTANTS = 1 < < 12 ;
2004-09-07 18:16:59 +00:00
2017-10-12 12:02:25 +00:00
strcpy ( destfile , " " ) ;
2005-02-28 07:16:19 +00:00
compressoutput = 0 ;
2018-04-20 19:09:14 +00:00
if ( ( arg = QCC_ReadParm ( " -max_regs " ) ) )
MAX_REGS = max ( 100 , atoi ( arg ) ) ;
if ( ( arg = QCC_ReadParm ( " -max_strings " ) ) )
MAX_STRINGS = max ( 100 , atoi ( arg ) ) ;
if ( ( arg = QCC_ReadParm ( " -max_globals " ) ) )
MAX_GLOBALS = max ( 64 , atoi ( arg ) ) ;
if ( ( arg = QCC_ReadParm ( " -max_fields " ) ) )
MAX_FIELDS = max ( 0 , atoi ( arg ) ) ;
if ( ( arg = QCC_ReadParm ( " -max_statements " ) ) )
MAX_STATEMENTS = max ( 1 , atoi ( arg ) ) ;
if ( ( arg = QCC_ReadParm ( " -max_functions " ) ) )
MAX_FUNCTIONS = max ( 1 , atoi ( arg ) ) ;
if ( ( arg = QCC_ReadParm ( " -max_types " ) ) )
maxtypeinfos = max ( 100 , atoi ( arg ) ) ;
if ( ( arg = QCC_ReadParm ( " -max_temps " ) ) )
max_temps = max ( 100 , atoi ( arg ) ) ;
if ( ( arg = QCC_ReadParm ( " -max_macros " ) ) )
MAX_CONSTANTS = max ( 100 , atoi ( arg ) ) ;
//FIXME: strip this.
s = externs - > ReadFile ( " qcc.cfg " , QCC_LoadFileHunkAlloc , NULL , & p , false ) ;
2018-01-22 19:18:04 +00:00
if ( s )
2004-09-07 18:16:59 +00:00
{
while ( 1 )
{
s = QCC_COM_Parse ( s ) ;
if ( ! strcmp ( qcc_token , " MAX_REGS " ) )
{
s = QCC_COM_Parse ( s ) ;
MAX_REGS = atoi ( qcc_token ) ;
} else if ( ! strcmp ( qcc_token , " MAX_STRINGS " ) ) {
s = QCC_COM_Parse ( s ) ;
MAX_STRINGS = atoi ( qcc_token ) ;
} else if ( ! strcmp ( qcc_token , " MAX_GLOBALS " ) ) {
s = QCC_COM_Parse ( s ) ;
MAX_GLOBALS = atoi ( qcc_token ) ;
} else if ( ! strcmp ( qcc_token , " MAX_FIELDS " ) ) {
s = QCC_COM_Parse ( s ) ;
MAX_FIELDS = atoi ( qcc_token ) ;
} else if ( ! strcmp ( qcc_token , " MAX_STATEMENTS " ) ) {
s = QCC_COM_Parse ( s ) ;
MAX_STATEMENTS = atoi ( qcc_token ) ;
} else if ( ! strcmp ( qcc_token , " MAX_FUNCTIONS " ) ) {
s = QCC_COM_Parse ( s ) ;
MAX_FUNCTIONS = atoi ( qcc_token ) ;
} else if ( ! strcmp ( qcc_token , " MAX_TYPES " ) ) {
s = QCC_COM_Parse ( s ) ;
2011-05-15 13:23:13 +00:00
maxtypeinfos = atoi ( qcc_token ) ;
2004-09-07 18:16:59 +00:00
} else if ( ! strcmp ( qcc_token , " MAX_TEMPS " ) ) {
s = QCC_COM_Parse ( s ) ;
2011-05-15 13:23:13 +00:00
max_temps = atoi ( qcc_token ) ;
2004-09-07 18:16:59 +00:00
} else if ( ! strcmp ( qcc_token , " CONSTANTS " ) ) {
s = QCC_COM_Parse ( s ) ;
MAX_CONSTANTS = atoi ( qcc_token ) ;
}
else if ( ! s )
break ;
else
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Bad token in qcc.cfg file \n " ) ;
2004-09-07 18:16:59 +00:00
}
}
/* don't try to be clever
else if ( p < 0 )
{
s = qccHunkAlloc ( 8192 ) ;
sprintf ( s , " MAX_REGS \t %i \r \n MAX_STRINGS \t %i \r \n MAX_GLOBALS \t %i \r \n MAX_FIELDS \t %i \r \n MAX_STATEMENTS \t %i \r \n MAX_FUNCTIONS \t %i \r \n MAX_TYPES \t %i \r \n " ,
MAX_REGS , MAX_STRINGS , MAX_GLOBALS , MAX_FIELDS , MAX_STATEMENTS , MAX_FUNCTIONS , maxtypeinfos ) ;
externs - > WriteFile ( " qcc.cfg " , s , strlen ( s ) ) ;
}
*/
------------------------------------------------------------------------
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
time ( & long_time ) ;
2019-12-10 14:50:47 +00:00
strftime ( QCC_copyright , sizeof ( QCC_copyright ) , " Compiled [%Y/%m/%d] "
# ifdef SVNREVISION
" , by fteqcc " STRINGIFY ( SVNREVISION )
# endif
" . " , localtime ( & long_time ) ) ;
2018-10-13 06:20:49 +00:00
( void ) QC_strlcat ( QCC_copyright , QCC_VersionString ( ) , sizeof ( QCC_copyright ) ) ;
2004-09-07 18:16:59 +00:00
for ( p = 0 ; p < 5 ; p + + )
strcpy ( QCC_Packname [ p ] , " " ) ;
for ( p = 0 ; compiler_flag [ p ] . enabled ; p + + )
{
2005-02-28 07:16:19 +00:00
* compiler_flag [ p ] . enabled = compiler_flag [ p ] . flags & FLAG_ASDEFAULT ;
2004-09-07 18:16:59 +00:00
}
2015-01-12 12:28:13 +00:00
parseonly = autoprototyped = autoprototype = false ;
2004-09-07 18:16:59 +00:00
QCC_SetDefaultProperties ( ) ;
2015-01-12 12:28:13 +00:00
autoprototype | = parseonly ;
2004-09-07 18:16:59 +00:00
optres_shortenifnots = 0 ;
optres_overlaptemps = 0 ;
optres_noduplicatestrings = 0 ;
optres_constantarithmatic = 0 ;
optres_nonvec_parms = 0 ;
optres_constant_names = 0 ;
optres_constant_names_strings = 0 ;
optres_precache_file = 0 ;
optres_filenames = 0 ;
optres_assignments = 0 ;
optres_unreferenced = 0 ;
optres_function_names = 0 ;
optres_locals = 0 ;
optres_dupconstdefs = 0 ;
optres_return_only = 0 ;
optres_compound_jumps = 0 ;
// optres_comexprremoval = 0;
optres_stripfunctions = 0 ;
2013-03-12 22:32:25 +00:00
optres_locals_overlapping = 0 ;
2004-09-07 18:16:59 +00:00
optres_logicops = 0 ;
2015-01-21 18:18:37 +00:00
optres_inlines = 0 ;
2004-09-07 18:16:59 +00:00
optres_test1 = 0 ;
optres_test2 = 0 ;
2005-02-09 19:32:30 +00:00
accglobalsblock = 0 ;
2004-09-07 18:16:59 +00:00
2013-03-12 22:32:25 +00:00
tempsused = 0 ;
2004-09-07 18:16:59 +00:00
2011-03-12 13:51:40 +00:00
QCC_PurgeTemps ( ) ;
2004-09-07 18:16:59 +00:00
strings = ( void * ) qccHunkAlloc ( sizeof ( char ) * MAX_STRINGS ) ;
2012-01-24 04:24:14 +00:00
strofs = 2 ;
2004-09-07 18:16:59 +00:00
2014-04-12 03:31:59 +00:00
statements = ( void * ) qccHunkAlloc ( sizeof ( QCC_statement_t ) * MAX_STATEMENTS ) ;
2004-09-07 18:16:59 +00:00
numstatements = 0 ;
2015-04-14 12:24:05 +00:00
functions = ( void * ) qccHunkAlloc ( sizeof ( QCC_function_t ) * MAX_FUNCTIONS ) ;
2004-09-07 18:16:59 +00:00
numfunctions = 0 ;
2004-11-03 04:21:42 +00:00
pr_bracelevel = 0 ;
2013-03-12 22:32:25 +00:00
qcc_pr_globals = ( void * ) qccHunkAlloc ( sizeof ( float ) * ( MAX_REGS + MAX_LOCALS + MAX_TEMPS ) ) ;
2004-09-07 18:16:59 +00:00
numpr_globals = 0 ;
2017-10-31 22:52:58 +00:00
Hash_InitTable ( & typedeftable , 1024 , qccHunkAlloc ( Hash_BytesForBuckets ( 1024 ) ) ) ;
2011-10-03 02:45:44 +00:00
Hash_InitTable ( & globalstable , MAX_REGS / 2 , qccHunkAlloc ( Hash_BytesForBuckets ( MAX_REGS / 2 ) ) ) ;
2013-12-29 22:48:28 +00:00
Hash_InitTable ( & localstable , 128 , qccHunkAlloc ( Hash_BytesForBuckets ( 128 ) ) ) ;
2011-10-03 02:45:44 +00:00
Hash_InitTable ( & floatconstdefstable , MAX_REGS / 2 + 1 , qccHunkAlloc ( Hash_BytesForBuckets ( MAX_REGS / 2 + 1 ) ) ) ;
Hash_InitTable ( & stringconstdefstable , MAX_REGS / 2 , qccHunkAlloc ( Hash_BytesForBuckets ( MAX_REGS / 2 ) ) ) ;
Hash_InitTable ( & stringconstdefstable_trans , 1000 , qccHunkAlloc ( Hash_BytesForBuckets ( 1000 ) ) ) ;
dotranslate_count = 0 ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
// pr_global_defs = (QCC_def_t **)qccHunkAlloc(sizeof(QCC_def_t *) * MAX_REGS);
qcc_globals = ( void * ) qccHunkAlloc ( sizeof ( QCC_ddef_t ) * MAX_GLOBALS ) ;
2011-05-15 13:23:13 +00:00
numglobaldefs = 0 ;
2004-09-07 18:16:59 +00:00
fields = ( void * ) qccHunkAlloc ( sizeof ( QCC_ddef_t ) * MAX_FIELDS ) ;
numfielddefs = 0 ;
memset ( pr_immediate_string , 0 , sizeof ( pr_immediate_string ) ) ;
2013-03-12 22:35:33 +00:00
precache_sound = ( void * ) qccHunkAlloc ( sizeof ( * precache_sound ) * QCC_MAX_SOUNDS ) ;
2004-09-07 18:16:59 +00:00
numsounds = 0 ;
2013-03-12 22:35:33 +00:00
precache_texture = ( void * ) qccHunkAlloc ( sizeof ( * precache_texture ) * QCC_MAX_TEXTURES ) ;
2004-09-07 18:16:59 +00:00
numtextures = 0 ;
2013-03-12 22:35:33 +00:00
precache_model = ( void * ) qccHunkAlloc ( sizeof ( * precache_model ) * QCC_MAX_MODELS ) ;
2004-09-07 18:16:59 +00:00
nummodels = 0 ;
2013-03-12 22:35:33 +00:00
precache_file = ( void * ) qccHunkAlloc ( sizeof ( * precache_file ) * QCC_MAX_FILES ) ;
2004-09-07 18:16:59 +00:00
numfiles = 0 ;
qcc_typeinfo = ( void * ) qccHunkAlloc ( sizeof ( QCC_type_t ) * maxtypeinfos ) ;
numtypeinfos = 0 ;
qcc_tempofs = qccHunkAlloc ( sizeof ( int ) * max_temps ) ;
tempsstart = 0 ;
bodylessfuncs = 0 ;
memset ( & pr , 0 , sizeof ( pr ) ) ;
# ifdef MAX_EXTRA_PARMS
memset ( & extra_parms , 0 , sizeof ( extra_parms ) ) ;
# endif
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
if ( QCC_CheckParm ( " /? " ) | | QCC_CheckParm ( " ? " ) | | QCC_CheckParm ( " -? " ) | | QCC_CheckParm ( " -help " ) | | QCC_CheckParm ( " --help " ) )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " qcc looks for progs.src in the current directory. \n " ) ;
externs - > Printf ( " to look in a different directory: qcc -src <directory> \n " ) ;
// externs->Printf ("to build a clean data tree: qcc -copy <srcdir> <destdir>\n");
// externs->Printf ("to build a clean pak file: qcc -pak <srcdir> <packfile>\n");
// externs->Printf ("to bsp all bmodels: qcc -bspmodels <gamedir>\n");
2020-03-25 21:29:30 +00:00
externs - > Printf ( " -Fwasm causes FTEQCC to dump all asm to qc.asm \n " ) ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " -O0 to disable optimisations \n " ) ;
externs - > Printf ( " -O1 to optimise for size \n " ) ;
externs - > Printf ( " -O2 to optimise more - some behaviours may change \n " ) ;
externs - > Printf ( " -O3 to optimise lots - experimental or non-future-proof \n " ) ;
externs - > Printf ( " -Oname to enable an optimisation \n " ) ;
externs - > Printf ( " -Ono-name to disable optimisations \n " ) ;
externs - > Printf ( " -Kkeyword to activate keyword \n " ) ;
externs - > Printf ( " -Kno-keyword to disable keyword \n " ) ;
externs - > Printf ( " -Wall to give a stupid number of warnings \n " ) ;
externs - > Printf ( " -Ttarget to set a output format \n " ) ;
externs - > Printf ( " -Fautoproto to enable automatic prototyping \n " ) ;
externs - > Printf ( " -Fsubscope to make locals specific to their subscope \n " ) ;
2004-09-07 18:16:59 +00:00
qcc_compileactive = false ;
2014-05-30 03:57:30 +00:00
return true ;
2004-09-07 18:16:59 +00:00
}
2014-03-30 08:55:06 +00:00
if ( flag_caseinsensitive )
2005-02-09 19:32:30 +00:00
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Compiling without case sensitivity \n " ) ;
2014-03-30 08:55:06 +00:00
pHash_Get = & Hash_GetInsensitive ;
pHash_GetNext = & Hash_GetNextInsensitive ;
pHash_Add = & Hash_AddInsensitive ;
pHash_RemoveData = & Hash_RemoveDataInsensitive ;
2005-02-09 19:32:30 +00:00
}
2016-09-08 19:04:35 +00:00
if ( * qccmsourcedir )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Source directory: %s \n " , qccmsourcedir ) ;
2004-09-07 18:16:59 +00:00
QCC_InitData ( ) ;
2004-12-24 08:45:56 +00:00
2004-09-07 18:16:59 +00:00
QCC_PR_BeginCompilation ( ( void * ) qccHunkAlloc ( 0x100000 ) , 0x100000 ) ;
2004-12-24 08:45:56 +00:00
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
QCC_PR_ClearGrabMacros ( false ) ;
2020-09-11 01:18:32 +00:00
qccmsrc = NULL ;
if ( destfile_explicit & & numsourcefiles & & ! currentsourcefile )
2018-10-13 06:20:49 +00:00
{ //generate an internal .src file from the argument list
2015-04-14 12:24:05 +00:00
int i ;
2020-09-11 01:18:32 +00:00
qccmsrc = qccHunkAlloc ( 8192 ) ;
* qccmsrc = 0 ;
for ( i = 0 ; i < numsourcefiles ; i + + )
QC_snprintfz ( qccmsrc + strlen ( qccmsrc ) , 8192 - strlen ( qccmsrc ) , " #include \" %s \" \n " , sourcefileslist [ i ] ) ;
currentsourcefile = i ;
2015-04-14 12:24:05 +00:00
}
if ( qccmsrc )
;
else if ( flag_acc & & ! numsourcefiles )
2005-02-09 19:32:30 +00:00
{
2014-03-01 11:38:53 +00:00
if ( ! QCC_FindQCFiles ( qccmsourcedir ) )
QCC_Error ( ERR_COULDNTOPENFILE , " Couldn't find any qc files. " ) ;
2004-09-07 18:16:59 +00:00
}
2005-02-09 19:32:30 +00:00
else
{
2008-11-09 22:29:28 +00:00
if ( ! numsourcefiles )
{
p = QCC_CheckParm ( " -qc " ) ;
if ( p & & p < argc - 1 )
2018-08-04 19:00:19 +00:00
QC_strlcpy ( qccmprogsdat , argv [ p + 1 ] , sizeof ( qccmprogsdat ) ) ;
2008-11-09 22:29:28 +00:00
else
{ //look for a preprogs.src... :o)
2018-08-04 19:00:19 +00:00
char tmp [ sizeof ( qccmsourcedir ) + 16 ] ;
QC_snprintfz ( tmp , sizeof ( tmp ) , " %spreprogs.src " , qccmsourcedir ) ;
if ( externs - > FileSize ( tmp ) < = 0 )
QC_snprintfz ( qccmprogsdat , sizeof ( qccmprogsdat ) , " progs.src " ) ;
2014-04-24 01:53:01 +00:00
else
2018-08-04 19:00:19 +00:00
QC_snprintfz ( qccmprogsdat , sizeof ( qccmprogsdat ) , " preprogs.src " ) ;
2008-11-09 22:29:28 +00:00
}
numsourcefiles = 0 ;
strcpy ( sourcefileslist [ numsourcefiles + + ] , qccmprogsdat ) ;
currentsourcefile = 0 ;
2005-02-09 19:32:30 +00:00
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
else if ( currentsourcefile = = numsourcefiles | | ( currentsourcefile & & destfile_explicit ) )
2008-11-09 22:29:28 +00:00
{
//no more.
qcc_compileactive = false ;
numsourcefiles = 0 ;
currentsourcefile = 0 ;
2014-05-30 03:57:30 +00:00
return true ;
2008-11-09 22:29:28 +00:00
}
if ( currentsourcefile )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " ------------------------------------- \n " ) ;
2015-02-02 08:01:53 +00:00
else
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s \n " , QCC_VersionString ( ) ) ;
2008-11-09 22:29:28 +00:00
2018-08-04 19:00:19 +00:00
QC_snprintfz ( qccmprogsdat , sizeof ( qccmprogsdat ) , " %s%s " , qccmsourcedir , sourcefileslist [ currentsourcefile + + ] ) ;
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Source file: %s \n " , qccmprogsdat ) ;
2004-09-07 18:16:59 +00:00
2015-02-07 18:07:30 +00:00
QC_strlcpy ( compilingrootfile , qccmprogsdat , sizeof ( compilingrootfile ) ) ;
2005-02-09 19:32:30 +00:00
if ( QCC_LoadFile ( qccmprogsdat , ( void * ) & qccmsrc ) = = - 1 )
2011-05-15 13:23:13 +00:00
{
2014-05-30 03:57:30 +00:00
return true ;
2005-02-09 19:32:30 +00:00
}
2004-09-07 18:16:59 +00:00
}
2005-02-09 19:32:30 +00:00
2004-09-07 18:16:59 +00:00
# ifdef WRITEASM
if ( writeasm )
{
asmfile = fopen ( " qc.asm " , " wb " ) ;
if ( ! asmfile )
QCC_Error ( ERR_INTERNAL , " Couldn't open file for asm output. " ) ;
}
2013-06-02 06:03:54 +00:00
asmfilebegun = ! ! asmfile ;
2004-09-07 18:16:59 +00:00
# endif
2005-03-20 02:57:11 +00:00
newstylesource = false ;
2018-10-11 10:31:23 +00:00
if ( qccmsrc [ 0 ] = = ' # ' & & qccmsrc [ 1 ] = = ' ! ' )
qccmsrc = strchr ( qccmsrc , ' \n ' ) ; //ignore the first line if it starts with a #! for unix scripts. because we can.
compilingfile = qccmprogsdat ;
preprocessonly = false ;
if ( QCC_CheckParm ( " -E " ) )
{
pr_file_p = qccmsrc ;
preprocessonly = true ;
goto newstyle ;
}
2005-03-20 02:57:11 +00:00
2018-10-11 10:31:23 +00:00
pr_file_p = QCC_COM_Parse ( qccmsrc ) ;
2004-12-24 08:45:56 +00:00
if ( QCC_CheckParm ( " -qc " ) )
{
strcpy ( destfile , qccmprogsdat ) ;
StripExtension ( destfile ) ;
strcat ( destfile , " .qco " ) ;
p = QCC_CheckParm ( " -o " ) ;
if ( ! p | | p > = argc - 1 | | argv [ p + 1 ] [ 0 ] = = ' - ' )
if ( p & & p < argc - 1 )
sprintf ( destfile , " %s%s " , qccmsourcedir , argv [ p + 1 ] ) ;
goto newstyle ;
}
2004-09-07 18:16:59 +00:00
if ( * qcc_token = = ' # ' )
2011-05-15 13:23:13 +00:00
{
2004-12-24 08:45:56 +00:00
newstyle :
2017-10-31 22:52:58 +00:00
if ( flag_filetimes )
QCC_PR_Warning ( 0 , qccmsrc , 0 , " -ffiletimes unsupported with this input " ) ;
2004-09-07 18:16:59 +00:00
newstylesource = true ;
2013-06-13 22:45:15 +00:00
originalqccmsrc = qccmsrc ;
2017-05-23 07:03:07 +00:00
pr_source_line = qccmline = 1 ;
2004-09-07 18:16:59 +00:00
StartNewStyleCompile ( ) ;
2014-05-30 03:57:30 +00:00
return true ;
2004-09-07 18:16:59 +00:00
}
2017-05-23 07:03:07 +00:00
pr_source_line = qccmline = 1 ;
2004-09-07 18:16:59 +00:00
pr_file_p = qccmsrc ;
2013-12-29 22:48:28 +00:00
QCC_PR_LexWhitespace ( false ) ;
2004-09-07 18:16:59 +00:00
qccmsrc = pr_file_p ;
s = qccmsrc ;
pr_file_p = qccmsrc ;
QCC_PR_SimpleGetToken ( ) ;
strcpy ( qcc_token , pr_token ) ;
qccmsrc = pr_file_p ;
2017-05-23 07:03:07 +00:00
qccmline = pr_source_line ;
2004-09-07 18:16:59 +00:00
if ( ! qccmsrc )
QCC_Error ( ERR_NOOUTPUT , " No destination filename. qcc -help for info. " ) ;
2015-07-06 14:47:46 +00:00
QCC_GenerateRelativePath ( destfile , sizeof ( destfile ) , qccmprogsdat , qcc_token ) ;
2004-09-07 18:16:59 +00:00
2015-04-14 12:24:05 +00:00
p = QCC_CheckParm ( " -o " ) ;
if ( p > 0 & & p < argc - 1 & & argv [ p + 1 ] [ 0 ] ! = ' - ' )
sprintf ( destfile , " %s " , argv [ p + 1 ] ) ;
2010-07-18 10:01:57 +00:00
if ( flag_filetimes )
{
struct stat s , os ;
pbool modified = false ;
if ( stat ( destfile , & os ) ! = - 1 )
{
2011-05-30 13:36:44 +00:00
while ( ( pr_file_p = QCC_COM_Parse ( pr_file_p ) ) )
2010-07-18 10:01:57 +00:00
{
if ( stat ( qcc_token , & s ) = = - 1 | | s . st_mtime > os . st_mtime )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " %s changed \n " , qcc_token ) ;
2010-07-18 10:01:57 +00:00
modified = true ;
break ;
}
}
if ( ! modified )
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " No changes \n " ) ;
2010-07-18 10:01:57 +00:00
qcc_compileactive = false ;
2014-05-30 03:57:30 +00:00
return true ;
2010-07-18 10:01:57 +00:00
}
else
{
pr_file_p = qccmsrc ;
}
}
}
2018-10-11 10:31:23 +00:00
externs - > Printf ( " outputfile: %s \n " , destfile ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
pr_dumpasm = false ;
currentchunk = NULL ;
2005-07-28 15:52:31 +00:00
originalqccmsrc = qccmsrc ;
2014-05-30 03:57:30 +00:00
return true ;
2004-09-07 18:16:59 +00:00
}
void new_QCC_ContinueCompile ( void ) ;
//called between exe frames - won't loose net connection (is the theory)...
void QCC_ContinueCompile ( void )
{
if ( ! qcc_compileactive )
//HEY!
return ;
if ( newstylesource )
{
2014-02-07 08:38:40 +00:00
char * ofp = pr_file_p ;
2012-11-27 03:23:19 +00:00
do
{
new_QCC_ContinueCompile ( ) ;
} while ( currentchunk ) ; //while parsing through preprocessor, make sure nothing gets hurt.
2014-02-07 08:38:40 +00:00
if ( ofp = = pr_file_p & & qcc_compileactive & & pr_token_type ! = tt_eof )
QCC_Error ( ERR_INTERNAL , " Syntax error \n " ) ;
2004-09-07 18:16:59 +00:00
return ;
}
2016-09-08 19:04:35 +00:00
pr_file_p = qccmsrc ;
2017-05-23 07:03:07 +00:00
s_filen = compilingrootfile ;
2016-09-08 19:04:35 +00:00
s_filed = 0 ;
2017-05-23 07:03:07 +00:00
pr_source_line = qccmline ;
2016-09-08 19:04:35 +00:00
QCC_PR_LexWhitespace ( false ) ;
qccmsrc = pr_file_p ;
2017-05-23 07:03:07 +00:00
qccmline = pr_source_line ;
2016-09-08 19:04:35 +00:00
2004-09-07 18:16:59 +00:00
qccmsrc = QCC_COM_Parse ( qccmsrc ) ;
if ( ! qccmsrc )
{
2015-01-12 12:28:13 +00:00
if ( parseonly )
2015-02-02 08:01:53 +00:00
{
2015-01-12 12:28:13 +00:00
qcc_compileactive = false ;
2020-09-11 01:18:32 +00:00
if ( sourcefilesnumdefs < countof ( sourcefilesdefs ) & & qccpersisthunk )
sourcefilesdefs [ currentsourcefile + + ] = pr . def_head . next ;
2015-02-02 08:01:53 +00:00
}
2015-01-12 12:28:13 +00:00
else
2004-09-07 18:16:59 +00:00
{
2015-01-12 12:28:13 +00:00
if ( autoprototype )
{
qccmsrc = originalqccmsrc ;
autoprototyped = autoprototype ;
QCC_SetDefaultProperties ( ) ;
autoprototype = false ;
return ;
}
QCC_FinishCompile ( ) ;
2004-09-07 18:16:59 +00:00
}
2008-11-09 22:29:28 +00:00
PostCompile ( ) ;
2013-03-12 23:15:32 +00:00
if ( currentsourcefile < numsourcefiles )
{
2014-05-30 03:57:30 +00:00
if ( ! QCC_main ( myargc , myargv ) )
2013-03-12 23:15:32 +00:00
return ;
}
else
{
qcc_compileactive = false ;
numsourcefiles = 0 ;
currentsourcefile = 0 ;
}
2004-09-07 18:16:59 +00:00
return ;
}
2016-10-22 07:06:51 +00:00
if ( setjmp ( pr_parse_abort ) )
{
if ( + + pr_error_count > MAX_ERRORS )
QCC_Error ( ERR_PARSEERRORS , " Errors have occured \n " ) ;
return ; //just try move onto the next file, gather errors.
}
else
QCC_FindBestInclude ( qcc_token , compilingrootfile , 2 ) ;
2016-09-08 19:04:35 +00:00
/*
{
int includepath = 0 ;
while ( 1 )
{
if ( includepath )
{
if ( includepath > MAXINCLUDEDIRS | | ! * qccincludedir [ includepath - 1 ] )
{
QCC_GenerateRelativePath ( qccmfilename , sizeof ( qccmfilename ) , compilingrootfile , qcc_token ) ;
break ;
}
currentfile = qccincludedir [ includepath - 1 ] ;
}
QCC_Canonicalize ( qccmfilename , sizeof ( fullname ) , qcc_token , compilingrootfile ) ;
{
extern progfuncs_t * qccprogfuncs ;
if ( qccprogfuncs - > funcs . parms - > FileSize ( qccmfilename ) = = - 1 )
{
includepath + + ;
continue ;
}
}
break ;
}
}
QCC_GenerateRelativePath ( qccmfilename , sizeof ( qccmfilename ) , compilingrootfile , qcc_token ) ;
2004-09-07 18:16:59 +00:00
if ( autoprototype )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " prototyping %s \n " , qccmfilename ) ;
2004-09-07 18:16:59 +00:00
else
2009-11-04 21:16:50 +00:00
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " compiling %s \n " , qccmfilename ) ;
2009-11-04 21:16:50 +00:00
}
2016-09-08 19:04:35 +00:00
2004-09-07 18:16:59 +00:00
QCC_LoadFile ( qccmfilename , ( void * ) & qccmsrc2 ) ;
if ( ! QCC_PR_CompileFile ( qccmsrc2 , qccmfilename ) )
QCC_Error ( ERR_PARSEERRORS , " Errors have occured \n " ) ;
2016-09-08 19:04:35 +00:00
*/
2004-09-07 18:16:59 +00:00
}
void QCC_FinishCompile ( void )
2011-05-15 13:23:13 +00:00
{
2008-11-09 22:29:28 +00:00
pbool donesomething ;
2004-09-07 18:16:59 +00:00
int crc ;
// int p;
currentchunk = NULL ;
if ( setjmp ( pr_parse_abort ) )
2020-09-08 04:44:07 +00:00
QCC_Error ( ERR_INTERNAL , " %s " , " " ) ;
2011-05-15 13:23:13 +00:00
2016-09-08 19:04:35 +00:00
s_filen = " " ;
s_filed = 0 ;
2015-04-14 12:24:05 +00:00
pr_source_line = 0 ;
2004-09-07 18:16:59 +00:00
if ( ! QCC_PR_FinishCompilation ( ) )
{
QCC_Error ( ERR_PARSEERRORS , " compilation errors " ) ;
}
/* p = QCC_CheckParm ("-asm");
if ( p )
{
for ( p + + ; p < myargc ; p + + )
{
if ( myargv [ p ] [ 0 ] = = ' - ' )
break ;
QCC_PrintFunction ( myargv [ p ] ) ;
}
} */
/*p = QCC_CheckParm ("-ofs");
if ( p )
{
for ( p + + ; p < myargc ; p + + )
{
if ( myargv [ p ] [ 0 ] = = ' - ' )
break ;
QCC_PrintOfs ( atoi ( myargv [ p ] ) ) ;
}
} */
// write progdefs.h
crc = QCC_PR_WriteProgdefs ( " progdefs.h " ) ;
2011-05-15 13:23:13 +00:00
2015-07-06 14:47:46 +00:00
if ( pr_error_count )
QCC_Error ( ERR_PARSEERRORS , " compilation errors " ) ;
2004-09-07 18:16:59 +00:00
// write data file
2008-11-09 22:29:28 +00:00
donesomething = QCC_WriteData ( crc ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
// regenerate bmodels if -bspmodels
QCC_BspModels ( ) ;
// report / copy the data files
QCC_CopyFiles ( ) ;
2020-09-11 01:18:32 +00:00
if ( sourcefilesnumdefs < countof ( sourcefilesdefs ) & & qccpersisthunk )
sourcefilesdefs [ sourcefilesnumdefs + + ] = pr . def_head . next ;
2015-02-02 08:01:53 +00:00
2008-11-09 22:29:28 +00:00
if ( donesomething )
{
2022-08-08 22:45:19 +00:00
if ( verbose > = VERBOSE_STANDARD )
2009-11-04 21:16:50 +00:00
{
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Compile Complete \n \n " ) ;
2009-11-04 21:16:50 +00:00
if ( optres_shortenifnots )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_shortenifnots %i \n " , optres_shortenifnots ) ;
2009-11-04 21:16:50 +00:00
if ( optres_overlaptemps )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_overlaptemps %i \n " , optres_overlaptemps ) ;
2009-11-04 21:16:50 +00:00
if ( optres_noduplicatestrings )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_noduplicatestrings %i \n " , optres_noduplicatestrings ) ;
2009-11-04 21:16:50 +00:00
if ( optres_constantarithmatic )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_constantarithmatic %i \n " , optres_constantarithmatic ) ;
2009-11-04 21:16:50 +00:00
if ( optres_nonvec_parms )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_nonvec_parms %i \n " , optres_nonvec_parms ) ;
2009-11-04 21:16:50 +00:00
if ( optres_constant_names )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_constant_names %i \n " , optres_constant_names ) ;
2009-11-04 21:16:50 +00:00
if ( optres_constant_names_strings )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_constant_names_strings %i \n " , optres_constant_names_strings ) ;
2009-11-04 21:16:50 +00:00
if ( optres_precache_file )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_precache_file %i \n " , optres_precache_file ) ;
2009-11-04 21:16:50 +00:00
if ( optres_filenames )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_filenames %i \n " , optres_filenames ) ;
2009-11-04 21:16:50 +00:00
if ( optres_assignments )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_assignments %i \n " , optres_assignments ) ;
2009-11-04 21:16:50 +00:00
if ( optres_unreferenced )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_unreferenced %i \n " , optres_unreferenced ) ;
2009-11-04 21:16:50 +00:00
if ( optres_locals )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_locals %i \n " , optres_locals ) ;
2009-11-04 21:16:50 +00:00
if ( optres_function_names )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_function_names %i \n " , optres_function_names ) ;
2009-11-04 21:16:50 +00:00
if ( optres_dupconstdefs )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_dupconstdefs %i \n " , optres_dupconstdefs ) ;
2009-11-04 21:16:50 +00:00
if ( optres_return_only )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_return_only %i \n " , optres_return_only ) ;
2009-11-04 21:16:50 +00:00
if ( optres_compound_jumps )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_compound_jumps %i \n " , optres_compound_jumps ) ;
2009-11-04 21:16:50 +00:00
// if (optres_comexprremoval)
2018-10-11 10:31:23 +00:00
// externs->Printf("optres_comexprremoval %i\n", optres_comexprremoval);
2009-11-04 21:16:50 +00:00
if ( optres_stripfunctions )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_stripfunctions %i \n " , optres_stripfunctions ) ;
2013-03-12 22:32:25 +00:00
if ( optres_locals_overlapping )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_locals_overlapping %i \n " , optres_locals_overlapping ) ;
2009-11-04 21:16:50 +00:00
if ( optres_logicops )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_logicops %i \n " , optres_logicops ) ;
2015-01-21 18:18:37 +00:00
if ( optres_inlines )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_inlines %i \n " , optres_inlines ) ;
2009-11-04 21:16:50 +00:00
if ( optres_test1 )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_test1 %i \n " , optres_test1 ) ;
2009-11-04 21:16:50 +00:00
if ( optres_test2 )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " optres_test2 %i \n " , optres_test2 ) ;
2011-05-15 13:23:13 +00:00
2018-10-11 10:31:23 +00:00
externs - > Printf ( " numtemps %u \n " , ( unsigned ) tempsused ) ;
2009-11-04 21:16:50 +00:00
}
2022-08-08 22:45:19 +00:00
if ( ! flag_msvcstyle & & verbose > = VERBOSE_PROGRESS )
2018-10-11 10:31:23 +00:00
externs - > Printf ( " Done. %i warnings \n " , pr_warning_count ) ;
2008-11-09 22:29:28 +00:00
}
2005-12-16 17:15:43 +00:00
2004-09-07 18:16:59 +00:00
qcc_compileactive = false ;
}
extern char * pr_file_p ;
extern int pr_source_line ;
2018-10-11 10:31:23 +00:00
static void StartNewStyleCompile ( void )
2004-09-07 18:16:59 +00:00
{
2016-09-08 19:04:35 +00:00
char * tmp ;
2004-09-07 18:16:59 +00:00
if ( setjmp ( pr_parse_abort ) )
{
if ( + + pr_error_count > MAX_ERRORS )
return ;
2008-11-09 22:29:28 +00:00
if ( setjmp ( pr_parse_abort ) )
return ;
2004-09-07 18:16:59 +00:00
QCC_PR_SkipToSemicolon ( ) ;
if ( pr_token_type = = tt_eof )
return ;
}
compilingfile = qccmprogsdat ;
2016-09-08 19:04:35 +00:00
s_filen = tmp = qccHunkAlloc ( strlen ( compilingfile ) + 1 ) ;
strcpy ( tmp , compilingfile ) ;
if ( opt_filenames )
{
optres_filenames + = strlen ( compilingfile ) + 1 ;
s_filed = 0 ;
}
else
s_filed = QCC_CopyString ( compilingfile ) ;
2004-09-07 18:16:59 +00:00
pr_file_p = qccmsrc ;
pr_source_line = 0 ;
QCC_PR_NewLine ( false ) ;
QCC_PR_Lex ( ) ; // read first token
}
void new_QCC_ContinueCompile ( void )
{
if ( setjmp ( pr_parse_abort ) )
{
// if (pr_error_count != 0)
{
QCC_Error ( ERR_PARSEERRORS , " Errors have occured " ) ;
return ;
}
QCC_PR_SkipToSemicolon ( ) ;
if ( pr_token_type = = tt_eof )
return ;
}
if ( pr_token_type = = tt_eof )
{
if ( pr_error_count )
QCC_Error ( ERR_PARSEERRORS , " Errors have occured " ) ;
2008-11-09 22:29:28 +00:00
2015-01-12 12:28:13 +00:00
if ( autoprototype & & ! parseonly )
2013-06-13 22:45:15 +00:00
{
2016-09-08 19:04:35 +00:00
char * tmp ;
2013-06-13 22:45:15 +00:00
qccmsrc = originalqccmsrc ;
2016-09-08 19:04:35 +00:00
s_filen = tmp = qccHunkAlloc ( strlen ( compilingfile ) + 1 ) ;
strcpy ( tmp , compilingfile ) ;
if ( opt_filenames )
{
optres_filenames + = strlen ( compilingfile ) + 1 ;
s_filed = 0 ;
}
else
s_filed = QCC_CopyString ( compilingfile ) ;
2013-06-13 22:45:15 +00:00
pr_file_p = qccmsrc ;
autoprototyped = autoprototype ;
2013-06-23 02:17:02 +00:00
QCC_SetDefaultProperties ( ) ;
2013-06-13 22:45:15 +00:00
autoprototype = false ;
QCC_PR_NewLine ( false ) ;
QCC_PR_Lex ( ) ;
2008-11-09 22:29:28 +00:00
return ;
2013-06-13 22:45:15 +00:00
}
else
{
2015-01-12 12:28:13 +00:00
if ( ! parseonly )
QCC_FinishCompile ( ) ;
2015-02-02 08:01:53 +00:00
else
{
2020-09-11 01:18:32 +00:00
if ( sourcefilesnumdefs < countof ( sourcefilesdefs ) & & qccpersisthunk )
sourcefilesdefs [ currentsourcefile + + ] = pr . def_head . next ;
2015-02-02 08:01:53 +00:00
}
2013-06-13 22:45:15 +00:00
PostCompile ( ) ;
2014-05-30 03:57:30 +00:00
if ( ! QCC_main ( myargc , myargv ) )
2015-04-14 12:24:05 +00:00
{
qcc_compileactive = false ;
2013-06-13 22:45:15 +00:00
return ;
2015-04-14 12:24:05 +00:00
}
2013-06-13 22:45:15 +00:00
return ;
}
2004-09-07 18:16:59 +00:00
}
pr_scope = NULL ; // outside all functions
2011-05-15 13:23:13 +00:00
2018-10-11 10:31:23 +00:00
if ( preprocessonly )
{
pbool white = false ;
static int line = 1 ;
while ( pr_token_type ! = tt_eof )
{
//if there's whitespace next, make sure we represent that
if ( line < pr_token_line )
{ //keep line numbers correct by splurging multiple newlines.
while ( line + + < pr_source_line )
externs - > Printf ( " \n " ) ;
}
else if ( white )
externs - > Printf ( " " ) ;
externs - > Printf ( " %s " , pr_token ) ;
white = ( qcc_iswhite ( * pr_file_p ) | | ( * pr_file_p = = ' / ' & & ( pr_file_p [ 1 ] = = ' / ' | | pr_file_p [ 1 ] = = ' * ' ) ) ) ;
QCC_PR_Lex ( ) ;
}
QCC_PR_Lex ( ) ;
return ;
}
2017-11-16 22:20:40 +00:00
QCC_PR_ParseDefs ( NULL , false ) ;
2004-09-07 18:16:59 +00:00
}
/*void new_QCC_ContinueCompile(void)
{
char * s , * s2 ;
if ( ! qcc_compileactive )
//HEY!
return ;
// compile all the files
qccmsrc = QCC_COM_Parse ( qccmsrc ) ;
if ( ! qccmsrc )
{
QCC_FinishCompile ( ) ;
return ;
}
s = qcc_token ;
strcpy ( qccmfilename , qccmsourcedir ) ;
while ( 1 )
{
if ( ! strncmp ( s , " .. \\ " , 3 ) )
{
s2 = qccmfilename + strlen ( qccmfilename ) - 2 ;
while ( s2 > = qccmfilename )
{
if ( * s2 = = ' / ' | | * s2 = = ' \\ ' )
{
s2 [ 1 ] = ' \0 ' ;
break ;
}
s2 - - ;
}
s + = 3 ;
continue ;
}
if ( ! strncmp ( s , " . \\ " , 2 ) )
{
s + = 2 ;
continue ;
}
break ;
}
// strcat (qccmfilename, s);
2018-10-11 10:31:23 +00:00
// externs->Printf ("compiling %s\n", qccmfilename);
2004-09-07 18:16:59 +00:00
// QCC_LoadFile (qccmfilename, (void *)&qccmsrc2);
// if (!new_QCC_PR_CompileFile (qccmsrc2, qccmfilename) )
// QCC_Error ("Errors have occured\n");
{
if ( ! pr . memory )
QCC_Error ( " PR_CompileFile: Didn't clear " ) ;
QCC_PR_ClearGrabMacros ( ) ; // clear the frame macros
compilingfile = filename ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
pr_file_p = qccmsrc2 ;
s_file = QCC_CopyString ( filename ) ;
pr_source_line = 0 ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
QCC_PR_NewLine ( ) ;
QCC_PR_Lex ( ) ; // read first token
while ( pr_token_type ! = tt_eof )
{
if ( setjmp ( pr_parse_abort ) )
{
if ( + + pr_error_count > MAX_ERRORS )
return false ;
QCC_PR_SkipToSemicolon ( ) ;
if ( pr_token_type = = tt_eof )
2011-05-15 13:23:13 +00:00
return false ;
2004-09-07 18:16:59 +00:00
}
pr_scope = NULL ; // outside all functions
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
QCC_PR_ParseDefs ( ) ;
}
}
return ( pr_error_count = = 0 ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
} */
2007-04-12 02:09:52 +00:00
# endif