mirror of
https://github.com/open-goal/jak-project
synced 2026-09-07 11:36:26 -04:00
A lot of fixes (game is 100%'able!) (#1118)
* a crapton of fixes * Update cavecrystal-light.gc * damn you * fix bunnies * change codegen for int -> float cast (just add sign extension now) * fix test * this file is tagged anyway * fix some stack types * remove bad camera debug funcs * add more heap bars and entity pick menu * finish entity menu and make `music-flava` enum * fix some `process-taskable` fields * citadel sage crash fix * fix citadel drop plats * fix tests * fix some casts * update refs * finish `village3-obs` and `snow-ball` * Update README.md * fix sidekick too * fix issue? * more entity inspect hardcoded checks * more * use `*display-actor-anim*` for something! * CRAP * also clear actor anim when deselecting entity * *display-actor-anim* already renders this! * do not display `path` tag info * entity debug inspect tool * one more * make debug string even larger * missing res tag types * more polish and more known tags * last few
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://github.com/water111/jak-project/workflows/Windows/badge.svg"><img src="https://github.com/water111/jak-project/workflows/Windows/badge.svg" alt="Windows" style="max-width:100%;"></a>
|
||||
<a href="https://coveralls.io/github/water111/jak-project?branch=master" rel="nofollow"><img src="https://coveralls.io/repos/github/water111/jak-project/badge.svg?branch=master" alt="Coverage Status" style="max-width:100%;"></a>
|
||||
<a href="https://www.codacy.com/gh/water111/jak-project/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xTVaser/jak-project&utm_campaign=Badge_Grade" rel="nofollow"><img src="https://app.codacy.com/project/badge/Grade/7c3cdc07523f43aca3433484ebc62ff9" alt="Codacy Badge" style="max-width:100%;"></a>
|
||||
<a href="https://discord.gg/E7yFpd6w9G"><img src="https://img.shields.io/discord/756287461377703987" alt="Discord"></a>
|
||||
<a href="https://discord.gg/V82sTJGEAs"><img src="https://img.shields.io/discord/756287461377703987" alt="Discord"></a>
|
||||
<a href="https://makeapullrequest.com"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" alt=PRs Welcome></a>
|
||||
</p>
|
||||
|
||||
@@ -50,7 +50,7 @@ Our objectives are:
|
||||
|
||||
We support both Linux and Windows on x86-64.
|
||||
|
||||
We have a Discord server where we discuss development. https://discord.gg/BVEHQmm8
|
||||
We have a Discord server where we discuss development. https://discord.gg/V82sTJGEAs
|
||||
|
||||
## Current Status
|
||||
So far, we've decompiled around 341,233 lines of GOAL code, out of an estimated 500,000 total lines and we've started work on an OpenGL renderer. Currently, the main display process (`*dproc*`) runs and sends data to our renderer. We can load textures, text files, and level files. Using keyboard controls, we can open the debug menu and turn on some simple debug visualizations.
|
||||
|
||||
@@ -500,7 +500,8 @@ MethodInfo TypeSystem::declare_method(Type* type,
|
||||
const std::string& method_name,
|
||||
bool no_virtual,
|
||||
const TypeSpec& ts,
|
||||
bool override_type) {
|
||||
bool override_type,
|
||||
int id) {
|
||||
if (method_name == "new") {
|
||||
if (override_type) {
|
||||
throw_typesystem_error("Cannot use :replace option with a new method.");
|
||||
@@ -514,10 +515,13 @@ MethodInfo TypeSystem::declare_method(Type* type,
|
||||
|
||||
if (override_type) {
|
||||
if (!got_existing) {
|
||||
throw_typesystem_error(
|
||||
"Cannot use :replace on method {} of {} because this method was not previously declared "
|
||||
"in a parent.",
|
||||
method_name, type->get_name());
|
||||
if (id != -1 && try_lookup_method(type->get_parent(), id, &existing_info)) {
|
||||
} else {
|
||||
throw_typesystem_error(
|
||||
"Cannot use :replace on method {} of {} because this method was not previously "
|
||||
"declared in a parent.",
|
||||
method_name, type->get_name());
|
||||
}
|
||||
}
|
||||
|
||||
// use the existing ID.
|
||||
|
||||
@@ -167,7 +167,8 @@ class TypeSystem {
|
||||
const std::string& method_name,
|
||||
bool no_virtual,
|
||||
const TypeSpec& ts,
|
||||
bool override_type);
|
||||
bool override_type,
|
||||
int id = -1);
|
||||
MethodInfo define_method(const std::string& type_name,
|
||||
const std::string& method_name,
|
||||
const TypeSpec& ts);
|
||||
|
||||
@@ -229,7 +229,7 @@ void declare_method(Type* type, TypeSystem* type_system, const goos::Object& def
|
||||
function_typespec.add_arg(parse_typespec(type_system, return_type));
|
||||
|
||||
auto info = type_system->declare_method(type, method_name, no_virtual, function_typespec,
|
||||
replace_method);
|
||||
replace_method, id);
|
||||
|
||||
// check the method assert
|
||||
if (id != -1) {
|
||||
|
||||
@@ -2866,11 +2866,13 @@ void GetSymbolStringPointer::get_modified_regs(RegSet& regs) const {
|
||||
DefstateElement::DefstateElement(const std::string& process_type,
|
||||
const std::string& state_name,
|
||||
const std::vector<Entry>& entries,
|
||||
bool is_virtual)
|
||||
bool is_virtual,
|
||||
bool is_override)
|
||||
: m_process_type(process_type),
|
||||
m_state_name(state_name),
|
||||
m_entries(entries),
|
||||
m_is_virtual(is_virtual) {
|
||||
m_is_virtual(is_virtual),
|
||||
m_is_override(is_override) {
|
||||
for (auto& e : m_entries) {
|
||||
e.val->parent_element = this;
|
||||
}
|
||||
@@ -2910,7 +2912,11 @@ goos::Object DefstateElement::to_form_internal(const Env& env) const {
|
||||
forms.push_back(pretty_print::build_list(m_process_type));
|
||||
|
||||
if (m_is_virtual) {
|
||||
forms.push_back(pretty_print::to_symbol(":virtual #t"));
|
||||
if (!m_is_override) {
|
||||
forms.push_back(pretty_print::to_symbol(":virtual #t"));
|
||||
} else {
|
||||
forms.push_back(pretty_print::to_symbol(":virtual override"));
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& e : m_entries) {
|
||||
|
||||
@@ -1618,7 +1618,8 @@ class DefstateElement : public FormElement {
|
||||
DefstateElement(const std::string& process_type,
|
||||
const std::string& state_name,
|
||||
const std::vector<Entry>& entries,
|
||||
bool is_virtual);
|
||||
bool is_virtual,
|
||||
bool is_override);
|
||||
|
||||
goos::Object to_form_internal(const Env& env) const override;
|
||||
void apply(const std::function<void(FormElement*)>& f) override;
|
||||
@@ -1637,6 +1638,7 @@ class DefstateElement : public FormElement {
|
||||
std::string m_state_name;
|
||||
std::vector<Entry> m_entries;
|
||||
bool m_is_virtual = false;
|
||||
bool m_is_override = false;
|
||||
};
|
||||
|
||||
class DefskelgroupElement : public FormElement {
|
||||
|
||||
@@ -194,7 +194,7 @@ FormElement* rewrite_nonvirtual_defstate(
|
||||
info.second, pool, {}, skip_states);
|
||||
|
||||
return pool.alloc_element<DefstateElement>(info.second.last_arg().base_type(), info.first,
|
||||
entries, false);
|
||||
entries, false, false);
|
||||
}
|
||||
|
||||
struct VirtualStateInfo {
|
||||
@@ -362,15 +362,18 @@ FormElement* rewrite_virtual_defstate(
|
||||
method_info.name, type_name, method_info.type.print());
|
||||
}
|
||||
|
||||
bool state_override = false;
|
||||
{
|
||||
MethodInfo parent_method_info;
|
||||
auto parent_type_name = env.dts->ts.lookup_type(type_name)->get_parent();
|
||||
if (env.dts->ts.try_lookup_method(parent_type_name, method_info.name, &parent_method_info)) {
|
||||
if (env.dts->ts.try_lookup_method(parent_type_name, method_id, &parent_method_info)) {
|
||||
if (!inherit_info) {
|
||||
env.func->warnings.warn_and_throw(
|
||||
"Virtual defstate for state {} in type {}: the state was defined in the "
|
||||
"parent but wasn't inherited.",
|
||||
expected_state_name, type_name);
|
||||
// did NOT inherit parent state, this is an override!
|
||||
state_override = true;
|
||||
// env.func->warnings.warn_and_throw(
|
||||
// "Virtual defstate for state {} in type {}: the state was defined in the "
|
||||
// "parent but wasn't inherited.",
|
||||
// expected_state_name, type_name);
|
||||
}
|
||||
} else {
|
||||
if (inherit_info) {
|
||||
@@ -415,7 +418,8 @@ FormElement* rewrite_virtual_defstate(
|
||||
elt->body(), body_idx + 1, env, expected_state_name, elt->entries().at(0).dest,
|
||||
method_info.type.substitute_for_method_call(type_name), pool, type_name, skip_states);
|
||||
|
||||
return pool.alloc_element<DefstateElement>(type_name, expected_state_name, entries, true);
|
||||
return pool.alloc_element<DefstateElement>(type_name, expected_state_name, entries, true,
|
||||
state_override);
|
||||
}
|
||||
|
||||
bool is_nonvirtual_state(LetElement* elt) {
|
||||
|
||||
+161
-86
@@ -81,7 +81,7 @@
|
||||
(define-extern append! (function object object object))
|
||||
(define-extern delete! (function object object pair))
|
||||
(define-extern insert-cons! (function object object pair))
|
||||
(define-extern sort (function object (function object object object) object))
|
||||
(define-extern sort (function pair (function object object object) pair))
|
||||
(define-extern mem-copy! (function pointer pointer int pointer))
|
||||
(define-extern qmem-copy<-! (function pointer pointer int pointer))
|
||||
(define-extern qmem-copy->! (function pointer pointer int pointer))
|
||||
@@ -596,6 +596,60 @@
|
||||
(set-fps)
|
||||
)
|
||||
|
||||
;; flavors for music
|
||||
(defenum music-flava
|
||||
:type uint8
|
||||
(racer 1)
|
||||
(flutflut 2)
|
||||
(to-maincave 3)
|
||||
(to-snow 4)
|
||||
(sage 5)
|
||||
(assistant 6)
|
||||
(birdlady 7)
|
||||
(mayor 8)
|
||||
(sculptor 9)
|
||||
(explorer 10)
|
||||
(sage-yellow 11)
|
||||
(sage-red 12)
|
||||
(sage-blue 13)
|
||||
(miners 14)
|
||||
(warrior 15)
|
||||
(geologist 16)
|
||||
(gambler 17)
|
||||
(sage-hut 18)
|
||||
(dock 19)
|
||||
(farmer 20)
|
||||
(jungleb-eggtop 21)
|
||||
(misty-boat 22)
|
||||
(misty-battle 23)
|
||||
(beach-sentinel 24)
|
||||
(beach-cannon 25)
|
||||
(beach-grotto 26)
|
||||
(citadel-center 27)
|
||||
(robocave 28)
|
||||
(robocave-top 29)
|
||||
(maincave 30)
|
||||
(darkcave 31)
|
||||
(snow-battle 32)
|
||||
(snow-cave 33)
|
||||
(snow-fort 34)
|
||||
(snow-balls 35)
|
||||
(levitator 36)
|
||||
(swamp-launcher 37)
|
||||
(swamp-battle 38)
|
||||
(jungle-temple-exit 39)
|
||||
(jungle-lurkerm 40)
|
||||
(jungle-temple-top 41)
|
||||
(rolling-gorge 42)
|
||||
(ogre-middle 43)
|
||||
(ogre-end 44)
|
||||
(lavatube-middle 45)
|
||||
(lavatube-end 46)
|
||||
(finalboss-middle 47)
|
||||
(finalboss-end 48)
|
||||
(default 49)
|
||||
)
|
||||
|
||||
;; - Enums
|
||||
(defenum joint-mod-handler-mode
|
||||
:bitfield #t
|
||||
@@ -807,6 +861,7 @@
|
||||
(zero 0)
|
||||
(one 1)
|
||||
(confirm #x103)
|
||||
(press-to-talk #x104)
|
||||
(press-to-use #x105)
|
||||
(confirm-play #x106)
|
||||
(play-again? #x107)
|
||||
@@ -828,8 +883,12 @@
|
||||
(spanish #x117)
|
||||
(italian #x118)
|
||||
(japanese #x119)
|
||||
(press-to-trade-money #x11a)
|
||||
(press-to-trade-money-oracle #x11b)
|
||||
(press-to-warp #x11c)
|
||||
(press-to-exit #x11d)
|
||||
(press-to-talk-to-sage #x123)
|
||||
(press-to-talk-to-assistant #x124)
|
||||
(aspect-ratio #x125)
|
||||
(video-mode #x126)
|
||||
(game-options #x127)
|
||||
@@ -5519,6 +5578,7 @@
|
||||
(left 3)
|
||||
(right 4)
|
||||
(large 5)
|
||||
(pc-hack 6)
|
||||
)
|
||||
|
||||
(deftype font-context (basic)
|
||||
@@ -5697,9 +5757,9 @@
|
||||
(declare-type engine basic)
|
||||
(deftype connection (connectable)
|
||||
((param0 basic :offset-assert 16) ;; often (function object object object object object), but can be other things.
|
||||
(param1 basic :offset-assert 20)
|
||||
(param2 basic :offset-assert 24)
|
||||
(param3 basic :offset-assert 28)
|
||||
(param1 int32 :offset-assert 20)
|
||||
(param2 int32 :offset-assert 24)
|
||||
(param3 int32 :offset-assert 28)
|
||||
(quad uint128 2 :offset 0)
|
||||
)
|
||||
:method-count-assert 14
|
||||
@@ -6150,7 +6210,7 @@
|
||||
(define-extern *display-path-marks* symbol)
|
||||
(define-extern *display-vol-marks* symbol)
|
||||
(define-extern *display-water-marks* symbol)
|
||||
(define-extern *display-actor-anim* symbol)
|
||||
(define-extern *display-actor-anim* string)
|
||||
(define-extern *display-process-anim* (pointer process))
|
||||
(define-extern *display-actor-vis* symbol)
|
||||
(define-extern *display-actor-graph* symbol)
|
||||
@@ -10376,6 +10436,7 @@
|
||||
;; - Types
|
||||
|
||||
;; NOTE - root can also be a collide-shape
|
||||
(declare-type joint-mod basic)
|
||||
(deftype manipy (process-drawable)
|
||||
((new-trans-hook (function none) :offset-assert 176) ;; TODO - no idea on these types
|
||||
(cur-trans-hook (function none) :offset-assert 180) ;; TODO - no idea on these types
|
||||
@@ -10386,7 +10447,7 @@
|
||||
(cur-grab-handle handle :offset-assert 208)
|
||||
(cur-target-handle handle :offset-assert 216)
|
||||
(old-grab-pos vector :inline :offset-assert 224)
|
||||
(joint process-drawable 4 :offset-assert 240)
|
||||
(joint joint-mod 4 :offset-assert 240)
|
||||
(new-post-hook (function none) :offset-assert 256) ;; TODO - no idea on these types
|
||||
(cur-post-hook (function none) :offset-assert 260) ;; TODO - no idea on these types
|
||||
(clone-copy-trans basic :offset-assert 264)
|
||||
@@ -15802,7 +15863,7 @@
|
||||
(define-extern show-iop-info (function dma-buffer int))
|
||||
(define-extern show-iop-memory (function dma-buffer int))
|
||||
(define-extern make-sqrt-table (function int))
|
||||
(define-extern flava-lookup (function symbol int int))
|
||||
(define-extern flava-lookup (function symbol music-flava int))
|
||||
|
||||
;; - Symbols
|
||||
|
||||
@@ -17443,21 +17504,21 @@
|
||||
(cell-for-task game-task :offset-assert 256)
|
||||
(cell-x handle :offset-assert 264)
|
||||
(cam-joint-index int32 :offset-assert 272)
|
||||
(skippable basic :offset-assert 276) ;; probably a symbol
|
||||
(blend-on-exit basic :offset-assert 280) ;; probably a symbol?
|
||||
(skippable symbol :offset-assert 276) ;; probably a symbol
|
||||
(blend-on-exit art-joint-anim :offset-assert 280)
|
||||
(camera handle :offset-assert 288)
|
||||
(will-talk symbol :offset-assert 296)
|
||||
(talk-message uint32 :offset-assert 300)
|
||||
(last-talk uint64 :offset-assert 304)
|
||||
(talk-message game-text-id :offset-assert 300)
|
||||
(last-talk int64 :offset-assert 304)
|
||||
(bounce-away symbol :offset-assert 312)
|
||||
(ambient ambient-control :inline :offset-assert 320)
|
||||
(center-joint-index int32 :offset-assert 336)
|
||||
(draw-bounds-y-offset float :offset-assert 340)
|
||||
(neck-joint-index int32 :offset-assert 344)
|
||||
(fuel-cell-anim spool-anim :offset-assert 348)
|
||||
(sound-flava uint8 :offset-assert 352)
|
||||
(sound-flava music-flava :offset-assert 352)
|
||||
(have-flava symbol :offset-assert 356) ;; probably
|
||||
(music basic :offset-assert 360)
|
||||
(music symbol :offset-assert 360)
|
||||
(have-music symbol :offset-assert 364) ;; probably
|
||||
(been-kicked symbol :offset-assert 368) ;; probably
|
||||
(cur-trans-hook (function none) :offset-assert 372)
|
||||
@@ -18862,7 +18923,7 @@
|
||||
(define-extern cam-slave-init-vars (function none :behavior camera-slave))
|
||||
(define-extern cam-calc-follow! (function cam-rotation-tracker vector symbol vector))
|
||||
(define-extern slave-set-rotation! (function cam-rotation-tracker vector float float symbol none))
|
||||
(define-extern camera-slave-debug (function camera-slave object)) ;; passed to engine::method-15
|
||||
(define-extern camera-slave-debug (function camera-slave none))
|
||||
(define-extern camera-line-rel-len (function vector vector float vector4w none))
|
||||
(define-extern cam-slave-get-flags (function entity symbol uint128))
|
||||
(define-extern cam-slave-get-vector-with-offset (function entity-actor vector symbol symbol))
|
||||
@@ -19749,7 +19810,7 @@
|
||||
(define-extern ambient-hint-init-by-other (function string vector symbol none :behavior level-hint))
|
||||
(define-extern level-hint-process-cmd (function (pointer int32) int int int))
|
||||
(define-extern task-known? (function game-task symbol))
|
||||
(define-extern can-grab-display? (function process-taskable symbol)) ;; unconfirmed, see assistant-firecanyon
|
||||
(define-extern can-grab-display? (function process symbol))
|
||||
(define-extern level-hint-displayed? (function symbol))
|
||||
(define-extern ambient-inspect function)
|
||||
|
||||
@@ -22579,7 +22640,7 @@
|
||||
(frustration-point vector :inline :offset-assert 208)
|
||||
(jump-dest vector :inline :offset-assert 224)
|
||||
(jump-trajectory trajectory :inline :offset-assert 240)
|
||||
(jump-time uint64 :offset-assert 280)
|
||||
(jump-time int64 :offset-assert 280)
|
||||
(nav-info nav-enemy-info :offset-assert 288)
|
||||
(target-speed float :offset-assert 292)
|
||||
(momentum-speed float :offset-assert 296)
|
||||
@@ -22588,7 +22649,7 @@
|
||||
(turn-time int64 :offset-assert 312)
|
||||
(frustration-time int64 :offset-assert 320)
|
||||
(speed-scale float :offset-assert 328)
|
||||
(neck joint-mod :offset-assert 332) ; this is what `neck` is on the pelican
|
||||
(neck joint-mod :offset-assert 332)
|
||||
(reaction-time int64 :offset-assert 336)
|
||||
(notice-time int64 :offset-assert 344)
|
||||
(state-timeout int64 :offset-assert 352)
|
||||
@@ -22635,31 +22696,31 @@
|
||||
(TODO-RENAME-48 (_type_) none 48) ;; object past to method 60 -- see citb-bunny
|
||||
(TODO-RENAME-49 (_type_ nav-enemy-info) float 49)
|
||||
(TODO-RENAME-50 (_type_ vector) symbol 50)
|
||||
(dummy-51 (_type_) object 51) ;; ret - float | symbol
|
||||
(dummy-51 (_type_) none 51) ;; ret - float | symbol
|
||||
(dummy-52 (_type_ vector) symbol 52) ;; ret - symbol | vector
|
||||
(dummy-53 (_type_) symbol 53) ;; ret - symbol | none
|
||||
(dummy-54 (_type_) none 54)
|
||||
(dummy-55 (_type_) none 55)
|
||||
(set-jump-height-factor! (_type_ int) float 56)
|
||||
(dummy-57 (_type_) vector 57)
|
||||
(dummy-58 (_type_) vector 58)
|
||||
(dummy-54 (_type_ vector) symbol 54)
|
||||
(dummy-55 (_type_) symbol 55)
|
||||
(set-jump-height-factor! (_type_ int) none 56)
|
||||
(dummy-57 (_type_) none 57)
|
||||
(dummy-58 (_type_) none 58)
|
||||
(TODO-RENAME-59 (_type_) none 59)
|
||||
(dummy-60 (_type_ object) symbol 60)
|
||||
(dummy-61 (_type_) none 61)
|
||||
(dummy-62 (_type_) none 62)
|
||||
(dummy-63 (_type_) none 63)
|
||||
(dummy-64 (_type_) none 64)
|
||||
(dummy-65 (_type_) none 65)
|
||||
(dummy-66 (_type_) none 66)
|
||||
(dummy-67 (_type_) symbol 67)
|
||||
(dummy-68 (_type_) none 68)
|
||||
(dummy-69 (_type_) none 69)
|
||||
(dummy-70 (_type_) none 70)
|
||||
(dummy-71 () _type_ :state 71)
|
||||
(dummy-60 (_type_ symbol) symbol 60)
|
||||
(snow-bunny-attack () _type_ :state 61)
|
||||
(snow-bunny-chase-hop () _type_ :state 62)
|
||||
(snow-bunny-defend () _type_ :state 63)
|
||||
(dummy-64 () _type_ :state 64)
|
||||
(snow-bunny-lunge () _type_ :state 65)
|
||||
(snow-bunny-nav-resume () _type_ :state 66)
|
||||
(snow-bunny-patrol-hop () _type_ :state 67)
|
||||
(snow-bunny-patrol-idle () _type_ :state 68)
|
||||
(dummy-69 () _type_ :state 69)
|
||||
(snow-bunny-retreat-hop () _type_ :state 70)
|
||||
(snow-bunny-tune-spheres () _type_ :state 71)
|
||||
(nav-enemy-touch-handler (_type_ process event-message-block) object 72)
|
||||
(nav-enemy-attack-handler (_type_ process event-message-block) object 73)
|
||||
(nav-enemy-jump-blocked () _type_ :state 74)
|
||||
(dummy-75 (_type_) none 75)
|
||||
(dummy-75 () _type_ :state 75)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -23235,6 +23296,9 @@
|
||||
:size-assert #x165
|
||||
:heap-base #x100
|
||||
:flag-assert #x2101000165
|
||||
(:methods
|
||||
(notice-blue (handle) _type_ :replace :state 29)
|
||||
)
|
||||
)
|
||||
|
||||
;; - Unknowns
|
||||
@@ -23360,8 +23424,8 @@
|
||||
:size-assert #x20
|
||||
:flag-assert #xc00000020
|
||||
(:methods
|
||||
(sleep (_type_ uint) none 9)
|
||||
(reached-delay? (_type_ uint) symbol 10)
|
||||
(sleep (_type_ int) none 9)
|
||||
(reached-delay? (_type_ int) symbol 10)
|
||||
(completed? (_type_) symbol 11)
|
||||
)
|
||||
)
|
||||
@@ -24999,11 +25063,11 @@
|
||||
(jump-height-factor float :offset-assert 424)
|
||||
(jump-anim-start-frame float :offset-assert 428)
|
||||
(defense uint64 :offset-assert 432)
|
||||
(retreat-timeout-time uint64 :offset-assert 440)
|
||||
(last-nondangerous-time uint64 :offset-assert 448)
|
||||
(retreat-timeout-time int64 :offset-assert 440)
|
||||
(last-nondangerous-time int64 :offset-assert 448)
|
||||
(patrol-hop-failed? basic :offset-assert 456)
|
||||
(should-retreat? basic :offset-assert 460)
|
||||
(got-jump-event? basic :offset-assert 464)
|
||||
(got-jump-event? symbol :offset-assert 464)
|
||||
(using-jump-event? basic :offset-assert 468)
|
||||
(jump-anim int8 :offset-assert 472)
|
||||
(notice-land-anim int8 :offset-assert 473)
|
||||
@@ -25016,7 +25080,13 @@
|
||||
:heap-base #x190
|
||||
:flag-assert #x4d01900200
|
||||
(:methods
|
||||
(dummy-76 () none 76))
|
||||
(dummy-51 (_type_ vector vector) symbol :replace 51)
|
||||
(dummy-52 (_type_) symbol :replace 52)
|
||||
(dummy-54 (_type_) symbol :replace 54)
|
||||
(dummy-57 (_type_) symbol :replace 57)
|
||||
(dummy-60 (_type_) none :replace 60)
|
||||
(dummy-76 (_type_ symbol) none 76)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype snow-bunny-retreat-work (structure)
|
||||
@@ -25033,13 +25103,13 @@
|
||||
|
||||
;; - Functions
|
||||
|
||||
(define-extern snow-bunny-execute-jump function)
|
||||
(define-extern snow-bunny-initialize-jump function)
|
||||
(define-extern snow-bunny-default-event-handler function)
|
||||
(define-extern snow-bunny-execute-jump (function none :behavior snow-bunny))
|
||||
(define-extern snow-bunny-initialize-jump (function vector none :behavior snow-bunny))
|
||||
(define-extern snow-bunny-default-event-handler (function process int symbol event-message-block object :behavior snow-bunny))
|
||||
|
||||
;; - Unknowns
|
||||
|
||||
(define-extern *snow-bunny* snow-bunny) ;; unknown type
|
||||
(define-extern *snow-bunny* (pointer snow-bunny))
|
||||
(define-extern *snow-bunny-nav-enemy-info* nav-enemy-info)
|
||||
(define-extern *snow-bunny-sg* skeleton-group)
|
||||
|
||||
@@ -25187,11 +25257,11 @@
|
||||
(glow-u float :offset-assert 184)
|
||||
(glow-wf-period int32 :offset-assert 188)
|
||||
(glow-wf-offset int32 :offset-assert 192)
|
||||
(prev-compute-glow-time uint64 :offset-assert 200)
|
||||
(start-fade-time uint64 :offset-assert 208)
|
||||
(end-fade-time uint64 :offset-assert 216)
|
||||
(activated-time uint64 :offset-assert 224)
|
||||
(last-updated-user-lighting uint64 :offset-assert 232)
|
||||
(prev-compute-glow-time int64 :offset-assert 200)
|
||||
(start-fade-time int64 :offset-assert 208)
|
||||
(end-fade-time int64 :offset-assert 216)
|
||||
(activated-time int64 :offset-assert 224)
|
||||
(last-updated-user-lighting int64 :offset-assert 232)
|
||||
(player-attack-id uint64 :offset-assert 240)
|
||||
(on-color-mult vector :inline :offset-assert 256)
|
||||
(on-color-emissive vector :inline :offset-assert 272)
|
||||
@@ -26590,20 +26660,20 @@
|
||||
|
||||
;; - Functions
|
||||
|
||||
(define-extern peri-beamcam-init-by-other (function string (pointer process) :behavior process))
|
||||
(define-extern peri-beamcam-init-by-other (function string (pointer pov-camera) :behavior process))
|
||||
(define-extern draw-power-beam (function vector vector none))
|
||||
(define-extern reflector-origin-update (function entity-actor none :behavior reflector-origin))
|
||||
(define-extern reflector-init-by-other (function vector none :behavior reflector))
|
||||
(define-extern periscope-find-next (function object :behavior periscope))
|
||||
(define-extern periscope-find-reflection-angles (function float :behavior periscope))
|
||||
(define-extern periscope-update-joints (function float :behavior periscope))
|
||||
(define-extern periscope-find-next (function none :behavior periscope))
|
||||
(define-extern periscope-find-reflection-angles (function none :behavior periscope))
|
||||
(define-extern periscope-update-joints (function none :behavior periscope))
|
||||
(define-extern periscope-has-power-input? (function symbol :behavior periscope))
|
||||
(define-extern periscope-draw-beam (function none :behavior periscope))
|
||||
(define-extern periscope-find-aim-at-angles (function float :behavior periscope))
|
||||
(define-extern periscope-find-aim-at-angles (function none :behavior periscope))
|
||||
(define-extern periscope-crosshair (function symbol :behavior periscope))
|
||||
(define-extern periscope-test-task-complete? (function symbol :behavior periscope))
|
||||
(define-extern periscope-draw-beam-impact (function none :behavior periscope))
|
||||
(define-extern periscope-set-target-direction (function vector float :behavior periscope))
|
||||
(define-extern periscope-set-target-direction (function vector none :behavior periscope))
|
||||
(define-extern periscope-post (function none :behavior periscope))
|
||||
(define-extern periscope-debug-trans (function none :behavior periscope))
|
||||
(define-extern target-close-to-point? (function vector float symbol))
|
||||
@@ -29742,18 +29812,18 @@
|
||||
(deftype cavecrystal-light-control (basic)
|
||||
((active-count int32 :offset-assert 4)
|
||||
(head cavecrystal-light :offset-assert 8)
|
||||
(last-known-valid-time uint64 :offset-assert 16)
|
||||
(last-known-valid-time int64 :offset-assert 16)
|
||||
(crystal cavecrystal-light 7 :inline :offset-assert 32)
|
||||
)
|
||||
:method-count-assert 15
|
||||
:size-assert #x170
|
||||
:flag-assert #xf00000170
|
||||
(:methods
|
||||
(TODO-RENAME-9 (_type_ int float process-drawable) object 9) ;; last arg is a cavecrystal
|
||||
(TODO-RENAME-9 (_type_ int float process-drawable) none 9)
|
||||
(TODO-RENAME-10 (_type_ vector) float 10)
|
||||
(inc-intensites! (_type_) int 11)
|
||||
(TODO-RENAME-12 (_type_) symbol 12)
|
||||
(create-connection! (_type_ process-drawable res-lump (function object object object object object) object object) connection 13) ;; TODO - process-drawable is often a cavecrystal
|
||||
(inc-intensities! (_type_) none 11)
|
||||
(TODO-RENAME-12 (_type_) none 12)
|
||||
(create-connection! (_type_ process-drawable res-lump (function object object object object object) int float) connection 13) ;; TODO - process-drawable is often a cavecrystal
|
||||
(execute-connections (_type_) int 14)
|
||||
)
|
||||
)
|
||||
@@ -30709,9 +30779,9 @@
|
||||
(plat-mask uint32 :offset-assert 184)
|
||||
(plat-id-dir int32 :offset-assert 188)
|
||||
(wiggled? symbol :offset-assert 192)
|
||||
(timeout uint64 :offset-assert 200)
|
||||
(last-plat-activated-time uint64 :offset-assert 208)
|
||||
(delay-til-wiggle uint64 :offset-assert 216)
|
||||
(timeout int64 :offset-assert 200)
|
||||
(last-plat-activated-time int64 :offset-assert 208)
|
||||
(delay-til-wiggle int64 :offset-assert 216)
|
||||
(ticker ticky :inline :offset-assert 224)
|
||||
)
|
||||
:method-count-assert 20
|
||||
@@ -31266,9 +31336,9 @@
|
||||
)
|
||||
|
||||
(deftype sunken-pipegame-prize (structure)
|
||||
((puzzle-delay uint64 :offset-assert 0)
|
||||
(pipe-travel-time-to-far uint64 :offset-assert 8)
|
||||
(pipe-travel-time-to-jar uint64 :offset-assert 16)
|
||||
((puzzle-delay int64 :offset-assert 0)
|
||||
(pipe-travel-time-to-far int64 :offset-assert 8)
|
||||
(pipe-travel-time-to-jar int64 :offset-assert 16)
|
||||
(actor-handle handle :offset-assert 24)
|
||||
(jar-pos vector :inline :offset-assert 32)
|
||||
(far-pos vector :inline :offset-assert 48)
|
||||
@@ -31297,7 +31367,7 @@
|
||||
:heap-base #x230
|
||||
:flag-assert #x17023002a0
|
||||
(:methods
|
||||
(dummy-20 (_type_) none 20)
|
||||
(dummy-20 (_type_) uint 20)
|
||||
(dummy-21 (_type_ symbol) symbol 21)
|
||||
(dummy-22 (_type_ symbol) none 22)
|
||||
)
|
||||
@@ -31413,7 +31483,8 @@
|
||||
)
|
||||
(:methods
|
||||
(initialize-collision (_type_) collide-shape-moving :replace 47)
|
||||
(dummy-53 (_type_ vector) symbol :replace 53))
|
||||
(dummy-53 (_type_ vector) symbol :replace 53)
|
||||
)
|
||||
:method-count-assert 76
|
||||
:size-assert #x1a8
|
||||
:heap-base #x140
|
||||
@@ -32961,7 +33032,7 @@
|
||||
:heap-base #x180
|
||||
:flag-assert #x4c018001f0
|
||||
(:methods
|
||||
(dummy-51 (_type_ vector vector) object :replace 51)
|
||||
(dummy-51 (_type_ vector vector) symbol :replace 51)
|
||||
(dummy-53 (_type_ vector vector) symbol :replace 53)
|
||||
)
|
||||
(:states
|
||||
@@ -32997,9 +33068,8 @@
|
||||
|
||||
;; - Types
|
||||
|
||||
(declare-type snow-ball-roller process-drawable)
|
||||
(deftype snow-ball-shadow (process-drawable)
|
||||
((parent-override (pointer snow-ball-roller) :score 100 :offset 12))
|
||||
()
|
||||
:method-count-assert 20
|
||||
:size-assert #xb0
|
||||
:heap-base #x40
|
||||
@@ -33009,8 +33079,8 @@
|
||||
)
|
||||
|
||||
(deftype snow-ball-junction (structure)
|
||||
((enter-time uint64 :offset-assert 0)
|
||||
(exit-time uint64 :offset-assert 8)
|
||||
((enter-time int64 :offset-assert 0)
|
||||
(exit-time int64 :offset-assert 8)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
@@ -33038,8 +33108,8 @@
|
||||
(delay-til-bounce int32 :offset-assert 204)
|
||||
(rolling-sound-id sound-id :offset-assert 208)
|
||||
(rolling-sound-enabled? symbol :offset-assert 212)
|
||||
(last-bounce-time uint64 :offset-assert 216)
|
||||
(hit-player-time uint64 :offset-assert 224)
|
||||
(last-bounce-time int64 :offset-assert 216)
|
||||
(hit-player-time int64 :offset-assert 224)
|
||||
(path-info snow-ball-path-info :inline :offset-assert 240)
|
||||
(junctions snow-ball-junction 4 :inline :offset-assert 272)
|
||||
)
|
||||
@@ -33048,7 +33118,7 @@
|
||||
:heap-base #xe0
|
||||
:flag-assert #x1700e00150
|
||||
(:methods
|
||||
(follow-path (_type_) float 20)
|
||||
(follow-path (_type_) none 20)
|
||||
(play-landing-sound (_type_ float) sound-id 21)
|
||||
(dummy-22 (_type_ process-drawable) none 22)
|
||||
)
|
||||
@@ -33058,7 +33128,7 @@
|
||||
|
||||
(deftype snow-ball (process)
|
||||
((child-override (pointer snow-ball-roller) :score 100 :offset 20)
|
||||
(state-time uint64 :offset-assert 112)
|
||||
(state-time int64 :offset-assert 112)
|
||||
(last-path-picked int32 :offset-assert 120)
|
||||
(same-path-picked-count int32 :offset-assert 124)
|
||||
(delay-til-next int32 :offset-assert 128)
|
||||
@@ -33070,7 +33140,7 @@
|
||||
:flag-assert #x100020008c
|
||||
(:methods
|
||||
(dummy-14 (_type_ (inline-array snow-ball-junction) float int) symbol 14)
|
||||
(dummy-15 (_type_ (inline-array snow-ball-junction) int) none 15) ;; TODO - same type as above
|
||||
(dummy-15 (_type_ (inline-array snow-ball-junction) int) symbol 15)
|
||||
)
|
||||
(:states
|
||||
snow-ball-idle)
|
||||
@@ -33078,10 +33148,10 @@
|
||||
|
||||
;; - Functions
|
||||
|
||||
(define-extern snow-ball-roller-init-by-other (function entity snow-ball float int vector none :behavior snow-ball-roller))
|
||||
(define-extern snow-ball-roller-init-by-other (function entity-actor snow-ball float int (inline-array snow-ball-junction) none :behavior snow-ball-roller))
|
||||
(define-extern snow-ball-shadow-init-by-other (function none :behavior snow-ball-shadow))
|
||||
(define-extern snow-ball-roller-path-update (function none :behavior snow-ball-roller))
|
||||
(define-extern snow-ball-roller-path-init (function float :behavior snow-ball-roller))
|
||||
(define-extern snow-ball-roller-path-init (function none :behavior snow-ball-roller))
|
||||
|
||||
;; - Unknowns
|
||||
|
||||
@@ -33284,8 +33354,8 @@
|
||||
(deftype snow-button (process-drawable)
|
||||
((root-override collide-shape-moving :score 100 :offset 112)
|
||||
(wiggled? symbol :offset-assert 176)
|
||||
(timeout uint64 :offset-assert 184)
|
||||
(delay-til-wiggle uint64 :offset-assert 192)
|
||||
(timeout int64 :offset-assert 184)
|
||||
(delay-til-wiggle int64 :offset-assert 192)
|
||||
(prev-button entity-actor :offset-assert 200)
|
||||
(ticker ticky :inline :offset-assert 208)
|
||||
)
|
||||
@@ -33448,14 +33518,19 @@
|
||||
:size-assert #x1f4
|
||||
:heap-base #x190
|
||||
:flag-assert #x4c019001f4
|
||||
(:methods
|
||||
(dummy-51 (_type_ vector) symbol :replace 51)
|
||||
(dummy-52 (_type_) symbol :replace 52)
|
||||
(dummy-57 (_type_ float) float :replace 57)
|
||||
)
|
||||
(:states
|
||||
ram-boss-tracking
|
||||
ram-boss-nav-resume
|
||||
ram-boss-throw
|
||||
ram-boss-nav-start
|
||||
ram-boss-jump-down-hit-ground
|
||||
(ram-boss-jump-down basic vector)
|
||||
(ram-boss-already-down basic vector)
|
||||
(ram-boss-jump-down basic)
|
||||
(ram-boss-already-down basic)
|
||||
ram-boss-idle
|
||||
ram-boss-lose-shield
|
||||
ram-boss-up-defend-block
|
||||
|
||||
@@ -772,13 +772,13 @@
|
||||
[27, "(function none :behavior process)"],
|
||||
[28, "(function none :behavior fisher)"],
|
||||
[20, "(function none :behavior fisher-fish)"],
|
||||
[1, "(function none :behavior target)"]
|
||||
[1, "(function none :behavior manipy)"]
|
||||
],
|
||||
"fisher-JUNGLE-L1": [
|
||||
[27, "(function none :behavior process)"],
|
||||
[28, "(function none :behavior fisher)"],
|
||||
[20, "(function none :behavior fisher-fish)"],
|
||||
[1, "(function none :behavior target)"]
|
||||
[1, "(function none :behavior manipy)"]
|
||||
],
|
||||
|
||||
"robotboss-misc": [
|
||||
|
||||
@@ -280,12 +280,7 @@
|
||||
|
||||
// ocean-vu0
|
||||
"ocean-generate-verts", // crash
|
||||
"ocean-interp-wave",
|
||||
|
||||
// all unchecked and in level DGO code
|
||||
"(anon-function 21 plant-boss)", // CFG
|
||||
//"target-flut-falling-anim-trans", // CFG failure
|
||||
"(anon-function 5 orbit-plat)" // CFG
|
||||
"ocean-interp-wave"
|
||||
],
|
||||
|
||||
// these functions use pairs and the decompiler
|
||||
@@ -499,7 +494,12 @@
|
||||
"end-collect-nav": [0],
|
||||
"robotboss-always-trans": [9, 10, 11, 12, 13, 14, 15, 18, 29, 36, 45, 48],
|
||||
"target-flut-falling-anim-trans" : [5, 6],
|
||||
"(method 27 ropebridge)" : [5, 7]
|
||||
"(method 27 ropebridge)" : [5, 7],
|
||||
"(anon-function 5 orbit-plat)": [4, 5, 11],
|
||||
"(anon-function 21 plant-boss)": [0, 1, 3, 4],
|
||||
"(method 55 ram-boss)": [5],
|
||||
"(method 60 ice-cube)": [8],
|
||||
"(anon-function 2 snow-ball)": [22]
|
||||
},
|
||||
|
||||
// Sometimes the game might use format strings that are fetched dynamically,
|
||||
|
||||
@@ -332,7 +332,10 @@
|
||||
|
||||
"eye": [["L36", "eye-work"]],
|
||||
|
||||
"shadow-cpu": [["L122", "shadow-data"]],
|
||||
"shadow-cpu": [
|
||||
["L122", "shadow-data"],
|
||||
["L121", "vu-function"]
|
||||
],
|
||||
|
||||
"load-boundary": [
|
||||
["L327", "(inline-array lbvtx)", 12],
|
||||
@@ -1996,8 +1999,8 @@
|
||||
],
|
||||
|
||||
"snow-ball": [
|
||||
["L86", "(inline-array vector)", 2], // likely wrong, but its 8 floats -- maybe its timing related, like a ticky? but those are int64s
|
||||
["L87", "(inline-array vector)", 2], // likely wrong, but its 8 floats -- maybe its timing related, like a ticky? but those are int64s
|
||||
["L86", "(pointer float)", 8],
|
||||
["L87", "(pointer float)", 8],
|
||||
["L89", "attack-info"]
|
||||
],
|
||||
|
||||
@@ -2111,6 +2114,10 @@
|
||||
["L523", "float", true] // TODO - meters
|
||||
],
|
||||
|
||||
"snow-bunny": [
|
||||
["L190", "attack-info"]
|
||||
],
|
||||
|
||||
// please do not add things after this entry! git is dumb.
|
||||
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
|
||||
}
|
||||
|
||||
@@ -1691,7 +1691,7 @@
|
||||
"cam-collision-record-draw": [
|
||||
[16, "vector4w"],
|
||||
[32, "vector4w"],
|
||||
[48, "collide-mesh-cache-tri"],
|
||||
[48, "collide-tri-result"],
|
||||
[144, "vector"]
|
||||
],
|
||||
|
||||
@@ -2994,7 +2994,7 @@
|
||||
|
||||
"citb-sagecage-draw-bars": [
|
||||
[16, "vector"],
|
||||
[32, "vector"],
|
||||
[32, "quaternion"],
|
||||
[48, "vector"]
|
||||
],
|
||||
|
||||
@@ -3031,8 +3031,8 @@
|
||||
"(code target-fishing)": [
|
||||
[16, "event-message-block"],
|
||||
[96, "vector"],
|
||||
[112, "quaternion"],
|
||||
[128, "quaternion"],
|
||||
[112, "vector"],
|
||||
[128, "vector"],
|
||||
[144, "quaternion"]
|
||||
],
|
||||
"(method 43 fisher)": [
|
||||
@@ -3732,7 +3732,7 @@
|
||||
|
||||
"(method 53 ice-cube)": [
|
||||
[16, "vector"],
|
||||
[32, "collide-mesh-cache-tri"]
|
||||
[32, "collide-tri-result"]
|
||||
],
|
||||
|
||||
"(event double-lurker-top-knocked-down)": [
|
||||
@@ -5118,7 +5118,7 @@
|
||||
"(method 55 ram-boss)": [
|
||||
[16, "vector"],
|
||||
[32, "vector"],
|
||||
[48, "collide-mesh-cache-tri"]
|
||||
[48, "collide-tri-result"]
|
||||
],
|
||||
|
||||
"(enter ram-boss-jump-down)": [
|
||||
@@ -5172,7 +5172,7 @@
|
||||
],
|
||||
|
||||
"(code snow-ball-idle)": [
|
||||
[16, "vector"]
|
||||
[16, ["inline-array", "snow-ball-junction", 4]]
|
||||
],
|
||||
|
||||
"(method 11 spider-egg)": [
|
||||
@@ -5458,7 +5458,7 @@
|
||||
|
||||
"(event mistycannon-missile-explode)": [
|
||||
[16, "vector"],
|
||||
[32, "collide-mesh-cache-tri"],
|
||||
[32, "collide-tri-result"],
|
||||
[128, "event-message-block"]
|
||||
],
|
||||
|
||||
@@ -6378,5 +6378,70 @@
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"(code orbit-plat-rotating)": [
|
||||
[16, "vector"],
|
||||
[32, "vector"],
|
||||
[48, "vector"]
|
||||
],
|
||||
|
||||
"(code plant-boss-intro)": [
|
||||
[16, "event-message-block"]
|
||||
],
|
||||
|
||||
"(event notice-blue plat-eco)": [
|
||||
[16, "event-message-block"]
|
||||
],
|
||||
|
||||
"(trans notice-blue plat-eco)": [
|
||||
[16, "event-message-block"]
|
||||
],
|
||||
|
||||
"(trans plat-idle plat-eco)": [
|
||||
[16, "event-message-block"]
|
||||
],
|
||||
|
||||
"snow-bunny-default-event-handler": [
|
||||
[16, "event-message-block"]
|
||||
],
|
||||
|
||||
"(code notice-blue plat-eco)": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"(method 51 snow-bunny)": [
|
||||
[16, "vector"],
|
||||
[32, "collide-tri-result"]
|
||||
],
|
||||
|
||||
"(method 53 snow-bunny)": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"(method 54 snow-bunny)": [
|
||||
[16, "vector"],
|
||||
[32, "vector"]
|
||||
],
|
||||
|
||||
"(method 52 snow-bunny)": [
|
||||
[16, "vector"],
|
||||
[32, "vector"]
|
||||
],
|
||||
|
||||
"(code nav-enemy-notice snow-bunny)": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"(trans snow-bunny-attack snow-bunny)": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"(method 55 snow-bunny)": [
|
||||
[16, "snow-bunny-retreat-work"],
|
||||
[64, "vector"],
|
||||
[80, "vector"],
|
||||
[96, "vector"],
|
||||
[112, "nav-gap-info"]
|
||||
],
|
||||
|
||||
"placeholder-do-not-add-below!": []
|
||||
}
|
||||
|
||||
@@ -2630,7 +2630,7 @@
|
||||
"citb-drop-plat-drop-children": [[[23, 29], "a0", "drop-plat"]],
|
||||
|
||||
"citb-drop-plat-spawn-children": [
|
||||
[98, "t9", "(function process function vector uint uint int)"]
|
||||
[98, "t9", "(function process function vector int int int none)"]
|
||||
],
|
||||
|
||||
"(method 11 citb-drop-plat)": [
|
||||
@@ -3944,8 +3944,8 @@
|
||||
"(code robotboss-blue-wait)": [[14, "v1", "art-joint-anim"]],
|
||||
|
||||
"(enter green-eco-lurker-appear)": [
|
||||
[12, "v1", "robotboss"],
|
||||
[17, "v1", "robotboss"]
|
||||
[12, "v1", "green-eco-lurker-gen"],
|
||||
[17, "v1", "green-eco-lurker-gen"]
|
||||
],
|
||||
|
||||
"(code green-eco-lurker-appear)": [
|
||||
@@ -4653,8 +4653,7 @@
|
||||
],
|
||||
|
||||
"dark-plants-all-done": [
|
||||
[6, "a0", "dark-plant"],
|
||||
[12, "a0", "dark-plant"]
|
||||
[25, "v1", "dark-plant"]
|
||||
],
|
||||
|
||||
"(code happy-plant-opening)": [
|
||||
@@ -5464,7 +5463,7 @@
|
||||
],
|
||||
|
||||
"(event play-anim green-sagecage)": [
|
||||
[128, "s5", "robotboss"]
|
||||
[128, "s5", "process-drawable"]
|
||||
],
|
||||
|
||||
"(method 21 citb-sagecage)": [
|
||||
@@ -7101,12 +7100,6 @@
|
||||
[[3, 99], "s4", "joint-mod-tracker"]
|
||||
],
|
||||
|
||||
"(method 14 snow-ball)": [
|
||||
[16, "v1", "vector"],
|
||||
[23, "v1", "vector"],
|
||||
[30, "v1", "vector"]
|
||||
],
|
||||
|
||||
"(method 7 snow-ball)": [
|
||||
[26, "t9", "(function process-drawable int process-drawable)"]
|
||||
],
|
||||
@@ -7261,7 +7254,7 @@
|
||||
[189, "a1", "collectable"],
|
||||
[280, "s0", "collectable"],
|
||||
[371, "s0", "collectable"],
|
||||
[[407, 410], "v1", "sunken-pipegame-button"]
|
||||
[[407, 409], "v1", "(pointer sunken-pipegame-button)"]
|
||||
],
|
||||
|
||||
"(method 7 sunken-pipegame)": [
|
||||
@@ -7751,6 +7744,18 @@
|
||||
[130, "v1", "art-joint-anim"]
|
||||
],
|
||||
|
||||
"(code nav-enemy-notice snow-bunny)": [
|
||||
[145, "v1", "art-joint-anim"]
|
||||
],
|
||||
|
||||
"(code snow-bunny-lunge snow-bunny)": [
|
||||
[22, "v1", "art-joint-anim"]
|
||||
],
|
||||
|
||||
"(code snow-bunny-attack snow-bunny)": [
|
||||
[20, "v1", "art-joint-anim"]
|
||||
],
|
||||
|
||||
"ogreboss-pick-target": [
|
||||
[31, "s3", "process-drawable"]
|
||||
],
|
||||
@@ -7860,5 +7865,37 @@
|
||||
[[23, 24], "s3", "ropebridge-spring-point"]
|
||||
],
|
||||
|
||||
"(code orbit-plat-rotating)": [
|
||||
[12, "a2", "orbit-plat"]
|
||||
],
|
||||
|
||||
"(code notice-blue plat-eco)": [
|
||||
[22, "v1", "process-drawable"],
|
||||
[36, "v1", "collide-shape"]
|
||||
],
|
||||
|
||||
"snow-bunny-default-event-handler": [
|
||||
[52, "v1", "vector"]
|
||||
],
|
||||
|
||||
"(method 15 snow-ball)": [
|
||||
[3, "v1", "(pointer snow-ball-roller)"],
|
||||
[25, "v1", "(pointer snow-ball-roller)"],
|
||||
[34, "v1", "(pointer snow-ball-roller)"],
|
||||
[36, "v1", "(pointer snow-ball-roller)"],
|
||||
[28, "a3", "(inline-array snow-ball-junction)"],
|
||||
[7, "a3", "(inline-array snow-ball-junction)"],
|
||||
[13, "a3", "(inline-array snow-ball-junction)"],
|
||||
[20, "a3", "(inline-array snow-ball-junction)"]
|
||||
],
|
||||
|
||||
"(trans snow-ball-shadow-idle)": [
|
||||
[4, "a0", "process-drawable"]
|
||||
],
|
||||
|
||||
"snow-ball-shadow-init-by-other": [
|
||||
[20, "a0", "process-drawable"]
|
||||
],
|
||||
|
||||
"placeholder-do-not-add-below": []
|
||||
}
|
||||
|
||||
@@ -3972,5 +3972,12 @@
|
||||
}
|
||||
},
|
||||
|
||||
"(method 15 snow-ball)": {
|
||||
"vars": {
|
||||
"v1-0": ["v1-0", "(pointer snow-ball-roller)"],
|
||||
"a3-1": ["a3-1", "(inline-array snow-ball-junction)"]
|
||||
}
|
||||
},
|
||||
|
||||
"aaaaaaaaaaaaaaaaaaaaaaa": {}
|
||||
}
|
||||
|
||||
@@ -353,25 +353,34 @@ void DirectRenderer::update_gl_blend() {
|
||||
if (!state.alpha_blend_enable) {
|
||||
glDisable(GL_BLEND);
|
||||
} else {
|
||||
glEnable(GL_BLEND);
|
||||
if (state.a == GsAlpha::BlendMode::SOURCE && state.b == GsAlpha::BlendMode::DEST &&
|
||||
state.c == GsAlpha::BlendMode::SOURCE && state.d == GsAlpha::BlendMode::DEST) {
|
||||
// (Cs - Cd) * As + Cd
|
||||
// Cs * As + (1 - As) * Cd
|
||||
glEnable(GL_BLEND);
|
||||
// s, d
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
} else if (state.a == GsAlpha::BlendMode::SOURCE &&
|
||||
state.b == GsAlpha::BlendMode::ZERO_OR_FIXED &&
|
||||
state.c == GsAlpha::BlendMode::SOURCE && state.d == GsAlpha::BlendMode::DEST) {
|
||||
// (Cs - 0) * As + Cd
|
||||
// Cs * As + (1) * CD
|
||||
glEnable(GL_BLEND);
|
||||
// Cs * As + (1) * Cd
|
||||
// s, d
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
} else if (state.a == GsAlpha::BlendMode::ZERO_OR_FIXED &&
|
||||
state.b == GsAlpha::BlendMode::SOURCE && state.c == GsAlpha::BlendMode::SOURCE &&
|
||||
state.d == GsAlpha::BlendMode::DEST) {
|
||||
// (0 - Cs) * As + Cd
|
||||
// Cd - Cs * As
|
||||
// s, d
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
|
||||
} else {
|
||||
// unsupported blend: a 0 b 2 c 2 d 1
|
||||
lg::error("unsupported blend: a {} b {} c {} d {}", (int)state.a, (int)state.b, (int)state.c,
|
||||
(int)state.d);
|
||||
lg::error("unsupported blend: a {} b {} c {} d {} NOTE THIS DOWN IMMEDIATELY!!", (int)state.a,
|
||||
(int)state.b, (int)state.c, (int)state.d);
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,6 +417,10 @@ void Sprite3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedPr
|
||||
// fmt::print(" vif: {}\n", VifCode(data.vif1()).print());
|
||||
}
|
||||
}
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
}
|
||||
|
||||
void Sprite3::draw_debug_window() {
|
||||
|
||||
@@ -406,6 +406,10 @@ void SpriteRenderer::render(DmaFollower& dma,
|
||||
// fmt::print(" vif: {}\n", VifCode(data.vif1()).print());
|
||||
}
|
||||
}
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
}
|
||||
|
||||
void SpriteRenderer::draw_debug_window() {
|
||||
@@ -531,26 +535,35 @@ void SpriteRenderer::update_gl_blend(AdGifState& state) {
|
||||
if (!m_prim_gl_state.alpha_blend_enable) {
|
||||
glDisable(GL_BLEND);
|
||||
} else {
|
||||
glEnable(GL_BLEND);
|
||||
if (state.a == GsAlpha::BlendMode::SOURCE && state.b == GsAlpha::BlendMode::DEST &&
|
||||
state.c == GsAlpha::BlendMode::SOURCE && state.d == GsAlpha::BlendMode::DEST) {
|
||||
// (Cs - Cd) * As + Cd
|
||||
// Cs * As + (1 - As) * Cd
|
||||
glEnable(GL_BLEND);
|
||||
// s, d
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
} else if (state.a == GsAlpha::BlendMode::SOURCE &&
|
||||
state.b == GsAlpha::BlendMode::ZERO_OR_FIXED &&
|
||||
state.c == GsAlpha::BlendMode::SOURCE && state.d == GsAlpha::BlendMode::DEST) {
|
||||
// (Cs - 0) * As + Cd
|
||||
// Cs * As + (1) * CD
|
||||
glEnable(GL_BLEND);
|
||||
// Cs * As + (1) * Cd
|
||||
// s, d
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
} else if (state.a == GsAlpha::BlendMode::ZERO_OR_FIXED &&
|
||||
state.b == GsAlpha::BlendMode::SOURCE && state.c == GsAlpha::BlendMode::SOURCE &&
|
||||
state.d == GsAlpha::BlendMode::DEST) {
|
||||
// (0 - Cs) * As + Cd
|
||||
// Cd - Cs * As
|
||||
// s, d
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
|
||||
} else {
|
||||
// unsupported blend: a 0 b 2 c 2 d 1
|
||||
lg::error("unsupported blend: a {} b {} c {} d {}", (int)state.a, (int)state.b, (int)state.c,
|
||||
(int)state.d);
|
||||
// assert(false);
|
||||
lg::error("unsupported blend: a {} b {} c {} d {} NOTE THIS DOWN IMMEDIATELY!!", (int)state.a,
|
||||
(int)state.b, (int)state.c, (int)state.d);
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@
|
||||
"goal_src/levels/citadel/citadel-obs.gc"
|
||||
"goal_src/levels/citadel/citb-plat.gc"
|
||||
"goal_src/levels/citadel/citadel-sages.gc"
|
||||
"goal_src/levels/common/snow-bunny.gc"
|
||||
"goal_src/levels/snow/snow-bunny.gc"
|
||||
"goal_src/levels/citadel/citb-bunny.gc"
|
||||
"goal_src/levels/citadel/citb-drop-plat-CIT.gc"
|
||||
"goal_src/levels/l1_only/citb-drop-plat-L1.gc"
|
||||
|
||||
@@ -390,7 +390,7 @@
|
||||
["citadel-obs", "citadel-obs", 3, ["CIT", "L1"], "levels/citadel"],
|
||||
["citb-plat", "citb-plat", 3, ["CIT", "L1"], "levels/citadel"],
|
||||
["citadel-sages", "citadel-sages", 3, ["CIT", "L1"], "levels/citadel"],
|
||||
["snow-bunny", "snow-bunny", 3, ["CIT", "L1", "SNO"], "levels/common"],
|
||||
["snow-bunny", "snow-bunny", 3, ["CIT", "L1", "SNO"], "levels/snow"],
|
||||
["citb-bunny", "citb-bunny", 3, ["CIT", "L1"], "levels/citadel"],
|
||||
["citb-drop-plat-CIT", "citb-drop-plat", 3, ["CIT"], "levels/citadel"],
|
||||
["citb-drop-plat-L1", "citb-drop-plat", 3, ["L1"], "levels/l1_only"],
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun can-grab-display? ((arg0 process-taskable))
|
||||
(defun can-grab-display? ((arg0 process))
|
||||
(let ((v1-2 (handle->process (-> *game-info* display-text-handle))))
|
||||
(when (and (or (not v1-2) (= v1-2 arg0) (>= (- (-> *display* base-frame-counter) (-> *game-info* display-text-time)) 30))
|
||||
(and *target*
|
||||
|
||||
@@ -647,6 +647,15 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(define *default-shadow-settings* (new 'static 'shadow-settings
|
||||
:shadow-dir
|
||||
(new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w 37683.2)
|
||||
:top-plane (new 'static 'plane :y 1.0 :w 4096.0)
|
||||
:fade-dist 409600.0
|
||||
)
|
||||
)
|
||||
|
||||
(define-extern draw-bones (function draw-control dma-buffer float none))
|
||||
|
||||
;; HACK incomplete:
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
(define-extern cam-slave-options->string (function cam-slave-options object string))
|
||||
(define-extern cam-index-options->string (function cam-index-options object string))
|
||||
(define-extern debug-set-camera-pos-rot! (function vector matrix vector))
|
||||
(define-extern camera-slave-debug (function camera-slave object)) ;; passed to engine::method-15
|
||||
(define-extern camera-slave-debug (function camera-slave none))
|
||||
;; TODO - for cam-states
|
||||
(define-extern cam-debug-add-los-tri (function (inline-array collide-cache-tri) vector vector none))
|
||||
(define-extern cam-collision-record-save (function vector vector int symbol camera-slave none))
|
||||
|
||||
@@ -5,88 +5,709 @@
|
||||
;; name in dgo: cam-debug
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; this file is debug only
|
||||
(declare-file (debug))
|
||||
(when *debug-segment*
|
||||
(when (or (not *camera-old-cpu*) (zero? *camera-old-cpu*))
|
||||
(set! *camera-old-cpu* 0)
|
||||
0
|
||||
)
|
||||
|
||||
(defun external-cam-reset! ()
|
||||
(vector-reset! (-> *math-camera* trans))
|
||||
(matrix-identity! (-> *math-camera* inv-camera-rot))
|
||||
(when *camera-combiner*
|
||||
(let* ((v1-6 (-> *math-camera* inv-camera-rot))
|
||||
(a3-0 (-> *camera-combiner* inv-camera-rot))
|
||||
(a0-2 (-> a3-0 vector 0 quad))
|
||||
(a1-0 (-> a3-0 vector 1 quad))
|
||||
(a2-0 (-> a3-0 vector 2 quad))
|
||||
(a3-1 (-> a3-0 vector 3 quad))
|
||||
)
|
||||
(set! (-> v1-6 vector 0 quad) a0-2)
|
||||
(set! (-> v1-6 vector 1 quad) a1-0)
|
||||
(set! (-> v1-6 vector 2 quad) a2-0)
|
||||
(set! (-> v1-6 vector 3 quad) a3-1)
|
||||
)
|
||||
(set! (-> *math-camera* trans quad) (-> *camera-combiner* trans quad))
|
||||
(when (or (not *camera-old-vu*) (zero? *camera-old-vu*))
|
||||
(set! *camera-old-vu* 0)
|
||||
0
|
||||
)
|
||||
|
||||
(when (or (not *camera-old-tfrag-bytes*) (zero? *camera-old-tfrag-bytes*))
|
||||
(set! *camera-old-tfrag-bytes* 0)
|
||||
0
|
||||
)
|
||||
|
||||
(define-perm *camera-old-level* string (new 'global 'string 128 (the-as string #f)))
|
||||
|
||||
(define-perm *camera-old-stat-string-tfrag* string (new 'global 'string 128 (the-as string #f)))
|
||||
|
||||
(define-perm *camera-old-stat-string-tfrag-near* string (new 'global 'string 128 (the-as string #f)))
|
||||
|
||||
(define-perm *camera-old-stat-string-total* string (new 'global 'string 128 (the-as string #f)))
|
||||
|
||||
(deftype cam-dbg-scratch (structure)
|
||||
((linevec4w vector4w 2 :inline :offset-assert 0)
|
||||
(color vector :inline :offset-assert 32)
|
||||
(plotvec vector 2 :inline :offset-assert 48)
|
||||
(linevec vector 2 :inline :offset-assert 80)
|
||||
(rel-vec vector :inline :offset-assert 112)
|
||||
(sphere-v-start vector :inline :offset-assert 128)
|
||||
(sphere-v-end vector :inline :offset-assert 144)
|
||||
(sphere-v-down vector :inline :offset-assert 160)
|
||||
(sphere-vec vector :inline :offset-assert 176)
|
||||
(crossvec vector 3 :inline :offset-assert 192)
|
||||
(bboxvec vector 6 :inline :offset-assert 240)
|
||||
(fov-vv vector 4 :inline :offset-assert 336)
|
||||
(fov-src vector :inline :offset-assert 400)
|
||||
(fov-dest vector :inline :offset-assert 416)
|
||||
(fov-vert vector :inline :offset-assert 432)
|
||||
(fov-horz vector :inline :offset-assert 448)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x1d0
|
||||
:flag-assert #x9000001d0
|
||||
)
|
||||
|
||||
|
||||
(defun cam-slave-options->string ((arg0 cam-slave-options) (arg1 object))
|
||||
(if (= (logand (cam-slave-options AIR_EXIT) arg0) (cam-slave-options AIR_EXIT))
|
||||
(format arg1 "AIR_EXIT ")
|
||||
)
|
||||
(if (= (logand (cam-slave-options STICKY_ANGLE) arg0) (cam-slave-options STICKY_ANGLE))
|
||||
(format arg1 "STICKY_ANGLE ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options NO_ROTATE)) (cam-slave-options NO_ROTATE))
|
||||
(format arg1 "NO_ROTATE ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options BIKE_MODE)) (cam-slave-options BIKE_MODE))
|
||||
(format arg1 "BIKE_MODE ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options BLOCK_SHIFT_BUTTONS)) (cam-slave-options BLOCK_SHIFT_BUTTONS))
|
||||
(format arg1 "BLOCK_SHIFT_BUTTONS ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options GOTO_GOOD_POINT)) (cam-slave-options GOTO_GOOD_POINT))
|
||||
(format arg1 "GOTO_GOOD_POINT ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options SHRINK_MAX_ANGLE)) (cam-slave-options SHRINK_MAX_ANGLE))
|
||||
(format arg1 "SHRINK_MAX_ANGLE ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options MOVEMENT_BLOCKED)) (cam-slave-options MOVEMENT_BLOCKED))
|
||||
(format arg1 "MOVEMENT_BLOCKED ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options LINE_OF_SIGHT)) (cam-slave-options LINE_OF_SIGHT))
|
||||
(format arg1 "LINE_OF_SIGHT ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options PLAYER_MOVING_CAMERA)) (cam-slave-options PLAYER_MOVING_CAMERA))
|
||||
(format arg1 "PLAYER_MOVING_CAMERA ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options DRAG)) (cam-slave-options DRAG))
|
||||
(format arg1 "DRAG ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options FIND_HIDDEN_TARGET)) (cam-slave-options FIND_HIDDEN_TARGET))
|
||||
(format arg1 "FIND_HIDDEN_TARGET ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options COLLIDE)) (cam-slave-options COLLIDE))
|
||||
(format arg1 "COLLIDE ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options JUMP_PITCHES)) (cam-slave-options JUMP_PITCHES))
|
||||
(format arg1 "JUMP_PITCHES ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options ALLOW_Z_ROT)) (cam-slave-options ALLOW_Z_ROT))
|
||||
(format arg1 "ALLOW_Z_ROT ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options MOVE_SPHERICAL)) (cam-slave-options MOVE_SPHERICAL))
|
||||
(format arg1 "MOVE_SPHERICAL ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options SAME_SIDE)) (cam-slave-options SAME_SIDE))
|
||||
(format arg1 "SAME_SIDE ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-slave-options BUTT_CAM)) (cam-slave-options BUTT_CAM))
|
||||
(format arg1 "BUTT_CAM ")
|
||||
)
|
||||
(the-as string arg1)
|
||||
)
|
||||
|
||||
(defun cam-index-options->string ((arg0 cam-index-options) (arg1 object))
|
||||
(if (= (logand arg0 (cam-index-options SPHERICAL)) (cam-index-options SPHERICAL))
|
||||
(format arg1 "RADIAL ")
|
||||
)
|
||||
(if (= (logand arg0 (cam-index-options RADIAL)) (cam-index-options RADIAL))
|
||||
(format arg1 "SPHERICAL ")
|
||||
)
|
||||
(the-as string arg1)
|
||||
)
|
||||
|
||||
(defun slave-los-state->string ((arg0 slave-los-state))
|
||||
(case arg0
|
||||
(((slave-los-state between))
|
||||
"between"
|
||||
)
|
||||
(((slave-los-state ccw))
|
||||
"ccw"
|
||||
)
|
||||
(((slave-los-state cw))
|
||||
"cw"
|
||||
)
|
||||
(((slave-los-state none))
|
||||
"none"
|
||||
)
|
||||
(else
|
||||
"*unknown*"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype cam-debug-tri (structure)
|
||||
((vertex vector 3 :inline :offset-assert 0)
|
||||
(intersect vector :inline :offset-assert 48)
|
||||
(color vector4w :offset-assert 64)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x44
|
||||
:flag-assert #x900000044
|
||||
)
|
||||
|
||||
|
||||
(define *cam-debug-los-tri-current* 0)
|
||||
|
||||
(define *cam-debug-los-tri* (the-as (inline-array cam-debug-tri) (malloc 'debug #x8fc0)))
|
||||
|
||||
(define *cam-debug-coll-tri-current* 0)
|
||||
|
||||
(define *cam-debug-coll-tri* (the-as (inline-array cam-debug-tri) (malloc 'debug #x8fc0)))
|
||||
|
||||
(defun cam-debug-reset-coll-tri ()
|
||||
(set! *cam-debug-los-tri-current* 0)
|
||||
(set! *cam-debug-coll-tri-current* 0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun cam-debug-add-los-tri ((arg0 (inline-array collide-cache-tri)) (arg1 vector) (arg2 vector))
|
||||
(cond
|
||||
((>= *cam-debug-los-tri-current* 460)
|
||||
)
|
||||
(else
|
||||
(let ((v1-3 (-> *cam-debug-los-tri* *cam-debug-los-tri-current*)))
|
||||
(set! (-> v1-3 vertex 0 quad) (-> arg0 0 vertex 0 quad))
|
||||
(set! (-> v1-3 vertex 1 quad) (-> arg0 0 vertex 1 quad))
|
||||
(set! (-> v1-3 vertex 2 quad) (-> arg0 0 vertex 2 quad))
|
||||
(set! (-> v1-3 intersect quad) (-> arg1 quad))
|
||||
(set! (-> v1-3 color) (the-as vector4w arg2))
|
||||
)
|
||||
(set! *cam-debug-los-tri-current* (+ *cam-debug-los-tri-current* 1))
|
||||
(if (= *cam-debug-los-tri-current* 460)
|
||||
(format 0 "ERROR <GMJ>: cam-debug-add-los-tri overflow~%")
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun cam-debug-add-coll-tri ((arg0 cam-debug-tri) (arg1 vector) (arg2 cam-debug-tri))
|
||||
(cond
|
||||
((>= *cam-debug-coll-tri-current* 460)
|
||||
)
|
||||
(else
|
||||
(let ((v1-3 (-> *cam-debug-coll-tri* *cam-debug-coll-tri-current*)))
|
||||
(set! (-> v1-3 vertex 0 quad) (-> arg0 vertex 0 quad))
|
||||
(set! (-> v1-3 vertex 1 quad) (-> arg0 vertex 1 quad))
|
||||
(set! (-> v1-3 vertex 2 quad) (-> arg0 vertex 2 quad))
|
||||
(set! (-> v1-3 intersect quad) (-> arg1 quad))
|
||||
(set! (-> v1-3 color) (the-as vector4w arg2))
|
||||
)
|
||||
(set! *cam-debug-coll-tri-current* (+ *cam-debug-coll-tri-current* 1))
|
||||
(if (>= *cam-debug-coll-tri-current* 460)
|
||||
(format 0 "ERROR <GMJ>: cam-debug-add-coll-tri overflow~%")
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod print-nth-point tracking-spline ((obj tracking-spline) (arg0 int))
|
||||
(if (= arg0 (-> obj used-point))
|
||||
(format 0 "u")
|
||||
(format 0 " ")
|
||||
)
|
||||
(if (= arg0 (-> obj next-to-last-point))
|
||||
(format 0 "n")
|
||||
(format 0 " ")
|
||||
)
|
||||
(if (= arg0 (-> obj end-point))
|
||||
(format 0 "e")
|
||||
(format 0 " ")
|
||||
)
|
||||
(if (= arg0 -134250495)
|
||||
(format 0 " ~D~%" arg0)
|
||||
(format
|
||||
0
|
||||
" ~D ~M ~M ~M~%"
|
||||
arg0
|
||||
(-> obj point arg0 position x)
|
||||
(-> obj point arg0 position y)
|
||||
(-> obj point arg0 position z)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod TODO-RENAME-12 tracking-spline ((obj tracking-spline))
|
||||
(let ((s5-0 (-> obj used-point)))
|
||||
(while (!= s5-0 -134250495)
|
||||
(print-nth-point obj s5-0)
|
||||
(set! s5-0 (-> obj point s5-0 next))
|
||||
)
|
||||
(print-nth-point obj s5-0)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod TODO-RENAME-23 tracking-spline ((obj tracking-spline))
|
||||
(let ((s5-0 (-> obj used-point))
|
||||
(s4-0 (-> obj point (-> obj used-point) next))
|
||||
)
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
(when (!= s4-0 -134250495)
|
||||
(TODO-RENAME-19 obj 0.0 s3-0 (the-as tracking-spline-sampler #f))
|
||||
(camera-cross
|
||||
(new 'static 'vector :y 1024.0)
|
||||
(new 'static 'vector :z 1024.0)
|
||||
s3-0
|
||||
(new 'static 'vector4w :x #xff :w #x80)
|
||||
(meters 0.25)
|
||||
)
|
||||
(TODO-RENAME-19 obj (-> obj sample-len) s3-0 (the-as tracking-spline-sampler #f))
|
||||
(camera-cross
|
||||
(new 'static 'vector :y 1024.0)
|
||||
(new 'static 'vector :z 1024.0)
|
||||
s3-0
|
||||
(new 'static 'vector4w :x #xff :w #x80)
|
||||
(meters 0.25)
|
||||
)
|
||||
)
|
||||
)
|
||||
(while (!= s4-0 -134250495)
|
||||
(camera-line
|
||||
(the-as vector (-> obj point s5-0))
|
||||
(the-as vector (-> obj point s4-0))
|
||||
(new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)
|
||||
)
|
||||
(set! s5-0 s4-0)
|
||||
(set! s4-0 (-> obj point s4-0 next))
|
||||
)
|
||||
)
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector)))
|
||||
(camera-line
|
||||
(-> obj debug-out-position)
|
||||
(-> obj debug-old-position)
|
||||
(new 'static 'vector4w :x #xff :y #xff :w #x80)
|
||||
)
|
||||
(vector-! s5-1 (-> obj debug-out-position) (-> obj debug-old-position))
|
||||
(TODO-RENAME-20 obj s5-1 (-> obj debug-last-point))
|
||||
(camera-line-rel (-> obj debug-old-position) s5-1 (new 'static 'vector4w :x #xff :z #xff :w #x80))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun debug-euler ((arg0 cam-dbg-scratch))
|
||||
(let ((s4-0 (new 'stack-no-clear 'euler-angles))
|
||||
(gp-0 (new 'stack-no-clear 'matrix))
|
||||
)
|
||||
(matrix->eul s4-0 (the-as matrix (&-> arg0 sphere-vec w)) 21)
|
||||
(format *stdcon* "euler angles x ~R y ~R z ~R~%" (-> s4-0 x) (-> s4-0 y) (-> s4-0 z))
|
||||
(format
|
||||
*stdcon*
|
||||
"~f ~f ~f ~f~%"
|
||||
(-> arg0 sphere-vec w)
|
||||
(-> arg0 crossvec 0 x)
|
||||
(-> arg0 crossvec 0 y)
|
||||
(-> arg0 crossvec 0 z)
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"~f ~f ~f ~f~%"
|
||||
(-> arg0 crossvec 0 w)
|
||||
(-> arg0 crossvec 1 x)
|
||||
(-> arg0 crossvec 1 y)
|
||||
(-> arg0 crossvec 1 z)
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"~f ~f ~f ~f~%"
|
||||
(-> arg0 crossvec 1 w)
|
||||
(-> arg0 crossvec 2 x)
|
||||
(-> arg0 crossvec 2 y)
|
||||
(-> arg0 crossvec 2 z)
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"~f ~f ~f ~f~%"
|
||||
(-> arg0 crossvec 2 w)
|
||||
(-> arg0 bboxvec 0 x)
|
||||
(-> arg0 bboxvec 0 y)
|
||||
(-> arg0 bboxvec 0 z)
|
||||
)
|
||||
(eul->matrix gp-0 s4-0)
|
||||
(format
|
||||
*stdcon*
|
||||
"~f ~f ~f ~f~%"
|
||||
(-> gp-0 vector 0 x)
|
||||
(-> gp-0 vector 0 y)
|
||||
(-> gp-0 vector 0 z)
|
||||
(-> gp-0 vector 0 w)
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"~f ~f ~f ~f~%"
|
||||
(-> gp-0 vector 1 x)
|
||||
(-> gp-0 vector 1 y)
|
||||
(-> gp-0 vector 1 z)
|
||||
(-> gp-0 vector 1 w)
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"~f ~f ~f ~f~%"
|
||||
(-> gp-0 vector 2 x)
|
||||
(-> gp-0 vector 2 y)
|
||||
(-> gp-0 vector 2 z)
|
||||
(-> gp-0 vector 2 w)
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"~f ~f ~f ~f~%"
|
||||
(-> gp-0 vector 3 x)
|
||||
(-> gp-0 vector 3 y)
|
||||
(-> gp-0 vector 3 z)
|
||||
(-> gp-0 vector 3 w)
|
||||
)
|
||||
(if (or (< 0.001 (fabs (- (-> arg0 sphere-vec w) (-> gp-0 vector 0 x))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 0 x) (-> gp-0 vector 0 y))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 0 y) (-> gp-0 vector 0 z))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 0 z) (-> gp-0 vector 0 w))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 0 w) (-> gp-0 vector 1 x))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 1 x) (-> gp-0 vector 1 y))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 1 y) (-> gp-0 vector 1 z))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 1 z) (-> gp-0 vector 1 w))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 1 w) (-> gp-0 vector 2 x))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 2 x) (-> gp-0 vector 2 y))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 2 y) (-> gp-0 vector 2 z))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 2 z) (-> gp-0 vector 2 w))))
|
||||
(< 0.001 (fabs (- (-> arg0 crossvec 2 w) (-> gp-0 vector 3 x))))
|
||||
(< 0.001 (fabs (- (-> arg0 bboxvec 0 x) (-> gp-0 vector 3 y))))
|
||||
(< 0.001 (fabs (- (-> arg0 bboxvec 0 y) (-> gp-0 vector 3 z))))
|
||||
(< 0.001 (fabs (- (-> arg0 bboxvec 0 z) (-> gp-0 vector 3 w))))
|
||||
)
|
||||
(format *stdcon* "different~%")
|
||||
(format *stdcon* "same~%")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defun bike-cam-limit ((arg0 float))
|
||||
(let* ((f0-1 (* 10012.444 arg0))
|
||||
(f30-0 (fmax 0.0 f0-1))
|
||||
)
|
||||
(if (< f30-0 8192.0)
|
||||
(* (/ 1.0 (- 1.0 (cos 21845.334))) (+ (- (cos 21845.334)) (cos (* 2.6666667 (- 8192.0 f30-0)))))
|
||||
1.0
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defun master-draw-coordinates ((arg0 vector))
|
||||
(let ((s5-0 (new-stack-vector0))
|
||||
(gp-0 (new-stack-vector0))
|
||||
)
|
||||
(let ((a0-1 (new-stack-matrix0)))
|
||||
(set-vector! s5-0 0.0 8192.0 0.0 1.0)
|
||||
(matrix-rotate-yxz! a0-1 s5-0)
|
||||
)
|
||||
(vector+!
|
||||
gp-0
|
||||
(-> *camera-combiner* trans)
|
||||
(vector-normalize-copy! gp-0 (-> *camera-combiner* inv-camera-rot vector 2) 24576.0)
|
||||
)
|
||||
(let ((a1-2 s5-0)
|
||||
(v1-4 gp-0)
|
||||
(a0-3 s5-0)
|
||||
)
|
||||
(set! (-> a0-3 x) 4096.0)
|
||||
(set! (-> a0-3 y) 0.0)
|
||||
(set! (-> a0-3 z) 0.0)
|
||||
(set! (-> a0-3 w) 1.0)
|
||||
(vector+! a1-2 v1-4 a0-3)
|
||||
)
|
||||
(add-debug-line #t (bucket-id debug-draw1) gp-0 s5-0 (new 'static 'rgba :r #xff :a #x80) #f (the-as rgba -1))
|
||||
(let ((a1-5 s5-0)
|
||||
(v1-5 gp-0)
|
||||
(a0-5 s5-0)
|
||||
)
|
||||
(set! (-> a0-5 x) 0.0)
|
||||
(set! (-> a0-5 y) 4096.0)
|
||||
(set! (-> a0-5 z) 0.0)
|
||||
(set! (-> a0-5 w) 1.0)
|
||||
(vector+! a1-5 v1-5 a0-5)
|
||||
)
|
||||
(add-debug-line #t (bucket-id debug-draw1) gp-0 s5-0 (new 'static 'rgba :g #xff :a #x80) #f (the-as rgba -1))
|
||||
(let ((a1-8 s5-0)
|
||||
(v1-6 gp-0)
|
||||
(a0-7 s5-0)
|
||||
)
|
||||
(set! (-> a0-7 x) 0.0)
|
||||
(set! (-> a0-7 y) 0.0)
|
||||
(set! (-> a0-7 z) 4096.0)
|
||||
(set! (-> a0-7 w) 1.0)
|
||||
(vector+! a1-8 v1-6 a0-7)
|
||||
)
|
||||
(add-debug-line #t (bucket-id debug-draw1) gp-0 s5-0 (new 'static 'rgba :b #xff :a #x80) #f (the-as rgba -1))
|
||||
(when arg0
|
||||
(set! (-> s5-0 quad) (-> arg0 quad))
|
||||
(vector-normalize! s5-0 4096.0)
|
||||
(vector+! s5-0 gp-0 s5-0)
|
||||
(add-debug-line
|
||||
#t
|
||||
(bucket-id debug-draw1)
|
||||
gp-0
|
||||
s5-0
|
||||
(new 'static 'rgba :r #x7f :g #x7f :a #x80)
|
||||
#f
|
||||
(the-as rgba -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(deftype cam-collision-record (structure)
|
||||
((pos vector :inline :offset-assert 0)
|
||||
(vel vector :inline :offset-assert 16)
|
||||
(desired-pos vector :inline :offset-assert 32)
|
||||
(cam-tpos-cur vector :inline :offset-assert 48)
|
||||
(cam-tpos-old vector :inline :offset-assert 64)
|
||||
(view-flat vector :inline :offset-assert 80)
|
||||
(string-min-val vector :inline :offset-assert 96)
|
||||
(string-max-val vector :inline :offset-assert 112)
|
||||
(view-off vector :inline :offset-assert 128)
|
||||
(min-z-override float :offset-assert 144)
|
||||
(string-push-z float :offset-assert 148)
|
||||
(view-off-param float :offset-assert 152)
|
||||
(frame int32 :offset-assert 156)
|
||||
(iteration int32 :offset-assert 160)
|
||||
(move-type symbol :offset-assert 164)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xa8
|
||||
:flag-assert #x9000000a8
|
||||
)
|
||||
|
||||
|
||||
(deftype cam-collision-record-array (inline-array-class)
|
||||
((data cam-collision-record :dynamic :offset-assert 16)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
|
||||
(set! (-> cam-collision-record-array heap-base) (the-as uint 176))
|
||||
|
||||
(define *cam-collision-record-first* 0)
|
||||
|
||||
(define *cam-collision-record-last* 0)
|
||||
|
||||
(define *cam-collision-record-show* 0)
|
||||
|
||||
(define *cam-collision-record* (new 'debug 'cam-collision-record-array 600))
|
||||
|
||||
(defun cam-collision-record-save ((arg0 vector) (arg1 vector) (arg2 int) (arg3 symbol) (arg4 camera-slave))
|
||||
(when *record-cam-collide-history*
|
||||
(let ((v1-5 (the-as
|
||||
cam-collision-record
|
||||
(+ (+ (* 176 *cam-collision-record-last*) 12) (the-as int *cam-collision-record*))
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> v1-5 pos quad) (-> arg0 quad))
|
||||
(set! (-> v1-5 vel quad) (-> arg1 quad))
|
||||
(set! (-> v1-5 view-flat quad) (-> arg4 view-flat quad))
|
||||
(set! (-> v1-5 desired-pos quad) (-> arg4 desired-pos quad))
|
||||
(set! (-> v1-5 cam-tpos-cur quad) (-> *camera* tpos-curr-adj quad))
|
||||
(set! (-> v1-5 cam-tpos-old quad) (-> *camera* tpos-old-adj quad))
|
||||
(set! (-> v1-5 string-min-val quad) (-> arg4 string-min-val quad))
|
||||
(set! (-> v1-5 string-max-val quad) (-> arg4 string-max-val quad))
|
||||
(set! (-> v1-5 view-off quad) (-> arg4 view-off quad))
|
||||
(set! (-> v1-5 frame) (-> *display* base-frame-counter))
|
||||
(set! (-> v1-5 iteration) arg2)
|
||||
(set! (-> v1-5 move-type) arg3)
|
||||
(set! (-> v1-5 min-z-override) (-> arg4 min-z-override))
|
||||
(set! (-> v1-5 string-push-z) (-> *camera* string-push-z))
|
||||
(set! (-> v1-5 view-off-param) (-> arg4 view-off-param))
|
||||
)
|
||||
(set! *cam-collision-record-show* *cam-collision-record-last*)
|
||||
(set! *cam-collision-record-last* (+ *cam-collision-record-last* 1))
|
||||
(set! *cam-collision-record-last* (mod *cam-collision-record-last* 600))
|
||||
(when (= *cam-collision-record-last* *cam-collision-record-first*)
|
||||
(set! *cam-collision-record-first* (+ *cam-collision-record-first* 1))
|
||||
(set! *cam-collision-record-first* (mod *cam-collision-record-first* 600))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun cam-collision-record-step ((arg0 int))
|
||||
(set! *cam-collision-record-show* (+ *cam-collision-record-show* arg0))
|
||||
(while (>= *cam-collision-record-show* 600)
|
||||
(set! *cam-collision-record-show* (+ *cam-collision-record-show* -600))
|
||||
)
|
||||
(while (< *cam-collision-record-show* 0)
|
||||
(set! *cam-collision-record-show* (+ *cam-collision-record-show* 600))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun cam-collision-record-draw ()
|
||||
(cond
|
||||
((cpad-pressed? 0 down)
|
||||
(cam-collision-record-step 1)
|
||||
)
|
||||
((cpad-hold? 0 right)
|
||||
(cam-collision-record-step 1)
|
||||
)
|
||||
((cpad-pressed? 0 up)
|
||||
(cam-collision-record-step -1)
|
||||
)
|
||||
((cpad-hold? 0 left)
|
||||
(cam-collision-record-step -1)
|
||||
)
|
||||
)
|
||||
(let ((s5-0 (the-as
|
||||
cam-collision-record
|
||||
(+ (+ (* 176 *cam-collision-record-show*) 12) (the-as int *cam-collision-record*))
|
||||
)
|
||||
)
|
||||
(s4-0 (new 'stack 'vector4w))
|
||||
(gp-0 (new 'stack 'vector4w))
|
||||
)
|
||||
(format *stdcon* "move-type ~A~%" (-> s5-0 move-type))
|
||||
(cond
|
||||
((= (-> s5-0 move-type) 'normal)
|
||||
(set! (-> s4-0 x) 255)
|
||||
(set! (-> s4-0 y) 255)
|
||||
)
|
||||
((= (-> s5-0 move-type) 'jump)
|
||||
(set! (-> s4-0 x) 255)
|
||||
)
|
||||
((= (-> s5-0 move-type) 'no-hit)
|
||||
(set! (-> s4-0 y) 255)
|
||||
)
|
||||
(else
|
||||
(set! (-> s4-0 z) 255)
|
||||
)
|
||||
)
|
||||
(set! (-> s4-0 w) 128)
|
||||
(set! (-> gp-0 x) 127)
|
||||
(set! (-> gp-0 y) 127)
|
||||
(set! (-> gp-0 z) 127)
|
||||
(set! (-> gp-0 w) 128)
|
||||
(camera-line-rel-len (-> s5-0 pos) (-> s5-0 vel) (fmax 81.92 (vector-length (-> s5-0 vel))) s4-0)
|
||||
(let* ((s3-1 (new 'stack-no-clear 'collide-tri-result))
|
||||
(f30-1
|
||||
(fill-and-probe-using-line-sphere
|
||||
*collide-cache*
|
||||
(-> s5-0 pos)
|
||||
(-> s5-0 vel)
|
||||
(-> *CAMERA-bank* collide-move-rad)
|
||||
(collide-kind background)
|
||||
(the-as process #f)
|
||||
s3-1
|
||||
2
|
||||
)
|
||||
)
|
||||
(s2-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(format *stdcon* "frame ~D iteration ~D travel ~f~%" (-> s5-0 frame) (-> s5-0 iteration) f30-1)
|
||||
(format
|
||||
*stdcon*
|
||||
"mzo ~M psz ~M vop ~f~%"
|
||||
(-> s5-0 min-z-override)
|
||||
(-> s5-0 string-push-z)
|
||||
(-> s5-0 view-off-param)
|
||||
)
|
||||
(format *stdcon* "pos ~M ~M ~M~%" (-> s5-0 pos x) (-> s5-0 pos y) (-> s5-0 pos z))
|
||||
(format *stdcon* "vel ~M ~M ~M~%" (-> s5-0 vel x) (-> s5-0 vel y) (-> s5-0 vel z))
|
||||
(format *stdcon* "des ~M ~M ~M~%" (-> s5-0 desired-pos x) (-> s5-0 desired-pos y) (-> s5-0 desired-pos z))
|
||||
(format *stdcon* "flt ~M ~M ~M~%" (-> s5-0 view-flat x) (-> s5-0 view-flat y) (-> s5-0 view-flat z))
|
||||
(format *stdcon* "cur ~M ~M ~M~%" (-> s5-0 cam-tpos-cur x) (-> s5-0 cam-tpos-cur y) (-> s5-0 cam-tpos-cur z))
|
||||
(format *stdcon* "old ~M ~M ~M~%" (-> s5-0 cam-tpos-old x) (-> s5-0 cam-tpos-old y) (-> s5-0 cam-tpos-old z))
|
||||
(format
|
||||
*stdcon*
|
||||
"smn ~M ~M ~M~%"
|
||||
(-> s5-0 string-min-val x)
|
||||
(-> s5-0 string-min-val y)
|
||||
(-> s5-0 string-min-val z)
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"smx ~M ~M ~M~%"
|
||||
(-> s5-0 string-max-val x)
|
||||
(-> s5-0 string-max-val y)
|
||||
(-> s5-0 string-max-val z)
|
||||
)
|
||||
(format *stdcon* "vof ~M ~M ~M~%" (-> s5-0 view-off x) (-> s5-0 view-off y) (-> s5-0 view-off z))
|
||||
(when (>= f30-1 0.0)
|
||||
(camera-line (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1) s4-0)
|
||||
(camera-line (-> s3-1 vertex 1) (-> s3-1 vertex 2) s4-0)
|
||||
(camera-line (-> s3-1 vertex 2) (the-as vector (-> s3-1 vertex)) s4-0)
|
||||
(vector-! s2-1 (-> s5-0 pos) (-> s3-1 intersect))
|
||||
(vector-normalize! s2-1 1.0)
|
||||
(camera-line-rel-len (-> s3-1 intersect) s2-1 (-> *CAMERA-bank* collide-move-rad) gp-0)
|
||||
(camera-line-rel-len (-> s3-1 intersect) (-> s3-1 normal) (-> *CAMERA-bank* collide-move-rad) gp-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun debug-set-camera-pos-rot! ((arg0 vector) (arg1 matrix))
|
||||
(when (and *camera* *camera-combiner*)
|
||||
(send-event *camera* 'change-state cam-free-floating 0)
|
||||
(set! (-> *camera-combiner* trans quad) (-> arg0 quad))
|
||||
(let ((a2-0 (-> *camera-combiner* inv-camera-rot))
|
||||
(v1-10 (-> arg1 vector 0 quad))
|
||||
(a0-4 (-> arg1 vector 1 quad))
|
||||
(a1-2 (-> arg1 vector 2 quad))
|
||||
(a3-0 (-> arg1 vector 3 quad))
|
||||
)
|
||||
(set! (-> a2-0 vector 0 quad) v1-10)
|
||||
(set! (-> a2-0 vector 1 quad) a0-4)
|
||||
(set! (-> a2-0 vector 2 quad) a1-2)
|
||||
(set! (-> a2-0 vector 3 quad) a3-0)
|
||||
(send-event *camera* 'change-state cam-free-floating 0)
|
||||
(set! (-> *camera-combiner* trans quad) (-> arg0 quad))
|
||||
(let ((a2-0 (-> *camera-combiner* inv-camera-rot))
|
||||
(v1-10 (-> arg1 vector 0 quad))
|
||||
(a0-4 (-> arg1 vector 1 quad))
|
||||
(a1-2 (-> arg1 vector 2 quad))
|
||||
(a3-0 (-> arg1 vector 3 quad))
|
||||
)
|
||||
(set! (-> a2-0 vector 0 quad) v1-10)
|
||||
(set! (-> a2-0 vector 1 quad) a0-4)
|
||||
(set! (-> a2-0 vector 2 quad) a1-2)
|
||||
(set! (-> a2-0 vector 3 quad) a3-0)
|
||||
)
|
||||
(send-event *camera* 'change-state cam-fixed 0)
|
||||
)
|
||||
(send-event *camera* 'change-state cam-fixed 0)
|
||||
)
|
||||
arg0
|
||||
)
|
||||
|
||||
(defun external-cam-reset! ()
|
||||
(vector-reset! (-> *math-camera* trans))
|
||||
(matrix-identity! (-> *math-camera* inv-camera-rot))
|
||||
(when *camera-combiner*
|
||||
(let* ((v1-6 (-> *math-camera* inv-camera-rot))
|
||||
(a3-0 (-> *camera-combiner* inv-camera-rot))
|
||||
(a0-2 (-> a3-0 vector 0 quad))
|
||||
(a1-0 (-> a3-0 vector 1 quad))
|
||||
(a2-0 (-> a3-0 vector 2 quad))
|
||||
(a3-1 (-> a3-0 vector 3 quad))
|
||||
)
|
||||
(set! (-> v1-6 vector 0 quad) a0-2)
|
||||
(set! (-> v1-6 vector 1 quad) a1-0)
|
||||
(set! (-> v1-6 vector 2 quad) a2-0)
|
||||
(set! (-> v1-6 vector 3 quad) a3-1)
|
||||
)
|
||||
(set! (-> *math-camera* trans quad) (-> *camera-combiner* trans quad))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
|
||||
(define-extern cam-debug-add-los-tri (function (inline-array collide-cache-tri) vector vector none))
|
||||
(defun cam-debug-add-los-tri ((a (inline-array collide-cache-tri)) (b vector) (c vector))
|
||||
(none)
|
||||
)
|
||||
(defun cam-collision-record-save ((a vector) (b vector) (c int) (d symbol) (e camera-slave))
|
||||
(none)
|
||||
)
|
||||
(define-extern slave-los-state->string (function slave-los-state string))
|
||||
(define-extern cam-debug-reset-coll-tri (function none)) ;; not confirmed
|
||||
|
||||
(when (or (not *camera-old-cpu*) (zero? *camera-old-cpu*))
|
||||
(set! *camera-old-cpu* 0)
|
||||
0
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(when (or (not *camera-old-vu*) (zero? *camera-old-vu*))
|
||||
(set! *camera-old-vu* 0)
|
||||
0
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(when (or (not *camera-old-tfrag-bytes*) (zero? *camera-old-tfrag-bytes*))
|
||||
(set! *camera-old-tfrag-bytes* 0)
|
||||
0
|
||||
)
|
||||
|
||||
;; definition (perm) for symbol *camera-old-level*, type string
|
||||
(define-perm *camera-old-level* string (new 'global 'string 128 (the-as string #f)))
|
||||
|
||||
;; definition (perm) for symbol *camera-old-stat-string-tfrag*, type string
|
||||
(define-perm *camera-old-stat-string-tfrag* string (new 'global 'string 128 (the-as string #f)))
|
||||
|
||||
;; definition (perm) for symbol *camera-old-stat-string-tfrag-near*, type string
|
||||
(define-perm *camera-old-stat-string-tfrag-near* string (new 'global 'string 128 (the-as string #f)))
|
||||
|
||||
;; definition (perm) for symbol *camera-old-stat-string-total*, type string
|
||||
(define-perm *camera-old-stat-string-total* string (new 'global 'string 128 (the-as string #f)))
|
||||
|
||||
@@ -601,6 +601,10 @@
|
||||
)
|
||||
;;(.mov v1-14 vf6)
|
||||
(.itof.vf vf6 vf6)
|
||||
(.svf (&-> *transform-regs* vf7) vf7)
|
||||
(.svf (&-> *transform-regs* vf8) vf8)
|
||||
(.svf (&-> *transform-regs* vf9) vf9)
|
||||
(.svf (&-> *transform-regs* vf6) vf6)
|
||||
(set! (-> *transform-regs* vf1) (-> s5-0 vector 0 quad))
|
||||
(set! (-> *transform-regs* vf2) (-> s5-0 vector 1 quad))
|
||||
(set! (-> *transform-regs* vf3) (-> s5-0 vector 2 quad))
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
;; name in dgo: debug-sphere
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(defconstant DEBUG_SPHERE_SEC_AMT (#if (user? dass) 5 10))
|
||||
(defconstant DEBUG_SPHERE_SEC_H DEBUG_SPHERE_SEC_AMT)
|
||||
(defconstant DEBUG_SPHERE_SEC_W DEBUG_SPHERE_SEC_AMT)
|
||||
|
||||
(deftype debug-sphere-table (basic)
|
||||
((point vector 300 :inline :offset-assert 16)
|
||||
)
|
||||
@@ -20,24 +24,24 @@
|
||||
(s4-0 0)
|
||||
)
|
||||
(set-vector! s5-0 0.0 0.0 0.0 1.0)
|
||||
(dotimes (s3-0 10)
|
||||
(let ((f28-0 (* f30-0 (sin (* 3276.8 (the float s3-0)))))
|
||||
(f26-0 (* f30-0 (sin (* 3276.8 (the float (+ s3-0 1))))))
|
||||
(dotimes (s3-0 DEBUG_SPHERE_SEC_H)
|
||||
(let ((f28-0 (* f30-0 (sin (* (degrees (/ 180 DEBUG_SPHERE_SEC_H)) (the float s3-0)))))
|
||||
(f26-0 (* f30-0 (sin (* (degrees (/ 180 DEBUG_SPHERE_SEC_H)) (the float (+ s3-0 1))))))
|
||||
(s2-0 (new-stack-vector0))
|
||||
(s1-0 (new-stack-vector0))
|
||||
(s0-0 (new-stack-vector0))
|
||||
)
|
||||
(set! (-> s2-0 y) (+ (-> s5-0 y) (* (cos (* 3276.8 (the float s3-0))) f30-0)))
|
||||
(set! (-> s2-0 y) (+ (-> s5-0 y) (* (cos (* (degrees (/ 180 DEBUG_SPHERE_SEC_H)) (the float s3-0))) f30-0)))
|
||||
(set! (-> s1-0 y) (-> s2-0 y))
|
||||
(set! (-> s0-0 y) (+ (-> s5-0 y) (* (cos (* 3276.8 (the float (+ s3-0 1)))) f30-0)))
|
||||
(set! (-> s0-0 y) (+ (-> s5-0 y) (* (cos (* (degrees (/ 180 DEBUG_SPHERE_SEC_H)) (the float (+ s3-0 1)))) f30-0)))
|
||||
(set! sv-80 0)
|
||||
(while (< sv-80 10)
|
||||
(set! (-> s2-0 x) (+ (-> s5-0 x) (* (cos (* 6553.6 (the float sv-80))) f28-0)))
|
||||
(set! (-> s2-0 z) (+ (-> s5-0 z) (* (sin (* 6553.6 (the float sv-80))) f28-0)))
|
||||
(set! (-> s1-0 x) (+ (-> s5-0 x) (* (cos (* 6553.6 (the float (+ sv-80 1)))) f28-0)))
|
||||
(set! (-> s1-0 z) (+ (-> s5-0 z) (* (sin (* 6553.6 (the float (+ sv-80 1)))) f28-0)))
|
||||
(set! (-> s0-0 x) (+ (-> s5-0 x) (* (cos (* 6553.6 (the float sv-80))) f26-0)))
|
||||
(set! (-> s0-0 z) (+ (-> s5-0 z) (* (sin (* 6553.6 (the float sv-80))) f26-0)))
|
||||
(while (< sv-80 DEBUG_SPHERE_SEC_W)
|
||||
(set! (-> s2-0 x) (+ (-> s5-0 x) (* (cos (* (degrees (/ 360 DEBUG_SPHERE_SEC_W)) (the float sv-80))) f28-0)))
|
||||
(set! (-> s2-0 z) (+ (-> s5-0 z) (* (sin (* (degrees (/ 360 DEBUG_SPHERE_SEC_W)) (the float sv-80))) f28-0)))
|
||||
(set! (-> s1-0 x) (+ (-> s5-0 x) (* (cos (* (degrees (/ 360 DEBUG_SPHERE_SEC_W)) (the float (+ sv-80 1)))) f28-0)))
|
||||
(set! (-> s1-0 z) (+ (-> s5-0 z) (* (sin (* (degrees (/ 360 DEBUG_SPHERE_SEC_W)) (the float (+ sv-80 1)))) f28-0)))
|
||||
(set! (-> s0-0 x) (+ (-> s5-0 x) (* (cos (* (degrees (/ 360 DEBUG_SPHERE_SEC_W)) (the float sv-80))) f26-0)))
|
||||
(set! (-> s0-0 z) (+ (-> s5-0 z) (* (sin (* (degrees (/ 360 DEBUG_SPHERE_SEC_W)) (the float sv-80))) f26-0)))
|
||||
(set! (-> arg0 point s4-0 quad) (-> s2-0 quad))
|
||||
(set! (-> arg0 point (+ s4-0 1) quad) (-> s1-0 quad))
|
||||
(set! (-> arg0 point (+ s4-0 2) quad) (-> s0-0 quad))
|
||||
@@ -68,7 +72,7 @@
|
||||
)
|
||||
(.lvf vf1 (&-> arg1 quad))
|
||||
(.mov vf2 arg2)
|
||||
(dotimes (s0-0 100)
|
||||
(dotimes (s0-0 (* DEBUG_SPHERE_SEC_W DEBUG_SPHERE_SEC_H))
|
||||
(.lvf vf3 (&-> points 0 quad))
|
||||
(.lvf vf4 (&-> points 1 quad))
|
||||
(.lvf vf5 (&-> points 2 quad))
|
||||
|
||||
@@ -635,7 +635,7 @@
|
||||
)
|
||||
|
||||
(defun-debug add-debug-text-sphere ((arg0 symbol) (arg1 bucket-id) (arg2 vector) (arg3 meters) (arg4 string) (arg5 rgba))
|
||||
"Add a debug sphere at the given point, withe some text. The color is for the sphere - the text is color 0."
|
||||
"Add a debug sphere at the given point, with some text. The color is for the sphere - the text is color 0."
|
||||
(add-debug-sphere arg0 arg1 arg2 arg3 arg5)
|
||||
(add-debug-text-3d arg0 arg1 arg4 arg2 (font-color default) (the-as vector2h #f))
|
||||
#f
|
||||
|
||||
@@ -552,7 +552,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> *shader-pick-menu* items) (the-as pair (sort (-> *shader-pick-menu* items) debug-menu-node<?)))
|
||||
(set! (-> *shader-pick-menu* items) (sort (-> *shader-pick-menu* items) debug-menu-node<?))
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -657,29 +657,22 @@
|
||||
)
|
||||
)
|
||||
(set! (-> *instance-shrub-menu* items)
|
||||
(the-as
|
||||
pair
|
||||
(sort
|
||||
(-> *instance-shrub-menu* items)
|
||||
(lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name)))
|
||||
)
|
||||
(sort
|
||||
(-> *instance-shrub-menu* items)
|
||||
(lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name)))
|
||||
)
|
||||
)
|
||||
(set! (-> *instance-tie-menu* items)
|
||||
(the-as
|
||||
pair
|
||||
(sort
|
||||
(-> *instance-tie-menu* items)
|
||||
(lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name)))
|
||||
)
|
||||
(sort
|
||||
(-> *instance-tie-menu* items)
|
||||
(lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name)))
|
||||
)
|
||||
)
|
||||
(set! (-> *enable-instance-tie-menu* items)
|
||||
(the-as pair (sort
|
||||
(-> *enable-instance-tie-menu* items)
|
||||
(lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name)))
|
||||
)
|
||||
)
|
||||
(sort
|
||||
(-> *enable-instance-tie-menu* items)
|
||||
(lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name)))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
@@ -4126,8 +4119,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> *part-pick-menu* items) (the-as pair (sort (-> *part-pick-menu* items) debug-menu-node<?)))
|
||||
(none)
|
||||
(set! (-> *part-pick-menu* items) (sort (-> *part-pick-menu* items) debug-menu-node<?))
|
||||
)
|
||||
|
||||
(defun debug-menu-make-part-menu ((ctx debug-menu-context))
|
||||
@@ -4143,6 +4135,90 @@
|
||||
)
|
||||
)
|
||||
|
||||
(define *entity-pick-menu* (the-as debug-menu #f))
|
||||
|
||||
(defun dm-entity-pick-func ((e entity) (msg debug-menu-msg))
|
||||
(when (= msg (debug-menu-msg press))
|
||||
(if (= (-> *entity-debug-inspect* entity) e)
|
||||
(set-entity! *entity-debug-inspect* (the entity #f))
|
||||
(set-entity! *entity-debug-inspect* e))
|
||||
)
|
||||
(= (-> *entity-debug-inspect* entity) e)
|
||||
)
|
||||
|
||||
(defun build-entity-list ()
|
||||
"Fill the entity pick menu"
|
||||
;; clear old list
|
||||
(debug-menu-remove-all-items *entity-pick-menu*)
|
||||
;; go through active levels
|
||||
(dotimes (s5-0 (-> *level* length))
|
||||
(let ((s4-0 (-> *level* level s5-0)))
|
||||
(when (= (-> s4-0 status) 'active)
|
||||
;; actor entities
|
||||
(let ((s3-0 (-> s4-0 bsp actors)))
|
||||
(when (nonzero? s3-0)
|
||||
(dotimes (s2-0 (-> s3-0 length))
|
||||
(let ((s1-0 (-> s3-0 data s2-0 actor)))
|
||||
(debug-menu-append-item *entity-pick-menu* (new-dm-flag (res-lump-struct s1-0 'name string) s1-0 dm-entity-pick-func))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; ambients entities
|
||||
(let ((s3-1 (-> s4-0 bsp ambients)))
|
||||
(when (nonzero? s3-1)
|
||||
(dotimes (s2-1 (-> s3-1 length))
|
||||
(let ((s1-1 (-> s3-1 data s2-1 ambient)))
|
||||
(debug-menu-append-item *entity-pick-menu* (new-dm-flag (res-lump-struct s1-1 'name string) s1-1 dm-entity-pick-func))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;; camera entities
|
||||
(let ((s4-1 (-> s4-0 bsp cameras)))
|
||||
(when (nonzero? s4-1)
|
||||
(dotimes (s3-2 (-> s4-1 length))
|
||||
(let ((s2-2 (-> s4-1 s3-2)))
|
||||
(debug-menu-append-item *entity-pick-menu* (new-dm-flag (res-lump-struct s2-2 'name string) s2-2 dm-entity-pick-func))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> *entity-pick-menu* items) (sort (-> *entity-pick-menu* items) debug-menu-node<?))
|
||||
)
|
||||
|
||||
(defun dm-display-entities-pick-func ((arg0 symbol))
|
||||
(debug-print-entities *level* arg0 (the-as type #f))
|
||||
)
|
||||
|
||||
(defun debug-menu-make-entity-menu ((ctx debug-menu-context))
|
||||
(let ((entity-menu (new 'debug 'debug-menu ctx "Entity menu")))
|
||||
(let ((pick-menu (new 'debug 'debug-menu ctx "Pick entity menu")))
|
||||
(set! *entity-pick-menu* pick-menu)
|
||||
(debug-menu-append-item entity-menu (new-dm-submenu "Pick Entity" pick-menu))
|
||||
)
|
||||
(debug-menu-append-item entity-menu (new-dm-func "Refresh" #f build-entity-list))
|
||||
(debug-menu-append-item entity-menu (new-dm-func "Go to entity" #f
|
||||
(lambda ()
|
||||
(unless (-> *entity-debug-inspect* entity) (return #f))
|
||||
(let ((tf (new 'stack 'transformq)))
|
||||
(vector-copy! (-> tf trans) (-> *entity-debug-inspect* entity trans))
|
||||
(quaternion-identity! (-> tf quat))
|
||||
(vector-identity! (-> tf scale))
|
||||
(send-event *camera* 'teleport-to-transformq tf)
|
||||
))))
|
||||
(debug-menu-append-item entity-menu (new-dm-func "Print entity info" #t dm-display-entities-pick-func))
|
||||
(debug-menu-append-item entity-menu (new-dm-func "Print entity info (ag)" 'art-group dm-display-entities-pick-func))
|
||||
(debug-menu-append-item entity-menu (new-dm-func "Print entity info (meters)" 'entity-meters dm-display-entities-pick-func))
|
||||
(debug-menu-append-item entity-menu (new-dm-func "Print entity info (perm)" 'entity-perm dm-display-entities-pick-func))
|
||||
|
||||
(new-dm-submenu "Entity" entity-menu)
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro dm-lambda-boolean-flag (val)
|
||||
"helper macro for making boolean buttons that don't just access symbols directly"
|
||||
`(lambda (arg (msg debug-menu-msg))
|
||||
@@ -4196,24 +4272,10 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defun dm-display-entities-pick-func ((arg0 symbol))
|
||||
(debug-print-entities *level* arg0 (the-as type #f))
|
||||
)
|
||||
|
||||
(when (-> *debug-menu-context* root-menu)
|
||||
(debug-menu-append-item (-> *debug-menu-context* root-menu) (debug-menu-make-load-menu *debug-menu-context*))
|
||||
(debug-menu-append-item (-> *debug-menu-context* root-menu) (debug-menu-make-part-menu *debug-menu-context*))
|
||||
|
||||
(debug-menu-append-item (-> *debug-menu-context* root-menu)
|
||||
(debug-menu-make-from-template *debug-menu-context*
|
||||
'(menu "Entity"
|
||||
(function "Print entity info" #t dm-display-entities-pick-func)
|
||||
(function "Print entity info (art-group)" art-group dm-display-entities-pick-func)
|
||||
(function "Print entity info (entity-meters)" entity-meters dm-display-entities-pick-func)
|
||||
(function "Print entity info (entity-perm)" entity-perm dm-display-entities-pick-func)
|
||||
)
|
||||
)
|
||||
)
|
||||
(debug-menu-append-item (-> *debug-menu-context* root-menu) (debug-menu-make-entity-menu *debug-menu-context*))
|
||||
;; Music menu TODO
|
||||
;; Secrets menu TODO
|
||||
;; Scene menu TODO
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
(set! (-> gp-0 root-menu) #f)
|
||||
(set! (-> gp-0 joypad-func) #f)
|
||||
(set! (-> gp-0 joypad-item) #f)
|
||||
(set! (-> gp-0 font) (new 'debug 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)))
|
||||
(set! (-> gp-0 font) (new 'debug 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning pc-hack)))
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
@@ -970,7 +970,10 @@
|
||||
)
|
||||
|
||||
;; actually draw the item.
|
||||
(debug-menu-item-render (the-as debug-menu-item s0-1) (+ s3-1 12) s2-1 submenus (= s0-1 selected))
|
||||
;; PC PORT note : do not render if text is out of bounds...
|
||||
(when (and (< -20 s2-1) (> 256 s2-1))
|
||||
(debug-menu-item-render (the-as debug-menu-item s0-1) (+ s3-1 12) s2-1 submenus (= s0-1 selected))
|
||||
)
|
||||
(+! s2-1 8)
|
||||
(set! s1-1 (cdr s1-1))
|
||||
(set! s0-1 (car s1-1))
|
||||
|
||||
@@ -957,16 +957,15 @@
|
||||
; )
|
||||
(label cfg-27)
|
||||
(let ((a0-17 (-> gp-0 effect)))
|
||||
; (if a0-17
|
||||
; (TODO-RENAME-9 a0-17)
|
||||
; )
|
||||
(if a0-17
|
||||
(TODO-RENAME-9 a0-17)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; WARN: Expression building failed: Function ja-post has a return type of none, but the expression builder found a return statement.
|
||||
(defbehavior ja-post process-drawable ()
|
||||
(when (nonzero? (-> self draw))
|
||||
(let ((gp-1 (logtest? (-> self draw status) (draw-status drwf04))))
|
||||
|
||||
@@ -54,9 +54,9 @@
|
||||
(declare-type engine basic)
|
||||
(deftype connection (connectable)
|
||||
((param0 basic :offset-assert 16) ;; often (function object object object object object)
|
||||
(param1 basic :offset-assert 20)
|
||||
(param2 basic :offset-assert 24)
|
||||
(param3 basic :offset-assert 28)
|
||||
(param1 int32 :offset-assert 20)
|
||||
(param2 int32 :offset-assert 24)
|
||||
(param3 int32 :offset-assert 28)
|
||||
(quad uint128 2 :offset 0)
|
||||
)
|
||||
:method-count-assert 14
|
||||
@@ -73,6 +73,19 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod inspect connection ((obj connection))
|
||||
(format #t "[~8x] ~A~%" obj 'connection)
|
||||
(format #t "~Tnext0: ~`connectable`P~%" (-> obj next0))
|
||||
(format #t "~Tprev0: ~`connectable`P~%" (-> obj prev0))
|
||||
(format #t "~Tnext1: ~`connectable`P~%" (-> obj next1))
|
||||
(format #t "~Tprev1: ~`connectable`P~%" (-> obj prev1))
|
||||
(format #t "~Tparam0: ~A~%" (-> obj param0))
|
||||
(format #t "~Tparam1: ~A~%" (-> obj param1))
|
||||
(format #t "~Tparam2: ~A~%" (-> obj param2))
|
||||
(format #t "~Tparam3: ~A~%" (-> obj param3))
|
||||
(format #t "~Tquad[2] @ #x~X~%" (&-> obj next0))
|
||||
obj
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; engine
|
||||
@@ -336,7 +349,7 @@
|
||||
(let ((ct (the-as connection (-> obj alive-list-end prev0))))
|
||||
(while (!= ct (-> obj alive-list))
|
||||
;; execute!
|
||||
((the-as (function basic basic basic object object) (-> ct param0)) (-> ct param1) (-> ct param2) (-> ct param3) arg0)
|
||||
((the-as (function int int int object object) (-> ct param0)) (-> ct param1) (-> ct param2) (-> ct param3) arg0)
|
||||
;; advance to previous.
|
||||
(set! ct (the-as connection (-> ct prev0)))
|
||||
)
|
||||
@@ -350,7 +363,7 @@
|
||||
(let ((ct (the-as connection (-> obj alive-list-end prev0))))
|
||||
(while (!= ct (-> obj alive-list))
|
||||
;; execute function
|
||||
(let ((result ((the-as (function basic basic basic object object) (-> ct param0)) (-> ct param1) (-> ct param2) (-> ct param3) arg0)))
|
||||
(let ((result ((the-as (function int int int object object) (-> ct param0)) (-> ct param1) (-> ct param2) (-> ct param3) arg0)))
|
||||
;; set the next one, _before_ removing
|
||||
(set! ct (the-as connection (-> ct prev0)))
|
||||
;; remove if desired.
|
||||
@@ -413,9 +426,9 @@
|
||||
(let ((con (the connection con)))
|
||||
;; set the params of the connection
|
||||
(set! (-> con param0) (the basic func))
|
||||
(set! (-> con param1) (the basic p1))
|
||||
(set! (-> con param2) (the basic p2))
|
||||
(set! (-> con param3) (the basic p3))
|
||||
(set! (-> con param1) (the int p1))
|
||||
(set! (-> con param2) (the int p2))
|
||||
(set! (-> con param3) (the int p3))
|
||||
;; splice us out of the dead list
|
||||
(set! (-> obj dead-list next0) (-> con next0))
|
||||
(set! (-> con next0 prev0) (-> obj dead-list))
|
||||
|
||||
@@ -1289,7 +1289,7 @@
|
||||
process-hidden
|
||||
med-res-level))
|
||||
;; disallowed types
|
||||
(obj-etype? plat-eco boatpaddle cavecrystal snow-bunny ram citb-battlecontroller)
|
||||
;(obj-etype?)
|
||||
(zero? (-> obj etype)))
|
||||
(when (nonzero? (-> obj etype))
|
||||
(birth-log "rejecting etype ~A birth~%" (-> obj etype))
|
||||
@@ -1939,3 +1939,186 @@
|
||||
)
|
||||
)
|
||||
|
||||
(#when PC_PORT
|
||||
|
||||
;; custom entity functions for pc port
|
||||
(defun-debug entity-inspect-draw ((inspect-info entity-debug-inspect))
|
||||
"draw text about an entity on screen"
|
||||
|
||||
(update-pad inspect-info 0)
|
||||
(let* ((e (-> inspect-info entity)) (name (res-lump-struct e 'name string)))
|
||||
(set! *display-actor-anim* (the string (and (-> inspect-info show-actor-info) name)))
|
||||
;; draw trans
|
||||
(add-debug-x #t (bucket-id debug-draw1) (-> e trans) (static-rgba 255 255 0 128))
|
||||
(if (or (not (-> inspect-info show-actor-info)) (!= (-> e type) entity-actor) (and (= (-> e type) entity-actor) (not (-> (the entity-actor e) extra process))))
|
||||
(add-debug-text-3d #t (bucket-id debug-draw1) name (-> e trans) (font-color red) (new 'static 'vector2h :y 8)))
|
||||
|
||||
;; start writing text
|
||||
(let ((cur-y (- 16 (* (-> inspect-info scroll-y) 8))) (y-adv 8))
|
||||
(with-dma-buffer-add-bucket ((debug-buf (-> (current-frame) debug-buf))
|
||||
(bucket-id debug-draw1))
|
||||
;; basic info, actor id, etc
|
||||
(draw-string-xy
|
||||
(string-format "~3L~A~0L ~A~%tags: ~D size: ~D aid: #x~x~%R1/L1 scroll L3 toggle display-actor-info~%--------------------" (-> e type) name (length e) (asize-of e) (-> e aid))
|
||||
debug-buf 352 cur-y (font-color default) (font-flags shadow kerning middle))
|
||||
(+! cur-y (* 8 4))
|
||||
|
||||
;; draw each tag in entity
|
||||
(dotimes (i (length e))
|
||||
(let ((data (get-tag-index-data e i)))
|
||||
|
||||
;; tag info
|
||||
(format (clear *debug-temp-string*) "~3L~2D)~0L ~20L~A~0L:" i (-> e tag i name) (-> e tag i elt-type))
|
||||
|
||||
;; tag data - special cases first
|
||||
(cond
|
||||
((and (= (-> e tag i name) 'water-height) (= (-> e tag i elt-count) 4) (= (-> e tag i elt-type) float))
|
||||
(format *debug-temp-string* " ~mm ~mm ~mm ~f"
|
||||
(-> (the (pointer float) data) 0)
|
||||
(-> (the (pointer float) data) 1)
|
||||
(-> (the (pointer float) data) 2)
|
||||
(-> (the (pointer float) data) 3)
|
||||
)
|
||||
)
|
||||
((and (= (-> e tag i name) 'flava) (= (-> e tag i elt-count) 1) (= (-> e tag i elt-type) int32))
|
||||
(format *debug-temp-string* " (music-flava ~S)" (enum->string music-flava (-> (the (pointer int32) data) 0)))
|
||||
)
|
||||
((and (= (-> e tag i name) 'text-id) (= (-> e tag i elt-count) 1) (= (-> e tag i elt-type) int32))
|
||||
(format *debug-temp-string* " (game-text-id ~S)" (enum->string game-text-id (-> (the (pointer int32) data) 0)))
|
||||
)
|
||||
((and (= (-> e tag i name) 'eco-info) (= (-> e tag i elt-count) 2) (= (-> e tag i elt-type) int32))
|
||||
(format *debug-temp-string* " ~S " (pickup-type->string (the-as pickup-type (-> (the (pointer int32) data) 0))))
|
||||
(if (= (pickup-type fuel-cell) (-> (the (pointer int32) data) 0))
|
||||
(format *debug-temp-string* "~S" (game-task->string (the-as game-task (-> (the (pointer int32) data) 1))))
|
||||
(format *debug-temp-string* "~D" (-> (the (pointer int32) data) 1))
|
||||
)
|
||||
(if (= (pickup-type buzzer) (-> (the (pointer int32) data) 0))
|
||||
(format *debug-temp-string* " ~S" (game-task->string (the-as game-task (logand #xffff (-> (the (pointer int32) data) 1)))))
|
||||
)
|
||||
)
|
||||
((and (= (-> e tag i name) 'options) (= (-> e tag i elt-count) 1) (= (-> e tag i elt-type) uint32))
|
||||
(format *debug-temp-string* " (fact-options ")
|
||||
(bit-enum->string fact-options (-> (the (pointer uint32) data) 0) *debug-temp-string*)
|
||||
(format *debug-temp-string* ")")
|
||||
)
|
||||
((and (= (-> e tag i name) 'visvol) (= (-> e tag i elt-count) 2) (= (-> e tag i elt-type) vector))
|
||||
(format *debug-temp-string* " display actor-vis!")
|
||||
)
|
||||
((and (= (-> e tag i name) 'path) (= (-> e tag i elt-type) vector))
|
||||
(format *debug-temp-string* " display path marks!")
|
||||
)
|
||||
((and (= (-> e tag i name) 'vol) (= (-> e tag i elt-type) vector))
|
||||
(format *debug-temp-string* " display vol marks!")
|
||||
)
|
||||
(else
|
||||
(dotimes (ii (-> e tag i elt-count))
|
||||
(format *debug-temp-string* " ")
|
||||
(case (-> e tag i elt-type)
|
||||
((string symbol type)
|
||||
(format *debug-temp-string* "~A" (-> (the (pointer basic) data) ii)))
|
||||
((float)
|
||||
(case (-> e tag i name)
|
||||
(('spring-height 'vis-dist 'height-info 'distance 'cam-notice-dist 'cam-vert 'cam-horz 'idle-distance
|
||||
'nearest-y-threshold 'center-point 'center-radius 'notice-dist 'trigger-height 'notice-top)
|
||||
(format *debug-temp-string* "~mm" (-> (the (pointer float) data) ii))
|
||||
)
|
||||
(('rotoffset 'fov 'rotmin 'rotmax 'tiltmin 'tiltmax 'rotspeed)
|
||||
(format *debug-temp-string* "~rdeg" (-> (the (pointer float) data) ii))
|
||||
)
|
||||
(else
|
||||
(format *debug-temp-string* "~f" (-> (the (pointer float) data) ii))
|
||||
)
|
||||
)
|
||||
)
|
||||
((int8) (format *debug-temp-string* "~D" (-> (the (pointer int8) data) ii)))
|
||||
((int16) (format *debug-temp-string* "~D" (-> (the (pointer int16) data) ii)))
|
||||
((int32)
|
||||
(case (-> e tag i name)
|
||||
(('final-pickup 'pickup-type)
|
||||
(format *debug-temp-string* "~S" (pickup-type->string (the-as pickup-type (-> (the (pointer int32) data) ii))))
|
||||
)
|
||||
(('alt-task)
|
||||
(format *debug-temp-string* "~S" (game-task->string (the-as game-task (-> (the (pointer int32) data) ii))))
|
||||
)
|
||||
(else
|
||||
(format *debug-temp-string* "~D" (-> (the (pointer int32) data) ii))
|
||||
)
|
||||
)
|
||||
)
|
||||
((uint8)
|
||||
(case (-> e tag i name)
|
||||
(('shadow-mask)
|
||||
(format *debug-temp-string* "#b~b" (-> (the (pointer uint8) data) ii))
|
||||
)
|
||||
(else
|
||||
(format *debug-temp-string* "#x~x" (-> (the (pointer uint8) data) ii))
|
||||
)
|
||||
)
|
||||
)
|
||||
((uint16) (format *debug-temp-string* "#x~x" (-> (the (pointer uint16) data) ii)))
|
||||
((uint32)
|
||||
(case (-> e tag i name)
|
||||
(('nav-mesh-actor 'open-actor 'trigger-actor 'path-actor 'state-actor 'alt-actor 'next-actor 'prev-actor
|
||||
'spawner-blocker-actor 'spawner-trigger-actor 'kill-actor 'fade-actor 'water-actor 'target-actor)
|
||||
(format *debug-temp-string* "~%#x~x (~S)" (-> (the (pointer uint32) data) ii)
|
||||
(res-lump-struct (entity-by-aid (-> (the (pointer uint32) data) ii)) 'name string))
|
||||
(+! y-adv 8)
|
||||
)
|
||||
(('movie-mask)
|
||||
(format *debug-temp-string* "#b~b" (-> (the (pointer uint32) data) ii))
|
||||
)
|
||||
(else
|
||||
(format *debug-temp-string* "#x~x" (-> (the (pointer uint32) data) ii))
|
||||
)
|
||||
)
|
||||
)
|
||||
((vector)
|
||||
(case (-> e tag i name)
|
||||
(('movie-pos)
|
||||
(format *debug-temp-string* "~%(~mm ~mm ~mm ~rdeg)"
|
||||
(-> (the (inline-array vector) data) ii x)
|
||||
(-> (the (inline-array vector) data) ii y)
|
||||
(-> (the (inline-array vector) data) ii z)
|
||||
(-> (the (inline-array vector) data) ii w)
|
||||
)
|
||||
)
|
||||
(('nav-mesh-sphere)
|
||||
(format *debug-temp-string* "~%(~mm ~mm ~mm ~mm)"
|
||||
(-> (the (inline-array vector) data) ii x)
|
||||
(-> (the (inline-array vector) data) ii y)
|
||||
(-> (the (inline-array vector) data) ii z)
|
||||
(-> (the (inline-array vector) data) ii w)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(format *debug-temp-string* "~%(~f ~f ~f ~f)"
|
||||
(-> (the (inline-array vector) data) ii x)
|
||||
(-> (the (inline-array vector) data) ii y)
|
||||
(-> (the (inline-array vector) data) ii z)
|
||||
(-> (the (inline-array vector) data) ii w)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! y-adv 8))
|
||||
(else
|
||||
(format *debug-temp-string* "<unknown tag type ~A>" (-> e tag i elt-type))
|
||||
(set! ii (the int (-> e tag i elt-count)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(draw-string-xy *debug-temp-string* debug-buf 352 cur-y (font-color default) (font-flags shadow kerning middle))
|
||||
(+! cur-y y-adv)
|
||||
(set! y-adv 8)
|
||||
|
||||
))
|
||||
|
||||
)
|
||||
)))
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
+185
-239
@@ -7,90 +7,70 @@
|
||||
|
||||
;; note: the while loop in this is changed to include a cast to basic.
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(defmethod relocate process ((obj process) (arg0 int))
|
||||
(let ((v1-0 *kernel-context*))
|
||||
(set! (-> v1-0 relocating-process) obj)
|
||||
(set! (-> v1-0 relocating-min) (the-as int (&-> obj type)))
|
||||
(set!
|
||||
(-> v1-0 relocating-max)
|
||||
(the-as
|
||||
int
|
||||
(+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))
|
||||
)
|
||||
(set! (-> v1-0 relocating-process) obj)
|
||||
(set! (-> v1-0 relocating-min) (the-as int (&-> obj type)))
|
||||
(set! (-> v1-0 relocating-max)
|
||||
(the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj)))
|
||||
)
|
||||
(set! (-> v1-0 relocating-offset) arg0)
|
||||
)
|
||||
(set! (-> v1-0 relocating-offset) arg0)
|
||||
)
|
||||
(&+! (-> obj ppointer 0) arg0)
|
||||
(let ((v1-5 (-> obj entity)))
|
||||
(if (and v1-5 (= (-> v1-5 extra process) obj))
|
||||
(&+! (-> v1-5 extra process) arg0)
|
||||
(if (and v1-5 (= (-> v1-5 extra process) obj))
|
||||
(&+! (-> v1-5 extra process) arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-7 (-> obj connection-list next1)))
|
||||
(while (the-as connection v1-7)
|
||||
(let ((a0-14 (-> v1-7 prev1)))
|
||||
(if
|
||||
(and
|
||||
(>= (the-as int a0-14) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a0-14) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> v1-7 prev1) arg0)
|
||||
(while (the-as connection v1-7)
|
||||
(let ((a0-14 (-> v1-7 prev1)))
|
||||
(if (and (>= (the-as int a0-14) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a0-14) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> v1-7 prev1) arg0)
|
||||
)
|
||||
)
|
||||
(let ((a0-19 (-> (the-as connection v1-7) param1)))
|
||||
(if (and (>= a0-19 (-> *kernel-context* relocating-min)) (< a0-19 (-> *kernel-context* relocating-max)))
|
||||
(+! (-> (the-as connection v1-7) param1) arg0)
|
||||
)
|
||||
)
|
||||
(let ((a0-24 (-> (the-as connection v1-7) param2)))
|
||||
(if (and (>= a0-24 (-> *kernel-context* relocating-min)) (< a0-24 (-> *kernel-context* relocating-max)))
|
||||
(+! (-> (the-as connection v1-7) param2) arg0)
|
||||
)
|
||||
)
|
||||
(let ((a0-29 (-> (the-as connection v1-7) param3)))
|
||||
(if (and (>= a0-29 (-> *kernel-context* relocating-min)) (< a0-29 (-> *kernel-context* relocating-max)))
|
||||
(+! (-> (the-as connection v1-7) param3) arg0)
|
||||
)
|
||||
)
|
||||
(set! v1-7 (-> (the-as connection v1-7) next1))
|
||||
)
|
||||
)
|
||||
(let ((a0-19 (-> (the-as connection v1-7) param1)))
|
||||
(if
|
||||
(and
|
||||
(>= (the-as int a0-19) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a0-19) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> (the-as connection v1-7) param1) arg0)
|
||||
)
|
||||
)
|
||||
(let ((a0-24 (-> (the-as connection v1-7) param2)))
|
||||
(if
|
||||
(and
|
||||
(>= (the-as int a0-24) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a0-24) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> (the-as connection v1-7) param2) arg0)
|
||||
)
|
||||
)
|
||||
(let ((a0-29 (-> (the-as connection v1-7) param3)))
|
||||
(if
|
||||
(and
|
||||
(>= (the-as int a0-29) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a0-29) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> (the-as connection v1-7) param3) arg0)
|
||||
)
|
||||
)
|
||||
(set! v1-7 (-> (the-as connection v1-7) next1))
|
||||
)
|
||||
)
|
||||
(let ((v1-10 (-> obj self)))
|
||||
(if
|
||||
(and
|
||||
(>= (the-as int v1-10) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int v1-10) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> obj self) arg0)
|
||||
(if (and (>= (the-as int v1-10) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int v1-10) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> obj self) arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-15 (-> obj ppointer)))
|
||||
(if
|
||||
(and
|
||||
(>= (the-as int v1-15) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int v1-15) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> obj ppointer) arg0)
|
||||
(if (and (>= (the-as int v1-15) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int v1-15) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> obj ppointer) arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s4-0 (the basic (&+ (-> obj heap-base) 4))))
|
||||
(while (< (the-as int s4-0) (the-as int (-> obj heap-cur)))
|
||||
(relocate s4-0 arg0)
|
||||
(&+! s4-0 (logand -16 (+ (asize-of s4-0) 15)))
|
||||
(while (< (the-as int s4-0) (the-as int (-> obj heap-cur)))
|
||||
(relocate s4-0 arg0)
|
||||
(&+! s4-0 (logand -16 (+ (asize-of s4-0) 15)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(&+! (-> obj main-thread) arg0)
|
||||
(&+! (-> obj top-thread) arg0)
|
||||
(&+! (-> obj heap-base) arg0)
|
||||
@@ -99,18 +79,18 @@
|
||||
(let ((a2-4 (asize-of obj))
|
||||
(a1-22 (&-> obj type))
|
||||
)
|
||||
(cond
|
||||
((>= arg0 0)
|
||||
(qmem-copy->! (&+ a1-22 arg0) a1-22 a2-4)
|
||||
)
|
||||
((< a2-4 2560)
|
||||
(qmem-copy<-! (&+ a1-22 arg0) a1-22 a2-4)
|
||||
)
|
||||
(else
|
||||
(ultimate-memcpy (&+ a1-22 arg0) a1-22 (the-as uint a2-4))
|
||||
)
|
||||
(cond
|
||||
((>= arg0 0)
|
||||
(qmem-copy->! (&+ a1-22 arg0) a1-22 a2-4)
|
||||
)
|
||||
((< a2-4 2560)
|
||||
(qmem-copy<-! (&+ a1-22 arg0) a1-22 a2-4)
|
||||
)
|
||||
(else
|
||||
(ultimate-memcpy (&+ a1-22 arg0) a1-22 (the-as uint a2-4))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> *kernel-context* relocating-process) #f)
|
||||
(&+ obj arg0)
|
||||
)
|
||||
@@ -122,56 +102,52 @@
|
||||
|
||||
(defmethod relocate process-drawable ((obj process-drawable) (arg0 int))
|
||||
(let ((v1-0 *kernel-context*))
|
||||
(set! (-> v1-0 relocating-process) obj)
|
||||
(set! (-> v1-0 relocating-min) (the-as int (&-> obj type)))
|
||||
(set!
|
||||
(-> v1-0 relocating-max)
|
||||
(the-as
|
||||
int
|
||||
(+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))
|
||||
)
|
||||
(set! (-> v1-0 relocating-process) obj)
|
||||
(set! (-> v1-0 relocating-min) (the-as int (&-> obj type)))
|
||||
(set! (-> v1-0 relocating-max)
|
||||
(the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj)))
|
||||
)
|
||||
(set! (-> v1-0 relocating-offset) arg0)
|
||||
)
|
||||
(set! (-> v1-0 relocating-offset) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj root))
|
||||
(&+! (-> obj root) arg0)
|
||||
)
|
||||
(&+! (-> obj root) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj node-list))
|
||||
(&+! (-> obj node-list) arg0)
|
||||
)
|
||||
(&+! (-> obj node-list) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj draw))
|
||||
(&+! (-> obj draw) arg0)
|
||||
)
|
||||
(&+! (-> obj draw) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj skel))
|
||||
(&+! (-> obj skel) arg0)
|
||||
)
|
||||
(&+! (-> obj skel) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj nav))
|
||||
(&+! (-> obj nav) arg0)
|
||||
)
|
||||
(&+! (-> obj nav) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj align))
|
||||
(&+! (-> obj align) arg0)
|
||||
)
|
||||
(&+! (-> obj align) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj path))
|
||||
(&+! (-> obj path) arg0)
|
||||
)
|
||||
(&+! (-> obj path) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj vol))
|
||||
(&+! (-> obj vol) arg0)
|
||||
)
|
||||
(&+! (-> obj vol) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj fact))
|
||||
(&+! (-> obj fact) arg0)
|
||||
)
|
||||
(&+! (-> obj fact) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj link))
|
||||
(&+! (-> obj link) arg0)
|
||||
)
|
||||
(&+! (-> obj link) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj part))
|
||||
(&+! (-> obj part) arg0)
|
||||
)
|
||||
(&+! (-> obj part) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj water))
|
||||
(&+! (-> obj water) arg0)
|
||||
)
|
||||
(&+! (-> obj water) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj sound))
|
||||
(&+! (-> obj sound) arg0)
|
||||
)
|
||||
(&+! (-> obj sound) arg0)
|
||||
)
|
||||
(the-as process-drawable ((method-of-type process relocate) obj arg0))
|
||||
)
|
||||
|
||||
@@ -179,32 +155,26 @@
|
||||
(&+! (-> obj process) arg0)
|
||||
(&+! (-> obj root-prim) arg0)
|
||||
(if (-> obj riders)
|
||||
(&+! (-> obj riders) arg0)
|
||||
)
|
||||
(&+! (-> obj riders) arg0)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
(defmethod relocate collide-shape-moving ((obj collide-shape-moving) (arg0 int))
|
||||
(if (-> obj dynam)
|
||||
(&+! (-> obj dynam) arg0)
|
||||
)
|
||||
(the-as
|
||||
collide-shape-moving
|
||||
((method-of-type collide-shape relocate) obj arg0)
|
||||
)
|
||||
(&+! (-> obj dynam) arg0)
|
||||
)
|
||||
(the-as collide-shape-moving ((method-of-type collide-shape relocate) obj arg0))
|
||||
)
|
||||
|
||||
(defmethod
|
||||
relocate
|
||||
collide-sticky-rider-group
|
||||
((obj collide-sticky-rider-group) (arg0 int))
|
||||
(defmethod relocate collide-sticky-rider-group ((obj collide-sticky-rider-group) (arg0 int))
|
||||
(countdown (v1-0 (-> obj num-riders))
|
||||
(let ((a2-2 (-> obj rider v1-0)))
|
||||
(if (-> a2-2 sticky-prim)
|
||||
(&+! (-> a2-2 sticky-prim) arg0)
|
||||
)
|
||||
(let ((a2-2 (-> obj rider v1-0)))
|
||||
(if (-> a2-2 sticky-prim)
|
||||
(&+! (-> a2-2 sticky-prim) arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
@@ -213,14 +183,11 @@
|
||||
obj
|
||||
)
|
||||
|
||||
(defmethod
|
||||
relocate
|
||||
collide-shape-prim-group
|
||||
((obj collide-shape-prim-group) (arg0 int))
|
||||
(defmethod relocate collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 int))
|
||||
(&+! (-> obj cshape) arg0)
|
||||
(countdown (v1-2 (-> obj num-prims))
|
||||
(&+! (-> obj prims v1-2) arg0)
|
||||
)
|
||||
(&+! (-> obj prims v1-2) arg0)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
@@ -233,67 +200,57 @@
|
||||
(&+! (-> obj skeleton) arg0)
|
||||
(&+! (-> obj process) arg0)
|
||||
(when (-> obj ripple)
|
||||
(if (-> obj ripple query)
|
||||
(&+! (-> obj ripple query) arg0)
|
||||
(if (-> obj ripple query)
|
||||
(&+! (-> obj ripple query) arg0)
|
||||
)
|
||||
(&+! (-> obj ripple) arg0)
|
||||
)
|
||||
(&+! (-> obj ripple) arg0)
|
||||
)
|
||||
(let ((v1-14 (-> obj shadow-ctrl)))
|
||||
(if
|
||||
(and
|
||||
(>= (the-as int v1-14) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int v1-14) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> obj shadow-ctrl) arg0)
|
||||
(if (and (>= (the-as int v1-14) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int v1-14) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> obj shadow-ctrl) arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
(defmethod relocate joint-control ((obj joint-control) (arg0 int))
|
||||
(if (-> obj effect)
|
||||
(&+! (-> obj effect) arg0)
|
||||
)
|
||||
(set!
|
||||
(-> obj root-channel)
|
||||
(the-as
|
||||
(inline-array joint-control-channel)
|
||||
(+ (the-as uint (-> obj root-channel)) arg0)
|
||||
)
|
||||
)
|
||||
(&+! (-> obj effect) arg0)
|
||||
)
|
||||
(set! (-> obj root-channel)
|
||||
(the-as (inline-array joint-control-channel) (+ (the-as uint (-> obj root-channel)) arg0))
|
||||
)
|
||||
(countdown (v1-6 (-> obj allocated-length))
|
||||
(&+! (-> obj channel v1-6 parent) arg0)
|
||||
)
|
||||
(&+! (-> obj channel v1-6 parent) arg0)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
(defmethod relocate cspace-array ((obj cspace-array) (arg0 int))
|
||||
(countdown (v1-0 (-> obj length))
|
||||
(let ((a2-2 (-> obj data v1-0)))
|
||||
(if (-> a2-2 parent)
|
||||
(&+! (-> a2-2 parent) arg0)
|
||||
)
|
||||
(&+! (-> a2-2 bone) arg0)
|
||||
(let ((a3-6 (-> a2-2 param1)))
|
||||
(if
|
||||
(and
|
||||
(>= (the-as int a3-6) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a3-6) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> a2-2 param1) arg0)
|
||||
(let ((a2-2 (-> obj data v1-0)))
|
||||
(if (-> a2-2 parent)
|
||||
(&+! (-> a2-2 parent) arg0)
|
||||
)
|
||||
(&+! (-> a2-2 bone) arg0)
|
||||
(let ((a3-6 (-> a2-2 param1)))
|
||||
(if (and (>= (the-as int a3-6) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a3-6) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> a2-2 param1) arg0)
|
||||
)
|
||||
)
|
||||
(let ((a3-11 (-> a2-2 param2)))
|
||||
(if (and (>= (the-as int a3-11) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a3-11) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> a2-2 param2) arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a3-11 (-> a2-2 param2)))
|
||||
(if
|
||||
(and
|
||||
(>= (the-as int a3-11) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a3-11) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> a2-2 param2) arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
@@ -344,101 +301,90 @@
|
||||
obj
|
||||
)
|
||||
|
||||
(defmethod
|
||||
relocate
|
||||
sparticle-launch-control
|
||||
((obj sparticle-launch-control) (arg0 int))
|
||||
(defmethod relocate sparticle-launch-control ((obj sparticle-launch-control) (arg0 int))
|
||||
(&+! (-> obj proc) arg0)
|
||||
(countdown (v1-2 (-> obj length))
|
||||
(let* ((a0-3 (-> obj data v1-2))
|
||||
(a2-0 (-> a0-3 origin))
|
||||
(let* ((a0-3 (-> obj data v1-2))
|
||||
(a2-0 (-> a0-3 origin))
|
||||
)
|
||||
(if (and (>= (the-as int a2-0) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a2-0) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> a0-3 origin) arg0)
|
||||
)
|
||||
(if
|
||||
(and
|
||||
(>= (the-as int a2-0) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int a2-0) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> a0-3 origin) arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(forall-particles-with-key
|
||||
obj
|
||||
(lambda ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
|
||||
(let ((v1-1 (-> *kernel-context* relocating-offset)))
|
||||
(set!
|
||||
(-> arg1 key)
|
||||
(the-as sparticle-launch-control (+ (the-as int (-> arg1 key)) v1-1))
|
||||
obj
|
||||
(lambda ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
|
||||
(let ((v1-1 (-> *kernel-context* relocating-offset)))
|
||||
(set! (-> arg1 key) (the-as sparticle-launch-control (+ (the-as int (-> arg1 key)) v1-1)))
|
||||
(if (-> arg1 binding)
|
||||
(set! (-> arg1 binding) (the-as sparticle-launch-state (+ (the-as int (-> arg1 binding)) v1-1)))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(if (-> arg1 binding)
|
||||
(set!
|
||||
(-> arg1 binding)
|
||||
(the-as sparticle-launch-state (+ (the-as int (-> arg1 binding)) v1-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
#t
|
||||
#t
|
||||
)
|
||||
#t
|
||||
#t
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
(defmethod relocate camera-master ((obj camera-master) (arg0 int))
|
||||
(if (nonzero? (-> obj water-drip))
|
||||
(&+! (-> obj water-drip) arg0)
|
||||
)
|
||||
(&+! (-> obj water-drip) arg0)
|
||||
)
|
||||
(the-as camera-master ((method-of-type process relocate) obj arg0))
|
||||
)
|
||||
|
||||
(defmethod relocate time-of-day-proc ((obj time-of-day-proc) (arg0 int))
|
||||
(if (nonzero? (-> obj stars))
|
||||
(&+! (-> obj stars) arg0)
|
||||
)
|
||||
(&+! (-> obj stars) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj sun))
|
||||
(&+! (-> obj sun) arg0)
|
||||
)
|
||||
(&+! (-> obj sun) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj green-sun))
|
||||
(&+! (-> obj green-sun) arg0)
|
||||
)
|
||||
(&+! (-> obj green-sun) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj moon))
|
||||
(&+! (-> obj moon) arg0)
|
||||
)
|
||||
(&+! (-> obj moon) arg0)
|
||||
)
|
||||
(the-as time-of-day-proc ((method-of-type process relocate) obj arg0))
|
||||
)
|
||||
|
||||
(defmethod relocate swingpole ((obj swingpole) (arg0 int))
|
||||
(if (nonzero? (-> obj root))
|
||||
(&+! (-> obj root) arg0)
|
||||
)
|
||||
(&+! (-> obj root) arg0)
|
||||
)
|
||||
(the-as swingpole ((method-of-type process relocate) obj arg0))
|
||||
)
|
||||
|
||||
(defmethod relocate part-tracker ((obj part-tracker) (arg0 int))
|
||||
(if (nonzero? (-> obj root))
|
||||
(&+! (-> obj root) arg0)
|
||||
)
|
||||
(&+! (-> obj root) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj part))
|
||||
(&+! (-> obj part) arg0)
|
||||
)
|
||||
(&+! (-> obj part) arg0)
|
||||
)
|
||||
(the-as part-tracker ((method-of-type process relocate) obj arg0))
|
||||
)
|
||||
|
||||
(defmethod relocate manipy ((obj manipy) (arg0 int))
|
||||
(if (nonzero? (-> obj joint 0))
|
||||
(&+! (-> obj joint 0) arg0)
|
||||
)
|
||||
(&+! (-> obj joint 0) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj joint 1))
|
||||
(&+! (-> obj joint 1) arg0)
|
||||
)
|
||||
(&+! (-> obj joint 1) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj joint 2))
|
||||
(&+! (-> obj joint 2) arg0)
|
||||
)
|
||||
(&+! (-> obj joint 2) arg0)
|
||||
)
|
||||
(if (nonzero? (-> obj joint 3))
|
||||
(&+! (-> obj joint 3) arg0)
|
||||
)
|
||||
(&+! (-> obj joint 3) arg0)
|
||||
)
|
||||
(the-as manipy ((method-of-type process-drawable relocate) obj arg0))
|
||||
)
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
"demo-start"
|
||||
)
|
||||
(*debug-segment*
|
||||
(#if (user? dass) "snow-start" "village1-hut")
|
||||
(#if (user? dass) "citadel-generator-end" "village1-hut")
|
||||
)
|
||||
(else
|
||||
"title-start"
|
||||
|
||||
@@ -5,13 +5,9 @@
|
||||
;; name in dgo: generic-obs-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; TODO - for babak-with-cannon
|
||||
(define-extern mistycam-spawn (function none))
|
||||
;; TODO - for babak-with-cannon
|
||||
(define-extern beachcam-spawn (function none))
|
||||
|
||||
(define-extern draw-eco-beam (function vector vector none))
|
||||
|
||||
(declare-type camera-tracker process)
|
||||
(define-extern process-grab? (function process symbol :behavior camera-tracker))
|
||||
(define-extern process-release? (function process symbol :behavior process))
|
||||
@@ -31,24 +27,26 @@
|
||||
|
||||
(define-extern eco-blue-glow (function vector none))
|
||||
|
||||
(declare-type joint-mod basic)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype manipy (process-drawable)
|
||||
((new-trans-hook (function none) :offset-assert 176)
|
||||
(cur-trans-hook (function none) :offset-assert 180)
|
||||
(cur-event-hook (function none) :offset-assert 184)
|
||||
(new-joint-anim art-joint-anim :offset-assert 188)
|
||||
(new-joint-anim-blend uint64 :offset-assert 192)
|
||||
(anim-mode symbol :offset-assert 200)
|
||||
(cur-grab-handle handle :offset-assert 208)
|
||||
(cur-target-handle handle :offset-assert 216)
|
||||
(old-grab-pos vector :inline :offset-assert 224)
|
||||
(joint process-drawable 4 :offset-assert 240)
|
||||
(new-post-hook (function none) :offset-assert 256)
|
||||
(cur-post-hook (function none) :offset-assert 260)
|
||||
(clone-copy-trans basic :offset-assert 264)
|
||||
(shadow-backup basic :offset-assert 268)
|
||||
(draw? symbol :offset-assert 272)
|
||||
((new-trans-hook (function none) :offset-assert 176)
|
||||
(cur-trans-hook (function none) :offset-assert 180)
|
||||
(cur-event-hook (function none) :offset-assert 184)
|
||||
(new-joint-anim art-joint-anim :offset-assert 188)
|
||||
(new-joint-anim-blend uint64 :offset-assert 192)
|
||||
(anim-mode symbol :offset-assert 200)
|
||||
(cur-grab-handle handle :offset-assert 208)
|
||||
(cur-target-handle handle :offset-assert 216)
|
||||
(old-grab-pos vector :inline :offset-assert 224)
|
||||
(joint joint-mod 4 :offset-assert 240)
|
||||
(new-post-hook (function none) :offset-assert 256)
|
||||
(cur-post-hook (function none) :offset-assert 260)
|
||||
(clone-copy-trans basic :offset-assert 264)
|
||||
(shadow-backup basic :offset-assert 268)
|
||||
(draw? symbol :offset-assert 272)
|
||||
)
|
||||
:heap-base #xb0
|
||||
:method-count-assert 20
|
||||
|
||||
@@ -1199,7 +1199,7 @@
|
||||
)
|
||||
|
||||
(defbehavior camera-tracker-init camera-tracker ((arg0 object))
|
||||
(stack-size-set! (-> self main-thread) 768) ;; was 512
|
||||
(stack-size-set! (-> self main-thread) 512)
|
||||
(logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile))
|
||||
(set! (-> self mask-to-clear) (the-as uint #x4a0800))
|
||||
(set! (-> self grab-target) (the-as handle #f))
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; Global engine settings:
|
||||
(defglobalconstant TARGET_STARTUP_HACKS #t)
|
||||
(defglobalconstant NO_BONES_HACK #f)
|
||||
(define *stats-poly* #f)
|
||||
(define *stats-memory* #f)
|
||||
@@ -72,7 +71,7 @@
|
||||
(define *display-path-marks* #f)
|
||||
(define *display-vol-marks* #f)
|
||||
(define *display-water-marks* #f)
|
||||
(define *display-actor-anim* #f)
|
||||
(define *display-actor-anim* (the string #f))
|
||||
(define *display-process-anim* (the-as (pointer process) #f))
|
||||
(define *display-actor-vis* #f)
|
||||
(define *display-actor-graph* #f)
|
||||
|
||||
@@ -522,6 +522,47 @@
|
||||
0
|
||||
)
|
||||
|
||||
(defconstant MEM_BAR_WIDTH 152)
|
||||
(defconstant MEM_BAR_HEIGHT 8)
|
||||
(defconstant MEM_BAR_NUM 7)
|
||||
(defconstant MEM_BAR_BG_COL (static-rgba 64 64 64 64))
|
||||
(defconstant MEM_BAR_X (- 480 MEM_BAR_WIDTH))
|
||||
(defconstant MEM_BAR_Y (- 224 4 (* MEM_BAR_HEIGHT MEM_BAR_NUM)))
|
||||
(defmacro draw-memory-bar-generic (buf &key remain &key total &key name &key idx &key color)
|
||||
`(let* (
|
||||
(total (the float ,total))
|
||||
(remain (the float ,remain))
|
||||
(used-p (/ (- total remain) total))
|
||||
(used-x (the int (* used-p MEM_BAR_WIDTH)))
|
||||
(used-y (+ MEM_BAR_Y (* ,idx MEM_BAR_HEIGHT)))
|
||||
)
|
||||
(draw-sprite2d-xy ,buf MEM_BAR_X used-y used-x MEM_BAR_HEIGHT ,color)
|
||||
(draw-sprite2d-xy ,buf (+ MEM_BAR_X used-x) used-y (- MEM_BAR_WIDTH used-x) MEM_BAR_HEIGHT MEM_BAR_BG_COL)
|
||||
(draw-string-xy ,name ,buf MEM_BAR_X used-y (font-color red) (font-flags shadow kerning right))
|
||||
(draw-string-xy (string-format "~,,2f%" (* used-p 100)) ,buf (+ MEM_BAR_X used-x) used-y (font-color red) (font-flags shadow kerning middle))
|
||||
(draw-string-xy (string-format "~,,1fM" (/ total (* 1024 1024))) ,buf (+ MEM_BAR_X MEM_BAR_WIDTH) used-y (font-color red) (font-flags shadow kerning left))
|
||||
)
|
||||
)
|
||||
(defmacro draw-memory-bar-kheap (buf heap &key (name #f) &key idx &key color)
|
||||
`(let ((heap ,heap))
|
||||
(draw-memory-bar-generic ,buf
|
||||
:remain (&- (-> heap top) (-> heap current))
|
||||
:total (&- (-> heap top) (-> heap base))
|
||||
:name ,(if name name (symbol->string heap))
|
||||
:idx ,idx
|
||||
:color ,color)
|
||||
)
|
||||
)
|
||||
(defmacro draw-memory-bar-dead-pool-heap (buf heap &key (name #f) &key idx &key color)
|
||||
`(let* ((heap ,heap) (pool-total (memory-total heap)))
|
||||
(draw-memory-bar-generic ,buf
|
||||
:remain (- pool-total (memory-used heap))
|
||||
:total pool-total
|
||||
:name ,(if name name (symbol->string heap))
|
||||
:idx ,idx
|
||||
:color ,color)
|
||||
)
|
||||
)
|
||||
|
||||
(defbehavior display-loop process ()
|
||||
"This is in progress..."
|
||||
@@ -670,14 +711,18 @@
|
||||
|
||||
;; debug drawing
|
||||
(when *debug-segment*
|
||||
(debug-draw-buffers) ;; lines/text
|
||||
|
||||
(#when PC_PORT
|
||||
(if (-> *pc-settings* debug-pad-display)
|
||||
(debug-pad-display (-> *cpad-list* cpads 0))
|
||||
)
|
||||
(when (and (or (= *master-mode* 'game) (= *master-mode* 'pause)) (-> *entity-debug-inspect* entity))
|
||||
(define-extern entity-inspect-draw (function entity-debug-inspect object))
|
||||
(entity-inspect-draw *entity-debug-inspect*)
|
||||
)
|
||||
)
|
||||
|
||||
(debug-draw-buffers) ;; lines/text
|
||||
|
||||
;; debug dma
|
||||
(with-dma-buffer-add-bucket ((debug-buf (-> disp frames (-> disp on-screen) frame debug-buf))
|
||||
(bucket-id debug-draw1))
|
||||
@@ -721,7 +766,7 @@
|
||||
(format *stdcon* "bug-report ~A~%" *user*)
|
||||
(format *stdcon* "nick ~A continue ~S~%" (-> *load-state* vis-nick) (-> *game-info* current-continue name))
|
||||
(dotimes (i LEVEL_COUNT)
|
||||
(format *stdcon* "level ~D ~8A ~A~%" i (-> *level* level i name) (-> *level* level i display?))
|
||||
(format *stdcon* "level ~D ~12A ~A~%" i (-> *level* level i name) (-> *level* level i display?))
|
||||
)
|
||||
(format *stdcon* "music ~A (f: ~D) sound ~A ~A~%"
|
||||
(-> *setting-control* current music) (-> *setting-control* current sound-flava)
|
||||
@@ -738,38 +783,19 @@
|
||||
)
|
||||
)
|
||||
(when (-> *pc-settings* display-heap-status)
|
||||
(mlet* ((BAR_WIDTH 160)
|
||||
(BAR_HEIGHT 8)
|
||||
(BAR_NUM 2)
|
||||
(BAR_BG_COL (static-rgba 64 64 64 64))
|
||||
(BAR_X (- 480 BAR_WIDTH))
|
||||
(BAR_Y (- 224 4 (* BAR_HEIGHT BAR_NUM)))
|
||||
)
|
||||
(let* (
|
||||
(remain (the float (&- (-> global top) (-> global current))))
|
||||
(total (the float (&- (-> global top) (-> global base))))
|
||||
(used-p (/ (- total remain) total))
|
||||
(used-x (the int (* used-p BAR_WIDTH)))
|
||||
(used-y BAR_Y)
|
||||
)
|
||||
(draw-sprite2d-xy debug-buf BAR_X used-y used-x BAR_HEIGHT (static-rgba 32 32 255 64))
|
||||
(draw-sprite2d-xy debug-buf (+ BAR_X used-x) used-y (- BAR_WIDTH used-x) BAR_HEIGHT BAR_BG_COL)
|
||||
(draw-string-xy "global" debug-buf BAR_X used-y (font-color red) (font-flags shadow kerning right))
|
||||
(draw-string-xy (string-format "~,,2f% (~,,1fM)" (* used-p 100) (/ total (* 1024 1024))) debug-buf (+ BAR_X used-x) used-y (font-color red) (font-flags shadow kerning middle))
|
||||
)
|
||||
(let* (
|
||||
(remain (the float (&- (-> debug top) (-> debug current))))
|
||||
(total (the float (&- (-> debug top) (-> debug base))))
|
||||
(used-p (/ (- total remain) total))
|
||||
(used-x (the int (* used-p BAR_WIDTH)))
|
||||
(used-y (+ BAR_Y BAR_HEIGHT))
|
||||
)
|
||||
(draw-sprite2d-xy debug-buf BAR_X used-y used-x BAR_HEIGHT (static-rgba 255 32 32 64))
|
||||
(draw-sprite2d-xy debug-buf (+ BAR_X used-x) used-y (- BAR_WIDTH used-x) BAR_HEIGHT BAR_BG_COL)
|
||||
(draw-string-xy "debug" debug-buf BAR_X used-y (font-color red) (font-flags shadow kerning right))
|
||||
(draw-string-xy (string-format "~,,2f% (~,,1fM)" (* used-p 100) (/ total (* 1024 1024))) debug-buf (+ BAR_X used-x) used-y (font-color red) (font-flags shadow kerning middle))
|
||||
)
|
||||
)
|
||||
(draw-memory-bar-kheap debug-buf global :idx 0 :color (static-rgba 32 32 255 64))
|
||||
(draw-memory-bar-kheap debug-buf debug :idx 1 :color (static-rgba 255 32 32 64))
|
||||
(draw-memory-bar-kheap debug-buf (-> *level* level 0 heap) :name "l0" :idx 2 :color (static-rgba 32 255 255 64))
|
||||
(draw-memory-bar-kheap debug-buf (-> *level* level 1 heap) :name "l1" :idx 3 :color (static-rgba 255 32 255 64))
|
||||
(draw-memory-bar-dead-pool-heap debug-buf *nk-dead-pool* :name "actor" :idx 4 :color (static-rgba 32 255 32 64))
|
||||
(draw-memory-bar-generic debug-buf
|
||||
:remain (* 16 (dma-buffer-free (-> disp frames (-> disp on-screen) frame global-buf)))
|
||||
:total (length (-> disp frames (-> disp on-screen) frame global-buf))
|
||||
:name "dma-global" :idx 5 :color (static-rgba 32 32 255 64))
|
||||
(draw-memory-bar-generic debug-buf
|
||||
:remain (* 16 (dma-buffer-free (-> disp frames (-> disp on-screen) frame debug-buf)))
|
||||
:total (length (-> disp frames (-> disp on-screen) frame debug-buf))
|
||||
:name "dma-debug" :idx 6 :color (static-rgba 255 32 32 64))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
)
|
||||
|
||||
;; set sound flava
|
||||
(set! (-> s5-1 sound-flava) (the-as uint (flava-lookup (-> gp-0 music) (the-as int (-> s5-1 sound-flava)))))
|
||||
(set! (-> s5-1 sound-flava) (the-as uint (flava-lookup (-> gp-0 music) (the-as music-flava (-> s5-1 sound-flava)))))
|
||||
(set! (-> gp-0 sound-flava) (-> s5-1 sound-flava))
|
||||
(if *sound-player-enable*
|
||||
(sound-set-flava (-> gp-0 sound-flava))
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
((< (vector-length s5-3) 102400.0)
|
||||
(when (not (-> obj have-music))
|
||||
(set! (-> obj have-music) #t)
|
||||
(set-setting! *setting-control* pp 'music (the-as symbol (-> obj music)) 0.0 0)
|
||||
(set-setting! *setting-control* pp 'music (-> obj music) 0.0 0)
|
||||
)
|
||||
)
|
||||
((-> obj have-music)
|
||||
@@ -415,7 +415,7 @@
|
||||
(deactivate a0-4)
|
||||
)
|
||||
)
|
||||
(set! (-> self last-talk) (the-as uint (-> *display* game-frame-counter)))
|
||||
(set! (-> self last-talk) (-> *display* game-frame-counter))
|
||||
(dummy-52 self)
|
||||
(none)
|
||||
)
|
||||
@@ -486,13 +486,13 @@
|
||||
(ja-play-spooled-anim
|
||||
(the-as spool-anim arg1)
|
||||
arg0
|
||||
(the-as art-joint-anim (-> self blend-on-exit))
|
||||
(-> self blend-on-exit)
|
||||
(lambda ((arg0 process-taskable)) (= (get-response (-> arg0 query)) 'no))
|
||||
)
|
||||
(ja-play-spooled-anim
|
||||
(the-as spool-anim arg1)
|
||||
arg0
|
||||
(the-as art-joint-anim (-> self blend-on-exit))
|
||||
(-> self blend-on-exit)
|
||||
(the-as (function process-drawable symbol) false-func)
|
||||
)
|
||||
)
|
||||
@@ -1035,7 +1035,7 @@
|
||||
((not *target*)
|
||||
)
|
||||
((not (-> self will-talk))
|
||||
(if (>= (- (-> *display* game-frame-counter) (the-as int (-> self last-talk))) 3000)
|
||||
(if (>= (- (-> *display* game-frame-counter) (-> self last-talk)) 3000)
|
||||
(set! (-> self will-talk) #t)
|
||||
)
|
||||
)
|
||||
@@ -1085,7 +1085,7 @@
|
||||
(set! (-> v1-59 scale) 0.9)
|
||||
)
|
||||
(set! (-> gp-1 flags) (font-flags shadow kerning left large))
|
||||
(print-game-text (lookup-text! *common-text* (the-as game-text-id (-> self talk-message)) #f) gp-1 #f 128 22)
|
||||
(print-game-text (lookup-text! *common-text* (-> self talk-message) #f) gp-1 #f 128 22)
|
||||
)
|
||||
(when (and (cpad-pressed? 0 circle) (process-grab? *target*))
|
||||
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle))
|
||||
@@ -1174,8 +1174,8 @@
|
||||
(set! (-> obj cell-for-task) (game-task none))
|
||||
(set! (-> obj camera) (the-as handle #f))
|
||||
(set! (-> obj will-talk) #t)
|
||||
(set! (-> obj talk-message) (the-as uint 260))
|
||||
(set! (-> obj last-talk) (the-as uint 0))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk))
|
||||
(set! (-> obj last-talk) 0)
|
||||
(set! (-> obj bounce-away) #t)
|
||||
(set! (-> obj been-kicked) #f)
|
||||
(set! (-> obj neck-joint-index) arg5)
|
||||
@@ -1347,7 +1347,6 @@
|
||||
(s1-0 (or (!= (-> self spooling?) #t) (logtest? (-> (the-as process-taskable s2-0) skel status) 32)))
|
||||
)
|
||||
(vector<-cspace! s5-0 (-> (the-as process-taskable s2-0) node-list data (-> self cam-joint-index)))
|
||||
|
||||
(vector-normalize-copy! gp-0 (-> s4-0 vector 2) -1.0)
|
||||
(when s1-0
|
||||
(when (not (-> self had-valid-frame))
|
||||
@@ -1419,22 +1418,20 @@
|
||||
)
|
||||
|
||||
(defmethod draw-npc-shadow process-taskable ((obj process-taskable))
|
||||
(#unless TARGET_STARTUP_HACKS
|
||||
(let ((gp-0 (-> obj draw shadow-ctrl)))
|
||||
(cond
|
||||
((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status drwf03)))
|
||||
(dummy-15 gp-0 (-> obj draw origin) -4096.0 4096.0 32768.0)
|
||||
(dummy-14 gp-0)
|
||||
)
|
||||
(else
|
||||
(let ((v1-10 gp-0))
|
||||
(logior! (-> v1-10 settings flags) 32)
|
||||
)
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-0 (-> obj draw shadow-ctrl)))
|
||||
(cond
|
||||
((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status drwf03)))
|
||||
;(dummy-15 gp-0 (-> obj draw origin) -4096.0 4096.0 32768.0)
|
||||
(dummy-14 gp-0)
|
||||
)
|
||||
(else
|
||||
(let ((v1-10 gp-0))
|
||||
(logior! (-> v1-10 settings flags) 32)
|
||||
)
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
@@ -117,21 +117,21 @@
|
||||
(cell-for-task game-task :offset-assert 256)
|
||||
(cell-x handle :offset-assert 264)
|
||||
(cam-joint-index int32 :offset-assert 272)
|
||||
(skippable basic :offset-assert 276) ;; probably a symbol
|
||||
(blend-on-exit basic :offset-assert 280) ;; probably a symbol?
|
||||
(skippable symbol :offset-assert 276)
|
||||
(blend-on-exit art-joint-anim :offset-assert 280)
|
||||
(camera handle :offset-assert 288)
|
||||
(will-talk symbol :offset-assert 296)
|
||||
(talk-message uint32 :offset-assert 300)
|
||||
(last-talk uint64 :offset-assert 304)
|
||||
(talk-message game-text-id :offset-assert 300)
|
||||
(last-talk int64 :offset-assert 304)
|
||||
(bounce-away symbol :offset-assert 312)
|
||||
(ambient ambient-control :inline :offset-assert 320)
|
||||
(center-joint-index int32 :offset-assert 336)
|
||||
(draw-bounds-y-offset float :offset-assert 340)
|
||||
(neck-joint-index int32 :offset-assert 344)
|
||||
(fuel-cell-anim spool-anim :offset-assert 348)
|
||||
(sound-flava uint8 :offset-assert 352)
|
||||
(sound-flava music-flava :offset-assert 352)
|
||||
(have-flava symbol :offset-assert 356)
|
||||
(music basic :offset-assert 360)
|
||||
(music symbol :offset-assert 360)
|
||||
(have-music symbol :offset-assert 364)
|
||||
(been-kicked symbol :offset-assert 368)
|
||||
(cur-trans-hook (function none) :offset-assert 372)
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
(left 3)
|
||||
(right 4)
|
||||
(large 5)
|
||||
(pc-hack 6) ;; added, widescreen small text hack
|
||||
)
|
||||
|
||||
(deftype char-verts (structure)
|
||||
|
||||
@@ -693,7 +693,7 @@
|
||||
(.mul.vf vf25 vf25 vf1 :mask #b11)
|
||||
(.mul.vf vf23 vf23 vf1 :mask #b11)
|
||||
;; hack! fixes small font widescreen
|
||||
(if (logtest? (-> arg2 flags) (font-flags large right middle))
|
||||
(unless (logtest? (-> arg2 flags) (font-flags pc-hack))
|
||||
(.mul.vf vf24 vf24 vf1 :mask #b11)
|
||||
)
|
||||
(let ((fw *font-work*))
|
||||
@@ -1657,7 +1657,7 @@
|
||||
(.mul.vf vf25 vf25 vf1 :mask #b11)
|
||||
(.mul.vf vf23 vf23 vf1 :mask #b11)
|
||||
;; hack! fixes small font widescreen
|
||||
(if (logtest? (-> arg1 flags) (font-flags large right middle))
|
||||
(unless (logtest? (-> arg1 flags) (font-flags pc-hack))
|
||||
(.mul.vf vf24 vf24 vf1 :mask #b11)
|
||||
)
|
||||
(let ((a1-4 *font-work*))
|
||||
|
||||
@@ -1494,7 +1494,7 @@
|
||||
(let ((startup-level (case *kernel-boot-message*
|
||||
(('play)
|
||||
(if *debug-segment*
|
||||
(#if (user? dass) 'snow 'village1)
|
||||
(#if (user? dass) 'citadel 'village1)
|
||||
'title
|
||||
)
|
||||
)
|
||||
@@ -1664,6 +1664,12 @@
|
||||
(format 0 "Discarding level ~A~%" (-> s4-0 name))
|
||||
(level-status-set! s4-0 'inactive)
|
||||
(set! v1-0 #t)
|
||||
(#when PC_PORT
|
||||
(when *debug-segment*
|
||||
(define-extern *entity* entity)
|
||||
(set! *entity* (the entity #f))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -591,6 +591,67 @@
|
||||
(read-from-file *pc-settings* PC_SETTINGS_FILE_NAME)
|
||||
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;; entity debugging
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(when *debug-segment*
|
||||
|
||||
(deftype entity-debug-inspect (basic)
|
||||
(
|
||||
(scroll-y int32)
|
||||
(entity entity)
|
||||
(show-actor-info symbol)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type) _type_)
|
||||
(set-entity! (_type_ entity) entity)
|
||||
(update-pad (_type_ int) none)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod new entity-debug-inspect ((allocation symbol) (type-to-make type))
|
||||
"make a new entity-debug-inspect object"
|
||||
|
||||
(let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||
|
||||
(set! (-> obj scroll-y) 0)
|
||||
(set! (-> obj entity) (the entity #f))
|
||||
(set! (-> obj show-actor-info) #f)
|
||||
obj
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod set-entity! entity-debug-inspect ((obj entity-debug-inspect) (e entity))
|
||||
"set the entity to inspect"
|
||||
|
||||
(set! (-> obj entity) e)
|
||||
(unless e
|
||||
(set! *display-actor-anim* (the string #f)))
|
||||
(set! (-> obj scroll-y) 0)
|
||||
|
||||
e
|
||||
)
|
||||
|
||||
(defmethod update-pad entity-debug-inspect ((obj entity-debug-inspect) (pad-idx int))
|
||||
"respond to pad inputs"
|
||||
|
||||
(if (cpad-pressed? pad-idx r1)
|
||||
(1+! (-> obj scroll-y)))
|
||||
(if (cpad-pressed? pad-idx l1)
|
||||
(set! (-> obj scroll-y) (max 0 (1- (-> obj scroll-y)))))
|
||||
(if (cpad-pressed? pad-idx l3)
|
||||
(not! (-> obj show-actor-info)))
|
||||
|
||||
(none))
|
||||
|
||||
|
||||
(define *entity-debug-inspect* (new 'debug 'entity-debug-inspect))
|
||||
|
||||
)
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -83,6 +83,60 @@
|
||||
(set-fps)
|
||||
)
|
||||
|
||||
;; flavors for music
|
||||
(defenum music-flava
|
||||
:type uint8
|
||||
(racer 1)
|
||||
(flutflut 2)
|
||||
(to-maincave 3)
|
||||
(to-snow 4)
|
||||
(sage 5)
|
||||
(assistant 6)
|
||||
(birdlady 7)
|
||||
(mayor 8)
|
||||
(sculptor 9)
|
||||
(explorer 10)
|
||||
(sage-yellow 11)
|
||||
(sage-red 12)
|
||||
(sage-blue 13)
|
||||
(miners 14)
|
||||
(warrior 15)
|
||||
(geologist 16)
|
||||
(gambler 17)
|
||||
(sage-hut 18)
|
||||
(dock 19)
|
||||
(farmer 20)
|
||||
(jungleb-eggtop 21)
|
||||
(misty-boat 22)
|
||||
(misty-battle 23)
|
||||
(beach-sentinel 24)
|
||||
(beach-cannon 25)
|
||||
(beach-grotto 26)
|
||||
(citadel-center 27)
|
||||
(robocave 28)
|
||||
(robocave-top 29)
|
||||
(maincave 30)
|
||||
(darkcave 31)
|
||||
(snow-battle 32)
|
||||
(snow-cave 33)
|
||||
(snow-fort 34)
|
||||
(snow-balls 35)
|
||||
(levitator 36)
|
||||
(swamp-launcher 37)
|
||||
(swamp-battle 38)
|
||||
(jungle-temple-exit 39)
|
||||
(jungle-lurkerm 40)
|
||||
(jungle-temple-top 41)
|
||||
(rolling-gorge 42)
|
||||
(ogre-middle 43)
|
||||
(ogre-end 44)
|
||||
(lavatube-middle 45)
|
||||
(lavatube-end 46)
|
||||
(finalboss-middle 47)
|
||||
(finalboss-end 48)
|
||||
(default 49)
|
||||
)
|
||||
|
||||
;; like should match the sound type in OVERLORD
|
||||
;; This is shared between all sound RPCs and acts like the header for the sound messages
|
||||
(deftype sound-rpc-cmd (structure)
|
||||
|
||||
+79
-133
@@ -887,7 +887,7 @@
|
||||
(define *flava-table* (new 'global 'flava-table))
|
||||
(set! (-> *flava-table* count) 0)
|
||||
|
||||
(defun flava-lookup ((music symbol) (n int))
|
||||
(defun flava-lookup ((music symbol) (n music-flava))
|
||||
"Return the n'th flava for the specified music"
|
||||
|
||||
(dotimes (i (-> *flava-table* count))
|
||||
@@ -904,7 +904,7 @@
|
||||
|
||||
`(begin
|
||||
;; append a new music to the flava table
|
||||
(set! (-> *flava-table* row (-> *flava-table* count) music) ,name)
|
||||
(set! (-> *flava-table* row (-> *flava-table* count) music) (quote ,name))
|
||||
|
||||
;; reset this music's flavas
|
||||
(dotimes (n 50)
|
||||
@@ -916,170 +916,116 @@
|
||||
(1+! (-> *flava-table* count))
|
||||
|
||||
;; set the flavas or whatever they're called
|
||||
,@(apply (lambda (x) `(set! (-> *flava-table* row (1- (-> *flava-table* count)) flava ,(first x)) ,(second x))) flavas)
|
||||
,@(apply (lambda (x) `(set! (-> *flava-table* row (1- (-> *flava-table* count)) flava (music-flava ,(first x))) ,(second x))) flavas)
|
||||
)
|
||||
)
|
||||
|
||||
#| flava events (guesses):
|
||||
0 :
|
||||
1 : racer
|
||||
2 : flutflut
|
||||
3 : to-maincave
|
||||
4 : to-snow
|
||||
5 : sage
|
||||
6 : assistant
|
||||
7 : birdlady
|
||||
8 : mayor
|
||||
9 : sculptor
|
||||
10: uncle
|
||||
11: sage-yellow
|
||||
12: sage-red
|
||||
13: sage-blue
|
||||
14: miners
|
||||
15: warrior
|
||||
16: geologist
|
||||
17: gambler
|
||||
18: sage-hut
|
||||
19: dock
|
||||
20: farmer
|
||||
21: jungleb-eggtop
|
||||
22: misty-boat
|
||||
23: misty-ambush (?)
|
||||
24: beach-sentinel
|
||||
25: beach-cannon
|
||||
26: beach-logs
|
||||
27: citadel-center
|
||||
28: robocave
|
||||
29: robocave-top
|
||||
30: maincave
|
||||
31: darkcave
|
||||
32: snow-ambush (?)
|
||||
33: snow-cave
|
||||
34: snow-fort
|
||||
35: snow-balls
|
||||
36: levitator
|
||||
37: swamp-launcher
|
||||
38: swamp-ambush (?)
|
||||
39: jungle-temple-exit
|
||||
40: jungle-lurkerm
|
||||
41: jungle-temple-top
|
||||
42: rolling-race
|
||||
43: ogre-middle
|
||||
44: ogre-end
|
||||
45: lavatube-middle
|
||||
46: lavatube-end
|
||||
47: finalboss-middle
|
||||
48: finalboss-end
|
||||
49: default
|
||||
|#
|
||||
|
||||
;; TODO make enum
|
||||
(flava-table-add 'village1
|
||||
(5 2)
|
||||
(6 6)
|
||||
(7 4)
|
||||
(20 5)
|
||||
(8 7)
|
||||
(9 8)
|
||||
(10 9)
|
||||
(19 10)
|
||||
(18 3)
|
||||
(flava-table-add village1
|
||||
(sage 2)
|
||||
(assistant 6)
|
||||
(birdlady 4)
|
||||
(farmer 5)
|
||||
(mayor 7)
|
||||
(sculptor 8)
|
||||
(explorer 9)
|
||||
(dock 10)
|
||||
(sage-hut 3)
|
||||
)
|
||||
|
||||
(flava-table-add 'jungle
|
||||
(39 1)
|
||||
(40 2)
|
||||
(41 3)
|
||||
(flava-table-add jungle
|
||||
(jungle-temple-exit 1)
|
||||
(jungle-lurkerm 2)
|
||||
(jungle-temple-top 3)
|
||||
)
|
||||
|
||||
(flava-table-add 'firecanyon
|
||||
(1 1)
|
||||
(flava-table-add firecanyon
|
||||
(racer 1)
|
||||
)
|
||||
|
||||
(flava-table-add 'jungleb
|
||||
(21 1)
|
||||
(flava-table-add jungleb
|
||||
(jungleb-eggtop 1)
|
||||
)
|
||||
|
||||
(flava-table-add 'beach
|
||||
(7 4)
|
||||
(24 1)
|
||||
(25 2)
|
||||
(26 3)
|
||||
(flava-table-add beach
|
||||
(birdlady 4)
|
||||
(beach-sentinel 1)
|
||||
(beach-cannon 2)
|
||||
(beach-grotto 3)
|
||||
)
|
||||
|
||||
(flava-table-add 'misty
|
||||
(1 3)
|
||||
(22 2)
|
||||
(23 1)
|
||||
(flava-table-add misty
|
||||
(racer 3)
|
||||
(misty-boat 2)
|
||||
(misty-battle 1)
|
||||
)
|
||||
|
||||
(flava-table-add 'village2
|
||||
(5 1)
|
||||
(6 2)
|
||||
(15 3)
|
||||
(16 4)
|
||||
(17 5)
|
||||
(36 6)
|
||||
(flava-table-add village2
|
||||
(sage 1)
|
||||
(assistant 2)
|
||||
(warrior 3)
|
||||
(geologist 4)
|
||||
(gambler 5)
|
||||
(levitator 6)
|
||||
)
|
||||
|
||||
(flava-table-add 'swamp
|
||||
(2 4)
|
||||
(37 2)
|
||||
(38 3)
|
||||
(flava-table-add swamp
|
||||
(flutflut 4)
|
||||
(swamp-launcher 2)
|
||||
(swamp-battle 3)
|
||||
)
|
||||
|
||||
(flava-table-add 'rolling
|
||||
(42 1)
|
||||
(flava-table-add rolling
|
||||
(rolling-gorge 1)
|
||||
)
|
||||
|
||||
(flava-table-add 'ogre
|
||||
(43 1)
|
||||
(44 2)
|
||||
(flava-table-add ogre
|
||||
(ogre-middle 1)
|
||||
(ogre-end 2)
|
||||
)
|
||||
|
||||
(flava-table-add 'village3
|
||||
(3 4)
|
||||
(4 5)
|
||||
(5 2)
|
||||
(6 3)
|
||||
(14 1)
|
||||
(flava-table-add village3
|
||||
(to-maincave 4)
|
||||
(to-snow 5)
|
||||
(sage 2)
|
||||
(assistant 3)
|
||||
(miners 1)
|
||||
)
|
||||
|
||||
(flava-table-add 'maincave
|
||||
(28 1)
|
||||
(29 2)
|
||||
(30 3)
|
||||
(31 4)
|
||||
(flava-table-add maincave
|
||||
(robocave 1)
|
||||
(robocave-top 2)
|
||||
(maincave 3)
|
||||
(darkcave 4)
|
||||
)
|
||||
|
||||
(flava-table-add 'snow
|
||||
(2 2)
|
||||
(32 1)
|
||||
(33 3)
|
||||
(34 4)
|
||||
(35 5)
|
||||
(flava-table-add snow
|
||||
(flutflut 2)
|
||||
(snow-battle 1)
|
||||
(snow-cave 3)
|
||||
(snow-fort 4)
|
||||
(snow-balls 5)
|
||||
)
|
||||
|
||||
(flava-table-add 'lavatube
|
||||
(45 2)
|
||||
(46 3)
|
||||
(49 1)
|
||||
(flava-table-add lavatube
|
||||
(lavatube-middle 2)
|
||||
(lavatube-end 3)
|
||||
(default 1)
|
||||
)
|
||||
|
||||
(flava-table-add 'citadel
|
||||
(5 1)
|
||||
(6 2)
|
||||
(11 3)
|
||||
(12 4)
|
||||
(13 5)
|
||||
(27 6)
|
||||
(flava-table-add citadel
|
||||
(sage 1)
|
||||
(assistant 2)
|
||||
(sage-yellow 3)
|
||||
(sage-red 4)
|
||||
(sage-blue 5)
|
||||
(citadel-center 6)
|
||||
)
|
||||
|
||||
(flava-table-add 'finalboss
|
||||
(47 1)
|
||||
(48 2)
|
||||
(flava-table-add finalboss
|
||||
(finalboss-middle 1)
|
||||
(finalboss-end 2)
|
||||
)
|
||||
|
||||
(flava-table-add 'credits
|
||||
(49 2)
|
||||
(flava-table-add credits
|
||||
(default 2)
|
||||
)
|
||||
|
||||
@@ -203,18 +203,17 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(#unless TARGET_STARTUP_HACKS
|
||||
(let ((a0-26 (-> self skel effect)))
|
||||
(if a0-26
|
||||
(TODO-RENAME-9 a0-26)
|
||||
)
|
||||
)
|
||||
(if (logtest? (-> self skel status) 72)
|
||||
(merc-blend-shape self)
|
||||
(let ((a0-26 (-> self skel effect)))
|
||||
(if a0-26
|
||||
(TODO-RENAME-9 a0-26)
|
||||
)
|
||||
(if (logtest? (-> self skel status) 384)
|
||||
(merc-eye-anim self)
|
||||
))
|
||||
)
|
||||
; (if (logtest? (-> self skel status) 72)
|
||||
; (merc-blend-shape self)
|
||||
; )
|
||||
; (if (logtest? (-> self skel status) 384)
|
||||
; (merc-eye-anim self)
|
||||
; )
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -180,13 +180,9 @@
|
||||
(set! (-> arg2 vector 0 y) 0.0)
|
||||
)
|
||||
(else
|
||||
;; NOTE: this code has been commented for now so we can run progress even when manipy isn't working yet.
|
||||
;; if we don't have this stuff loaded right, just set the offset to 0.
|
||||
;; this ends up being the right offset in all the cases except for things that
|
||||
;; orbit the powercell. Those are just drawn underneath the powercell
|
||||
; (vector<-cspace! s3-0 (-> s5-0 icons (logand s4-0 3) icon 0 node-list data v1-0))
|
||||
; (vector<-cspace! s2-0 (-> s5-0 icons (logand s4-0 3) icon 0 node-list data 3))
|
||||
; (vector-! s3-0 s3-0 s2-0)
|
||||
(vector<-cspace! s3-0 (-> s5-0 icons (logand s4-0 3) icon 0 node-list data v1-0))
|
||||
(vector<-cspace! s2-0 (-> s5-0 icons (logand s4-0 3) icon 0 node-list data 3))
|
||||
(vector-! s3-0 s3-0 s2-0)
|
||||
(set! (-> arg2 vector 0 x) (* 48.0 (-> s3-0 x)))
|
||||
(set! (-> arg2 vector 0 y) (* 60.0 (-> s3-0 y)))
|
||||
(set! (-> arg2 vector 0 z) (* 32.0 (-> s3-0 z)))
|
||||
|
||||
@@ -364,7 +364,7 @@
|
||||
:stack *scratch-memory-top*
|
||||
)))
|
||||
(when new-manipy
|
||||
;;(set! (-> (-> new-manipy) draw dma-add-func) dma-add-process-drawable-hud) TODO
|
||||
(set! (-> (-> new-manipy) draw dma-add-func) dma-add-process-drawable-hud)
|
||||
(set-vector! (-> (-> new-manipy) root trans) 0.0 0.0 0.0 1.0)
|
||||
(set-vector! (-> (-> new-manipy) root scale) ,scale-x ,scale-y ,scale-x 1.0)
|
||||
(when #f
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
(zero 0)
|
||||
(one 1)
|
||||
(confirm #x103)
|
||||
(press-to-talk #x104)
|
||||
(press-to-use #x105)
|
||||
(confirm-play #x106)
|
||||
(play-again? #x107)
|
||||
@@ -37,8 +38,12 @@
|
||||
(spanish #x117)
|
||||
(italian #x118)
|
||||
(japanese #x119)
|
||||
(press-to-trade-money #x11a)
|
||||
(press-to-trade-money-oracle #x11b)
|
||||
(press-to-warp #x11c)
|
||||
(press-to-exit #x11d)
|
||||
(press-to-talk-to-sage #x123)
|
||||
(press-to-talk-to-assistant #x124)
|
||||
(aspect-ratio #x125)
|
||||
(video-mode #x126)
|
||||
(game-options #x127)
|
||||
|
||||
@@ -119,8 +119,8 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; set to #t to get lots of prints during loading
|
||||
(defglobalconstant DEBUG_LOAD #t)
|
||||
(defglobalconstant DEBUG_TEX #t)
|
||||
(defglobalconstant DEBUG_LOAD #f)
|
||||
(defglobalconstant DEBUG_TEX #f)
|
||||
|
||||
(defmacro load-dbg (fmt-str &rest args)
|
||||
(if DEBUG_LOAD
|
||||
|
||||
+5
-4
@@ -393,7 +393,6 @@
|
||||
|
||||
"common/blocking-plane.gc"
|
||||
"common/launcherdoor.gc"
|
||||
"common/snow-bunny.gc"
|
||||
"common/battlecontroller.gc"
|
||||
|
||||
"racer_common/target-racer-h-FIC-LAV-MIS-OGR-ROL.gc"
|
||||
@@ -624,7 +623,7 @@
|
||||
;; assistant
|
||||
(copy-strs "ASIBESWI" "ASR1BESW")
|
||||
;; sage
|
||||
(copy-strs "SAISD1" "SAISD2" "SAISE" "SAR1ECOR" "SAIMCANN" "SAR1MCAN" "SAR1GENE" "SAR2GENE")
|
||||
(copy-strs "SAISA" "SAISD1" "SAISD2" "SAISE" "SAR1ECOR" "SAIMCANN" "SAR1MCAN" "SAR1GENE" "SAR2GENE")
|
||||
;; fishermans-boat
|
||||
(copy-strs "FIBRTMIS")
|
||||
|
||||
@@ -882,6 +881,7 @@
|
||||
"snow-ram.gc"
|
||||
"snow-part.gc"
|
||||
"yeti.gc"
|
||||
"snow-bunny.gc"
|
||||
)
|
||||
|
||||
(copy-textures 710 842 711 712)
|
||||
@@ -912,6 +912,8 @@
|
||||
"snow-vis"
|
||||
)
|
||||
|
||||
;; ram-boss
|
||||
(copy-strs "SNRBICFC" "SNRBIPFC" "SNRBSBFC")
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Fire Canyon
|
||||
@@ -1323,7 +1325,7 @@
|
||||
|
||||
(goal-src-sequence
|
||||
"levels/citadel/"
|
||||
:deps ("out/obj/battlecontroller.o")
|
||||
:deps ("out/obj/battlecontroller.o" "out/obj/snow-bunny.o")
|
||||
|
||||
"citadel-part.gc"
|
||||
"citadel-obs.gc"
|
||||
@@ -1453,7 +1455,6 @@
|
||||
"intro-vis"
|
||||
)
|
||||
|
||||
(copy-strs "SAISA")
|
||||
;; evilbro
|
||||
(copy-strs "EVMEND")
|
||||
|
||||
|
||||
@@ -608,6 +608,14 @@
|
||||
`(set! ,result (sext32 (sar (logand #xffffffff (the-as int ,in)) ,sa)))
|
||||
)
|
||||
|
||||
(defmacro /-0-guard (a b)
|
||||
`(let ((divisor ,b))
|
||||
(if (zero? divisor)
|
||||
0
|
||||
(/ ,a divisor))
|
||||
)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Bit Macros
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
@@ -608,7 +608,7 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defun sort ((lst object) (compare-func (function object object object)))
|
||||
(defun sort ((lst pair) (compare-func (function object object object)))
|
||||
"Sort a list, using compare-func to compare elements.
|
||||
The comparison function can return either an integer or a true/false.
|
||||
For integers, use a positive number to represent first > second
|
||||
@@ -1421,3 +1421,7 @@
|
||||
(set! ,dest ,src)
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro empty-form ()
|
||||
`(none)
|
||||
)
|
||||
|
||||
@@ -212,7 +212,7 @@ It type checks the arguments for the entry function.
|
||||
;; This way it can check the individual function types, make sure they make sense, and create
|
||||
;; a state with the appropriate type.
|
||||
,(if virtual
|
||||
`(define-virtual-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post)
|
||||
`(define-virtual-state-hook ,state-name ,defstate-type ,new-state ,(eq? virtual 'override) :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post)
|
||||
`(define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post)
|
||||
)
|
||||
|
||||
|
||||
@@ -722,3 +722,9 @@
|
||||
)
|
||||
)
|
||||
|
||||
(#when PC_PORT
|
||||
(when *debug-segment*
|
||||
;; shared temporary string.
|
||||
(define *debug-temp-string* (new 'debug 'string 4096 (the string #f)))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
(defmethod init-from-entity! bird-lady-beach ((obj bird-lady-beach) (arg0 entity-actor))
|
||||
(dummy-40 obj arg0 *bird-lady-beach-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (game-task beach-flutflut)))
|
||||
(set! (-> obj sound-flava) (the-as uint 7))
|
||||
(set! (-> obj sound-flava) (music-flava birdlady))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
(defmethod init-from-entity! bird-lady ((obj bird-lady) (arg0 entity-actor))
|
||||
(dummy-40 obj arg0 *bird-lady-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (game-task beach-flutflut)))
|
||||
(set! (-> obj sound-flava) (the-as uint 7))
|
||||
(set! (-> obj sound-flava) (music-flava birdlady))
|
||||
(set! (-> obj draw light-index) (the-as uint 4))
|
||||
(if (closed? (-> obj tasks) (game-task beach-flutflut) (task-status need-reminder))
|
||||
(dummy-18 obj)
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
)
|
||||
|
||||
(defmethod play-anim! mayor ((obj mayor) (arg0 symbol))
|
||||
(set! (-> obj talk-message) (the-as uint 260))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk))
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status need-hint) (task-status need-introduction))
|
||||
(when arg0
|
||||
@@ -535,7 +535,7 @@
|
||||
(send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc)))
|
||||
)
|
||||
(else
|
||||
(set! (-> obj talk-message) (the-as uint 282))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-trade-money))
|
||||
)
|
||||
)
|
||||
(new 'static 'spool-anim
|
||||
@@ -725,7 +725,7 @@
|
||||
(dummy-40 obj arg0 *mayor-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5)
|
||||
(set! (-> obj bounce-away) #f)
|
||||
(set! (-> obj tasks) (get-task-control (game-task jungle-lurkerm)))
|
||||
(set! (-> obj sound-flava) (the-as uint 8))
|
||||
(set! (-> obj sound-flava) (music-flava mayor))
|
||||
(set! (-> obj draw light-index) (the-as uint 2))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
|
||||
@@ -588,7 +588,7 @@
|
||||
(dummy-40 obj arg0 *sculptor-sg* 3 40 (new 'static 'vector :w 4096.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (game-task misty-muse)))
|
||||
(set! (-> obj muse) (the-as handle #f))
|
||||
(set! (-> obj sound-flava) (the-as uint 9))
|
||||
(set! (-> obj sound-flava) (music-flava sculptor))
|
||||
(set! (-> obj draw light-index) (the-as uint 3))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
|
||||
@@ -5,18 +5,9 @@
|
||||
;; name in dgo: citadel-sages
|
||||
;; dgos: CIT, L1
|
||||
|
||||
(define-extern *citb-sagecage-sg* skeleton-group)
|
||||
|
||||
(define-extern *green-sagecage-sg* skeleton-group)
|
||||
(define-extern *robotboss-sg* skeleton-group)
|
||||
(define-extern *evilbro-citadel-sg* skeleton-group)
|
||||
(define-extern *evilsis-citadel-sg* skeleton-group)
|
||||
(define-extern *yellowsage-sg* skeleton-group)
|
||||
(define-extern *bluesage-sg* skeleton-group)
|
||||
(define-extern *redsage-sg* skeleton-group)
|
||||
|
||||
(declare-type citb-sage process-taskable)
|
||||
(declare-type robotboss process-drawable)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
@@ -55,19 +46,19 @@
|
||||
(let ((gp-0 (-> self node-list data 3 bone transform))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((s4-0 (new 'stack-no-clear 'quaternion)))
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
(matrix->quaternion (the-as quaternion s4-0) gp-0)
|
||||
(matrix->quaternion s4-0 gp-0)
|
||||
(vector-! s3-0 (camera-pos) (-> self root-override trans))
|
||||
(let ((v1-7 (-> gp-0 vector 2)))
|
||||
(set! (-> self angle-offset) (- (atan (-> v1-7 x) (-> v1-7 z))))
|
||||
)
|
||||
(quaternion-rotate-local-x! (the-as quaternion s4-0) (the-as quaternion s4-0) 16384.0)
|
||||
(quaternion-rotate-local-x! s4-0 s4-0 16384.0)
|
||||
(let ((f0-7 (+ (-> self angle-offset) (atan (-> s3-0 x) (-> s3-0 z)))))
|
||||
(quaternion-rotate-local-z! (the-as quaternion s4-0) (the-as quaternion s4-0) f0-7)
|
||||
(quaternion-rotate-local-z! s4-0 s4-0 f0-7)
|
||||
)
|
||||
)
|
||||
(quaternion-copy! *particle-quat* (the-as quaternion s4-0))
|
||||
(quaternion-copy! *particle-quat* s4-0)
|
||||
)
|
||||
(let ((s4-1 (-> *part-id-table* 2473))
|
||||
(s3-1 *sp-particle-system-3d*)
|
||||
@@ -491,8 +482,15 @@
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(if (not (should-display? self))
|
||||
(go-virtual hidden)
|
||||
(#if PC_PORT
|
||||
;; fix infinite state recursion
|
||||
(if (and (not (and (-> self been-kicked) (-> *pc-settings* fixes crash-sagecage))) (not (should-display? self)))
|
||||
(go-virtual hidden)
|
||||
)
|
||||
;; no fix
|
||||
(if (not (should-display? self))
|
||||
(go-virtual hidden)
|
||||
)
|
||||
)
|
||||
((-> (method-of-type process-taskable idle) trans))
|
||||
(none)
|
||||
@@ -616,7 +614,7 @@
|
||||
(dummy-40 obj arg0 *redsage-sg* 3 33 (new 'static 'vector :w 8192.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (-> obj entity extra perm task)))
|
||||
(play-reminder obj)
|
||||
(set! (-> obj sound-flava) (the-as uint 12))
|
||||
(set! (-> obj sound-flava) (music-flava sage-red))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
)
|
||||
@@ -735,7 +733,7 @@
|
||||
(dummy-40 obj arg0 *bluesage-sg* 3 54 (new 'static 'vector :w 8192.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (-> obj entity extra perm task)))
|
||||
(play-reminder obj)
|
||||
(set! (-> obj sound-flava) (the-as uint 13))
|
||||
(set! (-> obj sound-flava) (music-flava sage-blue))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
)
|
||||
@@ -849,7 +847,7 @@
|
||||
(dummy-40 obj arg0 *yellowsage-sg* 3 50 (new 'static 'vector :w 8192.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (-> obj entity extra perm task)))
|
||||
(play-reminder obj)
|
||||
(set! (-> obj sound-flava) (the-as uint 11))
|
||||
(set! (-> obj sound-flava) (music-flava sage-yellow))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
)
|
||||
@@ -1107,7 +1105,7 @@
|
||||
(when s5-1
|
||||
(format 0 "robotboss activated ent ~A~%" gp-0)
|
||||
(let ((f0-0 327680.0))
|
||||
(set! (-> (the-as robotboss s5-1) draw bounds w) f0-0)
|
||||
(set! (-> (the-as process-drawable s5-1) draw bounds w) f0-0)
|
||||
f0-0
|
||||
)
|
||||
)
|
||||
@@ -1243,7 +1241,7 @@
|
||||
0
|
||||
)
|
||||
)
|
||||
(set! (-> obj sound-flava) (the-as uint 5))
|
||||
(set! (-> obj sound-flava) (music-flava sage))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -81,14 +81,15 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod dummy-60 citb-bunny ((obj citb-bunny) (arg0 object))
|
||||
(defmethod dummy-60 citb-bunny ((obj citb-bunny))
|
||||
(initialize-skeleton obj *citb-bunny-sg* '())
|
||||
(set! (-> obj draw origin-joint-index) (the-as uint 3))
|
||||
(the-as symbol 0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod TODO-RENAME-48 citb-bunny ((obj citb-bunny) (arg0 object))
|
||||
(dummy-60 obj arg0)
|
||||
(dummy-60 obj)
|
||||
(TODO-RENAME-45 obj *citb-bunny-nav-enemy-info*)
|
||||
(set! (-> obj draw shadow-ctrl settings flags) (logand -9 (-> obj draw shadow-ctrl settings flags)))
|
||||
(cond
|
||||
@@ -101,7 +102,7 @@
|
||||
(set! (-> obj retreat-timeout) 0.1)
|
||||
)
|
||||
)
|
||||
(set! (-> obj last-nondangerous-time) (the-as uint (-> *display* base-frame-counter)))
|
||||
(set! (-> obj last-nondangerous-time) (-> *display* base-frame-counter))
|
||||
(set! (-> obj gnd-popup) 16384.0)
|
||||
(set! (-> obj got-jump-event?) #f)
|
||||
(set! (-> obj notice-land-anim) 8)
|
||||
@@ -122,29 +123,21 @@
|
||||
((zero? v1-0)
|
||||
(set! (-> obj jump-anim) 6)
|
||||
(set! (-> obj jump-height-min) 4096.0)
|
||||
(let ((f0-1 0.6))
|
||||
(set! (-> obj jump-height-factor) f0-1)
|
||||
f0-1
|
||||
)
|
||||
(set! (-> obj jump-height-factor) 0.6)
|
||||
)
|
||||
((= v1-0 1)
|
||||
(set! (-> obj jump-anim) 5)
|
||||
(set! (-> obj jump-height-min) 4096.0)
|
||||
(let ((f0-3 0.6))
|
||||
(set! (-> obj jump-height-factor) f0-3)
|
||||
f0-3
|
||||
)
|
||||
(set! (-> obj jump-height-factor) 0.6)
|
||||
)
|
||||
((= v1-0 2)
|
||||
(set! (-> obj jump-anim) 5)
|
||||
(set! (-> obj jump-height-min) 4096.0)
|
||||
(let ((f0-5 0.4))
|
||||
(set! (-> obj jump-height-factor) f0-5)
|
||||
f0-5
|
||||
)
|
||||
(set! (-> obj jump-height-factor) 0.4)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
;; name in dgo: citb-drop-plat
|
||||
;; dgos: CIT
|
||||
|
||||
(declare-type drop-plat process)
|
||||
(declare-type citb-drop-plat process)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(defskelgroup *citb-drop-plat-sg* citb-drop-plat
|
||||
@@ -418,27 +415,22 @@
|
||||
(set! sv-64 (the int (* 150.0 (rand-vu))))
|
||||
(set! sv-48 (get-process *default-dead-pool* drop-plat #x4000))
|
||||
(set! (-> self child-array data s1-0)
|
||||
(ppointer->handle (when sv-48
|
||||
(let ((t9-6 (method-of-type drop-plat activate)))
|
||||
(t9-6 (the-as drop-plat sv-48) self 'drop-plat (the-as pointer #x70004000))
|
||||
)
|
||||
(let ((t9-7 run-function-in-process)
|
||||
(a0-8 sv-48)
|
||||
(a1-5 drop-plat-init-by-other)
|
||||
(a2-4 gp-0)
|
||||
(t0-0 (-> self duration))
|
||||
)
|
||||
((the-as (function process function vector uint uint int) t9-7)
|
||||
a0-8
|
||||
a1-5
|
||||
a2-4
|
||||
(the-as uint sv-64)
|
||||
(the-as uint t0-0)
|
||||
)
|
||||
)
|
||||
(-> sv-48 ppointer)
|
||||
)
|
||||
)
|
||||
(ppointer->handle
|
||||
(when sv-48
|
||||
(let ((t9-6 (method-of-type drop-plat activate)))
|
||||
(t9-6 (the-as drop-plat sv-48) self 'drop-plat (the-as pointer #x70004000))
|
||||
)
|
||||
(let ((t9-7 run-function-in-process)
|
||||
(a0-8 sv-48)
|
||||
(a1-5 drop-plat-init-by-other)
|
||||
(a2-4 gp-0)
|
||||
(t0-0 (-> self duration))
|
||||
)
|
||||
((the-as (function process function vector int int int none) t9-7) a0-8 a1-5 a2-4 sv-64 t0-0 s0-0)
|
||||
)
|
||||
(-> sv-48 ppointer)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
(frustration-point vector :inline :offset-assert 208)
|
||||
(jump-dest vector :inline :offset-assert 224)
|
||||
(jump-trajectory trajectory :inline :offset-assert 240)
|
||||
(jump-time uint64 :offset-assert 280)
|
||||
(jump-time int64 :offset-assert 280)
|
||||
(nav-info nav-enemy-info :offset-assert 288)
|
||||
(target-speed float :offset-assert 292)
|
||||
(momentum-speed float :offset-assert 296)
|
||||
@@ -136,31 +136,31 @@
|
||||
(TODO-RENAME-48 (_type_) none 48)
|
||||
(TODO-RENAME-49 (_type_ nav-enemy-info) float 49)
|
||||
(TODO-RENAME-50 (_type_ vector) symbol 50)
|
||||
(dummy-51 (_type_) object 51)
|
||||
(dummy-51 (_type_) none 51)
|
||||
(dummy-52 (_type_ vector) symbol 52)
|
||||
(dummy-53 (_type_) symbol 53)
|
||||
(dummy-54 (_type_) none 54)
|
||||
(dummy-55 (_type_) none 55)
|
||||
(set-jump-height-factor! (_type_ int) float 56)
|
||||
(dummy-57 (_type_) vector 57)
|
||||
(dummy-58 (_type_) vector 58)
|
||||
(dummy-54 (_type_ vector) symbol 54)
|
||||
(dummy-55 (_type_) symbol 55)
|
||||
(set-jump-height-factor! (_type_ int) none 56)
|
||||
(dummy-57 (_type_) none 57)
|
||||
(dummy-58 (_type_) none 58)
|
||||
(TODO-RENAME-59 (_type_) none 59)
|
||||
(dummy-60 (_type_ object) symbol 60)
|
||||
(dummy-61 (_type_) none 61)
|
||||
(dummy-62 (_type_) none 62)
|
||||
(dummy-63 (_type_) none 63)
|
||||
(dummy-64 (_type_) none 64)
|
||||
(dummy-65 (_type_) none 65)
|
||||
(dummy-66 (_type_) none 66)
|
||||
(dummy-67 (_type_) symbol 67)
|
||||
(dummy-68 (_type_) none 68)
|
||||
(dummy-69 (_type_) none 69)
|
||||
(dummy-70 (_type_) none 70)
|
||||
(dummy-71 () _type_ :state 71)
|
||||
(dummy-60 (_type_ symbol) symbol 60)
|
||||
(snow-bunny-attack () _type_ :state 61)
|
||||
(snow-bunny-chase-hop () _type_ :state 62)
|
||||
(snow-bunny-defend () _type_ :state 63)
|
||||
(dummy-64 () _type_ :state 64)
|
||||
(snow-bunny-lunge () _type_ :state 65)
|
||||
(snow-bunny-nav-resume () _type_ :state 66)
|
||||
(snow-bunny-patrol-hop () _type_ :state 67)
|
||||
(snow-bunny-patrol-idle () _type_ :state 68)
|
||||
(dummy-69 () _type_ :state 69)
|
||||
(snow-bunny-retreat-hop () _type_ :state 70)
|
||||
(snow-bunny-tune-spheres () _type_ :state 71)
|
||||
(nav-enemy-touch-handler (_type_ process event-message-block) object 72)
|
||||
(nav-enemy-attack-handler (_type_ process event-message-block) object 73)
|
||||
(nav-enemy-jump-blocked () _type_ :state 74)
|
||||
(dummy-75 (_type_) none 75)
|
||||
(dummy-75 () _type_ :state 75)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
(set-collide-offense (-> obj collide-info) 2 (collide-offense touch))
|
||||
(set! (-> obj nav-enemy-flags) (logand -257 (-> obj nav-enemy-flags)))
|
||||
)
|
||||
(#unless TARGET_STARTUP_HACKS (dummy-14 (-> obj draw shadow-ctrl)))
|
||||
(dummy-14 (-> obj draw shadow-ctrl))
|
||||
(when *target*
|
||||
(if *target*
|
||||
(look-at-enemy!
|
||||
@@ -727,8 +727,7 @@ nav-enemy-default-event-handler
|
||||
(and (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance))
|
||||
(vector-vector-distance (-> obj collide-info trans) (camera-pos))
|
||||
)
|
||||
(or (#if TARGET_STARTUP_HACKS #t (logtest? (-> self draw status) (draw-status drwf03)))
|
||||
(!= (-> obj next-state name) 'nav-enemy-idle))
|
||||
(or (logtest? (-> obj draw status) (draw-status drwf03)) (!= (-> obj next-state name) 'nav-enemy-idle))
|
||||
)
|
||||
)
|
||||
(and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel)))
|
||||
@@ -769,7 +768,7 @@ nav-enemy-default-event-handler
|
||||
)
|
||||
(>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout))
|
||||
(nonzero? (-> self draw))
|
||||
(#if TARGET_STARTUP_HACKS #t (logtest? (-> self draw status) (draw-status drwf03)))
|
||||
(logtest? (-> self draw status) (draw-status drwf03))
|
||||
)
|
||||
(go-virtual nav-enemy-patrol)
|
||||
)
|
||||
@@ -833,8 +832,7 @@ nav-enemy-default-event-handler
|
||||
(behavior ()
|
||||
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30)
|
||||
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout))
|
||||
(if (and (nonzero? (-> self draw))
|
||||
(#if TARGET_STARTUP_HACKS #t (logtest? (-> self draw status) (draw-status drwf03))))
|
||||
(if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status drwf03)))
|
||||
(set! (-> self free-time) (-> *display* base-frame-counter))
|
||||
)
|
||||
(if (or (or (not *target*) (< (-> self enemy-info idle-distance)
|
||||
@@ -1611,7 +1609,7 @@ nav-enemy-default-event-handler
|
||||
)
|
||||
)
|
||||
(when (logtest? (-> self nav-enemy-flags) 8)
|
||||
(let ((f30-0 (the float (- (-> *display* base-frame-counter) (the-as int (-> self jump-time))))))
|
||||
(let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self jump-time)))))
|
||||
(let ((v1-12 (eval-position! (-> self jump-trajectory) f30-0 (new 'stack-no-clear 'vector))))
|
||||
(set! (-> self collide-info trans quad) (-> v1-12 quad))
|
||||
)
|
||||
@@ -1698,7 +1696,7 @@ nav-enemy-default-event-handler
|
||||
)
|
||||
)
|
||||
(set! (-> self collide-info status) (logand -8 (-> self collide-info status)))
|
||||
(set! (-> self jump-time) (the-as uint (-> *display* base-frame-counter)))
|
||||
(set! (-> self jump-time) (-> *display* base-frame-counter))
|
||||
(logior! (-> self nav-enemy-flags) 8)
|
||||
(cond
|
||||
((logtest? (-> self nav-enemy-flags) 1024)
|
||||
@@ -1742,9 +1740,7 @@ nav-enemy-default-event-handler
|
||||
)
|
||||
)
|
||||
)
|
||||
(while (< (the float (- (-> *display* base-frame-counter) (the-as int (-> self jump-time))))
|
||||
(-> self jump-trajectory time)
|
||||
)
|
||||
(while (< (the float (- (-> *display* base-frame-counter) (-> self jump-time))) (-> self jump-trajectory time))
|
||||
(suspend)
|
||||
(let ((a0-36 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-36 param 0) (the float (+ (-> a0-36 frame-group data 0 length) -1)))
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
;; name in dgo: plat-eco
|
||||
;; dgos: GAME, COMMON, L1
|
||||
|
||||
;; TODO - for citb-plat
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype plat-eco (plat)
|
||||
((notice-dist float :offset-assert 264)
|
||||
(sync-offset-dest float :offset-assert 268)
|
||||
@@ -15,8 +16,332 @@
|
||||
(unlit-look lod-set :inline :offset-assert 288)
|
||||
(lit-look lod-set :inline :offset-assert 324)
|
||||
)
|
||||
:heap-base #x100
|
||||
:method-count-assert 33
|
||||
:size-assert #x165
|
||||
:heap-base #x100
|
||||
:flag-assert #x2101000165
|
||||
(:methods
|
||||
(notice-blue (handle) _type_ :replace :state 29)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(defskelgroup *plat-eco-unlit-sg* plat-eco
|
||||
0
|
||||
8
|
||||
((1 (meters 20)) (2 (meters 40)) (3 (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 3)
|
||||
:longest-edge (meters 0)
|
||||
)
|
||||
|
||||
(defskelgroup *plat-eco-lit-sg* plat-eco
|
||||
0
|
||||
8
|
||||
((5 (meters 20)) (6 (meters 40)) (7 (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 3)
|
||||
:longest-edge (meters 0)
|
||||
)
|
||||
|
||||
(defstate plat-idle (plat-eco)
|
||||
:virtual #t
|
||||
:event
|
||||
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
(case arg2
|
||||
(('wake)
|
||||
(go-virtual plat-path-active (the-as plat #f))
|
||||
)
|
||||
(('eco-blue)
|
||||
(go-virtual notice-blue (process->handle arg0))
|
||||
)
|
||||
(('ridden 'edge-grabbed)
|
||||
(let ((a1-6 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> a1-6 from) self)
|
||||
(set! (-> a1-6 num-params) 2)
|
||||
(set! (-> a1-6 message) 'query)
|
||||
(set! (-> a1-6 param 0) (the-as uint 'powerup))
|
||||
(set! (-> a1-6 param 1) (the-as uint 3))
|
||||
(when (send-event-function *target* a1-6)
|
||||
(send-to-all (-> self link) 'wake)
|
||||
(go-virtual plat-path-active (the-as plat #f))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
:enter
|
||||
(behavior ()
|
||||
(lods-assign! (-> self draw) (-> self unlit-look))
|
||||
(none)
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(when (and (and *target*
|
||||
(>= (-> self notice-dist) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))
|
||||
)
|
||||
(send-event *target* 'query 'powerup 3)
|
||||
)
|
||||
(send-to-all (-> self link) 'wake)
|
||||
(go-virtual plat-path-active (the-as plat #f))
|
||||
)
|
||||
(if (and *target*
|
||||
(>= (-> self notice-dist) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))
|
||||
)
|
||||
(level-hint-spawn
|
||||
(game-text-id daxter-blue-eco-plat-tutorial)
|
||||
"sksp0073"
|
||||
(the-as entity #f)
|
||||
*entity-pool*
|
||||
(game-task none)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(ja-post)
|
||||
(update-transforms! (-> self root-override))
|
||||
(anim-loop)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(the-as (function none :behavior plat-eco) ja-post)
|
||||
)
|
||||
|
||||
(defstate notice-blue (plat-eco)
|
||||
:virtual override
|
||||
:event
|
||||
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
(case arg2
|
||||
(('wake)
|
||||
(sound-play-by-name
|
||||
(static-sound-name "blue-eco-on")
|
||||
(new-sound-id)
|
||||
1024
|
||||
0
|
||||
0
|
||||
1
|
||||
(the-as symbol (-> self root-override trans))
|
||||
)
|
||||
(go-virtual plat-path-active (the-as plat #f))
|
||||
)
|
||||
(('ridden 'edge-grabbed)
|
||||
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> a1-3 from) self)
|
||||
(set! (-> a1-3 num-params) 2)
|
||||
(set! (-> a1-3 message) 'query)
|
||||
(set! (-> a1-3 param 0) (the-as uint 'powerup))
|
||||
(set! (-> a1-3 param 1) (the-as uint 3))
|
||||
(when (send-event-function *target* a1-3)
|
||||
(send-to-all (-> self link) 'wake)
|
||||
(go-virtual plat-path-active (the-as plat #f))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
((-> (method-of-object self plat-idle) trans))
|
||||
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> a1-0 from) self)
|
||||
(set! (-> a1-0 num-params) 2)
|
||||
(set! (-> a1-0 message) 'query)
|
||||
(set! (-> a1-0 param 0) (the-as uint 'powerup))
|
||||
(set! (-> a1-0 param 1) (the-as uint 3))
|
||||
(if (and (not (send-event-function *target* a1-0))
|
||||
(begin (logior! (-> self mask) (process-mask sleep-code)) (not (-> self bouncing)))
|
||||
)
|
||||
(go-virtual plat-idle)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ((arg0 handle))
|
||||
(set! (-> self target) arg0)
|
||||
(while #t
|
||||
(let* ((gp-0 (handle->process (-> self target)))
|
||||
(v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable))
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(when v1-4
|
||||
(let* ((gp-1 (-> (the-as process-drawable v1-4) root))
|
||||
(v1-6 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape))
|
||||
gp-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(when v1-6
|
||||
(let* ((s5-0 (-> self root-override root-prim prim-core))
|
||||
(a1-3 (-> (the-as collide-shape v1-6) root-prim prim-core))
|
||||
(f30-0 (vector-vector-distance (the-as vector s5-0) (the-as vector a1-3)))
|
||||
)
|
||||
(when (rand-vu-percent? 0.5)
|
||||
(let ((gp-2 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> gp-2 quad) (-> s5-0 world-sphere quad))
|
||||
(dotimes (s5-1 3)
|
||||
(+! (-> gp-2 data s5-1) (rand-vu-float-range -5324.8 5324.8))
|
||||
)
|
||||
(eco-blue-glow gp-2)
|
||||
)
|
||||
)
|
||||
(set! (-> self bouncing) #t)
|
||||
(activate!
|
||||
(-> self smush)
|
||||
(lerp-scale
|
||||
(rand-vu-float-range 1.1 1.3)
|
||||
(rand-vu-float-range 1.0 1.02)
|
||||
f30-0
|
||||
(-> *FACT-bank* suck-suck-dist)
|
||||
(-> *FACT-bank* suck-bounce-dist)
|
||||
)
|
||||
60
|
||||
60
|
||||
1.0
|
||||
1.0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(suspend)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(behavior ()
|
||||
(plat-trans)
|
||||
(plat-post)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defstate plat-path-active (plat-eco)
|
||||
:virtual #t
|
||||
:enter
|
||||
(behavior ((arg0 plat))
|
||||
(lods-assign! (-> self draw) (-> self lit-look))
|
||||
(sync-now! (-> self sync) (-> self sync-linear-val))
|
||||
(set! (-> self sync-offset-faux) (-> self sync offset))
|
||||
(let* ((f0-3 (the float (-> self sync period)))
|
||||
(f1-1 (* 0.5 f0-3))
|
||||
)
|
||||
(if (< f1-1 (- (-> self sync-offset-dest) (-> self sync-offset-faux)))
|
||||
(+! (-> self sync-offset-faux) f0-3)
|
||||
)
|
||||
(if (< f1-1 (- (-> self sync-offset-faux) (-> self sync-offset-dest)))
|
||||
(set! (-> self sync-offset-faux) (- (-> self sync-offset-faux) f0-3))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
(arg0
|
||||
(let ((f0-5 (-> self sync-offset-dest)))
|
||||
(set! (-> self sync offset) f0-5)
|
||||
(set! (-> self sync-offset-faux) f0-5)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(process-entity-status! self (entity-perm-status complete) #t)
|
||||
(dotimes (gp-1 5)
|
||||
(spawn-projectile-blue *target*)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(when (!= (-> self sync-offset-faux) (-> self sync-offset-dest))
|
||||
(set! (-> self sync-offset-faux)
|
||||
(seek (-> self sync-offset-faux) (-> self sync-offset-dest) (* 12.0 (-> *display* seconds-per-frame)))
|
||||
)
|
||||
(let* ((f0-7 (the float (-> self sync period)))
|
||||
(f1-3 (+ (-> self sync-offset-faux) f0-7))
|
||||
)
|
||||
(set! (-> self sync offset) (- f1-3 (* (the float (the int (/ f1-3 f0-7))) f0-7)))
|
||||
)
|
||||
)
|
||||
((-> (method-of-type plat plat-path-active) trans))
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod dummy-24 plat-eco ((obj plat-eco))
|
||||
(let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
|
||||
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
|
||||
(set! (-> s5-0 reaction) default-collision-reaction)
|
||||
(set! (-> s5-0 no-reaction)
|
||||
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
|
||||
)
|
||||
(alloc-riders s5-0 1)
|
||||
(let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
|
||||
(set! (-> s4-0 prim-core collide-as) (collide-kind ground-object blue-eco-suck))
|
||||
(set! (-> s4-0 collide-with) (collide-kind target))
|
||||
(set! (-> s4-0 prim-core action) (collide-action solid ca-1))
|
||||
(set! (-> s4-0 prim-core offense) (collide-offense indestructible))
|
||||
(set! (-> s4-0 transform-index) 0)
|
||||
(set-vector! (-> s4-0 local-sphere) 0.0 -1228.8 0.0 13926.4)
|
||||
(set-root-prim! s5-0 s4-0)
|
||||
)
|
||||
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
||||
(backup-collide-with-as s5-0)
|
||||
(set! (-> obj root-override) s5-0)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod get-unlit-skel plat-eco ((obj plat-eco))
|
||||
*plat-eco-unlit-sg*
|
||||
)
|
||||
|
||||
(defmethod get-lit-skel plat-eco ((obj plat-eco))
|
||||
*plat-eco-lit-sg*
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! plat-eco ((obj plat-eco) (arg0 entity-actor))
|
||||
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
|
||||
(set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default -1.0))
|
||||
(set! (-> obj link) (new 'process 'actor-link-info obj))
|
||||
(dummy-24 obj)
|
||||
(process-drawable-from-entity! obj arg0)
|
||||
(let ((s4-0 (get-unlit-skel obj))
|
||||
(s5-1 (get-lit-skel obj))
|
||||
)
|
||||
(initialize-skeleton obj s4-0 '())
|
||||
(dummy-9 (-> obj unlit-look) s4-0 (-> obj draw art-group) (-> obj entity))
|
||||
(dummy-9 (-> obj lit-look) s5-1 (-> obj draw art-group) (-> obj entity))
|
||||
)
|
||||
(logclear! (-> obj mask) (process-mask actor-pause))
|
||||
(update-transforms! (-> obj root-override))
|
||||
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 107) obj))
|
||||
(set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0))
|
||||
(logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text))
|
||||
(set! (-> obj fact)
|
||||
(new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc))
|
||||
)
|
||||
(load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15)
|
||||
(set! (-> obj sync-offset-dest) (-> obj sync offset))
|
||||
(set! (-> obj sync-linear-val) (get-phase-offset (-> obj sync)))
|
||||
(sync-now! (-> obj sync) (-> obj sync-linear-val))
|
||||
(set! (-> obj sync-offset-faux) (-> obj sync offset))
|
||||
(set! (-> obj path-pos) (get-current-phase-with-mirror (-> obj sync)))
|
||||
(eval-path-curve! (-> obj path) (-> obj root-override trans) (-> obj path-pos) 'interp)
|
||||
(set! (-> obj sound-id) (new-sound-id))
|
||||
(dummy-26 obj)
|
||||
(dummy-21 obj)
|
||||
(if (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
|
||||
(< (-> obj notice-dist) 0.0)
|
||||
)
|
||||
(go (method-of-object obj plat-path-active) (the-as plat #t))
|
||||
(go (method-of-object obj plat-idle))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: snow-bunny.gc
|
||||
;; name in dgo: snow-bunny
|
||||
;; dgos: CIT, L1, SNO
|
||||
|
||||
(deftype snow-bunny (nav-enemy)
|
||||
((patrol-rand-distraction int32 :offset-assert 400)
|
||||
(base-hop-dist float :offset-assert 404)
|
||||
(halfway-dist float :offset-assert 408)
|
||||
(retreat-timeout float :offset-assert 412)
|
||||
(gnd-popup float :offset-assert 416)
|
||||
(jump-height-min float :offset-assert 420)
|
||||
(jump-height-factor float :offset-assert 424)
|
||||
(jump-anim-start-frame float :offset-assert 428)
|
||||
(defense uint64 :offset-assert 432)
|
||||
(retreat-timeout-time uint64 :offset-assert 440)
|
||||
(last-nondangerous-time uint64 :offset-assert 448)
|
||||
(patrol-hop-failed? basic :offset-assert 456)
|
||||
(should-retreat? basic :offset-assert 460)
|
||||
(got-jump-event? basic :offset-assert 464)
|
||||
(using-jump-event? basic :offset-assert 468)
|
||||
(jump-anim int8 :offset-assert 472)
|
||||
(notice-land-anim int8 :offset-assert 473)
|
||||
(attack-anim int8 :offset-assert 474)
|
||||
(final-dest vector :inline :offset-assert 480)
|
||||
(jump-event-dest vector :inline :offset-assert 496)
|
||||
)
|
||||
:method-count-assert 77
|
||||
:size-assert #x200
|
||||
:heap-base #x190
|
||||
:flag-assert #x4d01900200
|
||||
(:methods
|
||||
(dummy-76 () none 76))
|
||||
)
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
;; name in dgo: ticky
|
||||
;; dgos: GAME, COMMON, L1
|
||||
|
||||
;; definition of type ticky
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype ticky (structure)
|
||||
((delay-til-ramp int64 :offset-assert 0)
|
||||
(delay-til-timeout int64 :offset-assert 8)
|
||||
@@ -16,71 +17,53 @@
|
||||
:size-assert #x20
|
||||
:flag-assert #xc00000020
|
||||
(:methods
|
||||
(sleep (_type_ uint) none 9)
|
||||
(reached-delay? (_type_ uint) symbol 10)
|
||||
(sleep (_type_ int) none 9)
|
||||
(reached-delay? (_type_ int) symbol 10)
|
||||
(completed? (_type_) symbol 11)
|
||||
)
|
||||
)
|
||||
;; definition for method 9 of type ticky
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod sleep ticky ((obj ticky) (arg0 uint))
|
||||
|
||||
|
||||
(defmethod sleep ticky ((obj ticky) (arg0 int))
|
||||
(set! (-> obj starting-time) (-> *display* base-frame-counter))
|
||||
(set! (-> obj delay-til-timeout) (the-as int arg0))
|
||||
(set!
|
||||
(-> obj delay-til-ramp)
|
||||
(the-as int (max 0 (the-as int (+ arg0 -1200))))
|
||||
)
|
||||
(set! (-> obj delay-til-timeout) arg0)
|
||||
(set! (-> obj delay-til-ramp) (max 0 (+ arg0 -1200)))
|
||||
(set! (-> obj last-tick-time) 0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 11 of type ticky
|
||||
(defmethod completed? ticky ((obj ticky))
|
||||
(let ((gp-0 #f))
|
||||
(let ((v1-2 (- (-> *display* base-frame-counter) (-> obj starting-time))))
|
||||
(cond
|
||||
((>= v1-2 (-> obj delay-til-timeout))
|
||||
(set! gp-0 #t)
|
||||
)
|
||||
(else
|
||||
(let*
|
||||
((f0-1
|
||||
(fmin
|
||||
1.0
|
||||
(/
|
||||
(the float (max 0 (- v1-2 (-> obj delay-til-ramp))))
|
||||
(the float (- (-> obj delay-til-timeout) (-> obj delay-til-ramp)))
|
||||
)
|
||||
(let ((v1-2 (- (-> *display* base-frame-counter) (-> obj starting-time))))
|
||||
(cond
|
||||
((>= v1-2 (-> obj delay-til-timeout))
|
||||
(set! gp-0 #t)
|
||||
)
|
||||
(else
|
||||
(let* ((f0-1 (fmin 1.0 (/ (the float (max 0 (- v1-2 (-> obj delay-til-ramp))))
|
||||
(the float (- (-> obj delay-til-timeout) (-> obj delay-til-ramp)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(v1-7 (the int (lerp 105.0 41.0 f0-1)))
|
||||
)
|
||||
(when (>= (- (-> *display* base-frame-counter) (-> obj last-tick-time)) v1-7)
|
||||
(set! (-> obj last-tick-time) (-> *display* base-frame-counter))
|
||||
(sound-play-by-name (static-sound-name "stopwatch") (new-sound-id) 1024 0 0 1 #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(v1-7 (the int (lerp 105.0 41.0 f0-1)))
|
||||
)
|
||||
(when
|
||||
(>= (- (-> *display* base-frame-counter) (-> obj last-tick-time)) v1-7)
|
||||
(set! (-> obj last-tick-time) (-> *display* base-frame-counter))
|
||||
(sound-play-by-name
|
||||
(static-sound-name "stopwatch")
|
||||
(new-sound-id)
|
||||
1024
|
||||
0
|
||||
0
|
||||
1
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type ticky
|
||||
(defmethod reached-delay? ticky ((obj ticky) (arg0 uint))
|
||||
(>=
|
||||
(- (-> *display* base-frame-counter) (-> obj starting-time))
|
||||
(the-as int arg0)
|
||||
)
|
||||
(defmethod reached-delay? ticky ((obj ticky) (arg0 int))
|
||||
(>= (- (-> *display* base-frame-counter) (-> obj starting-time)) arg0)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
(glow-u float :offset-assert 184)
|
||||
(glow-wf-period int32 :offset-assert 188)
|
||||
(glow-wf-offset int32 :offset-assert 192)
|
||||
(prev-compute-glow-time uint64 :offset-assert 200)
|
||||
(start-fade-time uint64 :offset-assert 208)
|
||||
(end-fade-time uint64 :offset-assert 216)
|
||||
(activated-time uint64 :offset-assert 224)
|
||||
(last-updated-user-lighting uint64 :offset-assert 232)
|
||||
(prev-compute-glow-time int64 :offset-assert 200)
|
||||
(start-fade-time int64 :offset-assert 208)
|
||||
(end-fade-time int64 :offset-assert 216)
|
||||
(activated-time int64 :offset-assert 224)
|
||||
(last-updated-user-lighting int64 :offset-assert 232)
|
||||
(player-attack-id uint64 :offset-assert 240)
|
||||
(on-color-mult vector :inline :offset-assert 256)
|
||||
(on-color-emissive vector :inline :offset-assert 272)
|
||||
@@ -54,7 +54,7 @@
|
||||
(when (-> obj is-master?)
|
||||
(let ((v1-2 (-> *display* base-frame-counter)))
|
||||
(when (!= (-> obj last-updated-user-lighting) v1-2)
|
||||
(set! (-> obj last-updated-user-lighting) (the-as uint v1-2))
|
||||
(set! (-> obj last-updated-user-lighting) v1-2)
|
||||
(execute-connections *cavecrystal-light-control*)
|
||||
)
|
||||
)
|
||||
@@ -63,8 +63,8 @@
|
||||
)
|
||||
|
||||
(defmethod compute-glow cavecrystal ((obj cavecrystal))
|
||||
(set! (-> obj prev-compute-glow-time) (the-as uint (-> *display* game-frame-counter)))
|
||||
(let* ((gp-1 (max 1 (the-as int (+ (- 1 (the-as int (-> obj activated-time))) (-> *display* game-frame-counter)))))
|
||||
(set! (-> obj prev-compute-glow-time) (-> *display* game-frame-counter))
|
||||
(let* ((gp-1 (max 1 (+ (- 1 (-> obj activated-time)) (-> *display* game-frame-counter))))
|
||||
(f0-2
|
||||
(/ (the float (mod (+ (-> *display* base-frame-counter) (-> obj glow-wf-offset)) (-> obj glow-wf-period)))
|
||||
(the float (-> obj glow-wf-period))
|
||||
@@ -73,17 +73,17 @@
|
||||
(f30-1 (* 0.1 (cos (* 65536.0 f0-2))))
|
||||
)
|
||||
(cond
|
||||
((>= 20 (the-as int gp-1))
|
||||
((>= 20 gp-1)
|
||||
(let ((v1-11 (* 0.05 (the float gp-1))))
|
||||
(fmax 0.0 (fmin 2.0 (+ (* 2.0 v1-11) (* v1-11 f30-1))))
|
||||
)
|
||||
)
|
||||
((>= 180 (the-as int gp-1))
|
||||
((>= 180 gp-1)
|
||||
(let ((a2-0 (* 0.00625 (the float (+ gp-1 -20)))))
|
||||
(fmin 2.0 (+ (lerp 2.0 1.0 a2-0) f30-1))
|
||||
)
|
||||
)
|
||||
((>= (the-as int (-> obj start-fade-time)) (the-as int gp-1))
|
||||
((>= (-> obj start-fade-time) gp-1)
|
||||
(+ 1.0 f30-1)
|
||||
)
|
||||
(else
|
||||
@@ -136,7 +136,7 @@
|
||||
(cond
|
||||
((!= v1-1 (-> self player-attack-id))
|
||||
(set! (-> self player-attack-id) v1-1)
|
||||
(set! (-> self activated-time) (the-as uint (-> *display* game-frame-counter)))
|
||||
(set! (-> self activated-time) (-> *display* game-frame-counter))
|
||||
#t
|
||||
)
|
||||
(else
|
||||
@@ -151,8 +151,8 @@
|
||||
:enter
|
||||
(behavior ()
|
||||
(logclear! (-> self mask) (process-mask actor-pause))
|
||||
(set! (-> self activated-time) (the-as uint (-> *display* game-frame-counter)))
|
||||
(set! (-> self prev-compute-glow-time) (the-as uint (-> *display* game-frame-counter)))
|
||||
(set! (-> self activated-time) (-> *display* game-frame-counter))
|
||||
(set! (-> self prev-compute-glow-time) (-> *display* game-frame-counter))
|
||||
(none)
|
||||
)
|
||||
:exit
|
||||
@@ -223,7 +223,7 @@
|
||||
(defmethod init-from-entity! cavecrystal ((obj cavecrystal) (arg0 entity-actor))
|
||||
(set! (-> obj glow-u) 0.0)
|
||||
(set! (-> obj player-attack-id) (the-as uint 0))
|
||||
(set! (-> obj last-updated-user-lighting) (the-as uint 0))
|
||||
(set! (-> obj last-updated-user-lighting) 0)
|
||||
(set-vector! (-> obj off-color-mult) 0.0 0.0 0.0 1.0)
|
||||
(set-vector! (-> obj off-color-emissive) 0.0 0.0 0.0 0.0)
|
||||
(set-vector! (-> obj on-color-mult) 1.0 1.0 1.0 1.0)
|
||||
@@ -250,9 +250,7 @@
|
||||
(if (-> obj is-master?)
|
||||
(logclear! (-> obj mask) (process-mask actor-pause))
|
||||
)
|
||||
(set! (-> obj start-fade-time)
|
||||
(the-as uint (the int (* 300.0 (res-lump-float (-> obj entity) 'timeout :default 8.0))))
|
||||
)
|
||||
(set! (-> obj start-fade-time) (the int (* 300.0 (res-lump-float (-> obj entity) 'timeout :default 8.0))))
|
||||
(process-drawable-from-entity! obj arg0)
|
||||
(initialize-skeleton obj *cavecrystal-sg* '())
|
||||
(nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f))
|
||||
|
||||
@@ -475,9 +475,9 @@
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(set! (-> self played-sound?) #f)
|
||||
(set! (-> self sound-delay) (nav-enemy-rnd-int-range 30 150))
|
||||
(let ((f0-1 (- (-> self appear-dest x) (-> (the-as robotboss (-> self parent 0)) root-override trans x))))
|
||||
(let ((f0-1 (- (-> self appear-dest x) (-> (the-as green-eco-lurker-gen (-> self parent 0)) root trans x))))
|
||||
(set! (-> self collide-info trans x)
|
||||
(+ (-> (the-as robotboss (-> self parent 0)) root-override trans x) (fmax -32768.0 (fmin 32768.0 f0-1)))
|
||||
(+ (-> (the-as green-eco-lurker-gen (-> self parent 0)) root trans x) (fmax -32768.0 (fmin 32768.0 f0-1)))
|
||||
)
|
||||
)
|
||||
(logior! (-> self collide-info nav-flags) 2)
|
||||
|
||||
@@ -1171,7 +1171,7 @@
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status need-hint) (task-status need-introduction))
|
||||
(when arg0
|
||||
(set! (-> obj blend-on-exit) #t)
|
||||
(set! (-> obj blend-on-exit) (the-as art-joint-anim #t))
|
||||
(close-status! (-> obj tasks) (task-status need-introduction))
|
||||
(set! (-> obj training) #t)
|
||||
)
|
||||
@@ -1213,7 +1213,7 @@
|
||||
)
|
||||
(((task-status need-reminder-a) (task-status need-reminder))
|
||||
(set! (-> obj skippable) #t)
|
||||
(set! (-> obj blend-on-exit) #t)
|
||||
(set! (-> obj blend-on-exit) (the-as art-joint-anim #t))
|
||||
(new 'static 'spool-anim :name "fisher-reminder-1" :index 10 :parts 1 :command-list '())
|
||||
)
|
||||
(((task-status need-reward-speech))
|
||||
@@ -2255,14 +2255,10 @@
|
||||
(send-event
|
||||
(ppointer->process (-> self manipy))
|
||||
'eval
|
||||
(lambda :behavior target
|
||||
(lambda :behavior manipy
|
||||
()
|
||||
(set! (-> self attack-info vector x)
|
||||
(the-as float (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) self 6))
|
||||
)
|
||||
(set! (-> self attack-info vector y)
|
||||
(the-as float (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) self 5))
|
||||
)
|
||||
(set! (-> self joint 0) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) self 6))
|
||||
(set! (-> self joint 1) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) self 5))
|
||||
(none)
|
||||
)
|
||||
)
|
||||
@@ -2302,22 +2298,17 @@
|
||||
(joint-control-channel-group-eval! a0-28 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(when (-> self manipy)
|
||||
(let ((s2-0 (new-stack-quaternion0))
|
||||
(s4-0 (new-stack-quaternion0))
|
||||
(let ((s2-0 (new-stack-vector0))
|
||||
(s4-0 (new-stack-vector0))
|
||||
(s3-0 (quaternion-identity! (new-stack-quaternion0)))
|
||||
(f30-0 (update! (-> self control unknown-smush00)))
|
||||
)
|
||||
(quaternion-rotate-y! s3-0 s3-0 (* 5461.3335 f30-0))
|
||||
(set-vector! s2-0 1.0 1.0 1.0 1.0)
|
||||
(set-vector! s4-0 0.0 (* 2048.0 (-> s5-2 y)) (* 819.2 (-> s5-2 y)) 1.0)
|
||||
(initialize-skeleton (-> self manipy 0 joint 0) (the-as skeleton-group s4-0) (the-as pair s3-0))
|
||||
(set-trs! (-> self manipy 0 joint 0) s4-0 s3-0 s2-0)
|
||||
(set-vector! s4-0 0.0 (* -614.4 f30-0) 0.0 1.0)
|
||||
(let* ((a0-34 (-> self manipy 0 joint 1))
|
||||
(t9-16 (method-of-object a0-34 initialize-skeleton))
|
||||
(a2-7 #f)
|
||||
)
|
||||
(t9-16 a0-34 (the-as skeleton-group s4-0) (the-as pair a2-7))
|
||||
)
|
||||
(set-trs! (-> self manipy 0 joint 1) s4-0 (the-as quaternion #f) (the-as vector #f))
|
||||
(set! (-> s5-2 y) (-> s5-2 x))
|
||||
(set! (-> s5-2 x) f30-0)
|
||||
)
|
||||
|
||||
@@ -972,31 +972,24 @@
|
||||
(cond
|
||||
(gp-0
|
||||
(set! (-> self next-reflector-trans quad) (-> gp-0 extra trans quad))
|
||||
(let ((f0-3 (+ (-> self next-reflector-trans y) (res-lump-float gp-0 'height-info))))
|
||||
(set! (-> self next-reflector-trans y) f0-3)
|
||||
f0-3
|
||||
)
|
||||
(+! (-> self next-reflector-trans y) (res-lump-float gp-0 'height-info))
|
||||
)
|
||||
(else
|
||||
(let ((v1-9 (res-lump-struct (-> self entity) 'alt-vector structure))
|
||||
(v0-2 (the-as object (-> self next-reflector-trans)))
|
||||
)
|
||||
(set! (-> (the-as vector v0-2) quad) (-> (the-as vector v1-9) quad))
|
||||
v0-2
|
||||
(let ((v1-9 (res-lump-struct (-> self entity) 'alt-vector structure)))
|
||||
(set! (-> self next-reflector-trans quad) (-> (the-as vector v1-9) quad))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defbehavior periscope-set-target-direction periscope ((arg0 vector))
|
||||
(let ((f30-0 (vector-xz-length arg0)))
|
||||
(set! (-> self target-turn) (atan (-> arg0 x) (-> arg0 z)))
|
||||
(let ((f0-5 (atan (- (-> arg0 y)) f30-0)))
|
||||
(set! (-> self target-tilt) f0-5)
|
||||
f0-5
|
||||
)
|
||||
(set! (-> self target-tilt) (atan (- (-> arg0 y)) f30-0))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defbehavior periscope-find-aim-at-angles periscope ()
|
||||
@@ -1012,6 +1005,7 @@
|
||||
(periscope-set-target-direction s5-0)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defbehavior periscope-find-reflection-angles periscope ()
|
||||
@@ -1036,6 +1030,7 @@
|
||||
(periscope-set-target-direction s4-0)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defbehavior periscope-has-power-input? periscope ()
|
||||
@@ -1081,10 +1076,10 @@
|
||||
(quaternion-zxy! (-> self root-override quat) (the-as vector a1-0))
|
||||
)
|
||||
(set! (-> self root-override trans y) (+ -184320.0 (-> self y-offset) (-> self base y)))
|
||||
(let ((f0-10 (+ (- (+ (-> self base y) (-> self y-offset)) (-> self height)) (-> self y-offset-grips))))
|
||||
(set! (-> self grips transform trans y) f0-10)
|
||||
f0-10
|
||||
)
|
||||
(set! (-> self grips transform trans y)
|
||||
(+ (- (+ (-> self base y) (-> self y-offset)) (-> self height)) (-> self y-offset-grips))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defbehavior periscope-post periscope ()
|
||||
@@ -1119,7 +1114,7 @@
|
||||
(defbehavior peri-beamcam-init-by-other process ((arg0 string))
|
||||
(let ((gp-0 (entity-by-name "junglecam-1")))
|
||||
(the-as
|
||||
(pointer process)
|
||||
(pointer pov-camera)
|
||||
(cond
|
||||
(gp-0
|
||||
(cond
|
||||
|
||||
@@ -1399,7 +1399,132 @@
|
||||
|
||||
(defstate plant-boss-intro (plant-boss)
|
||||
:code
|
||||
(behavior () (none)) ;; todo
|
||||
(behavior ()
|
||||
(set-setting! *setting-control* self 'music 'danger (-> (new 'static 'array float 1 0.0) 0) 0)
|
||||
(send-event *target* 'reset-pickup 'eco)
|
||||
(let ((v1-9 (-> self entity extra perm)))
|
||||
(logior! (-> v1-9 status) (entity-perm-status user-set-from-cstage))
|
||||
(b! (zero? (-> v1-9 user-int8 2)) cfg-5 :delay (empty-form))
|
||||
)
|
||||
(ja-channel-push! 1 150)
|
||||
(let ((gp-0 (-> self skel root-channel 0)))
|
||||
(joint-control-channel-group-eval!
|
||||
gp-0
|
||||
(the-as art-joint-anim (-> self draw art-group data 10))
|
||||
num-func-identity
|
||||
)
|
||||
(set! (-> gp-0 frame-num) (ja-aframe (the-as float 510.0) 0))
|
||||
)
|
||||
(b! #t cfg-3 :delay (nop!))
|
||||
(label cfg-2)
|
||||
(set! (-> self energy)
|
||||
(seek (-> self energy) (-> (new 'static 'array float 1 1.0) 0) (* 2.0 (-> *display* seconds-per-frame)))
|
||||
)
|
||||
(suspend)
|
||||
(label cfg-3)
|
||||
(let ((v1-22 (-> self skel channel)))
|
||||
(b! (!= (-> self skel root-channel 0) v1-22) cfg-2 :delay (nop!))
|
||||
)
|
||||
(set-mode! (-> self neck) (joint-mod-handler-mode world-look-at))
|
||||
(set-mode! (-> self body) (joint-mod-handler-mode world-look-at))
|
||||
(b! #t cfg-17 :delay (nop!))
|
||||
(label cfg-5)
|
||||
(when (not (handle->process (-> self cam-tracker)))
|
||||
(let ((gp-1 (get-process *default-dead-pool* camera-tracker #x4000)))
|
||||
(set! (-> self cam-tracker)
|
||||
(ppointer->handle (when gp-1
|
||||
(let ((t9-9 (method-of-type camera-tracker activate)))
|
||||
(t9-9 (the-as camera-tracker gp-1) self 'camera-tracker (the-as pointer #x70004000))
|
||||
)
|
||||
(run-now-in-process
|
||||
gp-1
|
||||
camera-tracker-init
|
||||
(lambda :behavior camera-tracker
|
||||
()
|
||||
(while (not (process-grab? *target*))
|
||||
(suspend)
|
||||
)
|
||||
(ambient-hint-spawn "gamcam28" (the-as vector #f) *entity-pool* 'ambient)
|
||||
(send-event *camera* 'blend-from-as-fixed)
|
||||
(camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 13))
|
||||
(camera-change-to "camera-220" 0 #f)
|
||||
(while (let ((a1-4 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> a1-4 from) self)
|
||||
(set! (-> a1-4 num-params) 0)
|
||||
(set! (-> a1-4 message) 'intro-done?)
|
||||
(not (send-event-function *camera* a1-4))
|
||||
)
|
||||
(suspend)
|
||||
)
|
||||
(camera-change-to "camera-222" 600 #f)
|
||||
(let ((gp-0 (-> *display* base-frame-counter)))
|
||||
(until (>= (- (-> *display* base-frame-counter) gp-0) 600)
|
||||
(suspend)
|
||||
)
|
||||
)
|
||||
(while (not (process-release? (handle->process (-> self grab-target))))
|
||||
(suspend)
|
||||
)
|
||||
(send-event *camera* 'blend-from-as-fixed)
|
||||
(camera-look-at (the-as pair *target*) (the-as uint 0))
|
||||
(camera-change-to (the-as string 'base) 150 #f)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(-> gp-1 ppointer)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-37 (-> self neck)))
|
||||
(set! (-> v1-37 blend) 0.0)
|
||||
)
|
||||
(let ((v1-38 (-> self body)))
|
||||
(set! (-> v1-38 blend) 0.0)
|
||||
)
|
||||
(set-mode! (-> self neck) (joint-mod-handler-mode world-look-at))
|
||||
(set-mode! (-> self body) (joint-mod-handler-mode world-look-at))
|
||||
(set! (-> self body flex-blend) 0.0)
|
||||
(let ((a0-25 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-25 param 0) (-> (new 'static 'array float 1 1.0) 0))
|
||||
(joint-control-channel-group! a0-25 (the-as art-joint-anim #f) num-func-loop!)
|
||||
)
|
||||
(ja-channel-push! 1 150)
|
||||
(let ((gp-2 (-> self skel root-channel 0)))
|
||||
(set! (-> gp-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 10)))
|
||||
(set! (-> gp-2 param 0) (ja-aframe (the-as float 510.0) 0))
|
||||
(set! (-> gp-2 param 1) (-> (new 'static 'array float 1 1.0) 0))
|
||||
(set! (-> gp-2 frame-num) 0.0)
|
||||
(joint-control-channel-group! gp-2 (the-as art-joint-anim (-> self draw art-group data 10)) num-func-seek!)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(set! (-> self energy)
|
||||
(seek (-> self energy) (-> (new 'static 'array float 1 1.0) 0) (* 0.2 (-> *display* seconds-per-frame)))
|
||||
)
|
||||
(ja-blend-eval)
|
||||
(suspend)
|
||||
(let ((gp-3 (-> self skel root-channel 0)))
|
||||
(set! (-> gp-3 param 0) (ja-aframe (the-as float 510.0) 0))
|
||||
(set! (-> gp-3 param 1) (-> (new 'static 'array float 1 1.0) 0))
|
||||
(joint-control-channel-group-eval! gp-3 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
)
|
||||
(let ((a0-33 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-33 param 0) (the float (+ (-> a0-33 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-33 param 1) (-> (new 'static 'array float 1 1.0) 0))
|
||||
(joint-control-channel-group! a0-33 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(let ((v1-77 (-> self entity extra perm)))
|
||||
(logior! (-> v1-77 status) (entity-perm-status user-set-from-cstage))
|
||||
(set! (-> v1-77 user-int8 2) 1)
|
||||
)
|
||||
(label cfg-17)
|
||||
(set! (-> self cycle-count) 0)
|
||||
(set! (-> self snap-count) 0)
|
||||
(go plant-boss-reset 0)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(the-as (function none :behavior plant-boss) ja-post)
|
||||
)
|
||||
|
||||
@@ -262,11 +262,9 @@ baby-spider-default-event-handler
|
||||
)
|
||||
(set! (-> obj delta-wiggle-angle) (* 910.2222 f1-1))
|
||||
(set! (-> obj wiggle-factor) (* 1.5 f2-4))
|
||||
(let ((f0-3 (* 28672.0 f0-2)))
|
||||
(set! (-> obj target-speed) f0-3)
|
||||
(the-as object f0-3)
|
||||
)
|
||||
(set! (-> obj target-speed) (* 28672.0 f0-2))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod dummy-52 baby-spider ((obj baby-spider) (arg0 vector))
|
||||
|
||||
@@ -27,18 +27,18 @@
|
||||
(deftype cavecrystal-light-control (basic)
|
||||
((active-count int32 :offset-assert 4)
|
||||
(head cavecrystal-light :offset-assert 8)
|
||||
(last-known-valid-time uint64 :offset-assert 16)
|
||||
(last-known-valid-time int64 :offset-assert 16)
|
||||
(crystal cavecrystal-light 7 :inline :offset-assert 32)
|
||||
)
|
||||
:method-count-assert 15
|
||||
:size-assert #x170
|
||||
:flag-assert #xf00000170
|
||||
(:methods
|
||||
(TODO-RENAME-9 (_type_ int float process-drawable) object 9)
|
||||
(TODO-RENAME-9 (_type_ int float process-drawable) none 9)
|
||||
(TODO-RENAME-10 (_type_ vector) float 10)
|
||||
(inc-intensites! (_type_) int 11)
|
||||
(TODO-RENAME-12 (_type_) symbol 12)
|
||||
(create-connection! (_type_ process-drawable res-lump (function object object object object object) object object) connection 13)
|
||||
(inc-intensities! (_type_) none 11)
|
||||
(TODO-RENAME-12 (_type_) none 12)
|
||||
(create-connection! (_type_ process-drawable res-lump (function object object object object object) int float) connection 13)
|
||||
(execute-connections (_type_) int 14)
|
||||
)
|
||||
)
|
||||
@@ -69,8 +69,8 @@
|
||||
(arg0 process-drawable)
|
||||
(arg1 res-lump)
|
||||
(arg2 (function object object object object object))
|
||||
(arg3 object)
|
||||
(arg4 object)
|
||||
(arg3 int)
|
||||
(arg4 float)
|
||||
)
|
||||
(if (nonzero? (res-lump-value arg1 'crystal-light uint128))
|
||||
(add-connection *cavecrystal-engine* arg0 arg2 (process->ppointer arg0) arg3 arg4)
|
||||
@@ -86,7 +86,7 @@
|
||||
(a1-1 (-> *display* base-frame-counter))
|
||||
)
|
||||
(when (!= v1-0 a1-1)
|
||||
(set! (-> obj last-known-valid-time) (the-as uint a1-1))
|
||||
(set! (-> obj last-known-valid-time) a1-1)
|
||||
(cond
|
||||
((zero? v1-0)
|
||||
(set! (-> obj active-count) 0)
|
||||
@@ -101,7 +101,6 @@
|
||||
(set! (-> a1-5 crystal-handle) (the-as handle #f))
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
(else
|
||||
(when (> (-> obj active-count) 0)
|
||||
@@ -129,15 +128,15 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod inc-intensites! cavecrystal-light-control ((obj cavecrystal-light-control))
|
||||
(defmethod inc-intensities! cavecrystal-light-control ((obj cavecrystal-light-control))
|
||||
(set! (-> obj head) #f)
|
||||
(let ((a1-0 (the-as cavecrystal-light #f))
|
||||
(v0-0 0)
|
||||
@@ -156,10 +155,11 @@
|
||||
)
|
||||
)
|
||||
(set! (-> obj active-count) v0-0)
|
||||
v0-0
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; WARN: Expression building failed: Function (method 9 cavecrystal-light-control) has a return type of none, but the expression builder found a return statement.
|
||||
(defmethod TODO-RENAME-9 cavecrystal-light-control ((obj cavecrystal-light-control) (arg0 int) (arg1 float) (arg2 process-drawable))
|
||||
(TODO-RENAME-12 obj)
|
||||
(when (or (< arg0 0) (>= arg0 7))
|
||||
@@ -173,12 +173,12 @@
|
||||
(set! (-> s3-0 intensity) arg1)
|
||||
(set! (-> s3-0 crystal-handle) (process->handle arg2))
|
||||
(set! (-> s3-0 trans quad) (-> arg2 root trans quad))
|
||||
(inc-intensites! obj)
|
||||
(inc-intensities! obj)
|
||||
)
|
||||
((and (>= 0.0 arg1) (< 0.0 (-> s3-0 intensity)))
|
||||
(+! (-> obj active-count) -1)
|
||||
(set! (-> s3-0 intensity) 0.0)
|
||||
(inc-intensites! obj)
|
||||
(inc-intensities! obj)
|
||||
)
|
||||
((< 0.0 arg1)
|
||||
(set! (-> s3-0 intensity) arg1)
|
||||
@@ -186,6 +186,7 @@
|
||||
)
|
||||
(set-fade! *palette-fade-controls* (+ arg0 1) arg1 0.0 (-> s3-0 trans))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod TODO-RENAME-10 cavecrystal-light-control ((obj cavecrystal-light-control) (arg0 vector))
|
||||
|
||||
@@ -1084,7 +1084,8 @@
|
||||
(let ((f30-0 1274.3112)
|
||||
(f28-0 (the float s4-0))
|
||||
)
|
||||
(set! s4-0 (/ (the int (* 65536.0 (ja-frame-num 0))) (+ (-> (if (> (-> self skel active-channels) 0)
|
||||
;; changed for divide by zero
|
||||
(set! s4-0 (/-0-guard (the int (* 65536.0 (ja-frame-num 0))) (+ (-> (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
data
|
||||
|
||||
@@ -756,6 +756,7 @@
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> self sfx))
|
||||
(#when PC_DEBUG_SOUND_ENABLE
|
||||
(let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
|
||||
(set! (-> gp-1 command) (sound-command set-param))
|
||||
(set! (-> gp-1 id) (the-as sound-id (-> self sfx)))
|
||||
@@ -773,6 +774,7 @@
|
||||
(set! (-> gp-1 parms mask) (the-as uint 32))
|
||||
(-> gp-1 id)
|
||||
)
|
||||
)
|
||||
)
|
||||
(quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat))
|
||||
(suspend)
|
||||
@@ -934,7 +936,7 @@
|
||||
(a1-2 (-> self root-override root-prim prim-core))
|
||||
(v1-5 (-> v1-3 root-prim prim-core))
|
||||
(a2-1 (new 'stack-no-clear 'vector))
|
||||
(t2-0 (new 'stack-no-clear 'collide-mesh-cache-tri))
|
||||
(t2-0 (new 'stack-no-clear 'collide-tri-result))
|
||||
)
|
||||
0.0
|
||||
(vector-! a2-1 (the-as vector v1-5) (the-as vector a1-2))
|
||||
@@ -945,7 +947,7 @@
|
||||
40.96
|
||||
(collide-kind background)
|
||||
self
|
||||
(the-as collide-tri-result t2-0)
|
||||
t2-0
|
||||
1
|
||||
)
|
||||
0.0
|
||||
|
||||
@@ -158,7 +158,8 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(the-as object 0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod common-post muse ((obj muse))
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
|
||||
(defun dark-plants-all-done ((arg0 dark-plant))
|
||||
(while #t
|
||||
(if (!= (-> (the-as process arg0) state) dark-plant-gone)
|
||||
(if (!= (-> arg0 state) dark-plant-gone)
|
||||
(return #f)
|
||||
)
|
||||
(if (zero? (-> arg0 num-alts))
|
||||
@@ -274,7 +274,7 @@
|
||||
(if (not v1-9)
|
||||
(return #t)
|
||||
)
|
||||
(if (= v1-9 (the-as process arg0))
|
||||
(if (= v1-9 arg0)
|
||||
(return #t)
|
||||
)
|
||||
(set! arg0 (the-as dark-plant v1-9))
|
||||
@@ -1605,7 +1605,7 @@
|
||||
(-> gp-5 ppointer)
|
||||
)
|
||||
)
|
||||
(sleep (-> self ticker) (the-as uint #x1b7740))
|
||||
(sleep (-> self ticker) #x1b7740)
|
||||
(set-setting! *setting-control* self 'sound-flava #f 40.0 42)
|
||||
(none)
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,3 +5,654 @@
|
||||
;; name in dgo: snow-ball
|
||||
;; dgos: L1, SNO
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype snow-ball-shadow (process-drawable)
|
||||
()
|
||||
:heap-base #x40
|
||||
:method-count-assert 20
|
||||
:size-assert #xb0
|
||||
:flag-assert #x14004000b0
|
||||
(:states
|
||||
snow-ball-shadow-idle
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype snow-ball-junction (structure)
|
||||
((enter-time int64 :offset-assert 0)
|
||||
(exit-time int64 :offset-assert 8)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
|
||||
(deftype snow-ball-path-info (structure)
|
||||
((hug-path? symbol :offset-assert 0)
|
||||
(path-pos vector :inline :offset-assert 16)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|
||||
|
||||
(deftype snow-ball-roller (process-drawable)
|
||||
((root-override collide-shape-moving :offset 112)
|
||||
(which-path int32 :offset-assert 176)
|
||||
(path-u float :offset-assert 180)
|
||||
(path-speed float :offset-assert 184)
|
||||
(path-length float :offset-assert 188)
|
||||
(path-fall-u float :offset-assert 192)
|
||||
(path-coming-out-u float :offset-assert 196)
|
||||
(path-faded-up-u float :offset-assert 200)
|
||||
(delay-til-bounce int32 :offset-assert 204)
|
||||
(rolling-sound-id sound-id :offset-assert 208)
|
||||
(rolling-sound-enabled? symbol :offset-assert 212)
|
||||
(last-bounce-time int64 :offset-assert 216)
|
||||
(hit-player-time int64 :offset-assert 224)
|
||||
(path-info snow-ball-path-info :inline :offset-assert 240)
|
||||
(junctions snow-ball-junction 4 :inline :offset-assert 272)
|
||||
)
|
||||
:heap-base #xe0
|
||||
:method-count-assert 23
|
||||
:size-assert #x150
|
||||
:flag-assert #x1700e00150
|
||||
(:methods
|
||||
(follow-path (_type_) none 20)
|
||||
(play-landing-sound (_type_ float) sound-id 21)
|
||||
(dummy-22 (_type_ process-drawable) none 22)
|
||||
)
|
||||
(:states
|
||||
snow-ball-roller-idle
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype snow-ball (process)
|
||||
((child-override (pointer snow-ball-roller) :offset 20)
|
||||
(state-time int64 :offset-assert 112)
|
||||
(last-path-picked int32 :offset-assert 120)
|
||||
(same-path-picked-count int32 :offset-assert 124)
|
||||
(delay-til-next int32 :offset-assert 128)
|
||||
(path curve-control 2 :offset-assert 132)
|
||||
)
|
||||
:heap-base #x20
|
||||
:method-count-assert 16
|
||||
:size-assert #x8c
|
||||
:flag-assert #x100020008c
|
||||
(:methods
|
||||
(dummy-14 (_type_ (inline-array snow-ball-junction) float int) symbol 14)
|
||||
(dummy-15 (_type_ (inline-array snow-ball-junction) int) symbol 15)
|
||||
)
|
||||
(:states
|
||||
snow-ball-idle
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(defskelgroup *snow-ball-sg* snow-ball
|
||||
0
|
||||
2
|
||||
((1 (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 3)
|
||||
:longest-edge (meters 0)
|
||||
)
|
||||
|
||||
(defskelgroup *snow-ball-shadow-sg* snow-ball
|
||||
3
|
||||
-1
|
||||
((4 (meters 999999)))
|
||||
:bounds (static-spherem 0 -1.5 0 2)
|
||||
:longest-edge (meters 0)
|
||||
:shadow 5
|
||||
)
|
||||
|
||||
(define
|
||||
*snow-ball-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
:center
|
||||
(new 'static 'vector :w (the-as float #xa))
|
||||
:shadow-dir
|
||||
(new 'static 'vector :y -1.0 :w 245760.0)
|
||||
:bot-plane (new 'static 'plane :y 1.0 :w 26624.0)
|
||||
:top-plane (new 'static 'plane :y 1.0)
|
||||
:fade-dist 819200.0
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defstate snow-ball-shadow-idle (snow-ball-shadow)
|
||||
:trans
|
||||
(behavior ()
|
||||
(set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad))
|
||||
(dummy-14 (-> self draw shadow-ctrl))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(logior! (-> self mask) (process-mask sleep-code))
|
||||
(suspend)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(the-as (function none :behavior snow-ball-shadow) ja-post)
|
||||
)
|
||||
|
||||
(defbehavior snow-ball-shadow-init-by-other snow-ball-shadow ()
|
||||
(stack-size-set! (-> self main-thread) 128)
|
||||
(logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile))
|
||||
(set! (-> self root) (new 'process 'trsqv))
|
||||
(set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad))
|
||||
(quaternion-identity! (-> self root quat))
|
||||
(vector-identity! (-> self root scale))
|
||||
(initialize-skeleton self *snow-ball-shadow-sg* '())
|
||||
(ja-channel-set! 1)
|
||||
(let ((gp-0 (-> self skel root-channel 0)))
|
||||
(joint-control-channel-group-eval!
|
||||
gp-0
|
||||
(the-as art-joint-anim (-> self draw art-group data 6))
|
||||
num-func-identity
|
||||
)
|
||||
(set! (-> gp-0 frame-num) 0.0)
|
||||
)
|
||||
(set! (-> self draw shadow-ctrl) *snow-ball-shadow-control*)
|
||||
(go snow-ball-shadow-idle)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defbehavior snow-ball-roller-path-init snow-ball-roller ()
|
||||
(set! (-> self path-u) 0.0)
|
||||
(set! (-> self path-length) (path-distance (-> self path)))
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod follow-path snow-ball-roller ((obj snow-ball-roller))
|
||||
(let ((s5-0 (-> obj path-info)))
|
||||
(set! (-> s5-0 hug-path?) #f)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s4-0 quad) (-> s5-0 path-pos quad))
|
||||
(eval-path-curve! (-> obj path) (-> s5-0 path-pos) (-> obj path-u) 'interp)
|
||||
(let ((f0-1 (-> obj path-coming-out-u)))
|
||||
(when (< (-> obj path-u) f0-1)
|
||||
(set! (-> s5-0 path-pos y) (+ (- -20480.0 (* -20480.0 (/ (-> obj path-u) f0-1))) (-> s5-0 path-pos y)))
|
||||
(set! (-> s5-0 hug-path?) #t)
|
||||
)
|
||||
)
|
||||
(let ((f0-6 (-> obj path-faded-up-u)))
|
||||
(cond
|
||||
((< (-> obj path-u) f0-6)
|
||||
(let* ((f0-7 (/ (-> obj path-u) f0-6))
|
||||
(f0-8 (* f0-7 f0-7))
|
||||
)
|
||||
(set-vector! (-> obj draw color-mult) f0-8 f0-8 f0-8 1.0)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(vector-identity! (-> obj draw color-mult))
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((>= (-> obj path-u) (-> obj path-fall-u))
|
||||
(set! (-> s5-0 path-pos y) -409600.0)
|
||||
(set! (-> s5-0 path-pos x) (+ (-> s4-0 x) (-> obj root-override transv x)))
|
||||
(set! (-> s5-0 path-pos z) (+ (-> s4-0 z) (-> obj root-override transv z)))
|
||||
(set! (-> obj rolling-sound-enabled?) #f)
|
||||
)
|
||||
(else
|
||||
(set! (-> obj root-override transv x) (- (-> s5-0 path-pos x) (-> s4-0 x)))
|
||||
(set! (-> obj root-override transv z) (- (-> s5-0 path-pos z) (-> s4-0 z)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod play-landing-sound snow-ball-roller ((obj snow-ball-roller) (arg0 float))
|
||||
(let ((f30-0 (* 0.0018780049 (fmin 53248.0 (fmax 0.0 (+ -4096.0 (fabs arg0)))))))
|
||||
(sound-play-by-name (static-sound-name "snowball-land") (new-sound-id) (the int (* 10.24 f30-0)) 0 0 1 #t)
|
||||
)
|
||||
)
|
||||
|
||||
(defbehavior snow-ball-roller-path-update snow-ball-roller ()
|
||||
(local-vars (f0-5 float))
|
||||
(let ((f0-0 (-> self root-override trans y)))
|
||||
(+! (-> self root-override transv y) (* -491520.0 (-> *display* seconds-per-frame)))
|
||||
(let ((f30-0 (+ f0-0 (* (-> self root-override transv y) (-> *display* seconds-per-frame)))))
|
||||
(follow-path self)
|
||||
(let ((a1-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((a0-1 (-> self path-info)))
|
||||
(set! (-> a1-0 quad) (-> a0-1 path-pos quad))
|
||||
)
|
||||
(set! (-> a1-0 y) (+ 9216.0 (-> a1-0 y)))
|
||||
(cond
|
||||
((-> self path-info hug-path?)
|
||||
(move-to-point! (-> self root-override) a1-0)
|
||||
(set! (-> self root-override transv y) 0.0)
|
||||
)
|
||||
((begin (set! f0-5 (- f30-0 (-> a1-0 y))) (< 0.0 f0-5))
|
||||
(+! (-> a1-0 y) f0-5)
|
||||
(move-to-point! (-> self root-override) a1-0)
|
||||
)
|
||||
(else
|
||||
(move-to-point! (-> self root-override) a1-0)
|
||||
(let ((f0-7 (-> self root-override transv y)))
|
||||
(cond
|
||||
((>= -40960.0 f0-7)
|
||||
(set! (-> self root-override transv y) (* 0.4 (- f0-7)))
|
||||
(play-landing-sound self (-> self root-override transv y))
|
||||
)
|
||||
(else
|
||||
(set! (-> self root-override transv y) 0.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (< (-> self path-u) (-> self path-fall-u))
|
||||
(when (>= (- (-> *display* base-frame-counter) (-> self last-bounce-time)) (-> self delay-til-bounce))
|
||||
(let ((f0-13 (rand-vu-float-range 8192.0 20480.0)))
|
||||
(+! (-> self root-override transv y) f0-13)
|
||||
(play-landing-sound self f0-13)
|
||||
)
|
||||
(set! (-> self last-bounce-time) (-> *display* base-frame-counter))
|
||||
(set! (-> self delay-til-bounce) (rand-vu-int-range 300 2100))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(TODO-RENAME-14 (-> self path) s4-0 (-> self path-u))
|
||||
(let ((gp-0 (new 'stack-no-clear 'matrix)))
|
||||
(let ((s5-0 (new 'stack-no-clear 'matrix)))
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-negate! s3-0 (-> *standard-dynamics* gravity-normal))
|
||||
(forward-down->inv-matrix gp-0 s4-0 s3-0)
|
||||
)
|
||||
(matrix-rotate-x! s5-0 (* 1.1317686 (-> self path-u) (-> self path-length)))
|
||||
(matrix*! gp-0 s5-0 gp-0)
|
||||
)
|
||||
(matrix->quaternion (-> self root-override quat) gp-0)
|
||||
)
|
||||
)
|
||||
(+! (-> self path-u) (* (-> self path-speed) (-> *display* seconds-per-frame)))
|
||||
(if (< 1.0 (-> self path-u))
|
||||
(set! (-> self path-u) 1.0)
|
||||
)
|
||||
(let ((f0-23 (- 819200.0 (-> self root-override trans y))))
|
||||
(when (>= f0-23 0.0)
|
||||
(cond
|
||||
((>= f0-23 245760.0)
|
||||
(deactivate self)
|
||||
)
|
||||
(else
|
||||
(let ((f0-25 (- 1.0 (* 0.0000040690106 f0-23))))
|
||||
(set! (-> self root-override scale x) f0-25)
|
||||
(set! (-> self root-override scale y) f0-25)
|
||||
(set! (-> self root-override scale z) f0-25)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-54 (< (vector-vector-distance (-> self root-override trans) (math-camera-pos)) 163840.0)))
|
||||
(cond
|
||||
((zero? (-> self rolling-sound-id))
|
||||
(if (and v1-54 (-> self rolling-sound-enabled?))
|
||||
(set! (-> self rolling-sound-id) (sound-play-by-name
|
||||
(static-sound-name "snowball-roll")
|
||||
(new-sound-id)
|
||||
1024
|
||||
0
|
||||
0
|
||||
1
|
||||
(the-as symbol (-> self root-override trans))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
((and v1-54 (-> self rolling-sound-enabled?))
|
||||
(sound-play-by-name
|
||||
(static-sound-name "snowball-roll")
|
||||
(-> self rolling-sound-id)
|
||||
1024
|
||||
0
|
||||
0
|
||||
1
|
||||
(the-as symbol (-> self root-override trans))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(sound-stop (-> self rolling-sound-id))
|
||||
(set! (-> self rolling-sound-id) (new 'static 'sound-id))
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod dummy-22 snow-ball-roller ((obj snow-ball-roller) (arg0 process-drawable))
|
||||
(with-pp
|
||||
(cond
|
||||
((< (+ 4096.0 (-> arg0 root trans y)) (-> obj root-override trans y))
|
||||
(let ((f0-2 81920.0))
|
||||
(+! (-> obj root-override transv y) f0-2)
|
||||
(play-landing-sound obj f0-2)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((f0-3 24576.0))
|
||||
(+! (-> obj root-override transv y) f0-3)
|
||||
(play-landing-sound obj f0-3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-! s4-0 (-> arg0 root trans) (-> obj root-override trans))
|
||||
(set! (-> s4-0 y) 0.0)
|
||||
(vector-normalize! s4-0 1.0)
|
||||
(TODO-RENAME-14 (-> obj path) s3-0 (-> obj path-u))
|
||||
(set! (-> s3-0 y) 0.0)
|
||||
(vector-normalize! s3-0 1.0)
|
||||
(let* ((f28-0 (atan (-> s4-0 x) (-> s4-0 z)))
|
||||
(f30-0 (atan (-> s3-0 x) (-> s3-0 z)))
|
||||
(f0-11 (deg- f28-0 f30-0))
|
||||
)
|
||||
(when (< (fabs f0-11) 10922.667)
|
||||
(let ((f30-1 (+ f30-0 (if (>= f0-11 0.0)
|
||||
10922.667
|
||||
-10922.667
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set-vector! s4-0 (sin f30-1) 0.0 (cos f30-1) 1.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-normalize! s4-0 25600.0)
|
||||
(vector+! s4-0 s4-0 (-> obj root-override trans))
|
||||
(vector-! s4-0 s4-0 (-> arg0 root trans))
|
||||
(set! (-> s4-0 y) 0.0)
|
||||
(let ((f30-2 (vector-length s4-0)))
|
||||
(vector-normalize! s4-0 1.0)
|
||||
(let ((a1-17 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> a1-17 from) pp)
|
||||
(set! (-> a1-17 num-params) 2)
|
||||
(set! (-> a1-17 message) 'attack)
|
||||
(set! (-> a1-17 param 0) (the-as uint #f))
|
||||
(let ((v1-20 (new 'static 'attack-info :mask #xc2)))
|
||||
(set! (-> v1-20 vector quad) (-> s4-0 quad))
|
||||
(set! (-> v1-20 shove-up) 12288.0)
|
||||
(set! (-> v1-20 shove-back) f30-2)
|
||||
(set! (-> a1-17 param 1) (the-as uint v1-20))
|
||||
)
|
||||
(send-event-function arg0 a1-17)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defstate snow-ball-roller-idle (snow-ball-roller)
|
||||
:event
|
||||
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
(let ((v1-0 arg2))
|
||||
(the-as object (when (or (= v1-0 'touch) (= v1-0 'attack))
|
||||
(when (= (-> arg0 type) target)
|
||||
(do-push-aways! (-> self root-override))
|
||||
(when (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) 150)
|
||||
(set! (-> self hit-player-time) (-> *display* base-frame-counter))
|
||||
(dummy-22 self *target*)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
:enter
|
||||
(behavior ()
|
||||
(set! (-> self last-bounce-time) (-> *display* base-frame-counter))
|
||||
(snow-ball-roller-path-init)
|
||||
(none)
|
||||
)
|
||||
:exit
|
||||
(behavior ()
|
||||
(set! (-> self rolling-sound-enabled?) #f)
|
||||
(when (nonzero? (-> self rolling-sound-id))
|
||||
(sound-stop (-> self rolling-sound-id))
|
||||
(set! (-> self rolling-sound-id) (new 'static 'sound-id))
|
||||
0
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:trans
|
||||
(behavior ()
|
||||
(snow-ball-roller-path-update)
|
||||
(none)
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(logior! (-> self mask) (process-mask sleep-code))
|
||||
(suspend)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(the-as (function none :behavior snow-ball-roller) transform-post)
|
||||
)
|
||||
|
||||
(defbehavior snow-ball-roller-init-by-other snow-ball-roller ((arg0 entity-actor) (arg1 snow-ball) (arg2 float) (arg3 int) (arg4 (inline-array snow-ball-junction)))
|
||||
(set! (-> self rolling-sound-id) (new 'static 'sound-id))
|
||||
(set! (-> self rolling-sound-enabled?) #t)
|
||||
(set! (-> self path-speed) arg2)
|
||||
(set! (-> self which-path) arg3)
|
||||
(set! (-> self hit-player-time) 0)
|
||||
(set! (-> self entity) arg0)
|
||||
(dotimes (s3-0 4)
|
||||
(mem-copy! (the-as pointer (-> self junctions s3-0)) (the-as pointer (-> arg4 s3-0)) 16)
|
||||
)
|
||||
(let ((s4-1 (new 'process 'collide-shape-moving self (collide-list-enum hit-by-player))))
|
||||
(set! (-> s4-1 dynam) (copy *standard-dynamics* 'process))
|
||||
(set! (-> s4-1 reaction) default-collision-reaction)
|
||||
(set! (-> s4-1 no-reaction)
|
||||
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
|
||||
)
|
||||
(let ((s3-1 (new 'process 'collide-shape-prim-sphere s4-1 (the-as uint 0))))
|
||||
(set! (-> s3-1 prim-core collide-as) (collide-kind enemy))
|
||||
(set! (-> s3-1 collide-with) (collide-kind target))
|
||||
(set! (-> s3-1 prim-core action) (collide-action solid))
|
||||
(set! (-> s3-1 prim-core offense) (collide-offense indestructible))
|
||||
(set-vector! (-> s3-1 local-sphere) 0.0 0.0 0.0 10240.0)
|
||||
(set-root-prim! s4-1 s3-1)
|
||||
)
|
||||
(set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w)))
|
||||
(backup-collide-with-as s4-1)
|
||||
(set! (-> self root-override) s4-1)
|
||||
)
|
||||
(set-vector! (-> self root-override transv) 0.0 0.0 0.0 1.0)
|
||||
(process-drawable-from-entity! self arg0)
|
||||
(initialize-skeleton self *snow-ball-sg* '())
|
||||
(logclear! (-> self mask) (process-mask actor-pause))
|
||||
(set! (-> self path) (new 'process 'curve-control self 'path (the float (+ arg3 1))))
|
||||
(logior! (-> self path flags) (path-control-flag display draw-line draw-point draw-text))
|
||||
(let ((v1-33 (-> self which-path)))
|
||||
(cond
|
||||
((zero? v1-33)
|
||||
(set! (-> self path-fall-u) 0.8667)
|
||||
(set! (-> self path-coming-out-u) 0.05)
|
||||
(set! (-> self path-faded-up-u) 0.075)
|
||||
)
|
||||
((= v1-33 1)
|
||||
(set! (-> self path-fall-u) 0.9105)
|
||||
(set! (-> self path-coming-out-u) 0.05)
|
||||
(set! (-> self path-faded-up-u) 0.075)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> self delay-til-bounce) (rand-vu-int-range 900 2100))
|
||||
(let ((gp-1 (get-process *default-dead-pool* snow-ball-shadow #x4000)))
|
||||
(when gp-1
|
||||
(let ((t9-11 (method-of-type snow-ball-shadow activate)))
|
||||
(t9-11 (the-as snow-ball-shadow gp-1) self 'snow-ball-shadow (the-as pointer #x70004000))
|
||||
)
|
||||
(run-now-in-process gp-1 snow-ball-shadow-init-by-other)
|
||||
(-> gp-1 ppointer)
|
||||
)
|
||||
)
|
||||
(go snow-ball-roller-idle)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod dummy-14 snow-ball ((obj snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 float) (arg2 int))
|
||||
(local-vars (v1-0 (pointer float)))
|
||||
(if (zero? arg2)
|
||||
(set! v1-0 (new 'static 'array float 8 0.3309 0.36 0.4691 0.5061 0.6904 0.7264 0.864 0.8667))
|
||||
(set! v1-0 (new 'static 'array float 8 0.3344 0.3528 0.4919 0.5246 0.6967 0.7272 0.8677 0.9105))
|
||||
)
|
||||
(let ((a0-4 (* arg1 (-> *display* seconds-per-frame)))
|
||||
(a1-1 (-> arg0 0))
|
||||
(a2-2 (-> *display* base-frame-counter))
|
||||
)
|
||||
(dotimes (a3-1 4)
|
||||
(set! (-> a1-1 enter-time) (+ a2-2 (the int (/ (-> v1-0 0) a0-4))))
|
||||
(set! (-> a1-1 exit-time) (+ a2-2 (the int (/ (-> v1-0 1) a0-4))))
|
||||
(set! v1-0 (&-> v1-0 2))
|
||||
(&+! a1-1 16)
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
|
||||
(defmethod dummy-15 snow-ball ((obj snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 int))
|
||||
(local-vars (v0-0 symbol))
|
||||
(let ((v1-0 (-> obj child-override)))
|
||||
(while v1-0
|
||||
(let ((a0-1 (-> arg0 0))
|
||||
(a3-1 (-> v1-0 0 junctions))
|
||||
)
|
||||
(dotimes (t0-0 3)
|
||||
(if (and (>= (-> a3-1 0 exit-time) (-> a0-1 enter-time)) (>= (-> a0-1 exit-time) (-> a3-1 0 enter-time)))
|
||||
(return #f)
|
||||
)
|
||||
(&+! a0-1 16)
|
||||
(set! a3-1 (the-as (inline-array snow-ball-junction) (-> a3-1 1)))
|
||||
)
|
||||
(when (= arg1 (-> v1-0 0 which-path))
|
||||
(if (>= (-> a3-1 0 exit-time) (-> a0-1 enter-time))
|
||||
(return #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! v1-0 (the-as (pointer snow-ball-roller) (-> v1-0 0 brother)))
|
||||
)
|
||||
)
|
||||
(return #t)
|
||||
v0-0
|
||||
)
|
||||
|
||||
(defstate snow-ball-idle (snow-ball)
|
||||
:code
|
||||
(behavior ()
|
||||
(local-vars (gp-0 int))
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(set! (-> self delay-til-next) 0)
|
||||
(label cfg-1)
|
||||
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay-til-next))
|
||||
(set! gp-0 (cond
|
||||
((>= (-> self same-path-picked-count) 2)
|
||||
(if (zero? (-> self last-path-picked))
|
||||
(set! gp-0 1)
|
||||
(set! gp-0 0)
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
(else
|
||||
(rand-vu-int-range 0 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s4-0 0)
|
||||
(s5-0 (new 'stack-no-clear 'inline-array 'snow-ball-junction 4))
|
||||
)
|
||||
(while #t
|
||||
(let ((s3-0 (/ (+ 98304.0 (rand-vu-float-range 0.0 32768.0)) (path-distance (-> self path gp-0)))))
|
||||
(dummy-14 self s5-0 s3-0 gp-0)
|
||||
(when (dummy-15 self s5-0 gp-0)
|
||||
(let ((s4-1 (get-process *default-dead-pool* snow-ball-roller #x4000)))
|
||||
(when s4-1
|
||||
(let ((t9-6 (method-of-type snow-ball-roller activate)))
|
||||
(t9-6 (the-as snow-ball-roller s4-1) self 'snow-ball-roller (the-as pointer #x70004000))
|
||||
)
|
||||
(run-now-in-process s4-1 snow-ball-roller-init-by-other (-> self entity) self s3-0 gp-0 s5-0)
|
||||
(-> s4-1 ppointer)
|
||||
)
|
||||
)
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(set! (-> self delay-til-next) (rand-vu-int-range 450 1650))
|
||||
(cond
|
||||
((= gp-0 (-> self last-path-picked))
|
||||
(+! (-> self same-path-picked-count) 1)
|
||||
)
|
||||
(else
|
||||
(set! (-> self last-path-picked) gp-0)
|
||||
(set! (-> self same-path-picked-count) 1)
|
||||
)
|
||||
)
|
||||
(goto cfg-22)
|
||||
)
|
||||
)
|
||||
(+! s4-0 1)
|
||||
(if (< 5 s4-0)
|
||||
(goto cfg-22)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(label cfg-22)
|
||||
(suspend)
|
||||
(b! #t cfg-1 :delay (nop!))
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod relocate snow-ball ((obj snow-ball) (arg0 int))
|
||||
(dotimes (v1-0 2)
|
||||
(if (nonzero? (-> obj path v1-0))
|
||||
(&+! (-> obj path v1-0) arg0)
|
||||
)
|
||||
)
|
||||
(the-as snow-ball ((the-as (function process-drawable int process-drawable) (find-parent-method snow-ball 7))
|
||||
(the-as process-drawable obj)
|
||||
arg0
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! snow-ball ((obj snow-ball) (arg0 entity-actor))
|
||||
(set! (-> obj last-path-picked) 1)
|
||||
(set! (-> obj same-path-picked-count) 1)
|
||||
(dotimes (s5-0 2)
|
||||
(set! (-> obj path s5-0) (new 'process 'curve-control obj 'path (the float (+ s5-0 1))))
|
||||
)
|
||||
(logclear! (-> obj mask) (process-mask actor-pause))
|
||||
(go snow-ball-idle)
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,8 +49,8 @@
|
||||
(deftype snow-button (process-drawable)
|
||||
((root-override collide-shape-moving :offset 112)
|
||||
(wiggled? symbol :offset-assert 176)
|
||||
(timeout uint64 :offset-assert 184)
|
||||
(delay-til-wiggle uint64 :offset-assert 192)
|
||||
(timeout int64 :offset-assert 184)
|
||||
(delay-til-wiggle int64 :offset-assert 192)
|
||||
(prev-button entity-actor :offset-assert 200)
|
||||
(ticker ticky :inline :offset-assert 208)
|
||||
)
|
||||
@@ -467,7 +467,7 @@
|
||||
(set! (-> obj link) (new 'process 'actor-link-info obj))
|
||||
(initialize-skeleton obj *snow-button-sg* '())
|
||||
(logior! (-> obj skel status) 1)
|
||||
(set! (-> obj timeout) (the-as uint (the int (* 300.0 (res-lump-float arg0 'timeout :default 10.0)))))
|
||||
(set! (-> obj timeout) (the int (* 300.0 (res-lump-float arg0 'timeout :default 10.0))))
|
||||
(set! (-> obj delay-til-wiggle) (+ (-> obj timeout) -120))
|
||||
(if (> (entity-actor-count arg0 'alt-actor) 0)
|
||||
(set! (-> obj prev-button) (entity-actor-lookup arg0 'alt-actor 0))
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,11 +5,6 @@
|
||||
;; name in dgo: snow-ram
|
||||
;; dgos: L1, SNO
|
||||
|
||||
(define-extern *ram-sg* skeleton-group)
|
||||
|
||||
(declare-type ram process-drawable)
|
||||
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(defskelgroup *ram-sg* ram
|
||||
|
||||
@@ -441,7 +441,8 @@
|
||||
(defmethod dummy-51 double-lurker-top ((obj double-lurker-top))
|
||||
(restore-collide-with-as (-> obj collide-info))
|
||||
(logior! (-> obj collide-info nav-flags) 1)
|
||||
(the-as object (TODO-RENAME-27 (-> obj nav)))
|
||||
(TODO-RENAME-27 (-> obj nav))
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod initialize-collision double-lurker-top ((obj double-lurker-top))
|
||||
@@ -1400,7 +1401,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(the-as object #f)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod TODO-RENAME-48 double-lurker ((obj double-lurker))
|
||||
|
||||
@@ -585,7 +585,59 @@
|
||||
:trans
|
||||
(the-as (function none :behavior orbit-plat) plat-trans)
|
||||
:code
|
||||
(behavior () (none)) ;; todo
|
||||
(behavior ()
|
||||
(set! (-> self plat-status) (the-as uint 2))
|
||||
(set! (-> self is-reset?) #f)
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(let ((a0-0 (new 'stack-no-clear 'vector))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((v1-1 gp-0)
|
||||
(a1-0 (-> self other))
|
||||
)
|
||||
(set! (-> v1-1 quad) (-> (the-as orbit-plat (if a1-0
|
||||
(-> a1-0 extra process)
|
||||
)
|
||||
)
|
||||
root-override
|
||||
trans
|
||||
quad
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-! a0-0 (-> self basetrans) gp-0)
|
||||
(let ((f30-0 (vector-length a0-0)))
|
||||
(set! (-> self reset-length) f30-0)
|
||||
(let ((a0-1 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-1 param 0) 0.0)
|
||||
(set! (-> a0-1 param 1) 1.0)
|
||||
(joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(label cfg-3)
|
||||
(dotimes (s4-0 2)
|
||||
(get-rotate-point! s5-0 gp-0 (-> self basetrans) (the-as vector f30-0) (-> self rot-dir) 40960.0)
|
||||
(b! (not (dummy-16 (-> self nav) s5-0)) cfg-6 :delay (empty-form))
|
||||
(set! (-> self basetrans quad) (-> s5-0 quad))
|
||||
(b! #t cfg-9 :delay (nop!))
|
||||
(label cfg-6)
|
||||
(set! (-> self rot-dir) (- (-> self rot-dir)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(label cfg-9)
|
||||
(suspend)
|
||||
(when (not (ja-done? 0))
|
||||
(let ((a0-7 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-7 param 0) 0.0)
|
||||
(set! (-> a0-7 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
)
|
||||
(b! #t cfg-3 :delay (nop!))
|
||||
(none)
|
||||
)
|
||||
:post
|
||||
(the-as (function none :behavior orbit-plat) plat-post)
|
||||
)
|
||||
|
||||
@@ -61,9 +61,9 @@
|
||||
(plat-mask uint32 :offset-assert 184)
|
||||
(plat-id-dir int32 :offset-assert 188)
|
||||
(wiggled? symbol :offset-assert 192)
|
||||
(timeout uint64 :offset-assert 200)
|
||||
(last-plat-activated-time uint64 :offset-assert 208)
|
||||
(delay-til-wiggle uint64 :offset-assert 216)
|
||||
(timeout int64 :offset-assert 200)
|
||||
(last-plat-activated-time int64 :offset-assert 208)
|
||||
(delay-til-wiggle int64 :offset-assert 216)
|
||||
(ticker ticky :inline :offset-assert 224)
|
||||
)
|
||||
:heap-base #x90
|
||||
@@ -681,8 +681,8 @@
|
||||
(send-to-all (-> self link) 'bounce)
|
||||
)
|
||||
)
|
||||
(when (>= (- (-> *display* base-frame-counter) (the-as int (-> self last-plat-activated-time))) 90)
|
||||
(set! (-> self last-plat-activated-time) (the-as uint (-> *display* base-frame-counter)))
|
||||
(when (>= (- (-> *display* base-frame-counter) (-> self last-plat-activated-time)) 90)
|
||||
(set! (-> self last-plat-activated-time) (-> *display* base-frame-counter))
|
||||
(let ((v1-20 (-> self plat-id))
|
||||
(a0-5 (-> self plat-id-dir))
|
||||
(a1-3 (-> self plat-mask))
|
||||
@@ -725,9 +725,7 @@
|
||||
(set! (-> obj plat-id) -1)
|
||||
(set! (-> obj root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! obj arg0)
|
||||
(set! (-> obj timeout)
|
||||
(the-as uint (the int (* 300.0 (res-lump-float (-> obj entity) 'timeout :default 10.0))))
|
||||
)
|
||||
(set! (-> obj timeout) (the int (* 300.0 (res-lump-float (-> obj entity) 'timeout :default 10.0))))
|
||||
(set! (-> obj delay-til-wiggle) (+ (-> obj timeout) -120))
|
||||
(set! (-> obj link) (new 'process 'actor-link-info obj))
|
||||
(set! (-> obj plat-mask) (the-as uint (get-matching-actor-type-mask (-> obj link) square-platform)))
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
|
||||
(deftype sunken-pipegame-prize (structure)
|
||||
((puzzle-delay uint64 :offset-assert 0)
|
||||
(pipe-travel-time-to-far uint64 :offset-assert 8)
|
||||
(pipe-travel-time-to-jar uint64 :offset-assert 16)
|
||||
((puzzle-delay int64 :offset-assert 0)
|
||||
(pipe-travel-time-to-far int64 :offset-assert 8)
|
||||
(pipe-travel-time-to-jar int64 :offset-assert 16)
|
||||
(actor-handle handle :offset-assert 24)
|
||||
(jar-pos vector :inline :offset-assert 32)
|
||||
(far-pos vector :inline :offset-assert 48)
|
||||
@@ -49,7 +49,7 @@
|
||||
:size-assert #x2a0
|
||||
:flag-assert #x17023002a0
|
||||
(:methods
|
||||
(dummy-20 (_type_) none 20)
|
||||
(dummy-20 (_type_) uint 20)
|
||||
(dummy-21 (_type_ symbol) symbol 21)
|
||||
(dummy-22 (_type_ symbol) none 22)
|
||||
)
|
||||
@@ -528,8 +528,8 @@
|
||||
(if (got-buzzer? *game-info* (game-task sunken-buzzer) 1)
|
||||
(+! gp-0 4)
|
||||
)
|
||||
(the-as uint gp-0)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defstate sunken-pipegame-start-up (sunken-pipegame)
|
||||
@@ -725,9 +725,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(until (>= (- (-> *display* base-frame-counter) gp-0)
|
||||
(the-as int (-> self prize (-> self challenge) pipe-travel-time-to-far))
|
||||
)
|
||||
(until (>= (- (-> *display* base-frame-counter) gp-0) (-> self prize (-> self challenge) pipe-travel-time-to-far))
|
||||
(let ((s5-6 (-> self prize (-> self challenge))))
|
||||
(spawn (-> s5-6 sucked-up-part) (-> s5-6 sucked-up-jar-part-pos))
|
||||
(spawn (-> s5-6 blown-out-part) (-> s5-6 blown-out-far-part-pos))
|
||||
@@ -860,7 +858,7 @@
|
||||
)
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(until (>= (- (-> *display* base-frame-counter) (-> self state-time))
|
||||
(the-as int (-> self prize (-> self challenge) pipe-travel-time-to-jar))
|
||||
(-> self prize (-> self challenge) pipe-travel-time-to-jar)
|
||||
)
|
||||
(let ((gp-4 (-> self prize (-> self challenge))))
|
||||
(spawn (-> gp-4 sucked-up-part) (-> gp-4 sucked-up-far-part-pos))
|
||||
@@ -1031,7 +1029,7 @@
|
||||
(process-drawable-from-entity! obj arg0)
|
||||
(set! (-> obj path) (new 'process 'path-control obj 'path 0.0))
|
||||
(logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text))
|
||||
(set! (-> obj challenges-mask) (the-as uint (dummy-20 obj)))
|
||||
(set! (-> obj challenges-mask) (dummy-20 obj))
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector))
|
||||
(s3-0 (new 'stack-no-clear 'quaternion))
|
||||
)
|
||||
@@ -1052,9 +1050,9 @@
|
||||
(let ((v1-30 s2-0))
|
||||
(cond
|
||||
((zero? v1-30)
|
||||
(set! (-> s0-0 puzzle-delay) (the-as uint 7500))
|
||||
(set! (-> s0-0 pipe-travel-time-to-far) (the-as uint 2550))
|
||||
(set! (-> s0-0 pipe-travel-time-to-jar) (the-as uint 750))
|
||||
(set! (-> s0-0 puzzle-delay) 7500)
|
||||
(set! (-> s0-0 pipe-travel-time-to-far) 2550)
|
||||
(set! (-> s0-0 pipe-travel-time-to-jar) 750)
|
||||
(set-vector! s4-0 -30720.0 1146.88 5120.0 1.0)
|
||||
(set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 448) obj))
|
||||
(set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 451) obj))
|
||||
@@ -1074,9 +1072,9 @@
|
||||
)
|
||||
)
|
||||
((= v1-30 1)
|
||||
(set! (-> s0-0 puzzle-delay) (the-as uint 4500))
|
||||
(set! (-> s0-0 pipe-travel-time-to-far) (the-as uint 1650))
|
||||
(set! (-> s0-0 pipe-travel-time-to-jar) (the-as uint 750))
|
||||
(set! (-> s0-0 puzzle-delay) 4500)
|
||||
(set! (-> s0-0 pipe-travel-time-to-far) 1650)
|
||||
(set! (-> s0-0 pipe-travel-time-to-jar) 750)
|
||||
(set-vector! s4-0 0.0 1146.88 5120.0 1.0)
|
||||
(set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 449) obj))
|
||||
(set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 452) obj))
|
||||
@@ -1098,9 +1096,9 @@
|
||||
)
|
||||
)
|
||||
((= v1-30 2)
|
||||
(set! (-> s0-0 puzzle-delay) (the-as uint 4500))
|
||||
(set! (-> s0-0 pipe-travel-time-to-far) (the-as uint 1350))
|
||||
(set! (-> s0-0 pipe-travel-time-to-jar) (the-as uint 750))
|
||||
(set! (-> s0-0 puzzle-delay) 4500)
|
||||
(set! (-> s0-0 pipe-travel-time-to-far) 1350)
|
||||
(set! (-> s0-0 pipe-travel-time-to-jar) 750)
|
||||
(set-vector! s4-0 30720.0 1146.88 5120.0 1.0)
|
||||
(set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 450) obj))
|
||||
(set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 453) obj))
|
||||
@@ -1136,7 +1134,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> obj button s2-0) (the-as (pointer sunken-pipegame-button) v1-102))
|
||||
(set! (-> (the-as sunken-pipegame-button (-> (the-as sunken-pipegame-button v1-102) name)) button-id) s2-0)
|
||||
(set! (-> (the-as (pointer sunken-pipegame-button) v1-102) 0 button-id) s2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -439,7 +439,7 @@
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status need-hint) (task-status need-introduction))
|
||||
(when arg0
|
||||
(set! (-> obj blend-on-exit) #t)
|
||||
(set! (-> obj blend-on-exit) (the-as art-joint-anim #t))
|
||||
(close-status! (-> obj tasks) (task-status need-introduction))
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector)))
|
||||
(dotimes (s4-0 (+ (the int (the float (+ (-> obj path-snacks curve num-cverts) -1))) 1))
|
||||
@@ -498,7 +498,7 @@
|
||||
)
|
||||
(((task-status need-reminder-a) (task-status need-reminder))
|
||||
(set! (-> obj skippable) #t)
|
||||
(set! (-> obj blend-on-exit) #t)
|
||||
(set! (-> obj blend-on-exit) (the-as art-joint-anim #t))
|
||||
(set! (-> obj will-talk) #t)
|
||||
(new 'static 'spool-anim
|
||||
:name "billy-reminder-1"
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
)
|
||||
|
||||
(defmethod play-anim! explorer ((obj explorer) (arg0 symbol))
|
||||
(set! (-> obj talk-message) (the-as uint 260))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk))
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status need-hint) (task-status need-introduction))
|
||||
(if arg0
|
||||
@@ -117,7 +117,7 @@
|
||||
)
|
||||
(else
|
||||
(set! (-> obj will-talk) #t)
|
||||
(set! (-> obj talk-message) (the-as uint 282))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-trade-money))
|
||||
)
|
||||
)
|
||||
(new 'static 'spool-anim
|
||||
@@ -556,7 +556,7 @@
|
||||
(defmethod init-from-entity! explorer ((obj explorer) (arg0 entity-actor))
|
||||
(dummy-40 obj arg0 *explorer-sg* 3 42 (new 'static 'vector :w 4096.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (game-task village1-uncle-money)))
|
||||
(set! (-> obj sound-flava) (the-as uint 10))
|
||||
(set! (-> obj sound-flava) (music-flava explorer))
|
||||
(set! (-> obj draw light-index) (the-as uint 5))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
|
||||
@@ -655,7 +655,7 @@
|
||||
(dummy-40 obj arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (game-task misty-cannon)))
|
||||
(set! (-> obj reminder-played) #f)
|
||||
(set! (-> obj sound-flava) (the-as uint 5))
|
||||
(set! (-> obj sound-flava) (music-flava sage))
|
||||
(set! (-> obj assistant) (the-as handle #f))
|
||||
(set! (-> obj draw light-index) (the-as uint 1))
|
||||
(dummy-42 obj)
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
(defmethod play-anim! assistant-bluehut ((obj assistant-bluehut) (arg0 symbol))
|
||||
(with-pp
|
||||
(set! (-> obj talk-message) (the-as uint 292))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk-to-assistant))
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status unknown) (task-status need-hint) (task-status need-introduction))
|
||||
(if (not arg0)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
)
|
||||
|
||||
(defmethod play-anim! gambler ((obj gambler) (arg0 symbol))
|
||||
(set! (-> obj talk-message) (the-as uint 260))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk))
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status need-hint) (task-status need-introduction))
|
||||
(when arg0
|
||||
@@ -101,7 +101,7 @@
|
||||
(send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc)))
|
||||
)
|
||||
(else
|
||||
(set! (-> obj talk-message) (the-as uint 282))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-trade-money))
|
||||
)
|
||||
)
|
||||
(new 'static 'spool-anim :name "gambler-resolution-money" :index 15 :parts 2 :command-list '())
|
||||
@@ -274,7 +274,7 @@
|
||||
(defmethod init-from-entity! gambler ((obj gambler) (arg0 entity-actor))
|
||||
(dummy-40 obj arg0 *gambler-sg* 3 32 (new 'static 'vector :w 4096.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (game-task rolling-race)))
|
||||
(set! (-> obj sound-flava) (the-as uint 17))
|
||||
(set! (-> obj sound-flava) (music-flava gambler))
|
||||
(set! (-> obj draw light-index) (the-as uint 4))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
)
|
||||
|
||||
(defmethod play-anim! geologist ((obj geologist) (arg0 symbol))
|
||||
(set! (-> obj talk-message) (the-as uint 260))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk))
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status need-hint) (task-status need-introduction))
|
||||
(when arg0
|
||||
@@ -93,7 +93,7 @@
|
||||
(send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc)))
|
||||
)
|
||||
(else
|
||||
(set! (-> obj talk-message) (the-as uint 282))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-trade-money))
|
||||
)
|
||||
)
|
||||
(new 'static 'spool-anim :name "geologist-resolution-money" :index 10 :parts 2 :command-list '())
|
||||
@@ -169,7 +169,7 @@
|
||||
(defmethod init-from-entity! geologist ((obj geologist) (arg0 entity-actor))
|
||||
(dummy-40 obj arg0 *geologist-sg* 3 45 (new 'static 'vector :w 4096.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (game-task rolling-moles)))
|
||||
(set! (-> obj sound-flava) (the-as uint 16))
|
||||
(set! (-> obj sound-flava) (music-flava geologist))
|
||||
(set! (-> obj draw light-index) (the-as uint 2))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
(defmethod play-anim! sage-bluehut ((obj sage-bluehut) (arg0 symbol))
|
||||
(with-pp
|
||||
(set! (-> obj talk-message) (the-as uint 291))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk-to-sage))
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status need-hint) (task-status need-introduction))
|
||||
(if (not arg0)
|
||||
@@ -418,7 +418,7 @@
|
||||
(set! (-> obj reminder-played) #f)
|
||||
(set! (-> obj assistant) (entity-actor-lookup arg0 'alt-actor 0))
|
||||
(set! (-> obj draw light-index) (the-as uint 1))
|
||||
(set! (-> obj sound-flava) (the-as uint 5))
|
||||
(set! (-> obj sound-flava) (music-flava sage))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
(defmethod play-anim! warrior ((obj warrior) (arg0 symbol))
|
||||
(with-pp
|
||||
(set! (-> obj talk-message) (the-as uint 260))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk))
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status need-hint) (task-status need-introduction))
|
||||
(if arg0
|
||||
@@ -120,7 +120,7 @@
|
||||
)
|
||||
(else
|
||||
(set! (-> obj will-talk) #t)
|
||||
(set! (-> obj talk-message) (the-as uint 282))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-trade-money))
|
||||
)
|
||||
)
|
||||
(new 'static 'spool-anim
|
||||
@@ -218,7 +218,7 @@
|
||||
(defmethod init-from-entity! warrior ((obj warrior) (arg0 entity-actor))
|
||||
(dummy-40 obj arg0 *warrior-sg* 3 33 (new 'static 'vector :y -4096.0 :w 10240.0) 5)
|
||||
(set! (-> obj tasks) (get-task-control (game-task village2-warrior-money)))
|
||||
(set! (-> obj sound-flava) (the-as uint 15))
|
||||
(set! (-> obj sound-flava) (music-flava warrior))
|
||||
(set! (-> obj draw light-index) (the-as uint 3))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
)
|
||||
|
||||
(defmethod play-anim! assistant-villagec ((obj assistant-villagec) (arg0 symbol))
|
||||
(set! (-> obj talk-message) (the-as uint 292))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk-to-assistant))
|
||||
(cond
|
||||
((= (get-task-status (game-task finalboss-movies)) (task-status need-introduction))
|
||||
(if arg0
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
)
|
||||
|
||||
(defmethod play-anim! minertall ((obj minertall) (arg0 symbol))
|
||||
(set! (-> obj talk-message) (the-as uint 260))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk))
|
||||
(current-status (-> obj tasks))
|
||||
(if arg0
|
||||
(format
|
||||
@@ -279,7 +279,7 @@
|
||||
|
||||
(defmethod play-anim! minershort ((obj minershort) (arg0 symbol))
|
||||
(with-pp
|
||||
(set! (-> obj talk-message) (the-as uint 260))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk))
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status need-hint) (task-status need-introduction))
|
||||
(if (not arg0)
|
||||
@@ -458,7 +458,7 @@
|
||||
)
|
||||
(else
|
||||
(set! (-> obj will-talk) #t)
|
||||
(set! (-> obj talk-message) (the-as uint 282))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-trade-money))
|
||||
)
|
||||
)
|
||||
(if (< (the-as uint s4-3) (the-as uint 3))
|
||||
@@ -613,7 +613,7 @@
|
||||
(set! (-> obj tasks) (get-task-control (game-task village3-miner-money1)))
|
||||
(set! (-> obj other-miner) (the-as minertall (entity-actor-lookup arg0 'alt-actor 0)))
|
||||
(set! (-> obj cur-trans-hook) minershort-trans-hook)
|
||||
(set! (-> obj sound-flava) (the-as uint 14))
|
||||
(set! (-> obj sound-flava) (music-flava miners))
|
||||
(set! (-> obj draw light-index) (the-as uint 1))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
(defmethod play-anim! sage-villagec ((obj sage-villagec) (arg0 symbol))
|
||||
(with-pp
|
||||
(set! (-> obj talk-message) (the-as uint 291))
|
||||
(set! (-> obj talk-message) (game-text-id press-to-talk-to-sage))
|
||||
(case (current-status (-> obj tasks))
|
||||
(((task-status unknown) (task-status need-hint) (task-status need-introduction))
|
||||
(if (not arg0)
|
||||
@@ -344,7 +344,7 @@
|
||||
(set! (-> obj assistant) (entity-actor-lookup arg0 'alt-actor 0))
|
||||
(set! (-> obj evilbro) (the-as handle #f))
|
||||
(set! (-> obj evilsis) (the-as handle #f))
|
||||
(set! (-> obj sound-flava) (the-as uint 5))
|
||||
(set! (-> obj sound-flava) (music-flava sage))
|
||||
(dummy-42 obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user