diff options
author | Torbjörn Andersson | 2003-08-21 11:42:27 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-08-21 11:42:27 +0000 |
commit | 255c7ae5ff8c8f526de349246cdaf73506a85e81 (patch) | |
tree | bf2169c4c4a1f382a531eb0fb3a74cbf907c69c6 /sword2 | |
parent | bfefcc3567748e8dadd0eb8d879572f1996a4567 (diff) | |
download | scummvm-rg350-255c7ae5ff8c8f526de349246cdaf73506a85e81.tar.gz scummvm-rg350-255c7ae5ff8c8f526de349246cdaf73506a85e81.tar.bz2 scummvm-rg350-255c7ae5ff8c8f526de349246cdaf73506a85e81.zip |
When a menu icon reaches its full size it can be drawn directly, without
being run through the shrinker first.
svn-id: r9806
Diffstat (limited to 'sword2')
-rw-r--r-- | sword2/driver/menu.cpp | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/sword2/driver/menu.cpp b/sword2/driver/menu.cpp index 8f80bdc29f..9fe3d2ddb6 100644 --- a/sword2/driver/menu.cpp +++ b/sword2/driver/menu.cpp @@ -135,15 +135,15 @@ static uint8 pocketStatus[2][RDMENU_MAXPOCKETS] = { static uint8 iconCount = 0; int32 ProcessMenu(void) { - uint8 menu; - uint8 i; - uint8 complete; - uint8 frameCount; - int32 curx, xoff; - int32 cury, yoff; + uint8 menu; + uint8 i; + uint8 complete; + uint8 frameCount; + int32 curx, xoff; + int32 cury, yoff; ScummVM::Rect r; - int32 delta; - static int32 lastTime = 0; + int32 delta; + static int32 lastTime = 0; if (lastTime == 0) { lastTime = SVM_timeGetTime(); @@ -231,16 +231,21 @@ int32 ProcessMenu(void) { r.bottom = cury + yoff; } - if ((xoff != 0) && (yoff != 0)) { - SquashImage( - lpBackBuffer->_pixels + r.top * lpBackBuffer->_width + r.left, - lpBackBuffer->_width, - r.right - r.left, - r.bottom - r.top, - icons[menu][i], - RDMENU_ICONWIDE, - RDMENU_ICONWIDE, - RDMENU_ICONDEEP); + if (xoff != 0 && yoff != 0) { + byte *dst = lpBackBuffer->_pixels + r.top * lpBackBuffer->_width + r.left; + byte *src = icons[menu][i]; + + if (pocketStatus[menu][i] != MAXMENUANIMS) { + SquashImage( + dst, lpBackBuffer->_width, r.right - r.left, r.bottom - r.top, + src, RDMENU_ICONWIDE, RDMENU_ICONWIDE, RDMENU_ICONDEEP); + } else { + for (int j = 0; j < RDMENU_ICONDEEP; j++) { + memcpy(dst, src, RDMENU_ICONWIDE); + src += RDMENU_ICONWIDE; + dst += lpBackBuffer->_width; + } + } lpBackBuffer->upload(&r); } } |