summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2013-07-17 21:43:18 -0400
committerDavid Thompson <dthompson2@worcester.edu>2013-07-17 21:43:18 -0400
commit35a350a8b2728025c5d3aaa6cc50b969ff9c8414 (patch)
treea54ca9807129a1b104d84c8c9c57f88eaa47d298 /2d
parente13fd4b0f6a3ada466585c7865ba7479c9e54ed3 (diff)
Use rgba->gl-color in sprite module.
Diffstat (limited to '2d')
-rw-r--r--2d/sprite.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/2d/sprite.scm b/2d/sprite.scm
index 64a0240..2135c99 100644
--- a/2d/sprite.scm
+++ b/2d/sprite.scm
@@ -30,6 +30,7 @@
#:use-module (figl contrib packed-struct)
#:use-module ((sdl sdl) #:prefix SDL:)
#:use-module (2d vector)
+ #:use-module (2d helpers)
#:export (make-texture
texture?
texture-id
@@ -236,13 +237,14 @@ size."
(vertices sprite-vertices set-sprite-vertices!))
(define* (make-sprite drawable #:optional #:key (position #(0 0)) (scale #(1 1))
- (rotation 0) (color '(1 1 1)) (anchor 'center))
+ (rotation 0) (color #xffffffff) (anchor 'center))
"Makes a new sprite object."
- (let ((vertices (make-packed-array sprite-vertex 4)))
+ (let ((vertices (make-packed-array sprite-vertex 4))
+ (color (rgba->gl-color color)))
(%make-sprite drawable position scale rotation color anchor vertices)))
(define* (load-sprite filename #:optional #:key (position #(0 0)) (scale #(1 1))
- (rotation 0) (color '(1 1 1)) (anchor 'center))
+ (rotation 0) (color #xffffffff) (anchor 'center))
"Loads a sprite from file."
(make-sprite (load-texture filename) #:position position #:scale scale
#:rotation rotation #:color color #:anchor anchor))