[Scummvm-git-logs] scummvm master -> c118060b7c60001dc0880e007748c6427cb96f2c
sev-
sev at scummvm.org
Thu Feb 27 17:23:55 UTC 2020
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fa814ce3e8 DIRECTOR: Clarified comment
c0fd0aa968 DIRECTOR: Fixed background color for TextCast
c118060b7c DIRECTOR: JANITORIAL: Fix code formatting
Commit: fa814ce3e88a266a6ab2b50f830115b3549d8af0
https://github.com/scummvm/scummvm/commit/fa814ce3e88a266a6ab2b50f830115b3549d8af0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-02-27T14:06:17+01:00
Commit Message:
DIRECTOR: Clarified comment
Changed paths:
engines/director/frame.cpp
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 584421c502..e153c6472a 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -815,7 +815,7 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
// WORKAROUND, HACK
// Because we're not drawing text with transparency
// We swap drawing depending on whether the button is
- // inverted or not, to prevent destroying the button
+ // inverted or not, to prevent destroying the border
if (!invert)
renderText(surface, spriteId, &textRect);
Commit: c0fd0aa9681a28e44307317338662778963d864b
https://github.com/scummvm/scummvm/commit/c0fd0aa9681a28e44307317338662778963d864b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-02-27T18:22:12+01:00
Commit Message:
DIRECTOR: Fixed background color for TextCast
Changed paths:
engines/director/cachedmactext.cpp
engines/director/cachedmactext.h
engines/director/cast.cpp
engines/director/cast.h
engines/director/frame.cpp
engines/director/score.cpp
engines/director/score.h
diff --git a/engines/director/cachedmactext.cpp b/engines/director/cachedmactext.cpp
index 39a47455c6..c4ce407d75 100644
--- a/engines/director/cachedmactext.cpp
+++ b/engines/director/cachedmactext.cpp
@@ -52,18 +52,19 @@ void CachedMacText::makeMacText() {
uint color = _wm->findBestColor(_textCast->_palinfo1 & 0xff, _textCast->_palinfo2 & 0xff, _textCast->_palinfo3 & 0xff);
- _macText = new Graphics::MacText(_textCast->_ftext, _wm, macFont, color, 0xff, _width, _align, 1);
+ _macText = new Graphics::MacText(_textCast->_ftext, _wm, macFont, color, _bgcolor, _width, _align, 1);
// TODO destroy me
}
CachedMacText::CachedMacText(TextCast *const textCast,
+ int32 bgcolor,
int version,
int defaultWidth,
Graphics::MacWindowManager *const wm
)
:
_surface(NULL), _macText(NULL), _width(defaultWidth), _dirty(true),
- _textCast(textCast), _wm(wm) {
+ _textCast(textCast), _wm(wm), _bgcolor(bgcolor) {
debugC(5, kDebugText, "CachedMacText::CachedMacText(): font id: %d '%s'", _textCast->_fontId, Common::toPrintable(_textCast->_ftext).c_str());
diff --git a/engines/director/cachedmactext.h b/engines/director/cachedmactext.h
index 338c5ca296..8f862d0369 100644
--- a/engines/director/cachedmactext.h
+++ b/engines/director/cachedmactext.h
@@ -45,14 +45,17 @@ private:
bool _dirty;
Graphics::ManagedSurface *_surface;
void makeMacText();
+ int32 _bgcolor;
public:
CachedMacText(TextCast *const textCast,
+ int32 bgcolor,
int version,
int defaultWidth = -1,
Graphics::MacWindowManager *const wm = NULL);
void setWm(Graphics::MacWindowManager *wm);
void clip(int width);
+ void setBgColor(int color) { _bgcolor = color; }
void forceDirty();
const Graphics::ManagedSurface *getSurface();
int getLineCount();
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index bac531492c..488c79f601 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -121,9 +121,10 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16
_tag = castTag;
}
-TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
+TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version, int32 bgcolor) {
_type = kCastText;
+ _bgcolor = bgcolor;
_borderSize = kSizeNone;
_gutterSize = kSizeNone;
_boxShadow = kSizeNone;
@@ -234,7 +235,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
stream.readUint16();
}
- _cachedMacText = new CachedMacText(this, version, -1, g_director->_wm);
+ _cachedMacText = new CachedMacText(this, _bgcolor, version, -1, g_director->_wm);
// TODO Destroy me
_modified = false;
@@ -325,7 +326,7 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
_initialRect.debugPrint(0, "ShapeCast: rect:");
}
-ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextCast(stream, version) {
+ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextCast(stream, version, 0) {
_type = kCastButton;
if (version < 4) {
@@ -387,7 +388,7 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
}
}
-RTECast::RTECast(Common::ReadStreamEndian &stream, uint16 version) : TextCast(stream, version) {
+RTECast::RTECast(Common::ReadStreamEndian &stream, uint16 version, int32 bgcolor) : TextCast(stream, version, bgcolor) {
_type = kCastRTE;
}
diff --git a/engines/director/cast.h b/engines/director/cast.h
index 5123ef8034..34e9a9b51f 100644
--- a/engines/director/cast.h
+++ b/engines/director/cast.h
@@ -87,7 +87,7 @@ public:
class TextCast : public Cast {
public:
- TextCast(Common::ReadStreamEndian &stream, uint16 version);
+ TextCast(Common::ReadStreamEndian &stream, uint16 version, int bgcolor);
void setText(const char *text);
@@ -104,6 +104,7 @@ public:
byte _textSlant;
byte _textFlags;
uint16 _palinfo1, _palinfo2, _palinfo3;
+ int32 _bgcolor;
Common::String _ftext;
Common::String _ptext;
@@ -129,7 +130,7 @@ public:
class RTECast : public TextCast {
public:
- RTECast(Common::ReadStreamEndian &stream, uint16 version);
+ RTECast(Common::ReadStreamEndian &stream, uint16 version, int32 bgcolor);
void loadChunks();
};
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index e153c6472a..68f2b1435f 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -947,7 +947,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
}
Graphics::ManagedSurface textWithFeatures(width + (borderSize * 2) + boxShadow + textShadow, height + borderSize + boxShadow + textShadow);
- textWithFeatures.fillRect(Common::Rect(textWithFeatures.w, textWithFeatures.h), 0xff);
+ textWithFeatures.fillRect(Common::Rect(textWithFeatures.w, textWithFeatures.h), 255 - _vm->getCurrentScore()->getStageColor());
if (textRect == NULL && boxShadow > 0) {
textWithFeatures.fillRect(Common::Rect(boxShadow, boxShadow, textWithFeatures.w + boxShadow, textWithFeatures.h), 0);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 220f461b4d..e0add7535e 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -639,7 +639,7 @@ void Score::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) {
break;
case kCastText:
debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) TextCast", id, numToCastNum(id));
- _loadedCast->setVal(id, new TextCast(stream, _vm->getVersion()));
+ _loadedCast->setVal(id, new TextCast(stream, _vm->getVersion(), 255 - _stageColor));
break;
case kCastShape:
debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) ShapeCast", id, numToCastNum(id));
@@ -743,7 +743,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
break;
case kCastText:
debugC(3, kDebugLoading, "Score::loadCastData(): loading kCastText (%d children)", res->children.size());
- _loadedCast->setVal(id, new TextCast(castStream, _vm->getVersion()));
+ _loadedCast->setVal(id, new TextCast(castStream, _vm->getVersion(), 255 - _stageColor));
break;
case kCastShape:
debugC(3, kDebugLoading, "Score::loadCastData(): loading kCastShape (%d children)", res->children.size());
@@ -759,7 +759,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
break;
case kCastRTE:
debugC(3, kDebugLoading, "Score::loadCastData(): loading kCastRTE (%d children)", res->children.size());
- _loadedCast->setVal(id, new RTECast(castStream, _vm->getVersion()));
+ _loadedCast->setVal(id, new RTECast(castStream, _vm->getVersion(), 255 - _stageColor));
break;
case kCastFilmLoop:
warning("STUB: Score::loadCastData(): kCastFilmLoop (%d children)", res->children.size());
diff --git a/engines/director/score.h b/engines/director/score.h
index 754588094f..9b798b60c1 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -104,6 +104,8 @@ public:
void renderZoomBox(bool redraw = false);
bool haveZoomBox() { return !_zoomBoxes.empty(); }
+ int32 getStageColor() { return _stageColor; }
+
private:
void update();
void readVersion(uint32 rid);
Commit: c118060b7c60001dc0880e007748c6427cb96f2c
https://github.com/scummvm/scummvm/commit/c118060b7c60001dc0880e007748c6427cb96f2c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-02-27T18:23:34+01:00
Commit Message:
DIRECTOR: JANITORIAL: Fix code formatting
Changed paths:
engines/director/cachedmactext.cpp
engines/director/cachedmactext.h
diff --git a/engines/director/cachedmactext.cpp b/engines/director/cachedmactext.cpp
index c4ce407d75..93e7caf840 100644
--- a/engines/director/cachedmactext.cpp
+++ b/engines/director/cachedmactext.cpp
@@ -56,15 +56,10 @@ void CachedMacText::makeMacText() {
// TODO destroy me
}
-CachedMacText::CachedMacText(TextCast *const textCast,
- int32 bgcolor,
- int version,
- int defaultWidth,
- Graphics::MacWindowManager *const wm
- )
- :
- _surface(NULL), _macText(NULL), _width(defaultWidth), _dirty(true),
- _textCast(textCast), _wm(wm), _bgcolor(bgcolor) {
+CachedMacText::CachedMacText(TextCast *const textCast, int32 bgcolor, int version, int defaultWidth,
+ Graphics::MacWindowManager *const wm) :
+ _surface(NULL), _macText(NULL), _width(defaultWidth), _dirty(true),
+ _textCast(textCast), _wm(wm), _bgcolor(bgcolor) {
debugC(5, kDebugText, "CachedMacText::CachedMacText(): font id: %d '%s'", _textCast->_fontId, Common::toPrintable(_textCast->_ftext).c_str());
diff --git a/engines/director/cachedmactext.h b/engines/director/cachedmactext.h
index 8f862d0369..2795536539 100644
--- a/engines/director/cachedmactext.h
+++ b/engines/director/cachedmactext.h
@@ -48,11 +48,8 @@ private:
int32 _bgcolor;
public:
- CachedMacText(TextCast *const textCast,
- int32 bgcolor,
- int version,
- int defaultWidth = -1,
- Graphics::MacWindowManager *const wm = NULL);
+ CachedMacText(TextCast *const textCast, int32 bgcolor, int version, int defaultWidth = -1,
+ Graphics::MacWindowManager *const wm = NULL);
void setWm(Graphics::MacWindowManager *wm);
void clip(int width);
void setBgColor(int color) { _bgcolor = color; }
More information about the Scummvm-git-logs
mailing list