diff options
Diffstat (limited to 'tools/buildzip.pl')
-rwxr-xr-x | tools/buildzip.pl | 44 |
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 | ||
63 | my $firmdir="$ROOT/firmware"; | 63 | my $firmdir="$ROOT/firmware"; |
64 | my $appsdir="$ROOT/apps"; | ||
65 | my $viewer_bmpdir="$ROOT/apps/plugins/bitmaps/viewer_defaults"; | ||
64 | 66 | ||
65 | my $cppdef = $target; | 67 | my $cppdef = $target; |
66 | 68 | ||
@@ -72,8 +74,17 @@ sub gettargetinfo { | |||
72 | #ifdef HAVE_LCD_BITMAP | 74 | #ifdef HAVE_LCD_BITMAP |
73 | Bitmap: yes | 75 | Bitmap: yes |
74 | Depth: LCD_DEPTH | 76 | Depth: LCD_DEPTH |
77 | Icon Width: CONFIG_DEFAULT_ICON_WIDTH | ||
78 | Icon Height: CONFIG_DEFAULT_ICON_HEIGHT | ||
75 | #endif | 79 | #endif |
76 | Codec: CONFIG_CODEC | 80 | Codec: CONFIG_CODEC |
81 | #ifdef HAVE_REMOTE_LCD | ||
82 | Remote Depth: LCD_REMOTE_DEPTH | ||
83 | Remote Icon Width: CONFIG_REMOTE_DEFAULT_ICON_WIDTH | ||
84 | Remote Icon Height: CONFIG_REMOTE_DEFAULT_ICON_WIDTH | ||
85 | #else | ||
86 | Remote Depth: 0 | ||
87 | #endif | ||
77 | STOP | 88 | STOP |
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 | ||
107 | sub filesize { | 136 | sub filesize { |
@@ -130,7 +159,8 @@ sub buildlangs { | |||
130 | sub buildzip { | 159 | sub 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) { |