aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
authorStrangerke2014-03-14 08:08:31 +0100
committerStrangerke2014-03-14 08:08:31 +0100
commitdd16e5f91ca98f81ec5863e118e81cacf34e17ad (patch)
tree9e780f0422dd0aab6257c83fca19e9d81cd029fa /engines/voyeur
parent38f90feaa53d2e81e6047e22b1ca9ce7a3d191bd (diff)
downloadscummvm-rg350-dd16e5f91ca98f81ec5863e118e81cacf34e17ad.tar.gz
scummvm-rg350-dd16e5f91ca98f81ec5863e118e81cacf34e17ad.tar.bz2
scummvm-rg350-dd16e5f91ca98f81ec5863e118e81cacf34e17ad.zip
VOYEUR: Get rid of some magic values
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/files.cpp20
-rw-r--r--engines/voyeur/files.h3
-rw-r--r--engines/voyeur/graphics.cpp8
-rw-r--r--engines/voyeur/voyeur.cpp2
-rw-r--r--engines/voyeur/voyeur_game.cpp12
5 files changed, 23 insertions, 22 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp
index 3e86f43fc8..0a8a423604 100644
--- a/engines/voyeur/files.cpp
+++ b/engines/voyeur/files.cpp
@@ -738,12 +738,12 @@ RectResource::RectResource(int x1, int y1, int x2, int y2) {
DisplayResource::DisplayResource() {
_vm = NULL;
- _flags = 0;
+ _flags = DISPFLAG_NONE;
}
DisplayResource::DisplayResource(VoyeurEngine *vm) {
_vm = vm;
- _flags = 0;
+ _flags = DISPFLAG_NONE;
}
void DisplayResource::sFillBox(int width, int height) {
@@ -752,7 +752,7 @@ void DisplayResource::sFillBox(int width, int height) {
_vm->_graphicsManager->_saveBack = false;
PictureResource pr;
- pr._flags = 1;
+ pr._flags = DISPFLAG_1;
pr._select = 0xff;
pr._pick = 0;
pr._onOff = _vm->_graphicsManager->_drawPtr->_penColor;
@@ -846,7 +846,7 @@ int DisplayResource::drawText(const Common::String &msg) {
break;
}
- if (!(fontInfo._fontFlags & 3)) {
+ if (!(fontInfo._fontFlags & (DISPFLAG_1 | DISPFLAG_2))) {
viewPort->_fontRect.left = xp;
viewPort->_fontRect.top = yp;
viewPort->_fontRect.setWidth(msgWidth);
@@ -861,7 +861,7 @@ int DisplayResource::drawText(const Common::String &msg) {
pos.x = xp;
pos.y = yp;
- if (fontInfo._fontFlags & 4) {
+ if (fontInfo._fontFlags & DISPFLAG_4) {
if (fontInfo._shadow.x <= 0) {
viewPort->_fontRect.left += fontInfo._shadow.x;
viewPort->_fontRect.right -= fontInfo._shadow.x * 2;
@@ -942,7 +942,7 @@ int DisplayResource::drawText(const Common::String &msg) {
if (i != 0) {
fontChar._pick = 0;
fontChar._onOff = fontInfo._shadowColor;
- } else if (fontData._fontDepth == 1 || (fontInfo._fontFlags & 0x10)) {
+ } else if (fontData._fontDepth == 1 || (fontInfo._fontFlags & DISPFLAG_10)) {
fontChar._pick = 0;
fontChar._onOff = fontInfo._foreColor;
} else {
@@ -1120,7 +1120,7 @@ PictureResource::PictureResource(BoltFilesState &state, const byte *src):
}
PictureResource::PictureResource(Graphics::Surface *surface) {
- _flags = 0;
+ _flags = DISPFLAG_NONE;
_select = 0;
_pick = 0;
_onOff = 0;
@@ -1134,7 +1134,7 @@ PictureResource::PictureResource(Graphics::Surface *surface) {
}
PictureResource::PictureResource() {
- _flags = 0;
+ _flags = DISPFLAG_NONE;
_select = 0;
_pick = 0;
_onOff = 0;
@@ -1468,11 +1468,11 @@ FontInfoResource::FontInfoResource(BoltFilesState &state, const byte *src) {
FontInfoResource::FontInfoResource() {
_curFont = NULL;
- _picFlags = 3;
+ _picFlags = DISPFLAG_1 | DISPFLAG_2;
_picSelect = 0xff;
_picPick = 0xff;
_picOnOff = 0;
- _fontFlags = 0;
+ _fontFlags = DISPFLAG_NONE;
_justify = ALIGN_LEFT;
_fontSaveBack = 0;
_justifyWidth = 1;
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index 16d27fb3f6..0e736c9c08 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -234,7 +234,8 @@ enum DisplayFlag { DISPFLAG_1 = 1, DISPFLAG_2 = 2, DISPFLAG_4 = 4, DISPFLAG_8 =
DISPFLAG_10 = 0x10, DISPFLAG_20 = 0x20, DISPFLAG_40 = 0x40, DISPFLAG_80 = 0x80,
DISPFLAG_100 = 0x100, DISPFLAG_200 = 0x200, DISPFLAG_400 = 0x400,
DISPFLAG_800 = 0x800, DISPFLAG_1000 = 0x1000, DISPFLAG_2000 = 0x2000,
- DISPFLAG_4000 = 0x4000, DISPFLAG_VIEWPORT = 0x8000, DISPFLAG_CURSOR = 0x10000 };
+ DISPFLAG_4000 = 0x4000, DISPFLAG_VIEWPORT = 0x8000, DISPFLAG_CURSOR = 0x10000,
+ DISPFLAG_NONE = 0};
class DisplayResource {
private:
diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp
index acf0b273f8..f756b9cc85 100644
--- a/engines/voyeur/graphics.cpp
+++ b/engines/voyeur/graphics.cpp
@@ -48,7 +48,7 @@ GraphicsManager::GraphicsManager(VoyeurEngine *vm) : _defaultDrawInfo(1, Common:
_vPort = NULL;
_fontPtr = NULL;
Common::fill(&_VGAColors[0], &_VGAColors[PALETTE_SIZE], 0);
- _fontChar = new PictureResource(0, 0xff, 0xff, 0, Common::Rect(), 0, NULL, 0);
+ _fontChar = new PictureResource(DISPFLAG_NONE, 0xff, 0xff, 0, Common::Rect(), 0, NULL, 0);
_backColors = nullptr;
}
@@ -65,7 +65,7 @@ GraphicsManager::~GraphicsManager() {
void GraphicsManager::setupMCGASaveRect(ViewPortResource *viewPort) {
if (viewPort->_activePage) {
- viewPort->_activePage->_flags |= 1;
+ viewPort->_activePage->_flags |= DISPFLAG_1;
Common::Rect *clipRect = _clipPtr;
_clipPtr = &viewPort->_clipRect;
@@ -219,7 +219,7 @@ void GraphicsManager::sDrawPic(DisplayResource *srcDisplay, DisplayResource *des
widthDiff2 = destPic->_bounds.width() - width2;
if (destViewPort) {
- if (!_saveBack || ((srcPic->_flags & DISPFLAG_800) != 0)) {
+ if (!_saveBack || (srcPic->_flags & DISPFLAG_800)) {
backBounds.left = destPic->_bounds.left + offset.x;
backBounds.top = destPic->_bounds.top + offset.y;
backBounds.setWidth(width2);
@@ -864,7 +864,7 @@ void GraphicsManager::fillPic(DisplayResource *display, byte onOff) {
}
PictureResource picResource;
- picResource._flags = 0;
+ picResource._flags = DISPFLAG_NONE;
picResource._select = 0xff;
picResource._pick = 0;
picResource._onOff = onOff;
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index 4b4ff9df8a..6f39be4b6d 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -271,7 +271,7 @@ bool VoyeurEngine::doLock() {
_graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x708)._fontResource;
_graphicsManager->_fontPtr->_fontSaveBack = 0;
- _graphicsManager->_fontPtr->_fontFlags = 0;
+ _graphicsManager->_fontPtr->_fontFlags = DISPFLAG_NONE;
Common::String dateString = "ScummVM";
Common::String displayString = Common::String::format("Last Play %s", dateString.c_str());
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index 91bc429268..a6564c32ba 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -292,7 +292,7 @@ void VoyeurEngine::doClosingCredits() {
_graphicsManager->_fontPtr->_foreColor = 2;
_graphicsManager->_fontPtr->_backColor = 2;
_graphicsManager->_fontPtr->_fontSaveBack = false;
- _graphicsManager->_fontPtr->_fontFlags = 0;
+ _graphicsManager->_fontPtr->_fontFlags = DISPFLAG_NONE;
_soundManager->startVOCPlay(152);
FontInfoResource &fi = *_graphicsManager->_fontPtr;
@@ -398,7 +398,7 @@ void VoyeurEngine::doPiracy() {
fi._foreColor = 2;
fi._backColor = 2;
fi._fontSaveBack = false;
- fi._fontFlags = 0;
+ fi._fontFlags = DISPFLAG_NONE;
fi._justify = ALIGN_CENTER;
fi._justifyWidth = 384;
fi._justifyHeight = 230;
@@ -460,7 +460,7 @@ void VoyeurEngine::reviewTape() {
_eventsManager->_intPtr._hasPalette = true;
_graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x909)._fontResource;
_graphicsManager->_fontPtr->_fontSaveBack = false;
- _graphicsManager->_fontPtr->_fontFlags = 0;
+ _graphicsManager->_fontPtr->_fontFlags = DISPFLAG_NONE;
_eventsManager->getMouseInfo();
if (newX == -1) {
@@ -489,7 +489,7 @@ void VoyeurEngine::reviewTape() {
int yp = 45;
int eventNum = eventStart;
for (int lineNum = 0; lineNum < 8 && eventNum < _voy->_eventCount; ++lineNum, ++eventNum) {
- _graphicsManager->_fontPtr->_picFlags = 0;
+ _graphicsManager->_fontPtr->_picFlags = DISPFLAG_NONE;
_graphicsManager->_fontPtr->_picSelect = 0xff;
_graphicsManager->_fontPtr->_picPick = 7;
_graphicsManager->_fontPtr->_picOnOff = (lineNum == eventLine) ? 8 : 0;
@@ -551,7 +551,7 @@ void VoyeurEngine::reviewTape() {
int yp = 45;
int eventNum = eventStart;
for (int idx = 0; idx < 8 && eventNum < _voy->_eventCount; ++idx, ++eventNum) {
- _graphicsManager->_fontPtr->_picFlags = 0;
+ _graphicsManager->_fontPtr->_picFlags = DISPFLAG_NONE;
_graphicsManager->_fontPtr->_picSelect = 0xff;
_graphicsManager->_fontPtr->_picPick = 7;
_graphicsManager->_fontPtr->_picOnOff = (idx == eventLine) ? 8 : 0;
@@ -1171,7 +1171,7 @@ int VoyeurEngine::doComputerText(int maxLen) {
font._curFont = _bVoy->boltEntry(0x4910)._fontResource;
font._foreColor = 129;
font._fontSaveBack = false;
- font._fontFlags = 0;
+ font._fontFlags = DISPFLAG_NONE;
if (_voy->_vocSecondsOffset > 60)
_voy->_vocSecondsOffset = 0;