projects
/
uxul-world.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6c07f06
)
Finally no nonsense is done with defconstant anymore.
author
christoph
<christoph@christoph-laptop.(none)>
Mon, 24 May 2010 03:01:03 +0000
(
05:01
+0200)
committer
christoph
<christoph@christoph-laptop.(none)>
Mon, 24 May 2010 03:01:03 +0000
(
05:01
+0200)
constants.lisp
patch
|
blob
|
history
diff --git
a/constants.lisp
b/constants.lisp
index
c788c2d
..
40c5204
100755
(executable)
--- a/
constants.lisp
+++ b/
constants.lisp
@@
-2,10
+2,18
@@
(in-package :uxul-world)
(in-package :uxul-world)
-(defconstant +screen-width+ 1024)
-(defconstant +screen-height+ 768)
+(defmacro mydefconst (x y)
+ `(eval-when (:compile-toplevel :load-toplevel)
+ (when (or (not (boundp ',x))
+ (not (equal ,y
+ (symbol-value ',x))))
+ (defconstant ,x ,y))))
-(defconstant +class-indices+ '(t uxul-world::animation
+
+(mydefconst +screen-width+ 1024)
+(mydefconst +screen-height+ 768)
+
+(mydefconst +class-indices+ '(t uxul-world::animation
uxul-world::collision uxul-world::game-object uxul-world::player
uxul-world::room uxul-world::stone uxul-world::xy-coordinates
uxul-world::bottom uxul-world::moving-enemy
uxul-world::collision uxul-world::game-object uxul-world::player
uxul-world::room uxul-world::stone uxul-world::xy-coordinates
uxul-world::bottom uxul-world::moving-enemy