mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +00:00
Fixes
This commit is contained in:
parent
5f2b7e3d57
commit
3fa74da2b5
1 changed files with 10 additions and 6 deletions
16
fold.c
16
fold.c
|
@ -383,13 +383,17 @@ static GMQCC_INLINE ast_expression *fold_op_sub(fold_t *fold, ast_value *a, ast_
|
|||
|
||||
static GMQCC_INLINE ast_expression *fold_op_mul(fold_t *fold, ast_value *a, ast_value *b) {
|
||||
if (isfloat(a)) {
|
||||
if (isfloat(b) && fold_can_2(a, b))
|
||||
return fold_constgen_vector(fold, vec3_mulvf(fold_immvalue_vector(b), fold_immvalue_float(a)));
|
||||
else if (fold_can_2(a, b))
|
||||
return fold_constgen_float(fold, fold_immvalue_float(a) * fold_immvalue_float(b));
|
||||
if (isfloat(b)) {
|
||||
if (fold_can_2(a, b))
|
||||
return fold_constgen_vector(fold, vec3_mulvf(fold_immvalue_vector(b), fold_immvalue_float(a)));
|
||||
} else {
|
||||
if (fold_can_2(a, b))
|
||||
return fold_constgen_float(fold, fold_immvalue_float(a) * fold_immvalue_float(b));
|
||||
}
|
||||
} else if (isvector(a)) {
|
||||
if (isfloat(b) && fold_can_2(a, b)) {
|
||||
return fold_constgen_vector(fold, vec3_mulvf(fold_immvalue_vector(a), fold_immvalue_float(b)));
|
||||
if (isfloat(b)) {
|
||||
if (fold_can_2(a, b))
|
||||
return fold_constgen_vector(fold, vec3_mulvf(fold_immvalue_vector(a), fold_immvalue_float(b)));
|
||||
} else {
|
||||
if (fold_can_2(a, b)) {
|
||||
return fold_constgen_float(fold, vec3_mulvv(fold_immvalue_vector(a), fold_immvalue_vector(b)));
|
||||
|
|
Loading…
Reference in a new issue