Added support for ScummVM boot parameter values as well invoking the built-in debugger
svn-id: r23413
This commit is contained in:
parent
64d0e4dcd8
commit
6b5150797a
3 changed files with 179 additions and 83 deletions
|
@ -24,12 +24,12 @@
|
||||||
#include "lure/strings.h"
|
#include "lure/strings.h"
|
||||||
#include "lure/room.h"
|
#include "lure/room.h"
|
||||||
#include "lure/system.h"
|
#include "lure/system.h"
|
||||||
#include "lure/debug-input.h"
|
|
||||||
#include "lure/debug-methods.h"
|
|
||||||
#include "lure/scripts.h"
|
#include "lure/scripts.h"
|
||||||
#include "lure/res_struct.h"
|
#include "lure/res_struct.h"
|
||||||
#include "lure/animseq.h"
|
#include "lure/animseq.h"
|
||||||
|
|
||||||
|
#include "common/config-manager.h"
|
||||||
|
|
||||||
namespace Lure {
|
namespace Lure {
|
||||||
|
|
||||||
static Game *int_game = NULL;
|
static Game *int_game = NULL;
|
||||||
|
@ -40,16 +40,22 @@ Game &Game::getReference() {
|
||||||
|
|
||||||
Game::Game() {
|
Game::Game() {
|
||||||
int_game = this;
|
int_game = this;
|
||||||
|
_debugger = new Debugger();
|
||||||
_slowSpeedFlag = true;
|
_slowSpeedFlag = true;
|
||||||
_soundFlag = true;
|
_soundFlag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Game::~Game() {
|
||||||
|
delete _debugger;
|
||||||
|
}
|
||||||
|
|
||||||
void Game::nextFrame() {
|
void Game::nextFrame() {
|
||||||
Resources &res = Resources::getReference();
|
Resources &res = Resources::getReference();
|
||||||
ValueTableData &fields = res.fieldList();
|
ValueTableData &fields = res.fieldList();
|
||||||
Room &room = Room::getReference();
|
Room &room = Room::getReference();
|
||||||
HotspotList::iterator i;
|
HotspotList::iterator i;
|
||||||
|
|
||||||
|
res.pausedList().countdown();
|
||||||
room.checkCursor();
|
room.checkCursor();
|
||||||
room.update();
|
room.update();
|
||||||
|
|
||||||
|
@ -79,12 +85,11 @@ void Game::nextFrame() {
|
||||||
|
|
||||||
void Game::execute() {
|
void Game::execute() {
|
||||||
OSystem &system = System::getReference();
|
OSystem &system = System::getReference();
|
||||||
Room &r = Room::getReference();
|
Room &room = Room::getReference();
|
||||||
Resources &res = Resources::getReference();
|
Resources &res = Resources::getReference();
|
||||||
Events &events = Events::getReference();
|
Events &events = Events::getReference();
|
||||||
Mouse &mouse = Mouse::getReference();
|
Mouse &mouse = Mouse::getReference();
|
||||||
Screen &screen = Screen::getReference();
|
Screen &screen = Screen::getReference();
|
||||||
//Menu &menu = Menu::getReference();
|
|
||||||
ValueTableData &fields = res.fieldList();
|
ValueTableData &fields = res.fieldList();
|
||||||
|
|
||||||
uint32 timerVal = system.getMillis();
|
uint32 timerVal = system.getMillis();
|
||||||
|
@ -97,13 +102,13 @@ void Game::execute() {
|
||||||
|
|
||||||
Script::execute(STARTUP_SCRIPT);
|
Script::execute(STARTUP_SCRIPT);
|
||||||
|
|
||||||
// Load the first room
|
int bootParam = ConfMan.getInt("boot_param");
|
||||||
r.setRoomNumber(1);
|
handleBootParam(bootParam);
|
||||||
|
|
||||||
// Set the player direction
|
// Set the player direction
|
||||||
res.getActiveHotspot(PLAYER_ID)->setDirection(UP);
|
res.getActiveHotspot(PLAYER_ID)->setDirection(UP);
|
||||||
|
|
||||||
r.update();
|
room.update();
|
||||||
mouse.setCursorNum(CURSOR_ARROW);
|
mouse.setCursorNum(CURSOR_ARROW);
|
||||||
mouse.cursorOn();
|
mouse.cursorOn();
|
||||||
|
|
||||||
|
@ -118,42 +123,46 @@ void Game::execute() {
|
||||||
|
|
||||||
while (events.pollEvent()) {
|
while (events.pollEvent()) {
|
||||||
if (events.type() == OSystem::EVENT_KEYDOWN) {
|
if (events.type() == OSystem::EVENT_KEYDOWN) {
|
||||||
uint16 roomNum = r.roomNumber();
|
uint16 roomNum = room.roomNumber();
|
||||||
|
|
||||||
#ifdef LURE_DEBUG
|
if ((events.event().kbd.flags == OSystem::KBD_CTRL) &&
|
||||||
if (events.event().kbd.keycode == 282) {
|
(events.event().kbd.keycode == 'd')) {
|
||||||
doDebugMenu();
|
// Activate the debugger
|
||||||
continue;
|
_debugger->attach();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
switch (events.event().kbd.ascii) {
|
switch (events.event().kbd.ascii) {
|
||||||
case 27:
|
case 27:
|
||||||
events.quitFlag = true;
|
events.quitFlag = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef LURE_DEBUG
|
|
||||||
case '+':
|
case '+':
|
||||||
while (++roomNum <= 51)
|
while (++roomNum <= 51)
|
||||||
if (res.getRoom(roomNum) != NULL) break;
|
if (res.getRoom(roomNum) != NULL) break;
|
||||||
if (roomNum == 52) roomNum = 1;
|
if (roomNum == 52) roomNum = 1;
|
||||||
|
|
||||||
r.leaveRoom();
|
room.leaveRoom();
|
||||||
r.setRoomNumber(roomNum);
|
room.setRoomNumber(roomNum);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
if (roomNum == 1) roomNum = 55;
|
if (roomNum == 1) roomNum = 55;
|
||||||
while (res.getRoom(--roomNum) == NULL) ;
|
while (res.getRoom(--roomNum) == NULL) ;
|
||||||
|
|
||||||
r.leaveRoom();
|
room.leaveRoom();
|
||||||
r.setRoomNumber(roomNum);
|
room.setRoomNumber(roomNum);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '*':
|
case '*':
|
||||||
res.getActiveHotspot(PLAYER_ID)->setRoomNumber(
|
res.getActiveHotspot(PLAYER_ID)->setRoomNumber(
|
||||||
r.roomNumber());
|
room.roomNumber());
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
case 267: // keypad '/'
|
||||||
|
room.setShowInfo(!room.showInfo());
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -168,8 +177,9 @@ void Game::execute() {
|
||||||
destRoom = fields.getField(NEW_ROOM_NUMBER);
|
destRoom = fields.getField(NEW_ROOM_NUMBER);
|
||||||
if (destRoom != 0) {
|
if (destRoom != 0) {
|
||||||
// Need to change the current room
|
// Need to change the current room
|
||||||
|
strcpy(room.statusLine(), "");
|
||||||
bool remoteFlag = fields.getField(OLD_ROOM_NUMBER) != 0;
|
bool remoteFlag = fields.getField(OLD_ROOM_NUMBER) != 0;
|
||||||
r.setRoomNumber(destRoom, remoteFlag);
|
room.setRoomNumber(destRoom, remoteFlag);
|
||||||
fields.setField(NEW_ROOM_NUMBER, 0);
|
fields.setField(NEW_ROOM_NUMBER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,6 +190,9 @@ void Game::execute() {
|
||||||
|
|
||||||
system.updateScreen();
|
system.updateScreen();
|
||||||
system.delayMillis(10);
|
system.delayMillis(10);
|
||||||
|
|
||||||
|
if (_debugger->isAttached())
|
||||||
|
_debugger->onFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If Skorl catches player, show the catching animation
|
// If Skorl catches player, show the catching animation
|
||||||
|
@ -199,53 +212,9 @@ void Game::execute() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r.leaveRoom();
|
room.leaveRoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LURE_DEBUG
|
|
||||||
|
|
||||||
#define NUM_DEBUG_ITEMS 4
|
|
||||||
const char *debugItems[NUM_DEBUG_ITEMS] =
|
|
||||||
{"Toggle Info", "Set Room", "Show Active HS", "Show Room HS"};
|
|
||||||
|
|
||||||
void Game::doDebugMenu() {
|
|
||||||
uint16 index = PopupMenu::Show(NUM_DEBUG_ITEMS, debugItems);
|
|
||||||
Room &r = Room::getReference();
|
|
||||||
Resources &res = Resources::getReference();
|
|
||||||
|
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
// Toggle co-ordinates
|
|
||||||
r.setShowInfo(!r.showInfo());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
// Set room number:
|
|
||||||
uint32 roomNumber;
|
|
||||||
if (!input_integer("Enter room number:", roomNumber)) return;
|
|
||||||
if (res.getRoom(roomNumber))
|
|
||||||
r.setRoomNumber(roomNumber);
|
|
||||||
else
|
|
||||||
Dialog::show("The room does not exist");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
// Show active hotspots
|
|
||||||
showActiveHotspots();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
// Show hotspots in room
|
|
||||||
showRoomHotspots();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void Game::handleMenuResponse(uint8 selection) {
|
void Game::handleMenuResponse(uint8 selection) {
|
||||||
switch (selection) {
|
switch (selection) {
|
||||||
case MENUITEM_CREDITS:
|
case MENUITEM_CREDITS:
|
||||||
|
@ -274,9 +243,12 @@ void Game::playerChangeRoom() {
|
||||||
Resources &res = Resources::getReference();
|
Resources &res = Resources::getReference();
|
||||||
Room &room = Room::getReference();
|
Room &room = Room::getReference();
|
||||||
ValueTableData &fields = res.fieldList();
|
ValueTableData &fields = res.fieldList();
|
||||||
|
SequenceDelayList &delayList = Resources::getReference().delayList();
|
||||||
|
|
||||||
uint16 roomNum = fields.playerNewPos().roomNumber;
|
uint16 roomNum = fields.playerNewPos().roomNumber;
|
||||||
fields.playerNewPos().roomNumber = 0;
|
fields.playerNewPos().roomNumber = 0;
|
||||||
Point &newPos = fields.playerNewPos().position;
|
Point &newPos = fields.playerNewPos().position;
|
||||||
|
delayList.clear();
|
||||||
|
|
||||||
Hotspot *player = res.getActiveHotspot(PLAYER_ID);
|
Hotspot *player = res.getActiveHotspot(PLAYER_ID);
|
||||||
player->currentActions().clear();
|
player->currentActions().clear();
|
||||||
|
@ -325,12 +297,17 @@ void Game::handleClick() {
|
||||||
void Game::handleRightClickMenu() {
|
void Game::handleRightClickMenu() {
|
||||||
Room &room = Room::getReference();
|
Room &room = Room::getReference();
|
||||||
Resources &res = Resources::getReference();
|
Resources &res = Resources::getReference();
|
||||||
|
Screen &screen = Screen::getReference();
|
||||||
ValueTableData &fields = res.fieldList();
|
ValueTableData &fields = res.fieldList();
|
||||||
|
StringData &strings = StringData::getReference();
|
||||||
|
Mouse &mouse = Mouse::getReference();
|
||||||
|
char *statusLine = room.statusLine();
|
||||||
Hotspot *player = res.getActiveHotspot(PLAYER_ID);
|
Hotspot *player = res.getActiveHotspot(PLAYER_ID);
|
||||||
HotspotData *hotspot;
|
HotspotData *hotspot, *useHotspot;
|
||||||
Action action;
|
Action action;
|
||||||
uint32 actions;
|
uint32 actions;
|
||||||
uint16 itemId = 0xffff;
|
uint16 itemId = 0xffff;
|
||||||
|
bool hasItems;
|
||||||
|
|
||||||
if (room.hotspotId() != 0) {
|
if (room.hotspotId() != 0) {
|
||||||
// Get hotspot actions
|
// Get hotspot actions
|
||||||
|
@ -353,8 +330,18 @@ void Game::handleRightClickMenu() {
|
||||||
|
|
||||||
bool breakFlag = false;
|
bool breakFlag = false;
|
||||||
while (!breakFlag) {
|
while (!breakFlag) {
|
||||||
|
statusLine = room.statusLine();
|
||||||
|
strcpy(statusLine, "");
|
||||||
|
room.update();
|
||||||
|
screen.update();
|
||||||
|
|
||||||
action = PopupMenu::Show(actions);
|
action = PopupMenu::Show(actions);
|
||||||
|
|
||||||
|
if (action != NONE) {
|
||||||
|
sprintf(statusLine, "%s ", actionList[action]);
|
||||||
|
statusLine += strlen(statusLine);
|
||||||
|
}
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case LOOK:
|
case LOOK:
|
||||||
case STATUS:
|
case STATUS:
|
||||||
|
@ -365,12 +352,42 @@ void Game::handleRightClickMenu() {
|
||||||
case USE:
|
case USE:
|
||||||
case EXAMINE:
|
case EXAMINE:
|
||||||
case DRINK:
|
case DRINK:
|
||||||
if (action != DRINK)
|
if (action == ASK) {
|
||||||
hotspot = res.getHotspot(room.hotspotId());
|
strings.getString(hotspot->nameId, statusLine);
|
||||||
itemId = PopupMenu::ShowInventory();
|
strcat(statusLine, " for ");
|
||||||
breakFlag = (itemId != 0xffff);
|
}
|
||||||
if (breakFlag)
|
|
||||||
fields.setField(USE_HOTSPOT_ID, itemId);
|
hasItems = (res.numInventoryItems() != 0);
|
||||||
|
if (!hasItems)
|
||||||
|
strcat(statusLine, "(nothing)");
|
||||||
|
statusLine += strlen(statusLine);
|
||||||
|
|
||||||
|
room.update();
|
||||||
|
screen.update();
|
||||||
|
mouse.waitForRelease();
|
||||||
|
|
||||||
|
if (hasItems) {
|
||||||
|
if (action != DRINK)
|
||||||
|
hotspot = res.getHotspot(room.hotspotId());
|
||||||
|
itemId = PopupMenu::ShowInventory();
|
||||||
|
breakFlag = (itemId != 0xffff);
|
||||||
|
if (breakFlag) {
|
||||||
|
fields.setField(USE_HOTSPOT_ID, itemId);
|
||||||
|
if ((action == GIVE) || (action == USE)) {
|
||||||
|
// Add in the "X to " or "X on " section of give/use action
|
||||||
|
useHotspot = res.getHotspot(itemId);
|
||||||
|
assert(useHotspot);
|
||||||
|
strings.getString(useHotspot->nameId, statusLine);
|
||||||
|
if (action == GIVE)
|
||||||
|
strcat(statusLine, " to ");
|
||||||
|
else
|
||||||
|
strcat(statusLine, " on ");
|
||||||
|
statusLine += strlen(statusLine);
|
||||||
|
}
|
||||||
|
else if ((action == DRINK) || (action == EXAMINE))
|
||||||
|
hotspot = res.getHotspot(itemId);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -382,7 +399,17 @@ void Game::handleRightClickMenu() {
|
||||||
|
|
||||||
if (action != NONE) {
|
if (action != NONE) {
|
||||||
player->stopWalking();
|
player->stopWalking();
|
||||||
doAction(action, (hotspot != NULL) ? hotspot->hotspotId : 0, itemId);
|
|
||||||
|
if (hotspot == NULL) {
|
||||||
|
doAction(action, 0, itemId);
|
||||||
|
} else {
|
||||||
|
// Add the hotspot name to the status line and then go do the action
|
||||||
|
strings.getString(hotspot->nameId, statusLine);
|
||||||
|
doAction(action, hotspot->hotspotId, itemId);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Clear the status line
|
||||||
|
strcpy(room.statusLine(), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,15 +417,21 @@ void Game::handleLeftClick() {
|
||||||
Room &room = Room::getReference();
|
Room &room = Room::getReference();
|
||||||
Mouse &mouse = Mouse::getReference();
|
Mouse &mouse = Mouse::getReference();
|
||||||
Resources &res = Resources::getReference();
|
Resources &res = Resources::getReference();
|
||||||
|
StringData &strings = StringData::getReference();
|
||||||
Hotspot *player = res.getActiveHotspot(PLAYER_ID);
|
Hotspot *player = res.getActiveHotspot(PLAYER_ID);
|
||||||
|
|
||||||
room.setCursorState(CS_NONE);
|
room.setCursorState(CS_NONE);
|
||||||
player->stopWalking();
|
player->stopWalking();
|
||||||
player->setDestHotspot(0);
|
player->setDestHotspot(0);
|
||||||
player->setActionCtr(0);
|
player->setActionCtr(0);
|
||||||
|
strcpy(room.statusLine(), "");
|
||||||
|
|
||||||
if ((room.destRoomNumber() == 0) && (room.hotspotId() != 0)) {
|
if ((room.destRoomNumber() == 0) && (room.hotspotId() != 0)) {
|
||||||
// Handle look at hotspot
|
// Handle look at hotspot
|
||||||
|
sprintf(room.statusLine(), "%s ", actionList[LOOK_AT]);
|
||||||
|
HotspotData *hotspot = res.getHotspot(room.hotspotId());
|
||||||
|
assert(hotspot);
|
||||||
|
strings.getString(hotspot->nameId, room.statusLine() + strlen(room.statusLine()));
|
||||||
doAction(LOOK_AT, room.hotspotId(), 0xffff);
|
doAction(LOOK_AT, room.hotspotId(), 0xffff);
|
||||||
|
|
||||||
} else if (room.destRoomNumber() != 0) {
|
} else if (room.destRoomNumber() != 0) {
|
||||||
|
@ -497,4 +530,53 @@ void Game::doSound() {
|
||||||
memcpy(pDest, pSrc, 3);
|
memcpy(pDest, pSrc, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Game::handleBootParam(int value) {
|
||||||
|
Resources &res = Resources::getReference();
|
||||||
|
ValueTableData &fields = res.fieldList();
|
||||||
|
Room &room = Room::getReference();
|
||||||
|
Hotspot *h;
|
||||||
|
|
||||||
|
switch (value) {
|
||||||
|
case 0:
|
||||||
|
// No parameter - load the first room
|
||||||
|
room.setRoomNumber(1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
// Set player to be in rack room with a few items
|
||||||
|
// Setup Skorl in cell room
|
||||||
|
h = res.getActiveHotspot(SKORL_ID);
|
||||||
|
h->setRoomNumber(1);
|
||||||
|
h->setPosition(140, 120);
|
||||||
|
h->currentActions().top().setSupportData(0x1400);
|
||||||
|
fields.setField(11, 1);
|
||||||
|
|
||||||
|
// Set up player
|
||||||
|
h = res.getActiveHotspot(PLAYER_ID);
|
||||||
|
h->setRoomNumber(4);
|
||||||
|
h->setPosition(150, 110);
|
||||||
|
res.getHotspot(0x2710)->roomNumber = PLAYER_ID; // Bottle
|
||||||
|
res.getHotspot(0x2713)->roomNumber = PLAYER_ID; // Knife
|
||||||
|
|
||||||
|
room.setRoomNumber(4);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
// Set the player up in the outer cell with a full bottle & knife
|
||||||
|
h = res.getActiveHotspot(PLAYER_ID);
|
||||||
|
h->setRoomNumber(2);
|
||||||
|
h->setPosition(100, 110);
|
||||||
|
res.getHotspot(0x2710)->roomNumber = PLAYER_ID; // Bottle
|
||||||
|
fields.setField(BOTTLE_FILLED, 1);
|
||||||
|
res.getHotspot(0x2713)->roomNumber = PLAYER_ID; // Knife
|
||||||
|
|
||||||
|
room.setRoomNumber(2);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
room.setRoomNumber(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // end of namespace Lure
|
} // end of namespace Lure
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "lure/memory.h"
|
#include "lure/memory.h"
|
||||||
#include "lure/screen.h"
|
#include "lure/screen.h"
|
||||||
#include "lure/events.h"
|
#include "lure/events.h"
|
||||||
|
#include "lure/debugger.h"
|
||||||
|
|
||||||
namespace Lure {
|
namespace Lure {
|
||||||
|
|
||||||
|
@ -39,6 +40,7 @@ enum GameState {GS_RESTORE_RESTART = 1, GS_CAUGHT = 2};
|
||||||
|
|
||||||
class Game {
|
class Game {
|
||||||
private:
|
private:
|
||||||
|
Debugger *_debugger;
|
||||||
bool _slowSpeedFlag, _soundFlag;
|
bool _slowSpeedFlag, _soundFlag;
|
||||||
uint8 _state;
|
uint8 _state;
|
||||||
|
|
||||||
|
@ -49,8 +51,11 @@ private:
|
||||||
void doAction(Action action, uint16 hotspotId, uint16 usedId);
|
void doAction(Action action, uint16 hotspotId, uint16 usedId);
|
||||||
|
|
||||||
void playerChangeRoom();
|
void playerChangeRoom();
|
||||||
|
void handleBootParam(int value);
|
||||||
public:
|
public:
|
||||||
Game();
|
Game();
|
||||||
|
virtual ~Game();
|
||||||
|
|
||||||
static Game &getReference();
|
static Game &getReference();
|
||||||
|
|
||||||
void nextFrame();
|
void nextFrame();
|
||||||
|
|
|
@ -164,6 +164,10 @@ REGISTER_PLUGIN(LURE, "Lure of the Temptress Engine");
|
||||||
namespace Lure {
|
namespace Lure {
|
||||||
|
|
||||||
LureEngine::LureEngine(OSystem *system): Engine(system) {
|
LureEngine::LureEngine(OSystem *system): Engine(system) {
|
||||||
|
|
||||||
|
Common::addSpecialDebugLevel(kLureDebugScripts, "scripts", "Scripts debugging");
|
||||||
|
Common::addSpecialDebugLevel(kLureDebugAnimations, "animations", "Animations debugging");
|
||||||
|
Common::addSpecialDebugLevel(kLureDebugHotspots, "hotspots", "Hotspots debugging");
|
||||||
// Setup mixer
|
// Setup mixer
|
||||||
/*
|
/*
|
||||||
if (!_mixer->isReady()) {
|
if (!_mixer->isReady()) {
|
||||||
|
@ -174,6 +178,7 @@ LureEngine::LureEngine(OSystem *system): Engine(system) {
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
|
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
|
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_features = 0;
|
_features = 0;
|
||||||
_game = 0;
|
_game = 0;
|
||||||
}
|
}
|
||||||
|
@ -259,7 +264,6 @@ int LureEngine::init() {
|
||||||
_system->endGFXTransaction();
|
_system->endGFXTransaction();
|
||||||
|
|
||||||
detectGame();
|
detectGame();
|
||||||
|
|
||||||
_sys = new System(_system);
|
_sys = new System(_system);
|
||||||
_disk = new Disk();
|
_disk = new Disk();
|
||||||
_resources = new Resources();
|
_resources = new Resources();
|
||||||
|
@ -270,11 +274,14 @@ int LureEngine::init() {
|
||||||
_menu = new Menu();
|
_menu = new Menu();
|
||||||
Surface::initialise();
|
Surface::initialise();
|
||||||
_room = new Room();
|
_room = new Room();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LureEngine::~LureEngine() {
|
LureEngine::~LureEngine() {
|
||||||
|
// Remove all of our debug levels here
|
||||||
|
Common::clearAllSpecialDebugLevels();
|
||||||
|
|
||||||
|
// Delete and deinitialise subsystems
|
||||||
Surface::deinitialise();
|
Surface::deinitialise();
|
||||||
delete _room;
|
delete _room;
|
||||||
delete _menu;
|
delete _menu;
|
||||||
|
@ -288,10 +295,12 @@ LureEngine::~LureEngine() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int LureEngine::go() {
|
int LureEngine::go() {
|
||||||
// Show the introduction
|
if (ConfMan.getInt("boot_param") == 0) {
|
||||||
Introduction *intro = new Introduction(*_screen, *_system);
|
// Show the introduction
|
||||||
intro->show();
|
Introduction *intro = new Introduction(*_screen, *_system);
|
||||||
delete intro;
|
intro->show();
|
||||||
|
delete intro;
|
||||||
|
}
|
||||||
|
|
||||||
// Play the game
|
// Play the game
|
||||||
if (!_events->quitFlag) {
|
if (!_events->quitFlag) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue