Fix misc bugs.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4632 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2014-04-03 02:39:51 +00:00
parent 7ece1c70cb
commit d124fe8cf0
5 changed files with 26 additions and 29 deletions

View file

@ -3347,8 +3347,10 @@ void CL_LinkPacketEntities (void)
if (!(dl->flags & PFLAGS_FULLDYNAMIC)) //corona-only lights shouldn't do much else. if (!(dl->flags & PFLAGS_FULLDYNAMIC)) //corona-only lights shouldn't do much else.
{ {
dl->flags &= ~(LFLAG_LIGHTMAP|LFLAG_FLASHBLEND); dl->flags &= ~(LFLAG_LIGHTMAP|LFLAG_FLASHBLEND);
#ifdef RTLIGHTS
/*make sure there's no rtlight*/ /*make sure there's no rtlight*/
memset(dl->lightcolourscales, 0, sizeof(dl->lightcolourscales)); memset(dl->lightcolourscales, 0, sizeof(dl->lightcolourscales));
#endif
} }
dl->corona = (state->lightpflags & PFLAGS_CORONA)?1:0; dl->corona = (state->lightpflags & PFLAGS_CORONA)?1:0;
dl->coronascale = 0.25; dl->coronascale = 0.25;

View file

@ -409,7 +409,7 @@ typedef union QCC_eval_s
const extern unsigned int type_size[]; const extern unsigned int type_size[];
//extern QCC_def_t *def_for_type[9]; //extern QCC_def_t *def_for_type[9];
extern QCC_type_t *type_void, *type_string, *type_float, *type_vector, *type_entity, *type_field, *type_function, *type_pointer, *type_floatpointer, *type_intpointer, *type_integer, *type_variant, *type_floatfield; extern QCC_type_t *type_void, *type_string, *type_float, *type_vector, *type_entity, *type_field, *type_function, *type_floatfunction, *type_pointer, *type_floatpointer, *type_intpointer, *type_integer, *type_variant, *type_floatfield;
struct QCC_function_s struct QCC_function_s
{ {

View file

@ -5517,16 +5517,20 @@ QCC_ref_t *QCC_PR_ParseRefValue (QCC_ref_t *refbuf, QCC_type_t *assumeclass, pbo
if (!d) if (!d)
{ {
if ( (!strcmp(name, "random" )) || if ( (!strcmp(name, "randomv")) ||
(!strcmp(name, "randomv")) ||
(!strcmp(name, "sizeof")) || (!strcmp(name, "sizeof")) ||
(!strcmp(name, "entnum")) || (!strcmp(name, "entnum")) ||
(!strcmp(name, "va_arg")) || (!strcmp(name, "va_arg")) ||
(!strcmp(name, "_"))) //intrinsics, any old function with no args will do. (!strcmp(name, "_")) ) //intrinsics, any old function with no args will do.
{ {
d = QCC_PR_GetDef (type_function, name, NULL, true, 0, false); d = QCC_PR_GetDef (type_function, name, NULL, true, 0, false);
d->initialized = 0; d->initialized = 0;
} }
else if ( (!strcmp(name, "random" )) ) //intrinsics, any old function with no args will do. returning a float just in case people declare things in the wrong order
{
d = QCC_PR_GetDef (type_floatfunction, name, NULL, true, 0, false);
d->initialized = 0;
}
else if (keyword_class && !strcmp(name, "this")) else if (keyword_class && !strcmp(name, "this"))
{ {
if (!pr_classtype) if (!pr_classtype)

View file

@ -67,32 +67,22 @@ char *pr_punctuationremap[] = //a nice bit of evilness.
{"&&", "||", "<=", ">=","==", "!=", "/=", "*=", "+=", "-=", "|=", "&~=", "|=", "&~=", "&=", "++", "--", ".", "^=", "::", ";", ",", "!", "*", "/", "(", ")", "-", "+", "=", "[", "]", "{", "}", "...", "..", ".", "<<", "<", ">>", ">" , "?", "#" , "@", "&" , "|", "^", "~", ":", NULL}; {"&&", "||", "<=", ">=","==", "!=", "/=", "*=", "+=", "-=", "|=", "&~=", "|=", "&~=", "&=", "++", "--", ".", "^=", "::", ";", ",", "!", "*", "/", "(", ")", "-", "+", "=", "[", "]", "{", "}", "...", "..", ".", "<<", "<", ">>", ">" , "?", "#" , "@", "&" , "|", "^", "~", ":", NULL};
// simple types. function types are dynamically allocated // simple types. function types are dynamically allocated
QCC_type_t *type_void;// = {ev_void/*, &def_void*/}; QCC_type_t *type_void; //void
QCC_type_t *type_string;// = {ev_string/*, &def_string*/}; QCC_type_t *type_string; //string
QCC_type_t *type_float;// = {ev_float/*, &def_float*/}; QCC_type_t *type_float; //float
QCC_type_t *type_vector;// = {ev_vector/*, &def_vector*/}; QCC_type_t *type_vector; //vector
QCC_type_t *type_entity;// = {ev_entity/*, &def_entity*/}; QCC_type_t *type_entity; //entity
QCC_type_t *type_field;// = {ev_field/*, &def_field*/}; QCC_type_t *type_field; //.void
QCC_type_t *type_function;// = {ev_function/*, &def_function*/,NULL,&type_void}; QCC_type_t *type_function; //void()
// type_function is a void() function used for state defs QCC_type_t *type_floatfunction; //float()
QCC_type_t *type_pointer;// = {ev_pointer/*, &def_pointer*/}; QCC_type_t *type_pointer; //??? * - careful with this one
QCC_type_t *type_integer;// = {ev_integer/*, &def_integer*/}; QCC_type_t *type_integer; //int
QCC_type_t *type_variant;// = {ev_integer/*, &def_integer*/}; QCC_type_t *type_variant; //__variant
QCC_type_t *type_floatpointer; QCC_type_t *type_floatpointer; //float *
QCC_type_t *type_intpointer; QCC_type_t *type_intpointer; //int *
QCC_type_t *type_floatfield;// = {ev_field/*, &def_field*/, NULL, &type_float}; QCC_type_t *type_floatfield;// = {ev_field/*, &def_field*/, NULL, &type_float};
/*QCC_def_t def_void = {type_void, "temp"};
QCC_def_t def_string = {type_string, "temp"};
QCC_def_t def_float = {type_float, "temp"};
QCC_def_t def_vector = {type_vector, "temp"};
QCC_def_t def_entity = {type_entity, "temp"};
QCC_def_t def_field = {type_field, "temp"};
QCC_def_t def_function = {type_function, "temp"};
QCC_def_t def_pointer = {type_pointer, "temp"};
QCC_def_t def_integer = {type_integer, "temp"};
*/
QCC_def_t def_ret, def_parms[MAX_PARMS]; QCC_def_t def_ret, def_parms[MAX_PARMS];
//QCC_def_t *def_for_type[9] = {&def_void, &def_string, &def_float, &def_vector, &def_entity, &def_field, &def_function, &def_pointer, &def_integer}; //QCC_def_t *def_for_type[9] = {&def_void, &def_string, &def_float, &def_vector, &def_entity, &def_field, &def_function, &def_pointer, &def_integer};

View file

@ -1810,6 +1810,7 @@ void QCC_PR_BeginCompilation (void *memory, int memsize)
type_entity = QCC_PR_NewType("entity", ev_entity, true); type_entity = QCC_PR_NewType("entity", ev_entity, true);
type_field = QCC_PR_NewType("__field", ev_field, false); type_field = QCC_PR_NewType("__field", ev_field, false);
type_function = QCC_PR_NewType("__function", ev_function, false); type_function = QCC_PR_NewType("__function", ev_function, false);
type_function->aux_type = type_void;
type_pointer = QCC_PR_NewType("__pointer", ev_pointer, false); type_pointer = QCC_PR_NewType("__pointer", ev_pointer, false);
type_integer = QCC_PR_NewType("__integer", ev_integer, true); 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);
@ -1823,8 +1824,8 @@ void QCC_PR_BeginCompilation (void *memory, int memsize)
type_intpointer->aux_type = type_integer; type_intpointer->aux_type = type_integer;
type_floatpointer = QCC_PR_NewType("__floatpointer", ev_pointer, false); type_floatpointer = QCC_PR_NewType("__floatpointer", ev_pointer, false);
type_floatpointer->aux_type = type_float; type_floatpointer->aux_type = type_float;
type_floatfunction = QCC_PR_NewType("__floatfunction", ev_function, false);
type_function->aux_type = type_void; type_floatfunction->aux_type = type_float;
//type_field->aux_type = type_float; //type_field->aux_type = type_float;