aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudvig Strigeus2001-11-10 23:30:12 +0000
committerLudvig Strigeus2001-11-10 23:30:12 +0000
commit27e55e52a9c5d269875506812860177d232c7517 (patch)
tree9dfd79badba19e1dc94f493183c1aeeeb76e2a38
parente924c81353394e9f625bea40713891bceb153ecf (diff)
downloadscummvm-rg350-27e55e52a9c5d269875506812860177d232c7517.tar.gz
scummvm-rg350-27e55e52a9c5d269875506812860177d232c7517.tar.bz2
scummvm-rg350-27e55e52a9c5d269875506812860177d232c7517.zip
verb bug fix,
expireresource bug fix svn-id: r3485
-rw-r--r--resource.cpp3
-rw-r--r--script_v1.cpp4
-rw-r--r--sdl.cpp4
-rw-r--r--windows.cpp14
4 files changed, 17 insertions, 8 deletions
diff --git a/resource.cpp b/resource.cpp
index f60d7d8671..f9cea74bed 100644
--- a/resource.cpp
+++ b/resource.cpp
@@ -721,7 +721,8 @@ void Scumm::expireResources(uint32 size) {
if (res.mode[i]) {
for(j=res.num[i]; --j>=0;) {
flag = res.flags[i][j];
- if (!(flag&0x80) && flag >= best_counter && !isResourceInUse(i,j)) {
+ if (!(flag&0x80) && flag >= best_counter
+ && res.address[i][j] && !isResourceInUse(i,j)) {
best_counter = flag;
best_type = i;
best_res = j;
diff --git a/script_v1.cpp b/script_v1.cpp
index a88672230e..3852d6e698 100644
--- a/script_v1.cpp
+++ b/script_v1.cpp
@@ -1695,8 +1695,8 @@ void Scumm::o5_verbOps() {
switch(_opcode&0x1F) {
case 1: /* load image */
a = getVarOrDirectWord(0x80);
- if (verb) {
- setVerbObject(_roomResource, a, verb);
+ if (slot) {
+ setVerbObject(_roomResource, a, slot);
vs->type = 1;
}
break;
diff --git a/sdl.cpp b/sdl.cpp
index dbceaacd31..8f255dab63 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -137,8 +137,10 @@ void waitForTimer(Scumm *s, int delay) {
}
}
- if (!(s->_fastMode&2))
+ if (!(s->_fastMode&2)) {
+ assert(delay<500);
SDL_Delay(delay*10);
+ }
}
#define MAX_DIRTY_RECTS 40
diff --git a/windows.cpp b/windows.cpp
index ca8bd73979..81290c0da6 100644
--- a/windows.cpp
+++ b/windows.cpp
@@ -145,6 +145,13 @@ byte veryFastMode;
void modifyslot(int sel, int what);
+int mapKey(int key) {
+ if (key>=VK_F1 && key<=VK_F9) {
+ return key - VK_F1 + 315;
+ }
+ return key;
+}
+
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
WndMan *wm = (WndMan*)GetWindowLong(hWnd, GWL_USERDATA);
@@ -157,10 +164,6 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
exit(0);
break;
- case WM_CHAR:
- wm->_scumm->_keyPressed = wParam;
- break;
-
case WM_KEYDOWN:
if (wParam>='0' && wParam<='9') {
wm->_scumm->_saveLoadSlot = wParam - '0';
@@ -189,6 +192,8 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
wm->_scumm->resourceStats();
}
}
+
+ wm->_scumm->_keyPressed = mapKey(wParam);
break;
case WM_MOUSEMOVE:
@@ -918,6 +923,7 @@ void updateScreen(Scumm *s) {
void waitForTimer(Scumm *s, int delay) {
wm->handleMessage();
if (!veryFastMode) {
+ assert(delay<500);
Sleep(delay*10);
}
}