BS1 demo is basically fully supported now.

only some SFX are flipped.

svn-id: r15819
This commit is contained in:
Robert Göffringmann 2004-11-15 08:23:09 +00:00
parent 38baf0a0d3
commit 17f23ad3d5
4 changed files with 17 additions and 1 deletions

View File

@ -981,6 +981,8 @@ void Control::doRestore(void) {
Logic::_scriptVars[CHANGE_STANCE] = STAND; Logic::_scriptVars[CHANGE_STANCE] = STAND;
Logic::_scriptVars[CHANGE_PLACE] = cpt->o_place; Logic::_scriptVars[CHANGE_PLACE] = cpt->o_place;
SwordEngine::_systemVars.justRestoredGame = 1; SwordEngine::_systemVars.justRestoredGame = 1;
if (SwordEngine::_systemVars.isDemo)
Logic::_scriptVars[PLAYINGDEMO] = 1;
} }
void Control::delay(uint32 msecs) { void Control::delay(uint32 msecs) {

View File

@ -37,6 +37,8 @@
#include "sword1/debug.h" #include "sword1/debug.h"
#include "gui/message.h"
namespace Sword1 { namespace Sword1 {
#define MAX_STACK_SIZE 10 #define MAX_STACK_SIZE 10
@ -1630,7 +1632,12 @@ int Logic::fnRestartGame(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32
} }
int Logic::fnQuitGame(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d, int32 z, int32 x) { int Logic::fnQuitGame(Object *cpt, int32 id, int32 a, int32 b, int32 c, int32 d, int32 z, int32 x) {
error("fnQuitGame() called"); if (SwordEngine::_systemVars.isDemo) {
GUI::MessageDialog dialog("This is the end of the Broken Sword 1 Demo", "OK", NULL);
dialog.runModal();
SwordEngine::_systemVars.engineQuit = true;
} else
error("fnQuitGame() called");
return SCRIPT_STOP; return SCRIPT_STOP;
} }

View File

@ -61,6 +61,10 @@ int Sound::addToQueue(int32 fxNo) {
warning("Sound queue overflow"); warning("Sound queue overflow");
return 0; return 0;
} }
if ((fxNo == 168) && (SwordEngine::_systemVars.isDemo)) {
// this sound doesn't exist in demo
return 0;
}
_resMan->resOpen(_fxList[fxNo].sampleId); _resMan->resOpen(_fxList[fxNo].sampleId);
_fxQueue[_endOfQueue].id = fxNo; _fxQueue[_endOfQueue].id = fxNo;
if (_fxList[fxNo].type == FX_SPOT) if (_fxList[fxNo].type == FX_SPOT)
@ -140,6 +144,8 @@ void Sound::quitScreen(void) {
} }
void Sound::playSample(QueueElement *elem) { void Sound::playSample(QueueElement *elem) {
//if (((elem->id == 11) || (elem->id == 12) || (elem->id == 224)) && SwordEngine::_systemVars.isDemo)
// return;
uint8 *sampleData = (uint8*)_resMan->fetchRes(_fxList[elem->id].sampleId); uint8 *sampleData = (uint8*)_resMan->fetchRes(_fxList[elem->id].sampleId);
for (uint16 cnt = 0; cnt < MAX_ROOMS_PER_FX; cnt++) { for (uint16 cnt = 0; cnt < MAX_ROOMS_PER_FX; cnt++) {
if (_fxList[elem->id].roomVolList[cnt].roomNo) { if (_fxList[elem->id].roomVolList[cnt].roomNo) {

View File

@ -1116,6 +1116,7 @@ void SwordEngine::checkCdFiles(void) { // check if we're running from cd, hdd or
} else { // speech1 & speech2 not present. are we running from cd? } else { // speech1 & speech2 not present. are we running from cd?
if (test.open("cows.mad")) { if (test.open("cows.mad")) {
_systemVars.isDemo = true; _systemVars.isDemo = true;
Logic::_scriptVars[PLAYINGDEMO] = 1;
test.close(); test.close();
} }
if (test.open("cd1.id")) { if (test.open("cd1.id")) {