Initial commit
This commit is contained in:
154
engines/scumm/macgui/macgui.cpp
Normal file
154
engines/scumm/macgui/macgui.cpp
Normal file
@@ -0,0 +1,154 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/str.h"
|
||||
|
||||
#include "scumm/scumm.h"
|
||||
#include "scumm/macgui/macgui.h"
|
||||
#include "scumm/macgui/macgui_impl.h"
|
||||
#include "scumm/macgui/macgui_indy3.h"
|
||||
#include "scumm/macgui/macgui_loom.h"
|
||||
#include "scumm/macgui/macgui_v5.h"
|
||||
#include "scumm/macgui/macgui_v6.h"
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
MacGui::MacGui(ScummEngine *vm, const Common::Path &resourceFile) {
|
||||
switch (vm->_game.id) {
|
||||
case GID_INDY3:
|
||||
_impl = new MacIndy3Gui(vm, resourceFile);
|
||||
break;
|
||||
|
||||
case GID_LOOM:
|
||||
_impl = new MacLoomGui(vm, resourceFile);
|
||||
break;
|
||||
|
||||
case GID_MONKEY:
|
||||
case GID_MONKEY2:
|
||||
_impl = new MacV5Gui(vm, resourceFile);
|
||||
break;
|
||||
|
||||
case GID_INDY4:
|
||||
if (vm->_isModernMacVersion)
|
||||
_impl = new MacV6Gui(vm, resourceFile);
|
||||
else
|
||||
_impl = new MacV5Gui(vm, resourceFile);
|
||||
break;
|
||||
|
||||
case GID_TENTACLE:
|
||||
case GID_MANIAC:
|
||||
case GID_SAMNMAX:
|
||||
case GID_DIG:
|
||||
case GID_FT:
|
||||
_impl = new MacV6Gui(vm, resourceFile);
|
||||
break;
|
||||
|
||||
default:
|
||||
error("MacGui: Invalid game id %d", vm->_game.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MacGui::~MacGui() {
|
||||
delete _impl;
|
||||
}
|
||||
|
||||
int MacGui::getNumColors() const {
|
||||
return _impl->getNumColors();
|
||||
}
|
||||
|
||||
bool MacGui::initialize() {
|
||||
return _impl->initialize();
|
||||
}
|
||||
|
||||
void MacGui::reset() {
|
||||
_impl->reset();
|
||||
}
|
||||
|
||||
void MacGui::update(int delta) {
|
||||
_impl->update(delta);
|
||||
}
|
||||
|
||||
void MacGui::updateWindowManager() {
|
||||
_impl->updateWindowManager();
|
||||
}
|
||||
|
||||
void MacGui::resetAfterLoad() {
|
||||
_impl->resetAfterLoad();
|
||||
}
|
||||
|
||||
bool MacGui::handleEvent(Common::Event event) {
|
||||
return _impl->handleEvent(event);
|
||||
}
|
||||
|
||||
void MacGui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
|
||||
_impl->setupCursor(width, height, hotspotX, hotspotY, animate);
|
||||
}
|
||||
|
||||
void MacGui::setPaletteDirty() {
|
||||
_impl->setPaletteDirty();
|
||||
}
|
||||
|
||||
const Graphics::Font *MacGui::getFontByScummId(int32 id) {
|
||||
return _impl->getFontByScummId(id);
|
||||
}
|
||||
|
||||
void MacGui::drawBanner(char *message) {
|
||||
_impl->drawBanner(message);
|
||||
}
|
||||
|
||||
void MacGui::undrawBanner() {
|
||||
_impl->undrawBanner();
|
||||
}
|
||||
|
||||
Graphics::Surface *MacGui::textArea() const {
|
||||
return _impl->textArea();
|
||||
}
|
||||
|
||||
bool MacGui::runQuitDialog() {
|
||||
return _impl->runQuitDialog();
|
||||
}
|
||||
|
||||
bool MacGui::runRestartDialog() {
|
||||
return _impl->runRestartDialog();
|
||||
}
|
||||
|
||||
void MacGui::runDraftsInventory() {
|
||||
((MacLoomGui *)_impl)->runDraftsInventory();
|
||||
}
|
||||
|
||||
void MacGui::clearTextArea() {
|
||||
_impl->clearTextArea();
|
||||
}
|
||||
|
||||
void MacGui::initTextAreaForActor(Actor *a, byte color) {
|
||||
_impl->initTextAreaForActor(a, color);
|
||||
}
|
||||
|
||||
void MacGui::printCharToTextArea(int chr, int x, int y, int color) {
|
||||
_impl->printCharToTextArea(chr, x, y, color);
|
||||
}
|
||||
|
||||
bool MacGui::isVerbGuiActive() const {
|
||||
return _impl->isVerbGuiActive();
|
||||
}
|
||||
|
||||
} // End of namespace Scumm
|
||||
84
engines/scumm/macgui/macgui.h
Normal file
84
engines/scumm/macgui/macgui.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SCUMM_MACGUI_MACGUI_H
|
||||
#define SCUMM_MACGUI_MACGUI_H
|
||||
|
||||
#include "common/events.h"
|
||||
#include "common/str.h"
|
||||
|
||||
namespace Graphics {
|
||||
class Font;
|
||||
struct Surface;
|
||||
}
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
class ScummEngine;
|
||||
class Actor;
|
||||
class MacGuiImpl;
|
||||
|
||||
class MacGui {
|
||||
friend class ScummEngine;
|
||||
|
||||
private:
|
||||
MacGuiImpl *_impl = nullptr;
|
||||
|
||||
public:
|
||||
MacGui(ScummEngine *vm, const Common::Path &resourceFile);
|
||||
~MacGui();
|
||||
|
||||
int getNumColors() const;
|
||||
|
||||
bool initialize();
|
||||
void reset();
|
||||
void update(int delta);
|
||||
void updateWindowManager();
|
||||
|
||||
void resetAfterLoad();
|
||||
bool handleEvent(Common::Event event);
|
||||
|
||||
void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate);
|
||||
|
||||
void setPaletteDirty();
|
||||
|
||||
const Graphics::Font *getFontByScummId(int32 id);
|
||||
|
||||
void drawBanner(char *message);
|
||||
void undrawBanner();
|
||||
|
||||
bool runQuitDialog();
|
||||
bool runRestartDialog();
|
||||
|
||||
// Indiana Jones and the Last Crusade
|
||||
bool isVerbGuiActive() const;
|
||||
|
||||
Graphics::Surface *textArea() const;
|
||||
void clearTextArea();
|
||||
void initTextAreaForActor(Actor *a, byte color);
|
||||
void printCharToTextArea(int chr, int x, int y, int color);
|
||||
|
||||
// Loom
|
||||
void runDraftsInventory();
|
||||
};
|
||||
|
||||
} // End of namespace Scumm
|
||||
#endif
|
||||
53
engines/scumm/macgui/macgui_colors.h
Normal file
53
engines/scumm/macgui/macgui_colors.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SCUMM_MACGUI_COLORS_H
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
// Colors used by the 16 color Mac games. Nothing that is ever drawn by
|
||||
// 256 color games should use these!
|
||||
|
||||
#define kBlack 0
|
||||
#define kBlue 1
|
||||
#define kGreen 2
|
||||
#define kCyan 3
|
||||
#define kRed 4
|
||||
#define kMagenta 5
|
||||
#define kBrown 6
|
||||
#define kLightGray 7
|
||||
#define kDarkGray 8
|
||||
#define kBrightBlue 9
|
||||
#define kBrightGreen 10
|
||||
#define kBrightCyan 11
|
||||
#define kBrightRed 12
|
||||
#define kBrightMagenta 13
|
||||
#define kBrightYellow 14
|
||||
#define kWhite 15
|
||||
|
||||
// Gray or checkerboard
|
||||
#define kBackground 254
|
||||
|
||||
#define kTransparency 255
|
||||
|
||||
} // End of namespace Scumm
|
||||
|
||||
#endif
|
||||
1010
engines/scumm/macgui/macgui_dialogwindow.cpp
Normal file
1010
engines/scumm/macgui/macgui_dialogwindow.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1338
engines/scumm/macgui/macgui_impl.cpp
Normal file
1338
engines/scumm/macgui/macgui_impl.cpp
Normal file
File diff suppressed because it is too large
Load Diff
841
engines/scumm/macgui/macgui_impl.h
Normal file
841
engines/scumm/macgui/macgui_impl.h
Normal file
@@ -0,0 +1,841 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SCUMM_MACGUI_MACGUI_IMPL_H
|
||||
#define SCUMM_MACGUI_MACGUI_IMPL_H
|
||||
|
||||
#define TEXT_END_MARKER { 0, 0, kStyleRegular, Graphics::kTextAlignLeft, nullptr }
|
||||
|
||||
#include "common/events.h"
|
||||
#include "common/hashmap.h"
|
||||
#include "common/rect.h"
|
||||
#include "common/str.h"
|
||||
#include "common/str-array.h"
|
||||
|
||||
#include "engines/engine.h"
|
||||
|
||||
#include "graphics/font.h"
|
||||
#include "graphics/surface.h"
|
||||
|
||||
class OSystem;
|
||||
|
||||
namespace Graphics {
|
||||
struct Surface;
|
||||
class Palette;
|
||||
class MacWindowManager;
|
||||
class MacMenu;
|
||||
}
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
class ScummEngine;
|
||||
class Actor;
|
||||
|
||||
class MacGuiImpl {
|
||||
public:
|
||||
class MacDialogWindow;
|
||||
|
||||
enum MacStringIds {
|
||||
kMSISkip = -1,
|
||||
kMSIAboutGameName = 1,
|
||||
kMSIRoughCommandMsg,
|
||||
kMSIAreYouSureYouWantToQuit,
|
||||
kMSIAreYouSureYouWantToRestart,
|
||||
kMSIGameName,
|
||||
kMSIOpenGameFile,
|
||||
kMSISaveGameFileAs,
|
||||
kMSIGameFile,
|
||||
kMSIAboutString1,
|
||||
kMSIAboutString2,
|
||||
kMSIAboutString3,
|
||||
kMSIAboutString4,
|
||||
kMSIAboutString5,
|
||||
kMSIAboutString6,
|
||||
kMSIAboutString7,
|
||||
kMSIAboutString8,
|
||||
kMSIAboutString9,
|
||||
kMSIAboutString10,
|
||||
kMSIAboutString11,
|
||||
kMSIAboutString12,
|
||||
kMSIAboutString13,
|
||||
kMSIAboutString14,
|
||||
kMSIAboutString15,
|
||||
kMSIAboutString16,
|
||||
kMSIAboutString17,
|
||||
kMSIAboutString18,
|
||||
kMSIAboutString19,
|
||||
kMSIAboutString20,
|
||||
kMSIAboutString21,
|
||||
kMSIAboutString22,
|
||||
kMSIAboutString23,
|
||||
kMSIAboutString24,
|
||||
kMSIAboutString25,
|
||||
kMSIAboutString26,
|
||||
kMSIAboutString27,
|
||||
kMSIAboutString28,
|
||||
kMSIAboutString29,
|
||||
kMSIAboutString30,
|
||||
kMSIAboutString31,
|
||||
kMSIAboutString32,
|
||||
kMSIAboutString33,
|
||||
kMSIAboutString34,
|
||||
kMSIAboutString35,
|
||||
kMSIAboutString36,
|
||||
kMSIAboutString37,
|
||||
kMSIAboutString38,
|
||||
kMSIAboutString39,
|
||||
kMSIAboutString40
|
||||
};
|
||||
|
||||
enum ParsingMethod {
|
||||
kStrC,
|
||||
kStrPascal,
|
||||
};
|
||||
|
||||
struct MacSTRSParsingEntry {
|
||||
MacStringIds strId;
|
||||
ParsingMethod parsingMethod;
|
||||
int numStrings;
|
||||
};
|
||||
|
||||
enum MacWidgetType {
|
||||
kWidgetUnknown,
|
||||
kWidgetButton,
|
||||
kWidgetCheckbox,
|
||||
kWidgetStaticText,
|
||||
kWidgetEditText,
|
||||
kWidgetIcon,
|
||||
kWidgetImage,
|
||||
kWidgetSlider,
|
||||
kWidgetListBox,
|
||||
kWidgetImageSlider,
|
||||
kWidgetPopUpMenu
|
||||
};
|
||||
|
||||
virtual void onMenuOpen();
|
||||
virtual void onMenuClose();
|
||||
|
||||
protected:
|
||||
ScummEngine *_vm = nullptr;
|
||||
OSystem *_system = nullptr;
|
||||
|
||||
Graphics::Surface *_surface = nullptr;
|
||||
MacGuiImpl::MacDialogWindow *_bannerWindow = nullptr;
|
||||
|
||||
Common::Path _resourceFile;
|
||||
|
||||
bool _paletteDirty = false;
|
||||
bool _suspendPaletteUpdates = false;
|
||||
|
||||
bool _menuIsActive = false;
|
||||
bool _cursorWasVisible = false;
|
||||
|
||||
Common::HashMap<int, const Graphics::Font *> _fonts;
|
||||
Common::Array<Common::String> _strsStrings;
|
||||
|
||||
int _gameFontId = -1;
|
||||
|
||||
byte _unicodeToMacRoman[96];
|
||||
|
||||
enum DelayStatus {
|
||||
kDelayDone = 0,
|
||||
kDelayInterrupted = 1,
|
||||
kDelayAborted
|
||||
};
|
||||
|
||||
enum FontId {
|
||||
kSystemFont,
|
||||
|
||||
kAboutFontRegular,
|
||||
kAboutFontBold,
|
||||
kAboutFontBold2,
|
||||
kAboutFontExtraBold,
|
||||
kAboutFontHeaderInside,
|
||||
kAboutFontHeaderOutside,
|
||||
kAboutFontHeader,
|
||||
kAboutFontHeaderSimple1,
|
||||
kAboutFontHeaderSimple2,
|
||||
|
||||
kIndy3FontSmall,
|
||||
kIndy3FontMedium,
|
||||
kIndy3VerbFontRegular,
|
||||
kIndy3VerbFontBold,
|
||||
kIndy3VerbFontOutline,
|
||||
|
||||
kLoomFontSmall,
|
||||
kLoomFontMedium,
|
||||
kLoomFontLarge
|
||||
};
|
||||
|
||||
enum TextStyle {
|
||||
kStyleHeader1,
|
||||
kStyleHeader2,
|
||||
kStyleHeaderSimple1,
|
||||
kStyleHeaderSimple2,
|
||||
kStyleBold,
|
||||
kStyleBold2,
|
||||
kStyleExtraBold,
|
||||
kStyleRegular
|
||||
};
|
||||
|
||||
struct TextLine {
|
||||
int x;
|
||||
int y;
|
||||
TextStyle style;
|
||||
Graphics::TextAlign align;
|
||||
const char *str;
|
||||
};
|
||||
|
||||
enum MacDialogWindowStyle {
|
||||
kWindowStyleNormal,
|
||||
kWindowStyleRounded
|
||||
};
|
||||
|
||||
enum MacDialogMenuStyle {
|
||||
kMenuStyleNone,
|
||||
kMenuStyleDisabled,
|
||||
kMenuStyleApple
|
||||
};
|
||||
|
||||
MacGuiImpl::DelayStatus delay(uint32 ms = 0);
|
||||
|
||||
virtual bool getFontParams(FontId fontId, int &id, int &size, int &slant) const;
|
||||
|
||||
virtual bool handleMenu(int id, Common::String &name);
|
||||
|
||||
// For older games, there is no problem with displaying the Mac GUI and
|
||||
// the game at the same time. For newer, there is.
|
||||
virtual void saveScreen() {}
|
||||
virtual void restoreScreen() {}
|
||||
|
||||
virtual void runAboutDialog() = 0;
|
||||
virtual bool runOpenDialog(int &saveSlotToHandle);
|
||||
virtual bool runSaveDialog(int &saveSlotToHandle, Common::String &saveName);
|
||||
virtual bool runOptionsDialog() = 0;
|
||||
void prepareSaveLoad(Common::StringArray &savegameNames, bool *availSlots, int *slotIds, int size);
|
||||
|
||||
bool runOkCancelDialog(Common::String text);
|
||||
|
||||
virtual bool readStrings();
|
||||
void parseSTRSBlock(uint8 *strsData, const MacSTRSParsingEntry *parsingTable, int parsingTableSize);
|
||||
|
||||
void addMenu(Graphics::MacMenu *menu, int menuId);
|
||||
|
||||
// These are non interactable, no point in having them as widgets for now...
|
||||
void drawFakePathList(MacDialogWindow *window, Common::Rect r, const char *text);
|
||||
void drawFakeDriveLabel(MacDialogWindow *window, Common::Rect r, const char *text);
|
||||
|
||||
Graphics::Surface *createRemappedSurface(const Graphics::Surface *surface, const byte *palette, uint colorCount);
|
||||
|
||||
bool setupResourceCursor(int id, int &width, int &height, int &hotspotX, int &hotspotY, int &animate);
|
||||
|
||||
public:
|
||||
class MacGuiObject {
|
||||
protected:
|
||||
Common::Rect _bounds;
|
||||
bool _redraw = false;
|
||||
bool _enabled = false;
|
||||
bool _visible = true;
|
||||
|
||||
public:
|
||||
MacGuiObject(Common::Rect bounds, bool enabled) : _bounds(bounds), _enabled(enabled) {}
|
||||
virtual ~MacGuiObject() {}
|
||||
|
||||
Common::Rect getBounds() const { return _bounds; }
|
||||
bool getRedraw() const { return _redraw; }
|
||||
bool isEnabled() const { return _enabled; }
|
||||
bool isVisible() const { return _visible; }
|
||||
};
|
||||
|
||||
class MacWidget : public MacGuiObject {
|
||||
protected:
|
||||
MacGuiImpl::MacDialogWindow *_window;
|
||||
uint32 _black;
|
||||
uint32 _white;
|
||||
|
||||
int _id = -1;
|
||||
MacWidgetType _type = kWidgetUnknown;
|
||||
|
||||
bool _fullRedraw = false;
|
||||
|
||||
Common::String _text;
|
||||
int _oldValue = 0;
|
||||
int _value = 0;
|
||||
|
||||
int drawText(Common::String text, int x, int y, int w, uint32 fg = 0, uint32 bg = 0, Graphics::TextAlign align = Graphics::kTextAlignLeft, bool wordWrap = false, int deltax = 0) const;
|
||||
void drawBitmap(Common::Rect r, const uint16 *bitmap, uint32 color) const;
|
||||
|
||||
public:
|
||||
MacWidget(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, bool enabled);
|
||||
virtual ~MacWidget() {};
|
||||
|
||||
void setId(int id) { _id = id; }
|
||||
int getId() const { return _id; }
|
||||
|
||||
void setType(MacWidgetType type) { _type = type; }
|
||||
MacWidgetType getType() { return _type; }
|
||||
|
||||
// Visibility never changes after initialization, so it does
|
||||
// not trigger a redraw.
|
||||
void setVisible(bool visible) { _visible = visible; }
|
||||
|
||||
virtual void getFocus() { setRedraw(); }
|
||||
virtual void loseFocus() { setRedraw(); }
|
||||
|
||||
virtual void setRedraw(bool fullRedraw = false);
|
||||
|
||||
void setEnabled(bool enabled);
|
||||
|
||||
virtual void setValue(int value);
|
||||
int getValue() const { return _value; }
|
||||
|
||||
void rememberValue() {
|
||||
_oldValue = _value;
|
||||
}
|
||||
|
||||
bool valueHasChanged() {
|
||||
return _oldValue != _value;
|
||||
}
|
||||
|
||||
Common::String getText() const;
|
||||
|
||||
virtual bool useBeamCursor() { return false; }
|
||||
virtual bool findWidget(int x, int y) const;
|
||||
virtual bool reactsToKeyDown() { return false; }
|
||||
|
||||
virtual void draw(bool drawFocused = false) = 0;
|
||||
|
||||
virtual void handleMouseDown(Common::Event &event) {}
|
||||
virtual bool handleDoubleClick(Common::Event &event) { return false; }
|
||||
virtual bool handleMouseUp(Common::Event &event) { return false; }
|
||||
virtual void handleMouseMove(Common::Event &event) {}
|
||||
virtual void handleMouseHeld() {}
|
||||
virtual void handleWheelUp() {}
|
||||
virtual void handleWheelDown() {}
|
||||
virtual bool handleKeyDown(Common::Event &event) { return false; }
|
||||
};
|
||||
|
||||
class MacButton : public MacWidget {
|
||||
private:
|
||||
struct CornerLine {
|
||||
int start;
|
||||
int length;
|
||||
};
|
||||
|
||||
void hLine(int x0, int y0, int x1, bool enabled);
|
||||
void vLine(int x0, int y0, int y1, bool enabled);
|
||||
void drawCorners(Common::Rect r, CornerLine *corner, bool enabled);
|
||||
|
||||
public:
|
||||
MacButton(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, bool enabled) : MacWidget(window, bounds, text, enabled) {}
|
||||
|
||||
void draw(bool drawFocused = false) override;
|
||||
|
||||
bool handleMouseUp(Common::Event &event) override { return true; }
|
||||
};
|
||||
|
||||
class MacCheckbox : public MacWidget {
|
||||
private:
|
||||
Common::Rect _hitBounds;
|
||||
|
||||
public:
|
||||
MacCheckbox(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, bool enabled);
|
||||
|
||||
bool findWidget(int x, int y) const override;
|
||||
void draw(bool drawFocused = false) override;
|
||||
bool handleMouseUp(Common::Event &event) override;
|
||||
};
|
||||
|
||||
// The dialogs add texts as disabled, but we don't want it to be drawn
|
||||
// as disabled so we enable it and make it "disabled" by giving it a
|
||||
// custom findWidget().
|
||||
|
||||
class MacStaticText : public MacWidget {
|
||||
private:
|
||||
uint32 _fg;
|
||||
uint32 _bg;
|
||||
Graphics::TextAlign _alignment = Graphics::kTextAlignLeft;
|
||||
bool _wordWrap = true;
|
||||
|
||||
public:
|
||||
MacStaticText(
|
||||
MacGuiImpl::MacDialogWindow *window,
|
||||
Common::Rect bounds, Common::String text,
|
||||
bool enabled, Graphics::TextAlign alignment = Graphics::kTextAlignLeft) : MacWidget(window, bounds, text, true) {
|
||||
_alignment = alignment;
|
||||
_fg = _black;
|
||||
_bg = _white;
|
||||
}
|
||||
|
||||
void getFocus() override {}
|
||||
void loseFocus() override {}
|
||||
|
||||
void setWordWrap(bool wordWrap) { _wordWrap = wordWrap; }
|
||||
|
||||
void setText(Common::String text) {
|
||||
if (text != _text) {
|
||||
_text = text;
|
||||
setRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
void setColor(uint32 fg, uint32 bg) {
|
||||
if (fg != _fg || bg != _bg) {
|
||||
_fg = fg;
|
||||
_bg = bg;
|
||||
setRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
void draw(bool drawFocused = false) override;
|
||||
};
|
||||
|
||||
class MacEditText : public MacWidget {
|
||||
private:
|
||||
// Max length of a SCUMM saved game name. We could make this
|
||||
// configurable later, if needed.
|
||||
uint _maxLength = 31;
|
||||
|
||||
int _textPos = 1;
|
||||
int _selectLen = 0;
|
||||
int _caretPos = 0;
|
||||
int _caretX = -1;
|
||||
|
||||
uint32 _nextCaretBlink = 0;
|
||||
bool _caretVisible = true;
|
||||
|
||||
const Graphics::Font *_font;
|
||||
Graphics::Surface _textSurface;
|
||||
|
||||
int getTextPosFromMouse(int x, int y);
|
||||
|
||||
void updateSelection(int x, int y);
|
||||
void deleteSelection();
|
||||
|
||||
public:
|
||||
MacEditText(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, bool enabled);
|
||||
|
||||
void getFocus() override {}
|
||||
void loseFocus() override {}
|
||||
|
||||
void selectAll();
|
||||
|
||||
bool useBeamCursor() override { return true; }
|
||||
bool findWidget(int x, int y) const override;
|
||||
bool reactsToKeyDown() override { return true; }
|
||||
|
||||
void draw(bool drawFocused = false) override;
|
||||
|
||||
void handleMouseDown(Common::Event &event) override;
|
||||
bool handleDoubleClick(Common::Event &event) override;
|
||||
bool handleKeyDown(Common::Event &event) override;
|
||||
void handleMouseHeld() override;
|
||||
void handleMouseMove(Common::Event &event) override;
|
||||
};
|
||||
|
||||
class MacImage : public MacWidget {
|
||||
private:
|
||||
Graphics::Surface *_image = nullptr;
|
||||
Graphics::Surface *_mask = nullptr;
|
||||
|
||||
public:
|
||||
MacImage(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Graphics::Surface *surface, Graphics::Surface *mask, bool enabled);
|
||||
~MacImage();
|
||||
|
||||
Graphics::Surface *getImage() const { return _image; }
|
||||
Graphics::Surface *getMask() const { return _mask; }
|
||||
|
||||
void draw(bool drawFocused = false) override;
|
||||
};
|
||||
|
||||
class MacSliderBase : public MacWidget {
|
||||
protected:
|
||||
int _minValue;
|
||||
int _maxValue;
|
||||
int _minPos;
|
||||
int _maxPos;
|
||||
int _handlePos = -1;
|
||||
int _grabOffset = -1;
|
||||
|
||||
Common::HashMap<int, int> _posToValue;
|
||||
Common::HashMap<int, int> _valueToPos;
|
||||
|
||||
int calculateValueFromPos(int pos) const;
|
||||
int calculatePosFromValue(int value) const;
|
||||
int calculateValueFromPos() const;
|
||||
int calculatePosFromValue() const;
|
||||
|
||||
public:
|
||||
MacSliderBase(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, int minValue, int maxValue, int minPos, int maxPos, bool enabled)
|
||||
: MacWidget(window, bounds, "SliderBase", enabled),
|
||||
_minValue(minValue), _maxValue(maxValue),
|
||||
_minPos(minPos), _maxPos(maxPos) {}
|
||||
|
||||
virtual ~MacSliderBase() {
|
||||
_posToValue.clear();
|
||||
_valueToPos.clear();
|
||||
}
|
||||
|
||||
void getFocus() override {}
|
||||
void loseFocus() override {}
|
||||
|
||||
int getMinValue() const { return _minValue; }
|
||||
int getMaxValue() const { return _maxValue; }
|
||||
void setValue(int value) override;
|
||||
|
||||
void addStop(int pos, int value) {
|
||||
_posToValue[pos] = value;
|
||||
_valueToPos[value] = pos;
|
||||
}
|
||||
};
|
||||
|
||||
class MacSlider : public MacSliderBase {
|
||||
private:
|
||||
Common::Point _clickPos;
|
||||
uint32 _nextRepeat = 0;
|
||||
|
||||
int _pageSize = 0;
|
||||
int _paging = 0;
|
||||
|
||||
bool _upArrowPressed = false;
|
||||
bool _downArrowPressed = false;
|
||||
|
||||
Common::Rect _boundsButtonUp;
|
||||
Common::Rect _boundsButtonDown;
|
||||
Common::Rect _boundsBody;
|
||||
|
||||
Common::Rect getHandleRect(int value);
|
||||
|
||||
void fill(Common::Rect r, bool inverted = false);
|
||||
|
||||
void drawUpArrow(bool markAsDirty);
|
||||
void drawDownArrow(bool markAsDirty);
|
||||
void drawArrow(Common::Rect r, const uint16 *bitmap, bool markAsDirty);
|
||||
|
||||
void eraseDragHandle();
|
||||
void drawHandle(Common::Rect r);
|
||||
|
||||
public:
|
||||
MacSlider(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, int minValue, int maxValue, int pageSize, bool enabled);
|
||||
|
||||
bool isScrollable() const { return (_maxValue - _minValue) > 0; }
|
||||
int getPageSize() const { return _pageSize; }
|
||||
|
||||
bool findWidget(int x, int y) const override;
|
||||
void draw(bool drawFocued = false) override;
|
||||
void redrawHandle(int oldValue, int newValue);
|
||||
|
||||
void handleMouseDown(Common::Event &event) override;
|
||||
bool handleMouseUp(Common::Event &event) override;
|
||||
void handleMouseMove(Common::Event &event) override;
|
||||
void handleMouseHeld() override;
|
||||
void handleWheelUp() override;
|
||||
void handleWheelDown() override;
|
||||
};
|
||||
|
||||
class MacImageSlider : public MacSliderBase {
|
||||
private:
|
||||
Graphics::Surface *_background;
|
||||
MacImage *_handle;
|
||||
int _minX;
|
||||
int _maxX;
|
||||
bool _freeBackground = false;
|
||||
bool _snapWhileDragging = false;
|
||||
|
||||
void eraseHandle();
|
||||
void drawHandle();
|
||||
|
||||
public:
|
||||
MacImageSlider(MacGuiImpl::MacDialogWindow *window, MacImage *background, MacImage *handle, bool enabled, int minX, int maxX, int minValue, int maxValue, int leftMargin, int rightMargin)
|
||||
: MacSliderBase(window, background->getBounds(), minValue, maxValue, minX + leftMargin, maxX - rightMargin, enabled),
|
||||
_background(background->getImage()), _handle(handle), _minX(minX), _maxX(maxX) {}
|
||||
MacImageSlider(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, MacImage *handle, bool enabled, int minX, int maxX, int minValue, int maxValue);
|
||||
~MacImageSlider();
|
||||
|
||||
void setValue(int value) override;
|
||||
|
||||
bool findWidget(int x, int y) const override;
|
||||
void draw(bool drawFocused = false) override;
|
||||
|
||||
void setSnapWhileDragging(bool snap) { _snapWhileDragging = snap; }
|
||||
|
||||
void handleMouseDown(Common::Event &event) override;
|
||||
bool handleMouseUp(Common::Event &event) override;
|
||||
void handleMouseMove(Common::Event &event) override;
|
||||
void handleWheelUp() override;
|
||||
void handleWheelDown() override;
|
||||
};
|
||||
|
||||
class MacListBox : public MacWidget {
|
||||
private:
|
||||
Common::StringArray _texts;
|
||||
Common::Array<MacStaticText *> _textWidgets;
|
||||
MacSlider *_slider;
|
||||
bool _sliderFocused = false;
|
||||
|
||||
void updateTexts();
|
||||
void handleWheel(int distance);
|
||||
|
||||
public:
|
||||
MacListBox(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::StringArray texts, bool enabled, bool contentUntouchable = true);
|
||||
~MacListBox();
|
||||
|
||||
void getFocus() override {}
|
||||
void loseFocus() override {}
|
||||
|
||||
void setValue(int value) override {
|
||||
if (value != _value) {
|
||||
_value = value;
|
||||
updateTexts();
|
||||
}
|
||||
}
|
||||
|
||||
bool findWidget(int x, int y) const override;
|
||||
void setRedraw(bool fullRedraw = false) override;
|
||||
void draw(bool drawFocused = false) override;
|
||||
|
||||
void handleMouseDown(Common::Event &event) override;
|
||||
bool handleDoubleClick(Common::Event &event) override;
|
||||
bool handleMouseUp(Common::Event &event) override;
|
||||
void handleMouseMove(Common::Event &event) override;
|
||||
void handleMouseHeld() override;
|
||||
void handleWheelUp() override;
|
||||
void handleWheelDown() override;
|
||||
bool handleKeyDown(Common::Event &event) override;
|
||||
};
|
||||
|
||||
class MacPopUpMenu : public MacWidget {
|
||||
private:
|
||||
Common::StringArray _texts;
|
||||
int _textWidth;
|
||||
bool _menuVisible = false;
|
||||
int _selected;
|
||||
Graphics::Surface _popUpBackground;
|
||||
Common::Rect _popUpBounds;
|
||||
|
||||
public:
|
||||
MacPopUpMenu(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, int textWidth, Common::StringArray texts, bool enabled);
|
||||
~MacPopUpMenu();
|
||||
|
||||
bool findWidget(int x, int y) const override;
|
||||
void draw(bool drawFocused = false) override;
|
||||
|
||||
void handleMouseDown(Common::Event &event) override;
|
||||
bool handleMouseUp(Common::Event &event) override;
|
||||
void handleMouseMove(Common::Event &event) override;
|
||||
};
|
||||
|
||||
enum MacDialogEventType {
|
||||
kDialogClick,
|
||||
kDialogValueChange,
|
||||
kDialogKeyDown
|
||||
};
|
||||
|
||||
struct MacDialogEvent {
|
||||
MacWidget *widget;
|
||||
MacDialogEventType type;
|
||||
};
|
||||
|
||||
class MacDialogWindow {
|
||||
private:
|
||||
Common::Queue<MacDialogEvent> _eventQueue;
|
||||
uint32 _black;
|
||||
uint32 _white;
|
||||
|
||||
bool _shakeWasEnabled;
|
||||
|
||||
Common::Rect _bounds;
|
||||
int _margin;
|
||||
|
||||
bool _visible = false;
|
||||
|
||||
uint32 _lastClickTime = 0;
|
||||
Common::Point _lastClickPos;
|
||||
|
||||
Graphics::Surface *_beamCursor = nullptr;
|
||||
Common::Point _beamCursorPos;
|
||||
bool _cursorWasVisible = false;
|
||||
bool _beamCursorVisible = false;
|
||||
const int _beamCursorHotspotX = 3;
|
||||
const int _beamCursorHotspotY = 4;
|
||||
|
||||
void drawBeamCursor();
|
||||
void undrawBeamCursor();
|
||||
|
||||
PauseToken _pauseToken;
|
||||
|
||||
Graphics::Surface *_from = nullptr;
|
||||
Graphics::Surface *_backup = nullptr;
|
||||
Graphics::Surface _surface;
|
||||
Graphics::Surface _innerSurface;
|
||||
|
||||
Common::Array<MacWidget *> _widgets;
|
||||
|
||||
MacWidget *_defaultWidget = nullptr;
|
||||
|
||||
MacWidget *_focusedWidget = nullptr;
|
||||
Common::Point _focusClick;
|
||||
Common::Point _oldMousePos;
|
||||
Common::Point _mousePos;
|
||||
Common::Point _realMousePos;
|
||||
|
||||
Common::StringArray _substitutions;
|
||||
Common::Array<Common::Rect> _dirtyRects;
|
||||
bool _dirtyPalette = false;
|
||||
|
||||
void queueEvent(MacGuiImpl::MacWidget *widget, MacGuiImpl::MacDialogEventType type);
|
||||
|
||||
void copyToScreen(Graphics::Surface *s = nullptr) const;
|
||||
|
||||
void addWidget(MacWidget *widget, MacWidgetType type);
|
||||
|
||||
public:
|
||||
OSystem *_system;
|
||||
MacGuiImpl *_gui;
|
||||
|
||||
MacDialogWindow(MacGuiImpl *gui, OSystem *system, Graphics::Surface *from, Common::Rect bounds, MacDialogWindowStyle windowStyle = kWindowStyleNormal, MacDialogMenuStyle menuStyle = kMenuStyleDisabled);
|
||||
~MacDialogWindow();
|
||||
|
||||
Graphics::Surface *surface() { return &_surface; }
|
||||
Graphics::Surface *innerSurface() { return &_innerSurface; }
|
||||
|
||||
bool isVisible() const { return _visible; }
|
||||
|
||||
void show();
|
||||
bool runDialog(MacDialogEvent &dialogEvent);
|
||||
void delayAndUpdate();
|
||||
void updateCursor();
|
||||
|
||||
uint getNumWidgets() const { return _widgets.size(); }
|
||||
|
||||
MacWidget *getWidget(uint nr) const;
|
||||
MacWidget *getWidget(MacWidgetType type, uint nr = 0) const;
|
||||
|
||||
void setDefaultWidget(MacWidget *widget) { _defaultWidget = widget; }
|
||||
MacWidget *getDefaultWidget() const { return _defaultWidget; }
|
||||
|
||||
void setFocusedWidget(int x, int y);
|
||||
void clearFocusedWidget();
|
||||
MacWidget *getFocusedWidget() const { return _focusedWidget; }
|
||||
Common::Point getFocusClick() const { return _focusClick; }
|
||||
Common::Point getMousePos() const { return _mousePos; }
|
||||
|
||||
int findWidget(int x, int y) const;
|
||||
|
||||
MacGuiImpl::MacButton *addButton(Common::Rect bounds, Common::String text, bool enabled);
|
||||
MacGuiImpl::MacCheckbox *addCheckbox(Common::Rect bounds, Common::String text, bool enabled);
|
||||
MacGuiImpl::MacStaticText *addStaticText(Common::Rect bounds, Common::String text, bool enabled, Graphics::TextAlign alignment = Graphics::kTextAlignLeft);
|
||||
MacGuiImpl::MacEditText *addEditText(Common::Rect bounds, Common::String text, bool enabled);
|
||||
MacGuiImpl::MacImage *addIcon(int x, int y, int id, bool enabled);
|
||||
MacGuiImpl::MacImage *addPicture(Common::Rect bounds, int id, bool enabled);
|
||||
MacGuiImpl::MacSlider *addSlider(int x, int y, int h, int minValue, int maxValue, int pageSize, bool enabled);
|
||||
MacGuiImpl::MacImageSlider *addImageSlider(int backgroundId, int handleId, bool enabled, int minX, int maxX, int minValue, int maxValue, int leftMargin = 0, int rightMargin = 0);
|
||||
MacGuiImpl::MacImageSlider *addImageSlider(Common::Rect bounds, MacImage *handle, bool enabled, int minX, int maxX, int minValue, int maxValue);
|
||||
MacGuiImpl::MacListBox *addListBox(Common::Rect bounds, Common::StringArray texts, bool enabled, bool contentUntouchable = false);
|
||||
MacGuiImpl::MacPopUpMenu *addPopUpMenu(Common::Rect bounds, Common::String text, int textWidth, Common::StringArray texts, bool enabled);
|
||||
|
||||
void addControl(Common::Rect bounds, uint16 controlId);
|
||||
|
||||
void addSubstitution(Common::String text) { _substitutions.push_back(text); }
|
||||
void replaceSubstitution(int nr, Common::String text) { _substitutions[nr] = text; }
|
||||
|
||||
bool hasSubstitution(uint n) const { return n < _substitutions.size(); }
|
||||
Common::String &getSubstitution(uint n) { return _substitutions[n]; }
|
||||
|
||||
void markRectAsDirty(Common::Rect r);
|
||||
void update(bool fullRedraw = false);
|
||||
|
||||
void drawPatternRoundRect(const Common::Rect &rect, int arc, uint32 color, bool filled, bool darkenOnly);
|
||||
|
||||
void drawDottedHLine(int x0, int y, int x1);
|
||||
void fillPattern(Common::Rect r, uint16 pattern, bool fillBlack = true, bool fillWhite = true);
|
||||
void drawSprite(const MacImage *image, int x, int y);
|
||||
void drawSprite(const Graphics::Surface *sprite, int x, int y);
|
||||
void drawSprite(const Graphics::Surface *sprite, int x, int y, Common::Rect clipRect);
|
||||
void drawTexts(Common::Rect r, const TextLine *lines, bool inverse = false);
|
||||
void drawTextBox(Common::Rect r, const TextLine *lines, bool inverse = false, int arc = 9);
|
||||
};
|
||||
|
||||
MacGuiImpl(ScummEngine *vm, const Common::Path &resourceFile);
|
||||
virtual ~MacGuiImpl();
|
||||
|
||||
Graphics::MacWindowManager *_windowManager = nullptr;
|
||||
|
||||
virtual int getNumColors() const = 0;
|
||||
|
||||
Graphics::Surface *surface() { return _surface; }
|
||||
virtual uint32 getBlack() const;
|
||||
virtual uint32 getWhite() const;
|
||||
|
||||
uint32 _macWhite;
|
||||
uint32 _macBlack;
|
||||
|
||||
virtual const Common::String name() const = 0;
|
||||
|
||||
Common::String readCString(uint8 *&data);
|
||||
Common::String readPascalString(uint8 *&data);
|
||||
|
||||
int toMacRoman(int unicode) const;
|
||||
|
||||
void setPaletteDirty();
|
||||
void updatePalette();
|
||||
|
||||
virtual bool handleEvent(Common::Event event);
|
||||
|
||||
static void menuCallback(int id, Common::String &name, void *data);
|
||||
virtual bool initialize();
|
||||
virtual void updateWindowManager();
|
||||
virtual void updateMenus();
|
||||
|
||||
const Graphics::Font *getFont(FontId fontId);
|
||||
virtual const Graphics::Font *getFontByScummId(int32 id) = 0;
|
||||
|
||||
bool loadIcon(int id, Graphics::Surface **icon, Graphics::Surface **mask);
|
||||
Graphics::Surface *loadPict(int id);
|
||||
|
||||
virtual bool isVerbGuiActive() const { return false; }
|
||||
virtual void reset() {}
|
||||
virtual void resetAfterLoad() = 0;
|
||||
virtual void update(int delta) = 0;
|
||||
|
||||
virtual bool runQuitDialog();
|
||||
virtual bool runRestartDialog();
|
||||
|
||||
virtual void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) = 0;
|
||||
|
||||
virtual Graphics::Surface *textArea() { return nullptr; }
|
||||
virtual void clearTextArea() {}
|
||||
virtual void initTextAreaForActor(Actor *a, byte color) {}
|
||||
virtual void printCharToTextArea(int chr, int x, int y, int color) {}
|
||||
|
||||
void setMacGuiColors(Graphics::Palette &palette);
|
||||
|
||||
MacDialogWindow *createWindow(Common::Rect bounds, MacDialogWindowStyle style = kWindowStyleNormal, MacDialogMenuStyle menuStyle = kMenuStyleDisabled);
|
||||
MacDialogWindow *createDialog(int dialogId);
|
||||
MacDialogWindow *createDialog(int dialogId, Common::Rect bounds);
|
||||
void drawBanner(char *message);
|
||||
void undrawBanner();
|
||||
|
||||
void drawBitmap(Graphics::Surface *s, Common::Rect r, const uint16 *bitmap, uint32 color) const;
|
||||
};
|
||||
|
||||
} // End of namespace Scumm
|
||||
#endif
|
||||
2002
engines/scumm/macgui/macgui_indy3.cpp
Normal file
2002
engines/scumm/macgui/macgui_indy3.cpp
Normal file
File diff suppressed because it is too large
Load Diff
294
engines/scumm/macgui/macgui_indy3.h
Normal file
294
engines/scumm/macgui/macgui_indy3.h
Normal file
@@ -0,0 +1,294 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SCUMM_MACGUI_MACGUI_INDY3_H
|
||||
#define SCUMM_MACGUI_MACGUI_INDY3_H
|
||||
|
||||
#include "common/events.h"
|
||||
#include "common/rect.h"
|
||||
#include "common/str.h"
|
||||
|
||||
#include "graphics/surface.h"
|
||||
|
||||
#include "scumm/macgui/macgui_colors.h"
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
#define INDY3_INVENTORY_SLOT_SIZE 6
|
||||
|
||||
class MacGuiImpl;
|
||||
|
||||
class MacIndy3Gui : public MacGuiImpl {
|
||||
public:
|
||||
enum ScrollDirection {
|
||||
kScrollUp,
|
||||
kScrollDown
|
||||
};
|
||||
|
||||
MacIndy3Gui(ScummEngine *vm, const Common::Path &resourceFile);
|
||||
~MacIndy3Gui();
|
||||
|
||||
const Common::String name() const override { return "Indy"; }
|
||||
int getNumColors() const override { return 16; }
|
||||
|
||||
Graphics::Surface _textArea;
|
||||
|
||||
const Graphics::Font *getFontByScummId(int32 id) override;
|
||||
|
||||
void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) override;
|
||||
|
||||
Graphics::Surface *textArea() override { return &_textArea; }
|
||||
void clearTextArea() override { _textArea.fillRect(Common::Rect(_textArea.w, _textArea.h), kBlack); }
|
||||
void initTextAreaForActor(Actor *a, byte color) override;
|
||||
void printCharToTextArea(int chr, int x, int y, int color) override;
|
||||
|
||||
// There is a distinction between the GUI being allowed and being
|
||||
// active. Allowed means that it's allowed to draw verbs, but not that
|
||||
// it necessarily is. Active means that there are verbs on screen. From
|
||||
// the outside, only the latter is relevant.
|
||||
//
|
||||
// One case where this makes a difference is when boxing with the
|
||||
// coach. During the "10 minutes later" sign, the GUI is active but
|
||||
// it's not drawing verbs, so the SCUMM engine is allowed to draw in
|
||||
// the verb area to clear the power meters and text.
|
||||
|
||||
bool isVerbGuiActive() const override;
|
||||
|
||||
void reset() override;
|
||||
void resetAfterLoad() override;
|
||||
void update(int delta) override;
|
||||
bool handleEvent(Common::Event event) override;
|
||||
|
||||
protected:
|
||||
bool getFontParams(FontId fontId, int &id, int &size, int &slant) const override;
|
||||
|
||||
void updateMenus() override;
|
||||
bool handleMenu(int id, Common::String &name) override;
|
||||
|
||||
void runAboutDialog() override;
|
||||
bool runOpenDialog(int &saveSlotToHandle) override;
|
||||
bool runSaveDialog(int &saveSlotToHandle, Common::String &saveName) override;
|
||||
bool runOptionsDialog() override;
|
||||
bool runIqPointsDialog();
|
||||
|
||||
private:
|
||||
int _verbGuiTop = 0;
|
||||
Graphics::Surface _verbGuiSurface;
|
||||
|
||||
bool _visible = false;
|
||||
|
||||
bool _leftButtonIsPressed = false;
|
||||
Common::Point _leftButtonPressed;
|
||||
Common::Point _leftButtonHeld;
|
||||
|
||||
int _timer = 0;
|
||||
|
||||
bool updateVerbs(int delta);
|
||||
void updateMouseHeldTimer(int delta);
|
||||
void drawVerbs();
|
||||
|
||||
void clearAboutDialog(MacDialogWindow *window);
|
||||
|
||||
int getInventoryScrollOffset() const;
|
||||
void setInventoryScrollOffset(int n) const;
|
||||
|
||||
class Widget : public MacGuiObject {
|
||||
private:
|
||||
int _timer = 0;
|
||||
|
||||
public:
|
||||
static ScummEngine *_vm;
|
||||
static MacIndy3Gui *_gui;
|
||||
static Graphics::Surface *_surface;
|
||||
|
||||
Widget(int x, int y, int width, int height);
|
||||
virtual ~Widget() {}
|
||||
|
||||
void setEnabled(bool enabled) {
|
||||
if (enabled != _enabled)
|
||||
setRedraw(true);
|
||||
if (!_enabled)
|
||||
_timer = 0;
|
||||
_enabled = enabled;
|
||||
}
|
||||
|
||||
void setTimer(int t) { _timer = t; }
|
||||
void clearTimer() { _timer = 0; }
|
||||
bool hasTimer() const { return _timer > 0; }
|
||||
|
||||
virtual void setRedraw(bool redraw) { _redraw = redraw; }
|
||||
|
||||
virtual void reset();
|
||||
|
||||
virtual bool handleEvent(Common::Event &event) = 0;
|
||||
virtual bool handleMouseHeld(Common::Point &pressed, Common::Point &held) { return false; }
|
||||
virtual void updateTimer(int delta);
|
||||
virtual void timeOut() {}
|
||||
|
||||
virtual void draw();
|
||||
virtual void undraw();
|
||||
|
||||
byte translateChar(byte c) const;
|
||||
|
||||
// Primitives
|
||||
void fill(Common::Rect r);
|
||||
void drawBitmap(Common::Rect r, const uint16 *bitmap, byte color) const;
|
||||
void drawShadowBox(Common::Rect r) const;
|
||||
void drawShadowFrame(Common::Rect r, byte shadowColor, byte fillColor);
|
||||
|
||||
void markScreenAsDirty(Common::Rect r) const;
|
||||
};
|
||||
|
||||
class VerbWidget : public Widget {
|
||||
protected:
|
||||
int _verbid = 0;
|
||||
int _verbslot = -1;
|
||||
bool _kill = false;
|
||||
|
||||
public:
|
||||
VerbWidget(int x, int y, int width, int height) : Widget(x, y, width, height) {}
|
||||
|
||||
void setVerbid(int n) { _verbid = n; }
|
||||
bool hasVerb() const { return _verbslot != -1; }
|
||||
void threaten() { _kill = true; }
|
||||
bool isDying() const { return _kill; }
|
||||
|
||||
void reset() override;
|
||||
|
||||
virtual void updateVerb(int verbslot);
|
||||
|
||||
void draw() override;
|
||||
void undraw() override;
|
||||
};
|
||||
|
||||
class Button : public VerbWidget {
|
||||
private:
|
||||
Common::String _text;
|
||||
|
||||
public:
|
||||
Button(int x, int y, int width, int height);
|
||||
|
||||
bool handleEvent(Common::Event &event) override;
|
||||
|
||||
void reset() override;
|
||||
void timeOut() override;
|
||||
void updateVerb(int verbslot) override;
|
||||
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
class Inventory : public VerbWidget {
|
||||
private:
|
||||
class ScrollBar : public Widget {
|
||||
private:
|
||||
int _invCount = 0;
|
||||
int _invOffset = 0;
|
||||
|
||||
public:
|
||||
ScrollBar(int x, int y, int width, int height);
|
||||
|
||||
void setInventoryParameters(int invCount, int invOffset);
|
||||
void scroll(ScrollDirection dir);
|
||||
int getHandlePosition();
|
||||
|
||||
void reset() override;
|
||||
|
||||
bool handleEvent(Common::Event &event) override;
|
||||
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
class ScrollButton : public Widget {
|
||||
public:
|
||||
ScrollDirection _direction;
|
||||
|
||||
ScrollButton(int x, int y, int width, int height, ScrollDirection direction);
|
||||
|
||||
bool handleEvent(Common::Event &event) override;
|
||||
bool handleMouseHeld(Common::Point &pressed, Common::Point &held) override;
|
||||
void timeOut() override;
|
||||
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
class Slot : public Widget {
|
||||
private:
|
||||
Common::String _name;
|
||||
int _slot = -1;
|
||||
int _obj = -1;
|
||||
|
||||
public:
|
||||
Slot(int slot, int x, int y, int width, int height);
|
||||
|
||||
void clearName() { _name.clear(); }
|
||||
bool hasName() const { return !_name.empty(); }
|
||||
|
||||
void clearObject();
|
||||
void setObject(int n);
|
||||
int getObject() const { return _obj; }
|
||||
|
||||
void reset() override;
|
||||
|
||||
bool handleEvent(Common::Event &event) override;
|
||||
void timeOut() override;
|
||||
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
Slot *_slots[INDY3_INVENTORY_SLOT_SIZE];
|
||||
ScrollBar *_scrollBar;
|
||||
ScrollButton *_scrollButtons[2];
|
||||
|
||||
static const uint16 _upArrow[16];
|
||||
static const uint16 _downArrow[16];
|
||||
|
||||
public:
|
||||
Inventory(int x, int y, int width, int height);
|
||||
~Inventory();
|
||||
|
||||
void setRedraw(bool redraw) override;
|
||||
|
||||
void reset() override;
|
||||
|
||||
bool handleEvent(Common::Event &event) override;
|
||||
bool handleMouseHeld(Common::Point &pressed, Common::Point &held) override;
|
||||
void updateTimer(int delta) override;
|
||||
void updateVerb(int verbslot) override;
|
||||
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
Common::HashMap<int, VerbWidget *> _widgets;
|
||||
Common::Array<Common::Rect> _dirtyRects;
|
||||
|
||||
bool isVerbGuiAllowed() const;
|
||||
|
||||
void show();
|
||||
void hide();
|
||||
|
||||
void fill(Common::Rect r);
|
||||
|
||||
void markScreenAsDirty(Common::Rect r);
|
||||
void copyDirtyRectsToScreen();
|
||||
};
|
||||
|
||||
} // End of namespace Scumm
|
||||
#endif
|
||||
834
engines/scumm/macgui/macgui_loom.cpp
Normal file
834
engines/scumm/macgui/macgui_loom.cpp
Normal file
@@ -0,0 +1,834 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/system.h"
|
||||
#include "common/config-manager.h"
|
||||
#include "common/macresman.h"
|
||||
|
||||
#include "engines/engine.h"
|
||||
|
||||
#include "graphics/macgui/macfontmanager.h"
|
||||
#include "graphics/macgui/macwindowmanager.h"
|
||||
#include "graphics/surface.h"
|
||||
|
||||
#include "scumm/scumm.h"
|
||||
#include "scumm/detection.h"
|
||||
#include "scumm/macgui/macgui_impl.h"
|
||||
#include "scumm/macgui/macgui_colors.h"
|
||||
#include "scumm/macgui/macgui_loom.h"
|
||||
#include "scumm/music.h"
|
||||
#include "scumm/sound.h"
|
||||
#include "scumm/verbs.h"
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
// ===========================================================================
|
||||
// The Mac Loom GUI. This one is pretty simple.
|
||||
// ===========================================================================
|
||||
|
||||
MacLoomGui::MacLoomGui(ScummEngine *vm, const Common::Path &resourceFile) : MacGuiImpl(vm, resourceFile) {
|
||||
// The practice box can be moved, but this is its default position on
|
||||
// a large screen, and it's not saved.
|
||||
|
||||
_practiceBoxPos = Common::Point(215, 376 + 2 * _vm->_macScreenDrawOffset);
|
||||
}
|
||||
|
||||
MacLoomGui::~MacLoomGui() {
|
||||
if (_practiceBox) {
|
||||
_practiceBox->free();
|
||||
delete _practiceBox;
|
||||
}
|
||||
}
|
||||
|
||||
const Graphics::Font *MacLoomGui::getFontByScummId(int32 id) {
|
||||
switch (id) {
|
||||
case 0:
|
||||
return getFont(kLoomFontLarge);
|
||||
|
||||
default:
|
||||
error("MacLoomGui::getFontByScummId: Invalid font id %d", id);
|
||||
}
|
||||
}
|
||||
|
||||
bool MacLoomGui::getFontParams(FontId fontId, int &id, int &size, int &slant) const {
|
||||
if (MacGuiImpl::getFontParams(fontId, id, size, slant))
|
||||
return true;
|
||||
|
||||
// Loom uses only font size 13 for in-game text, but size 12 is used
|
||||
// for system messages, e.g. the original pause dialog.
|
||||
//
|
||||
// Special characters:
|
||||
//
|
||||
// 16-23 are the note names c through c'.
|
||||
// 60 is an upside-down note, i.e. the one used for c'.
|
||||
// 95 is a used for the rest of the notes.
|
||||
|
||||
switch (fontId) {
|
||||
case kLoomFontSmall:
|
||||
id = _gameFontId;
|
||||
size = 9;
|
||||
slant = Graphics::kMacFontRegular;
|
||||
return true;
|
||||
|
||||
case kLoomFontMedium:
|
||||
id = _gameFontId;
|
||||
size = 12;
|
||||
slant = Graphics::kMacFontRegular;
|
||||
return true;
|
||||
|
||||
case kLoomFontLarge:
|
||||
id = _gameFontId;
|
||||
size = 13;
|
||||
slant = Graphics::kMacFontRegular;
|
||||
return true;
|
||||
|
||||
default:
|
||||
error("MacLoomGui: getFontParams: Unknown font id %d", (int)fontId);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void MacLoomGui::setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) {
|
||||
setupResourceCursor(1000, width, height, hotspotX, hotspotY, animate);
|
||||
}
|
||||
|
||||
void MacLoomGui::updateMenus() {
|
||||
bool saveCondition, loadCondition;
|
||||
|
||||
// TODO: Complete LOOM with the rest of the proper code from disasm,
|
||||
// for now we only have the copy protection code and a best guess in place...
|
||||
//
|
||||
// Details:
|
||||
// VAR(221) & 0x4000: Copy protection bit (the only thing I could confirm from the disasm)
|
||||
// VAR(VAR_VERB_SCRIPT) == 5: Best guess... it prevents saving/loading from e.g. difficulty selection screen
|
||||
// _userPut > 0: Best guess... it prevents saving/loading during cutscenes
|
||||
|
||||
saveCondition = loadCondition =
|
||||
!(_vm->VAR(221) & 0x4000) &&
|
||||
(_vm->VAR(_vm->VAR_VERB_SCRIPT) == 5) &&
|
||||
(_vm->_userPut > 0);
|
||||
|
||||
Graphics::MacMenu *menu = _windowManager->getMenu();
|
||||
Graphics::MacMenuItem *gameMenu = menu->getMenuItem(1);
|
||||
Graphics::MacMenuItem *loadMenu = menu->getSubMenuItem(gameMenu, 0);
|
||||
Graphics::MacMenuItem *saveMenu = menu->getSubMenuItem(gameMenu, 1);
|
||||
|
||||
loadMenu->enabled = _vm->canLoadGameStateCurrently() && loadCondition;
|
||||
saveMenu->enabled = _vm->canSaveGameStateCurrently() && saveCondition;
|
||||
}
|
||||
|
||||
bool MacLoomGui::handleMenu(int id, Common::String &name) {
|
||||
if (MacGuiImpl::handleMenu(id, name))
|
||||
return true;
|
||||
|
||||
switch (id) {
|
||||
case 101: // Drafts inventory
|
||||
runDraftsInventory();
|
||||
return true;
|
||||
|
||||
case 204: // Options
|
||||
runOptionsDialog();
|
||||
return true;
|
||||
|
||||
case 205: // Quit
|
||||
if (runQuitDialog())
|
||||
_vm->quitGame();
|
||||
return true;
|
||||
|
||||
default:
|
||||
warning("Unknown menu command: %d", id);
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void MacLoomGui::runAboutDialog() {
|
||||
// The About window is not a dialog resource. Its size appears to be
|
||||
// hard-coded (416x166), and it's drawn centered. The graphics are in
|
||||
// PICT 5000 and 5001.
|
||||
|
||||
int width = 416;
|
||||
int height = 166;
|
||||
int x = (640 - width) / 2;
|
||||
int y = (400 - height) / 2;
|
||||
|
||||
Common::Rect bounds(x, y, x + width, y + height);
|
||||
MacDialogWindow *window = createWindow(bounds, kWindowStyleNormal, kMenuStyleApple);
|
||||
Graphics::Surface *lucasFilm = loadPict(5000);
|
||||
Graphics::Surface *loom = loadPict(5001);
|
||||
|
||||
const char *subVers = (const char *)_vm->getStringAddress(5);
|
||||
Common::String version = Common::String::format(_strsStrings[kMSIAboutString2].c_str(), subVers, '5', '1', '6');
|
||||
|
||||
const TextLine page1[] = {
|
||||
{ 0, 23, kStyleExtraBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString1].c_str() }, // "PRESENTS"
|
||||
TEXT_END_MARKER
|
||||
};
|
||||
|
||||
const TextLine page2[] = {
|
||||
{ 1, 59, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString3].c_str() }, // "TM & \xA9 1990 LucasArts Entertainment Company. All rights reserved."
|
||||
{ 0, 70, kStyleRegular, Graphics::kTextAlignCenter, version.c_str() }, // "Release Version 1.2 25-JAN-91 Interpreter version 5.1.6"
|
||||
TEXT_END_MARKER
|
||||
};
|
||||
|
||||
const TextLine page3[] = {
|
||||
{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString4].c_str() }, // "Macintosh version by"
|
||||
{ 0, 25, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString6].c_str() }, // "Eric Johnston"
|
||||
{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString5].c_str() }, // "Macintosh scripting by"
|
||||
{ 1, 63, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString7].c_str() }, // "Ron Baldwin"
|
||||
TEXT_END_MARKER
|
||||
};
|
||||
|
||||
const TextLine page4[] = {
|
||||
{ 0, 26, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString8].c_str() }, // "Original game created by"
|
||||
{ 1, 40, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString9].c_str() }, // "Brian Moriarty"
|
||||
TEXT_END_MARKER
|
||||
};
|
||||
|
||||
const TextLine page5[] = {
|
||||
{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString10].c_str() }, // "Produced by"
|
||||
{ 0, 25, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString12].c_str() }, // "Gregory D. Hammond"
|
||||
{ 0, 49, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString11].c_str() }, // "Macintosh Version Produced by"
|
||||
{ 1, 63, kStyleHeader1, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString13].c_str() }, // "David Fox"
|
||||
TEXT_END_MARKER
|
||||
};
|
||||
|
||||
const TextLine page6[] = {
|
||||
{ 1, 6, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString14].c_str() }, // "SCUMM Story System"
|
||||
{1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString15].c_str()}, // "created by"
|
||||
{ 97, 35, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString17].c_str() }, // "Ron Gilbert"
|
||||
{ 1, 51, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString16].c_str() }, // "and"
|
||||
{ 122, 65, kStyleHeader1, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString18].c_str() }, // "Aric Wilmunder"
|
||||
TEXT_END_MARKER
|
||||
};
|
||||
|
||||
const TextLine page7[] = {
|
||||
{ 1, 16, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString19].c_str() }, // "Stumped? Loom hint books are available!"
|
||||
{ 76, 33, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString22].c_str() }, // "In the U.S. call"
|
||||
{ 150, 34, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString20].c_str() }, // "1 (800) STAR-WARS"
|
||||
{ 150, 43, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString24].c_str() }, // "that\xD5s 1 (800) 782-7927"
|
||||
{ 80, 63, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString23].c_str() }, // "In Canada call"
|
||||
{ 150, 64, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString21].c_str() }, // "1 (800) 828-7927"
|
||||
TEXT_END_MARKER
|
||||
};
|
||||
|
||||
const TextLine page8[] = {
|
||||
{ 1, 11, kStyleBold, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString25].c_str() }, // "Need a hint NOW? Having problems?"
|
||||
{ 81, 25, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString28].c_str() }, // "For technical support call"
|
||||
{ 205, 26, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString26].c_str() }, // "1 (415) 721-3333"
|
||||
{ 137, 35, kStyleRegular, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString29].c_str() }, // "For hints call"
|
||||
|
||||
{ 205, 36, kStyleBold, Graphics::kTextAlignLeft, _strsStrings[kMSIAboutString27].c_str() }, // "1 (900) 740-JEDI"
|
||||
{ 1, 50, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString30].c_str() }, // "The charge for the hint line is 75\xA2 per minute."
|
||||
{ 1, 60, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString31].c_str() }, // "(You must have your parents\xD5 permission to"
|
||||
{ 1, 70, kStyleRegular, Graphics::kTextAlignCenter, _strsStrings[kMSIAboutString32].c_str() }, // "call this number if you are under 18.)"
|
||||
TEXT_END_MARKER
|
||||
};
|
||||
|
||||
struct AboutPage {
|
||||
const TextLine *text;
|
||||
int waitFrames;
|
||||
};
|
||||
|
||||
AboutPage aboutPages[] = {
|
||||
{ nullptr, 60 }, // ~3 seconds
|
||||
{ page1, 40 }, // ~2 seconds
|
||||
{ page2, 130 }, // ~6.5 seconds
|
||||
{ page3, 80 }, // ~4 seconds
|
||||
{ page4, 80 },
|
||||
{ page5, 80 },
|
||||
{ page6, 80 },
|
||||
{ page7, 260 }, // ~13 seconds
|
||||
{ page8, 0 }
|
||||
};
|
||||
|
||||
int page = 0;
|
||||
|
||||
// I've based the animation speed on what it looks like when Mini vMac
|
||||
// emulates an old black-and-white Mac at normal speed. It looks a bit
|
||||
// different in Basilisk II, but that's probably because it emulates a
|
||||
// much faster Mac.
|
||||
//
|
||||
// The animation is either either growing or shrinking, depending on
|
||||
// if growth is positive or negative. During each scene, the animation
|
||||
// may reach its smallest point, at which time it bounces back. When
|
||||
// it reaches its outer limit, the scene ends.
|
||||
|
||||
window->show();
|
||||
|
||||
int scene = 0;
|
||||
DelayStatus status = kDelayDone;
|
||||
|
||||
Common::Rect r(0, 0, 404, 154);
|
||||
int growth = -2;
|
||||
int pattern;
|
||||
bool darkenOnly = false;
|
||||
int waitFrames = 0;
|
||||
|
||||
int innerBounce = 72;
|
||||
int targetTop = 48;
|
||||
int targetGrowth = 2;
|
||||
|
||||
bool changeScene = false;
|
||||
bool fastForward = false;
|
||||
|
||||
while (!_vm->shouldQuit()) {
|
||||
if ((scene % 2) == 0) {
|
||||
// This appears to be pixel perfect or at least nearly
|
||||
// so for the outer layers, but breaks down slightly
|
||||
// near the middle.
|
||||
//
|
||||
// Also, the original does an inexplicable skip in the
|
||||
// first animation that I haven't bothered to
|
||||
// implement. I don't know if it was intentional or
|
||||
// not, but I think it looks awkward. And I wasn't able
|
||||
// to get it quite right anyway.
|
||||
|
||||
pattern = (r.top / 2) % 8;
|
||||
|
||||
if (pattern > 4)
|
||||
darkenOnly = false;
|
||||
|
||||
window->drawPatternRoundRect(r, 7, pattern, true, darkenOnly);
|
||||
|
||||
if (!fastForward)
|
||||
window->markRectAsDirty(r);
|
||||
|
||||
if (r.top == targetTop && growth == targetGrowth) {
|
||||
changeScene = true;
|
||||
} else {
|
||||
r.grow(growth);
|
||||
|
||||
if (growth < 0 && r.top >= innerBounce)
|
||||
growth = -growth;
|
||||
}
|
||||
} else {
|
||||
if (--waitFrames <= 0)
|
||||
changeScene = true;
|
||||
}
|
||||
|
||||
if (!fastForward) {
|
||||
window->update();
|
||||
status = delay(50);
|
||||
}
|
||||
|
||||
if (status == kDelayInterrupted)
|
||||
fastForward = true;
|
||||
|
||||
if (status == kDelayAborted)
|
||||
break;
|
||||
|
||||
if (changeScene) {
|
||||
changeScene = false;
|
||||
scene++;
|
||||
|
||||
// Animations happen on even-numbered scenes. All
|
||||
// animations start in an inwards direction.
|
||||
//
|
||||
// Odd-numbered scenes are the text pages where it
|
||||
// waits for a bit before continuing. This is where
|
||||
// fast-forwarding (by clicking) stops. Unlike Last
|
||||
// Crusade, we can't just skip the animation because
|
||||
// everything has to be drawn. (Well, some could
|
||||
// probably be skipped, but I doubt it's worth the
|
||||
// trouble to do so.)
|
||||
|
||||
if ((scene % 2) == 0)
|
||||
growth = -2;
|
||||
else {
|
||||
fastForward = false;
|
||||
darkenOnly = true;
|
||||
|
||||
if (aboutPages[page].text)
|
||||
window->drawTexts(r, aboutPages[page].text);
|
||||
|
||||
waitFrames = aboutPages[page].waitFrames;
|
||||
page++;
|
||||
}
|
||||
|
||||
switch (scene) {
|
||||
case 1:
|
||||
window->drawSprite(lucasFilm, 134, 61);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// All subsequent text pages are larger, which
|
||||
// we compensate by making the inner bounce
|
||||
// happen earlier.
|
||||
|
||||
innerBounce -= 8;
|
||||
targetTop -= 16;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
window->drawSprite(loom, 95, 38);
|
||||
break;
|
||||
}
|
||||
|
||||
window->update(true);
|
||||
|
||||
if (scene >= 17)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (status != kDelayAborted)
|
||||
delay();
|
||||
|
||||
_windowManager->popCursor();
|
||||
|
||||
lucasFilm->free();
|
||||
loom->free();
|
||||
|
||||
delete lucasFilm;
|
||||
delete loom;
|
||||
delete window;
|
||||
}
|
||||
|
||||
void MacLoomGui::runDraftsInventory() {
|
||||
char notesBuf[6];
|
||||
const char *names[18] = {
|
||||
"Drafts",
|
||||
"Opening:", "Straw Into Gold:", "Dyeing:",
|
||||
"Night Vision:", "Twisting:", "Sleep:",
|
||||
"Emptying:", "Invisibility:", "Terror:",
|
||||
"Sharpening:", "Reflection:", "Healing:",
|
||||
"Silence:", "Shaping:", "Unmaking:",
|
||||
"Transcendence:",
|
||||
"Unknown:"
|
||||
};
|
||||
|
||||
const char *notes = "cdefgabC";
|
||||
|
||||
// ACT 1: Draw the Mac dialog window
|
||||
MacGuiImpl::MacDialogWindow *window = createWindow(Common::Rect(110, 20, 540, 252), kWindowStyleNormal, kMenuStyleApple);
|
||||
const Graphics::Font *font = getFont(kSystemFont);
|
||||
|
||||
Graphics::Surface *s = window->innerSurface();
|
||||
|
||||
// ACT 2: Draw the drafts text
|
||||
//
|
||||
// Drafts are stored in SCUMM global variables; we choose the appropriate
|
||||
// first entry in the variables at which these drafts start.
|
||||
int base = 55;
|
||||
|
||||
// TODO: Can these be drawn in different styles? (e.g. Checkerboard)
|
||||
byte unlockedColor = kBlack;
|
||||
byte inactiveColor = kBlack;
|
||||
byte newDraftColor = kBlack;
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
int draft = _vm->_scummVars[base + i * 2];
|
||||
|
||||
// In which row are we rendering our text?
|
||||
int heightMultiplier = i < 8 ? i : (i % 8);
|
||||
int textHeight = 24;
|
||||
|
||||
// Has the draft been unlocked by the player?
|
||||
//int titleColor = (draft & 0x2000) ? unlockedColor : inactiveColor;
|
||||
|
||||
// Has the new draft been used at least once?
|
||||
int notesColor = (draft & 0x4000) ? unlockedColor : newDraftColor;
|
||||
|
||||
// Has the draft been unlocked? Great: put it in our text buffer
|
||||
// otherwise just prepare to render the "????" string.
|
||||
if (draft & 0x2000) {
|
||||
Common::sprintf_s(notesBuf, sizeof(notesBuf), "%c%c%c%c",
|
||||
notes[draft & 0x0007],
|
||||
notes[(draft & 0x0038) >> 3],
|
||||
notes[(draft & 0x01c0) >> 6],
|
||||
notes[(draft & 0x0e00) >> 9]);
|
||||
} else {
|
||||
notesColor = inactiveColor;
|
||||
Common::sprintf_s(notesBuf, sizeof(notesBuf), "????");
|
||||
}
|
||||
|
||||
// Where are we positioning the text?
|
||||
// Left column or right column?
|
||||
int xPos = i < 8 ? 40 : 260;
|
||||
|
||||
// Draw the titles of the drafts...
|
||||
if (draft & 0x2000) {
|
||||
font->drawString(s, names[i + 1], xPos - 20, 24 + textHeight * heightMultiplier, s->w, notesColor); // FIXME: titleColor, not notesColor?
|
||||
} else {
|
||||
// Draw "Unknown:" as the title of the draft
|
||||
font->drawString(s, names[17], xPos - 20, 24 + textHeight * heightMultiplier, s->w, notesColor); // FIXME: titleColor, not notesColor?
|
||||
}
|
||||
|
||||
// Draw the notes of the draft...
|
||||
font->drawString(s, notesBuf, xPos + 100, 24 + textHeight * heightMultiplier, s->w, notesColor);
|
||||
}
|
||||
|
||||
// Draw "Drafts" on top of the dialog
|
||||
font->drawString(s, names[0], 0, 4, s->w, kBlack, Graphics::kTextAlignCenter);
|
||||
|
||||
// Draw a vertical line to separate the two columns
|
||||
s->vLine(210, 44, 184, kBlack);
|
||||
|
||||
// Update the screen with all the new stuff!
|
||||
window->show();
|
||||
delay();
|
||||
delete window;
|
||||
}
|
||||
|
||||
bool MacLoomGui::runOptionsDialog() {
|
||||
// Widgets:
|
||||
//
|
||||
// 0 - Okay button
|
||||
// 1 - Cancel button
|
||||
// 2 - Sound checkbox
|
||||
// 3 - Music checkbox
|
||||
// 4 - Picture (text speed background)
|
||||
// 5 - Picture (text speed handle)
|
||||
// 6 - Scrolling checkbox
|
||||
// 7 - Full Animation checkbox
|
||||
// 8 - Picture (music quality background)
|
||||
// 9 - Picture (music quality handle)
|
||||
// 10 - "Machine Speed: ^0" text
|
||||
// 11 - Text speed slider (manually created)
|
||||
// 12 - Music quality slider (manually created)
|
||||
|
||||
int sound = (!ConfMan.hasKey("mute") || !ConfMan.getBool("mute")) ? 1 : 0;
|
||||
int music = (!ConfMan.hasKey("music_mute") || !ConfMan.getBool("music_mute")) ? 1 : 0;
|
||||
|
||||
int scrolling = _vm->_snapScroll == 0;
|
||||
int fullAnimation = _vm->VAR(_vm->VAR_MACHINE_SPEED) == 1 ? 0 : 1;
|
||||
int textSpeed = _vm->_defaultTextSpeed;
|
||||
int musicQuality = ConfMan.hasKey("mac_snd_quality") ? ConfMan.getInt("mac_snd_quality") : 0;
|
||||
int musicQualityOption = (musicQuality == 0) ? 1 : (musicQuality - 1) % 3;
|
||||
musicQuality = (musicQuality == 0) ? (_vm->VAR(_vm->VAR_SOUNDCARD) == 10 ? 0 : 2) : (musicQuality - 1) / 3;
|
||||
|
||||
MacDialogWindow *window = createDialog(1000);
|
||||
|
||||
MacButton *buttonOk = (MacButton *)window->getWidget(kWidgetButton, 0);
|
||||
MacButton *buttonCancel = (MacButton *)window->getWidget(kWidgetButton, 1);
|
||||
|
||||
MacCheckbox *checkboxSound = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 0);
|
||||
MacCheckbox *checkboxMusic = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 1);
|
||||
MacCheckbox *checkboxScrolling = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 2);
|
||||
MacCheckbox *checkboxFullAnimation = (MacCheckbox *)window->getWidget(kWidgetCheckbox, 3);
|
||||
|
||||
checkboxSound->setValue(sound);
|
||||
checkboxMusic->setValue(music);
|
||||
checkboxScrolling->setValue(scrolling);
|
||||
checkboxFullAnimation->setValue(fullAnimation);
|
||||
|
||||
if (!sound)
|
||||
checkboxMusic->setEnabled(false);
|
||||
|
||||
MacImageSlider *sliderTextSpeed = window->addImageSlider(4, 5, true, 5, 105, 0, 9);
|
||||
sliderTextSpeed->setValue(textSpeed);
|
||||
|
||||
MacImageSlider *sliderMusicQuality = window->addImageSlider(8, 9, true, 5, 69, 0, 2, 6, 4);
|
||||
sliderMusicQuality->setValue(musicQualityOption);
|
||||
|
||||
// Machine rating
|
||||
window->addSubstitution(Common::String::format("%d", _vm->VAR(53)));
|
||||
|
||||
while (!_vm->shouldQuit()) {
|
||||
MacDialogEvent event;
|
||||
|
||||
while (window->runDialog(event)) {
|
||||
switch (event.type) {
|
||||
case kDialogClick:
|
||||
if (event.widget == buttonOk) {
|
||||
// TEXT SPEED
|
||||
_vm->_defaultTextSpeed = CLIP<int>(sliderTextSpeed->getValue(), 0, 9);
|
||||
ConfMan.setInt("original_gui_text_speed", _vm->_defaultTextSpeed);
|
||||
_vm->setTalkSpeed(_vm->_defaultTextSpeed);
|
||||
|
||||
// SOUND&MUSIC ACTIVATION
|
||||
// 0 - Sound&Music on
|
||||
// 1 - Sound on, music off
|
||||
// 2 - Sound&Music off
|
||||
int musicVariableValue = 0;
|
||||
|
||||
if (checkboxSound->getValue() == 0)
|
||||
musicVariableValue = 2;
|
||||
else if (checkboxSound->getValue() == 1 && checkboxMusic->getValue() == 0)
|
||||
musicVariableValue = 1;
|
||||
|
||||
_vm->_musicEngine->toggleMusic(musicVariableValue == 0);
|
||||
_vm->_musicEngine->toggleSoundEffects(musicVariableValue < 2);
|
||||
ConfMan.setBool("music_mute", musicVariableValue > 0);
|
||||
ConfMan.setBool("mute", musicVariableValue == 2);
|
||||
|
||||
// SCROLLING ACTIVATION
|
||||
_vm->_snapScroll = checkboxScrolling->getValue() == 0;
|
||||
|
||||
if (_vm->VAR_CAMERA_FAST_X != 0xFF)
|
||||
_vm->VAR(_vm->VAR_CAMERA_FAST_X) = _vm->_snapScroll;
|
||||
|
||||
// FULL ANIMATION ACTIVATION
|
||||
_vm->VAR(_vm->VAR_MACHINE_SPEED) = checkboxFullAnimation->getValue() == 1 ? 0 : 1;
|
||||
|
||||
// MUSIC QUALITY SELECTOR
|
||||
musicQuality = musicQuality * 3 + 1 + sliderMusicQuality->getValue();
|
||||
_vm->_musicEngine->setQuality(musicQuality);
|
||||
ConfMan.setInt("mac_snd_quality", musicQuality);
|
||||
|
||||
_vm->syncSoundSettings();
|
||||
ConfMan.flushToDisk();
|
||||
|
||||
delete window;
|
||||
return true;
|
||||
} else if (event.widget == buttonCancel) {
|
||||
delete window;
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case kDialogValueChange:
|
||||
if (event.widget == checkboxSound) {
|
||||
checkboxMusic->setEnabled(checkboxSound->getValue() != 0);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
window->delayAndUpdate();
|
||||
}
|
||||
|
||||
delete window;
|
||||
return false;
|
||||
}
|
||||
|
||||
void MacLoomGui::resetAfterLoad() {
|
||||
reset();
|
||||
|
||||
// We used to use verb 53 for the Loom practice box, and while it's
|
||||
// still the verb we pretend to use when clicking on it we no longer
|
||||
// use the actual verb slot.
|
||||
//
|
||||
// Apparently the practice box isn't restored on saving, so it seems
|
||||
// that savegame compatibility isn't broken. And if it is, it happened
|
||||
// shortly after the savegame version was increased for other reasons,
|
||||
// so the damage would be very limited.
|
||||
|
||||
for (int i = 0; i < _vm->_numVerbs; i++) {
|
||||
if (_vm->_verbs[i].verbid == 53)
|
||||
_vm->killVerb(i);
|
||||
}
|
||||
}
|
||||
|
||||
void MacLoomGui::update(int delta) {
|
||||
// Unlike the PC version, the Macintosh version of Loom appears to
|
||||
// hard-code the drawing of the practice mode box. This is handled by
|
||||
// script 27 in both versions, but whereas the PC version draws the
|
||||
// notes, the Mac version just sets variables 50 and 54.
|
||||
//
|
||||
// In this script, the variables are set to the same value but it
|
||||
// appears that only variable 50 is cleared when the box is supposed to
|
||||
// disappear. I don't know what the purpose of variable 54 is.
|
||||
//
|
||||
// Variable 128 is the game difficulty:
|
||||
//
|
||||
// 0 - Practice
|
||||
// 1 - Standard
|
||||
// 2 - Expert
|
||||
//
|
||||
// Note that the practice mode box is never inscribed on the "Mac
|
||||
// screen" surface. It's drawn last on every update, so it floats
|
||||
// above everything else.
|
||||
|
||||
int notes = _vm->VAR(50);
|
||||
|
||||
if (_vm->VAR(128) == 0) {
|
||||
if (notes) {
|
||||
int w = 64;
|
||||
int h = 24;
|
||||
|
||||
bool bw = (_vm->_renderMode == Common::kRenderMacintoshBW);
|
||||
|
||||
if (!_practiceBox) {
|
||||
debug(1, "MacLoomGui: Creating practice mode box");
|
||||
|
||||
_practiceBox = new Graphics::Surface();
|
||||
_practiceBox->create(w, h, Graphics::PixelFormat::createFormatCLUT8());
|
||||
|
||||
_practiceBox->fillRect(Common::Rect(w, h), kBlack);
|
||||
|
||||
byte color = bw ? kWhite : kLightGray;
|
||||
|
||||
_practiceBox->hLine(2, 1, w - 3, color);
|
||||
_practiceBox->hLine(2, h - 2, w - 3, color);
|
||||
_practiceBox->vLine(1, 2, h - 3, color);
|
||||
_practiceBox->vLine(w - 2, 2, h - 3, color);
|
||||
_practiceBoxNotes = 0;
|
||||
}
|
||||
|
||||
if (notes != _practiceBoxNotes) {
|
||||
debug(1, "MacLoomGui: Drawing practice mode notes");
|
||||
|
||||
_practiceBoxNotes = notes;
|
||||
|
||||
_practiceBox->fillRect(Common::Rect(2, 2, w - 2, h - 2), kBlack);
|
||||
|
||||
const Graphics::Font *font = getFont(kLoomFontLarge);
|
||||
byte colors[] = { kRed, kBrightRed, kBrightYellow, kBrightGreen, kBrightCyan, kCyan, kBrightBlue, kWhite };
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int note = (notes >> (4 * i)) & 0x0F;
|
||||
|
||||
if (note >= 2 && note <= 9) {
|
||||
font->drawChar(_practiceBox, 14 + note, 9 + i * 13, 5, bw ? kWhite : colors[note - 2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_system->copyRectToScreen(_practiceBox->getBasePtr(0, 0), _practiceBox->pitch, _practiceBoxPos.x, _practiceBoxPos.y, w, h);
|
||||
} else {
|
||||
if (_practiceBox) {
|
||||
debug(1, "MacLoomGui: Deleting practice mode box");
|
||||
|
||||
_system->copyRectToScreen(_surface->getBasePtr(_practiceBoxPos.x, _practiceBoxPos.y), _surface->pitch, _practiceBoxPos.x, _practiceBoxPos.y, _practiceBox->w, _practiceBox->h);
|
||||
|
||||
_practiceBox->free();
|
||||
delete _practiceBox;
|
||||
_practiceBox = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool MacLoomGui::handleEvent(Common::Event event) {
|
||||
if (MacGuiImpl::handleEvent(event))
|
||||
return true;
|
||||
|
||||
if (_vm->isPaused())
|
||||
return false;
|
||||
|
||||
if (!_practiceBox || _vm->_userPut <= 0)
|
||||
return false;
|
||||
|
||||
// Perhaps the silliest feature in Mac Loom, that literally only one
|
||||
// person has ever asked for: You can drag the Loom practice box.
|
||||
//
|
||||
// The game will freeze while the button is held down, but that's how
|
||||
// the original acted as well. Should sounds keep playing? I don't know
|
||||
// if that situation can even occur. I think it's nicer to let them
|
||||
// play if it does.
|
||||
|
||||
if (event.type != Common::EVENT_LBUTTONDOWN)
|
||||
return false;
|
||||
|
||||
Common::Rect bounds;
|
||||
|
||||
bounds.left = _practiceBoxPos.x;
|
||||
bounds.top = _practiceBoxPos.y;
|
||||
bounds.right = _practiceBoxPos.x + _practiceBox->w;
|
||||
bounds.bottom = _practiceBoxPos.y + _practiceBox->h;
|
||||
|
||||
if (!bounds.contains(event.mouse))
|
||||
return false;
|
||||
|
||||
int clickX = event.mouse.x;
|
||||
int clickY = event.mouse.y;
|
||||
bool dragMode = false;
|
||||
|
||||
while (!_vm->shouldQuit()) {
|
||||
bool dragging = false;
|
||||
int dragX = 0;
|
||||
int dragY = 0;
|
||||
|
||||
while (_system->getEventManager()->pollEvent(event)) {
|
||||
switch (event.type) {
|
||||
case Common::EVENT_LBUTTONUP:
|
||||
if (!dragMode)
|
||||
_vm->runInputScript(kVerbClickArea, 53, 1);
|
||||
return true;
|
||||
|
||||
case Common::EVENT_MOUSEMOVE:
|
||||
if (ABS(event.mouse.x - clickX) >= 3 || ABS(event.mouse.y - clickY) >= 3)
|
||||
dragMode = true;
|
||||
|
||||
if (dragMode) {
|
||||
dragging = true;
|
||||
dragX = event.mouse.x;
|
||||
dragY = event.mouse.y;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (dragging) {
|
||||
// How much has the mouse moved since the initial
|
||||
// click? Calculate new position from that.
|
||||
|
||||
int newX = bounds.left + (dragX - clickX);
|
||||
int newY = bounds.top + (dragY - clickY);
|
||||
|
||||
// The box has to stay completely inside the screen.
|
||||
// Also, things get weird if you move the box into the
|
||||
// menu hotzone, so don't allow that.
|
||||
|
||||
int maxY = _surface->h - _practiceBox->h - 2 * _vm->_macScreenDrawOffset;
|
||||
int minY = 2 * _vm->_macScreenDrawOffset;
|
||||
|
||||
if (_vm->isUsingOriginalGUI() && minY < 23)
|
||||
minY = 23;
|
||||
|
||||
newX = CLIP(newX, 0, _surface->w - _practiceBox->w);
|
||||
newY = CLIP(newY, minY, maxY);
|
||||
|
||||
// For some reason, X coordinates can only change in
|
||||
// increments of 16 pixels. As an enhancement, we allow
|
||||
// any X coordinate.
|
||||
|
||||
if (!_vm->enhancementEnabled(kEnhUIUX))
|
||||
newX &= ~0xF;
|
||||
|
||||
if (newX != _practiceBoxPos.x || newY != _practiceBoxPos.y) {
|
||||
int w = _practiceBox->w;
|
||||
int h = _practiceBox->h;
|
||||
|
||||
// The old and new rect will almost certainly
|
||||
// overlap, so it's possible to optimize this.
|
||||
// But increasing the delay in the event loop
|
||||
// was a better optimization than removing one
|
||||
// of the copyRectToScreen() calls completely,
|
||||
// so I doubt it's worth it.
|
||||
|
||||
_system->copyRectToScreen(_surface->getBasePtr(_practiceBoxPos.x, _practiceBoxPos.y), _surface->pitch, _practiceBoxPos.x, _practiceBoxPos.y, w, h);
|
||||
_system->copyRectToScreen(_practiceBox->getBasePtr(0, 0), _practiceBox->pitch, newX, newY, w, h);
|
||||
|
||||
_practiceBoxPos = Common::Point(newX, newY);
|
||||
}
|
||||
|
||||
_system->delayMillis(20);
|
||||
_system->updateScreen();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // End of namespace Scumm
|
||||
68
engines/scumm/macgui/macgui_loom.h
Normal file
68
engines/scumm/macgui/macgui_loom.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SCUMM_MACGUI_MACGUI_LOOM_H
|
||||
#define SCUMM_MACGUI_MACGUI_LOOM_H
|
||||
|
||||
#include "common/events.h"
|
||||
#include "common/rect.h"
|
||||
#include "common/str.h"
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
class MacGuiImpl;
|
||||
|
||||
class MacLoomGui : public MacGuiImpl {
|
||||
public:
|
||||
MacLoomGui(ScummEngine *vm, const Common::Path &resourceFile);
|
||||
~MacLoomGui();
|
||||
|
||||
const Common::String name() const override { return "Loom"; }
|
||||
int getNumColors() const override { return 16; }
|
||||
|
||||
bool handleEvent(Common::Event event) override;
|
||||
|
||||
const Graphics::Font *getFontByScummId(int32 id) override;
|
||||
|
||||
void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) override;
|
||||
|
||||
void resetAfterLoad() override;
|
||||
void update(int delta) override;
|
||||
|
||||
void runDraftsInventory();
|
||||
|
||||
protected:
|
||||
bool getFontParams(FontId fontId, int &id, int &size, int &slant) const override;
|
||||
|
||||
void updateMenus() override;
|
||||
bool handleMenu(int id, Common::String &name) override;
|
||||
|
||||
void runAboutDialog() override;
|
||||
bool runOptionsDialog() override;
|
||||
|
||||
private:
|
||||
Graphics::Surface *_practiceBox = nullptr;
|
||||
Common::Point _practiceBoxPos;
|
||||
int _practiceBoxNotes = 0;
|
||||
};
|
||||
|
||||
} // End of namespace Scumm
|
||||
#endif
|
||||
778
engines/scumm/macgui/macgui_strings.cpp
Normal file
778
engines/scumm/macgui/macgui_strings.cpp
Normal file
@@ -0,0 +1,778 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/macresman.h"
|
||||
|
||||
#include "scumm/macgui/macgui_impl.h"
|
||||
#include "scumm/scumm.h"
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
Common::String MacGuiImpl::readCString(uint8 *&data) {
|
||||
while (data[0] == '\0') {
|
||||
data++;
|
||||
}
|
||||
|
||||
Common::String result(reinterpret_cast<const char *>(data));
|
||||
data += result.size() + 1;
|
||||
|
||||
debug(8, "MacGuiImpl::readCString(): %s", result.c_str());
|
||||
return result;
|
||||
}
|
||||
|
||||
Common::String MacGuiImpl::readPascalString(uint8 *&data) {
|
||||
while (data[0] == '\0') {
|
||||
data++;
|
||||
}
|
||||
|
||||
Common::String result(reinterpret_cast<const char *>(&data[1]), (uint32)data[0]);
|
||||
data += (uint32)data[0] + 1;
|
||||
|
||||
debug(8, "MacGuiImpl::readPascalString(): %s", result.c_str());
|
||||
return result;
|
||||
}
|
||||
|
||||
#define SKIP_C(x) { MacGuiImpl::kMSISkip, MacGuiImpl::kStrC, x }
|
||||
#define SKIP_P(x) { MacGuiImpl::kMSISkip, MacGuiImpl::kStrPascal, x }
|
||||
|
||||
static const MacGuiImpl::MacSTRSParsingEntry strsIndy3Table[] = {
|
||||
SKIP_C(6),
|
||||
SKIP_P(2),
|
||||
SKIP_C(2),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToQuit, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIOpenGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSISaveGameFileAs, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(2),
|
||||
SKIP_C(2),
|
||||
SKIP_P(1),
|
||||
SKIP_C(67),
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAboutString1, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString2, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString3, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString4, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString5, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString6, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString7, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString8, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString9, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString10, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString11, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString12, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString13, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString14, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString15, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString16, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString17, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString18, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString19, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString20, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString21, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString22, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString23, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString24, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString25, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString26, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString27, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString28, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString29, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString30, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString31, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString32, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString33, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString34, MacGuiImpl::kStrPascal, 1 },
|
||||
// SKIP_C(1),
|
||||
// SKIP_P(4),
|
||||
// SKIP_C(3),
|
||||
// SKIP_P(2),
|
||||
// SKIP_C(4),
|
||||
// SKIP_P(1),
|
||||
// SKIP_C(1),
|
||||
// SKIP_P(5),
|
||||
};
|
||||
|
||||
static const MacGuiImpl::MacSTRSParsingEntry strsLoomTable[] = {
|
||||
SKIP_C(6),
|
||||
SKIP_P(2),
|
||||
SKIP_C(2),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToQuit, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIOpenGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSISaveGameFileAs, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(2),
|
||||
SKIP_P(1),
|
||||
SKIP_C(67),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutString1, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString2, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString3, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString4, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString5, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString6, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString7, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString8, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString9, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString10, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString11, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString12, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString13, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString14, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString15, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString16, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString17, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString18, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString19, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString20, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString21, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString22, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString23, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString24, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString25, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString26, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString27, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString28, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString29, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString30, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString31, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString32, MacGuiImpl::kStrPascal, 1 },
|
||||
// SKIP_C(1),
|
||||
// SKIP_P(4),
|
||||
// SKIP_C(3),
|
||||
// SKIP_P(2),
|
||||
// SKIP_C(4),
|
||||
// SKIP_P(1),
|
||||
// SKIP_C(1),
|
||||
// SKIP_P(5),
|
||||
// SKIP_C(7),
|
||||
};
|
||||
|
||||
static const MacGuiImpl::MacSTRSParsingEntry strsMI1Table[] = {
|
||||
SKIP_C(93),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToQuit, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIOpenGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSISaveGameFileAs, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(6),
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAboutString1, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString2, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString3, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString4, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString5, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString6, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString7, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString8, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString9, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString10, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString11, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString12, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString13, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString14, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString15, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString16, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString17, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString18, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString19, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString20, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString21, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString22, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString23, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString24, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString25, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString26, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString27, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString28, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString29, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString30, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString31, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString32, MacGuiImpl::kStrPascal, 1 },
|
||||
// SKIP_C(75)
|
||||
};
|
||||
|
||||
static const MacGuiImpl::MacSTRSParsingEntry strsMI2Variant1Table[] = {
|
||||
SKIP_C(93),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToQuit, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIRoughCommandMsg, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIOpenGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSISaveGameFileAs, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(6),
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAboutString1, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString2, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString3, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString4, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString5, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString6, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString7, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString8, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString9, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString10, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString11, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString12, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString13, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString14, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString15, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString16, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString17, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString18, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString19, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString20, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString21, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString22, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString23, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString24, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString25, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString26, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString27, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString28, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString29, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString30, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString31, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString32, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString33, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString34, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString35, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString36, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString37, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString38, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString39, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString40, MacGuiImpl::kStrPascal, 1 },
|
||||
// SKIP_C(95)
|
||||
};
|
||||
|
||||
static const MacGuiImpl::MacSTRSParsingEntry strsMI2Variant2Table[] = {
|
||||
SKIP_C(93),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(2),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToQuit, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIRoughCommandMsg, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIOpenGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSISaveGameFileAs, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(6),
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAboutString1, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString2, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString3, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString4, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString5, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString6, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString7, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString8, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString9, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString10, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString11, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString12, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString13, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString14, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString15, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString16, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString17, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString18, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString19, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString20, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString21, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString22, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString23, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString24, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString25, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString26, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString27, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString28, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString29, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString30, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString31, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString32, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString33, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString34, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString35, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString36, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString37, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString38, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString39, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString40, MacGuiImpl::kStrPascal, 1 },
|
||||
// SKIP_C(95)
|
||||
};
|
||||
|
||||
static const MacGuiImpl::MacSTRSParsingEntry strsIndy4CDVariant1Table[] = {
|
||||
SKIP_C(144),
|
||||
SKIP_P(1),
|
||||
SKIP_C(2),
|
||||
SKIP_P(10),
|
||||
SKIP_C(51),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToQuit, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIRoughCommandMsg, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIOpenGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSISaveGameFileAs, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(6),
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAboutString1, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString2, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString3, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString4, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString5, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString6, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString7, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString8, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString9, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString10, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString11, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString12, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString13, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString14, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString15, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString16, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString17, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString18, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString19, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString20, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString21, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString22, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString23, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString24, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString25, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString26, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString27, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString28, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString29, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString30, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString31, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString32, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString33, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString34, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString35, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString36, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString37, MacGuiImpl::kStrPascal, 1 },
|
||||
};
|
||||
|
||||
static const MacGuiImpl::MacSTRSParsingEntry strsIndy4CDVariant2Table[] = {
|
||||
SKIP_C(97),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToQuit, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIRoughCommandMsg, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIOpenGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSISaveGameFileAs, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(6),
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAboutString1, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString2, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString3, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString4, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString5, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString6, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString7, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString8, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString9, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString10, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString11, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString12, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString13, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString14, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString15, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString16, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString17, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString18, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString19, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString20, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString21, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString22, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString23, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString24, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString25, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString26, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString27, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString28, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString29, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString30, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString31, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString32, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString33, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString34, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString35, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString36, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString37, MacGuiImpl::kStrPascal, 1 },
|
||||
};
|
||||
|
||||
static const MacGuiImpl::MacSTRSParsingEntry strsIndy4FloppyVariant1Table[] = {
|
||||
SKIP_C(93),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToQuit, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIRoughCommandMsg, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIOpenGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSISaveGameFileAs, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(6),
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAboutString1, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString2, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString3, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString4, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString5, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString6, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString7, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString8, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString9, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString10, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString11, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString12, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString13, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString14, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString15, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString16, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString17, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString18, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString19, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString20, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString21, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString22, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString23, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString38, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString24, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString25, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString26, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString27, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString28, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString29, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString30, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString31, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString32, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString33, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString34, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString35, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString36, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString37, MacGuiImpl::kStrPascal, 1 },
|
||||
};
|
||||
|
||||
static const MacGuiImpl::MacSTRSParsingEntry strsIndy4FloppyVariant2Table[] = {
|
||||
SKIP_C(93),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToQuit, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIRoughCommandMsg, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIOpenGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSISaveGameFileAs, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIGameFile, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(6),
|
||||
SKIP_P(2),
|
||||
{ MacGuiImpl::kMSIAboutString1, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString2, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString3, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString4, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString5, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString6, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString7, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString8, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString9, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString10, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString11, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString12, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString13, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString14, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString15, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString16, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString17, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString18, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString19, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString20, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString21, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString22, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString23, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString38, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString24, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString25, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString26, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString27, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString28, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString29, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString30, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString31, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString32, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString33, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString34, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString35, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString36, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString37, MacGuiImpl::kStrPascal, 1 },
|
||||
};
|
||||
|
||||
static const MacGuiImpl::MacSTRSParsingEntry strsIndy4DemoTable[] = {
|
||||
SKIP_C(98),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIAboutGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(1),
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToQuit, MacGuiImpl::kStrC, 1 },
|
||||
{ MacGuiImpl::kMSIAreYouSureYouWantToRestart, MacGuiImpl::kStrC, 1 },
|
||||
SKIP_C(1),
|
||||
SKIP_P(1),
|
||||
{ MacGuiImpl::kMSIGameName, MacGuiImpl::kStrPascal, 1 },
|
||||
SKIP_C(9),
|
||||
{ MacGuiImpl::kMSIAboutString1, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString2, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString3, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString4, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString5, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString6, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString7, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString8, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString9, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString10, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString11, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString12, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString13, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString14, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString15, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString16, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString17, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString18, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString19, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString20, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString21, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString22, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString23, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString24, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString25, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString26, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString27, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString29, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString30, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString31, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString32, MacGuiImpl::kStrPascal, 1 },
|
||||
{ MacGuiImpl::kMSIAboutString33, MacGuiImpl::kStrPascal, 1 },
|
||||
};
|
||||
|
||||
#undef SKIP_C
|
||||
#undef SKIP_P
|
||||
|
||||
bool MacGuiImpl::readStrings() {
|
||||
if (_vm->_game.version >= 6 || _vm->_game.id == GID_MANIAC) {
|
||||
_strsStrings.clear();
|
||||
_strsStrings.reserve(128);
|
||||
for (int i = 0; i < 128; i++) {
|
||||
_strsStrings.emplace_back("");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Common::MacResManager resource;
|
||||
resource.open(_resourceFile);
|
||||
uint32 strsLen = resource.getResLength(MKTAG('S', 'T', 'R', 'S'), 0);
|
||||
|
||||
if (strsLen <= 0)
|
||||
return false;
|
||||
|
||||
Common::SeekableReadStream *strsStream = resource.getResource(MKTAG('S', 'T', 'R', 'S'), 0);
|
||||
uint8 *strsBlock = (uint8 *)malloc(strsLen);
|
||||
strsStream->read(strsBlock, strsLen);
|
||||
|
||||
uint8 *strsData = strsBlock;
|
||||
const MacSTRSParsingEntry *parsingTable = nullptr;
|
||||
int parsingTableSize = 0;
|
||||
|
||||
if (_vm->_game.id == GID_INDY3) {
|
||||
switch (strsLen) {
|
||||
case 2950:
|
||||
// 1.7 8/17/90
|
||||
parsingTable = strsIndy3Table;
|
||||
parsingTableSize = ARRAYSIZE(strsIndy3Table);
|
||||
break;
|
||||
}
|
||||
} else if (_vm->_game.id == GID_LOOM) {
|
||||
switch (strsLen) {
|
||||
case 3184:
|
||||
// 1.2 25-JAN-91
|
||||
parsingTable = strsLoomTable;
|
||||
parsingTableSize = ARRAYSIZE(strsLoomTable);
|
||||
break;
|
||||
}
|
||||
} else if (_vm->_game.id == GID_MONKEY) {
|
||||
switch (strsLen) {
|
||||
case 5986:
|
||||
// version 2.4
|
||||
parsingTable = strsMI1Table;
|
||||
parsingTableSize = ARRAYSIZE(strsMI1Table);
|
||||
break;
|
||||
}
|
||||
} else if (_vm->_game.id == GID_MONKEY2) {
|
||||
switch (strsLen) {
|
||||
case 6574:
|
||||
parsingTable = strsMI2Variant1Table;
|
||||
parsingTableSize = ARRAYSIZE(strsMI2Variant1Table);
|
||||
break;
|
||||
case 6602:
|
||||
// v1.0 11/5/92 from the LucasArts Mac CD Game Pack II
|
||||
parsingTable = strsMI2Variant2Table;
|
||||
parsingTableSize = ARRAYSIZE(strsMI2Variant2Table);
|
||||
break;
|
||||
}
|
||||
} else if (_vm->_game.id == GID_INDY4) {
|
||||
switch (strsLen) {
|
||||
case 6516:
|
||||
parsingTable = strsIndy4FloppyVariant1Table;
|
||||
parsingTableSize = ARRAYSIZE(strsIndy4FloppyVariant1Table);
|
||||
break;
|
||||
case 6612:
|
||||
// V1.0 10-9-92 from the LucasArts Mac CD Game Pack II
|
||||
parsingTable = strsIndy4FloppyVariant2Table;
|
||||
parsingTableSize = ARRAYSIZE(strsIndy4FloppyVariant2Table);
|
||||
break;
|
||||
case 6836: // CD
|
||||
// V1.0 10-9-92
|
||||
parsingTable = strsIndy4CDVariant1Table;
|
||||
parsingTableSize = ARRAYSIZE(strsIndy4CDVariant1Table);
|
||||
break;
|
||||
case 6772: // CD
|
||||
// fate_v1.5
|
||||
parsingTable = strsIndy4CDVariant2Table;
|
||||
parsingTableSize = ARRAYSIZE(strsIndy4CDVariant2Table);
|
||||
break;
|
||||
case 6312: // Demo
|
||||
parsingTable = strsIndy4DemoTable;
|
||||
parsingTableSize = ARRAYSIZE(strsIndy4DemoTable);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (parsingTable)
|
||||
parseSTRSBlock(strsData, parsingTable, parsingTableSize);
|
||||
else
|
||||
warning("MacGuiImpl::readStrings(): String parsing table not defined for this variant of the game; STRS resource %d bytes", strsLen);
|
||||
|
||||
free(strsBlock);
|
||||
delete strsStream;
|
||||
|
||||
return parsingTable != nullptr;
|
||||
}
|
||||
|
||||
void MacGuiImpl::parseSTRSBlock(uint8 *strsData, const MacSTRSParsingEntry *parsingTable, int parsingTableSize) {
|
||||
_strsStrings.clear();
|
||||
_strsStrings.reserve(128);
|
||||
for (int i = 0; i < 128; i++) {
|
||||
_strsStrings.emplace_back("");
|
||||
}
|
||||
|
||||
for (int i = 0; i < parsingTableSize; i++) {
|
||||
MacSTRSParsingEntry entry = parsingTable[i];
|
||||
|
||||
if (entry.strId == kMSISkip) {
|
||||
for (int j = 0; j < entry.numStrings; j++) {
|
||||
entry.parsingMethod == MacGuiImpl::kStrC ? readCString(strsData) : readPascalString(strsData);
|
||||
}
|
||||
} else {
|
||||
for (int j = 0; j < entry.numStrings; j++) {
|
||||
if (entry.parsingMethod == MacGuiImpl::kStrC) {
|
||||
_strsStrings[entry.strId] = readCString(strsData);
|
||||
} else if (entry.parsingMethod == MacGuiImpl::kStrPascal) {
|
||||
_strsStrings[entry.strId] = readPascalString(strsData);
|
||||
} else {
|
||||
error("MacGuiImpl::parseSTRSBlock(): invalid parsing method encountered (%d)", entry.parsingMethod);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Scumm
|
||||
1133
engines/scumm/macgui/macgui_v5.cpp
Normal file
1133
engines/scumm/macgui/macgui_v5.cpp
Normal file
File diff suppressed because it is too large
Load Diff
80
engines/scumm/macgui/macgui_v5.h
Normal file
80
engines/scumm/macgui/macgui_v5.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SCUMM_MACGUI_MACGUI_V5_H
|
||||
#define SCUMM_MACGUI_MACGUI_V5_H
|
||||
|
||||
#include "common/events.h"
|
||||
#include "common/rect.h"
|
||||
#include "common/str.h"
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
class MacGuiImpl;
|
||||
|
||||
class MacV5Gui : public MacGuiImpl {
|
||||
public:
|
||||
MacV5Gui(ScummEngine *vm, const Common::Path &resourceFile);
|
||||
~MacV5Gui() {}
|
||||
|
||||
bool initialize() override;
|
||||
|
||||
const Common::String name() const override { return _strsStrings[kMSIGameName]; }
|
||||
int getNumColors() const override { return 256; }
|
||||
|
||||
bool handleEvent(Common::Event event) override;
|
||||
|
||||
const Graphics::Font *getFontByScummId(int32 id) override;
|
||||
|
||||
void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) override;
|
||||
|
||||
void resetAfterLoad() override;
|
||||
void update(int delta) override {}
|
||||
|
||||
protected:
|
||||
bool getFontParams(FontId fontId, int &id, int &size, int &slant) const override;
|
||||
|
||||
void updateMenus() override;
|
||||
bool handleMenu(int id, Common::String &name) override;
|
||||
|
||||
void runAboutDialog() override;
|
||||
bool runOptionsDialog() override;
|
||||
|
||||
private:
|
||||
struct AboutPage {
|
||||
const TextLine *text;
|
||||
int drawArea;
|
||||
uint32 delayMs;
|
||||
};
|
||||
|
||||
uint _roughProgress = 0;
|
||||
bool _roughWarned = false;
|
||||
|
||||
void runAboutDialogMI1(MacDialogWindow *window);
|
||||
void runAboutDialogMI2(MacDialogWindow *window);
|
||||
void runAboutDialogIndy4(MacDialogWindow *window);
|
||||
void runAboutDialogIndy4Demo(MacDialogWindow *window);
|
||||
|
||||
void drawShadow(Graphics::Surface *s, int x, int y, int h, Common::Pair<int, int> *drawData);
|
||||
};
|
||||
|
||||
} // End of namespace Scumm
|
||||
#endif
|
||||
1312
engines/scumm/macgui/macgui_v6.cpp
Normal file
1312
engines/scumm/macgui/macgui_v6.cpp
Normal file
File diff suppressed because it is too large
Load Diff
104
engines/scumm/macgui/macgui_v6.h
Normal file
104
engines/scumm/macgui/macgui_v6.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SCUMM_MACGUI_MACGUI_V6_H
|
||||
#define SCUMM_MACGUI_MACGUI_V6_H
|
||||
|
||||
#include "common/events.h"
|
||||
#include "common/rect.h"
|
||||
#include "common/str.h"
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
class MacGuiImpl;
|
||||
|
||||
class MacV6Gui : public MacGuiImpl {
|
||||
private:
|
||||
Common::String _gameName;
|
||||
|
||||
Graphics::Surface *_backupScreen;
|
||||
byte *_backupPalette;
|
||||
|
||||
int _screenSaveLevel = 0;
|
||||
bool _skipScene = false;
|
||||
|
||||
#if ENABLE_SCUMM_7_8
|
||||
// V7 games don't honor the music_mute and sfx_mute settings, so we
|
||||
// have to set the volume directly.
|
||||
|
||||
int _oldMusicVolume = -1;
|
||||
int _oldSfxVolume = -1;
|
||||
#endif
|
||||
|
||||
public:
|
||||
MacV6Gui(ScummEngine *vm, const Common::Path &resourceFile);
|
||||
~MacV6Gui();
|
||||
|
||||
bool initialize() override;
|
||||
bool readStrings() override;
|
||||
|
||||
const Common::String name() const override { return _gameName; }
|
||||
int getNumColors() const override { return 256; }
|
||||
|
||||
// See setMacGuiColors()
|
||||
uint32 getBlack() const override { return 255; }
|
||||
uint32 getWhite() const override { return 254; }
|
||||
|
||||
void updateWindowManager() override;
|
||||
|
||||
const Graphics::Font *getFontByScummId(int32 id) override;
|
||||
|
||||
void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) override;
|
||||
|
||||
void resetAfterLoad() override;
|
||||
void update(int delta) override {}
|
||||
|
||||
void updateThumbnail(MacDialogWindow *window, Common::Rect drawArea, int saveSlot);
|
||||
|
||||
protected:
|
||||
bool getFontParams(FontId fontId, int &id, int &size, int &slant) const override;
|
||||
|
||||
void updateMenus() override;
|
||||
bool handleMenu(int id, Common::String &name) override;
|
||||
|
||||
void saveScreen() override;
|
||||
void restoreScreen() override;
|
||||
|
||||
void onMenuOpen() override;
|
||||
void onMenuClose() override;
|
||||
|
||||
void drawDottedFrame(MacDialogWindow *window, Common::Rect bounds, int x1, int x2);
|
||||
|
||||
MacGuiImpl::MacImageSlider *addSlider(MacDialogWindow *window, int x, int y, int width, int minValue, int maxValue, int primaryMarkings = 4);
|
||||
|
||||
void setVolume(int type, int volume);
|
||||
|
||||
void runAboutDialog() override;
|
||||
bool runOpenDialog(int &saveSlotToHandle) override;
|
||||
bool runSaveDialog(int &saveSlotToHandle, Common::String &saveName) override;
|
||||
bool runOptionsDialog() override;
|
||||
bool runQuitDialog() override;
|
||||
bool runRestartDialog() override;
|
||||
};
|
||||
|
||||
} // End of namespace Scumm
|
||||
|
||||
#endif
|
||||
1845
engines/scumm/macgui/macgui_widgets.cpp
Normal file
1845
engines/scumm/macgui/macgui_widgets.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user