diff options
author | James Brown | 2002-10-01 16:58:26 +0000 |
---|---|---|
committer | James Brown | 2002-10-01 16:58:26 +0000 |
commit | 969a74720c33df8f4ba1717d07bff74187b25c0d (patch) | |
tree | d09295019a9510c1c1b3bdbbf096d2a8f3cdacf4 /scumm/gfx.cpp | |
parent | 4d24a0bfbe389d498d281860415de5839635e37c (diff) | |
download | scummvm-rg350-969a74720c33df8f4ba1717d07bff74187b25c0d.tar.gz scummvm-rg350-969a74720c33df8f4ba1717d07bff74187b25c0d.tar.bz2 scummvm-rg350-969a74720c33df8f4ba1717d07bff74187b25c0d.zip |
Fix some faulty resource-validation logic to allow part of the fuel-tower to work.
svn-id: r5059
Diffstat (limited to 'scumm/gfx.cpp')
-rw-r--r-- | scumm/gfx.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index a655420662..c8fee3c146 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -2484,6 +2484,19 @@ void Scumm::palManipulateInit(int start, int end, int string_id, int time) byte *string1, *string2, *string3; int i; + string1 = getStringAddress(string_id); + string2 = getStringAddress(string_id + 1); + string3 = getStringAddress(string_id + 2); + if (!string1 || !string2 || !string3) { + warning("palManipulateInit(%d,%d,%d,%d): Cannot obtain string resources %d, %d and %d\n", + start, end, string_id, time, string_id, string_id + 1, string_id + 2); + return; + } + + string1+=start; + string2+=start; + string3+=start; + _palManipStart = start; _palManipEnd = end; _palManipCounter = 0; @@ -2497,15 +2510,6 @@ void Scumm::palManipulateInit(int start, int end, int string_id, int time) target = _palManipPalette + start * 3; between = _palManipIntermediatePal + start * 6; - string1 = getStringAddress(string_id) + start; - string2 = getStringAddress(string_id + 1) + start; - string3 = getStringAddress(string_id + 2) + start; - if (!string1 || !string2 || !string3) { - warning("palManipulateInit(%d,%d,%d,%d): Cannot obtain string resources %d, %d and %d\n", - start, end, string_id, time, string_id, string_id + 1, string_id + 2); - return; - } - for (i = start; i < end; ++i) { *target++ = *string1++; *target++ = *string2++; |