diff options
author | Eugene Sandulenko | 2019-11-24 18:17:02 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-24 18:17:02 +0000 |
commit | 991e7d447bd919934002858dad8e8cb4f9dd1eed (patch) | |
tree | dba26f312c2fea61a18928bd59cfe9e61c79c061 /engines | |
parent | 6a650e10b1fed68e52134f6959bda5f560eebe06 (diff) | |
download | scummvm-rg350-991e7d447bd919934002858dad8e8cb4f9dd1eed.tar.gz scummvm-rg350-991e7d447bd919934002858dad8e8cb4f9dd1eed.tar.bz2 scummvm-rg350-991e7d447bd919934002858dad8e8cb4f9dd1eed.zip |
DIRECTOR: Rename Cast class variables to follow our naming conventions
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/cachedmactext.cpp | 14 | ||||
-rw-r--r-- | engines/director/cast.cpp | 226 | ||||
-rw-r--r-- | engines/director/cast.h | 72 | ||||
-rw-r--r-- | engines/director/frame.cpp | 50 | ||||
-rw-r--r-- | engines/director/lingo/lingo-the.cpp | 12 | ||||
-rw-r--r-- | engines/director/score.cpp | 56 |
6 files changed, 215 insertions, 215 deletions
diff --git a/engines/director/cachedmactext.cpp b/engines/director/cachedmactext.cpp index a479376996..d9a0740f78 100644 --- a/engines/director/cachedmactext.cpp +++ b/engines/director/cachedmactext.cpp @@ -35,10 +35,10 @@ void CachedMacText::makeMacText() { delete _macText; - if ((int)_textCast->textAlign == -1) + if ((int)_textCast->_textAlign == -1) _align = (Graphics::TextAlign)3; else - _align = (Graphics::TextAlign)((int)_textCast->textAlign + 1); + _align = (Graphics::TextAlign)((int)_textCast->_textAlign + 1); _macText = new Graphics::MacText(_textCast->_ftext, _wm, @@ -62,17 +62,17 @@ CachedMacText::CachedMacText(TextCast *const textCast, _surface(NULL), _macFont(NULL), _macText(NULL), _width(defaultWidth), _dirty(true), _textCast(textCast), _wm(wm) { - _macFont = new Graphics::MacFont(_textCast->fontId, - _textCast->fontSize, - _textCast->textSlant); + _macFont = new Graphics::MacFont(_textCast->_fontId, + _textCast->_fontSize, + _textCast->_textSlant); // TODO destroy me if (_width == -1) { if (version >= 4) { // This came from frame.cpp - _width = _textCast->initialRect.right; + _width = _textCast->_initialRect.right; } else { - _width = _textCast->initialRect.width(); + _width = _textCast->_initialRect.width(); } } diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index a3950c0d54..d864b50bfc 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -29,35 +29,35 @@ namespace Director { BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 version) { if (version < 4) { - pitch = 0; - flags = stream.readByte(); - someFlaggyThing = stream.readUint16(); - initialRect = Score::readRect(stream); - boundingRect = Score::readRect(stream); - regY = stream.readUint16(); - regX = stream.readUint16(); - unk1 = unk2 = 0; - - if (someFlaggyThing & 0x8000) { - unk1 = stream.readUint16(); - unk2 = stream.readUint16(); + _pitch = 0; + _flags = stream.readByte(); + _someFlaggyThing = stream.readUint16(); + _initialRect = Score::readRect(stream); + _boundingRect = Score::readRect(stream); + _regY = stream.readUint16(); + _regX = stream.readUint16(); + _unk1 = _unk2 = 0; + + if (_someFlaggyThing & 0x8000) { + _unk1 = stream.readUint16(); + _unk2 = stream.readUint16(); } } else if (version == 4) { - pitch = stream.readUint16(); - pitch &= 0x0fff; + _pitch = stream.readUint16(); + _pitch &= 0x0fff; - flags = 0; - someFlaggyThing = 0; - unk1 = unk2 = 0; + _flags = 0; + _someFlaggyThing = 0; + _unk1 = _unk2 = 0; - initialRect = Score::readRect(stream); - boundingRect = Score::readRect(stream); - regX = stream.readUint16(); - regY = stream.readUint16(); + _initialRect = Score::readRect(stream); + _boundingRect = Score::readRect(stream); + _regX = stream.readUint16(); + _regY = stream.readUint16(); - bitsPerPixel = stream.readUint16(); - if (bitsPerPixel == 0) - bitsPerPixel = 1; + _bitsPerPixel = stream.readUint16(); + if (_bitsPerPixel == 0) + _bitsPerPixel = 1; int tail = 0; @@ -68,7 +68,7 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 warning("BitmapCast: %d bytes left", tail); } else if (version == 5) { - pitch = 0; + _pitch = 0; uint16 count = stream.readUint16(); for (uint16 cc = 0; cc < count; cc++) stream.readUint32(); @@ -78,46 +78,46 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 stream.readByte(); /*uint16 width =*/ stream.readUint16LE(); //maybe? - initialRect = Score::readRect(stream); + _initialRect = Score::readRect(stream); /*uint32 somethingElse =*/ stream.readUint32(); - boundingRect = Score::readRect(stream); + _boundingRect = Score::readRect(stream); - bitsPerPixel = stream.readUint16(); + _bitsPerPixel = stream.readUint16(); - regX = 0; - regY = 0; + _regX = 0; + _regY = 0; stream.readUint32(); } - modified = 0; - tag = castTag; + _modified = 0; + _tag = castTag; } TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { - borderSize = kSizeNone; - gutterSize = kSizeNone; - boxShadow = kSizeNone; - - flags1 = 0; - fontId = 0; - fontSize = 12; - textType = kTextTypeFixed; - textAlign = kTextAlignLeft; - textShadow = kSizeNone; - textSlant = 0; - palinfo1 = palinfo2 = palinfo3 = 0; + _borderSize = kSizeNone; + _gutterSize = kSizeNone; + _boxShadow = kSizeNone; + + _flags1 = 0; + _fontId = 0; + _fontSize = 12; + _textType = kTextTypeFixed; + _textAlign = kTextAlignLeft; + _textShadow = kSizeNone; + _textSlant = 0; + _palinfo1 = _palinfo2 = _palinfo3 = 0; if (version <= 3) { - flags1 = stream.readByte(); - borderSize = static_cast<SizeType>(stream.readByte()); - gutterSize = static_cast<SizeType>(stream.readByte()); - boxShadow = static_cast<SizeType>(stream.readByte()); - textType = static_cast<TextType>(stream.readByte()); - textAlign = static_cast<TextAlignType>(stream.readUint16()); - palinfo1 = stream.readUint16(); - palinfo2 = stream.readUint16(); - palinfo3 = stream.readUint16(); + _flags1 = stream.readByte(); + _borderSize = static_cast<SizeType>(stream.readByte()); + _gutterSize = static_cast<SizeType>(stream.readByte()); + _boxShadow = static_cast<SizeType>(stream.readByte()); + _textType = static_cast<TextType>(stream.readByte()); + _textAlign = static_cast<TextAlignType>(stream.readUint16()); + _palinfo1 = stream.readUint16(); + _palinfo2 = stream.readUint16(); + _palinfo3 = stream.readUint16(); if (version == 2) { int t = stream.readUint16(); @@ -125,7 +125,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { warning("TextCast: t: %x", t); } - initialRect = Score::readRect(stream); + _initialRect = Score::readRect(stream); stream.readUint16(); } else { int t = stream.readUint32(); @@ -133,50 +133,50 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { warning("TextCast: t: %x", t); } - initialRect = Score::readRect(stream); + _initialRect = Score::readRect(stream); } - textShadow = static_cast<SizeType>(stream.readByte()); + _textShadow = static_cast<SizeType>(stream.readByte()); byte flags = stream.readByte(); if (flags & 0x1) - textFlags.push_back(kTextFlagEditable); + _textFlags.push_back(kTextFlagEditable); if (flags & 0x2) - textFlags.push_back(kTextFlagAutoTab); + _textFlags.push_back(kTextFlagAutoTab); if (flags & 0x4) - textFlags.push_back(kTextFlagDoNotWrap); + _textFlags.push_back(kTextFlagDoNotWrap); if (flags & 0xf8) warning("Unprocessed text cast flags: %x", flags & 0xf8); // TODO: FIXME: guesswork - fontId = stream.readByte(); - fontSize = stream.readByte(); - textSlant = 0; + _fontId = stream.readByte(); + _fontSize = stream.readByte(); + _textSlant = 0; } else if (version == 4) { - borderSize = static_cast<SizeType>(stream.readByte()); - gutterSize = static_cast<SizeType>(stream.readByte()); - boxShadow = static_cast<SizeType>(stream.readByte()); - textType = static_cast<TextType>(stream.readByte()); - textAlign = static_cast<TextAlignType>(stream.readSint16()); // this is because 'right' is -1? or should that be 255? + _borderSize = static_cast<SizeType>(stream.readByte()); + _gutterSize = static_cast<SizeType>(stream.readByte()); + _boxShadow = static_cast<SizeType>(stream.readByte()); + _textType = static_cast<TextType>(stream.readByte()); + _textAlign = static_cast<TextAlignType>(stream.readSint16()); // this is because 'right' is -1? or should that be 255? stream.readUint16(); stream.readUint16(); stream.readUint16(); stream.readUint16(); - fontId = 1; // this is in STXT + _fontId = 1; // this is in STXT - initialRect = Score::readRect(stream); + _initialRect = Score::readRect(stream); stream.readUint16(); - textShadow = static_cast<SizeType>(stream.readByte()); + _textShadow = static_cast<SizeType>(stream.readByte()); byte flags = stream.readByte(); if (flags) warning("Unprocessed text cast flags: %x", flags); - fontSize = stream.readUint16(); - textSlant = 0; + _fontSize = stream.readUint16(); + _textSlant = 0; } else { - fontId = 1; - fontSize = 12; + _fontId = 1; + _fontSize = 12; stream.readUint32(); stream.readUint32(); @@ -193,27 +193,27 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { stream.readUint32(); stream.readUint32(); - initialRect = Score::readRect(stream); - boundingRect = Score::readRect(stream); + _initialRect = Score::readRect(stream); + _boundingRect = Score::readRect(stream); stream.readUint32(); stream.readUint16(); stream.readUint16(); } - modified = 0; + _modified = 0; - cachedMacText = new CachedMacText(this, version, -1, g_director->_wm); + _cachedMacText = new CachedMacText(this, version, -1, g_director->_wm); // TODO Destroy me } void TextCast::importStxt(const Stxt *stxt) { - fontId = stxt->_fontId; - textSlant = stxt->_textSlant; - fontSize = stxt->_fontSize; - palinfo1 = stxt->_palinfo1; - palinfo2 = stxt->_palinfo2; - palinfo3 = stxt->_palinfo3; + _fontId = stxt->_fontId; + _textSlant = stxt->_textSlant; + _fontSize = stxt->_fontSize; + _palinfo1 = stxt->_palinfo1; + _palinfo2 = stxt->_palinfo2; + _palinfo3 = stxt->_palinfo3; _ftext = stxt->_ftext; } @@ -229,34 +229,34 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) { if (version < 4) { /*byte flags = */ stream.readByte(); /*unk1 = */ stream.readByte(); - shapeType = static_cast<ShapeType>(stream.readByte()); - initialRect = Score::readRect(stream); - pattern = stream.readUint16BE(); - fgCol = stream.readByte(); - bgCol = stream.readByte(); - fillType = stream.readByte(); - lineThickness = stream.readByte(); - lineDirection = stream.readByte(); + _shapeType = static_cast<ShapeType>(stream.readByte()); + _initialRect = Score::readRect(stream); + _pattern = stream.readUint16BE(); + _fgCol = stream.readByte(); + _bgCol = stream.readByte(); + _fillType = stream.readByte(); + _lineThickness = stream.readByte(); + _lineDirection = stream.readByte(); } else { stream.readByte(); stream.readByte(); - initialRect = Score::readRect(stream); - boundingRect = Score::readRect(stream); + _initialRect = Score::readRect(stream); + _boundingRect = Score::readRect(stream); - shapeType = kShapeRectangle; - pattern = 0; - fgCol = bgCol = 0; - fillType = 0; - lineThickness = 1; - lineDirection = 0; + _shapeType = kShapeRectangle; + _pattern = 0; + _fgCol = _bgCol = 0; + _fillType = 0; + _lineThickness = 1; + _lineDirection = 0; } - modified = 0; + _modified = 0; } ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextCast(stream, version) { if (version < 4) { - buttonType = static_cast<ButtonType>(stream.readUint16BE()); + _buttonType = static_cast<ButtonType>(stream.readUint16BE()); } else { stream.readByte(); stream.readByte(); @@ -265,9 +265,9 @@ ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextC //initialRect = Score::readRect(stream); //boundingRect = Score::readRect(stream); - buttonType = static_cast<ButtonType>(stream.readUint16BE()); + _buttonType = static_cast<ButtonType>(stream.readUint16BE()); } - modified = 0; + _modified = 0; } ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) { @@ -277,12 +277,12 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) { stream.readByte(); stream.readByte(); - initialRect = Score::readRect(stream); - boundingRect = Score::readRect(stream); + _initialRect = Score::readRect(stream); + _boundingRect = Score::readRect(stream); - id = stream.readUint32(); + _id = stream.readUint32(); - debugC(4, kDebugLoading, "CASt: Script id: %d", id); + debugC(4, kDebugLoading, "CASt: Script id: %d", _id); stream.readByte(); // There should be no more data assert(stream.eos()); @@ -290,16 +290,16 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) { stream.readByte(); stream.readByte(); - initialRect = Score::readRect(stream); - boundingRect = Score::readRect(stream); + _initialRect = Score::readRect(stream); + _boundingRect = Score::readRect(stream); - id = stream.readUint32(); + _id = stream.readUint32(); - debugC(4, kDebugLoading, "CASt: Script id: %d", id); + debugC(4, kDebugLoading, "CASt: Script id: %d", _id); // WIP need to complete this! } - modified = 0; + _modified = 0; } } // End of namespace Director diff --git a/engines/director/cast.h b/engines/director/cast.h index 8acbc39acd..213cfbd1c9 100644 --- a/engines/director/cast.h +++ b/engines/director/cast.h @@ -51,30 +51,30 @@ enum CastType { class Cast { public: - CastType type; - Common::Rect initialRect; - Common::Rect boundingRect; - Common::Array<Resource> children; + CastType _type; + Common::Rect _initialRect; + Common::Rect _boundingRect; + Common::Array<Resource> _children; - const Graphics::Surface *surface; + const Graphics::Surface *_surface; - byte modified; + byte _modified; }; class BitmapCast : public Cast { public: BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 version = 2); - uint16 pitch; - uint16 regX; - uint16 regY; - uint8 flags; - uint16 someFlaggyThing; - uint16 unk1, unk2; + uint16 _pitch; + uint16 _regX; + uint16 _regY; + uint8 _flags; + uint16 _someFlaggyThing; + uint16 _unk1, _unk2; - uint16 bitsPerPixel; + uint16 _bitsPerPixel; - uint32 tag; + uint32 _tag; }; enum ShapeType { @@ -88,13 +88,13 @@ class ShapeCast : public Cast { public: ShapeCast(Common::ReadStreamEndian &stream, uint16 version = 2); - ShapeType shapeType; - uint16 pattern; - byte fgCol; - byte bgCol; - byte fillType; - byte lineThickness; - byte lineDirection; + ShapeType _shapeType; + uint16 _pattern; + byte _fgCol; + byte _bgCol; + byte _fillType; + byte _lineThickness; + byte _lineDirection; }; enum TextType { @@ -128,24 +128,24 @@ class TextCast : public Cast { public: TextCast(Common::ReadStreamEndian &stream, uint16 version = 2); - SizeType borderSize; - SizeType gutterSize; - SizeType boxShadow; + SizeType _borderSize; + SizeType _gutterSize; + SizeType _boxShadow; - byte flags1; - uint32 fontId; - uint16 fontSize; - TextType textType; - TextAlignType textAlign; - SizeType textShadow; - byte textSlant; - Common::Array<TextFlag> textFlags; - uint16 palinfo1, palinfo2, palinfo3; + byte _flags1; + uint32 _fontId; + uint16 _fontSize; + TextType _textType; + TextAlignType _textAlign; + SizeType _textShadow; + byte _textSlant; + Common::Array<TextFlag> _textFlags; + uint16 _palinfo1, _palinfo2, _palinfo3; Common::String _ftext; void importStxt(const Stxt *stxt); void importRTE(byte* text); - CachedMacText *cachedMacText; + CachedMacText *_cachedMacText; }; enum ButtonType { @@ -158,14 +158,14 @@ class ButtonCast : public TextCast { public: ButtonCast(Common::ReadStreamEndian &stream, uint16 version = 2); - ButtonType buttonType; + ButtonType _buttonType; }; class ScriptCast : public Cast { public: ScriptCast(Common::ReadStreamEndian &stream, uint16 version = 2); - uint32 id; + uint32 _id; }; diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index b7743aec99..c2597ec245 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -618,19 +618,19 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) { continue; } - int32 regX = _sprites[i]->_bitmapCast->regX; - int32 regY = _sprites[i]->_bitmapCast->regY; - int32 rectLeft = _sprites[i]->_bitmapCast->initialRect.left; - int32 rectTop = _sprites[i]->_bitmapCast->initialRect.top; + int32 regX = _sprites[i]->_bitmapCast->_regX; + int32 regY = _sprites[i]->_bitmapCast->_regY; + int32 rectLeft = _sprites[i]->_bitmapCast->_initialRect.left; + int32 rectTop = _sprites[i]->_bitmapCast->_initialRect.top; int x = _sprites[i]->_startPoint.x - regX + rectLeft; int y = _sprites[i]->_startPoint.y - regY + rectTop; int height = _sprites[i]->_height; - int width = _vm->getVersion() > 4 ? _sprites[i]->_bitmapCast->initialRect.width() : _sprites[i]->_width; + int width = _vm->getVersion() > 4 ? _sprites[i]->_bitmapCast->_initialRect.width() : _sprites[i]->_width; warning("drawRect: x=%d, y=%d, w=%d h=%d", x, y, width, height); Common::Rect drawRect(x, y, x + width, y + height); addDrawRect(i, drawRect); - inkBasedBlit(surface, *(_sprites[i]->_bitmapCast->surface), i, drawRect); + inkBasedBlit(surface, *(_sprites[i]->_bitmapCast->_surface), i, drawRect); } } } @@ -676,13 +676,13 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) { uint16 castId = _sprites[spriteId]->_castId; ButtonCast *button = _vm->getCurrentScore()->_loadedButtons->getVal(castId); - uint32 rectLeft = button->initialRect.left; - uint32 rectTop = button->initialRect.top; + uint32 rectLeft = button->_initialRect.left; + uint32 rectTop = button->_initialRect.top; int x = _sprites[spriteId]->_startPoint.x + rectLeft; int y = _sprites[spriteId]->_startPoint.y + rectTop; - int height = button->initialRect.height(); - int width = button->initialRect.width() + 3; + int height = button->_initialRect.height(); + int width = button->_initialRect.width() + 3; Common::Rect textRect(0, 0, width, height); // pass the rect of the button into the label. @@ -693,7 +693,7 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) { Common::Rect _rect; - switch (button->buttonType) { + switch (button->_buttonType) { case kTypeCheckBox: // Magic numbers: checkbox square need to move left about 5px from text and 12px side size (D4) _rect = Common::Rect(x - 17, y, x + 12, y + 12); @@ -750,20 +750,20 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo int x = _sprites[spriteId]->_startPoint.x; // +rectLeft; int y = _sprites[spriteId]->_startPoint.y; // +rectTop; - int height = textCast->initialRect.height(); //_sprites[spriteId]->_height; + int height = textCast->_initialRect.height(); //_sprites[spriteId]->_height; int width; if (_vm->getVersion() >= 4) { if (textSize == NULL) - width = textCast->initialRect.right; + width = textCast->_initialRect.right; else { width = textSize->width(); } } else { - width = textCast->initialRect.width(); //_sprites[spriteId]->_width; + width = textCast->_initialRect.width(); //_sprites[spriteId]->_width; } - if (_vm->getCurrentScore()->_fontMap.contains(textCast->fontId)) { + if (_vm->getCurrentScore()->_fontMap.contains(textCast->_fontId)) { // We need to make sure that the Shared Cast fonts have been loaded in? // might need a mapping table here of our own. // textCast->fontId = _vm->_wm->_fontMan->getFontIdByName(_vm->getCurrentScore()->_fontMap[textCast->fontId]); @@ -774,22 +774,22 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo return; } - Graphics::MacFont *macFont = new Graphics::MacFont(textCast->fontId, textCast->fontSize, textCast->textSlant); + Graphics::MacFont *macFont = new Graphics::MacFont(textCast->_fontId, textCast->_fontSize, textCast->_textSlant); debugC(3, kDebugText, "renderText: x: %d y: %d w: %d h: %d font: '%s' text: '%s'", x, y, width, height, _vm->_wm->_fontMan->getFontName(*macFont).c_str(), textCast->_ftext.c_str()); - uint16 boxShadow = (uint16)textCast->boxShadow; - uint16 borderSize = (uint16)textCast->borderSize; + uint16 boxShadow = (uint16)textCast->_boxShadow; + uint16 borderSize = (uint16)textCast->_borderSize; if (textSize != NULL) borderSize = 0; - uint16 padding = (uint16)textCast->gutterSize; - uint16 textShadow = (uint16)textCast->textShadow; + uint16 padding = (uint16)textCast->_gutterSize; + uint16 textShadow = (uint16)textCast->_textShadow; //uint32 rectLeft = textCast->initialRect.left; //uint32 rectTop = textCast->initialRect.top; - textCast->cachedMacText->clip(width); - const Graphics::ManagedSurface *textSurface = textCast->cachedMacText->getSurface(); + textCast->_cachedMacText->clip(width); + const Graphics::ManagedSurface *textSurface = textCast->_cachedMacText->getSurface(); if (!textSurface) return; @@ -797,7 +797,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo height = textSurface->h; if (textSize != NULL) { // TODO: this offset could be due to incorrect fonts loaded! - textSize->bottom = height + textCast->cachedMacText->getLineCount(); + textSize->bottom = height + textCast->_cachedMacText->getLineCount(); } uint16 textX = 0, textY = 0; @@ -821,7 +821,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo textY += padding / 2; } - if (textCast->textAlign == kTextAlignRight) + if (textCast->_textAlign == kTextAlignRight) textX -= 1; if (textShadow > 0) @@ -833,7 +833,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo y += 2; } - switch (textCast->textAlign) { + switch (textCast->_textAlign) { case kTextAlignLeft: default: break; diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index 68999f66ef..4ba8eec34e 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -687,7 +687,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) { } ShapeCast *shape = _vm->getCurrentScore()->_loadedShapes->getVal(id); - d.u.i = shape->bgCol; + d.u.i = shape->_bgCol; } break; case kTheForeColor: @@ -699,7 +699,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) { } ShapeCast *shape = _vm->getCurrentScore()->_loadedShapes->getVal(id); - d.u.i = shape->fgCol; + d.u.i = shape->_fgCol; } break; case kTheLoaded: @@ -767,8 +767,8 @@ void Lingo::setTheCast(Datum &id1, int field, Datum &d) { warning("Field %d of cast %d not found", field, id); } ShapeCast *shape = _vm->getCurrentScore()->_loadedShapes->getVal(id); - shape->bgCol = d.u.i; - shape->modified = 1; + shape->_bgCol = d.u.i; + shape->_modified = 1; } break; case kTheForeColor: @@ -778,8 +778,8 @@ void Lingo::setTheCast(Datum &id1, int field, Datum &d) { return; } ShapeCast *shape = _vm->getCurrentScore()->_loadedShapes->getVal(id); - shape->fgCol = d.u.i; - shape->modified = 1; + shape->_fgCol = d.u.i; + shape->_modified = 1; } break; default: diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 6315a5b812..f3934db9ea 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -228,7 +228,7 @@ void Score::copyCastStxts() { for (tc = _loadedText->begin(); tc != _loadedText->end(); ++tc) { uint stxtid = (_vm->getVersion() < 4) ? tc->_key + 1024 : - tc->_value->children[0].index; + tc->_value->_children[0].index; if (_loadedStxts->getVal(stxtid)) { debugC(3, kDebugLoading,"Yes to STXT: %d", stxtid); const Stxt *stxt = _loadedStxts->getVal(stxtid); @@ -243,7 +243,7 @@ void Score::copyCastStxts() { for (bc = _loadedButtons->begin(); bc != _loadedButtons->end(); ++bc) { uint stxtid = (_vm->getVersion() < 4) ? bc->_key + 1024 : - bc->_value->children[0].index; + bc->_value->_children[0].index; if (_loadedStxts->getVal(stxtid)) { debugC(3, "Yes to STXT: %d", stxtid); const Stxt *stxt = _loadedStxts->getVal(stxtid); @@ -260,13 +260,13 @@ void Score::loadSpriteImages(bool isSharedCast) { Common::HashMap<int, BitmapCast *>::iterator bc; for (bc = _loadedBitmaps->begin(); bc != _loadedBitmaps->end(); ++bc) { if (bc->_value) { - uint32 tag = bc->_value->tag; + uint32 tag = bc->_value->_tag; uint16 imgId = bc->_key + 1024; BitmapCast *bitmapCast = bc->_value; - if (_vm->getVersion() >= 4 && bitmapCast->children.size() > 0) { - imgId = bitmapCast->children[0].index; - tag = bitmapCast->children[0].tag; + if (_vm->getVersion() >= 4 && bitmapCast->_children.size() > 0) { + imgId = bitmapCast->_children[0].index; + tag = bitmapCast->_children[0].tag; } Image::ImageDecoder *img = NULL; @@ -277,11 +277,11 @@ void Score::loadSpriteImages(bool isSharedCast) { if (_movieArchive->hasResource(MKTAG('D', 'I', 'B', ' '), imgId)) { img = new DIBDecoder(); img->loadStream(*_movieArchive->getResource(MKTAG('D', 'I', 'B', ' '), imgId)); - bitmapCast->surface = img->getSurface(); + bitmapCast->_surface = img->getSurface(); } else if (isSharedCast && _vm->getSharedDIB() != NULL && _vm->getSharedDIB()->contains(imgId)) { img = new DIBDecoder(); img->loadStream(*_vm->getSharedDIB()->getVal(imgId)); - bitmapCast->surface = img->getSurface(); + bitmapCast->_surface = img->getSurface(); } break; case MKTAG('B', 'I', 'T', 'D'): @@ -299,21 +299,21 @@ void Score::loadSpriteImages(bool isSharedCast) { break; } - int w = bitmapCast->initialRect.width(), h = bitmapCast->initialRect.height(); + int w = bitmapCast->_initialRect.width(), h = bitmapCast->_initialRect.height(); debugC(4, kDebugImages, "id: %d, w: %d, h: %d, flags: %x, some: %x, unk1: %d, unk2: %d", - imgId, w, h, bitmapCast->flags, bitmapCast->someFlaggyThing, bitmapCast->unk1, bitmapCast->unk2); + imgId, w, h, bitmapCast->_flags, bitmapCast->_someFlaggyThing, bitmapCast->_unk1, bitmapCast->_unk2); if (pic != NULL && bitmapCast != NULL && w > 0 && h > 0) { if (_vm->getVersion() < 4) { img = new BITDDecoder(w, h); } else if (_vm->getVersion() < 6) { - img = new BITDDecoderV4(w, h, bitmapCast->bitsPerPixel, bitmapCast->pitch); + img = new BITDDecoderV4(w, h, bitmapCast->_bitsPerPixel, bitmapCast->_pitch); } else { img = new Image::BitmapDecoder(); } img->loadStream(*pic); - bitmapCast->surface = img->getSurface(); + bitmapCast->_surface = img->getSurface(); } else { warning("Image %d not found", imgId); } @@ -543,10 +543,10 @@ void Score::setSpriteCasts() { if (_vm->getSharedScore() != nullptr && _vm->getSharedScore()->_loadedButtons->contains(castId)) { _frames[i]->_sprites[j]->_buttonCast = _vm->getSharedScore()->_loadedButtons->getVal(castId); - if (_frames[i]->_sprites[j]->_buttonCast->children.size() == 1) { + if (_frames[i]->_sprites[j]->_buttonCast->_children.size() == 1) { _frames[i]->_sprites[j]->_textCast = - _vm->getSharedScore()->_loadedText->getVal(_frames[i]->_sprites[j]->_buttonCast->children[0].index); - } else if (_frames[i]->_sprites[j]->_buttonCast->children.size() > 0) { + _vm->getSharedScore()->_loadedText->getVal(_frames[i]->_sprites[j]->_buttonCast->_children[0].index); + } else if (_frames[i]->_sprites[j]->_buttonCast->_children.size() > 0) { warning("Cast %d has too many children!", j); } } else if (_loadedButtons->contains(castId)) { @@ -636,28 +636,28 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id, case kCastBitmap: _loadedBitmaps->setVal(id, new BitmapCast(castStream, res->tag, _vm->getVersion())); for (uint child = 0; child < res->children.size(); child++) - _loadedBitmaps->getVal(id)->children.push_back(res->children[child]); + _loadedBitmaps->getVal(id)->_children.push_back(res->children[child]); _castTypes[id] = kCastBitmap; debugC(3, kDebugLoading, "Score::loadCastData(): loaded kCastBitmap (%d)", res->children.size()); break; case kCastText: _loadedText->setVal(id, new TextCast(castStream, _vm->getVersion())); for (uint child = 0; child < res->children.size(); child++) - _loadedText->getVal(id)->children.push_back(res->children[child]); + _loadedText->getVal(id)->_children.push_back(res->children[child]); _castTypes[id] = kCastText; debugC(3, kDebugLoading, "Score::loadCastData(): loaded kCastText (%d)", res->children.size()); break; case kCastShape: _loadedShapes->setVal(id, new ShapeCast(castStream, _vm->getVersion())); for (uint child = 0; child < res->children.size(); child++) - _loadedShapes->getVal(id)->children.push_back(res->children[child]); + _loadedShapes->getVal(id)->_children.push_back(res->children[child]); _castTypes[id] = kCastShape; debugC(3, kDebugLoading, "Score::loadCastData(): loaded kCastShape (%d)", res->children.size()); break; case kCastButton: _loadedButtons->setVal(id, new ButtonCast(castStream, _vm->getVersion())); for (uint child = 0; child < res->children.size(); child++) - _loadedButtons->getVal(id)->children.push_back(res->children[child]); + _loadedButtons->getVal(id)->_children.push_back(res->children[child]); _castTypes[id] = kCastButton; debugC(3, kDebugLoading, "Score::loadCastData(): loaded kCastButton (%d)", res->children.size()); break; @@ -671,7 +671,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id, _castTypes[id] = kCastRTE; _loadedText->setVal(id, new TextCast(castStream, _vm->getVersion())); for (uint child = 0; child < res->children.size(); child++) { - _loadedText->getVal(id)->children.push_back(res->children[child]); + _loadedText->getVal(id)->_children.push_back(res->children[child]); if (child == 1) { Common::SeekableReadStream *rte1 = _movieArchive->getResource(res->children[child].tag, res->children[child].index); byte *buffer = new byte[rte1->size() + 2]; @@ -776,13 +776,13 @@ void Score::loadCastInto(Sprite *sprite, int castId) { Common::Rect Score::getCastMemberInitialRect(int castId) { switch (_castTypes[castId]) { case kCastBitmap: - return _loadedBitmaps->getVal(castId)->initialRect; + return _loadedBitmaps->getVal(castId)->_initialRect; case kCastShape: - return _loadedShapes->getVal(castId)->initialRect; + return _loadedShapes->getVal(castId)->_initialRect; case kCastButton: - return _loadedButtons->getVal(castId)->initialRect; + return _loadedButtons->getVal(castId)->_initialRect; case kCastText: - return _loadedText->getVal(castId)->initialRect; + return _loadedText->getVal(castId)->_initialRect; default: warning("Score::getCastMemberInitialRect(%d): Unhandled castType %d", castId, _castTypes[castId]); return Common::Rect(0, 0); @@ -792,16 +792,16 @@ Common::Rect Score::getCastMemberInitialRect(int castId) { void Score::setCastMemberModified(int castId) { switch (_castTypes[castId]) { case kCastBitmap: - _loadedBitmaps->getVal(castId)->modified = 1; + _loadedBitmaps->getVal(castId)->_modified = 1; break; case kCastShape: - _loadedShapes->getVal(castId)->modified = 1; + _loadedShapes->getVal(castId)->_modified = 1; break; case kCastButton: - _loadedButtons->getVal(castId)->modified = 1; + _loadedButtons->getVal(castId)->_modified = 1; break; case kCastText: - _loadedText->getVal(castId)->modified = 1; + _loadedText->getVal(castId)->_modified = 1; break; default: warning("Score::setCastMemberModified(%d): Unhandled castType %d", castId, _castTypes[castId]); |