jak2: macro detection for launch-particles and seconds-per-frame, add og:preserve-this comments for manual patches (#2974)

This PR adds detection of the `launch-particles` and `seconds-per-frame`
macros to the decompiler, removing a lot of bloat and hiding many
process register uses.

I also added `og:preserve-this` comments to as many manual patches and
comments as I could, which will soon be used in conjunction with CI to
hopefully catch any regressions in future big decomp update PRs.

I have some concerns about the `launch-particles` macro (more details in
`sparticle-launcher.gc`) , but thus far, I have not seen anything break
yet.

---------

Co-authored-by: water <awaterford111445@gmail.com>
This commit is contained in:
Hat Kid 2023-09-10 17:48:56 +02:00 committed by GitHub
parent 74250a22f7
commit 49e798f88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
525 changed files with 16710 additions and 20790 deletions

View File

@ -23,4 +23,10 @@
"body": [";; og:update-with-merge"],
"description": "The file will be updated with a git merge-file instead of naive copy-paste"
},
"og:preserve-this": {
"scope": "opengoal",
"prefix": ["og:preserve-this"],
"body": [";; og:preserve-this"],
"description": "When updating GOAL source files from decomp, CI will pick up if this comment is deleted in the diff. Use this to keep track of manually patched sections of code."
},
}

View File

@ -1295,6 +1295,7 @@ class DerefElement : public FormElement {
private:
ConstantTokenElement* try_as_art_const(const Env& env, FormPool& pool);
GenericElement* try_as_curtime(FormPool& pool);
GenericElement* try_as_seconds_per_frame(FormPool& pool);
Form* m_base = nullptr;
bool m_is_addr_of = false;

View File

@ -3846,6 +3846,52 @@ void FunctionCallElement::update_from_stack(const Env& env,
}
}
// detect launch-particles macro
{
if (unstacked.at(0)->to_form(env).is_symbol("sp-launch-particles-var")) {
auto system = arg_forms.at(0);
auto part = arg_forms.at(1);
auto origin = arg_forms.at(2);
auto launch_state = arg_forms.at(3);
auto launch_control = arg_forms.at(4);
auto rate = arg_forms.at(5);
std::vector<Form*> macro;
if (system->to_string(env) != "*sp-particle-system-2d*") {
macro.push_back(pool.form<ConstantTokenElement>(":system"));
macro.push_back(system);
}
macro.push_back(part);
macro.push_back(origin);
auto mr_launch_state =
match(Matcher::cast("sparticle-launch-state", Matcher::symbol("#f")), launch_state);
auto mr_launch_control =
match(Matcher::cast("sparticle-launch-control", Matcher::symbol("#f")), launch_control);
if (!mr_launch_state.matched) {
macro.push_back(pool.form<ConstantTokenElement>(":launch-state"));
macro.push_back(launch_state);
}
if (!mr_launch_control.matched) {
macro.push_back(pool.form<ConstantTokenElement>(":launch-control"));
macro.push_back(launch_control);
}
if (rate->to_string(env) != "1.0") {
macro.push_back(pool.form<ConstantTokenElement>(":rate"));
macro.push_back(rate);
}
if (env.version > GameVersion::Jak1) {
macro.push_back(pool.form<ConstantTokenElement>(":origin-is-matrix"));
macro.push_back(pool.form<ConstantTokenElement>("#t"));
}
new_form = pool.alloc_element<GenericElement>(
GenericOperator::make_function(pool.form<ConstantTokenElement>("launch-particles")),
macro);
}
}
result->push_back(new_form);
}
@ -3895,6 +3941,18 @@ GenericElement* DerefElement::try_as_curtime(FormPool& pool) {
return nullptr;
}
GenericElement* DerefElement::try_as_seconds_per_frame(FormPool& pool) {
auto mr = match(Matcher::deref(Matcher::s6(), false,
{DerefTokenMatcher::string("clock"),
DerefTokenMatcher::string("seconds-per-frame")}),
this);
if (mr.matched) {
return pool.alloc_element<GenericElement>(
GenericOperator::make_function(pool.form<ConstantTokenElement>("seconds-per-frame")));
}
return nullptr;
}
void DerefElement::update_from_stack(const Env& env,
FormPool& pool,
FormStack& stack,
@ -3937,6 +3995,13 @@ void DerefElement::update_from_stack(const Env& env,
return;
}
// seconds-per-frame macro
auto as_seconds_per_frame = try_as_seconds_per_frame(pool);
if (as_seconds_per_frame) {
result->push_back(as_seconds_per_frame);
return;
}
result->push_back(this);
}

View File

@ -78,11 +78,13 @@ struct LetRewriteStats {
int set_let = 0;
int with_dma_buf_add_bucket = 0;
int dma_buffer_add_gs_set = 0;
int launch_particles = 0;
int total() const {
return dotimes + countdown + abs + abs2 + unused + ja + case_no_else + case_with_else +
set_vector + set_vector2 + send_event + font_context_meth + proc_new + attack_info +
vector_dot + rand_float_gen + set_let + with_dma_buf_add_bucket + dma_buffer_add_gs_set;
vector_dot + rand_float_gen + set_let + with_dma_buf_add_bucket + dma_buffer_add_gs_set +
launch_particles;
}
std::string print() const {
@ -108,6 +110,7 @@ struct LetRewriteStats {
out += fmt::format(" set_let: {}\n", set_let);
out += fmt::format(" with_dma_buf_add_bucket: {}\n", with_dma_buf_add_bucket);
out += fmt::format(" dma_buffer_add_gs_set: {}\n", dma_buffer_add_gs_set);
out += fmt::format(" launch_particles: {}\n", launch_particles);
return out;
}
@ -131,6 +134,7 @@ struct LetRewriteStats {
result.rand_float_gen = rand_float_gen + other.rand_float_gen;
result.set_let = rand_float_gen + other.set_let;
result.with_dma_buf_add_bucket = rand_float_gen + other.with_dma_buf_add_bucket;
result.launch_particles = launch_particles + other.launch_particles;
return result;
}
@ -153,6 +157,7 @@ struct LetRewriteStats {
rand_float_gen += other.rand_float_gen;
set_let += other.set_let;
with_dma_buf_add_bucket += other.with_dma_buf_add_bucket;
launch_particles += other.launch_particles;
return *this;
}
};

View File

@ -2247,6 +2247,116 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
return elt;
}
FormElement* rewrite_launch_particles(LetElement* in, const Env& env, FormPool& pool) {
/*
* (let ((t9-0 sp-launch-particles-var)
* (a0-1 *sp-particle-system-2d*)
* (a1-0 (-> *part-id-table* 539))
* (a2-0 *launch-matrix*)
* )
* (set! (-> a2-0 trans quad) (-> arg0 quad))
* (t9-0 a0-1 a1-0 a2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control
* #f) 1.0)
* )
* to:
* (launch-particles (-> *part-id-table* 539) arg0)
*/
if (in->entries().size() != 4) {
return nullptr;
}
if (in->body()->elts().size() != 2) {
return nullptr;
}
auto func = in->entries().at(0);
if (func.src->elts().at(0)->to_string(env) != "sp-launch-particles-var") {
return nullptr;
}
auto set_elt = dynamic_cast<SetFormFormElement*>(in->body()->at(0));
if (!set_elt) {
return nullptr;
}
auto func_elt = dynamic_cast<GenericElement*>(in->body()->at(1));
if (!func_elt) {
return nullptr;
}
auto part_system = in->entries().at(1);
auto system = part_system.src->at(0)->to_string(env);
if (system != "*sp-particle-system-2d*" && system != "*sp-particle-system-3d*") {
return nullptr;
}
auto part_form = in->entries().at(2).src;
auto part = dynamic_cast<DerefElement*>(part_form->elts().at(0));
if (!part) {
return nullptr;
}
auto part_id_table = part->base()->to_string(env);
if (part_id_table != "*part-id-table*") {
return nullptr;
}
auto launch_matrix = in->entries().at(3);
if (launch_matrix.src->at(0)->to_string(env) != "*launch-matrix*") {
return nullptr;
}
auto origin = dynamic_cast<DerefElement*>(set_elt->src()->elts().at(0));
if (!origin) {
return nullptr;
}
auto tokens = origin->tokens().size();
Form* origin_form;
// remove only the quad if there are multiple derefs
if (tokens > 1) {
origin_form = pool.form<DerefElement>(origin->base(), false, origin->tokens());
auto orig = dynamic_cast<DerefElement*>(origin_form->elts().at(0));
orig->tokens().pop_back();
} else {
origin_form = origin->base();
}
auto launch_state = func_elt->elts().at(func_elt->elts().size() - 3);
auto mr_launch_state =
match(Matcher::cast("sparticle-launch-state", Matcher::symbol("#f")), launch_state);
auto launch_control = func_elt->elts().at(func_elt->elts().size() - 2);
auto mr_launch_control =
match(Matcher::cast("sparticle-launch-control", Matcher::symbol("#f")), launch_control);
auto rate = func_elt->elts().at(func_elt->elts().size() - 1)->to_string(env);
// build the macro
std::vector<Form*> macro;
if (system != "*sp-particle-system-2d*") {
macro.push_back(pool.form<ConstantTokenElement>(":system"));
macro.push_back(pool.form<ConstantTokenElement>(system));
}
macro.push_back(part_form);
if (!mr_launch_state.matched) {
macro.push_back(pool.form<ConstantTokenElement>(":launch-state"));
macro.push_back(launch_state);
}
if (!mr_launch_control.matched) {
macro.push_back(pool.form<ConstantTokenElement>(":launch-control"));
macro.push_back(launch_control);
}
macro.push_back(origin_form);
if (rate != "1.0") {
macro.push_back(pool.form<ConstantTokenElement>(":rate"));
macro.push_back(pool.form<ConstantTokenElement>(rate));
}
auto elt = pool.alloc_element<GenericElement>(
GenericOperator::make_function(pool.form<ConstantTokenElement>("launch-particles")), macro);
elt->parent_form = in->parent_form;
return elt;
}
FormElement* rewrite_multi_let(LetElement* in,
const Env& env,
FormPool& pool,
@ -2271,6 +2381,14 @@ FormElement* rewrite_multi_let(LetElement* in,
}
}
if (in->entries().size() >= 4) {
auto as_launch_particles = rewrite_launch_particles(in, env, pool);
if (as_launch_particles) {
stats.launch_particles++;
return as_launch_particles;
}
}
if (in->entries().size() >= 6) {
auto as_vector_dot = rewrite_multi_let_as_vector_dot(in, env, pool);
if (as_vector_dot) {

View File

@ -481,7 +481,8 @@
)
(defbehavior manipy-init manipy ((arg0 vector) (arg1 entity-actor) (arg2 skeleton-group) (arg3 vector))
(stack-size-set! (-> self main-thread) 256) ;; from 128
;; og:preserve-this increased from 128
(stack-size-set! (-> self main-thread) 256)
(logior! (-> self mask) (process-mask heap-shrunk))
(set! (-> self entity) arg1)
(cond
@ -537,6 +538,7 @@
((nonzero? (-> self skel))
(set! (-> self new-joint-anim) (ja-group))
(set! (-> self anim-mode) 'loop)
;; og:preserve-this
(#when PC_PORT
(set! (-> self skel postbind-function) process-drawable-joint-callback-pc))
)
@ -1252,6 +1254,7 @@
(.mov v1-37 vf16)
)
(suspend)
;; og:preserve-this
(init-vf0-vector)
)
(none)
@ -1400,6 +1403,7 @@
)
)
((= (-> s2-0 -1) symbol)
;; og:preserve-this
(set! s4-0 (symbol->string (the-as symbol s2-0)))
(set! s3-0 (lookup-part-group-pointer-by-name (the-as string s4-0)))
(if s3-0
@ -1690,7 +1694,8 @@
(let ((s5-0 (new-stack-matrix0))
(gp-0 (vector-reset! (new 'stack-no-clear 'vector)))
)
(let* ((f0-0 (analog-input-horizontal-third (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) ;; changed for pc port
;; og:preserve-this changed for pc port
(let* ((f0-0 (analog-input-horizontal-third (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0))
(f1-1 (* -546.13336 f0-0))
(f0-2 (fmin 546.13336 (fmax -546.13336 f1-1)))
)
@ -1758,15 +1763,18 @@
)
)
;; og:preserve-this
;; blue eco launcher cam (not used for enclosed launchers like in jungle temple)
(defbehavior cam-launcher-long-joystick camera-slave ()
(when *camera-read-analog*
(let ((gp-0 (new-stack-matrix0)))
(let* ((f0-0 (analog-input-horizontal-third (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) ;; changed for pc port
;; og:preserve-this changed for pc port
(let* ((f0-0 (analog-input-horizontal-third (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0))
(f1-1 (* -546.13336 f0-0))
(f0-2 (fmin 546.13336 (fmax -546.13336 f1-1)))
)
(matrix-axis-angle! gp-0 (-> *camera* local-down) (* DISPLAY_FPS_RATIO f0-2)) ;; changed for high fps
;; og:preserve-this changed for high fps
(matrix-axis-angle! gp-0 (-> *camera* local-down) (* DISPLAY_FPS_RATIO f0-2))
)
(vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0)
)

View File

@ -48,7 +48,7 @@
(sp-kill-particle arg0 arg1)
(set-vector! s5-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(sound-play "water-drop" :position (the-as symbol s5-0))
(launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 108) s5-0)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 108) s5-0 :rate 1.0)
)
)
0

View File

@ -526,12 +526,11 @@
)
)
(let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 74))))
(if (and (< (fabs
(vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-0 (-> self control trans))
)
)
(if (and (< (fabs (vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-0 (-> self control trans))
)
)
819.2
)
(rand-vu-percent? 0.5)
@ -540,12 +539,11 @@
)
)
(let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 70))))
(if (and (< (fabs
(vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans))
)
)
(if (and (< (fabs (vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans))
)
)
819.2
)
(rand-vu-percent? 0.5)
@ -553,7 +551,7 @@
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2391) gp-1)
)
)
;; PAL patch here
;; og:preserve-this PAL patch here
(let ((f0-8 (lerp-scale 80.0 100.0 (-> self control unknown-float01) 0.0 81920.0)))
(if (not (ja-group? (-> self draw art-group data 104)))
(set! f0-8 (* 0.8 f0-8))
@ -624,15 +622,21 @@
(((pickup-type eco-yellow))
(change-sound! (-> self sound) (static-sound-name "yel-eco-jak"))
(let ((s4-0 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 269 270))
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-0))
)
(launch-particles
(-> *part-id-table* (if (rand-vu-percent? 0.5)
269
270
)
)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-0))
)
)
(dotimes (gp-4 2)
(let ((v1-111 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(launch-particles (-> *part-id-table* 271)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-111))
)
(launch-particles
(-> *part-id-table* 271)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-111))
)
)
)
)
@ -648,15 +652,21 @@
(update-transforms! (-> self control))
(change-sound! (-> self sound) (static-sound-name "red-eco-jak"))
(let ((s4-2 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 273 274))
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-2))
)
(launch-particles
(-> *part-id-table* (if (rand-vu-percent? 0.5)
273
274
)
)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-2))
)
)
(dotimes (gp-6 2)
(let ((v1-139 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(launch-particles (-> *part-id-table* 275)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-139))
)
(launch-particles
(-> *part-id-table* 275)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-139))
)
)
)
)
@ -675,35 +685,53 @@
(set! (-> *part-id-table* 259 init-specs 4 random-rangef) 16384.0)
)
)
(launch-particles (-> *part-id-table* 259) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-150))
)
(launch-particles
(-> *part-id-table* 259)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-150))
)
)
(let ((gp-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 255 256))
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8))
)
(launch-particles
(-> *part-id-table* (if (rand-vu-percent? 0.5)
255
256
)
)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8))
)
(if (rand-vu-percent? 0.5)
(launch-particles (-> *part-id-table* 257)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8))
)
(launch-particles
(-> *part-id-table* 257)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-8))
)
)
)
(let ((v1-168 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(launch-particles (-> *part-id-table* 260)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-168))
)
(launch-particles
(-> *part-id-table* 260)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-168))
)
)
(cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 (seconds 0.1))
)
(((pickup-type eco-green))
(change-sound! (-> self sound) (static-sound-name "green-eco-jak"))
(let ((s4-8 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(launch-particles (-> *part-id-table* (if (rand-vu-percent? 0.5) 277 278))
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-8)))
(launch-particles
(-> *part-id-table* (if (rand-vu-percent? 0.5)
277
278
)
)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s4-8))
)
)
(dotimes (gp-11 2)
(let ((v1-188 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(launch-particles (-> *part-id-table* 279) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-188)))
(launch-particles
(-> *part-id-table* 279)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-188))
)
)
)
)

View File

@ -444,8 +444,8 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(launch-particles :rate 1.0 (-> *part-id-table* 39) gp-0)
(launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 40) gp-0)
(launch-particles (-> *part-id-table* 39) gp-0 :rate 1.0)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 40) gp-0 :rate 1.0)
)
)
(none)

View File

@ -5,6 +5,12 @@
;; name in dgo: sparticle-launcher
;; dgos: GAME, ENGINE
;; og:preserve-this added macro
(defmacro launch-particles (&key (system *sp-particle-system-2d*) particle origin &key (launch-state (the-as sparticle-launch-state #f)) &key (launch-control (the-as sparticle-launch-control #f))
&key (rate DISPLAY_FPS_RATIO))
`(sp-launch-particles-var ,system ,particle ,origin ,launch-state ,launch-control ,rate)
)
;; decomp begins
(define *particle-300hz-timer* 0)
@ -86,6 +92,7 @@
(dotimes (gp-0 s3-0)
(let ((v1-2 (-> s4-0 gp-0)))
(if (and (nonzero? v1-2) (string= arg0 (-> v1-2 name)))
;; og:preserve-this
;;(return (&+ (-> s4-0 data) (* gp-0 4)))
(return (&-> s4-0 gp-0))
)
@ -98,6 +105,7 @@
(defun part-group-pointer? ((arg0 pointer))
"Is the given pointer a pointer that was returned by lookup-part-group-pointer-by-name?"
(let ((v1-0 *part-group-id-table*))
;; og:preserve-this
;; just check if we are inside the array.
(and (>= (the-as int arg0) (the-as int (-> v1-0 data)))
(< (the-as int arg0) (the-as int (&-> v1-0 1024)))
@ -129,7 +137,7 @@
;; particle init
;;;;;;;;;;;;;;;;;;;;;;;
;; this was rewritten from assembly
;; og:preserve-this this was rewritten from assembly
(defun sp-init-fields! ((arg0 (pointer float)) (arg1 (inline-array sp-field-init-spec)) (arg2 sp-field-id) (arg3 sp-field-id) (write-missing-fields symbol))
(1+! arg2)
(let ((cur-spec arg1))
@ -191,6 +199,7 @@
;; launch queue
;;;;;;;;;;;;;;;;;;;;;;;
;; og:preserve-this
;(#if (not PC_BIG_MEMORY)
(defconstant SPARTICLE_QUEUE_SIZE 32)
;(defconstant SPARTICLE_QUEUE_SIZE 80))
@ -205,7 +214,7 @@
:flag-assert #x900000020
)
;; og:preserve-this constant
(deftype sp-launch-queue (basic)
((in-use int32 :offset-assert 4)
(queue sp-queued-launch-particles SPARTICLE_QUEUE_SIZE :inline :offset-assert 16)
@ -252,7 +261,7 @@
(set! (-> arg0 prims 9) (gs-reg64 alpha-1))
(set! (-> arg0 alpha) (new 'static 'gs-alpha :b #x1 :d #x1))
;; clamp is actually zbuf for sparticles, not gs-clamp.
;; og:preserve-this clamp is actually zbuf for sparticles, not gs-clamp.
(set! (-> arg0 clamp) (the gs-clamp (new 'static 'gs-zbuf :zbp #x1c0 :psm (gs-psm ct24) :zmsk #x1)))
0
(none)
@ -275,8 +284,7 @@
(define *particle-adgif-cache* (new 'global 'particle-adgif-cache))
(set! (-> *particle-adgif-cache* used) 0)
(define-extern particle-adgif (function adgif-shader texture-id none))
(set! particle-adgif (the (function adgif-shader texture-id none) (__pc-get-mips2c "particle-adgif")))
(def-mips2c particle-adgif (function adgif-shader texture-id none))
;;;;;;;;;;;;;;;;;;;
;; launch
@ -286,6 +294,7 @@
"Queue a launch from the given launcher, at the given position."
(let ((v1-0 *sp-launch-queue*))
;; og:preserve-this constant
;; make sure we have room in the queue
(when (= (-> v1-0 in-use) SPARTICLE_QUEUE_SIZE)
(format 0 "ERROR: sp-launch-particles called during processing, and queue is full~%")
@ -464,6 +473,7 @@
(define *death-adgif* (the-as adgif-shader #f))
;; WARN: Function sp-launch-particles-death has a return type of none, but the expression builder found a return statement.
(defun sp-launch-particles-death ((arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 vector))
(rlet ((vf0 :class vf)
(vf1 :class vf)
@ -593,14 +603,7 @@
(when (> (-> gp-0 in-use) 0)
(dotimes (s5-0 (-> gp-0 in-use))
(let ((v1-4 (-> gp-0 queue s5-0)))
(sp-launch-particles-var
(-> v1-4 sp-system)
(-> v1-4 sp-launcher)
(-> v1-4 pos)
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles :system (-> v1-4 sp-system) (-> v1-4 sp-launcher) (-> v1-4 pos) :rate 1.0)
)
)
(set! (-> gp-0 in-use) 0)
@ -939,11 +942,11 @@
)
)
;; can we see it?
;; og:preserve-this can we see it?
(#if (not PC_PORT)
(sphere-in-view-frustum? (the-as sphere gp-1))
(if (-> *pc-settings* ps2-parts?)
;; pc port : launchers have larger bsphere if you have ps2 parts off
;; og:preserve-this pc port: launchers have larger bsphere if you have ps2 parts off
(sphere-in-view-frustum? (the-as sphere gp-1))
(sphere-in-view-frustum? (the-as sphere (begin (*! (-> gp-1 w) 8.0) gp-1)))
)
@ -958,6 +961,7 @@
(defmethod spawn sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector))
(set! (-> obj center quad) (-> arg0 quad))
;; og:preserve-this
;; check if we are visible (remove this check to force particles to be drawn.)
(if (not (or (is-visible? obj arg0)
(logtest? (-> obj group flags) (sp-group-flag always-draw screen-space))
@ -996,7 +1000,7 @@
(set! f30-0 0.0)
)
;; if we have ps2 particles off, say we're at the camera
;; og:preserve-this if we have ps2 particles off, say we're at the camera
(with-pc
(if (not (-> *pc-settings* ps2-parts?))
(set! f30-0 0.0)))
@ -1024,7 +1028,7 @@
(b! (!= (-> a1-4 type) a0-26) cfg-78 :delay (nop!))
)
;; PAL patch here
;; og:preserve-this PAL patch here
;; ??
(b! (zero? (logand (-> v1-29 flags) (sp-group-item-flag launch-asap bit6)))
cfg-36 :delay (nop!)
@ -1037,16 +1041,16 @@
(set! (-> a3-0 spawn-time) (the-as uint s4-0))
(logior! (-> a3-0 flags) (sp-launch-state-flags particles-active))
(if (< 0.0 f0-2)
(sp-launch-particles-var
(if (logtest? (-> v1-29 flags) (sp-group-item-flag is-3d))
(launch-particles
:system (if (logtest? (-> v1-29 flags) (sp-group-item-flag is-3d))
*sp-particle-system-3d*
*sp-particle-system-2d*
)
a1-4
(-> a3-0 origin)
a3-0
obj
f0-2
:launch-state a3-0
:launch-control obj
:rate f0-2
)
)
)
@ -1102,16 +1106,16 @@
(set! (-> a3-0 spawn-time) (the-as uint s4-0))
(logior! (-> a3-0 flags) (sp-launch-state-flags particles-active))
(if (< 0.0 f0-4)
(sp-launch-particles-var
(if (logtest? (-> v1-29 flags) (sp-group-item-flag is-3d))
(launch-particles
:system (if (logtest? (-> v1-29 flags) (sp-group-item-flag is-3d))
*sp-particle-system-3d*
*sp-particle-system-2d*
)
a1-4
(-> a3-0 origin)
a3-0
obj
f0-4
:launch-state a3-0
:launch-control obj
:rate f0-4
)
)
)
@ -1283,7 +1287,12 @@
)
)
(defun birth-func-copy-omega-to-z ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d) (arg3 sparticle-launcher) (arg4 sparticle-launch-state))
(defun birth-func-copy-omega-to-z ((arg0 sparticle-system)
(arg1 sparticle-cpuinfo)
(arg2 sprite-vec-data-3d)
(arg3 sparticle-launcher)
(arg4 sparticle-launch-state)
)
(set! (-> arg2 qx-qy-qz-sy z) (+ -16384.0 (-> arg1 omega)))
(set! (-> arg1 next-time) (-> arg4 sprite next-time))
(set! (-> arg2 x-y-z-sx w) (* 163.85638 (the float (-> arg4 sprite next-time))))
@ -1291,7 +1300,12 @@
(none)
)
(defun birth-func-random-next-time ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d) (arg3 sparticle-launcher) (arg4 sparticle-launch-state))
(defun birth-func-random-next-time ((arg0 sparticle-system)
(arg1 sparticle-cpuinfo)
(arg2 sprite-vec-data-3d)
(arg3 sparticle-launcher)
(arg4 sparticle-launch-state)
)
(set! (-> arg1 next-time) (the-as uint (the int (rand-vu-float-range 0.0 (-> arg1 user-float)))))
0
(none)

View File

@ -128,12 +128,6 @@
(new 'global 'sparticle-system 256 0 #t (-> *sprite-array-3d* vec-data) (-> *sprite-array-3d* adgif-data))
)
(defmacro launch-particles (&key (system *sp-particle-system-2d*) particle origin &key (launch-state (the-as sparticle-launch-state #f)) &key (launch-control (the-as sparticle-launch-control #f))
&key (rate DISPLAY_FPS_RATIO))
`(sp-launch-particles-var ,system ,particle ,origin ,launch-state ,launch-control ,rate)
)
;;;;;;;;;;;;;;;;;;;;
;; alloc and block
;;;;;;;;;;;;;;;;;;;;

View File

@ -36,7 +36,7 @@
(s5-0 *target*)
)
(+! (-> a1-1 y) 4096.0)
;; NOTE : added *target* check here.
;; og:preserve-this added *target* check here.
(when (and s5-0 (>= (fill-and-probe-using-y-probe
*collide-cache*
a1-1
@ -93,7 +93,7 @@
)
(init-vf0-vector)
(set! sv-16 *target*)
;; NOTE : added check here
;; og:preserve-this added check here
(if (not sv-16) (return #f))
(let ((s3-0 (new 'stack-no-clear 'vector)))
(new 'stack-no-clear 'vector)
@ -176,7 +176,7 @@
)
(defun part-tracker-track-target-joint ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo))
;; NOTE : added this check
;; og:preserve-this added this check
(if (not *target*) (return #f))
(let* ((v1-0 *target*)
(v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-0 node-list data (the int (-> arg1 user-float)))))
@ -2165,12 +2165,11 @@
)
)
)
(let ((a2-3
(process-drawable-random-point!
(the-as process-drawable (ppointer->process s4-1))
(new 'stack-no-clear 'vector)
)
)
(let ((a2-3 (process-drawable-random-point!
(the-as process-drawable (ppointer->process s4-1))
(new 'stack-no-clear 'vector)
)
)
)
(launch-particles (-> *part-id-table* 2002) a2-3)
)

View File

@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype lurkerworm (process-drawable)
((root-override collide-shape-moving :offset 112)
(twister twister :offset-assert 176)

View File

@ -63,8 +63,8 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0)
(launch-particles :rate 1.0 (-> *part-id-table* 2882) gp-0)
(launch-particles :rate 1.0 (-> *part-id-table* 2883) gp-0)
(launch-particles (-> *part-id-table* 2882) gp-0 :rate 1.0)
(launch-particles (-> *part-id-table* 2883) gp-0 :rate 1.0)
)
)
(none)

View File

@ -12,7 +12,6 @@
;; DECOMP BEGINS
(defskelgroup *citb-sagecage-sg* citb-sagecage citb-sagecage-lod0-jg citb-sagecage-redsage-idle-ja
((citb-sagecage-lod0-mg (meters 20)) (citb-sagecage-lod1-mg (meters 999999)))
:bounds (static-spherem 0 -6 0 7)
@ -421,8 +420,8 @@
)
)
:trans (behavior ()
;; og:preserve-this fix infinite state recursion
(#if PC_PORT
;; fix infinite state recursion
(if (and (not (-> self been-kicked)) (not (should-display? self)))
(go-virtual hidden)
)
@ -1054,6 +1053,7 @@
)
)
)
;; og:preserve-this
(#when PC_PORT
(when (and (= (get-response (-> self query)) 'no) (or (not (= *cheat-mode* 'debug)) (not (cpad-hold? 0 r1))) (= (-> self which-movie) 1))
(format #t "skipped green-sagecage~%")

View File

@ -7,7 +7,6 @@
;; DECOMP BEGINS
(defskelgroup *plat-citb-sg* plat-citb plat-citb-lod0-jg plat-citb-idle-ja
((plat-citb-lod0-mg (meters 20)) (plat-citb-lod1-mg (meters 999999)))
:bounds (static-spherem 0 0 0 3)

View File

@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype light-eco-child (process-drawable)
((root-override collide-shape :offset 112)
(angle-bit int32 :offset-assert 176)
@ -187,8 +186,8 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0)
(launch-particles :rate 1.0 (-> *part-id-table* 2904) gp-0)
(launch-particles :rate 1.0 (-> *part-id-table* 2905) gp-0)
(launch-particles (-> *part-id-table* 2904) gp-0 :rate 1.0)
(launch-particles (-> *part-id-table* 2905) gp-0 :rate 1.0)
)
)
(none)
@ -306,22 +305,8 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 2910)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 2911)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles (-> *part-id-table* 2910) gp-0 :rate 1.0)
(launch-particles (-> *part-id-table* 2911) gp-0 :rate 1.0)
)
)
(none)

View File

@ -349,22 +349,8 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 2933)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 2934)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles (-> *part-id-table* 2933) gp-0 :rate 1.0)
(launch-particles (-> *part-id-table* 2934) gp-0 :rate 1.0)
)
)
(none)
@ -1038,8 +1024,8 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0)
(launch-particles :rate 1.0 (-> *part-id-table* 2962) gp-0)
(launch-particles :rate 1.0 (-> *part-id-table* 2963) gp-0)
(launch-particles (-> *part-id-table* 2962) gp-0 :rate 1.0)
(launch-particles (-> *part-id-table* 2963) gp-0 :rate 1.0)
)
)
(none)

View File

@ -12,7 +12,6 @@
;; DECOMP BEGINS
(deftype darkvine (process-drawable)
((root-override collide-shape :offset 112)
(speed float :offset-assert 176)

View File

@ -9,7 +9,6 @@
;; DECOMP BEGINS
(deftype fisher-bank (basic)
((width meters :offset-assert 4)
(net-radius meters :offset-assert 8)
@ -1337,7 +1336,7 @@
)
(else
(when (< (mod (-> *display* base-frame-counter) (seconds 1)) (seconds 0.5))
;; PAL patch here
;; og:preserve-this PAL patch here
(let ((gp-0 (new
'stack
'font-context
@ -1623,8 +1622,8 @@
)
)
;; og:preserve-this pc port needs its own implementation of play-anim for cutscene skipping
(#when PC_PORT
;; pc port needs its own implementation of play-anim for cutscene skipping
(define *fisher-camera-backup-fov* (degrees 46.2356))
(define *fisher-camera-backup-trans* (new 'static 'vector :x 1095664.2500 :y 15926.4003 :z -945203.3750 :w 1.0000))
(define *fisher-camera-backup-matrix* (new 'static 'matrix :vector (new 'static 'inline-array vector 4
@ -1674,9 +1673,9 @@
)
(none)
)
;; og:preserve-this needed for cutscene skipping
:exit (behavior ()
(#when PC_PORT
;; needed for cutscene skipping
(set! (-> self cur-trans-hook) nothing)
)
((-> (method-of-type process-taskable play-anim) exit)))

View File

@ -11,7 +11,6 @@
;; DECOMP BEGINS
(defpartgroup group-jungle-binoculars
:id 176
:flags (screen-space)
@ -652,7 +651,7 @@
(when (not (or (paused?) (-> (the-as periscope (-> self change-event-from 0)) aligned?)))
(vector-reset! s5-0)
(when *camera-read-analog*
;; Mirror controls changed to respect PC Port settings
;; og:preserve-this Mirror controls changed to respect PC Port settings
(let ((f26-0 (analog-input-horizontal-first
(the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx)))
0.0

View File

@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype maincavecam (pov-camera)
((seq uint64 :offset-assert 224)
)

View File

@ -293,8 +293,8 @@
(sound-play "water-drop")
)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(launch-particles :rate 1.0 (-> *part-id-table* 2231) gp-0)
(launch-particles :system *sp-particle-system-3d* :rate 1.0 (-> *part-id-table* 2232) gp-0)
(launch-particles (-> *part-id-table* 2231) gp-0 :rate 1.0)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2232) gp-0 :rate 1.0)
)
)
(none)

View File

@ -7,7 +7,6 @@
;; DECOMP BEGINS
(defpartgroup group-windturbine-particles
:id 191
:bounds (static-bspherem 0 0 0 12)
@ -1034,6 +1033,7 @@
(let ((f30-0 1274.3112)
(f28-0 (the float s4-0))
)
;; og:preserve-this
(set! s4-0 (/-0-guard (the int (* 65536.0 (ja-frame-num 0))) (+ (-> (ja-group) data 0 length) -1)))
(set! (-> *part-id-table* 943 init-specs 17 initial-valuef)
(+ f30-0 (- f28-0 (* (the float (the int (/ (the float s4-0) 8192.0))) 8192.0)))
@ -1386,7 +1386,7 @@
(defstate breakaway-about-to-fall (breakaway)
:code (behavior ()
(sound-play "falling-bones")
(launch-particles (-> *part-id-table* 281) (-> self root-override trans))
(launch-particles (-> *part-id-table* 281) (-> self root-override trans))
(let ((gp-1 #f)
(s5-1 (-> *display* base-frame-counter))
)

View File

@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype muse (nav-enemy)
((root-override collide-shape-moving :offset 112)
(current-path-index float :offset-assert 400)
@ -143,7 +142,10 @@
(defmethod nav-enemy-method-51 muse ((obj muse))
(dotimes (s5-0 2)
(let ((v1-2 (rand-vu-int-range 3 (+ (-> obj node-list length) -1))))
(launch-particles (-> *part-id-table* 271) (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data v1-2)))
(launch-particles
(-> *part-id-table* 271)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data v1-2))
)
)
)
0

View File

@ -306,8 +306,9 @@
(not (-> self racer stick-lock))
(not (-> self racer stick-off))
)
(* (- 1.0 (* 0.0125 DISPLAY_FPS_RATIO)) f0-13) ;; changed for high fps
(* (- 0.5 (* 0.00625 DISPLAY_FPS_RATIO)) (+ 1.0 f0-13)) ;; changed for high fps
;; og:preserve-this changed for high fps
(* (- 1.0 (* 0.0125 DISPLAY_FPS_RATIO)) f0-13)
(* (- 0.5 (* 0.00625 DISPLAY_FPS_RATIO)) (+ 1.0 f0-13))
)
)
(else
@ -648,10 +649,11 @@
(when (< 0.0 (-> *part-id-table* 2212 init-specs 11 initial-valuef))
(set! (-> *part-id-table* 2212 init-specs 14 initial-valuef) (the-as float gp-0))
(set! (-> *part-id-table* 2212 init-specs 3 initial-valuef) 15155.2)
(launch-particles :system *sp-particle-system-3d*
(-> *part-id-table* 2212)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4))
)
(launch-particles
:system *sp-particle-system-3d*
(-> *part-id-table* 2212)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4))
)
)
)
(let ((gp-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00))))
@ -664,10 +666,11 @@
(when (< 0.0 (-> *part-id-table* 2212 init-specs 11 initial-valuef))
(set! (-> *part-id-table* 2212 init-specs 14 initial-valuef) (the-as float gp-2))
(set! (-> *part-id-table* 2212 init-specs 3 initial-valuef) 10240.0)
(launch-particles :system *sp-particle-system-3d*
(-> *part-id-table* 2212)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 10))
)
(launch-particles
:system *sp-particle-system-3d*
(-> *part-id-table* 2212)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 10))
)
)
)
(when (and (racer-on-ground?) (< (-> self control unknown-float01) 90112.0))
@ -729,10 +732,14 @@
)
(set! (-> s5-2 y) (-> self control shadow-pos y))
(if (nonzero? a1-13)
(launch-particles :system (if gp-4 *sp-particle-system-3d* *sp-particle-system-2d*)
a1-13
s5-2
)
(launch-particles
:system (if gp-4
*sp-particle-system-3d*
*sp-particle-system-2d*
)
a1-13
s5-2
)
)
)
(let* ((gp-5 #f)
@ -759,10 +766,14 @@
)
(set! (-> a2-7 y) (-> self control shadow-pos y))
(if (nonzero? s5-3)
(launch-particles :system (if gp-5 *sp-particle-system-3d* *sp-particle-system-2d*)
(the-as sparticle-launcher s5-3)
a2-7
)
(launch-particles
:system (if gp-5
*sp-particle-system-3d*
*sp-particle-system-2d*
)
(the-as sparticle-launcher s5-3)
a2-7
)
)
)
)
@ -840,6 +851,7 @@
(if (and (>= (-> self racer heat) (-> *RACER-bank* heat-max)) (= (-> self game mode) 'play))
(send-event self 'attack #f (static-attack-info ((mode 'heat))))
)
;; og:preserve-this allow boost with debug segment enabled
(if (and *cheat-mode* (or *debug-segment* PC_PORT) (cpad-pressed? 0 l2))
(send-event self 'boost 1.0)
)
@ -877,9 +889,10 @@
(when (!= (-> self racer boost-output) 0.0)
(dotimes (gp-7 8)
(let ((v1-258 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(launch-particles (-> *part-id-table* 2229)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-258))
)
(launch-particles
(-> *part-id-table* 2229)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-258))
)
)
)
(cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 (seconds 0.1))
@ -928,12 +941,11 @@
(sound-play "warning")
)
(when (rand-vu-percent? (/ (-> self racer heat) (-> *RACER-bank* heat-max)))
(let ((a2-28
(process-drawable-random-point!
(the-as process-drawable (ppointer->process (-> self manipy)))
(new 'stack-no-clear 'vector)
)
)
(let ((a2-28 (process-drawable-random-point!
(the-as process-drawable (ppointer->process (-> self manipy)))
(new 'stack-no-clear 'vector)
)
)
)
(launch-particles (-> *part-id-table* 2227) a2-28)
)
@ -1058,7 +1070,8 @@
(ja :num-func num-func-identity :frame-num (ja-aframe (-> self racer turn-anim-frame) 0))
(ja :chan 1 :num! (chan 0) :frame-interp (+ 0.5 (* 0.025 (-> self racer tail-anim-frame))))
(let ((gp-2 (-> self skel root-channel 2)))
(let ((f0-82 (lerp (-> self racer slide-interp) f30-2 (* DISPLAY_FPS_RATIO 0.125)))) ;; changed for high fps
;; og:preserve-this changed for high fps
(let ((f0-82 (lerp (-> self racer slide-interp) f30-2 (* DISPLAY_FPS_RATIO 0.125))))
(set! (-> self racer slide-interp) f0-82)
(set! (-> gp-2 frame-interp) f0-82)
)

View File

@ -8,7 +8,6 @@
;; DECOMP BEGINS
(defun find-adjacent-bounds-one ((arg0 nav-mesh) (arg1 nav-poly) (arg2 int) (arg3 (array int8)) (arg4 (array int8)) (arg5 vector))
(local-vars (v0-2 object) (v1-2 int) (v1-30 int) (a0-2 int) (a0-12 int) (sv-16 nav-poly) (sv-32 int))
(let ((v1-1 (+ arg2 1)))
@ -174,6 +173,7 @@
(defbehavior fleeing-nav-enemy-adjust-nav-info fleeing-nav-enemy ()
(let ((f30-0 (vector-vector-distance (-> *camera* tpos-curr-adj) (-> *camera* tpos-old-adj))))
;; og:preserve-this
;; High FPS fix: stop-chase and notice distances are calculated between a min/max range where
;; the further the camera moved since last frame decides how close the chosen value is to the
;; max distance. Since this is called more often above 60 FPS, the distance is skewed to the
@ -923,11 +923,11 @@
:neck-joint 5
:player-look-at-joint 5
:run-travel-speed (meters 30)
:run-rotate-speed (degrees 3000.0)
:run-rotate-speed (degrees 3000)
:run-acceleration (meters 1)
:run-turn-time (seconds 0.1)
:walk-travel-speed (meters 30)
:walk-rotate-speed (degrees 3000.0)
:walk-rotate-speed (degrees 3000)
:walk-acceleration (meters 1)
:walk-turn-time (seconds 0.1)
:attack-shove-back (meters 3)
@ -1158,7 +1158,7 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(launch-particles :rate 1.0 (-> *part-id-table* 1771) gp-0)
(launch-particles (-> *part-id-table* 1771) gp-0 :rate 1.0)
)
)
(none)
@ -1172,7 +1172,7 @@
(sound-play "land-grass")
)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(launch-particles :rate 1.0 (-> *part-id-table* 1772) gp-0)
(launch-particles (-> *part-id-table* 1772) gp-0 :rate 1.0)
)
)
(none)

View File

@ -9,7 +9,6 @@
;; DECOMP BEGINS
(deftype orbit-plat-bottom (process-drawable)
((parent-override (pointer orbit-plat) :offset 12)
(part2 sparticle-launch-control :offset-assert 176)

View File

@ -10,7 +10,6 @@
;; DECOMP BEGINS
(deftype blue-eco-charger-orb (process-drawable)
((parent-process (pointer blue-eco-charger) :offset 12)
(orbit-rot vector :inline :offset-assert 176)
@ -284,6 +283,7 @@
(eco-blue-glow gp-1)
)
(suspend)
;; og:preserve-this
(init-vf0-vector)
)
(none)

View File

@ -293,22 +293,8 @@
(sound-play "water-drop")
)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 763)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(sp-launch-particles-var
*sp-particle-system-3d*
(-> *part-id-table* 764)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles (-> *part-id-table* 763) gp-0 :rate 1.0)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 764) gp-0 :rate 1.0)
)
)
(none)

View File

@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype assistant (process-taskable)
((sound-id sound-id :offset-assert 380)
)
@ -358,7 +357,7 @@
(sound-play "water-drop")
)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(launch-particles :rate 1.0 (-> *part-id-table* 367) gp-0)
(launch-particles (-> *part-id-table* 367) gp-0 :rate 1.0)
)
)
(none)

View File

@ -9,7 +9,6 @@
;; DECOMP BEGINS
(define *fishermans-boat-constants* (new 'static 'rigid-body-platform-constants
:drag-factor 2.0
:buoyancy-factor 1.5

View File

@ -1198,22 +1198,8 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 434)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
(the-as float 1.0)
)
(sp-launch-particles-var
*sp-particle-system-3d*
(-> *part-id-table* 435)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
(the-as float 1.0)
)
(launch-particles (-> *part-id-table* 434) gp-0 :rate 1.0)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 435) gp-0 :rate 1.0)
)
)
(none)

View File

@ -1613,22 +1613,8 @@
(sound-play "water-drop")
)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 502)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
(the-as float 1.0)
)
(sp-launch-particles-var
*sp-particle-system-3d*
(-> *part-id-table* 503)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
(the-as float 1.0)
)
(launch-particles (-> *part-id-table* 502) gp-0 :rate 1.0)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 503) gp-0 :rate 1.0)
)
)
(none)

View File

@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype assistant-levitator (process-taskable)
((boulder entity-actor :offset-assert 380)
(particle sparticle-launch-control 4 :offset-assert 384)
@ -685,14 +684,7 @@
(sound-play "water-drop")
)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 1324)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles (-> *part-id-table* 1324) gp-0 :rate 1.0)
)
)
(none)

View File

@ -10,7 +10,6 @@
;; DECOMP BEGINS
(defskelgroup *swamp-tetherrock-sg* swamp-tetherrock swamp-tetherrock-lod0-jg swamp-tetherrock-idle-ja
((swamp-tetherrock-lod0-mg (meters 999999)))
:bounds (static-spherem 0 4 0 6)
@ -1019,7 +1018,7 @@
(let ((a2-1 (new 'static 'vector)))
(set! (-> a2-1 quad) (-> self root-override trans quad))
(set! (-> a2-1 y) 0.0)
(launch-particles :rate 1.0 (-> *part-id-table* 2017) a2-1)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 2017) a2-1 :rate 1.0)
)
)
(none)

View File

@ -1831,14 +1831,7 @@
(sound-play "water-drop")
)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 1207)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
(the-as float 1.0)
)
(launch-particles (-> *part-id-table* 1207) gp-0 :rate 1.0)
)
)
(none)

View File

@ -302,6 +302,7 @@
(enemy-method-100 self)
)
(when *target*
;; og:preserve-this macro
(target-look-at-me! :trans (the-as vector (-> self root root-prim prim-core))
:message (if (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance))
'attacking
@ -980,7 +981,7 @@
(defmethod enemy-method-111 enemy ((obj enemy))
(let ((v1-0 (-> obj root)))
(when (logtest? (-> v1-0 status) (collide-status touch-surface))
(let ((f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (-> self clock seconds-per-frame) (+ -1.0 (-> obj enemy-info friction)))))))
(let ((f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 (-> obj enemy-info friction)))))))
(vector-float*! (-> v1-0 transv) (-> v1-0 transv) f0-1)
)
0
@ -1716,6 +1717,7 @@ This commonly includes things such as:
(send-event (ppointer->process (-> obj parent)) 'child-hit)
0
(when (not *debug-unkillable*)
;; og:preserve-this for damage numbers cheat
(#cond
(PC_PORT
(let ((old-hp (-> obj hit-points))
@ -2172,14 +2174,12 @@ This commonly includes things such as:
)
(defmethod enemy-method-47 enemy ((obj enemy) (arg0 vector))
(with-pp
(let* ((f2-0 0.8)
(f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (-> pp clock seconds-per-frame) (+ -1.0 f2-0)))))
)
(vector-float*! arg0 arg0 f0-1)
)
(set! (-> arg0 y) (+ (-> arg0 y) (* -204800.0 (-> pp clock seconds-per-frame))))
(let* ((f2-0 0.8)
(f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 f2-0)))))
)
(vector-float*! arg0 arg0 f0-1)
)
(set! (-> arg0 y) (+ (-> arg0 y) (* -204800.0 (seconds-per-frame))))
)
(defbehavior enemy-die-falling-post enemy ()
@ -3036,62 +3036,60 @@ This commonly includes things such as:
;; WARN: Return type mismatch vector vs symbol.
(defmethod enemy-method-100 enemy ((obj enemy))
(local-vars (v0-1 vector))
(with-pp
(when (not (-> obj enemy-info move-to-ground))
(enemy-method-103 obj)
(return (the-as symbol #f))
)
(when (not (logtest? (enemy-flag directed) (-> obj enemy-flags)))
(let ((s5-0 (-> obj root)))
(if (focus-test? obj under-water)
(enemy-method-47 obj (-> s5-0 transv))
(+! (-> s5-0 transv y) (* (-> obj enemy-info movement-gravity) (-> pp clock seconds-per-frame)))
)
(let ((a2-0 (new 'stack-no-clear 'move-above-ground-params)))
(let ((v1-16 (-> obj enemy-info)))
(set! (-> a2-0 gnd-collide-with) (-> v1-16 recover-gnd-collide-with))
(set! (-> a2-0 popup) 8192.0)
(set! (-> a2-0 dont-move-if-overlaps?) #t)
(set! (-> a2-0 hover-if-no-ground?) (-> v1-16 hover-if-no-ground))
(set! (-> a2-0 overlaps-params options) (overlaps-others-options oo0 oo2))
(set! (-> a2-0 overlaps-params collide-with-filter) (-> v1-16 overlaps-others-collide-with-filter))
)
(set! (-> a2-0 overlaps-params tlist) *touching-list*)
(-> a2-0 overlaps-params)
(enemy-method-128 obj (-> s5-0 transv) a2-0)
(when (not (-> obj enemy-info move-to-ground))
(enemy-method-103 obj)
(return (the-as symbol #f))
)
(when (not (logtest? (enemy-flag directed) (-> obj enemy-flags)))
(let ((s5-0 (-> obj root)))
(if (focus-test? obj under-water)
(enemy-method-47 obj (-> s5-0 transv))
(+! (-> s5-0 transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame)))
)
(let ((a2-0 (new 'stack-no-clear 'move-above-ground-params)))
(let ((v1-16 (-> obj enemy-info)))
(set! (-> a2-0 gnd-collide-with) (-> v1-16 recover-gnd-collide-with))
(set! (-> a2-0 popup) 8192.0)
(set! (-> a2-0 dont-move-if-overlaps?) #t)
(set! (-> a2-0 hover-if-no-ground?) (-> v1-16 hover-if-no-ground))
(set! (-> a2-0 overlaps-params options) (overlaps-others-options oo0 oo2))
(set! (-> a2-0 overlaps-params collide-with-filter) (-> v1-16 overlaps-others-collide-with-filter))
)
(set! (-> a2-0 overlaps-params tlist) *touching-list*)
(-> a2-0 overlaps-params)
(enemy-method-128 obj (-> s5-0 transv) a2-0)
)
)
(logclear! (-> obj enemy-flags) (enemy-flag directed))
(if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead))))
(kill-prefer-falling obj)
)
(logclear! (-> obj enemy-flags) (enemy-flag directed))
(if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead))))
(kill-prefer-falling obj)
)
(let ((s5-1 (-> obj root))
(a1-2 (new 'stack-no-clear 'collide-query))
(s3-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(let ((s5-1 (-> obj root))
(a1-2 (new 'stack-no-clear 'collide-query))
(s3-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s3-0 quad) (-> s5-1 gspot-pos quad))
(set! (-> s4-0 quad) (-> s5-1 gspot-normal quad))
(the-as symbol (cond
((find-ground s5-1 a1-2 (-> obj enemy-info gnd-collide-with) 8192.0 81920.0 1024.0)
(let ((f0-4 (- (-> s5-1 trans y) (-> s5-1 gspot-pos y))))
(when (>= 409.6 (fabs f0-4))
(enemy-method-103 obj)
(return (the-as symbol #f))
v0-1
)
(set! (-> s3-0 quad) (-> s5-1 gspot-pos quad))
(set! (-> s4-0 quad) (-> s5-1 gspot-normal quad))
(the-as symbol (cond
((find-ground s5-1 a1-2 (-> obj enemy-info gnd-collide-with) 8192.0 81920.0 1024.0)
(let ((f0-4 (- (-> s5-1 trans y) (-> s5-1 gspot-pos y))))
(when (>= 409.6 (fabs f0-4))
(enemy-method-103 obj)
(return (the-as symbol #f))
v0-1
)
)
(else
(set! (-> s5-1 gspot-pos quad) (-> s3-0 quad))
(set! v0-1 (-> s5-1 gspot-normal))
(set! (-> v0-1 quad) (-> s4-0 quad))
v0-1
)
)
(else
(set! (-> s5-1 gspot-pos quad) (-> s3-0 quad))
(set! v0-1 (-> s5-1 gspot-normal))
(set! (-> v0-1 quad) (-> s4-0 quad))
v0-1
)
)
)
)
)
)
)

View File

@ -496,8 +496,8 @@
(not (paused?))
)
(if (logtest? (-> self message flags) 32)
(seek! (-> self interp) 1.0 (* 0.5 (-> self clock seconds-per-frame)))
(seek! (-> self interp) 1.0 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> self interp) 1.0 (* 0.5 (seconds-per-frame)))
(seek! (-> self interp) 1.0 (* 4.0 (seconds-per-frame)))
)
(talker-method-17 self)
)
@ -507,8 +507,8 @@
(when (and (nonzero? (-> self message-id)) (logtest? (-> self message flags) 96))
(while (!= (-> self interp) 0.0)
(if (logtest? (-> self message flags) 32)
(seek! (-> self interp) 0.0 (* 0.5 (-> self clock seconds-per-frame)))
(seek! (-> self interp) 0.0 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> self interp) 0.0 (* 0.5 (seconds-per-frame)))
(seek! (-> self interp) 0.0 (* 4.0 (seconds-per-frame)))
)
(talker-method-17 self)
(suspend)

View File

@ -449,38 +449,36 @@
)
(defmethod integrate-and-kill joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list))
(with-pp
(set! (-> arg0 bbox-valid?) #f)
(set! (-> arg0 pre-moved?) #t)
(let ((s4-0 (-> obj joints))
(f30-0 (* (-> obj tuning gravity) (-> pp clock seconds-per-frame)))
(s3-0 (-> arg0 head))
)
(while (>= s3-0 0)
(let* ((s2-0 (-> s4-0 joint s3-0))
(s1-0 (-> s2-0 mat trans))
)
(set! (-> s2-0 prev-pos quad) (-> s1-0 quad))
(+! (-> s2-0 transv y) f30-0)
(vector-v+! s1-0 s1-0 (-> s2-0 transv))
(matrix*! (-> s2-0 rmat) (-> s2-0 rmat) (-> s2-0 update-rmat))
(cond
((or (< (-> s1-0 y) (-> obj die-if-below-y))
(< (-> obj die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> obj root trans)))
)
(set! s3-0 (remove-from-list-and-reset obj arg0 s3-0))
(set! (-> arg0 bbox-valid?) #f)
(set! (-> arg0 pre-moved?) #t)
(let ((s4-0 (-> obj joints))
(f30-0 (* (-> obj tuning gravity) (seconds-per-frame)))
(s3-0 (-> arg0 head))
)
(while (>= s3-0 0)
(let* ((s2-0 (-> s4-0 joint s3-0))
(s1-0 (-> s2-0 mat trans))
)
(else
(update-bbox-for-joint obj arg0 s2-0)
(set! s3-0 (-> s2-0 next))
)
(set! (-> s2-0 prev-pos quad) (-> s1-0 quad))
(+! (-> s2-0 transv y) f30-0)
(vector-v+! s1-0 s1-0 (-> s2-0 transv))
(matrix*! (-> s2-0 rmat) (-> s2-0 rmat) (-> s2-0 update-rmat))
(cond
((or (< (-> s1-0 y) (-> obj die-if-below-y))
(< (-> obj die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> obj root trans)))
)
(set! s3-0 (remove-from-list-and-reset obj arg0 s3-0))
)
(else
(update-bbox-for-joint obj arg0 s2-0)
(set! s3-0 (-> s2-0 next))
)
)
)
)
0
(none)
)
0
(none)
)
(defmethod do-collision-response joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list))

View File

@ -434,23 +434,19 @@
(defun joint-mod-spinner-callback ((arg0 cspace) (arg1 transformq))
(with-pp
(let ((gp-0 (the-as joint-mod-spinner (-> arg0 param1))))
(when (-> gp-0 enable)
(let ((f30-0
(the float
(sar (shl (the int (+ (-> gp-0 angle) (* (-> gp-0 spin-rate) (-> pp clock seconds-per-frame)))) 48) 48)
)
)
(let ((gp-0 (the-as joint-mod-spinner (-> arg0 param1))))
(when (-> gp-0 enable)
(let ((f30-0
(the float (sar (shl (the int (+ (-> gp-0 angle) (* (-> gp-0 spin-rate) (seconds-per-frame)))) 48) 48))
)
(quaternion-vector-angle! (-> arg1 quat) (-> gp-0 spin-axis) f30-0)
(set! (-> gp-0 angle) f30-0)
)
)
(quaternion-vector-angle! (-> arg1 quat) (-> gp-0 spin-axis) f30-0)
(set! (-> gp-0 angle) f30-0)
)
)
(cspace<-parented-transformq-joint! arg0 arg1)
(none)
)
(cspace<-parented-transformq-joint! arg0 arg1)
(none)
)
(defmethod new joint-mod-spinner ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 vector) (arg3 float))
@ -640,7 +636,7 @@
)
)
;; og:preserve-this added macro
(defmacro target-look-at-me! (&key trans &key (message 'nothing-special))
"make target look at a trans in self. PC PORT NOTE : added check to see if lods have been set"
`(if (and (not (logtest? (-> self draw status) (draw-control-status uninited no-draw-temp))) *target*)

View File

@ -55,13 +55,13 @@
(cspace<-parented-transformq-joint! arg0 arg1)
(cond
((logtest? (-> gp-0 flags) (joint-mod-ik-flags enable))
(+! (-> gp-0 blend) (* 4.0 (-> self clock seconds-per-frame)))
(+! (-> gp-0 blend) (* 4.0 (seconds-per-frame)))
(if (< 1.0 (-> gp-0 blend))
(set! (-> gp-0 blend) 1.0)
)
)
(else
(set! (-> gp-0 blend) (- (-> gp-0 blend) (* 4.0 (-> self clock seconds-per-frame))))
(set! (-> gp-0 blend) (- (-> gp-0 blend) (* 4.0 (seconds-per-frame))))
(if (< (-> gp-0 blend) 0.0)
(set! (-> gp-0 blend) 0.0)
)
@ -246,6 +246,7 @@
(f4-0 (-> v1-76 y))
(f5-0 (-> v1-76 z))
)
;; og:preserve-this inlined vector-dot
; (.mula.s f0-23 f3-5)
; (.madda.s f1-16 f4-0)
; (.madd.s f0-24 f2-6 f5-0)
@ -467,9 +468,9 @@
(+! (-> sv-16 trans z) (* 8.0 f0-43))
)
)
(+! (-> sv-16 trans z) (* -260.0 (-> self clock seconds-per-frame) (-> sv-16 trans y)))
(+! (-> sv-16 trans z) (* -260.0 (seconds-per-frame) (-> sv-16 trans y)))
(let ((f0-48 (-> sv-16 trans y)))
(+! (-> sv-16 trans y) (* (-> sv-16 trans z) (-> self clock seconds-per-frame)))
(+! (-> sv-16 trans y) (* (-> sv-16 trans z) (seconds-per-frame)))
(set! (-> sv-16 trans y) (* 0.95 (-> sv-16 trans y)))
(when (< (* f0-48 (-> sv-16 trans y)) 0.0)
(set! (-> sv-16 trans y) 0.0)
@ -531,7 +532,7 @@
)
(vector-deg-slerp (-> s5-0 twist) (-> s5-0 twist) s4-0 0.3)
(set! (-> s4-0 quad) (-> s5-0 twist quad))
(seek! (-> s5-0 blend) (-> s5-0 flex-blend) (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> s5-0 blend) (-> s5-0 flex-blend) (* 4.0 (seconds-per-frame)))
(let ((s3-1 (matrix->scale gp-0 (new 'stack-no-clear 'vector))))
(let ((s2-0 (matrix->quat gp-0 (new 'stack-no-clear 'quaternion)))
(s0-0 (matrix->trans gp-0 (new 'stack-no-clear 'vector)))
@ -546,11 +547,7 @@
(let* ((f0-14 (vector-dot s4-0 (vector-! (new 'stack-no-clear 'vector) s0-0 (-> s5-0 trans))))
(f0-15 (lerp-scale 1.0 0.0 f0-14 819.2 2048.0))
)
(seek!
(-> s5-0 polar-internal-tilt-max)
(* (-> s5-0 blend) f0-15 f30-1)
(* 15.0 (-> self clock seconds-per-frame))
)
(seek! (-> s5-0 polar-internal-tilt-max) (* (-> s5-0 blend) f0-15 f30-1) (* 15.0 (seconds-per-frame)))
)
(quaternion-slerp! s1-0 s2-0 s1-0 (-> s5-0 polar-internal-tilt-max))
(matrix<-quat gp-0 s1-0)
@ -849,6 +846,7 @@
(f4-0 (-> s0-0 y))
(f5-0 (-> s0-0 z))
)
;; og:preserve-this inlined vector-dot
; (.mula.s f0-0 f3-0)
; (.madda.s f1-0 f4-0)
; (.madd.s f0-1 f2-0 f5-0)

View File

@ -859,22 +859,12 @@
(s4-0 (new 'stack-no-clear 'matrix))
)
(when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG)))
(let ((f24-0 (analog-input
(the-as int (-> *cpad-list* cpads 0 rightx))
128.0
32.0
110.0
(* 8192.0 (-> self clock seconds-per-frame))
)
)
(f1-2 (analog-input
(the-as int (-> *cpad-list* cpads 0 righty))
128.0
32.0
110.0
(* 8192.0 (-> self clock seconds-per-frame))
)
)
(let ((f24-0
(analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 32.0 110.0 (* 8192.0 (seconds-per-frame)))
)
(f1-2
(analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 32.0 110.0 (* 8192.0 (seconds-per-frame)))
)
(s2-0 (new-stack-matrix0))
)
(let ((v1-15 (new 'stack-no-clear 'vector)))
@ -895,9 +885,7 @@
(set! f1-2 (- f1-2))
)
(let* ((f1-3 (+ f24-0 f1-2))
(f1-5
(fmin (* 8192.0 (-> self clock seconds-per-frame)) (fmax (* -8192.0 (-> self clock seconds-per-frame)) f1-3))
)
(f1-5 (fmin (* 8192.0 (seconds-per-frame)) (fmax (* -8192.0 (seconds-per-frame)) f1-3)))
)
(cond
((and (< 0.0 f1-5) (< 0.0 f0-10) (< (-> self max-angle-curr) f28-0))
@ -1824,6 +1812,7 @@
((or (< f0-7 0.0) (< 1.0 f0-7))
)
((let ((f1-2 0.0))
;; og:preserve-this inlined vector-dot
;; (let* ((v1-23 arg1)
;; (f2-0 (-> v1-23 x))
;; (f3-0 (-> v1-23 y))
@ -2489,12 +2478,10 @@
128.0
32.0
110.0
(* 182.04445
(-> self clock seconds-per-frame)
(if (logtest? (cam-slave-options-u32 GUN_CAM) (-> self options))
120.0
120.0
)
(* 182.04445 (seconds-per-frame) (if (logtest? (cam-slave-options-u32 GUN_CAM) (-> self options))
120.0
120.0
)
)
)
)
@ -2509,18 +2496,18 @@
(set! f30-2 (- f30-2))
)
(if (-> self have-phony-joystick)
(set! f30-2 (* 21845.334 (-> self phony-joystick-x) (-> self clock seconds-per-frame)))
(set! f30-2 (* 21845.334 (-> self phony-joystick-x) (seconds-per-frame)))
)
(when (logtest? (cam-slave-options-u32 ALLOW_SHIFT_BUTTONS) (-> self options))
(when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS))
(if (cpad-hold? (-> *CAMERA-bank* joypad) r1)
(+! f30-2 (+ (* 10922.667 (-> self clock seconds-per-frame))
(+! f30-2 (+ (* 10922.667 (seconds-per-frame))
(analog-input
(the-as int (-> *cpad-list* cpads (-> *CAMERA-bank* joypad) abutton 9))
0.0
32.0
230.0
(* 21845.334 (-> self clock seconds-per-frame))
(* 21845.334 (seconds-per-frame))
)
)
)
@ -2528,13 +2515,13 @@
)
(when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS))
(if (cpad-hold? (-> *CAMERA-bank* joypad) l1)
(set! f30-2 (- f30-2 (+ (* 10922.667 (-> self clock seconds-per-frame))
(set! f30-2 (- f30-2 (+ (* 10922.667 (seconds-per-frame))
(analog-input
(the-as int (-> *cpad-list* cpads (-> *CAMERA-bank* joypad) abutton 8))
0.0
32.0
230.0
(* 21845.334 (-> self clock seconds-per-frame))
(* 21845.334 (seconds-per-frame))
)
)
)
@ -2548,7 +2535,7 @@
(fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat))))
)
)
(set! f30-2 (* 21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-82)) (-> self clock seconds-per-frame)))
(set! f30-2 (* 21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-82)) (seconds-per-frame)))
)
)
((and (= (-> self los-state) (slave-los-state cw)) (< f30-2 0.0))
@ -2556,7 +2543,7 @@
(fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat))))
)
)
(set! f30-2 (* -21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-88)) (-> self clock seconds-per-frame)))
(set! f30-2 (* -21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-88)) (seconds-per-frame)))
)
)
)
@ -2996,28 +2983,28 @@
(seek!
(-> self string-min-val y)
(-> (the-as vector s5-0) y)
(* (-> (the-as vector s5-0) w) (-> self clock seconds-per-frame))
(* (-> (the-as vector s5-0) w) (seconds-per-frame))
)
)
(if (!= (-> (the-as vector s5-0) z) 4095996000.0)
(seek!
(-> self string-min-val z)
(-> (the-as vector s5-0) z)
(* (-> (the-as vector s5-0) w) (-> self clock seconds-per-frame))
(* (-> (the-as vector s5-0) w) (seconds-per-frame))
)
)
(if (!= (-> (the-as vector gp-1) y) 4095996000.0)
(seek!
(-> self string-max-val y)
(-> (the-as vector gp-1) y)
(* (-> (the-as vector gp-1) w) (-> self clock seconds-per-frame))
(* (-> (the-as vector gp-1) w) (seconds-per-frame))
)
)
(if (!= (-> (the-as vector gp-1) z) 4095996000.0)
(seek!
(-> self string-max-val z)
(-> (the-as vector gp-1) z)
(* (-> (the-as vector gp-1) w) (-> self clock seconds-per-frame))
(* (-> (the-as vector gp-1) w) (seconds-per-frame))
)
)
)
@ -3428,14 +3415,9 @@
(lerp (-> *CAM_STICK-bank* min-z) (-> *CAM_STICK-bank* max-z) (-> self view-off-param))
)
(when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG)))
(let ((f0-16 (analog-input
(the-as int (-> *cpad-list* cpads 0 rightx))
128.0
32.0
110.0
(* 21845.334 (-> self clock seconds-per-frame))
)
)
(let ((f0-16
(analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 32.0 110.0 (* 21845.334 (seconds-per-frame)))
)
(gp-0 (new-stack-matrix0))
(s3-0 (new-stack-vector0))
(s5-0 (new-stack-vector0))
@ -3454,13 +3436,7 @@
(vector-negate! s3-0 s3-0)
(set! (-> s4-0 quad) (-> s5-0 quad))
(vector-normalize-copy! s4-0 s3-0 1.0)
(matrix-from-two-vectors-max-angle-partial!
gp-0
s5-0
s4-0
(* 10922.667 (-> self clock seconds-per-frame))
0.05
)
(matrix-from-two-vectors-max-angle-partial! gp-0 s5-0 s4-0 (* 10922.667 (seconds-per-frame)) 0.05)
(vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0)
)
)

View File

@ -1175,12 +1175,12 @@
(f30-0 (vector-vector-distance (-> *camera* tpos-curr-adj) (-> *camera* tpos-old-adj)))
(s2-0 (new 'stack-no-clear 'vector))
)
(vector-flatten! s1-0 (the-as vector (&-> *camera* stack 320)) (-> *camera* local-down))
(vector-flatten! s1-0 (-> *camera* tgt-face-mat vector 2) (-> *camera* local-down))
(vector-normalize! s1-0 1.0)
(vector-! s0-0 (-> *camera* tpos-curr-adj) arg1)
(vector-flatten! s0-0 s0-0 (-> *camera* local-down))
(vector-normalize! s0-0 1.0)
(vector-float*! s2-0 (the-as vector (&-> *camera* stack 320)) 32768.0)
(vector-float*! s2-0 (-> *camera* tgt-face-mat vector 2) 32768.0)
(set! sv-128 lerp-clamp)
(set! sv-144 (the-as float 0.7))
(set! sv-160 (the-as float 0.4))
@ -1248,7 +1248,7 @@
(else
(vector-! s2-1 (-> *camera* tpos-curr-adj) arg1)
(vector-normalize! s2-1 1.0)
(let* ((f0-32 (vector-dot (the-as vector (&-> *camera* stack 256)) s2-1))
(let* ((f0-32 (vector-dot (-> *camera* tgt-rot-mat vector 2) s2-1))
(f30-2 (cond
((< f0-32 0.0)
1.0
@ -1268,14 +1268,14 @@
(let* ((f1-15 (* 0.000022194603 (+ -20480.0 (vector-length s2-1))))
(f0-37 (fmax 0.0 (fmin 1.0 f1-15)))
)
(vector-float*! s2-1 (the-as vector (&-> *camera* stack 256)) (* (lerp 2048.0 8192.0 f0-37) f30-2))
(vector-float*! s2-1 (-> *camera* tgt-rot-mat vector 2) (* (lerp 2048.0 8192.0 f0-37) f30-2))
)
)
)
)
(cond
(arg2
(vector-seek-3d-smooth! (-> arg0 follow-off) s2-1 (* 20480.0 (-> pp clock seconds-per-frame)) 0.05)
(vector-seek-3d-smooth! (-> arg0 follow-off) s2-1 (* 20480.0 (seconds-per-frame)) 0.05)
(if (logtest? (cam-slave-options VERTICAL_FOLLOW_MATCHES_CAMERA) (-> *camera* settings slave-options))
(set! (-> arg0 follow-height-extra vel) 0.0)
(update! (-> arg0 follow-height-extra) 0.0)
@ -1599,6 +1599,7 @@
(set! sv-240 (new 'stack-no-clear 'matrix))
(set! sv-224 (new 'stack-no-clear 'vector))
(vector-normalize-copy! sv-224 s0-0 1.0)
;; og:preserve-this inlined vector-dot
;; (let* ((v1-25 (-> *camera* local-down))
;; (f0-8 (-> sv-224 x))
;; (f1-1 (-> sv-224 y))
@ -1765,6 +1766,7 @@
)
)
(let ((t9-10 acos))
;; og:preserve-this inlined vector-dot
;; (let* ((v1-22 s0-0)
;; (f0-9 (-> v1-22 x))
;; (f1-2 (-> v1-22 y))
@ -1851,6 +1853,7 @@
)
)
(let ((t9-10 acos))
;; og:preserve-this inlined vector-dot
;; (let* ((v1-10 s1-0)
;; (f0-6 (-> v1-10 x))
;; (f1-0 (-> v1-10 y))

View File

@ -1174,7 +1174,7 @@ it returns a triangle and normal direction to push in.
(s2-0 (new 'stack-no-clear 'vector))
)
;; figure out how far we want to move
(vector-float*! s2-0 arg1 (* arg2 (-> pp clock seconds-per-frame)))
(vector-float*! s2-0 arg1 (* arg2 (seconds-per-frame)))
;; setup collision query
(set! (-> s5-0 move-dist quad) (-> s2-0 quad))
(set! (-> s5-0 best-dist) -100000000.0)
@ -1283,27 +1283,25 @@ it returns a triangle and normal direction to push in.
(defmethod integrate-and-collide! collide-shape ((obj collide-shape) (arg0 vector))
;; for the simple collide shape, just move, and ignore collision.
(local-vars (at-0 int))
(with-pp
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(let ((t9-0 (method-of-object obj move-by-vector!))
(v1-1 (new 'stack-no-clear 'vector))
)
(.lvf vf1 (&-> arg0 quad))
(let ((f0-0 (-> pp clock seconds-per-frame)))
(.mov at-0 f0-0)
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v1-1 quad) vf1)
(t9-0 obj v1-1)
(init-vf0-vector)
(let ((t9-0 (method-of-object obj move-by-vector!))
(v1-1 (new 'stack-no-clear 'vector))
)
(.lvf vf1 (&-> arg0 quad))
(let ((f0-0 (seconds-per-frame)))
(.mov at-0 f0-0)
)
(none)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v1-1 quad) vf1)
(t9-0 obj v1-1)
)
(none)
)
)
@ -1422,7 +1420,7 @@ it returns a triangle and normal direction to push in.
)
;; and also rate limit it to prevent huge jumps in jak's animation when exiting an anim early.
;; in theory, this should follow the blending of animations, but this likely good enough.
(vector-seek! (-> obj cspace-offset) total-offset (* 16384.0 (-> pp clock seconds-per-frame)))
(vector-seek! (-> obj cspace-offset) total-offset (* 16384.0 (seconds-per-frame)))
)
;; compute the total extra velocity to add to collide.
@ -1525,7 +1523,7 @@ it returns a triangle and normal direction to push in.
)
)
;; increase a blocked counter.
(seek! (-> obj blocked-factor) 1.0 (* 4.0 (-> pp clock seconds-per-frame)))
(seek! (-> obj blocked-factor) 1.0 (* 4.0 (seconds-per-frame)))
;; and a "air block" counter.
(seek!
@ -1534,15 +1532,15 @@ it returns a triangle and normal direction to push in.
1.0
0.0
)
(* 4.0 (-> pp clock seconds-per-frame))
(* 4.0 (seconds-per-frame))
)
;; set block flag.
(logior! (-> obj status) (collide-status blocked))
)
(else
;; not blocked, wind down counters.
(seek! (-> obj blocked-factor) 0.0 (* 2.0 (-> pp clock seconds-per-frame)))
(seek! (-> obj blocked-in-air-factor) 0.0 (* 2.0 (-> pp clock seconds-per-frame)))
(seek! (-> obj blocked-factor) 0.0 (* 2.0 (seconds-per-frame)))
(seek! (-> obj blocked-in-air-factor) 0.0 (* 2.0 (seconds-per-frame)))
)
)
)
@ -1700,59 +1698,57 @@ it returns a triangle and normal direction to push in.
(defmethod integrate-no-collide! collide-shape-moving ((obj collide-shape-moving) (arg0 vector))
"Move, ignoring all collision."
(local-vars (at-0 int))
(with-pp
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(update-transforms obj)
(set! (-> obj trans-old-old-old quad) (-> obj trans-old-old quad))
(set! (-> obj trans-old-old quad) (-> obj trans-old quad))
(set! (-> obj trans-old quad) (-> obj trans quad))
(set! (-> obj prev-status) (-> obj status))
(logclear! (-> obj status) (collide-status
on-surface
on-ground
touch-surface
touch-wall
touch-ceiling
touch-actor
on-special-surface
touch-edge
blocked
on-water
impact-surface
touch-background
stuck
glance
)
)
(when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset)))
(let ((v1-13 (-> obj dynam gravity-normal)))
(set! (-> obj local-normal quad) (-> v1-13 quad))
(set! (-> obj surface-normal quad) (-> v1-13 quad))
(set! (-> obj poly-normal quad) (-> v1-13 quad))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(set! (-> obj coverage) 0.0)
(set! (-> obj touch-angle) 0.0)
(init-vf0-vector)
(update-transforms obj)
(set! (-> obj trans-old-old-old quad) (-> obj trans-old-old quad))
(set! (-> obj trans-old-old quad) (-> obj trans-old quad))
(set! (-> obj trans-old quad) (-> obj trans quad))
(set! (-> obj prev-status) (-> obj status))
(logclear! (-> obj status) (collide-status
on-surface
on-ground
touch-surface
touch-wall
touch-ceiling
touch-actor
on-special-surface
touch-edge
blocked
on-water
impact-surface
touch-background
stuck
glance
)
)
(when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset)))
(let ((v1-13 (-> obj dynam gravity-normal)))
(set! (-> obj local-normal quad) (-> v1-13 quad))
(set! (-> obj surface-normal quad) (-> v1-13 quad))
(set! (-> obj poly-normal quad) (-> v1-13 quad))
)
(let ((t9-1 (method-of-object obj move-by-vector!))
(a1-5 (new 'stack-no-clear 'vector))
)
(.lvf vf1 (&-> arg0 quad))
(let ((f0-2 (-> pp clock seconds-per-frame)))
(.mov at-0 f0-2)
)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> a1-5 quad) vf1)
(t9-1 obj a1-5)
)
0
(none)
(set! (-> obj coverage) 0.0)
(set! (-> obj touch-angle) 0.0)
)
(let ((t9-1 (method-of-object obj move-by-vector!))
(a1-5 (new 'stack-no-clear 'vector))
)
(.lvf vf1 (&-> arg0 quad))
(let ((f0-2 (seconds-per-frame)))
(.mov at-0 f0-2)
)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> a1-5 quad) vf1)
(t9-1 obj a1-5)
)
0
(none)
)
)
@ -1769,36 +1765,34 @@ it returns a triangle and normal direction to push in.
(defmethod find-ground collide-shape-moving ((obj collide-shape-moving) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float))
"Find the ground, return #t if we found it, and fill out gspot in the collide-query."
(with-pp
(set! (-> obj gspot-pos quad) (-> obj trans quad))
(set! (-> arg0 start-pos quad) (-> obj trans quad))
(vector-reset! (-> arg0 move-dist))
(let ((f0-0 (-> obj transv y)))
(if (< f0-0 0.0)
(set! arg2 (- arg2 (fmax -40960.0 (* f0-0 (-> pp clock seconds-per-frame)))))
)
)
(+! (-> arg0 start-pos y) arg2)
(set! (-> arg0 move-dist y) (- (+ arg2 arg3)))
(let ((v1-7 arg0))
(set! (-> v1-7 radius) arg4)
(set! (-> v1-7 collide-with) arg1)
(set! (-> v1-7 ignore-process0) (-> obj process))
(set! (-> v1-7 ignore-process1) #f)
(set! (-> v1-7 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> obj pat-ignore-mask)))
(set! (-> v1-7 action-mask) (collide-action solid))
)
(cond
((>= (fill-and-probe-using-line-sphere *collide-cache* arg0) 0.0)
(set! (-> obj gspot-pos y) (-> arg0 best-other-tri intersect y))
(set! (-> obj gspot-normal quad) (-> arg0 best-other-tri normal quad))
#t
)
(else
(set! (-> obj gspot-pos y) -40959590.0)
(set! (-> obj gspot-normal quad) (-> *y-vector* quad))
#f
(set! (-> obj gspot-pos quad) (-> obj trans quad))
(set! (-> arg0 start-pos quad) (-> obj trans quad))
(vector-reset! (-> arg0 move-dist))
(let ((f0-0 (-> obj transv y)))
(if (< f0-0 0.0)
(set! arg2 (- arg2 (fmax -40960.0 (* f0-0 (seconds-per-frame)))))
)
)
(+! (-> arg0 start-pos y) arg2)
(set! (-> arg0 move-dist y) (- (+ arg2 arg3)))
(let ((v1-7 arg0))
(set! (-> v1-7 radius) arg4)
(set! (-> v1-7 collide-with) arg1)
(set! (-> v1-7 ignore-process0) (-> obj process))
(set! (-> v1-7 ignore-process1) #f)
(set! (-> v1-7 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> obj pat-ignore-mask)))
(set! (-> v1-7 action-mask) (collide-action solid))
)
(cond
((>= (fill-and-probe-using-line-sphere *collide-cache* arg0) 0.0)
(set! (-> obj gspot-pos y) (-> arg0 best-other-tri intersect y))
(set! (-> obj gspot-normal quad) (-> arg0 best-other-tri normal quad))
#t
)
(else
(set! (-> obj gspot-pos y) -40959590.0)
(set! (-> obj gspot-normal quad) (-> *y-vector* quad))
#f
)
)
)
@ -2030,31 +2024,29 @@ it returns a triangle and normal direction to push in.
(defmethod fill-cache-integrate-and-collide collide-shape ((obj collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters))
"Helper to fill the collide cache and call integrate-and-collide."
(local-vars (at-0 int))
(with-pp
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
;; scale the cache fill volume by frame rate
(let ((v1-0 (new 'stack-no-clear 'vector)))
(let ((a0-1 v1-0))
(.lvf vf1 (&-> arg0 quad))
(let ((f0-0 (-> pp clock seconds-per-frame)))
(.mov at-0 f0-0)
)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> a0-1 quad) vf1)
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
;; fill the cache.
(fill-cache-for-shape obj (+ (vector-length v1-0) arg2) arg1)
(init-vf0-vector)
;; scale the cache fill volume by frame rate
(let ((v1-0 (new 'stack-no-clear 'vector)))
(let ((a0-1 v1-0))
(.lvf vf1 (&-> arg0 quad))
(let ((f0-0 (seconds-per-frame)))
(.mov at-0 f0-0)
)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> a0-1 quad) vf1)
)
;; move.
(integrate-and-collide! obj arg0)
(none)
;; fill the cache.
(fill-cache-for-shape obj (+ (vector-length v1-0) arg2) arg1)
)
;; move.
(integrate-and-collide! obj arg0)
(none)
)
)

View File

@ -617,18 +617,15 @@
45.0
60.0
)
(-> self clock seconds-per-frame)
(seconds-per-frame)
)
)
(let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> self base) gp-1)))
(vector-normalize!
s5-2
(fmax 0.0 (- (vector-length s5-2) (* (-> self speed w) (-> self clock seconds-per-frame))))
)
(vector-normalize! s5-2 (fmax 0.0 (- (vector-length s5-2) (* (-> self speed w) (seconds-per-frame)))))
(when (< (vector-length s5-2) 81920.0)
(+! (-> self speed y) (* 72817.78 (-> self clock seconds-per-frame)))
(+! (-> self speed y) (* 72817.78 (seconds-per-frame)))
(set! (-> self speed y) (fmin (fmin 291271.12 (-> self speed y)) (-> self speed y)))
(vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (-> self clock seconds-per-frame)))
(vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (seconds-per-frame)))
)
(set! (-> self suck-y-offset)
(* 2048.0 (sin (* 873.81335 (the float (mod (- (current-time) (the-as int (-> self suck-time))) 75)))))
@ -1500,37 +1497,35 @@ This commonly includes things such as:
)
(defmethod common-post money ((obj money))
(with-pp
(quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* 40049.777 (-> pp clock seconds-per-frame)))
(let ((f30-0 (-> obj bob-amount)))
(when (< 0.0 f30-0)
(set! (-> obj root trans y)
(+ (-> obj base y)
(-> obj suck-y-offset)
(* f30-0
(sin
(* 109.22667
(the float
(mod (+ (- (current-time) (the-as int (-> obj birth-time))) (the-as time-frame (-> obj bob-offset))) 600)
)
)
)
(quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* 40049.777 (seconds-per-frame)))
(let ((f30-0 (-> obj bob-amount)))
(when (< 0.0 f30-0)
(set! (-> obj root trans y)
(+ (-> obj base y)
(-> obj suck-y-offset)
(* f30-0
(sin
(* 109.22667
(the float
(mod (+ (- (current-time) (the-as int (-> obj birth-time))) (the-as time-frame (-> obj bob-offset))) 600)
)
)
)
)
)
(update-transforms (-> obj root))
)
)
)
)
(update-transforms (-> obj root))
)
(ja-post)
(none)
)
(ja-post)
(none)
)
(defstate notice-blue (money)
:virtual #t
:code (behavior ((arg0 handle))
(until #f
(quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (-> self clock seconds-per-frame)))
(quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame)))
(set! (-> self root trans quad) (-> self base quad))
(add-blue-motion #t #t #t #f)
(let ((f30-0 (-> self bob-amount)))
@ -1713,25 +1708,19 @@ This commonly includes things such as:
)
(defmethod common-post gem ((obj gem))
(with-pp
(seek! (-> obj roty-speed) 20024.889 (* 65536.0 (-> pp clock seconds-per-frame)))
(quaternion-rotate-y!
(-> obj root quat)
(-> obj root quat)
(* (-> obj roty-speed) (-> pp clock seconds-per-frame))
)
(logclear! (-> obj draw status) (draw-control-status no-draw-temp uninited))
(do-joint-math (-> obj draw) (-> obj node-list) (-> obj skel))
(let ((a0-7 (-> obj part))
(a1-3 (-> obj draw skeleton bones 3))
)
(if (nonzero? a0-7)
(spawn-with-matrix a0-7 (the-as matrix a1-3))
)
)
0
(none)
(seek! (-> obj roty-speed) 20024.889 (* 65536.0 (seconds-per-frame)))
(quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* (-> obj roty-speed) (seconds-per-frame)))
(logclear! (-> obj draw status) (draw-control-status no-draw-temp uninited))
(do-joint-math (-> obj draw) (-> obj node-list) (-> obj skel))
(let ((a0-7 (-> obj part))
(a1-3 (-> obj draw skeleton bones 3))
)
(if (nonzero? a0-7)
(spawn-with-matrix a0-7 (the-as matrix a1-3))
)
)
0
(none)
)
(defstate deploy (gem)
@ -1796,7 +1785,7 @@ This commonly includes things such as:
(vector-! (-> self root transv) s5-1 (-> self root trans))
(vector-normalize! (-> self root transv) 40960.0)
(set! (-> self root transv y) (if (< 0.0 (-> self root transv y))
(+ f30-0 (* 4.0 (-> self clock seconds-per-frame) (-> self root transv y)))
(+ f30-0 (* 4.0 (seconds-per-frame) (-> self root transv y)))
f30-0
)
)
@ -1860,7 +1849,7 @@ This commonly includes things such as:
)
)
)
(seek! (-> self roty-speed) 0.0 (* 16384.0 (-> self clock seconds-per-frame)))
(seek! (-> self roty-speed) 0.0 (* 16384.0 (seconds-per-frame)))
(common-post self)
(none)
)
@ -2279,12 +2268,10 @@ This commonly includes things such as:
)
(defmethod common-post ammo-collectable ((obj ammo-collectable))
(with-pp
(quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* 40049.777 (-> pp clock seconds-per-frame)))
((method-of-type collectable common-post) obj)
0
(none)
)
(quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* 40049.777 (seconds-per-frame)))
((method-of-type collectable common-post) obj)
0
(none)
)
(defstate die (ammo-collectable)
@ -2431,6 +2418,7 @@ This commonly includes things such as:
(if arg5
(mem-copy! (&-> sv-56 type) (&-> arg5 type) 40)
)
;; og:preserve-this pc port cheat
(#when PC_PORT
(when (and (pc-cheats? (-> *pc-settings* cheats) suck-in-all)
(!= arg1 (pickup-type skill)))
@ -2752,7 +2740,7 @@ This commonly includes things such as:
:flag-assert #xf00000080
)
;; og:preserve-this added macro
(defmacro spawn-gem-near-target! (&key (count 5))
`(dotimes (i ,count)
(birth-pickup-at-point

View File

@ -153,7 +153,7 @@ and return it as well. Otherwise, set it to `0`"
(* f0-10 (-> (the-as (pointer float) (+ (the-as uint (-> obj speed-mult-array)) (* section-idx 4)))))
)
)
(vector-float*! a2-8 (-> section pull-dir) (* f0-10 (-> self clock seconds-per-frame)))
(vector-float*! a2-8 (-> section pull-dir) (* f0-10 (seconds-per-frame)))
)
(send-event proc-focus 'push-trans a2-8 (seconds 10))
)

View File

@ -690,9 +690,10 @@ do so.
(seek!
(-> self path-pos)
(-> self path-dest)
;; og:preserve-this pc port fast elevator option
(* (/ (* (#if PC_PORT (if (eligible-for-fast-elevator? *pc-settings* self) 1.5 1.0)
1.0)
(-> self params move-rate)) (-> self move-dist)) (-> self clock seconds-per-frame))
(-> self params move-rate)) (-> self move-dist)) (seconds-per-frame))
)
(let* ((f30-0 (-> self move-pos 0))
(f28-0 (-> self move-pos 1))

View File

@ -497,24 +497,10 @@
)
(defun eco-blue-glow ((arg0 vector))
(let ((t9-0 sp-launch-particles-var)
(a0-1 *sp-particle-system-2d*)
(a1-0 (-> *part-id-table* 539))
(a2-0 *launch-matrix*)
)
(set! (-> a2-0 trans quad) (-> arg0 quad))
(t9-0 a0-1 a1-0 a2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(when (rand-vu-percent? 0.5)
(let ((t9-2 sp-launch-particles-var)
(a0-3 *sp-particle-system-2d*)
(a1-1 (-> *part-id-table* 541))
(a2-1 *launch-matrix*)
)
(set! (-> a2-1 trans quad) (-> arg0 quad))
(t9-2 a0-3 a1-1 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
(launch-particles (-> *part-id-table* 539) arg0)
(if (rand-vu-percent? 0.5)
(launch-particles (-> *part-id-table* 541) arg0)
)
)
0
(none)
)
@ -638,45 +624,26 @@
(set! (-> *part-id-table* 543 init-specs 4 random-rangef) 16384.0)
)
)
(let ((gp-5 sp-launch-particles-var)
(s5-4 *sp-particle-system-2d*)
(s4-4 (-> *part-id-table* 543))
(s2-4 *launch-matrix*)
)
(set! (-> s2-4 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-99)) quad)
)
(gp-5 s5-4 s4-4 s2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
(launch-particles
(-> *part-id-table* 543)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-99))
)
)
(let ((gp-6 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(let ((s5-5 sp-launch-particles-var)
(s4-5 *sp-particle-system-2d*)
(s3-5 (-> *part-id-table* (if (rand-vu-percent? 0.5)
539
540
)
)
)
(s1-4 *launch-matrix*)
(launch-particles
(-> *part-id-table* (if (rand-vu-percent? 0.5)
539
540
)
)
(set! (-> s1-4 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-6)) quad)
)
(s5-5 s4-5 s3-5 s1-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-6))
)
(when (rand-vu-percent? 0.5)
(let ((s5-6 sp-launch-particles-var)
(s4-6 *sp-particle-system-2d*)
(s3-6 (-> *part-id-table* 541))
(s1-5 *launch-matrix*)
)
(set! (-> s1-5 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-6)) quad)
)
(s5-6 s4-6 s3-6 s1-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
(if (rand-vu-percent? 0.5)
(launch-particles
(-> *part-id-table* 541)
(vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data gp-6))
)
)
)
)
(let ((v1-123 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))
(gp-7 sp-launch-particles-var)
@ -855,44 +822,30 @@
)
)
(let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 38))))
(when (and (< (fabs (vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-0 (-> self control trans))
)
(if (and (< (fabs (vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-0 (-> self control trans))
)
819.2
)
(rand-vu-percent? 0.5)
)
(let ((t9-3 sp-launch-particles-var)
(a0-15 *sp-particle-system-3d*)
(a1-2 (-> *part-id-table* 165))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> gp-0 quad))
(t9-3 a0-15 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
819.2
)
(rand-vu-percent? 0.5)
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 165) gp-0)
)
)
)
(let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 31))))
(when (and (< (fabs (vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans))
)
(if (and (< (fabs (vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans))
)
819.2
)
(rand-vu-percent? 0.5)
)
(let ((t9-6 sp-launch-particles-var)
(a0-19 *sp-particle-system-3d*)
(a1-5 (-> *part-id-table* 165))
(a2-5 *launch-matrix*)
)
(set! (-> a2-5 trans quad) (-> gp-1 quad))
(t9-6 a0-19 a1-5 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
819.2
)
(rand-vu-percent? 0.5)
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 165) gp-1)
)
)
)
(let ((f0-10 (lerp-scale 0.8 1.0 (-> self control ctrl-xz-vel) 0.0 81920.0)))
(let ((v1-64 (ja-group)))
@ -900,7 +853,7 @@
(set! f0-10 (* 0.8 f0-10))
)
)
(seek! (-> self control unknown-float45) f0-10 (-> self clock seconds-per-frame))
(seek! (-> self control unknown-float45) f0-10 (seconds-per-frame))
)
(let ((f30-1 (-> self control unknown-float45))
(f0-14 (lerp-scale -0.3 0.3 (-> self control ctrl-xz-vel) 0.0 81920.0))
@ -971,23 +924,23 @@
((cpad-hold? (-> self control cpad number) r1)
(update-rates!
(-> *display* entity-clock)
(seek (-> *display* entity-clock clock-ratio) 60.0 (* 120.0 (-> self clock seconds-per-frame)))
(seek (-> *display* entity-clock clock-ratio) 60.0 (* 120.0 (seconds-per-frame)))
)
(update-rates! (-> *display* bg-clock) (-> *display* entity-clock clock-ratio))
(update-rates!
(-> *display* target-clock)
(seek (-> *display* target-clock clock-ratio) 2.0 (* 120.0 (-> self clock seconds-per-frame)))
(seek (-> *display* target-clock clock-ratio) 2.0 (* 120.0 (seconds-per-frame)))
)
)
((or (!= (-> *display* entity-clock clock-ratio) 2.0) (!= (-> *display* target-clock clock-ratio) 1.0))
(update-rates!
(-> *display* entity-clock)
(seek (-> *display* entity-clock clock-ratio) 2.0 (* 120.0 (-> self clock seconds-per-frame)))
(seek (-> *display* entity-clock clock-ratio) 2.0 (* 120.0 (seconds-per-frame)))
)
(update-rates! (-> *display* bg-clock) (-> *display* entity-clock clock-ratio))
(update-rates!
(-> *display* target-clock)
(seek (-> *display* target-clock clock-ratio) 1.0 (* 120.0 (-> self clock seconds-per-frame)))
(seek (-> *display* target-clock clock-ratio) 1.0 (* 120.0 (seconds-per-frame)))
)
)
)
@ -1001,28 +954,29 @@
((cpad-hold? (-> self control cpad number) r1)
(update-rates!
(-> *display* entity-clock)
(seek (-> *display* entity-clock clock-ratio) 0.3 (* 30.0 (-> self clock seconds-per-frame)))
(seek (-> *display* entity-clock clock-ratio) 0.3 (* 30.0 (seconds-per-frame)))
)
(update-rates! (-> *display* bg-clock) (-> *display* entity-clock clock-ratio))
(update-rates!
(-> *display* target-clock)
(seek (-> *display* target-clock clock-ratio) 0.5 (* 30.0 (-> self clock seconds-per-frame)))
(seek (-> *display* target-clock clock-ratio) 0.5 (* 30.0 (seconds-per-frame)))
)
)
((or (!= (-> *display* entity-clock clock-ratio) 1.0) (!= (-> *display* target-clock clock-ratio) 1.0))
(update-rates!
(-> *display* entity-clock)
(seek (-> *display* entity-clock clock-ratio) 1.0 (* 30.0 (-> self clock seconds-per-frame)))
(seek (-> *display* entity-clock clock-ratio) 1.0 (* 30.0 (seconds-per-frame)))
)
(update-rates! (-> *display* bg-clock) (-> *display* entity-clock clock-ratio))
(update-rates!
(-> *display* target-clock)
(seek (-> *display* target-clock clock-ratio) 1.0 (* 30.0 (-> self clock seconds-per-frame)))
(seek (-> *display* target-clock clock-ratio) 1.0 (* 30.0 (seconds-per-frame)))
)
)
)
)
)
;; og:preserve-this pc port time cheat
(#when PC_PORT
;; time cheats (doesn't work properly)
(cond
@ -1052,12 +1006,12 @@
(let ((f30-2 (-> self board camera-interp)))
(cond
((focus-test? self board)
(seek! (-> self board camera-interp) 1.0 (* 0.1 (-> self clock seconds-per-frame)))
(seek! (-> self board camera-interp) 1.0 (* 0.1 (seconds-per-frame)))
)
((< (-> self control ctrl-xz-vel) 2048.0)
)
(else
(seek! (-> self board camera-interp) 0.0 (* 0.1 (-> self clock seconds-per-frame)))
(seek! (-> self board camera-interp) 0.0 (* 0.1 (seconds-per-frame)))
)
)
(let ((f28-0 (-> self board camera-interp)))

View File

@ -193,42 +193,40 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p
(defun projectile-move-fill-line-sphere ((arg0 projectile))
(local-vars (at-0 int))
(with-pp
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(let ((gp-0 (-> arg0 root)))
(let ((a1-0 (new 'stack-no-clear 'collide-query)))
(let ((a2-0 (-> gp-0 root-prim)))
(set! (-> a1-0 start-pos quad) (-> gp-0 trans quad))
(let ((v1-1 (-> a1-0 move-dist)))
(.lvf vf1 (&-> (-> gp-0 transv) quad))
(let ((f0-0 (-> pp clock seconds-per-frame)))
(.mov at-0 f0-0)
)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v1-1 quad) vf1)
)
(let ((v1-2 a1-0))
(set! (-> v1-2 radius) (-> a2-0 prim-core world-sphere w))
(set! (-> v1-2 collide-with) (-> a2-0 prim-core collide-with))
(set! (-> v1-2 ignore-process0) arg0)
(set! (-> v1-2 ignore-process1) (handle->process (-> arg0 ignore-handle)))
(set! (-> v1-2 ignore-pat) (-> gp-0 pat-ignore-mask))
(set! (-> v1-2 action-mask) (collide-action solid))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(let ((gp-0 (-> arg0 root)))
(let ((a1-0 (new 'stack-no-clear 'collide-query)))
(let ((a2-0 (-> gp-0 root-prim)))
(set! (-> a1-0 start-pos quad) (-> gp-0 trans quad))
(let ((v1-1 (-> a1-0 move-dist)))
(.lvf vf1 (&-> (-> gp-0 transv) quad))
(let ((f0-0 (seconds-per-frame)))
(.mov at-0 f0-0)
)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v1-1 quad) vf1)
)
(let ((v1-2 a1-0))
(set! (-> v1-2 radius) (-> a2-0 prim-core world-sphere w))
(set! (-> v1-2 collide-with) (-> a2-0 prim-core collide-with))
(set! (-> v1-2 ignore-process0) arg0)
(set! (-> v1-2 ignore-process1) (handle->process (-> arg0 ignore-handle)))
(set! (-> v1-2 ignore-pat) (-> gp-0 pat-ignore-mask))
(set! (-> v1-2 action-mask) (collide-action solid))
)
(fill-using-line-sphere *collide-cache* a1-0)
)
(integrate-and-collide! gp-0 (-> gp-0 transv))
(fill-using-line-sphere *collide-cache* a1-0)
)
0
(none)
(integrate-and-collide! gp-0 (-> gp-0 transv))
)
0
(none)
)
)
@ -298,14 +296,14 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p
)
)
(when (logtest? (-> self options) (projectile-options proj-options-2))
(seek! (-> self tween) 1.0 (* 0.5 (-> self clock seconds-per-frame)))
(seek! (-> self tween) 1.0 (* 0.5 (seconds-per-frame)))
(let ((f0-4 (vector-vector-distance (-> self root trans) (-> self target-pos))))
(cond
((< f0-4 20480.0)
(seek! (-> self tween) 1.0 (* 3.0 (-> self clock seconds-per-frame)))
(seek! (-> self tween) 1.0 (* 3.0 (seconds-per-frame)))
)
((< f0-4 40960.0)
(seek! (-> self tween) 1.0 (-> self clock seconds-per-frame))
(seek! (-> self tween) 1.0 (seconds-per-frame))
)
)
)
@ -507,7 +505,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p
)
(defbehavior projectile-bounce-update-velocity projectile ((arg0 projectile-bounce))
(set! (-> arg0 root transv y) (- (-> arg0 root transv y) (* 184320.0 (-> self clock seconds-per-frame))))
(set! (-> arg0 root transv y) (- (-> arg0 root transv y) (* 184320.0 (seconds-per-frame))))
0
(none)
)

View File

@ -179,8 +179,8 @@
)
)
(if (< 0.0 f0-6)
(seek! (-> self twist) -0.4 (* 0.3 (-> self clock seconds-per-frame)))
(seek! (-> self twist) 0.4 (* 0.3 (-> self clock seconds-per-frame)))
(seek! (-> self twist) -0.4 (* 0.3 (seconds-per-frame)))
(seek! (-> self twist) 0.4 (* 0.3 (seconds-per-frame)))
)
)
(let ((a1-9 (new 'stack-no-clear 'event-message-block)))
@ -444,6 +444,7 @@
(set! (-> *game-info* timer) (the-as time-frame v1-15))
)
)
;; og:preserve-this pc port trick tracker
;; Print trick text to screen if available
(#when PC_PORT
(render-combo *board-trick-tracker*))
@ -469,6 +470,7 @@
(when (and s4-0 (begin (send-event s5-2 'change-mode 'board #f) (focus-test? s5-2 board)))
(change-parent self (ppointer->process s4-0))
(try-update-focus (-> self focus) s5-2)
;; og:preserve-this pc port trick tracker
(#when PC_PORT
(end-combo! *board-trick-tracker*)
(reset-combo! *board-trick-tracker*))

View File

@ -350,7 +350,7 @@
((#f)
)
(('heat)
(send-event (the-as process-tree gp-0) 'heat (* 10.0 (-> self clock seconds-per-frame)))
(send-event (the-as process-tree gp-0) 'heat (* 10.0 (seconds-per-frame)))
)
(('drown-death 'lava 'dark-eco-pool)
(if (and (not (focus-test? (the-as process-focusable gp-0) board))

View File

@ -83,93 +83,91 @@
;; WARN: Function (method 11 flow-control) has a return type of none, but the expression builder found a return statement.
(defmethod push-process flow-control ((obj flow-control) (arg0 process-focusable))
(with-pp
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
)
(init-vf0-vector)
(let ((s5-0 (new 'stack-no-clear 'vector)))
(set! (-> s5-0 quad) (-> (get-trans arg0 0) quad))
(set! (-> s5-0 w) 1.0)
(when (>= (vector4-dot s5-0 (the-as vector (-> obj leading))) 0.0)
(let* ((v1-7 (-> obj sections))
(a0-3 (-> v1-7 length))
(a3-0 (the-as object (-> obj leading)))
)
(dotimes (s3-1 a0-3)
(let ((s2-0 (-> v1-7 data s3-1)))
(when (< (vector4-dot s5-0 (the-as vector (-> s2-0 trailing))) 0.0)
(let ((v1-8 (new 'stack-no-clear 'vector)))
(vector-! v1-8 s5-0 (-> s2-0 start))
(when (>= (-> obj belt-radius) (fabs (vector-dot v1-8 (-> s2-0 radial-dir))))
(let* ((f0-7 (vector-dot v1-8 (-> s2-0 pull-dir)))
(f0-9 (- (-> v1-8 y) (* (-> s2-0 pull-dir y) f0-7)))
)
(when (and (>= f0-9 -41984.0) (>= 41779.2 f0-9))
(let* ((a0-11 (new 'stack-no-clear 'vector))
(s1-0 (new 'stack-no-clear 'vector))
(f30-0 (ray-plane-equation-intersect a0-11 s5-0 (-> s2-0 pull-dir) (the-as vector a3-0)))
(f0-10 (ray-plane-equation-intersect s1-0 s5-0 (-> s2-0 pull-dir) (-> s2-0 trailing)))
)
(let ((a0-13 (new 'stack-no-clear 'vector)))
(let ((v1-13 (-> s2-0 start)))
(let ((a1-12 (-> s2-0 pull-dir)))
(let ((a2-6 12288.0))
(.mov vf7 a2-6)
)
(.lvf vf5 (&-> a1-12 quad))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
)
(init-vf0-vector)
(let ((s5-0 (new 'stack-no-clear 'vector)))
(set! (-> s5-0 quad) (-> (get-trans arg0 0) quad))
(set! (-> s5-0 w) 1.0)
(when (>= (vector4-dot s5-0 (the-as vector (-> obj leading))) 0.0)
(let* ((v1-7 (-> obj sections))
(a0-3 (-> v1-7 length))
(a3-0 (the-as object (-> obj leading)))
)
(dotimes (s3-1 a0-3)
(let ((s2-0 (-> v1-7 data s3-1)))
(when (< (vector4-dot s5-0 (the-as vector (-> s2-0 trailing))) 0.0)
(let ((v1-8 (new 'stack-no-clear 'vector)))
(vector-! v1-8 s5-0 (-> s2-0 start))
(when (>= (-> obj belt-radius) (fabs (vector-dot v1-8 (-> s2-0 radial-dir))))
(let* ((f0-7 (vector-dot v1-8 (-> s2-0 pull-dir)))
(f0-9 (- (-> v1-8 y) (* (-> s2-0 pull-dir y) f0-7)))
)
(when (and (>= f0-9 -41984.0) (>= 41779.2 f0-9))
(let* ((a0-11 (new 'stack-no-clear 'vector))
(s1-0 (new 'stack-no-clear 'vector))
(f30-0 (ray-plane-equation-intersect a0-11 s5-0 (-> s2-0 pull-dir) (the-as vector a3-0)))
(f0-10 (ray-plane-equation-intersect s1-0 s5-0 (-> s2-0 pull-dir) (-> s2-0 trailing)))
)
(let ((a0-13 (new 'stack-no-clear 'vector)))
(let ((v1-13 (-> s2-0 start)))
(let ((a1-12 (-> s2-0 pull-dir)))
(let ((a2-6 12288.0))
(.mov vf7 a2-6)
)
(.lvf vf4 (&-> v1-13 quad))
(.lvf vf5 (&-> a1-12 quad))
)
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf5 vf7 :mask #b111)
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
(.svf (&-> a0-13 quad) vf6)
(.lvf vf4 (&-> v1-13 quad))
)
0
(let ((f0-12 (/ f30-0 (- f30-0 f0-10)))
(s2-1 (new 'stack-no-clear 'vector))
)
(displacement-between-two-points-normalized! (-> obj path) s2-1 (+ (the float s3-1) f0-12))
(let ((v1-17 (new 'stack-no-clear 'vector)))
(vector-float*! v1-17 s2-1 (* (-> obj speed) (-> pp clock seconds-per-frame)))
(let ((a1-15 (new 'stack-no-clear 'vector)))
(let ((a0-17 v1-17))
(let ((a2-9 2048.0))
(.mov vf7 a2-9)
)
(.lvf vf5 (&-> a0-17 quad))
)
(.lvf vf4 (&-> s5-0 quad))
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf5 vf7 :mask #b111)
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
(.svf (&-> a1-15 quad) vf6)
)
0
(send-event arg0 'push-trans v1-17 (seconds 10))
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf5 vf7 :mask #b111)
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
(.svf (&-> a0-13 quad) vf6)
)
0
(let ((f0-12 (/ f30-0 (- f30-0 f0-10)))
(s2-1 (new 'stack-no-clear 'vector))
)
(displacement-between-two-points-normalized! (-> obj path) s2-1 (+ (the float s3-1) f0-12))
(let ((v1-17 (new 'stack-no-clear 'vector)))
(vector-float*! v1-17 s2-1 (* (-> obj speed) (seconds-per-frame)))
(let ((a1-15 (new 'stack-no-clear 'vector)))
(let ((a0-17 v1-17))
(let ((a2-9 2048.0))
(.mov vf7 a2-9)
)
(.lvf vf5 (&-> a0-17 quad))
)
(.lvf vf4 (&-> s5-0 quad))
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf5 vf7 :mask #b111)
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
(.svf (&-> a1-15 quad) vf6)
)
0
(send-event arg0 'push-trans v1-17 (seconds 10))
)
)
)
)
)
)
(return #f)
)
(return #f)
)
(set! a3-0 (+ (the-as uint (-> v1-7 data 0 trailing)) (* s3-1 64)))
)
(set! a3-0 (+ (the-as uint (-> v1-7 data 0 trailing)) (* s3-1 64)))
)
)
)
0
(none)
)
0
(none)
)
)

View File

@ -13,14 +13,7 @@
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(sound-play "water-drop" :position gp-0)
(let ((t9-3 sp-launch-particles-var)
(a0-4 *sp-particle-system-3d*)
(a1-3 (-> *part-id-table* 501))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> gp-0 quad))
(t9-3 a0-4 a1-3 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 501) gp-0)
)
)
0
@ -620,23 +613,9 @@
(sp-kill-particle arg0 arg1)
(set-vector! s3-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(sound-play "water-drop" :position s3-0)
(let ((t9-3 sp-launch-particles-var)
(a0-5 *sp-particle-system-3d*)
(a1-3 (-> *part-id-table* 501))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> s3-0 quad))
(t9-3 a0-5 a1-3 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 501) s3-0)
(set! (-> *part-id-table* 536 init-specs 15 initial-valuef) (-> s3-0 y))
(let ((t9-4 sp-launch-particles-var)
(a0-6 *sp-particle-system-2d*)
(a1-4 (-> *part-id-table* 536))
(a2-3 *launch-matrix*)
)
(set! (-> a2-3 trans quad) (-> s3-0 quad))
(t9-4 a0-6 a1-4 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 536) s3-0)
)
)
(sparticle-motion-blur arg0 arg1 arg2)
@ -822,7 +801,7 @@
(gp-0 (new 'stack-no-clear 'vector))
)
(set! (-> gp-0 quad) (-> (the-as process-drawable s5-0) water bottom 0 quad))
(seek! (-> self root scale x) 2.0 (* 2.0 (-> self clock seconds-per-frame)))
(seek! (-> self root scale x) 2.0 (* 2.0 (seconds-per-frame)))
(set! (-> self root scale z) (-> self root scale x))
(set! (-> gp-0 y) (-> (the-as process-drawable s5-0) water surface-height))
(let ((v0-1 (-> self root trans)))
@ -851,34 +830,13 @@
(set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111)
(set! (-> *part-id-table* 506 init-specs 3 initial-valuef) (-> obj wake-size))
(set! (-> *part-id-table* 506 init-specs 5 initial-valuef) (-> obj wake-size))
(let ((t9-13 sp-launch-particles-var)
(a0-62 *sp-particle-system-3d*)
(a1-16 (-> *part-id-table* 506))
(a2-8 *launch-matrix*)
)
(set! (-> a2-8 trans quad) (-> s3-0 quad))
(t9-13 a0-62 a1-16 a2-8 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 506) s3-0)
(set! (-> *part-id-table* 509 init-specs 1 initial-valuef) (* 0.000004150391 f28-0))
(set! (-> *part-id-table* 509 init-specs 18 initial-valuef) f30-0)
(let ((t9-14 sp-launch-particles-var)
(a0-63 *sp-particle-system-3d*)
(a1-17 (-> *part-id-table* 509))
(a2-9 *launch-matrix*)
)
(set! (-> a2-9 trans quad) (-> s3-0 quad))
(t9-14 a0-63 a1-17 a2-9 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 509) s3-0)
(when (< f28-0 4096.0)
(set! (-> *part-id-table* 504 init-specs 2 random-rangef) (-> obj ripple-size))
(let ((t9-15 sp-launch-particles-var)
(a0-64 *sp-particle-system-3d*)
(a1-18 (-> *part-id-table* 504))
(a2-10 *launch-matrix*)
)
(set! (-> a2-10 trans quad) (-> s3-0 quad))
(t9-15 a0-64 a1-18 a2-10 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 504) s3-0)
)
)
)
@ -913,23 +871,9 @@
(+ f0-72 (* f1-26 (sqrtf (+ (* (-> v1-222 x) (-> v1-222 x)) (* (-> v1-222 z) (-> v1-222 z))))))
)
)
(let ((t9-20 sp-launch-particles-var)
(a0-75 *sp-particle-system-2d*)
(a1-26 (-> *part-id-table* 502))
(a2-14 *launch-matrix*)
)
(set! (-> a2-14 trans quad) (-> s3-1 quad))
(t9-20 a0-75 a1-26 a2-14 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 502) s3-1)
(set! (-> *part-id-table* 503 init-specs 16 initial-valuef) (-> obj surface-height))
(let ((t9-21 sp-launch-particles-var)
(a0-76 *sp-particle-system-2d*)
(a1-27 (-> *part-id-table* 503))
(a2-15 *launch-matrix*)
)
(set! (-> a2-15 trans quad) (-> s3-1 quad))
(t9-21 a0-76 a1-27 a2-15 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 503) s3-1)
)
)
)
@ -1147,14 +1091,7 @@
(set! (-> *part-id-table* 537 init-specs 10 initial-valuef) (* 0.05 (- (-> v0-34 x) (-> obj drip-old-pos x))))
(set! (-> *part-id-table* 537 init-specs 11 initial-valuef) (* 0.05 (- (-> v0-34 y) (-> obj drip-old-pos y))))
(set! (-> *part-id-table* 537 init-specs 12 initial-valuef) (* 0.05 (- (-> v0-34 z) (-> obj drip-old-pos z))))
(let ((t9-35 sp-launch-particles-var)
(a0-208 *sp-particle-system-2d*)
(a1-61 (-> *part-id-table* 537))
(a2-22 *launch-matrix*)
)
(set! (-> a2-22 trans quad) (-> v0-34 quad))
(t9-35 a0-208 a1-61 a2-22 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 537) v0-34)
)
(set! (-> obj drip-time) (current-time))
(logclear! (-> obj flags) (water-flags spawn-drip))
@ -1374,34 +1311,13 @@
(set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111)
(set! (-> *part-id-table* 506 init-specs 3 initial-valuef) arg3)
(set! (-> *part-id-table* 506 init-specs 5 initial-valuef) arg3)
(let ((t9-0 sp-launch-particles-var)
(a0-1 *sp-particle-system-3d*)
(a1-1 (-> *part-id-table* 506))
(a2-1 *launch-matrix*)
)
(set! (-> a2-1 trans quad) (-> arg1 quad))
(t9-0 a0-1 a1-1 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 506) arg1)
(set! (-> *part-id-table* 509 init-specs 1 initial-valuef) (* 0.000004150391 f30-0))
(set! (-> *part-id-table* 509 init-specs 18 initial-valuef) arg0)
(let ((t9-1 sp-launch-particles-var)
(a0-2 *sp-particle-system-3d*)
(a1-2 (-> *part-id-table* 509))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> arg1 quad))
(t9-1 a0-2 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 509) arg1)
(when (< f30-0 4096.0)
(set! (-> *part-id-table* 504 init-specs 2 random-rangef) arg4)
(let ((t9-2 sp-launch-particles-var)
(a0-3 *sp-particle-system-3d*)
(a1-3 (-> *part-id-table* 504))
(a2-3 *launch-matrix*)
)
(set! (-> a2-3 trans quad) (-> arg1 quad))
(t9-2 a0-3 a1-3 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 504) arg1)
)
)
0
@ -1556,6 +1472,7 @@
(logtest? (-> s2-2 prim-core action) arg3)
(nonzero? (-> s2-2 prim-core collide-with))
)
;; og:preserve-this scratchpad
(set! (-> (scratchpad-object region-prim-area) pos quad) (-> s2-2 prim-core world-sphere quad))
(if (and (within-area? arg1 (scratchpad-object region-prim-area))
(begin
@ -1588,6 +1505,7 @@
(set! (-> arg0 flags) (water-flags))
(set! (-> arg0 handle) (the-as handle #f))
(set! (-> s3-0 extra-flags) (the-as uint 0))
;; og:preserve-this scratchpad
(set! (-> (scratchpad-object region-prim-area) region-prim-list num-items) 0)
(set! (-> (scratchpad-object region-prim-area) region-inside-count) 0)
(set! (-> (scratchpad-object region-prim-area) pos quad) (-> obj root-prim prim-core world-sphere quad))
@ -1601,6 +1519,7 @@
(let ((a0-10 (-> s1-0 sv-80)))
(while (< sv-80 s0-0)
(if (= (-> a0-10 name) 'water)
;; og:preserve-this scratchpad
(collect-regions
a0-10
(the-as sphere (-> (scratchpad-object region-prim-area) pos))
@ -1618,6 +1537,7 @@
)
)
)
;; og:preserve-this scratchpad
(countdown (s2-1 (-> (scratchpad-object region-prim-area) region-prim-list num-items))
(water-info<-region s3-0 (-> (scratchpad-object region-prim-area) region-prim-list items s2-1) obj arg1)
(when (and (logtest? (-> s3-0 flags) (water-flags active))

View File

@ -32,7 +32,7 @@
(vf19 :class vf)
(vf9 :class vf)
)
;; modified for PC: these register would be loaded by the draw method of bsp.
;; og:preserve-this modified for PC: these register would be loaded by the draw method of bsp.
(let ((at-0 *math-camera*))
(.lvf vf16 (&-> at-0 plane 0 quad))
(.lvf vf17 (&-> at-0 plane 1 quad))
@ -45,7 +45,7 @@
(.add.mul.y.vf acc vf17 vf10 acc)
(.add.mul.z.vf acc vf18 vf10 acc)
(.sub.mul.w.vf vf9 vf19 vf0 acc)
;; og:preserve-this
;; checking to see if we are inside all 4 planes.
;; using the inside part of the sphere
@ -57,7 +57,7 @@
)
)
;; og:preserve-this
(defun sphere-cull-for-ocean ((arg0 vector))
"Is the given sphere in the view frustum?
PC-port ocean version"
@ -71,7 +71,7 @@
(vf19 :class vf)
(vf9 :class vf)
)
;; modified for PC: these register would be loaded by the draw method of bsp.
;; og:preserve-this modified for PC: these register would be loaded by the draw method of bsp.
(cond
((-> *time-of-day-context* use-camera-other)
(let ((at-0 *math-camera*))
@ -123,7 +123,7 @@
(vf9 :class vf)
)
(init-vf0-vector)
;; modified for PC: these registers would be loaded in dma-add-process-drawable
;; og:preserve-this modified for PC: these registers would be loaded in dma-add-process-drawable
(let ((at-0 *math-camera*))
(.lvf vf20 (&-> at-0 guard-plane 0 quad))
(.lvf vf21 (&-> at-0 guard-plane 1 quad))
@ -308,7 +308,11 @@
)
(defmethod collect-regions drawable ((obj drawable) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
"Collect a list of regions that we're in, recursively."
"Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count
@param area-of-interest The area defined by a sphere that we care about overlaps
@param _count The amount of [[drawable]]s in the object to enumerate through
@param! region-list Stores the overlapping regions and a count for how many were found
@returns none"
0
(none)
)
@ -596,6 +600,7 @@
"Print info about a prototype."
(local-vars
(sv-16 uint)
;; og:preserve-this uint -> uint32
(sv-32 uint32)
(sv-48 uint32)
(sv-64 int)
@ -940,7 +945,7 @@
)
(init-vf0-vector)
(set! sv-16 pd)
;; og:preserve-this
(reset! (-> *perf-stats* data (perf-stat-bucket foreground)))
;; skip drawing when in menu mode.
@ -955,6 +960,7 @@
;; only if we should draw...
(when (not (logtest? (-> dc status) (draw-control-status no-draw no-draw-temp uninited)))
;; og:preserve-this scratchpad
(let ((fg-bounds (-> (scratchpad-object foreground-work) bounds))
(fg-lights (-> (scratchpad-object foreground-work) lights))
)
@ -1107,13 +1113,13 @@
)
)
(when (not (paused?))
(vector-seek! current-shadow-dir target-shadow-dir (* 0.2 (-> pp clock seconds-per-frame)))
(vector-seek! current-shadow-dir target-shadow-dir (* 0.2 (seconds-per-frame)))
(vector-normalize! current-shadow-dir 1.0)
)
(set! (-> dc shadow-ctrl settings shadow-dir w) shadow-dir-w)
)
)
;; og:preserve-this
(#when PC_PORT (add-debug-lights *display-lights* (bucket-id debug2) (-> lg lights) (-> dc origin)))
)
)
@ -1153,6 +1159,7 @@
(.lvf vf27 (&-> at-0 camera-rot trans quad))
)
;; og:preserve-this scratchpad
;; do distance math
(let ((fg-dist (-> (scratchpad-object foreground-work) distance)))
(.lvf vf15 (&-> fg-bounds quad))
@ -1179,6 +1186,7 @@
(cond
((>= (-> dc force-lod) 0)
(set! lod-idx (-> dc force-lod))
;; og:preserve-this force high lods
(if (#if (not PC_PORT)
(< (-> dc lod-set lod (-> dc lod-set max-lod) dist) dist-w)
(and (-> *pc-settings* ps2-lod-dist?) (< (-> dc lod-set lod (-> dc lod-set max-lod) dist) dist-w)))
@ -1192,7 +1200,7 @@
)
)
)
;; lod hacks!
;; og:preserve-this lod hacks!
(with-pc
(when (not (-> *pc-settings* ps2-lod-dist?))
(set! lod-idx (minmax (-> *pc-settings* lod-force-actor) 0 (-> dc lod-set max-lod)))
@ -1257,7 +1265,7 @@
(set! (-> pp clock) (-> sv-16 clock))
;; draw!
;; PC port note : we ALWAYS disable the envmap hack when a process-drawable has warp effect enabled
;; og:preserve-this PC port note: we ALWAYS disable the envmap hack when a process-drawable has warp effect enabled
(when (or (= lod-idx (-> dc cur-lod)) (logtest? (-> dc status) (draw-control-status lod-set)))
(protect ((-> *pc-settings* force-envmap?))
(when (not (movie?))
@ -1270,9 +1278,9 @@
)
)
;; trick to do joint math twice if we're changing lods.
;; og:preserve-this trick to do joint math twice if we're changing lods.
(when (and (< lod-idx (-> dc cur-lod)) (logtest? (-> dc status) (draw-control-status math-skel)))
;; NOTE : added this check for PC port to prevent memory corruption
;; og:preserve-this added this check for PC port to prevent memory corruption
(if (< (-> *matrix-engine* length) (-> *matrix-engine* allocated-length))
(let ((v1-159 *matrix-engine*))
(set! (-> v1-159 (-> v1-159 length)) (process->handle sv-16))
@ -1288,6 +1296,7 @@
)
)
)
;; og:preserve-this
(read! (-> *perf-stats* data (perf-stat-bucket foreground)))
(none)
)
@ -1312,7 +1321,7 @@
;; only draw if we're enabled
(when (not (logtest? (-> arg1 status) (draw-control-status no-draw no-draw-temp uninited)))
;; og:preserve-this scratchpad
;; copy *hud-lights* to the scratchpad lights.
(let ((v1-6 (-> (scratchpad-object foreground-work) lights))
(a0-3 *hud-lights*)
@ -1365,6 +1374,7 @@
(let ((gp-0 (-> *display* frames (-> *display* on-screen) global-buf base)))
(with-profiler 'foreground *profile-foreground-color*
(let ((s4-1 (-> arg1 global-buf)))
;; og:preserve-this
; (let ((v1-29 (-> s4-1 base)))
; (.sync.l)
; (.cache dxwbin v1-29 0)
@ -1463,6 +1473,7 @@
(local-vars (a0-96 int) (a0-98 int))
(with-pp
(when *slow-frame-rate*
;; og:preserve-this
(dotimes (v1-2 128000000) ;; was 12800000
(nop!)
(nop!)
@ -1512,6 +1523,7 @@
(set! (-> pp clock) (-> *display* bg-clock))
(set! (-> pp clock) (-> *display* real-clock))
)
;; og:preserve-this
; (if (not (paused?))
; (update-wind *wind-work* *wind-scales*)
; )
@ -1554,7 +1566,7 @@
(foreground-execute-cpu-vu0-engines)
(set! (-> pp clock) gp-6)
)
;; og:preserve-this
;; ??
; (when *add-sphere*
; )
@ -1729,7 +1741,7 @@
(defun display-frame-start ((arg0 display) (arg1 int) (arg2 float))
"Advance clocks, poll pads/mouse, set up buckets."
;; workaround for PS2 HW bug
;; og:preserve-this workaround for PS2 HW bug
; (set! (-> (the-as vif-bank #x10003c00) err me0) 1)
;; tick frame clocks
(set-time-ratios *display* 1.0)
@ -1750,7 +1762,7 @@
(tick! (-> arg0 bg-clock))
(set! (-> arg0 bg-clock frame-counter) (the-as time-frame (mod (-> arg0 bg-clock frame-counter) #x69780)))
(tick! (-> arg0 part-clock))
;; og:preserve-this screenshot stuff
; (when (and (nonzero? *screen-shot-work*) (!= (-> *screen-shot-work* count) -1))
; (let ((v1-43 (-> *screen-shot-work* size)))
; (if (!= (-> *screen-shot-work* count) (* v1-43 v1-43))
@ -1791,6 +1803,7 @@
(debug-reset-buffers)
(clear! *simple-sprite-system*)
)
;; og:preserve-this
(set! (-> s5-1 bucket-group) (dma-buffer-add-buckets (-> s5-1 calc-buf) (enum-length bucket-id)))
)
@ -1800,6 +1813,7 @@
(none)
)
;; og:preserve-this pc port function
(defun pc-maybe-vsync ()
"PC Port implementation of the block of code in display-sync that computes frame-time-ratio and maybe vsyncs."
;; for now, it's very simple.
@ -2044,6 +2058,7 @@
(tfrag-vu1-init-buffers)
(tie-vu1-init-buffers)
(merc-vu1-init-buffers)
;; og:preserve-this
; (emerc-vu1-init-buffers)
(generic-vu1-init-buffers)

View File

@ -1543,7 +1543,7 @@
(s1-3 (-> s4-8 bsp region-trees s2-4))
)
(while (< s2-4 s3-5)
;; pc port note : added this name check
;; og:preserve-this pc port note: added this name check
(let ((tree-name (-> s1-3 name)))
(set! *debug-region-color-alt* (= tree-name 'camera))
@ -1608,7 +1608,10 @@
)
((begin
(set! (-> s4-0 type) s5-0)
(and s5-0 (valid? s5-0 type (the-as string #f) #f 0) (valid? (method-of-object s4-0 init-from-entity!) function (the-as string #f) #f 0))
(and s5-0
(valid? s5-0 type (the-as string #f) #f 0)
(valid? (method-of-object s4-0 init-from-entity!) function (the-as string #f) #f 0)
)
)
(init-entity s4-0 obj s5-0)
)
@ -2093,147 +2096,147 @@
(sv-80 string)
(sv-96 float)
)
(with-pp
(when *compact-actors*
(if (and (= *compact-actors* 'debug) (= (-> *nk-dead-pool* alive-list prev) (-> *nk-dead-pool* first-gap)))
(churn *nk-dead-pool* 1)
)
(let ((s5-0
(the int
(lerp-scale 8.0 1.0 (the float (-> *display* frames (-> *display* last-screen) run-time)) 2000.0 8000.0)
)
)
)
(if (nonzero? *debug-dead-pool*)
(compact *debug-dead-pool* 10)
)
(compact *nk-dead-pool* s5-0)
(compact *city-dead-pool* s5-0)
(when *compact-actors*
(if (and (= *compact-actors* 'debug) (= (-> *nk-dead-pool* alive-list prev) (-> *nk-dead-pool* first-gap)))
(churn *nk-dead-pool* 1)
)
)
(update-actor-hash)
(when (not (paused?))
(let ((s5-1 (-> *display* frames (-> *display* last-screen) run-time)))
(let ((f0-5 (fmax 327680.0 (fmin (+ 327680.0 (* 204.8 (the float (- 7000 s5-1)))) (-> *ACTOR-bank* birth-dist)))))
(seek! (-> *ACTOR-bank* pause-dist) f0-5 (* 81920.0 (-> pp clock seconds-per-frame)))
)
(seekl! (-> *ACTOR-bank* birth-max) (the int (lerp-scale 25.0 2.0 (the float s5-1) 2000.0 7000.0)) 10)
)
(if (movie?)
(set! (-> *ACTOR-bank* birth-max) 1000)
)
)
(when *spawn-actors*
(set! sv-16 (if (movie?)
(math-camera-pos)
(camera-pos)
)
(let ((s5-0
(the int
(lerp-scale 8.0 1.0 (the float (-> *display* frames (-> *display* last-screen) run-time)) 2000.0 8000.0)
)
)
(set! sv-24 0)
(dotimes (s5-2 (-> obj length))
(let ((s4-1 (-> obj level s5-2)))
(when (= (-> s4-1 status) 'active)
(set! sv-32 (-> s4-1 task-mask))
(cond
((= (-> s4-1 display?) 'special)
(let* ((s4-2 (-> s4-1 entity))
(s3-1 (-> s4-2 length))
)
(dotimes (s2-0 s3-1)
(let ((v1-54 (-> s4-2 data s2-0)))
(cond
((and (logtest? (-> v1-54 kill-mask) (task-mask special)) (not (logtest? (-> v1-54 kill-mask) sv-32)))
(when (not (or (-> v1-54 process) (logtest? (-> v1-54 perm status) (entity-perm-status bit-0 dead))))
(birth! (-> v1-54 entity))
(set! sv-24 (+ sv-24 1))
(if (>= sv-24 (-> *ACTOR-bank* birth-max))
(return #f)
)
)
)
(if (nonzero? *debug-dead-pool*)
(compact *debug-dead-pool* 10)
)
(compact *nk-dead-pool* s5-0)
(compact *city-dead-pool* s5-0)
)
)
(update-actor-hash)
(when (not (paused?))
(let ((s5-1 (-> *display* frames (-> *display* last-screen) run-time)))
(let ((f0-5 (fmax 327680.0 (fmin (+ 327680.0 (* 204.8 (the float (- 7000 s5-1)))) (-> *ACTOR-bank* birth-dist)))))
(seek! (-> *ACTOR-bank* pause-dist) f0-5 (* 81920.0 (seconds-per-frame)))
)
(seekl! (-> *ACTOR-bank* birth-max) (the int (lerp-scale 25.0 2.0 (the float s5-1) 2000.0 7000.0)) 10)
)
(if (movie?)
(set! (-> *ACTOR-bank* birth-max) 1000)
)
)
(when *spawn-actors*
(set! sv-16 (if (movie?)
(math-camera-pos)
(camera-pos)
)
)
(set! sv-24 0)
(dotimes (s5-2 (-> obj length))
(let ((s4-1 (-> obj level s5-2)))
(when (= (-> s4-1 status) 'active)
(set! sv-32 (-> s4-1 task-mask))
(cond
((= (-> s4-1 display?) 'special)
(let* ((s4-2 (-> s4-1 entity))
(s3-1 (-> s4-2 length))
)
(dotimes (s2-0 s3-1)
(let ((v1-54 (-> s4-2 data s2-0)))
(cond
((and (logtest? (-> v1-54 kill-mask) (task-mask special)) (not (logtest? (-> v1-54 kill-mask) sv-32)))
(when (not (or (-> v1-54 process) (logtest? (-> v1-54 perm status) (entity-perm-status bit-0 dead))))
(birth! (-> v1-54 entity))
(set! sv-24 (+ sv-24 1))
(if (>= sv-24 (-> *ACTOR-bank* birth-max))
(return #f)
)
)
(else
(if (and (-> v1-54 process)
(not (logtest? (-> v1-54 perm status) (entity-perm-status no-kill)))
(not (logtest? (-> v1-54 process mask) (process-mask no-kill)))
)
(kill! (-> v1-54 entity))
)
)
)
(else
(if (and (-> v1-54 process)
(not (logtest? (-> v1-54 perm status) (entity-perm-status no-kill)))
(not (logtest? (-> v1-54 process mask) (process-mask no-kill)))
)
(kill! (-> v1-54 entity))
)
)
)
)
)
)
((= (-> s4-1 display?) 'actor)
(let* ((s4-3 (-> s4-1 entity))
(s3-2 (-> s4-3 length))
)
(dotimes (s2-1 s3-2)
(let ((v1-67 (-> s4-3 data s2-1)))
(cond
((not (logtest? (-> v1-67 kill-mask) sv-32))
(when (not (or (-> v1-67 process) (logtest? (-> v1-67 perm status) (entity-perm-status bit-0 dead))))
(birth! (-> v1-67 entity))
(set! sv-24 (+ sv-24 1))
(if (>= sv-24 (-> *ACTOR-bank* birth-max))
(return #f)
)
)
)
((= (-> s4-1 display?) 'actor)
(let* ((s4-3 (-> s4-1 entity))
(s3-2 (-> s4-3 length))
)
(dotimes (s2-1 s3-2)
(let ((v1-67 (-> s4-3 data s2-1)))
(cond
((not (logtest? (-> v1-67 kill-mask) sv-32))
(when (not (or (-> v1-67 process) (logtest? (-> v1-67 perm status) (entity-perm-status bit-0 dead))))
(birth! (-> v1-67 entity))
(set! sv-24 (+ sv-24 1))
(if (>= sv-24 (-> *ACTOR-bank* birth-max))
(return #f)
)
)
(else
(if (and (-> v1-67 process)
(not (logtest? (-> v1-67 perm status) (entity-perm-status no-kill)))
(not (logtest? (-> v1-67 process mask) (process-mask no-kill)))
)
(kill! (-> v1-67 entity))
)
)
)
(else
(if (and (-> v1-67 process)
(not (logtest? (-> v1-67 perm status) (entity-perm-status no-kill)))
(not (logtest? (-> v1-67 process mask) (process-mask no-kill)))
)
(kill! (-> v1-67 entity))
)
)
)
)
)
)
((not *vis-actors*)
(let* ((s4-4 (-> s4-1 entity))
(s3-3 (-> s4-4 length))
)
(dotimes (s2-2 s3-3)
(let ((s1-0 (-> s4-4 data s2-2)))
(cond
((and (< (vector-vector-distance (-> s1-0 trans) sv-16) (-> *ACTOR-bank* birth-dist))
(not (logtest? (-> s1-0 perm status) (entity-perm-status bit-9 bit-10)))
(not (logtest? (-> s1-0 kill-mask) sv-32))
)
(when (not (or (-> s1-0 process) (logtest? (-> s1-0 perm status) (entity-perm-status bit-0 dead))))
(birth! (-> s1-0 entity))
(set! sv-24 (+ sv-24 1))
(if (>= sv-24 (-> *ACTOR-bank* birth-max))
(return #f)
)
)
)
((not *vis-actors*)
(let* ((s4-4 (-> s4-1 entity))
(s3-3 (-> s4-4 length))
)
(dotimes (s2-2 s3-3)
(let ((s1-0 (-> s4-4 data s2-2)))
(cond
((and (< (vector-vector-distance (-> s1-0 trans) sv-16) (-> *ACTOR-bank* birth-dist))
(not (logtest? (-> s1-0 perm status) (entity-perm-status bit-9 bit-10)))
(not (logtest? (-> s1-0 kill-mask) sv-32))
)
(when (not (or (-> s1-0 process) (logtest? (-> s1-0 perm status) (entity-perm-status bit-0 dead))))
(birth! (-> s1-0 entity))
(set! sv-24 (+ sv-24 1))
(if (>= sv-24 (-> *ACTOR-bank* birth-max))
(return #f)
)
)
(else
(if (and (-> s1-0 process)
(not (logtest? (-> s1-0 perm status) (entity-perm-status no-kill)))
(not (logtest? (-> s1-0 process mask) (process-mask no-kill)))
)
(kill! (-> s1-0 entity))
)
)
)
(else
(if (and (-> s1-0 process)
(not (logtest? (-> s1-0 perm status) (entity-perm-status no-kill)))
(not (logtest? (-> s1-0 process mask) (process-mask no-kill)))
)
(kill! (-> s1-0 entity))
)
)
)
)
)
)
(*vis-actors*
(when (not (and (-> s4-1 vis-info 0) (-> s4-1 all-visible?)))
(let* ((s3-4 (-> s4-1 entity))
(s2-3 (-> s3-4 length))
(s0-0 #f)
)
(dotimes (s1-1 s2-3)
(set! sv-48 (-> s3-4 data s1-1))
(cond
)
(*vis-actors*
(when (not (and (-> s4-1 vis-info 0) (-> s4-1 all-visible?)))
(let* ((s3-4 (-> s4-1 entity))
(s2-3 (-> s3-4 length))
(s0-0 #f)
)
(dotimes (s1-1 s2-3)
(set! sv-48 (-> s3-4 data s1-1))
(cond
;; og:preserve-this entity blacklist
((and (#if PC_PORT (or (with-pc (and (not (-> *pc-settings* ps2-actor-vis?))
;; ban specific entities
(not (let ((name (res-lump-struct (-> sv-48 entity) 'name string)))
@ -2247,10 +2250,10 @@
(string= name "under-locking-2"))))))
(is-object-visible? s4-1 (-> sv-48 vis-id)))
(is-object-visible? s4-1 (-> sv-48 vis-id)))
(not (logtest? (-> sv-48 perm status) (entity-perm-status bit-9 bit-10)))
(not (logtest? (-> sv-48 kill-mask) sv-32))
(or (-> s4-1 vis-info 0) (< (vector-vector-distance (-> sv-48 trans) sv-16) (-> sv-48 vis-dist)))
;; PC port note : added this extra check to fix level types being used after deloaded because of bad entity placement
(not (logtest? (-> sv-48 perm status) (entity-perm-status bit-9 bit-10)))
(not (logtest? (-> sv-48 kill-mask) sv-32))
(or (-> s4-1 vis-info 0) (< (vector-vector-distance (-> sv-48 trans) sv-16) (-> sv-48 vis-dist)))
;; og:preserve-this PC port note: added this extra check to fix level types being used after deloaded because of bad entity placement
(#if PC_PORT
(or (not (type-type? (-> sv-48 entity type) entity-actor)) (and (valid? (-> (the-as entity-actor (-> sv-48 entity)) etype) type "entity-type-check etype" #f *stdcon*)
(valid? (-> (the-as entity-actor (-> sv-48 entity)) etype symbol) symbol "entity-type-check symbol" #f *stdcon*)
@ -2258,39 +2261,38 @@
(= (-> (the-as entity-actor (-> sv-48 entity)) etype) (-> (the-as entity-actor (-> sv-48 entity)) etype symbol value))
))
#f)
)
(when (not (or (-> sv-48 process) (logtest? (-> sv-48 perm status) (entity-perm-status bit-0 dead)) s0-0))
(birth! (-> sv-48 entity))
(set! sv-24 (+ sv-24 1))
(when (< (/ (the float (memory-free *nk-dead-pool*)) (the float (memory-total *nk-dead-pool*))) 0.1)
(when *debug-segment*
(let ((s0-1 format))
(set! sv-64 *stdcon*)
(set! sv-80 "low actor memory, no birth triggered!!! ~,,0fK/~,,0fK~%")
(set! sv-96 (* 0.0009765625 (the float (memory-free *nk-dead-pool*))))
(let ((a3-2 (* 0.0009765625 (the float (memory-total *nk-dead-pool*)))))
(s0-1 sv-64 sv-80 sv-96 a3-2)
)
)
(when (not (or (-> sv-48 process) (logtest? (-> sv-48 perm status) (entity-perm-status bit-0 dead)) s0-0))
(birth! (-> sv-48 entity))
(set! sv-24 (+ sv-24 1))
(when (< (/ (the float (memory-free *nk-dead-pool*)) (the float (memory-total *nk-dead-pool*))) 0.1)
(when *debug-segment*
(let ((s0-1 format))
(set! sv-64 *stdcon*)
(set! sv-80 "low actor memory, no birth triggered!!! ~,,0fK/~,,0fK~%")
(set! sv-96 (* 0.0009765625 (the float (memory-free *nk-dead-pool*))))
(let ((a3-2 (* 0.0009765625 (the float (memory-total *nk-dead-pool*)))))
(s0-1 sv-64 sv-80 sv-96 a3-2)
)
)
(set! s0-0 #t)
)
(set! s0-0 #t)
)
)
(else
(when (and (-> sv-48 process)
(not (logtest? (-> sv-48 perm status) (entity-perm-status no-kill)))
(not (logtest? (-> sv-48 process mask) (process-mask no-kill)))
)
(kill! (-> sv-48 entity))
(set! sv-24 (+ sv-24 1))
)
)
(else
(when (and (-> sv-48 process)
(not (logtest? (-> sv-48 perm status) (entity-perm-status no-kill)))
(not (logtest? (-> sv-48 process mask) (process-mask no-kill)))
)
(kill! (-> sv-48 entity))
(set! sv-24 (+ sv-24 1))
)
)
(if (>= sv-24 (-> *ACTOR-bank* birth-max))
(return #f)
)
)
(if (>= sv-24 (-> *ACTOR-bank* birth-max))
(return #f)
)
)
)
)
@ -2299,9 +2301,9 @@
)
)
)
0
(none)
)
0
(none)
)
(defun entity-birth-no-kill ((arg0 entity))

View File

@ -904,7 +904,7 @@
(set! (-> s5-0 flags) (font-flags shadow kerning large))
(let ((s3-1 (current-time)))
(until (>= (- (current-time) s3-1) (+ arg2 -75))
(+! (-> s5-0 origin y) (* -120.0 (-> self clock seconds-per-frame)))
(+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame)))
(let ((s2-0 print-game-text))
(format (clear *temp-string*) "~4,,0f" arg1)
(s2-0 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1))
@ -915,7 +915,7 @@
(let ((s4-1 (current-time)))
(until (>= (- (current-time) s4-1) (seconds 0.25))
(set! (-> s5-0 alpha) (lerp-scale 1.0 0.0 (the float (- (current-time) s4-1)) 0.0 150.0))
(+! (-> s5-0 origin y) (* -120.0 (-> self clock seconds-per-frame)))
(+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame)))
(let ((s3-2 print-game-text))
(format (clear *temp-string*) "~4,,0f" arg1)
(s3-2 *temp-string* s5-0 #f 44 (bucket-id debug-no-zbuf1))
@ -1285,6 +1285,7 @@
(if arg2
(format arg0 "~%")
)
;; og:preserve-this level constant
(dotimes (s4-2 LEVEL_MAX)
(if (or (= (-> *level* level s4-2 status) 'active)
(= (-> *level* level s4-2 status) 'alive)

View File

@ -901,7 +901,7 @@
(mem-copy! (the-as pointer s4-0) (the-as pointer (-> obj user-default)) 528)
(set! (-> s4-0 ambient-volume) (* (-> obj user-default sfx-volume) (-> obj user-default ambient-volume)))
(user-setting-data-method-9 s4-0 (-> obj engine) (-> obj engine-pers) (-> obj engine-hi))
;; pc port note : check for target sound mode and music instead of current sound mode
;; og:preserve-this check for target sound mode and music instead of current sound mode
(when (= (-> s4-0 sound-mode) 1)
(case (-> s4-0 music)
(('sewer)
@ -1055,85 +1055,85 @@
(defmethod update setting-control ((obj setting-control))
(local-vars (v1-41 symbol))
(with-pp
(run-pending-updates! (-> obj engine-pers) (-> *display* base-clock frame-counter))
(apply-settings obj)
(let ((s5-0 (-> obj user-current)))
(let ((s4-0 (-> obj user-target)))
(when *sound-player-enable*
(when (!= (-> s5-0 sfx-volume) (-> s4-0 sfx-volume))
(seek! (-> s5-0 sfx-volume) (-> s4-0 sfx-volume) (-> pp clock seconds-per-frame))
(sound-set-volume (sound-group sfx) (-> s5-0 sfx-volume))
)
(when (!= (-> s5-0 music-volume) (-> s4-0 music-volume))
(seek! (-> s5-0 music-volume) (-> s4-0 music-volume) (-> pp clock seconds-per-frame))
(sound-set-volume (sound-group music) (* 0.75 (-> s5-0 music-volume)))
)
(when (!= (-> s5-0 dialog-volume) (-> s4-0 dialog-volume))
(seek! (-> s5-0 dialog-volume) (-> s4-0 dialog-volume) (-> pp clock seconds-per-frame))
(sound-set-volume (sound-group dialog dialog2) (-> s5-0 dialog-volume))
)
(when (!= (-> s5-0 ambient-volume) (-> s4-0 ambient-volume))
(seek! (-> s5-0 ambient-volume) (-> s4-0 ambient-volume) (-> pp clock seconds-per-frame))
(sound-set-volume (sound-group ambient) (-> s5-0 ambient-volume))
(run-pending-updates! (-> obj engine-pers) (-> *display* base-clock frame-counter))
(apply-settings obj)
(let ((s5-0 (-> obj user-current)))
(let ((s4-0 (-> obj user-target)))
(when *sound-player-enable*
(when (!= (-> s5-0 sfx-volume) (-> s4-0 sfx-volume))
(seek! (-> s5-0 sfx-volume) (-> s4-0 sfx-volume) (seconds-per-frame))
(sound-set-volume (sound-group sfx) (-> s5-0 sfx-volume))
)
(when (!= (-> s5-0 music-volume) (-> s4-0 music-volume))
(seek! (-> s5-0 music-volume) (-> s4-0 music-volume) (seconds-per-frame))
(sound-set-volume (sound-group music) (* 0.75 (-> s5-0 music-volume)))
)
(when (!= (-> s5-0 dialog-volume) (-> s4-0 dialog-volume))
(seek! (-> s5-0 dialog-volume) (-> s4-0 dialog-volume) (seconds-per-frame))
(sound-set-volume (sound-group dialog dialog2) (-> s5-0 dialog-volume))
)
(when (!= (-> s5-0 ambient-volume) (-> s4-0 ambient-volume))
(seek! (-> s5-0 ambient-volume) (-> s4-0 ambient-volume) (seconds-per-frame))
(sound-set-volume (sound-group ambient) (-> s5-0 ambient-volume))
)
)
(when (!= (-> s5-0 language) (-> s4-0 language))
(set! (-> s5-0 language) (-> s4-0 language))
(case (-> s5-0 language)
(((language-enum uk-english))
(set-language (language-enum english))
)
(else
(set-language (-> s5-0 language))
)
)
(when (!= (-> s5-0 language) (-> s4-0 language))
(set! (-> s5-0 language) (-> s4-0 language))
(case (-> s5-0 language)
(((language-enum uk-english))
(set-language (language-enum english))
)
(else
(set-language (-> s5-0 language))
)
)
)
(set! (-> s5-0 subtitle-language) (-> s4-0 subtitle-language))
(when (!= (-> s5-0 stereo-mode) (-> s4-0 stereo-mode))
(set! (-> s5-0 stereo-mode) (-> s4-0 stereo-mode))
(sound-set-stereo-mode (the-as stereo-mode (-> s5-0 stereo-mode)))
)
(when (and (!= (-> s4-0 music) (-> s5-0 music))
(and (zero? (rpc-busy? 1))
(or (not (-> s4-0 music))
(and (< 0.0 (-> s5-0 music-volume)) (not (load-in-progress? *level*)) (not (-> s5-0 movie)))
)
(begin
(countdown (v1-40 3)
(when (not (-> *level* sound-bank v1-40))
(set! v1-41 #f)
(goto cfg-37)
)
)
(set! v1-41 #t)
(label cfg-37)
(and v1-41 (not *master-exit*))
)
(set! (-> s5-0 subtitle-language) (-> s4-0 subtitle-language))
(when (!= (-> s5-0 stereo-mode) (-> s4-0 stereo-mode))
(set! (-> s5-0 stereo-mode) (-> s4-0 stereo-mode))
(sound-set-stereo-mode (the-as stereo-mode (-> s5-0 stereo-mode)))
)
(when (and (!= (-> s4-0 music) (-> s5-0 music))
(and (zero? (rpc-busy? 1))
(or (not (-> s4-0 music))
(and (< 0.0 (-> s5-0 music-volume)) (not (load-in-progress? *level*)) (not (-> s5-0 movie)))
)
(begin
(countdown (v1-40 3)
(when (not (-> *level* sound-bank v1-40))
(set! v1-41 #f)
(goto cfg-37)
)
)
(set! v1-41 #t)
(label cfg-37)
(and v1-41 (not *master-exit*))
)
)
(cond
((-> s4-0 music)
(format 0 "Load music ~A~%" (-> s4-0 music))
(set! (-> s5-0 sound-flava) (the-as uint 0))
(sound-music-load (string->sound-name (symbol->string (-> s4-0 music))))
)
(else
(format 0 "Unload music~%")
(sound-music-unload)
)
)
)
(cond
((-> s4-0 music)
(format 0 "Load music ~A~%" (-> s4-0 music))
(set! (-> s5-0 sound-flava) (the-as uint 0))
(sound-music-load (string->sound-name (symbol->string (-> s4-0 music))))
)
(else
(format 0 "Unload music~%")
(sound-music-unload)
)
(set! (-> s5-0 music) (-> s4-0 music))
)
(set! (-> s4-0 sound-excitement) (fmax 0.0 (fmin 0.99 (-> s4-0 sound-excitement))))
(set! (-> s4-0 sound-reverb) (fmax 0.0 (fmin 1.0 (-> s4-0 sound-reverb))))
(when (and (nonzero? (-> obj user-default sound-stinger))
(>= (- (-> *display* base-clock frame-counter) (-> obj sound-stinger-time)) (seconds 0.5))
)
(set! (-> obj user-default sound-stinger) 0)
0
)
(when *sound-player-enable*
(set! (-> s5-0 music) (-> s4-0 music))
)
(set! (-> s4-0 sound-excitement) (fmax 0.0 (fmin 0.99 (-> s4-0 sound-excitement))))
(set! (-> s4-0 sound-reverb) (fmax 0.0 (fmin 1.0 (-> s4-0 sound-reverb))))
(when (and (nonzero? (-> obj user-default sound-stinger))
(>= (- (-> *display* base-clock frame-counter) (-> obj sound-stinger-time)) (seconds 0.5))
)
(set! (-> obj user-default sound-stinger) 0)
0
)
(when *sound-player-enable*
;; og:preserve-this
;; PC port note : this was a huge cond which is not really the greatest idea since only one of the clauses can run
;; it seems that it's completely safe to change multiple midi registers at once.
;; it also only changed the registers when the settings changed, but this is undesirable as the sound driver itself
@ -1160,220 +1160,219 @@
(set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter))
)
(when (!= (the int (* 4.0 (-> s4-0 sound-excitement))) (the int (* 4.0 (-> obj sound-excitement-targ))))
(let ((v1-87 (max 0 (min 3 (the int (* 4.0 (-> s4-0 sound-excitement)))))))
(when (and (< (-> obj sound-excitement-targ) (-> s4-0 sound-excitement))
(let ((v1-87 (max 0 (min 3 (the int (* 4.0 (-> s4-0 sound-excitement)))))))
(when (and (< (-> obj sound-excitement-targ) (-> s4-0 sound-excitement))
(< (the-as int (-> obj sound-excitement-level)) v1-87)
(zero? (-> obj user-default sound-stinger))
)
(set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter))
(set! (-> obj sound-stinger-change-time v1-87) (-> *display* base-clock frame-counter))
(set! (-> obj user-default sound-stinger) (+ v1-87 9))
(set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter))
(set! (-> obj sound-stinger-change-time v1-87) (-> *display* base-clock frame-counter))
(set! (-> obj user-default sound-stinger) (+ v1-87 9))
)
(cond
((< (the-as int (-> obj sound-excitement-level)) v1-87)
(set! (-> obj sound-excitement-level) (the-as uint v1-87))
)
(cond
((< (the-as int (-> obj sound-excitement-level)) v1-87)
(set! (-> obj sound-excitement-level) (the-as uint v1-87))
)
((< v1-87 (the-as int (+ (-> obj sound-excitement-level) -1)))
(set! (-> obj sound-excitement-level) (the-as uint (+ v1-87 1)))
)
((zero? v1-87)
(set! (-> obj sound-excitement-level) (the-as uint v1-87))
)
((< v1-87 (the-as int (+ (-> obj sound-excitement-level) -1)))
(set! (-> obj sound-excitement-level) (the-as uint (+ v1-87 1)))
)
)
(set! (-> obj sound-excitement-change-time) (-> *display* base-clock frame-counter))
(set! (-> obj sound-excitement-targ) (-> s4-0 sound-excitement))
)
((zero? v1-87)
(set! (-> obj sound-excitement-level) (the-as uint v1-87))
)
)
)
(set! (-> obj sound-excitement-change-time) (-> *display* base-clock frame-counter))
(set! (-> obj sound-excitement-targ) (-> s4-0 sound-excitement))
)
(when (and (!= (the int (* 4.0 (-> s5-0 sound-excitement))) (the int (* 4.0 (-> obj sound-excitement-targ))))
(>= (- (-> *display* base-clock frame-counter) (-> obj sound-excitement-change-time)) (seconds 0.8))
)
(max 0 (min 3 (the int (* 4.0 (-> obj sound-excitement-targ)))))
(sound-set-midi-reg 2 (the int (* 100.0 (-> s5-0 sound-excitement))))
(set! (-> s5-0 sound-excitement) (-> obj sound-excitement-targ))
(sound-set-midi-reg 16 (the int (* 100.0 (-> s5-0 sound-excitement))))
(max 0 (min 3 (the int (* 4.0 (-> obj sound-excitement-targ)))))
(sound-set-midi-reg 2 (the int (* 100.0 (-> s5-0 sound-excitement))))
(set! (-> s5-0 sound-excitement) (-> obj sound-excitement-targ))
(sound-set-midi-reg 16 (the int (* 100.0 (-> s5-0 sound-excitement))))
)
)
(set! (-> s5-0 mode-sound-bank) (-> s4-0 mode-sound-bank))
(when (!= (-> s5-0 aspect-ratio) (-> s4-0 aspect-ratio))
(set! (-> s5-0 aspect-ratio) (-> s4-0 aspect-ratio))
(set-aspect-ratio (-> s5-0 aspect-ratio))
)
(when (!= (-> s5-0 use-progressive-scan) (-> s4-0 use-progressive-scan))
(set! (-> s5-0 use-progressive-scan) (-> s4-0 use-progressive-scan))
(set! (-> *video-params* set-video-mode) #t)
)
(when (!= (-> s5-0 video-mode) (-> s4-0 video-mode))
(set! (-> s5-0 video-mode) (-> s4-0 video-mode))
(set-video-mode (-> s5-0 video-mode))
)
(when (!= (-> s5-0 display-dx) (-> s4-0 display-dx))
(set! (-> s5-0 display-dx) (-> s4-0 display-dx))
(set! (-> *video-params* display-dx) (/ (-> s4-0 display-dx) 2))
)
(when (!= (-> s5-0 display-dy) (-> s4-0 display-dy))
(set! (-> s5-0 display-dy) (-> s4-0 display-dy))
(set! (-> *video-params* display-dy) (* (/ (-> s4-0 display-dy) 2) 2))
)
(set! (-> *blit-displays-work* horizontal-flip-flag)
(logtest? (-> *game-info* secrets) (game-secrets hflip-screen))
)
)
(set! (-> s5-0 mode-sound-bank) (-> s4-0 mode-sound-bank))
(when (!= (-> s5-0 aspect-ratio) (-> s4-0 aspect-ratio))
(set! (-> s5-0 aspect-ratio) (-> s4-0 aspect-ratio))
(set-aspect-ratio (-> s5-0 aspect-ratio))
)
(when (!= (-> s5-0 use-progressive-scan) (-> s4-0 use-progressive-scan))
(set! (-> s5-0 use-progressive-scan) (-> s4-0 use-progressive-scan))
(set! (-> *video-params* set-video-mode) #t)
)
(when (!= (-> s5-0 video-mode) (-> s4-0 video-mode))
(set! (-> s5-0 video-mode) (-> s4-0 video-mode))
(set-video-mode (-> s5-0 video-mode))
)
(when (!= (-> s5-0 display-dx) (-> s4-0 display-dx))
(set! (-> s5-0 display-dx) (-> s4-0 display-dx))
(set! (-> *video-params* display-dx) (/ (-> s4-0 display-dx) 2))
)
(when (!= (-> s5-0 display-dy) (-> s4-0 display-dy))
(set! (-> s5-0 display-dy) (-> s4-0 display-dy))
(set! (-> *video-params* display-dy) (* (/ (-> s4-0 display-dy) 2) 2))
)
(set! (-> *blit-displays-work* horizontal-flip-flag)
(logtest? (-> *game-info* secrets) (game-secrets hflip-screen))
(set! (-> s5-0 allow-blackout) (-> s4-0 allow-blackout))
(set! (-> s5-0 bg-a-speed) (-> s4-0 bg-a-speed))
(set! (-> s5-0 bg-a-force) (-> s4-0 bg-a-force))
(set! (-> s5-0 bg-r) (-> s4-0 bg-r))
(set! (-> s5-0 bg-g) (-> s4-0 bg-g))
(set! (-> s5-0 bg-b) (-> s4-0 bg-b))
(seek! (-> s5-0 bg-a) (-> s4-0 bg-a) (* (-> s4-0 bg-a-speed) (seconds-per-frame)))
(let ((v1-133 *display*))
(let ((f0-71 (-> s5-0 bg-a)))
(if (!= (-> s5-0 bg-a-force) 0.0)
(set! f0-71 (-> s5-0 bg-a-force))
)
(set! (-> s5-0 allow-blackout) (-> s4-0 allow-blackout))
(set! (-> s5-0 bg-a-speed) (-> s4-0 bg-a-speed))
(set! (-> s5-0 bg-a-force) (-> s4-0 bg-a-force))
(set! (-> s5-0 bg-r) (-> s4-0 bg-r))
(set! (-> s5-0 bg-g) (-> s4-0 bg-g))
(set! (-> s5-0 bg-b) (-> s4-0 bg-b))
(seek! (-> s5-0 bg-a) (-> s4-0 bg-a) (* (-> s4-0 bg-a-speed) (-> pp clock seconds-per-frame)))
(let ((v1-133 *display*))
(let ((f0-71 (-> s5-0 bg-a)))
(if (!= (-> s5-0 bg-a-force) 0.0)
(set! f0-71 (-> s5-0 bg-a-force))
)
(if (not (-> s5-0 allow-blackout))
(set! f0-71 0.0)
)
(set! (-> v1-133 bgcolor r) (the int (* 255.0 (-> s5-0 bg-r))))
(set! (-> v1-133 bgcolor g) (the int (* 255.0 (-> s5-0 bg-g))))
(set! (-> v1-133 bgcolor b) (the int (* 255.0 (-> s5-0 bg-b))))
(set! (-> v1-133 pmode alp) (the int (* 255.0 (- 1.0 f0-71))))
)
(set! (-> v1-133 run-half-speed) (the-as basic (-> s5-0 half-speed)))
(if (not (-> s5-0 allow-blackout))
(set! f0-71 0.0)
)
(set! (-> v1-133 bgcolor r) (the int (* 255.0 (-> s5-0 bg-r))))
(set! (-> v1-133 bgcolor g) (the int (* 255.0 (-> s5-0 bg-g))))
(set! (-> v1-133 bgcolor b) (the int (* 255.0 (-> s5-0 bg-b))))
(set! (-> v1-133 pmode alp) (the int (* 255.0 (- 1.0 f0-71))))
)
(set! (-> s5-0 spotlight-color) (-> s4-0 spotlight-color))
(set! (-> v1-133 run-half-speed) (the-as basic (-> s5-0 half-speed)))
)
(set! (-> *texture-pool* common-page-mask) (-> s5-0 unknown-int32-00))
(set! (-> *cpad-list* cpads 0 buzz) (the-as basic (-> s5-0 vibration)))
(let ((v1-137 *ocean*))
(case (-> s5-0 ocean-off)
((#t)
(set! (-> v1-137 off) #t)
)
(('mid)
(set! (-> v1-137 mid-off) #t)
)
(('near)
(set! (-> v1-137 near-off) #t)
)
)
)
(set! (-> *mouse* active) (-> s5-0 mouse))
(set! (-> *mouse* cursor) (the-as basic (and (-> s5-0 mouse) (-> s5-0 cursor))))
(set! (-> s5-0 spotlight-color) (-> s4-0 spotlight-color))
)
(let ((s5-1 (-> obj cam-current)))
(let ((s4-1 (-> obj cam-target)))
(set! (-> s5-1 entity-or-mode-changed) #f)
(if (and (not (name= (-> s5-1 entity-name) (-> s4-1 entity-name)))
(or (not *target*) (not (logtest? (-> *target* focus-status) (-> s4-1 entity-mask))))
)
(set! (-> s4-1 entity-or-mode-changed) #t)
)
(if (!= (-> s5-1 mode-name) (-> s4-1 mode-name))
(set! (-> s4-1 entity-or-mode-changed) #t)
)
(set! (-> s5-1 teleport-on-entity-change) (-> s4-1 teleport-on-entity-change))
(cam-master-set-entity s4-1)
(cond
((not (-> s4-1 entity-or-mode-changed))
)
((or (= (-> s5-1 cam-mode) cam-eye) (= (-> s4-1 cam-mode) cam-eye))
(set! (-> s4-1 no-intro) #t)
(set! (-> s4-1 interp-time) (the-as uint 60))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
)
((= (-> s4-1 cam-mode) cam-endlessfall)
(set! (-> s4-1 no-intro) #t)
(set! (-> s4-1 interp-time) (the-as uint 30))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
)
((or (= (-> s5-1 cam-mode) cam-free-floating) (= (-> s4-1 cam-mode) cam-free-floating))
(set! (-> s4-1 interp-time) (the-as uint 0))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
)
)
(set! (-> s5-1 entity-name) (-> s4-1 entity-name))
(set! (-> s5-1 entity-mask) (-> s4-1 entity-mask))
(set! (-> s5-1 mode-name) (-> s4-1 mode-name))
(let ((v1-173 (-> s4-1 entity-or-mode-changed)))
(set! (-> s5-1 entity-or-mode-changed) v1-173)
(when v1-173
(set! (-> s5-1 real-entity-name) (-> s4-1 real-entity-name))
(set! (-> s5-1 cam-mode) (-> s4-1 cam-mode))
)
)
(+! (-> s5-1 fov) (fmax -182.04445 (fmin 182.04445 (* 0.1 (- (-> s4-1 fov) (-> s5-1 fov))))))
(set! (-> s5-1 pov-handle) (-> s4-1 pov-handle))
(set! (-> s5-1 pov-bone) (-> s4-1 pov-bone))
(set! (-> s5-1 pov-offset quad) (-> s4-1 pov-offset quad))
(set! (-> s5-1 string-default) (-> s4-1 string-default))
(set! (-> s5-1 string-max-length-default) (-> s4-1 string-max-length-default))
(set! (-> s5-1 string-min-length-default) (-> s4-1 string-min-length-default))
(set! (-> s5-1 string-max-height-default) (-> s4-1 string-max-height-default))
(set! (-> s5-1 string-min-height-default) (-> s4-1 string-min-height-default))
(set! (-> s5-1 string-max-length) (-> s4-1 string-max-length))
(set! (-> s5-1 string-min-length) (-> s4-1 string-min-length))
(set! (-> s5-1 string-max-height) (-> s4-1 string-max-height))
(set! (-> s5-1 string-min-height) (-> s4-1 string-min-height))
(set! (-> s5-1 string-cliff-height) (-> s4-1 string-cliff-height))
(set! (-> s5-1 string-camera-ceiling) (-> s4-1 string-camera-ceiling))
(cond
((-> s5-1 string-default)
(set! (-> s5-1 gun-min-height) (-> s4-1 gun-min-height))
(set! (-> s5-1 gun-max-height) (-> s4-1 gun-max-height))
)
(else
(set! (-> s5-1 gun-min-height) (-> s4-1 string-min-height))
(set! (-> s5-1 gun-max-height) (-> s4-1 string-max-height))
)
)
(set! (-> s5-1 string-local-down quad) (-> s4-1 string-local-down quad))
(set! (-> s5-1 slave-options) (-> s4-1 slave-options))
(seek! (-> s5-1 matrix-blend-max-angle) (-> s4-1 matrix-blend-max-angle) 182.04445)
(seek! (-> s5-1 matrix-blend-max-partial) (-> s4-1 matrix-blend-max-partial) 0.05)
(set! (-> s5-1 string-spline-max-move) (-> s4-1 string-spline-max-move))
(set! (-> s5-1 string-spline-accel) (-> s4-1 string-spline-accel))
(set! (-> s5-1 string-spline-max-move-player) (-> s4-1 string-spline-max-move-player))
(set! (-> s5-1 string-spline-accel-player) (-> s4-1 string-spline-accel-player))
(set! (-> s5-1 target-height) (-> s4-1 target-height))
(set! (-> s5-1 head-offset) (-> s4-1 head-offset))
(set! (-> s5-1 foot-offset) (-> s4-1 foot-offset))
(set! (-> s5-1 master-options) (-> s4-1 master-options))
(set! (-> s5-1 no-intro) (-> s4-1 no-intro))
(set! (-> s5-1 mouse-input) (-> s4-1 mouse-input))
(set! (-> s5-1 cpad1-skip-buttons) (-> s4-1 cpad1-skip-buttons))
(set! (-> s5-1 interp-time) (-> s4-1 interp-time))
(set! (-> s5-1 1Tinterp-time-priority) (-> s4-1 1Tinterp-time-priority))
(set! (-> s5-1 string-use-startup-vector) (-> s4-1 string-use-startup-vector))
(set! (-> s5-1 string-startup-vector quad) (-> s4-1 string-startup-vector quad))
(set! (-> s5-1 use-look-at-point) (-> s4-1 use-look-at-point))
(set! (-> s5-1 look-at-point quad) (-> s4-1 look-at-point quad))
(set! (-> s5-1 use-point-of-interest) (-> s4-1 use-point-of-interest))
(set! (-> s5-1 point-of-interest quad) (-> s4-1 point-of-interest quad))
(set! (-> s5-1 use-mouse-tumble-point) (-> s4-1 use-mouse-tumble-point))
(set! (-> s5-1 mouse-tumble-point quad) (-> s4-1 mouse-tumble-point quad))
(set! (-> s5-1 handle-of-interest) (-> s4-1 handle-of-interest))
(let* ((s3-1 (handle->process (-> s5-1 handle-of-interest)))
(a0-147 (the-as process-focusable (if (type? s3-1 process-focusable)
(the-as process-focusable s3-1)
)
)
)
)
(when (the-as process a0-147)
(set! (-> s5-1 use-point-of-interest) #t)
(set! (-> s5-1 point-of-interest quad) (-> (get-trans a0-147 4) quad))
)
)
(set! (-> obj cam-default point-of-interest quad) (-> s5-1 point-of-interest quad))
(set! (-> s5-1 butt-handle) (-> s4-1 butt-handle))
(set! (-> s5-1 butt-angle) (-> s4-1 butt-angle))
(set! (-> s5-1 extra-follow-height) (-> s4-1 extra-follow-height))
(set! (-> *texture-pool* common-page-mask) (-> s5-0 unknown-int32-00))
(set! (-> *cpad-list* cpads 0 buzz) (the-as basic (-> s5-0 vibration)))
(let ((v1-137 *ocean*))
(case (-> s5-0 ocean-off)
((#t)
(set! (-> v1-137 off) #t)
)
(('mid)
(set! (-> v1-137 mid-off) #t)
)
(('near)
(set! (-> v1-137 near-off) #t)
)
)
(if (-> s5-1 entity-or-mode-changed)
(cam-master-activate-slave #f)
)
)
(-> obj user-current)
(set! (-> *mouse* active) (-> s5-0 mouse))
(set! (-> *mouse* cursor) (the-as basic (and (-> s5-0 mouse) (-> s5-0 cursor))))
)
(let ((s5-1 (-> obj cam-current)))
(let ((s4-1 (-> obj cam-target)))
(set! (-> s5-1 entity-or-mode-changed) #f)
(if (and (not (name= (-> s5-1 entity-name) (-> s4-1 entity-name)))
(or (not *target*) (not (logtest? (-> *target* focus-status) (-> s4-1 entity-mask))))
)
(set! (-> s4-1 entity-or-mode-changed) #t)
)
(if (!= (-> s5-1 mode-name) (-> s4-1 mode-name))
(set! (-> s4-1 entity-or-mode-changed) #t)
)
(set! (-> s5-1 teleport-on-entity-change) (-> s4-1 teleport-on-entity-change))
(cam-master-set-entity s4-1)
(cond
((not (-> s4-1 entity-or-mode-changed))
)
((or (= (-> s5-1 cam-mode) cam-eye) (= (-> s4-1 cam-mode) cam-eye))
(set! (-> s4-1 no-intro) #t)
(set! (-> s4-1 interp-time) (the-as uint 60))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
)
((= (-> s4-1 cam-mode) cam-endlessfall)
(set! (-> s4-1 no-intro) #t)
(set! (-> s4-1 interp-time) (the-as uint 30))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
)
((or (= (-> s5-1 cam-mode) cam-free-floating) (= (-> s4-1 cam-mode) cam-free-floating))
(set! (-> s4-1 interp-time) (the-as uint 0))
(set! (-> s4-1 1Tinterp-time-priority) (the-as uint 2))
)
)
(set! (-> s5-1 entity-name) (-> s4-1 entity-name))
(set! (-> s5-1 entity-mask) (-> s4-1 entity-mask))
(set! (-> s5-1 mode-name) (-> s4-1 mode-name))
(let ((v1-173 (-> s4-1 entity-or-mode-changed)))
(set! (-> s5-1 entity-or-mode-changed) v1-173)
(when v1-173
(set! (-> s5-1 real-entity-name) (-> s4-1 real-entity-name))
(set! (-> s5-1 cam-mode) (-> s4-1 cam-mode))
)
)
(+! (-> s5-1 fov) (fmax -182.04445 (fmin 182.04445 (* 0.1 (- (-> s4-1 fov) (-> s5-1 fov))))))
(set! (-> s5-1 pov-handle) (-> s4-1 pov-handle))
(set! (-> s5-1 pov-bone) (-> s4-1 pov-bone))
(set! (-> s5-1 pov-offset quad) (-> s4-1 pov-offset quad))
(set! (-> s5-1 string-default) (-> s4-1 string-default))
(set! (-> s5-1 string-max-length-default) (-> s4-1 string-max-length-default))
(set! (-> s5-1 string-min-length-default) (-> s4-1 string-min-length-default))
(set! (-> s5-1 string-max-height-default) (-> s4-1 string-max-height-default))
(set! (-> s5-1 string-min-height-default) (-> s4-1 string-min-height-default))
(set! (-> s5-1 string-max-length) (-> s4-1 string-max-length))
(set! (-> s5-1 string-min-length) (-> s4-1 string-min-length))
(set! (-> s5-1 string-max-height) (-> s4-1 string-max-height))
(set! (-> s5-1 string-min-height) (-> s4-1 string-min-height))
(set! (-> s5-1 string-cliff-height) (-> s4-1 string-cliff-height))
(set! (-> s5-1 string-camera-ceiling) (-> s4-1 string-camera-ceiling))
(cond
((-> s5-1 string-default)
(set! (-> s5-1 gun-min-height) (-> s4-1 gun-min-height))
(set! (-> s5-1 gun-max-height) (-> s4-1 gun-max-height))
)
(else
(set! (-> s5-1 gun-min-height) (-> s4-1 string-min-height))
(set! (-> s5-1 gun-max-height) (-> s4-1 string-max-height))
)
)
(set! (-> s5-1 string-local-down quad) (-> s4-1 string-local-down quad))
(set! (-> s5-1 slave-options) (-> s4-1 slave-options))
(seek! (-> s5-1 matrix-blend-max-angle) (-> s4-1 matrix-blend-max-angle) 182.04445)
(seek! (-> s5-1 matrix-blend-max-partial) (-> s4-1 matrix-blend-max-partial) 0.05)
(set! (-> s5-1 string-spline-max-move) (-> s4-1 string-spline-max-move))
(set! (-> s5-1 string-spline-accel) (-> s4-1 string-spline-accel))
(set! (-> s5-1 string-spline-max-move-player) (-> s4-1 string-spline-max-move-player))
(set! (-> s5-1 string-spline-accel-player) (-> s4-1 string-spline-accel-player))
(set! (-> s5-1 target-height) (-> s4-1 target-height))
(set! (-> s5-1 head-offset) (-> s4-1 head-offset))
(set! (-> s5-1 foot-offset) (-> s4-1 foot-offset))
(set! (-> s5-1 master-options) (-> s4-1 master-options))
(set! (-> s5-1 no-intro) (-> s4-1 no-intro))
(set! (-> s5-1 mouse-input) (-> s4-1 mouse-input))
(set! (-> s5-1 cpad1-skip-buttons) (-> s4-1 cpad1-skip-buttons))
(set! (-> s5-1 interp-time) (-> s4-1 interp-time))
(set! (-> s5-1 1Tinterp-time-priority) (-> s4-1 1Tinterp-time-priority))
(set! (-> s5-1 string-use-startup-vector) (-> s4-1 string-use-startup-vector))
(set! (-> s5-1 string-startup-vector quad) (-> s4-1 string-startup-vector quad))
(set! (-> s5-1 use-look-at-point) (-> s4-1 use-look-at-point))
(set! (-> s5-1 look-at-point quad) (-> s4-1 look-at-point quad))
(set! (-> s5-1 use-point-of-interest) (-> s4-1 use-point-of-interest))
(set! (-> s5-1 point-of-interest quad) (-> s4-1 point-of-interest quad))
(set! (-> s5-1 use-mouse-tumble-point) (-> s4-1 use-mouse-tumble-point))
(set! (-> s5-1 mouse-tumble-point quad) (-> s4-1 mouse-tumble-point quad))
(set! (-> s5-1 handle-of-interest) (-> s4-1 handle-of-interest))
(let* ((s3-1 (handle->process (-> s5-1 handle-of-interest)))
(a0-147 (the-as process-focusable (if (type? s3-1 process-focusable)
(the-as process-focusable s3-1)
)
)
)
)
(when (the-as process a0-147)
(set! (-> s5-1 use-point-of-interest) #t)
(set! (-> s5-1 point-of-interest quad) (-> (get-trans a0-147 4) quad))
)
)
(set! (-> obj cam-default point-of-interest quad) (-> s5-1 point-of-interest quad))
(set! (-> s5-1 butt-handle) (-> s4-1 butt-handle))
(set! (-> s5-1 butt-angle) (-> s4-1 butt-angle))
(set! (-> s5-1 extra-follow-height) (-> s4-1 extra-follow-height))
)
(if (-> s5-1 entity-or-mode-changed)
(cam-master-activate-slave #f)
)
)
(-> obj user-current)
)
(when (zero? *setting-control*)
@ -1416,6 +1415,7 @@
(set! (-> gp-0 display-dx) 0)
(set! (-> gp-0 display-dy) 0)
(set! (-> gp-0 vibration)
;; og:preserve-this constant
(if (or (= *kernel-boot-message* 'demo) (= *kernel-boot-message* 'demo-shared) (!= (scf-get-territory) GAME_TERRITORY_SCEA))
#f
#t
@ -1426,12 +1426,14 @@
(set! (-> gp-0 play-hints) #t)
(set! (-> gp-0 sound-bank-load) #t)
(set! (-> gp-0 subtitle)
;; og:preserve-this constant
(if (or (= *kernel-boot-message* 'demo) (or (= *kernel-boot-message* 'demo-shared) (!= (scf-get-territory) GAME_TERRITORY_SCEE)))
#f
#t
)
)
(let ((v1-31 (scf-get-territory)))
;; og:preserve-this constant
(set! (-> gp-0 beard) (if (or (= v1-31 GAME_TERRITORY_SCEI) (= v1-31 GAME_TERRITORY_SCEK))
#f
#t

View File

@ -122,7 +122,7 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)"
)
(let ((f0-4 (- (-> obj dist) (-> obj smoothed-dist))))
(if (< (fabs f0-4) 40960.0)
(+! (-> obj smoothed-dist) (* 10.0 (-> self clock seconds-per-frame) f0-4))
(+! (-> obj smoothed-dist) (* 10.0 (seconds-per-frame) f0-4))
(set! (-> obj smoothed-dist) (-> obj dist))
)
)
@ -141,7 +141,7 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)"
)
(cond
((-> obj moving)
(set! (-> obj rod-of-god-scale) (- (-> obj rod-of-god-scale) (* 8.0 (-> self clock seconds-per-frame))))
(set! (-> obj rod-of-god-scale) (- (-> obj rod-of-god-scale) (* 8.0 (seconds-per-frame))))
(when (< (-> obj rod-of-god-scale) 0.0)
(set! (-> obj rod-of-god-scale) 0.0)
(set! (-> obj moving) #f)
@ -161,7 +161,7 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)"
)
(else
(set! (-> obj pos quad) (-> obj root trans quad))
(+! (-> obj rod-of-god-scale) (* 8.0 (-> self clock seconds-per-frame)))
(+! (-> obj rod-of-god-scale) (* 8.0 (seconds-per-frame)))
(if (< 1.0 (-> obj rod-of-god-scale))
(set! (-> obj rod-of-god-scale) 1.0)
)
@ -175,8 +175,8 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)"
(spawn (-> obj part) (-> obj root trans))
)
(else
(+! (-> obj theta) (* 32768.0 (-> self clock seconds-per-frame)))
(+! (-> obj phi) (* 9102.223 (-> self clock seconds-per-frame)))
(+! (-> obj theta) (* 32768.0 (seconds-per-frame)))
(+! (-> obj phi) (* 9102.223 (seconds-per-frame)))
(set! (-> obj root trans quad) (-> obj pos quad))
(set! (-> obj root trans y) (+ 28672.0 (* 4096.0 (cos (-> obj theta))) (-> obj pos y)))
)

View File

@ -109,6 +109,7 @@
(let ((s4-0 (new 'stack-no-clear 'vector)))
(set! (-> s4-0 quad) (-> arg1 quad))
(vector-reflect-flat! arg0 s4-0 arg2)
;; og:preserve-this
(let* ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 1.0)) ;; src normalized
(f28-0 (vector-length s4-0)) ;; src original len
(f30-0 (vector-length arg0)) ;; dst original len
@ -280,7 +281,7 @@
(vf6 :class vf)
)
(init-vf0-vector)
(.lvf vf1 (&-> arg2 vec quad))
(.lvf vf1 (&-> arg2 quad))
(.lvf vf6 (&-> arg1 quad))
(.add.vf vf5 vf1 vf1)
(.add.w.vf vf2 vf0 vf1 :mask #b1)
@ -326,6 +327,7 @@
(vf7 :class vf)
)
(init-vf0-vector)
;; og:preserve-this
;; (.sub.vf vf7 vf7 vf7)
(.xor.vf vf7 vf7 vf7)
(.lvf vf1 (&-> arg2 vec quad))
@ -544,6 +546,7 @@
)
)
;; og:preserve-this
;; hack for the smoothed matrix from vectors to handle cases where they accidentally set turnvf to 0.
;; this causes the smoothing to go away on ps2, due to some behavior of inf/nan that differ.
;; if we cheat this to a small but nonzero value, it behaves like on ps2.
@ -560,33 +563,31 @@
arg3 is a rotations-per-frame rate. This limit takes frame rate into account (when lagging, the rotation is larger)
arg4 is a 'slow down when getting close to the end' limit.
This is used in rotate-toward-orientation, which is much improved from jak 1."
(with-pp
(let* ((s5-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0))
(f0-1 (vector-dot arg1 arg2))
(f0-2 (acos f0-1))
(f1-2 (fmin (* arg3 (-> pp clock seconds-per-frame)) (/ (* 5.0 (fabs f0-2)) (int-to-float-nonzero-hack arg4))))
(f30-0 (fmax (fmin f0-2 f1-2) (- f1-2)))
)
(matrix-axis-sin-cos! arg0 s5-1 (sin f30-0) (cos f30-0))
)
arg0
(let* ((s5-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0))
(f0-1 (vector-dot arg1 arg2))
(f0-2 (acos f0-1))
;; og:preserve-this
(f1-2 (fmin (* arg3 (seconds-per-frame)) (/ (* 5.0 (fabs f0-2)) (int-to-float-nonzero-hack arg4))))
(f30-0 (fmax (fmin f0-2 f1-2) (- f1-2)))
)
(matrix-axis-sin-cos! arg0 s5-1 (sin f30-0) (cos f30-0))
)
arg0
)
(defun matrix-from-two-vectors-the-long-way-smooth! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int))
"Same as above, but rotates you away from the target.
Note that the 'near the end' smoothing will apply when you're near the target."
(with-pp
(let* ((s5-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0))
(f0-1 (vector-dot arg1 arg2))
(f0-3 (- (acos f0-1)))
(f1-2 (fmin (* arg3 (-> pp clock seconds-per-frame)) (/ (* 5.0 (fabs f0-3)) (int-to-float-nonzero-hack arg4))))
(f30-0 (fmax (fmin f0-3 f1-2) (- f1-2)))
)
(matrix-axis-sin-cos! arg0 s5-1 (sin f30-0) (cos f30-0))
)
arg0
(let* ((s5-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0))
(f0-1 (vector-dot arg1 arg2))
(f0-3 (- (acos f0-1)))
;; og:preserve-this
(f1-2 (fmin (* arg3 (seconds-per-frame)) (/ (* 5.0 (fabs f0-3)) (int-to-float-nonzero-hack arg4))))
(f30-0 (fmax (fmin f0-3 f1-2) (- f1-2)))
)
(matrix-axis-sin-cos! arg0 s5-1 (sin f30-0) (cos f30-0))
)
arg0
)
(defun quaternion-from-two-vectors-smooth! ((arg0 quaternion) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int))
@ -687,7 +688,7 @@
(quaternion-negate! s5-0 s5-0)
)
(let ((f30-1 (* 2.0 (acos (-> s5-0 w)))))
(set! (-> arg0 quad) (-> s5-0 vec quad))
(set! (-> arg0 quad) (-> s5-0 quad))
(vector-negate! arg0 arg0)
(if (= (vector-normalize-ret-len! arg0 1.0) 0.0)
(set! (-> arg0 y) 1.0)
@ -835,12 +836,14 @@
"arg2 is the vertices of the triangle, arg3 is the normal, arg1 is the input point, arg0 is the output."
;; (declare (print-asm))
(local-vars
;; og:preserve-this float -> uint
(v1-0 uint)
(v1-4 uint)
(v1-5 uint)
(v1-6 uint)
(v1-7 uint)
(v1-10 uint)
;; og:preserve-this float -> uint
(a0-1 uint)
(a1-1 uint)
)
@ -868,13 +871,13 @@
(init-vf0-vector)
(nop!)
(nop!)
(.lvf vf3 (&-> arg2 vector 1 quad))
(.lvf vf3 (&-> arg2 quad 1))
(nop!)
(.lvf vf4 (&-> arg2 vector 2 quad))
(.lvf vf4 (&-> arg2 quad 2))
(nop!)
(.lvf vf5 (&-> arg1 quad))
(.sub.vf vf6 vf3 vf4)
(.lvf vf2 (&-> arg2 vector 0 quad))
(.lvf vf2 (&-> arg2 quad 0))
(.sub.vf vf7 vf3 vf5)
(.lvf vf1 (&-> arg3 quad))
(.sub.vf vf8 vf3 vf2)
@ -895,7 +898,7 @@
(.add.z.vf vf11 vf11 vf11 :mask #b10)
(.add.z.vf vf12 vf12 vf12 :mask #b10)
(.add.z.vf vf13 vf13 vf13 :mask #b10)
;; note: these types were changed to uint to make this copy 64 bits.
;; og:preserve-this these types were changed to uint to make this copy 64 bits.
(.mov v1-0 vf11)
(.mov a1-1 vf12)
(.mov a0-1 vf13)
@ -965,6 +968,7 @@
(defun point-in-triangle-cross ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector))
"Check if point is in the triangle using cross product check (so you have to get the order of points right)"
;; og:preserve-this float -> int
(local-vars (v1-0 int) (a0-1 int) (a1-1 int))
(rlet ((acc :class vf)
(vf1 :class vf)
@ -1009,6 +1013,7 @@
(.mov a0-1 vf2)
(.mov a1-1 vf3)
(.mov v1-0 vf4)
;; og:preserve-this
(>= (the-as int (logior (logior a0-1 a1-1) v1-0)) 0)
)
)
@ -1198,11 +1203,13 @@
(defun calculate-basis-functions-vector! ((arg0 vector) (arg1 int) (arg2 float) (arg3 (pointer float)))
"Calculate polynomial basis for a given control point."
(local-vars (v1-0 int) (v1-1 object))
;; og:preserve-this
;;(.sll v1-0 arg1 2)
(set! v1-0 (* 4 arg1)) ;; originally used 32-bit asm
(let ((a1-1 #x3f800000)
(f3-0 arg2)
)
;; og:preserve-this
;;(.addu v1-1 arg3 v1-0)
(set! v1-1 (&+ arg3 v1-0))
(let* ((f1-0 (the-as float a1-1)) ;; trick to load float constant.
@ -1325,6 +1332,7 @@
(nop!)
(nop!)
(label cfg-11)
;; og:preserve-this
;; calculate coefficients for this knot's polynomial, store in s4-0
(calculate-basis-functions-vector!
s4-0
@ -1333,10 +1341,12 @@
(the-as (pointer float) arg4)
)
)
;; og:preserve-this
;;(.addiu v1-7 s3-0 -3)
(set! v1-7 (- s3-0 3))
(.lvf vf6 s4-0)
)
;; og:preserve-this
;; evaluate polynomial!
;;(.sll v1-8 v1-7 4)
(set! v1-8 (* v1-7 16))
@ -1497,7 +1507,3 @@
)
)
)

View File

@ -32,8 +32,8 @@
:regs (new 'static 'gif-tag-regs-32 :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
:adnops (new 'static 'inline-array gs-adcmd 2
(new 'static 'gs-adcmd :word (new 'static 'array uint32 4 #x0 #x0 #x7f #x0))
(new 'static 'gs-adcmd :word (new 'static 'array uint32 4 #x0 #x0 #x7f #x0))
(new 'static 'gs-adcmd :cmds (gs-reg64 hack))
(new 'static 'gs-adcmd :cmds (gs-reg64 hack))
)
)
)
@ -334,7 +334,7 @@
(-> arg0 process 0 clock)
(cond
((< (-> arg0 state counter) f0-0)
(+! (-> arg0 state counter) (* 300.0 (-> self clock seconds-per-frame)))
(+! (-> arg0 state counter) (* 300.0 (seconds-per-frame)))
(let ((gp-0 (-> arg0 state)))
(let* ((s5-0 (-> arg0 spec))
(f30-0 (fmax 0.0 (fmin 1.0 (* (- 1.0 (/ (-> gp-0 counter) f0-0)) (-> s5-0 fade-start-factor)))))
@ -814,7 +814,6 @@
(define *lightning* #t)
;; ERROR: Failed store: (s.w! (+ v1-31 8) 0) at op 89
(defun lightning-draw-all ()
(when (and *lightning* (not (-> *blit-displays-work* menu-mode)))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic))

View File

@ -679,7 +679,7 @@
(set! (-> arg0 times 6 w) (-> gp-1 shield))
(set! (-> arg0 times 7 w) 1.0)
(when (not (paused?))
(+! (-> gp-1 shield-count) (* 262144.0 (-> self clock seconds-per-frame)))
(+! (-> gp-1 shield-count) (* 262144.0 (seconds-per-frame)))
(set! (-> gp-1 shield) (+ 0.875 (* 0.125 (cos (-> gp-1 shield-count)))))
)
)
@ -910,7 +910,7 @@
(update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0)
(set! (-> arg0 times 7 w) (-> s4-1 explosion))
(if (not (paused?))
(seek! (-> s4-1 explosion) 0.0 (* 2.0 (-> self clock seconds-per-frame)))
(seek! (-> s4-1 explosion) 0.0 (* 2.0 (seconds-per-frame)))
)
)
)
@ -1004,12 +1004,12 @@
(if (and (task-node-closed? (game-task-node drill-mech-smash-consoles))
(not (task-node-closed? (game-task-node drill-mech-resolution)))
)
(update-mood-pulse arg0 7 52 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 16384.0)
(update-mood-pulse arg0 7 52 0.75 0.25 (* 65536.0 (seconds-per-frame)) 16384.0)
)
(when (not (paused?))
(if (-> gp-1 fire-floor-flag)
(seek! (-> gp-1 fire-floor-fade) 1.5 (* 3.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-1 fire-floor-fade) 0.5 (* 3.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-1 fire-floor-fade) 1.5 (* 3.0 (seconds-per-frame)))
(seek! (-> gp-1 fire-floor-fade) 0.5 (* 3.0 (seconds-per-frame)))
)
(set! (-> gp-1 fire-floor)
(+ (-> gp-1 fire-floor-fade) (* (-> gp-1 fire-floor-fade) (rand-vu-float-range 0.0 0.1)))
@ -1061,11 +1061,7 @@
(let ((s5-1 *math-camera*))
(set! (-> arg0 times 5 w) 1.0)
(if (not (paused?))
(quaternion-rotate-y!
(-> s5-1 quat-other)
(-> s5-1 quat-other)
(* 273.06668 (-> self clock seconds-per-frame))
)
(quaternion-rotate-y! (-> s5-1 quat-other) (-> s5-1 quat-other) (* 273.06668 (seconds-per-frame)))
)
)
)
@ -1073,6 +1069,7 @@
(none)
)
;; og:preserve-this
(#when PC_PORT
;; added - drillmtn uses camera-other but only palout sets the trans
(defun init-mood-drillmnt ((arg0 mood-context))
@ -1112,12 +1109,12 @@
(if (and (task-node-closed? (game-task-node drill-mech-smash-consoles))
(not (task-node-closed? (game-task-node drill-mech-resolution)))
)
(update-mood-pulse arg0 7 12 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 16384.0)
(update-mood-pulse arg0 7 12 0.75 0.25 (* 65536.0 (seconds-per-frame)) 16384.0)
)
(when (not (paused?))
(if (-> gp-0 fire-floor-flag)
(seek! (-> gp-0 fire-floor-fade) 1.5 (* 3.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-0 fire-floor-fade) 0.5 (* 3.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-0 fire-floor-fade) 1.5 (* 3.0 (seconds-per-frame)))
(seek! (-> gp-0 fire-floor-fade) 0.5 (* 3.0 (seconds-per-frame)))
)
(set! (-> gp-0 fire-floor)
(+ (-> gp-0 fire-floor-fade) (* (-> gp-0 fire-floor-fade) (rand-vu-float-range 0.0 0.1)))
@ -1190,7 +1187,7 @@
(set! (-> arg0 times 6 w) 1.0)
(set! (-> arg0 times 7 w) 0.0)
(if (not (paused?))
(set! (-> s4-1 explosion) (- (-> s4-1 explosion) (-> self clock seconds-per-frame)))
(set! (-> s4-1 explosion) (- (-> s4-1 explosion) (seconds-per-frame)))
)
)
)
@ -1278,11 +1275,7 @@
(update-mood-flames arg0 6 2 8 0.5 0.0009765625 1.5)
(let ((gp-1 *math-camera*))
(if (not (paused?))
(quaternion-rotate-y!
(-> gp-1 quat-other)
(-> gp-1 quat-other)
(* 273.06668 (-> self clock seconds-per-frame))
)
(quaternion-rotate-y! (-> gp-1 quat-other) (-> gp-1 quat-other) (* 273.06668 (seconds-per-frame)))
)
)
)
@ -1403,11 +1396,11 @@
(when (not (paused?))
(cond
((-> s5-1 green-flag)
(set! (-> s5-1 green) (fmin 1.9 (+ (-> s5-1 green) (* 2.0 (-> self clock seconds-per-frame)))))
(set! (-> s5-1 green) (fmin 1.9 (+ (-> s5-1 green) (* 2.0 (seconds-per-frame)))))
(set! (-> s5-1 green-noise) (rand-vu-float-range 0.0 (-> s5-1 green)))
)
(else
(set! (-> s5-1 green) (fmax 0.0 (- (-> s5-1 green) (* 2.0 (-> self clock seconds-per-frame)))))
(set! (-> s5-1 green) (fmax 0.0 (- (-> s5-1 green) (* 2.0 (seconds-per-frame)))))
(set! (-> s5-1 green-noise) 0.0)
)
)
@ -1472,7 +1465,7 @@
)
(when (not (paused?))
(if (-> gp-1 interp-flag)
(seek! (-> gp-1 interp) 1.0 (* 0.5 (-> self clock seconds-per-frame)))
(seek! (-> gp-1 interp) 1.0 (* 0.5 (seconds-per-frame)))
)
)
)
@ -1551,7 +1544,7 @@
(update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0)
(set! (-> arg0 times 6 w) (-> s4-1 flash))
(if (not (paused?))
(set! (-> s4-1 flash) (fmax 0.0 (- (-> s4-1 flash) (* 2.0 (-> self clock seconds-per-frame)))))
(set! (-> s4-1 flash) (fmax 0.0 (- (-> s4-1 flash) (* 2.0 (seconds-per-frame)))))
)
)
)

View File

@ -103,16 +103,16 @@
)
(set! (-> arg0 times 4 w) (+ 1.2 (* 0.2 (cos (-> gp-0 3)))))
(when (not (paused?))
(let ((f0-17 (+ (-> gp-0 0) (* 18204.445 (-> self clock seconds-per-frame)))))
(let ((f0-17 (+ (-> gp-0 0) (* 18204.445 (seconds-per-frame)))))
(set! (-> gp-0 0) (- f0-17 (* (the float (the int (/ f0-17 65536.0))) 65536.0)))
)
(let ((f0-20 (+ (-> gp-0 1) (* 196608.0 (-> self clock seconds-per-frame)))))
(let ((f0-20 (+ (-> gp-0 1) (* 196608.0 (seconds-per-frame)))))
(set! (-> gp-0 1) (- f0-20 (* (the float (the int (/ f0-20 65536.0))) 65536.0)))
)
(let ((f0-23 (+ (-> gp-0 2) (* 163840.0 (-> self clock seconds-per-frame)))))
(let ((f0-23 (+ (-> gp-0 2) (* 163840.0 (seconds-per-frame)))))
(set! (-> gp-0 2) (- f0-23 (* (the float (the int (/ f0-23 65536.0))) 65536.0)))
)
(let ((f0-26 (+ (-> gp-0 3) (* 32768.0 (-> self clock seconds-per-frame)))))
(let ((f0-26 (+ (-> gp-0 3) (* 32768.0 (seconds-per-frame)))))
(set! (-> gp-0 3) (- f0-26 (* (the float (the int (/ f0-26 65536.0))) 65536.0)))
)
)
@ -873,7 +873,7 @@
)
(shr (shl (the int (* 16.0 f0-7)) 56) 40)
)
(-> (new 'static 'array uint64 1 #xffffffff00ffffff) 0)
(the-as uint #xffffffff00ffffff)
)
(shl #x8000 16)
)
@ -885,7 +885,7 @@
(set! (-> arg0 times 7 w) (-> s4-0 turret-value))
(when (not (paused?))
(set! (-> s4-0 turret-value) (fmax 0.0 (+ -0.2 (-> s4-0 turret-value))))
(seek! (-> s4-0 explosion) 0.0 (* 2.5 (-> self clock seconds-per-frame)))
(seek! (-> s4-0 explosion) 0.0 (* 2.5 (seconds-per-frame)))
)
)
(when *ocean-map-sewer*
@ -1054,14 +1054,14 @@
)
)
(when (not (paused?))
(seek! (-> s5-0 door-current) (-> s5-0 door-target) (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> s5-0 door-current) (-> s5-0 door-target) (* 4.0 (seconds-per-frame)))
(cond
((-> s5-0 purple-flag)
(set! (-> s5-0 purple) (fmin 1.9 (+ (-> s5-0 purple) (* 2.0 (-> self clock seconds-per-frame)))))
(set! (-> s5-0 purple) (fmin 1.9 (+ (-> s5-0 purple) (* 2.0 (seconds-per-frame)))))
(set! (-> s5-0 purple-noise) (rand-vu-float-range 0.0 (-> s5-0 purple)))
)
(else
(set! (-> s5-0 purple) (fmax 0.0 (- (-> s5-0 purple) (* 2.0 (-> self clock seconds-per-frame)))))
(set! (-> s5-0 purple) (fmax 0.0 (- (-> s5-0 purple) (* 2.0 (seconds-per-frame)))))
(set! (-> s5-0 purple-noise) 0.0)
)
)
@ -1606,7 +1606,7 @@
(else
(set! (-> arg0 times 0 w) 1.0)
(set! (-> arg0 times 1 w) 1.0)
(update-mood-pulse arg0 7 0 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0)
(update-mood-pulse arg0 7 0 0.75 0.25 (* 65536.0 (seconds-per-frame)) 0.0)
)
)
0
@ -1640,7 +1640,7 @@
(else
(set! (-> arg0 times 0 w) 1.0)
(set! (-> arg0 times 1 w) 1.0)
(update-mood-pulse arg0 7 16 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0)
(update-mood-pulse arg0 7 16 0.75 0.25 (* 65536.0 (seconds-per-frame)) 0.0)
(update-mood-electricity arg0 6 20 0.8 1.0)
(let ((s5-0 (the-as fordumpa-states (-> arg0 state))))
(set! (-> arg0 times 2 w) (-> s5-0 turret-value 0))
@ -1706,12 +1706,12 @@
((begin
(set! (-> arg0 times 0 w) 1.0)
(set! (-> arg0 times 1 w) 1.0)
(update-mood-pulse arg0 3 4 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0)
(update-mood-pulse arg0 3 4 0.75 0.25 (* 65536.0 (seconds-per-frame)) 0.0)
(-> arg0 state 0)
)
(set! (-> arg0 times 2 w) 0.0)
(update-mood-pulse arg0 4 8 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 16384.0)
(update-mood-strobe arg0 5 12 85 (* 16.0 (-> self clock seconds-per-frame)))
(update-mood-pulse arg0 4 8 0.75 0.25 (* 65536.0 (seconds-per-frame)) 16384.0)
(update-mood-strobe arg0 5 12 85 (* 16.0 (seconds-per-frame)))
)
(else
(set! (-> arg0 times 2 w) 1.0)
@ -1761,7 +1761,7 @@
(set! (-> arg0 times 1 w) 1.0)
(update-mood-electricity arg0 5 4 0.8 1.0)
(update-mood-electricity arg0 6 20 0.8 1.0)
(update-mood-pulse arg0 7 0 0.75 0.25 (* 65536.0 (-> self clock seconds-per-frame)) 0.0)
(update-mood-pulse arg0 7 0 0.75 0.25 (* 65536.0 (seconds-per-frame)) 0.0)
)
)
0
@ -1895,12 +1895,12 @@
(set! (-> arg0 times 2 w) (-> gp-0 torture))
(when (not (paused?))
(set! (-> gp-0 pulse) (+ 1.125 (* 0.125 (cos (-> gp-0 angle)))))
(let ((f0-14 (+ (-> gp-0 angle) (* 32768.0 (-> self clock seconds-per-frame)))))
(let ((f0-14 (+ (-> gp-0 angle) (* 32768.0 (seconds-per-frame)))))
(set! (-> gp-0 angle) (- f0-14 (* (the float (the int (/ f0-14 65536.0))) 65536.0)))
)
(if (-> gp-0 torture-flag)
(seek! (-> gp-0 torture) 1.0 (-> self clock seconds-per-frame))
(seek! (-> gp-0 torture) 0.0 (-> self clock seconds-per-frame))
(seek! (-> gp-0 torture) 1.0 (seconds-per-frame))
(seek! (-> gp-0 torture) 0.0 (seconds-per-frame))
)
)
)
@ -2087,9 +2087,9 @@
(set! (-> arg0 times 5 w) 0.0)
)
(when (not (paused?))
(+! (-> gp-0 time) (* 300.0 (-> self clock seconds-per-frame)))
(+! (-> gp-0 rot) (* 32768.0 (-> self clock seconds-per-frame)))
(+! (-> gp-0 rot2) (* 16384.0 (-> self clock seconds-per-frame)))
(+! (-> gp-0 time) (* 300.0 (seconds-per-frame)))
(+! (-> gp-0 rot) (* 32768.0 (seconds-per-frame)))
(+! (-> gp-0 rot2) (* 16384.0 (seconds-per-frame)))
(set! (-> gp-0 flicker) (rand-vu-float-range 0.0 0.1))
)
)
@ -2364,7 +2364,7 @@
(s0-0 0.85)
)
(set! sv-16 0.15)
(let ((t1-0 (* 182.04445 (-> self clock seconds-per-frame) (rand-vu-float-range 60.0 200.0)))
(let ((t1-0 (* 182.04445 (seconds-per-frame) (rand-vu-float-range 60.0 200.0)))
(t2-0 0.0)
)
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0 t2-0)
@ -2377,7 +2377,7 @@
(s0-1 0.85)
)
(set! sv-32 0.15)
(let ((t1-1 (* 182.04445 (-> self clock seconds-per-frame) (rand-vu-float-range 120.0 180.0)))
(let ((t1-1 (* 182.04445 (seconds-per-frame) (rand-vu-float-range 120.0 180.0)))
(t2-1 16384.0)
)
(s4-1 s3-1 s2-1 s1-1 s0-1 sv-32 t1-1 t2-1)
@ -2398,7 +2398,7 @@
)
(when (not (paused?))
(set! (-> gp-0 drillbit) (rand-vu-float-range 0.5 1.0))
(seek! (-> gp-0 explosion) 0.0 (* 2.5 (-> self clock seconds-per-frame)))
(seek! (-> gp-0 explosion) 0.0 (* 2.5 (seconds-per-frame)))
)
)
)
@ -2618,7 +2618,7 @@
(set! (-> arg0 times 1 w) 1.0)
(update-mood-caustics arg0 2 (-> gp-1 rot) 10922.667 0.75 0.25)
(update-mood-caustics arg0 3 (-> gp-1 rot) 0.0 0.75 0.25)
;; note : updated for pc port for nest revisit
;; og:preserve-this updated for pc port for nest revisit
(#if PC_PORT
(if (process-by-name "blocking-plane-nestb" *active-pool*)
(set! (-> arg0 times 4 w) 0.0)
@ -2626,9 +2626,9 @@
(update-mood-pulse arg0 4 0 0.875 0.125 (* 196608.0 (-> self clock seconds-per-frame)) 0.0))
(set! (-> arg0 times 5 w) (+ (-> gp-1 purple) (-> gp-1 purple-noise)))
(when (not (paused?))
(seek! (-> gp-1 purple) 0.0 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-1 purple) 0.0 (* 4.0 (seconds-per-frame)))
(set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (* 0.2 (-> gp-1 purple))))
(+! (-> gp-1 rot) (* 16384.0 (-> self clock seconds-per-frame)))
(+! (-> gp-1 rot) (* 16384.0 (seconds-per-frame)))
)
)
)
@ -2690,14 +2690,14 @@
(cond
((zero? v1-9)
(set! (-> gp-1 flicker) (rand-vu-float-range 0.2 0.4))
(set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame)))
(set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (seconds-per-frame)))
(when (>= 0.0 (-> gp-1 flicker-count))
(set! (-> gp-1 flicker-count) (rand-vu-float-range 0.25 1.0))
(set! (-> gp-1 flicker-state) 1)
)
)
((= v1-9 1)
(set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame)))
(set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (seconds-per-frame)))
(when (>= 0.0 (-> gp-1 flicker-count))
(set! (-> gp-1 flicker-count) (rand-vu-float-range 0.1 0.5))
(set! (-> gp-1 flicker-state) 2)
@ -2705,14 +2705,14 @@
)
((= v1-9 2)
(set! (-> gp-1 flicker) (rand-vu-float-range 0.25 0.75))
(set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame)))
(set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (seconds-per-frame)))
(when (>= 0.0 (-> gp-1 flicker-count))
(set! (-> gp-1 flicker-count) (rand-vu-float-range 0.25 1.0))
(set! (-> gp-1 flicker-state) 3)
)
)
(else
(set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (-> self clock seconds-per-frame)))
(set! (-> gp-1 flicker-count) (- (-> gp-1 flicker-count) (seconds-per-frame)))
(when (>= 0.0 (-> gp-1 flicker-count))
(set! (-> gp-1 flicker-count) (rand-vu-float-range 0.1 0.5))
(set! (-> gp-1 flicker-state) 0)
@ -2844,12 +2844,12 @@
(set! (-> arg0 times 6 y) f0-7)
)
(set! (-> arg0 times 6 w) 1.0)
(update-mood-pulse arg0 4 8 1.15 0.15 (* 43690.668 (-> self clock seconds-per-frame)) 0.0)
(update-mood-pulse arg0 5 24 1.3 0.2 (* 54613.332 (-> self clock seconds-per-frame)) 0.0)
(update-mood-pulse arg0 4 8 1.15 0.15 (* 43690.668 (seconds-per-frame)) 0.0)
(update-mood-pulse arg0 5 24 1.3 0.2 (* 54613.332 (seconds-per-frame)) 0.0)
(update-mood-electricity arg0 7 0 0.9 1.0)
(when (not (paused?))
(+! (-> s5-0 rot) (* 13107.2 (-> self clock seconds-per-frame)))
(+! (-> s5-0 robot-rot) (* 32768.0 (-> self clock seconds-per-frame)))
(+! (-> s5-0 rot) (* 13107.2 (seconds-per-frame)))
(+! (-> s5-0 robot-rot) (* 32768.0 (seconds-per-frame)))
)
)
)

View File

@ -954,131 +954,129 @@ Returns the current value of `lightning-id`"
;; WARN: disable def twice: 141. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
(defmethod gen-lightning-and-thunder! mood-control ((obj mood-control))
(local-vars (a1-1 (array float)))
(with-pp
(let ((v1-3 (-> obj mood-channel-group data (-> obj lightning-index) vecs))
(a1-0 (-> obj lightning-val))
(a0-4 (/ (-> obj lightning-time) 2))
(f0-0 (-> obj lightning-time2))
(let ((v1-3 (-> obj mood-channel-group data (-> obj lightning-index) vecs))
(a1-0 (-> obj lightning-val))
(a0-4 (/ (-> obj lightning-time) 2))
(f0-0 (-> obj lightning-time2))
)
(set! (-> obj lightning-flash) 0.0)
(cond
((>= 0.0 f0-0)
(cond
((zero? a1-0)
(set! a1-1 *flash0*)
)
(set! (-> obj lightning-flash) 0.0)
(cond
((>= 0.0 f0-0)
(cond
((zero? a1-0)
(set! a1-1 *flash0*)
)
((= a1-0 1)
(set! a1-1 *flash1*)
)
((= a1-0 2)
(set! a1-1 *flash2*)
)
((= a1-0 3)
(set! a1-1 *flash3*)
)
((= a1-0 4)
(set! a1-1 *flash4*)
)
((= a1-0 5)
(set! a1-1 *flash5*)
)
((= a1-0 6)
(set! a1-1 *flash6*)
)
(else
(set! a1-1 *flash7*)
)
)
(cond
((< a0-4 (-> a1-1 length))
(let ((f30-0 (-> a1-1 a0-4))
(s5-0 (new 'stack-no-clear 'vector))
)
(cond
((= (-> obj lightning-index) 4)
(set! (-> obj lightning-flash) f30-0)
)
((= (-> obj lightning-index) 5)
(set! (-> obj lightning-flash) f30-0)
(dotimes (s4-0 8)
(set-vector! s5-0 255.0 255.0 255.0 128.0)
(vector4-lerp!
(the-as vector (-> obj mood-fog-table data s4-0))
(the-as vector (-> obj mood-fog-table data s4-0))
s5-0
f30-0
)
)
)
(else
(set! (-> obj lightning-flash) (* 1.9921875 f30-0))
(set-vector! (-> v1-3 0) 1.0 1.0 1.0 1.0)
(set! (-> v1-3 1 quad) (-> v1-3 0 quad))
(set! (-> v1-3 2 quad) (-> v1-3 0 quad))
(set! (-> v1-3 3 quad) (-> v1-3 0 quad))
(set! (-> v1-3 4 quad) (-> v1-3 0 quad))
(set! (-> v1-3 5 quad) (-> v1-3 0 quad))
)
)
)
(when (not (paused?))
(let ((v0-2 (the-as number (+ (-> obj lightning-time) 1))))
(set! (-> obj lightning-time) (the-as int v0-2))
v0-2
)
)
)
((and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) name) 'nest))
(set! (-> obj lightning-time2) (rand-vu-float-range 3.0 5.0))
)
(else
(set! (-> obj lightning-time2) (rand-vu-float-range 15.0 20.0))
)
((= a1-0 1)
(set! a1-1 *flash1*)
)
((= a1-0 2)
(set! a1-1 *flash2*)
)
((= a1-0 3)
(set! a1-1 *flash3*)
)
((= a1-0 4)
(set! a1-1 *flash4*)
)
((= a1-0 5)
(set! a1-1 *flash5*)
)
((= a1-0 6)
(set! a1-1 *flash6*)
)
(else
(set! a1-1 *flash7*)
)
)
(else
(when (not (paused?))
(set! (-> obj lightning-time2) (- (-> obj lightning-time2) (-> pp clock seconds-per-frame)))
(when (>= 0.0 (-> obj lightning-time2))
(set! (-> obj lightning-index) (mod (the-as int (rand-uint31-gen *random-generator*)) 6))
(set! (-> obj lightning-val) (the-as int (logand (rand-uint31-gen *random-generator*) 7)))
(set! (-> obj lightning-time) 0)
(cond
((zero? (-> obj lightning-index))
(play-or-stop-lightning!
obj
(static-sound-spec "thunder-b")
(new 'static 'vector :x 37109760.0 :y 16261120.0 :z 5857280.0)
)
)
((= (-> obj lightning-index) 1)
(play-or-stop-lightning!
obj
(static-sound-spec "thunder-b")
(new 'static 'vector :x 20480000.0 :y 33341440.0 :z 12124160.0)
)
)
((= (-> obj lightning-index) 2)
(play-or-stop-lightning!
obj
(static-sound-spec "thunder-b")
(new 'static 'vector :x -20480000.0 :y 33341440.0 :z 12124160.0)
)
)
((= (-> obj lightning-index) 3)
(play-or-stop-lightning!
obj
(static-sound-spec "thunder-b")
(new 'static 'vector :x -37109760.0 :y 16261120.0 :z 5857280.0)
)
)
((= (-> obj lightning-index) 4)
(play-or-stop-lightning! obj (static-sound-spec "thunder-c") (new 'static 'vector :y 40960000.0))
)
((= (-> obj lightning-index) 5)
(play-or-stop-lightning! obj (static-sound-spec "thunder-a") (new 'static 'vector :y 40960000.0))
)
(cond
((< a0-4 (-> a1-1 length))
(let ((f30-0 (-> a1-1 a0-4))
(s5-0 (new 'stack-no-clear 'vector))
)
(cond
((= (-> obj lightning-index) 4)
(set! (-> obj lightning-flash) f30-0)
)
((= (-> obj lightning-index) 5)
(set! (-> obj lightning-flash) f30-0)
(dotimes (s4-0 8)
(set-vector! s5-0 255.0 255.0 255.0 128.0)
(vector4-lerp!
(the-as vector (-> obj mood-fog-table data s4-0))
(the-as vector (-> obj mood-fog-table data s4-0))
s5-0
f30-0
)
)
)
(else
(set! (-> obj lightning-flash) (* 1.9921875 f30-0))
(set-vector! (-> v1-3 0) 1.0 1.0 1.0 1.0)
(set! (-> v1-3 1 quad) (-> v1-3 0 quad))
(set! (-> v1-3 2 quad) (-> v1-3 0 quad))
(set! (-> v1-3 3 quad) (-> v1-3 0 quad))
(set! (-> v1-3 4 quad) (-> v1-3 0 quad))
(set! (-> v1-3 5 quad) (-> v1-3 0 quad))
)
)
)
(when (not (paused?))
(let ((v0-2 (the-as number (+ (-> obj lightning-time) 1))))
(set! (-> obj lightning-time) (the-as int v0-2))
v0-2
)
)
)
((and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) name) 'nest))
(set! (-> obj lightning-time2) (rand-vu-float-range 3.0 5.0))
)
(else
(set! (-> obj lightning-time2) (rand-vu-float-range 15.0 20.0))
)
)
)
(else
(when (not (paused?))
(set! (-> obj lightning-time2) (- (-> obj lightning-time2) (seconds-per-frame)))
(when (>= 0.0 (-> obj lightning-time2))
(set! (-> obj lightning-index) (mod (the-as int (rand-uint31-gen *random-generator*)) 6))
(set! (-> obj lightning-val) (the-as int (logand (rand-uint31-gen *random-generator*) 7)))
(set! (-> obj lightning-time) 0)
(cond
((zero? (-> obj lightning-index))
(play-or-stop-lightning!
obj
(static-sound-spec "thunder-b")
(new 'static 'vector :x 37109760.0 :y 16261120.0 :z 5857280.0)
)
)
((= (-> obj lightning-index) 1)
(play-or-stop-lightning!
obj
(static-sound-spec "thunder-b")
(new 'static 'vector :x 20480000.0 :y 33341440.0 :z 12124160.0)
)
)
((= (-> obj lightning-index) 2)
(play-or-stop-lightning!
obj
(static-sound-spec "thunder-b")
(new 'static 'vector :x -20480000.0 :y 33341440.0 :z 12124160.0)
)
)
((= (-> obj lightning-index) 3)
(play-or-stop-lightning!
obj
(static-sound-spec "thunder-b")
(new 'static 'vector :x -37109760.0 :y 16261120.0 :z 5857280.0)
)
)
((= (-> obj lightning-index) 4)
(play-or-stop-lightning! obj (static-sound-spec "thunder-c") (new 'static 'vector :y 40960000.0))
)
((= (-> obj lightning-index) 5)
(play-or-stop-lightning! obj (static-sound-spec "thunder-a") (new 'static 'vector :y 40960000.0))
)
)
)
)
@ -1087,8 +1085,6 @@ Returns the current value of `lightning-id`"
)
)
;; definition for method 9 of type mood-control
;; WARN: Return type mismatch int vs none.
(defmethod init-weather! mood-control ((obj mood-control))
(local-vars (v1-39 int))
(let ((s5-0 (level-get-target-inside *level*)))
@ -1133,15 +1129,15 @@ Returns the current value of `lightning-id`"
(let ((a0-6 (-> s4-0 iweather fog))
(v1-30 (-> s4-0 iweather cloud))
)
(set! (-> s4-0 index 0) (+ (* 3 (the-as int v1-30)) (the-as int a0-6)))
(set! (-> s4-0 index 1) (the-as int (+ a0-6 1 (* 3 (the-as int v1-30)))))
(set! (-> s4-0 index 2) (+ (* 3 (the-as int (+ v1-30 1))) (the-as int a0-6)))
(set! (-> s4-0 index 3) (the-as int (+ a0-6 1 (* 3 (the-as int (+ v1-30 1))))))
(set! (-> s4-0 index 0) (+ (* 3 v1-30) a0-6))
(set! (-> s4-0 index 1) (+ a0-6 1 (* 3 v1-30)))
(set! (-> s4-0 index 2) (+ (* 3 (+ v1-30 1)) a0-6))
(set! (-> s4-0 index 3) (+ a0-6 1 (* 3 (+ v1-30 1))))
)
(let ((v1-34 (-> s4-0 iweather cloud)))
(set! (-> s4-0 color-interp) (-> s4-0 interp cloud))
(set! (-> s4-0 color-index 0) (the-as int v1-34))
(set! (-> s4-0 color-index 1) (the-as int (+ v1-34 1)))
(set! (-> s4-0 color-index 0) v1-34)
(set! (-> s4-0 color-index 1) (+ v1-34 1))
)
0
(let ((f0-23 (- (-> s4-0 weather cloud) (the float (-> s4-0 iweather cloud)))))
@ -1192,17 +1188,15 @@ Returns the current value of `lightning-id`"
(seek!
(-> obj current-interp cloud)
(-> obj target-interp cloud)
(* (/ 1.0 (-> obj speed-interp cloud)) (-> self clock seconds-per-frame))
(* (/ 1.0 (-> obj speed-interp cloud)) (seconds-per-frame))
)
(seek!
(-> obj current-interp fog)
(-> obj target-interp fog)
(* (/ 1.0 (-> obj speed-interp fog)) (-> self clock seconds-per-frame))
(* (/ 1.0 (-> obj speed-interp fog)) (seconds-per-frame))
)
(when (!= (-> obj time-until-random cloud) -99.0)
(set! (-> obj time-until-random cloud)
(- (-> obj time-until-random cloud) (* 300.0 (-> self clock seconds-per-frame)))
)
(set! (-> obj time-until-random cloud) (- (-> obj time-until-random cloud) (* 300.0 (seconds-per-frame))))
(when (< (-> obj time-until-random cloud) 0.0)
(set! (-> obj time-until-random cloud)
(rand-vu-float-range (-> obj time-until-random-min cloud) (-> obj time-until-random-max cloud))
@ -1232,9 +1226,7 @@ Returns the current value of `lightning-id`"
)
)
(when (!= (-> obj time-until-random fog) -99.0)
(set! (-> obj time-until-random fog)
(- (-> obj time-until-random fog) (* 300.0 (-> self clock seconds-per-frame)))
)
(set! (-> obj time-until-random fog) (- (-> obj time-until-random fog) (* 300.0 (seconds-per-frame))))
(when (< (-> obj time-until-random fog) 0.0)
(set! (-> obj time-until-random fog)
(rand-vu-float-range (-> obj time-until-random-min fog) (-> obj time-until-random-max fog))
@ -1322,11 +1314,11 @@ Returns the current value of `lightning-id`"
(format *stdcon* "time until random cloud ~f~%" (* 0.0033333334 (-> obj time-until-random cloud)))
(format *stdcon* "current cloud ~f~%" (-> obj current-interp cloud))
(format *stdcon* "target cloud ~f~%" (-> obj target-interp cloud))
(format *stdcon* "speed cloud ~f~%" (* (/ 1.0 (-> obj speed-interp cloud)) (-> self clock seconds-per-frame)))
(format *stdcon* "speed cloud ~f~%" (* (/ 1.0 (-> obj speed-interp cloud)) (seconds-per-frame)))
(format *stdcon* "time until random fog ~f~%" (* 0.0033333334 (-> obj time-until-random fog)))
(format *stdcon* "current fog ~f~%" (-> obj current-interp fog))
(format *stdcon* "target fog ~f~%" (-> obj target-interp fog))
(format *stdcon* "speed fog ~f~%" (* (/ 1.0 (-> obj speed-interp fog)) (-> self clock seconds-per-frame)))
(format *stdcon* "speed fog ~f~%" (* (/ 1.0 (-> obj speed-interp fog)) (seconds-per-frame)))
)
)
)
@ -1338,11 +1330,10 @@ Returns the current value of `lightning-id`"
(none)
)
;; WARN: Return type mismatch int vs none.
(defmethod update-mood-weather! mood-control ((obj mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float))
"Set the `target-interp` and `speed-interp` for the clouds and fog
If `*-speed` is 0.0, use the `*-target` args to set `current-interp`
See [[mood-weather]]"
If `*-speed` is 0.0, use the `*-target` args to set `current-interp`
See [[mood-weather]]"
(set! (-> obj target-interp cloud) cloud-target)
(set! (-> obj target-interp fog) fog-target)
(set! (-> obj speed-interp cloud) cloud-speed)

View File

@ -352,22 +352,8 @@
(set! (-> *part-id-table* 56 init-specs 1 initial-valuef) (* 4.0 f0-0))
)
(set! (-> *part-id-table* 56 init-specs 19 initial-valuef) (+ 32768.0 (vector-y-angle arg2)))
(let ((t9-2 sp-launch-particles-var)
(a0-3 *sp-particle-system-2d*)
(a1-2 (-> *part-id-table* 58))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> arg1 quad))
(t9-2 a0-3 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-3 sp-launch-particles-var)
(a0-4 *sp-particle-system-2d*)
(a1-3 (-> *part-id-table* 56))
(a2-3 *launch-matrix*)
)
(set! (-> a2-3 trans quad) (-> arg1 quad))
(t9-3 a0-4 a1-3 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 58) arg1)
(launch-particles (-> *part-id-table* 56) arg1)
0
(none)
)
@ -629,45 +615,17 @@
(set! (-> *part-id-table* 62 init-specs 22 initial-valuef) (- 16384.0 (vector-x-angle (-> gp-0 vector 1))))
(set! (-> *part-id-table* 62 init-specs 16 initial-valuef) f30-0)
)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 62)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles (-> *part-id-table* 62) gp-0 :origin-is-matrix #t)
(case (-> arg1 datab 3)
((11 10)
(sound-play "sizzle-drips")
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 66)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 65)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles (-> *part-id-table* 66) gp-0 :origin-is-matrix #t)
(launch-particles (-> *part-id-table* 65) gp-0 :origin-is-matrix #t)
)
(else
(sound-play "dry-drips")
(set! (-> *part-id-table* 64 init-specs 10 initial-valuef) (-> arg1 omega))
(sp-launch-particles-var
*sp-particle-system-3d*
(-> *part-id-table* 64)
gp-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 64) gp-0 :origin-is-matrix #t)
)
)
)
@ -721,22 +679,8 @@
)
(set! (-> *part-id-table* 60 init-specs 2 initial-valuef) arg0)
(set! (-> *part-id-table* 61 init-specs 2 initial-valuef) (* 4.0 arg0))
(let ((t9-6 sp-launch-particles-var)
(a0-10 *sp-particle-system-2d*)
(a1-7 (-> *part-id-table* 60))
(a2-5 *launch-matrix*)
)
(set! (-> a2-5 trans quad) (-> gp-1 quad))
(t9-6 a0-10 a1-7 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-7 sp-launch-particles-var)
(a0-11 *sp-particle-system-2d*)
(a1-8 (-> *part-id-table* 61))
(a2-6 *launch-matrix*)
)
(set! (-> a2-6 trans quad) (-> gp-1 quad))
(t9-7 a0-11 a1-8 a2-6 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 60) gp-1)
(launch-particles (-> *part-id-table* 61) gp-1)
)
)
0

View File

@ -5,8 +5,11 @@
;; name in dgo: ocean-texture
;; dgos: ENGINE, GAME
;; og:ignore-form:(defun-debug check-normals
;; DECOMP BEGINS
;; og:preserve-this
(define ocean-texture-vu1-block (new 'static 'vu-function))
(defmethod ocean-texture-setup-constants ocean ((obj ocean) (arg0 ocean-texture-constants))
@ -180,6 +183,7 @@
)
(ocean-texture-add-call-rest obj arg0)
(ocean-texture-add-call-done obj arg0)
;; og:preserve-this method 81 not handled for now
;; (ocean-method-81 obj arg0)
;; (reset-display-gs-state *display* arg0)
0
@ -294,24 +298,22 @@
)
(defmethod do-tex-scroll! ocean ((obj ocean))
(with-pp
(when (not (paused?))
(+! (-> obj st-scroll x) (* 8.0 (-> pp clock seconds-per-frame)))
(set! (-> obj st-scroll y) (- (-> obj st-scroll y) (* 8.0 (-> pp clock seconds-per-frame))))
(if (< 128.0 (-> obj st-scroll x))
(+! (-> obj st-scroll x) -128.0)
)
(if (< (-> obj st-scroll y) 0.0)
(+! (-> obj st-scroll y) 128.0)
)
)
(set! (-> obj uv-scroll-0 x) (the int (* 16.0 (-> obj st-scroll x))))
(set! (-> obj uv-scroll-0 y) (the int (* 16.0 (+ 256.0 (-> obj st-scroll y)))))
(set! (-> obj uv-scroll-1 x) (the int (* 16.0 (+ 256.0 (-> obj st-scroll x)))))
(set! (-> obj uv-scroll-1 y) (the int (* 16.0 (-> obj st-scroll y))))
0
(none)
(when (not (paused?))
(+! (-> obj st-scroll x) (* 8.0 (seconds-per-frame)))
(set! (-> obj st-scroll y) (- (-> obj st-scroll y) (* 8.0 (seconds-per-frame))))
(if (< 128.0 (-> obj st-scroll x))
(+! (-> obj st-scroll x) -128.0)
)
(if (< (-> obj st-scroll y) 0.0)
(+! (-> obj st-scroll y) 128.0)
)
)
(set! (-> obj uv-scroll-0 x) (the int (* 16.0 (-> obj st-scroll x))))
(set! (-> obj uv-scroll-0 y) (the int (* 16.0 (+ 256.0 (-> obj st-scroll y)))))
(set! (-> obj uv-scroll-1 x) (the int (* 16.0 (+ 256.0 (-> obj st-scroll x)))))
(set! (-> obj uv-scroll-1 y) (the int (* 16.0 (-> obj st-scroll y))))
0
(none)
)
(defmethod ocean-method-81 ocean ((obj ocean) (arg0 dma-buffer))

View File

@ -5,9 +5,7 @@
;; name in dgo: ocean
;; dgos: ENGINE, GAME
(def-mips2c init-ocean-far-regs (function none))
(def-mips2c draw-large-polygon-ocean (function none))
(def-mips2c render-ocean-quad (function (inline-array ocean-vertex) dma-buffer symbol))
;; og:ignore-form:(defmethod ocean-method-18
;; DECOMP BEGINS
@ -103,9 +101,11 @@
)
)
;; ERROR: function was not converted to expressions. Cannot decompile.
(def-mips2c init-ocean-far-regs (function none))
;; ERROR: function was not converted to expressions. Cannot decompile.
(def-mips2c draw-large-polygon-ocean (function none))
(def-mips2c render-ocean-quad (function (inline-array ocean-vertex) dma-buffer symbol))
(defmethod add-colors! ocean ((obj ocean) (arg0 vector) (arg1 ocean-vertex))
(let ((s3-0 (new 'stack-no-clear 'vector))
@ -114,7 +114,7 @@
(set! (-> s3-0 quad) (-> arg1 pos quad))
(set! (-> s3-0 y) 0.0)
(vector-normalize! s3-0 1.0)
(set! (-> s3-0 y) (+ 0.1 (-> s3-0 y)))
(+! (-> s3-0 y) 0.1)
(vector-normalize! s3-0 1.0)
(let ((s5-0 (new 'stack-no-clear 'vector4)))
(let* ((f0-4 (vector-dot (-> s4-0 sun0-normal) s3-0))
@ -141,6 +141,7 @@
(defmethod ocean-method-60 ocean ((obj ocean) (arg0 dma-buffer))
(local-vars (sv-48 float) (sv-52 vector) (sv-56 vector))
;; og:preserve-this scratchpad
(let ((vertices (scratchpad-object (inline-array ocean-vertex))))
(let ((f0-0 (-> obj start-corner z)))
(let ((f1-1 (+ -5898240.0 f0-0)))
@ -240,6 +241,7 @@
(defmethod ocean-method-61 ocean ((obj ocean) (arg0 dma-buffer))
(local-vars (sv-48 float) (sv-52 vector) (sv-56 vector))
;; og:preserve-this scratchpad
(let ((vertices (scratchpad-object (inline-array ocean-vertex))))
(let* ((f0-1 (+ 18874368.0 (-> obj start-corner z)))
(f1-2 (+ 5898240.0 f0-1))
@ -339,6 +341,7 @@
(defmethod ocean-method-62 ocean ((obj ocean) (arg0 dma-buffer))
(local-vars (sv-48 float) (sv-52 vector) (sv-56 vector))
;; og:preserve-this scratchpad
(let ((vertices (scratchpad-object (inline-array ocean-vertex))))
(let* ((f0-0 (-> obj start-corner x))
(f1-1 (+ -5898240.0 f0-0))
@ -438,6 +441,7 @@
(defmethod ocean-method-63 ocean ((obj ocean) (arg0 dma-buffer))
(local-vars (sv-48 float) (sv-52 vector) (sv-56 vector))
;; og:preserve-this scratchpad
(let ((vertices (scratchpad-object (inline-array ocean-vertex))))
(let ((f0-1 (+ 18874368.0 (-> obj start-corner x))))
(let ((f1-2 (+ 5898240.0 f0-1)))
@ -536,6 +540,7 @@
)
(defmethod ocean-method-64 ocean ((obj ocean) (arg0 dma-buffer))
;; og:preserve-this scratchpad
(let ((vertices (scratchpad-object (inline-array ocean-vertex))))
(let* ((v1-1 (-> obj ocean-colors))
(f30-0 (-> obj start-corner x))
@ -644,6 +649,7 @@
)
(defmethod ocean-method-65 ocean ((obj ocean) (arg0 dma-buffer))
;; og:preserve-this scratchpad
(let ((vertices (scratchpad-object (inline-array ocean-vertex))))
(let* ((v1-1 (-> obj ocean-colors))
(f30-0 (+ 18874368.0 (-> obj start-corner x)))
@ -752,6 +758,7 @@
)
(defmethod ocean-method-66 ocean ((obj ocean) (arg0 dma-buffer))
;; og:preserve-this scratchpad
(let ((vertices (scratchpad-object (inline-array ocean-vertex))))
(let* ((v1-1 (-> obj ocean-colors))
(f30-0 (-> obj start-corner x))
@ -854,6 +861,7 @@
)
(defmethod ocean-method-67 ocean ((obj ocean) (arg0 dma-buffer))
;; og:preserve-this scratchpad
(let ((vertices (scratchpad-object (inline-array ocean-vertex))))
(let* ((v1-1 (-> obj ocean-colors))
(f30-0 (+ 18874368.0 (-> obj start-corner x)))
@ -956,6 +964,7 @@
)
(defmethod render-ocean-far ocean ((obj ocean) (arg1 dma-buffer) (facing int))
;; og:preserve-this scratchpad
(let ((vertices (scratchpad-object (inline-array ocean-vertex))))
(let ((f0-0 (-> obj start-corner y)))
(set! (-> vertices 0 pos y) f0-0)
@ -1035,6 +1044,7 @@
(none)
)
;; WARN: Return type mismatch pointer vs none.
(defmethod init-buffer! ocean ((obj ocean) (arg0 dma-buffer))
"Initialize [[ocean]] DMA buffer."
(dma-buffer-add-gs-set arg0
@ -1089,140 +1099,138 @@
)
(defmethod update-map ocean ((obj ocean))
(with-pp
(set! (-> obj heights) #f)
(set! (-> obj verts) #f)
(let ((s5-0 *mood-control*))
(set! (-> obj constant w) (if (and (-> s5-0 overide-weather-flag) (not (movie?)))
(-> s5-0 overide cloud)
(-> s5-0 current-interp cloud)
)
)
(set! (-> obj heights) #f)
(set! (-> obj verts) #f)
(let ((s5-0 *mood-control*))
(set! (-> obj constant w) (if (and (-> s5-0 overide-weather-flag) (not (movie?)))
(-> s5-0 overide cloud)
(-> s5-0 current-interp cloud)
)
)
)
(set! (-> obj constant w) (fmin 1.0 (* 2.0 (-> obj constant w))))
(let ((f0-5 1.0)
(f30-0 1.0)
)
(when (= (-> *bigmap* bigmap-index) 13)
(set! f0-5 0.333)
(set! f30-0 0.75)
)
(set! (-> obj constant w) (fmin 1.0 (* 2.0 (-> obj constant w))))
(let ((f0-5 1.0)
(f30-0 1.0)
)
(when (= (-> *bigmap* bigmap-index) 13)
(set! f0-5 0.333)
(set! f30-0 0.75)
(set! (-> obj frame-speed) (* (+ 4.0 (-> *setting-control* user-current rain)) f0-5))
(set! (-> obj frame-speed2) (* (+ 5.0 (-> *setting-control* user-current rain)) f0-5))
(when (not (paused?))
(let ((f0-8 (+ (-> obj frame-num) (* (-> obj frame-speed) (seconds-per-frame)))))
(set! (-> obj frame-num) (- f0-8 (* (the float (the int (/ f0-8 64.0))) 64.0)))
)
(set! (-> obj frame-speed) (* (+ 4.0 (-> *setting-control* user-current rain)) f0-5))
(set! (-> obj frame-speed2) (* (+ 5.0 (-> *setting-control* user-current rain)) f0-5))
(when (not (paused?))
(let ((f0-8 (+ (-> obj frame-num) (* (-> obj frame-speed) (-> pp clock seconds-per-frame)))))
(set! (-> obj frame-num) (- f0-8 (* (the float (the int (/ f0-8 64.0))) 64.0)))
)
(let ((f0-11 (+ (-> obj frame-num2) (* (-> obj frame-speed2) (-> pp clock seconds-per-frame)))))
(set! (-> obj frame-num2) (- f0-11 (* (the float (the int (/ f0-11 64.0))) 64.0)))
)
)
(let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf)))
(set! (-> obj heights) (the-as ocean-height-array (-> s5-1 base)))
(interp-wave obj (the-as ocean-wave-info (-> obj heights)) (the-as uint (-> obj frame-num)) (* 0.08325 f30-0))
(&+! (-> s5-1 base) 4096)
(set! (-> obj heights2) (the-as ocean-height-array (-> s5-1 base)))
(interp-wave
obj
(the-as ocean-wave-info (-> obj heights2))
(the-as uint (-> obj frame-num2))
(* 0.01665 f30-0)
)
(&+! (-> s5-1 base) 4096)
(ocean-method-15 obj (the-as matrix (-> obj heights)) (the-as matrix (-> obj heights2)))
(set! (-> obj verts) (the-as ocean-vert-array (-> s5-1 base)))
(&+! (-> s5-1 base) #x8000)
(let ((f0-11 (+ (-> obj frame-num2) (* (-> obj frame-speed2) (seconds-per-frame)))))
(set! (-> obj frame-num2) (- f0-11 (* (the float (the int (/ f0-11 64.0))) 64.0)))
)
)
(when (not (or (-> obj off) (-> *blit-displays-work* menu-mode)))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask ocean))
(mem-copy! (the-as pointer (-> obj cloud-lights)) (the-as pointer (-> *sky-work* cloud-lights)) 156)
(mem-copy! (the-as pointer (-> obj haze-lights)) (the-as pointer (-> *sky-work* haze-lights)) 124)
(vector4-scale!
(the-as vector4 (-> obj sky-color))
(the-as vector4 (-> *time-of-day-context* current-sky-color))
0.0078125
)
(generate-verts obj (-> obj verts) (-> obj heights))
(let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s5-2 (-> s4-0 base))
)
(let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf)))
(set! (-> obj heights) (the-as ocean-height-array (-> s5-1 base)))
(interp-wave obj (the-as ocean-wave-info (-> obj heights)) (the-as uint (-> obj frame-num)) (* 0.08325 f30-0))
(&+! (-> s5-1 base) 4096)
(set! (-> obj heights2) (the-as ocean-height-array (-> s5-1 base)))
(interp-wave
obj
(the-as ocean-wave-info (-> obj heights2))
(the-as uint (-> obj frame-num2))
(* 0.01665 f30-0)
)
(&+! (-> s5-1 base) 4096)
(ocean-method-15 obj (the-as matrix (-> obj heights)) (the-as matrix (-> obj heights2)))
(set! (-> obj verts) (the-as ocean-vert-array (-> s5-1 base)))
(&+! (-> s5-1 base) #x8000)
)
)
(when (not (or (-> obj off) (-> *blit-displays-work* menu-mode)))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask ocean))
(mem-copy! (the-as pointer (-> obj cloud-lights)) (the-as pointer (-> *sky-work* cloud-lights)) 156)
(mem-copy! (the-as pointer (-> obj haze-lights)) (the-as pointer (-> *sky-work* haze-lights)) 124)
(vector4-scale!
(the-as vector4 (-> obj sky-color))
(the-as vector4 (-> *time-of-day-context* current-sky-color))
0.0078125
)
(generate-verts obj (-> obj verts) (-> obj heights))
(let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s5-2 (-> s4-0 base))
)
;; TODO handle ocean::79 and ocean::89
;; diasble tod ocean stuff
;; (if (-> *time-of-day-context* sky)
;; (ocean-method-89 obj s4-0)
;; )
(draw-ocean-texture obj s4-0 (the-as int (-> obj verts)))
(draw-ocean-texture obj s4-0 (the-as int (-> obj verts)))
;; disable whatever this is
;; (ocean-method-79 obj s4-0)
(init-buffer! obj s4-0)
(if (-> obj far-on)
(draw-ocean-far obj s4-0)
)
(if (not (-> obj mid-off))
(draw-ocean-mid obj s4-0)
)
(end-buffer! obj s4-0)
(set-dirty-mask! (-> *level* default-level) 9 #xc0000 #x2a000)
(let ((a3-3 (-> s4-0 base)))
(let ((v1-87 (the-as object (-> s4-0 base))))
(set! (-> (the-as dma-packet v1-87) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-87) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-87) vif1) (new 'static 'vif-tag))
(set! (-> s4-0 base) (&+ (the-as pointer v1-87) 16))
(init-buffer! obj s4-0)
(if (-> obj far-on)
(draw-ocean-far obj s4-0)
)
(if (not (-> obj mid-off))
(draw-ocean-mid obj s4-0)
)
(end-buffer! obj s4-0)
(set-dirty-mask! (-> *level* default-level) 9 #xc0000 #x2a000)
(let ((a3-3 (-> s4-0 base)))
(let ((v1-87 (the-as object (-> s4-0 base))))
(set! (-> (the-as dma-packet v1-87) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-87) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-87) vif1) (new 'static 'vif-tag))
(set! (-> s4-0 base) (&+ (the-as pointer v1-87) 16))
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id ocean-mid-far)
s5-2
(the-as (pointer dma-tag) a3-3)
)
)
)
(when (not (or (-> obj near-off)
(or (-> obj mid-off) (< 196608.0 (fabs (- (-> obj start-corner y) (-> *math-camera* trans y)))))
)
)
(let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s5-3 (-> s4-1 base))
)
(draw-ocean-texture obj s4-1 (the-as int (-> obj verts)))
(draw-ocean-near obj s4-1)
(end-buffer! obj s4-1)
(set-dirty-mask! (-> *level* default-level) 7 #xc0000 #x2a000)
(let ((a3-5 (-> s4-1 base)))
(let ((v1-113 (the-as object (-> s4-1 base))))
(set! (-> (the-as dma-packet v1-113) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-113) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-113) vif1) (new 'static 'vif-tag))
(set! (-> s4-1 base) (&+ (the-as pointer v1-113) 16))
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id ocean-mid-far)
s5-2
(the-as (pointer dma-tag) a3-3)
)
)
)
(when (not (or (-> obj near-off)
(or (-> obj mid-off) (< 196608.0 (fabs (- (-> obj start-corner y) (-> *math-camera* trans y)))))
)
)
(let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s5-3 (-> s4-1 base))
)
(draw-ocean-texture obj s4-1 (the-as int (-> obj verts)))
(draw-ocean-near obj s4-1)
(end-buffer! obj s4-1)
(set-dirty-mask! (-> *level* default-level) 7 #xc0000 #x2a000)
(let ((a3-5 (-> s4-1 base)))
(let ((v1-113 (the-as object (-> s4-1 base))))
(set! (-> (the-as dma-packet v1-113) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-113) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-113) vif1) (new 'static 'vif-tag))
(set! (-> s4-1 base) (&+ (the-as pointer v1-113) 16))
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id ocean-near)
s5-3
(the-as (pointer dma-tag) a3-5)
)
(bucket-id ocean-near)
s5-3
(the-as (pointer dma-tag) a3-5)
)
)
)
)
)
(when (not (paused?))
(set! (-> obj off) #f)
(set! (-> obj mid-off) #f)
(set! (-> obj near-off) (if obj
(not (-> obj ocean-near-translucent?))
#f
)
)
)
0
(none)
)
(when (not (paused?))
(set! (-> obj off) #f)
(set! (-> obj mid-off) #f)
(set! (-> obj near-off) (if obj
(not (-> obj ocean-near-translucent?))
#f
)
)
)
0
(none)
)
;; PC Port hack
;; og:preserve-this PC Port hack
(define *ocean-generate-verts-vector* (new 'global 'vector))
(set-vector! *ocean-generate-verts-vector*

View File

@ -22,6 +22,37 @@
(define-extern particle-adgif (function adgif-shader texture-id none)) ;; TODO - particle-adgif atomic ops, MIPS2C
(define-extern sp-launch-particles-var (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none)) ;; TODO - mips2c
;; og:preserve-this added macro
;; TODO changing rate causes crashes at higher frame rates with certain particles, disabled for now
;; for future testing: at 165 fps, the blue gun particles should cause a crash
(defmacro launch-particles (&key (system *sp-particle-system-2d*)
particle
origin
&key (launch-state (the-as sparticle-launch-state #f))
&key (launch-control (the-as sparticle-launch-control #f))
&key (rate 1.0)
&key (origin-is-matrix #f))
(if origin-is-matrix
`(sp-launch-particles-var
,system
,particle
(the matrix ,origin)
,launch-state
,launch-control
,rate #|(if (= (get-video-mode) 'custom) (/ (-> *display* time-factor) 5.0) ,rate)|#)
`(begin
(vector-copy! (-> *launch-matrix* trans) (the vector ,origin))
(sp-launch-particles-var
,system
,particle
*launch-matrix*
,launch-state
,launch-control
,rate #|(if (= (get-video-mode) 'custom) (/ (-> *display* time-factor) 5.0) ,rate)|#)
)
)
)
;; DECOMP BEGINS
;; WARN: Return type mismatch int vs sparticle-launcher.
@ -95,7 +126,7 @@
0
)
;; this was rewritten from assembly
;; og:preserve-this this was rewritten from assembly
(defun sp-init-fields! ((arg0 (pointer float)) (arg1 (inline-array sp-field-init-spec)) (arg2 sp-field-id) (arg3 sp-field-id) (write-missing-fields symbol))
(1+! arg2)
(let ((cur-spec arg1))
@ -269,6 +300,7 @@
(let ((s4-0 (-> arg0 alpha))
(s3-0 (-> arg0 clamp))
)
;; og:preserve-this
; (.svf (&-> s5-0 0 quad) vf16)
; (.svf (&-> s5-0 1 quad) vf17)
; (.svf (&-> s5-0 2 quad) vf18)
@ -278,6 +310,7 @@
(set! (-> arg0 alpha) s4-0)
(set! (-> arg0 clamp) s3-0)
)
;; og:preserve-this
; (.lvf vf16 (&-> s5-0 0 quad))
; (.lvf vf17 (&-> s5-0 1 quad))
; (.lvf vf18 (&-> s5-0 2 quad))
@ -378,14 +411,14 @@
(cond
((< (-> s5-0 w) 0.0)
(.lvf vf1 (&-> arg0 conerot quad))
(.lvf vf2 (&-> s5-0 vec quad))
(.lvf vf2 (&-> s5-0 quad))
(.sub.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> arg0 conerot quad) vf1)
(.mov v1-1 vf1)
)
(else
(.lvf vf1 (&-> arg0 conerot quad))
(.lvf vf2 (&-> s5-0 vec quad))
(.lvf vf2 (&-> s5-0 quad))
(.add.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> arg0 conerot quad) vf1)
(.mov v1-2 vf1)
@ -502,12 +535,12 @@
)
(set! (-> s5-0 vector 1 y) 0.0)
(set! (-> s5-0 vector 1 z) (the float (sar (shl (the int (-> s5-0 vector 1 z)) 48) 48)))
(.lvf vf4 (&-> s5-0 vector 2 quad))
(.lvf vf5 (&-> s5-0 vector 0 quad))
(.lvf vf4 (&-> s5-0 quad 2))
(.lvf vf5 (&-> s5-0 quad 0))
(.min.x.vf vf4 vf4 vf31 :mask #b111)
(.add.vf vf5 vf5 vf30 :mask #b111)
(.svf (&-> s5-0 vector 2 quad) vf4)
(.svf (&-> s5-0 vector 0 quad) vf5)
(.svf (&-> s5-0 quad 2) vf4)
(.svf (&-> s5-0 quad 0) vf5)
(when (not *death-adgif*)
(set! *death-adgif* (new 'static 'adgif-shader))
(particle-adgif *death-adgif* (new 'static 'texture-id :index #xc9 :page #xc))
@ -530,19 +563,19 @@
)
(set! (-> gp-0 clock-index) (the-as uint 8))
(.lvf vf4 (&-> (-> *time-of-day-context* current-prt-color) quad))
(.lvf vf5 (&-> s5-0 vector 2 quad))
(.lvf vf5 (&-> s5-0 quad 2))
(.lvf vf6 (&-> gp-0 fade quad))
(.mul.vf vf5 vf5 vf4 :mask #b111)
(.mul.vf vf6 vf6 vf4 :mask #b111)
(.svf (&-> s5-0 vector 2 quad) vf5)
(.svf (&-> s5-0 quad 2) vf5)
(.svf (&-> gp-0 fade quad) vf6)
(.mov v1-26 vf6)
(set! (-> gp-0 key) (the-as sparticle-launch-control 0))
(set! (-> gp-0 binding) #f)
(let ((v1-27 (-> gp-0 sprite)))
(.lvf vf1 (&-> s5-0 vector 0 quad))
(.lvf vf2 (&-> s5-0 vector 1 quad))
(.lvf vf3 (&-> s5-0 vector 2 quad))
(.lvf vf1 (&-> s5-0 quad 0))
(.lvf vf2 (&-> s5-0 quad 1))
(.lvf vf3 (&-> s5-0 quad 2))
(.svf (&-> v1-27 x-y-z-sx quad) vf1)
(.svf (&-> v1-27 flag-rot-sy quad) vf2)
(.sub.w.vf vf3 vf0 vf0 :mask #b1000)
@ -565,14 +598,7 @@
(dotimes (s4-0 (-> gp-0 in-use))
(let ((v1-4 (-> gp-0 queue s4-0)))
(set! (-> s5-0 trans quad) (-> v1-4 pos quad))
(sp-launch-particles-var
(-> v1-4 sp-system)
(-> v1-4 sp-launcher)
s5-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles :system (-> v1-4 sp-system) (-> v1-4 sp-launcher) s5-0 :origin-is-matrix #t)
)
)
(set! (-> gp-0 in-use) 0)
@ -900,6 +926,7 @@
)
(add-debug-matrix *display-sprite-marks* (bucket-id debug2) (-> obj origin) (meters 2))
)
;; og:preserve-this
;; can we see it?
(#if (not PC_PORT)
(sphere-in-view-frustum? (the-as sphere s5-1))
@ -918,14 +945,14 @@
(defmethod spawn-with-matrix sparticle-launch-control ((obj sparticle-launch-control) (arg0 matrix))
(let* ((a2-0 (-> obj origin))
(a3-0 arg0)
(v1-0 (-> a3-0 vector 0 quad))
(a0-1 (-> a3-0 vector 1 quad))
(a1-1 (-> a3-0 vector 2 quad))
(v1-0 (-> a3-0 quad 0))
(a0-1 (-> a3-0 quad 1))
(a1-1 (-> a3-0 quad 2))
(a3-1 (-> a3-0 trans quad))
)
(set! (-> a2-0 vector 0 quad) v1-0)
(set! (-> a2-0 vector 1 quad) a0-1)
(set! (-> a2-0 vector 2 quad) a1-1)
(set! (-> a2-0 quad 0) v1-0)
(set! (-> a2-0 quad 1) a0-1)
(set! (-> a2-0 quad 2) a1-1)
(set! (-> a2-0 trans quad) a3-1)
)
(let ((s4-0 (-> obj group)))
@ -964,14 +991,14 @@
(defmethod spawn-with-cspace sparticle-launch-control ((obj sparticle-launch-control) (arg0 cspace))
(let* ((v1-0 (-> obj origin))
(a3-0 (-> arg0 bone transform))
(a0-2 (-> a3-0 vector 0 quad))
(a1-1 (-> a3-0 vector 1 quad))
(a2-0 (-> a3-0 vector 2 quad))
(a0-2 (-> a3-0 quad 0))
(a1-1 (-> a3-0 quad 1))
(a2-0 (-> a3-0 quad 2))
(a3-1 (-> a3-0 trans quad))
)
(set! (-> v1-0 vector 0 quad) a0-2)
(set! (-> v1-0 vector 1 quad) a1-1)
(set! (-> v1-0 vector 2 quad) a2-0)
(set! (-> v1-0 quad 0) a0-2)
(set! (-> v1-0 quad 1) a1-1)
(set! (-> v1-0 quad 2) a2-0)
(set! (-> v1-0 trans quad) a3-1)
)
(let ((s4-0 (-> obj group)))
@ -1043,7 +1070,7 @@
(set! f30-0 0.0)
)
;; if we have ps2 particles off, say we're at the camera
;; og:preserve-this if we have ps2 particles off, say we're at the camera
(with-pc
(if (not (-> *pc-settings* ps2-parts?))
(set! f30-0 0.0)))
@ -1158,16 +1185,17 @@
)
(cond
((logtest? (-> v1-33 flags) (sp-group-item-flag bit7))
(sp-launch-particles-var
(if (logtest? (-> v1-33 flags) (sp-group-item-flag is-3d))
(launch-particles
:system (if (logtest? (-> v1-33 flags) (sp-group-item-flag is-3d))
*sp-particle-system-3d*
*sp-particle-system-2d*
)
a1-4
(-> obj origin)
a3-0
obj
f0-5
:launch-state a3-0
:launch-control obj
:rate f0-5
:origin-is-matrix #t
)
)
(else
@ -1241,14 +1269,7 @@
(set! (-> s2-0 quad) (-> (the-as vector s0-0) quad))
(set! (-> s2-0 w) 1.0)
(vector-matrix*! (-> s3-0 trans) s2-0 s3-0)
(sp-launch-particles-var
gp-0
sv-96
s3-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles :system gp-0 sv-96 s3-0 :origin-is-matrix #t)
)
)
)
@ -1351,14 +1372,14 @@
(cond
((< (-> gp-0 w) 0.0)
(.lvf vf1 (&-> arg2 qx-qy-qz-sy quad))
(.lvf vf2 (&-> gp-0 vec quad))
(.lvf vf2 (&-> gp-0 quad))
(.sub.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> arg2 qx-qy-qz-sy quad) vf1)
(.mov v1-1 vf1)
)
(else
(.lvf vf1 (&-> arg2 qx-qy-qz-sy quad))
(.lvf vf2 (&-> gp-0 vec quad))
(.lvf vf2 (&-> gp-0 quad))
(.add.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> arg2 qx-qy-qz-sy quad) vf1)
(.mov v1-2 vf1)
@ -1399,14 +1420,14 @@
(cond
((< (-> s4-0 w) 0.0)
(.lvf vf1 (&-> v1-4 qx-qy-qz-sy quad))
(.lvf vf2 (&-> s4-0 vec quad))
(.lvf vf2 (&-> s4-0 quad))
(.sub.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> v1-4 qx-qy-qz-sy quad) vf1)
(.mov v1-5 vf1)
)
(else
(.lvf vf1 (&-> v1-4 qx-qy-qz-sy quad))
(.lvf vf2 (&-> s4-0 vec quad))
(.lvf vf2 (&-> s4-0 quad))
(.add.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> v1-4 qx-qy-qz-sy quad) vf1)
(.mov v1-6 vf1)
@ -1462,14 +1483,14 @@
(cond
((< (-> s4-0 w) 0.0)
(.lvf vf1 (&-> v1-17 qx-qy-qz-sy quad))
(.lvf vf2 (&-> s4-0 vec quad))
(.lvf vf2 (&-> s4-0 quad))
(.sub.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> v1-17 qx-qy-qz-sy quad) vf1)
(.mov v1-18 vf1)
)
(else
(.lvf vf1 (&-> v1-17 qx-qy-qz-sy quad))
(.lvf vf2 (&-> s4-0 vec quad))
(.lvf vf2 (&-> s4-0 quad))
(.add.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> v1-17 qx-qy-qz-sy quad) vf1)
(.mov v1-19 vf1)
@ -1876,14 +1897,14 @@
(cond
((< (-> s5-1 w) 0.0)
(.lvf vf1 (&-> arg2 conerot quad))
(.lvf vf2 (&-> s5-1 vec quad))
(.lvf vf2 (&-> s5-1 quad))
(.sub.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> arg2 conerot quad) vf1)
(.mov v1-0 vf1)
)
(else
(.lvf vf1 (&-> arg2 conerot quad))
(.lvf vf2 (&-> s5-1 vec quad))
(.lvf vf2 (&-> s5-1 quad))
(.add.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> arg2 conerot quad) vf1)
(.mov v1-1 vf1)
@ -1910,14 +1931,14 @@
(cond
((< (-> v1-0 w) 0.0)
(.lvf vf1 (&-> a0-1 conerot quad))
(.lvf vf2 (&-> v1-0 vec quad))
(.lvf vf2 (&-> v1-0 quad))
(.sub.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> a0-1 conerot quad) vf1)
(.mov a0-2 vf1)
)
(else
(.lvf vf1 (&-> a0-1 conerot quad))
(.lvf vf2 (&-> v1-0 vec quad))
(.lvf vf2 (&-> v1-0 quad))
(.add.vf vf1 vf0 vf2 :mask #b111)
(.svf (&-> a0-1 conerot quad) vf1)
(.mov a0-3 vf1)

View File

@ -51,7 +51,7 @@
(t0-1 (/ (-> v1-4 w) 2))
(a3-1 (/ (-> v1-4 h) 2))
)
;; modified
;; og:preserve-this modified
;(upload-vram-data dma-buf (the-as int (-> v1-4 dest 0)) (the-as pointer (-> v1-4 pad 0)) a3-1 t0-1)
(pc-texture-anim-flag upload-generic-vram dma-buf :qwc 1)
(let ((upload-record (the texture-anim-pc-upload (-> dma-buf base))))
@ -65,7 +65,8 @@
(&+! (-> dma-buf base) 16)
)
;(dma-buffer-add-gs-set dma-buf (texflush 0)) don't need
;; og:preserve-this don't need
;(dma-buffer-add-gs-set dma-buf (texflush 0))
(texture-anim-layer-add-shader dma-buf layer 1)
(texture-anim-layer-draw dma-buf width height layer)
)
@ -74,21 +75,19 @@
)
(defun cloud-texture-anim-func ((arg0 dma-buffer) (arg1 texture-anim))
(with-pp
(when (>= (+ (-> arg1 frame-time) (* (-> arg1 frame-delta) (-> pp clock seconds-per-frame))) (-> arg1 frame-mod))
(let ((s5-0 (-> arg1 data 0 tex))
(s4-0 (-> arg1 data 1 tex))
(s3-0 (-> arg1 data 0 tex w))
)
(when (not (paused?))
(set! (-> arg1 data 0 tex) s4-0)
(set! (-> arg1 data 1 tex) s5-0)
(make-noise-texture (the-as pointer (-> s5-0 pad 0)) s3-0 s3-0 s3-0)
(when (>= (+ (-> arg1 frame-time) (* (-> arg1 frame-delta) (seconds-per-frame))) (-> arg1 frame-mod))
(let ((s5-0 (-> arg1 data 0 tex))
(s4-0 (-> arg1 data 1 tex))
(s3-0 (-> arg1 data 0 tex w))
)
(when (not (paused?))
(set! (-> arg1 data 0 tex) s4-0)
(set! (-> arg1 data 1 tex) s5-0)
(make-noise-texture (the-as pointer (-> s5-0 pad 0)) s3-0 s3-0 s3-0)
)
)
0
)
0
)
(defun fog-texture-anim-init ((arg0 texture-anim))
@ -210,7 +209,7 @@
)
)
(let ((s5-1 (-> arg1 tex)))
;; og:preserve-this
;; they use bitbltbuf directly to upload in the format of the data, rather than
;; the usual PSM32 trick
; (dma-buffer-add-gs-set arg0
@ -248,7 +247,7 @@
(&+! (-> arg0 base) 16)
(set! (-> *texture-pool* ids (shr (-> s5-1 clutdest) 6)) (the-as uint 0))
;; just a texflush.
;; og:preserve-this just a texflush.
; (let* ((v1-29 arg0)
; (a0-51 (the-as object (-> v1-29 base)))
; )

View File

@ -7,6 +7,7 @@
;; DECOMP BEGINS
;; og:preserve-this
;; The "texture animation" system modifies a texture according to a series of layers.
(define *texture-anim-work*
@ -166,6 +167,7 @@
)
)
;; og:preserve-this
(defenum texture-anim-pc
(start-anim-array 12)
(finish-anim-array 13)
@ -243,6 +245,7 @@
"Add DMA to set the GS to use the given shader. This can be used to read from the texture."
(let ((s5-0 (-> arg1 tex)))
(when s5-0
;; og:preserve-this
(pc-texture-anim-flag set-shader arg0)
(dma-buffer-add-gs-set arg0
(tex0-1 (new 'static 'gs-tex0
@ -271,6 +274,7 @@
"Add DMA to set the GS to use the clut as a ct32 texture. This is used to abuse the GS to blend cluts by pretending they are ct32's."
(let ((a1-1 (-> arg1 tex)))
(when a1-1
;; og:preserve-this
(pc-texture-anim-flag set-shader arg0)
(dma-buffer-add-gs-set arg0
(tex0-1 (new 'static 'gs-tex0 :tbw #x1 :tw #x4 :th #x4 :tcc arg2 :tbp0 (-> a1-1 clutdest)))
@ -290,7 +294,8 @@
Always draws a tristrip with two triangles.
"
(local-vars (v1-27 float) (sv-224 matrix) (sv-228 matrix) (sv-232 matrix) (sv-236 matrix))
(pc-texture-anim-flag draw dma-buf) ;; added
;; og:preserve-this added
(pc-texture-anim-flag draw dma-buf)
(rlet ((acc :class vf)
(vf0 :class vf)
@ -432,6 +437,7 @@
(texture-anim-layer-draw dma-buf 16 16 layer)
)
)
;; og:preserve-this
(format 0 "after blend-clut-texture-anim-layer-func ~X~%" (-> dma-buf base))
0
@ -440,7 +446,7 @@
(defun move-rg-to-ba-texture-anim-layer-func ((dma-buf dma-buffer) (fbp-to-draw uint) (width int) (height int) (layer texture-anim-layer) (time float))
"Some cursed texture drawing."
;; HACK added:
;; og:preserve-this HACK added:
(pc-texture-anim-flag move-rg-to-ba dma-buf :qwc 1)
(let ((transform (the texture-anim-pc-texture-transform (-> dma-buf base))))
(set! (-> transform src-tbp) (-> layer tex dest 0))
@ -450,7 +456,7 @@
)
(&+! (-> dma-buf base) 16)
(return 0)
;; end added
;; og:preserve-this end added
(-> layer tex)
(let ((tw (log2 (* width 2)))
@ -499,7 +505,7 @@
)
)
;; manually done from the stuff below.
;; og:preserve-this manually done from the stuff below.
(dma-buffer-add-gs-set-flusha dma-buf
(xyoffset-1 (new 'static 'gs-xy-offset :ofx #x7000 :ofy #x7300))
(frame-1 (new 'static 'gs-frame :fbw (/ (+ width 63) 64) :fbp fbp-to-draw))
@ -540,6 +546,7 @@
(vf2 :class vf)
)
(let ((s5-0 (/ (+ width 63) 64)))
;; og:preserve-this
;; set frame to mask alpha
(dma-buffer-add-gs-set-flusha dma-buf
(frame-1 (new 'static 'gs-frame :fbmsk #xff000000 :fbw s5-0 :fbp fbp-to-draw))
@ -565,6 +572,7 @@
(set-vector! (the-as vector4w (&+ v1-4 64)) (* a0-8 16) (* a1-15 16) 0 0)
)
(&+! (-> dma-buf base) 80)
;; og:preserve-this
;; reset frame.
(dma-buffer-add-gs-set-flusha dma-buf
(frame-1 (new 'static 'gs-frame :fbw s5-0 :fbp fbp-to-draw))
@ -597,6 +605,7 @@
)
)
;; og:preserve-this
(define-extern *sky-texture-anim-array* (texture-anim-array texture-anim))
(#when PC_PORT
(define-extern *sky-hires-texture-anim-array* (texture-anim-array texture-anim)))
@ -624,7 +633,7 @@
(defun pc-update-anim-frame-time ((anim texture-anim))
(when (not (paused?))
(with-pp
(let ((f0-2 (+ (-> anim frame-time) (* (-> anim frame-delta) (-> pp clock seconds-per-frame))))
(let ((f0-2 (+ (-> anim frame-time) (* (-> anim frame-delta) (seconds-per-frame))))
(f1-2 (-> anim frame-mod))
)
(set! (-> anim frame-time) (- f0-2 (* (the float (the int (/ f0-2 f1-2))) f1-2)))
@ -636,6 +645,7 @@
)
)
;; og:preserve-this
(defun pc-update-fixed-anim ((bucket bucket-id) (anim-id texture-anim-pc) (anim-array texture-anim-array))
"Run a 'fixed' texture-anim, which should run entirely in C++."
(with-dma-buffer-add-bucket ((dma-buf (-> *display* frames (-> *display* on-screen) global-buf))
@ -790,6 +800,7 @@ struct SlimeInput {
)
((= anim-array *sky-texture-anim-array*)
(when (= bucket (bucket-id tex-lcom-sky-post))
;; og:preserve-this
;; skip. I believe this is only used to generate the envmap texture for the ocean.
;; it generates the exact same thing, so if we want this on PC one day, we can just
;; steal if from the beginning of the frame.
@ -993,7 +1004,6 @@ struct SlimeInput {
;; (return #f)
;;
(local-vars (tex-height int) (fbp-for-tex uint) (layer-idx int))
(with-pp
(if (-> *blit-displays-work* menu-mode)
(return #f)
)
@ -1003,6 +1013,7 @@ struct SlimeInput {
(with-dma-buffer-add-bucket ((dma-buf (-> *display* frames (-> *display* on-screen) global-buf))
bucket
)
;; og:preserve-this
;; added: flag for the PC port to indicate start of texture anim data:
(pc-texture-anim-flag start-anim-array dma-buf)
@ -1102,7 +1113,7 @@ struct SlimeInput {
;; advance animation.
(when (not (paused?))
(let ((f0-2 (+ (-> anim frame-time) (* (-> anim frame-delta) (-> pp clock seconds-per-frame))))
(let ((f0-2 (+ (-> anim frame-time) (* (-> anim frame-delta) (seconds-per-frame))))
(f1-2 (-> anim frame-mod))
)
(set! (-> anim frame-time) (- f0-2 (* (the float (the int (/ f0-2 f1-2))) f1-2)))
@ -1131,7 +1142,6 @@ struct SlimeInput {
(none)
)
)
)
(defun no-alpha-texture-anim-layer-func ((dma-buf dma-buffer) (fbp-to-draw uint) (width int) (height int) (layer texture-anim-layer) (time float))
"Like others, but the tcc value is 0"
@ -1620,8 +1630,6 @@ struct SlimeInput {
(none)
)
;; definition for function texture-anim-slime-clut-upload
;; WARN: Return type mismatch int vs none.
(defun texture-anim-slime-clut-upload ((arg0 dma-buffer) (arg1 texture-anim))
(when (-> arg1 tex)
(make-slime-clut (the-as (pointer uint32) (-> arg1 tex pad 0)))
@ -1632,8 +1640,6 @@ struct SlimeInput {
(none)
)
;; definition for function texture-anim-slime-clut-init
;; WARN: Return type mismatch int vs none.
(defun texture-anim-slime-clut-init ((arg0 texture-anim))
(let ((s5-0 (new 'loading-level 'texture))
(s4-0 (the int (-> arg0 extra x)))
@ -1647,7 +1653,6 @@ struct SlimeInput {
(none)
)
;; definition for function make-ramp-clut
;; WARN: Return type mismatch symbol vs none.
(defun make-ramp-clut ((arg0 (pointer uint32)) (arg1 pointer) (arg2 object))
(dotimes (v1-0 256)
@ -1693,7 +1698,7 @@ struct SlimeInput {
((128)
(set! s4-0 (new 'loading-level 'noise128x128))
)
;; pc port note : added these two cases
;; og:preserve-this added these two cases
((256)
(set! s4-0 (new 'loading-level 'noise256x256))
)
@ -1730,6 +1735,7 @@ struct SlimeInput {
(defun texture-anim-alpha-ramp-clut-upload ((arg0 dma-buffer) (arg1 texture-anim))
(when (-> arg1 tex)
;; og:preserve-this
;(upload-vram-data arg0 (the-as int (-> arg1 tex clutdest)) (the-as pointer (-> arg1 tex pad 0)) 16 16)
(pc-texture-anim-flag upload-clut-16-16 arg0 :qwc 1)
@ -1831,7 +1837,6 @@ struct SlimeInput {
obj
)
;; definition for method 10 of type texture-anim-array
(defmethod clear! texture-anim-array ((obj texture-anim-array))
(dotimes (s5-0 (-> obj length))
(clear-textures! (-> obj array-data s5-0))
@ -1839,6 +1844,7 @@ struct SlimeInput {
obj
)
;; og:preserve-this added macro
(defmacro assert-symbol-is-function (sym)
`(begin
(let ((sym-val (-> (the symbol ,sym) value)))
@ -1863,7 +1869,8 @@ struct SlimeInput {
(set! (-> obj func) (the-as (function dma-buffer texture-anim int) (-> (the-as symbol (-> obj func)) value)))
)
(when (logtest? (the-as int (-> obj init-func)) 1)
(assert-symbol-is-function (-> obj init-func)) ;; added
;; og:preserve-this added
(assert-symbol-is-function (-> obj init-func))
(set! (-> obj init-func) (the-as (function texture-anim int) (-> (the-as symbol (-> obj init-func)) value)))
(if (-> obj init-func)
((-> obj init-func) obj)
@ -1935,7 +1942,6 @@ struct SlimeInput {
obj
)
;; definition for method 10 of type texture-anim
(defmethod clear-textures! texture-anim ((obj texture-anim))
(set! (-> obj tex) #f)
(dotimes (s5-0 (the-as int (-> obj num-layers)))
@ -1944,10 +1950,10 @@ struct SlimeInput {
obj
)
;; definition for method 9 of type texture-anim-layer
(defmethod initialize-texture! texture-anim-layer ((obj texture-anim-layer))
(when (logtest? (the-as int (-> obj func)) 1)
(assert-symbol-is-function (-> obj func)) ;; added
;; og:preserve-this added
(assert-symbol-is-function (-> obj func))
(set! (-> obj func) (the-as
(function dma-buffer uint int int texture-anim-layer float int)
(-> (the-as symbol (-> obj func)) value)
@ -1955,7 +1961,8 @@ struct SlimeInput {
)
)
(when (logtest? (the-as int (-> obj init-func)) 1)
(assert-symbol-is-function (-> obj init-func)) ;; added
;; og:preserve-this added
(assert-symbol-is-function (-> obj init-func))
(set! (-> obj init-func)
(the-as (function texture-anim-layer int) (-> (the-as symbol (-> obj init-func)) value))
)
@ -1971,7 +1978,6 @@ struct SlimeInput {
obj
)
;; definition for method 10 of type texture-anim-layer
(defmethod clear-texture! texture-anim-layer ((obj texture-anim-layer))
(set! (-> obj tex) #f)
obj

View File

@ -58,6 +58,7 @@ are needed or not, and skip segments if needed.
additionally, some texture pages have a chunk system that allows more specific control.
|#
;; DECOMP BEGINS
(defmethod print texture-page ((obj texture-page))
"Print a texture page with name and size."
@ -87,7 +88,7 @@ additionally, some texture pages have a chunk system that allows more specific c
(set! (-> arg0 length) (max 83 (-> arg0 length)))
(set! (-> arg0 data 82 name) "texture")
(+! (-> arg0 data 82 count) (-> obj length))
;; note: in jak 1 this + was a - for reasons I do not understand.
;; og:preserve-this note: in jak 1 this + was a - for reasons I do not understand.
(let ((v1-7 (+ (asize-of obj) (* (-> obj dram-size) 4))))
;; also add the size of the texture objects.
(dotimes (a0-6 (-> obj length))
@ -578,6 +579,7 @@ additionally, some texture pages have a chunk system that allows more specific c
(when tex
(dotimes (mask-idx 3)
(dotimes (mask-word 3)
;; og:preserve-this
(set! (-> tex masks data mask-idx mask data mask-word) 0)
;(set! (-> (the-as texture (+ (+ (* mask-idx 16) (* mask-word 4)) (the-as int tex))) masks data 0 mask x) 0)
)
@ -630,6 +632,7 @@ additionally, some texture pages have a chunk system that allows more specific c
(when tex
(dotimes (mask-idx 3)
(dotimes (mask-word 3)
;; og:preserve-this
(set! (-> tex masks data mask-idx mask data mask-word) 0)
;(set! (-> (the-as texture (+ (+ (* mask-idx 16) (* mask-word 4)) (the-as int tex))) masks data 0 mask x) 0)
)
@ -661,6 +664,7 @@ additionally, some texture pages have a chunk system that allows more specific c
;; this assumes that the common-segment starts at 0.
(let ((vram-loc 0))
;; og:preserve-this constant
;; loop over all active levels
(countdown (level-idx LEVEL_TOTAL)
(let ((lev (-> *level* level level-idx)))
@ -700,6 +704,7 @@ additionally, some texture pages have a chunk system that allows more specific c
"Lay out hud/map textures from all levels so all can fit into
VRAM at the same time."
(let ((level-idx 0))
;; og:preserve-this constant
(countdown (vram-loc LEVEL_TOTAL)
(let ((lev (-> *level* level vram-loc)))
(when (or (= (-> lev status) 'active)
@ -742,6 +747,7 @@ additionally, some texture pages have a chunk system that allows more specific c
;; again, assume that common-segment starts at 0
(let ((vram-loc 0))
;; og:preserve-this constant
;; iterate over active levels
(countdown (level-idx LEVEL_TOTAL)
(let ((lev (-> *level* level level-idx)))
@ -1073,6 +1079,7 @@ additionally, some texture pages have a chunk system that allows more specific c
(+! num-chunks chunks-pending)
)
;; og:preserve-this
;; add a texflush.
(dma-buffer-add-gs-set dma-buf (texflush 1))
@ -1154,7 +1161,7 @@ additionally, some texture pages have a chunk system that allows more specific c
0
)
;; og:preserve-this pc port function
(defun upload-vram-pages-pris-pc ((pool texture-pool)
(dest-seg texture-pool-segment)
(tpage texture-page)
@ -1569,6 +1576,7 @@ additionally, some texture pages have a chunk system that allows more specific c
(((tpage-category alpha))
;; alpha has some special cases
(cond
;; og:preserve-this constant
((= (-> lev index) LEVEL_MAX) ;; default level
;; if the auto-save-icon-flag is set, clear flag and upload next time.
(if (not (-> *bigmap* auto-save-icon-flag))
@ -1645,6 +1653,7 @@ additionally, some texture pages have a chunk system that allows more specific c
(((tpage-category map))
;; map doesn't use masks for the default level.
(cond
;; og:preserve-this constant
((= (-> lev index) LEVEL_MAX)
(set! (-> lev upload-size 8)
(upload-vram-pages pool (-> pool segment-common) tpage (tex-upload-mode seg0-1-2) bucket)
@ -1671,6 +1680,7 @@ additionally, some texture pages have a chunk system that allows more specific c
(let ((s2-0 (-> lev texture-anim-array cat)))
(cond
((= cat (tpage-category warp))
;; og:preserve-this constant
;; warps put all their update-texture-anim's with the default level:
(when (= (-> lev index) LEVEL_MAX)
(dotimes (s2-1 LEVEL_TOTAL)
@ -1690,8 +1700,8 @@ additionally, some texture pages have a chunk system that allows more specific c
;; hack for a certain level here...
(cond
((and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) info taskname) 'nest))
(let ((f30-0 (-> pp clock seconds-per-frame)))
(set! (-> pp clock seconds-per-frame) (* 10.0 (-> pp clock seconds-per-frame)))
(let ((f30-0 (seconds-per-frame)))
(set! (-> pp clock seconds-per-frame) (* 10.0 (seconds-per-frame)))
(if s2-0
(update-texture-anim bucket s2-0)
)
@ -1770,6 +1780,7 @@ additionally, some texture pages have a chunk system that allows more specific c
)
)
;; og:preserve-this constant
;; clear upload-size
(dotimes (lev-idx LEVEL_TOTAL)
(let ((lev (-> *level* level lev-idx)))
@ -1793,6 +1804,7 @@ additionally, some texture pages have a chunk system that allows more specific c
)
(when (and src-level (logtest? (-> *texture-pool* texture-enable-user) (-> tpage-info texture-user)))
(cond
;; og:preserve-this constant
((= (-> tpage-info level-index) LEVEL_MAX)
;; always upload default-level textures
(add-level-tpage-dma
@ -1818,6 +1830,7 @@ additionally, some texture pages have a chunk system that allows more specific c
)
)
;; og:preserve-this constant
;; reset masks and closest array for the next frame!
(dotimes (v1-16 LEVEL_TOTAL)
(let ((a0-30 (-> *level* level v1-16)))
@ -1849,6 +1862,7 @@ additionally, some texture pages have a chunk system that allows more specific c
"Send the given texture-page to VRAM right now. This function doesn't return until
it has happened, and only should be used during boot."
;; og:preserve-this
(#when PC_PORT
;; load it to the PC Port's texture pool.
(__pc-texture-upload-now obj arg0)
@ -1913,7 +1927,7 @@ additionally, some texture pages have a chunk system that allows more specific c
Will try to move the whole thing, including the clut, assuming you provide a destination for it.
Note that this uses the format/width stuff properly, so it will be slower, but won't scramble your texture."
;; og:preserve-this
(#when PC_PORT
;; as far as I know this is only used for fonts which have 1 mip level.
(__pc-texture-relocate (/ dest-loc 64) (-> tex dest 0) dest-fmt)
@ -2809,6 +2823,3 @@ additionally, some texture pages have a chunk system that allows more specific c
)
(define *texture-pool* (new 'global 'texture-pool))

View File

@ -41,31 +41,29 @@
The vel is a maximum velocity limit.
The frame count is the time constant (first order).
There's some logic to avoid rapidly changing directions"
(with-pp
(let* ((f0-0 (deg-diff (quaternion-y-angle (-> obj quat)) (vector-y-angle arg0)))
(f1-2 (fmin (* arg1 (-> pp clock seconds-per-frame)) (/ (* 5.0 (fabs f0-0)) (the float arg2))))
(f30-0 (fmax (fmin f0-0 f1-2) (- f1-2)))
)
(let ((f0-2 (-> obj old-y-angle-diff)))
(set! f30-0
(cond
((or (= f0-2 0.0)
(and (< 0.0 f30-0) (< 0.0 f0-2))
(or (and (< f30-0 0.0) (< f0-2 0.0)) (>= (- (current-time) (-> obj angle-change-time)) (seconds 0.2)))
)
(set! (-> obj angle-change-time) (current-time))
f30-0
)
(else
(* 0.000000001 f30-0)
)
(let* ((f0-0 (deg-diff (quaternion-y-angle (-> obj quat)) (vector-y-angle arg0)))
(f1-2 (fmin (* arg1 (seconds-per-frame)) (/ (* 5.0 (fabs f0-0)) (the float arg2))))
(f30-0 (fmax (fmin f0-0 f1-2) (- f1-2)))
)
(let ((f0-2 (-> obj old-y-angle-diff)))
(set! f30-0
(cond
((or (= f0-2 0.0)
(and (< 0.0 f30-0) (< 0.0 f0-2))
(or (and (< f30-0 0.0) (< f0-2 0.0)) (>= (- (current-time) (-> obj angle-change-time)) (seconds 0.2)))
)
(set! (-> obj angle-change-time) (current-time))
f30-0
)
(else
(* 0.000000001 f30-0)
)
)
)
(set! (-> obj old-y-angle-diff) f30-0)
(let ((a1-2 (get-quaternion obj)))
(quaternion-rotate-y! a1-2 a1-2 f30-0)
)
)
)
(set! (-> obj old-y-angle-diff) f30-0)
(let ((a1-2 (get-quaternion obj)))
(quaternion-rotate-y! a1-2 a1-2 f30-0)
)
)
)
@ -203,6 +201,7 @@
(cond
((!= s2-0 0.0)
(let* ((v1-5 (vector-cross! (new 'stack-no-clear 'vector) s1-2 sv-272))
;; og:preserve-this inlined vector-dot
; (f0-3 (-> sv-256 x))
; (f1-3 (-> sv-256 y))
; (f2-0 (-> sv-256 z))

View File

@ -553,49 +553,37 @@
(defun vector-v! ((arg0 vector))
"Convert a velocity to a displacement per frame. The velocity should be in X/actual_second.
Uses the current process clock."
(with-pp
(vector-float*! arg0 arg0 (-> pp clock seconds-per-frame))
arg0
)
(vector-float*! arg0 arg0 (seconds-per-frame))
arg0
)
(defun vector-v+! ((arg0 vector) (arg1 vector) (arg2 vector))
"Euler forward step, using the current display time settings"
(with-pp
(vector+float*! arg0 arg1 arg2 (-> pp clock seconds-per-frame))
arg0
)
(vector+float*! arg0 arg1 arg2 (seconds-per-frame))
arg0
)
(defun vector-v*float+! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float))
"Euler forward step, scaling velocity by velocity-scale"
(with-pp
(vector+float*! arg0 arg1 arg2 (* arg3 (-> pp clock seconds-per-frame)))
arg0
)
(vector+float*! arg0 arg1 arg2 (* arg3 (seconds-per-frame)))
arg0
)
(defun vector-v++! ((arg0 vector) (arg1 vector))
"Update position in place, using display's current timing"
(with-pp
(vector+float*! arg0 arg0 arg1 (-> pp clock seconds-per-frame))
arg0
)
(vector+float*! arg0 arg0 arg1 (seconds-per-frame))
arg0
)
(defun vector-v*float! ((arg0 vector) (arg1 vector) (arg2 float))
"Go from velocity to delta-p per frame, scaling by scale"
(with-pp
(vector-float*! arg0 arg1 (* arg2 (-> pp clock seconds-per-frame)))
)
(vector-float*! arg0 arg1 (* arg2 (seconds-per-frame)))
)
(defun vector-v*float++! ((arg0 vector) (arg1 vector) (arg2 float))
"update position with given velocity, scaled by scale."
(with-pp
(vector+float*! arg0 arg0 arg1 (* arg2 (-> pp clock seconds-per-frame)))
arg0
)
(vector+float*! arg0 arg0 arg1 (* arg2 (seconds-per-frame)))
arg0
)
(defun vector-to-ups! ((arg0 vector) (arg1 vector))
@ -623,22 +611,20 @@
(defun vector-from-ups! ((arg0 vector) (arg1 vector))
"Go from units per second to units per frame?"
(local-vars (at-0 int))
(with-pp
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(let ((f0-0 (-> pp clock seconds-per-frame)))
(.mov at-0 f0-0)
)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> arg0 quad) vf1)
arg0
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(let ((f0-0 (seconds-per-frame)))
(.mov at-0 f0-0)
)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> arg0 quad) vf1)
arg0
)
)
@ -827,6 +813,7 @@
)
)
arg0
;; og:preserve-this
; (rlet ((acc :class vf)
; (Q :class vf)
; (vf0 :class vf)
@ -866,6 +853,7 @@
f0-0
)
;; og:preserve-this
; (local-vars (v1-1 float))
; (rlet ((acc :class vf)
; (Q :class vf)
@ -961,7 +949,7 @@
"Make vector at most arg1 length (xyz only).
If it is larger, project onto sphere.
Doesn't touch w"
;; note: converted to asm in jak 2
;; og:preserve-this converted to asm in jak 2
(let ((f0-0 (vector-length arg0)))
(when (not (or (= f0-0 0.0) (< f0-0 arg1)))
(let ((f0-1 (/ f0-0 arg1)))
@ -1594,9 +1582,9 @@
(defun sphere<-vector! ((arg0 sphere) (arg1 vector))
"Set the position of the sphere to arg1. Does not change the radius"
(let ((f0-0 (-> arg0 w)))
(let ((f0-0 (-> arg0 r)))
(set! (-> arg0 quad) (-> arg1 quad))
(set! (-> arg0 w) f0-0)
(set! (-> arg0 r) f0-0)
)
arg0
)
@ -1604,7 +1592,7 @@
(defun sphere<-vector+r! ((arg0 sphere) (arg1 vector) (arg2 float))
"Set the position of the sphere from arg1 and the radius from arg2"
(set! (-> arg0 quad) (-> arg1 quad))
(set! (-> arg0 w) arg2)
(set! (-> arg0 r) arg2)
arg0
)
@ -1640,7 +1628,8 @@
0.0
)
((>= -1.0 f0-1)
0.017257283 ;; what is this value?? this should be 180 degrees.
;; og:preserve-this what is this value?? this should be 180 degrees.
0.017257283
)
(else
(acos f0-1)
@ -1648,7 +1637,3 @@
)
)
)

View File

@ -146,65 +146,63 @@
;; WARN: Return type mismatch vector vs symbol.
(defmethod enemy-method-100 nav-enemy ((obj nav-enemy))
(local-vars (v0-1 vector))
(with-pp
(when (not (-> obj enemy-info move-to-ground))
(enemy-method-103 obj)
(return (the-as symbol #f))
)
(when (not (logtest? (enemy-flag directed) (-> obj enemy-flags)))
(let ((s5-0 (-> obj root)))
(if (focus-test? obj under-water)
(enemy-method-47 obj (-> s5-0 transv))
(+! (-> s5-0 transv y) (* (-> obj enemy-info movement-gravity) (-> pp clock seconds-per-frame)))
)
(let ((a2-0 (new 'stack-no-clear 'move-above-ground-params)))
(let ((v1-16 (-> obj enemy-info)))
(set! (-> a2-0 gnd-collide-with) (-> v1-16 recover-gnd-collide-with))
(set! (-> a2-0 popup) 8192.0)
(set! (-> a2-0 dont-move-if-overlaps?) #t)
(set! (-> a2-0 hover-if-no-ground?) (-> v1-16 hover-if-no-ground))
(set! (-> a2-0 overlaps-params options) (overlaps-others-options oo0 oo2))
(set! (-> a2-0 overlaps-params collide-with-filter) (-> v1-16 overlaps-others-collide-with-filter))
)
(set! (-> a2-0 overlaps-params tlist) *touching-list*)
(-> a2-0 overlaps-params)
(enemy-method-128 obj (-> s5-0 transv) a2-0)
(when (not (-> obj enemy-info move-to-ground))
(enemy-method-103 obj)
(return (the-as symbol #f))
)
(when (not (logtest? (enemy-flag directed) (-> obj enemy-flags)))
(let ((s5-0 (-> obj root)))
(if (focus-test? obj under-water)
(enemy-method-47 obj (-> s5-0 transv))
(+! (-> s5-0 transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame)))
)
(let ((a2-0 (new 'stack-no-clear 'move-above-ground-params)))
(let ((v1-16 (-> obj enemy-info)))
(set! (-> a2-0 gnd-collide-with) (-> v1-16 recover-gnd-collide-with))
(set! (-> a2-0 popup) 8192.0)
(set! (-> a2-0 dont-move-if-overlaps?) #t)
(set! (-> a2-0 hover-if-no-ground?) (-> v1-16 hover-if-no-ground))
(set! (-> a2-0 overlaps-params options) (overlaps-others-options oo0 oo2))
(set! (-> a2-0 overlaps-params collide-with-filter) (-> v1-16 overlaps-others-collide-with-filter))
)
(set! (-> a2-0 overlaps-params tlist) *touching-list*)
(-> a2-0 overlaps-params)
(enemy-method-128 obj (-> s5-0 transv) a2-0)
)
)
(logclear! (-> obj enemy-flags) (enemy-flag directed))
(if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead))))
(kill-prefer-falling obj)
)
(the-as symbol (when (logtest? (-> obj nav state flags) (nav-state-flag in-mesh))
(let ((s5-1 (-> obj root))
(a1-2 (new 'stack-no-clear 'collide-query))
(s3-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s3-0 quad) (-> s5-1 gspot-pos quad))
(set! (-> s4-0 quad) (-> s5-1 gspot-normal quad))
(cond
((find-ground s5-1 a1-2 (-> obj enemy-info gnd-collide-with) 8192.0 81920.0 1024.0)
(let ((f0-4 (- (-> s5-1 trans y) (-> s5-1 gspot-pos y))))
(when (>= 409.6 (fabs f0-4))
(enemy-method-103 obj)
(return (the-as symbol #f))
v0-1
)
)
(logclear! (-> obj enemy-flags) (enemy-flag directed))
(if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead))))
(kill-prefer-falling obj)
)
(the-as symbol (when (logtest? (-> obj nav state flags) (nav-state-flag in-mesh))
(let ((s5-1 (-> obj root))
(a1-2 (new 'stack-no-clear 'collide-query))
(s3-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s3-0 quad) (-> s5-1 gspot-pos quad))
(set! (-> s4-0 quad) (-> s5-1 gspot-normal quad))
(cond
((find-ground s5-1 a1-2 (-> obj enemy-info gnd-collide-with) 8192.0 81920.0 1024.0)
(let ((f0-4 (- (-> s5-1 trans y) (-> s5-1 gspot-pos y))))
(when (>= 409.6 (fabs f0-4))
(enemy-method-103 obj)
(return (the-as symbol #f))
v0-1
)
)
(else
(set! (-> s5-1 gspot-pos quad) (-> s3-0 quad))
(set! v0-1 (-> s5-1 gspot-normal))
(set! (-> v0-1 quad) (-> s4-0 quad))
v0-1
)
)
(else
(set! (-> s5-1 gspot-pos quad) (-> s3-0 quad))
(set! v0-1 (-> s5-1 gspot-normal))
(set! (-> v0-1 quad) (-> s4-0 quad))
v0-1
)
)
)
)
)
)
)
)
(defmethod track-target! nav-enemy ((self nav-enemy))
@ -223,6 +221,7 @@
)
)
(when *target*
;; og:preserve-this target-look-at-me! macro
(target-look-at-me! :trans (the-as vector (-> self root root-prim prim-core))
:message (if (logtest? (-> self enemy-flags) (enemy-flag use-notice-distance))
'attacking
@ -540,7 +539,7 @@
(set! (-> s5-0 y) 0.0)
(vector-normalize! s5-0 1.0)
;; modified for PC, see comment near definition in collide-shape-h.gc
;; og:preserve-this modified for PC, see comment near definition in collide-shape-h.gc
(normalized-heading-to-quaternion! (-> obj root quat) s5-0)
)
(quaternion-normalize! (-> obj root quat))
@ -549,48 +548,46 @@
)
(defmethod nav-enemy-method-143 nav-enemy ((obj nav-enemy) (arg0 nav-control))
(with-pp
(let ((v1-0 (new 'stack-no-clear 'vector)))
(let ((a2-0 (-> arg0 state)))
(set! (-> v1-0 quad) (-> a2-0 velocity quad))
)
(let ((a0-3 (-> obj root transv)))
(set! (-> a0-3 x) (-> v1-0 x))
(set! (-> a0-3 z) (-> v1-0 z))
)
(let ((v1-0 (new 'stack-no-clear 'vector)))
(let ((a2-0 (-> arg0 state)))
(set! (-> v1-0 quad) (-> a2-0 velocity quad))
)
(cond
((-> obj enemy-info move-to-ground)
(if (focus-test? obj under-water)
(enemy-method-47 obj (-> obj root transv))
(+! (-> obj root transv y) (* (-> obj enemy-info movement-gravity) (-> pp clock seconds-per-frame)))
)
(let ((a2-3 (new 'stack-no-clear 'move-above-ground-params)))
(let ((v1-14 (-> obj enemy-info)))
(set! (-> a2-3 gnd-collide-with) (the-as collide-spec (-> obj gnd-collide)))
(set! (-> a2-3 popup) 8192.0)
(set! (-> a2-3 dont-move-if-overlaps?) #t)
(set! (-> a2-3 hover-if-no-ground?) (-> v1-14 hover-if-no-ground))
(set! (-> a2-3 overlaps-params options) (overlaps-others-options oo0 oo2))
(set! (-> a2-3 overlaps-params collide-with-filter) (-> v1-14 overlaps-others-collide-with-filter))
)
(set! (-> a2-3 overlaps-params tlist) *touching-list*)
(-> a2-3 overlaps-params)
(enemy-method-128 obj (-> obj root transv) a2-3)
)
)
(else
(let ((a2-4 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a2-4 options) (overlaps-others-options oo0))
(set! (-> a2-4 collide-with-filter) (-> obj enemy-info overlaps-others-collide-with-filter))
(set! (-> a2-4 tlist) *touching-list*)
(integrate-for-enemy-no-mtg (-> obj root) (-> obj root transv) a2-4)
)
)
(let ((a0-3 (-> obj root transv)))
(set! (-> a0-3 x) (-> v1-0 x))
(set! (-> a0-3 z) (-> v1-0 z))
)
0
(none)
)
(cond
((-> obj enemy-info move-to-ground)
(if (focus-test? obj under-water)
(enemy-method-47 obj (-> obj root transv))
(+! (-> obj root transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame)))
)
(let ((a2-3 (new 'stack-no-clear 'move-above-ground-params)))
(let ((v1-14 (-> obj enemy-info)))
(set! (-> a2-3 gnd-collide-with) (the-as collide-spec (-> obj gnd-collide)))
(set! (-> a2-3 popup) 8192.0)
(set! (-> a2-3 dont-move-if-overlaps?) #t)
(set! (-> a2-3 hover-if-no-ground?) (-> v1-14 hover-if-no-ground))
(set! (-> a2-3 overlaps-params options) (overlaps-others-options oo0 oo2))
(set! (-> a2-3 overlaps-params collide-with-filter) (-> v1-14 overlaps-others-collide-with-filter))
)
(set! (-> a2-3 overlaps-params tlist) *touching-list*)
(-> a2-3 overlaps-params)
(enemy-method-128 obj (-> obj root transv) a2-3)
)
)
(else
(let ((a2-4 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a2-4 options) (overlaps-others-options oo0))
(set! (-> a2-4 collide-with-filter) (-> obj enemy-info overlaps-others-collide-with-filter))
(set! (-> a2-4 tlist) *touching-list*)
(integrate-for-enemy-no-mtg (-> obj root) (-> obj root transv) a2-4)
)
)
)
0
(none)
)
(define *nav-enemy-null-callback-info* (new 'static 'nav-callback-info))
@ -1536,7 +1533,7 @@ This commonly includes things such as:
(defbehavior nav-enemy-debug-control-post nav-enemy ()
(let ((gp-0 *nav-enemy-debug-control-info*))
(let ((f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)))
(seek! (-> gp-0 steering) (fmax -1.0 (fmin 1.0 f30-0)) (-> self clock seconds-per-frame))
(seek! (-> gp-0 steering) (fmax -1.0 (fmin 1.0 f30-0)) (seconds-per-frame))
(if (cpad-hold? 0 x)
(set! (-> gp-0 throttle) 1.0)
(set! (-> gp-0 throttle) 0.0)

View File

@ -425,7 +425,7 @@
(gp-0
(let ((v1-0 arg0))
(.lvf vf1 (&-> arg2 quad))
(let ((f0-0 (-> pp clock seconds-per-frame)))
(let ((f0-0 (seconds-per-frame)))
(.mov at-0 f0-0)
)
(.mov vf2 at-0)
@ -971,6 +971,7 @@
(defmethod lay-out-spad-memory nav-engine ((obj nav-engine) (arg0 nav-mesh))
(let ((s5-0 0))
;; og:preserve-this scratchpad
(set! (-> obj spr-addr) (scratchpad-object uint :offset #x60))
(let* ((v1-1 obj)
(a1-1 320)
@ -1381,6 +1382,7 @@
(reloc-ptrs-to-mem obj (the-as nav-engine-spr-buffer gp-0))
(dotimes (s4-0 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count))
(let ((a2-1 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 spr-addr s4-0 state mesh)))
;; og:preserve-this scratchpad
(when (in-scratchpad? a2-1)
(format 0 "nav-engine::update-nav-controls-in-spr: (pre-dma) bad mesh pointer found (#x0~x)~%" a2-1)
(break!)
@ -1392,6 +1394,7 @@
(dma-sync (the-as pointer #x1000d000) 0 0)
(dotimes (s5-1 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count))
(let ((a2-3 (-> (&+ (-> (the-as nav-engine-spr-buffer gp-0) mem-addr) (* 288 s5-1)) 31)))
;; og:preserve-this scratchpad
(when (in-scratchpad? a2-3)
(format 0 "nav-engine::update-nav-controls-in-spr: (post-dma) bad mesh pointer found (#x0~x)~%" a2-3)
(break!)
@ -1415,6 +1418,7 @@
(the-as none sp-0)
(set! sp-0 #x70003fc0)
(set! (-> obj work mesh) obj)
;; og:preserve-this scratchpad
(let ((s4-0 (scratchpad-object nav-engine)))
(lay-out-spad-memory s4-0 obj)
(add-all-spheres s4-0)
@ -1607,6 +1611,7 @@
(s0-0 (-> s4-0 0))
)
(b! (zero? s0-0) cfg-17 :delay (nop!))
;; og:preserve-this
(label cfg-2)
(let ((v1-2 (logand s0-0 1)))
(nop!)
@ -1629,6 +1634,7 @@
)
)
(label cfg-16)
;; og:preserve-this
(set! s0-0 (the-as uint (/ (the-as int s0-0) 2)))
(nop!)
(b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1)))
@ -1929,6 +1935,7 @@
(s0-0 (-> s3-0 0))
)
(b! (zero? s0-0) cfg-17 :delay (nop!))
;; og:preserve-this
(label cfg-2)
(let ((v1-3 (logand s0-0 1)))
(nop!)
@ -1955,6 +1962,7 @@
(b! #t cfg-38 :delay (nop!))
(nop!)
(label cfg-16)
;; og:preserve-this cast
(set! s0-0 (the-as uint (/ (the-as int s0-0) 2)))
(nop!)
(b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1)))
@ -1978,6 +1986,7 @@
(s0-1 (-> s3-1 0))
)
(b! (zero? s0-1) cfg-34 :delay (nop!))
;; og:preserve-this
(label cfg-20)
(let ((v1-19 (logand s0-1 1)))
(nop!)
@ -2001,6 +2010,7 @@
)
)
(label cfg-33)
;; og:preserve-this cast
(set! s0-1 (the-as uint (/ (the-as int s0-1) 2)))
(nop!)
(b! (nonzero? s0-1) cfg-20 :delay (set! s1-1 (+ s1-1 1)))
@ -2589,6 +2599,7 @@
(s0-0 (-> s3-0 0))
)
(b! (zero? s0-0) cfg-14 :delay (nop!))
;; og:preserve-this
(label cfg-2)
(let ((v1-5 (logand s0-0 1)))
(nop!)
@ -2615,6 +2626,7 @@
(nop!)
)
(label cfg-13)
;; og:preserve-this cast
(set! s0-0 (the-as uint (/ (the-as int s0-0) 2)))
(nop!)
(b! (nonzero? s0-0) cfg-2 :delay (set! s1-0 (+ s1-0 1)))

View File

@ -40,7 +40,7 @@
(defmethod rigid-body-queue-method-10 rigid-body-queue ((obj rigid-body-queue))
(local-vars (s4-0 process))
(with-pp
(let ((f0-0 (-> pp clock seconds-per-frame))
(let ((f0-0 (seconds-per-frame))
(v1-1 (-> obj count))
)
(b! #t cfg-9 :delay (nop!))

View File

@ -906,12 +906,10 @@
)
(defmethod rigid-body-object-method-30 rigid-body-object ((obj rigid-body-object))
(with-pp
(rigid-body-control-method-10 (-> obj rbody) obj (-> pp clock seconds-per-frame) (-> obj max-time-step))
(logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force))
0
(none)
)
(rigid-body-control-method-10 (-> obj rbody) obj (seconds-per-frame) (-> obj max-time-step))
(logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force))
0
(none)
)
(defmethod rigid-body-object-method-51 rigid-body-object ((obj rigid-body-object))

View File

@ -91,7 +91,7 @@
(.lvf vf2 (&-> (-> arg1 bone) transform trans quad))
(.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11)
;; ADDED (also added in jak1)
;; og:preserve-this ADDED (also added in jak1)
;; there's a bug in swamp-blimp where they vector<-cspace!
;; on some default-initialized-to-zero bones
;; we have to return 0s for this to avoid NaNs getting everywhere.
@ -260,6 +260,7 @@
)
(defmethod setup-masks draw-control ((obj draw-control) (arg0 int) (arg1 int))
"TODO - use the enum types"
(local-vars (v1-4 int) (a2-1 (array uint64)))
(let ((a1-2 (logior (logclear (-> obj seg-mask) arg0) arg1)))
(set! (-> obj seg-mask) a1-2)
@ -416,8 +417,10 @@
(+ s1-0 1)
(let ((s5-0 pp))
(set! pp (-> obj process))
;; og:preserve-this scratchpad
((-> arg1 generate-frame-function) (the-as joint-anim-frame (+ 2400 (scratchpad-object int))) s1-0 arg1)
(if (-> arg1 prebind-function)
;; og:preserve-this scratchpad
((-> arg1 prebind-function) (the-as joint-anim-frame (+ 2400 (scratchpad-object int))) s1-0 arg1)
)
(dotimes (s1-1 1)
@ -431,6 +434,7 @@
)
(dotimes (s1-2 2)
(let* ((a0-11 (-> arg0 data (+ s1-2 1)))
;; og:preserve-this scratchpad
(a1-7 (+ (* s1-2 64) 2400 (scratchpad-object int)))
(t9-4 (-> a0-11 param0))
)
@ -442,6 +446,7 @@
(let ((s1-3 3))
(dotimes (s0-0 s2-0)
(let ((a0-12 (-> arg0 data (+ s0-0 s1-3)))
;; og:preserve-this scratchpad
(a1-9 (+ (* 48 s0-0) 2528 (scratchpad-object int)))
)
(if (-> a0-12 param0)
@ -468,6 +473,7 @@
)
)
)
;; og:preserve-this
(#when PC_PORT (when *debug-segment*
(if *display-bones*
(draw-bone-lines (the-as process-drawable (-> obj process))))
@ -598,7 +604,8 @@
)
)
:code (behavior ((arg0 string))
(format 0 "ART ERROR: ~A for ~A~%" arg0 self)
;; og:preserve-this
(format 0 "ART ERROR: ~A for ~A~%" arg0 self)
(if (-> self entity)
(logior! (-> self entity extra perm status) (entity-perm-status error))
)
@ -672,11 +679,7 @@
)
(set! sv-16 (-> s1-0 data (-> arg1 jgeo)))
(set! sv-20 (-> s1-0 length))
(when (or (< (the-as int (-> arg1 jgeo)) 0)
(>= (the-as int (-> arg1 jgeo)) sv-20)
(not sv-16)
(!= (-> sv-16 type) art-joint-geo)
)
(when (or (< (-> arg1 jgeo) 0) (>= (-> arg1 jgeo) sv-20) (not sv-16) (!= (-> sv-16 type) art-joint-geo))
(go process-drawable-art-error "joint-geo")
(set! s2-0 (the-as draw-control #f))
(goto cfg-50)
@ -852,9 +855,8 @@
(set-vector! s2-0 0.0 0.0 0.0 1.0)
)
(when (logtest? arg0 (align-opts adjust-x-vel))
(set! (-> a1-5 x) (+ (* (-> arg1 trans x) (-> arg2 x) (-> pp clock frames-per-second))
(* (-> s2-0 x) (-> pp clock seconds-per-frame))
)
(set! (-> a1-5 x)
(+ (* (-> arg1 trans x) (-> arg2 x) (-> pp clock frames-per-second)) (* (-> s2-0 x) (seconds-per-frame)))
)
(if (not (logtest? arg0 (align-opts adjust-xz-vel keep-other-velocities)))
(set! (-> a1-5 z) 0.0)
@ -863,15 +865,13 @@
(if (and (logtest? arg0 (align-opts adjust-y-vel))
(not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0)))
)
(set! (-> a1-5 y) (+ (* (-> arg1 trans y) (-> arg2 y) (-> pp clock frames-per-second))
(* (-> s2-0 y) (-> pp clock seconds-per-frame))
)
(set! (-> a1-5 y)
(+ (* (-> arg1 trans y) (-> arg2 y) (-> pp clock frames-per-second)) (* (-> s2-0 y) (seconds-per-frame)))
)
)
(when (logtest? arg0 (align-opts adjust-xz-vel))
(set! (-> a1-5 z) (+ (* (-> arg1 trans z) (-> arg2 z) (-> pp clock frames-per-second))
(* (-> s2-0 z) (-> pp clock seconds-per-frame))
)
(set! (-> a1-5 z)
(+ (* (-> arg1 trans z) (-> arg2 z) (-> pp clock frames-per-second)) (* (-> s2-0 z) (seconds-per-frame)))
)
(if (not (logtest? arg0 (align-opts adjust-x-vel keep-other-velocities)))
(set! (-> a1-5 x) 0.0)
@ -1208,6 +1208,7 @@
(let ((s2-0 (-> s3-0 frame-group)))
(when (not (and s2-0 (nonzero? s2-0) (= (logand (the-as int s2-0) 7) 4) (= (-> s2-0 type) art-joint-anim)))
(go process-drawable-art-error "joint-anim")
;; og:preserve-this
(abandon-thread)
0
)
@ -1274,6 +1275,7 @@
(let ((s0-0 (-> s1-0 frame-group)))
(when (not (and s0-0 (nonzero? s0-0) (= (logand (the-as int s0-0) 7) 4) (= (-> s0-0 type) art-joint-anim)))
(go process-drawable-art-error "joint-anim")
;; og:preserve-this
(abandon-thread)
0
)
@ -1490,7 +1492,7 @@
(cond
((= (-> obj interp) 0.0)
(when s5-0
(seek! (-> s5-0 frame-interp 1) 0.0 (* 8.0 (-> pp clock seconds-per-frame)))
(seek! (-> s5-0 frame-interp 1) 0.0 (* 8.0 (seconds-per-frame)))
(if s3-0
(set! (-> s3-0 frame-interp 1) (fmin (-> s3-0 frame-interp 1) (-> s5-0 frame-interp 1)))
)

View File

@ -584,6 +584,7 @@
)
)
;; og:preserve-this
(defun pc-upload-subtitle-texture ((dma-buf dma-buffer) (image-data pointer) (clut-data pointer) (width int) (height int) (tbp int) (cbp int))
"Added PC-port function to send a mt4 texture."
(pc-texture-anim-flag start-anim-array dma-buf)
@ -625,6 +626,7 @@
(with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id subtitle)
)
;; og:preserve-this
;; (upload-vram-data s3-0 0 (-> arg0 palette) 2 8)
(let ((s0-0 20))
(pc-upload-subtitle-texture
@ -656,7 +658,7 @@
(test-1 (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)))
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
(tex0-1 (new 'static 'gs-tex0 :tbp0 #x1 :tcc #x1 :cld #x1 :psm s0-0 :th v1-17 :tw sv-32 :tbw (shr gp-0 6)))
;; added texture filtering for PC-port here:
;; og:preserve-this added texture filtering for PC port here:
(tex1-1 (new 'static 'gs-tex1 :mmag 1 :mmin 1))
(clamp-1 (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)))
(texflush 0)
@ -671,6 +673,7 @@
(a0-23 (+ a2-23 (-> arg0 width)))
(a1-33 (+ a3-8 (-> arg0 height)))
)
;; og:preserve-this
(#when PC_PORT
(when (not (-> *pc-settings* use-vis?))
(let ((corrected-width (the int (* (-> *pc-settings* aspect-ratio-reciprocal) (-> arg0 width)))))
@ -696,6 +699,7 @@
(a0-30 (+ a1-38 (-> arg0 width)))
(a2-28 (+ a3-11 (-> arg0 height)))
)
;; og:preserve-this
(#when PC_PORT
(when (not (-> *pc-settings* use-vis?))
(let ((corrected-width (the int (* (-> *pc-settings* aspect-ratio-reciprocal) (-> arg0 width)))))
@ -726,7 +730,7 @@
)
(let ((v1-9 (-> self skel root-channel 0 frame-group)))
(when v1-9
;; send a movie-no-subtitle message so the pc subtitle system at least knows there's a movie playing
;; og:preserve-this send a movie-no-subtitle message so the pc subtitle system at least knows there's a movie playing
(#when PC_PORT
(if (= (-> self type) scene-player)
(send-event (ppointer->process *subtitle2*) 'movie-no-subtitle (-> (the scene-player self) anim name) #f (ja-aframe-num 0))))
@ -735,6 +739,7 @@
(let ((f30-0 (ja-aframe-num 0))
(s5-0 (the-as int (-> *setting-control* user-current subtitle-language)))
)
;; og:preserve-this constant
(if (and (= (the-as language-enum s5-0) (language-enum english)) (= (scf-get-territory) GAME_TERRITORY_SCEE))
(set! s5-0 7)
)
@ -773,6 +778,7 @@
(+! (-> s2-0 origin y) 1.0)
(set! (-> s2-0 color) (font-color default))
(set! (-> s2-0 flags) (font-flags shadow kerning middle left large))
;; og:preserve-this
(#if PC_PORT
(if (or (!= (-> self type) scene-player)
(not (send-event (ppointer->process *subtitle2*) 'movie (-> (the scene-player self) anim name) s3-0 f30-0)))
@ -1045,7 +1051,7 @@
*screen-filter*
(new 'static 'vector)
(new 'static 'vector :w 128.0)
(* 30.0 (-> self clock seconds-per-frame))
(* 30.0 (seconds-per-frame))
(bucket-id screen-filter)
)
(let ((gp-0 (current-time)))
@ -1501,10 +1507,7 @@
)
(else
(set! (-> self targ-speed)
(fmax
-10.0
(fmin 10.0 (+ (-> self targ-speed) (* (-> self speed-change-speed) (-> self clock seconds-per-frame))))
)
(fmax -10.0 (fmin 10.0 (+ (-> self targ-speed) (* (-> self speed-change-speed) (seconds-per-frame)))))
)
(if (< (- (current-time) (-> self speed-change-time)) (seconds 3))
(format
@ -1549,7 +1552,8 @@
(defbehavior scene-player-init scene-player ((arg0 object) (arg1 symbol) (arg2 string))
"`object` arg can be an `(array scene)`, `pair of scene` or a `scene`"
(process-entity-set! self (the-as entity #f))
(stack-size-set! (-> self main-thread) 768) ;; changed from 512
;; og:preserve-this changed from 512
(stack-size-set! (-> self main-thread) 768)
(set! (-> self root) (new 'process 'trsqv))
(case (rtype-of arg0)
((array)

View File

@ -61,8 +61,8 @@
)
(let ((f0-1 (lerp-scale 1.0 -1.0 f28-0 -32768.0 32768.0)))
(if (or (< (fabs f0-1) 0.1) (< (-> self control turn-to-magnitude) 0.3))
(seek! (-> self board turn-anim-mag) 0.0 (* 8.0 (-> self clock seconds-per-frame)))
(seek! (-> self board turn-anim-mag) f0-1 (* 2.0 (-> self clock seconds-per-frame)))
(seek! (-> self board turn-anim-mag) 0.0 (* 8.0 (seconds-per-frame)))
(seek! (-> self board turn-anim-mag) f0-1 (* 2.0 (seconds-per-frame)))
)
)
(set! (-> self board turn-anim-targ) (+ (lerp-scale
@ -106,16 +106,14 @@
)
)
(set! (-> self board turn-anim-duck-vel) (* 0.98 (-> self board turn-anim-duck-vel)))
(+! (-> self board turn-anim-duck-vel) (* -8.0 (-> self clock seconds-per-frame)))
(+! (-> self board turn-anim-duck-vel) (* -8.0 (seconds-per-frame)))
(when (and (board-on-ground?) (>= (- (current-time) (-> self board unknown-time-frame02)) (seconds 0.2)))
(if (logtest? (-> self control status) (collide-status impact-surface))
(+! (-> self board turn-anim-duck-vel) (lerp-scale 0.0 15.0 (-> self control normal-impact-vel) 0.0 81920.0))
)
(let ((f0-38 (vector-dot (the-as vector (-> self board up-vector)) (-> self board up-vector 1))))
(if (< f0-38 1.0)
(+! (-> self board turn-anim-duck-vel)
(* (lerp-scale 400.0 0.0 f0-38 0.6 1.0) (-> self clock seconds-per-frame))
)
(+! (-> self board turn-anim-duck-vel) (* (lerp-scale 400.0 0.0 f0-38 0.6 1.0) (seconds-per-frame)))
)
)
)
@ -188,8 +186,8 @@
(if (not (-> self control danger-mode))
(target-danger-set! 'board-spin #f)
)
;; pc port note: patched for high fps
(+! (-> self board trotyv) (* (-> self board spin-control) (seconds-per-frame)))
;; og:preserve-this high fps fix
(+! (-> self board trotyv) (* (-> self board spin-control) (seconds-per-frame-high-fps)))
(when (and (< (fabs f28-0) 1092266.6)
(< (fabs (-> self board spin-control)) 1092266.6)
(< (* 0.9 (fabs (-> self board flip-control))) (fabs f30-0))
@ -2374,14 +2372,7 @@
(set! (-> *part-id-table* 431 init-specs 1 initial-valuef)
(lerp-scale 0.1 2.0 (fabs (-> self board ride-speed)) 0.0 (* 0.3 (-> self control mod-surface transv-max)))
)
(let ((t9-10 sp-launch-particles-var)
(a0-42 *sp-particle-system-2d*)
(a1-12 (-> *part-id-table* 431))
(a2-9 *launch-matrix*)
)
(set! (-> a2-9 trans quad) (-> gp-1 quad))
(t9-10 a0-42 a1-12 a2-9 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 431) gp-1)
)
)
(none)
@ -2487,7 +2478,7 @@
(-> self control transv)
(-> self control transv)
(-> self control dynam gravity-normal)
(* 122880.0 (-> self clock seconds-per-frame))
(* 122880.0 (seconds-per-frame))
)
)
(when (jump-hit-ground-stuck?)
@ -2791,7 +2782,7 @@
:post (behavior ()
(set! (-> self control bend-speed) 0.0)
(set! (-> self control bend-target) 0.0)
(vector-seek! (-> self control draw-offset) *null-vector* (* 16384.0 (-> self clock seconds-per-frame)))
(vector-seek! (-> self control draw-offset) *null-vector* (* 16384.0 (seconds-per-frame)))
(target-no-move-post)
(target-board-effect)
(none)
@ -2989,7 +2980,7 @@
:post (behavior ()
(set! (-> self control bend-speed) 0.0)
(set! (-> self control bend-target) 0.0)
(vector-seek! (-> self control draw-offset) *null-vector* (* 16384.0 (-> self clock seconds-per-frame)))
(vector-seek! (-> self control draw-offset) *null-vector* (* 16384.0 (seconds-per-frame)))
(target-post)
(target-board-effect)
(none)

View File

@ -393,7 +393,7 @@
(case arg3
((1)
(when (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)
(let* ((f30-0 (* 122880.0 (-> self control turn-to-magnitude) (-> self clock seconds-per-frame)))
(let* ((f30-0 (* 122880.0 (-> self control turn-to-magnitude) (seconds-per-frame)))
(a2-1 (-> self board ride-dir))
(v1-12 (vector-flatten! (new 'stack-no-clear 'vector) (-> self control to-target-pt-xz) a2-1))
)
@ -686,12 +686,7 @@
)
1.0
)
(vector+float*!
s5-1
(-> self control trans)
(-> self control c-R-w vector 2)
(* 40960.0 (-> self clock seconds-per-frame))
)
(vector+float*! s5-1 (-> self control trans) (-> self control c-R-w vector 2) (* 40960.0 (seconds-per-frame)))
(let* ((t9-8 vector-segment-overlap)
(a1-8 (-> gp-1 world-vertex))
(a2-3 (-> gp-1 world-vertex 1))
@ -1069,14 +1064,11 @@
)
(when (not (or (= (-> self control current-surface vel-turn) 0.0) (< (-> gp-0 z) 0.0)))
(let ((f0-22 (atan (-> gp-0 x) (-> gp-0 z))))
(vector-rotate-y!
gp-0
gp-0
(fmin
(* 0.03 (-> self clock time-adjust-ratio) (- f0-22))
(* (-> self control current-surface vel-turn) (-> self clock seconds-per-frame))
)
)
(vector-rotate-y! gp-0 gp-0 (fmin
(* 0.03 (-> self clock time-adjust-ratio) (- f0-22))
(* (-> self control current-surface vel-turn) (seconds-per-frame))
)
)
)
)
(let* ((f0-28 (* f30-0 (-> self board thrust-scale) (lerp-scale 0.4 1.0 f28-0 0.3 1.0)))
@ -1109,9 +1101,9 @@
)
)
)
(+! (-> gp-0 z) (* f0-28 (-> self clock seconds-per-frame)))
(+! (-> gp-0 z) (* f0-28 (seconds-per-frame)))
(when (!= f1-23 0.0)
(let ((f0-33 (- 1.0 (/ (* f30-0 (-> self clock seconds-per-frame)) f1-23))))
(let ((f0-33 (- 1.0 (/ (* f30-0 (seconds-per-frame)) f1-23))))
(set! (-> gp-0 x) (* (-> gp-0 x) f0-33))
(set! (-> gp-0 z) (* (-> gp-0 z) f0-33))
)
@ -1236,17 +1228,17 @@
)
)
(if (board-on-ground?)
(seek! (-> self board sound-air-knob) 0.0 (* 16.0 (-> self clock seconds-per-frame)))
(seek! (-> self board sound-air-knob) 0.0 (* 16.0 (seconds-per-frame)))
(seek!
(-> self board sound-air-knob)
(lerp-scale 0.0 1.0 (target-height-above-ground) 409.6 28672.0)
(* 2.0 (-> self clock seconds-per-frame))
(* 2.0 (seconds-per-frame))
)
)
(let ((f30-0 (fabs (/ (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames)))))
(seek! (-> self board sound-bank-knob) f30-0 (if (< (-> self board sound-bank-knob) f30-0)
(* 0.5 (-> self clock seconds-per-frame))
(-> self clock seconds-per-frame)
(* 0.5 (seconds-per-frame))
(seconds-per-frame)
)
)
(set! (-> self board engine-sound-volume) (lerp-scale 0.8 1.0 f30-0 0.0 1.0))
@ -1298,12 +1290,12 @@
(seek!
(-> self board spin-sound-volume)
(lerp-scale 0.0 1.0 (fabs (-> self board trotyv)) 0.0 91022.22)
(* 8.0 (-> self clock seconds-per-frame))
(* 8.0 (seconds-per-frame))
)
(seek!
(-> self board spin-sound-pitch)
(lerp-scale 0.0 0.3 (fabs (-> self board trotyv)) 36408.89 91022.22)
(-> self clock seconds-per-frame)
(seconds-per-frame)
)
(when *sound-player-enable*
(let ((v1-89 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
@ -1324,17 +1316,14 @@
)
(when (= (-> self board upper-body mode) (joint-mod-mode rotate))
(set! (-> self board upper-body-rotyv)
(* 0.95
(fmax
(fmin (-> self board upper-body-rotyv) (-> self board upper-body-rotyv-max))
(- (-> self board upper-body-rotyv-max))
)
(* 0.95 (fmax
(fmin (-> self board upper-body-rotyv) (-> self board upper-body-rotyv-max))
(- (-> self board upper-body-rotyv-max))
)
)
)
(+! (-> self board upper-body-rotyv)
(* -10.0 (-> self clock seconds-per-frame) (-> self board upper-body-roty))
)
(let ((f1-21 (* (-> self board upper-body-rotyv) (-> self clock seconds-per-frame)))
(+! (-> self board upper-body-rotyv) (* -10.0 (seconds-per-frame) (-> self board upper-body-roty)))
(let ((f1-21 (* (-> self board upper-body-rotyv) (seconds-per-frame)))
(f0-65 (-> self board upper-body-roty))
)
(+! (-> self board upper-body-roty) f1-21)
@ -1373,9 +1362,9 @@
(set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad))
)
(+! (-> self board shock-offsetv)
(+ (* -10.0 (-> self clock seconds-per-frame) (-> self board shock-offset))
(+ (* -10.0 (seconds-per-frame) (-> self board shock-offset))
(if (board-on-ground?)
(* (-> self control dynam gravity-length) (-> self clock seconds-per-frame) f30-0)
(* (-> self control dynam gravity-length) (seconds-per-frame) f30-0)
0.0
)
)
@ -1391,7 +1380,7 @@
)
(!= (-> self control mod-surface mode) 'air)
)
(+! (-> self board shock-offset) (* (-> self board shock-offsetv) (-> self clock seconds-per-frame)))
(+! (-> self board shock-offset) (* (-> self board shock-offsetv) (seconds-per-frame)))
)
)
(set! (-> self board shock-offset)
@ -1766,7 +1755,7 @@
(or (= v1-126 'target-board-trickx) (= v1-126 'target-board-hold))
)
)
(seek! (-> self control dynam gravity-length) 245760.0 (* 30.0 (-> self clock seconds-per-frame)))
(seek! (-> self control dynam gravity-length) 245760.0 (* 30.0 (seconds-per-frame)))
)
((= (-> self control mod-surface name) 'spin)
(set! (-> self control dynam gravity-length)
@ -1789,7 +1778,7 @@
(set! (-> self control dynam gravity-length) 245760.0)
)
((>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1))
(seek! (-> self control dynam gravity-length) 245760.0 (* 245760.0 (-> self clock seconds-per-frame)))
(seek! (-> self control dynam gravity-length) 245760.0 (* 245760.0 (seconds-per-frame)))
)
(else
(set! (-> self control dynam gravity-length) 81920.0)
@ -1983,12 +1972,12 @@
(set! (-> self board trotyv)
(* 0.95 (fmax (fmin (-> self board trotyv) (-> self board trotyv-max)) (- (-> self board trotyv-max))))
)
(let ((f0-15 (* (-> self board trotyv) (-> self clock seconds-per-frame))))
(let ((f0-15 (* (-> self board trotyv) (seconds-per-frame))))
(set! (-> self board troty) (the float (sar (shl (the int (+ (-> self board troty) f0-15)) 48) 48)))
(set! (-> self board unknown-deg00) (-> self board troty-cum))
(+! (-> self board troty-cum) f0-15)
)
(seek! (-> self board trotyv-max) 91022.22 (* 91022.22 (-> self clock seconds-per-frame)))
(seek! (-> self board trotyv-max) 91022.22 (* 91022.22 (seconds-per-frame)))
(mode-set! (-> self board main) (joint-mod-mode rotate))
(twist-set! (-> self board main) (the-as float #f) (-> self board troty) (the-as float #f))
(mode-set! (-> self board board 0 main) (joint-mod-mode rotate))
@ -2067,7 +2056,7 @@
(pre-collide-setup)
(cond
((and (-> self next-state) (= (-> self next-state name) 'target-board-get-off))
(seek! (-> self board cushion-offset) 0.0 (* 20480.0 (-> self clock seconds-per-frame)))
(seek! (-> self board cushion-offset) 0.0 (* 20480.0 (seconds-per-frame)))
)
((and (logtest? (-> self control mod-surface flags) (surface-flag air))
(not (logtest? (-> self control status) (collide-status on-surface)))
@ -2075,22 +2064,18 @@
(seek!
(-> self board cushion-offset)
(lerp-scale (-> *TARGET_BOARD-bank* cushion) 0.0 (target-height-above-ground) 0.0 12288.0)
(* 20480.0 (-> self clock seconds-per-frame))
(* 20480.0 (seconds-per-frame))
)
)
((focus-test? self on-water)
(seek!
(-> self board cushion-offset)
(+ 2048.0 (-> *TARGET_BOARD-bank* cushion))
(* 20480.0 (-> self clock seconds-per-frame))
(* 20480.0 (seconds-per-frame))
)
)
(else
(seek!
(-> self board cushion-offset)
(-> *TARGET_BOARD-bank* cushion)
(* 8192.0 (-> self clock seconds-per-frame))
)
(seek! (-> self board cushion-offset) (-> *TARGET_BOARD-bank* cushion) (* 8192.0 (seconds-per-frame)))
)
)
(target-board-collision)
@ -2212,9 +2197,9 @@
(let* ((f30-0 (deg- (vector-y-angle (-> self board ride-dir)) (-> self board ride-rot-abs 0)))
(f30-1 (* f30-0 (lerp-scale 10.0 100.0 (fabs f30-0) 1820.4445 3640.889)))
)
(+! (-> self board ride-rtv-abs) (* f30-1 (-> self clock seconds-per-frame)))
(+! (-> self board ride-rtv-abs) (* f30-1 (seconds-per-frame)))
(set! (-> self board ride-rtv-abs) (* 0.9 (-> self board ride-rtv-abs)))
(+! (-> self board ride-rot-abs 0) (* (-> self board ride-rtv-abs) (-> self clock seconds-per-frame)))
(+! (-> self board ride-rot-abs 0) (* (-> self board ride-rtv-abs) (seconds-per-frame)))
(when (>= 0.0 (* f30-1 (deg- (vector-y-angle (-> self board ride-dir)) (-> self board ride-rot-abs 0))))
(set! (-> self board ride-rtv-abs) 0.0)
(set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-dir)))
@ -2329,7 +2314,7 @@
(let ((f0-25 (vector-vector-distance (-> self control trans) s4-1)))
(when #t
(let ((s3-5 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> self control trans))))
(let ((f1-9 (* 12288.0 (-> self clock seconds-per-frame))))
(let ((f1-9 (* 12288.0 (seconds-per-frame))))
(if (and (not (-> self board ride-lock-on)) (< f1-9 f0-25))
(vector-normalize! s3-5 f1-9)
(set! (-> self board ride-lock-on) #t)
@ -2429,9 +2414,7 @@
(set! sv-768 (the-as int (-> s3-8 best-other-tri pat)))
)
(when (and (< (+ (the float (-> self board ride-vertex-length)) (/ 0.0 f28-3))
(+ (-> self board ride-vertex-index)
(/ (* (-> self board ride-speed) (-> self clock seconds-per-frame)) f28-3)
)
(+ (-> self board ride-vertex-index) (/ (* (-> self board ride-speed) (seconds-per-frame)) f28-3))
)
(>= f28-3 3686.4)
(and (or (>= f26-1 6963.2) (and (>= f26-1 2048.0) (zero? (shr (shl sv-768 54) 61))))
@ -2446,9 +2429,7 @@
f26-1
sv-768
(+ (-> self board ride-vertex-index)
(/ (* (-> self board ride-speed) (-> self clock seconds-per-frame))
(vector-length (-> self board ride-segment))
)
(/ (* (-> self board ride-speed) (seconds-per-frame)) (vector-length (-> self board ride-segment)))
)
(+ (the float (-> self board ride-vertex-length)) (/ 0.0 f28-3))
)
@ -2568,44 +2549,40 @@
(defbehavior board-ride-add-thrust target ((arg0 vector) (arg1 float))
(let* ((f30-0 (-> self board ride-speed))
(f0-4
(lerp-scale
(-> self control current-surface fric)
(* 0.2 (-> self control current-surface fric))
f30-0
0.0
(-> self control current-surface transv-max)
)
)
(f30-1 (seek f30-0 0.0 (* f0-4 (-> self clock seconds-per-frame))))
(f28-0 (vector-dot (-> self board ride-dir) arg0))
(f0-19
(+ f30-1
(* (if (< 0.0 f28-0)
(* f28-0
(lerp-scale
(-> self control current-surface target-speed)
0.0
(-> self board ride-speed)
0.0
(-> self control current-surface transv-max)
)
arg1
)
(* 40960.0 arg1 f28-0)
)
(-> self clock seconds-per-frame)
(f0-4 (lerp-scale
(-> self control current-surface fric)
(* 0.2 (-> self control current-surface fric))
f30-0
0.0
(-> self control current-surface transv-max)
)
)
)
)
(f30-1 (seek f30-0 0.0 (* f0-4 (seconds-per-frame))))
(f28-0 (vector-dot (-> self board ride-dir) arg0))
(f0-19 (+ f30-1 (* (if (< 0.0 f28-0)
(* f28-0
(lerp-scale
(-> self control current-surface target-speed)
0.0
(-> self board ride-speed)
0.0
(-> self control current-surface transv-max)
)
arg1
)
(* 40960.0 arg1 f28-0)
)
(seconds-per-frame)
)
)
)
(v1-21 (-> self control to-target-pt-xz))
(f1-6 (vector-dot (-> self control dynam gravity-normal) v1-21))
(f0-20
(if (< f1-6 0.0)
(+ f0-19 (* (- f1-6) (-> self control current-surface slope-down-factor) (-> self clock seconds-per-frame)))
(+ f0-19 (* (- f1-6) (-> self control current-surface slope-up-factor) (-> self clock seconds-per-frame)))
)
)
(f0-20 (if (< f1-6 0.0)
(+ f0-19 (* (- f1-6) (-> self control current-surface slope-down-factor) (seconds-per-frame)))
(+ f0-19 (* (- f1-6) (-> self control current-surface slope-up-factor) (seconds-per-frame)))
)
)
)
(set! (-> self board ride-speed) (fmax 0.0 (fmin f0-20 (-> self control current-surface transv-max))))
)
@ -2644,9 +2621,7 @@
(set! f0-16 0.0)
)
(set! (-> self board ride-lean-targ) f0-16)
(+! (-> self board ride-leanv)
(* 100.0 (-> self clock seconds-per-frame) (- f0-16 (-> self board ride-lean)))
)
(+! (-> self board ride-leanv) (* 100.0 (seconds-per-frame) (- f0-16 (-> self board ride-lean))))
)
)
)
@ -2654,9 +2629,9 @@
(seek!
(-> self board ride-lean-mag)
(fabs (analog-input (the-as int (-> self control cpad leftx)) 128.0 32.0 110.0 1.0))
(* 2.0 (-> self clock seconds-per-frame))
(* 2.0 (seconds-per-frame))
)
(+! (-> self board ride-lean) (* (-> self board ride-leanv) (-> self clock seconds-per-frame)))
(+! (-> self board ride-lean) (* (-> self board ride-leanv) (seconds-per-frame)))
(cond
((< (-> self board ride-lean) -1.0)
(set! (-> self board ride-lean) -1.0)
@ -2673,7 +2648,7 @@
(target-board-compute-edge)
(do-rotations2)
(pre-collide-setup)
(seek! (-> self board cushion-offset) 1638.4 (* 16384.0 (-> self clock seconds-per-frame)))
(seek! (-> self board cushion-offset) 1638.4 (* 16384.0 (seconds-per-frame)))
(let ((s5-3 (new 'stack-no-clear 'vector)))
(set! (-> s5-3 quad) (-> self control transv quad))
(let ((s4-1 (new 'stack-no-clear 'vector)))
@ -2754,7 +2729,7 @@
(-> self board ride-vertex)
(-> self board ride-vertex-length)
(the-as float s4-1)
(* (-> self board ride-speed) (-> self clock seconds-per-frame))
(* (-> self board ride-speed) (seconds-per-frame))
)
)
)
@ -2878,7 +2853,7 @@
0.0
(* 0.3 (-> self board transv-max))
)
(-> self clock seconds-per-frame)
(seconds-per-frame)
)
)
(set! (-> self board turn-anim-vel)
@ -2892,7 +2867,7 @@
)
)
)
(+! (-> self board turn-anim-frame) (* (-> self board turn-anim-vel) (-> self clock seconds-per-frame)))
(+! (-> self board turn-anim-frame) (* (-> self board turn-anim-vel) (seconds-per-frame)))
(set! (-> self board turn-anim-frame)
(fmax
(fmin (-> self board turn-anim-frame) (-> *TARGET_BOARD-bank* turn-frames))
@ -2934,14 +2909,14 @@
(let ((f0-59
(fmin
(if (logtest? (-> self control status) (collide-status on-surface))
(seek (-> self board turn-anim-duck) 0.0 (-> self clock seconds-per-frame))
(seek (-> self board turn-anim-duck) 0.0 (seconds-per-frame))
(-> self board turn-anim-duck)
)
(lerp-scale 0.0 -1.0 (the float (- (current-time) (-> self control last-time-on-surface))) 30.0 120.0)
)
)
)
(+! (-> self board turn-anim-duck) (* (-> self board turn-anim-duck-vel) (-> self clock seconds-per-frame)))
(+! (-> self board turn-anim-duck) (* (-> self board turn-anim-duck-vel) (seconds-per-frame)))
(cond
((< (-> self board turn-anim-duck) f0-59)
(set! (-> self board turn-anim-duck) f0-59)
@ -2991,6 +2966,7 @@
(let ((t9-4 format)
(a0-29 #t)
(a1-8 "trick: ~S (~D) ~,,0f")
;; og:preserve-this
(trick-name (enum->string board-tricks arg0)))
(t9-4
a0-29
@ -3000,6 +2976,7 @@
s3-1
)
)
;; og:preserve-this jetboard trick tracker
(let ((total-points s3-1))
(when (nonzero? (-> obj trick-count))
(format #t " + combo ~,,0f" (-> obj trick-points-array (+ (-> obj trick-count) -1)))
@ -3038,6 +3015,7 @@
)
(send-event (ppointer->process (-> obj process)) 'get-pickup (pickup-type trick-point) f30-0)
(sound-play "trick-score")
;; og:preserve-this
(#when PC_PORT
(end-combo! *board-trick-tracker*))
)

View File

@ -584,11 +584,7 @@
(vector-float*!
(new 'stack-no-clear 'vector)
(-> self control edge-grab-across-edge-dir)
(seek
(vector-length (-> self control additional-decaying-velocity))
40960.0
(* 81920.0 (-> self clock seconds-per-frame))
)
(seek (vector-length (-> self control additional-decaying-velocity)) 40960.0 (* 81920.0 (seconds-per-frame)))
)
(seconds 0.3)
)

View File

@ -86,27 +86,13 @@
(set! (-> s4-1 initial-valuef) (y-angle (-> obj root)))
)
)
(let ((t9-7 sp-launch-particles-var)
(a0-19 *sp-particle-system-2d*)
(a1-9 (-> *part-id-table* 196))
(a2-3 *launch-matrix*)
)
(set! (-> a2-3 trans quad) (-> s5-1 quad))
(t9-7 a0-19 a1-9 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 196) s5-1)
(let ((s4-2 (get-field-spec-by-id (-> *part-id-table* 195) (sp-field-id spt-rotate-y))))
(if s4-2
(set! (-> s4-2 initial-valuef) (y-angle (-> obj root)))
)
)
(let ((t9-10 sp-launch-particles-var)
(a0-22 *sp-particle-system-2d*)
(a1-11 (-> *part-id-table* 195))
(a2-4 *launch-matrix*)
)
(set! (-> a2-4 trans quad) (-> s5-1 quad))
(t9-10 a0-22 a1-11 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 195) s5-1)
)
0
(none)

View File

@ -532,22 +532,8 @@
0
40960.0
)
(let ((t9-2 sp-launch-particles-var)
(a0-3 *sp-particle-system-2d*)
(a1-1 (-> *part-id-table* 215))
(a2-1 *launch-matrix*)
)
(set! (-> a2-1 trans quad) (-> self root trans quad))
(t9-2 a0-3 a1-1 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-3 sp-launch-particles-var)
(a0-4 *sp-particle-system-2d*)
(a1-2 (-> *part-id-table* 216))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> self root trans quad))
(t9-3 a0-4 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 215) (-> self root trans))
(launch-particles (-> *part-id-table* 216) (-> self root trans))
(let ((gp-0 (-> *part-id-table* 430)))
(when gp-0
(let ((v1-14 (get-field-spec-by-id gp-0 (sp-field-id spt-timer))))
@ -667,12 +653,14 @@
(set! (-> gp-1 penetrate-using) (penetrate explode))
(explosion-spawn (the-as process-drawable *default-pool*) explosion gp-1)
)
;; og:preserve-this stack array -> pointer
(let (;(s3-0 (the-as (array collide-shape) (new 'stack 'array collide-shape 16)))
(s3-0 (the-as (pointer collide-shape) (new 'stack-no-clear 'array 'collide-shape 16)))
(a1-8 (new 'stack-no-clear 'sphere))
)
(set! (-> a1-8 quad) (-> self root trans quad))
(set! (-> a1-8 r) (-> self blast-radius))
;; og:preserve-this stack array -> pointer
(let ((gp-2 (fill-actor-list-for-sphere *actor-hash* a1-8 s3-0 16)))
(let ((s1-0 (the-as process-drawable #f))
(f30-0 4096000.0)

View File

@ -502,22 +502,8 @@
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0)
(set! (-> *part-id-table* 199 init-specs 11 initial-valuef) (-> gp-0 y))
(let ((t9-1 sp-launch-particles-var)
(a0-2 *sp-particle-system-2d*)
(a1-2 (-> *part-id-table* 199))
(a2-1 *launch-matrix*)
)
(set! (-> a2-1 trans quad) (-> gp-0 quad))
(t9-1 a0-2 a1-2 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-2 sp-launch-particles-var)
(a0-3 *sp-particle-system-2d*)
(a1-3 (-> *part-id-table* 203))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> gp-0 quad))
(t9-2 a0-3 a1-3 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 199) gp-0)
(launch-particles (-> *part-id-table* 203) gp-0)
)
)
0
@ -529,22 +515,8 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0)
(let ((t9-1 sp-launch-particles-var)
(a0-2 *sp-particle-system-2d*)
(a1-2 (-> *part-id-table* 200))
(a2-1 *launch-matrix*)
)
(set! (-> a2-1 trans quad) (-> gp-0 quad))
(t9-1 a0-2 a1-2 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-2 sp-launch-particles-var)
(a0-3 *sp-particle-system-2d*)
(a1-3 (-> *part-id-table* 203))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> gp-0 quad))
(t9-2 a0-3 a1-3 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 200) gp-0)
(launch-particles (-> *part-id-table* 203) gp-0)
)
)
0

View File

@ -59,14 +59,7 @@
)
)
)
(let ((t9-3 sp-launch-particles-var)
(a0-3 *sp-particle-system-2d*)
(a1-2 (-> *part-id-table* 190))
(a2-0 *launch-matrix*)
)
(set! (-> a2-0 trans quad) (-> gp-0 fire-point quad))
(t9-3 a0-3 a1-2 a2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 190) (-> gp-0 fire-point))
(let ((s5-2 (new 'stack-no-clear 'vector)))
(let ((v1-10 (-> gp-0 fire-point)))
(let ((a0-4 (-> gp-0 fire-dir-out)))

View File

@ -386,7 +386,7 @@
(trs-set! (-> self mag gp-1) (the-as vector #f) (the-as quaternion #f) *zero-vector*)
)
(else
(seek! (-> self mag-scale gp-1) 1.0 (* 8.0 (-> self clock seconds-per-frame)))
(seek! (-> self mag-scale gp-1) 1.0 (* 8.0 (seconds-per-frame)))
(let* ((f30-0 (-> self mag-scale gp-1))
(s5-3 (-> self mag gp-1))
(s4-2 (method-of-object s5-3 trs-set!))
@ -979,33 +979,12 @@
(>= (-> obj fire-range) (vector-vector-distance s2-1 s5-0))
)
(vector+! s2-1 s2-1 s1-0)
(let ((t9-5 sp-launch-particles-var)
(a0-31 *sp-particle-system-2d*)
(a1-12 (-> *part-id-table* 185))
(a2-1 *launch-matrix*)
)
(set! (-> a2-1 trans quad) (-> s2-1 quad))
(t9-5 a0-31 a1-12 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-6 sp-launch-particles-var)
(a0-32 *sp-particle-system-2d*)
(a1-13 (-> *part-id-table* 184))
(a2-2 *launch-matrix*)
)
(set! (-> a2-2 trans quad) (-> s2-1 quad))
(t9-6 a0-32 a1-13 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 185) s2-1)
(launch-particles (-> *part-id-table* 184) s2-1)
)
(else
(vector+! s2-1 s2-1 s1-0)
(let ((t9-7 sp-launch-particles-var)
(a0-35 *sp-particle-system-2d*)
(a1-15 (-> *part-id-table* 186))
(a2-3 *launch-matrix*)
)
(set! (-> a2-3 trans quad) (-> s2-1 quad))
(t9-7 a0-35 a1-15 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 186) s2-1)
)
)
)
@ -1031,23 +1010,9 @@
(when (< 0.0 f28-1)
(vector+! s3-1 s3-1 v1-47)
(set! (-> *part-id-table* 183 init-specs 13 initial-valuef) f28-1)
(let ((t9-12 sp-launch-particles-var)
(a0-46 *sp-particle-system-2d*)
(a1-23 (-> *part-id-table* 183))
(a2-5 *launch-matrix*)
)
(set! (-> a2-5 trans quad) (-> s3-1 quad))
(t9-12 a0-46 a1-23 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 183) s3-1)
(set! (-> *part-id-table* 182 init-specs 13 initial-valuef) f28-1)
(let ((t9-13 sp-launch-particles-var)
(a0-47 *sp-particle-system-2d*)
(a1-24 (-> *part-id-table* 182))
(a2-6 *launch-matrix*)
)
(set! (-> a2-6 trans quad) (-> s3-1 quad))
(t9-13 a0-47 a1-24 a2-6 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 182) s3-1)
)
)
)

View File

@ -105,14 +105,7 @@
(set! (-> *part-id-table* 223 init-specs 4 initial-valuef) f28-0)
)
(vector-normalize! s5-1 1.0)
(let ((t9-2 sp-launch-particles-var)
(a0-5 *sp-particle-system-2d*)
(a1-2 (-> *part-id-table* 224))
(a2-3 *launch-matrix*)
)
(set! (-> a2-3 trans quad) (-> gp-0 quad))
(t9-2 a0-5 a1-2 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 224) gp-0)
(let ((s3-0 (new 'stack-no-clear 'matrix))
(f28-1 (* 0.000015258789 f30-0))
(f30-1 (-> *part-id-table* 226 init-specs 3 initial-valuef))
@ -120,14 +113,7 @@
(forward-up->inv-matrix s3-0 s5-1 *up-vector*)
(set! (-> s3-0 trans quad) (-> s4-0 quad))
(set! (-> *part-id-table* 226 init-specs 3 initial-valuef) (* f28-1 f30-1))
(sp-launch-particles-var
*sp-particle-system-2d*
(-> *part-id-table* 226)
s3-0
(the-as sparticle-launch-state #f)
(the-as sparticle-launch-control #f)
1.0
)
(launch-particles (-> *part-id-table* 226) s3-0 :origin-is-matrix #t)
(set! (-> *part-id-table* 226 init-specs 3 initial-valuef) f30-1)
)
(let ((f0-6 (vector-dot s5-1 (-> (camera-matrix) vector 2))))
@ -138,14 +124,7 @@
)
(set! (-> *part-id-table* 225 init-specs 8 initial-valuef) (* f30-2 f0-7))
(set! (-> *part-id-table* 225 init-specs 8 random-rangef) (* f28-2 f0-7))
(let ((t9-6 sp-launch-particles-var)
(a0-9 *sp-particle-system-2d*)
(a1-5 (-> *part-id-table* 225))
(a2-6 *launch-matrix*)
)
(set! (-> a2-6 trans quad) (-> gp-0 quad))
(t9-6 a0-9 a1-5 a2-6 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 225) gp-0)
(set! (-> *part-id-table* 225 init-specs 8 initial-valuef) f30-2)
(set! (-> *part-id-table* 225 init-specs 8 random-rangef) f28-2)
)

View File

@ -59,8 +59,8 @@
(set! (-> self control current-surface target-speed) (* (-> self control current-surface target-speed) f0-11))
(set! (-> self control current-surface transv-max) (* (-> self control current-surface transv-max) f0-11))
)
;; og:preserve-this turbo jet board cheat
(#when PC_PORT
;; turbo jet board cheat
(when (cheat-state-flag? turbo-board)
(*! (-> self control current-surface target-speed) (-> *pc-cheat-state* turbo-board-speed))
(*! (-> self control current-surface transv-max) (-> *pc-cheat-state* turbo-board-speed))
@ -819,14 +819,11 @@
)
(else
(let ((f0-10 (atan (-> arg0 x) (-> arg0 z))))
(vector-rotate-y!
arg0
arg0
(fmin
(* 0.03 (-> self clock time-adjust-ratio) (- f0-10))
(* (-> self control current-surface vel-turn) (-> self clock seconds-per-frame))
)
)
(vector-rotate-y! arg0 arg0 (fmin
(* 0.03 (-> self clock time-adjust-ratio) (- f0-10))
(* (-> self control current-surface vel-turn) (seconds-per-frame))
)
)
)
)
)
@ -956,7 +953,7 @@
(set! (-> s3-1 z) (fmax 0.0 (fmin (-> s3-1 z) (-> s4-0 z))))
)
(if (< 0.2 (-> self control blocked-factor))
(vector-seek! s3-1 s4-0 (* 122880.0 (-> self clock seconds-per-frame)))
(vector-seek! s3-1 s4-0 (* 122880.0 (seconds-per-frame)))
)
(vector-matrix*! s2-0 s3-1 (-> self control c-R-w))
(let ((f28-0 (vector-vector-xz-distance s3-1 s4-0)))
@ -1005,7 +1002,7 @@
(set! (-> gp-0 z) 0.0)
)
(let ((s4-2 (vector-! (new-stack-vector0) s5-0 gp-0)))
(let ((f0-45 (* f30-0 (-> self clock seconds-per-frame))))
(let ((f0-45 (* f30-0 (seconds-per-frame))))
(set! (-> s4-2 y) 0.0)
(let ((v1-104 s4-2))
(if (< f0-45 (sqrtf (+ (* (-> v1-104 x) (-> v1-104 x)) (* (-> v1-104 z) (-> v1-104 z)))))
@ -1160,7 +1157,7 @@
(s4-0 (forward-up-nopitch->quaternion (new-stack-quaternion0) gp-0 s3-0))
(s3-1 (forward-up-nopitch->quaternion (new-stack-quaternion0) s5-0 s3-0))
(f0-2 (acos (vector-dot gp-0 s5-0)))
(f1-2 (* (-> self control current-surface turnvv) (-> self clock seconds-per-frame)))
(f1-2 (* (-> self control current-surface turnvv) (seconds-per-frame)))
)
(quaternion-slerp!
(-> self control dir-targ)
@ -1433,7 +1430,7 @@
(.svf (&-> a1-9 quad) vf6)
)
(let ((f0-13 (lerp-scale 1.0 0.0 (- (-> s2-0 y) (-> self control gspot-pos y)) 819.2 2048.0)))
(seek! (-> self leg-ik s5-0 user-blend) f0-13 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> self leg-ik s5-0 user-blend) f0-13 (* 4.0 (seconds-per-frame)))
)
(let ((a1-12 (-> gp-0 start-pos)))
(let ((v1-63 s2-0))
@ -1510,11 +1507,7 @@
(if (>= (current-time) (-> self control additional-decaying-velocity-decay-start-time))
(vector-normalize!
(-> self control additional-decaying-velocity)
(seek
(vector-length (-> self control additional-decaying-velocity))
0.0
(* 40960.0 (-> self clock seconds-per-frame))
)
(seek (vector-length (-> self control additional-decaying-velocity)) 0.0 (* 40960.0 (seconds-per-frame)))
)
)
(cond
@ -1531,10 +1524,10 @@
(f0-3 (vector-dot (-> self control transv) v1-22))
)
(if (< f0-3 0.0)
(set! f30-0 (seek f30-0 0.0 (* -1.0 (-> self clock seconds-per-frame) f0-3)))
(set! f30-0 (seek f30-0 0.0 (* -1.0 (seconds-per-frame) f0-3)))
)
)
(let ((f0-7 (seek f30-0 0.0 (* 28672.0 (-> self clock seconds-per-frame)))))
(let ((f0-7 (seek f30-0 0.0 (* 28672.0 (seconds-per-frame)))))
(vector-normalize! (-> self control additional-decaying-velocity) f0-7)
)
)
@ -1834,23 +1827,23 @@
(seek!
(-> self hair 0 twist-max z)
(lerp-scale 0.0 1820.4445 (vector-length (-> self control transv)) 0.0 122880.0)
(* 65536.0 (-> self clock seconds-per-frame))
(* 65536.0 (seconds-per-frame))
)
(seek!
(-> self hair 0 twist-speed-x)
(lerp-scale 0.5 4.0 (vector-length (-> self control transv)) 0.0 122880.0)
(* 10.0 (-> self clock seconds-per-frame))
(* 10.0 (seconds-per-frame))
)
(let ((f0-9 (+ (-> self hair 0 twist z) (* (-> self hair 0 twist-speed-x) (-> self clock seconds-per-frame)))))
(let ((f0-9 (+ (-> self hair 0 twist z) (* (-> self hair 0 twist-speed-x) (seconds-per-frame)))))
(set! (-> self hair 0 twist z) (- f0-9 (* (the float (the int (/ f0-9 1.0))) 1.0)))
)
(if (and (focus-test? self pilot) (nonzero? (-> self pilot)) (= (-> self pilot stance) 1))
(seek!
(-> self hair 0 twist-max w)
(lerp-scale 0.0 9102.223 (vector-length (-> self control transv)) 0.0 122880.0)
(* 65536.0 (-> self clock seconds-per-frame))
(* 65536.0 (seconds-per-frame))
)
(seek! (-> self hair 0 twist-max w) 0.0 (* 65536.0 (-> self clock seconds-per-frame)))
(seek! (-> self hair 0 twist-max w) 0.0 (* 65536.0 (seconds-per-frame)))
)
(trs-set!
(-> self hair 0)
@ -1865,14 +1858,14 @@
(seek!
(-> self hair 1 twist-max z)
(lerp-scale 0.0 5461.3335 (vector-length (-> self control transv)) 4096.0 122880.0)
(* 65536.0 (-> self clock seconds-per-frame))
(* 65536.0 (seconds-per-frame))
)
(seek!
(-> self hair 1 twist-speed-x)
(lerp-scale 1.0 8.0 (vector-length (-> self control transv)) 4096.0 122880.0)
(* 10.0 (-> self clock seconds-per-frame))
(* 10.0 (seconds-per-frame))
)
(let ((f0-33 (+ (-> self hair 1 twist z) (* (-> self hair 1 twist-speed-x) (-> self clock seconds-per-frame)))))
(let ((f0-33 (+ (-> self hair 1 twist z) (* (-> self hair 1 twist-speed-x) (seconds-per-frame)))))
(set! (-> self hair 1 twist z) (- f0-33 (* (the float (the int (/ f0-33 1.0))) 1.0)))
)
(trs-set!
@ -1905,7 +1898,7 @@
)
)
)
(seek! (-> self control bend-amount) f0-1 (* (-> self control bend-speed) (-> self clock seconds-per-frame)))
(seek! (-> self control bend-amount) f0-1 (* (-> self control bend-speed) (seconds-per-frame)))
)
(set! (-> self control dynam gravity-normal quad) (-> self control standard-dynamics gravity-normal quad))
(vector-float*!
@ -2053,10 +2046,10 @@
((-> s5-0 pilot-edge-grab?)
(case (-> s5-0 pilot-edge-grab?)
(('target-jump)
(seek! (-> s5-0 pilot-grab-interp) 1.0 (* 2.0 (-> self clock seconds-per-frame)))
(seek! (-> s5-0 pilot-grab-interp) 1.0 (* 2.0 (seconds-per-frame)))
)
(else
(seek! (-> s5-0 pilot-grab-interp) 1.0 (* 1.5 (-> self clock seconds-per-frame)))
(seek! (-> s5-0 pilot-grab-interp) 1.0 (* 1.5 (seconds-per-frame)))
)
)
(let* ((f0-11 (fmin 1.0 (* 1.5 (-> s5-0 pilot-grab-interp))))
@ -2385,12 +2378,12 @@
)
(cond
((>= f0-1 (-> self excitement))
(seek! (-> self excitement) f0-1 (* 6.0 (-> self clock seconds-per-frame)))
(seek! (-> self excitement) f0-1 (* 6.0 (seconds-per-frame)))
)
((focus-test? self dead ignore hit)
)
(else
(seek! (-> self excitement) f0-1 (* 0.25 (-> self clock seconds-per-frame)))
(seek! (-> self excitement) f0-1 (* 0.25 (seconds-per-frame)))
)
)
)
@ -3084,7 +3077,8 @@
(set! arg0 (get-current-continue-forced *game-info*))
)
(set-continue! *game-info* arg0 #f)
(stack-size-set! (-> obj main-thread) 2048) ;; changed from 1024
;; og:preserve-this changed from 1024
(stack-size-set! (-> obj main-thread) 2048)
(logior! (-> obj mask) (process-mask target))
(set! (-> obj state-hook) (the-as (function none :behavior target) nothing))
(cond

View File

@ -186,50 +186,15 @@
)
)
)
(let ((t9-5 sp-launch-particles-var)
(a0-7 *sp-particle-system-2d*)
(a1-8 (-> *part-id-table* 945))
(a2-5 *launch-matrix*)
)
(set! (-> a2-5 trans quad) (-> arg1 quad))
(t9-5 a0-7 a1-8 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-6 sp-launch-particles-var)
(a0-8 *sp-particle-system-2d*)
(a1-9 (-> *part-id-table* 940))
(a2-6 *launch-matrix*)
)
(set! (-> a2-6 trans quad) (-> arg1 quad))
(t9-6 a0-8 a1-9 a2-6 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 945) arg1)
(launch-particles (-> *part-id-table* 940) arg1)
(cond
((!= (-> *setting-control* user-current under-water-pitch-mod) 0.0)
(let ((t9-7 sp-launch-particles-var)
(a0-9 *sp-particle-system-2d*)
(a1-10 (-> *part-id-table* 945))
(a2-7 *launch-matrix*)
)
(set! (-> a2-7 trans quad) (-> arg1 quad))
(t9-7 a0-9 a1-10 a2-7 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 945) arg1)
)
(else
(let ((t9-8 sp-launch-particles-var)
(a0-10 *sp-particle-system-2d*)
(a1-11 (-> *part-id-table* 941))
(a2-8 *launch-matrix*)
)
(set! (-> a2-8 trans quad) (-> arg1 quad))
(t9-8 a0-10 a1-11 a2-8 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-9 sp-launch-particles-var)
(a0-11 *sp-particle-system-2d*)
(a1-12 (-> *part-id-table* 943))
(a2-9 *launch-matrix*)
)
(set! (-> a2-9 trans quad) (-> arg1 quad))
(t9-9 a0-11 a1-12 a2-9 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(launch-particles (-> *part-id-table* 941) arg1)
(launch-particles (-> *part-id-table* 943) arg1)
)
)
0

View File

@ -128,20 +128,18 @@
(let ((f26-1 (* (deg-diff f26-0 (y-angle (-> self control))) (-> self clock frames-per-second))))
(cond
((< 910.2222 (fabs f26-1))
(set! f28-0 (seek f28-0 1.0 (* 16.0 (-> self clock seconds-per-frame))))
(set! f28-0 (seek f28-0 1.0 (* 16.0 (seconds-per-frame))))
(set! gp-1 #t)
)
(else
(set! f28-0 (seek f28-0 0.0 (* 6.0 (-> self clock seconds-per-frame))))
(set! f28-0 (seek f28-0 0.0 (* 6.0 (seconds-per-frame))))
(when (and gp-1 (= f28-0 0.0))
(set! gp-1 #f)
(sound-play "mech-twitch")
)
)
)
(set! f30-0
(seek f30-0 (lerp-scale 1.0 0.0 (fabs f26-1) 3640.889 16384.0) (* 10.0 (-> self clock seconds-per-frame)))
)
(set! f30-0 (seek f30-0 (lerp-scale 1.0 0.0 (fabs f26-1) 3640.889 16384.0) (* 10.0 (seconds-per-frame))))
(let ((v1-41 (-> self skel effect)))
(set! (-> v1-41 channel-offset) (cond
((< 0.8 (- 1.0 f28-0))
@ -305,17 +303,11 @@
(set! (-> self control unknown-word04)
(the-as uint (+ (the-as float (-> self control unknown-word04)) f26-1))
)
(set! f30-0 (seek
f30-0
(lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 16384.0 32768.0)
(* 2.0 (-> self clock seconds-per-frame))
)
(set! f30-0
(seek f30-0 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 16384.0 32768.0) (* 2.0 (seconds-per-frame)))
)
(set! f28-0 (seek
f28-0
(lerp-scale 1.0 0.0 (-> self control ctrl-xz-vel) 0.0 12288.0)
(* 2.0 (-> self clock seconds-per-frame))
)
(set! f28-0
(seek f28-0 (lerp-scale 1.0 0.0 (-> self control ctrl-xz-vel) 0.0 12288.0) (* 2.0 (seconds-per-frame)))
)
(let ((v1-39 (-> self skel effect)))
(set! (-> v1-39 channel-offset) (if (< 0.5 f30-0)
@ -698,7 +690,7 @@
)
(cond
((< (-> self mech forward-vel) 0.0)
(seek! (-> self mech forward-vel) -0.04096 (* 122880.0 (-> self clock seconds-per-frame)))
(seek! (-> self mech forward-vel) -0.04096 (* 122880.0 (seconds-per-frame)))
)
((let ((a0-43 (ja-group)))
(and a0-43 (or (= a0-43 (-> self draw art-group data 335)) (= a0-43 (-> self draw art-group data 353))))
@ -721,7 +713,7 @@
((and a0-50 (= a0-50 (-> self draw art-group data 333)))
(cond
((< v1-142 (seconds 0.465))
(seek! (-> self mech forward-vel) 0.0 (* 20480.0 (-> self clock seconds-per-frame)))
(seek! (-> self mech forward-vel) 0.0 (* 20480.0 (seconds-per-frame)))
(set! s3-2 #f)
)
((< v1-142 (seconds 0.53))
@ -733,7 +725,7 @@
)
)
((< v1-142 (seconds 0.465))
(seek! (-> self mech forward-vel) 0.0 (* 20480.0 (-> self clock seconds-per-frame)))
(seek! (-> self mech forward-vel) 0.0 (* 20480.0 (seconds-per-frame)))
(set! s3-2 #f)
)
((< v1-142 (seconds 0.53))
@ -826,7 +818,7 @@
((cpad-hold? (-> self control cpad number) x)
(cond
((= f0-2 0.0)
(seek! (-> self mech jump-thrust) 0.0 (* 245760.0 (-> self clock seconds-per-frame)))
(seek! (-> self mech jump-thrust) 0.0 (* 245760.0 (seconds-per-frame)))
)
((!= f0-2 (-> *TARGET-bank* mech-jump-thrust-fuel))
(let ((f26-0
@ -839,7 +831,7 @@
(seek!
(-> self mech jump-thrust)
(- (- (-> self control dynam gravity-length) f30-0) f26-0)
(* 8192000.0 (-> self clock seconds-per-frame))
(* 8192000.0 (seconds-per-frame))
)
(set! (-> self mech thruster-flame-width) (* 0.75 f28-0))
(set! (-> self mech thruster-flame-length) f28-0)
@ -854,7 +846,7 @@
(seek! (-> self mech jump-thrust-fuel) 0.0 (the float (- (current-time) (-> self clock old-frame-counter))))
)
(else
(seek! (-> self mech jump-thrust) 0.0 (* 491520.0 (-> self clock seconds-per-frame)))
(seek! (-> self mech jump-thrust) 0.0 (* 491520.0 (seconds-per-frame)))
(set! (-> self mech thruster-flame-width) (* 0.021428572 (-> self mech jump-thrust)))
(set! (-> self mech thruster-flame-length) (* 0.028571429 (-> self mech jump-thrust)))
)
@ -867,7 +859,7 @@
)
(let* ((f0-37 (vector-length v1-85))
(f1-9 f0-37)
(f2-2 (+ f30-0 (* (-> self mech jump-thrust) (-> self clock seconds-per-frame))))
(f2-2 (+ f30-0 (* (-> self mech jump-thrust) (seconds-per-frame))))
)
(vector+!
(-> self control transv)
@ -1215,7 +1207,7 @@
(set! (-> self trans-hook)
(lambda :behavior target
()
(vector-seek! (-> self draw color-mult) *zero-vector* (-> self clock seconds-per-frame))
(vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame))
(let ((v1-2 (new-stack-vector0))
(f0-2 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))
)
@ -1370,7 +1362,7 @@
(vector-seek!
(-> self draw color-mult)
(new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0)
(* 5.0 (-> self clock seconds-per-frame))
(* 5.0 (seconds-per-frame))
)
(suspend)
(ja :num! (seek!))
@ -1619,7 +1611,7 @@
(else
(ja-no-eval :num! (seek! (ja-aframe 8.0 0)))
(while (not (ja-done? 0))
(set! f30-0 (seek f30-0 f28-0 (* 5.0 (-> self clock seconds-per-frame))))
(set! f30-0 (seek f30-0 f28-0 (* 5.0 (seconds-per-frame))))
(let ((v1-120 (-> self skel root-channel 1)))
(set! (-> v1-120 frame-interp 1) f30-0)
(set! (-> v1-120 frame-interp 0) f30-0)
@ -1660,7 +1652,7 @@
(sound-play "mech-servo-up")
(ja-no-eval :num! (seek!))
(while (not (ja-done? 0))
(set! f30-0 (seek f30-0 f28-0 (* 5.0 (-> self clock seconds-per-frame))))
(set! f30-0 (seek f30-0 f28-0 (* 5.0 (seconds-per-frame))))
(let ((v1-174 (-> self skel root-channel 1)))
(set! (-> v1-174 frame-interp 1) f30-0)
(set! (-> v1-174 frame-interp 0) f30-0)
@ -1790,7 +1782,7 @@
(let ((s5-5 (the-as carry-info (send-event-function (handle->process (-> self carry other)) a1-10))))
(when s5-5
(if (< 20.0 (ja-aframe-num 0))
(seek! (-> s5-5 grab-trans-blend) 1.0 (* 2.0 (-> self clock seconds-per-frame)))
(seek! (-> s5-5 grab-trans-blend) 1.0 (* 2.0 (seconds-per-frame)))
)
(let ((s3-0 (-> s5-5 process 0 control))
(s5-6 (new 'stack-no-clear 'collide-query))
@ -1955,8 +1947,8 @@
(suspend)
(let ((f28-1 (* (deg-diff f28-0 (y-angle (-> self control))) (-> self clock frames-per-second))))
(set! f30-0 (if (< 910.2222 (fabs f28-1))
(seek f30-0 1.0 (* 16.0 (-> self clock seconds-per-frame)))
(seek f30-0 0.0 (* 6.0 (-> self clock seconds-per-frame)))
(seek f30-0 1.0 (* 16.0 (seconds-per-frame)))
(seek f30-0 0.0 (* 6.0 (seconds-per-frame)))
)
)
(let* ((f0-9 (current-cycle-distance (-> self skel)))
@ -2073,11 +2065,8 @@
(set! (-> self control unknown-word04)
(the-as uint (+ (the-as float (-> self control unknown-word04)) f28-1))
)
(set! f30-0 (seek
f30-0
(lerp-scale 1.0 0.0 (-> self control ctrl-xz-vel) 0.0 8192.0)
(* 2.0 (-> self clock seconds-per-frame))
)
(set! f30-0
(seek f30-0 (lerp-scale 1.0 0.0 (-> self control ctrl-xz-vel) 0.0 8192.0) (* 2.0 (seconds-per-frame)))
)
(ja :num! (loop! f28-1))
)
@ -2228,7 +2217,7 @@
(set! (-> self control unknown-word04) (the-as uint #f))
(set! f28-0 32768.0)
)
(seek f28-0 0.0 (* 65536.0 (-> self clock seconds-per-frame)))
(seek f28-0 0.0 (* 65536.0 (seconds-per-frame)))
)
((< 0.0 f0-2)
(let ((v1-47 (ja-group)))
@ -2243,7 +2232,7 @@
(ja :group! (-> self draw art-group data 345) :num! (identity (ja-aframe f26-0 0)) :dist 16384.0)
)
)
(seek f28-0 49152.0 (* 24576.0 (-> self clock seconds-per-frame)))
(seek f28-0 49152.0 (* 24576.0 (seconds-per-frame)))
)
((< f0-2 0.0)
(let ((v1-71 (ja-group)))
@ -2258,10 +2247,10 @@
(ja :group! (-> self draw art-group data 346) :num! (identity (ja-aframe f26-0 0)) :dist 16384.0)
)
)
(seek f28-0 -49152.0 (* 24576.0 (-> self clock seconds-per-frame)))
(seek f28-0 -49152.0 (* 24576.0 (seconds-per-frame)))
)
(else
(seek f28-0 0.0 (* 32768.0 (-> self clock seconds-per-frame)))
(seek f28-0 0.0 (* 32768.0 (seconds-per-frame)))
)
)
)
@ -2279,7 +2268,7 @@
0.0
49152.0
)
(* 2.0 (-> self clock seconds-per-frame))
(* 2.0 (seconds-per-frame))
)
)
(sound-play-by-name
@ -2298,7 +2287,7 @@
(seek!
(-> self mech jump-thrust)
(lerp-scale 0.0 245760.0 (fabs f28-0) 0.0 49152.0)
(* 491520.0 (-> self clock seconds-per-frame))
(* 491520.0 (seconds-per-frame))
)
(set! (-> self mech thruster-flame-width) (* 0.021428572 (-> self mech jump-thrust)))
(set! (-> self mech thruster-flame-length) (* 0.028571429 (-> self mech jump-thrust)))
@ -2548,7 +2537,7 @@
(set! (-> a1-3 message) 'carry-info)
(let ((gp-1 (the-as carry-info (send-event-function (handle->process (-> self carry other)) a1-3))))
(if gp-1
(seek! (-> gp-1 grab-trans-blend) 1.0 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-1 grab-trans-blend) 1.0 (* 4.0 (seconds-per-frame)))
)
)
)

View File

@ -190,6 +190,7 @@
(go-virtual pickup (method-of-object self wait-for-return))
)
)
;; og:preserve-this target-look-at-me! macro
(target-look-at-me! :trans (vector+! (new 'stack-no-clear 'vector) (the-as vector (-> self root root-prim prim-core)) (new 'static 'vector :y 2048.0 :w 1.0)))
(mech-method-24 self)
(suspend)
@ -426,7 +427,7 @@ This commonly includes things such as:
)
:code (behavior ()
(while (< 0.0 (-> self root scale x))
(seek! (-> self root scale x) 0.0 (* 8.0 (-> self clock seconds-per-frame)))
(seek! (-> self root scale x) 0.0 (* 8.0 (seconds-per-frame)))
(set! (-> self root scale y) (-> self root scale x))
(ja-post)
(suspend)
@ -463,15 +464,15 @@ This commonly includes things such as:
(let ((f30-0 0.0))
(logclear! (-> self draw status) (draw-control-status no-draw))
(while (< (-> self root scale x) 1.0)
(seek! (-> self root scale x) 1.0 (* 8.0 (-> self clock seconds-per-frame)))
(seek! (-> self root scale x) 1.0 (* 8.0 (seconds-per-frame)))
(set! (-> self root scale y) (-> self root scale x))
(set! f30-0 (seek f30-0 1.0 (* 2.0 (-> self clock seconds-per-frame))))
(set! f30-0 (seek f30-0 1.0 (* 2.0 (seconds-per-frame))))
(ja :num! (loop! f30-0))
(ja-post)
(suspend)
)
(until #f
(set! f30-0 (seek f30-0 1.0 (* 0.25 (-> self clock seconds-per-frame))))
(set! f30-0 (seek f30-0 1.0 (* 0.25 (seconds-per-frame))))
(ja :num! (loop! f30-0))
(ja-post)
(suspend)

View File

@ -85,10 +85,10 @@
(* (lerp-scale 0.0 5.0 (fabs (-> gp-0 board trotyv)) 0.0 182044.44) (-> self special-anim-interp))
)
(set! (-> self special-anim-frame) (-> arg1 z))
(seek! (-> self special-anim-interp) 1.0 (* 8.0 (-> self clock seconds-per-frame)))
(seek! (-> self special-anim-interp) 1.0 (* 8.0 (seconds-per-frame)))
)
(else
(seek! (-> self special-anim-interp) 0.0 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> self special-anim-interp) 0.0 (* 4.0 (seconds-per-frame)))
(set! (-> arg1 z) (* (-> self special-anim-frame) (-> self special-anim-interp)))
)
)

View File

@ -299,7 +299,7 @@
)
)
(until (ja-done? 0)
(seek! (-> self control bend-target) 0.0 (-> self clock seconds-per-frame))
(seek! (-> self control bend-target) 0.0 (seconds-per-frame))
(suspend)
(ja :num! (seek!))
)
@ -323,7 +323,7 @@
)
)
(until (ja-done? 0)
(seek! (-> self control bend-target) 0.0 (-> self clock seconds-per-frame))
(seek! (-> self control bend-target) 0.0 (seconds-per-frame))
(suspend)
(ja :num! (seek!))
)
@ -343,7 +343,7 @@
)
)
(until (ja-done? 0)
(seek! (-> self control bend-target) 0.0 (-> self clock seconds-per-frame))
(seek! (-> self control bend-target) 0.0 (seconds-per-frame))
(suspend)
(ja :num! (seek!))
)
@ -919,8 +919,8 @@
)
(until (ja-done? 0)
(suspend)
;; pc port note: patched for high fps
(ja :num! (seek! max (/ (* (fmax 20480.0 (-> self control ctrl-xz-vel)) (seconds-per-frame))
;; og:preserve-this patched for high fps
(ja :num! (seek! max (/ (* (fmax 20480.0 (-> self control ctrl-xz-vel)) (seconds-per-frame-high-fps))
(/ (-> *TARGET-bank* run-up-cycle-dist) (-> *TARGET-bank* run-cycle-length))
)
)
@ -1128,15 +1128,12 @@
(set! f26-0 (seek
f26-0
(fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control ctrl-xz-vel)))))
(* 2.0 (-> self clock seconds-per-frame))
(* 2.0 (seconds-per-frame))
)
)
(if (and (focus-test? self dark) (nonzero? (-> self darkjak)))
(set! f26-0 (seek
f26-0
(lerp-scale f26-0 (* 0.7 f26-0) sv-16 1820.4445 3640.889)
(* 2.0 (-> self clock seconds-per-frame))
)
(set! f26-0
(seek f26-0 (lerp-scale f26-0 (* 0.7 f26-0) sv-16 1820.4445 3640.889) (* 2.0 (seconds-per-frame)))
)
)
(cond
@ -1290,7 +1287,7 @@
(set! (-> s5-0 param 0)
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 54)) frames num-frames) -1))
)
(let ((f30-1 (seek f30-0 1.0 (* 0.5 (-> self clock seconds-per-frame)))))
(let ((f30-1 (seek f30-0 1.0 (* 0.5 (seconds-per-frame)))))
(set! (-> s5-0 param 1) f30-1)
(set! (-> s5-0 frame-num) 0.0)
(joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 54)) num-func-seek!)
@ -1356,7 +1353,7 @@
(suspend)
(let ((s5-1 (-> self skel root-channel 0)))
(set! (-> s5-1 param 0) (the float (+ (-> s5-1 frame-group frames num-frames) -1)))
(set! f30-1 (seek f30-1 1.0 (* 0.5 (-> self clock seconds-per-frame))))
(set! f30-1 (seek f30-1 1.0 (* 0.5 (seconds-per-frame))))
(set! (-> s5-1 param 1) f30-1)
(joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!)
)
@ -1776,7 +1773,7 @@
(quaternion-rotate-y!
(-> self control quat-for-control)
(-> self control quat-for-control)
(* f30-0 (-> self clock seconds-per-frame))
(* f30-0 (seconds-per-frame))
)
(suspend)
(ja :num! (loop!))
@ -1794,7 +1791,7 @@
(quaternion-rotate-y!
(-> self control quat-for-control)
(-> self control quat-for-control)
(* f30-0 (-> self clock seconds-per-frame))
(* f30-0 (seconds-per-frame))
)
)
(else

View File

@ -235,7 +235,7 @@
(target-danger-set! 'harmless #f)
(ja-no-eval :num! (seek! (ja-aframe 5.0 0)))
(while (not (ja-done? 0))
(set! f30-0 (seek f30-0 f28-0 (* 5.0 (-> self clock seconds-per-frame))))
(set! f30-0 (seek f30-0 f28-0 (* 5.0 (seconds-per-frame))))
(let ((v1-45 (-> self skel root-channel 1)))
(set! (-> v1-45 frame-interp 1) f30-0)
(set! (-> v1-45 frame-interp 0) f30-0)
@ -247,7 +247,7 @@
(target-collide-set! 'carry 0.0)
(ja-no-eval :num! (seek!))
(while (not (ja-done? 0))
(set! f30-0 (seek f30-0 f28-0 (* 5.0 (-> self clock seconds-per-frame))))
(set! f30-0 (seek f30-0 f28-0 (* 5.0 (seconds-per-frame))))
(let ((v1-70 (-> self skel root-channel 1)))
(set! (-> v1-70 frame-interp 1) f30-0)
(set! (-> v1-70 frame-interp 0) f30-0)
@ -259,7 +259,7 @@
(set! (-> a1-22 message) 'carry-info)
(let ((gp-4 (the-as carry-info (send-event-function (handle->process (-> self carry other)) a1-22))))
(if gp-4
(seek! (-> gp-4 grab-trans-blend) 0.0 (* 2.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-4 grab-trans-blend) 0.0 (* 2.0 (seconds-per-frame)))
)
)
)
@ -356,7 +356,7 @@
(let ((gp-4 (the-as carry-info (send-event-function (handle->process (-> self carry other)) a1-9))))
(when gp-4
(if (< 22.0 (ja-aframe-num 0))
(seek! (-> gp-4 grab-trans-blend) 1.0 (* 2.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-4 grab-trans-blend) 1.0 (* 2.0 (seconds-per-frame)))
)
(let ((s4-0 (-> gp-4 process 0 control))
(gp-5 (new 'stack-no-clear 'collide-query))
@ -387,7 +387,7 @@
(set! (-> a1-14 message) 'carry-info)
(let ((gp-6 (the-as carry-info (send-event-function (handle->process (-> self carry other)) a1-14))))
(if gp-6
(seek! (-> gp-6 grab-trans-blend) 0.0 (* 2.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-6 grab-trans-blend) 0.0 (* 2.0 (seconds-per-frame)))
)
)
)
@ -683,7 +683,7 @@
(seek!
(-> self control unknown-float35)
(fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control ctrl-xz-vel)))))
(-> self clock seconds-per-frame)
(seconds-per-frame)
)
(none)
)
@ -735,7 +735,7 @@
(set! (-> a1-3 message) 'carry-info)
(let ((gp-1 (the-as carry-info (send-event-function (handle->process (-> self carry other)) a1-3))))
(if gp-1
(seek! (-> gp-1 grab-trans-blend) 1.0 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-1 grab-trans-blend) 1.0 (* 4.0 (seconds-per-frame)))
)
)
)
@ -776,7 +776,7 @@
(set! (-> a1-11 message) 'carry-info)
(let ((gp-4 (the-as carry-info (send-event-function (handle->process (-> self carry other)) a1-11))))
(if gp-4
(seek! (-> gp-4 grab-trans-blend) 0.0 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> gp-4 grab-trans-blend) 0.0 (* 4.0 (seconds-per-frame)))
)
)
)

View File

@ -125,7 +125,7 @@
)
)
(else
(seek! (-> self darkjak-interp) 0.0 (* 2.0 (-> self clock seconds-per-frame)))
(seek! (-> self darkjak-interp) 0.0 (* 2.0 (seconds-per-frame)))
(if (= (-> self darkjak-interp) 0.0)
(set! (-> self darkjak-giant-interp) 1.0)
)
@ -217,13 +217,9 @@
(not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp)))
(not (movie?))
)
(let ((gp-1 sp-launch-particles-var)
(s5-0 *sp-particle-system-2d*)
(s4-0 (-> *part-id-table* 178))
(s2-0 *launch-matrix*)
)
(set! (-> s2-0 trans quad) (-> (process-drawable-random-point! self (new 'stack-no-clear 'vector)) quad))
(gp-1 s5-0 s4-0 s2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
(launch-particles
(-> *part-id-table* 178)
(process-drawable-random-point! self (new 'stack-no-clear 'vector))
)
(cond
((rand-vu-percent? 0.25)
@ -483,7 +479,7 @@
((and v1-30 (= v1-30 (-> self draw art-group data 412)))
(ja-no-eval :num! (seek! 0.0))
(while (not (ja-done? 0))
(seek! (-> self darkjak-interp) 0.0 (* 2.0 (-> self clock seconds-per-frame)))
(seek! (-> self darkjak-interp) 0.0 (* 2.0 (seconds-per-frame)))
(suspend)
(ja-eval)
)
@ -808,7 +804,7 @@
)
)
((< sv-16 0.0)
(set! sv-16 (seek sv-16 -0.04096 (* 491520.0 (-> self clock seconds-per-frame))))
(set! sv-16 (seek sv-16 -0.04096 (* 491520.0 (seconds-per-frame))))
(set-forward-vel sv-16)
)
((and (nonzero? (-> self control unknown-time-frame18))
@ -985,8 +981,8 @@
(defmethod update-clock! darkjak-info ((obj darkjak-info) (arg0 int))
(when (-> obj clock-on)
(+! (-> obj clock-pos) (* (-> obj clock-vel) (-> self clock seconds-per-frame)))
(+! (-> obj clock-vel) (* 4.0 (-> self clock seconds-per-frame)))
(+! (-> obj clock-pos) (* (-> obj clock-vel) (seconds-per-frame)))
(+! (-> obj clock-vel) (* 4.0 (seconds-per-frame)))
(cond
((< 1.0 (-> obj clock-pos))
(set! (-> obj clock-pos) 1.0)
@ -1017,7 +1013,7 @@
)
(defbehavior target-darkjak-bomb-collide target ((arg0 float) (arg1 float))
(seek! (-> (the-as (pointer float) arg0) 0) arg1 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> (the-as (pointer float) arg0) 0) arg1 (* 4.0 (seconds-per-frame)))
(set! (-> self control bomb-scale) (-> (the-as (pointer float) arg0) 0))
(target-danger-set! 'bomb #f)
(update-transforms (-> self control))
@ -1167,7 +1163,7 @@
(vector-! v1-92 (-> self control transv) (vector-float*! v1-92 (-> self control dynam gravity-normal) f0-35))
(let* ((f1-5 (vector-length v1-92))
(f2-0 f1-5)
(f0-36 (+ f0-35 (* -491520.0 (-> self clock seconds-per-frame))))
(f0-36 (+ f0-35 (* -491520.0 (seconds-per-frame))))
)
(vector+!
(-> self control transv)
@ -1194,7 +1190,7 @@
)
(let* ((f1-8 (vector-length v1-105))
(f2-1 f1-8)
(f0-43 (+ f0-42 (* -491520.0 (-> self clock seconds-per-frame))))
(f0-43 (+ f0-42 (* -491520.0 (seconds-per-frame))))
)
(vector+!
(-> self control transv)
@ -1863,7 +1859,7 @@
(set! sv-92 1.0)
)
)
(set! sv-88 (seek sv-88 (the-as float sv-92) (* 6.0 (-> self clock seconds-per-frame))))
(set! sv-88 (seek sv-88 (the-as float sv-92) (* 6.0 (seconds-per-frame))))
(ja :num! (loop!))
(let ((a0-60 (-> self skel root-channel 1)))
(let ((f0-17 sv-88))

View File

@ -123,6 +123,7 @@
(reserve-free *art-control* (-> *art-control* reserve-buffer heap))
)
(when (logtest? (-> arg0 flags) (continue-flags demo demo-movie))
;; og:preserve-this
(#unless DEMO_HACK
(set! (-> ctywide memory-mode) (load-buffer-mode small-edge)))
0
@ -895,7 +896,7 @@
#t
(let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (ja-group) frames num-frames) -1)) (ja-step 0))))))
(until v1-29
(+! f30-1 (* (-> arg0 shove-back) f28-1 (-> self clock seconds-per-frame)))
(+! f30-1 (* (-> arg0 shove-back) f28-1 (seconds-per-frame)))
(set! s1-1 (target-hit-push s3-0 s2-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0))
(suspend)
(ja :num! (seek!))
@ -903,7 +904,7 @@
)
(while (and (or (not (logtest? (-> self control status) (collide-status on-surface))) s1-1) (!= s1-1 'stuck))
(arg2)
(+! f30-1 (* (-> arg0 shove-back) f28-1 (-> self clock seconds-per-frame)))
(+! f30-1 (* (-> arg0 shove-back) f28-1 (seconds-per-frame)))
(set! s1-1 (target-hit-push s3-0 s2-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0))
(if (not s1-1)
(logclear! (-> self focus-status) (focus-status hit))
@ -1180,7 +1181,7 @@
)
(let* ((f1-10 (vector-length v1-157))
(f2-1 f1-10)
(f0-40 (+ f0-39 (* 286720.0 (-> self clock seconds-per-frame))))
(f0-40 (+ f0-39 (* 286720.0 (seconds-per-frame))))
)
(vector+!
(-> self control transv)
@ -1781,7 +1782,7 @@
(vector-seek!
(-> self draw color-mult)
(new 'static 'vector :x 0.5 :y 0.5 :z 0.5 :w 1.0)
(* 5.0 (-> self clock seconds-per-frame))
(* 5.0 (seconds-per-frame))
)
(suspend)
(ja :num! (seek!))
@ -1907,7 +1908,7 @@
(set! v1-24 'target-hit-ground-hard)
(goto cfg-17)
)
(vector-seek! (-> self draw color-mult) *zero-vector* (-> self clock seconds-per-frame))
(vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame))
(let ((v1-49 (new-stack-vector0))
(f0-7 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv))))
)
@ -1946,7 +1947,7 @@
:frame-num 0.0
)
(until (ja-done? 0)
(vector-seek! (-> self draw color-mult) *identity-vector* (-> self clock seconds-per-frame))
(vector-seek! (-> self draw color-mult) *identity-vector* (seconds-per-frame))
(suspend)
(ja :num! (seek!))
)
@ -2017,11 +2018,7 @@
)
(until (ja-done? 0)
(if (< (+ -10240.0 (-> self water height)) (-> self control trans y))
(seek!
(-> self control trans y)
(+ -10240.0 (-> self water height))
(* 81920.0 (-> self clock seconds-per-frame))
)
(seek! (-> self control trans y) (+ -10240.0 (-> self water height)) (* 81920.0 (seconds-per-frame)))
)
(suspend)
(ja :num! (seek!))

View File

@ -65,10 +65,10 @@
#t
)
((< (-> self control unknown-float003) f30-0)
(seek! (-> self control unknown-float003) f30-0 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> self control unknown-float003) f30-0 (* 4.0 (seconds-per-frame)))
)
(else
(seek! (-> self control unknown-float003) f30-0 (-> self clock seconds-per-frame))
(seek! (-> self control unknown-float003) f30-0 (seconds-per-frame))
)
)
)
@ -1685,11 +1685,11 @@
(seek!
(-> self gun top-anim-tilt-up)
(lerp-scale -1820.4445 0.0 f0-8 61440.0 122880.0)
(* 5461.3335 (-> self clock seconds-per-frame))
(* 5461.3335 (seconds-per-frame))
)
)
((!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)
(seek! (-> self gun top-anim-tilt-up) 0.0 (* 1820.4445 (-> self clock seconds-per-frame)))
(seek! (-> self gun top-anim-tilt-up) 0.0 (* 1820.4445 (seconds-per-frame)))
)
)
)
@ -1726,10 +1726,10 @@
(focus-test? self pilot-riding)
)
)
(seek! (-> self upper-body twist z) 0.0 (* 65536.0 (-> self clock seconds-per-frame)))
(seek! (-> self upper-body twist z) 0.0 (* 65536.0 (seconds-per-frame)))
)
((logtest? (surface-flag gun-no-twist) (-> self control current-surface flags))
(seek! (-> self upper-body twist z) 0.0 (* 16384.0 (-> self clock seconds-per-frame)))
(seek! (-> self upper-body twist z) 0.0 (* 16384.0 (seconds-per-frame)))
)
((and (< 0.0 (-> self control turn-to-magnitude))
(not (logtest? (-> self control current-surface flags) (surface-flag duck)))
@ -1744,7 +1744,7 @@
(set! (-> (new 'stack-no-clear 'vector) quad) (-> self control trans quad))
(if (logtest? (surface-flag gun-no-twist) (-> self control current-surface flags))
(set! (-> self upper-body flex-blend) 0.0)
(seek! (-> self upper-body flex-blend) 1.0 (* 8.0 (-> self clock seconds-per-frame)))
(seek! (-> self upper-body flex-blend) 1.0 (* 8.0 (seconds-per-frame)))
)
(when (logtest? (-> self gun track?) (gun-track-flags gutflags-0))
(set! (-> self gun top-anim-look-at quad) (-> self gun track-trans quad))
@ -1871,8 +1871,8 @@
)
)
(else
(seek! (-> self upper-body flex-blend) 0.0 (* 16.0 (-> self clock seconds-per-frame)))
(seek! (-> self upper-body twist z) 0.0 (* 65536.0 (-> self clock seconds-per-frame)))
(seek! (-> self upper-body flex-blend) 0.0 (* 16.0 (seconds-per-frame)))
(seek! (-> self upper-body twist z) 0.0 (* 65536.0 (seconds-per-frame)))
)
)
0
@ -1935,7 +1935,7 @@
(or (= v1-50 (-> self draw art-group data 247)) (= v1-50 (-> self draw art-group data 254)))
)
)
(seek! (-> self gun top-anim-low-high) 0.0 (* 6.0 (-> self clock seconds-per-frame)))
(seek! (-> self gun top-anim-low-high) 0.0 (* 6.0 (seconds-per-frame)))
(push-anim-to-targ
(-> self skel top-anim)
(the-as art-joint-anim (-> self draw art-group data 247))
@ -1987,7 +1987,7 @@
)
)
)
(seek! (-> self gun top-anim-low-high) 0.0 (* 6.0 (-> self clock seconds-per-frame)))
(seek! (-> self gun top-anim-low-high) 0.0 (* 6.0 (seconds-per-frame)))
(push-anim-to-targ
(-> self skel top-anim)
(the-as art-joint-anim (-> self draw art-group data 295))
@ -2676,19 +2676,17 @@
((4)
(cond
((cpad-hold? (-> self control cpad number) r1)
(seek! (-> gp-0 fire-spinv) 218453.33 (* 145635.56 (-> self clock seconds-per-frame)))
(seek! (-> gp-0 fire-spinv) 218453.33 (* 145635.56 (seconds-per-frame)))
(if (and (nonzero? (-> self gun track-target-hold-time)) (< (current-time) (-> self gun track-target-hold-time)))
(set! (-> gp-0 fire-spinv) 218453.33)
)
)
(else
(seek! (-> gp-0 fire-spinv) 0.0 (* 109226.664 (-> self clock seconds-per-frame)))
(seek! (-> gp-0 fire-spinv) 0.0 (* 109226.664 (seconds-per-frame)))
)
)
(set! (-> gp-0 fire-spin)
(the float
(sar (shl (the int (+ (-> gp-0 fire-spin) (* (-> gp-0 fire-spinv) (-> self clock seconds-per-frame)))) 48) 48)
)
(the float (sar (shl (the int (+ (-> gp-0 fire-spin) (* (-> gp-0 fire-spinv) (seconds-per-frame)))) 48) 48))
)
(set! (-> gp-0 fire-delay) (the-as uint (the int (lerp-scale 120.0 30.0 (-> gp-0 fire-spinv) 0.0 218453.33))))
(when (and (>= (-> gp-0 fire-spinv) 218453.33)

View File

@ -279,11 +279,7 @@
)
0
(set! f30-1
(seek
f30-1
(lerp-scale 1.0 0.0 (-> self control ctrl-xz-vel) 16384.0 32768.0)
(* 4.0 (-> self clock seconds-per-frame))
)
(seek f30-1 (lerp-scale 1.0 0.0 (-> self control ctrl-xz-vel) 16384.0 32768.0) (* 4.0 (seconds-per-frame)))
)
(let ((v1-107 (-> self skel root-channel 1)))
(set! (-> v1-107 frame-interp 1) f24-1)
@ -353,7 +349,7 @@
(seek!
(-> self control unknown-float43)
(fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3))
(* arg1 (-> self clock seconds-per-frame))
(* arg1 (seconds-per-frame))
)
)
(let ((a2-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control))))
@ -370,8 +366,8 @@
)
(set! (-> self control override-quat-alpha) (fabs (-> self control unknown-float43)))
(if (and (-> self next-state) (= (-> self next-state name) 'target-swim-down))
(seek! (-> self control unknown-float001) -6144.0 (* 4096.0 (-> self clock seconds-per-frame)))
(seek! (-> self control unknown-float001) 0.0 (* 2048.0 (-> self clock seconds-per-frame)))
(seek! (-> self control unknown-float001) -6144.0 (* 4096.0 (seconds-per-frame)))
(seek! (-> self control unknown-float001) 0.0 (* 2048.0 (seconds-per-frame)))
)
(set! (-> self control draw-offset y) (-> self control unknown-float001))
)
@ -858,7 +854,7 @@
(f26-0 f28-0)
(f24-0 (+ f0-13 f30-0))
)
(set! f30-0 (seek f30-0 0.0 (* 32768.0 (-> self clock seconds-per-frame))))
(set! f30-0 (seek f30-0 0.0 (* 32768.0 (seconds-per-frame))))
(vector+!
(-> self control transv)
(vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f24-0)
@ -1002,7 +998,7 @@
)
(suspend)
(ja :num! (loop! f30-0))
(set! f30-0 (seek f30-0 1.0 (-> self clock seconds-per-frame)))
(set! f30-0 (seek f30-0 1.0 (seconds-per-frame)))
)
)
#f

View File

@ -165,12 +165,12 @@
1.0
0.0
)
(* 2.0 (-> self clock seconds-per-frame))
(* 2.0 (seconds-per-frame))
)
(seek!
(-> self tube tube-sound-pitch)
(lerp-scale -0.15 0.15 (-> self control ctrl-xz-vel) 0.0 122880.0)
(* 0.5 (-> self clock seconds-per-frame))
(* 0.5 (seconds-per-frame))
)
(let ((f1-2 (-> self tube tube-sound-vol))
(f0-9 (-> self tube tube-sound-pitch))
@ -288,7 +288,7 @@
(vector-v++! (-> self control transv-ctrl) s4-2)
)
(let* ((f1-8 (-> self control current-surface fric))
(f0-17 (- 1.0 (* 60.0 (-> self clock seconds-per-frame) (- 1.0 f1-8))))
(f0-17 (- 1.0 (* 60.0 (seconds-per-frame) (- 1.0 f1-8))))
(f0-19 (* 0.5 (+ 1.0 f0-17)))
)
(set! (-> self control transv-ctrl x) (* (-> self control transv-ctrl x) f0-19))
@ -646,7 +646,7 @@
0.0
36864.0
)
(-> self clock seconds-per-frame)
(seconds-per-frame)
)
)
(set! (-> self tube turn-anim-vel)
@ -655,7 +655,7 @@
(fmin 100.0 (* (-> self tube turn-anim-vel) (lerp-scale 0.96 0.9 (-> self control ctrl-xz-vel) 0.0 36864.0)))
)
)
(+! (-> self tube turn-anim-frame) (* (-> self tube turn-anim-vel) (-> self clock seconds-per-frame)))
(+! (-> self tube turn-anim-frame) (* (-> self tube turn-anim-vel) (seconds-per-frame)))
(set! (-> self tube turn-anim-frame) (fmax -20.0 (fmin 20.0 (-> self tube turn-anim-frame))))
(cond
((and (>= (-> self tube turn-anim-frame) 20.0) (>= (-> self tube turn-anim-vel) 0.0))
@ -756,7 +756,7 @@
(seek!
(-> self control unknown-float35)
(fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control ctrl-xz-vel)))))
(-> self clock seconds-per-frame)
(seconds-per-frame)
)
(none)
)

Some files were not shown because too many files have changed in this diff Show More