[Scummvm-git-logs] scummvm master -> 56f2f4a4bef86eb2fbfa7eeb8cfd166f126fa382
sev-
sev at scummvm.org
Tue Apr 7 23:21:20 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:
8ae73ce263 GRAPHICS: MACGUI: Add disableBorder() to MacWindow
ee557c8712 PINK: Use MacWindow::disableBorder()
b0fecf95c7 GRAPHICS: MACGUI: Fix infinite loop in event processing for MacWindow
393362b616 GRAPHICS: MACGUI: Fix window removal
56f2f4a4be DIRECTOR: Allocat MacWindow and draw on it
Commit: 8ae73ce2634fc74426fa9cd4538e8f6b8f002043
https://github.com/scummvm/scummvm/commit/8ae73ce2634fc74426fa9cd4538e8f6b8f002043
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-08T00:47:11+02:00
Commit Message:
GRAPHICS: MACGUI: Add disableBorder() to MacWindow
Changed paths:
graphics/macgui/macwindow.cpp
graphics/macgui/macwindow.h
diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index 21ebfe5a9a..4181ff88aa 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -68,6 +68,28 @@ MacWindow::MacWindow(int id, bool scrollable, bool resizable, bool editable, Mac
MacWindow::~MacWindow() {
}
+static const byte noborderData[3][3] = {
+ { 0, 1, 0 },
+ { 1, 0, 1 },
+ { 0, 1, 0 },
+};
+
+void MacWindow::disableBorder() {
+ Graphics::TransparentSurface *noborder = new Graphics::TransparentSurface();
+ noborder->create(3, 3, noborder->getSupportedPixelFormat());
+ uint32 colorBlack = noborder->getSupportedPixelFormat().RGBToColor(0, 0, 0);
+ uint32 colorPink = noborder->getSupportedPixelFormat().RGBToColor(255, 0, 255);
+
+ for (int y = 0; y < 3; y++)
+ for (int x = 0; x < 3; x++)
+ *((uint32 *)noborder->getBasePtr(x, y)) = noborderData[y][x] ? colorBlack : colorPink;
+
+ setBorder(noborder, true);
+
+ Graphics::TransparentSurface *noborder2 = new Graphics::TransparentSurface(*noborder, true);
+ setBorder(noborder2, false);
+}
+
const Font *MacWindow::getTitleFont() {
return _wm->_fontMan->getFont(Graphics::MacFont(kMacFontChicago, 12));
}
diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h
index 9140634ec6..8fbf2ab5e5 100644
--- a/graphics/macgui/macwindow.h
+++ b/graphics/macgui/macwindow.h
@@ -266,6 +266,7 @@ public:
*/
void loadBorder(Common::SeekableReadStream &file, bool active, int lo = -1, int ro = -1, int to = -1, int bo = -1);
void setBorder(TransparentSurface *border, bool active, int lo = -1, int ro = -1, int to = -1, int bo = -1);
+ void disableBorder();
/**
* Indicate whether the window can be closed (false by default).
Commit: ee557c8712a598d93e8288f668cdd35d57b26017
https://github.com/scummvm/scummvm/commit/ee557c8712a598d93e8288f668cdd35d57b26017
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-08T00:54:04+02:00
Commit Message:
PINK: Use MacWindow::disableBorder()
Changed paths:
engines/pink/objects/actions/action_text.cpp
diff --git a/engines/pink/objects/actions/action_text.cpp b/engines/pink/objects/actions/action_text.cpp
index 2f54aec82e..146ea3f140 100644
--- a/engines/pink/objects/actions/action_text.cpp
+++ b/engines/pink/objects/actions/action_text.cpp
@@ -75,12 +75,6 @@ void ActionText::toConsole() const {
_name.c_str(), _fileName.c_str(), _xLeft, _yTop, _xRight, _yBottom, _centered, _scrollBar, _textRGB, _backgroundRGB);
}
-static const byte noborderData[3][3] = {
- { 0, 1, 0 },
- { 1, 0, 1 },
- { 0, 1, 0 },
-};
-
void ActionText::start() {
findColorsInPalette();
Director *director = _actor->getPage()->getGame()->getDirector();
@@ -111,25 +105,12 @@ void ActionText::start() {
Graphics::MacFont *font = new Graphics::MacFont;
_txtWnd = director->getWndManager().addTextWindow(font, _textColorIndex, _backgroundColorIndex,
_xRight - _xLeft, align, nullptr, false);
+ _txtWnd->disableBorder();
_txtWnd->move(_xLeft, _yTop);
_txtWnd->resize(_xRight - _xLeft, _yBottom - _yTop);
_txtWnd->setEditable(false);
_txtWnd->setSelectable(false);
- Graphics::TransparentSurface *noborder = new Graphics::TransparentSurface();
- noborder->create(3, 3, noborder->getSupportedPixelFormat());
- uint32 colorBlack = noborder->getSupportedPixelFormat().RGBToColor(0, 0, 0);
- uint32 colorPink = noborder->getSupportedPixelFormat().RGBToColor(255, 0, 255);
-
- for (int y = 0; y < 3; y++)
- for (int x = 0; x < 3; x++)
- *((uint32 *)noborder->getBasePtr(x, y)) = noborderData[y][x] ? colorBlack : colorPink;
-
- _txtWnd->setBorder(noborder, true);
-
- Graphics::TransparentSurface *noborder2 = new Graphics::TransparentSurface(*noborder, true);
- _txtWnd->setBorder(noborder2, false);
-
_txtWnd->appendText(_text, font);
} else {
Commit: b0fecf95c763ca3bab50fbb91684e76dd84c212a
https://github.com/scummvm/scummvm/commit/b0fecf95c763ca3bab50fbb91684e76dd84c212a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-08T01:16:57+02:00
Commit Message:
GRAPHICS: MACGUI: Fix infinite loop in event processing for MacWindow
Changed paths:
graphics/macgui/macwindow.cpp
diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index 4181ff88aa..80ab084a21 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -537,7 +537,7 @@ bool MacWindow::processEvent(Common::Event &event) {
}
MacWidget *w = findEventHandler(event, _dims.left, _dims.top);
- if (w && w->processEvent(event))
+ if (w && w != this && w->processEvent(event))
return true;
if (_callback)
Commit: 393362b6162ffde53d4de477c72dbe590a65685d
https://github.com/scummvm/scummvm/commit/393362b6162ffde53d4de477c72dbe590a65685d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-08T01:17:28+02:00
Commit Message:
GRAPHICS: MACGUI: Fix window removal
Changed paths:
graphics/macgui/macwindowmanager.cpp
diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp
index d753d6430a..f31cfe9875 100644
--- a/graphics/macgui/macwindowmanager.cpp
+++ b/graphics/macgui/macwindowmanager.cpp
@@ -292,6 +292,9 @@ void MacWindowManager::setActive(int id) {
void MacWindowManager::removeWindow(MacWindow *target) {
_windowsToRemove.push_back(target);
_needsRemoval = true;
+
+ if (target->getId() == _activeWindow)
+ _activeWindow = -1;
}
void macDrawPixel(int x, int y, int color, void *data) {
@@ -442,7 +445,7 @@ void MacWindowManager::removeMarked() {
removeFromStack(*it);
removeFromWindowList(*it);
delete *it;
- _activeWindow = 0;
+ _activeWindow = -1;
_fullRefresh = true;
}
_windowsToRemove.clear();
Commit: 56f2f4a4bef86eb2fbfa7eeb8cfd166f126fa382
https://github.com/scummvm/scummvm/commit/56f2f4a4bef86eb2fbfa7eeb8cfd166f126fa382
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-08T01:20:33+02:00
Commit Message:
DIRECTOR: Allocat MacWindow and draw on it
Inter-movie transitions are broken again (go over white)
Changed paths:
engines/director/score.cpp
engines/director/score.h
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 2659531820..4c0c487431 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -107,6 +107,7 @@ Score::Score(DirectorEngine *vm) {
_framesRan = 0; // used by kDebugFewFramesOnly
+ _window = nullptr;
}
void Score::setArchive(Archive *archive) {
@@ -446,9 +447,6 @@ void Score::loadSpriteSounds(bool isSharedCast) {
Score::~Score() {
- if (_surface && _surface->w)
- _surface->free();
-
if (_trailSurface && _trailSurface->w)
_trailSurface->free();
@@ -460,9 +458,11 @@ Score::~Score() {
delete _backSurface;
delete _backSurface2;
- delete _surface;
delete _trailSurface;
+ if (_window)
+ _vm->_wm->removeWindow(_window);
+
for (uint i = 0; i < _frames.size(); i++)
delete _frames[i];
@@ -1515,12 +1515,15 @@ void Score::startLoop() {
initGraphics(_movieRect.width(), _movieRect.height());
- _surface = new Graphics::ManagedSurface;
+ _window = _vm->_wm->addWindow(false, false, false);
+ _window->disableBorder();
+ _window->resize(_movieRect.width(), _movieRect.height());
+
+ _surface = _window->getSurface();
_trailSurface = new Graphics::ManagedSurface;
_backSurface = new Graphics::ManagedSurface;
_backSurface2 = new Graphics::ManagedSurface;
- _surface->create(_movieRect.width(), _movieRect.height());
_trailSurface->create(_movieRect.width(), _movieRect.height());
_backSurface->create(_movieRect.width(), _movieRect.height());
_backSurface2->create(_movieRect.width(), _movieRect.height());
diff --git a/engines/director/score.h b/engines/director/score.h
index f589ecf222..86b643d0e2 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -28,6 +28,7 @@
namespace Graphics {
class ManagedSurface;
class Font;
+ class MacWindow;
}
namespace Common {
@@ -153,6 +154,8 @@ public:
int _numChannelsDisplayed;
+ Graphics::MacWindow *_window;
+
private:
uint16 _versionMinor;
uint16 _versionMajor;
More information about the Scummvm-git-logs
mailing list