aboutsummaryrefslogtreecommitdiff
path: root/sword2/driver/menu.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-08-21 11:42:27 +0000
committerTorbjörn Andersson2003-08-21 11:42:27 +0000
commit255c7ae5ff8c8f526de349246cdaf73506a85e81 (patch)
treebf2169c4c4a1f382a531eb0fb3a74cbf907c69c6 /sword2/driver/menu.cpp
parentbfefcc3567748e8dadd0eb8d879572f1996a4567 (diff)
downloadscummvm-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/driver/menu.cpp')
-rw-r--r--sword2/driver/menu.cpp41
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);
}
}