summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/buildzip.pl44
1 files changed, 41 insertions, 3 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index 380c3a41e2..1dc33979af 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -61,6 +61,8 @@ while(1) {
61 61
62 62
63my $firmdir="$ROOT/firmware"; 63my $firmdir="$ROOT/firmware";
64my $appsdir="$ROOT/apps";
65my $viewer_bmpdir="$ROOT/apps/plugins/bitmaps/viewer_defaults";
64 66
65my $cppdef = $target; 67my $cppdef = $target;
66 68
@@ -72,8 +74,17 @@ sub gettargetinfo {
72#ifdef HAVE_LCD_BITMAP 74#ifdef HAVE_LCD_BITMAP
73Bitmap: yes 75Bitmap: yes
74Depth: LCD_DEPTH 76Depth: LCD_DEPTH
77Icon Width: CONFIG_DEFAULT_ICON_WIDTH
78Icon Height: CONFIG_DEFAULT_ICON_HEIGHT
75#endif 79#endif
76Codec: CONFIG_CODEC 80Codec: CONFIG_CODEC
81#ifdef HAVE_REMOTE_LCD
82Remote Depth: LCD_REMOTE_DEPTH
83Remote Icon Width: CONFIG_REMOTE_DEFAULT_ICON_WIDTH
84Remote Icon Height: CONFIG_REMOTE_DEFAULT_ICON_WIDTH
85#else
86Remote Depth: 0
87#endif
77STOP 88STOP
78; 89;
79 close(GCC); 90 close(GCC);
@@ -84,7 +95,9 @@ STOP
84 95
85 open(TARGET, "$c|"); 96 open(TARGET, "$c|");
86 97
87 my ($bitmap, $depth, $swcodec); 98 my ($bitmap, $depth, $swcodec, $icon_h, $icon_w);
99 my ($remote_depth, $remote_icon_h, $remote_icon_w);
100 $icon_count = 1;
88 while(<TARGET>) { 101 while(<TARGET>) {
89 # print STDERR "DATA: $_"; 102 # print STDERR "DATA: $_";
90 if($_ =~ /^Bitmap: (.*)/) { 103 if($_ =~ /^Bitmap: (.*)/) {
@@ -93,15 +106,31 @@ STOP
93 elsif($_ =~ /^Depth: (\d*)/) { 106 elsif($_ =~ /^Depth: (\d*)/) {
94 $depth = $1; 107 $depth = $1;
95 } 108 }
109 elsif($_ =~ /^Icon Width: (\d*)/) {
110 $icon_w = $1;
111 }
112 elsif($_ =~ /^Icon Height: (\d*)/) {
113 $icon_h = $1;
114 }
96 elsif($_ =~ /^Codec: (\d*)/) { 115 elsif($_ =~ /^Codec: (\d*)/) {
97 # SWCODEC is 1, the others are HWCODEC 116 # SWCODEC is 1, the others are HWCODEC
98 $swcodec = ($1 == 1); 117 $swcodec = ($1 == 1);
99 } 118 }
119 elsif($_ =~ /^Remote Depth: (\d*)/) {
120 $remote_depth = $1;
121 }
122 elsif($_ =~ /^Remote Icon Width: (\d*)/) {
123 $remote_icon_w = $1;
124 }
125 elsif($_ =~ /^Remote Icon Height: (\d*)/) {
126 $remote_icon_h = $1;
127 }
100 } 128 }
101 close(TARGET); 129 close(TARGET);
102 unlink("gcctemp"); 130 unlink("gcctemp");
103 131
104 return ($bitmap, $depth, $swcodec); 132 return ($bitmap, $depth, $icon_w, $icon_h,
133 $swcodec, $remote_depth, $remote_icon_w, $remote_icon_h);
105} 134}
106 135
107sub filesize { 136sub filesize {
@@ -130,7 +159,8 @@ sub buildlangs {
130sub buildzip { 159sub buildzip {
131 my ($zip, $image, $fonts)=@_; 160 my ($zip, $image, $fonts)=@_;
132 161
133 my ($bitmap, $depth, $swcodec) = &gettargetinfo(); 162 my ($bitmap, $depth, $icon_w, $icon_h, $swcodec,
163 $remote_depth, $remote_icon_w, $remote_icon_h) = &gettargetinfo();
134 164
135 # print "Bitmap: $bitmap\nDepth: $depth\nSwcodec: $swcodec\n"; 165 # print "Bitmap: $bitmap\nDepth: $depth\nSwcodec: $swcodec\n";
136 166
@@ -261,6 +291,14 @@ sub buildzip {
261 } 291 }
262 close VIEWERS; 292 close VIEWERS;
263 293
294 if ($bitmap) {
295 mkdir ".rockbox/icons", 0777;
296 `cp $viewer_bmpdir/viewers.${icon_w}x${icon_h}x$depth.bmp .rockbox/icons/viewers.bmp`;
297 if ($remote_depth) {
298 `cp $viewer_bmpdir/remote_viewers.${remote_icon_w}x${remote_icon_h}x$remote_depth.bmp .rockbox/icons/remote_viewers.bmp`;
299 }
300 }
301
264 `cp $ROOT/apps/tagnavi.config .rockbox/`; 302 `cp $ROOT/apps/tagnavi.config .rockbox/`;
265 303
266 if($bitmap) { 304 if($bitmap) {