forked from len0rd/rockbox
prevent useless file reads
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15695 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
51923703fd
commit
cb62c97054
1 changed files with 15 additions and 6 deletions
|
@ -974,10 +974,14 @@ static void viewer_top(void)
|
|||
{
|
||||
/* Read top of file into buffer
|
||||
and point screen pointer to top */
|
||||
file_pos = 0;
|
||||
buffer_end = BUFFER_END(); /* Update whenever file_pos changes */
|
||||
if (file_pos != 0)
|
||||
{
|
||||
file_pos = 0;
|
||||
buffer_end = BUFFER_END(); /* Update whenever file_pos changes */
|
||||
fill_buffer(0, buffer, BUFFER_SIZE);
|
||||
}
|
||||
|
||||
screen_top_ptr = buffer;
|
||||
fill_buffer(0, buffer, BUFFER_SIZE);
|
||||
}
|
||||
|
||||
static void viewer_bottom(void)
|
||||
|
@ -995,10 +999,15 @@ static void viewer_bottom(void)
|
|||
else {
|
||||
last_sectors = 0;
|
||||
}
|
||||
file_pos = last_sectors;
|
||||
buffer_end = BUFFER_END(); /* Update whenever file_pos changes */
|
||||
|
||||
if (file_pos != last_sectors)
|
||||
{
|
||||
file_pos = last_sectors;
|
||||
buffer_end = BUFFER_END(); /* Update whenever file_pos changes */
|
||||
fill_buffer(last_sectors, buffer, BUFFER_SIZE);
|
||||
}
|
||||
|
||||
screen_top_ptr = buffer_end-1;
|
||||
fill_buffer(last_sectors, buffer, BUFFER_SIZE);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue