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"
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 ;
int writeasm ;
2009-11-04 21:16:50 +00:00
pbool verbose ;
2013-06-13 22:45:15 +00:00
pbool qcc_nopragmaoptimise ;
2013-09-26 14:36:52 +00:00
extern unsigned int locals_marshalled ;
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 ) ;
2004-09-07 18:16:59 +00:00
void * FS_ReadToMem ( char * fname , void * membuf , int * len ) ;
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 ;
int numtemps ;
2008-11-09 22:29:28 +00:00
# define MAXSOURCEFILESLIST 8
char sourcefileslist [ MAXSOURCEFILESLIST ] [ 1024 ] ;
int currentsourcefile ;
int numsourcefiles ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
extern char * compilingfile ;
2008-11-09 22:29:28 +00:00
2006-01-27 08:17:59 +00:00
void QCC_PR_ResetErrorScope ( void ) ;
2005-02-28 07:16:19 +00:00
pbool compressoutput ;
2004-09-07 18:16:59 +00:00
pbool newstylesource ;
char destfile [ 1024 ] ;
float * qcc_pr_globals ;
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 ;
QCC_dfunction_t * functions ;
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 ;
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
qcc_targetformat_t qcc_targetformat ;
pbool bodylessfuncs ;
QCC_type_t * qcc_typeinfo ;
int numtypeinfos ;
int maxtypeinfos ;
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
{ " 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 } ,
------------------------------------------------------------------------
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)
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 ;
}
2004-11-13 17:18:34 +00:00
int QCC_WarningForName ( char * name )
{
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. " } ,
{ & opt_unreferenced , " u " , 1 , FLAG_ASDEFAULT , " unreferenced " , " Removes the entries of unreferenced variables. Doesn't make a difference in well maintained code. " } ,
{ & 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). " } ,
2013-03-12 22:32:25 +00:00
{ & opt_return_only , " ro " , 3 , 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 " , 3 , 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...
2013-09-26 14:36:52 +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. This can affect FTE_MULTIPROGS. " } ,
2013-09-26 16:43:11 +00:00
{ & opt_locals_overlapping , " lo " , 3 , 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. " } ,
2004-09-07 18:16:59 +00:00
{ NULL }
} ;
2005-04-16 16:21:27 +00:00
# define defaultkeyword FLAG_HIDDENINGUI|FLAG_ASDEFAULT|FLAG_MIDCOMPILE
# define nondefaultkeyword FLAG_HIDDENINGUI|0|FLAG_MIDCOMPILE
//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. " } ,
{ & 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. " } ,
{ & keyword_int , defaultkeyword , " int " , " Keyword: int " , " Disables the 'int' keyword. " } ,
{ & keyword_integer , defaultkeyword , " integer " , " Keyword: integer " , " Disables the 'integer' keyword. " } ,
{ & keyword_noref , defaultkeyword , " noref " , " Keyword: noref " , " Disables the 'noref' keyword. " } , //nowhere else references this, don't strip it.
{ & keyword_nosave , defaultkeyword , " nosave " , " Keyword: nosave " , " Disables the 'nosave' keyword. " } , //don't write the def to the output.
{ & 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. " } ,
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. " } ,
2005-03-20 02:57:11 +00:00
2004-09-07 18:16:59 +00:00
//options
2005-02-28 07:16:19 +00:00
{ & keywords_coexist , FLAG_ASDEFAULT , " kce " , " Keywords Coexist " , " If you want keywords to NOT be disabled when they a variable by the same name is defined, check here. " } ,
{ & 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)
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.
2009-08-29 19:44:58 +00:00
{ & flag_iffloat , FLAG_MIDCOMPILE , " iffloat " , " if(-0.0) fix " , " Fixes certain floating point logic. " } ,
2014-03-30 08:55:06 +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 <20> as EOF. Whilst case insensitivity and lax type checking are supported by reacc, they are seperate compiler flags in fteqcc. " } , //reacc like behaviour of src files.
{ & 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 " } ,
{ & 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. " } ,
2013-09-26 14:36:52 +00:00
{ & flag_debugmacros , FLAG_MIDCOMPILE , " flag_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. " } ,
2009-08-29 14:56:42 +00:00
{ & flag_fasttrackarrays , FLAG_MIDCOMPILE | FLAG_ASDEFAULT , " 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. " } ,
{ & 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. " } ,
2013-09-26 14:36:52 +00:00
{ & flag_noboundchecks , FLAG_MIDCOMPILE , " noboundchecks " , " Disable Bound Checks " , " Disable array index checks, speeding up array access but can result in your code misbehaving. " } ,
2004-09-07 18:16:59 +00:00
{ NULL }
} ;
struct {
qcc_targetformat_t target ;
char * name ;
} targets [ ] = {
{ QCF_STANDARD , " standard " } ,
2005-02-28 07:16:19 +00:00
{ QCF_STANDARD , " q1 " } ,
2004-09-07 18:16:59 +00:00
{ QCF_STANDARD , " quakec " } ,
{ QCF_HEXEN2 , " hexen2 " } ,
2005-02-28 07:16:19 +00:00
{ QCF_HEXEN2 , " h2 " } ,
{ QCF_KK7 , " kkqwsv " } ,
2004-09-07 18:16:59 +00:00
{ QCF_KK7 , " kk7 " } ,
{ QCF_KK7 , " bigprogs " } ,
{ QCF_KK7 , " version7 " } ,
{ QCF_KK7 , " kkqwsv " } ,
{ QCF_FTE , " 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
{ QCF_FTEH2 , " fteh2 " } ,
2008-10-16 23:04:36 +00:00
{ QCF_DARKPLACES , " darkplaces " } ,
{ QCF_DARKPLACES , " dp " } ,
2011-03-04 13:59:06 +00:00
{ QCF_QTEST , " qtest " } ,
2004-09-07 18:16:59 +00:00
{ 0 , NULL }
} ;
/*
= = = = = = = = = = = = = = = = =
BspModels
Runs qbsp and light on all of the models with a . bsp extension
= = = = = = = = = = = = = = = = =
*/
int QCC_CheckParm ( char * check ) ;
void QCC_BspModels ( void )
{
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
int QCC_CopyString ( char * str )
{
int old ;
2012-01-24 04:24:14 +00:00
if ( ! str )
return 0 ;
if ( ! * str )
return 1 ;
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 ;
strcpy ( strings + strofs , str ) ;
strofs + = strlen ( str ) + 1 ;
return old ;
}
int QCC_CopyDupBackString ( char * str )
{
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 ;
strcpy ( strings + strofs , str ) ;
strofs + = strlen ( str ) + 1 ;
return old ;
}
void QCC_PrintStrings ( void )
{
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 ;
printf ( " %5i : " , i ) ;
for ( j = 0 ; j < l ; j + + )
{
if ( strings [ i + j ] = = ' \n ' )
{
putchar ( ' \\ ' ) ;
putchar ( ' n ' ) ;
}
else
putchar ( strings [ i + j ] ) ;
}
printf ( " \n " ) ;
}
}
/*void QCC_PrintFunctions (void)
{
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 ] ;
printf ( " %s : %s : %i %i ( " , strings + d - > s_file , strings + d - > s_name , d - > first_statement , d - > parm_start ) ;
for ( j = 0 ; j < d - > numparms ; j + + )
printf ( " %i " , d - > parm_size [ j ] ) ;
printf ( " ) \n " ) ;
}
} */
void QCC_PrintFields ( void )
{
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 ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < numfielddefs ; i + + )
{
d = & fields [ i ] ;
2013-09-26 16:43:11 +00:00
printf ( " %5i : (%s) %s \n " , d - > ofs , basictypenames [ d - > type ] , strings + d - > s_name ) ;
2004-09-07 18:16:59 +00:00
}
}
void QCC_PrintGlobals ( void )
{
int i ;
QCC_ddef_t * d ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < numglobaldefs ; i + + )
{
d = & qcc_globals [ i ] ;
printf ( " %5i : (%i) %s \n " , d - > ofs , d - > type , strings + d - > s_name ) ;
}
}
int encode ( int len , int method , char * in , int handle ) ;
int WriteSourceFiles ( int h , dprograms_t * progs , pbool sourceaswell )
{
includeddatafile_t * idf ;
qcc_cachedsourcefile_t * f ;
int num = 0 ;
int ofs ;
/*
for ( f = qcc_sourcefile ; f ; f = f - > next )
{
if ( f - > type = = FT_CODE & & ! sourceaswell )
continue ;
SafeWrite ( h , f - > filename , strlen ( f - > filename ) + 1 ) ;
2005-05-22 13:42:10 +00:00
i = PRLittleLong ( f - > size ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & i , sizeof ( int ) ) ;
2005-05-22 13:42:10 +00:00
i = PRLittleLong ( encrpytmode ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & i , sizeof ( int ) ) ;
if ( encrpytmode )
for ( i = 0 ; i < f - > size ; i + + )
f - > file [ i ] ^ = 0xA5 ;
SafeWrite ( h , f - > file , f - > size ) ;
} */
for ( f = qcc_sourcefile , num = 0 ; f ; f = f - > next )
{
if ( f - > type = = FT_CODE & & ! sourceaswell )
continue ;
num + + ;
}
if ( ! num )
return 0 ;
idf = qccHunkAlloc ( sizeof ( includeddatafile_t ) * num ) ;
for ( f = qcc_sourcefile , num = 0 ; f ; f = f - > next )
{
if ( f - > type = = FT_CODE & & ! sourceaswell )
continue ;
strcpy ( idf [ num ] . filename , f - > filename ) ;
idf [ num ] . size = f - > size ;
# ifdef AVAIL_ZLIB
idf [ num ] . compmethod = 2 ;
# else
idf [ num ] . compmethod = 1 ;
# endif
idf [ num ] . ofs = SafeSeek ( h , 0 , SEEK_CUR ) ;
idf [ num ] . compsize = QC_encode ( progfuncs , f - > size , idf [ num ] . compmethod , f - > file , h ) ;
num + + ;
}
2011-05-15 13:23:13 +00:00
ofs = SafeSeek ( h , 0 , SEEK_CUR ) ;
2004-09-07 18:16:59 +00:00
SafeWrite ( h , & num , sizeof ( int ) ) ;
SafeWrite ( h , idf , sizeof ( includeddatafile_t ) * num ) ;
qcc_sourcefile = NULL ;
return ofs ;
}
void QCC_InitData ( void )
{
static char parmname [ 12 ] [ MAX_PARMS ] ;
static temp_t ret_temp ;
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
memset ( & ret_temp , 0 , sizeof ( ret_temp ) ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
def_ret . ofs = OFS_RETURN ;
def_ret . name = " return " ;
def_ret . temp = & ret_temp ;
def_ret . constant = false ;
2004-10-01 22:20:19 +00:00
def_ret . type = NULL ;
2004-09-07 18:16:59 +00:00
ret_temp . ofs = def_ret . ofs ;
ret_temp . scope = NULL ;
ret_temp . size = 3 ;
ret_temp . next = NULL ;
for ( i = 0 ; i < MAX_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 ) ;
}
}
int WriteBodylessFuncs ( int handle )
{
QCC_def_t * d ;
int ret = 0 ;
for ( d = pr . def_head . next ; d ; d = d - > next )
{
if ( d - > type - > type = = ev_function & & ! d - > scope ) // function parms are ok
{
2011-10-27 16:16:29 +00:00
if ( ! ( d - > initialized & 1 ) & & d - > references > 0 )
2004-09-07 18:16:59 +00:00
{
SafeWrite ( handle , d - > name , strlen ( d - > name ) + 1 ) ;
ret + + ;
}
}
}
return ret ;
}
2013-03-12 22:32:25 +00:00
//marshalled locals still point to the FIRST_LOCAL range.
//this function remaps all the locals back into actual usable defs.
2004-09-07 18:16:59 +00:00
void QCC_UnmarshalLocals ( void )
{
QCC_def_t * def ;
unsigned int ofs ;
unsigned int maxo ;
int i ;
2013-03-12 22:32:25 +00:00
extern int tempsused ;
2004-09-07 18:16:59 +00:00
ofs = numpr_globals ;
2013-09-26 14:36:52 +00:00
maxo = ofs + locals_marshalled ;
2004-09-07 18:16:59 +00:00
for ( def = pr . def_head . next ; def ; def = def - > next )
{
2013-03-12 22:32:25 +00:00
if ( def - > ofs > = FIRST_LOCAL ) //unmap defs.
2004-09-07 18:16:59 +00:00
{
2013-03-12 22:32:25 +00:00
def - > ofs = def - > ofs + ofs - FIRST_LOCAL ;
if ( maxo < def - > ofs + def - > type - > size )
maxo = def - > ofs + def - > type - > size ;
2004-09-07 18:16:59 +00:00
}
}
for ( i = 0 ; i < numfunctions ; i + + )
{
2013-03-12 22:32:25 +00:00
if ( functions [ i ] . parm_start = = FIRST_LOCAL )
2004-09-07 18:16:59 +00:00
functions [ i ] . parm_start = ofs ;
}
2013-03-12 22:32:25 +00:00
QCC_RemapOffsets ( 0 , numstatements , FIRST_LOCAL , FIRST_LOCAL + ( maxo - ofs ) , ofs ) ;
QCC_RemapOffsets ( 0 , numstatements , FIRST_TEMP , FIRST_TEMP + tempsused , maxo ) ;
2004-09-07 18:16:59 +00:00
2013-03-12 22:32:25 +00:00
numpr_globals = maxo + tempsused ;
2004-09-07 18:16:59 +00:00
if ( numpr_globals > MAX_REGS )
QCC_Error ( ERR_TOOMANYGLOBALS , " Too many globals are in use to unmarshal all locals " ) ;
2013-09-26 14:36:52 +00:00
if ( verbose )
printf ( " Total of %i locals, %i temps \n " , maxo - ofs , tempsused ) ;
2004-09-07 18:16:59 +00:00
}
CompilerConstant_t * QCC_PR_CheckCompConstDefined ( char * def ) ;
2008-11-09 22:29:28 +00:00
pbool QCC_WriteData ( int crc )
2004-09-07 18:16:59 +00:00
{
char element [ MAX_NAME ] ;
QCC_def_t * def , * comp_x , * comp_y , * comp_z ;
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 ;
2014-05-18 23:02:04 +00:00
int warnedunref = 0 ;
2014-04-12 03:31:59 +00:00
int * statement_linenums ;
2004-09-07 18:16:59 +00:00
2008-11-09 22:29:28 +00:00
if ( numstatements = = 1 & & numfunctions = = 1 & & numglobaldefs = = 1 & & numfielddefs = = 1 )
{
printf ( " nothing to write \n " ) ;
return false ;
}
2004-09-07 18:16:59 +00:00
progs . blockscompressed = 0 ;
if ( numstatements > MAX_STATEMENTS )
QCC_Error ( ERR_TOOMANYSTATEMENTS , " Too many statements - %i \n Add \" MAX_STATEMENTS \" \" %i \" to qcc.cfg " , numstatements , ( numstatements + 32768 ) & ~ 32767 ) ;
if ( strofs > MAX_STRINGS )
QCC_Error ( ERR_TOOMANYSTRINGS , " Too many strings - %i \n Add \" MAX_STRINGS \" \" %i \" to qcc.cfg " , strofs , ( strofs + 32768 ) & ~ 32767 ) ;
QCC_UnmarshalLocals ( ) ;
switch ( qcc_targetformat )
{
case QCF_HEXEN2 :
case QCF_STANDARD :
if ( bodylessfuncs )
printf ( " Warning: There are some functions without bodies. \n " ) ;
2005-02-28 07:16:19 +00:00
if ( numpr_globals > 65530 )
2004-09-07 18:16:59 +00:00
{
printf ( " Forcing target to FTE32 due to numpr_globals \n " ) ;
2011-03-04 13:59:06 +00:00
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 )
{
printf ( " Progs execution will require FTE \n " ) ;
break ;
}
2004-09-07 18:16:59 +00:00
else if ( qcc_targetformat = = QCF_HEXEN2 )
{
------------------------------------------------------------------------
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
printf ( " Progs execution requires a Hexen2 compatible HCVM \n " ) ;
2004-09-07 18:16:59 +00:00
break ;
}
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?
2013-12-29 22:48:28 +00:00
printf ( " Globals exceeds 32k - an enhanced QCVM will be required \n " ) ;
2004-09-07 18:16:59 +00:00
else
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
printf ( " Progs should run on any QuakeC VM \n " ) ;
2004-09-07 18:16:59 +00:00
break ;
}
------------------------------------------------------------------------
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_targetformat = ( qcc_targetformat = = QCF_HEXEN2 ) ? QCF_FTEH2 : QCF_FTE ;
//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 :
2008-10-16 23:04:36 +00:00
case QCF_DARKPLACES :
2005-02-28 07:16:19 +00:00
if ( qcc_targetformat = = QCF_FTEDEBUG )
debugtarget = true ;
if ( numpr_globals > 65530 )
2004-09-07 18:16:59 +00:00
{
2005-02-28 07:16:19 +00:00
printf ( " Using 32 bit target due to numpr_globals \n " ) ;
2011-03-04 13:59:06 +00:00
outputsttype = PST_FTE32 ;
2004-09-07 18:16:59 +00:00
}
2009-04-01 22:03:56 +00:00
if ( qcc_targetformat = = QCF_DARKPLACES )
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
printf ( " AMD64 builds cannot write typeinfo structures \n " ) ;
types = false ;
}
2004-09-07 18:16:59 +00:00
2009-11-04 21:16:50 +00:00
if ( verbose )
{
if ( qcc_targetformat = = QCF_DARKPLACES )
printf ( " DarkPlaces or FTE will be required \n " ) ;
else
printf ( " An FTE executor will be required \n " ) ;
}
2004-09-07 18:16:59 +00:00
break ;
case QCF_KK7 :
if ( bodylessfuncs )
printf ( " Warning: There are some functions without bodies. \n " ) ;
2005-02-28 07:16:19 +00:00
if ( numpr_globals > 65530 )
printf ( " Warning: Saving is not supported. Ensure all engine read fields and globals are defined early on. \n " ) ;
2004-09-07 18:16:59 +00:00
2007-10-05 18:08:47 +00:00
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 :
printf ( " Compiled QTest progs will most likely not work at all. YOU'VE BEEN WARNED! \n " ) ;
outputsttype = PST_QTEST ;
break ;
default :
Sys_Error ( " invalid progs type chosen! " ) ;
2004-09-07 18:16:59 +00:00
}
//part of how compilation works. This def is always present, and never used.
2008-10-05 02:55:01 +00:00
def = QCC_PR_GetDef ( NULL , " end_sys_globals " , NULL , false , 0 , false ) ;
2004-09-07 18:16:59 +00:00
if ( def )
def - > references + + ;
2008-10-05 02:55:01 +00:00
def = QCC_PR_GetDef ( NULL , " end_sys_fields " , NULL , false , 0 , false ) ;
2004-09-07 18:16:59 +00:00
if ( def )
def - > references + + ;
for ( def = pr . def_head . next ; def ; def = def - > next )
{
2012-02-13 09:24:01 +00:00
if ( ( def - > type - > type = = ev_struct | | def - > type - > type = = ev_union | | def - > arraysize ) & & def - > deftail )
{
QCC_def_t * d ;
d = def ;
while ( d ! = def - > deftail )
{
d = d - > next ;
h = d - > references ;
d - > references + = def - > references ;
def - > references + = h ;
}
}
2004-09-07 18:16:59 +00:00
if ( def - > type - > type = = ev_vector | | ( def - > type - > type = = ev_field & & def - > type - > aux_type - > type = = ev_vector ) )
{ //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 ;
2004-09-07 18:16:59 +00:00
sprintf ( 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 ) ;
2004-09-07 18:16:59 +00:00
sprintf ( 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 ) ;
2004-09-07 18:16:59 +00:00
sprintf ( 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 ;
}
}
if ( def - > references < = 0 )
{
2011-10-03 02:45:44 +00:00
int wt = def - > constant ? WARN_NOTREFERENCEDCONST : WARN_NOTREFERENCED ;
2013-06-02 06:03:54 +00:00
pr_scope = def - > scope ;
2013-09-26 14:36:52 +00:00
if ( strcmp ( def - > name , " IMMEDIATE " ) )
2010-05-01 22:47:47 +00:00
{
2014-03-01 11:38:53 +00:00
char typestr [ 256 ] ;
2014-05-18 23:02:04 +00:00
if ( warnedunref > = 10 )
2011-10-03 02:45:44 +00:00
{
2014-05-18 23:02:04 +00:00
if ( qccwarningaction [ wt ] )
pr_warning_count + + ;
}
else if ( QCC_PR_Warning ( wt , strings + def - > s_file , def - > s_line , " %s %s no references. " , TypeName ( def - > type , typestr , sizeof ( typestr ) ) , def - > name ) )
{
warnedunref + + ;
if ( warnedunref = = 10 )
QCC_PR_Note ( wt , NULL , 0 , " Not reporting other unreferenced variables. You can use the noref prefix or pragma to silence these messages as you clearly don't care. " ) ;
2011-10-03 02:45:44 +00:00
}
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
if ( opt_unreferenced & & def - > type - > type ! = ev_field )
{
optres_unreferenced + + ;
continue ;
}
}
2014-04-14 09:16:41 +00:00
if ( def - > strip )
continue ;
2004-09-07 18:16:59 +00:00
if ( def - > type - > type = = ev_function )
{
2013-03-12 22:32:25 +00:00
if ( opt_function_names & & def - > initialized & & functions [ G_FUNCTION ( def - > ofs ) ] . first_statement < 0 )
2004-09-07 18:16:59 +00:00
{
optres_function_names + + ;
def - > name = " " ;
}
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.
continue ;
}
// df = &functions[numfunctions];
// numfunctions++;
}
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
{
2011-08-16 04:12:15 +00:00
if ( numfielddefs > = MAX_FIELDS )
QCC_PR_ParseError ( 0 , " Too many fields. Limit is %u \n " , MAX_FIELDS ) ;
2004-09-07 18:16:59 +00:00
dd = & fields [ numfielddefs ] ;
numfielddefs + + ;
dd - > type = def - > type - > aux_type - > type ;
dd - > s_name = QCC_CopyString ( def - > name ) ;
dd - > ofs = G_INT ( def - > ofs ) ;
}
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 ) ;
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
if ( def - > saved & & ( ( ! def - > initialized | | def - > type - > type = = ev_function )
// && def->type->type != ev_function
& & def - > type - > type ! = ev_field
& & 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 ;
if ( opt_locals & & ( def - > scope | | ! strcmp ( def - > name , " IMMEDIATE " ) ) )
{
dd - > s_name = 0 ;
optres_locals + = strlen ( def - > name ) ;
}
else
dd - > s_name = QCC_CopyString ( def - > name ) ;
dd - > ofs = def - > ofs ;
}
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
{
QCC_PR_Warning ( 0 , NULL , 0 , " Mismatched union field types (%s and %s) " , strings + dd - > s_name , strings + fields [ h ] . s_name ) ;
}
}
}
}
}
2004-09-07 18:16:59 +00:00
if ( numglobaldefs > MAX_GLOBALS )
QCC_Error ( ERR_TOOMANYGLOBALS , " Too many globals - %i \n Add \" MAX_GLOBALS \" \" %i \" to qcc.cfg " , numglobaldefs , ( numglobaldefs + 32768 ) & ~ 32767 ) ;
for ( i = 0 ; i < nummodels ; i + + )
{
2013-03-12 22:35:33 +00:00
if ( ! precache_model [ i ] . used )
QCC_PR_Warning ( WARN_EXTRAPRECACHE , precache_model [ i ] . filename , precache_model [ i ] . fileline , " Model %s was precached but not directly used " , precache_model [ i ] . name ) ;
else if ( ! precache_model [ i ] . block )
QCC_PR_Warning ( WARN_NOTPRECACHED , precache_model [ i ] . filename , precache_model [ i ] . fileline , " Model %s was used but not precached " , precache_model [ i ] . name ) ;
2004-09-07 18:16:59 +00:00
}
//PrintStrings ();
//PrintFunctions ();
//PrintFields ();
//PrintGlobals ();
strofs = ( strofs + 3 ) & ~ 3 ;
2009-11-04 21:16:50 +00:00
if ( verbose )
{
printf ( " %6i strofs (of %i) \n " , strofs , MAX_STRINGS ) ;
printf ( " %6i numstatements (of %i) \n " , numstatements , MAX_STATEMENTS ) ;
printf ( " %6i numfunctions (of %i) \n " , numfunctions , MAX_FUNCTIONS ) ;
printf ( " %6i numglobaldefs (of %i) \n " , numglobaldefs , MAX_GLOBALS ) ;
printf ( " %6i numfielddefs (%i unique) (of %i) \n " , numfielddefs , pr . size_fields , MAX_FIELDS ) ;
printf ( " %6i numpr_globals (of %i) \n " , numpr_globals , MAX_REGS ) ;
2013-11-05 17:39:05 +00:00
printf ( " %6i nummodels \n " , nummodels ) ;
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 " ) ;
2009-11-04 21:16:50 +00:00
if ( verbose )
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 ;
------------------------------------------------------------------------
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 ( qcc_targetformat = = QCF_HEXEN2 | | 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
{
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 + + )
{
statements32 [ i ] . op = PRLittleLong /*PRLittleShort*/ ( statements [ i ] . op ) ;
statements32 [ i ] . a = PRLittleLong /*PRLittleShort*/ ( statements [ i ] . a ) ;
statements32 [ i ] . b = PRLittleLong /*PRLittleShort*/ ( statements [ i ] . b ) ;
statements32 [ i ] . c = PRLittleLong /*PRLittleShort*/ ( statements [ i ] . c ) ;
}
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
{
QCC_statement_t stmt = statements [ i ] ;
qtst [ i ] . line = 0 ; // no line support
qtst [ i ] . op = PRLittleShort ( ( unsigned short ) stmt . op ) ;
if ( stmt . a < 0 )
qtst [ i ] . a = PRLittleShort ( ( short ) stmt . a ) ;
else
qtst [ i ] . a = ( unsigned short ) PRLittleShort ( ( unsigned short ) stmt . a ) ;
if ( stmt . b < 0 )
qtst [ i ] . b = PRLittleShort ( ( short ) stmt . b ) ;
else
qtst [ i ] . b = ( unsigned short ) PRLittleShort ( ( unsigned short ) stmt . b ) ;
if ( stmt . c < 0 )
qtst [ i ] . c = PRLittleShort ( ( short ) stmt . c ) ;
else
qtst [ i ] . c = ( unsigned short ) PRLittleShort ( ( unsigned short ) stmt . c ) ;
}
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 ) ;
for ( i = 0 ; i < numstatements ; i + + ) //resize as we go - scaling down
{
statements16 [ i ] . op = PRLittleShort ( ( unsigned short ) statements [ i ] . op ) ;
if ( statements [ i ] . a < 0 )
statements16 [ i ] . a = PRLittleShort ( ( short ) statements [ i ] . a ) ;
else
statements16 [ i ] . a = ( unsigned short ) PRLittleShort ( ( unsigned short ) statements [ i ] . a ) ;
if ( statements [ i ] . b < 0 )
statements16 [ i ] . b = PRLittleShort ( ( short ) statements [ i ] . b ) ;
else
statements16 [ i ] . b = ( unsigned short ) PRLittleShort ( ( unsigned short ) statements [ i ] . b ) ;
if ( statements [ i ] . c < 0 )
statements16 [ i ] . c = PRLittleShort ( ( short ) statements [ i ] . c ) ;
else
statements16 [ i ] . c = ( unsigned short ) PRLittleShort ( ( unsigned short ) statements [ i ] . c ) ;
}
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 :
2011-03-04 13:59:06 +00:00
Sys_Error ( " structtype error " ) ;
2004-09-07 18:16:59 +00:00
}
progs . ofs_functions = SafeSeek ( h , 0 , SEEK_CUR ) ;
progs . numfunctions = numfunctions ;
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 :
{
// this sucks but the structures are just too different
qtest_function_t * qtestfuncs = ( qtest_function_t * ) qccHunkAlloc ( sizeof ( qtest_function_t ) * numfunctions ) ;
2004-09-07 18:16:59 +00:00
2011-03-04 13:59:06 +00:00
for ( i = 0 ; i < numfunctions ; i + + )
{
int j ;
qtestfuncs [ i ] . unused1 = 0 ;
qtestfuncs [ i ] . profile = 0 ;
qtestfuncs [ i ] . first_statement = PRLittleLong ( functions [ i ] . first_statement ) ;
qtestfuncs [ i ] . parm_start = PRLittleLong ( functions [ i ] . parm_start ) ;
qtestfuncs [ i ] . s_name = PRLittleLong ( functions [ i ] . s_name ) ;
qtestfuncs [ i ] . s_file = PRLittleLong ( functions [ i ] . s_file ) ;
qtestfuncs [ i ] . numparms = PRLittleLong ( ( functions [ i ] . numparms > MAX_PARMS ) ? MAX_PARMS : functions [ i ] . numparms ) ;
qtestfuncs [ i ] . locals = PRLittleLong ( functions [ i ] . locals ) ;
for ( j = 0 ; j < MAX_PARMS ; j + + )
qtestfuncs [ i ] . parm_size [ j ] = PRLittleLong ( ( int ) functions [ i ] . parm_size [ j ] ) ;
}
SafeWrite ( h , qtestfuncs , numfunctions * sizeof ( qtest_function_t ) ) ;
}
break ;
case PST_DEFAULT :
case PST_KKQWSV :
case PST_FTE32 :
for ( i = 0 ; i < numfunctions ; i + + )
{
functions [ i ] . first_statement = PRLittleLong ( functions [ i ] . first_statement ) ;
functions [ i ] . parm_start = PRLittleLong ( functions [ i ] . parm_start ) ;
functions [ i ] . s_name = PRLittleLong ( functions [ i ] . s_name ) ;
functions [ i ] . s_file = PRLittleLong ( functions [ i ] . s_file ) ;
functions [ i ] . numparms = PRLittleLong ( ( functions [ i ] . numparms > MAX_PARMS ) ? MAX_PARMS : functions [ i ] . numparms ) ;
functions [ i ] . locals = PRLittleLong ( functions [ i ] . locals ) ;
}
if ( progs . blockscompressed & 8 )
2011-05-15 13:23:13 +00:00
{
2011-03-04 13:59:06 +00:00
SafeWrite ( h , & len , sizeof ( int ) ) ; //save for later
len = QC_encode ( progfuncs , numfunctions * sizeof ( QCC_dfunction_t ) , 2 , ( char * ) functions , 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 ) ;
}
else
SafeWrite ( h , functions , numfunctions * sizeof ( QCC_dfunction_t ) ) ;
break ;
default :
Sys_Error ( " structtype error " ) ;
2004-09-07 18:16:59 +00:00
}
2013-05-14 12:52:07 +00:00
if ( verbose > = 2 )
QCC_PrintFields ( ) ;
2013-03-12 22:32:25 +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
}
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 ) ;
fields16 [ i ] . ofs = ( unsigned short ) PRLittleShort ( ( unsigned short ) fields [ i ] . ofs ) ;
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 :
2011-03-04 13:59:06 +00:00
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 ;
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 ;
break ;
2005-02-28 07:16:19 +00:00
case QCF_KK7 :
progs . version = PROG_KKQWSVVERSION ;
break ;
case QCF_STANDARD :
case QCF_HEXEN2 : //urgh
progs . version = PROG_VERSION ;
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 :
progs . version = PROG_EXTENDEDVERSION ;
2011-03-04 13:59:06 +00:00
if ( outputsttype = = PST_FTE32 )
2004-09-07 18:16:59 +00:00
progs . secondaryversion = PROG_SECONDARYVERSION32 ;
else
progs . secondaryversion = PROG_SECONDARYVERSION16 ;
progs . ofsbodylessfuncs = SafeSeek ( h , 0 , SEEK_CUR ) ;
2011-05-15 13:23:13 +00:00
progs . numbodylessfuncs = WriteBodylessFuncs ( h ) ;
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 ;
}
2005-02-28 07:16:19 +00:00
progs . ofsfiles = WriteSourceFiles ( h , & progs , debugtarget ) ;
break ;
2004-09-07 18:16:59 +00:00
}
2009-11-04 21:16:50 +00:00
if ( verbose )
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 ;
// qbyte swap the header and write it out
for ( i = 0 ; i < sizeof ( progs ) / 4 ; i + + )
2011-05-15 13:23:13 +00:00
( ( 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 ) ) ;
2013-09-26 14:36:52 +00:00
if ( ! SafeClose ( h ) )
{
printf ( " Error while writing output %s \n " , destfile ) ;
return false ;
}
printf ( " Compile finished: %s \n " , destfile ) ;
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 , ' . ' ) ;
if ( 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 " ) ;
if ( verbose )
printf ( " Writing %s for debugging \n " , destfile ) ;
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
}
/*
= = = = = = = = = = = = = = =
PR_String
Returns a string suitable for printing ( no newlines , max 60 chars length )
= = = = = = = = = = = = = = =
*/
char * QCC_PR_String ( char * string )
{
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 ;
}
QCC_def_t * QCC_PR_DefForFieldOfs ( gofs_t ofs )
{
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 ;
QCC_dfunction_t * f ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
switch ( type )
{
case ev_string :
sprintf ( line , " %s " , QCC_PR_String ( strings + * ( int * ) val ) ) ;
break ;
2011-05-15 13:23:13 +00:00
case ev_entity :
2004-09-07 18:16:59 +00:00
sprintf ( line , " entity %i " , * ( int * ) val ) ;
break ;
case ev_function :
f = functions + * ( int * ) val ;
if ( ! f )
sprintf ( line , " undefined function " ) ;
else
sprintf ( line , " %s() " , strings + f - > s_name ) ;
break ;
case ev_field :
def = QCC_PR_DefForFieldOfs ( * ( int * ) val ) ;
sprintf ( line , " .%s " , def - > name ) ;
break ;
case ev_void :
sprintf ( line , " void " ) ;
break ;
case ev_float :
sprintf ( line , " %5.1f " , * ( float * ) val ) ;
break ;
case ev_integer :
sprintf ( line , " %i " , * ( int * ) val ) ;
break ;
case ev_vector :
sprintf ( line , " '%5.1f %5.1f %5.1f' " , ( ( float * ) val ) [ 0 ] , ( ( float * ) val ) [ 1 ] , ( ( float * ) val ) [ 2 ] ) ;
break ;
case ev_pointer :
sprintf ( line , " pointer " ) ;
break ;
default :
sprintf ( line , " bad type %i " , type ) ;
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);
sprintf ( line , " %i(? " " ? " " ?) " , ofs ) ;
else
sprintf ( 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 ;
}
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 ] ) ;
sprintf ( line , " %i(%s) " , ofs , s ) ;
}
else
sprintf ( 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)
{
printf ( " %s \n " , QCC_PR_GlobalString ( ofs ) ) ;
} */
/*
= = = = = = = = = = = = = = = = =
PR_PrintStatement
= = = = = = = = = = = = = = = = =
*/
/*void QCC_PR_PrintStatement (QCC_dstatement_t *s)
{
int i ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
printf ( " %4i : %4i : %s " , ( int ) ( s - statements ) , statement_linenums [ s - statements ] , pr_opcodes [ s - > op ] . opname ) ;
i = strlen ( pr_opcodes [ s - > op ] . opname ) ;
for ( ; i < 10 ; i + + )
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 )
printf ( " %sbranch %i " , QCC_PR_GlobalString ( s - > a ) , s - > b ) ;
else if ( s - > op = = OP_GOTO )
{
printf ( " branch %i " , s - > a ) ;
}
else if ( ( unsigned ) ( s - > op - OP_STORE_F ) < 6 )
{
printf ( " %s " , QCC_PR_GlobalString ( s - > a ) ) ;
printf ( " %s " , QCC_PR_GlobalStringNoContents ( s - > b ) ) ;
}
else
{
if ( s - > a )
printf ( " %s " , QCC_PR_GlobalString ( s - > a ) ) ;
if ( s - > b )
printf ( " %s " , QCC_PR_GlobalString ( s - > b ) ) ;
if ( s - > c )
printf ( " %s " , QCC_PR_GlobalStringNoContents ( s - > c ) ) ;
}
printf ( " \n " ) ;
} */
/*
= = = = = = = = = = = =
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 ) ;
} */
2012-02-05 01:38:51 +00:00
QCC_type_t * QCC_PR_NewType ( 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
numtypeinfos + + ;
return & qcc_typeinfo [ numtypeinfos - 1 ] ;
}
/*
= = = = = = = = = = = = = =
PR_BeginCompilation
called before compiling a batch of files , clears the pr struct
= = = = = = = = = = = = = =
*/
void QCC_PR_BeginCompilation ( void * memory , int memsize )
{
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 ;
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 ) ;
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 ) ;
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 ) ;
type_integer = QCC_PR_NewType ( " __integer " , ev_integer , true ) ;
type_variant = QCC_PR_NewType ( " variant " , ev_variant , true ) ;
type_variant = QCC_PR_NewType ( " __variant " , ev_variant , true ) ;
type_floatfield = QCC_PR_NewType ( " fieldfloat " , ev_field , false ) ;
2004-09-07 18:16:59 +00:00
type_floatfield - > aux_type = type_float ;
2012-02-05 01:38:51 +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
//type_field->aux_type = type_float;
2012-02-05 01:38:51 +00:00
type_integer = QCC_PR_NewType ( " integer " , ev_integer , keyword_integer ? true : false ) ;
type_integer = QCC_PR_NewType ( " int " , ev_integer , keyword_integer ? true : false ) ;
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 ;
2012-01-17 07:57:46 +00:00
QCC_PR_GetDef ( type_vector , " RETURN " , NULL , true , 0 , false ) - > references + + ;
2004-09-07 18:16:59 +00:00
for ( i = 0 ; i < MAX_PARMS ; i + + )
{
sprintf ( name , " PARM%i " , i ) ;
2012-01-17 07:57:46 +00:00
QCC_PR_GetDef ( type_vector , name , NULL , true , 0 , false ) - > references + + ;
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 ;
}
/*
= = = = = = = = = = = = = =
PR_FinishCompilation
called after all files are compiled to check for errors
Returns false if errors were detected .
= = = = = = = = = = = = = =
*/
int QCC_PR_FinishCompilation ( void )
{
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
2004-09-07 18:16:59 +00:00
errors = false ;
2011-05-15 13:23:13 +00:00
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 )
{
2013-12-29 22:48:28 +00:00
if ( d - > type - > type = = ev_function & & d - > constant ) // function parms are ok
2004-09-07 18:16:59 +00:00
{
// f = G_FUNCTION(d->ofs);
// if (!f || (!f->code && !f->builtin) )
if ( d - > initialized = = 0 )
{
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 ) ;
if ( t )
{
QCC_PR_EmitClassFromFunction ( d , t ) ;
pr_scope = NULL ;
continue ;
}
2004-09-07 18:16:59 +00:00
}
2013-06-11 02:06:06 +00:00
QCC_PR_Warning ( ERR_NOFUNC , strings + d - > s_file , d - > s_line , " function %s has no body " , d - > name ) ;
QCC_PR_ParsePrintDef ( ERR_NOFUNC , d ) ;
bodylessfuncs = true ;
errors = true ;
2004-09-07 18:16:59 +00:00
}
else if ( d - > initialized = = 2 )
bodylessfuncs = true ;
}
}
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
} ;
void QCC_CRC_Init ( unsigned short * crcvalue )
{
* crcvalue = CRC_INIT_VALUE ;
}
void QCC_CRC_ProcessByte ( unsigned short * crcvalue , qbyte data )
{
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
}
unsigned short QCC_CRC_Value ( unsigned short crcvalue )
{
return crcvalue ^ CRC_XOR_VALUE ;
}
//=============================================================================
/*
= = = = = = = = = = = =
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
2009-06-13 12:25:39 +00:00
static void Add ( 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 ' ;
}
# define ADD(p) Add(p, &crc, file)
//#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';}
2009-06-13 12:25:39 +00:00
static void Add3 ( 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
}
# define ADD3(p) Add3(p, &crc, file)
unsigned short QCC_PR_WriteProgdefs ( char * filename )
{
2005-02-09 19:32:30 +00:00
# define ADD2(p) strncat(file, p, PROGDEFS_MAX_SIZE-1 - strlen(file)) //no crc (later changes)
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
//ADD: crc and dump
//ADD2: dump but don't crc
//ADD3: crc but don't dump
2004-09-07 18:16:59 +00:00
ADD ( " \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
if ( qcc_targetformat = = QCF_HEXEN2 | | qcc_targetformat = = QCF_FTEH2 )
2004-09-07 18:16:59 +00:00
ADD3 ( " generated by hcc, do not modify " ) ;
else
ADD3 ( " file generated by qcc, do not modify " ) ;
ADD2 ( " File generated by FTEQCC, relevent for engine modding only, the generated crc must be the same as your engine expects. " ) ;
ADD ( " */ \n \n typedef struct " ) ;
ADD2 ( " globalvars_s " ) ;
2011-05-15 13:23:13 +00:00
ADD ( qcva ( " \n { " ) ) ;
2004-09-07 18:16:59 +00:00
ADD2 ( " \t int pad; \n "
" \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 " ) ;
ADD3 ( qcva ( " \t int \t pad[%i]; \n " , RESERVED_OFS ) ) ;
for ( d = pr . def_head . next ; d ; d = d - > next )
{
if ( ! strcmp ( d - > name , " end_sys_globals " ) )
break ;
if ( d - > ofs < RESERVED_OFS )
continue ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
switch ( d - > type - > type )
{
case ev_float :
ADD ( qcva ( " \t float \t %s; \n " , d - > name ) ) ;
break ;
case ev_vector :
ADD ( 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 :
ADD ( qcva ( " \t string_t \t %s; \n " , d - > name ) ) ;
break ;
case ev_function :
ADD ( qcva ( " \t func_t \t %s; \n " , d - > name ) ) ;
break ;
case ev_entity :
ADD ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
break ;
case ev_integer :
ADD ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
break ;
default :
ADD ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
break ;
}
}
ADD ( " } globalvars_t; \n \n " ) ;
// print all fields
ADD ( " typedef struct " ) ;
ADD2 ( " entvars_s " ) ;
ADD ( " \n { \n " ) ;
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 :
ADD ( qcva ( " \t float \t %s; \n " , d - > name ) ) ;
break ;
case ev_vector :
ADD ( 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 :
ADD ( qcva ( " \t string_t \t %s; \n " , d - > name ) ) ;
break ;
case ev_function :
ADD ( qcva ( " \t func_t \t %s; \n " , d - > name ) ) ;
break ;
case ev_entity :
ADD ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
break ;
case ev_integer :
ADD ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
break ;
default :
ADD ( qcva ( " \t int \t %s; \n " , d - > name ) ) ;
break ;
}
}
ADD ( " } entvars_t; \n \n " ) ;
2012-11-27 03:23:19 +00:00
/*
2004-09-07 18:16:59 +00:00
///temp
ADD2 ( " //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 " ) ;
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 )
2011-05-15 13:23:13 +00:00
ADD2 ( " , \n " ) ;
2004-09-07 18:16:59 +00:00
ADD2 ( qcva ( " \t {%i, \t %i, \t \" %s \" } " , G_INT ( d - > ofs ) , d - > type - > aux_type - > type , d - > name ) ) ;
f = 1 ;
}
ADD2 ( " \n }; \n #endif \n \n " ) ;
//end temp
2012-11-27 03:23:19 +00:00
*/
2004-09-07 18:16:59 +00:00
ADD2 ( qcva ( " #define PROGHEADER_CRC %i \n " , crc ) ) ;
if ( QCC_CheckParm ( " -progdefs " ) )
{
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 ;
switch ( crc )
{
2009-05-24 10:11:17 +00:00
case 12923 : //#pragma sourcefile usage
break ;
2005-03-01 15:36:23 +00:00
case 54730 :
2009-11-04 21:16:50 +00:00
if ( verbose )
printf ( " Recognised progs as QuakeWorld \n " ) ;
2005-03-01 15:36:23 +00:00
break ;
case 5927 :
2009-11-04 21:16:50 +00:00
if ( verbose )
printf ( " Recognised progs as NetQuake server gamecode \n " ) ;
2009-04-01 22:03:56 +00:00
break ;
case 26940 :
2009-11-04 21:16:50 +00:00
if ( verbose )
printf ( " Recognised progs as Quake pre-release... \n " ) ;
2005-03-01 15:36:23 +00:00
break ;
2009-04-01 22:03:56 +00:00
2005-03-01 15:36:23 +00:00
case 38488 :
2009-11-04 21:16:50 +00:00
if ( verbose )
printf ( " Recognised progs as original Hexen2 \n " ) ;
2005-03-01 15:36:23 +00:00
break ;
case 26905 :
2009-11-04 21:16:50 +00:00
if ( verbose )
printf ( " Recognised progs as Hexen2 Mission Pack \n " ) ;
2005-03-01 15:36:23 +00:00
break ;
2009-04-01 22:03:56 +00:00
case 14046 :
2009-11-04 21:16:50 +00:00
if ( verbose )
printf ( " Recognised progs as Hexen2 (demo) \n " ) ;
2009-04-01 22:03:56 +00:00
break ;
2009-05-24 10:11:17 +00:00
case 22390 : //EXT_CSQC_1
2009-11-04 21:16:50 +00:00
if ( verbose )
printf ( " Recognised progs as an EXT_CSQC_1 module \n " ) ;
2009-05-24 10:11:17 +00:00
break ;
case 17105 :
case 32199 : //outdated ext_csqc
------------------------------------------------------------------------
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_Warning ( WARN_SYSTEMCRC , NULL , 0 , " Recognised progs as outdated CSQC module \n " ) ;
2009-04-01 22:03:56 +00:00
break ;
------------------------------------------------------------------------
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 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.
printf ( " Recognised progs as DP-specific CSQC module \n " ) ;
2009-04-01 22:03:56 +00:00
break ;
case 10020 :
2009-11-04 21:16:50 +00:00
if ( verbose )
printf ( " Recognised progs as a DP/FTE Menu module \n " ) ;
2009-04-01 22:03:56 +00:00
break ;
case 32401 :
------------------------------------------------------------------------
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_Warning ( WARN_SYSTEMCRC , NULL , 0 , " Warning: please update your tenebrae system defs. \n " ) ;
2009-04-01 22:03:56 +00:00
break ;
default :
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
QCC_PR_Warning ( WARN_SYSTEMCRC , NULL , 0 , " Warning: progs CRC not recognised from quake nor clones \n " ) ;
2009-04-01 22:03:56 +00:00
break ;
2005-03-01 15:36:23 +00:00
}
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 ;
2004-09-07 18:16:59 +00:00
printf ( " Statements for function %s: \n " , name ) ;
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 ) ;
printf ( " \n \n " ) ;
}
}
}
*/
/*
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
DIRECTORY COPYING / PACKFILE CREATION
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*/
typedef struct
{
char name [ 56 ] ;
int filepos , filelen ;
} packfile_t ;
typedef struct
{
char id [ 4 ] ;
int dirofs ;
int dirlen ;
} packheader_t ;
packfile_t pfiles [ 4096 ] , * pf ;
int packhandle ;
int packbytes ;
/*
= = = = = = = = = = = =
CreatePath
= = = = = = = = = = = =
*/
void QCC_CreatePath ( char * path )
{
/*
char * ofs ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
for ( ofs = path + 1 ; * ofs ; ofs + + )
{
if ( * ofs = = ' / ' )
{ // create the directory
* ofs = 0 ;
# ifdef QCC
mkdir ( path ) ;
# else
QCC_mkdir ( path ) ;
# endif
* ofs = ' / ' ;
}
}
*/
}
/*
= = = = = = = = = = =
PackFile
Copy a file into the pak file
= = = = = = = = = = =
*/
void QCC_PackFile ( char * src , char * name )
{
int remaining ;
# 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
2004-09-07 18:16:59 +00:00
if ( ( qbyte * ) pf - ( qbyte * ) pfiles > sizeof ( pfiles ) )
QCC_Error ( ERR_TOOMANYPAKFILES , " Too many files in pak file " ) ;
# if 1
f = FS_ReadToMem ( src , NULL , & remaining ) ;
if ( ! f )
{
printf ( " %64s : %7s \n " , name , " " ) ;
// 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 ) ;
printf ( " %64s : %7i \n " , pf - > name , remaining ) ;
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 ) ;
printf ( " %64s : %7i \n " , pf - > name , remaining ) ;
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
= = = = = = = = = = =
*/
void QCC_CopyFile ( char * src , char * dest )
{
/*
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
= = = = = = = = = = =
*/
void _QCC_CopyFiles ( int blocknum , int copytype , char * srcdir , char * destdir )
{
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 ' ;
dirlen = ( qbyte * ) pf - ( qbyte * ) 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 + + )
QCC_CRC_ProcessByte ( & crc , ( ( qbyte * ) pfiles ) [ i ] ) ;
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
i = pf - pfiles ;
printf ( " %i files packed in %i bytes (%i crc) \n " , i , packbytes , crc ) ;
}
}
void QCC_CopyFiles ( void )
{
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 )
printf ( " %3i unique precache_sounds \n " , numsounds ) ;
if ( nummodels > 0 )
printf ( " %3i unique precache_models \n " , nummodels ) ;
if ( numtextures > 0 )
printf ( " %3i unique precache_textures \n " , numtextures ) ;
if ( numfiles > 0 )
printf ( " %3i unique precache_files \n " , numfiles ) ;
}
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 ;
}
for ( p = 0 ; p < 5 ; p + + )
{
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 ) ;
}
*/
}
//============================================================================
void QCC_PR_CommandLinePrecompilerOptions ( void )
{
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 ;
2004-09-07 18:16:59 +00:00
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 + + )
{
//compiler constant
if ( ! strncmp ( myargv [ i ] , " -D " , 2 ) )
{
name = myargv [ i ] + 2 ;
val = strchr ( name , ' = ' ) ;
if ( val )
{
* val = ' \0 ' ;
val + + ;
}
cnst = QCC_PR_DefineName ( name ) ;
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
}
}
//optimisations.
else if ( ! strnicmp ( myargv [ i ] , " -O " , 2 ) | | ! strnicmp ( myargv [ i ] , " /O " , 2 ) )
{
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 ' )
{
}
else if ( ! strnicmp ( myargv [ i ] + 2 , " no- " , 3 ) )
{
2004-09-22 15:31:19 +00:00
if ( myargv [ i ] [ 5 ] )
{
2004-09-07 18:16:59 +00:00
for ( p = 0 ; optimisations [ p ] . enabled ; p + + )
2004-09-22 15:31:19 +00:00
{
2004-09-07 18:16:59 +00:00
if ( ( * optimisations [ p ] . abbrev & & ! stricmp ( myargv [ i ] + 5 , optimisations [ p ] . abbrev ) ) | | ! stricmp ( myargv [ i ] + 5 , optimisations [ p ] . fullname ) )
{
* optimisations [ p ] . enabled = false ;
break ;
}
2004-09-22 15:31:19 +00:00
}
}
2004-09-07 18:16:59 +00:00
}
else
{
if ( myargv [ i ] [ 2 ] )
for ( p = 0 ; optimisations [ p ] . enabled ; p + + )
if ( ( * optimisations [ p ] . abbrev & & ! stricmp ( myargv [ i ] + 2 , optimisations [ p ] . abbrev ) ) | | ! stricmp ( myargv [ i ] + 2 , optimisations [ p ] . fullname ) )
{
* optimisations [ p ] . enabled = true ;
break ;
}
}
if ( ! optimisations [ p ] . enabled )
QCC_PR_Warning ( 0 , NULL , WARN_BADPARAMS , " Unrecognised optimisation parameter (%s) " , myargv [ i ] ) ;
}
2011-05-15 13:23:13 +00:00
2004-09-07 18:16:59 +00:00
else if ( ! strnicmp ( myargv [ i ] , " -K " , 2 ) | | ! strnicmp ( myargv [ i ] , " /K " , 2 ) )
{
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 )
QCC_PR_Warning ( 0 , NULL , WARN_BADPARAMS , " Unrecognised keyword parameter (%s) " , myargv [ i ] ) ;
}
else if ( ! strnicmp ( myargv [ i ] , " -F " , 2 ) | | ! strnicmp ( myargv [ i ] , " /F " , 2 ) )
{
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 )
QCC_PR_Warning ( 0 , NULL , WARN_BADPARAMS , " Unrecognised flag parameter (%s) " , myargv [ i ] ) ;
}
else if ( ! strncmp ( myargv [ i ] , " -T " , 2 ) | | ! strncmp ( myargv [ i ] , " /T " , 2 ) )
{
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
{
for ( p = 0 ; targets [ p ] . name ; p + + )
if ( ! stricmp ( myargv [ i ] + 2 , targets [ p ] . name ) )
{
qcc_targetformat = targets [ p ] . target ;
break ;
}
2004-09-07 18:16:59 +00:00
2015-01-12 12:28:13 +00:00
if ( ! targets [ p ] . name )
QCC_PR_Warning ( 0 , NULL , WARN_BADPARAMS , " Unrecognised target parameter (%s) " , myargv [ i ] ) ;
}
2004-09-07 18:16:59 +00:00
}
else if ( ! strnicmp ( myargv [ i ] , " -W " , 2 ) | | ! strnicmp ( myargv [ i ] , " /W " , 2 ) )
{
if ( ! stricmp ( myargv [ i ] + 2 , " 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 )
{
if ( j = = WARN_FIXEDRETURNVALUECONFLICT )
continue ;
qccwarningaction [ j ] = WA_WARN ;
}
}
else if ( ! stricmp ( myargv [ i ] + 2 , " extra " ) )
{
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
}
2004-09-07 18:16:59 +00:00
else if ( ! stricmp ( myargv [ i ] + 2 , " 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 ;
}
2009-08-29 13:39:57 +00:00
else if ( ! stricmp ( myargv [ i ] + 2 , " 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 ;
}
2005-09-28 16:57:10 +00:00
else if ( ! stricmp ( myargv [ i ] + 2 , " no-mundane " ) )
{ //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_FIXEDRETURNVALUECONFLICT ] = 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
{
------------------------------------------------------------------------
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 ;
if ( ! strnicmp ( myargv [ i ] + 2 , " error- " , 6 ) )
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
p = QCC_WarningForName ( myargv [ i ] + 8 ) ;
if ( p > = 0 )
qccwarningaction [ p ] = WA_ERROR ;
}
else if ( ! strnicmp ( myargv [ i ] + 2 , " no- " , 3 ) )
{
p = QCC_WarningForName ( myargv [ i ] + 5 ) ;
if ( p > = 0 )
qccwarningaction [ p ] = WA_IGNORE ;
2004-09-07 18:16:59 +00:00
}
else
{
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
p = QCC_WarningForName ( myargv [ i ] + 2 ) ;
if ( p > = 0 )
qccwarningaction [ p ] = WA_WARN ;
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 ( p < 0 )
2004-09-07 18:16:59 +00:00
QCC_PR_Warning ( 0 , NULL , WARN_BADPARAMS , " Unrecognised warning parameter (%s) " , myargv [ 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 ( werror )
{
for ( j = 0 ; j < ERR_PARSEERRORS ; j + + )
if ( qccwarningaction [ j ] )
qccwarningaction [ j ] = WA_ERROR ;
}
2004-09-07 18:16:59 +00:00
}
/*
= = = = = = = = = = = =
main
= = = = = = = = = = = =
*/
char * qccmsrc ;
char * qccmsrc2 ;
char qccmfilename [ 1024 ] ;
char qccmprogsdat [ 1024 ] ;
char qccmsourcedir [ 1024 ] ;
void QCC_FinishCompile ( void ) ;
void SetEndian ( void ) ;
void QCC_SetDefaultProperties ( void )
{
int level ;
int i ;
2005-02-09 19:32:30 +00:00
Hash_InitTable ( & compconstantstable , MAX_CONSTANTS , qccHunkAlloc ( Hash_BytesForBuckets ( MAX_CONSTANTS ) ) ) ;
ForcedCRC = 0 ;
2009-03-29 23:47:29 +00:00
defaultstatic = 0 ;
2005-02-09 19:32:30 +00:00
2004-09-07 18:16:59 +00:00
QCC_PR_DefineName ( " FTEQCC " ) ;
if ( QCC_CheckParm ( " /Oz " ) )
{
qcc_targetformat = QCF_FTE ;
QCC_PR_DefineName ( " OP_COMP_STATEMENTS " ) ;
QCC_PR_DefineName ( " OP_COMP_DEFS " ) ;
QCC_PR_DefineName ( " OP_COMP_FIELDS " ) ;
QCC_PR_DefineName ( " OP_COMP_FUNCTIONS " ) ;
QCC_PR_DefineName ( " OP_COMP_STRINGS " ) ;
QCC_PR_DefineName ( " OP_COMP_GLOBALS " ) ;
QCC_PR_DefineName ( " OP_COMP_LINES " ) ;
QCC_PR_DefineName ( " OP_COMP_TYPES " ) ;
}
if ( QCC_CheckParm ( " /O0 " ) | | QCC_CheckParm ( " -O0 " ) )
level = 0 ;
else if ( QCC_CheckParm ( " /O1 " ) | | QCC_CheckParm ( " -O1 " ) )
level = 1 ;
else if ( QCC_CheckParm ( " /O2 " ) | | QCC_CheckParm ( " -O2 " ) )
level = 2 ;
else if ( QCC_CheckParm ( " /O3 " ) | | QCC_CheckParm ( " -O3 " ) )
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 ;
}
}
if ( QCC_CheckParm ( " -h2 " ) )
qcc_targetformat = QCF_HEXEN2 ;
else if ( QCC_CheckParm ( " -fte " ) )
qcc_targetformat = 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
else if ( QCC_CheckParm ( " -fteh2 " ) )
qcc_targetformat = QCF_FTEH2 ;
2008-10-16 23:04:36 +00:00
else if ( QCC_CheckParm ( " -dp " ) )
qcc_targetformat = QCF_DARKPLACES ;
2004-09-07 18:16:59 +00:00
else
qcc_targetformat = QCF_STANDARD ;
//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.
------------------------------------------------------------------------
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_NOTREFERENCEDCONST ] = WA_IGNORE ;
qccwarningaction [ WARN_MACROINSTRING ] = WA_IGNORE ;
2013-03-12 22:32:25 +00:00
// qccwarningaction[WARN_ASSIGNMENTTOCONSTANT] = WA_IGNORE;
------------------------------------------------------------------------
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_FIXEDRETURNVALUECONFLICT ] = WA_IGNORE ;
qccwarningaction [ WARN_EXTRAPRECACHE ] = WA_IGNORE ;
qccwarningaction [ WARN_DEADCODE ] = WA_IGNORE ;
qccwarningaction [ WARN_FTE_SPECIFIC ] = WA_IGNORE ;
qccwarningaction [ WARN_EXTENSION_USED ] = WA_IGNORE ;
qccwarningaction [ WARN_IFSTRING_USED ] = WA_IGNORE ;
qccwarningaction [ WARN_CORRECTEDRETURNTYPE ] = WA_IGNORE ;
2013-03-12 22:32:25 +00:00
qccwarningaction [ WARN_NOTUTF8 ] = WA_IGNORE ;
qccwarningaction [ WARN_UNINITIALIZED ] = WA_IGNORE ; //not sure about this being ignored by default.
2013-06-02 06:03:54 +00:00
qccwarningaction [ WARN_SELFNOTTHIS ] = WA_IGNORE ;
2013-06-23 02:17:02 +00:00
qccwarningaction [ WARN_EVILPREPROCESSOR ] = WA_WARN ; //FIXME: make into WA_ERROR;
2004-09-07 18:16:59 +00:00
if ( QCC_CheckParm ( " -h2 " ) )
2014-03-30 08:55:06 +00:00
qccwarningaction [ WARN_CASEINSENSITIVEFRAMEMACRO ] = WA_IGNORE ;
2004-09-07 18:16:59 +00:00
//Check the command line
QCC_PR_CommandLinePrecompilerOptions ( ) ;
------------------------------------------------------------------------
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 ( qcc_targetformat = = QCF_HEXEN2 | | qcc_targetformat = = QCF_FTEH2 ) //force on the thinktime keyword if hexen2 progs.
2013-07-31 00:28:22 +00:00
{
2004-09-07 18:16:59 +00:00
keyword_thinktime = true ;
2013-07-31 00:28:22 +00:00
keyword_until = true ;
keyword_loop = true ;
}
2004-09-07 18:16:59 +00:00
if ( QCC_CheckParm ( " /Debug " ) ) //disable any debug optimisations
{
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!
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
printf ( " -Facc is not supported on this platform. Please make a progs.src file instead \n " ) ;
# 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 ;
}
2004-09-07 18:16:59 +00:00
int qcc_compileactive = false ;
2005-02-09 19:32:30 +00:00
extern int accglobalsblock ;
2014-03-01 11:38:53 +00:00
extern int qcc_debugflag ;
2005-07-28 15:52:31 +00:00
char * originalqccmsrc ; //for autoprototype.
2014-05-30 03:57:30 +00:00
pbool QCC_main ( int argc , char * * argv ) //as part of the quake engine
2004-09-07 18:16:59 +00:00
{
2013-03-12 22:32:25 +00:00
extern int pr_bracelevel , tempsused ;
------------------------------------------------------------------------
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
int p ;
# ifndef QCCONLY
char destfile2 [ 1024 ] , * s2 ;
# endif
char * s ;
2014-05-30 03:57:30 +00:00
if ( numsourcefiles & & currentsourcefile = = numsourcefiles )
{
numsourcefiles = 0 ;
return false ;
}
if ( ! PreCompile ( ) )
return false ;
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 ;
2004-09-07 18:16:59 +00:00
MAX_STRINGS = 1000000 ;
2011-09-03 03:49:43 +00:00
MAX_GLOBALS = 1 < < 17 ;
MAX_FIELDS = 1 < < 12 ;
2005-02-28 07:16:19 +00:00
MAX_STATEMENTS = 0x80000 ;
2004-09-07 18:16:59 +00:00
MAX_FUNCTIONS = 16384 ;
maxtypeinfos = 16384 ;
MAX_CONSTANTS = 2048 ;
2005-02-28 07:16:19 +00:00
compressoutput = 0 ;
2004-09-07 18:16:59 +00:00
p = externs - > FileSize ( " qcc.cfg " ) ;
2014-10-05 20:04:11 +00:00
// if (p < 0)
// p = externs->FileSize("src/qcc.cfg");
2004-09-07 18:16:59 +00:00
if ( p > 0 )
{
s = qccHunkAlloc ( p + 1 ) ;
2014-10-05 20:04:11 +00:00
s = externs - > ReadFile ( " qcc.cfg " , s , p , NULL ) ;
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
printf ( " Bad token in qcc.cfg file \n " ) ;
}
}
/* 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 ) ;
strftime ( QCC_copyright , sizeof ( QCC_copyright ) , " Compiled [%Y/%m/%d] " , localtime ( & long_time ) ) ;
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 ;
optres_test1 = 0 ;
optres_test2 = 0 ;
2005-02-09 19:32:30 +00:00
accglobalsblock = 0 ;
2014-03-01 11:38:53 +00:00
qcc_debugflag = false ;
2005-02-09 19:32:30 +00:00
2004-09-07 18:16:59 +00:00
numtemps = 0 ;
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 ;
functions = ( void * ) qccHunkAlloc ( sizeof ( QCC_dfunction_t ) * MAX_FUNCTIONS ) ;
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 ;
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
2013-05-14 12:52:07 +00:00
for ( p = 1 ; p < myargc ; p + + )
{
if ( ! QC_strcasecmp ( " -v " , myargv [ p ] ) )
verbose + + ;
}
2004-09-07 18:16:59 +00:00
if ( QCC_CheckParm ( " /? " ) | | QCC_CheckParm ( " ? " ) | | QCC_CheckParm ( " -? " ) | | QCC_CheckParm ( " -help " ) | | QCC_CheckParm ( " --help " ) )
{
printf ( " qcc looks for progs.src in the current directory. \n " ) ;
printf ( " to look in a different directory: qcc -src <directory> \n " ) ;
// printf ("to build a clean data tree: qcc -copy <srcdir> <destdir>\n");
// printf ("to build a clean pak file: qcc -pak <srcdir> <packfile>\n");
// printf ("to bsp all bmodels: qcc -bspmodels <gamedir>\n");
printf ( " -Fwasm <funcname> causes FTEQCC to dump all asm to qc.asm \n " ) ;
printf ( " -O0 to disable optimisations \n " ) ;
printf ( " -O1 to optimise for size \n " ) ;
printf ( " -O2 to optimise more - some behaviours may change \n " ) ;
printf ( " -O3 to optimise lots - experimental or non-future-proof \n " ) ;
printf ( " -Oname to enable an optimisation \n " ) ;
printf ( " -Ono-name to disable optimisations \n " ) ;
printf ( " -Kkeyword to activate keyword \n " ) ;
printf ( " -Kno-keyword to disable keyword \n " ) ;
printf ( " -Wall to give a stupid number of warnings \n " ) ;
printf ( " -Ttarget to set a output format \n " ) ;
printf ( " -Fautoproto to enable automatic prototyping \n " ) ;
2010-12-22 01:05:33 +00:00
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
{
2014-03-30 08:55:06 +00:00
printf ( " Compiling without case sensitivity \n " ) ;
pHash_Get = & Hash_GetInsensitive ;
pHash_GetNext = & Hash_GetNextInsensitive ;
pHash_Add = & Hash_AddInsensitive ;
pHash_RemoveData = & Hash_RemoveDataInsensitive ;
2005-02-09 19:32:30 +00:00
}
2004-09-07 18:16:59 +00:00
p = QCC_CheckParm ( " -src " ) ;
if ( p & & p < argc - 1 )
{
strcpy ( qccmsourcedir , argv [ p + 1 ] ) ;
strcat ( qccmsourcedir , " / " ) ;
printf ( " Source directory: %s \n " , qccmsourcedir ) ;
}
else
2004-10-13 07:24:59 +00:00
* qccmsourcedir = ' \0 ' ;
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 ) ;
2005-02-09 19:32:30 +00:00
if ( flag_acc )
{
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 | | argv [ p + 1 ] [ 0 ] = = ' - ' )
p = QCC_CheckParm ( " -srcfile " ) ;
if ( p & & p < argc - 1 )
2011-05-15 13:23:13 +00:00
sprintf ( qccmprogsdat , " %s " , argv [ p + 1 ] ) ;
2008-11-09 22:29:28 +00:00
else
{ //look for a preprogs.src... :o)
2014-04-24 01:53:01 +00:00
sprintf ( qccmprogsdat , " %spreprogs.src " , qccmsourcedir ) ;
2008-11-09 22:29:28 +00:00
if ( externs - > FileSize ( qccmprogsdat ) < = 0 )
2010-05-01 22:47:47 +00:00
sprintf ( qccmprogsdat , " progs.src " ) ;
2014-04-24 01:53:01 +00:00
else
sprintf ( 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
}
2008-11-09 22:29:28 +00:00
else if ( currentsourcefile = = numsourcefiles )
{
//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 )
printf ( " ------------------------------------- \n " ) ;
2010-05-01 22:47:47 +00:00
sprintf ( qccmprogsdat , " %s%s " , qccmsourcedir , sourcefileslist [ currentsourcefile + + ] ) ;
2005-02-09 19:32:30 +00:00
printf ( " Source file: %s \n " , qccmprogsdat ) ;
2004-09-07 18:16:59 +00:00
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 ;
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 ;
}
------------------------------------------------------------------------
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
compilingfile = qccmprogsdat ;
2004-09-07 18:16:59 +00:00
if ( * qcc_token = = ' # ' )
2011-05-15 13:23:13 +00:00
{
2004-09-07 18:16:59 +00:00
void StartNewStyleCompile ( void ) ;
2004-12-24 08:45:56 +00:00
newstyle :
2004-09-07 18:16:59 +00:00
newstylesource = true ;
2013-06-13 22:45:15 +00:00
originalqccmsrc = qccmsrc ;
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
}
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 ;
if ( ! qccmsrc )
QCC_Error ( ERR_NOOUTPUT , " No destination filename. qcc -help for info. " ) ;
2004-12-24 08:45:56 +00:00
strcpy ( destfile , qcc_token ) ;
2004-09-07 18:16:59 +00:00
# ifndef QCCONLY
2006-09-17 00:59:22 +00:00
p = 0 ;
2011-05-15 13:23:13 +00:00
s2 = strcpy ( destfile2 , destfile ) ;
2004-09-07 18:16:59 +00:00
if ( ! strncmp ( s2 , " ./ " , 2 ) )
s2 + = 2 ;
else
{
while ( ! strncmp ( s2 , " ../ " , 3 ) )
{
s2 + = 3 ;
p + + ;
}
}
strcpy ( qccmfilename , qccmsourcedir ) ;
for ( s = qccmfilename + strlen ( qccmfilename ) ; p & & s > = qccmfilename ; s - - )
{
if ( * s = = ' / ' | | * s = = ' \\ ' )
{
* ( s + 1 ) = ' \0 ' ;
p - - ;
}
}
2006-09-17 00:59:22 +00:00
sprintf ( destfile , " %s " , s2 ) ;
2006-04-02 23:47:27 +00:00
while ( p > 0 )
{
memmove ( destfile + 3 , destfile , strlen ( destfile ) + 1 ) ;
destfile [ 0 ] = ' . ' ;
destfile [ 1 ] = ' . ' ;
destfile [ 2 ] = ' / ' ;
p - - ;
}
2004-09-07 18:16:59 +00:00
# endif
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 )
{
printf ( " %s changed \n " , qcc_token ) ;
modified = true ;
break ;
}
}
if ( ! modified )
{
printf ( " No changes \n " ) ;
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 ;
}
}
}
2004-09-07 18:16:59 +00:00
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 )
{
char * s , * s2 ;
currentchunk = NULL ;
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 ;
}
qccmsrc = QCC_COM_Parse ( qccmsrc ) ;
if ( ! qccmsrc )
{
2015-01-12 12:28:13 +00:00
if ( parseonly )
qcc_compileactive = false ;
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 ;
}
s = qcc_token ;
strcpy ( qccmfilename , qccmsourcedir ) ;
while ( 1 )
{
2010-07-18 10:01:57 +00:00
if ( ! strncmp ( s , " .. \\ " , 3 ) | | ! strncmp ( s , " ../ " , 3 ) )
2004-09-07 18:16:59 +00:00
{
s2 = qccmfilename + strlen ( qccmfilename ) - 2 ;
while ( s2 > = qccmfilename )
{
if ( * s2 = = ' / ' | | * s2 = = ' \\ ' )
{
s2 [ 1 ] = ' \0 ' ;
break ;
}
s2 - - ;
}
2010-07-18 10:01:57 +00:00
if ( s2 > = qccmfilename )
{
s + = 3 ;
continue ;
}
2004-09-07 18:16:59 +00:00
}
2010-07-18 10:01:57 +00:00
if ( ! strncmp ( s , " . \\ " , 2 ) | | ! strncmp ( s , " ./ " , 2 ) )
2004-09-07 18:16:59 +00:00
{
s + = 2 ;
continue ;
}
break ;
}
strcat ( qccmfilename , s ) ;
if ( autoprototype )
printf ( " prototyping %s \n " , qccmfilename ) ;
else
2009-11-04 21:16:50 +00:00
{
2004-09-07 18:16:59 +00:00
printf ( " compiling %s \n " , qccmfilename ) ;
2009-11-04 21:16:50 +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 " ) ;
}
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 ) )
QCC_Error ( ERR_INTERNAL , " " ) ;
2011-05-15 13:23:13 +00:00
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
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 ( ) ;
2008-11-09 22:29:28 +00:00
if ( donesomething )
{
2009-11-04 21:16:50 +00:00
if ( verbose )
{
printf ( " Compile Complete \n \n " ) ;
if ( optres_shortenifnots )
printf ( " optres_shortenifnots %i \n " , optres_shortenifnots ) ;
if ( optres_overlaptemps )
printf ( " optres_overlaptemps %i \n " , optres_overlaptemps ) ;
if ( optres_noduplicatestrings )
printf ( " optres_noduplicatestrings %i \n " , optres_noduplicatestrings ) ;
if ( optres_constantarithmatic )
printf ( " optres_constantarithmatic %i \n " , optres_constantarithmatic ) ;
if ( optres_nonvec_parms )
printf ( " optres_nonvec_parms %i \n " , optres_nonvec_parms ) ;
if ( optres_constant_names )
printf ( " optres_constant_names %i \n " , optres_constant_names ) ;
if ( optres_constant_names_strings )
printf ( " optres_constant_names_strings %i \n " , optres_constant_names_strings ) ;
if ( optres_precache_file )
printf ( " optres_precache_file %i \n " , optres_precache_file ) ;
if ( optres_filenames )
printf ( " optres_filenames %i \n " , optres_filenames ) ;
if ( optres_assignments )
printf ( " optres_assignments %i \n " , optres_assignments ) ;
if ( optres_unreferenced )
printf ( " optres_unreferenced %i \n " , optres_unreferenced ) ;
if ( optres_locals )
printf ( " optres_locals %i \n " , optres_locals ) ;
if ( optres_function_names )
printf ( " optres_function_names %i \n " , optres_function_names ) ;
if ( optres_dupconstdefs )
printf ( " optres_dupconstdefs %i \n " , optres_dupconstdefs ) ;
if ( optres_return_only )
printf ( " optres_return_only %i \n " , optres_return_only ) ;
if ( optres_compound_jumps )
printf ( " optres_compound_jumps %i \n " , optres_compound_jumps ) ;
// if (optres_comexprremoval)
// printf("optres_comexprremoval %i\n", optres_comexprremoval);
if ( optres_stripfunctions )
printf ( " optres_stripfunctions %i \n " , optres_stripfunctions ) ;
2013-03-12 22:32:25 +00:00
if ( optres_locals_overlapping )
printf ( " optres_locals_overlapping %i \n " , optres_locals_overlapping ) ;
2009-11-04 21:16:50 +00:00
if ( optres_logicops )
printf ( " optres_logicops %i \n " , optres_logicops ) ;
if ( optres_test1 )
printf ( " optres_test1 %i \n " , optres_test1 ) ;
if ( optres_test2 )
printf ( " optres_test2 %i \n " , optres_test2 ) ;
2011-05-15 13:23:13 +00:00
2009-11-04 21:16:50 +00:00
printf ( " numtemps %i \n " , numtemps ) ;
}
if ( ! flag_msvcstyle )
2013-09-26 14:36:52 +00:00
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 QCC_string_t s_file , s_file2 ;
extern char * pr_file_p ;
extern int pr_source_line ;
extern QCC_def_t * pr_scope ;
void QCC_PR_ParseDefs ( char * classname ) ;
void StartNewStyleCompile ( void )
{
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 ;
pr_file_p = qccmsrc ;
s_file = s_file2 = QCC_CopyString ( compilingfile ) ;
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
{
qccmsrc = originalqccmsrc ;
pr_file_p = qccmsrc ;
s_file = s_file2 = QCC_CopyString ( compilingfile ) ;
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 ( ) ;
2013-06-13 22:45:15 +00:00
PostCompile ( ) ;
2014-05-30 03:57:30 +00:00
if ( ! QCC_main ( myargc , myargv ) )
2013-06-13 22:45:15 +00:00
return ;
return ;
}
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 ( NULL ) ;
}
/*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);
// printf ("compiling %s\n", qccmfilename);
// 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