Browse Source

Update for command CRCs and fix build

* I had to make changes to remove unnecessary global includes, which
caused command changes on files across projects
* Added Math.cake, which revealed a problem in macro
evaluation (delimiters need to be part of the context when evaluating
macros after the first evaluation)
pitch-detection
Macoy Madson 12 months ago
parent
commit
f0bb3a84ea
  1. 4
      Build_Debug.sh
  2. 2
      Dependencies/cakelisp
  3. 28
      src/Math.cake
  4. 1
      test/src/Loader.cake
  5. 2
      test/src/MakeHotReload.cake
  6. 5
      test/src/Options.cake

4
Build_Debug.sh

@ -14,9 +14,11 @@ echo "\n\nLoader\n\n"
./Dependencies/cakelisp/bin/cakelisp test/src/Loader.cake || exit $?
echo "\n\nVocal Game (no reload)\n\n"
./Dependencies/cakelisp/bin/cakelisp --execute \
./Dependencies/cakelisp/bin/cakelisp \
test/src/NoHotReload.cake test/src/VocalGame.cake || exit $?
# TODO: Need process command change detection to successfully rebuild this
./Dependencies/cakelisp/bin/cakelisp src/AutoTest.cake src/Math.cake || exit $?
# TESTING

2
Dependencies/cakelisp

@ -1 +1 @@
Subproject commit 56869ad3d6d7bf315e493b897cd1687947e1aad1
Subproject commit 9f0a8965b9777b353c22f7c118526fb6df50909f

28
src/Math.cake

@ -0,0 +1,28 @@
;; Math.cake: Common game math
(set-cakelisp-option cakelisp-src-dir "Dependencies/cakelisp/src")
(c-import "<stdio.h>")
(defstruct vec3
x float
y float
z float)
;; Expand vector to each of its components
(defmacro vec3-expand (vec symbol)
(tokenize-push output
(field (token-splice vec) x)
(field (token-splice vec) y)
(field (token-splice vec) z))
(return true))
(defun test--math (&return int)
(var my-vec vec3 (array 1.f 2.f 3.f))
;; TODO: ExpressionList delimiter is lost because macro expansion uses different evaluate all
;; (printf "%f %f %f\n" (vec3-expand my-vec))
(printf "%f %f %f\n" (field my-vec x)
(field my-vec y)
(field my-vec z))
(return 0))
(add-build-config-label "Math")

1
test/src/Loader.cake

@ -14,6 +14,7 @@
;; "src/SDL.cake")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(import &comptime-only "Options.cake" "Macros.cake")
;; TODO: Should this happen automatically, because import automatically adds current working dir?
;; Should it add working dir?

2
test/src/MakeHotReload.cake

@ -6,3 +6,5 @@
(add-c-search-directory global "Dependencies/cakelisp/src")
(import "Dependencies/cakelisp/runtime/HotReloadingCodeModifier.cake")
(add-c-search-directory global "Dependencies/cakelisp/runtime")

5
test/src/Options.cake

@ -2,8 +2,5 @@
(set-cakelisp-option cakelisp-src-dir "Dependencies/cakelisp/src")
(add-cakelisp-search-directory "src")
(add-c-search-directory global "src")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(add-c-search-directory global "Dependencies/cakelisp/runtime")
(add-cakelisp-search-directory "src")

Loading…
Cancel
Save