nest floating point addition and multiply operations (#794)

* nest floating point addition and multiply operations

* fix mood
This commit is contained in:
water111 2021-08-31 12:04:46 -04:00 committed by GitHub
parent c10834025f
commit 41507f1aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 581 additions and 870 deletions

View file

@ -115,6 +115,12 @@ class SimpleExpressionElement : public FormElement {
FormStack& stack,
std::vector<FormElement*>* result,
bool allow_side_effects);
void update_from_stack_float_2_nestable(const Env& env,
FixedOperatorKind kind,
FormPool& pool,
FormStack& stack,
std::vector<FormElement*>* result,
bool allow_side_effects);
void update_from_stack_float_1(const Env& env,
FixedOperatorKind kind,
FormPool& pool,

View file

@ -670,6 +670,9 @@ void SimpleExpressionElement::update_from_stack_div_s(const Env& env,
}
}
/*!
* Update a two-argument form that uses two floats.
*/
void SimpleExpressionElement::update_from_stack_float_2(const Env& env,
FixedOperatorKind kind,
FormPool& pool,
@ -678,8 +681,6 @@ void SimpleExpressionElement::update_from_stack_float_2(const Env& env,
bool allow_side_effects) {
if (is_float_type(env, m_my_idx, m_expr.get_arg(0).var()) &&
is_float_type(env, m_my_idx, m_expr.get_arg(1).var())) {
// todo - check the order here
auto args = pop_to_forms({m_expr.get_arg(0).var(), m_expr.get_arg(1).var()}, env, pool, stack,
allow_side_effects);
auto new_form = pool.alloc_element<GenericElement>(GenericOperator::make_fixed(kind),
@ -694,6 +695,97 @@ void SimpleExpressionElement::update_from_stack_float_2(const Env& env,
}
}
namespace {
std::vector<Form*> get_math_op_elements(Form* in, FixedOperatorKind kind) {
auto gen_elt = in->try_as_element<GenericElement>();
if (gen_elt && gen_elt->op().is_fixed(kind)) {
return gen_elt->elts();
} else {
return {in};
}
}
FormElement* make_and_compact_math_op(Form* arg0,
Form* arg1,
const std::optional<TypeSpec>& arg0_cast,
const std::optional<TypeSpec>& arg1_cast,
FormPool& pool,
const Env& env,
FixedOperatorKind operator_kind,
bool inline_first,
bool inline_second) {
if (!arg1_cast) {
std::vector<Form*> arg0_elts;
if (inline_first) {
arg0_elts = get_math_op_elements(arg0, operator_kind);
} else {
arg0_elts = {arg0};
}
assert(!arg0_elts.empty());
if (arg0_cast) {
arg0_elts.front() = cast_form(arg0_elts.front(), *arg0_cast, pool, env);
}
// it's fine to only cast the first thing here - the rest are already cast properly.
std::vector<Form*> arg1_elts;
if (inline_second) {
arg1_elts = get_math_op_elements(arg1, operator_kind);
} else {
arg1_elts = {arg1};
}
assert(!arg1_elts.empty());
if (arg1_cast) {
arg1_elts.front() = cast_form(arg1_elts.front(), *arg1_cast, pool, env);
}
// add all together
arg0_elts.insert(arg0_elts.end(), arg1_elts.begin(), arg1_elts.end());
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(operator_kind),
arg0_elts);
} else {
if (arg0_cast) {
arg0 = cast_form(arg0, *arg0_cast, pool, env);
}
if (arg1_cast) {
arg1 = cast_form(arg1, *arg1_cast, pool, env);
}
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(operator_kind), arg0,
arg1);
}
}
} // namespace
/*!
* Update a two-argument form that uses two floats.
* This is for operations like * and + that can be nested
* (* (* a b)) -> (* a b c)
* Note that we only apply this to the _first_ argument to keep the order of operations the same.
*/
void SimpleExpressionElement::update_from_stack_float_2_nestable(const Env& env,
FixedOperatorKind kind,
FormPool& pool,
FormStack& stack,
std::vector<FormElement*>* result,
bool allow_side_effects) {
if (is_float_type(env, m_my_idx, m_expr.get_arg(0).var()) &&
is_float_type(env, m_my_idx, m_expr.get_arg(1).var())) {
auto args = pop_to_forms({m_expr.get_arg(0).var(), m_expr.get_arg(1).var()}, env, pool, stack,
allow_side_effects);
auto new_form =
make_and_compact_math_op(args.at(0), args.at(1), {}, {}, pool, env, kind, true, false);
result->push_back(new_form);
} else {
auto type0 = env.get_types_before_op(m_my_idx).get(m_expr.get_arg(0).var().reg());
auto type1 = env.get_types_before_op(m_my_idx).get(m_expr.get_arg(1).var().reg());
throw std::runtime_error(fmt::format(
"[OP: {}] - Floating point math attempted on invalid types: {} and {} in op {}.", m_my_idx,
type0.print(), type1.print(), to_string(env)));
}
}
void SimpleExpressionElement::update_from_stack_float_1(const Env& env,
FixedOperatorKind kind,
FormPool& pool,
@ -723,54 +815,6 @@ void SimpleExpressionElement::update_from_stack_si_1(const Env& env,
make_cast_if_needed(arg, in_type, TypeSpec("int"), pool, env)));
}
namespace {
std::vector<Form*> get_addition_elements(Form* in) {
auto gen_elt = in->try_as_element<GenericElement>();
if (gen_elt && gen_elt->op().is_fixed(FixedOperatorKind::ADDITION)) {
return gen_elt->elts();
} else {
return {in};
}
}
FormElement* make_and_compact_addition(Form* arg0,
Form* arg1,
const std::optional<TypeSpec>& arg0_cast,
const std::optional<TypeSpec>& arg1_cast,
FormPool& pool,
const Env& env) {
if (!arg1_cast) {
auto arg0_elts = get_addition_elements(arg0);
assert(!arg0_elts.empty());
if (arg0_cast) {
arg0_elts.front() = cast_form(arg0_elts.front(), *arg0_cast, pool, env);
}
// it's fine to only cast the first thing here - the rest are already cast properly.
auto arg1_elts = get_addition_elements(arg1);
assert(!arg1_elts.empty());
if (arg1_cast) {
arg1_elts.front() = cast_form(arg1_elts.front(), *arg1_cast, pool, env);
}
// add all together
arg0_elts.insert(arg0_elts.end(), arg1_elts.begin(), arg1_elts.end());
return pool.alloc_element<GenericElement>(
GenericOperator::make_fixed(FixedOperatorKind::ADDITION), arg0_elts);
} else {
if (arg0_cast) {
arg0 = cast_form(arg0, *arg0_cast, pool, env);
}
if (arg1_cast) {
arg1 = cast_form(arg1, *arg1_cast, pool, env);
}
return pool.alloc_element<GenericElement>(
GenericOperator::make_fixed(FixedOperatorKind::ADDITION), arg0, arg1);
}
}
} // namespace
void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
FormPool& pool,
FormStack& stack,
@ -1050,11 +1094,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
}
}
if (false && ((arg0_i && arg1_i) || (arg0_u && arg1_u))) {
auto new_form = pool.alloc_element<GenericElement>(
GenericOperator::make_fixed(FixedOperatorKind::ADDITION), args.at(0), args.at(1));
result->push_back(new_form);
} else if (arg0_ptr) {
if (arg0_ptr) {
auto new_form = pool.alloc_element<GenericElement>(
GenericOperator::make_fixed(FixedOperatorKind::ADDITION_PTR), args.at(0), args.at(1));
result->push_back(new_form);
@ -1076,8 +1116,8 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
arg1_cast = TypeSpec(arg0_i ? "int" : "uint");
}
result->push_back(
make_and_compact_addition(args.at(0), args.at(1), arg0_cast, arg1_cast, pool, env));
result->push_back(make_and_compact_math_op(args.at(0), args.at(1), arg0_cast, arg1_cast, pool,
env, FixedOperatorKind::ADDITION, true, true));
}
}
@ -1960,12 +2000,12 @@ void SimpleExpressionElement::update_from_stack(const Env& env,
allow_side_effects);
break;
case SimpleExpression::Kind::MUL_S:
update_from_stack_float_2(env, FixedOperatorKind::MULTIPLICATION, pool, stack, result,
allow_side_effects);
update_from_stack_float_2_nestable(env, FixedOperatorKind::MULTIPLICATION, pool, stack,
result, allow_side_effects);
break;
case SimpleExpression::Kind::ADD_S:
update_from_stack_float_2(env, FixedOperatorKind::ADDITION, pool, stack, result,
allow_side_effects);
update_from_stack_float_2_nestable(env, FixedOperatorKind::ADDITION, pool, stack, result,
allow_side_effects);
break;
case SimpleExpression::Kind::MAX_S:
update_from_stack_float_2(env, FixedOperatorKind::FMAX, pool, stack, result,

View file

@ -5,6 +5,10 @@
;; name in dgo: mood
;; dgos: GAME, ENGINE
;; TODO
(define-extern update-mood-lightning (function mood-context int int int int float symbol none))
(define-extern update-mood-lava (function mood-context float int symbol none))
;; definition for function clear-mood-times
(defun clear-mood-times ((arg0 mood-context))
(dotimes (v1-0 8)
@ -214,7 +218,8 @@
(let
((f0-14
(+
(+ (* 2.0 (-> v1-12 lgt-color x)) (* 4.0 (-> v1-12 lgt-color y)))
(* 2.0 (-> v1-12 lgt-color x))
(* 4.0 (-> v1-12 lgt-color y))
(-> v1-12 lgt-color z)
)
)
@ -263,7 +268,8 @@
((f0-28
(*
(+
(+ (* 2.0 (-> s0-0 lgt-color x)) (* 4.0 (-> s0-0 lgt-color y)))
(* 2.0 (-> s0-0 lgt-color x))
(* 4.0 (-> s0-0 lgt-color y))
(-> s0-0 lgt-color z)
)
(- 1.0 f30-0)
@ -272,7 +278,8 @@
(f1-26
(*
(+
(+ (* 2.0 (-> s1-0 lgt-color x)) (* 4.0 (-> s1-0 lgt-color y)))
(* 2.0 (-> s1-0 lgt-color x))
(* 4.0 (-> s1-0 lgt-color y))
(-> s1-0 lgt-color z)
)
f30-0
@ -477,7 +484,8 @@
(let
((f0-3
(+
(+ (* 2.0 (-> a1-11 lgt-color x)) (* 4.0 (-> a1-11 lgt-color y)))
(* 2.0 (-> a1-11 lgt-color x))
(* 4.0 (-> a1-11 lgt-color y))
(-> a1-11 lgt-color z)
)
)
@ -726,7 +734,7 @@
)
(else
(let ((f0-13 (sin (* 32768.0 (/ (the float a0-1) (the float v1-2))))))
(set! (-> arg0 times s4-0 w) (+ (* (* (the float s0-0) f0-13) arg5) arg4))
(set! (-> arg0 times s4-0 w) (+ (* (the float s0-0) f0-13 arg5) arg4))
)
(if (not (paused?))
(+! (-> s5-0 1) 1)
@ -1004,7 +1012,6 @@
;; definition for function update-mood-lightning
;; ERROR: function was not converted to expressions. Cannot decompile.
(define-extern update-mood-lightning (function mood-context int int int int float symbol none))
;; definition of type light-time-state
(deftype light-time-state (structure)
@ -1125,7 +1132,6 @@
;; definition for function update-mood-lava
;; ERROR: function was not converted to expressions. Cannot decompile.
(define-extern update-mood-lava (function mood-context float int symbol none))
;; definition for function update-mood-caustics
(defun update-mood-caustics ((arg0 mood-context) (arg1 int) (arg2 int))
@ -1394,7 +1400,7 @@
)
(set!
(-> arg0 current-fog fog-dists w)
(+ f0-7 (* (* 0.666 f30-0) (- f1-1 f0-7)))
(+ f0-7 (* 0.666 f30-0 (- f1-1 f0-7)))
)
)
)
@ -1953,20 +1959,14 @@
(s4-3 (new 'stack-no-clear 'vector))
(f26-3
(+
(+
(+
0.75
(*
0.0625
(cos
(the float (* 4000 (-> *display* integral-frame-counter)))
)
)
)
(*
0.0625
(cos (the float (shl (-> *display* integral-frame-counter) 11)))
)
0.75
(*
0.0625
(cos (the float (* 4000 (-> *display* integral-frame-counter))))
)
(*
0.0625
(cos (the float (shl (-> *display* integral-frame-counter) 11)))
)
(*
0.125
@ -2126,10 +2126,9 @@
(set!
(-> s5-2 dir0 levels x)
(+
(+
(+ (* 0.25 (-> arg0 times 4 w)) (* 0.25 (-> arg0 times 5 w)))
(* 0.25 (-> arg0 times 6 w))
)
(* 0.25 (-> arg0 times 4 w))
(* 0.25 (-> arg0 times 5 w))
(* 0.25 (-> arg0 times 6 w))
(* 0.25 (-> arg0 times 7 w))
)
)
@ -2993,8 +2992,8 @@
)
(set-vector! (-> s5-1 direction) 0.0 -1.0 0.0 0.0)
(set-vector! (-> s5-1 color) 1.0 0.38 0.0 1.0)
(set! (-> s5-1 levels x) (* (* f1-6 (- 1.0 f30-1)) f28-1))
(set! (-> s5-1 levels y) (* (* f0-17 (- 1.0 f30-1)) f28-1))
(set! (-> s5-1 levels x) (* f1-6 (- 1.0 f30-1) f28-1))
(set! (-> s5-1 levels y) (* f0-17 (- 1.0 f30-1) f28-1))
)
)
(else
@ -3657,21 +3656,17 @@
(f30-2 (- 1.0 (fmax 0.0 (fmin 1.0 f2-5))))
(f28-4
(+
(+
(+
0.5
(*
0.125
(cos
(the float (* 4000 (-> *display* integral-frame-counter)))
)
)
0.5
(*
0.125
(cos
(the float (* 4000 (-> *display* integral-frame-counter)))
)
(*
0.125
(cos
(the float (shl (-> *display* integral-frame-counter) 11))
)
)
(*
0.125
(cos
(the float (shl (-> *display* integral-frame-counter) 11))
)
)
(*

View file

@ -1301,97 +1301,53 @@
)
(defun matrix-4x4-determinant ((dst matrix))
"Take the determinant of a 4x4 matrix. The answer is wrong."
(let ((f15-0 (-> dst data 0))
(f14-0 (-> dst data 1))
(f10-0 (-> dst data 2))
(f2-0 (-> dst data 3))
(f9-0 (-> dst data 4))
(f6-0 (-> dst data 5))
(f3-0 (-> dst data 6))
(f11-0 (-> dst data 7))
(f5-0 (-> dst data 8))
(f1-0 (-> dst data 9))
(f8-0 (-> dst data 10))
(f13-0 (-> dst data 11))
(f0-0 (-> dst data 12))
(f7-0 (-> dst data 13))
(f4-0 (-> dst data 14))
(f12-0 (-> dst data 15))
"Take the determinant of a 4x4 matrix, but this is wrong."
(let ((f15-0 (-> dst vector 0 x))
(f14-0 (-> dst vector 0 y))
(f10-0 (-> dst vector 0 z))
(f2-0 (-> dst vector 0 w))
(f9-0 (-> dst vector 1 x))
(f6-0 (-> dst vector 1 y))
(f3-0 (-> dst vector 1 z))
(f11-0 (-> dst vector 1 w))
(f5-0 (-> dst vector 2 x))
(f1-0 (-> dst vector 2 y))
(f8-0 (-> dst vector 2 z))
(f13-0 (-> dst vector 2 w))
(f0-0 (-> dst vector 3 x))
(f7-0 (-> dst vector 3 y))
(f4-0 (-> dst vector 3 z))
(f12-0 (-> dst vector 3 w))
)
(-
(+
(* f15-0 f6-0 f8-0 f12-0)
(* f15-0 f3-0 f13-0 f7-0)
(* f15-0 f11-0 f1-0 f4-0)
(* f14-0 f9-0 f13-0 f4-0)
(* f14-0 f3-0 f5-0 f4-0)
(* f14-0 f11-0 f8-0 f0-0)
(* f10-0 f9-0 f1-0 f12-0)
(* f10-0 f6-0 f13-0 f0-0)
(* f10-0 f11-0 f5-0 f7-0)
(* f2-0 f9-0 f1-0 f4-0)
(* f2-0 f6-0 f8-0 f0-0)
(* f2-0 f3-0 f5-0 f7-0)
)
(+
(* f15-0 f6-0 f13-0 f4-0)
(* f15-0 f3-0 f1-0 f12-0)
(* f15-0 f11-0 f8-0 f7-0)
(* f14-0 f9-0 f8-0 f12-0)
(* f14-0 f3-0 f13-0 f0-0)
(* f14-0 f11-0 f5-0 f4-0)
(* f10-0 f9-0 f13-0 f7-0)
(* f10-0 f6-0 f5-0 f12-0)
(* f10-0 f11-0 f1-0 f0-0)
(* f2-0 f9-0 f8-0 f7-0)
(* f2-0 f6-0 f5-0 f4-0)
(* f2-0 f3-0 f1-0 f0-0)
)
(let ((result (-
(+
(+
(+
(+
(+
(+
(+
(+
(+
(+
(+
(* (* (* f15-0 f6-0) f8-0) f12-0)
(* (* (* f15-0 f3-0) f13-0) f7-0)
)
(* (* (* f15-0 f11-0) f1-0) f4-0)
)
(* (* (* f14-0 f9-0) f13-0) f4-0)
)
(* (* (* f14-0 f3-0) f5-0) f4-0)
)
(* (* (* f14-0 f11-0) f8-0) f0-0)
)
(* (* (* f10-0 f9-0) f1-0) f12-0)
)
(* (* (* f10-0 f6-0) f13-0) f0-0)
)
(* (* (* f10-0 f11-0) f5-0) f7-0)
)
(* (* (* f2-0 f9-0) f1-0) f4-0)
)
(* (* (* f2-0 f6-0) f8-0) f0-0)
)
(* (* (* f2-0 f3-0) f5-0) f7-0)
)
(+
(+
(+
(+
(+
(+
(+
(+
(+
(+
(+
(* (* (* f15-0 f6-0) f13-0) f4-0)
(* (* (* f15-0 f3-0) f1-0) f12-0)
)
(* (* (* f15-0 f11-0) f8-0) f7-0)
)
(* (* (* f14-0 f9-0) f8-0) f12-0)
)
(* (* (* f14-0 f3-0) f13-0) f0-0)
)
(* (* (* f14-0 f11-0) f5-0) f4-0)
)
(* (* (* f10-0 f9-0) f13-0) f7-0)
)
(* (* (* f10-0 f6-0) f5-0) f12-0)
)
(* (* (* f10-0 f11-0) f1-0) f0-0)
)
(* (* (* f2-0 f9-0) f8-0) f7-0)
)
(* (* (* f2-0 f6-0) f5-0) f4-0)
)
(* (* (* f2-0 f3-0) f1-0) f0-0)
)
)
)
)
result
)
)
)
@ -1399,450 +1355,354 @@
(defun matrix-4x4-inverse-transpose! ((dst matrix) (src matrix))
"Invert and transpose an entire 4x4. I think has no restrictions, other than dst != src. Unused.
The answer is wrong. The determinant function is wrong."
(let ((f0-0 (matrix-4x4-determinant src)))
(let ((f9-0 (-> src data 5))
(f2-0 (-> src data 6))
(f5-0 (-> src data 7))
(f3-0 (-> src data 9))
(f6-0 (-> src data 10))
(f10-0 (-> src data 11))
(f4-0 (-> src data 13))
(f7-0 (-> src data 14))
(f1-0 (-> src data 15))
(let ((f0-0 (matrix-4x4-determinant src)))
(let ((f9-0 (-> src vector 1 y))
(f2-0 (-> src vector 1 z))
(f5-0 (-> src vector 1 w))
(f3-0 (-> src vector 2 y))
(f6-0 (-> src vector 2 z))
(f10-0 (-> src vector 2 w))
(f4-0 (-> src vector 3 y))
(f7-0 (-> src vector 3 z))
(f1-0 (-> src vector 3 w))
)
(set!
(-> dst data 0)
(-> dst vector 0 x)
(/
(-
(+
(+ (* (* f9-0 f6-0) f1-0) (* (* f2-0 f10-0) f4-0))
(* (* f5-0 f3-0) f7-0)
)
(+
(+ (* (* f9-0 f10-0) f7-0) (* (* f5-0 f6-0) f4-0))
(* (* f2-0 f3-0) f1-0)
)
(+ (* f9-0 f6-0 f1-0) (* f2-0 f10-0 f4-0) (* f5-0 f3-0 f7-0))
(+ (* f9-0 f10-0 f7-0) (* f5-0 f6-0 f4-0) (* f2-0 f3-0 f1-0))
)
f0-0
)
)
)
(let ((f9-2 (-> src data 4))
(f2-2 (-> src data 6))
(f5-2 (-> src data 7))
(f3-1 (-> src data 8))
(f6-1 (-> src data 10))
(f10-1 (-> src data 11))
(f4-3 (-> src data 12))
(f7-2 (-> src data 14))
(f1-6 (-> src data 15))
(let ((f9-2 (-> src vector 1 x))
(f2-2 (-> src vector 1 z))
(f5-2 (-> src vector 1 w))
(f3-1 (-> src vector 2 x))
(f6-1 (-> src vector 2 z))
(f10-1 (-> src vector 2 w))
(f4-3 (-> src vector 3 x))
(f7-2 (-> src vector 3 z))
(f1-6 (-> src vector 3 w))
)
(set!
(-> dst data 1)
(-> dst vector 0 y)
(-
(/
(-
(+
(+ (* (* f9-2 f6-1) f1-6) (* (* f2-2 f10-1) f4-3))
(* (* f5-2 f3-1) f7-2)
)
(+
(+ (* (* f9-2 f10-1) f7-2) (* (* f5-2 f6-1) f4-3))
(* (* f2-2 f3-1) f1-6)
)
(+ (* f9-2 f6-1 f1-6) (* f2-2 f10-1 f4-3) (* f5-2 f3-1 f7-2))
(+ (* f9-2 f10-1 f7-2) (* f5-2 f6-1 f4-3) (* f2-2 f3-1 f1-6))
)
f0-0
)
)
)
)
(let ((f9-4 (-> src data 4))
(f2-4 (-> src data 5))
(f5-4 (-> src data 7))
(f3-2 (-> src data 8))
(f6-2 (-> src data 9))
(f10-2 (-> src data 11))
(f4-6 (-> src data 12))
(f7-4 (-> src data 13))
(f1-13 (-> src data 15))
(let ((f9-4 (-> src vector 1 x))
(f2-4 (-> src vector 1 y))
(f5-4 (-> src vector 1 w))
(f3-2 (-> src vector 2 x))
(f6-2 (-> src vector 2 y))
(f10-2 (-> src vector 2 w))
(f4-6 (-> src vector 3 x))
(f7-4 (-> src vector 3 y))
(f1-13 (-> src vector 3 w))
)
(set!
(-> dst data 2)
(-> dst vector 0 z)
(/
(-
(+
(+ (* (* f9-4 f6-2) f1-13) (* (* f2-4 f10-2) f4-6))
(* (* f5-4 f3-2) f7-4)
)
(+
(+ (* (* f9-4 f10-2) f7-4) (* (* f5-4 f6-2) f4-6))
(* (* f2-4 f3-2) f1-13)
)
(+ (* f9-4 f6-2 f1-13) (* f2-4 f10-2 f4-6) (* f5-4 f3-2 f7-4))
(+ (* f9-4 f10-2 f7-4) (* f5-4 f6-2 f4-6) (* f2-4 f3-2 f1-13))
)
f0-0
)
)
)
(let ((f9-6 (-> src data 4))
(f2-6 (-> src data 5))
(f5-6 (-> src data 6))
(f3-3 (-> src data 8))
(f6-3 (-> src data 9))
(f10-3 (-> src data 10))
(f4-9 (-> src data 12))
(f7-6 (-> src data 13))
(f1-19 (-> src data 14))
(let ((f9-6 (-> src vector 1 x))
(f2-6 (-> src vector 1 y))
(f5-6 (-> src vector 1 z))
(f3-3 (-> src vector 2 x))
(f6-3 (-> src vector 2 y))
(f10-3 (-> src vector 2 z))
(f4-9 (-> src vector 3 x))
(f7-6 (-> src vector 3 y))
(f1-19 (-> src vector 3 z))
)
(set!
(-> dst data 3)
(-> dst vector 0 w)
(-
(/
(-
(+
(+ (* (* f9-6 f6-3) f1-19) (* (* f2-6 f10-3) f4-9))
(* (* f5-6 f3-3) f7-6)
)
(+
(+ (* (* f9-6 f10-3) f7-6) (* (* f5-6 f6-3) f4-9))
(* (* f2-6 f3-3) f1-19)
)
(+ (* f9-6 f6-3 f1-19) (* f2-6 f10-3 f4-9) (* f5-6 f3-3 f7-6))
(+ (* f9-6 f10-3 f7-6) (* f5-6 f6-3 f4-9) (* f2-6 f3-3 f1-19))
)
f0-0
)
)
)
)
(let ((f9-8 (-> src data 1))
(f2-8 (-> src data 2))
(f5-8 (-> src data 3))
(f3-4 (-> src data 9))
(f6-4 (-> src data 10))
(f10-4 (-> src data 11))
(f4-12 (-> src data 13))
(f7-8 (-> src data 14))
(f1-26 (-> src data 15))
(let ((f9-8 (-> src vector 0 y))
(f2-8 (-> src vector 0 z))
(f5-8 (-> src vector 0 w))
(f3-4 (-> src vector 2 y))
(f6-4 (-> src vector 2 z))
(f10-4 (-> src vector 2 w))
(f4-12 (-> src vector 3 y))
(f7-8 (-> src vector 3 z))
(f1-26 (-> src vector 3 w))
)
(set!
(-> dst data 4)
(-> dst vector 1 x)
(-
(/
(-
(+
(+ (* (* f9-8 f6-4) f1-26) (* (* f2-8 f10-4) f4-12))
(* (* f5-8 f3-4) f7-8)
)
(+
(+ (* (* f9-8 f10-4) f7-8) (* (* f5-8 f6-4) f4-12))
(* (* f2-8 f3-4) f1-26)
)
(+ (* f9-8 f6-4 f1-26) (* f2-8 f10-4 f4-12) (* f5-8 f3-4 f7-8))
(+ (* f9-8 f10-4 f7-8) (* f5-8 f6-4 f4-12) (* f2-8 f3-4 f1-26))
)
f0-0
)
)
)
)
(let ((f9-10 (-> src data 0))
(f2-10 (-> src data 2))
(f5-10 (-> src data 3))
(f3-5 (-> src data 8))
(f6-5 (-> src data 10))
(f10-5 (-> src data 11))
(f4-15 (-> src data 12))
(f7-10 (-> src data 14))
(f1-33 (-> src data 15))
(let ((f9-10 (-> src vector 0 x))
(f2-10 (-> src vector 0 z))
(f5-10 (-> src vector 0 w))
(f3-5 (-> src vector 2 x))
(f6-5 (-> src vector 2 z))
(f10-5 (-> src vector 2 w))
(f4-15 (-> src vector 3 x))
(f7-10 (-> src vector 3 z))
(f1-33 (-> src vector 3 w))
)
(set!
(-> dst data 5)
(-> dst vector 1 y)
(/
(-
(+
(+ (* (* f9-10 f6-5) f1-33) (* (* f2-10 f10-5) f4-15))
(* (* f5-10 f3-5) f7-10)
)
(+
(+ (* (* f9-10 f10-5) f7-10) (* (* f5-10 f6-5) f4-15))
(* (* f2-10 f3-5) f1-33)
)
(+ (* f9-10 f6-5 f1-33) (* f2-10 f10-5 f4-15) (* f5-10 f3-5 f7-10))
(+ (* f9-10 f10-5 f7-10) (* f5-10 f6-5 f4-15) (* f2-10 f3-5 f1-33))
)
f0-0
)
)
)
(let ((f9-12 (-> src data 0))
(f2-12 (-> src data 1))
(f5-12 (-> src data 3))
(f3-6 (-> src data 8))
(f6-6 (-> src data 9))
(f10-6 (-> src data 11))
(f4-18 (-> src data 12))
(f7-12 (-> src data 13))
(f1-39 (-> src data 15))
(let ((f9-12 (-> src vector 0 x))
(f2-12 (-> src vector 0 y))
(f5-12 (-> src vector 0 w))
(f3-6 (-> src vector 2 x))
(f6-6 (-> src vector 2 y))
(f10-6 (-> src vector 2 w))
(f4-18 (-> src vector 3 x))
(f7-12 (-> src vector 3 y))
(f1-39 (-> src vector 3 w))
)
(set!
(-> dst data 6)
(-> dst vector 1 z)
(-
(/
(-
(+
(+ (* (* f9-12 f6-6) f1-39) (* (* f2-12 f10-6) f4-18))
(* (* f5-12 f3-6) f7-12)
)
(+
(+ (* (* f9-12 f10-6) f7-12) (* (* f5-12 f6-6) f4-18))
(* (* f2-12 f3-6) f1-39)
)
(+ (* f9-12 f6-6 f1-39) (* f2-12 f10-6 f4-18) (* f5-12 f3-6 f7-12))
(+ (* f9-12 f10-6 f7-12) (* f5-12 f6-6 f4-18) (* f2-12 f3-6 f1-39))
)
f0-0
)
)
)
)
(let ((f9-14 (-> src data 0))
(f2-14 (-> src data 1))
(f5-14 (-> src data 2))
(f3-7 (-> src data 8))
(f6-7 (-> src data 9))
(f10-7 (-> src data 10))
(f4-21 (-> src data 12))
(f7-14 (-> src data 13))
(f1-46 (-> src data 14))
(let ((f9-14 (-> src vector 0 x))
(f2-14 (-> src vector 0 y))
(f5-14 (-> src vector 0 z))
(f3-7 (-> src vector 2 x))
(f6-7 (-> src vector 2 y))
(f10-7 (-> src vector 2 z))
(f4-21 (-> src vector 3 x))
(f7-14 (-> src vector 3 y))
(f1-46 (-> src vector 3 z))
)
(set!
(-> dst data 7)
(-> dst vector 1 w)
(/
(-
(+
(+ (* (* f9-14 f6-7) f1-46) (* (* f2-14 f10-7) f4-21))
(* (* f5-14 f3-7) f7-14)
)
(+
(+ (* (* f9-14 f10-7) f7-14) (* (* f5-14 f6-7) f4-21))
(* (* f2-14 f3-7) f1-46)
)
(+ (* f9-14 f6-7 f1-46) (* f2-14 f10-7 f4-21) (* f5-14 f3-7 f7-14))
(+ (* f9-14 f10-7 f7-14) (* f5-14 f6-7 f4-21) (* f2-14 f3-7 f1-46))
)
f0-0
)
)
)
(let ((f9-16 (-> src data 1))
(f2-16 (-> src data 2))
(f5-16 (-> src data 3))
(f3-8 (-> src data 5))
(f6-8 (-> src data 6))
(f10-8 (-> src data 7))
(f4-24 (-> src data 13))
(f7-16 (-> src data 14))
(f1-52 (-> src data 15))
(let ((f9-16 (-> src vector 0 y))
(f2-16 (-> src vector 0 z))
(f5-16 (-> src vector 0 w))
(f3-8 (-> src vector 1 y))
(f6-8 (-> src vector 1 z))
(f10-8 (-> src vector 1 w))
(f4-24 (-> src vector 3 y))
(f7-16 (-> src vector 3 z))
(f1-52 (-> src vector 3 w))
)
(set!
(-> dst data 8)
(-> dst vector 2 x)
(/
(-
(+
(+ (* (* f9-16 f6-8) f1-52) (* (* f2-16 f10-8) f4-24))
(* (* f5-16 f3-8) f7-16)
)
(+
(+ (* (* f9-16 f10-8) f7-16) (* (* f5-16 f6-8) f4-24))
(* (* f2-16 f3-8) f1-52)
)
(+ (* f9-16 f6-8 f1-52) (* f2-16 f10-8 f4-24) (* f5-16 f3-8 f7-16))
(+ (* f9-16 f10-8 f7-16) (* f5-16 f6-8 f4-24) (* f2-16 f3-8 f1-52))
)
f0-0
)
)
)
(let ((f9-18 (-> src data 0))
(f2-18 (-> src data 2))
(f5-18 (-> src data 3))
(f3-9 (-> src data 4))
(f6-9 (-> src data 6))
(f10-9 (-> src data 7))
(f4-27 (-> src data 12))
(f7-18 (-> src data 14))
(f1-58 (-> src data 15))
(let ((f9-18 (-> src vector 0 x))
(f2-18 (-> src vector 0 z))
(f5-18 (-> src vector 0 w))
(f3-9 (-> src vector 1 x))
(f6-9 (-> src vector 1 z))
(f10-9 (-> src vector 1 w))
(f4-27 (-> src vector 3 x))
(f7-18 (-> src vector 3 z))
(f1-58 (-> src vector 3 w))
)
(set!
(-> dst data 9)
(-> dst vector 2 y)
(-
(/
(-
(+
(+ (* (* f9-18 f6-9) f1-58) (* (* f2-18 f10-9) f4-27))
(* (* f5-18 f3-9) f7-18)
)
(+
(+ (* (* f9-18 f10-9) f7-18) (* (* f5-18 f6-9) f4-27))
(* (* f2-18 f3-9) f1-58)
)
(+ (* f9-18 f6-9 f1-58) (* f2-18 f10-9 f4-27) (* f5-18 f3-9 f7-18))
(+ (* f9-18 f10-9 f7-18) (* f5-18 f6-9 f4-27) (* f2-18 f3-9 f1-58))
)
f0-0
)
)
)
)
(let ((f9-20 (-> src data 0))
(f2-20 (-> src data 1))
(f5-20 (-> src data 3))
(f3-10 (-> src data 4))
(f6-10 (-> src data 5))
(f10-10 (-> src data 7))
(f4-30 (-> src data 12))
(f7-20 (-> src data 13))
(f1-65 (-> src data 15))
(let ((f9-20 (-> src vector 0 x))
(f2-20 (-> src vector 0 y))
(f5-20 (-> src vector 0 w))
(f3-10 (-> src vector 1 x))
(f6-10 (-> src vector 1 y))
(f10-10 (-> src vector 1 w))
(f4-30 (-> src vector 3 x))
(f7-20 (-> src vector 3 y))
(f1-65 (-> src vector 3 w))
)
(set!
(-> dst data 10)
(-> dst vector 2 z)
(/
(-
(+
(+ (* (* f9-20 f6-10) f1-65) (* (* f2-20 f10-10) f4-30))
(* (* f5-20 f3-10) f7-20)
)
(+
(+ (* (* f9-20 f10-10) f7-20) (* (* f5-20 f6-10) f4-30))
(* (* f2-20 f3-10) f1-65)
)
(+ (* f9-20 f6-10 f1-65) (* f2-20 f10-10 f4-30) (* f5-20 f3-10 f7-20))
(+ (* f9-20 f10-10 f7-20) (* f5-20 f6-10 f4-30) (* f2-20 f3-10 f1-65))
)
f0-0
)
)
)
(let ((f9-22 (-> src data 0))
(f2-22 (-> src data 1))
(f5-22 (-> src data 2))
(f3-11 (-> src data 4))
(f6-11 (-> src data 5))
(f10-11 (-> src data 6))
(f4-33 (-> src data 12))
(f7-22 (-> src data 13))
(f1-71 (-> src data 14))
(let ((f9-22 (-> src vector 0 x))
(f2-22 (-> src vector 0 y))
(f5-22 (-> src vector 0 z))
(f3-11 (-> src vector 1 x))
(f6-11 (-> src vector 1 y))
(f10-11 (-> src vector 1 z))
(f4-33 (-> src vector 3 x))
(f7-22 (-> src vector 3 y))
(f1-71 (-> src vector 3 z))
)
(set!
(-> dst data 11)
(-> dst vector 2 w)
(-
(/
(-
(+
(+ (* (* f9-22 f6-11) f1-71) (* (* f2-22 f10-11) f4-33))
(* (* f5-22 f3-11) f7-22)
)
(+
(+ (* (* f9-22 f10-11) f7-22) (* (* f5-22 f6-11) f4-33))
(* (* f2-22 f3-11) f1-71)
)
(+ (* f9-22 f6-11 f1-71) (* f2-22 f10-11 f4-33) (* f5-22 f3-11 f7-22))
(+ (* f9-22 f10-11 f7-22) (* f5-22 f6-11 f4-33) (* f2-22 f3-11 f1-71))
)
f0-0
)
)
)
)
(let ((f9-24 (-> src data 1))
(f2-24 (-> src data 2))
(f5-24 (-> src data 3))
(f3-12 (-> src data 5))
(f6-12 (-> src data 6))
(f10-12 (-> src data 7))
(f4-36 (-> src data 9))
(f7-24 (-> src data 10))
(f1-78 (-> src data 11))
(let ((f9-24 (-> src vector 0 y))
(f2-24 (-> src vector 0 z))
(f5-24 (-> src vector 0 w))
(f3-12 (-> src vector 1 y))
(f6-12 (-> src vector 1 z))
(f10-12 (-> src vector 1 w))
(f4-36 (-> src vector 2 y))
(f7-24 (-> src vector 2 z))
(f1-78 (-> src vector 2 w))
)
(set!
(-> dst data 12)
(-> dst vector 3 x)
(-
(/
(-
(+
(+ (* (* f9-24 f6-12) f1-78) (* (* f2-24 f10-12) f4-36))
(* (* f5-24 f3-12) f7-24)
)
(+
(+ (* (* f9-24 f10-12) f7-24) (* (* f5-24 f6-12) f4-36))
(* (* f2-24 f3-12) f1-78)
)
(+ (* f9-24 f6-12 f1-78) (* f2-24 f10-12 f4-36) (* f5-24 f3-12 f7-24))
(+ (* f9-24 f10-12 f7-24) (* f5-24 f6-12 f4-36) (* f2-24 f3-12 f1-78))
)
f0-0
)
)
)
)
(let ((f9-26 (-> src data 0))
(f2-26 (-> src data 2))
(f5-26 (-> src data 3))
(f3-13 (-> src data 4))
(f6-13 (-> src data 6))
(f10-13 (-> src data 7))
(f4-39 (-> src data 8))
(f7-26 (-> src data 10))
(f1-85 (-> src data 11))
(let ((f9-26 (-> src vector 0 x))
(f2-26 (-> src vector 0 z))
(f5-26 (-> src vector 0 w))
(f3-13 (-> src vector 1 x))
(f6-13 (-> src vector 1 z))
(f10-13 (-> src vector 1 w))
(f4-39 (-> src vector 2 x))
(f7-26 (-> src vector 2 z))
(f1-85 (-> src vector 2 w))
)
(set!
(-> dst data 13)
(-> dst vector 3 y)
(/
(-
(+
(+ (* (* f9-26 f6-13) f1-85) (* (* f2-26 f10-13) f4-39))
(* (* f5-26 f3-13) f7-26)
)
(+
(+ (* (* f9-26 f10-13) f7-26) (* (* f5-26 f6-13) f4-39))
(* (* f2-26 f3-13) f1-85)
)
(+ (* f9-26 f6-13 f1-85) (* f2-26 f10-13 f4-39) (* f5-26 f3-13 f7-26))
(+ (* f9-26 f10-13 f7-26) (* f5-26 f6-13 f4-39) (* f2-26 f3-13 f1-85))
)
f0-0
)
)
)
(let ((f9-28 (-> src data 0))
(f2-28 (-> src data 1))
(f5-28 (-> src data 3))
(f3-14 (-> src data 4))
(f6-14 (-> src data 5))
(f10-14 (-> src data 7))
(f4-42 (-> src data 8))
(f7-28 (-> src data 9))
(f1-91 (-> src data 11))
(let ((f9-28 (-> src vector 0 x))
(f2-28 (-> src vector 0 y))
(f5-28 (-> src vector 0 w))
(f3-14 (-> src vector 1 x))
(f6-14 (-> src vector 1 y))
(f10-14 (-> src vector 1 w))
(f4-42 (-> src vector 2 x))
(f7-28 (-> src vector 2 y))
(f1-91 (-> src vector 2 w))
)
(set!
(-> dst data 14)
(-> dst vector 3 z)
(-
(/
(-
(+
(+ (* (* f9-28 f6-14) f1-91) (* (* f2-28 f10-14) f4-42))
(* (* f5-28 f3-14) f7-28)
)
(+
(+ (* (* f9-28 f10-14) f7-28) (* (* f5-28 f6-14) f4-42))
(* (* f2-28 f3-14) f1-91)
)
(+ (* f9-28 f6-14 f1-91) (* f2-28 f10-14 f4-42) (* f5-28 f3-14 f7-28))
(+ (* f9-28 f10-14 f7-28) (* f5-28 f6-14 f4-42) (* f2-28 f3-14 f1-91))
)
f0-0
)
)
)
)
(let ((f8-60 (-> src data 0))
(f1-98 (-> src data 1))
(f5-30 (-> src data 2))
(f2-30 (-> src data 4))
(f6-15 (-> src data 5))
(f9-30 (-> src data 6))
(f4-45 (-> src data 8))
(f7-30 (-> src data 9))
(f3-15 (-> src data 10))
(let ((f8-60 (-> src vector 0 x))
(f1-98 (-> src vector 0 y))
(f5-30 (-> src vector 0 z))
(f2-30 (-> src vector 1 x))
(f6-15 (-> src vector 1 y))
(f9-30 (-> src vector 1 z))
(f4-45 (-> src vector 2 x))
(f7-30 (-> src vector 2 y))
(f3-15 (-> src vector 2 z))
)
(set!
(-> dst data 15)
(-> dst vector 3 w)
(/
(-
(+
(+ (* (* f8-60 f6-15) f3-15) (* (* f1-98 f9-30) f4-45))
(* (* f5-30 f2-30) f7-30)
)
(+
(+ (* (* f8-60 f9-30) f7-30) (* (* f5-30 f6-15) f4-45))
(* (* f1-98 f2-30) f3-15)
)
(+ (* f8-60 f6-15 f3-15) (* f1-98 f9-30 f4-45) (* f5-30 f2-30 f7-30))
(+ (* f8-60 f9-30 f7-30) (* f5-30 f6-15 f4-45) (* f1-98 f2-30 f3-15))
)
f0-0
)
@ -1852,6 +1712,7 @@
dst
)
(defun matrix-y-angle ((mat matrix))
"If mat has its upper 3x3 as a rotation, gets the y axis rotation."
(let ((z-row (&-> mat data 8)))

View file

@ -979,7 +979,7 @@
(set!
(-> a1-3 x)
(+
(* (* (-> arg1 0 x) (-> s2-0 x)) (-> *display* frames-per-second))
(* (-> arg1 0 x) (-> s2-0 x) (-> *display* frames-per-second))
(* (-> s1-0 x) (-> *display* seconds-per-frame))
)
)
@ -995,7 +995,7 @@
(set!
(-> a1-3 y)
(+
(* (* (-> arg1 0 y) (-> s2-0 y)) (-> *display* frames-per-second))
(* (-> arg1 0 y) (-> s2-0 y) (-> *display* frames-per-second))
(* (-> s1-0 y) (-> *display* seconds-per-frame))
)
)
@ -1004,7 +1004,7 @@
(set!
(-> a1-3 z)
(+
(* (* (-> arg1 0 z) (-> s2-0 z)) (-> *display* frames-per-second))
(* (-> arg1 0 z) (-> s2-0 z) (-> *display* frames-per-second))
(* (-> s1-0 z) (-> *display* seconds-per-frame))
)
)
@ -1245,16 +1245,10 @@
((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere)
)
(set! (-> s5-0 0 quad) (-> self control trans quad))
(set!
(-> s5-0 0 y)
(+ (+ 5734.4 (-> *TARGET-bank* body-radius)) (-> s5-0 0 y))
)
(set! (-> s5-0 0 y) (+ 5734.4 (-> *TARGET-bank* body-radius) (-> s5-0 0 y)))
(set! (-> s5-0 0 w) (-> *TARGET-bank* body-radius))
(set! (-> s5-0 1 quad) (-> self control trans quad))
(set!
(-> s5-0 1 y)
(+ (+ 2867.2 (-> *TARGET-bank* body-radius)) (-> s5-0 1 y))
)
(set! (-> s5-0 1 y) (+ 2867.2 (-> *TARGET-bank* body-radius) (-> s5-0 1 y)))
(set! (-> s5-0 1 w) (-> *TARGET-bank* body-radius))
(set! (-> gp-0 spheres) (the-as uint s5-0))
)

View file

@ -210,7 +210,8 @@
(let
((f0-14
(+
(+ (* 2.0 (-> v1-12 lgt-color x)) (* 4.0 (-> v1-12 lgt-color y)))
(* 2.0 (-> v1-12 lgt-color x))
(* 4.0 (-> v1-12 lgt-color y))
(-> v1-12 lgt-color z)
)
)
@ -259,7 +260,8 @@
((f0-28
(*
(+
(+ (* 2.0 (-> s0-0 lgt-color x)) (* 4.0 (-> s0-0 lgt-color y)))
(* 2.0 (-> s0-0 lgt-color x))
(* 4.0 (-> s0-0 lgt-color y))
(-> s0-0 lgt-color z)
)
(- 1.0 f30-0)
@ -268,7 +270,8 @@
(f1-26
(*
(+
(+ (* 2.0 (-> s1-0 lgt-color x)) (* 4.0 (-> s1-0 lgt-color y)))
(* 2.0 (-> s1-0 lgt-color x))
(* 4.0 (-> s1-0 lgt-color y))
(-> s1-0 lgt-color z)
)
f30-0
@ -473,7 +476,8 @@
(let
((f0-3
(+
(+ (* 2.0 (-> a1-11 lgt-color x)) (* 4.0 (-> a1-11 lgt-color y)))
(* 2.0 (-> a1-11 lgt-color x))
(* 4.0 (-> a1-11 lgt-color y))
(-> a1-11 lgt-color z)
)
)
@ -722,7 +726,7 @@
)
(else
(let ((f0-13 (sin (* 32768.0 (/ (the float a0-1) (the float v1-2))))))
(set! (-> arg0 times s4-0 w) (+ (* (* (the float s0-0) f0-13) arg5) arg4))
(set! (-> arg0 times s4-0 w) (+ (* (the float s0-0) f0-13 arg5) arg4))
)
(if (not (paused?))
(+! (-> s5-0 1) 1)
@ -1388,7 +1392,7 @@
)
(set!
(-> arg0 current-fog fog-dists w)
(+ f0-7 (* (* 0.666 f30-0) (- f1-1 f0-7)))
(+ f0-7 (* 0.666 f30-0 (- f1-1 f0-7)))
)
)
)
@ -1947,20 +1951,14 @@
(s4-3 (new 'stack-no-clear 'vector))
(f26-3
(+
(+
(+
0.75
(*
0.0625
(cos
(the float (* 4000 (-> *display* integral-frame-counter)))
)
)
)
(*
0.0625
(cos (the float (shl (-> *display* integral-frame-counter) 11)))
)
0.75
(*
0.0625
(cos (the float (* 4000 (-> *display* integral-frame-counter))))
)
(*
0.0625
(cos (the float (shl (-> *display* integral-frame-counter) 11)))
)
(*
0.125
@ -2120,10 +2118,9 @@
(set!
(-> s5-2 dir0 levels x)
(+
(+
(+ (* 0.25 (-> arg0 times 4 w)) (* 0.25 (-> arg0 times 5 w)))
(* 0.25 (-> arg0 times 6 w))
)
(* 0.25 (-> arg0 times 4 w))
(* 0.25 (-> arg0 times 5 w))
(* 0.25 (-> arg0 times 6 w))
(* 0.25 (-> arg0 times 7 w))
)
)
@ -2987,8 +2984,8 @@
)
(set-vector! (-> s5-1 direction) 0.0 -1.0 0.0 0.0)
(set-vector! (-> s5-1 color) 1.0 0.38 0.0 1.0)
(set! (-> s5-1 levels x) (* (* f1-6 (- 1.0 f30-1)) f28-1))
(set! (-> s5-1 levels y) (* (* f0-17 (- 1.0 f30-1)) f28-1))
(set! (-> s5-1 levels x) (* f1-6 (- 1.0 f30-1) f28-1))
(set! (-> s5-1 levels y) (* f0-17 (- 1.0 f30-1) f28-1))
)
)
(else
@ -3651,21 +3648,17 @@
(f30-2 (- 1.0 (fmax 0.0 (fmin 1.0 f2-5))))
(f28-4
(+
(+
(+
0.5
(*
0.125
(cos
(the float (* 4000 (-> *display* integral-frame-counter)))
)
)
0.5
(*
0.125
(cos
(the float (* 4000 (-> *display* integral-frame-counter)))
)
(*
0.125
(cos
(the float (shl (-> *display* integral-frame-counter) 11))
)
)
(*
0.125
(cos
(the float (shl (-> *display* integral-frame-counter) 11))
)
)
(*

View file

@ -223,7 +223,7 @@
(if (logtest? arg0 2)
(set!
(-> s3-0 y)
(* (* (-> s5-0 trans y) arg3) (-> *display* frames-per-second))
(* (-> s5-0 trans y) arg3 (-> *display* frames-per-second))
)
)
(when (logtest? arg0 4)

View file

@ -43,10 +43,10 @@
(local-vars (sv-240 vector))
(when (not *artist-fix-frustum*)
(let ((s5-0 (new 'stack 'view-frustum)))
(let ((f30-0 (* (* arg2 (-> arg0 x-ratio)) (-> arg0 d)))
(f26-0 (* (* arg2 (-> arg0 y-ratio)) (-> arg0 d)))
(f28-0 (* (* arg2 (-> arg0 x-ratio)) (-> arg0 f)))
(f24-0 (* (* arg2 (-> arg0 y-ratio)) (-> arg0 f)))
(let ((f30-0 (* arg2 (-> arg0 x-ratio) (-> arg0 d)))
(f26-0 (* arg2 (-> arg0 y-ratio) (-> arg0 d)))
(f28-0 (* arg2 (-> arg0 x-ratio) (-> arg0 f)))
(f24-0 (* arg2 (-> arg0 y-ratio) (-> arg0 f)))
)
(set-point (-> s5-0 hither-top-left) (- f30-0) f26-0 (-> arg0 d))
(set-point (-> s5-0 hither-top-right) f30-0 f26-0 (-> arg0 d))

View file

@ -412,7 +412,7 @@
;; definition for function third-power
(defun third-power ((arg0 float))
(* (* arg0 arg0) arg0)
(* arg0 arg0 arg0)
)
;; definition for function parameter-ease-sqr-clamp
@ -1018,7 +1018,7 @@
)
(let* ((f0-4 (vector-normalize-ret-len! s2-0 1.0))
(f0-5 (* 0.5 f0-4))
(f26-0 (* (* (fmin 1.0 f0-5) f30-0) (vector-dot arg0 s2-0)))
(f26-0 (* (fmin 1.0 f0-5) f30-0 (vector-dot arg0 s2-0)))
)
(let ((f2-7 (vector-dot s2-0 s3-0)))
(cond
@ -1848,7 +1848,7 @@
(set! f0-3 1.0)
)
)
(let ((f30-0 (* (* 364.0889 (-> *display* time-adjust-ratio)) f0-3)))
(let ((f30-0 (* 364.0889 (-> *display* time-adjust-ratio) f0-3)))
(matrix->quaternion s4-0 arg0)
(matrix->quaternion s2-0 arg3)
(quaternion-conjugate! gp-0 s4-0)
@ -1858,8 +1858,8 @@
(quaternion-negate! gp-0 gp-0)
)
(let ((f28-0 (acos (-> gp-0 w))))
(if (< (* (* 0.25 (-> *display* time-adjust-ratio)) f28-0) f30-0)
(set! f30-0 (* (* 0.25 (-> *display* time-adjust-ratio)) f28-0))
(if (< (* 0.25 (-> *display* time-adjust-ratio) f28-0) f30-0)
(set! f30-0 (* 0.25 (-> *display* time-adjust-ratio) f28-0))
)
(cond
((< (-> gp-0 w) 0.9999999)

View file

@ -50,27 +50,27 @@
(y-rat (-> math-cam y-ratio))
(cull-info (-> math-cam cull-info))
)
(/ (+ 1.0 (* (* 4.0 x-rat) x-rat)) (+ 1.0 (* x-rat x-rat)))
(let ((y-thing (/ (+ 1.0 (* (* 4.0 y-rat) y-rat)) (+ 1.0 (* y-rat y-rat)))))
(/ (+ 1.0 (* 4.0 x-rat x-rat)) (+ 1.0 (* x-rat x-rat)))
(let ((y-thing (/ (+ 1.0 (* 4.0 y-rat y-rat)) (+ 1.0 (* y-rat y-rat)))))
(set!
(-> cull-info x-fact)
(/
(+ 1.0 (* (* 4.0 x-rat) x-rat))
(* x-rat (sqrtf (+ 1.0 (* (* 16.0 x-rat) x-rat))))
(+ 1.0 (* 4.0 x-rat x-rat))
(* x-rat (sqrtf (+ 1.0 (* 16.0 x-rat x-rat))))
)
)
(set!
(-> cull-info y-fact)
(/
(+ 1.0 (* (* 4.0 y-rat) y-rat))
(* y-rat (sqrtf (+ 1.0 (* (* 16.0 y-rat) y-rat))))
(+ 1.0 (* 4.0 y-rat y-rat))
(* y-rat (sqrtf (+ 1.0 (* 16.0 y-rat y-rat))))
)
)
(set!
(-> cull-info z-fact)
(sqrtf
(+
(* (* (* (+ -4.0 y-thing) (+ -4.0 y-thing)) y-rat) y-rat)
(* (+ -4.0 y-thing) (+ -4.0 y-thing) y-rat y-rat)
(* (+ -1.0 y-thing) (+ -1.0 y-thing))
)
)
@ -179,7 +179,7 @@
)
(set!
(-> math-cam perspective vector 2 z)
(* (* cam-fov-mult (+ (-> math-cam f) (-> math-cam d))) corrected-fog)
(* cam-fov-mult (+ (-> math-cam f) (-> math-cam d)) corrected-fog)
)
(set!
(-> math-cam perspective vector 2 w)
@ -187,10 +187,7 @@
)
(set!
(-> math-cam perspective vector 3 z)
(*
(* (* (* -2.0 corrected-fog) (-> math-cam f)) (-> math-cam d))
cam-fov-mult
)
(* -2.0 corrected-fog (-> math-cam f) (-> math-cam d) cam-fov-mult)
)
)
(let ((hvdf-x 2048.0)
@ -254,7 +251,7 @@
0.0
0.0
(* 500000000.0 persp-x)
(* (* 60.0 persp-x) (-> math-cam pfog0))
(* 60.0 persp-x (-> math-cam pfog0))
)
)
(set! (-> math-cam sprite-2d-hvdf quad) (-> math-cam hvdf-off quad))

View file

@ -75,7 +75,8 @@
(let* ((duration (the float (+ (-> chan frame-group data 0 length) -1)))
(after-inc
(+
(+ (-> chan frame-num) duration)
(-> chan frame-num)
duration
(*
inc
(* (-> chan frame-group speed) (-> *display* time-adjust-ratio))

View file

@ -48,7 +48,7 @@
(('rel)
(set!
(-> obj sfx-volume)
(* (* 0.01 (the-as float (-> conn param2))) (-> obj sfx-volume))
(* 0.01 (the-as float (-> conn param2)) (-> obj sfx-volume))
)
)
(else
@ -62,7 +62,7 @@
(('rel)
(set!
(-> obj music-volume)
(* (* 0.01 (the-as float (-> conn param2))) (-> obj music-volume))
(* 0.01 (the-as float (-> conn param2)) (-> obj music-volume))
)
)
(else
@ -75,7 +75,7 @@
(('rel)
(set!
(-> obj ambient-volume)
(* (* 0.01 (the-as float (-> conn param2))) (-> obj ambient-volume))
(* 0.01 (the-as float (-> conn param2)) (-> obj ambient-volume))
)
)
(else
@ -88,7 +88,7 @@
(('rel)
(set!
(-> obj dialog-volume)
(* (* 0.01 (the-as float (-> conn param2))) (-> obj dialog-volume))
(* 0.01 (the-as float (-> conn param2)) (-> obj dialog-volume))
)
)
(else
@ -101,7 +101,7 @@
(('rel)
(set!
(-> obj sfx-volume-movie)
(* (* 0.01 (the-as float (-> conn param2))) (-> obj sfx-volume-movie))
(* 0.01 (the-as float (-> conn param2)) (-> obj sfx-volume-movie))
)
)
(else
@ -114,10 +114,7 @@
(('rel)
(set!
(-> obj music-volume-movie)
(*
(* 0.01 (the-as float (-> conn param2)))
(-> obj music-volume-movie)
)
(* 0.01 (the-as float (-> conn param2)) (-> obj music-volume-movie))
)
)
(else
@ -130,10 +127,7 @@
(('rel)
(set!
(-> obj ambient-volume-movie)
(*
(* 0.01 (the-as float (-> conn param2)))
(-> obj ambient-volume-movie)
)
(* 0.01 (the-as float (-> conn param2)) (-> obj ambient-volume-movie))
)
)
(else
@ -146,10 +140,7 @@
(('rel)
(set!
(-> obj dialog-volume-hint)
(*
(* 0.01 (the-as float (-> conn param2)))
(-> obj dialog-volume-hint)
)
(* 0.01 (the-as float (-> conn param2)) (-> obj dialog-volume-hint))
)
)
(else
@ -310,7 +301,7 @@
(mem-copy! (the-as pointer s5-0) (the-as pointer (-> obj default)) 196)
(set!
(-> s5-0 ambient-volume)
(* (* 0.01 (-> obj default ambient-volume)) (-> obj default sfx-volume))
(* 0.01 (-> obj default ambient-volume) (-> obj default sfx-volume))
)
(handle-pending-updates s5-0 (-> obj engine))
(set! (-> gp-0 border-mode) (-> s5-0 border-mode))

View file

@ -939,7 +939,8 @@
(let
((f0-3
(+
(+ (* (-> arg2 x) (-> arg1 x)) (* (-> arg2 y) (-> arg1 y)))
(* (-> arg2 x) (-> arg1 x))
(* (-> arg2 y) (-> arg1 y))
(* (-> arg2 z) (-> arg1 z))
)
)

View file

@ -960,17 +960,11 @@
(while (>= s2-0 s3-0)
(set!
(-> sv-36 x)
(+
(+ 49152.0 (* 98304.0 (the float s3-0)))
(-> *ocean-map* start-corner x)
)
(+ 49152.0 (* 98304.0 (the float s3-0)) (-> *ocean-map* start-corner x))
)
(set!
(-> sv-36 z)
(+
(+ 49152.0 (* 98304.0 (the float s5-0)))
(-> *ocean-map* start-corner z)
)
(+ 49152.0 (* 98304.0 (the float s5-0)) (-> *ocean-map* start-corner z))
)
(when (sphere-cull sv-36)
(if (not (ocean-trans-camera-masks-bit? s5-0 s3-0))
@ -1072,14 +1066,16 @@
(set!
(-> sv-36 x)
(+
(+ 196608.0 (* 393216.0 (the float s3-0)))
196608.0
(* 393216.0 (the float s3-0))
(-> *ocean-map* start-corner x)
)
)
(set!
(-> sv-36 z)
(+
(+ 196608.0 (* 393216.0 (the float s5-0)))
196608.0
(* 393216.0 (the float s5-0))
(-> *ocean-map* start-corner z)
)
)

View file

@ -178,10 +178,7 @@
(dotimes (s3-0 (-> arg0 count))
(let* ((v1-3 (-> arg0 wave s3-0))
(f0-2
(+
(+ (-> v1-3 offs) (* arg1 (-> v1-3 xmul)))
(* arg2 (-> v1-3 zmul))
)
(+ (-> v1-3 offs) (* arg1 (-> v1-3 xmul)) (* arg2 (-> v1-3 zmul)))
)
)
(+! f30-0 (* (-> v1-3 scale) (cos f0-2)))
@ -245,7 +242,7 @@
(if (< f0-23 0.0)
(set! f0-23 (-> gp-0 global-scale))
)
(+ f30-0 (* (* 0.0078125 f1-12) f0-23))
(+ f30-0 (* 0.0078125 f1-12 f0-23))
)
)
)

View file

@ -64,8 +64,8 @@
(let ((s3-1 (+ s3-0 1)))
(set-vector!
(-> gp-0 entry s3-1)
(* (* 0.001953125 f28-0) (sin f26-0))
(* (* 0.00390625 f30-0) (cos f26-0))
(* 0.001953125 f28-0 (sin f26-0))
(* 0.00390625 f30-0 (cos f26-0))
0.0
0.0
)
@ -326,7 +326,8 @@
(*
0.00390625
(+
(+ -2048.0 (the float (-> *video-parms* screen-hy)))
-2048.0
(the float (-> *video-parms* screen-hy))
(-> (the-as vector a0-1) y)
)
)

View file

@ -642,7 +642,7 @@
0.0
0.0
(* 500000000.0 f0-1)
(* (* 60.0 f0-1) (-> *math-camera* pfog0))
(* 60.0 f0-1 (-> *math-camera* pfog0))
)
)
(&+! (-> dma-buff base) 64)

View file

@ -204,8 +204,8 @@
(set! (-> arg0 9) f2-1)
(set! (-> arg0 13) f5-7)
)
(set! (-> arg0 8) (* (* -0.5 f4-1) f1-0))
(set! (-> arg0 12) (* (* -0.5 f3-2) f0-0))
(set! (-> arg0 8) (* -0.5 f4-1 f1-0))
(set! (-> arg0 12) (* -0.5 f3-2 f0-0))
)
)
(none)

View file

@ -738,17 +738,17 @@
(cos-z (-> cos-vec z))
(sin-z (-> sin-vec z))
)
(set! (-> dst vector 0 x) (- (* cos-y cos-z) (* (* sin-y cos-x) sin-z)))
(set! (-> dst vector 0 x) (- (* cos-y cos-z) (* sin-y cos-x sin-z)))
(set! (-> dst vector 0 y) (* sin-y sin-x))
(set! (-> dst vector 0 z) (- (+ (* cos-y sin-z) (* (* sin-y cos-x) cos-z))))
(set! (-> dst vector 0 z) (- (+ (* cos-y sin-z) (* sin-y cos-x cos-z))))
(set! (-> dst vector 0 w) 0.0)
(set! (-> dst vector 1 x) (* sin-x sin-z))
(set! (-> dst vector 1 y) cos-x)
(set! (-> dst vector 1 z) (* sin-x cos-z))
(set! (-> dst vector 1 w) 0.0)
(set! (-> dst vector 2 x) (+ (* sin-y cos-z) (* (* cos-y cos-x) sin-z)))
(set! (-> dst vector 2 x) (+ (* sin-y cos-z) (* cos-y cos-x sin-z)))
(set! (-> dst vector 2 y) (- (* cos-y sin-x)))
(set! (-> dst vector 2 z) (- (* (* cos-y cos-x) cos-z) (* sin-y sin-z)))
(set! (-> dst vector 2 z) (- (* cos-y cos-x cos-z) (* sin-y sin-z)))
)
)
(set! (-> dst vector 2 w) 0.0)
@ -836,8 +836,8 @@
(f0-0 (-> mat vector 2 z))
)
(-
(+ (+ (* (* f8-0 f5-0) f0-0) (* (* f1-0 f9-0) f3-0)) (* (* f4-0 f2-0) f6-0))
(+ (+ (* (* f8-0 f9-0) f6-0) (* (* f4-0 f5-0) f3-0)) (* (* f1-0 f2-0) f0-0))
(+ (* f8-0 f5-0 f0-0) (* f1-0 f9-0 f3-0) (* f4-0 f2-0 f6-0))
(+ (* f8-0 f9-0 f6-0) (* f4-0 f5-0 f3-0) (* f1-0 f2-0 f0-0))
)
)
)
@ -1122,72 +1122,32 @@
)
(-
(+
(+
(+
(+
(+
(+
(+
(+
(+
(+
(+
(* (* (* f15-0 f6-0) f8-0) f12-0)
(* (* (* f15-0 f3-0) f13-0) f7-0)
)
(* (* (* f15-0 f11-0) f1-0) f4-0)
)
(* (* (* f14-0 f9-0) f13-0) f4-0)
)
(* (* (* f14-0 f3-0) f5-0) f4-0)
)
(* (* (* f14-0 f11-0) f8-0) f0-0)
)
(* (* (* f10-0 f9-0) f1-0) f12-0)
)
(* (* (* f10-0 f6-0) f13-0) f0-0)
)
(* (* (* f10-0 f11-0) f5-0) f7-0)
)
(* (* (* f2-0 f9-0) f1-0) f4-0)
)
(* (* (* f2-0 f6-0) f8-0) f0-0)
)
(* (* (* f2-0 f3-0) f5-0) f7-0)
(* f15-0 f6-0 f8-0 f12-0)
(* f15-0 f3-0 f13-0 f7-0)
(* f15-0 f11-0 f1-0 f4-0)
(* f14-0 f9-0 f13-0 f4-0)
(* f14-0 f3-0 f5-0 f4-0)
(* f14-0 f11-0 f8-0 f0-0)
(* f10-0 f9-0 f1-0 f12-0)
(* f10-0 f6-0 f13-0 f0-0)
(* f10-0 f11-0 f5-0 f7-0)
(* f2-0 f9-0 f1-0 f4-0)
(* f2-0 f6-0 f8-0 f0-0)
(* f2-0 f3-0 f5-0 f7-0)
)
(+
(+
(+
(+
(+
(+
(+
(+
(+
(+
(+
(* (* (* f15-0 f6-0) f13-0) f4-0)
(* (* (* f15-0 f3-0) f1-0) f12-0)
)
(* (* (* f15-0 f11-0) f8-0) f7-0)
)
(* (* (* f14-0 f9-0) f8-0) f12-0)
)
(* (* (* f14-0 f3-0) f13-0) f0-0)
)
(* (* (* f14-0 f11-0) f5-0) f4-0)
)
(* (* (* f10-0 f9-0) f13-0) f7-0)
)
(* (* (* f10-0 f6-0) f5-0) f12-0)
)
(* (* (* f10-0 f11-0) f1-0) f0-0)
)
(* (* (* f2-0 f9-0) f8-0) f7-0)
)
(* (* (* f2-0 f6-0) f5-0) f4-0)
)
(* (* (* f2-0 f3-0) f1-0) f0-0)
(* f15-0 f6-0 f13-0 f4-0)
(* f15-0 f3-0 f1-0 f12-0)
(* f15-0 f11-0 f8-0 f7-0)
(* f14-0 f9-0 f8-0 f12-0)
(* f14-0 f3-0 f13-0 f0-0)
(* f14-0 f11-0 f5-0 f4-0)
(* f10-0 f9-0 f13-0 f7-0)
(* f10-0 f6-0 f5-0 f12-0)
(* f10-0 f11-0 f1-0 f0-0)
(* f2-0 f9-0 f8-0 f7-0)
(* f2-0 f6-0 f5-0 f4-0)
(* f2-0 f3-0 f1-0 f0-0)
)
)
)
@ -1210,14 +1170,8 @@
(-> dst vector 0 x)
(/
(-
(+
(+ (* (* f9-0 f6-0) f1-0) (* (* f2-0 f10-0) f4-0))
(* (* f5-0 f3-0) f7-0)
)
(+
(+ (* (* f9-0 f10-0) f7-0) (* (* f5-0 f6-0) f4-0))
(* (* f2-0 f3-0) f1-0)
)
(+ (* f9-0 f6-0 f1-0) (* f2-0 f10-0 f4-0) (* f5-0 f3-0 f7-0))
(+ (* f9-0 f10-0 f7-0) (* f5-0 f6-0 f4-0) (* f2-0 f3-0 f1-0))
)
f0-0
)
@ -1238,14 +1192,8 @@
(-
(/
(-
(+
(+ (* (* f9-2 f6-1) f1-6) (* (* f2-2 f10-1) f4-3))
(* (* f5-2 f3-1) f7-2)
)
(+
(+ (* (* f9-2 f10-1) f7-2) (* (* f5-2 f6-1) f4-3))
(* (* f2-2 f3-1) f1-6)
)
(+ (* f9-2 f6-1 f1-6) (* f2-2 f10-1 f4-3) (* f5-2 f3-1 f7-2))
(+ (* f9-2 f10-1 f7-2) (* f5-2 f6-1 f4-3) (* f2-2 f3-1 f1-6))
)
f0-0
)
@ -1266,14 +1214,8 @@
(-> dst vector 0 z)
(/
(-
(+
(+ (* (* f9-4 f6-2) f1-13) (* (* f2-4 f10-2) f4-6))
(* (* f5-4 f3-2) f7-4)
)
(+
(+ (* (* f9-4 f10-2) f7-4) (* (* f5-4 f6-2) f4-6))
(* (* f2-4 f3-2) f1-13)
)
(+ (* f9-4 f6-2 f1-13) (* f2-4 f10-2 f4-6) (* f5-4 f3-2 f7-4))
(+ (* f9-4 f10-2 f7-4) (* f5-4 f6-2 f4-6) (* f2-4 f3-2 f1-13))
)
f0-0
)
@ -1294,14 +1236,8 @@
(-
(/
(-
(+
(+ (* (* f9-6 f6-3) f1-19) (* (* f2-6 f10-3) f4-9))
(* (* f5-6 f3-3) f7-6)
)
(+
(+ (* (* f9-6 f10-3) f7-6) (* (* f5-6 f6-3) f4-9))
(* (* f2-6 f3-3) f1-19)
)
(+ (* f9-6 f6-3 f1-19) (* f2-6 f10-3 f4-9) (* f5-6 f3-3 f7-6))
(+ (* f9-6 f10-3 f7-6) (* f5-6 f6-3 f4-9) (* f2-6 f3-3 f1-19))
)
f0-0
)
@ -1323,14 +1259,8 @@
(-
(/
(-
(+
(+ (* (* f9-8 f6-4) f1-26) (* (* f2-8 f10-4) f4-12))
(* (* f5-8 f3-4) f7-8)
)
(+
(+ (* (* f9-8 f10-4) f7-8) (* (* f5-8 f6-4) f4-12))
(* (* f2-8 f3-4) f1-26)
)
(+ (* f9-8 f6-4 f1-26) (* f2-8 f10-4 f4-12) (* f5-8 f3-4 f7-8))
(+ (* f9-8 f10-4 f7-8) (* f5-8 f6-4 f4-12) (* f2-8 f3-4 f1-26))
)
f0-0
)
@ -1351,14 +1281,8 @@
(-> dst vector 1 y)
(/
(-
(+
(+ (* (* f9-10 f6-5) f1-33) (* (* f2-10 f10-5) f4-15))
(* (* f5-10 f3-5) f7-10)
)
(+
(+ (* (* f9-10 f10-5) f7-10) (* (* f5-10 f6-5) f4-15))
(* (* f2-10 f3-5) f1-33)
)
(+ (* f9-10 f6-5 f1-33) (* f2-10 f10-5 f4-15) (* f5-10 f3-5 f7-10))
(+ (* f9-10 f10-5 f7-10) (* f5-10 f6-5 f4-15) (* f2-10 f3-5 f1-33))
)
f0-0
)
@ -1379,14 +1303,8 @@
(-
(/
(-
(+
(+ (* (* f9-12 f6-6) f1-39) (* (* f2-12 f10-6) f4-18))
(* (* f5-12 f3-6) f7-12)
)
(+
(+ (* (* f9-12 f10-6) f7-12) (* (* f5-12 f6-6) f4-18))
(* (* f2-12 f3-6) f1-39)
)
(+ (* f9-12 f6-6 f1-39) (* f2-12 f10-6 f4-18) (* f5-12 f3-6 f7-12))
(+ (* f9-12 f10-6 f7-12) (* f5-12 f6-6 f4-18) (* f2-12 f3-6 f1-39))
)
f0-0
)
@ -1407,14 +1325,8 @@
(-> dst vector 1 w)
(/
(-
(+
(+ (* (* f9-14 f6-7) f1-46) (* (* f2-14 f10-7) f4-21))
(* (* f5-14 f3-7) f7-14)
)
(+
(+ (* (* f9-14 f10-7) f7-14) (* (* f5-14 f6-7) f4-21))
(* (* f2-14 f3-7) f1-46)
)
(+ (* f9-14 f6-7 f1-46) (* f2-14 f10-7 f4-21) (* f5-14 f3-7 f7-14))
(+ (* f9-14 f10-7 f7-14) (* f5-14 f6-7 f4-21) (* f2-14 f3-7 f1-46))
)
f0-0
)
@ -1434,14 +1346,8 @@
(-> dst vector 2 x)
(/
(-
(+
(+ (* (* f9-16 f6-8) f1-52) (* (* f2-16 f10-8) f4-24))
(* (* f5-16 f3-8) f7-16)
)
(+
(+ (* (* f9-16 f10-8) f7-16) (* (* f5-16 f6-8) f4-24))
(* (* f2-16 f3-8) f1-52)
)
(+ (* f9-16 f6-8 f1-52) (* f2-16 f10-8 f4-24) (* f5-16 f3-8 f7-16))
(+ (* f9-16 f10-8 f7-16) (* f5-16 f6-8 f4-24) (* f2-16 f3-8 f1-52))
)
f0-0
)
@ -1462,14 +1368,8 @@
(-
(/
(-
(+
(+ (* (* f9-18 f6-9) f1-58) (* (* f2-18 f10-9) f4-27))
(* (* f5-18 f3-9) f7-18)
)
(+
(+ (* (* f9-18 f10-9) f7-18) (* (* f5-18 f6-9) f4-27))
(* (* f2-18 f3-9) f1-58)
)
(+ (* f9-18 f6-9 f1-58) (* f2-18 f10-9 f4-27) (* f5-18 f3-9 f7-18))
(+ (* f9-18 f10-9 f7-18) (* f5-18 f6-9 f4-27) (* f2-18 f3-9 f1-58))
)
f0-0
)
@ -1490,14 +1390,8 @@
(-> dst vector 2 z)
(/
(-
(+
(+ (* (* f9-20 f6-10) f1-65) (* (* f2-20 f10-10) f4-30))
(* (* f5-20 f3-10) f7-20)
)
(+
(+ (* (* f9-20 f10-10) f7-20) (* (* f5-20 f6-10) f4-30))
(* (* f2-20 f3-10) f1-65)
)
(+ (* f9-20 f6-10 f1-65) (* f2-20 f10-10 f4-30) (* f5-20 f3-10 f7-20))
(+ (* f9-20 f10-10 f7-20) (* f5-20 f6-10 f4-30) (* f2-20 f3-10 f1-65))
)
f0-0
)
@ -1518,14 +1412,8 @@
(-
(/
(-
(+
(+ (* (* f9-22 f6-11) f1-71) (* (* f2-22 f10-11) f4-33))
(* (* f5-22 f3-11) f7-22)
)
(+
(+ (* (* f9-22 f10-11) f7-22) (* (* f5-22 f6-11) f4-33))
(* (* f2-22 f3-11) f1-71)
)
(+ (* f9-22 f6-11 f1-71) (* f2-22 f10-11 f4-33) (* f5-22 f3-11 f7-22))
(+ (* f9-22 f10-11 f7-22) (* f5-22 f6-11 f4-33) (* f2-22 f3-11 f1-71))
)
f0-0
)
@ -1547,14 +1435,8 @@
(-
(/
(-
(+
(+ (* (* f9-24 f6-12) f1-78) (* (* f2-24 f10-12) f4-36))
(* (* f5-24 f3-12) f7-24)
)
(+
(+ (* (* f9-24 f10-12) f7-24) (* (* f5-24 f6-12) f4-36))
(* (* f2-24 f3-12) f1-78)
)
(+ (* f9-24 f6-12 f1-78) (* f2-24 f10-12 f4-36) (* f5-24 f3-12 f7-24))
(+ (* f9-24 f10-12 f7-24) (* f5-24 f6-12 f4-36) (* f2-24 f3-12 f1-78))
)
f0-0
)
@ -1575,14 +1457,8 @@
(-> dst vector 3 y)
(/
(-
(+
(+ (* (* f9-26 f6-13) f1-85) (* (* f2-26 f10-13) f4-39))
(* (* f5-26 f3-13) f7-26)
)
(+
(+ (* (* f9-26 f10-13) f7-26) (* (* f5-26 f6-13) f4-39))
(* (* f2-26 f3-13) f1-85)
)
(+ (* f9-26 f6-13 f1-85) (* f2-26 f10-13 f4-39) (* f5-26 f3-13 f7-26))
(+ (* f9-26 f10-13 f7-26) (* f5-26 f6-13 f4-39) (* f2-26 f3-13 f1-85))
)
f0-0
)
@ -1603,14 +1479,8 @@
(-
(/
(-
(+
(+ (* (* f9-28 f6-14) f1-91) (* (* f2-28 f10-14) f4-42))
(* (* f5-28 f3-14) f7-28)
)
(+
(+ (* (* f9-28 f10-14) f7-28) (* (* f5-28 f6-14) f4-42))
(* (* f2-28 f3-14) f1-91)
)
(+ (* f9-28 f6-14 f1-91) (* f2-28 f10-14 f4-42) (* f5-28 f3-14 f7-28))
(+ (* f9-28 f10-14 f7-28) (* f5-28 f6-14 f4-42) (* f2-28 f3-14 f1-91))
)
f0-0
)
@ -1631,14 +1501,8 @@
(-> dst vector 3 w)
(/
(-
(+
(+ (* (* f8-60 f6-15) f3-15) (* (* f1-98 f9-30) f4-45))
(* (* f5-30 f2-30) f7-30)
)
(+
(+ (* (* f8-60 f9-30) f7-30) (* (* f5-30 f6-15) f4-45))
(* (* f1-98 f2-30) f3-15)
)
(+ (* f8-60 f6-15 f3-15) (* f1-98 f9-30 f4-45) (* f5-30 f2-30 f7-30))
(+ (* f8-60 f9-30 f7-30) (* f5-30 f6-15 f4-45) (* f1-98 f2-30 f3-15))
)
f0-0
)

View file

@ -19,7 +19,8 @@
1.0
(sqrtf
(+
(+ (* (-> obj x) (-> obj x)) (* (-> obj y) (-> obj y)))
(* (-> obj x) (-> obj x))
(* (-> obj y) (-> obj y))
(* (-> obj z) (-> obj z))
)
)
@ -455,10 +456,7 @@
;; definition for function matrix->quaternion
(defun matrix->quaternion ((arg0 quaternion) (arg1 matrix))
(let
((f0-2
(+ (+ (-> arg1 vector 0 x) (-> arg1 vector 1 y)) (-> arg1 vector 2 z))
)
)
((f0-2 (+ (-> arg1 vector 0 x) (-> arg1 vector 1 y) (-> arg1 vector 2 z))))
(cond
((< 0.0 f0-2)
(let ((f0-4 (sqrtf (+ 1.0 f0-2))))
@ -750,7 +748,7 @@
(s2-0 (new 'stack-no-clear 'vector))
)
(set! (-> s2-0 x) (* (- 1.0 arg3) f0-7))
(set! (-> s2-0 y) (* (* arg3 f0-7) f30-0))
(set! (-> s2-0 y) (* arg3 f0-7 f30-0))
(vector-sin-rad! s2-0 s2-0)
(.lvf vf1 (&-> s2-0 quad))
)

View file

@ -368,9 +368,7 @@
(y-step (* y-diff alpha))
(z-step (* z-diff alpha))
(step-len
(sqrtf
(+ (+ (* x-step x-step) (* y-step y-step)) (* z-step z-step))
)
(sqrtf (+ (* x-step x-step) (* y-step y-step) (* z-step z-step)))
)
)
(cond

View file

@ -12,7 +12,7 @@
(+! (-> result x) (* time (-> obj initial-velocity x)))
(+! (-> result y) (* time (-> obj initial-velocity y)))
(+! (-> result z) (* time (-> obj initial-velocity z)))
(+! (-> result y) (* (* (* 0.5 time) time) (-> obj gravity)))
(+! (-> result y) (* 0.5 time time (-> obj gravity)))
result
)
@ -43,10 +43,7 @@
)
(set!
(-> obj initial-velocity y)
(-
(/ (- (-> to y) (-> from y)) duration)
(* (* 0.5 duration) (-> obj gravity))
)
(- (/ (- (-> to y) (-> from y)) duration) (* 0.5 duration (-> obj gravity)))
)
0
(none)
@ -72,7 +69,7 @@
trajectory
((obj trajectory) (from vector) (to vector) (y-vel float) (grav float))
(let* ((f0-0 y-vel)
(f1-3 (- (* f0-0 f0-0) (* (* 2.0 (- (-> from y) (-> to y))) grav)))
(f1-3 (- (* f0-0 f0-0) (* 2.0 (- (-> from y) (-> to y)) grav)))
(f0-3 900.0)
)
(when (>= f1-3 0.0)
@ -93,7 +90,7 @@
trajectory
((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float))
(let* ((f1-2 (+ arg2 (fmax (-> arg0 y) (-> arg1 y))))
(f1-5 (* (* 2.0 (- (-> arg0 y) f1-2)) arg3))
(f1-5 (* 2.0 (- (-> arg0 y) f1-2) arg3))
(f0-3 4096.0)
)
(if (< 0.0 f1-5)

View file

@ -377,7 +377,7 @@
((f30-1
(fmax
(fmin
(* (* f0-1 (-> gp-0 blend)) (-> gp-0 flex-blend))
(* f0-1 (-> gp-0 blend) (-> gp-0 flex-blend))
(-> gp-0 twist-max y)
)
(- (-> gp-0 twist-max y))
@ -428,7 +428,7 @@
(f0-21
(fmax
(fmin
(* (* (- (deg-diff f30-2 f0-15)) (-> gp-0 blend)) (-> gp-0 flex-blend))
(* (- (deg-diff f30-2 f0-15)) (-> gp-0 blend) (-> gp-0 flex-blend))
(-> gp-0 twist-max x)
)
(- (-> gp-0 twist-max x))
@ -520,7 +520,7 @@
((f0-5
(fmax
(fmin
(* (* f0-1 (-> gp-0 blend)) (-> gp-0 flex-blend))
(* f0-1 (-> gp-0 blend) (-> gp-0 flex-blend))
(-> gp-0 twist-max y)
)
(- (-> gp-0 twist-max y))
@ -560,7 +560,7 @@
(f0-20
(fmax
(fmin
(* (* (- (deg-diff f30-2 f0-14)) (-> gp-0 blend)) (-> gp-0 flex-blend))
(* (- (deg-diff f30-2 f0-14)) (-> gp-0 blend) (-> gp-0 flex-blend))
(-> gp-0 twist-max x)
)
(- (-> gp-0 twist-max x))
@ -634,7 +634,7 @@
(-> v1-2 x)
(-> v1-2 y)
(-> v1-2 z)
(* (* (-> s4-0 twist x) (-> s4-0 blend)) (-> s4-0 flex-blend))
(* (-> s4-0 twist x) (-> s4-0 blend) (-> s4-0 flex-blend))
)
)
)
@ -647,7 +647,7 @@
(-> v1-6 x)
(-> v1-6 y)
(-> v1-6 z)
(* (* (-> s4-0 twist y) (-> s4-0 blend)) (-> s4-0 flex-blend))
(* (-> s4-0 twist y) (-> s4-0 blend) (-> s4-0 flex-blend))
)
)
)
@ -660,7 +660,7 @@
(-> v1-10 x)
(-> v1-10 y)
(-> v1-10 z)
(* (* (-> s4-0 twist z) (-> s4-0 blend)) (-> s4-0 flex-blend))
(* (-> s4-0 twist z) (-> s4-0 blend) (-> s4-0 flex-blend))
)
)
)
@ -762,7 +762,7 @@
(let* ((f0-3 (vector-dot s2-0 s3-0))
(f1-0 65536.0)
(f2-1 (* 6.28318 (-> s4-0 wheel-radius)))
(f0-4 (* (* f1-0 (/ 1.0 f2-1)) f0-3))
(f0-4 (* f1-0 (/ 1.0 f2-1) f0-3))
)
(+! (-> s4-0 angle) f0-4)
)

View file

@ -945,10 +945,7 @@
s5-0
(-
f0-11
(*
(* f30-1 f30-1)
(-> self control unknown-surface01 slope-up-factor)
)
(* f30-1 f30-1 (-> self control unknown-surface01 slope-up-factor))
)
)
)

View file

@ -94,7 +94,7 @@
;; definition for function calc-terminal4-vel
(defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float))
(let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))))
(- f0-5 (+ arg1 (* arg2 (* (* (* f0-5 f0-5) f0-5) f0-5))))
(- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5))))
)
)

View file

@ -972,7 +972,7 @@
(set!
(-> a1-3 x)
(+
(* (* (-> arg1 0 x) (-> s2-0 x)) (-> *display* frames-per-second))
(* (-> arg1 0 x) (-> s2-0 x) (-> *display* frames-per-second))
(* (-> s1-0 x) (-> *display* seconds-per-frame))
)
)
@ -988,7 +988,7 @@
(set!
(-> a1-3 y)
(+
(* (* (-> arg1 0 y) (-> s2-0 y)) (-> *display* frames-per-second))
(* (-> arg1 0 y) (-> s2-0 y) (-> *display* frames-per-second))
(* (-> s1-0 y) (-> *display* seconds-per-frame))
)
)
@ -997,7 +997,7 @@
(set!
(-> a1-3 z)
(+
(* (* (-> arg1 0 z) (-> s2-0 z)) (-> *display* frames-per-second))
(* (-> arg1 0 z) (-> s2-0 z) (-> *display* frames-per-second))
(* (-> s1-0 z) (-> *display* seconds-per-frame))
)
)
@ -1238,16 +1238,10 @@
((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere)
)
(set! (-> s5-0 0 quad) (-> self control trans quad))
(set!
(-> s5-0 0 y)
(+ (+ 5734.4 (-> *TARGET-bank* body-radius)) (-> s5-0 0 y))
)
(set! (-> s5-0 0 y) (+ 5734.4 (-> *TARGET-bank* body-radius) (-> s5-0 0 y)))
(set! (-> s5-0 0 w) (-> *TARGET-bank* body-radius))
(set! (-> s5-0 1 quad) (-> self control trans quad))
(set!
(-> s5-0 1 y)
(+ (+ 2867.2 (-> *TARGET-bank* body-radius)) (-> s5-0 1 y))
)
(set! (-> s5-0 1 y) (+ 2867.2 (-> *TARGET-bank* body-radius) (-> s5-0 1 y)))
(set! (-> s5-0 1 w) (-> *TARGET-bank* body-radius))
(set! (-> gp-0 spheres) (the-as uint s5-0))
)

View file

@ -61,9 +61,9 @@
(f0-10 out-param)
(f1-12 (+ out-param total-normal-phase))
(f2-5 (* f0-10 f0-10))
(f3-3 (+ (* (* 2.0 f0-10) (- f1-12 f0-10)) f2-5))
(f3-3 (+ (* 2.0 f0-10 (- f1-12 f0-10)) f2-5))
(f4-3 (/ f0-10 (- 1.0 f1-12)))
(y-end (+ (* (* (- 1.0 f1-12) (- 1.0 f1-12)) f4-3) f3-3))
(y-end (+ (* (- 1.0 f1-12) (- 1.0 f1-12) f4-3) f3-3))
)
(set! (-> obj tlo) f0-10)
(set! (-> obj thi) f1-12)
@ -333,10 +333,8 @@
)
(combined-offset
(+
(+
(* (- wrapped-user-offset current-time-wrapped) period-float)
period-float
)
(* (- wrapped-user-offset current-time-wrapped) period-float)
period-float
(-> obj offset)
)
)
@ -520,11 +518,11 @@
(* current-val current-val)
)
((< current-val (-> obj thi))
(+ (* (* 2.0 tlo) (- current-val tlo)) (-> obj ylo))
(+ (* 2.0 tlo (- current-val tlo)) (-> obj ylo))
)
(else
(let ((f1-7 (- 1.0 current-val)))
(- (-> obj yend) (* (* f1-7 f1-7) (-> obj m2)))
(- (-> obj yend) (* f1-7 f1-7 (-> obj m2)))
)
)
)

View file

@ -65,8 +65,8 @@
(+! (-> obj posy) (* (-> obj vely) (-> *display* seconds-per-frame)))
(set! (-> obj velx) (* (-> obj velx) (-> obj damping)))
(set! (-> obj vely) (* (-> obj vely) (-> obj damping)))
(+! (-> obj velx) (* (* -1.0 (-> obj posx)) (-> obj spring)))
(+! (-> obj vely) (* (* -1.0 (-> obj posy)) (-> obj spring)))
(+! (-> obj velx) (* -1.0 (-> obj posx) (-> obj spring)))
(+! (-> obj vely) (* -1.0 (-> obj posy) (-> obj spring)))
0
(none)
)
@ -96,7 +96,3 @@
0
(none)
)

View file

@ -975,7 +975,8 @@
(-
(sqrtf
(*
(* 2.0 (-> self control dynam gravity-length))
2.0
(-> self control dynam gravity-length)
(vector-dot
(-> self control dynam gravity-normal)
(vector-!
@ -1128,7 +1129,3 @@
:post
target-no-stick-post
)

View file

@ -47,7 +47,7 @@
(-> obj initial-velocity)
time
)
(+! (-> result y) (* (* (* 0.5 time) time) (-> obj gravity)))
(+! (-> result y) (* 0.5 time time (-> obj gravity)))
result
)

View file

@ -583,13 +583,10 @@
s4-0
*y-vector*
(*
(*
(*
(* (-> obj rbody mass) (fmin 1.0 f30-0))
(/ (-> obj info gravity) (the float (-> obj info control-point-count)))
)
(-> obj info gravity-factor)
)
(-> obj rbody mass)
(fmin 1.0 f30-0)
(/ (-> obj info gravity) (the float (-> obj info control-point-count)))
(-> obj info gravity-factor)
(-> obj info buoyancy-factor)
)
)
@ -597,7 +594,7 @@
(vector-float*!
s4-0
(-> arg0 velocity)
(* (* -1.0 (-> obj info drag-factor)) (fmin 1.0 f30-0))
(* -1.0 (-> obj info drag-factor) (fmin 1.0 f30-0))
)
(TODO-RENAME-13 (-> obj rbody) (-> arg0 world-pos) s4-0)
)
@ -631,7 +628,9 @@
a1-0
*y-vector*
(*
(* (* -1.0 (-> obj info gravity-factor)) (-> obj info gravity))
-1.0
(-> obj info gravity-factor)
(-> obj info gravity)
(-> obj rbody mass)
)
)
@ -760,10 +759,9 @@
((f0-4
(fmin
(*
(*
(* 0.00012207031 (the-as float (-> arg3 param 1)))
(-> self info player-bonk-factor)
)
0.00012207031
(the-as float (-> arg3 param 1))
(-> self info player-bonk-factor)
(-> self info player-weight)
)
(-> self info player-force-clamp)
@ -818,7 +816,8 @@
((f0-9
(fmin
(*
(* 16.0 (-> self info player-weight))
16.0
(-> self info player-weight)
(-> self info player-dive-factor)
)
(-> self info player-force-clamp)