aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/agi.cpp
diff options
context:
space:
mode:
authorKari Salminen2007-07-10 15:28:43 +0000
committerKari Salminen2007-07-10 15:28:43 +0000
commit80cdd532bc8460d23b2562cafe336bedcbe6fb18 (patch)
treee2a87dc3265efc5cbbfaa316eba4ae6b9f745b7c /engines/agi/agi.cpp
parent728fe1ff86e26f781a0bd0656822b6845ef5707a (diff)
downloadscummvm-rg350-80cdd532bc8460d23b2562cafe336bedcbe6fb18.tar.gz
scummvm-rg350-80cdd532bc8460d23b2562cafe336bedcbe6fb18.tar.bz2
scummvm-rg350-80cdd532bc8460d23b2562cafe336bedcbe6fb18.zip
Add AgiButtonStyle and create correct style according to render mode (Supports PC and Amiga styles).
svn-id: r28009
Diffstat (limited to 'engines/agi/agi.cpp')
-rw-r--r--engines/agi/agi.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 61430dcaea..cb02df1ecc 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -535,6 +535,58 @@ static const GameSettings agiSettings[] = {
{NULL, NULL, 0, 0, NULL}
};
+AgiTextColor AgiButtonStyle::getColor(bool hasFocus, bool pressed, bool positive) const {
+ if (_amigaStyle)
+ if (positive)
+ if (pressed) // Positive pressed Amiga-style button
+ return AgiTextColor(amigaBlack, _olderAgi? amigaOrange : amigaPurple);
+ else // Positive unpressed Amiga-style button
+ return AgiTextColor(amigaWhite, amigaGreen);
+ else // _amigaStyle && !positive
+ if (pressed) // Negative pressed Amiga-style button
+ return AgiTextColor(amigaBlack, amigaCyan);
+ else // Negative unpressed Amiga-style button
+ return AgiTextColor(amigaWhite, amigaRed);
+ else // PC-style button
+ if (hasFocus || pressed) // A pressed or in focus PC-style button
+ return AgiTextColor(pcWhite, pcBlack);
+ else // An unpressed PC-style button without focus
+ return AgiTextColor(pcBlack, pcWhite);
+}
+
+AgiTextColor AgiButtonStyle::getColor(bool hasFocus, bool pressed, bool baseFgColor, bool baseBgColor) const {
+ return getColor(hasFocus, pressed, AgiTextColor(baseFgColor, baseBgColor));
+}
+
+AgiTextColor AgiButtonStyle::getColor(bool hasFocus, bool pressed, const AgiTextColor &baseColor) const {
+ if (hasFocus || pressed)
+ return baseColor.swap();
+ else
+ return baseColor;
+}
+
+int AgiButtonStyle::getTextOffset(bool hasFocus, bool pressed) const {
+ return (pressed && !_amigaStyle) ? 1 : 0;
+}
+
+bool AgiButtonStyle::getBorder(bool hasFocus, bool pressed) const {
+ return _amigaStyle && !_authenticAmiga && (hasFocus || pressed);
+}
+
+void AgiButtonStyle::setAmigaStyle(bool amigaStyle, bool olderAgi, bool authenticAmiga) {
+ _amigaStyle = amigaStyle;
+ _olderAgi = olderAgi;
+ _authenticAmiga = authenticAmiga;
+}
+
+void AgiButtonStyle::setPcStyle(bool pcStyle) {
+ setAmigaStyle(!pcStyle);
+}
+
+AgiButtonStyle::AgiButtonStyle(Common::RenderMode renderMode) {
+ setAmigaStyle(renderMode == Common::kRenderAmiga);
+}
+
AgiEngine::AgiEngine(OSystem *syst) : Engine(syst) {
// Setup mixer
@@ -635,6 +687,7 @@ void AgiEngine::initialize() {
}
}
+ _buttonStyle = AgiButtonStyle(_renderMode);
_console = new Console(this);
_gfx = new GfxMgr(this);
_sound = new SoundMgr(this, _mixer);