aboutsummaryrefslogtreecommitdiff
path: root/script.cpp
diff options
context:
space:
mode:
authorLudvig Strigeus2001-12-04 10:44:33 +0000
committerLudvig Strigeus2001-12-04 10:44:33 +0000
commit761fe5d7bd92f7224fe12b4cdf912b55ef1fb768 (patch)
tree1e914700c1f00cabdf0eaad4930d0f0406c530ac /script.cpp
parentaa16d391989156027b627962123221aa7268f487 (diff)
downloadscummvm-rg350-761fe5d7bd92f7224fe12b4cdf912b55ef1fb768.tar.gz
scummvm-rg350-761fe5d7bd92f7224fe12b4cdf912b55ef1fb768.tar.bz2
scummvm-rg350-761fe5d7bd92f7224fe12b4cdf912b55ef1fb768.zip
* better drawBox (tnx sam_k)
* more params allowed for soundKludge opcode (8 instead of 16) will perhaps fix bugs. svn-id: r3523
Diffstat (limited to 'script.cpp')
-rw-r--r--script.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/script.cpp b/script.cpp
index 620c20af1e..193abe5635 100644
--- a/script.cpp
+++ b/script.cpp
@@ -380,7 +380,7 @@ void Scumm::setResult(int value) {
void Scumm::drawBox(int x, int y, int x2, int y2, int color) {
int top,bottom,count;
VirtScreen *vs;
- byte *backbuff;
+ byte *backbuff, *bgbuff;
if ((vs=findVirtScreen(y)) == NULL)
return;
@@ -407,11 +407,18 @@ void Scumm::drawBox(int x, int y, int x2, int y2, int color) {
backbuff = getResourceAddress(rtBuffer, vs->number+1) + vs->xstart + (y-top)*320 + x;
- count = y2 - y;
- while (count) {
- memset(backbuff, color, x2 - x);
- backbuff += 320;
- count--;
+ if (color==-1) {
+ if(vs->number!=0)
+ error("can only copy bg to main window");
+ bgbuff = getResourceAddress(rtBuffer, vs->number+5) + vs->xstart + (y-top)*320 + x;
+ blit(backbuff, bgbuff, x2 - x, y2 - y);
+ } else {
+ count = y2 - y;
+ while (count) {
+ memset(backbuff, color, x2 - x);
+ backbuff += 320;
+ count--;
+ }
}
}