aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/file_v2d.cpp
diff options
context:
space:
mode:
authorArnaud Boutonné2011-01-23 00:05:52 +0000
committerArnaud Boutonné2011-01-23 00:05:52 +0000
commit3f6496d5b5b2caf0b935b27bca557ae53a880302 (patch)
tree0b1da465ca9b7c1787ab73865366df4e4c89c721 /engines/hugo/file_v2d.cpp
parent257a6b2e6d432cd343e213218474a61f61a72980 (diff)
downloadscummvm-rg350-3f6496d5b5b2caf0b935b27bca557ae53a880302.tar.gz
scummvm-rg350-3f6496d5b5b2caf0b935b27bca557ae53a880302.tar.bz2
scummvm-rg350-3f6496d5b5b2caf0b935b27bca557ae53a880302.zip
HUGO: Cleanup
Suppress almost all defines, rename constants svn-id: r55451
Diffstat (limited to 'engines/hugo/file_v2d.cpp')
-rw-r--r--engines/hugo/file_v2d.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp
index d7d4593945..a935977a7e 100644
--- a/engines/hugo/file_v2d.cpp
+++ b/engines/hugo/file_v2d.cpp
@@ -34,7 +34,6 @@
#include "hugo/hugo.h"
#include "hugo/file.h"
-#include "hugo/global.h"
#include "hugo/schedule.h"
#include "hugo/display.h"
#include "hugo/util.h"
@@ -118,15 +117,15 @@ void FileManager_v2d::readOverlay(int screenNum, image_pt image, ovl_t overlayTy
uint32 i = 0;
switch (overlayType) {
- case BOUNDARY:
+ case kOvlBoundary:
_sceneryArchive1.seek(sceneBlock.b_off, SEEK_SET);
i = sceneBlock.b_len;
break;
- case OVERLAY:
+ case kOvlOverlay:
_sceneryArchive1.seek(sceneBlock.o_off, SEEK_SET);
i = sceneBlock.o_len;
break;
- case OVLBASE:
+ case kOvlBase:
_sceneryArchive1.seek(sceneBlock.ob_off, SEEK_SET);
i = sceneBlock.ob_len;
break;
@@ -135,7 +134,7 @@ void FileManager_v2d::readOverlay(int screenNum, image_pt image, ovl_t overlayTy
break;
}
if (i == 0) {
- for (i = 0; i < OVL_SIZE; i++)
+ for (i = 0; i < kOvlSize; i++)
image[i] = 0;
return;
}
@@ -155,7 +154,7 @@ void FileManager_v2d::readOverlay(int screenNum, image_pt image, ovl_t overlayTy
for (i = 0; i < (byte)(-data + 1); i++, k++)
*tmpImage++ = j;
}
- } while (k < OVL_SIZE);
+ } while (k < kOvlSize);
}
/**
@@ -163,6 +162,7 @@ void FileManager_v2d::readOverlay(int screenNum, image_pt image, ovl_t overlayTy
*/
char *FileManager_v2d::fetchString(int index) {
debugC(1, kDebugFile, "fetchString(%d)", index);
+ static char buffer[kMaxBoxChar];
// Get offset to string[index] (and next for length calculation)
_stringArchive.seek((uint32)index * sizeof(uint32), SEEK_SET);
@@ -173,18 +173,18 @@ char *FileManager_v2d::fetchString(int index) {
error("An error has occurred: bad String offset");
// Check size of string
- if ((off2 - off1) >= MAX_BOX)
+ if ((off2 - off1) >= kMaxBoxChar)
error("Fetched string too long!");
// Position to string and read it into gen purpose _textBoxBuffer
_stringArchive.seek(off1, SEEK_SET);
- if (_stringArchive.read(_textBoxBuffer, (uint16)(off2 - off1)) == 0)
+ if (_stringArchive.read(buffer, (uint16)(off2 - off1)) == 0)
error("An error has occurred: fetchString");
// Null terminate, decode and return it
- _textBoxBuffer[off2-off1] = '\0';
- _vm->_scheduler->decodeString(_textBoxBuffer);
- return _textBoxBuffer;
+ buffer[off2-off1] = '\0';
+ _vm->_scheduler->decodeString(buffer);
+ return buffer;
}
} // End of namespace Hugo