]> de.git.xonotic.org Git - xonotic/mediasource.git/blob - gfx/menu/luminos_versionbuilder/all2tga.scm
Loading screen tip messages (most taken from server/help.cfg) and a few tiny tweaks
[xonotic/mediasource.git] / gfx / menu / luminos_versionbuilder / all2tga.scm
1 ;Converts image files to .tga
2 ;In:  FilesIn (wildcard * possible)
3 ;     Compress (using RLE algorithm, 0=no, 1=yes)
4 ;Out: tga files with same name as input (overwrites tga input files)
5
6 (define (all2tga filesIn compress)
7         (let*
8         (
9             (fileList (cadr (file-glob filesIn 1)))
10         )
11
12         (while (not (null? fileList))
13             (let*
14                 (
15                     (file (car fileList))
16                     (image (car (gimp-file-load 1 file file)))
17                     (drawable (car (gimp-image-get-active-layer image)))
18                 )
19
20                 ;Set extension to .tga
21                         (set! file (car (strbreakup file ".")))
22                         (set! file (string-append file ".tga")) 
23
24                 ;Save image as RLE compressed tga
25                         (set! drawable (car (gimp-image-merge-visible-layers image 1)))
26                         (file-tga-save 1 image drawable file file compress 0)
27                 (gimp-image-delete image)
28
29                 (set! fileList (cdr fileList))
30             )
31             )
32     )
33 )