diff options
Diffstat (limited to 'engines/tsage')
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes8.cpp | 4 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes8.h | 2 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes9.cpp | 4 | ||||
-rw-r--r-- | engines/tsage/core.cpp | 9 | ||||
-rw-r--r-- | engines/tsage/detection.cpp | 1 | ||||
-rw-r--r-- | engines/tsage/detection_tables.h | 16 | ||||
-rw-r--r-- | engines/tsage/globals.cpp | 7 | ||||
-rw-r--r-- | engines/tsage/graphics.cpp | 3 | ||||
-rw-r--r-- | engines/tsage/graphics.h | 4 | ||||
-rw-r--r-- | engines/tsage/module.mk | 1 | ||||
-rw-r--r-- | engines/tsage/resources.h | 4 | ||||
-rw-r--r-- | engines/tsage/ringworld/ringworld_scenes3.cpp | 14 | ||||
-rw-r--r-- | engines/tsage/ringworld/ringworld_scenes3.h | 2 | ||||
-rw-r--r-- | engines/tsage/sherlock/sherlock_logo.cpp | 356 | ||||
-rw-r--r-- | engines/tsage/sherlock/sherlock_logo.h | 78 | ||||
-rw-r--r-- | engines/tsage/sound.cpp | 42 | ||||
-rw-r--r-- | engines/tsage/sound.h | 24 | ||||
-rw-r--r-- | engines/tsage/tsage.cpp | 10 | ||||
-rw-r--r-- | engines/tsage/tsage.h | 3 |
19 files changed, 511 insertions, 73 deletions
diff --git a/engines/tsage/blue_force/blueforce_scenes8.cpp b/engines/tsage/blue_force/blueforce_scenes8.cpp index 6855fd41b9..337e73dad0 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.cpp +++ b/engines/tsage/blue_force/blueforce_scenes8.cpp @@ -964,9 +964,10 @@ Scene810::Scene810(): SceneExt() { } void Scene810::synchronize(Serializer &s) { + int dummy = 0; SceneExt::synchronize(s); s.syncAsSint16LE(_fieldA70); - s.syncAsSint16LE(_fieldA72); + s.syncAsSint16LE(dummy); s.syncAsSint16LE(_fieldA74); } @@ -2220,6 +2221,7 @@ Scene840::Scene840(): PalettedScene() { _field1AC2 = 0; _field1AC4 = 0; _field1AC6 = (BF_GLOBALS._dayNumber > 3) ? 1 : 0; + _field1ABA = 0; } void Scene840::synchronize(Serializer &s) { diff --git a/engines/tsage/blue_force/blueforce_scenes8.h b/engines/tsage/blue_force/blueforce_scenes8.h index 140327e85d..09de14f150 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.h +++ b/engines/tsage/blue_force/blueforce_scenes8.h @@ -229,7 +229,7 @@ public: Exit _exit; ASoundExt _sound1; Rect _rect1, _rect2, _rect3; - int _fieldA70, _fieldA72, _fieldA74; + int _fieldA70, _fieldA74; Scene810(); virtual void synchronize(Serializer &s); diff --git a/engines/tsage/blue_force/blueforce_scenes9.cpp b/engines/tsage/blue_force/blueforce_scenes9.cpp index 53000d6997..5ba82a4714 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.cpp +++ b/engines/tsage/blue_force/blueforce_scenes9.cpp @@ -3521,7 +3521,7 @@ void Scene935::Action1::signal() { scene->_visualSpeaker.removeText(); scene->_visualSpeaker._textPos.y = scene->_sceneBounds.top + 80; scene->_visualSpeaker._color1 = 252; - scene->_visualSpeaker._color1 = 251; + scene->_visualSpeaker._color2 = 251; scene->_visualSpeaker.setText("Jake! Hide in the closet!"); setDelay(3); break; @@ -3538,7 +3538,7 @@ void Scene935::Action1::signal() { scene->_visualSpeaker.removeText(); scene->_visualSpeaker._textPos.y = scene->_sceneBounds.top + 150; scene->_visualSpeaker._color1 = 250; - scene->_visualSpeaker._color1 = 249; + scene->_visualSpeaker._color2 = 249; scene->_visualSpeaker.setText("Jake! Hide in the closet!"); setDelay(3); break; diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index f35aa583e2..d4068c25c9 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -56,6 +56,9 @@ InvObject::InvObject(int sceneNumber, int rlbNum, int cursorNum, CursorType curs _bounds = s.getBounds(); DEALLOCATE(imgData); + _visage = 0; + _strip = 0; + _frame = 0; } InvObject::InvObject(int visage, int strip, int frame) { @@ -1462,7 +1465,7 @@ void ScenePalette::fade(const byte *adjustData, bool fullAdjust, int percent) { adjustData += 3; } - // Set the altered pale4tte + // Set the altered palette g_system->getPaletteManager()->setPalette((const byte *)&tempPalette[0], 0, 256); GLOBALS._screenSurface.updateScreen(); } @@ -1518,7 +1521,7 @@ void ScenePalette::changeBackground(const Rect &bounds, FadeMode fadeMode) { } Rect tempRect = bounds; - if (g_vm->getGameID() != GType_Ringworld) + if (g_vm->getGameID() != GType_Ringworld && g_vm->getGameID() != GType_Sherlock1) tempRect.setHeight(T2_GLOBALS._interfaceY); g_globals->_screenSurface.copyFrom(g_globals->_sceneManager._scene->_backSurface, @@ -2803,7 +2806,7 @@ void SceneObject::updateScreen() { srcRect.right = ((srcRect.right + 3) / 4) * 4; srcRect.clip(g_globals->_sceneManager._scene->_sceneBounds); - if (g_vm->getGameID() != GType_Ringworld) { + if (g_vm->getGameID() != GType_Ringworld && g_vm->getGameID() != GType_Sherlock1) { if (T2_GLOBALS._uiElements._visible) srcRect.bottom = MIN<int16>(srcRect.bottom, T2_GLOBALS._interfaceY); } diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 9d61b4d182..388967931d 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -62,6 +62,7 @@ static const PlainGameDescriptor tSageGameTitles[] = { { "ringworld", "Ringworld: Revenge of the Patriarch" }, { "blueforce", "Blue Force" }, { "ringworld2", "Return to Ringworld" }, + { "sherlock-logo", "The Lost Files of Sherlock Holmes (Logo)" }, { 0, 0 } }; diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index da283a27e7..1dfc3e6fd2 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -185,6 +185,22 @@ static const tSageGameDescription gameDescriptions[] = { GType_Ringworld2, GF_CD | GF_ALT_REGIONS | GF_DEMO }, + + // The Lost Files of Sherlock Holmes - The Case of the Serrated Scalpel (Logo) + { + { + "sherlock-logo", + "", + AD_ENTRY1s("sf3.rlb", "153f9b93eda4e95578e31be30e69b5e5", 50419), + Common::EN_ANY, + Common::kPlatformDOS, + ADGF_NO_FLAGS, + GUIO0() + }, + GType_Sherlock1, + GF_FLOPPY + }, + { AD_TABLE_END_MARKER, 0, 0 } }; diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index e75febfdbc..1be3e2b6da 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -27,6 +27,7 @@ #include "tsage/ringworld/ringworld_logic.h" #include "tsage/ringworld2/ringworld2_logic.h" #include "tsage/ringworld2/ringworld2_scenes0.h" +#include "tsage/sherlock/sherlock_logo.h" #include "tsage/staticres.h" namespace TsAGE { @@ -156,6 +157,12 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface _game = new Ringworld2::Ringworld2Game(); _sceneHandler = new Ringworld2::SceneHandlerExt(); break; + + case GType_Sherlock1: + _inventory = nullptr; + _sceneHandler = new Sherlock::SherlockSceneHandler(); + _game = new Sherlock::SherlockLogo(); + break; } } diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index ce24c76290..156503fb51 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -1289,7 +1289,8 @@ void GfxManager::setDefaults() { _font._edgeSize = Common::Point(1, 1); _font._colors = g_globals->_fontColors; - _font.setFontNumber(g_globals->_gfxFontNumber); + if (g_globals->_gfxFontNumber >= 0) + _font.setFontNumber(g_globals->_gfxFontNumber); } void GfxManager::activate() { diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index d65d0bcf8b..25f7aea8cd 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -20,8 +20,8 @@ * */ -#ifndef RING_GRAPHICS_H -#define RING_GRAPHICS_H +#ifndef TSAGE_GRAPHICS_H +#define TSAGE_GRAPHICS_H #include "tsage/events.h" #include "tsage/saveload.h" diff --git a/engines/tsage/module.mk b/engines/tsage/module.mk index d62f398c20..e23b157a95 100644 --- a/engines/tsage/module.mk +++ b/engines/tsage/module.mk @@ -47,6 +47,7 @@ MODULE_OBJS := \ ringworld2/ringworld2_vampire.o \ saveload.o \ scenes.o \ + sherlock/sherlock_logo.o \ sound.o \ staticres.o \ tsage.o \ diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h index a7536a3c2d..7aa0c49dd4 100644 --- a/engines/tsage/resources.h +++ b/engines/tsage/resources.h @@ -20,8 +20,8 @@ * */ -#ifndef RING_RESOURCES_H -#define RING_RESOURCES_H +#ifndef TSAGE_RESOURCES_H +#define TSAGE_RESOURCES_H #include "common/scummsys.h" #include "common/array.h" diff --git a/engines/tsage/ringworld/ringworld_scenes3.cpp b/engines/tsage/ringworld/ringworld_scenes3.cpp index d8556c691e..a515224964 100644 --- a/engines/tsage/ringworld/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld/ringworld_scenes3.cpp @@ -494,7 +494,7 @@ void Scene2100::Action1::signal() { setDelay(1); else { setAction(&scene->_sequenceManager, this, 2102, &g_globals->_player, NULL); - scene->_sitFl = 0; + scene->_sitFl = false; } break; case 1: { @@ -1548,6 +1548,7 @@ Scene2100::Scene2100() : _area3._pt = Common::Point(200, 75); _area4.setup(2153, 1, 1, OBJECT_TRANSLATOR); _area4._pt = Common::Point(237, 77); + _sitFl = false; } void Scene2100::postInit(SceneObjectList *OwnerList) { @@ -1688,7 +1689,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { g_globals->_player._moveDiff.x = 4; g_globals->_player.changeZoom(-1); g_globals->_player.disableControl(); - _sitFl = 0; + _sitFl = false; switch (g_globals->_sceneManager._previousScene) { case 2120: @@ -1824,7 +1825,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { g_globals->_player.fixPriority(152); g_globals->_player.setStrip(2); - _sitFl = 1; + _sitFl = true; _object4.postInit(); _object4.setVisage(2102); @@ -1858,7 +1859,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { g_globals->_player.fixPriority(152); g_globals->_player.setStrip(2); - _sitFl = 1; + _sitFl = true; setAction(&_action16); } break; @@ -1932,12 +1933,12 @@ void Scene2100::stripCallback(int v) { void Scene2100::signal() { switch (_sceneMode) { case 2101: - _sitFl = 1; + _sitFl = true; g_globals->_player._uiEnabled = true; g_globals->_events.setCursor(CURSOR_USE); break; case 2102: - _sitFl = 0; + _sitFl = false; g_globals->_player.enableControl(); break; case 2103: @@ -5789,6 +5790,7 @@ Scene2320::Scene2320() : _area3._pt = Common::Point(200, 75); _area4.setup(2153, 1, 1, 10); _area4._pt = Common::Point(237, 77); + _hotspotPtr = nullptr; } void Scene2320::postInit(SceneObjectList *OwnerList) { diff --git a/engines/tsage/ringworld/ringworld_scenes3.h b/engines/tsage/ringworld/ringworld_scenes3.h index a371f800b9..752b6acd48 100644 --- a/engines/tsage/ringworld/ringworld_scenes3.h +++ b/engines/tsage/ringworld/ringworld_scenes3.h @@ -283,7 +283,7 @@ public: Action15 _action15; Action16 _action16; Action17 _action17; - int _sitFl; + bool _sitFl; SceneArea _area1, _area2, _area3, _area4; Scene2100(); diff --git a/engines/tsage/sherlock/sherlock_logo.cpp b/engines/tsage/sherlock/sherlock_logo.cpp new file mode 100644 index 0000000000..2922a9938b --- /dev/null +++ b/engines/tsage/sherlock/sherlock_logo.cpp @@ -0,0 +1,356 @@ +/* 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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "tsage/sherlock/sherlock_logo.h" +#include "tsage/scenes.h" +#include "tsage/tsage.h" + +namespace TsAGE { + +namespace Sherlock { + +void SherlockLogo::start() { + GLOBALS._gfxFontNumber = -1; + GLOBALS.gfxManager().setDefaults(); + + // Start the demo's single scene + g_globals->_sceneManager.changeScene(1); + + g_globals->_events.setCursor(CURSOR_NONE); +} + +Scene *SherlockLogo::createScene(int sceneNumber) { + // The demo only has a single scene, so ignore the scene number and always return it + return new SherlockLogoScene(); +} + +bool SherlockLogo::canLoadGameStateCurrently() { + return false; +} + +bool SherlockLogo::canSaveGameStateCurrently() { + return false; +} + +void SherlockLogo::processEvent(Event &event) { + if (event.eventType == EVENT_BUTTON_DOWN || (event.eventType == EVENT_KEYPRESS && + event.kbd.keycode == Common::KEYCODE_ESCAPE)) + quitGame(); +} + +void SherlockLogo::quitGame() { + g_vm->quitGame(); +} + +/*--------------------------------------------------------------------------*/ + +void SherlockSceneHandler::postInit(SceneObjectList *OwnerList) { + _delayTicks = 2; + + GLOBALS._soundManager.postInit(); + GLOBALS._soundManager.buildDriverList(true); + GLOBALS._soundManager.installConfigDrivers(); + + GLOBALS._sceneManager.setNewScene(10); + GLOBALS._game->start(); +} + +/*--------------------------------------------------------------------------*/ + +void Object::setVisage(const Common::String &name) { + int visageNum = atoi(name.c_str()); + SceneObject::setVisage(visageNum); +} + +/*--------------------------------------------------------------------------*/ + +void SherlockLogoScene::Action1::signal() { + SherlockLogoScene &scene = *(SherlockLogoScene *)GLOBALS._sceneManager._scene; + + switch (_actionIndex++) { + case 0: + // Load scene palette + GLOBALS._scenePalette.loadPalette(1111); + GLOBALS._scenePalette.loadPalette(1); + GLOBALS._scenePalette.refresh(); + setDelay(1); + break; + + case 1: + // Fade in the spotlight background + GLOBALS._scenePalette.addFader(scene._palette1._palette, 256, 6, this); + break; + + case 2: + // First half of square, circle, and triangle bouncing + scene._object1.postInit(); + scene._object1.setVisage("0016.vis"); + scene._object1._strip = 1; + scene._object1._frame = 1; + scene._object1.setPosition(Common::Point(169, 107)); + scene._object1.changeZoom(100); + scene._object1._numFrames = 7; + scene._object1.animate(ANIM_MODE_5, this); + break; + + case 3: + // Remainder of bouncing square, circle, and triangle coming to rest + scene._object1._strip = 2; + scene._object1._frame = 1; + scene._object1.changeZoom(100); + scene._object1.animate(ANIM_MODE_4, 11, 1, this); + break; + + case 4: + // Fade out background without fading out the shapes + GLOBALS._scenePalette.addFader(scene._palette2._palette, 256, 6, this); + break; + + case 5: + scene._backSurface.fillRect(scene._sceneBounds, 0); + scene._gfxManager2.activate(); + scene._gfxManager2.fillRect(scene._sceneBounds, 0); + scene._gfxManager2.deactivate(); + //word_2B4AA = 3; + setDelay(10); + break; + + case 6: + GLOBALS._scenePalette.loadPalette(12); + GLOBALS._scenePalette.refresh(); + setDelay(1); + break; + + case 7: + // Animation of shapes expanding upwards to form larger EA logo + scene._object1.setVisage("0012.vis"); + scene._object1._strip = 1; + scene._object1._frame = 1; + scene._object1.changeZoom(100); + scene._object1.setPosition(Common::Point(170, 142)); + scene._object1._numFrames = 7; + scene._object1.animate(ANIM_MODE_5, (const void *)nullptr); + ADD_MOVER(scene._object1, 158, 71); + break; + + case 8: + GLOBALS._scenePalette.addFader(scene._palette3._palette, 256, 40, this); + break; + + case 9: + // Show 'Electronic Arts' company name + scene._object2.postInit(nullptr); + scene._object2.setVisage("0014.vis"); + scene._object2._strip = 1; + scene._object2._frame = 1; + scene._object2.setPosition(Common::Point(152, 98)); + scene._object2.changeZoom(100); + scene._object2.animate(ANIM_MODE_NONE, (const void *)nullptr); + setDelay(120); + break; + + case 10: + // Remainder of steps is positioning and sizing hand cursorin an arc + scene._object3.postInit(); + scene._object3.setVisage("0018.vis"); + scene._object3._strip = 1; + scene._object3._frame = 1; + scene._object3.setPosition(Common::Point(33, 91)); + scene._object3.changeZoom(100); + scene._object3.animate(ANIM_MODE_NONE, (const void *)nullptr); + setDelay(5); + break; + + case 11: + scene._object3._frame = 2; + scene._object3.setPosition(Common::Point(44, 124)); + setDelay(5); + break; + + case 12: + scene._object3._frame = 3; + scene._object3.setPosition(Common::Point(64, 153)); + setDelay(5); + break; + + case 13: + scene._object3._frame = 4; + scene._object3.setPosition(Common::Point(87, 174)); + setDelay(5); + break; + + case 14: + scene._object3._frame = 5; + scene._object3.setPosition(Common::Point(114, 191)); + setDelay(5); + break; + + case 15: + scene._object3._frame = 6; + scene._object3.setPosition(Common::Point(125, 184)); + setDelay(5); + break; + + case 16: + scene._object3._frame = 7; + scene._object3.setPosition(Common::Point(154, 187)); + setDelay(5); + break; + + case 17: + scene._object3._frame = 8; + scene._object3.setPosition(Common::Point(181, 182)); + setDelay(5); + break; + + case 18: + scene._object3._frame = 9; + scene._object3.setPosition(Common::Point(191, 167)); + setDelay(5); + break; + + case 19: + scene._object3._frame = 10; + scene._object3.setPosition(Common::Point(190, 150)); + setDelay(5); + break; + + case 20: + scene._object3._frame = 11; + scene._object3.setPosition(Common::Point(182, 139)); + setDelay(5); + break; + + case 21: + scene._object3._frame = 11; + scene._object3.setPosition(Common::Point(170, 130)); + setDelay(5); + break; + + case 22: + scene._object3._frame = 11; + scene._object3.setPosition(Common::Point(158, 121)); + setDelay(8); + break; + + case 23: + // Show a highlighting of the company name + scene._object3.hide(); + scene._object4.show(); + scene._object4.setPosition(Common::Point(155, 94)); + setDelay(8); + break; + + case 24: + scene._object4._frame = 2; + scene._object4.setPosition(Common::Point(155, 94)); + setDelay(8); + break; + + case 25: + scene._object2.remove(); + setDelay(1); + break; + + case 26: + scene._object4._frame = 3; + scene._object4.setPosition(Common::Point(155, 94)); + setDelay(8); + break; + + case 27: + scene._object4._frame = 4; + scene._object4.setPosition(Common::Point(155, 94)); + setDelay(8); + break; + break; + + case 28: + scene._object4._frame = 5; + scene._object4.setPosition(Common::Point(155, 94)); + setDelay(8); + break; + break; + + case 29: + scene._object4._frame = 6; + scene._object4.setPosition(Common::Point(155, 94)); + setDelay(8); + break; + break; + + case 30: + scene._object4._frame = 7; + scene._object4.setPosition(Common::Point(155, 94)); + setDelay(8); + break; + break; + + case 31: + scene._object4._frame = 8; + scene._object4.setPosition(Common::Point(155, 94)); + setDelay(8); + break; + + case 32: + setDelay(180); + break; + + default: + scene.finish(); + remove(); + break; + } +} + +/*--------------------------------------------------------------------------*/ + +void SherlockLogoScene::postInit(SceneObjectList *OwnerList) { + loadScene(10); + Scene::postInit(OwnerList); + + _palette1.loadPalette(1111); + _palette1.loadPalette(10); + _palette2.loadPalette(1111); + _palette2.loadPalette(1); + _palette3.loadPalette(1111); + _palette3.loadPalette(14); + + _object4.postInit(); + _object4.setVisage("0019.vis"); + _object4._strip = 1; + _object4._frame = 1; + _object4.setPosition(Common::Point(155, 94)); + _object4.changeZoom(100); + _object4.animate(ANIM_MODE_NONE, (const void *)nullptr); + _object4.hide(); + + setAction(&_action1); +} + +void SherlockLogoScene::finish() { + g_vm->quitGame(); +} + +} // End of namespace Sherlock + +} // End of namespace TsAGE diff --git a/engines/tsage/sherlock/sherlock_logo.h b/engines/tsage/sherlock/sherlock_logo.h new file mode 100644 index 0000000000..95fc0e272f --- /dev/null +++ b/engines/tsage/sherlock/sherlock_logo.h @@ -0,0 +1,78 @@ +/* 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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TSAGE_SHERLOCK_LOGO_H +#define TSAGE_SHERLOCK_LOGO_H + +#include "common/scummsys.h" +#include "tsage/events.h" +#include "tsage/core.h" +#include "tsage/scenes.h" +#include "tsage/globals.h" +#include "tsage/sound.h" + +namespace TsAGE { + +namespace Sherlock { + +using namespace TsAGE; + +class Object : public SceneObject { +public: + void setVisage(const Common::String &name); +}; + +class SherlockLogo: public Game { +public: + virtual void start(); + virtual Scene *createScene(int sceneNumber); + virtual void quitGame(); + virtual void processEvent(Event &event); + virtual bool canSaveGameStateCurrently(); + virtual bool canLoadGameStateCurrently(); +}; + +class SherlockSceneHandler : public SceneHandler { +public: + virtual void postInit(SceneObjectList *OwnerList); +}; + +class SherlockLogoScene: public Scene { + class Action1 : public Action { + public: + virtual void signal(); + }; +public: + ScenePalette _palette1, _palette2, _palette3; + Object _object1, _object2, _object3, _object4; + Action1 _action1; + GfxManager _gfxManager2; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + void finish(); +}; + +} // End of namespace Sherlock + +} // End of namespace TsAGE + +#endif diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index b95b614f09..0d3fb55dd3 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -20,9 +20,9 @@ * */ +#include "audio/fmopl.h" #include "audio/decoders/raw.h" #include "common/config-manager.h" -#include "audio/decoders/raw.h" #include "audio/audiostream.h" #include "tsage/core.h" #include "tsage/globals.h" @@ -2743,17 +2743,9 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _groupData._pData = &adlib_group_data[0]; _mixer = g_vm->_mixer; - _sampleRate = _mixer->getOutputRate(); _opl = OPL::Config::create(); assert(_opl); - _opl->init(_sampleRate); - - _samplesTillCallback = 0; - _samplesTillCallbackRemainder = 0; - _samplesPerCallback = getRate() / CALLBACKS_PER_SECOND; - _samplesPerCallbackRemainder = getRate() % CALLBACKS_PER_SECOND; - - _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); + _opl->init(); Common::fill(_channelVoiced, _channelVoiced + ADLIB_CHANNEL_COUNT, false); memset(_channelVolume, 0, ADLIB_CHANNEL_COUNT * sizeof(int)); @@ -2772,11 +2764,12 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _channelVoiced[i] = false; _pitchBlend[i] = 0; } + + _opl->start(new Common::Functor0Mem<void, AdlibSoundDriver>(this, &AdlibSoundDriver::onTimer), CALLBACKS_PER_SECOND); } AdlibSoundDriver::~AdlibSoundDriver() { DEALLOCATE(_patchData); - _mixer->stopHandle(_soundHandle); delete _opl; } @@ -3019,33 +3012,12 @@ void AdlibSoundDriver::setFrequency(int channel) { ((dataWord >> 8) & 3) | (var2 << 2)); } -int AdlibSoundDriver::readBuffer(int16 *buffer, const int numSamples) { +void AdlibSoundDriver::onTimer() { Common::StackLock slock1(SoundManager::sfManager()._serverDisabledMutex); Common::StackLock slock2(SoundManager::sfManager()._serverSuspendedMutex); - int32 samplesLeft = numSamples; - memset(buffer, 0, sizeof(int16) * numSamples); - while (samplesLeft) { - if (!_samplesTillCallback) { - SoundManager::sfUpdateCallback(NULL); - flush(); - - _samplesTillCallback = _samplesPerCallback; - _samplesTillCallbackRemainder += _samplesPerCallbackRemainder; - if (_samplesTillCallbackRemainder >= CALLBACKS_PER_SECOND) { - _samplesTillCallback++; - _samplesTillCallbackRemainder -= CALLBACKS_PER_SECOND; - } - } - - int32 render = MIN<int>(samplesLeft, _samplesTillCallback); - samplesLeft -= render; - _samplesTillCallback -= render; - - _opl->readBuffer(buffer, render); - buffer += render; - } - return numSamples; + SoundManager::sfUpdateCallback(NULL); + flush(); } /*--------------------------------------------------------------------------*/ diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 49558b4bca..68755a48c8 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -27,12 +27,15 @@ #include "common/mutex.h" #include "common/queue.h" #include "audio/audiostream.h" -#include "audio/fmopl.h" #include "audio/mixer.h" #include "common/list.h" #include "tsage/saveload.h" #include "tsage/core.h" +namespace OPL { +class OPL; +} + namespace TsAGE { class Sound; @@ -446,21 +449,15 @@ public: #define ADLIB_CHANNEL_COUNT 9 -class AdlibSoundDriver: public SoundDriver, Audio::AudioStream { +class AdlibSoundDriver: public SoundDriver { private: GroupData _groupData; Audio::Mixer *_mixer; - FM_OPL *_opl; - Audio::SoundHandle _soundHandle; - int _sampleRate; + OPL::OPL *_opl; byte _portContents[256]; const byte *_patchData; int _masterVolume; Common::Queue<RegisterValue> _queue; - int _samplesTillCallback; - int _samplesTillCallbackRemainder; - int _samplesPerCallback; - int _samplesPerCallbackRemainder; bool _channelVoiced[ADLIB_CHANNEL_COUNT]; int _channelVolume[ADLIB_CHANNEL_COUNT]; @@ -495,13 +492,8 @@ public: virtual void proc38(int channel, int cmd, int value); virtual void setPitch(int channel, int pitchBlend); - // AudioStream interface - virtual int readBuffer(int16 *buffer, const int numSamples); - virtual bool isStereo() const { return false; } - virtual bool endOfData() const { return false; } - virtual int getRate() const { return _sampleRate; } - - void update(int16 *buf, int len); +private: + void onTimer(); }; class SoundBlasterDriver: public SoundDriver { diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 0b882d5cbf..4412d0670f 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -44,11 +44,12 @@ TSageEngine::TSageEngine(OSystem *system, const tSageGameDescription *gameDesc) _debugger = new DemoDebugger(); else _debugger = new RingworldDebugger(); - } - else if (g_vm->getGameID() == GType_BlueForce) + } else if (g_vm->getGameID() == GType_BlueForce) _debugger = new BlueForceDebugger(); else if (g_vm->getGameID() == GType_Ringworld2) _debugger = new Ringworld2Debugger(); + else if (g_vm->getGameID() == GType_Sherlock1) + _debugger = new DemoDebugger(); } Common::Error TSageEngine::init() { @@ -110,6 +111,11 @@ void TSageEngine::initialize() { // Reset all global variables R2_GLOBALS.reset(); + } else if (g_vm->getGameID() == GType_Sherlock1) { + g_resourceManager->addLib("SF3.RLB"); + g_globals = new Globals(); + + return; } g_globals->gfxManager().setDefaults(); diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index ea4f5da6ea..667a8daa59 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -42,7 +42,8 @@ namespace TsAGE { enum { GType_Ringworld = 0, GType_BlueForce = 1, - GType_Ringworld2 = 2 + GType_Ringworld2 = 2, + GType_Sherlock1 = 5 }; enum { |