diff options
-rw-r--r-- | catbird/asset.scm | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/catbird/asset.scm b/catbird/asset.scm index 72f46df..71d9b6a 100644 --- a/catbird/asset.scm +++ b/catbird/asset.scm @@ -23,6 +23,9 @@ (define-module (catbird asset) #:use-module (catbird config) #:use-module (catbird inotify) + #:use-module (chickadee audio) + #:use-module (chickadee graphics text) + #:use-module (chickadee graphics texture) #:use-module (ice-9 match) #:use-module (oop goops) #:export (<asset> @@ -36,6 +39,10 @@ unsubscribe on-asset-refresh define-asset + define-font + define-image + define-tileset + define-audio reload-modified-assets <asset-container>)) @@ -168,7 +175,7 @@ ;;; Syntax ;;; -(define-syntax-rule (define-asset name ((var file-name) ...) body ...) +(define-syntax-rule (define-asset (name (var file-name) ...) body ...) (define name (let ((file-names (list file-name ...)) (proc (lambda (var ...) body ...))) @@ -182,6 +189,22 @@ #:file-names file-names #:loader proc))))) +(define-syntax-rule (define-font name file-name size args ...) + (define-asset (name (f file-name)) + (load-font f size args ...))) + +(define-syntax-rule (define-image name file-name args ...) + (define-asset (name (f file-name)) + (load-image f args ...))) + +(define-syntax-rule (define-tileset name file-name tw th args ...) + (define-asset (name (f file-name)) + (load-tileset f tw th args ...))) + +(define-syntax-rule (define-audio name file-name args ...) + (define-asset (name (f file-name)) + (load-audio f args ...))) + ;;; ;;; Asset Metaclass |