diff options
author | Willem Jan Palenstijn | 2015-07-22 22:37:40 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-07-22 22:43:42 +0200 |
commit | 6ec9c81b575f13b2c4b30aeac592ebf2557b5890 (patch) | |
tree | 503d50902bad2d800165593039d08d5ccf0c98ab /engines/agi/agi.cpp | |
parent | 5ec05f6b647c5ea41418be7ed19ad381f97cabd8 (diff) | |
parent | 4e5c8d35f7e133e2e72a846fdbd54900c91eeb73 (diff) | |
download | scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.gz scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.bz2 scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.zip |
Merge branch 'master' into mm
Conflicts:
engines/access/access.cpp
engines/access/asurface.h
engines/access/bubble_box.cpp
engines/access/bubble_box.h
engines/access/martian/martian_game.cpp
engines/access/player.cpp
engines/access/player.h
engines/access/resources.cpp
engines/access/screen.cpp
engines/access/screen.h
engines/access/sound.cpp
engines/access/sound.h
Diffstat (limited to 'engines/agi/agi.cpp')
-rw-r--r-- | engines/agi/agi.cpp | 94 |
1 files changed, 62 insertions, 32 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 1e663ec29a..2b5d7137bc 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -97,50 +97,62 @@ void AgiEngine::processEvents() { } break; case Common::EVENT_LBUTTONDOWN: - key = BUTTON_LEFT; - _mouse.button = kAgiMouseButtonLeft; - keyEnqueue(key); - _mouse.x = event.mouse.x; - _mouse.y = event.mouse.y; + if (_game.mouseEnabled) { + key = BUTTON_LEFT; + _mouse.button = kAgiMouseButtonLeft; + keyEnqueue(key); + _mouse.x = event.mouse.x; + _mouse.y = event.mouse.y; + } break; case Common::EVENT_RBUTTONDOWN: - key = BUTTON_RIGHT; - _mouse.button = kAgiMouseButtonRight; - keyEnqueue(key); - _mouse.x = event.mouse.x; - _mouse.y = event.mouse.y; + if (_game.mouseEnabled) { + key = BUTTON_RIGHT; + _mouse.button = kAgiMouseButtonRight; + keyEnqueue(key); + _mouse.x = event.mouse.x; + _mouse.y = event.mouse.y; + } break; case Common::EVENT_WHEELUP: - key = WHEEL_UP; - keyEnqueue(key); + if (_game.mouseEnabled) { + key = WHEEL_UP; + keyEnqueue(key); + } break; case Common::EVENT_WHEELDOWN: - key = WHEEL_DOWN; - keyEnqueue(key); + if (_game.mouseEnabled) { + key = WHEEL_DOWN; + keyEnqueue(key); + } break; case Common::EVENT_MOUSEMOVE: - _mouse.x = event.mouse.x; - _mouse.y = event.mouse.y; - - if (!_game.mouseFence.isEmpty()) { - if (_mouse.x < _game.mouseFence.left) - _mouse.x = _game.mouseFence.left; - if (_mouse.x > _game.mouseFence.right) - _mouse.x = _game.mouseFence.right; - if (_mouse.y < _game.mouseFence.top) - _mouse.y = _game.mouseFence.top; - if (_mouse.y > _game.mouseFence.bottom) - _mouse.y = _game.mouseFence.bottom; - - g_system->warpMouse(_mouse.x, _mouse.y); + if (_game.mouseEnabled) { + _mouse.x = event.mouse.x; + _mouse.y = event.mouse.y; + + if (!_game.mouseFence.isEmpty()) { + if (_mouse.x < _game.mouseFence.left) + _mouse.x = _game.mouseFence.left; + if (_mouse.x > _game.mouseFence.right) + _mouse.x = _game.mouseFence.right; + if (_mouse.y < _game.mouseFence.top) + _mouse.y = _game.mouseFence.top; + if (_mouse.y > _game.mouseFence.bottom) + _mouse.y = _game.mouseFence.bottom; + + g_system->warpMouse(_mouse.x, _mouse.y); + } } break; case Common::EVENT_LBUTTONUP: case Common::EVENT_RBUTTONUP: - _mouse.button = kAgiMouseButtonUp; - _mouse.x = event.mouse.x; - _mouse.y = event.mouse.y; + if (_game.mouseEnabled) { + _mouse.button = kAgiMouseButtonUp; + _mouse.x = event.mouse.x; + _mouse.y = event.mouse.y; + } break; case Common::EVENT_KEYDOWN: if (event.kbd.hasFlags(Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_d) { @@ -496,12 +508,15 @@ AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(sys // Assign default values to the config manager, in case settings are missing ConfMan.registerDefault("originalsaveload", "false"); ConfMan.registerDefault("altamigapalette", "false"); + ConfMan.registerDefault("mousesupport", "true"); _noSaveLoadAllowed = false; _rnd = new Common::RandomSource("agi"); _sound = 0; + _fontData = NULL; + initFeatures(); initVersion(); } @@ -550,6 +565,19 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas memset(&_debug, 0, sizeof(struct AgiDebug)); memset(&_mouse, 0, sizeof(struct Mouse)); + _game.mouseEnabled = true; + if (!ConfMan.getBool("mousesupport")) { + // we effectively disable the mouse for games, that explicitly do not want mouse support to be enabled + _game.mouseEnabled = false; + } + + // We are currently using the custom font for all fanmade games + if (!(getFeatures() & (GF_FANMADE | GF_AGDS))) { + _fontData = fontData_Sierra; // original Sierra font + } else { + _fontData = fontData_FanGames; // our (own?) custom font, that supports umlauts etc. + } + _game._vm = this; _game.clockEnabled = false; @@ -708,7 +736,9 @@ Common::Error AgiBase::init() { } Common::Error AgiEngine::go() { - CursorMan.showMouse(true); + if (_game.mouseEnabled) { + CursorMan.showMouse(true); + } setTotalPlayTime(0); if (_game.state < STATE_LOADED) { |