summaryrefslogtreecommitdiff
path: root/2d/texture.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-06-07 19:57:06 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-06-07 19:57:06 -0400
commitc2a4f0636569978a40cb5c98875d798624909eb2 (patch)
treeca0d993826c0adde719e3a88aec255626281340d /2d/texture.scm
parentdef69615603e49bb17b09c7352295578f9dd67af (diff)
Replace vector2 module with a more generic vector module.
* 2d/vector2.scm: Delete it. * 2d/vector.scm: New file. * Makefile.am (SOURCES): s/vector2/vector. * 2d/font.scm: * 2d/keyboard.scm: * 2d/mouse.scm: * 2d/rect.scm: * 2d/shader.scm: * 2d/sprite.scm: * 2d/texture.scm: * 2d/transform.scm: * 2d/window.scm: * examples/2048/2048: * examples/animation.scm: * examples/coroutine.scm: * examples/font.scm: * examples/particles.scm: * examples/simple.scm: * examples/tilemap.scm: Use vectors instead of defunct vector2.
Diffstat (limited to '2d/texture.scm')
-rw-r--r--2d/texture.scm20
1 files changed, 10 insertions, 10 deletions
diff --git a/2d/texture.scm b/2d/texture.scm
index 8dcbf95..bd7bea6 100644
--- a/2d/texture.scm
+++ b/2d/texture.scm
@@ -28,7 +28,7 @@
#:use-module (gl contrib packed-struct)
#:use-module (2d color)
#:use-module (2d helpers)
- #:use-module (2d vector2)
+ #:use-module (2d vector)
#:use-module (2d wrappers gl)
#:use-module (2d wrappers freeimage)
#:export (make-texture
@@ -156,7 +156,7 @@ that will be rendered, in pixels."
texture))
(define (anchor-texture texture anchor)
- "Return a vector2 of the coordinates for the center point of a
+ "Return a vector of the coordinates for the center point of a
texture."
(let ((w (texture-width texture))
(h (texture-height texture)))
@@ -164,20 +164,20 @@ texture."
((vector2? anchor)
anchor)
((eq? anchor 'center)
- (vector2 (/ w 2)
- (/ h 2)))
+ (vector (/ w 2)
+ (/ h 2)))
((eq? anchor 'top-left)
- null-vector2)
+ #(0 0))
((eq? anchor 'top-right)
- (vector2 w 0))
+ (vector w 0))
((eq? anchor 'bottom-left)
- (vector2 0 h))
+ (vector 0 h))
((eq? anchor 'bottom-right)
- (vector2 w h))
+ (vector w h))
((eq? anchor 'top-center)
- (vector2 (/ w 2) 0))
+ (vector (/ w 2) 0))
((eq? anchor 'bottom-center)
- (vector2 (/ w 2) h))
+ (vector (/ w 2) h))
(else
(error "Invalid anchor type!" anchor)))))