Merge pull request #83 from houqp/master

This should fix #78
This commit is contained in:
Dobrica Pavlinušić
2012-03-31 06:36:07 -07:00
2 changed files with 22 additions and 1 deletions

View File

@@ -150,6 +150,16 @@ static int einkUpdate(lua_State *L) {
ioctl(fb->fd, FBIO_EINK_UPDATE_DISPLAY_AREA, &myarea);
#else
// for now, we only do fullscreen blits in emulation mode
if (fxtype == 0) {
// simmulate a full screen update in eink screen
if(SDL_MUSTLOCK(fb->screen) && (SDL_LockSurface(fb->screen) < 0)) {
return luaL_error(L, "can't lock surface.");
}
SDL_FillRect(fb->screen, NULL, 0x000000);
if(SDL_MUSTLOCK(fb->screen)) SDL_UnlockSurface(fb->screen);
SDL_Flip(fb->screen);
}
if(SDL_MUSTLOCK(fb->screen) && (SDL_LockSurface(fb->screen) < 0)) {
return luaL_error(L, "can't lock surface.");
}

View File

@@ -187,6 +187,11 @@ function UniReader:initGlobalSettings(settings)
if cache_max_ttl then
self.cache_max_ttl = cache_max_ttl
end
local rcountmax = settings:readSetting("partial_refresh_count")
if rcountmax then
self.rcountmax = rcountmax
end
end
-- guarantee that we have enough memory in cache
@@ -523,7 +528,7 @@ function UniReader:show(no)
self:toggleTextHighLight(self.highlight[no])
end
if self.rcount == self.rcountmax then
if self.rcount >= self.rcountmax then
print("full refresh")
self.rcount = 1
fb:refresh(0)
@@ -1070,6 +1075,12 @@ function UniReader:addAllCommands()
unireader:showHighLight()
unireader:goto(unireader.pageno)
end)
self.commands:add(KEY_R, MOD_SHIFT, "R",
"manual full screen refresh",
function(unireader)
unireader.rcount = 1
fb:refresh(0)
end)
self.commands:add(KEY_HOME,nil,"Home",
"exit application",
function(unireader)