diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-06-03 13:59:32 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-06-03 13:59:32 +0000 |
commit | a5555c08fee3c80374aaf40685b52ea5681ae744 (patch) | |
tree | 8101fd0ef13dab70a48ac5b3d64f2df3c59a6f60 /tools/buildtheme.pl | |
parent | bf3e50b89bccab5c64f23c1e54d3bbeb0994f7b2 (diff) | |
download | rockbox-a5555c08fee3c80374aaf40685b52ea5681ae744.tar.gz rockbox-a5555c08fee3c80374aaf40685b52ea5681ae744.tar.bz2 rockbox-a5555c08fee3c80374aaf40685b52ea5681ae744.zip |
copy the images for the skins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26513 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/buildtheme.pl')
-rwxr-xr-x | tools/buildtheme.pl | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/tools/buildtheme.pl b/tools/buildtheme.pl index 488a57d0ab..171adf2176 100755 --- a/tools/buildtheme.pl +++ b/tools/buildtheme.pl @@ -264,8 +264,9 @@ sub copyskin my @filelist; my $src; my $dest; + my $sizestring; - if($wpslist =~ /(.*)OUT/) { + if($wpslist =~ /(.*)WPSFILE/) { $dir = $1; # first try the actual filename given to us @@ -274,6 +275,10 @@ sub copyskin $src = "${dir}$skin.$ext"; if ( -e $src ) { + if ($skin =~ /\w\.(\d*x\d*x\d*).*/) + { + $sizestring = $1; + } my $cmd = "cp $src $rbdir/wps/$themename.$ext"; `$cmd`; } @@ -287,13 +292,13 @@ sub copyskin foreach my $d (@depthlist) { next if ($d > $depth); - $src = "${dir}$skin.${width}x${height}x${d}.$ext"; + $sizestring = "${width}x${height}x${d}"; + $src = "${dir}$skin.${sizestring}.$ext"; last if (-e $src); } if (-e $src) { my $cmd = "cp $src $rbdir/wps/$themename.$ext"; - print "$cmd\n"; `$cmd`; } elsif (-e "${dir}$skin.$ext") @@ -304,6 +309,35 @@ sub copyskin else { #print STDERR "buildtheme warning: No suitable skin file for $ext\n"; + return; + } + } + + open(WPSFILE, "$rbdir/wps/$themename.$ext"); + while (<WPSFILE>) { + $filelist[$#filelist + 1] = $1 if (/\|([^|]*?.bmp)\|/); + } + close(WPSFILE); + if ($#filelist >= 0) + { + my $file; + if ($sizestring && -e "$dir/$themename/$sizestring") + { + foreach $file (@filelist) + { + system("cp $dir/$themename/$sizestring/$file $rbdir/wps/$themename/"); + } + } + elsif (-e "$dir/$themename") + { + foreach $file (@filelist) + { + system("cp $dir/$themename/$file $rbdir/wps/$themename/"); + } + } + else + { + print STDERR "beep, no dir to copy WPS from!\n"; } } } |