mirror of
https://github.com/open-goal/jak-project
synced 2026-07-09 14:55:51 -04:00
Merge remote-tracking branch 'water111/master' into decomp/misty-teetertotter
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
third-party/**/* linguist-vendored
|
||||
test/decompiler/reference/** linguist-vendored
|
||||
*.gc linguist-language=lisp
|
||||
*.gd linguist-language=lisp
|
||||
*.gs linguist-language=Scheme
|
||||
goal_src/engine/gfx/ocean/ocean-tables.gc linguist-vendored
|
||||
|
||||
@@ -22,9 +22,7 @@ jobs:
|
||||
|
||||
# just do a sed for now
|
||||
- name: Update Line Count
|
||||
run: |
|
||||
chmod +x ./.github/workflows/scripts/line-count.sh
|
||||
./.github/workflows/scripts/line-count.sh
|
||||
run: python ./scripts/update-file-progress.py
|
||||
|
||||
- name: Update Site
|
||||
run: |
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
LINE_COUNT=$(find ./goal_src -name '*.gc' | xargs wc -l | tail -1 | awk -F'[^0-9]+' '{ print $2 }')
|
||||
|
||||
sed -i "s/.*value.*/ \"value\": ${LINE_COUNT},/g" ./docs/gh-pages-proj/src/config/progress.json
|
||||
@@ -49,6 +49,13 @@
|
||||
"name" : "Run - Runtime (with kernel)",
|
||||
"args" : [ "-fakeiso", "-debug", "-v", "-nodisplay" ]
|
||||
},
|
||||
{
|
||||
"type" : "default",
|
||||
"project" : "CMakeLists.txt",
|
||||
"projectTarget" : "gk.exe (bin\\gk.exe)",
|
||||
"name" : "Run - Runtime (with kernel + display)",
|
||||
"args" : [ "-fakeiso", "-debug", "-v" ]
|
||||
},
|
||||
{
|
||||
"type" : "default",
|
||||
"project" : "CMakeLists.txt",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "common/common_types.h"
|
||||
#include "third-party/dragonbox.h"
|
||||
#include "print_float.h"
|
||||
#include "common/util/assert.h"
|
||||
|
||||
/*!
|
||||
* Convert a float to a string. The string is _always_ in this format:
|
||||
@@ -127,4 +128,4 @@ int float_to_cstr(float value, char* buffer) {
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
+95
-113
@@ -782,7 +782,7 @@
|
||||
(leaving-misty 114)
|
||||
(assistant-village3 115)
|
||||
(max 116)
|
||||
(*unknown* 255))
|
||||
)
|
||||
|
||||
|
||||
(defenum game-text-id
|
||||
@@ -11420,7 +11420,7 @@
|
||||
(projectile-dissipate () none 21) ;; state
|
||||
(projectile-impact () none 22) ;; state
|
||||
(dummy-23 () none 23)
|
||||
(dummy-24 () none 24)
|
||||
(dummy-24 (_type_ ) none 24)
|
||||
(dummy-25 () none 25)
|
||||
(dummy-26 () none 26)
|
||||
(dummy-27 () none 27)
|
||||
@@ -11852,15 +11852,15 @@
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
(dummy-12 () none 12)
|
||||
(dummy-12 (_type_ vector float uint process bone uint) float 12) ;; TODO - bone not confirmed
|
||||
(dummy-13 () none 13)
|
||||
(dummy-14 () none 14)
|
||||
(dummy-15 () none 15)
|
||||
(dummy-16 () none 16)
|
||||
(dummy-16 (_type_ vector float uint process uint) none 16)
|
||||
(dummy-17 () none 17)
|
||||
(dummy-18 () none 18)
|
||||
(dummy-19 () none 19)
|
||||
(dummy-20 () none 20)
|
||||
(dummy-20 (_type_ vector float uint bone uint) none 20) ;; TODO - bone not confirmed
|
||||
(dummy-21 () none 21)
|
||||
(dummy-22 () none 22)
|
||||
(dummy-23 () none 23)
|
||||
@@ -13220,12 +13220,12 @@
|
||||
(deftype sp-field-init-spec (structure)
|
||||
((field uint16 :offset-assert 0)
|
||||
(flags uint16 :offset-assert 2)
|
||||
(initial-valuef float :offset-assert 4)
|
||||
(random-rangef float :offset-assert 8)
|
||||
(random-multf float :offset-assert 12)
|
||||
(initial-value int32 :offset 4)
|
||||
(random-range int32 :offset 8)
|
||||
(random-mult int32 :offset 12)
|
||||
(initial-value int32 :offset-assert 4)
|
||||
(random-range int32 :offset-assert 8)
|
||||
(random-mult int32 :offset-assert 12)
|
||||
(initial-valuef float :offset 4) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||
(random-rangef float :offset 8) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||
(random-multf float :offset 12) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||
(func basic :offset 4)
|
||||
(tex uint32 :offset 4)
|
||||
(pntr uint32 :offset 4)
|
||||
@@ -13240,7 +13240,7 @@
|
||||
(deftype sparticle-launcher (basic)
|
||||
((birthaccum float :offset-assert 4)
|
||||
(soundaccum float :offset-assert 8)
|
||||
(init-specs uint32 :offset-assert 12)
|
||||
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
@@ -18977,7 +18977,7 @@
|
||||
(define-extern level-setup (function none))
|
||||
(define-extern target-exit function)
|
||||
(define-extern target-calc-camera-pos function)
|
||||
(define-extern do-target-shadow function)
|
||||
(define-extern do-target-shadow (function none :behavior target))
|
||||
(define-extern target-powerup-process function)
|
||||
(define-extern flag-setup function)
|
||||
(define-extern build-conversions function)
|
||||
@@ -20853,7 +20853,7 @@
|
||||
(define-extern projectile-collision-reaction function)
|
||||
(define-extern projectile-update-velocity-space-wars function)
|
||||
(define-extern find-nearest-attackable function)
|
||||
(define-extern find-ground-and-draw-shadow function)
|
||||
(define-extern find-ground-and-draw-shadow (function vector vector float uint process float float none))
|
||||
(define-extern spawn-projectile-blue function)
|
||||
|
||||
;; - Unknowns
|
||||
@@ -21010,9 +21010,9 @@
|
||||
|
||||
;; - Functions
|
||||
|
||||
(define-extern compute-and-draw-shadow function)
|
||||
(define-extern draw-shadow function)
|
||||
(define-extern add-fake-shadow-to-buffer function)
|
||||
(define-extern compute-and-draw-shadow (function vector vector vector vector float float none))
|
||||
(define-extern draw-shadow (function vector vector vector float float float none))
|
||||
(define-extern add-fake-shadow-to-buffer (function vector vector float int none))
|
||||
(define-extern swap-fake-shadow-buffers (function none))
|
||||
|
||||
|
||||
@@ -22452,8 +22452,8 @@
|
||||
:size-assert #x3c
|
||||
:flag-assert #xb0000003c
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(reset! (_type_ process-drawable float float) none 9)
|
||||
(TODO-RENAME-10 (_type_ process-drawable vector) symbol 10)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -22948,21 +22948,21 @@
|
||||
|
||||
;; - Types
|
||||
|
||||
; (deftype ticky (structure)
|
||||
; ((delay-til-ramp uint64 :offset-assert 0)
|
||||
; (delay-til-timeout uint64 :offset-assert 8)
|
||||
; (starting-time uint64 :offset-assert 16)
|
||||
; (last-tick-time uint64 :offset-assert 24)
|
||||
; )
|
||||
; :method-count-assert 12
|
||||
; :size-assert #x20
|
||||
; :flag-assert #xc00000020
|
||||
; (:methods
|
||||
; (dummy-9 () none 9)
|
||||
; (dummy-10 () none 10)
|
||||
; (dummy-11 () none 11)
|
||||
; )
|
||||
; )
|
||||
(deftype ticky (structure)
|
||||
((delay-til-ramp uint64 :offset-assert 0)
|
||||
(delay-til-timeout uint64 :offset-assert 8)
|
||||
(starting-time uint64 :offset-assert 16)
|
||||
(last-tick-time uint64 :offset-assert 24)
|
||||
)
|
||||
:method-count-assert 12
|
||||
:size-assert #x20
|
||||
:flag-assert #xc00000020
|
||||
(:methods
|
||||
(sleep (_type_ uint) none 9)
|
||||
(reached-delay? (_type_ uint) symbol 10)
|
||||
(completed? (_type_) symbol 11)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; ----------------------
|
||||
@@ -23279,25 +23279,25 @@
|
||||
|
||||
;; - Types
|
||||
|
||||
; (deftype wobbler (basic)
|
||||
; ((posx float :offset-assert 4)
|
||||
; (posy float :offset-assert 8)
|
||||
; (velx float :offset-assert 12)
|
||||
; (vely float :offset-assert 16)
|
||||
; (spring float :offset-assert 20)
|
||||
; (damping float :offset-assert 24)
|
||||
; (height float :offset-assert 28)
|
||||
; )
|
||||
; :method-count-assert 13
|
||||
; :size-assert #x20
|
||||
; :flag-assert #xd00000020
|
||||
; (:methods
|
||||
; (dummy-9 () none 9)
|
||||
; (dummy-10 () none 10)
|
||||
; (dummy-11 () none 11)
|
||||
; (dummy-12 () none 12)
|
||||
; )
|
||||
; )
|
||||
(deftype wobbler (basic)
|
||||
((posx float :offset-assert 4)
|
||||
(posy float :offset-assert 8)
|
||||
(velx float :offset-assert 12)
|
||||
(vely float :offset-assert 16)
|
||||
(spring float :offset-assert 20)
|
||||
(damping float :offset-assert 24)
|
||||
(height float :offset-assert 28)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #x20
|
||||
:flag-assert #xd00000020
|
||||
(:methods
|
||||
(reset! (_type_ float float float) none 9)
|
||||
(inc-xy-vel! (_type_ float float) none 10)
|
||||
(move! (_type_) none 11)
|
||||
(TODO-RENAME-12 (_type_ quaternion) none 12)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; ----------------------
|
||||
@@ -23308,37 +23308,40 @@
|
||||
|
||||
;; - Types
|
||||
|
||||
; (deftype twist-joint (structure)
|
||||
; ((ry float :offset-assert 0)
|
||||
; (max-dry float :offset-assert 4)
|
||||
; )
|
||||
; :method-count-assert 9
|
||||
; :size-assert #x8
|
||||
; :flag-assert #x900000008
|
||||
; )
|
||||
(deftype twist-joint (structure)
|
||||
((ry float :offset-assert 0)
|
||||
(max-dry float :offset-assert 4)
|
||||
)
|
||||
:allow-misaligned
|
||||
:method-count-assert 9
|
||||
:size-assert #x8
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
; (deftype twister (basic)
|
||||
; ((num-joints int32 :offset-assert 4)
|
||||
; (first-joint int32 :offset-assert 8)
|
||||
; (last-joint int32 :offset-assert 12)
|
||||
; (max-speed float :offset-assert 16)
|
||||
; (smoothing float :offset-assert 20)
|
||||
; (min-dist float :offset-assert 24)
|
||||
; (target float :offset-assert 28)
|
||||
; (ry float :offset-assert 32)
|
||||
; (max-speed-ry float :offset-assert 36)
|
||||
; (data UNKNOWN :dynamic :offset-assert 40)
|
||||
; )
|
||||
; :method-count-assert 13
|
||||
; :size-assert #x28
|
||||
; :flag-assert #xd00000028
|
||||
; (:methods
|
||||
; (dummy-9 () none 9)
|
||||
; (dummy-10 () none 10)
|
||||
; (dummy-11 () none 11)
|
||||
; (dummy-12 () none 12)
|
||||
; )
|
||||
; )
|
||||
(deftype twister (basic)
|
||||
((num-joints int32 :offset-assert 4)
|
||||
(first-joint int32 :offset-assert 8)
|
||||
(last-joint int32 :offset-assert 12)
|
||||
(something uint16 :offset 12)
|
||||
(max-speed float :offset-assert 16)
|
||||
(smoothing float :offset-assert 20)
|
||||
(min-dist float :offset-assert 24)
|
||||
(target float :offset-assert 28)
|
||||
(ry float :offset-assert 32)
|
||||
(max-speed-ry float :offset-assert 36)
|
||||
(data twist-joint :inline :dynamic :offset-assert 40)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #x28
|
||||
:flag-assert #xd00000028
|
||||
(:methods
|
||||
(new (symbol _type_ int int float float float float) _type_ 0)
|
||||
(TODO-RENAME-9 (_type_ int int float) none 9)
|
||||
(set-target! (_type_ float) none 10)
|
||||
(TODO-RENAME-11 (_type_) none 11)
|
||||
(TODO-RENAME-12 (_type_ process-drawable) none 12)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; ----------------------
|
||||
@@ -36912,36 +36915,15 @@
|
||||
|
||||
;; - Types
|
||||
|
||||
; (deftype mother-spider-proj (projectile)
|
||||
; ((facing-dir vector :inline :offset-assert 416)
|
||||
; )
|
||||
; :method-count-assert 29
|
||||
; :size-assert #x1b0
|
||||
; :flag-assert #x1d014001b0
|
||||
; ;; inherited inspect of projectile
|
||||
; (:methods
|
||||
; (dummy-9 () none 9)
|
||||
; (dummy-10 () none 10)
|
||||
; (dummy-11 () none 11)
|
||||
; (dummy-12 () none 12)
|
||||
; (dummy-13 () none 13)
|
||||
; (dummy-14 () none 14)
|
||||
; (dummy-15 () none 15)
|
||||
; (dummy-16 () none 16)
|
||||
; (dummy-17 () none 17)
|
||||
; (dummy-18 () none 18)
|
||||
; (dummy-19 () none 19)
|
||||
; (dummy-20 () none 20)
|
||||
; (dummy-21 () none 21)
|
||||
; (dummy-22 () none 22)
|
||||
; (dummy-23 () none 23)
|
||||
; (dummy-24 () none 24)
|
||||
; (dummy-25 () none 25)
|
||||
; (dummy-26 () none 26)
|
||||
; (dummy-27 () none 27)
|
||||
; (dummy-28 () none 28)
|
||||
; )
|
||||
; )
|
||||
(deftype mother-spider-proj (projectile)
|
||||
((facing-dir vector :inline :offset-assert 416)
|
||||
)
|
||||
:method-count-assert 29
|
||||
:heap-base #x140
|
||||
:size-assert #x1b0
|
||||
:flag-assert #x1d014001b0
|
||||
;; inherited inspect of projectile
|
||||
)
|
||||
|
||||
;; - Functions
|
||||
|
||||
|
||||
@@ -1412,6 +1412,30 @@
|
||||
["L497", "float", true],
|
||||
["L508", "float", true]
|
||||
],
|
||||
"shadow": [
|
||||
["L23", "sparticle-launcher", true],
|
||||
["L26", "float", true],
|
||||
["L27", "float", true],
|
||||
["L28", "float", true]
|
||||
],
|
||||
|
||||
"tippy": [
|
||||
["L7", "float", true]
|
||||
],
|
||||
|
||||
"ticky": [
|
||||
["L7", "float", true],
|
||||
["L8", "float", true],
|
||||
["L10", "uint64", true]
|
||||
],
|
||||
|
||||
"wobbler": [
|
||||
["L6", "float", true]
|
||||
],
|
||||
|
||||
"twister": [
|
||||
["L20", "float", true]
|
||||
],
|
||||
|
||||
"misty-teetertotter": [
|
||||
["L2", "_lambda_", true],
|
||||
|
||||
@@ -820,6 +820,34 @@
|
||||
"draw-ocean-transition-seams": [
|
||||
[16, "sphere"]
|
||||
],
|
||||
|
||||
"(method 10 tippy)": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"compute-and-draw-shadow": [
|
||||
[16, "vector"],
|
||||
[32, "vector"],
|
||||
[48, "sparticle-cpuinfo"] // kinda a guess
|
||||
],
|
||||
|
||||
"find-ground-and-draw-shadow": [
|
||||
[16, "vector"],
|
||||
[32, "vector"],
|
||||
[48, "bone"] // what a guess!
|
||||
],
|
||||
|
||||
"(method 20 collide-cache)": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"(method 12 wobbler)": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"(method 12 twister)": [
|
||||
[16, "matrix"]
|
||||
],
|
||||
|
||||
"target-on-end-of-teetertotter?": [
|
||||
[16, "vector"],
|
||||
|
||||
@@ -1787,6 +1787,24 @@
|
||||
|
||||
"draw-ocean-transition": [[255, "v1", "ocean-mid-mask"]],
|
||||
|
||||
"do-target-shadow": [
|
||||
[[0, 999], "s6", "target"],
|
||||
[46, "v1", "collide-shape-prim"] // `event-other` from collide-shape
|
||||
],
|
||||
|
||||
"(method 11 twister)": [
|
||||
[7, "s4", "twist-joint"],
|
||||
[13, "s4", "twist-joint"],
|
||||
[26, "s4", "twist-joint"],
|
||||
[28, "s4", "twist-joint"],
|
||||
[36, "s4", "twist-joint"],
|
||||
[40, "s4", "twist-joint"],
|
||||
[47, "s4", "twist-joint"],
|
||||
[55, "s4", "twist-joint"],
|
||||
[70, "s4", "twist-joint"],
|
||||
[82, "s4", "twist-joint"]
|
||||
],
|
||||
|
||||
"(anon-function 2 misty-teetertotter)": [
|
||||
[11, "v1", "art-joint-anim"]
|
||||
],
|
||||
|
||||
@@ -288,7 +288,7 @@ int index_of_closest_following_label_in_segment(int start_byte,
|
||||
for (int i = 0; i < (int)labels.size(); i++) {
|
||||
const auto& label = labels.at(i);
|
||||
if (label.target_segment == seg) {
|
||||
if (result_idx == -1) {
|
||||
if (result_idx == -1 && label.offset > start_byte) {
|
||||
result_idx = i;
|
||||
closest_byte = label.offset;
|
||||
} else {
|
||||
@@ -419,6 +419,20 @@ goos::Object ocean_mid_masks_decompile(const std::vector<LinkedWord>& words,
|
||||
data_field, all_words, file,
|
||||
TypeSpec("ocean-mid-mask"), 8);
|
||||
}
|
||||
|
||||
goos::Object sp_field_init_spec_decompile(const std::vector<LinkedWord>& words,
|
||||
const std::vector<DecompilerLabel>& labels,
|
||||
int my_seg,
|
||||
int field_location,
|
||||
const TypeSystem& ts,
|
||||
const Field& data_field,
|
||||
const std::vector<std::vector<LinkedWord>>& all_words,
|
||||
const LinkedObjectFile* file) {
|
||||
return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts,
|
||||
data_field, all_words, file,
|
||||
TypeSpec("sp-field-init-spec"), 16);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
goos::Object decompile_structure(const TypeSpec& type,
|
||||
@@ -608,6 +622,10 @@ goos::Object decompile_structure(const TypeSpec& type,
|
||||
field_defs_out.emplace_back(
|
||||
field.name(), ocean_mid_masks_decompile(obj_words, labels, label.target_segment,
|
||||
field_start, ts, field, words, file));
|
||||
} else if (field.name() == "init-specs" && type.print() == "sparticle-launcher") {
|
||||
field_defs_out.emplace_back(
|
||||
field.name(), sp_field_init_spec_decompile(obj_words, labels, label.target_segment,
|
||||
field_start, ts, field, words, file));
|
||||
} else {
|
||||
std::vector<u8> bytes_out;
|
||||
for (int byte_idx = field_start; byte_idx < field_end; byte_idx++) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,8 +1,11 @@
|
||||
{
|
||||
"jak1": {
|
||||
"locPercentage": {
|
||||
"value": 117858,
|
||||
"label": "Lines of Code"
|
||||
"fileProgress": {
|
||||
"src_files_total": 514,
|
||||
"src_files_finished": 55,
|
||||
"src_files_started": 177,
|
||||
"data_files_total": 584,
|
||||
"data_files_started": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,13 +58,33 @@
|
||||
<v-col cols="10">
|
||||
<v-subheader>Decompilation</v-subheader>
|
||||
<v-progress-linear
|
||||
color="teal"
|
||||
color="green"
|
||||
buffer-value="0"
|
||||
:value="jak1BlackLabelStatus.decompDone"
|
||||
:value="jak1BlackLabelStatus.srcFilesFinishedValue"
|
||||
stream
|
||||
height="25"
|
||||
>
|
||||
{{jak1BlackLabelStatus.decompLabel}} - {{jak1BlackLabelStatus.decompDone}}%
|
||||
Source Files Finished - {{ jak1BlackLabelStatus.srcFilesFinished }} / {{ jak1BlackLabelStatus.srcFilesTotal }}
|
||||
</v-progress-linear>
|
||||
<br>
|
||||
<v-progress-linear
|
||||
color="yellow"
|
||||
buffer-value="0"
|
||||
:value="jak1BlackLabelStatus.srcFilesStartedValue"
|
||||
stream
|
||||
height="25"
|
||||
>
|
||||
Source Files Started - {{ jak1BlackLabelStatus.srcFilesStarted }} / {{ jak1BlackLabelStatus.srcFilesTotal }}
|
||||
</v-progress-linear>
|
||||
<br>
|
||||
<v-progress-linear
|
||||
color="teal"
|
||||
buffer-value="0"
|
||||
:value="jak1BlackLabelStatus.dataFilesStartedValue"
|
||||
stream
|
||||
height="25"
|
||||
>
|
||||
Data Files Started - {{ jak1BlackLabelStatus.dataFilesStarted }} / {{ jak1BlackLabelStatus.dataFilesTotal }}
|
||||
</v-progress-linear>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -129,8 +149,14 @@ export default {
|
||||
return {
|
||||
recentPRs: [],
|
||||
jak1BlackLabelStatus: {
|
||||
decompDone: (projectProgress.jak1.locPercentage.value / 750000.0) * 100.0,
|
||||
decompLabel: projectProgress.jak1.locPercentage.label
|
||||
srcFilesTotal: projectProgress.jak1.fileProgress.src_files_total,
|
||||
srcFilesFinished: projectProgress.jak1.fileProgress.src_files_finished,
|
||||
srcFilesFinishedValue: projectProgress.jak1.fileProgress.src_files_finished / projectProgress.jak1.fileProgress.src_files_total * 100,
|
||||
srcFilesStarted: projectProgress.jak1.fileProgress.src_files_started,
|
||||
srcFilesStartedValue: projectProgress.jak1.fileProgress.src_files_started / projectProgress.jak1.fileProgress.src_files_total * 100,
|
||||
dataFilesTotal: projectProgress.jak1.fileProgress.data_files_total,
|
||||
dataFilesStarted: projectProgress.jak1.fileProgress.data_files_started,
|
||||
dataFilesStartedValue: projectProgress.jak1.fileProgress.data_files_started / projectProgress.jak1.fileProgress.data_files_total * 100,
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -152,7 +178,7 @@ export default {
|
||||
const numPRs = 9;
|
||||
for (var i = 0; i < numPRs; i++) {
|
||||
var pr = data.items[i];
|
||||
if (pr.body.length == 0) {
|
||||
if (pr,body == null || pr.body.length == 0) {
|
||||
pr.body = "No Description";
|
||||
}
|
||||
pr.body = this.truncateString(pr.body, 250);
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/jak-project/favicon.png"><title>OpenGOAL Tooling</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link href="/jak-project/css/about.8d0e9591.css" rel="prefetch"><link href="/jak-project/js/about.93743c22.js" rel="prefetch"><link href="/jak-project/css/chunk-vendors.b018c88a.css" rel="preload" as="style"><link href="/jak-project/js/app.1e67702b.js" rel="preload" as="script"><link href="/jak-project/js/chunk-vendors.f27e8f37.js" rel="preload" as="script"><link href="/jak-project/css/chunk-vendors.b018c88a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but docs-and-tooling doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/jak-project/js/chunk-vendors.f27e8f37.js"></script><script src="/jak-project/js/app.1e67702b.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/jak-project/favicon.png"><title>OpenGOAL Tooling</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link href="/jak-project/css/about.bf16c6ab.css" rel="prefetch"><link href="/jak-project/js/about.e560ddd1.js" rel="prefetch"><link href="/jak-project/css/chunk-vendors.b018c88a.css" rel="preload" as="style"><link href="/jak-project/js/app.b9111cd5.js" rel="preload" as="script"><link href="/jak-project/js/chunk-vendors.874e560a.js" rel="preload" as="script"><link href="/jak-project/css/chunk-vendors.b018c88a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but docs-and-tooling doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/jak-project/js/chunk-vendors.874e560a.js"></script><script src="/jak-project/js/app.b9111cd5.js"></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
(function(e){function t(t){for(var n,o,i=t[0],c=t[1],l=t[2],s=0,p=[];s<i.length;s++)o=i[s],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&p.push(a[o][0]),a[o]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);f&&f(t);while(p.length)p.shift()();return u.push.apply(u,l||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(u.splice(t--,1),e=c(c.s=r[0]))}return e}var n={},o={app:0},a={app:0},u=[];function i(e){return c.p+"js/"+({about:"about"}[e]||e)+"."+{about:"93743c22"}[e]+".js"}function c(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.e=function(e){var t=[],r={about:1};o[e]?t.push(o[e]):0!==o[e]&&r[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="css/"+({about:"about"}[e]||e)+"."+{about:"8d0e9591"}[e]+".css",a=c.p+n,u=document.getElementsByTagName("link"),i=0;i<u.length;i++){var l=u[i],s=l.getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(s===n||s===a))return t()}var p=document.getElementsByTagName("style");for(i=0;i<p.length;i++){l=p[i],s=l.getAttribute("data-href");if(s===n||s===a)return t()}var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onload=t,f.onerror=function(t){var n=t&&t.target&&t.target.src||a,u=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=n,delete o[e],f.parentNode.removeChild(f),r(u)},f.href=a;var d=document.getElementsByTagName("head")[0];d.appendChild(f)})).then((function(){o[e]=0})));var n=a[e];if(0!==n)if(n)t.push(n[2]);else{var u=new Promise((function(t,r){n=a[e]=[t,r]}));t.push(n[2]=u);var l,s=document.createElement("script");s.charset="utf-8",s.timeout=120,c.nc&&s.setAttribute("nonce",c.nc),s.src=i(e);var p=new Error;l=function(t){s.onerror=s.onload=null,clearTimeout(f);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;p.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",p.name="ChunkLoadError",p.type=n,p.request=o,r[1](p)}a[e]=void 0}};var f=setTimeout((function(){l({type:"timeout",target:s})}),12e4);s.onerror=s.onload=l,document.head.appendChild(s)}return Promise.all(t)},c.m=e,c.c=n,c.d=function(e,t,r){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(c.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(r,n,function(t){return e[t]}.bind(null,n));return r},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/jak-project/",c.oe=function(e){throw console.error(e),e};var l=window["webpackJsonp"]=window["webpackJsonp"]||[],s=l.push.bind(l);l.push=t,l=l.slice();for(var p=0;p<l.length;p++)t(l[p]);var f=s;u.push([0,"chunk-vendors"]),r()})({0:function(e,t,r){e.exports=r("56d7")},"56d7":function(e,t,r){"use strict";r.r(t);r("e260"),r("e6cf"),r("cca6"),r("a79d");var n=r("2b0e"),o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-app",[r("v-main",[r("router-view")],1)],1)},a=[],u={name:"App",components:{},data:function(){return{}}},i=u,c=r("2877"),l=r("6544"),s=r.n(l),p=r("7496"),f=r("f6c4"),d=Object(c["a"])(i,o,a,!1,null,null,null),h=d.exports;s()(d,{VApp:p["a"],VMain:f["a"]});var m=r("f309");n["a"].use(m["a"]);var v=new m["a"]({theme:{dark:!0}}),b=(r("d3b7"),r("3ca3"),r("ddb0"),r("8c4f"));n["a"].use(b["a"]);var g=[{path:"/",name:"Home",component:function(){return r.e("about").then(r.bind(null,"bb51"))}}],y=new b["a"]({mode:"history",base:"/jak-project/",routes:g}),w=y;n["a"].config.productionTip=!1,new n["a"]({vuetify:v,router:w,render:function(e){return e(h)}}).$mount("#app")}});
|
||||
//# sourceMappingURL=app.1e67702b.js.map
|
||||
(function(e){function t(t){for(var n,o,i=t[0],c=t[1],l=t[2],s=0,p=[];s<i.length;s++)o=i[s],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&p.push(a[o][0]),a[o]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);f&&f(t);while(p.length)p.shift()();return u.push.apply(u,l||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,o=1;o<r.length;o++){var i=r[o];0!==a[i]&&(n=!1)}n&&(u.splice(t--,1),e=c(c.s=r[0]))}return e}var n={},o={app:0},a={app:0},u=[];function i(e){return c.p+"js/"+({about:"about"}[e]||e)+"."+{about:"e560ddd1"}[e]+".js"}function c(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.e=function(e){var t=[],r={about:1};o[e]?t.push(o[e]):0!==o[e]&&r[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="css/"+({about:"about"}[e]||e)+"."+{about:"bf16c6ab"}[e]+".css",a=c.p+n,u=document.getElementsByTagName("link"),i=0;i<u.length;i++){var l=u[i],s=l.getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(s===n||s===a))return t()}var p=document.getElementsByTagName("style");for(i=0;i<p.length;i++){l=p[i],s=l.getAttribute("data-href");if(s===n||s===a)return t()}var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onload=t,f.onerror=function(t){var n=t&&t.target&&t.target.src||a,u=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=n,delete o[e],f.parentNode.removeChild(f),r(u)},f.href=a;var d=document.getElementsByTagName("head")[0];d.appendChild(f)})).then((function(){o[e]=0})));var n=a[e];if(0!==n)if(n)t.push(n[2]);else{var u=new Promise((function(t,r){n=a[e]=[t,r]}));t.push(n[2]=u);var l,s=document.createElement("script");s.charset="utf-8",s.timeout=120,c.nc&&s.setAttribute("nonce",c.nc),s.src=i(e);var p=new Error;l=function(t){s.onerror=s.onload=null,clearTimeout(f);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;p.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",p.name="ChunkLoadError",p.type=n,p.request=o,r[1](p)}a[e]=void 0}};var f=setTimeout((function(){l({type:"timeout",target:s})}),12e4);s.onerror=s.onload=l,document.head.appendChild(s)}return Promise.all(t)},c.m=e,c.c=n,c.d=function(e,t,r){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(c.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(r,n,function(t){return e[t]}.bind(null,n));return r},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/jak-project/",c.oe=function(e){throw console.error(e),e};var l=window["webpackJsonp"]=window["webpackJsonp"]||[],s=l.push.bind(l);l.push=t,l=l.slice();for(var p=0;p<l.length;p++)t(l[p]);var f=s;u.push([0,"chunk-vendors"]),r()})({0:function(e,t,r){e.exports=r("56d7")},"56d7":function(e,t,r){"use strict";r.r(t);r("e260"),r("e6cf"),r("cca6"),r("a79d");var n=r("2b0e"),o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-app",[r("v-main",[r("router-view")],1)],1)},a=[],u={name:"App",components:{},data:function(){return{}}},i=u,c=r("2877"),l=r("6544"),s=r.n(l),p=r("7496"),f=r("f6c4"),d=Object(c["a"])(i,o,a,!1,null,null,null),h=d.exports;s()(d,{VApp:p["a"],VMain:f["a"]});var m=r("f309");n["a"].use(m["a"]);var v=new m["a"]({theme:{dark:!0}}),b=(r("d3b7"),r("3ca3"),r("ddb0"),r("8c4f"));n["a"].use(b["a"]);var g=[{path:"/",name:"Home",component:function(){return r.e("about").then(r.bind(null,"bb51"))}}],y=new b["a"]({mode:"history",base:"/jak-project/",routes:g}),w=y;n["a"].config.productionTip=!1,new n["a"]({vuetify:v,router:w,render:function(e){return e(h)}}).$mount("#app")}});
|
||||
//# sourceMappingURL=app.b9111cd5.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -73,6 +73,7 @@ set(RUNTIME_SOURCE
|
||||
overlord/stream.cpp
|
||||
graphics/gfx.cpp
|
||||
graphics/display.cpp
|
||||
graphics/pipelines/opengl.cpp
|
||||
system/vm/dmac.cpp
|
||||
system/vm/vm.cpp)
|
||||
|
||||
|
||||
+112
-35
@@ -4,51 +4,128 @@
|
||||
*/
|
||||
|
||||
#include "display.h"
|
||||
#include "gfx.h"
|
||||
|
||||
#include "common/log/log.h"
|
||||
|
||||
namespace Display {
|
||||
/* ****************************** */
|
||||
/* Internal functions */
|
||||
/* ****************************** */
|
||||
|
||||
GLFWwindow* display = NULL;
|
||||
namespace {
|
||||
|
||||
void InitDisplay(int width, int height, const char* title, GLFWwindow*& d) {
|
||||
if (d) {
|
||||
lg::warn("InitDisplay has already created a display window");
|
||||
return;
|
||||
}
|
||||
|
||||
// request OpenGL 3.0 (placeholder)
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
d = glfwCreateWindow(width, height, title, NULL, NULL);
|
||||
|
||||
if (!d) {
|
||||
lg::error("InitDisplay failed - Could not create display window");
|
||||
return;
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(d);
|
||||
if (!gladLoadGL()) {
|
||||
lg::error("GL init fail");
|
||||
KillDisplay(d);
|
||||
return;
|
||||
}
|
||||
|
||||
// enable vsync by default
|
||||
glfwSwapInterval(1);
|
||||
|
||||
lg::debug("init display #x{}", (uintptr_t)d);
|
||||
bool renderer_is_correct(const GfxRendererModule* renderer, GfxPipeline pipeline) {
|
||||
return renderer->pipeline == pipeline;
|
||||
}
|
||||
|
||||
void KillDisplay(GLFWwindow*& d) {
|
||||
lg::debug("kill display #x{}", (uintptr_t)d);
|
||||
if (!d) {
|
||||
lg::warn("KillDisplay called when no display was available");
|
||||
void set_main_display(std::shared_ptr<GfxDisplay> display) {
|
||||
if (Display::g_displays.size() > 0) {
|
||||
Display::g_displays[0] = display;
|
||||
} else {
|
||||
Display::g_displays.push_back(display);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
/* ****************************** */
|
||||
/* GfxDisplay */
|
||||
/* ****************************** */
|
||||
|
||||
GfxDisplay::GfxDisplay(GLFWwindow* a_window) {
|
||||
set_renderer(GfxPipeline::OpenGL);
|
||||
set_window(a_window);
|
||||
}
|
||||
|
||||
GfxDisplay::~GfxDisplay() {
|
||||
m_renderer->kill_display(this);
|
||||
// window_generic_ptr = nullptr;
|
||||
}
|
||||
|
||||
void GfxDisplay::set_renderer(GfxPipeline pipeline) {
|
||||
if (is_active()) {
|
||||
lg::error("Can't change display's renderer while window exists.");
|
||||
return;
|
||||
}
|
||||
if (m_renderer != nullptr) {
|
||||
lg::error("A display changed renderer unexpectedly.");
|
||||
return;
|
||||
}
|
||||
|
||||
glfwDestroyWindow(d);
|
||||
d = NULL;
|
||||
m_renderer = Gfx::GetRenderer(pipeline);
|
||||
}
|
||||
|
||||
void GfxDisplay::set_window(GLFWwindow* window) {
|
||||
if (!renderer_is_correct(m_renderer, GfxPipeline::OpenGL)) {
|
||||
lg::error("Can't set OpenGL window when using {}", m_renderer->name);
|
||||
return;
|
||||
}
|
||||
if (is_active()) {
|
||||
lg::error("Already have a window. Close window first.");
|
||||
return;
|
||||
}
|
||||
|
||||
this->window_glfw = window;
|
||||
}
|
||||
|
||||
void GfxDisplay::set_title(const char* title) {
|
||||
if (!is_active()) {
|
||||
lg::error("No window to set title `{}`.", title);
|
||||
return;
|
||||
}
|
||||
|
||||
m_title = title;
|
||||
}
|
||||
|
||||
void GfxDisplay::render_graphics() {
|
||||
m_renderer->render_display(this);
|
||||
}
|
||||
|
||||
/* ****************************** */
|
||||
/* DISPLAY */
|
||||
/* ****************************** */
|
||||
|
||||
namespace Display {
|
||||
|
||||
std::vector<std::shared_ptr<GfxDisplay>> g_displays;
|
||||
std::shared_ptr<GfxDisplay> GetMainDisplay() {
|
||||
if (g_displays.size() == 0)
|
||||
return NULL;
|
||||
return g_displays.front()->is_active() ? g_displays.front() : NULL;
|
||||
}
|
||||
|
||||
int InitMainDisplay(int width, int height, const char* title, GfxSettings& settings) {
|
||||
if (GetMainDisplay() != NULL) {
|
||||
lg::warn("InitMainDisplay called when main display already exists.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto display = settings.renderer->make_main_display(width, height, title, settings);
|
||||
if (display == NULL) {
|
||||
lg::error("Failed to make main display.");
|
||||
return 1;
|
||||
}
|
||||
set_main_display(display);
|
||||
}
|
||||
|
||||
void KillDisplay(std::shared_ptr<GfxDisplay> display) {
|
||||
// lg::debug("kill display #x{:x}", (uintptr_t)display);
|
||||
if (!display->is_active()) {
|
||||
lg::warn("display #x{:x} cant be killed because it is not active");
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetMainDisplay() == display) {
|
||||
// killing the main display, kill all children displays too!
|
||||
for (int i = 1; i < g_displays.size(); ++i) {
|
||||
KillDisplay(g_displays.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
// find this display in the list and remove it from there
|
||||
// if everything went right the smart pointer should delete the display.
|
||||
auto this_disp = std::find(g_displays.begin(), g_displays.end(), display);
|
||||
g_displays.erase(this_disp);
|
||||
}
|
||||
|
||||
} // namespace Display
|
||||
|
||||
+38
-11
@@ -5,21 +5,48 @@
|
||||
* Display for graphics. This is the game window, distinct from the runtime console.
|
||||
*/
|
||||
|
||||
#ifndef RUNTIME_DISPLAY_H
|
||||
#define RUNTIME_DISPLAY_H
|
||||
#include "pipelines/opengl.h"
|
||||
#include "gfx.h"
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include "opengl.h"
|
||||
// a GfxDisplay class is equivalent to a window that displays stuff. This holds an actual internal
|
||||
// window pointer used by whichever renderer. It also contains functions for setting and
|
||||
// retrieving certain window parameters.
|
||||
class GfxDisplay {
|
||||
const char* m_title;
|
||||
|
||||
const GfxRendererModule* m_renderer = nullptr;
|
||||
|
||||
public:
|
||||
GfxDisplay(GLFWwindow* a_window); // OpenGL window constructor
|
||||
~GfxDisplay(); // destructor - this calls the renderer's function for getting rid of a window,
|
||||
// and we can then get rid of the GfxDisplay itself
|
||||
|
||||
// all kinds of windows for the display
|
||||
union {
|
||||
void* window_generic_ptr = nullptr;
|
||||
GLFWwindow* window_glfw;
|
||||
};
|
||||
|
||||
bool is_active() const { return window_generic_ptr != nullptr; }
|
||||
void set_renderer(GfxPipeline pipeline);
|
||||
void set_window(GLFWwindow* window);
|
||||
void set_title(const char* title);
|
||||
const char* get_title() const { return m_title; }
|
||||
|
||||
void render_graphics();
|
||||
};
|
||||
|
||||
namespace Display {
|
||||
|
||||
// TODO - eventually we might actually want to support having multiple windows and viewpoints
|
||||
// so it would be nice if we didn't end up designing this system such that this MUST be
|
||||
// a single window.
|
||||
extern GLFWwindow* display;
|
||||
// a list of displays. the first one is the "main" display, all others are spectator-like extra
|
||||
// views.
|
||||
extern std::vector<std::shared_ptr<GfxDisplay>> g_displays;
|
||||
|
||||
void InitDisplay(int width, int height, const char* title, GLFWwindow*& d);
|
||||
void KillDisplay(GLFWwindow*& d);
|
||||
int InitMainDisplay(int width, int height, const char* title, GfxSettings& settings);
|
||||
void KillDisplay(std::shared_ptr<GfxDisplay> display);
|
||||
|
||||
std::shared_ptr<GfxDisplay> GetMainDisplay();
|
||||
|
||||
} // namespace Display
|
||||
|
||||
#endif // RUNTIME_DISPLAY_H
|
||||
|
||||
+48
-31
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @file gfx.cpp
|
||||
* Graphics component for the runtime. Handles some low-level routines.
|
||||
* Graphics component for the runtime. Abstraction layer for the main graphics routines.
|
||||
*/
|
||||
|
||||
#include "gfx.h"
|
||||
@@ -9,62 +9,79 @@
|
||||
#include "game/runtime.h"
|
||||
#include "display.h"
|
||||
|
||||
#include "opengl.h"
|
||||
#include "pipelines/opengl.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// initializes a gfx settings.
|
||||
// TODO save and load from file
|
||||
void InitSettings(GfxSettings& settings) {
|
||||
// use opengl by default for now
|
||||
settings.renderer = Gfx::GetRenderer(GfxPipeline::OpenGL); // Gfx::renderers[0];
|
||||
|
||||
// 1 screen update per frame
|
||||
settings.vsync = 1;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
void GlfwErrorCallback(int err, const char* msg) {
|
||||
lg::error("GLFW ERR {}: " + std::string(msg), err);
|
||||
GfxVertex g_vertices_temp[VERTEX_BUFFER_LENGTH_TEMP];
|
||||
|
||||
GfxSettings g_settings;
|
||||
// const std::vector<const GfxRendererModule*> renderers = {&moduleOpenGL};
|
||||
|
||||
const GfxRendererModule* GetRenderer(GfxPipeline pipeline) {
|
||||
switch (pipeline) {
|
||||
case GfxPipeline::Invalid:
|
||||
lg::error("Requested invalid graphics pipeline!");
|
||||
return NULL;
|
||||
break;
|
||||
case GfxPipeline::OpenGL:
|
||||
return &moduleOpenGL;
|
||||
default:
|
||||
lg::error("Unknown graphics pipeline {}", (u64)pipeline);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
u32 Init() {
|
||||
if (glfwSetErrorCallback(GlfwErrorCallback) != NULL) {
|
||||
lg::warn("glfwSetErrorCallback has been re-set!");
|
||||
}
|
||||
lg::info("GFX Init");
|
||||
// initialize settings
|
||||
InitSettings(g_settings);
|
||||
|
||||
if (!glfwInit()) {
|
||||
lg::error("glfwInit error");
|
||||
if (g_settings.renderer->init()) {
|
||||
lg::error("Gfx::Init error");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (g_main_thread_id != std::this_thread::get_id()) {
|
||||
lg::warn("ran Gfx::Init outside main thread. Init display elsewhere?");
|
||||
} else {
|
||||
Display::InitDisplay(640, 480, "testy", Display::display);
|
||||
Display::InitMainDisplay(640, 480, "testy", g_settings);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Loop(std::function<bool()> f) {
|
||||
lg::info("GFX Loop");
|
||||
while (f()) {
|
||||
// run display-specific things
|
||||
if (Display::display) {
|
||||
// check if we have a display
|
||||
if (Display::GetMainDisplay()) {
|
||||
// lg::debug("run display");
|
||||
glfwMakeContextCurrent(Display::display);
|
||||
|
||||
// render graphics
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glfwSwapBuffers(Display::display);
|
||||
|
||||
// poll events TODO integrate input with cpad
|
||||
glfwPollEvents();
|
||||
|
||||
// exit if display window was closed
|
||||
if (glfwWindowShouldClose(Display::display)) {
|
||||
// Display::KillDisplay(Display::display);
|
||||
MasterExit = 2;
|
||||
}
|
||||
Display::GetMainDisplay()->render_graphics();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 Exit() {
|
||||
lg::debug("gfx exit");
|
||||
Display::KillDisplay(Display::display);
|
||||
glfwTerminate();
|
||||
glfwSetErrorCallback(NULL);
|
||||
lg::info("GFX Exit");
|
||||
Display::KillDisplay(Display::GetMainDisplay());
|
||||
g_settings.renderer->exit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+51
-7
@@ -2,23 +2,67 @@
|
||||
|
||||
/*!
|
||||
* @file gfx.h
|
||||
* Graphics component for the runtime. Handles some low-level routines.
|
||||
* Graphics component for the runtime. Abstraction layer for the main graphics routines.
|
||||
*/
|
||||
|
||||
#ifndef RUNTIME_GFX_H
|
||||
#define RUNTIME_GFX_H
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include "common/common_types.h"
|
||||
#include "display.h"
|
||||
#include "game/kernel/kboot.h"
|
||||
|
||||
// forward declarations
|
||||
struct GfxSettings;
|
||||
class GfxDisplay;
|
||||
|
||||
// enum for rendering pipeline
|
||||
enum class GfxPipeline { Invalid = 0, OpenGL };
|
||||
|
||||
// module for the different rendering pipelines
|
||||
struct GfxRendererModule {
|
||||
std::function<int()> init;
|
||||
std::function<std::shared_ptr<GfxDisplay>(int w, int h, const char* title, GfxSettings& settings)>
|
||||
make_main_display;
|
||||
std::function<void(GfxDisplay* display)> kill_display;
|
||||
std::function<void(GfxDisplay* display)> render_display;
|
||||
std::function<void()> exit;
|
||||
|
||||
GfxPipeline pipeline;
|
||||
const char* name;
|
||||
};
|
||||
|
||||
// store settings related to the gfx systems
|
||||
struct GfxSettings {
|
||||
const GfxRendererModule* renderer; // which rendering pipeline to use.
|
||||
|
||||
int vsync; // (temp) number of screen update per frame
|
||||
};
|
||||
|
||||
// struct for a single vertex. this should in theory be renderer-agnostic
|
||||
struct GfxVertex {
|
||||
// x y z
|
||||
float x, y, z;
|
||||
|
||||
// rgba or the full u32 thing.
|
||||
union {
|
||||
u32 rgba;
|
||||
struct {
|
||||
u8 r, g, b, a;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
static constexpr int VERTEX_BUFFER_LENGTH_TEMP = 4096;
|
||||
extern GfxVertex g_vertices_temp[VERTEX_BUFFER_LENGTH_TEMP];
|
||||
|
||||
extern GfxSettings g_settings;
|
||||
// extern const std::vector<const GfxRendererModule*> renderers;
|
||||
|
||||
const GfxRendererModule* GetRenderer(GfxPipeline pipeline);
|
||||
|
||||
u32 Init();
|
||||
void Loop(std::function<bool()> f);
|
||||
u32 Exit();
|
||||
|
||||
} // namespace Gfx
|
||||
|
||||
#endif // RUNTIME_GFX_H
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
/*!
|
||||
* @file opengl.h
|
||||
* OpenGL includes.
|
||||
*/
|
||||
|
||||
#ifndef RUNTIME_OPENGL_H
|
||||
#define RUNTIME_OPENGL_H
|
||||
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#endif // RUNTIME_OPENGL_H
|
||||
@@ -0,0 +1,127 @@
|
||||
/*!
|
||||
* @file opengl.cpp
|
||||
* Lower-level OpenGL implementation.
|
||||
*/
|
||||
|
||||
#include "opengl.h"
|
||||
|
||||
#include "game/graphics/gfx.h"
|
||||
#include "game/graphics/display.h"
|
||||
|
||||
#include "common/log/log.h"
|
||||
#include <memory>
|
||||
|
||||
namespace {
|
||||
|
||||
void SetDisplayCallbacks(GLFWwindow* d) {
|
||||
glfwSetKeyCallback(d, [](GLFWwindow* window, int key, int scancode, int action, int mods) {
|
||||
if (action == GlfwKeyAction::Press) {
|
||||
lg::debug("KEY PRESS: key: {} scancode: {} mods: {:X}", key, scancode, mods);
|
||||
} else if (action == GlfwKeyAction::Release) {
|
||||
lg::debug("KEY RELEASE: key: {} scancode: {} mods: {:X}", key, scancode, mods);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ErrorCallback(int err, const char* msg) {
|
||||
lg::error("GLFW ERR {}: " + std::string(msg), err);
|
||||
}
|
||||
|
||||
bool HasError() {
|
||||
return glfwGetError(NULL) != GLFW_NO_ERROR;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
static bool gl_inited = false;
|
||||
static int gl_init() {
|
||||
if (glfwSetErrorCallback(ErrorCallback) != NULL) {
|
||||
lg::warn("glfwSetErrorCallback has been re-set!");
|
||||
}
|
||||
|
||||
if (glfwInit() == GLFW_FALSE) {
|
||||
lg::error("glfwInit error");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// request OpenGL 3.0 (placeholder)
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gl_exit() {
|
||||
glfwTerminate();
|
||||
glfwSetErrorCallback(NULL);
|
||||
}
|
||||
|
||||
static std::shared_ptr<GfxDisplay> gl_make_main_display(int width,
|
||||
int height,
|
||||
const char* title,
|
||||
GfxSettings& settings) {
|
||||
GLFWwindow* window = glfwCreateWindow(width, height, title, NULL, NULL);
|
||||
|
||||
if (!window) {
|
||||
lg::error("gl_make_main_display failed - Could not create display window");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
if (!gl_inited && !gladLoadGL()) {
|
||||
lg::error("GL init fail");
|
||||
return NULL;
|
||||
}
|
||||
gl_inited = true;
|
||||
|
||||
// enable vsync by default
|
||||
// glfwSwapInterval(1);
|
||||
glfwSwapInterval(settings.vsync);
|
||||
|
||||
SetDisplayCallbacks(window);
|
||||
|
||||
if (HasError()) {
|
||||
lg::error("gl_make_main_display error");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::shared_ptr<GfxDisplay> display = std::make_shared<GfxDisplay>(window);
|
||||
// lg::debug("init display #x{:x}", (uintptr_t)display);
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
static void gl_kill_display(GfxDisplay* display) {
|
||||
glfwDestroyWindow(display->window_glfw);
|
||||
}
|
||||
|
||||
static void gl_render_display(GfxDisplay* display) {
|
||||
GLFWwindow* window = display->window_glfw;
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
// render graphics
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
|
||||
// poll events TODO integrate input with cpad
|
||||
glfwPollEvents();
|
||||
|
||||
// exit if display window was closed
|
||||
if (glfwWindowShouldClose(window)) {
|
||||
// Display::KillDisplay(window);
|
||||
MasterExit = 2;
|
||||
}
|
||||
}
|
||||
|
||||
const GfxRendererModule moduleOpenGL = {
|
||||
gl_init, // init
|
||||
gl_make_main_display, // make_main_display
|
||||
gl_kill_display, // kill_display
|
||||
gl_render_display, // render_display
|
||||
gl_exit, // exit
|
||||
GfxPipeline::OpenGL, // pipeline
|
||||
"OpenGL 3.0" // name
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
/*!
|
||||
* @file opengl.h
|
||||
* OpenGL includes.
|
||||
*/
|
||||
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "game/graphics/gfx.h"
|
||||
|
||||
enum GlfwKeyAction {
|
||||
Release = GLFW_RELEASE, // falling edge of key press
|
||||
Press = GLFW_PRESS, // rising edge of key press
|
||||
Repeat = GLFW_REPEAT // repeated input on hold e.g. when typing something
|
||||
};
|
||||
|
||||
extern const GfxRendererModule moduleOpenGL;
|
||||
@@ -48,9 +48,7 @@
|
||||
#include "game/overlord/stream.h"
|
||||
#include "game/overlord/sbank.h"
|
||||
|
||||
#include "game/graphics/opengl.h"
|
||||
#include "game/graphics/gfx.h"
|
||||
#include "game/graphics/display.h"
|
||||
|
||||
#include "game/system/vm/vm.h"
|
||||
#include "game/system/vm/dmac.h"
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
* Not meant to work as a full DMAC emulator, just enough to inspect DMA packets.
|
||||
*/
|
||||
|
||||
#ifndef VM_DMAC_H
|
||||
#define VM_DMAC_H
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "game/kernel/Ptr.h"
|
||||
|
||||
@@ -73,5 +70,3 @@ static_assert(alignof(DmaChannelRegisters) == 0x10, "DmaChannelRegisters unalign
|
||||
void dmac_init_globals();
|
||||
|
||||
} // namespace VM
|
||||
|
||||
#endif // VM_DMAC_H
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
* Not an emulator!
|
||||
*/
|
||||
|
||||
#ifndef VM_H
|
||||
#define VM_H
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace VM {
|
||||
@@ -33,5 +30,3 @@ void unsubscribe_component();
|
||||
u64 get_vm_ptr(u32 ptr);
|
||||
|
||||
} // namespace VM
|
||||
|
||||
#endif // VM_H
|
||||
|
||||
@@ -110,15 +110,15 @@
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
(dummy-12 () none 12)
|
||||
(dummy-12 (_type_ vector float uint process bone uint) float 12) ;; TODO - bone not confirmed
|
||||
(dummy-13 () none 13)
|
||||
(dummy-14 () none 14)
|
||||
(dummy-15 () none 15)
|
||||
(dummy-16 () none 16)
|
||||
(dummy-16 (_type_ vector float uint process uint) none 16)
|
||||
(dummy-17 () none 17)
|
||||
(dummy-18 () none 18)
|
||||
(dummy-19 () none 19)
|
||||
(dummy-20 () none 20)
|
||||
(dummy-20 (_type_ vector float uint bone uint) none 20) ;; TODO - bone not confirmed
|
||||
(dummy-21 () none 21)
|
||||
(dummy-22 () none 22)
|
||||
(dummy-23 () none 23)
|
||||
|
||||
@@ -343,43 +343,7 @@
|
||||
|
||||
(defun disasm-dma-tag ((arg0 dma-tag) (arg1 symbol))
|
||||
(format arg1 "(dma-tag ")
|
||||
;; this is a case statement.
|
||||
(let ((t9-1 format)
|
||||
(a0-2 arg1)
|
||||
(a1-2 "~s")
|
||||
(v1-1 (-> arg0 id))
|
||||
)
|
||||
(t9-1 a0-2 a1-2 (cond
|
||||
((= v1-1 (dma-tag-id end))
|
||||
"end"
|
||||
)
|
||||
((= v1-1 (dma-tag-id ret))
|
||||
"ret"
|
||||
)
|
||||
((= v1-1 (dma-tag-id call))
|
||||
"call"
|
||||
)
|
||||
((= v1-1 (dma-tag-id refs))
|
||||
"refs"
|
||||
)
|
||||
((= v1-1 (dma-tag-id ref))
|
||||
"ref"
|
||||
)
|
||||
((= v1-1 (dma-tag-id next))
|
||||
"next"
|
||||
)
|
||||
((= v1-1 (dma-tag-id cnt))
|
||||
"cnt"
|
||||
)
|
||||
((zero? v1-1)
|
||||
"refe"
|
||||
)
|
||||
(else
|
||||
"*unknown*"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(format arg1 "~s" (enum->string dma-tag-id (-> arg0 id)))
|
||||
(if (> (the-as uint (-> arg0 addr)) 0)
|
||||
(format arg1 " :addr #x~8x" (-> arg0 addr))
|
||||
)
|
||||
|
||||
@@ -62,19 +62,7 @@
|
||||
)
|
||||
|
||||
(defun pickup-type->string ((arg0 pickup-type))
|
||||
(case arg0
|
||||
(((pickup-type eco-pill-random)) "eco-pill-random")
|
||||
(((pickup-type buzzer)) "buzzer")
|
||||
(((pickup-type eco-pill)) "eco-pill")
|
||||
(((pickup-type fuel-cell)) "fuel-cell")
|
||||
(((pickup-type money)) "money")
|
||||
(((pickup-type eco-green)) "eco-green")
|
||||
(((pickup-type eco-blue)) "eco-blue")
|
||||
(((pickup-type eco-red)) "eco-red")
|
||||
(((pickup-type eco-yellow)) "eco-yellow")
|
||||
(((pickup-type none)) "none")
|
||||
(else "*unknown*")
|
||||
)
|
||||
(enum->string pickup-type arg0)
|
||||
)
|
||||
|
||||
;; Each individual enemy and pickup process will allocate a fact-info on its process heap
|
||||
|
||||
@@ -126,11 +126,11 @@
|
||||
(leaving-misty 114)
|
||||
(assistant-village3 115)
|
||||
(max 116)
|
||||
(*unknown* 255))
|
||||
)
|
||||
|
||||
;; Game parameters.
|
||||
(deftype game-bank (basic)
|
||||
((life-max-default float :offset-assert 4)
|
||||
((life-max-default float :offset-assert 4) ;; yes this life system works, but does nothing
|
||||
(life-start-default float :offset-assert 8)
|
||||
(life-single-inc float :offset-assert 12)
|
||||
(money-task-inc float :offset-assert 16)
|
||||
@@ -142,11 +142,11 @@
|
||||
)
|
||||
|
||||
(define *GAME-bank* (new 'static 'game-bank
|
||||
:life-max-default 99.000000
|
||||
:life-start-default 5.000000
|
||||
:life-single-inc 1.000000
|
||||
:money-task-inc 90.000000
|
||||
:money-oracle-inc 120.000000
|
||||
:life-max-default 99.0
|
||||
:life-start-default 5.0
|
||||
:life-single-inc 1.0
|
||||
:money-task-inc 90.0
|
||||
:money-oracle-inc 120.0
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -708,126 +708,7 @@
|
||||
)
|
||||
|
||||
(defun-debug game-task->string ((arg0 game-task))
|
||||
(case arg0
|
||||
(((game-task max)) "max")
|
||||
(((game-task assistant-village3)) "assistant-village3")
|
||||
(((game-task leaving-misty)) "leaving-misty")
|
||||
(((game-task plunger-lurker-hit)) "plunger-lurker-hit")
|
||||
(((game-task finalboss-movies)) "finalboss-movies")
|
||||
(((game-task village4-button)) "village4-button")
|
||||
(((game-task ogre-secret)) "ogre-secret")
|
||||
(((game-task intro)) "intro")
|
||||
(((game-task lavatube-start)) "lavatube-start")
|
||||
(((game-task lavatube-balls)) "lavatube-balls")
|
||||
(((game-task red-eggtop)) "red-eggtop")
|
||||
(((game-task village3-button)) "village3-button")
|
||||
(((game-task swamp-arm)) "swamp-arm")
|
||||
(((game-task village2-levitator)) "village2-levitator")
|
||||
(((game-task firecanyon-assistant)) "firecanyon-assistant")
|
||||
(((game-task village3-oracle-money2)) "village3-oracle-money2")
|
||||
(((game-task village3-oracle-money1)) "village3-oracle-money1")
|
||||
(((game-task village3-miner-money4)) "village3-miner-money4")
|
||||
(((game-task village3-miner-money3)) "village3-miner-money3")
|
||||
(((game-task village3-miner-money2)) "village3-miner-money2")
|
||||
(((game-task village3-miner-money1)) "village3-miner-money1")
|
||||
(((game-task training-buzzer)) "training-buzzer")
|
||||
(((game-task training-climb)) "training-climb")
|
||||
(((game-task training-door)) "training-door")
|
||||
(((game-task training-gimmie)) "training-gimmie")
|
||||
(((game-task citadel-buzzer)) "citadel-buzzer")
|
||||
(((game-task lavatube-buzzer)) "lavatube-buzzer")
|
||||
(((game-task lavatube-end)) "lavatube-end")
|
||||
(((game-task ogre-buzzer)) "ogre-buzzer")
|
||||
(((game-task ogre-end)) "ogre-end")
|
||||
(((game-task ogre-boss)) "ogre-boss")
|
||||
(((game-task cave-buzzer)) "cave-buzzer")
|
||||
(((game-task cave-platforms)) "cave-platforms")
|
||||
(((game-task cave-spider-tunnel)) "cave-spider-tunnel")
|
||||
(((game-task cave-swing-poles)) "cave-swing-poles")
|
||||
(((game-task cave-robot-climb)) "cave-robot-climb")
|
||||
(((game-task cave-dark-climb)) "cave-dark-climb")
|
||||
(((game-task cave-dark-crystals)) "cave-dark-crystals")
|
||||
(((game-task cave-gnawers)) "cave-gnawers")
|
||||
(((game-task village3-buzzer)) "village3-buzzer")
|
||||
(((game-task village2-buzzer)) "village2-buzzer")
|
||||
(((game-task village1-buzzer)) "village1-buzzer")
|
||||
(((game-task village3-extra1)) "village3-extra1")
|
||||
(((game-task citadel-sage-yellow)) "citadel-sage-yellow")
|
||||
(((game-task citadel-sage-red)) "citadel-sage-red")
|
||||
(((game-task citadel-sage-blue)) "citadel-sage-blue")
|
||||
(((game-task citadel-sage-green)) "citadel-sage-green")
|
||||
(((game-task firecanyon-end)) "firecanyon-end")
|
||||
(((game-task firecanyon-buzzer)) "firecanyon-buzzer")
|
||||
(((game-task snow-cage)) "snow-cage")
|
||||
(((game-task snow-bumpers)) "snow-bumpers")
|
||||
(((game-task snow-buzzer)) "snow-buzzer")
|
||||
(((game-task snow-bunnies)) "snow-bunnies")
|
||||
(((game-task snow-ball)) "snow-ball")
|
||||
(((game-task snow-fort)) "snow-fort")
|
||||
(((game-task snow-ram)) "snow-ram")
|
||||
(((game-task snow-eggtop)) "snow-eggtop")
|
||||
(((game-task rolling-ring-chase-2)) "rolling-ring-chase-2")
|
||||
(((game-task rolling-ring-chase-1)) "rolling-ring-chase-1")
|
||||
(((game-task rolling-buzzer)) "rolling-buzzer")
|
||||
(((game-task rolling-lake)) "rolling-lake")
|
||||
(((game-task rolling-plants)) "rolling-plants")
|
||||
(((game-task rolling-moles)) "rolling-moles")
|
||||
(((game-task rolling-robbers)) "rolling-robbers")
|
||||
(((game-task rolling-race)) "rolling-race")
|
||||
(((game-task sunken-spinning-room)) "sunken-spinning-room")
|
||||
(((game-task sunken-top-of-helix)) "sunken-top-of-helix")
|
||||
(((game-task sunken-buzzer)) "sunken-buzzer")
|
||||
(((game-task sunken-sharks)) "sunken-sharks")
|
||||
(((game-task sunken-room)) "sunken-room")
|
||||
(((game-task sunken-slide)) "sunken-slide")
|
||||
(((game-task sunken-pipe)) "sunken-pipe")
|
||||
(((game-task sunken-platforms)) "sunken-platforms")
|
||||
(((game-task swamp-buzzer)) "swamp-buzzer")
|
||||
(((game-task swamp-tether-4)) "swamp-tether-4")
|
||||
(((game-task swamp-tether-3)) "swamp-tether-3")
|
||||
(((game-task swamp-tether-2)) "swamp-tether-2")
|
||||
(((game-task swamp-tether-1)) "swamp-tether-1")
|
||||
(((game-task swamp-battle)) "swamp-battle")
|
||||
(((game-task swamp-flutflut)) "swamp-flutflut")
|
||||
(((game-task swamp-billy)) "swamp-billy")
|
||||
(((game-task village2-oracle-money2)) "village2-oracle-money2")
|
||||
(((game-task village2-oracle-money1)) "village2-oracle-money1")
|
||||
(((game-task village2-warrior-money)) "village2-warrior-money")
|
||||
(((game-task village2-geologist-money)) "village2-geologist-money")
|
||||
(((game-task village2-gambler-money)) "village2-gambler-money")
|
||||
(((game-task misty-eco-challenge)) "misty-eco-challenge")
|
||||
(((game-task misty-bike-jump)) "misty-bike-jump")
|
||||
(((game-task misty-buzzer)) "misty-buzzer")
|
||||
(((game-task misty-bike)) "misty-bike")
|
||||
(((game-task misty-cannon)) "misty-cannon")
|
||||
(((game-task misty-warehouse)) "misty-warehouse")
|
||||
(((game-task misty-boat)) "misty-boat")
|
||||
(((game-task misty-muse)) "misty-muse")
|
||||
(((game-task beach-sentinel)) "beach-sentinel")
|
||||
(((game-task beach-gimmie)) "beach-gimmie")
|
||||
(((game-task beach-buzzer)) "beach-buzzer")
|
||||
(((game-task beach-cannon)) "beach-cannon")
|
||||
(((game-task beach-seagull)) "beach-seagull")
|
||||
(((game-task beach-flutflut)) "beach-flutflut")
|
||||
(((game-task beach-pelican)) "beach-pelican")
|
||||
(((game-task beach-ecorocks)) "beach-ecorocks")
|
||||
(((game-task village1-oracle-money2)) "village1-oracle-money2")
|
||||
(((game-task village1-oracle-money1)) "village1-oracle-money1")
|
||||
(((game-task village1-uncle-money)) "village1-uncle-money")
|
||||
(((game-task village1-mayor-money)) "village1-mayor-money")
|
||||
(((game-task village1-yakow)) "village1-yakow")
|
||||
(((game-task jungle-temple-door)) "jungle-temple-door")
|
||||
(((game-task jungle-canyon-end)) "jungle-canyon-end")
|
||||
(((game-task jungle-buzzer)) "jungle-buzzer")
|
||||
(((game-task jungle-plant)) "jungle-plant")
|
||||
(((game-task jungle-fishgame)) "jungle-fishgame")
|
||||
(((game-task jungle-tower)) "jungle-tower")
|
||||
(((game-task jungle-lurkerm)) "jungle-lurkerm")
|
||||
(((game-task jungle-eggtop)) "jungle-eggtop")
|
||||
(((game-task complete)) "complete")
|
||||
(((game-task none)) "none")
|
||||
(else "*unknown*")
|
||||
)
|
||||
(enum->string game-task arg0)
|
||||
)
|
||||
|
||||
(defmethod debug-print game-info ((obj game-info) (arg0 symbol))
|
||||
|
||||
@@ -131,55 +131,7 @@
|
||||
)
|
||||
|
||||
(defun-debug game-save-elt->string ((arg0 game-save-elt))
|
||||
"Convert a game-save-elt to a string"
|
||||
(let ((v1-0 arg0))
|
||||
(cond
|
||||
((= v1-0 (game-save-elt aspect-ratio)) "aspect-ratio")
|
||||
((= v1-0 (game-save-elt video-mode)) "video-mode")
|
||||
((= v1-0 (game-save-elt play-hints)) "play-hints")
|
||||
((= v1-0 (game-save-elt vibration)) "vibration")
|
||||
((= v1-0 (game-save-elt screeny)) "screeny")
|
||||
((= v1-0 (game-save-elt screenx)) "screenx")
|
||||
((= v1-0 (game-save-elt language)) "language")
|
||||
((= v1-0 (game-save-elt dialog-volume)) "dialog-volume")
|
||||
((= v1-0 (game-save-elt music-volume)) "music-volume")
|
||||
((= v1-0 (game-save-elt sfx-volume)) "sfx-volume")
|
||||
((= v1-0 (game-save-elt in-level-time)) "in-level-time")
|
||||
((= v1-0 (game-save-elt auto-save-count)) "auto-save-count")
|
||||
((= v1-0 (game-save-elt death-pos)) "death-pos")
|
||||
((= v1-0 (game-save-elt deaths-per-level)) "deaths-per-level")
|
||||
((= v1-0 (game-save-elt enter-level-time)) "enter-level-time")
|
||||
((= v1-0 (game-save-elt fuel-cell-time)) "fuel-cell-time")
|
||||
((= v1-0 (game-save-elt continue-time)) "continue-time")
|
||||
((= v1-0 (game-save-elt fuel-cell-pickup-time)) "fuel-cell-pickup-time")
|
||||
((= v1-0 (game-save-elt hit-time)) "hit-time")
|
||||
((= v1-0 (game-save-elt death-time)) "death-time")
|
||||
((= v1-0 (game-save-elt continue-timke)) "continue-timke")
|
||||
((= v1-0 (game-save-elt game-start-time)) "game-start-time")
|
||||
((= v1-0 (game-save-elt fuel-cell-deaths)) "fuel-cell-deaths")
|
||||
((= v1-0 (game-save-elt continue-deaths)) "continue-deaths")
|
||||
((= v1-0 (game-save-elt total-deaths)) "total-deaths")
|
||||
((= v1-0 (game-save-elt level-open-list)) "level-open-list")
|
||||
((= v1-0 (game-save-elt text-list)) "text-list")
|
||||
((= v1-0 (game-save-elt hint-list)) "hint-list")
|
||||
((= v1-0 (game-save-elt perm-list)) "perm-list")
|
||||
((= v1-0 (game-save-elt task-list)) "task-list")
|
||||
((= v1-0 (game-save-elt death-movie-tick)) "death-movie-tick")
|
||||
((= v1-0 (game-save-elt fuel-cell)) "fuel-cell")
|
||||
((= v1-0 (game-save-elt buzzer-total)) "buzzer-total")
|
||||
((= v1-0 (game-save-elt moeny-per-level)) "money-per-level")
|
||||
((= v1-0 (game-save-elt money-total)) "money-total")
|
||||
((= v1-0 (game-save-elt money)) "money")
|
||||
((= v1-0 (game-save-elt life)) "life")
|
||||
((= v1-0 (game-save-elt continue)) "continue")
|
||||
((= v1-0 (game-save-elt integral-time)) "integral-time")
|
||||
((= v1-0 (game-save-elt game-time)) "game-time")
|
||||
((= v1-0 (game-save-elt real-time)) "real-time")
|
||||
((= v1-0 (game-save-elt base-time)) "base-time")
|
||||
((= v1-0 (game-save-elt name)) "name")
|
||||
(else "*unknown*")
|
||||
)
|
||||
)
|
||||
(enum->string game-save-elt arg0)
|
||||
)
|
||||
|
||||
(defun progress-level-index->string ((arg0 int))
|
||||
|
||||
@@ -6,28 +6,28 @@
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(deftype projectile (process-drawable)
|
||||
((base-trans vector :inline :offset-assert 176)
|
||||
(target vector :inline :offset-assert 192)
|
||||
(target-base vector :inline :offset-assert 208)
|
||||
(parent-base vector :inline :offset-assert 224)
|
||||
(parent-quat vector :inline :offset-assert 240)
|
||||
(base-vector vector :inline :offset-assert 256)
|
||||
(timeout uint64 :offset-assert 272)
|
||||
(options uint64 :offset-assert 280)
|
||||
(last-target uint64 :offset-assert 288)
|
||||
(notify-handle uint64 :offset-assert 296)
|
||||
(max-speed float :offset-assert 304)
|
||||
(max-turn float :offset-assert 308)
|
||||
(old-dist float 16 :offset-assert 312)
|
||||
(old-dist-count int32 :offset-assert 376)
|
||||
(hits int32 :offset-assert 380)
|
||||
(max-hits int32 :offset-assert 384)
|
||||
(tween float :offset-assert 388)
|
||||
(attack-mode basic :offset-assert 392)
|
||||
(update-velocity basic :offset-assert 396)
|
||||
(counter int32 :offset-assert 400)
|
||||
(target-count int32 :offset-assert 404)
|
||||
(sound-id sound-id :offset-assert 408)
|
||||
((base-trans vector :inline :offset-assert 176)
|
||||
(target vector :inline :offset-assert 192)
|
||||
(target-base vector :inline :offset-assert 208)
|
||||
(parent-base vector :inline :offset-assert 224)
|
||||
(parent-quat vector :inline :offset-assert 240)
|
||||
(base-vector vector :inline :offset-assert 256)
|
||||
(timeout uint64 :offset-assert 272)
|
||||
(options uint64 :offset-assert 280)
|
||||
(last-target uint64 :offset-assert 288)
|
||||
(notify-handle uint64 :offset-assert 296)
|
||||
(max-speed float :offset-assert 304)
|
||||
(max-turn float :offset-assert 308)
|
||||
(old-dist float 16 :offset-assert 312)
|
||||
(old-dist-count int32 :offset-assert 376)
|
||||
(hits int32 :offset-assert 380)
|
||||
(max-hits int32 :offset-assert 384)
|
||||
(tween float :offset-assert 388)
|
||||
(attack-mode basic :offset-assert 392)
|
||||
(update-velocity basic :offset-assert 396)
|
||||
(counter int32 :offset-assert 400)
|
||||
(target-count int32 :offset-assert 404)
|
||||
(sound-id sound-id :offset-assert 408)
|
||||
)
|
||||
:heap-base #x130
|
||||
:method-count-assert 29
|
||||
@@ -38,7 +38,7 @@
|
||||
(projectile-dissipate () none 21) ;; state
|
||||
(projectile-impact () none 22) ;; state
|
||||
(dummy-23 () none 23)
|
||||
(dummy-24 () none 24)
|
||||
(dummy-24 (_type_) none 24)
|
||||
(dummy-25 () none 25)
|
||||
(dummy-26 () none 26)
|
||||
(dummy-27 () none 27)
|
||||
|
||||
@@ -6,17 +6,7 @@
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(defun-debug task-status->string ((arg0 task-status))
|
||||
(case arg0
|
||||
(((task-status need-resolution)) "need-resolution")
|
||||
(((task-status need-reward-speech)) "need-reward-speech")
|
||||
(((task-status need-reminder)) "need-reminder")
|
||||
(((task-status need-reminder-a)) "need-reminder-a")
|
||||
(((task-status need-introduction)) "need-introduction")
|
||||
(((task-status need-hint)) "need-hint")
|
||||
(((task-status unknown)) "unknown")
|
||||
(((task-status invalid)) "invalid")
|
||||
(else "*unknown*")
|
||||
)
|
||||
(enum->string task-status arg0)
|
||||
)
|
||||
|
||||
(defmethod get-game-task task-cstage ((obj task-cstage))
|
||||
|
||||
@@ -98,22 +98,7 @@
|
||||
|
||||
(defun psm->string ((arg0 gs-psm))
|
||||
"Get the name of a texture format."
|
||||
(case arg0
|
||||
(((gs-psm mz16s)) "mz16s")
|
||||
(((gs-psm mz16)) "mz16")
|
||||
(((gs-psm mz24)) "mz24")
|
||||
(((gs-psm mz32)) "mz32")
|
||||
(((gs-psm mt4hh)) "mt4hh")
|
||||
(((gs-psm mt4hl)) "mt4hl")
|
||||
(((gs-psm mt8h)) "mt8h")
|
||||
(((gs-psm mt4)) "mt4")
|
||||
(((gs-psm mt8)) "mt8")
|
||||
(((gs-psm ct16s)) "ct16s")
|
||||
(((gs-psm ct16)) "ct16")
|
||||
(((gs-psm ct24)) "ct24")
|
||||
(((gs-psm ct32)) "ct32")
|
||||
(else "*unknown*")
|
||||
)
|
||||
(enum->string gs-psm arg0)
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -5,3 +5,339 @@
|
||||
;; name in dgo: shadow
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; definition for function add-fake-shadow-to-buffer
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun
|
||||
add-fake-shadow-to-buffer
|
||||
((arg0 vector) (arg1 vector) (arg2 float) (arg3 int))
|
||||
(let ((v1-0 *fake-shadow-buffer*))
|
||||
(when (< (-> v1-0 num-shadows) 32)
|
||||
(let ((t0-5 (-> v1-0 data (-> v1-0 num-shadows))))
|
||||
(set! (-> t0-5 px) (-> arg0 x))
|
||||
(set! (-> t0-5 py) (-> arg0 y))
|
||||
(set! (-> t0-5 pz) (-> arg0 z))
|
||||
(set! (-> t0-5 scale) arg2)
|
||||
(set! (-> t0-5 qx) (-> arg1 x))
|
||||
(set! (-> t0-5 qy) (-> arg1 y))
|
||||
(set! (-> t0-5 qz) (-> arg1 z))
|
||||
(set! (-> t0-5 flags) arg3)
|
||||
)
|
||||
(+! (-> v1-0 num-shadows) 1)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function swap-fake-shadow-buffers
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun swap-fake-shadow-buffers ()
|
||||
(set! *fake-shadow-buffer* (if (= *fake-shadow-buffer* *fake-shadow-buffer-1*)
|
||||
*fake-shadow-buffer-2*
|
||||
*fake-shadow-buffer-1*
|
||||
)
|
||||
)
|
||||
(set! (-> *fake-shadow-buffer* num-shadows) 0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function draw-shadow
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun
|
||||
draw-shadow
|
||||
((arg0 vector)
|
||||
(arg1 vector)
|
||||
(arg2 vector)
|
||||
(arg3 float)
|
||||
(arg4 float)
|
||||
(arg5 float)
|
||||
)
|
||||
(let ((f0-1 (- (-> arg0 y) (-> arg1 y))))
|
||||
(if (< f0-1 arg4)
|
||||
(add-fake-shadow-to-buffer
|
||||
arg1
|
||||
arg2
|
||||
(* (- 1.0 (/ f0-1 arg4)) arg3)
|
||||
(the-as int arg5)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function compute-and-draw-shadow
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; Used lq/sq
|
||||
(defun
|
||||
compute-and-draw-shadow
|
||||
((arg0 vector)
|
||||
(arg1 vector)
|
||||
(arg2 vector)
|
||||
(arg3 vector)
|
||||
(arg4 float)
|
||||
(arg5 float)
|
||||
)
|
||||
(local-vars
|
||||
(v1-10 float)
|
||||
(v1-11 float)
|
||||
(sv-96 vector)
|
||||
(sv-112 (function quaternion vector float quaternion))
|
||||
(sv-128 vector)
|
||||
(sv-144 vector)
|
||||
)
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! sv-96 arg2)
|
||||
(let ((s4-0 arg3)
|
||||
(s3-0 arg4)
|
||||
(s2-0 arg5)
|
||||
)
|
||||
(when (< (- (-> arg0 y) (-> arg1 y)) s3-0)
|
||||
(set! sv-144 (new 'stack-no-clear 'vector))
|
||||
(let ((s0-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'sparticle-cpuinfo))
|
||||
)
|
||||
(set! (-> arg1 y) (+ 40.96 (-> arg1 y)))
|
||||
(set! (-> sv-144 x) (-> sv-96 z))
|
||||
(set! (-> sv-144 y) 0.0)
|
||||
(set! (-> sv-144 z) (- (-> sv-96 x)))
|
||||
(vector-normalize! sv-144 1.0)
|
||||
(set! sv-112 quaternion-vector-angle!)
|
||||
(set! sv-128 s0-0)
|
||||
(let ((a2-1 (acos (-> sv-96 y))))
|
||||
(sv-112 (the-as quaternion sv-128) sv-144 a2-1)
|
||||
)
|
||||
(let ((v1-9 s1-0))
|
||||
(cond
|
||||
((< (-> s0-0 w) 0.0)
|
||||
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
|
||||
(.lvf vf2 (&-> s0-0 quad))
|
||||
(.sub.vf vf1 vf0 vf2 :mask #b111)
|
||||
(.svf (&-> v1-9 vel-sxvel quad) vf1)
|
||||
(.mov v1-10 vf1)
|
||||
)
|
||||
(else
|
||||
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
|
||||
(.lvf vf2 (&-> s0-0 quad))
|
||||
(.add.vf vf1 vf0 vf2 :mask #b111)
|
||||
(.svf (&-> v1-9 vel-sxvel quad) vf1)
|
||||
(.mov v1-11 vf1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(draw-shadow arg0 arg1 (-> s1-0 vel-sxvel) (the-as float s4-0) s3-0 s2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function find-ground-and-draw-shadow
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; Used lq/sq
|
||||
(defun
|
||||
find-ground-and-draw-shadow
|
||||
((arg0 vector)
|
||||
(arg1 vector)
|
||||
(arg2 float)
|
||||
(arg3 uint)
|
||||
(arg4 process)
|
||||
(arg5 float)
|
||||
(arg6 float)
|
||||
)
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s2-0 quad) (-> arg0 quad))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(+! (-> s2-0 y) arg5)
|
||||
(let ((s4-0 (new 'stack-no-clear 'bone)))
|
||||
(cond
|
||||
((>=
|
||||
(dummy-12 *collide-cache* s2-0 arg6 arg3 arg4 s4-0 (the-as uint 1))
|
||||
0.0
|
||||
)
|
||||
(if (!= arg2 0.0)
|
||||
(compute-and-draw-shadow
|
||||
s2-0
|
||||
(-> s4-0 position)
|
||||
(-> s4-0 scale)
|
||||
(the-as vector arg2)
|
||||
arg6
|
||||
(the-as float 0)
|
||||
)
|
||||
)
|
||||
(if (and arg1 (!= (shr (shl (-> s4-0 cache bone-matrix) 52) 58) 3))
|
||||
(set! (-> arg1 quad) (-> s4-0 position quad))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(if arg1
|
||||
(vector+float*!
|
||||
arg1
|
||||
arg0
|
||||
(-> *standard-dynamics* gravity-normal)
|
||||
(- arg6)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function do-target-shadow
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; Used lq/sq
|
||||
(defbehavior do-target-shadow target ()
|
||||
(if
|
||||
(and
|
||||
(logtest? (-> self control status) 1)
|
||||
(!= (-> self control unknown-surface mode) 'swim)
|
||||
(!= (-> self control unknown-surface mode) 'dive)
|
||||
(!= (-> self next-state name) 'target-flop)
|
||||
(zero? (logand (-> self draw status) 38))
|
||||
)
|
||||
(set! (-> self control shadow-pos quad) (-> self control trans quad))
|
||||
(find-ground-and-draw-shadow
|
||||
(-> self control trans)
|
||||
(-> self control shadow-pos)
|
||||
0.0
|
||||
(-> (the-as collide-shape-prim (-> self control root-prim)) collide-with)
|
||||
self
|
||||
0.0
|
||||
81920.0
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set!
|
||||
(-> *part-id-table* 362)
|
||||
(new 'static 'sparticle-launcher
|
||||
:init-specs
|
||||
(new 'static 'inline-array sp-field-init-spec 20
|
||||
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200000)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x6
|
||||
:flags #x1
|
||||
:initial-value #x41000000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #xd
|
||||
:flags #x1
|
||||
:initial-value #x4499999a
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x10
|
||||
:flags #x1
|
||||
:initial-value -956301312
|
||||
:random-range #x47800000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x11
|
||||
:flags #x3
|
||||
:initial-value -4
|
||||
:random-mult 1
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x12
|
||||
:flags #x1
|
||||
:initial-value #x42b40000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x13
|
||||
:flags #x1
|
||||
:initial-value #x42b40000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x14
|
||||
:flags #x1
|
||||
:initial-value #x42b40000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x15
|
||||
:flags #x1
|
||||
:initial-value #x41a00000
|
||||
:random-range #x41a00000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x1a
|
||||
:flags #x1
|
||||
:initial-value #x4103126f
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x1c
|
||||
:flags #x1
|
||||
:initial-value #x41888889
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x20
|
||||
:flags #x3
|
||||
:initial-value -4
|
||||
:random-mult 1
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x24
|
||||
:flags #x1
|
||||
:initial-value -1097229926
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x2e
|
||||
:initial-value #x138c
|
||||
:random-mult 1
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x2f
|
||||
:initial-value 12
|
||||
:random-mult 1
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x36
|
||||
:flags #x1
|
||||
:initial-value -983331271
|
||||
:random-range #x452aaaab
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x3a
|
||||
:flags #x1
|
||||
:initial-value #x46800000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x3b
|
||||
:flags #x1
|
||||
:initial-value -956301312
|
||||
:random-range #x47800000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x3e
|
||||
:flags #x1
|
||||
:initial-value #x444ccccd
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec :field #x43)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -224,26 +224,7 @@
|
||||
(camera 16))
|
||||
|
||||
(defun-debug perf-stat-bucket->string ((arg0 perf-stat-bucket))
|
||||
(case arg0
|
||||
(((perf-stat-bucket camera)) "camera")
|
||||
(((perf-stat-bucket collide)) "collide")
|
||||
(((perf-stat-bucket nav)) "nav")
|
||||
(((perf-stat-bucket bones)) "bones")
|
||||
(((perf-stat-bucket proto-tie-n)) "proto-tie-n")
|
||||
(((perf-stat-bucket proto-tie)) "proto-tie")
|
||||
(((perf-stat-bucket proto-tie-g)) "proto-tie-g")
|
||||
(((perf-stat-bucket inst-tie)) "inst-tie")
|
||||
(((perf-stat-bucket proto-shrub)) "proto-shrub")
|
||||
(((perf-stat-bucket inst-shrub)) "inst-shrub")
|
||||
(((perf-stat-bucket tfrag-near)) "tfrag-near")
|
||||
(((perf-stat-bucket tfrag)) "tfrag")
|
||||
(((perf-stat-bucket drawable)) "drawable")
|
||||
(((perf-stat-bucket background)) "background")
|
||||
(((perf-stat-bucket tie-generic)) "tie-generic")
|
||||
(((perf-stat-bucket mercneric)) "mercneric")
|
||||
(((perf-stat-bucket all-code)) "all-code")
|
||||
(else "*unknown*")
|
||||
)
|
||||
(enum->string perf-stat-bucket arg0)
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -182,32 +182,7 @@
|
||||
)
|
||||
|
||||
(defun-debug sound-command->string ((cmd sound-command))
|
||||
(case cmd
|
||||
(((sound-command unload-music)) "unload-music")
|
||||
(((sound-command list-sounds)) "list-sounds")
|
||||
(((sound-command shutdown)) "shutdown")
|
||||
(((sound-command set-ear-trans)) "set-ear-trans")
|
||||
(((sound-command set-reverb)) "set-reverb")
|
||||
(((sound-command set-flava)) "set-flava")
|
||||
(((sound-command set-language)) "set-language")
|
||||
(((sound-command reload-info)) "reload-info")
|
||||
(((sound-command set-sound-falloff)) "set-sound-falloff")
|
||||
(((sound-command set-falloff-curve)) "set-falloff-curve")
|
||||
(((sound-command get-irx-version)) "get-irx-version")
|
||||
(((sound-command continue-group)) "continue-group")
|
||||
(((sound-command stop-group)) "stop-group")
|
||||
(((sound-command pause-group)) "pause-group")
|
||||
(((sound-command set-master-volume)) "set-master-volume")
|
||||
(((sound-command set-param)) "set-param")
|
||||
(((sound-command continue-sound)) "continue-sound")
|
||||
(((sound-command stop-sound)) "stop-sound")
|
||||
(((sound-command pause-sound)) "pause-sound")
|
||||
(((sound-command play)) "play")
|
||||
(((sound-command unload-bank)) "unload-bank")
|
||||
(((sound-command load-music)) "load-music")
|
||||
(((sound-command load-bank)) "load-bank")
|
||||
(else "*unknown*")
|
||||
)
|
||||
(enum->string sound-command cmd)
|
||||
)
|
||||
|
||||
(defun sound-buffer-dump ()
|
||||
|
||||
@@ -84,3 +84,7 @@
|
||||
)
|
||||
|
||||
(define-extern part-group-pointer? (function pointer symbol))
|
||||
|
||||
;; TODO - for shadow
|
||||
(define-extern *part-id-table* (array sparticle-launcher))
|
||||
(define-extern *part-group-id-table* (array sparticle-launch-group))
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(deftype sp-field-init-spec (structure)
|
||||
((field uint16 :offset-assert 0)
|
||||
(flags uint16 :offset-assert 2)
|
||||
(initial-valuef float :offset-assert 4)
|
||||
(random-rangef float :offset-assert 8)
|
||||
(random-multf float :offset-assert 12)
|
||||
(initial-value int32 :offset 4)
|
||||
(random-range int32 :offset 8)
|
||||
(random-mult int32 :offset 12)
|
||||
(func basic :offset 4)
|
||||
(tex uint32 :offset 4)
|
||||
(pntr uint32 :offset 4)
|
||||
(sym basic :offset 4)
|
||||
(sound basic :offset 4)
|
||||
((field uint16 :offset-assert 0)
|
||||
(flags uint16 :offset-assert 2)
|
||||
(initial-value int32 :offset-assert 4)
|
||||
(random-range int32 :offset-assert 8)
|
||||
(random-mult int32 :offset-assert 12)
|
||||
(initial-valuef float :offset 4) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||
(random-rangef float :offset 8) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||
(random-multf float :offset 12) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
|
||||
(func basic :offset 4)
|
||||
(tex uint32 :offset 4)
|
||||
(pntr uint32 :offset 4)
|
||||
(sym basic :offset 4)
|
||||
(sound basic :offset 4)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
@@ -28,7 +28,7 @@
|
||||
(deftype sparticle-launcher (basic)
|
||||
((birthaccum float :offset-assert 4)
|
||||
(soundaccum float :offset-assert 8)
|
||||
(init-specs uint32 :offset-assert 12)
|
||||
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
|
||||
@@ -5,3 +5,6 @@
|
||||
;; name in dgo: sparticle-launcher
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; TODO - for shadow
|
||||
(define *part-id-table* (new 'global 'boxed-array sparticle-launcher 3584))
|
||||
(define *part-group-id-table* (new 'global 'boxed-array sparticle-launch-group 1024))
|
||||
|
||||
@@ -70,54 +70,15 @@
|
||||
)
|
||||
|
||||
(defun-debug pat-material->string ((pat pat-surface))
|
||||
(case (-> pat material)
|
||||
(((pat-material neutral)) "neutral")
|
||||
(((pat-material rotate)) "rotate")
|
||||
(((pat-material stopproj)) "stopproj")
|
||||
(((pat-material swamp)) "swamp")
|
||||
(((pat-material tube)) "tube")
|
||||
(((pat-material straw)) "straw")
|
||||
(((pat-material metal)) "metal")
|
||||
(((pat-material dirt)) "dirt")
|
||||
(((pat-material gravel)) "gravel")
|
||||
(((pat-material crwood)) "crwood")
|
||||
(((pat-material lava)) "lava")
|
||||
(((pat-material hotcoals)) "hotcoals")
|
||||
(((pat-material deepsnow)) "deepsnow")
|
||||
(((pat-material snow)) "snow")
|
||||
(((pat-material pcmetal)) "pcmetal")
|
||||
(((pat-material grass)) "grass")
|
||||
(((pat-material wood)) "wood")
|
||||
(((pat-material sand)) "sand")
|
||||
(((pat-material tar)) "tar")
|
||||
(((pat-material waterbottom)) "waterbottom")
|
||||
(((pat-material quicksand)) "quicksand")
|
||||
(((pat-material ice)) "ice")
|
||||
(((pat-material stone)) "stone")
|
||||
(else "*unknown*")
|
||||
)
|
||||
(enum->string pat-material (-> pat material))
|
||||
)
|
||||
|
||||
(defun-debug pat-mode->string ((pat pat-surface))
|
||||
(case (-> pat mode)
|
||||
(((pat-mode obstacle)) "obstacle")
|
||||
(((pat-mode wall)) "wall")
|
||||
(((pat-mode ground)) "ground")
|
||||
(else "*unknown*")
|
||||
)
|
||||
(enum->string pat-mode (-> pat mode))
|
||||
)
|
||||
|
||||
(defun-debug pat-event->string ((pat pat-surface))
|
||||
(case (-> pat event)
|
||||
(((pat-event melt)) "melt")
|
||||
(((pat-event burnup)) "burnup")
|
||||
(((pat-event deadlyup)) "deadlyup")
|
||||
(((pat-event burn)) "burn")
|
||||
(((pat-event endlessfall)) "endlessfall")
|
||||
(((pat-event deadly)) "deadly")
|
||||
(((pat-event none)) "none")
|
||||
(else "*unknown*")
|
||||
)
|
||||
(enum->string pat-event (-> pat event))
|
||||
)
|
||||
|
||||
(deftype pat-mode-info (structure)
|
||||
|
||||
+36
-1
@@ -524,7 +524,7 @@
|
||||
|
||||
(defmacro logtesta? (a b)
|
||||
"does a have ALL of the bits in b?"
|
||||
`(= (logand ,a ,b) ,b)
|
||||
`(= (logand ,b ,a) ,b)
|
||||
)
|
||||
|
||||
(defmacro deref (t addr &rest fields)
|
||||
@@ -707,3 +707,38 @@
|
||||
|
||||
;; load the default project
|
||||
(load-project "goal_src/game.gp")
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
;; enum stuff
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defmacro enum->string (enum input)
|
||||
"return the name of an enum value"
|
||||
|
||||
`(case ,input
|
||||
,@(apply (lambda (x) `(((,enum ,(car x) )) ,(symbol->string (car x) ) )) (reverse (get-enum-vals enum)))
|
||||
(else "*unknown*")
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro bit-enum->string (enum input stream)
|
||||
"print the enum bits in input to stream"
|
||||
|
||||
(with-gensyms (val str)
|
||||
`(let ((,val ,input)
|
||||
(,str ,stream))
|
||||
|
||||
,@(apply (lambda (x)
|
||||
`(if (logtesta? ,val (,enum ,(car x)))
|
||||
(format ,str ,(fmt #f "{} " (car x)))
|
||||
)
|
||||
|
||||
) (reverse (get-enum-vals enum)))
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -62,6 +62,9 @@
|
||||
(defsmacro cddr (x)
|
||||
`(cdr (cdr ,x)))
|
||||
|
||||
(defsmacro cdddr (x)
|
||||
`(cdr (cdr (cdr ,x))))
|
||||
|
||||
(desfun first (x)
|
||||
(car x))
|
||||
|
||||
@@ -116,6 +119,40 @@
|
||||
)
|
||||
)
|
||||
|
||||
(desfun reverse (lst)
|
||||
(if (null? lst)
|
||||
'()
|
||||
(let ((old-lst lst)
|
||||
(new-lst '()))
|
||||
(while (not (null? old-lst))
|
||||
(set! new-lst (cons (car old-lst) new-lst))
|
||||
(set! old-lst (cdr old-lst))
|
||||
)
|
||||
new-lst
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(desfun reverse-recursive (lst)
|
||||
(if (null? lst)
|
||||
'()
|
||||
(let ((old-lst lst)
|
||||
(new-lst '()))
|
||||
(while (not (null? old-lst))
|
||||
(let ((cur-obj (car old-lst)))
|
||||
(set! new-lst (cons (if (pair? cur-obj)
|
||||
(reverse-recursive cur-obj)
|
||||
cur-obj
|
||||
)
|
||||
new-lst))
|
||||
(set! old-lst (cdr old-lst))
|
||||
)
|
||||
)
|
||||
new-lst
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defsmacro let (bindings &rest body)
|
||||
`((lambda ,(apply first bindings) ,@body)
|
||||
,@(apply second bindings)))
|
||||
@@ -239,6 +276,49 @@
|
||||
)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
;; enum stuff
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(desfun enum-length (enum)
|
||||
(length (get-enum-vals enum))
|
||||
)
|
||||
|
||||
(defsmacro doenum (bindings &rest body)
|
||||
;; (doenum (name-var val-var 'enum &rest result) &rest body)
|
||||
|
||||
(with-gensyms (enum-vals)
|
||||
`(let ((,enum-vals (get-enum-vals ,(third bindings))))
|
||||
|
||||
(while (not (null? ,enum-vals))
|
||||
(let ((,(first bindings) (caar ,enum-vals)) ;; name
|
||||
(,(second bindings) (cdar ,enum-vals)) ;; value
|
||||
)
|
||||
,@body
|
||||
)
|
||||
|
||||
(set! ,enum-vals (cdr ,enum-vals))
|
||||
)
|
||||
|
||||
,@(cdddr bindings)
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
(desfun enum-max (enum)
|
||||
"get the highest value in an enum"
|
||||
|
||||
(let ((max-val -999999999))
|
||||
(doenum (name val enum)
|
||||
(when (> val max-val)
|
||||
(set! max-val val))
|
||||
)
|
||||
|
||||
max-val
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; shortcut to quit GOOS
|
||||
|
||||
@@ -279,84 +279,7 @@
|
||||
;; Each process-tree element has a process-mask which indicates what type of node it is.
|
||||
|
||||
(defun-debug stream<-process-mask ((arg0 object) (arg1 process-mask))
|
||||
(let ((s4-0 arg1))
|
||||
(if (= (logand #x1000000 (the-as int s4-0)) (process-mask death))
|
||||
(format arg0 "death ")
|
||||
)
|
||||
(if (= (logand #x800000 (the-as int s4-0)) (process-mask attackable))
|
||||
(format arg0 "attackable ")
|
||||
)
|
||||
(if (= (logand #x400000 (the-as int s4-0)) (process-mask projectile))
|
||||
(format arg0 "projectile ")
|
||||
)
|
||||
(if (= (logand #x200000 (the-as int s4-0)) (process-mask entity))
|
||||
(format arg0 "entity ")
|
||||
)
|
||||
(if (= (logand #x100000 (the-as int s4-0)) (process-mask ambient))
|
||||
(format arg0 "ambient ")
|
||||
)
|
||||
(if (= (logand #x80000 (the-as int s4-0)) (process-mask platform))
|
||||
(format arg0 "platform ")
|
||||
)
|
||||
(if (= (logand #x40000 (the-as int s4-0)) (process-mask camera))
|
||||
(format arg0 "camera ")
|
||||
)
|
||||
(if (= (logand #x20000 (the-as int s4-0)) (process-mask enemy))
|
||||
(format arg0 "enemy ")
|
||||
)
|
||||
(if (= (logand #x10000 (the-as int s4-0)) (process-mask collectable))
|
||||
(format arg0 "collectable ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask crate)) (process-mask crate))
|
||||
(format arg0 "crate ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask sidekick)) (process-mask sidekick))
|
||||
(format arg0 "sidekick ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask target)) (process-mask target))
|
||||
(format arg0 "target ")
|
||||
)
|
||||
(if
|
||||
(= (logand s4-0 (process-mask movie-subject)) (process-mask movie-subject))
|
||||
(format arg0 "movie-subject ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask movie)) (process-mask movie))
|
||||
(format arg0 "movie ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask going)) (process-mask going))
|
||||
(format arg0 "going ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask heap-shrunk)) (process-mask heap-shrunk))
|
||||
(format arg0 "heap-shrunk ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask process-tree)) (process-mask process-tree))
|
||||
(format arg0 "process-tree ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask sleep-code)) (process-mask sleep-code))
|
||||
(format arg0 "sleep-code ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask sleep)) (process-mask sleep))
|
||||
(format arg0 "sleep ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask actor-pause)) (process-mask actor-pause))
|
||||
(format arg0 "actor-pause ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask progress)) (process-mask progress))
|
||||
(format arg0 "progress ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask menu)) (process-mask menu))
|
||||
(format arg0 "menu ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask pause)) (process-mask pause))
|
||||
(format arg0 "pause ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask draw)) (process-mask draw))
|
||||
(format arg0 "draw ")
|
||||
)
|
||||
(if (= (logand s4-0 (process-mask execute)) (process-mask execute))
|
||||
(format arg0 "execute ")
|
||||
)
|
||||
)
|
||||
(bit-enum->string process-mask arg1 arg0)
|
||||
arg1
|
||||
)
|
||||
|
||||
|
||||
@@ -5,3 +5,194 @@
|
||||
;; name in dgo: twister
|
||||
;; dgos: BEA, L1
|
||||
|
||||
;; definition of type twist-joint
|
||||
(deftype twist-joint (structure)
|
||||
((ry float :offset-assert 0)
|
||||
(max-dry float :offset-assert 4)
|
||||
)
|
||||
:allow-misaligned :method-count-assert 9
|
||||
:size-assert #x8
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
;; definition of type twister
|
||||
(deftype twister (basic)
|
||||
((num-joints int32 :offset-assert 4)
|
||||
(first-joint int32 :offset-assert 8)
|
||||
(last-joint int32 :offset-assert 12)
|
||||
(something uint16 :offset 12)
|
||||
(max-speed float :offset-assert 16)
|
||||
(smoothing float :offset-assert 20)
|
||||
(min-dist float :offset-assert 24)
|
||||
(target float :offset-assert 28)
|
||||
(ry float :offset-assert 32)
|
||||
(max-speed-ry float :offset-assert 36)
|
||||
(data twist-joint :inline :dynamic :offset-assert 40)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #x28
|
||||
:flag-assert #xd00000028
|
||||
(:methods
|
||||
(new (symbol _type_ int int float float float float) _type_ 0)
|
||||
(TODO-RENAME-9 (_type_ int int float) none 9)
|
||||
(set-target! (_type_ float) none 10)
|
||||
(TODO-RENAME-11 (_type_) none 11)
|
||||
(TODO-RENAME-12 (_type_ process-drawable) none 12)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 0 of type twister
|
||||
(defmethod
|
||||
new
|
||||
twister
|
||||
((allocation symbol)
|
||||
(type-to-make twister)
|
||||
(arg0 int)
|
||||
(arg1 int)
|
||||
(arg2 float)
|
||||
(arg3 float)
|
||||
(arg4 float)
|
||||
(arg5 float)
|
||||
)
|
||||
(let* ((gp-0 (+ (- 1 arg0) arg1))
|
||||
(v0-0
|
||||
(object-new
|
||||
allocation
|
||||
(the-as type type-to-make)
|
||||
(the-as int (+ (-> type-to-make something) (* gp-0 16)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> v0-0 first-joint) arg0)
|
||||
(set! (-> v0-0 last-joint) arg1)
|
||||
(set! (-> v0-0 num-joints) gp-0)
|
||||
(set! (-> v0-0 max-speed) arg2)
|
||||
(set! (-> v0-0 smoothing) arg4)
|
||||
(set! (-> v0-0 min-dist) arg5)
|
||||
(set! (-> v0-0 target) 0.0)
|
||||
(set! (-> v0-0 ry) 0.0)
|
||||
(set! (-> v0-0 max-speed-ry) arg3)
|
||||
(dotimes (v1-4 gp-0)
|
||||
(set! (-> v0-0 data v1-4 ry) 0.0)
|
||||
(set! (-> v0-0 data v1-4 max-dry) 0.0)
|
||||
)
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 5 of type twister
|
||||
(defmethod asize-of twister ((obj twister))
|
||||
(+ (* (-> obj num-joints) 16) 40)
|
||||
)
|
||||
|
||||
;; definition for method 9 of type twister
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod
|
||||
TODO-RENAME-9
|
||||
twister
|
||||
((obj twister) (arg0 int) (arg1 int) (arg2 float))
|
||||
(let ((v1-1 (- arg0 (-> obj first-joint)))
|
||||
(a1-2 (- arg1 (-> obj first-joint)))
|
||||
)
|
||||
(while (>= a1-2 v1-1)
|
||||
(set! (-> obj data v1-1 max-dry) arg2)
|
||||
(+! v1-1 1)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type twister
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod set-target! twister ((obj twister) (arg0 float))
|
||||
(set! (-> obj target) arg0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 11 of type twister
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod TODO-RENAME-11 twister ((obj twister))
|
||||
(let* ((s5-0 (+ (-> obj num-joints) -1))
|
||||
(s4-0 (-> obj data s5-0))
|
||||
)
|
||||
(let ((f0-2 (deg-diff (-> s4-0 ry) (-> obj target))))
|
||||
(+!
|
||||
(-> s4-0 ry)
|
||||
(seek-with-smooth
|
||||
0.0
|
||||
f0-2
|
||||
(-> obj max-speed)
|
||||
(-> obj smoothing)
|
||||
(-> obj min-dist)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f30-1 (-> s4-0 ry)))
|
||||
(while (> s5-0 0)
|
||||
(+! s5-0 -1)
|
||||
(let ((s4-1 (-> obj data s5-0)))
|
||||
(let ((f0-9 (deg-diff f30-1 (-> s4-1 ry))))
|
||||
(cond
|
||||
((= (-> s4-1 max-dry) 0.0)
|
||||
(set! f0-9 0.0)
|
||||
)
|
||||
((< (fabs f0-9) (-> s4-1 max-dry))
|
||||
)
|
||||
((< f0-9 0.0)
|
||||
(set!
|
||||
f0-9
|
||||
(seek-with-smooth
|
||||
f0-9
|
||||
(- (-> s4-1 max-dry))
|
||||
(-> obj max-speed)
|
||||
(-> obj smoothing)
|
||||
(-> obj min-dist)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set!
|
||||
f0-9
|
||||
(seek-with-smooth
|
||||
f0-9
|
||||
(-> s4-1 max-dry)
|
||||
(-> obj max-speed)
|
||||
(-> obj smoothing)
|
||||
(-> obj min-dist)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! f30-1 f0-9)
|
||||
)
|
||||
(set! (-> s4-1 ry) f30-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 12 of type twister
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod TODO-RENAME-12 twister ((obj twister) (arg0 process-drawable))
|
||||
(let ((s4-0 (new 'stack-no-clear 'matrix)))
|
||||
(dotimes (s3-0 (-> obj num-joints))
|
||||
(let
|
||||
((s2-0
|
||||
(-> arg0 node-list data (+ (-> obj first-joint) s3-0) bone transform)
|
||||
)
|
||||
)
|
||||
(matrix-rotate-y! s4-0 (-> obj data s3-0 ry))
|
||||
(vector-! (-> s2-0 vector 3) (-> s2-0 vector 3) (-> arg0 root trans))
|
||||
(matrix*! s2-0 s2-0 s4-0)
|
||||
(vector+! (-> s2-0 vector 3) (-> s2-0 vector 3) (-> arg0 root trans))
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -5,3 +5,85 @@
|
||||
;; name in dgo: wobbler
|
||||
;; dgos: BEA, L1
|
||||
|
||||
;; definition of type wobbler
|
||||
(deftype wobbler (basic)
|
||||
((posx float :offset-assert 4)
|
||||
(posy float :offset-assert 8)
|
||||
(velx float :offset-assert 12)
|
||||
(vely float :offset-assert 16)
|
||||
(spring float :offset-assert 20)
|
||||
(damping float :offset-assert 24)
|
||||
(height float :offset-assert 28)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #x20
|
||||
:flag-assert #xd00000020
|
||||
(:methods
|
||||
(reset! (_type_ float float float) none 9)
|
||||
(inc-xy-vel! (_type_ float float) none 10)
|
||||
(move! (_type_) none 11)
|
||||
(TODO-RENAME-12 (_type_ quaternion) none 12)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 9 of type wobbler
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod reset! wobbler ((obj wobbler) (arg0 float) (arg1 float) (arg2 float))
|
||||
(set! (-> obj posx) 0.0)
|
||||
(set! (-> obj posy) 0.0)
|
||||
(set! (-> obj velx) 0.0)
|
||||
(set! (-> obj vely) 0.0)
|
||||
(set! (-> obj spring) arg0)
|
||||
(set! (-> obj damping) arg1)
|
||||
(set! (-> obj height) arg2)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type wobbler
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod inc-xy-vel! wobbler ((obj wobbler) (arg0 float) (arg1 float))
|
||||
(+! (-> obj velx) arg0)
|
||||
(+! (-> obj vely) arg1)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 11 of type wobbler
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod move! wobbler ((obj wobbler))
|
||||
(+! (-> obj posx) (* (-> obj velx) (-> *display* seconds-per-frame)))
|
||||
(+! (-> obj posy) (* (-> obj vely) (-> *display* seconds-per-frame)))
|
||||
(set! (-> obj velx) (* (-> obj velx) (-> obj damping)))
|
||||
(set! (-> obj vely) (* (-> obj vely) (-> obj damping)))
|
||||
(+! (-> obj velx) (* (* -1.0 (-> obj posx)) (-> obj spring)))
|
||||
(+! (-> obj vely) (* (* -1.0 (-> obj posy)) (-> obj spring)))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 12 of type wobbler
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod TODO-RENAME-12 wobbler ((obj wobbler) (arg0 quaternion))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s5-0 x) (-> obj posy))
|
||||
(set! (-> s5-0 y) 0.0)
|
||||
(set! (-> s5-0 z) (- (-> obj posx)))
|
||||
(vector-normalize! s5-0 1.0)
|
||||
(let*
|
||||
((f0-8
|
||||
(/
|
||||
(sqrtf
|
||||
(+ (* (-> obj posx) (-> obj posx)) (* (-> obj posy) (-> obj posy)))
|
||||
)
|
||||
(-> obj height)
|
||||
)
|
||||
)
|
||||
(f0-9 (atan f0-8 1.0))
|
||||
)
|
||||
(quaternion-vector-angle! arg0 s5-0 f0-9)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -5,3 +5,86 @@
|
||||
;; name in dgo: ticky
|
||||
;; dgos: GAME, COMMON, L1
|
||||
|
||||
;; definition of type ticky
|
||||
(deftype ticky (structure)
|
||||
((delay-til-ramp uint64 :offset-assert 0)
|
||||
(delay-til-timeout uint64 :offset-assert 8)
|
||||
(starting-time uint64 :offset-assert 16)
|
||||
(last-tick-time uint64 :offset-assert 24)
|
||||
)
|
||||
:method-count-assert 12
|
||||
:size-assert #x20
|
||||
:flag-assert #xc00000020
|
||||
(:methods
|
||||
(sleep (_type_ uint) none 9)
|
||||
(reached-delay? (_type_ uint) 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))
|
||||
(set! (-> obj starting-time) (-> *display* base-frame-counter))
|
||||
(set! (-> obj delay-til-timeout) arg0)
|
||||
(set! (-> obj delay-til-ramp) (max 0 (the-as int (+ arg0 -1200))))
|
||||
(set! (-> obj last-tick-time) (the-as uint 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
|
||||
((>= (the-as int v1-2) (the-as int (-> obj delay-til-timeout)))
|
||||
(set! gp-0 #t)
|
||||
)
|
||||
(else
|
||||
(let*
|
||||
((f0-1
|
||||
(fmin
|
||||
1.0
|
||||
(/
|
||||
(the float (max 0 (the-as int (- 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
|
||||
(>=
|
||||
(the-as
|
||||
int
|
||||
(- (-> *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
|
||||
(the-as uint 1)
|
||||
(the-as vector #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type ticky
|
||||
(defmethod reached-delay? ticky ((obj ticky) (arg0 uint))
|
||||
(>=
|
||||
(the-as int (- (-> *display* base-frame-counter) (-> obj starting-time)))
|
||||
(the-as int arg0)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -5,3 +5,102 @@
|
||||
;; name in dgo: tippy
|
||||
;; dgos: GAME, COMMON, L1
|
||||
|
||||
;; definition of type tippy
|
||||
(deftype tippy (structure)
|
||||
((axis vector :inline :offset-assert 0)
|
||||
(angle float :offset-assert 16)
|
||||
(orig quaternion :inline :offset-assert 32)
|
||||
(dist-ratio float :offset-assert 48)
|
||||
(damping float :offset-assert 52)
|
||||
(1-damping float :offset-assert 56)
|
||||
)
|
||||
:method-count-assert 11
|
||||
:size-assert #x3c
|
||||
:flag-assert #xb0000003c
|
||||
(:methods
|
||||
(reset! (_type_ process-drawable float float) none 9)
|
||||
(TODO-RENAME-10 (_type_ process-drawable vector) symbol 10)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tippy
|
||||
(defmethod inspect tippy ((obj tippy))
|
||||
(format #t "[~8x] ~A~%" obj 'tippy)
|
||||
(format #t "~Taxis: #<vector @ #x~X>~%" (-> obj axis))
|
||||
(format #t "~Tangle: ~f~%" (-> obj angle))
|
||||
(format #t "~Torig: #<quaternion @ #x~X>~%" (-> obj orig))
|
||||
(format #t "~Tdist-ratio: ~f~%" (-> obj dist-ratio))
|
||||
(format #t "~Tdamping: ~f~%" (-> obj damping))
|
||||
(format #t "~T1-damping: ~f~%" (-> obj 1-damping))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 9 of type tippy
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod
|
||||
reset!
|
||||
tippy
|
||||
((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float))
|
||||
(set-vector! (-> obj axis) 0.0 0.0 0.0 1.0)
|
||||
(set! (-> obj angle) 0.0)
|
||||
(quaternion-copy! (-> obj orig) (-> arg0 root quat))
|
||||
(set! (-> obj dist-ratio) arg1)
|
||||
(set! (-> obj damping) arg2)
|
||||
(set! (-> obj 1-damping) (- 1.0 arg2))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type tippy
|
||||
(defmethod
|
||||
TODO-RENAME-10
|
||||
tippy
|
||||
((obj tippy) (arg0 process-drawable) (arg1 vector))
|
||||
(let ((s4-0 #t))
|
||||
(cond
|
||||
(arg1
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(set! (-> s3-0 x) (- (-> arg1 z) (-> arg0 root trans z)))
|
||||
(set! (-> s3-0 y) 0.0)
|
||||
(set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x)))
|
||||
(let ((f0-6 (vector-length s3-0)))
|
||||
(vector-float*! s3-0 s3-0 (/ 1.0 f0-6))
|
||||
(let ((f30-0 (* f0-6 (-> obj dist-ratio))))
|
||||
(set!
|
||||
(-> obj axis x)
|
||||
(+
|
||||
(* (-> obj 1-damping) (-> obj axis x))
|
||||
(* (-> obj damping) (-> s3-0 x))
|
||||
)
|
||||
)
|
||||
(set! (-> obj axis y) 0.0)
|
||||
(set!
|
||||
(-> obj axis z)
|
||||
(+
|
||||
(* (-> obj 1-damping) (-> obj axis z))
|
||||
(* (-> obj damping) (-> s3-0 z))
|
||||
)
|
||||
)
|
||||
(vector-normalize! (-> obj axis) 1.0)
|
||||
(set!
|
||||
(-> obj angle)
|
||||
(+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle)))
|
||||
(when (< (-> obj angle) 182.04445)
|
||||
(set! (-> obj angle) 0.0)
|
||||
(set! s4-0 #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle))
|
||||
(quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig))
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
import glob
|
||||
|
||||
src_files = glob.glob("./goal_src/**/*.g[cs]", recursive=True)
|
||||
data_files = glob.glob("./goal_src/**/*.gd", recursive=True)
|
||||
|
||||
# Find how many of each have been started
|
||||
|
||||
src_files_started = 0
|
||||
src_files_finished = 0
|
||||
data_files_started = 0
|
||||
|
||||
for f in src_files:
|
||||
with open(f, "r") as temp_file:
|
||||
lines = temp_file.readlines()
|
||||
line_count = len(lines)
|
||||
if line_count > 7:
|
||||
# Check to see if there are any TODOs
|
||||
if any("TODO" in string for string in lines):
|
||||
src_files_finished = src_files_finished + 1
|
||||
else:
|
||||
src_files_started = src_files_started + 1
|
||||
|
||||
for f in data_files:
|
||||
with open(f, "r") as temp_file:
|
||||
line_count = len(temp_file.readlines())
|
||||
if line_count > 7:
|
||||
data_files_started = data_files_started + 1
|
||||
|
||||
import json
|
||||
with open('./docs/gh-pages-proj/src/config/progress.json', 'r+', encoding='utf-8') as f:
|
||||
data = {
|
||||
'jak1': {
|
||||
'fileProgress': {
|
||||
'src_files_total': len(src_files),
|
||||
'src_files_finished': src_files_finished,
|
||||
'src_files_started': src_files_started,
|
||||
'data_files_total': len(data_files),
|
||||
'data_files_started': data_files_started
|
||||
}
|
||||
}
|
||||
}
|
||||
f.seek(0)
|
||||
json.dump(data, f, ensure_ascii=False, indent=2)
|
||||
f.truncate()
|
||||
@@ -189,15 +189,15 @@
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
(dummy-12 () none 12)
|
||||
(dummy-12 (_type_ vector float uint process bone uint) float 12)
|
||||
(dummy-13 () none 13)
|
||||
(dummy-14 () none 14)
|
||||
(dummy-15 () none 15)
|
||||
(dummy-16 () none 16)
|
||||
(dummy-16 (_type_ vector float uint process uint) none 16)
|
||||
(dummy-17 () none 17)
|
||||
(dummy-18 () none 18)
|
||||
(dummy-19 () none 19)
|
||||
(dummy-20 () none 20)
|
||||
(dummy-20 (_type_ vector float uint bone uint) none 20)
|
||||
(dummy-21 () none 21)
|
||||
(dummy-22 () none 22)
|
||||
(dummy-23 () none 23)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
(projectile-dissipate () none 21)
|
||||
(projectile-impact () none 22)
|
||||
(dummy-23 () none 23)
|
||||
(dummy-24 () none 24)
|
||||
(dummy-24 (_type_) none 24)
|
||||
(dummy-25 () none 25)
|
||||
(dummy-26 () none 26)
|
||||
(dummy-27 () none 27)
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for function add-fake-shadow-to-buffer
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun
|
||||
add-fake-shadow-to-buffer
|
||||
((arg0 vector) (arg1 vector) (arg2 float) (arg3 int))
|
||||
(let ((v1-0 *fake-shadow-buffer*))
|
||||
(when (< (-> v1-0 num-shadows) 32)
|
||||
(let ((t0-5 (-> v1-0 data (-> v1-0 num-shadows))))
|
||||
(set! (-> t0-5 px) (-> arg0 x))
|
||||
(set! (-> t0-5 py) (-> arg0 y))
|
||||
(set! (-> t0-5 pz) (-> arg0 z))
|
||||
(set! (-> t0-5 scale) arg2)
|
||||
(set! (-> t0-5 qx) (-> arg1 x))
|
||||
(set! (-> t0-5 qy) (-> arg1 y))
|
||||
(set! (-> t0-5 qz) (-> arg1 z))
|
||||
(set! (-> t0-5 flags) arg3)
|
||||
)
|
||||
(+! (-> v1-0 num-shadows) 1)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function swap-fake-shadow-buffers
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun swap-fake-shadow-buffers ()
|
||||
(set! *fake-shadow-buffer* (if (= *fake-shadow-buffer* *fake-shadow-buffer-1*)
|
||||
*fake-shadow-buffer-2*
|
||||
*fake-shadow-buffer-1*
|
||||
)
|
||||
)
|
||||
(set! (-> *fake-shadow-buffer* num-shadows) 0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function draw-shadow
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defun
|
||||
draw-shadow
|
||||
((arg0 vector)
|
||||
(arg1 vector)
|
||||
(arg2 vector)
|
||||
(arg3 float)
|
||||
(arg4 float)
|
||||
(arg5 float)
|
||||
)
|
||||
(let ((f0-1 (- (-> arg0 y) (-> arg1 y))))
|
||||
(if (< f0-1 arg4)
|
||||
(add-fake-shadow-to-buffer
|
||||
arg1
|
||||
arg2
|
||||
(* (- 1.0 (/ f0-1 arg4)) arg3)
|
||||
(the-as int arg5)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function compute-and-draw-shadow
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; Used lq/sq
|
||||
(defun
|
||||
compute-and-draw-shadow
|
||||
((arg0 vector)
|
||||
(arg1 vector)
|
||||
(arg2 vector)
|
||||
(arg3 vector)
|
||||
(arg4 float)
|
||||
(arg5 float)
|
||||
)
|
||||
(local-vars
|
||||
(v1-10 float)
|
||||
(v1-11 float)
|
||||
(sv-96 vector)
|
||||
(sv-112 (function quaternion vector float quaternion))
|
||||
(sv-128 vector)
|
||||
(sv-144 vector)
|
||||
)
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! sv-96 arg2)
|
||||
(let ((s4-0 arg3)
|
||||
(s3-0 arg4)
|
||||
(s2-0 arg5)
|
||||
)
|
||||
(when (< (- (-> arg0 y) (-> arg1 y)) s3-0)
|
||||
(set! sv-144 (new 'stack-no-clear 'vector))
|
||||
(let ((s0-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'sparticle-cpuinfo))
|
||||
)
|
||||
(set! (-> arg1 y) (+ 40.96 (-> arg1 y)))
|
||||
(set! (-> sv-144 x) (-> sv-96 z))
|
||||
(set! (-> sv-144 y) 0.0)
|
||||
(set! (-> sv-144 z) (- (-> sv-96 x)))
|
||||
(vector-normalize! sv-144 1.0)
|
||||
(set! sv-112 quaternion-vector-angle!)
|
||||
(set! sv-128 s0-0)
|
||||
(let ((a2-1 (acos (-> sv-96 y))))
|
||||
(sv-112 (the-as quaternion sv-128) sv-144 a2-1)
|
||||
)
|
||||
(let ((v1-9 s1-0))
|
||||
(cond
|
||||
((< (-> s0-0 w) 0.0)
|
||||
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
|
||||
(.lvf vf2 (&-> s0-0 quad))
|
||||
(.sub.vf vf1 vf0 vf2 :mask #b111)
|
||||
(.svf (&-> v1-9 vel-sxvel quad) vf1)
|
||||
(.mov v1-10 vf1)
|
||||
)
|
||||
(else
|
||||
(.lvf vf1 (&-> v1-9 vel-sxvel quad))
|
||||
(.lvf vf2 (&-> s0-0 quad))
|
||||
(.add.vf vf1 vf0 vf2 :mask #b111)
|
||||
(.svf (&-> v1-9 vel-sxvel quad) vf1)
|
||||
(.mov v1-11 vf1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(draw-shadow arg0 arg1 (-> s1-0 vel-sxvel) (the-as float s4-0) s3-0 s2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function find-ground-and-draw-shadow
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; Used lq/sq
|
||||
(defun
|
||||
find-ground-and-draw-shadow
|
||||
((arg0 vector)
|
||||
(arg1 vector)
|
||||
(arg2 float)
|
||||
(arg3 uint)
|
||||
(arg4 process)
|
||||
(arg5 float)
|
||||
(arg6 float)
|
||||
)
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s2-0 quad) (-> arg0 quad))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(+! (-> s2-0 y) arg5)
|
||||
(let ((s4-0 (new 'stack-no-clear 'bone)))
|
||||
(cond
|
||||
((>=
|
||||
(dummy-12 *collide-cache* s2-0 arg6 arg3 arg4 s4-0 (the-as uint 1))
|
||||
0.0
|
||||
)
|
||||
(if (!= arg2 0.0)
|
||||
(compute-and-draw-shadow
|
||||
s2-0
|
||||
(-> s4-0 transform vector 3)
|
||||
(-> s4-0 scale)
|
||||
(the-as vector arg2)
|
||||
arg6
|
||||
(the-as float 0)
|
||||
)
|
||||
)
|
||||
(if (and arg1 (!= (shr (shl (-> s4-0 cache bone-matrix) 52) 58) 3))
|
||||
(set! (-> arg1 quad) (-> s4-0 transform vector 3 quad))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(if arg1
|
||||
(vector+float*!
|
||||
arg1
|
||||
arg0
|
||||
(-> *standard-dynamics* gravity-normal)
|
||||
(- arg6)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function do-target-shadow
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
;; Used lq/sq
|
||||
(defbehavior do-target-shadow target ()
|
||||
(if
|
||||
(and
|
||||
(logtest? (-> self control status) 1)
|
||||
(!= (-> self control unknown-surface mode) 'swim)
|
||||
(!= (-> self control unknown-surface mode) 'dive)
|
||||
(!= (-> self next-state name) 'target-flop)
|
||||
(zero? (logand (-> self draw status) 38))
|
||||
)
|
||||
(set! (-> self control shadow-pos quad) (-> self control trans quad))
|
||||
(find-ground-and-draw-shadow
|
||||
(-> self control trans)
|
||||
(-> self control shadow-pos)
|
||||
0.0
|
||||
(-> (the-as collide-shape-prim (-> self control root-prim)) collide-with)
|
||||
self
|
||||
0.0
|
||||
81920.0
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set!
|
||||
(-> *part-id-table* 362)
|
||||
(new 'static 'sparticle-launcher
|
||||
:init-specs
|
||||
(new 'static 'inline-array sp-field-init-spec 20
|
||||
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200000)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x6
|
||||
:flags #x1
|
||||
:initial-value #x41000000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #xd
|
||||
:flags #x1
|
||||
:initial-value #x4499999a
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x10
|
||||
:flags #x1
|
||||
:initial-value -956301312
|
||||
:random-range #x47800000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x11
|
||||
:flags #x3
|
||||
:initial-value -4
|
||||
:random-mult 1
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x12
|
||||
:flags #x1
|
||||
:initial-value #x42b40000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x13
|
||||
:flags #x1
|
||||
:initial-value #x42b40000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x14
|
||||
:flags #x1
|
||||
:initial-value #x42b40000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x15
|
||||
:flags #x1
|
||||
:initial-value #x41a00000
|
||||
:random-range #x41a00000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x1a
|
||||
:flags #x1
|
||||
:initial-value #x4103126f
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x1c
|
||||
:flags #x1
|
||||
:initial-value #x41888889
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x20
|
||||
:flags #x3
|
||||
:initial-value -4
|
||||
:random-mult 1
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x24
|
||||
:flags #x1
|
||||
:initial-value -1097229926
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x2e
|
||||
:initial-value #x138c
|
||||
:random-mult 1
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x2f
|
||||
:initial-value 12
|
||||
:random-mult 1
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x36
|
||||
:flags #x1
|
||||
:initial-value -983331271
|
||||
:random-range #x452aaaab
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x3a
|
||||
:flags #x1
|
||||
:initial-value #x46800000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x3b
|
||||
:flags #x1
|
||||
:initial-value -956301312
|
||||
:random-range #x47800000
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec
|
||||
:field #x3e
|
||||
:flags #x1
|
||||
:initial-value #x444ccccd
|
||||
:random-mult #x3f800000
|
||||
)
|
||||
(new 'static 'sp-field-init-spec :field #x43)
|
||||
)
|
||||
)
|
||||
)
|
||||
+12
-12
@@ -5,12 +5,12 @@
|
||||
(deftype sp-field-init-spec (structure)
|
||||
((field uint16 :offset-assert 0)
|
||||
(flags uint16 :offset-assert 2)
|
||||
(initial-valuef float :offset-assert 4)
|
||||
(random-rangef float :offset-assert 8)
|
||||
(random-multf float :offset-assert 12)
|
||||
(initial-value int32 :offset 4)
|
||||
(random-range int32 :offset 8)
|
||||
(random-mult int32 :offset 12)
|
||||
(initial-value int32 :offset-assert 4)
|
||||
(random-range int32 :offset-assert 8)
|
||||
(random-mult int32 :offset-assert 12)
|
||||
(initial-valuef float :offset 4)
|
||||
(random-rangef float :offset 8)
|
||||
(random-multf float :offset 12)
|
||||
(func basic :offset 4)
|
||||
(tex uint32 :offset 4)
|
||||
(pntr uint32 :offset 4)
|
||||
@@ -30,9 +30,9 @@
|
||||
(format #t "~Tinitial-valuef: ~f~%" (-> obj initial-valuef))
|
||||
(format #t "~Trandom-rangef: ~f~%" (-> obj random-rangef))
|
||||
(format #t "~Trandom-multf: ~f~%" (-> obj random-multf))
|
||||
(format #t "~Tinitial-value: ~D~%" (-> obj initial-valuef))
|
||||
(format #t "~Trandom-range: ~D~%" (-> obj random-rangef))
|
||||
(format #t "~Trandom-mult: ~D~%" (-> obj random-multf))
|
||||
(format #t "~Tinitial-value: ~D~%" (-> obj initial-value))
|
||||
(format #t "~Trandom-range: ~D~%" (-> obj random-range))
|
||||
(format #t "~Trandom-mult: ~D~%" (-> obj random-mult))
|
||||
(format #t "~Tfunc: ~A~%" (-> obj initial-valuef))
|
||||
(format #t "~Ttex: ~D~%" (-> obj initial-valuef))
|
||||
(format #t "~Tpntr: #x~X~%" (-> obj initial-valuef))
|
||||
@@ -43,9 +43,9 @@
|
||||
|
||||
;; definition of type sparticle-launcher
|
||||
(deftype sparticle-launcher (basic)
|
||||
((birthaccum float :offset-assert 4)
|
||||
(soundaccum float :offset-assert 8)
|
||||
(init-specs uint32 :offset-assert 12)
|
||||
((birthaccum float :offset-assert 4)
|
||||
(soundaccum float :offset-assert 8)
|
||||
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type twist-joint
|
||||
(deftype twist-joint (structure)
|
||||
((ry float :offset-assert 0)
|
||||
(max-dry float :offset-assert 4)
|
||||
)
|
||||
:allow-misaligned :method-count-assert 9
|
||||
:size-assert #x8
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
;; definition for method 3 of type twist-joint
|
||||
(defmethod inspect twist-joint ((obj twist-joint))
|
||||
(format #t "[~8x] ~A~%" obj 'twist-joint)
|
||||
(format #t "~Try: ~f~%" (-> obj ry))
|
||||
(format #t "~Tmax-dry: ~f~%" (-> obj max-dry))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type twister
|
||||
(deftype twister (basic)
|
||||
((num-joints int32 :offset-assert 4)
|
||||
(first-joint int32 :offset-assert 8)
|
||||
(last-joint int32 :offset-assert 12)
|
||||
(something uint16 :offset 12)
|
||||
(max-speed float :offset-assert 16)
|
||||
(smoothing float :offset-assert 20)
|
||||
(min-dist float :offset-assert 24)
|
||||
(target float :offset-assert 28)
|
||||
(ry float :offset-assert 32)
|
||||
(max-speed-ry float :offset-assert 36)
|
||||
(data twist-joint :inline :dynamic :offset-assert 40)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #x28
|
||||
:flag-assert #xd00000028
|
||||
(:methods
|
||||
(new (symbol _type_ int int float float float float) _type_ 0)
|
||||
(TODO-RENAME-9 (_type_ int int float) none 9)
|
||||
(set-target! (_type_ float) none 10)
|
||||
(TODO-RENAME-11 (_type_) none 11)
|
||||
(TODO-RENAME-12 (_type_ process-drawable) none 12)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type twister
|
||||
(defmethod inspect twister ((obj twister))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tnum-joints: ~D~%" (-> obj num-joints))
|
||||
(format #t "~Tfirst-joint: ~D~%" (-> obj first-joint))
|
||||
(format #t "~Tlast-joint: ~D~%" (-> obj last-joint))
|
||||
(format #t "~Tmax-speed: ~f~%" (-> obj max-speed))
|
||||
(format #t "~Tsmoothing: ~f~%" (-> obj smoothing))
|
||||
(format #t "~Tmin-dist: ~f~%" (-> obj min-dist))
|
||||
(format #t "~Ttarget: ~f~%" (-> obj target))
|
||||
(format #t "~Try: ~f~%" (-> obj ry))
|
||||
(format #t "~Tmax-speed-ry: ~f~%" (-> obj max-speed-ry))
|
||||
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 0 of type twister
|
||||
(defmethod
|
||||
new
|
||||
twister
|
||||
((allocation symbol)
|
||||
(type-to-make twister)
|
||||
(arg0 int)
|
||||
(arg1 int)
|
||||
(arg2 float)
|
||||
(arg3 float)
|
||||
(arg4 float)
|
||||
(arg5 float)
|
||||
)
|
||||
(let* ((gp-0 (+ (- 1 arg0) arg1))
|
||||
(v0-0
|
||||
(object-new
|
||||
allocation
|
||||
(the-as type type-to-make)
|
||||
(the-as int (+ (-> type-to-make something) (* gp-0 16)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> v0-0 first-joint) arg0)
|
||||
(set! (-> v0-0 last-joint) arg1)
|
||||
(set! (-> v0-0 num-joints) gp-0)
|
||||
(set! (-> v0-0 max-speed) arg2)
|
||||
(set! (-> v0-0 smoothing) arg4)
|
||||
(set! (-> v0-0 min-dist) arg5)
|
||||
(set! (-> v0-0 target) 0.0)
|
||||
(set! (-> v0-0 ry) 0.0)
|
||||
(set! (-> v0-0 max-speed-ry) arg3)
|
||||
(dotimes (v1-4 gp-0)
|
||||
(set! (-> v0-0 data v1-4 ry) 0.0)
|
||||
(set! (-> v0-0 data v1-4 max-dry) 0.0)
|
||||
)
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 5 of type twister
|
||||
(defmethod asize-of twister ((obj twister))
|
||||
(+ (* (-> obj num-joints) 16) 40)
|
||||
)
|
||||
|
||||
;; definition for method 9 of type twister
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod
|
||||
TODO-RENAME-9
|
||||
twister
|
||||
((obj twister) (arg0 int) (arg1 int) (arg2 float))
|
||||
(let ((v1-1 (- arg0 (-> obj first-joint)))
|
||||
(a1-2 (- arg1 (-> obj first-joint)))
|
||||
)
|
||||
(while (>= a1-2 v1-1)
|
||||
(set! (-> obj data v1-1 max-dry) arg2)
|
||||
(+! v1-1 1)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type twister
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod set-target! twister ((obj twister) (arg0 float))
|
||||
(set! (-> obj target) arg0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 11 of type twister
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod TODO-RENAME-11 twister ((obj twister))
|
||||
(let* ((s5-0 (+ (-> obj num-joints) -1))
|
||||
(s4-0 (-> obj data s5-0))
|
||||
)
|
||||
(let ((f0-2 (deg-diff (-> s4-0 ry) (-> obj target))))
|
||||
(+!
|
||||
(-> s4-0 ry)
|
||||
(seek-with-smooth
|
||||
0.0
|
||||
f0-2
|
||||
(-> obj max-speed)
|
||||
(-> obj smoothing)
|
||||
(-> obj min-dist)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f30-1 (-> s4-0 ry)))
|
||||
(while (> s5-0 0)
|
||||
(+! s5-0 -1)
|
||||
(let ((s4-1 (-> obj data s5-0)))
|
||||
(let ((f0-9 (deg-diff f30-1 (-> s4-1 ry))))
|
||||
(cond
|
||||
((= (-> s4-1 max-dry) 0.0)
|
||||
(set! f0-9 0.0)
|
||||
)
|
||||
((< (fabs f0-9) (-> s4-1 max-dry))
|
||||
)
|
||||
((< f0-9 0.0)
|
||||
(set!
|
||||
f0-9
|
||||
(seek-with-smooth
|
||||
f0-9
|
||||
(- (-> s4-1 max-dry))
|
||||
(-> obj max-speed)
|
||||
(-> obj smoothing)
|
||||
(-> obj min-dist)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set!
|
||||
f0-9
|
||||
(seek-with-smooth
|
||||
f0-9
|
||||
(-> s4-1 max-dry)
|
||||
(-> obj max-speed)
|
||||
(-> obj smoothing)
|
||||
(-> obj min-dist)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! f30-1 f0-9)
|
||||
)
|
||||
(set! (-> s4-1 ry) f30-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 12 of type twister
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod TODO-RENAME-12 twister ((obj twister) (arg0 process-drawable))
|
||||
(let ((s4-0 (new 'stack-no-clear 'matrix)))
|
||||
(dotimes (s3-0 (-> obj num-joints))
|
||||
(let
|
||||
((s2-0
|
||||
(-> arg0 node-list data (+ (-> obj first-joint) s3-0) bone transform)
|
||||
)
|
||||
)
|
||||
(matrix-rotate-y! s4-0 (-> obj data s3-0 ry))
|
||||
(vector-! (-> s2-0 vector 3) (-> s2-0 vector 3) (-> arg0 root trans))
|
||||
(matrix*! s2-0 s2-0 s4-0)
|
||||
(vector+! (-> s2-0 vector 3) (-> s2-0 vector 3) (-> arg0 root trans))
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type wobbler
|
||||
(deftype wobbler (basic)
|
||||
((posx float :offset-assert 4)
|
||||
(posy float :offset-assert 8)
|
||||
(velx float :offset-assert 12)
|
||||
(vely float :offset-assert 16)
|
||||
(spring float :offset-assert 20)
|
||||
(damping float :offset-assert 24)
|
||||
(height float :offset-assert 28)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #x20
|
||||
:flag-assert #xd00000020
|
||||
(:methods
|
||||
(reset! (_type_ float float float) none 9)
|
||||
(inc-xy-vel! (_type_ float float) none 10)
|
||||
(move! (_type_) none 11)
|
||||
(TODO-RENAME-12 (_type_ quaternion) none 12)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type wobbler
|
||||
(defmethod inspect wobbler ((obj wobbler))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tposx: ~f~%" (-> obj posx))
|
||||
(format #t "~Tposy: ~f~%" (-> obj posy))
|
||||
(format #t "~Tvelx: ~f~%" (-> obj velx))
|
||||
(format #t "~Tvely: ~f~%" (-> obj vely))
|
||||
(format #t "~Tspring: ~f~%" (-> obj spring))
|
||||
(format #t "~Tdamping: ~f~%" (-> obj damping))
|
||||
(format #t "~Theight: ~f~%" (-> obj height))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 9 of type wobbler
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod reset! wobbler ((obj wobbler) (arg0 float) (arg1 float) (arg2 float))
|
||||
(set! (-> obj posx) 0.0)
|
||||
(set! (-> obj posy) 0.0)
|
||||
(set! (-> obj velx) 0.0)
|
||||
(set! (-> obj vely) 0.0)
|
||||
(set! (-> obj spring) arg0)
|
||||
(set! (-> obj damping) arg1)
|
||||
(set! (-> obj height) arg2)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type wobbler
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod inc-xy-vel! wobbler ((obj wobbler) (arg0 float) (arg1 float))
|
||||
(+! (-> obj velx) arg0)
|
||||
(+! (-> obj vely) arg1)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 11 of type wobbler
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod move! wobbler ((obj wobbler))
|
||||
(+! (-> obj posx) (* (-> obj velx) (-> *display* seconds-per-frame)))
|
||||
(+! (-> obj posy) (* (-> obj vely) (-> *display* seconds-per-frame)))
|
||||
(set! (-> obj velx) (* (-> obj velx) (-> obj damping)))
|
||||
(set! (-> obj vely) (* (-> obj vely) (-> obj damping)))
|
||||
(+! (-> obj velx) (* (* -1.0 (-> obj posx)) (-> obj spring)))
|
||||
(+! (-> obj vely) (* (* -1.0 (-> obj posy)) (-> obj spring)))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 12 of type wobbler
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod TODO-RENAME-12 wobbler ((obj wobbler) (arg0 quaternion))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s5-0 x) (-> obj posy))
|
||||
(set! (-> s5-0 y) 0.0)
|
||||
(set! (-> s5-0 z) (- (-> obj posx)))
|
||||
(vector-normalize! s5-0 1.0)
|
||||
(let*
|
||||
((f0-8
|
||||
(/
|
||||
(sqrtf
|
||||
(+ (* (-> obj posx) (-> obj posx)) (* (-> obj posy) (-> obj posy)))
|
||||
)
|
||||
(-> obj height)
|
||||
)
|
||||
)
|
||||
(f0-9 (atan f0-8 1.0))
|
||||
)
|
||||
(quaternion-vector-angle! arg0 s5-0 f0-9)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type ticky
|
||||
(deftype ticky (structure)
|
||||
((delay-til-ramp uint64 :offset-assert 0)
|
||||
(delay-til-timeout uint64 :offset-assert 8)
|
||||
(starting-time uint64 :offset-assert 16)
|
||||
(last-tick-time uint64 :offset-assert 24)
|
||||
)
|
||||
:method-count-assert 12
|
||||
:size-assert #x20
|
||||
:flag-assert #xc00000020
|
||||
(:methods
|
||||
(sleep (_type_ uint) none 9)
|
||||
(reached-delay? (_type_ uint) symbol 10)
|
||||
(completed? (_type_) symbol 11)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type ticky
|
||||
(defmethod inspect ticky ((obj ticky))
|
||||
(format #t "[~8x] ~A~%" obj 'ticky)
|
||||
(format #t "~Tdelay-til-ramp: ~D~%" (-> obj delay-til-ramp))
|
||||
(format #t "~Tdelay-til-timeout: ~D~%" (-> obj delay-til-timeout))
|
||||
(format #t "~Tstarting-time: ~D~%" (-> obj starting-time))
|
||||
(format #t "~Tlast-tick-time: ~D~%" (-> obj last-tick-time))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 9 of type ticky
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod sleep ticky ((obj ticky) (arg0 uint))
|
||||
(set! (-> obj starting-time) (-> *display* base-frame-counter))
|
||||
(set! (-> obj delay-til-timeout) arg0)
|
||||
(set! (-> obj delay-til-ramp) (max 0 (the-as int (+ arg0 -1200))))
|
||||
(set! (-> obj last-tick-time) (the-as uint 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
|
||||
((>= (the-as int v1-2) (the-as int (-> obj delay-til-timeout)))
|
||||
(set! gp-0 #t)
|
||||
)
|
||||
(else
|
||||
(let*
|
||||
((f0-1
|
||||
(fmin
|
||||
1.0
|
||||
(/
|
||||
(the float (max 0 (the-as int (- 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
|
||||
(>=
|
||||
(the-as
|
||||
int
|
||||
(- (-> *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
|
||||
(the-as uint 1)
|
||||
(the-as vector #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type ticky
|
||||
(defmethod reached-delay? ticky ((obj ticky) (arg0 uint))
|
||||
(>=
|
||||
(the-as int (- (-> *display* base-frame-counter) (-> obj starting-time)))
|
||||
(the-as int arg0)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type tippy
|
||||
(deftype tippy (structure)
|
||||
((axis vector :inline :offset-assert 0)
|
||||
(angle float :offset-assert 16)
|
||||
(orig quaternion :inline :offset-assert 32)
|
||||
(dist-ratio float :offset-assert 48)
|
||||
(damping float :offset-assert 52)
|
||||
(1-damping float :offset-assert 56)
|
||||
)
|
||||
:method-count-assert 11
|
||||
:size-assert #x3c
|
||||
:flag-assert #xb0000003c
|
||||
(:methods
|
||||
(reset! (_type_ process-drawable float float) none 9)
|
||||
(TODO-RENAME-10 (_type_ process-drawable vector) symbol 10)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tippy
|
||||
(defmethod inspect tippy ((obj tippy))
|
||||
(format #t "[~8x] ~A~%" obj 'tippy)
|
||||
(format #t "~Taxis: #<vector @ #x~X>~%" (-> obj axis))
|
||||
(format #t "~Tangle: ~f~%" (-> obj angle))
|
||||
(format #t "~Torig: #<quaternion @ #x~X>~%" (-> obj orig))
|
||||
(format #t "~Tdist-ratio: ~f~%" (-> obj dist-ratio))
|
||||
(format #t "~Tdamping: ~f~%" (-> obj damping))
|
||||
(format #t "~T1-damping: ~f~%" (-> obj 1-damping))
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 9 of type tippy
|
||||
;; INFO: Return type mismatch int vs none.
|
||||
(defmethod
|
||||
reset!
|
||||
tippy
|
||||
((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float))
|
||||
(set-vector! (-> obj axis) 0.0 0.0 0.0 1.0)
|
||||
(set! (-> obj angle) 0.0)
|
||||
(quaternion-copy! (-> obj orig) (-> arg0 root quat))
|
||||
(set! (-> obj dist-ratio) arg1)
|
||||
(set! (-> obj damping) arg2)
|
||||
(set! (-> obj 1-damping) (- 1.0 arg2))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type tippy
|
||||
(defmethod
|
||||
TODO-RENAME-10
|
||||
tippy
|
||||
((obj tippy) (arg0 process-drawable) (arg1 vector))
|
||||
(let ((s4-0 #t))
|
||||
(cond
|
||||
(arg1
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(set! (-> s3-0 x) (- (-> arg1 z) (-> arg0 root trans z)))
|
||||
(set! (-> s3-0 y) 0.0)
|
||||
(set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x)))
|
||||
(let ((f0-6 (vector-length s3-0)))
|
||||
(vector-float*! s3-0 s3-0 (/ 1.0 f0-6))
|
||||
(let ((f30-0 (* f0-6 (-> obj dist-ratio))))
|
||||
(set!
|
||||
(-> obj axis x)
|
||||
(+
|
||||
(* (-> obj 1-damping) (-> obj axis x))
|
||||
(* (-> obj damping) (-> s3-0 x))
|
||||
)
|
||||
)
|
||||
(set! (-> obj axis y) 0.0)
|
||||
(set!
|
||||
(-> obj axis z)
|
||||
(+
|
||||
(* (-> obj 1-damping) (-> obj axis z))
|
||||
(* (-> obj damping) (-> s3-0 z))
|
||||
)
|
||||
)
|
||||
(vector-normalize! (-> obj axis) 1.0)
|
||||
(set!
|
||||
(-> obj angle)
|
||||
(+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle)))
|
||||
(when (< (-> obj angle) 182.04445)
|
||||
(set! (-> obj angle) 0.0)
|
||||
(set! s4-0 #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle))
|
||||
(quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig))
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user