[Scummvm-git-logs] scummvm master -> 7a15ae695a63f8c88f8a4a54bb1c4cabdd8f74f1
npjg
nathanael.gentrydb8 at gmail.com
Thu Aug 6 16:50:47 UTC 2020
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
05a18f74be DIRECTOR: Reset current window on movie change
ed1b8bac24 DIRECTOR: Only re-init surface on changed dims
fba1993465 GRAPHICS: MACGUI: MacWindow: Add centering function
33fff7efe2 DIRECTOR: Properly set window dimensions
7a15ae695a DIRECTOR: Implement kTheCenterStage
Commit: 05a18f74be85344077622de2277135028d64fb97
https://github.com/scummvm/scummvm/commit/05a18f74be85344077622de2277135028d64fb97
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-06T12:50:24-04:00
Commit Message:
DIRECTOR: Reset current window on movie change
Changed paths:
engines/director/movie.cpp
engines/director/window.cpp
engines/director/window.h
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index 945f0b262a..de985785bd 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -124,7 +124,7 @@ bool Movie::loadArchive() {
initGraphics(windowWidth, windowHeight);
}
- _window->setStageColor(_stageColor);
+ _window->setStageColor(_stageColor, true);
// Score
if (!_movieArchive->hasResource(MKTAG('V', 'W', 'S', 'C'), -1)) {
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index 473e3801e6..d96a1a643e 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -113,8 +113,8 @@ bool Window::render(bool forceRedraw, Graphics::ManagedSurface *blitTo) {
return true;
}
-void Window::setStageColor(uint stageColor) {
- if (stageColor != _stageColor) {
+void Window::setStageColor(uint stageColor, bool forceReset) {
+ if (stageColor != _stageColor || forceReset) {
_stageColor = stageColor;
reset();
markAllDirty();
diff --git a/engines/director/window.h b/engines/director/window.h
index 9dd803c029..e21a85165e 100644
--- a/engines/director/window.h
+++ b/engines/director/window.h
@@ -95,7 +95,7 @@ class Window : public Graphics::MacWindow, public Object<Window> {
void invertChannel(Channel *channel);
bool needsAppliedColor(DirectorPlotData *pd);
- void setStageColor(uint stageColor);
+ void setStageColor(uint stageColor, bool forceReset = false);
int getStageColor() { return _stageColor; }
void addDirtyRect(const Common::Rect &r);
Commit: ed1b8bac24232bdd9c8dd37822cbf8ecca9c8c2d
https://github.com/scummvm/scummvm/commit/ed1b8bac24232bdd9c8dd37822cbf8ecca9c8c2d
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-06T12:50:24-04:00
Commit Message:
DIRECTOR: Only re-init surface on changed dims
Changed paths:
engines/director/movie.cpp
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index de985785bd..79a12a5096 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -120,8 +120,9 @@ bool Movie::loadArchive() {
if (_vm->_surface->w != windowWidth || _vm->_surface->h != windowHeight) {
_vm->_surface->free();
_vm->_surface->create(windowWidth, windowHeight, Graphics::PixelFormat::createFormatCLUT8());
+
+ initGraphics(windowWidth, windowHeight);
}
- initGraphics(windowWidth, windowHeight);
}
_window->setStageColor(_stageColor, true);
Commit: fba1993465d89a0ec19415a0b9a5d6658beff94b
https://github.com/scummvm/scummvm/commit/fba1993465d89a0ec19415a0b9a5d6658beff94b
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-06T12:50:25-04:00
Commit Message:
GRAPHICS: MACGUI: MacWindow: Add centering function
Changed paths:
graphics/macgui/macwindow.cpp
graphics/macgui/macwindow.h
diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index 2ecf35c0e6..3272f188fa 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -186,6 +186,22 @@ void MacWindow::blit(ManagedSurface *g, Common::Rect &dest) {
g->transBlitFrom(*_composeSurface, _composeSurface->getBounds(), dest, kColorGreen2);
}
+void MacWindow::center(bool toCenter) {
+ if (!_wm)
+ return;
+
+ Common::Rect screen = _wm->_screen->getBounds();
+ Common::Rect d = getDimensions();
+
+ if (toCenter) {
+ move((screen.width() - _dims.width()) / 2, (screen.height() - _dims.height()) / 2);
+ } else if (_macBorder.hasBorder(_active) && _macBorder.hasOffsets()) {
+ move(_macBorder.getOffset().left, _macBorder.getOffset().top);
+ } else {
+ move(0, 0);
+ }
+}
+
#define ARROW_W 12
#define ARROW_H 6
const int arrowPixels[ARROW_H][ARROW_W] = {
diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h
index 352f4190f3..dbf7ee90b3 100644
--- a/graphics/macgui/macwindow.h
+++ b/graphics/macgui/macwindow.h
@@ -221,6 +221,12 @@ public:
virtual bool draw(bool forceRedraw = false) override;
virtual void blit(ManagedSurface *g, Common::Rect &dest) override;
+ /**
+ * Centers the window using the dimensions of the parent window manager, or undoes this; does
+ * nothing if WM is null.
+ */
+ void center(bool toCenter = true);
+
/**
* Mutator to change the active state of the window.
* Most often called from the WM.
Commit: 33fff7efe2e318493caee2ae032007d267eb5a9f
https://github.com/scummvm/scummvm/commit/33fff7efe2e318493caee2ae032007d267eb5a9f
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-06T12:50:25-04:00
Commit Message:
DIRECTOR: Properly set window dimensions
Changed paths:
engines/director/window.cpp
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index d96a1a643e..7b43804ab0 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -122,6 +122,7 @@ void Window::setStageColor(uint stageColor, bool forceReset) {
}
void Window::reset() {
+ resize(_composeSurface->w, _composeSurface->h, true);
_composeSurface->clear(_stageColor);
_contentIsDirty = true;
}
Commit: 7a15ae695a63f8c88f8a4a54bb1c4cabdd8f74f1
https://github.com/scummvm/scummvm/commit/7a15ae695a63f8c88f8a4a54bb1c4cabdd8f74f1
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-08-06T12:50:25-04:00
Commit Message:
DIRECTOR: Implement kTheCenterStage
Changed paths:
engines/director/director.cpp
engines/director/director.h
engines/director/lingo/lingo-the.cpp
engines/director/movie.cpp
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index c6506a2a16..79d62095d5 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -105,6 +105,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
_machineType = 9; // Macintosh IIci
_playbackPaused = false;
_skipFrameAdvance = false;
+ _centerStage = true;
}
DirectorEngine::~DirectorEngine() {
diff --git a/engines/director/director.h b/engines/director/director.h
index 14fff4d653..75618f18d7 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -231,6 +231,7 @@ public:
int _machineType;
bool _playbackPaused;
bool _skipFrameAdvance;
+ bool _centerStage;
Common::HashMap<Common::String, Archive *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _openResFiles;
Common::String _sharedCastFile;
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index d3b6aea308..9c32c470e0 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -371,7 +371,7 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
warning("STUB: Lingo::getTheEntity(): Unprocessed getting field %s of entity %s", field2str(field), entity2str(entity));
break;
case kTheCenterStage:
- getTheEntitySTUB(kTheCenterStage);
+ return g_director->_centerStage;
break;
case kTheCheckBoxAccess:
getTheEntitySTUB(kTheCheckBoxAccess);
@@ -863,7 +863,7 @@ void Lingo::setTheEntity(int entity, Datum &id, int field, Datum &d) {
setTheCast(id, field, d);
break;
case kTheCenterStage:
- setTheEntitySTUB(kTheCenterStage);
+ g_director->_centerStage = d.asInt();
break;
case kTheCheckBoxAccess:
setTheEntitySTUB(kTheCheckBoxAccess);
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index 79a12a5096..7fe21fd103 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -127,6 +127,9 @@ bool Movie::loadArchive() {
_window->setStageColor(_stageColor, true);
+ if (debugChannelSet(-1, kDebugDesktop))
+ _window->center(g_director->_centerStage);
+
// Score
if (!_movieArchive->hasResource(MKTAG('V', 'W', 'S', 'C'), -1)) {
warning("Movie::loadArchive(): Wrong movie format. VWSC resource missing");
More information about the Scummvm-git-logs
mailing list