mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +00:00
poundonly flag for preqcc-dependant mods
constant name max increased to 64 git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1267 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
8b099781da
commit
cf1ec0b425
4 changed files with 5 additions and 2 deletions
|
@ -63,7 +63,7 @@ extern int MAX_FUNCTIONS;
|
||||||
#define MAX_DATA_PATH 64
|
#define MAX_DATA_PATH 64
|
||||||
|
|
||||||
extern int MAX_CONSTANTS;
|
extern int MAX_CONSTANTS;
|
||||||
#define MAXCONSTANTLENGTH 32
|
#define MAXCONSTANTLENGTH 64
|
||||||
#define MAXCONSTANTVALUELENGTH 256
|
#define MAXCONSTANTVALUELENGTH 256
|
||||||
#define MAXCONSTANTPARAMLENGTH 32
|
#define MAXCONSTANTPARAMLENGTH 32
|
||||||
#define MAXCONSTANTPARAMS 8
|
#define MAXCONSTANTPARAMS 8
|
||||||
|
@ -476,6 +476,7 @@ extern pbool flag_ifstring;
|
||||||
extern pbool flag_acc;
|
extern pbool flag_acc;
|
||||||
extern pbool flag_caseinsensative;
|
extern pbool flag_caseinsensative;
|
||||||
extern pbool flag_laxcasts;
|
extern pbool flag_laxcasts;
|
||||||
|
extern pbool flag_poundonly;
|
||||||
|
|
||||||
extern pbool opt_overlaptemps;
|
extern pbool opt_overlaptemps;
|
||||||
extern pbool opt_shortenifnots;
|
extern pbool opt_shortenifnots;
|
||||||
|
|
|
@ -71,6 +71,7 @@ pbool flag_ifstring; //makes if (blah) equivelent to if (blah != "") which reso
|
||||||
pbool flag_acc; //reacc like behaviour of src files (finds *.qc in start dir and compiles all in alphabetical order)
|
pbool flag_acc; //reacc like behaviour of src files (finds *.qc in start dir and compiles all in alphabetical order)
|
||||||
pbool flag_caseinsensative; //symbols will be matched to an insensative case if the specified case doesn't exist. This should b usable for any mod
|
pbool flag_caseinsensative; //symbols will be matched to an insensative case if the specified case doesn't exist. This should b usable for any mod
|
||||||
pbool flag_laxcasts; //Allow lax casting. This'll produce loadsa warnings of course. But allows compilation of certain dodgy code.
|
pbool flag_laxcasts; //Allow lax casting. This'll produce loadsa warnings of course. But allows compilation of certain dodgy code.
|
||||||
|
pbool flag_poundonly; //Allows use of only #constant for precompiler constants, allows certain preqcc using mods to compile
|
||||||
|
|
||||||
pbool opt_overlaptemps; //reduce numpr_globals by reuse of temps. When they are not needed they are freed for reuse. The way this is implemented is better than frikqcc's. (This is the single most important optimisation)
|
pbool opt_overlaptemps; //reduce numpr_globals by reuse of temps. When they are not needed they are freed for reuse. The way this is implemented is better than frikqcc's. (This is the single most important optimisation)
|
||||||
pbool opt_assignments; //STORE_F isn't used if an operation wrote to a temp.
|
pbool opt_assignments; //STORE_F isn't used if an operation wrote to a temp.
|
||||||
|
|
|
@ -2285,7 +2285,7 @@ void QCC_PR_Lex (void)
|
||||||
|
|
||||||
if ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' )
|
if ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' )
|
||||||
{
|
{
|
||||||
if (!QCC_PR_CheakCompConst()) //look for a macro.
|
if (flag_poundonly || !QCC_PR_CheakCompConst()) //look for a macro.
|
||||||
QCC_PR_LexName ();
|
QCC_PR_LexName ();
|
||||||
else
|
else
|
||||||
if (pr_token_type == tt_eof)
|
if (pr_token_type == tt_eof)
|
||||||
|
|
|
@ -219,6 +219,7 @@ compiler_flag_t compiler_flag[] = {
|
||||||
{&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 ¦ as EOF. Whilst case insensativity and lax type checking are supported by reacc, they are seperate compiler flags in fteqcc."}, //reacc like behaviour of src files.
|
{&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 ¦ as EOF. Whilst case insensativity and lax type checking are supported by reacc, they are seperate compiler flags in fteqcc."}, //reacc like behaviour of src files.
|
||||||
{&flag_caseinsensative, 0, "caseinsens", "Case insensativity", "Causes fteqcc to become case insensative 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 insensative case if the specified case doesn't exist. This should b usable for any mod
|
{&flag_caseinsensative, 0, "caseinsens", "Case insensativity", "Causes fteqcc to become case insensative 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 insensative case if the specified case doesn't exist. This should b usable for any mod
|
||||||
{&flag_laxcasts, FLAG_MIDCOMPILE,"lax", "Lax type checks", "Disables many errors (generating warnings instead) when function calls or operations refer to two normally incompatable 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.
|
{&flag_laxcasts, FLAG_MIDCOMPILE,"lax", "Lax type checks", "Disables many errors (generating warnings instead) when function calls or operations refer to two normally incompatable 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.
|
||||||
|
{&flag_poundonly, FLAG_MIDCOMPILE,"poundonly", "Pound-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. This code is advised:\nplayer_stand1:\n if (self.velocity_x || self.velocity_y)\nplayer_run\n if (!(self.velocity_x || self.velocity_y))"},
|
{&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. This code is advised:\nplayer_stand1:\n if (self.velocity_x || self.velocity_y)\nplayer_run\n if (!(self.velocity_x || self.velocity_y))"},
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue