[Scummvm-git-logs] scummvm master -> 6a306affdbc7df44935d0977b1908adf1171a109
sev-
sev at scummvm.org
Thu Oct 15 10:15:26 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
6a306affdb STARK: Moved constants to enum from static members, to make OSX compiler happier
Commit: 6a306affdbc7df44935d0977b1908adf1171a109
https://github.com/scummvm/scummvm/commit/6a306affdbc7df44935d0977b1908adf1171a109
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-10-15T12:14:45+02:00
Commit Message:
STARK: Moved constants to enum from static members, to make OSX compiler happier
Changed paths:
engines/stark/savemetadata.cpp
engines/stark/services/userinterface.h
engines/stark/ui/menu/saveloadmenu.cpp
diff --git a/engines/stark/savemetadata.cpp b/engines/stark/savemetadata.cpp
index 6a61d31218..3f59b2ea1e 100644
--- a/engines/stark/savemetadata.cpp
+++ b/engines/stark/savemetadata.cpp
@@ -126,20 +126,20 @@ void SaveMetadata::setSaveTime(const TimeDate &timeDate) {
void SaveMetadata::writeGameScreenThumbnail(Common::WriteStream *stream) {
assert(gameWindowThumbnail);
- assert(gameWindowThumbnail->pitch * gameWindowThumbnail->h == UserInterface::kThumbnailSize);
+ assert(gameWindowThumbnail->pitch * gameWindowThumbnail->h == kThumbnailSize);
- stream->write((const byte *)gameWindowThumbnail->getPixels(), UserInterface::kThumbnailSize);
+ stream->write((const byte *)gameWindowThumbnail->getPixels(), kThumbnailSize);
}
void SaveMetadata::skipGameScreenThumbnail(Common::SeekableReadStream *stream) {
- stream->skip(UserInterface::kThumbnailSize);
+ stream->skip(kThumbnailSize);
}
Graphics::Surface *SaveMetadata::readGameScreenThumbnail(Common::SeekableReadStream *stream) {
Graphics::Surface *thumb = new Graphics::Surface();
- thumb->create(UserInterface::kThumbnailWidth, UserInterface::kThumbnailHeight, Gfx::Driver::getRGBAPixelFormat());
+ thumb->create(kThumbnailWidth, kThumbnailHeight, Gfx::Driver::getRGBAPixelFormat());
- stream->read(thumb->getPixels(), UserInterface::kThumbnailSize);
+ stream->read(thumb->getPixels(), kThumbnailSize);
return thumb;
}
diff --git a/engines/stark/services/userinterface.h b/engines/stark/services/userinterface.h
index fe4746548f..ec2af77e34 100644
--- a/engines/stark/services/userinterface.h
+++ b/engines/stark/services/userinterface.h
@@ -62,6 +62,12 @@ class DialogScreen;
class Cursor;
class FMVScreen;
+enum {
+ kThumbnailWidth = 160,
+ kThumbnailHeight = 92,
+ kThumbnailSize = kThumbnailWidth * kThumbnailHeight * 4
+};
+
/**
* Facade object for interacting with the user interface from the rest of the engine
*/
@@ -189,10 +195,6 @@ public:
/** Perform an action after a keypress */
void handleKeyPress(const Common::KeyState &keyState);
- static const uint kThumbnailWidth = 160;
- static const uint kThumbnailHeight = 92;
- static const uint kThumbnailSize = kThumbnailWidth * kThumbnailHeight * 4;
-
private:
Screen *getScreenByName(Screen::Name screenName) const;
diff --git a/engines/stark/ui/menu/saveloadmenu.cpp b/engines/stark/ui/menu/saveloadmenu.cpp
index 0503438a7f..d3da8e205d 100644
--- a/engines/stark/ui/menu/saveloadmenu.cpp
+++ b/engines/stark/ui/menu/saveloadmenu.cpp
@@ -72,29 +72,29 @@ void SaveLoadMenuScreen::open() {
"loadsavebg",
nullptr,
nullptr));
-
+
_widgets.push_back(new StaticLocationWidget(
"back to index",
CLICK_HANDLER(SaveLoadMenuScreen, backHandler),
nullptr));
_widgets.back()->setupSounds(0, 1);
-
+
_widgets.push_back(new StaticLocationWidget(
"Cancel",
CLICK_HANDLER(SaveLoadMenuScreen, backHandler),
nullptr));
_widgets.back()->setupSounds(0, 1);
-
+
_widgets.push_back(new StaticLocationWidget(
"SaveText",
nullptr,
nullptr));
-
+
_widgets.push_back(new StaticLocationWidget(
"LoadText",
nullptr,
nullptr));
-
+
_widgets.push_back(new StaticLocationWidget(
"Back",
CLICK_HANDLER(SaveLoadMenuScreen, prevPageHandler),
@@ -102,7 +102,7 @@ void SaveLoadMenuScreen::open() {
_widgets.back()->setupSounds(0, 1);
_widgets.back()->setTextColor(Color(0, 0, 0));
_widgets.back()->setVisible(_page > 0);
-
+
_widgets.push_back(new StaticLocationWidget(
"Next",
CLICK_HANDLER(SaveLoadMenuScreen, nextPageHandler),
@@ -244,8 +244,8 @@ SaveDataWidget::SaveDataWidget(int slot, Gfx::Driver *gfx, SaveLoadMenuScreen *s
StaticLocationWidget(nullptr, nullptr, nullptr),
_slot(slot),
_screen(screen),
- _thumbWidth(StarkUserInterface->kThumbnailWidth),
- _thumbHeight(StarkUserInterface->kThumbnailHeight),
+ _thumbWidth(kThumbnailWidth),
+ _thumbHeight(kThumbnailHeight),
_texture(gfx->createTexture()),
_outline(gfx->createTexture()),
_surfaceRenderer(gfx->createSurfaceRenderer()),
More information about the Scummvm-git-logs
mailing list