mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
copy the images for the skins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26513 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bf3e50b89b
commit
a5555c08fe
1 changed files with 37 additions and 3 deletions
|
@ -264,8 +264,9 @@ sub copyskin
|
||||||
my @filelist;
|
my @filelist;
|
||||||
my $src;
|
my $src;
|
||||||
my $dest;
|
my $dest;
|
||||||
|
my $sizestring;
|
||||||
|
|
||||||
if($wpslist =~ /(.*)OUT/) {
|
if($wpslist =~ /(.*)WPSFILE/) {
|
||||||
$dir = $1;
|
$dir = $1;
|
||||||
|
|
||||||
# first try the actual filename given to us
|
# first try the actual filename given to us
|
||||||
|
@ -274,6 +275,10 @@ sub copyskin
|
||||||
$src = "${dir}$skin.$ext";
|
$src = "${dir}$skin.$ext";
|
||||||
if ( -e $src )
|
if ( -e $src )
|
||||||
{
|
{
|
||||||
|
if ($skin =~ /\w\.(\d*x\d*x\d*).*/)
|
||||||
|
{
|
||||||
|
$sizestring = $1;
|
||||||
|
}
|
||||||
my $cmd = "cp $src $rbdir/wps/$themename.$ext";
|
my $cmd = "cp $src $rbdir/wps/$themename.$ext";
|
||||||
`$cmd`;
|
`$cmd`;
|
||||||
}
|
}
|
||||||
|
@ -287,13 +292,13 @@ sub copyskin
|
||||||
foreach my $d (@depthlist)
|
foreach my $d (@depthlist)
|
||||||
{
|
{
|
||||||
next if ($d > $depth);
|
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);
|
last if (-e $src);
|
||||||
}
|
}
|
||||||
if (-e $src)
|
if (-e $src)
|
||||||
{
|
{
|
||||||
my $cmd = "cp $src $rbdir/wps/$themename.$ext";
|
my $cmd = "cp $src $rbdir/wps/$themename.$ext";
|
||||||
print "$cmd\n";
|
|
||||||
`$cmd`;
|
`$cmd`;
|
||||||
}
|
}
|
||||||
elsif (-e "${dir}$skin.$ext")
|
elsif (-e "${dir}$skin.$ext")
|
||||||
|
@ -304,6 +309,35 @@ sub copyskin
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#print STDERR "buildtheme warning: No suitable skin file for $ext\n";
|
#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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue