summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-16 19:15:17 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-16 19:15:17 +0000
commit576793a637bb924a6f2c2bacf684a82a93fd438f (patch)
tree4b435c01108452310ba5d6256e05d350d1576e96
parentc20801b71210daaed53d576be0ae7c24d04440df (diff)
downloadrockbox-576793a637bb924a6f2c2bacf684a82a93fd438f.tar.gz
rockbox-576793a637bb924a6f2c2bacf684a82a93fd438f.tar.bz2
rockbox-576793a637bb924a6f2c2bacf684a82a93fd438f.zip
Recalibrate the skin buffer size calculation so that targets with remote get a reasonable extra buffer (depending on the remote) instead of just doubling it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22352 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/skin_engine/skin_buffer.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/apps/gui/skin_engine/skin_buffer.c b/apps/gui/skin_engine/skin_buffer.c
index 2d10a931ec..750fec62b3 100644
--- a/apps/gui/skin_engine/skin_buffer.c
+++ b/apps/gui/skin_engine/skin_buffer.c
@@ -33,20 +33,37 @@
* tokens for both/all screens.
*
* This is mostly just copy/paste from firmware/buffer.c
+ *
+ *
+ * MAIN_ and REMOTE_BUFFER are just for reasonable size calibration,
+ * both screens can use the whole buffer as they need; it's not split
+ * between screens
*/
-#define IMG_BUFSIZE (((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \
- + (2*LCD_HEIGHT*LCD_WIDTH/8)) * NB_SCREENS)
-
-static unsigned char buffer_start[IMG_BUFSIZE], *buffer_pos = NULL;
-static size_t buf_size = IMG_BUFSIZE;
+
+#define MAIN_BUFFER ((LCD_HEIGHT*LCD_WIDTH*LCD_DEPTH/8) \
+ + (2*LCD_HEIGHT*LCD_WIDTH/8))
+
+#if (NB_SCREENS > 1)
+#define REMOTE_BUFFER ((LCD_REMOTE_HEIGHT*LCD_REMOTE_WIDTH*LCD_REMOTE_DEPTH/8) \
+ + (2*LCD_REMOTE_HEIGHT*LCD_REMOTE_WIDTH/8))
+#else
+#define REMOTE_BUFFER 0
+#endif
+
+
+#define SKIN_BUFFER_SIZE (MAIN_BUFFER + REMOTE_BUFFER)
+
+
+static unsigned char buffer_start[SKIN_BUFFER_SIZE], *buffer_pos = NULL;
+static size_t buf_size = SKIN_BUFFER_SIZE;
void skin_buffer_init(void)
{
#if 0 /* this will go in again later probably */
if (buffer_start == NULL)
{
- buf_size = IMG_BUFSIZE;/* global_settings.skin_buf_size */
+ buf_size = SKIN_BUFFER_SIZE;/* global_settings.skin_buf_size */
buffer_start = buffer_alloc(buf_size);
buffer_pos = buffer_start;