Permalink
Browse files

Distribution skeleton

  • Loading branch information...
borodust committed Apr 15, 2017
1 parent 8a77603 commit 7d49cae0bc7d1ea14144b7aac6b1d323e05a598c
@@ -4,9 +4,10 @@
*.lisp-temp
# emacs junk
\#*
*~
.\#*
# build
build/
# system dependent junk
local/
BIN +214 KB assets/font.brf
Binary file not shown.

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,4 @@
'(:engine
(:systems (mortar-combat::mortar-combat)
:log-level :debug)
:assets "assets/")
@@ -9,7 +9,20 @@
:author "Pavel Korolev"
:mailto "dev@borodust.org"
:license "GPLv3"
:depends-on (log4cl bodge-blobs cl-bodge)
:depends-on (log4cl uiop cl-muth bodge-blobs cl-bodge)
:serial t
:pathname "src/"
:components ((:file "packages")
(:file "utils")
(:file "main")))
(defsystem mortar-combat/distrib
:description "Mortar Combat distribution"
:version "0.0.1"
:author "Pavel Korolev"
:mailto "dev@borodust.org"
:license "GPLv3"
:depends-on (bodge-blobs mortar-combat cl-bodge/distribution)
:serial t
:components ((:file "mortar-combat.dist")))
@@ -0,0 +1,3 @@
'(:engine
(:systems (mortar-combat::mortar-combat))
:assets "assets/")
@@ -0,0 +1,7 @@
(ge.dist:descriptor :mortar-combat
:base-directory "../"
:entry-function (:mortar-combat main)
:assets ("mortar-combat.conf.lisp"
"run.sh"
"run.bat"
"assets/"))
@@ -0,0 +1,5 @@
@echo off
set WORK_DIR=%~dp0
set PATH=%WORK_DIR%lib\;%PATH%
start /d "%WORK_DIR%" mortar-combat.bin mortar-combat.conf.lisp
16 run.sh
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
WORK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
case $OSTYPE in
linux*)
export LD_LIBRARY_PATH="$WORK_DIR/lib/"
export ALSOFT_DRIVERS="-jack,$ALSOFT_DRIVERS"
;;
darwin*)
export DYLD_LIBRARY_PATH="$WORK_DIR/lib/"
;;
esac
cd $WORK_DIR
./mortar-combat.bin mortar-combat.conf.lisp
@@ -0,0 +1,55 @@
(in-package :mortar-combat)
(defvar *main-latch* (mt:make-latch))
(defclass mortar-combat (enableable generic-system)
((scene :initform nil))
(:default-initargs :depends-on '(graphics-system
physics-system
audio-system)))
(definline mortar-combat ()
(engine-system 'mortar-combat))
(defun scenegraph-flow ()
(scenegraph
(transform-node)))
(defmethod initialize-system :after ((this mortar-combat))
(with-slots (scene) this
(register-resource-loader (make-resource-loader (asset-path "font.brf")))
(run (>> (-> ((host)) ()
(setf (viewport-title) "Mortar Combat")
(setf (viewport-size) (vec2 800 600)))
(-> ((physics)) ()
(setf (gravity) (vec3 0.0 -9.81 0.0)))
(scenegraph-flow)
(instantly (scenegraph-root)
(setf scene (make-scene (make-pass-chain (make-simulation-pass)
(make-rendering-pass))
scenegraph-root)))
(concurrently ()
(let (looped-flow)
(setf looped-flow (>> (scene-processing-flow scene)
(instantly ()
(when (enabledp this)
(run looped-flow)))))
(run looped-flow)))))))
(defun start (configuration-path)
(startup configuration-path (uiop:pathname-directory-pathname configuration-path)))
(defun stop ()
(shutdown))
(defun main (args)
(start (merge-pathnames (second args) (uiop:getcwd)))
(mt:wait-for-latch *main-latch*))
File renamed without changes.
@@ -0,0 +1,5 @@
(in-package :mortar-combat)
(defun asset-path (file)
(merge-pathnames file (merge-working-pathname (property :assets "assets/"))))

0 comments on commit 7d49cae

Please sign in to comment.