From bdb105647e3975c51dd1fe6ba2ddf5e1c843ff4f Mon Sep 17 00:00:00 2001 From: zongor Date: Sat, 2 Dec 2023 19:33:48 -0500 Subject: [PATCH] Add sbcl using cl-project, NOTE: this is not actually here its in ~/quicklisp/local-projects because I can't figure how asdf works --- lisp/client/mmo-client-sbcl/.gitignore | 9 ++++++++ lisp/client/mmo-client-sbcl/README.markdown | 5 +++++ lisp/client/mmo-client-sbcl/README.org | 5 +++++ .../mmo-client-sbcl/mmo-client-sbcl.asd | 21 ++++++++++++++++++ .../src/main.lisp} | 22 ++++++++++++------- lisp/client/mmo-client-sbcl/tests/main.lisp | 11 ++++++++++ lisp/client/sbcl/install-cl-raylib.sh | 2 -- 7 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 lisp/client/mmo-client-sbcl/.gitignore create mode 100644 lisp/client/mmo-client-sbcl/README.markdown create mode 100644 lisp/client/mmo-client-sbcl/README.org create mode 100644 lisp/client/mmo-client-sbcl/mmo-client-sbcl.asd rename lisp/client/{sbcl/client.lisp => mmo-client-sbcl/src/main.lisp} (66%) create mode 100644 lisp/client/mmo-client-sbcl/tests/main.lisp delete mode 100755 lisp/client/sbcl/install-cl-raylib.sh diff --git a/lisp/client/mmo-client-sbcl/.gitignore b/lisp/client/mmo-client-sbcl/.gitignore new file mode 100644 index 0000000..b9fa3c1 --- /dev/null +++ b/lisp/client/mmo-client-sbcl/.gitignore @@ -0,0 +1,9 @@ +*.abcl +*.fasl +*.dx32fsl +*.dx64fsl +*.lx32fsl +*.lx64fsl +*.x86f +*~ +.#* diff --git a/lisp/client/mmo-client-sbcl/README.markdown b/lisp/client/mmo-client-sbcl/README.markdown new file mode 100644 index 0000000..65ceb56 --- /dev/null +++ b/lisp/client/mmo-client-sbcl/README.markdown @@ -0,0 +1,5 @@ +# Mmo-Client-Sbcl + +## Usage + +## Installation diff --git a/lisp/client/mmo-client-sbcl/README.org b/lisp/client/mmo-client-sbcl/README.org new file mode 100644 index 0000000..411190f --- /dev/null +++ b/lisp/client/mmo-client-sbcl/README.org @@ -0,0 +1,5 @@ +* Mmo-Client-Sbcl + +** Usage + +** Installation diff --git a/lisp/client/mmo-client-sbcl/mmo-client-sbcl.asd b/lisp/client/mmo-client-sbcl/mmo-client-sbcl.asd new file mode 100644 index 0000000..0367e87 --- /dev/null +++ b/lisp/client/mmo-client-sbcl/mmo-client-sbcl.asd @@ -0,0 +1,21 @@ +(defsystem "mmo-client-sbcl" + :version "0.1.0" + :author "" + :license "" + :depends-on ("claylib") + :components ((:module "src" + :components + ((:file "main")))) + :description "" + :in-order-to ((test-op (test-op "mmo-client-sbcl/tests")))) + +(defsystem "mmo-client-sbcl/tests" + :author "" + :license "" + :depends-on ("mmo-client-sbcl" + "rove") + :components ((:module "tests" + :components + ((:file "main")))) + :description "Test system for mmo-client-sbcl" + :perform (test-op (op c) (symbol-call :rove :run c))) diff --git a/lisp/client/sbcl/client.lisp b/lisp/client/mmo-client-sbcl/src/main.lisp similarity index 66% rename from lisp/client/sbcl/client.lisp rename to lisp/client/mmo-client-sbcl/src/main.lisp index e5058da..6120477 100644 --- a/lisp/client/sbcl/client.lisp +++ b/lisp/client/mmo-client-sbcl/src/main.lisp @@ -1,5 +1,6 @@ - (load "~/quicklisp/setup.lisp") -(ql:quickload '(:claylib :usocket :simple-actors :bordeau-thread)) +(defpackage mmo-client-sbcl + (:use :cl :claylib)) +(in-package :mmo-client-sbcl) (defvar *mouse-delta* (make-vector2 0 0)) @@ -21,7 +22,8 @@ (y (rot camera)) (* 0.05 (y *mouse-delta*)) (zoom camera) (* 2 (get-mouse-wheel-move)))) - (with-window (:title "common lisp client : raylib") +(defun main () + (with-window (:title "raylib [core] example - 3d camera first person") (let ((camera (make-camera-3d 0 2 4 0 2 0 0 1 0 @@ -32,12 +34,16 @@ ((ground (make-plane 0 0 0 32 32 +lightgray+)) (blue (make-cube -16 2.5 0 1 5 32 - +blue+))))))) + +blue+)) + (green (make-cube 16 2.5 0 + 1 5 32 + +lime+)) + (yellow (make-cube 0 2.5 16 + 32 5 1 + +gold+)))))) (with-scenes scene () (do-game-loop (:livesupport t) -(pro-mode-update camera) + (compute-camera camera) (with-drawing () (with-3d-mode camera - (draw-scene scene '(ground blue green yellow)) - (draw-scene-regex scene "^COLUMN")) - (draw-scene-regex scene "^(STATUS|INST)")))))) + (draw-scene scene '(ground blue green yellow))))))))) diff --git a/lisp/client/mmo-client-sbcl/tests/main.lisp b/lisp/client/mmo-client-sbcl/tests/main.lisp new file mode 100644 index 0000000..cda513c --- /dev/null +++ b/lisp/client/mmo-client-sbcl/tests/main.lisp @@ -0,0 +1,11 @@ +(defpackage mmo-client-sbcl/tests/main + (:use :cl + :mmo-client-sbcl + :rove)) +(in-package :mmo-client-sbcl/tests/main) + +;; NOTE: To run this test file, execute `(asdf:test-system :mmo-client-sbcl)' in your Lisp. + +(deftest test-target-1 + (testing "should (= 1 1) to be true" + (ok (= 1 1)))) diff --git a/lisp/client/sbcl/install-cl-raylib.sh b/lisp/client/sbcl/install-cl-raylib.sh deleted file mode 100755 index e137737..0000000 --- a/lisp/client/sbcl/install-cl-raylib.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -git clone https://github.com/defun-games/claylib ~/quicklisp/local-projects/claylib