;;-*-Lisp-*- (in-package goal) ;; this file is debug only (declare-file (debug)) ;; definition for function cleanup-selection ;; WARN: Return type mismatch int vs object. (defun cleanup-selection ((arg0 editable-array)) (let* ((v1-0 (-> arg0 length)) (a0-1 0) (a1-2 (-> arg0 data a0-1)) ) (while (< a0-1 v1-0) (if a1-2 (logclear! (-> a1-2 flags) (editable-flag mark)) ) (+! a0-1 1) (set! a1-2 (-> arg0 data a0-1)) ) ) (let* ((s5-0 (-> arg0 length)) (s4-0 0) (a0-2 (-> arg0 data s4-0)) ) (while (< s4-0 s5-0) (if (and a0-2 (logtest? (-> a0-2 flags) (editable-flag selected))) (editable-method-31 a0-2 (editable-flag)) ) (+! s4-0 1) (set! a0-2 (-> arg0 data s4-0)) ) ) 0 ) ;; definition for function insert-box ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs object. (defun insert-box ((arg0 editable-array) (arg1 vector) (arg2 vector)) (if (not (-> arg0 region)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) (let ((f30-0 (* 4096.0 (-> arg0 edit-param0))) (s2-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'array 'int32 8)) ) (let ((s3-0 (-> arg0 region))) (if (= f30-0 0.0) (set! f30-0 40960.0) ) (dotimes (s0-0 8) (set! (-> s4-0 s0-0) (get-length arg0)) (set! (-> arg0 data (-> s4-0 s0-0)) (the-as editable #t)) ) (dotimes (v1-13 8) (when (< (-> s4-0 v1-13) 0) (dotimes (v1-14 8) (set! (-> arg0 data (-> s4-0 v1-14)) #f) ) (return (the-as object #f)) ) ) (vector-copy! s2-0 arg1) (set! (-> s2-0 y) (- (-> s2-0 y) f30-0)) (set! (-> s2-0 x) (- (-> s2-0 x) f30-0)) (set! (-> s2-0 z) (- (-> s2-0 z) f30-0)) (set! (-> arg0 data (-> s4-0 0)) (new 'debug 'editable-point s2-0 s3-0)) (vector-copy! s2-0 arg1) (set! (-> s2-0 y) (- (-> s2-0 y) f30-0)) (+! (-> s2-0 x) f30-0) (set! (-> s2-0 z) (- (-> s2-0 z) f30-0)) (set! (-> arg0 data (-> s4-0 1)) (new 'debug 'editable-point s2-0 s3-0)) (vector-copy! s2-0 arg1) (set! (-> s2-0 y) (- (-> s2-0 y) f30-0)) (set! (-> s2-0 x) (- (-> s2-0 x) f30-0)) (+! (-> s2-0 z) f30-0) (set! (-> arg0 data (-> s4-0 2)) (new 'debug 'editable-point s2-0 s3-0)) (vector-copy! s2-0 arg1) (set! (-> s2-0 y) (- (-> s2-0 y) f30-0)) (+! (-> s2-0 x) f30-0) (+! (-> s2-0 z) f30-0) (set! (-> arg0 data (-> s4-0 3)) (new 'debug 'editable-point s2-0 s3-0)) (vector-copy! s2-0 arg1) (+! (-> s2-0 y) f30-0) (set! (-> s2-0 x) (- (-> s2-0 x) f30-0)) (set! (-> s2-0 z) (- (-> s2-0 z) f30-0)) (set! (-> arg0 data (-> s4-0 4)) (new 'debug 'editable-point s2-0 s3-0)) (vector-copy! s2-0 arg1) (+! (-> s2-0 y) f30-0) (+! (-> s2-0 x) f30-0) (set! (-> s2-0 z) (- (-> s2-0 z) f30-0)) (set! (-> arg0 data (-> s4-0 5)) (new 'debug 'editable-point s2-0 s3-0)) (vector-copy! s2-0 arg1) (+! (-> s2-0 y) f30-0) (set! (-> s2-0 x) (- (-> s2-0 x) f30-0)) (+! (-> s2-0 z) f30-0) (set! (-> arg0 data (-> s4-0 6)) (new 'debug 'editable-point s2-0 s3-0)) (vector-copy! s2-0 arg1) (+! (-> s2-0 y) f30-0) (+! (-> s2-0 x) f30-0) (+! (-> s2-0 z) f30-0) (set! (-> arg0 data (-> s4-0 7)) (new 'debug 'editable-point s2-0 s3-0)) (handle-cmd arg0 (editable-command select-none) (the-as mouse-info #f) arg2) (set-selected! (-> arg0 data (-> s4-0 0)) #t) (set-selected! (-> arg0 data (-> s4-0 1)) #t) (set-selected! (-> arg0 data (-> s4-0 2)) #t) (set-selected! (-> arg0 data (-> s4-0 3)) #t) (set! (-> arg0 region) s3-0) (handle-cmd arg0 (editable-command insert-face) (the-as mouse-info #f) arg2) (handle-cmd arg0 (editable-command select-none) (the-as mouse-info #f) arg2) (set-selected! (-> arg0 data (-> s4-0 4)) #t) (set-selected! (-> arg0 data (-> s4-0 5)) #t) (set-selected! (-> arg0 data (-> s4-0 6)) #t) (set-selected! (-> arg0 data (-> s4-0 7)) #t) (set! (-> arg0 region) s3-0) (handle-cmd arg0 (editable-command insert-face) (the-as mouse-info #f) arg2) (handle-cmd arg0 (editable-command flip-side) (the-as mouse-info #f) arg2) (handle-cmd arg0 (editable-command select-none) (the-as mouse-info #f) arg2) (set-selected! (-> arg0 data (-> s4-0 0)) #t) (set-selected! (-> arg0 data (-> s4-0 2)) #t) (set-selected! (-> arg0 data (-> s4-0 4)) #t) (set-selected! (-> arg0 data (-> s4-0 6)) #t) (set! (-> arg0 region) s3-0) (handle-cmd arg0 (editable-command insert-face) (the-as mouse-info #f) arg2) (handle-cmd arg0 (editable-command select-none) (the-as mouse-info #f) arg2) (set-selected! (-> arg0 data (-> s4-0 1)) #t) (set-selected! (-> arg0 data (-> s4-0 3)) #t) (set-selected! (-> arg0 data (-> s4-0 5)) #t) (set-selected! (-> arg0 data (-> s4-0 7)) #t) (set! (-> arg0 region) s3-0) (handle-cmd arg0 (editable-command insert-face) (the-as mouse-info #f) arg2) (handle-cmd arg0 (editable-command flip-side) (the-as mouse-info #f) arg2) (handle-cmd arg0 (editable-command select-none) (the-as mouse-info #f) arg2) (set-selected! (-> arg0 data (-> s4-0 0)) #t) (set-selected! (-> arg0 data (-> s4-0 1)) #t) (set-selected! (-> arg0 data (-> s4-0 4)) #t) (set-selected! (-> arg0 data (-> s4-0 5)) #t) (set! (-> arg0 region) s3-0) (handle-cmd arg0 (editable-command insert-face) (the-as mouse-info #f) arg2) (handle-cmd arg0 (editable-command flip-side) (the-as mouse-info #f) arg2) (handle-cmd arg0 (editable-command select-none) (the-as mouse-info #f) arg2) (set-selected! (-> arg0 data (-> s4-0 2)) #t) (set-selected! (-> arg0 data (-> s4-0 3)) #t) (set-selected! (-> arg0 data (-> s4-0 6)) #t) (set-selected! (-> arg0 data (-> s4-0 7)) #t) (set! (-> arg0 region) s3-0) (handle-cmd arg0 (editable-command insert-face) (the-as mouse-info #f) arg2) (handle-cmd arg0 (editable-command select-none) (the-as mouse-info #f) arg2) (set! (-> arg0 region) s3-0) ) (dotimes (s3-1 8) (set-selected! (-> arg0 data (-> s4-0 s3-1)) #t) ) ) (handle-cmd arg0 (editable-command select-current-owner) (the-as mouse-info #f) arg2) 0 ) ;; definition for function insert-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs object. (defun insert-wall ((arg0 editable-array) (arg1 vector) (arg2 vector)) (if (not (-> arg0 region)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) (let ((f30-0 (* 4096.0 (-> arg0 edit-param0))) (s1-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'array 'int32 2)) ) (let ((s3-0 (-> arg0 region))) (if (= f30-0 0.0) (set! f30-0 40960.0) ) (dotimes (s0-0 2) (set! (-> s4-0 s0-0) (get-length arg0)) (set! (-> arg0 data (-> s4-0 s0-0)) (the-as editable #t)) ) (dotimes (v1-13 2) (when (< (-> s4-0 v1-13) 0) (dotimes (v1-14 2) (set! (-> arg0 data (-> s4-0 v1-14)) #f) ) (return (the-as object #f)) ) ) (vector-copy! s1-0 arg1) (set! (-> s1-0 y) (- (-> s1-0 y) f30-0)) (set! (-> s1-0 x) (- (-> s1-0 x) f30-0)) (set! (-> arg0 data (-> s4-0 0)) (new 'debug 'editable-point s1-0 s3-0)) (vector-copy! s1-0 arg1) (+! (-> s1-0 y) f30-0) (+! (-> s1-0 x) f30-0) (set! (-> arg0 data (-> s4-0 1)) (new 'debug 'editable-point s1-0 s3-0)) (handle-cmd arg0 (editable-command select-none) (the-as mouse-info #f) arg2) (set-selected! (-> arg0 data (-> s4-0 0)) #t) (set-selected! (-> arg0 data (-> s4-0 1)) #t) (set! (-> arg0 region) s3-0) (handle-cmd arg0 (editable-command insert-face) (the-as mouse-info #f) arg2) (handle-cmd arg0 (editable-command select-none) (the-as mouse-info #f) arg2) (set! (-> arg0 region) s3-0) ) (dotimes (s3-1 2) (set-selected! (-> arg0 data (-> s4-0 s3-1)) #t) ) ) (handle-cmd arg0 (editable-command select-current-owner) (the-as mouse-info #f) arg2) 0 ) ;; definition for function update-manipulator-position ;; INFO: Used lq/sq (defun update-manipulator-position ((arg0 editable-array) (arg1 manipulator)) (let ((sv-32 (new-stack-vector0)) (sv-40 0) (sv-48 (the-as euler-angles #f)) ) (let* ((s4-0 (-> arg0 length)) (s3-0 0) (s2-0 (-> arg0 data s3-0)) ) (while (< s3-0 s4-0) (when (and s2-0 (logtest? (-> s2-0 flags) (editable-flag selected))) (set! sv-48 (the-as euler-angles (get-null-vec s2-0))) (vector+! sv-32 sv-32 (editable-method-15 s2-0)) (+! sv-40 1) (if (not (-> arg0 region-lock?)) (set! (-> arg0 region) (-> s2-0 region)) ) ) (+! s3-0 1) (set! s2-0 (-> arg0 data s3-0)) ) ) (when (nonzero? sv-40) (vector-float*! (-> arg1 position) sv-32 (/ 1.0 (the float sv-40))) (set! (-> arg1 angles quad) (-> sv-48 quad)) (eul->matrix (-> arg1 mat) sv-48) ) ) ) ;; definition for function execute-select (defun execute-select ((arg0 editable-array) (arg1 editable-command) (arg2 mouse-info) (arg3 manipulator)) (case arg1 (((editable-command select-none)) (let* ((s5-1 (-> arg0 length)) (s4-1 0) (a0-2 (-> arg0 data s4-1)) ) (while (< s4-1 s5-1) (if (and a0-2 (logtest? (-> a0-2 flags) (editable-flag selected))) (set-selected! a0-2 #f) ) (+! s4-1 1) (set! a0-2 (-> arg0 data s4-1)) ) ) (if (not (-> arg0 region-lock?)) (set! (-> arg0 region) #f) ) ) (((editable-command select-all)) (let* ((s5-2 (-> arg0 length)) (s4-2 0) (a0-4 (-> arg0 data s4-2)) ) (while (< s4-2 s5-2) (if (and a0-4 (or (and (logtest? (-> a0-4 region filter) (-> arg0 filter 0)) (logtest? (-> a0-4 region filter) (-> arg0 filter 1)) ) (logtest? (-> a0-4 flags) (editable-flag selected)) ) ) (set-selected! a0-4 #t) ) (+! s4-2 1) (set! a0-4 (-> arg0 data s4-2)) ) ) ) (((editable-command select-one)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-7 arg0) (t9-4 (method-of-object a0-7 editable-array-method-10)) (a1-12 (new 'stack-no-clear 'vector)) ) (set! (-> a1-12 x) (-> arg2 posx)) (set! (-> a1-12 y) (-> arg2 posy)) (set! (-> a1-12 z) 0.0) (set! (-> a1-12 w) 1.0) (let ((s3-1 (t9-4 a0-7 a1-12 0))) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (when s3-1 (set-selected! s3-1 #t) (if (not (-> arg0 region-lock?)) (set! (-> arg0 region) (-> s3-1 region)) ) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command select-add)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-13 arg0) (t9-10 (method-of-object a0-13 editable-array-method-10)) (a1-17 (new 'stack-no-clear 'vector)) ) (set! (-> a1-17 x) (-> arg2 posx)) (set! (-> a1-17 y) (-> arg2 posy)) (set! (-> a1-17 z) 0.0) (set! (-> a1-17 w) 1.0) (let ((s4-3 (t9-10 a0-13 a1-17 0))) (when s4-3 (set-selected! s4-3 #t) (if (not (-> arg0 region-lock?)) (set! (-> arg0 region) (-> s4-3 region)) ) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command select-remove)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-18 arg0) (t9-15 (method-of-object a0-18 editable-array-method-10)) (a1-21 (new 'stack-no-clear 'vector)) ) (set! (-> a1-21 x) (-> arg2 posx)) (set! (-> a1-21 y) (-> arg2 posy)) (set! (-> a1-21 z) 0.0) (set! (-> a1-21 w) 1.0) (let ((s4-4 (t9-15 a0-18 a1-21 0))) (when s4-4 (set-selected! s4-4 #f) (if (not (-> arg0 region-lock?)) (set! (-> arg0 region) (-> s4-4 region)) ) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command select-toggle)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-23 arg0) (t9-20 (method-of-object a0-23 editable-array-method-10)) (a1-25 (new 'stack-no-clear 'vector)) ) (set! (-> a1-25 x) (-> arg2 posx)) (set! (-> a1-25 y) (-> arg2 posy)) (set! (-> a1-25 z) 0.0) (set! (-> a1-25 w) 1.0) (let ((s4-5 (t9-20 a0-23 a1-25 1))) (when s4-5 (set-selected! s4-5 'toggle) (if (and (logtest? (-> s4-5 flags) (editable-flag selected)) (not (-> arg0 region-lock?))) (set! (-> arg0 region) (-> s4-5 region)) ) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command select-region)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-28 arg0) (t9-25 (method-of-object a0-28 editable-array-method-10)) (a1-29 (new 'stack-no-clear 'vector)) ) (set! (-> a1-29 x) (-> arg2 posx)) (set! (-> a1-29 y) (-> arg2 posy)) (set! (-> a1-29 z) 0.0) (set! (-> a1-29 w) 1.0) (let ((s3-6 (t9-25 a0-28 a1-29 0))) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (when s3-6 (set-selected! s3-6 #t) (set! (-> arg0 backup-region) (-> arg0 region)) (set! (-> arg0 region) (-> s3-6 region)) (handle-cmd arg0 (editable-command select-current-region) arg2 arg3) (if (-> arg0 region-lock?) (set! (-> arg0 region) (-> arg0 backup-region)) ) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command select-face)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-35 arg0) (t9-32 (method-of-object a0-35 editable-array-method-10)) (a1-35 (new 'stack-no-clear 'vector)) ) (set! (-> a1-35 x) (-> arg2 posx)) (set! (-> a1-35 y) (-> arg2 posy)) (set! (-> a1-35 z) 0.0) (set! (-> a1-35 w) 1.0) (let ((s3-8 (t9-32 a0-35 a1-35 0))) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (when s3-8 (set-selected! s3-8 #t) (set! (-> arg0 backup-region) (-> arg0 region)) (set! (-> arg0 region) (-> s3-8 region)) (handle-cmd arg0 (editable-command select-current-face) arg2 arg3) (if (-> arg0 region-lock?) (set! (-> arg0 region) (-> arg0 backup-region)) ) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command select-prim)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-42 arg0) (t9-39 (method-of-object a0-42 editable-array-method-10)) (a1-41 (new 'stack-no-clear 'vector)) ) (set! (-> a1-41 x) (-> arg2 posx)) (set! (-> a1-41 y) (-> arg2 posy)) (set! (-> a1-41 z) 0.0) (set! (-> a1-41 w) 1.0) (let ((s3-10 (t9-39 a0-42 a1-41 0))) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (when s3-10 (set-selected! s3-10 #t) (set! (-> arg0 backup-region) (-> arg0 region)) (set! (-> arg0 region) (-> s3-10 region)) (handle-cmd arg0 (editable-command select-current-prim) arg2 arg3) (if (-> arg0 region-lock?) (set! (-> arg0 region) (-> arg0 backup-region)) ) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command select-current-region)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (when (-> arg0 region) (let ((s3-12 (-> arg0 region))) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (set! (-> arg0 region) s3-12) ) (let* ((s4-6 (-> arg0 length)) (s3-13 0) (a0-50 (-> arg0 data s3-13)) ) (while (< s3-13 s4-6) (when (and a0-50 (or (and (logtest? (-> a0-50 region filter) (-> arg0 filter 0)) (logtest? (-> a0-50 region filter) (-> arg0 filter 1)) ) (logtest? (-> a0-50 flags) (editable-flag selected)) ) ) (if (= (-> arg0 region) (-> a0-50 region)) (set-selected! a0-50 #t) ) ) (+! s3-13 1) (set! a0-50 (-> arg0 data s3-13)) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command select-current-owner)) (let* ((s4-7 (-> arg0 length)) (s3-14 0) (v1-145 (-> arg0 data s3-14)) ) (while (< s3-14 s4-7) (when (and v1-145 (logtest? (-> v1-145 flags) (editable-flag selected))) (let* ((s2-8 (-> v1-145 owner)) (a0-56 (car s2-8)) ) (while (not (null? s2-8)) (set-selected! (the-as editable a0-56) #t) (set! s2-8 (cdr s2-8)) (set! a0-56 (car s2-8)) ) ) ) (+! s3-14 1) (set! v1-145 (-> arg0 data s3-14)) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command select-current-face)) (let* ((s4-8 (-> arg0 length)) (s3-15 0) (v1-159 (-> arg0 data s3-15)) ) (while (< s3-15 s4-8) (when (and v1-159 (logtest? (-> v1-159 flags) (editable-flag selected))) (let* ((s2-9 (-> v1-159 owner)) (a0-62 (car s2-9)) ) (while (not (null? s2-9)) (set-selected! (the-as editable a0-62) #t) (set! s2-9 (cdr s2-9)) (set! a0-62 (car s2-9)) ) ) ) (+! s3-15 1) (set! v1-159 (-> arg0 data s3-15)) ) ) (let* ((s4-9 (-> arg0 length)) (s3-16 0) (s2-10 (-> arg0 data s3-16)) ) (while (< s3-16 s4-9) (when (and s2-10 (or (and (logtest? (-> s2-10 region filter) (-> arg0 filter 0)) (logtest? (-> s2-10 region filter) (-> arg0 filter 1)) ) (logtest? (-> s2-10 flags) (editable-flag selected)) ) ) (let* ((s1-0 (-> s2-10 owner)) (v1-180 (car s1-0)) ) (while (not (null? s1-0)) (if (logtest? (-> (the-as editable v1-180) flags) (editable-flag selected)) (set-selected! s2-10 #t) ) (set! s1-0 (cdr s1-0)) (set! v1-180 (car s1-0)) ) ) ) (+! s3-16 1) (set! s2-10 (-> arg0 data s3-16)) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command select-current-prim)) (countdown (s4-10 10) (let* ((s3-17 (-> arg0 length)) (s2-11 0) (v1-195 (-> arg0 data s2-11)) ) (while (< s2-11 s3-17) (when (and v1-195 (logtest? (-> v1-195 flags) (editable-flag selected))) (let* ((s1-1 (-> v1-195 owner)) (a0-76 (car s1-1)) ) (while (not (null? s1-1)) (set-selected! (the-as editable a0-76) #t) (set! s1-1 (cdr s1-1)) (set! a0-76 (car s1-1)) ) ) ) (+! s2-11 1) (set! v1-195 (-> arg0 data s2-11)) ) ) (let* ((s3-18 (-> arg0 length)) (s2-12 0) (s1-2 (-> arg0 data s2-12)) ) (while (< s2-12 s3-18) (when (and s1-2 (or (and (logtest? (-> s1-2 region filter) (-> arg0 filter 0)) (logtest? (-> s1-2 region filter) (-> arg0 filter 1)) ) (logtest? (-> s1-2 flags) (editable-flag selected)) ) ) (let* ((s0-0 (-> s1-2 owner)) (v1-216 (car s0-0)) ) (while (not (null? s0-0)) (if (logtest? (-> (the-as editable v1-216) flags) (editable-flag selected)) (set-selected! s1-2 #t) ) (set! s0-0 (cdr s0-0)) (set! v1-216 (car s0-0)) ) ) ) (+! s2-12 1) (set! s1-2 (-> arg0 data s2-12)) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command cancel)) (editable-array-method-14 arg0 (editable-command none) (editable-command none) (the-as string #f)) ) (((editable-command pick-target)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a0-90 arg0) (t9-60 (method-of-object a0-90 editable-array-method-10)) (a1-75 (new 'stack-no-clear 'vector)) ) (set! (-> a1-75 x) (-> arg2 posx)) (set! (-> a1-75 y) (-> arg2 posy)) (set! (-> a1-75 z) 0.0) (set! (-> a1-75 w) 1.0) (let ((v1-235 (t9-60 a0-90 a1-75 0))) (when v1-235 (set! (-> arg0 target) v1-235) (handle-cmd arg0 (-> arg0 target-command) arg2 arg3) ) ) ) (editable-array-method-14 arg0 (editable-command none) (editable-command none) (the-as string #f)) ) (((editable-command pick-loc) (editable-command pick-yes-no)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (handle-cmd arg0 (-> arg0 target-command) arg2 arg3) (editable-array-method-14 arg0 (editable-command none) (editable-command none) (the-as string #f)) ) (((editable-command edit-plane-clear)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (set! (-> arg0 edit-plane) #f) (editable-array-method-17 arg0) ) (((editable-command edit-plane-set)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (cond ((-> arg0 target) (set! (-> arg0 edit-plane) (the-as editable-plane (as-type (-> arg0 target) editable-plane))) (editable-array-method-17 arg0) ) (else (editable-array-method-15 arg0 (the-as (function editable editable-region symbol) (lambda ((arg0 editable)) (type? arg0 editable-plane))) (the-as editable-region #f) ) (cond ((>= (-> arg0 selection length) 1) (set! (-> arg0 edit-plane) (the-as editable-plane (-> arg0 selection 0))) (editable-array-method-17 arg0) ) (else (editable-array-method-14 arg0 (editable-command pick-target) (editable-command edit-plane-set) "pick the plane to edit-from" ) ) ) ) ) ) (((editable-command print-region-info)) (let ((s5-6 (-> arg0 region))) (when s5-6 (format #t "~%~%region-~D~%~%" (-> s5-6 id)) (let ((a2-39 (-> s5-6 on-enter))) (if a2-39 (format #t "(on-enter ~S)~%" a2-39) ) ) (let ((a2-40 (-> s5-6 on-inside))) (if a2-40 (format #t "(on-inside ~S)~%" a2-40) ) ) (let ((a2-41 (-> s5-6 on-exit))) (if a2-41 (format #t "(on-exit ~S)~%" a2-41) ) ) (format #t "~%~%") ) ) (format #t "~%selected:~%") (let* ((s5-7 (-> arg0 length)) (s4-13 0) (a2-42 (-> arg0 data s4-13)) ) (while (< s4-13 s5-7) (if (and a2-42 (logtest? (-> a2-42 flags) (editable-flag selected))) (format #t "~A~%" a2-42) ) (+! s4-13 1) (set! a2-42 (-> arg0 data s4-13)) ) ) (format #t "~%~%") ) (else (return #f) ) ) #t ) ;; definition for function execute-mouse-move ;; INFO: Used lq/sq (defun execute-mouse-move ((arg0 editable-array) (arg1 editable-command) (arg2 mouse-info) (arg3 manipulator)) (local-vars (v0-2 object)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) ) (init-vf0-vector) (set! v0-2 (cond ((= arg1 (editable-command camera-tumble)) (set-setting! 'mouse-input 'abs #t 0) (let ((s5-1 (new-stack-vector0)) (f30-0 0.0) ) (let* ((s4-1 (-> arg0 length)) (s3-0 0) (a0-2 (-> arg0 data s3-0)) ) (while (< s3-0 s4-1) (when (and a0-2 (logtest? (-> a0-2 flags) (editable-flag selected))) (vector+! s5-1 s5-1 (editable-method-15 a0-2)) (set! f30-0 (+ 1.0 f30-0)) ) (+! s3-0 1) (set! a0-2 (-> arg0 data s3-0)) ) ) (cond ((= f30-0 0.0) (remove-setting! 'mouse-tumble-point) ) (else (vector-float/! s5-1 s5-1 f30-0) (set-setting! 'mouse-tumble-point 'abs s5-1 0) ) ) ) ) ((= arg1 (editable-command camera-xy)) (set-setting! 'mouse-input 'abs #t 0) ) ((= arg1 (editable-command camera-xz)) (set-setting! 'mouse-input 'abs #t 0) ) ((= arg1 (editable-command drag-move)) (let* ((s4-2 (-> arg0 length)) (s3-1 0) (a0-8 (-> arg0 data s3-1)) ) (while (< s3-1 s4-2) (if (and a0-8 (logtest? (-> a0-8 flags) (editable-flag selected))) (editable-method-17 a0-8 (-> arg3 speed) (editable-flag no-update)) ) (+! s3-1 1) (set! a0-8 (-> arg0 data s3-1)) ) ) (let* ((s5-2 (-> arg0 length)) (s4-3 0) (a0-9 (-> arg0 data s4-3)) ) (while (< s4-3 s5-2) (if (and a0-9 (logtest? (-> a0-9 flags) (editable-flag selected))) (editable-method-30 a0-9 (editable-flag)) ) (+! s4-3 1) (set! a0-9 (-> arg0 data s4-3)) ) ) (cleanup-selection arg0) ) ((= arg1 (editable-command snap-rotate)) (let* ((s4-4 (-> arg0 length)) (s3-2 0) (a0-11 (-> arg0 data s3-2)) ) (while (< s3-2 s4-4) (if (and a0-11 (logtest? (-> a0-11 flags) (editable-flag selected))) (editable-method-35 a0-11 (-> *editable* 0 mouse-normal)) ) (+! s3-2 1) (set! a0-11 (-> arg0 data s3-2)) ) ) (let* ((s4-5 (-> arg0 length)) (s3-3 0) (a0-12 (-> arg0 data s3-3)) ) (while (< s3-3 s4-5) (if (and a0-12 (logtest? (-> a0-12 flags) (editable-flag selected))) (editable-method-30 a0-12 (editable-flag)) ) (+! s3-3 1) (set! a0-12 (-> arg0 data s3-3)) ) ) (cleanup-selection arg0) (update-manipulator-position arg0 arg3) ) ((= arg1 (editable-command drag-rotate)) (let ((v1-70 0)) (let* ((a0-15 (-> arg0 length)) (a1-22 0) (a3-5 (-> arg0 data a1-22)) ) (while (< a1-22 a0-15) (if (and a3-5 (logtest? (-> a3-5 flags) (editable-flag selected))) (+! v1-70 1) ) (+! a1-22 1) (set! a3-5 (-> arg0 data a1-22)) ) ) (cond ((= v1-70 1) (let* ((s4-6 (-> arg0 length)) (s3-4 0) (a0-19 (-> arg0 data s3-4)) ) (while (< s3-4 s4-6) (if (and a0-19 (logtest? (-> a0-19 flags) (editable-flag selected))) (get-null-vec2 a0-19 (-> arg3 angles)) ) (+! s3-4 1) (set! a0-19 (-> arg0 data s3-4)) ) ) ) (else (let* ((s3-5 (-> arg0 length)) (s2-1 0) (s1-2 (-> arg0 data s2-1)) ) (while (< s2-1 s3-5) (when (and s1-2 (logtest? (-> s1-2 flags) (editable-flag selected))) (let ((s0-0 (new 'stack-no-clear 'vector)) (sv-176 (new 'stack-no-clear 'vector)) ) (let ((sv-128 vector-rotate-around-y!) (sv-144 (new 'stack-no-clear 'vector)) (sv-160 (new 'stack-no-clear 'vector)) ) (let ((v1-92 (editable-method-15 s1-2)) (a0-23 (-> arg3 position)) ) (.lvf vf4 (&-> v1-92 quad)) (.lvf vf5 (&-> a0-23 quad)) ) (.mov.vf.w vf6 vf0) (.sub.vf.xyz vf6 vf4 vf5) (.svf (&-> sv-160 quad) vf6) (let ((v0-11 (sv-128 sv-144 sv-160 (* 182.04445 (- (-> arg2 posx) (-> arg2 pos 1 x))))) (v1-95 (-> arg3 position)) ) (.mov.vf.w vf6 vf0) (.lvf vf4 (&-> v0-11 quad)) (.lvf vf5 (&-> v1-95 quad)) ) ) (.add.vf.xyz vf6 vf4 vf5) (.svf (&-> sv-176 quad) vf6) (let ((s0-1 (vector-! s0-0 sv-176 (editable-method-15 s1-2)))) (editable-method-17 s1-2 s0-1 (editable-flag no-update)) ) ) ) (+! s2-1 1) (set! s1-2 (-> arg0 data s2-1)) ) ) (let* ((s5-3 (-> arg0 length)) (s4-7 0) (a0-28 (-> arg0 data s4-7)) ) (while (< s4-7 s5-3) (if (and a0-28 (logtest? (-> a0-28 flags) (editable-flag selected))) (editable-method-30 a0-28 (editable-flag)) ) (+! s4-7 1) (set! a0-28 (-> arg0 data s4-7)) ) ) ) ) ) (cleanup-selection arg0) ) ((= arg1 (editable-command drag-scale)) (let* ((s3-6 (-> arg0 length)) (s2-2 0) (s1-3 (-> arg0 data s2-2)) ) (while (< s2-2 s3-6) (when (and s1-3 (logtest? (-> s1-3 flags) (editable-flag selected))) (let ((s0-2 (new 'stack-no-clear 'vector)) (sv-192 (new 'stack-no-clear 'vector)) ) (let ((v1-125 (editable-method-15 s1-3)) (a0-33 (-> arg3 position)) ) (.lvf vf4 (&-> v1-125 quad)) (.lvf vf5 (&-> a0-33 quad)) ) (.mov.vf.w vf6 vf0) (.sub.vf.xyz vf6 vf4 vf5) (.svf (&-> sv-192 quad) vf6) (let ((s0-3 (vector-float*! s0-2 sv-192 (* 0.01 (- (-> arg2 posx) (-> arg2 pos 1 x)))))) (case (-> arg3 action) (((manipulator-action ma1)) (set! (-> s0-3 y) 0.0) (set! (-> s0-3 z) 0.0) ) (((manipulator-action ma2)) (set! (-> s0-3 x) 0.0) (set! (-> s0-3 z) 0.0) ) (((manipulator-action ma3)) (set! (-> s0-3 x) 0.0) (set! (-> s0-3 y) 0.0) ) (((manipulator-action ma4)) (set! (-> s0-3 z) 0.0) ) (((manipulator-action ma5)) (set! (-> s0-3 y) 0.0) ) (((manipulator-action ma6)) (set! (-> s0-3 x) 0.0) ) (((manipulator-action ma7)) ) (else (set! (-> s0-3 x) 0.0) (set! (-> s0-3 y) 0.0) (set! (-> s0-3 z) 0.0) ) ) (editable-method-17 s1-3 s0-3 (editable-flag no-update)) ) ) ) (+! s2-2 1) (set! s1-3 (-> arg0 data s2-2)) ) ) (let* ((s5-4 (-> arg0 length)) (s4-8 0) (a0-42 (-> arg0 data s4-8)) ) (while (< s4-8 s5-4) (if (and a0-42 (logtest? (-> a0-42 flags) (editable-flag selected))) (editable-method-30 a0-42 (editable-flag)) ) (+! s4-8 1) (set! a0-42 (-> arg0 data s4-8)) ) ) (cleanup-selection arg0) ) (else (return #f) v0-2 ) ) ) #t ) ) ;; definition for function execute-move (defun execute-move ((arg0 editable-array) (arg1 editable-command) (arg2 mouse-info) (arg3 manipulator)) (case arg1 (((editable-command drag-resize)) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 x) (* 0.001 (vector-vector-distance (-> *math-camera* trans) (-> arg3 position)) (- (-> arg2 posx) (-> arg2 pos 1 x)) ) ) (set! (-> s3-0 y) 0.0) (set! (-> s3-0 z) 0.0) (set! (-> s3-0 w) 1.0) (let* ((s5-1 (-> arg0 length)) (s4-1 0) (a0-3 (-> arg0 data s4-1)) ) (while (< s4-1 s5-1) (if (and a0-3 (logtest? (-> a0-3 flags) (editable-flag selected))) (editable-method-19 a0-3 s3-0) ) (+! s4-1 1) (set! a0-3 (-> arg0 data s4-1)) ) ) ) ) (((editable-command refresh-filter)) (let* ((s5-2 (-> arg0 length)) (s4-2 0) (s3-1 (-> arg0 data s4-2)) ) (while (< s4-2 s5-2) (if (and s3-1 (-> s3-1 region)) (set! (-> s3-1 region filter) (editable-region-method-12 (-> s3-1 region))) ) (+! s4-2 1) (set! s3-1 (-> arg0 data s4-2)) ) ) ) (((editable-command resize)) (let ((s5-3 (new 'stack-no-clear 'vector))) (set! (-> s5-3 x) 0.0) (set! (-> s5-3 y) (* 4096.0 (-> arg0 edit-param0))) (set! (-> s5-3 z) 0.0) (set! (-> s5-3 w) 1.0) (let* ((s4-3 (-> arg0 length)) (s3-2 0) (a0-8 (-> arg0 data s3-2)) ) (while (< s3-2 s4-3) (if (and a0-8 (logtest? (-> a0-8 flags) (editable-flag selected))) (editable-method-19 a0-8 s5-3) ) (+! s3-2 1) (set! a0-8 (-> arg0 data s3-2)) ) ) ) ) (((editable-command insert-sphere)) (let ((s3-3 (get-length arg0))) (when (>= s3-3 0) (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a2-3 (editable-array-method-18 arg0 (new 'stack-no-clear 'vector) (-> arg2 pos 0))) (s2-1 (new 'debug 'editable-sphere a2-3 2048.0 (-> arg0 region))) ) (set! (-> arg0 data s3-3) s2-1) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (set-selected! s2-1 #t) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command insert-point)) (let ((s3-4 (get-length arg0))) (when (>= s3-4 0) (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a2-7 (editable-array-method-18 arg0 (new 'stack-no-clear 'vector) (-> arg2 pos 0))) (s2-3 (new 'debug 'editable-point a2-7 (-> arg0 region))) ) (set! (-> arg0 data s3-4) s2-3) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (set-selected! s2-3 #t) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command insert-sample)) (let ((s3-5 (get-length arg0))) (when (>= s3-5 0) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a2-11 (editable-array-method-18 arg0 (new 'stack-no-clear 'vector) (-> arg2 pos 0))) (s2-5 (new 'debug 'editable-sample a2-11 *editable-sample-region*)) ) (set! (-> arg0 data s3-5) s2-5) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (set-selected! s2-5 #t) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command insert-simple-camera)) (let ((s3-6 (get-length arg0))) (when (>= s3-6 0) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let ((s2-8 (new 'debug 'editable-sample (math-camera-pos) *editable-sample-region*))) (set! (-> arg0 data s3-6) s2-8) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (set-selected! s2-8 #t) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command insert-light)) (let ((s3-7 (get-length arg0))) (when (>= s3-7 0) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a2-18 (editable-array-method-18 arg0 (new 'stack-no-clear 'vector) (-> arg2 pos 0))) (s2-10 (new 'debug 'editable-light a2-18 2048.0 *editable-light-region*)) ) (set! (-> arg0 data s3-7) s2-10) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (set-selected! s2-10 #t) (editable-method-25 s2-10) ) (update-light-hash *light-hash*) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command insert-entity)) (let ((s3-8 (get-length arg0))) (when (>= s3-8 0) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((a2-22 (editable-array-method-18 arg0 (new 'stack-no-clear 'vector) (-> arg2 pos 0))) (s2-12 (new 'debug 'editable-entity a2-22 6144.0 *editable-entity-region*)) ) (set! (-> arg0 data s3-8) s2-12) (handle-cmd arg0 (editable-command select-none) arg2 arg3) (set-selected! s2-12 #t) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command insert-box)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) (let ((a1-49 (editable-array-method-18 arg0 (new 'stack-no-clear 'vector) (-> arg2 pos 0)))) (insert-box arg0 a1-49 (the-as vector arg3)) ) (update-manipulator-position arg0 arg3) ) (((editable-command insert-wall)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) (let ((a1-54 (editable-array-method-18 arg0 (new 'stack-no-clear 'vector) (-> arg2 pos 0)))) (insert-wall arg0 a1-54 (the-as vector arg3)) ) (update-manipulator-position arg0 arg3) ) (((editable-command insert-face)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) (let ((s3-12 (get-length arg0))) 0 (editable-array-method-15 arg0 (lambda ((arg0 editable) (arg1 editable-region)) (and (type? arg0 editable-point) (= (-> arg0 region) arg1))) (-> arg0 region) ) (let ((s4-5 (-> arg0 selection length))) (cond ((= s4-5 1) (cond ((and (-> arg0 target) (type? (-> arg0 target) editable-point) (= (-> arg0 target region) (-> arg0 region))) (set! (-> arg0 selection 1) (-> arg0 target)) (+! (-> arg0 selection length) 1) (+! s4-5 1) ) (else (editable-array-method-14 arg0 (editable-command pick-target) (editable-command insert-face) "pick the point to complete the face" ) (return #f) ) ) ) ((and (>= s4-5 2) (>= 6 s4-5)) ) (else (format 0 "ERROR: face can only be inserted if there are 2-6 points selected in the current region, got ~D.~%" s4-5 ) (return #f) ) ) (when (>= s3-12 0) (let ((s2-15 (new 'debug 'editable-face (-> arg0 region)))) (set! (-> arg0 data s3-12) s2-15) (dotimes (s3-13 s4-5) (set! (-> s2-15 vertex s3-13) (the-as editable-point (-> arg0 selection s3-13))) (set! (-> arg0 selection s3-13 owner) (cons s2-15 (-> arg0 selection s3-13 owner))) ) (set! (-> s2-15 length) s4-5) (set-selected! s2-15 #t) (editable-method-30 s2-15 (editable-flag no-plane-snap)) (editable-method-31 s2-15 (editable-flag no-plane-snap)) ) ) ) ) (update-manipulator-position arg0 arg3) ) (((editable-command insert-plane)) (if (and (-> arg0 region) (-> arg0 region locked)) (set! (-> arg0 region) (new 'debug 'editable-region)) ) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let ((s2-16 (get-length arg0))) 0 (editable-array-method-15 arg0 (lambda ((arg0 editable) (arg1 editable-region)) (and (type? arg0 editable-point) (= (-> arg0 region) arg1))) (-> arg0 region) ) (let ((s4-7 (-> arg0 selection length))) (cond ((= s4-7 1) (cond ((and (-> arg0 target) (type? (-> arg0 target) editable-point) (= (-> arg0 target region) (-> arg0 region))) (set! (-> arg0 selection 1) (-> arg0 target)) (+! (-> arg0 selection length) 1) (+! s4-7 1) ) (else (editable-array-method-14 arg0 (editable-command pick-target) (editable-command insert-plane) "pick the point to complete the plane" ) (return #f) ) ) ) ((= s4-7 2) ) (else (format 0 "ERROR: plane can only be inserted if there are 2 points selected in the current region, got ~D.~%" s4-7 ) (return #f) ) ) (when (>= s2-16 0) (let ((s3-15 (new 'debug 'editable-plane (-> arg0 region)))) (set! (-> arg0 data s2-16) s3-15) (dotimes (s2-17 s4-7) (set! (-> s3-15 vertex s2-17) (the-as editable-point (-> arg0 selection s2-17))) (set! (-> arg0 selection s2-17 owner) (cons s3-15 (-> arg0 selection s2-17 owner))) ) (set! (-> s3-15 length) s4-7) (set-selected! s3-15 #t) (editable-method-30 s3-15 (editable-flag no-plane-snap)) (editable-method-31 s3-15 (editable-flag no-plane-snap)) ) ) ) ) (update-manipulator-position arg0 arg3) ) (else (return #f) ) ) #t ) ;; definition for method 9 of type editable-array (defmethod handle-cmd ((this editable-array) (arg0 editable-command) (arg1 mouse-info) (arg2 object)) (with-pp (if (execute-select this arg0 arg1 (the-as manipulator arg2)) (return #f) ) (if (execute-move this arg0 arg1 (the-as manipulator arg2)) (return #f) ) (if (execute-mouse-move this arg0 arg1 (the-as manipulator arg2)) (return #f) ) (cond ((= arg0 (editable-command copy)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (set! (-> this selection length) 0) (let* ((s3-2 (-> this length)) (s2-1 0) (s1-0 (-> this data s2-1)) ) (while (< s2-1 s3-2) (when (and s1-0 (logtest? (-> s1-0 flags) (editable-flag selected))) (copy-into-editable-array! s1-0 this) (when (= (-> s1-0 type) editable-light) (editable-method-25 s1-0) (update-light-hash *light-hash*) ) ) (+! s2-1 1) (set! s1-0 (-> this data s2-1)) ) ) (handle-cmd this (editable-command select-none) arg1 arg2) (let ((s5-1 (the-as editable-region #f))) (dotimes (s4-1 (-> this selection length)) (let ((a0-13 (-> this selection s4-1))) (when (and a0-13 (logtest? s4-1 1)) (set! s5-1 (-> a0-13 region)) (set-selected! a0-13 #t) ) ) ) (if (not (-> this region-lock?)) (set! (-> this region) s5-1) ) ) ) ((= arg0 (editable-command copy-region)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (when (and (-> this region) (not (-> this region locked))) (handle-cmd this (editable-command select-current-region) arg1 arg2) (let ((v1-52 (copy (-> this region) 'debug))) (set! (-> v1-52 id) (the-as uint 0)) (set! (-> v1-52 changed) #t) (set! (-> this region) v1-52) ) (handle-cmd this (editable-command copy) arg1 arg2) ) ) ((= arg0 (editable-command delete)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((s5-3 (-> this length)) (s4-3 0) (s3-4 (-> this data s4-3)) ) (while (< s4-3 s5-3) (when (and s3-4 (logtest? (-> s3-4 flags) (editable-flag selected))) (editable-array-method-16 this s3-4) (when (= (-> s3-4 type) editable-light) (editable-method-25 s3-4) (update-light-hash *light-hash*) ) ) (+! s4-3 1) (set! s3-4 (-> this data s4-3)) ) ) (if (not (-> this region-lock?)) (set! (-> this region) #f) ) ) ((= arg0 (editable-command delete-region)) (when (-> this region) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (when (!= (-> this region) *editable-light-region*) (handle-cmd this (editable-command select-current-region) arg1 arg2) (handle-cmd this (editable-command delete) arg1 arg2) (set! (-> this region) #f) ) ) ) ((= arg0 (editable-command snap-to-ground)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((s4-5 (new 'stack-no-clear 'vector)) (s3-7 (-> this length)) (s2-4 0) (s1-1 (-> this data s2-4)) ) (while (< s2-4 s3-7) (when (and s1-1 (logtest? (-> s1-1 flags) (editable-flag selected))) (if (editable-method-11 s1-1 s4-5) (editable-method-21 s1-1 s4-5) ) ) (+! s2-4 1) (set! s1-1 (-> this data s2-4)) ) ) (update-manipulator-position this (the-as manipulator arg2)) ) ((= arg0 (editable-command snap-y)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (cond ((-> this target) (let* ((s4-7 (editable-method-15 (-> this target))) (s3-9 (-> this length)) (s2-5 0) (a0-38 (-> this data s2-5)) ) (while (< s2-5 s3-9) (if (and a0-38 (logtest? (-> a0-38 flags) (editable-flag selected))) (editable-method-18 a0-38 s4-7 80) ) (+! s2-5 1) (set! a0-38 (-> this data s2-5)) ) ) ) (else (editable-array-method-14 this (editable-command pick-target) (editable-command snap-y) "pick the editable to use the y from" ) ) ) (update-manipulator-position this (the-as manipulator arg2)) ) ((= arg0 (editable-command snap-xz)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (cond ((-> this target) (let* ((s4-9 (editable-method-15 (-> this target))) (s3-11 (-> this length)) (s2-6 0) (a0-43 (-> this data s2-6)) ) (while (< s2-6 s3-11) (if (and a0-43 (logtest? (-> a0-43 flags) (editable-flag selected))) (editable-method-18 a0-43 s4-9 104) ) (+! s2-6 1) (set! a0-43 (-> this data s2-6)) ) ) ) (else (editable-array-method-14 this (editable-command pick-target) (editable-command snap-xz) "pick the editable to use the xz from" ) ) ) (update-manipulator-position this (the-as manipulator arg2)) ) ((= arg0 (editable-command region-set)) (when (and (-> this region) (not (-> this region locked))) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((s5-5 (-> this length)) (s4-11 0) (a0-47 (-> this data s4-11)) ) (while (< s4-11 s5-5) (if (and a0-47 (logtest? (-> a0-47 flags) (editable-flag selected))) (change-region! a0-47 (-> this region)) ) (+! s4-11 1) (set! a0-47 (-> this data s4-11)) ) ) ) ) ((= arg0 (editable-command region-add)) (when (and (-> this region) (not (-> this region locked))) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (if (-> this target) (change-region! (-> this target) (-> this region)) (editable-array-method-14 this (editable-command pick-target) (editable-command region-add) "pick the editable to add to current region" ) ) ) ) ((= arg0 (editable-command region-new)) (let ((v1-178 (new 'debug 'editable-region))) (if (and (-> this region) (not (-> this region locked))) (set! (-> v1-178 tree) (-> this region tree)) ) (set! (-> this region) v1-178) ) (handle-cmd this (editable-command region-set) arg1 arg2) ) ((= arg0 (editable-command flip-side)) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((s5-8 (-> this length)) (s4-14 0) (a0-61 (-> this data s4-14)) ) (while (< s4-14 s5-8) (if (and a0-61 (logtest? (-> a0-61 flags) (editable-flag selected))) (editable-method-26 a0-61) ) (+! s4-14 1) (set! a0-61 (-> this data s4-14)) ) ) ) ((= arg0 (editable-command rotate-level)) (let* ((f0-1 (* 182.04445 (-> this edit-param0))) (s5-9 (matrix-rotate-y! (new 'stack-no-clear 'matrix) f0-1)) (s4-15 (-> this length)) (s3-12 0) (a0-63 (-> this data s3-12)) ) (while (< s3-12 s4-15) (if (and a0-63 region (= (-> a0-63 region level) (-> this level))) (editable-method-20 a0-63 (-> this level-offset) s5-9) ) (+! s3-12 1) (set! a0-63 (-> this data s3-12)) ) ) ) ((= arg0 (editable-command translate-y-level)) (let ((s5-10 (new 'stack-no-clear 'vector))) (set! (-> s5-10 x) 0.0) (set! (-> s5-10 y) (* 4096.0 (-> this edit-param0))) (set! (-> s5-10 z) 0.0) (set! (-> s5-10 w) 1.0) (let* ((s4-16 (-> this length)) (s3-13 0) (a0-64 (-> this data s3-13)) ) (while (< s3-13 s4-16) (if (and a0-64 region (= (-> a0-64 region level) (-> this level))) (editable-method-17 a0-64 s5-10 (editable-flag x y z)) ) (+! s3-13 1) (set! a0-64 (-> this data s3-13)) ) ) ) ) ((= arg0 (editable-command save)) (let* ((s5-11 (-> this length)) (s4-17 0) (v1-234 (-> this data s4-17)) ) (while (< s4-17 s5-11) (if (and v1-234 (-> v1-234 region)) (save-region! (-> v1-234 region) this 0 0) ) (+! s4-17 1) (set! v1-234 (-> this data s4-17)) ) ) (save-region! *editable-sample-region* this 0 0) (save-region! *editable-light-region* this 0 0) (save-region! *editable-entity-region* this 0 0) ) ((= arg0 (editable-command load)) (handle-cmd this (editable-command select-none) arg1 arg2) (dotimes (v1-251 (-> this length)) (set! (-> this data v1-251) #f) ) (set! (-> this length) 0) (let* ((s5-12 this) (s4-18 (method-of-object s5-12 editable-array-method-13)) (v1-256 (level-get-target-inside *level*)) ) (s4-18 s5-12 (if v1-256 (-> v1-256 info dbname) #f ) ) ) (handle-cmd this (editable-command update-game) (the-as mouse-info #f) #f) ) ((= arg0 (editable-command update-game)) (reset-light-hash *light-hash*) (let* ((s5-13 (-> this length)) (s4-19 0) (a0-79 (-> this data s4-19)) ) (while (< s4-19 s5-13) (if a0-79 (editable-method-25 a0-79) ) (+! s4-19 1) (set! a0-79 (-> this data s4-19)) ) ) (update-light-hash *light-hash*) ) ((or (= arg0 (editable-command exit)) (= arg0 (editable-command kill))) (deactivate pp) ) ) #f ) ) ;; definition for method 10 of type editable-player (defmethod deactivate ((this editable-player)) "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) (if (= (-> a1-3 status) 'active) (set! (-> a1-3 light-hash) (-> a1-3 bsp light-hash)) ) ) ) (set! *editable* (the-as (pointer editable-player) #f)) (set! *external-cam-mode* (-> this external-cam-mode)) ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type editable-player ;; WARN: Return type mismatch process-drawable vs editable-player. (defmethod relocate ((this editable-player) (offset int)) (let ((v1-0 *kernel-context*)) (set! (-> v1-0 relocating-process) this) (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) offset) ) (let ((v1-2 (-> this current))) (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) (< (the-as int v1-2) (-> *kernel-context* relocating-max)) ) (&+! (-> this current) offset) ) ) (the-as editable-player ((method-of-type process-drawable relocate) this offset)) ) ;; definition for method 21 of type editable-player ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod editable-player-method-21 ((this editable-player)) (set! *display-region-marks* #f) (let* ((s5-0 (-> this current length)) (s4-0 0) (a0-2 (-> this current data s4-0)) ) (while (< s4-0 s5-0) (if (and a0-2 (or (and (logtest? (-> a0-2 region filter) (-> this current filter 0)) (logtest? (-> a0-2 region filter) (-> this current filter 1)) ) (logtest? (-> a0-2 flags) (editable-flag selected)) ) ) (editable-method-10 a0-2) ) (+! s4-0 1) (set! a0-2 (-> this current data s4-0)) ) ) (let ((s4-1 (new-stack-vector0)) (s5-1 0) ) (let* ((s3-0 (-> this current length)) (s2-0 0) (a0-5 (-> this current data s2-0)) ) (while (< s2-0 s3-0) (when (and a0-5 (logtest? (-> a0-5 flags) (editable-flag selected))) (vector+! s4-1 s4-1 (editable-method-15 a0-5)) (+! s5-1 1) ) (+! s2-0 1) (set! a0-5 (-> this current data s2-0)) ) ) (if (nonzero? s5-1) (manipulator-method-11 (-> this manipulator)) ) ) (when #t (format *stdcon* "~0K") (format *stdcon* "~16S~16S~16S~%" "Left button" "Middle button" "Right button") (format *stdcon* "~16S~16S~16S~%" (editable-command->string (if (and (nonzero? (-> this command 1)) (or (= (-> this command 0) (editable-command none)) (mouse-hold? left))) (-> this command 1) (-> this command 0) ) ) (editable-command->string (if (and (nonzero? (-> this command 5)) (or (= (-> this command 4) (editable-command none)) (mouse-hold? middle))) (-> this command 5) (-> this command 4) ) ) (editable-command->string (if (and (nonzero? (-> this command 3)) (or (= (-> this command 2) (editable-command none)) (mouse-hold? right))) (-> this command 3) (-> this command 2) ) ) ) (let* ((s5-3 (-> this current length)) (s4-3 0) (v1-52 (-> this current data s4-3)) ) (while (< s4-3 s5-3) (when (and v1-52 (logtest? (-> v1-52 flags) (editable-flag selected))) (let ((s3-2 (-> v1-52 name))) (if (not (string-prefix= "undefined" s3-2)) (format *stdcon* "~s~%" s3-2) ) ) ) (+! s4-3 1) (set! v1-52 (-> this current data s4-3)) ) ) (when (!= *master-mode* 'menu) (let ((a2-5 (-> this current target-message))) (if a2-5 (format *stdcon* "~%~3L~S~0L~%" a2-5) ) ) (when (cpad-hold? 1 triangle) (let* ((s5-4 (-> this current length)) (s4-4 0) (a0-33 (-> this current data s4-4)) ) (while (< s4-4 s5-4) (when (and a0-33 (or (and (logtest? (-> a0-33 region filter) (-> this current filter 0)) (logtest? (-> a0-33 region filter) (-> this current filter 1)) ) (logtest? (-> a0-33 flags) (editable-flag selected)) ) ) (if (and (-> a0-33 region) (!= (-> a0-33 type) editable-point)) (print-region-info (-> a0-33 region) (editable-method-15 a0-33) (if (cpad-hold? 1 circle) 1 0 ) ) ) ) (+! s4-4 1) (set! a0-33 (-> this current data s4-4)) ) ) (format *stdcon* "~%") (cond ((-> this current region) (let ((s5-5 (-> this current region))) (format *stdcon* "~%region: region-~D ~S ~S~S~%" (-> s5-5 id) (-> s5-5 level) (-> s5-5 tree) (if (-> s5-5 changed) " (modified)" "" ) ) (format *stdcon* " (on-enter ~S)~%" (-> s5-5 on-enter)) (format *stdcon* " (on-inside ~S)~%" (-> s5-5 on-inside)) (format *stdcon* " (on-exit ~S)~%" (-> s5-5 on-exit)) ) ) (else (format *stdcon* "no region~%") ) ) (when (-> this current edit-plane) (let ((a2-13 (-> this current edit-plane))) (format *stdcon* "~%edit-plane: ~A~%" a2-13) ) ) (format *stdcon* "~%selected:~%") (let* ((s5-6 (-> this current length)) (s4-5 0) (a2-14 (-> this current data s4-5)) ) (while (< s4-5 s5-6) (if (and a2-14 (logtest? (-> a2-14 flags) (editable-flag selected))) (format *stdcon* " ~A~%" a2-14) ) (+! s4-5 1) (set! a2-14 (-> this current data s4-5)) ) ) ) ) (format *stdcon* "~1K~%") ) 0 (none) ) ;; definition for method 22 of type editable-player ;; WARN: Return type mismatch int vs none. (defmethod editable-player-method-22 ((this editable-player)) (cond ((or (logtest? (-> *keybd* keys 0) 4) (logtest? (-> *keybd* keys 0) 64)) (set-setting! 'mouse-input 'abs #t 0) (set! (-> this command 0) (editable-command camera-rotate)) (set! (-> this command 1) (editable-command none)) (set! (-> this command 2) (editable-command camera-zoom)) (set! (-> this command 3) (editable-command none)) (set! (-> this command 4) (editable-command camera-move)) (set! (-> this command 5) (editable-command none)) 0 ) ((and (or (cpad-hold? 1 l2) (cpad-hold? 1 r2)) (or (and (cpad-hold? 1 left) (not (-> this left-handed))) (and (cpad-hold? 1 square) (-> this left-handed))) ) (set! (-> this command 0) (editable-command copy-region)) (set! (-> this command 1) (editable-command none)) (set! (-> this command 2) (editable-command delete-region)) (set! (-> this command 3) (editable-command none)) (set! (-> this command 4) (editable-command region-add)) (set! (-> this command 5) (editable-command none)) 0 ) ((and (or (cpad-hold? 1 l2) (cpad-hold? 1 r2)) (or (and (cpad-hold? 1 right) (not (-> this left-handed))) (and (cpad-hold? 1 circle) (-> this left-handed))) ) (set! (-> this command 0) (editable-command update-game)) (set! (-> this command 1) (editable-command none)) (set! (-> this command 2) (editable-command delete)) (set! (-> this command 3) (editable-command none)) (set! (-> this command 4) (editable-command copy)) (set! (-> this command 5) (editable-command none)) 0 ) ((and (or (cpad-hold? 1 l2) (cpad-hold? 1 r2)) (or (and (cpad-hold? 1 up) (not (-> this left-handed))) (and (cpad-hold? 1 triangle) (-> this left-handed))) ) (set! (-> this command 0) (editable-command select-none)) (set! (-> this command 1) (editable-command none)) (set! (-> this command 2) (editable-command print-region-info)) (set! (-> this command 3) (editable-command none)) (set! (-> this command 4) (editable-command flip-side)) (set! (-> this command 5) (editable-command none)) 0 ) ((and (or (cpad-hold? 1 l2) (cpad-hold? 1 r2)) (or (and (cpad-hold? 1 down) (not (-> this left-handed))) (and (cpad-hold? 1 x) (-> this left-handed))) ) (set! (-> this command 0) (editable-command insert-sample)) (set! (-> this command 1) (editable-command none)) (set! (-> this command 2) (editable-command insert-simple-camera)) (set! (-> this command 3) (editable-command none)) (set! (-> this command 4) (editable-command insert-entity)) (set! (-> this command 5) (editable-command none)) 0 ) ((or (cpad-hold? 1 l2) (cpad-hold? 1 r2)) (set! (-> this command 0) (editable-command none)) (set! (-> this command 1) (editable-command camera-tumble)) (set! (-> this command 2) (editable-command none)) (set! (-> this command 3) (editable-command camera-xz)) (set! (-> this command 4) (editable-command none)) (set! (-> this command 5) (editable-command camera-xy)) ) ((or (or (logtest? (-> *keybd* keys 0) 1) (logtest? (-> *keybd* keys 0) 16)) (and (cpad-hold? 1 up) (cpad-hold? 1 left) (or (and (cpad-hold? 1 up) (not (-> this left-handed))) (and (cpad-hold? 1 triangle) (-> this left-handed))) ) ) (set! (-> this command 0) (editable-command select-region)) (set! (-> this command 1) (editable-command none)) (set! (-> this command 2) (editable-command select-prim)) (set! (-> this command 3) (editable-command none)) (set! (-> this command 4) (editable-command select-face)) (set! (-> this command 5) (editable-command none)) 0 ) ((logtest? (-> *keybd* keys 0) 8) (set! (-> this command 0) (editable-command none)) (set! (-> this command 1) (editable-command drag-rotate)) (set! (-> this command 2) (editable-command none)) (set! (-> this command 3) (editable-command snap-rotate)) (set! (-> this command 4) (editable-command none)) (set! (-> this command 5) (editable-command none)) 0 ) ((or (and (cpad-hold? 1 left) (not (-> this left-handed))) (and (cpad-hold? 1 square) (-> this left-handed))) (set! (-> this command 0) (editable-command none)) (set! (-> this command 1) (editable-command drag-move)) (set! (-> this command 2) (editable-command none)) (set! (-> this command 3) (editable-command drag-move)) (set! (-> this command 4) (editable-command none)) (set! (-> this command 5) (editable-command drag-move)) ) ((or (and (cpad-hold? 1 right) (not (-> this left-handed))) (and (cpad-hold? 1 circle) (-> this left-handed))) (set! (-> this command 0) (editable-command insert-light)) (set! (-> this command 1) (editable-command none)) (set! (-> this command 2) (editable-command insert-sphere)) (set! (-> this command 3) (editable-command none)) (set! (-> this command 4) (editable-command insert-point)) (set! (-> this command 5) (editable-command none)) 0 ) ((or (or (logtest? (-> *keybd* keys 0) 2) (logtest? (-> *keybd* keys 0) 32)) (or (and (cpad-hold? 1 up) (not (-> this left-handed))) (and (cpad-hold? 1 triangle) (-> this left-handed))) ) (set! (-> this command 0) (editable-command select-add)) (set! (-> this command 1) (editable-command none)) (set! (-> this command 2) (editable-command select-remove)) (set! (-> this command 3) (editable-command none)) (set! (-> this command 4) (editable-command select-toggle)) (set! (-> this command 5) (editable-command none)) 0 ) ((or (and (cpad-hold? 1 down) (not (-> this left-handed))) (and (cpad-hold? 1 x) (-> this left-handed))) (set! (-> this command 0) (editable-command insert-face)) (set! (-> this command 1) (editable-command none)) (set! (-> this command 2) (editable-command insert-box)) (set! (-> this command 3) (editable-command none)) (set! (-> this command 4) (editable-command insert-plane)) (set! (-> this command 5) (editable-command none)) 0 ) (else (set! (-> this command 0) (editable-command none)) (set! (-> this command 1) (editable-command drag-move)) (set! (-> this command 2) (editable-command none)) (set! (-> this command 3) (editable-command drag-resize)) (set! (-> this command 4) (editable-command none)) (set! (-> this command 5) (editable-command drag-scale)) ) ) 0 (none) ) ;; definition for function get-light-value (defun get-light-value ((arg0 uint)) (let ((f30-0 0.0)) (let* ((s5-0 (-> *editable* 0 current length)) (s4-0 0) (s3-0 (-> *editable* 0 current data s4-0)) ) (while (< s4-0 s5-0) (when (and s3-0 (logtest? (-> s3-0 flags) (editable-flag selected))) (let ((v1-8 (as-type s3-0 editable-light))) (if (the-as editable-light v1-8) (set! f30-0 (-> (&+ (the-as (pointer float) v1-8) arg0) 0)) ) ) ) (+! s4-0 1) (set! s3-0 (-> *editable* 0 current data s4-0)) ) ) f30-0 ) ) ;; definition for function set-light-value ;; WARN: Return type mismatch symbol vs object. (defun set-light-value ((arg0 int) (arg1 float)) (let* ((s4-0 (-> *editable* 0 current length)) (s3-0 0) (s2-0 (-> *editable* 0 current data s3-0)) ) (while (< s3-0 s4-0) (when (and s2-0 (logtest? (-> s2-0 flags) (editable-flag selected))) (let ((a0-7 (as-type s2-0 editable-light))) (when (the-as editable-light a0-7) (set! (-> (&+ (the-as (pointer float) a0-7) arg0) 0) arg1) (logior! (-> (the-as editable-light a0-7) flags) (editable-flag changed)) (let ((v1-12 (-> (the-as editable-light a0-7) region))) (if v1-12 (set! (-> v1-12 changed) #t) ) ) (update-light-sphere-from-editable-light (the-as editable-light a0-7)) ) ) ) (+! s3-0 1) (set! s2-0 (-> *editable* 0 current data s3-0)) ) ) #f ) ;; definition for method 23 of type editable-player (defmethod editable-player-method-23 ((this editable-player)) (let ((s5-0 (-> this current)) (s4-0 (new 'stack 'font-context *font-default-matrix* 20 379 0.0 (font-color menu-selected-parent) (font-flags shadow kerning) ) ) ) (set! (-> s4-0 flags) (font-flags)) (set-width! s4-0 340) (set-height! s4-0 80) (set-scale! s4-0 1.0) (cond ((or (= (-> this current-command) (editable-command select-add)) (= (-> this current-command) (editable-command select-remove)) (= (-> this current-command) (editable-command select-toggle)) ) (set-vector! (-> this mouse-box 1) (the-as float (the int (-> *mouse* posx))) (the-as float (the int (-> *mouse* posy))) 0.0 (the-as float #x1) ) (let ((v1-11 3) (a0-12 (abs (- (the-as int (-> this mouse-box 1 x)) (the-as uint (the-as int (-> this mouse-box 0 x)))))) ) (when (and (< v1-11 a0-12) (let ((v1-13 3) (a0-15 (abs (- (the-as int (-> this mouse-box 1 y)) (the-as uint (the-as int (-> this mouse-box 0 y)))))) ) (< v1-13 a0-15) ) ) (let ((s4-1 (new 'static 'vector4w)) (s3-0 (new 'static 'inline-array vector4w 4 (new 'static 'vector4w) (new 'static 'vector4w) (new 'static 'vector4w) (new 'static 'vector4w) ) ) ) (set-vector! (-> s3-0 0) (the-as int (-> this mouse-box 0 x)) (the-as int (-> this mouse-box 0 y)) 0 1) (set-vector! (-> s3-0 1) (the-as int (-> this mouse-box 1 x)) (the-as int (-> this mouse-box 0 y)) 0 1) (set-vector! (-> s3-0 2) (the-as int (-> this mouse-box 1 x)) (the-as int (-> this mouse-box 1 y)) 0 1) (set-vector! (-> s3-0 3) (the-as int (-> this mouse-box 0 x)) (the-as int (-> this mouse-box 1 y)) 0 1) (set-vector! s4-1 128 128 128 128) (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> s3-0 0) (-> s3-0 1) s4-1) (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> s3-0 1) (-> s3-0 2) s4-1) (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> s3-0 2) (-> s3-0 3) s4-1) (add-debug-line2d #t (bucket-id debug-no-zbuf1) (-> s3-0 3) (-> s3-0 0) s4-1) ) ) ) (let ((a1-7 (new 'stack-no-clear 'vector))) (set! (-> a1-7 x) (the float (min (the-as int (-> this mouse-box 0 x)) (the-as int (-> this mouse-box 1 x))))) (set! (-> a1-7 y) (the float (min (the-as int (-> this mouse-box 0 y)) (the-as int (-> this mouse-box 1 y))))) (set! (-> a1-7 z) 0.0) (set! (-> a1-7 w) 1.0) (let ((a2-5 (new 'stack-no-clear 'vector))) (set! (-> a2-5 x) (the float (max (the-as int (-> this mouse-box 0 x)) (the-as int (-> this mouse-box 1 x))))) (set! (-> a2-5 y) (the float (max (the-as int (-> this mouse-box 0 y)) (the-as int (-> this mouse-box 1 y))))) (set! (-> a2-5 z) 0.0) (set! (-> a2-5 w) 1.0) (cond ((and (not (mouse-hold? left)) (= (-> this current-command) (editable-command select-add))) (if (and (< 3.0 (- (-> a2-5 x) (-> a1-7 x))) (< 3.0 (- (-> a2-5 y) (-> a1-7 y)))) (editable-array-method-11 s5-0 a1-7 a2-5 0) (handle-cmd s5-0 (editable-command select-add) *mouse* (-> this manipulator)) ) (update-manipulator-position s5-0 (-> this manipulator)) (set! (-> this current-command) (editable-command none)) 0 ) ((and (not (mouse-hold? right)) (= (-> this current-command) (editable-command select-remove))) (if (and (< 3.0 (- (-> a2-5 x) (-> a1-7 x))) (< 3.0 (- (-> a2-5 y) (-> a1-7 y)))) (editable-array-method-11 s5-0 a1-7 a2-5 2) (handle-cmd s5-0 (editable-command select-remove) *mouse* (-> this manipulator)) ) (update-manipulator-position s5-0 (-> this manipulator)) (set! (-> this current-command) (editable-command none)) 0 ) ((and (not (mouse-hold? middle)) (= (-> this current-command) (editable-command select-toggle))) (if (and (< 3.0 (- (-> a2-5 x) (-> a1-7 x))) (< 3.0 (- (-> a2-5 y) (-> a1-7 y)))) (editable-array-method-11 s5-0 a1-7 a2-5 1) (handle-cmd s5-0 (editable-command select-toggle) *mouse* (-> this manipulator)) ) (update-manipulator-position s5-0 (-> this manipulator)) (set! (-> this current-command) (editable-command none)) 0 ) ) ) ) ) ((= (-> this current-command) (editable-command drag-move)) (manipulator-method-13 (-> this manipulator) (-> this mouse-pos) (-> this mouse-end)) (when (not (mouse-hold? left)) (manipulator-method-14 (-> this manipulator)) (update-manipulator-position s5-0 (-> this manipulator)) (set! (-> this current-command) (editable-command none)) 0 ) ) ((= (-> this current-command) (editable-command drag-scale)) (manipulator-method-13 (-> this manipulator) (-> this mouse-pos) (-> this mouse-end)) (when (not (mouse-hold? middle)) (manipulator-method-14 (-> this manipulator)) (update-manipulator-position s5-0 (-> this manipulator)) (set! (-> this current-command) (editable-command none)) 0 ) ) ((= (-> this current-command) (editable-command drag-rotate)) (manipulator-method-13 (-> this manipulator) (-> this mouse-pos) (-> this mouse-end)) (when (not (mouse-hold? left)) (manipulator-method-14 (-> this manipulator)) (update-manipulator-position s5-0 (-> this manipulator)) (set! (-> this current-command) (editable-command none)) 0 ) ) ((= (-> this current-command) (editable-command drag-resize)) ) ((= (-> this current-command) (editable-command select-user1)) (when (!= (-> *keybd* keys 58) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-1 print-game-text)) (format (clear *temp-string*) "Red:~F" (-> this float-variable)) (s5-1 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user2)) (when (!= (-> *keybd* keys 59) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-2 print-game-text)) (format (clear *temp-string*) "Green:~F" (-> this float-variable)) (s5-2 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user3)) (when (!= (-> *keybd* keys 60) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-3 print-game-text)) (format (clear *temp-string*) "Blue:~F" (-> this float-variable)) (s5-3 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user4)) (when (!= (-> *keybd* keys 61) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-4 print-game-text)) (format (clear *temp-string*) "Palette Index:~F" (-> this float-variable)) (s5-4 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user5)) (when (!= (-> *keybd* keys 62) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-5 print-game-text)) (format (clear *temp-string*) "Decay Start:~F" (-> this float-variable)) (s5-5 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user6)) (when (!= (-> *keybd* keys 63) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-6 print-game-text)) (format (clear *temp-string*) "Ambient Point Ratio:~F" (-> this float-variable)) (s5-6 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user7)) (when (!= (-> *keybd* keys 64) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-7 print-game-text)) (format (clear *temp-string*) "Brightness:~F" (-> this float-variable)) (s5-7 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user8)) (when (!= (-> *keybd* keys 65) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-8 print-game-text)) (format (clear *temp-string*) "Shadow-Ambi:~F" (-> this float-variable)) (s5-8 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user9)) (when (!= (-> *keybd* keys 66) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-9 print-game-text)) (format (clear *temp-string*) "Shadow-Dir0:~F" (-> this float-variable)) (s5-9 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user10)) (when (!= (-> *keybd* keys 67) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-10 print-game-text)) (format (clear *temp-string*) "Shadow-Dir1:~F" (-> this float-variable)) (s5-10 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user11)) (when (!= (-> *keybd* keys 68) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-11 print-game-text)) (format (clear *temp-string*) "Shadow-Dir2:~F" (-> this float-variable)) (s5-11 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) ((= (-> this current-command) (editable-command select-user12)) (when (!= (-> *keybd* keys 69) 1) (set! (-> this current-command) (editable-command none)) 0 ) (set-light-value (the-as int (-> this float-id)) (-> this float-variable)) (let ((s5-12 print-game-text)) (format (clear *temp-string*) "Shadow-Dir3:~F" (-> this float-variable)) (s5-12 *temp-string* s4-0 #f 44 (bucket-id hud-draw-hud-alpha)) ) ) (else (return #f) ) ) ) #t ) ;; definition for function keybd-set-time-of-day! ;; WARN: Return type mismatch time-of-day-palette-id vs object. (defun keybd-set-time-of-day! ((arg0 int) (arg1 time-of-day-palette-id)) (cond ((= arg1 (time-of-day-palette-id unk3)) (send-event (ppointer->process *time-of-day*) 'dest-clock-ratio-set (the-as float (if *time-of-day-fast* 60.0 1.0 ) ) (seconds 2) ) ) (else (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) (send-event (ppointer->process *time-of-day*) 'change 'hour arg0) ) ) (send-event (ppointer->process *time-of-day*) 'change 'minutes 0) (send-event (ppointer->process *time-of-day*) 'change 'seconds 0) (send-event (ppointer->process *time-of-day*) 'change 'frames 0) (set! *teleport-count* 1) (set! (-> *time-of-day-context* mode) arg1) arg1 ) ;; failed to figure out what this is: (defstate idle (editable-player) :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) (case message (('execute) (let ((a2-1 (-> block param 0))) (case a2-1 ((32 31 39 33 35 36) (editable-array-method-14 (-> self current) (editable-command pick-loc) (the-as editable-command a2-1) "click on the point to insert at (up target, down camera)" ) ) ((57 1 53 41 61 62) (if (not (-> self left-handed)) (editable-array-method-14 (-> self current) (editable-command pick-yes-no) (the-as editable-command a2-1) "press x to confirm, square to cancel" ) (editable-array-method-14 (-> self current) (editable-command pick-yes-no) (the-as editable-command a2-1) "press down to confirm, left to cancel" ) ) ) (else (handle-cmd (-> self current) (the-as editable-command a2-1) *mouse* (-> self manipulator)) ) ) ) ) (('exit) (deactivate self) ) (('menu) (set! v0-0 (+ (current-time) (the-as time-frame (-> block param 0)))) (set! (-> self close-menu-time) (the-as time-frame v0-0)) v0-0 ) (('select-by-name) (let ((gp-1 (-> block param 0))) (handle-cmd (-> self current) (editable-command select-none) *mouse* #f) (let* ((s5-1 (-> self current length)) (s4-0 0) (s3-0 (-> self current data s4-0)) ) (while (< s4-0 s5-1) (when (and s3-0 (or (and (logtest? (-> s3-0 region filter) (-> self current filter 0)) (logtest? (-> s3-0 region filter) (-> self current filter 1)) ) (logtest? (-> s3-0 flags) (editable-flag selected)) ) ) (if (string= (the-as string (-> s3-0 prefix)) (the-as string gp-1)) (set-selected! s3-0 #t) ) ) (+! s4-0 1) (set! s3-0 (-> self current data s4-0)) ) ) ) (update-manipulator-position (-> self current) (-> self manipulator)) ) (('on-enter 'on-exit 'on-inside) (let ((s4-1 (-> self current region))) (when s4-1 (let ((gp-2 (-> block param 0))) (set! (-> *syntax-context* got-error?) #f) (eval! *syntax-context* (the-as pair gp-2)) (when (not (-> *syntax-context* got-error?)) (set! (-> s4-1 changed) #t) (cond ((= message 'on-enter) (set! (-> s4-1 on-enter) (the-as pair gp-2)) ) ((= message 'on-inside) (set! (-> s4-1 on-inside) (the-as pair gp-2)) ) ((= message 'on-exit) (set! (-> s4-1 on-exit) (the-as pair gp-2)) ) ) ) ) (set! v0-0 (editable-region-method-12 s4-1)) (set! (-> s4-1 filter) (the-as editable-filter v0-0)) v0-0 ) ) ) (('select) (let ((gp-3 (-> block param 0))) (handle-cmd (-> self current) (editable-command select-none) (the-as mouse-info #f) (-> self manipulator)) (let* ((s5-2 (-> self current length)) (s4-2 0) (a0-51 (-> self current data s4-2)) ) (while (< s4-2 s5-2) (when (and a0-51 (or (and (logtest? (-> a0-51 region filter) (-> self current filter 0)) (logtest? (-> a0-51 region filter) (-> self current filter 1)) ) (logtest? (-> a0-51 flags) (editable-flag selected)) ) ) (when (and (-> a0-51 region) (= gp-3 (-> a0-51 region id))) (set! (-> self current region) (-> a0-51 region)) (set-selected! a0-51 #t) ) ) (+! s4-2 1) (set! a0-51 (-> self current data s4-2)) ) ) ) #f ) (('set-pos) (let* ((s5-3 (-> self current length)) (s4-3 0) (s3-1 (-> self current data s4-3)) ) (while (< s4-3 s5-3) (when (and s3-1 (logtest? (-> s3-1 flags) (editable-flag selected))) (let ((v1-81 (as-type s3-1 editable-entity))) (when v1-81 (vector-copy! (-> v1-81 trans) (the-as vector (-> block param 0))) (logior! (-> v1-81 flags) (editable-flag changed)) (let ((v1-82 (-> v1-81 region))) (if v1-82 (set! (-> v1-82 changed) #t) ) ) ) ) ) (+! s4-3 1) (set! s3-1 (-> self current data s4-3)) ) ) #f ) (('name) (let* ((s5-4 (-> self current length)) (s4-4 0) (s3-2 (-> self current data s4-4)) ) (while (< s4-4 s5-4) (when (and s3-2 (logtest? (-> s3-2 flags) (editable-flag selected))) (let ((s2-0 (as-type s3-2 editable-entity))) (when s2-0 (copy-string<-string (-> s2-0 name) (the-as string (-> block param 0))) (logior! (-> s2-0 flags) (editable-flag changed)) (let ((a0-73 (-> s2-0 region))) (if a0-73 (set! (-> a0-73 changed) #t) ) ) ) ) ) (+! s4-4 1) (set! s3-2 (-> self current data s4-4)) ) ) #f ) (('level) (let ((gp-4 (lookup-level-info (the-as symbol (-> block param 0))))) (when (-> gp-4 dbname) (let* ((s5-5 (-> self current length)) (s4-5 0) (s3-3 (-> self current data s4-5)) ) (while (< s4-5 s5-5) (when (and s3-3 (logtest? (-> s3-3 flags) (editable-flag selected))) (let ((v1-109 (as-type s3-3 editable))) (when (and v1-109 (-> v1-109 region)) (set! (-> v1-109 region level) (the-as string (-> gp-4 dbname))) (set! (-> v1-109 region changed) #t) (logior! (-> v1-109 flags) (editable-flag changed)) ) ) ) (+! s4-5 1) (set! s3-3 (-> self current data s4-5)) ) ) #f ) ) ) (('get-level) (-> self current level) ) (('direction) (let* ((f30-0 (the-as float (-> block param 0))) (f28-0 (the-as float (-> block param 1))) (f26-0 (the-as float (-> block param 2))) (f24-0 (if (and (zero? (-> block param 0)) (zero? (-> block param 1)) (zero? (-> block param 2))) 0.0 1.0 ) ) (gp-5 (-> self current length)) (s5-6 0) (s3-4 (-> self current data s5-6)) ) (while (< s5-6 gp-5) (when (and s3-4 (logtest? (-> s3-4 flags) (editable-flag selected))) (let ((s4-6 (as-type s3-4 editable-light))) (when (and s4-6 (!= (-> (the-as editable-light s4-6) color w) -2.0)) (set-vector! (-> (the-as editable-light s4-6) direction) f30-0 f28-0 f26-0 f24-0) (vector-normalize! (-> (the-as editable-light s4-6) direction) 1.0) (logior! (-> (the-as editable-light s4-6) flags) (editable-flag changed)) (let ((a0-99 (-> (the-as editable-light s4-6) region))) (if a0-99 (set! (-> a0-99 changed) #t) ) ) ) ) ) (+! s5-6 1) (set! s3-4 (-> self current data s5-6)) ) ) #f ) (('angles) (let* ((f30-1 (the-as float (-> block param 0))) (f28-1 (the-as float (-> block param 1))) (f26-1 (the-as float (-> block param 2))) (gp-6 (-> self current length)) (s5-7 0) (s3-5 (-> self current data s5-7)) ) (while (< s5-7 gp-6) (when (and s3-5 (logtest? (-> s3-5 flags) (editable-flag selected))) (let ((s4-7 (as-type s3-5 editable-entity))) (when s4-7 (set-eul! (-> s4-7 angles) (* 182.04445 f30-1) (* 182.04445 f28-1) (* 182.04445 f26-1) 21) (logior! (-> s4-7 flags) (editable-flag changed)) (let ((v1-156 (-> s4-7 region))) (if v1-156 (set! (-> v1-156 changed) #t) ) ) (editable-entity-method-36 s4-7) ) ) ) (+! s5-7 1) (set! s3-5 (-> self current data s5-7)) ) ) (update-manipulator-position (-> self current) (-> self manipulator)) ) (('color) (let* ((f30-2 (the-as float (-> block param 0))) (f28-2 (the-as float (-> block param 1))) (f26-2 (the-as float (-> block param 2))) (f24-1 (the-as float (-> block param 3))) (gp-7 (-> self current length)) (s5-8 0) (s4-8 (-> self current data s5-8)) ) (while (< s5-8 gp-7) (when (and s4-8 (logtest? (-> s4-8 flags) (editable-flag selected))) (let ((v1-174 (as-type s4-8 editable-light))) (when v1-174 (set-vector! (-> v1-174 color) f30-2 f28-2 f26-2 f24-1) (logior! (-> v1-174 flags) (editable-flag changed)) (let ((v1-175 (-> v1-174 region))) (if v1-175 (set! (-> v1-175 changed) #t) ) ) ) ) ) (+! s5-8 1) (set! s4-8 (-> self current data s5-8)) ) ) #f ) (('param) (let ((s5-9 (-> block param 0)) (f30-3 (the-as float (-> block param 1))) ) (when (and (>= (the-as int s5-9) 0) (>= 2 (the-as int s5-9))) (let* ((gp-8 (-> self current length)) (s4-9 0) (s3-6 (-> self current data s4-9)) ) (while (< s4-9 gp-8) (when (and s3-6 (logtest? (-> s3-6 flags) (editable-flag selected))) (let ((v1-189 (as-type s3-6 editable-light))) (when (the-as editable-light v1-189) (set! (-> (the-as editable-light (+ (* s5-9 4) (the-as uint v1-189))) decay-start) f30-3) (logior! (-> (the-as editable-light v1-189) flags) (editable-flag changed)) (let ((v1-190 (-> (the-as editable-light v1-189) region))) (if v1-190 (set! (-> v1-190 changed) #t) ) ) ) ) ) (+! s4-9 1) (set! s3-6 (-> self current data s4-9)) ) ) #f ) ) ) ) ) :code (behavior () (until #f (suspend) ) #f ) :post (behavior () (editable-player-method-21 self) ) ) ;; definition for function editable-player-init ;; WARN: Return type mismatch object vs none. (defbehavior editable-player-init editable-player ((arg0 symbol)) (set! *editable-temp-id* 0) (set! *display-profile* #f) (set! *display-entity-errors* #f) (set! *display-actor-marks* #f) (set! (-> *editable-work* hide) #f) (logclear! (-> self mask) (process-mask freeze pause menu)) (+! (-> self clock ref-count) -1) (+! (-> *display* real-clock ref-count) 1) (set! (-> self clock) (-> *display* real-clock)) (set! (-> self current) (new 'debug 'editable-array 4096)) (add-setting! 'mouse #t 0.0 0) (add-setting! 'cursor #t 0.0 0) (add-setting! 'keybd #t 0.0 0) (set! (-> self current-command) (editable-command none)) (set! (-> self select-command) (the-as (function object) 8)) (set! (-> self drag-command) (the-as uint 20)) (set! (-> self extra-command) (the-as (function object) 24)) (set! (-> self left-handed) #f) (set! (-> self light-names) #f) (set! (-> self command 0) (the-as editable-command (-> self select-command))) (set! (-> self command 1) (editable-command none)) (set! (-> self command 2) (editable-command none)) (set! (-> self command 3) (the-as editable-command (-> self extra-command))) (set! (-> self command 4) (editable-command none)) (set! (-> self command 5) (the-as editable-command (-> self drag-command))) (let* ((s5-0 (-> self current)) (s4-0 (method-of-object s5-0 editable-array-method-13)) (s3-0 (if arg0 (lookup-level-info arg0) ) ) (gp-1 (level-get-target-inside *level*)) (a1-6 (cond (s3-0 (let ((gp-2 (level-get *level* (-> s3-0 dbname)))) (when gp-2 (format 0 "setting level~d ~s to *light-hash*~%" (-> gp-2 index) (-> gp-2 name)) (set! (-> gp-2 light-hash) *light-hash*) ) ) (-> s3-0 dbname) ) (gp-1 (let ((s3-1 (level-get *level* (-> gp-1 info dbname)))) (when s3-1 (format 0 "setting level~d ~s to *light-hash*~%" (-> s3-1 index) (-> s3-1 name)) (set! (-> s3-1 light-hash) *light-hash*) ) ) (-> gp-1 info dbname) ) ) ) ) (s4-0 s5-0 a1-6) ) (set! *editable* (the-as (pointer editable-player) (process->ppointer self))) (set! (-> self event-hook) (-> (method-of-object self idle) event)) (set! (-> self external-cam-mode) *external-cam-mode*) (set! *external-cam-mode* 'pad-1) (matrix-identity! (-> self manipulator mat)) (handle-cmd (-> self current) (editable-command update-game) (the-as mouse-info #f) (-> self manipulator)) (go-virtual idle) (none) ) ;; definition for function set-editable-name ;; WARN: Return type mismatch string vs object. (defun set-editable-name ((arg0 string)) (copy-string<-string *editable-default-name* arg0) ) ;; definition for function select-editable-by-name (defun select-editable-by-name ((arg0 string)) (send-event (ppointer->process *editable*) 'select-by-name arg0) ) ;; definition for symbol *editable-menu-context*, type debug-menu-context (define *editable-menu-context* (new 'debug 'debug-menu-context)) ;; failed to figure out what this is: (set! (-> *editable-menu-context* joypad-number) 1) ;; definition for function editable-menu-command (defun editable-menu-command ((arg0 int)) (send-event (ppointer->process *editable*) 'execute (/ arg0 8)) (send-event (ppointer->process *editable*) 'menu 90) ) ;; definition for function editable-menu-command-no-close (defun editable-menu-command-no-close ((arg0 int)) (send-event (ppointer->process *editable*) 'execute (/ arg0 8)) ) ;; definition for function dm-region-tree-pick-func ;; WARN: Return type mismatch object vs symbol. (defun dm-region-tree-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) (when (= arg1 (debug-menu-msg press)) (when (and *editable* (-> *editable* 0 current region)) (let ((s5-0 (-> *editable* 0 current region))) (set! (-> s5-0 tree) arg0) (set! (-> s5-0 changed) #t) (set! (-> s5-0 filter) (editable-region-method-12 s5-0)) ) ) ) (the-as symbol (and *editable* (-> *editable* 0 current region) (= arg0 (-> *editable* 0 current region tree))) ) ) ;; definition for function dm-editable-flag-pick-func (defun dm-editable-flag-pick-func ((arg0 editable-flag) (arg1 debug-menu-msg)) (when *editable* (let ((gp-0 (/ (the-as int arg0) 8))) (editable-array-method-15 (-> *editable* 0 current) (the-as (function editable editable-region symbol) true-func) (the-as editable-region #f) ) (when (= arg1 (debug-menu-msg press)) (let* ((v1-10 (-> *editable* 0 current length)) (a0-2 0) (a1-4 (-> *editable* 0 current data a0-2)) ) (while (< a0-2 v1-10) (if (and a1-4 (logtest? (-> a1-4 flags) (editable-flag selected))) (logxor! (-> a1-4 flags) (the-as uint gp-0)) ) (+! a0-2 1) (set! a1-4 (-> *editable* 0 current data a0-2)) ) ) ) (and (>= (-> *editable* 0 current selection length) 1) (logtest? (-> *editable* 0 current selection 0 flags) gp-0) ) ) ) ) ;; definition for function dm-editable-filter0-pick-func (defun dm-editable-filter0-pick-func ((arg0 editable-filter) (arg1 debug-menu-msg)) (when *editable* (let ((v1-1 (/ (the-as int arg0) 8))) (if (= arg1 (debug-menu-msg press)) (logxor! (-> *editable* 0 current filter 0) (the-as uint v1-1)) ) (logtest? (-> *editable* 0 current filter 0) v1-1) ) ) ) ;; definition for function dm-editable-filter1-pick-func (defun dm-editable-filter1-pick-func ((arg0 editable-filter) (arg1 debug-menu-msg)) (when *editable* (let ((v1-1 (/ (the-as int arg0) 8))) (if (= arg1 (debug-menu-msg press)) (logxor! (-> *editable* 0 current filter 1) (the-as uint v1-1)) ) (logtest? (-> *editable* 0 current filter 1) v1-1) ) ) ) ;; definition for function dm-editable-light-float-func (defun dm-editable-light-float-func ((arg0 int) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) (cond ((not *editable*) arg3 ) ((= arg1 (debug-menu-msg press)) (let* ((s4-0 (-> *editable* 0 current length)) (s3-0 0) (s2-0 (-> *editable* 0 current data s3-0)) ) (while (< s3-0 s4-0) (when (and s2-0 (logtest? (-> s2-0 flags) (editable-flag selected))) (let ((a0-7 (as-type s2-0 editable-light))) (when (the-as editable-light a0-7) (set! (-> (&+ (the-as (pointer float) a0-7) (/ arg0 8)) 0) arg2) (logior! (-> (the-as editable-light a0-7) flags) (editable-flag changed)) (when (= (-> (the-as editable-light a0-7) color w) -2.0) (let ((a1-2 0) (v1-17 0) ) (dotimes (a2-1 5) (let ((f0-2 (-> (the-as editable-light a0-7) shadows a2-1))) (when (!= f0-2 1.0) (set! a1-2 (logior a1-2 (ash 1 a2-1))) (set! v1-17 (logior v1-17 (ash (logand (the int (* 16.0 f0-2)) 15) (* a2-1 4)))) ) ) ) (set! (-> (the-as editable-light a0-7) direction x) (the-as float (logior (logand (the-as uint (-> (the-as editable-light a0-7) direction x)) (the-as uint #xffffffff00ffffff)) (shr (shl a1-2 56) 32) ) ) ) (set! (-> (the-as editable-light a0-7) direction x) (the-as float (logior (logand (the-as int (-> (the-as editable-light a0-7) direction x)) -16777216) (shr (shl v1-17 40) 40)) ) ) ) ) (let ((v1-21 (-> (the-as editable-light a0-7) region))) (if v1-21 (set! (-> v1-21 changed) #t) ) ) (update-light-sphere-from-editable-light (the-as editable-light a0-7)) ) ) ) (+! s3-0 1) (set! s2-0 (-> *editable* 0 current data s3-0)) ) ) (the-as float #f) ) (else (let ((f30-0 arg3)) (let* ((s5-1 (-> *editable* 0 current length)) (s4-1 0) (s3-1 (-> *editable* 0 current data s4-1)) ) (while (< s4-1 s5-1) (when (and s3-1 (logtest? (-> s3-1 flags) (editable-flag selected))) (let ((v1-35 (as-type s3-1 editable-light))) (if (the-as editable-light v1-35) (set! f30-0 (-> (&+ (the-as (pointer float) v1-35) (/ arg0 8)) 0)) ) ) ) (+! s4-1 1) (set! s3-1 (-> *editable* 0 current data s4-1)) ) ) f30-0 ) ) ) ) ;; definition for function dm-cam-externalize2 (defun dm-cam-externalize2 ((arg0 symbol) (arg1 debug-menu-msg)) (when (= arg1 (debug-menu-msg press)) (cond ((= arg0 'reset) (if (!= *external-cam-mode* 'locked) (external-cam-reset!) ) ) ((= arg0 'allow-z) (set! *external-cam-options* (logxor *external-cam-options* (external-cam-option allow-z))) ) ((= *external-cam-mode* arg0) (set! *external-cam-mode* #f) ) (else (if (not *external-cam-mode*) (external-cam-reset!) ) (set! *external-cam-mode* arg0) ) ) ) (if (= arg0 'allow-z) (logtest? *external-cam-options* (external-cam-option allow-z)) (= *external-cam-mode* arg0) ) ) ;; definition for function dm-editable-boolean-toggle-pick-func ;; WARN: Return type mismatch float vs symbol. (defun dm-editable-boolean-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) (the-as symbol (cond (*editable* (let ((v1-3 (&+ (the-as (pointer float) (-> *editable* 0)) (/ arg0 8)))) (if (= arg1 (debug-menu-msg press)) (set! (-> v1-3 0) (the-as float (not (-> v1-3 0)))) ) (-> v1-3 0) ) ) (else (the-as float #f) ) ) ) ) ;; definition for function editable-menu-context-make-menus (defun editable-menu-context-make-menus ((arg0 debug-menu-context)) (debug-menu-make-from-template arg0 '(main-menu "Editable" (flag "Cam 1" pad-1 dm-cam-externalize2) (flag "Left Handed" 216 dm-editable-boolean-toggle-pick-func) (menu "Insert" (function "Sphere" 31 editable-menu-command) (function "Point" 32 editable-menu-command) (function "Sample" 33 editable-menu-command) (function "Light" 35 editable-menu-command) (function "Entity" 36 editable-menu-command) (function "Face" 37 editable-menu-command) (function "Plane" 38 editable-menu-command) (function "Box" 39 editable-menu-command) (function "Wall" 40 editable-menu-command) (function "Edit-Plane Set" 51 editable-menu-command) (function "Edit-Plane Clear" 52 editable-menu-command) ) (menu "Select" (function "None" 8 editable-menu-command) (function "All" 7 editable-menu-command) (function "Owner" 12 editable-menu-command) (function "Current Region" 13 editable-menu-command) (function "Current Face" 14 editable-menu-command) (function "Current Prim" 15 editable-menu-command) ) (menu "Selection" (function "Copy" 42 editable-menu-command) (function "Delete" 41 editable-menu-command) (function "Flip Side" 48 editable-menu-command) (function "Snap to Ground" 44 editable-menu-command) (function "Snap XZ" 45 editable-menu-command) (function "Snap Y" 46 editable-menu-command) (function "Resize to Param" 43 editable-menu-command) (function "Set to current Region" 49 editable-menu-command) (function "Set to new Region" 50 editable-menu-command) (flag "No Save" 2 dm-editable-flag-pick-func) (flag "Top Set" 512 dm-editable-flag-pick-func) (flag "Bot Set" 1024 dm-editable-flag-pick-func) ) (menu "Region" (function "Print Info" 59 editable-menu-command) (function "Copy" 54 editable-menu-command) (function "Delete" 53 editable-menu-command) (function "Add to current Region" 55 editable-menu-command) (flag "Region Lock" #f ,(lambda ((arg0 object) (arg1 int)) (if (= arg1 4) (set! (-> *editable* 0 current region-lock?) (not (-> *editable* 0 current region-lock?))) ) (-> *editable* 0 current region-lock?) ) ) (flag "Camera" camera dm-region-tree-pick-func) (flag "Target" target dm-region-tree-pick-func) (flag "Water" water dm-region-tree-pick-func) (flag "Data" data dm-region-tree-pick-func) (flag "City Vis" city_vis dm-region-tree-pick-func) ) (menu "Filter" (flag "None" 1 dm-editable-filter0-pick-func) (flag "Unknown" 2 dm-editable-filter0-pick-func) (flag "Sound" 4 dm-editable-filter0-pick-func) (flag "Part" 8 dm-editable-filter0-pick-func) (flag "Load" 64 dm-editable-filter0-pick-func) (flag "User Setting" 16 dm-editable-filter0-pick-func) (flag "Cam Setting" 32 dm-editable-filter0-pick-func) (flag "Camera" 256 dm-editable-filter1-pick-func) (flag "Target" 512 dm-editable-filter1-pick-func) (flag "Water" 1024 dm-editable-filter1-pick-func) (flag "Data" 2048 dm-editable-filter1-pick-func) (flag "Sample" 8192 dm-editable-filter1-pick-func) (flag "Light" 16384 dm-editable-filter1-pick-func) (flag "Entity" 32768 dm-editable-filter1-pick-func) (flag "City Vis" 4096 dm-editable-filter1-pick-func) ) (menu "Light" (flag "Show Light Names" 220 dm-editable-boolean-toggle-pick-func) (float-var "Red" 60 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.00390625) #t 0 (new 'static 'bfloat :data 1.9921875) 0 ) (float-var "Green" 64 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.00390625) #t 0 (new 'static 'bfloat :data 1.9921875) 0 ) (float-var "Blue" 68 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.00390625) #t 0 (new 'static 'bfloat :data 1.9921875) 0 ) (float-var "Palette Index" 72 dm-editable-light-float-func 2 (new 'static 'bfloat :data 1.0) #t (new 'static 'bfloat :data -2.0) (new 'static 'bfloat :data 7.0) 0 ) (float-var "Decay Start" 76 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.00390625) #t 0 1 0) (float-var "Ambient Point Ratio" 80 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.00390625) #t 0 1 0 ) (float-var "Brightness" 84 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.00390625) #t 0 1 0) (float-var "Shadow Ambi" 88 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.0625) #t 0 1 0) (float-var "Shadow Dir0" 92 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.0625) #t 0 1 0) (float-var "Shadow Dir1" 96 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.0625) #t 0 1 0) (float-var "Shadow Dir2" 100 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.0625) #t 0 1 0) (float-var "Shadow Dir3" 104 dm-editable-light-float-func 2 (new 'static 'bfloat :data 0.0625) #t 0 1 0) ) (float-var "Param" #f ,(lambda ((arg0 object) (arg1 int) (arg2 float)) (cond ((= arg1 4) (if (and *editable* (nonzero? *editable*)) (set! (-> *editable* 0 current edit-param0) arg2) ) ) ((or (not *editable*) (zero? *editable*)) 0 ) (else (-> *editable* 0 current edit-param0) ) ) ) 3 (new 'static 'bfloat :data 0.5) #t 0 500 1 ) (function "Rotate Level" 61 editable-menu-command) (function "Trans Y Level" 62 editable-menu-command) (function "Revert" 57 editable-menu-command) (function "Save" 56 editable-menu-command-no-close) (function "Update Game" 58 editable-menu-command-no-close) (function "Cancel" 19 editable-menu-command) (function "Exit" 1 editable-menu-command) ) ) arg0 ) ;; failed to figure out what this is: (editable-menu-context-make-menus *editable-menu-context*) ;; definition for function insert-sample-camera ;; WARN: Return type mismatch int vs object. (defun insert-sample-camera ((arg0 symbol)) (cond (level (let ((s5-0 sql-query)) (format (clear *temp-string*) "select translate_x,translate_y,translate_z,level_info_id from level_info where name='~S'" arg0 ) (let ((s5-1 (s5-0 *temp-string*))) (cond ((and (= (-> s5-1 content-type) 'select) (= (-> s5-1 length) 4)) (let ((f26-0 (* 4096.0 (string->float (the-as string (-> s5-1 sql-data 0))))) (f28-0 (* 4096.0 (string->float (the-as string (-> s5-1 sql-data 1))))) (f30-3 (* 4096.0 (string->float (the-as string (-> s5-1 sql-data 2))))) (s5-2 (string->int (the-as string (-> s5-1 sql-data 3)))) (s3-0 (math-camera-pos)) (s4-1 (clear *temp-string*)) ) (format s4-1 "insert into sample_point set level_info_id=~D,x=~f,y=~f,z=~f,source='manual'" s5-2 (* 0.00024414062 (- (-> s3-0 x) f26-0)) (* 0.00024414062 (- (-> s3-0 y) f28-0)) (* 0.00024414062 (- (-> s3-0 z) f30-3)) ) (let ((a2-2 (sql-query s4-1))) (cond ((= (-> a2-2 content-type) 'modify) (format (clear s4-1) "update level_info set last_update=last_update, sample_point_update=NULL where level_info_id=~D" s5-2 ) (let ((a2-4 (sql-query s4-1))) (when (!= (-> a2-4 content-type) 'modify) (format 0 "ERROR: sql: modify error ~A~%" a2-4) (return (the-as object #f)) ) ) (sound-play-by-spec (static-sound-spec "beep" :group 0 :fo-curve 1) (new-sound-id) (the-as vector #t)) (format #t "EDITABLE: saved camera sample point for level ~A~%" arg0) ) (else (format 0 "ERROR: sql: insert error ~A~%" a2-2) ) ) ) ) ) (else (format 0 "ERROR: sql: select error ~A~%" s5-1) ) ) ) ) ) (else (format 0 "ERROR: EDITABLE: no current level~%") ) ) 0 ) ;; definition for symbol *debug-hook*, type pair (define *debug-hook* (cons (lambda () (when (and *debug-segment* *manual-sample-point*) (when (cpad-pressed? 1 select) (cond (*editable* #f ) ((not *artist-fix-visible*) (insert-sample-camera (-> (level-get-target-inside *level*) info dbname)) ) (else (let ((gp-1 0)) (dotimes (s5-0 (-> *level* length)) (let ((v1-14 (-> *level* level s5-0))) (when (= (-> v1-14 status) 'active) (when (!= (-> v1-14 bsp visible-list-length) 4) (if (not (logtest? *fix-visible-level-mask* (ash 1 gp-1))) (insert-sample-camera (-> v1-14 name)) ) (+! gp-1 1) ) ) ) ) ) #f ) ) ) ) ) *debug-hook* ) )