aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2005-05-14 22:47:00 +0000
committerMax Horn2005-05-14 22:47:00 +0000
commitef8c36554ce9f3990ee1e21455b9ad9602261457 (patch)
tree2f7bc1b96a60d8827095479c9b433c8205218db1
parent9b9e8424c12024015e0b697222ba0266b0ede5f5 (diff)
downloadscummvm-rg350-ef8c36554ce9f3990ee1e21455b9ad9602261457.tar.gz
scummvm-rg350-ef8c36554ce9f3990ee1e21455b9ad9602261457.tar.bz2
scummvm-rg350-ef8c36554ce9f3990ee1e21455b9ad9602261457.zip
Made the SCUMM main dialog scale itself
svn-id: r18097
-rw-r--r--scumm/dialogs.cpp58
-rw-r--r--scumm/dialogs.h3
2 files changed, 47 insertions, 14 deletions
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp
index f8c7628f49..7b05d0c9a4 100644
--- a/scumm/dialogs.cpp
+++ b/scumm/dialogs.cpp
@@ -383,37 +383,67 @@ Common::StringList generateSavegameList(ScummEngine *scumm, bool saveMode) {
return l;
}
-enum {
- kRowHeight = 18,
- kBigButtonWidth = 90,
- kMainMenuWidth = (kBigButtonWidth + 2 * 8),
- kMainMenuHeight = 7 * kRowHeight + 3 * 5 + 7 + 5
-};
-
#define addBigButton(label, cmd, hotkey) \
- new GUI::ButtonWidget(this, x, y, kBigButtonWidth, 16, label, cmd, hotkey); y += kRowHeight
+ new GUI::ButtonWidget(this, hOffset, y, buttonWidth, buttonHeight, label, cmd, hotkey, ws); \
+ y += (buttonHeight + vAddOff)
MainMenuDialog::MainMenuDialog(ScummEngine *scumm)
- : ScummDialog(scumm, (320 - kMainMenuWidth) / 2, (200 - kMainMenuHeight)/2, kMainMenuWidth, kMainMenuHeight) {
- int y = 7;
+ : ScummDialog(scumm, 0, 0, 0, 0) {
+
+ const int sw = g_system->getOverlayWidth();
+ const int sh = g_system->getOverlayHeight();
+
+ int hOffset;
+ int vSpace;
+ int vAddOff;
+
+ GUI::WidgetSize ws;
+ int buttonWidth;
+ int buttonHeight;
+
+ if (sw >= 400 && sh >= 300) {
+ buttonWidth = 160;
+ buttonHeight = 28;
+ ws = GUI::kBigWidgetSize;
+ hOffset = 12;
+ vSpace = 7;
+ vAddOff = 3;
+ } else {
+ buttonWidth = 90;
+ buttonHeight = 16;
+ ws = GUI::kNormalWidgetSize;
+ hOffset = 8;
+ vSpace = 5;
+ vAddOff = 2;
+ }
+
+ int y = vSpace + vAddOff;
+
- const int x = (_w - kBigButtonWidth) / 2;
addBigButton("Resume", kPlayCmd, 'P');
- y += 5;
+ y += vSpace;
addBigButton("Load", kLoadCmd, 'L');
addBigButton("Save", kSaveCmd, 'S');
- y += 5;
+ y += vSpace;
addBigButton("Options", kOptionsCmd, 'O');
#ifndef DISABLE_HELP
addBigButton("Help", kHelpCmd, 'H');
#endif
addBigButton("About", kAboutCmd, 'A');
- y += 5;
+ y += vSpace;
addBigButton("Quit", kQuitCmd, 'Q');
+
+ _w = buttonWidth + 2 * hOffset;
+ _h = y + vSpace;
+
+ _x = (sw - _w) / 2;
+ _y = (sh - _h) / 2;
+
+
//
// Create the sub dialog(s)
//
diff --git a/scumm/dialogs.h b/scumm/dialogs.h
index 8e3af00e27..3ca76c3712 100644
--- a/scumm/dialogs.h
+++ b/scumm/dialogs.h
@@ -72,6 +72,9 @@ public:
~MainMenuDialog();
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
+ // disable scaling
+ bool wantsScaling() const { return false; }
+
protected:
GUI::Dialog *_aboutDialog;
GUI::Dialog *_optionsDialog;