[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/data gen-scrfile.scm,1.3,1.4
From: |
Ingo Ruhnke |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/data gen-scrfile.scm,1.3,1.4 |
Date: |
Wed, 22 Oct 2003 14:12:19 +0200 |
Update of /var/lib/cvs/Games/Pingus/data
In directory dark:/tmp/cvs-serv14708
Modified Files:
gen-scrfile.scm
Log Message:
- changed script to generate .xml
Index: gen-scrfile.scm
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/data/gen-scrfile.scm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gen-scrfile.scm 14 Apr 2003 17:56:35 -0000 1.3
+++ gen-scrfile.scm 22 Oct 2003 12:12:17 -0000 1.4
@@ -58,7 +58,7 @@
(equal? (stat:type (stat file)) 'directory))
(define (indent level)
- (make-string (* 4 level) #\space))
+ (make-string (* 2 level) #\space))
(define (cut-extension filename)
(substring filename 0 (- (string-length filename) 4)))
@@ -75,30 +75,36 @@
(not (equal? (string-ref el 0) #\.))))
lst)))
(for-each (lambda (el)
- (println-port port (indent (1+ level)) (cut-extension el)
- " = ../" path "/" el " (type=surface);"))
+ (println-port port
+ (indent (1+ level))
+ "<sprite name=\"" (cut-extension el) "\">\n"
+ (indent (+ 2 level))
+ "<image file=\"" path "/" el "\"/>\n"
+ (indent (1+ level))"</sprite>\n"
+ ))
images)
(for-each (lambda (el)
- (println-port port (indent level) "section " el "\n{")
+ (println-port port (indent level) "<section name=\"" el "\">")
(dirtree2scr port (1+ level) (string-append path "/" el))
- (println-port port (indent level) "}\n"))
- directories))
- (if (= level 0)
- (println-port port"// EOF //")))
+ (println-port port (indent level) "</section>"))
+ directories)))
(define (create-scr-file filename directory)
(let ((port (open-output-file filename)))
- (println-port port "// Automatic generated by gen-scrfile.scm - don't edit
by hand!\n")
- (dirtree2scr port 0 directory)
+ (println-port port "<?xml version=\"1.0\"?>\n")
+ (println-port port "<!-- Automatic generated by gen-scrfile.scm - don't
edit by hand! -->\n")
+ (println-port port"<resources>")
+ (dirtree2scr port 1 directory)
+ (println-port port"</resources>")
(close port)))
(define (main args)
- (create-scr-file "data/groundpieces-ground.scr" "images/groundpieces/ground")
- (create-scr-file "data/groundpieces-solid.scr" "images/groundpieces/solid")
- (create-scr-file "data/groundpieces-remove.scr" "images/groundpieces/remove")
- (create-scr-file "data/groundpieces-transparent.scr"
"images/groundpieces/transparent")
- (create-scr-file "data/groundpieces-bridge.scr" "images/groundpieces/bridge")
- (create-scr-file "data/hotspots.scr" "images/hotspots"))
+ (create-scr-file "data/groundpieces-ground.xml" "images/groundpieces/ground")
+ (create-scr-file "data/groundpieces-solid.xml" "images/groundpieces/solid")
+ (create-scr-file "data/groundpieces-remove.xml" "images/groundpieces/remove")
+ (create-scr-file "data/groundpieces-transparent.xml"
"images/groundpieces/transparent")
+ (create-scr-file "data/groundpieces-bridge.xml" "images/groundpieces/bridge")
+ (create-scr-file "data/hotspots.xml" "images/hotspots"))
;; EOF ;;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/data gen-scrfile.scm,1.3,1.4,
Ingo Ruhnke <=