mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 09:49:14 +00:00
VOYEUR: Get rid of some magic values
This commit is contained in:
parent
38f90feaa5
commit
dd16e5f91c
@ -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;
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user