mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 09:02:08 +00:00
Fix defs as constants for vectors and quaternions.
This commit is contained in:
parent
38b25e0c38
commit
c4a398850a
2 changed files with 9 additions and 0 deletions
|
@ -106,6 +106,7 @@ extern struct symtab_s *current_symtab;
|
||||||
#define D_FLOAT(d) D_var (float, d)
|
#define D_FLOAT(d) D_var (float, d)
|
||||||
#define D_INT(d) D_var (integer, d)
|
#define D_INT(d) D_var (integer, d)
|
||||||
#define D_VECTOR(d) D_var (vector, d)
|
#define D_VECTOR(d) D_var (vector, d)
|
||||||
|
#define D_QUAT(d) D_var (quat, d)
|
||||||
#define D_STRING(d) D_var (string, d)
|
#define D_STRING(d) D_var (string, d)
|
||||||
#define D_GETSTR(d) GETSTR (D_STRING (d))
|
#define D_GETSTR(d) GETSTR (D_STRING (d))
|
||||||
#define D_FUNCTION(d) D_var (func, d)
|
#define D_FUNCTION(d) D_var (func, d)
|
||||||
|
|
|
@ -702,6 +702,10 @@ expr_vector (expr_t *e)
|
||||||
if (e->type == ex_symbol && e->e.symbol->sy_type == sy_const
|
if (e->type == ex_symbol && e->e.symbol->sy_type == sy_const
|
||||||
&& e->e.symbol->type->type == ev_vector)
|
&& e->e.symbol->type->type == ev_vector)
|
||||||
return e->e.symbol->s.value.v.vector_val;
|
return e->e.symbol->s.value.v.vector_val;
|
||||||
|
if (e->type == ex_symbol && e->e.symbol->sy_type == sy_var
|
||||||
|
&& e->e.symbol->s.def->constant
|
||||||
|
&& e->e.symbol->s.def->type->type == ev_vector)
|
||||||
|
return D_VECTOR (e->e.symbol->s.def);
|
||||||
internal_error (e, "not a vector constant");
|
internal_error (e, "not a vector constant");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -728,6 +732,10 @@ expr_quaternion (expr_t *e)
|
||||||
if (e->type == ex_symbol && e->e.symbol->sy_type == sy_const
|
if (e->type == ex_symbol && e->e.symbol->sy_type == sy_const
|
||||||
&& e->e.symbol->type->type == ev_quat)
|
&& e->e.symbol->type->type == ev_quat)
|
||||||
return e->e.symbol->s.value.v.quaternion_val;
|
return e->e.symbol->s.value.v.quaternion_val;
|
||||||
|
if (e->type == ex_symbol && e->e.symbol->sy_type == sy_var
|
||||||
|
&& e->e.symbol->s.def->constant
|
||||||
|
&& e->e.symbol->s.def->type->type == ev_quat)
|
||||||
|
return D_QUAT (e->e.symbol->s.def);
|
||||||
internal_error (e, "not a quaternion constant");
|
internal_error (e, "not a quaternion constant");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue