Permalink
Browse files

STARTREK: Put CD ROM detection into features field

  • Loading branch information...
Drenn1 authored and sev- committed Aug 2, 2018
1 parent 57691c4 commit c6834a997c93ab8c9cee0bf39204a716383c29bf
Showing with 7 additions and 23 deletions.
  1. +3 −19 engines/startrek/detection.cpp
  2. +1 −1 engines/startrek/sound.cpp
  3. +1 −1 engines/startrek/startrek.cpp
  4. +2 −2 engines/startrek/startrek.h
@@ -42,7 +42,6 @@ struct StarTrekGameDescription {

uint8 gameType;
uint32 features;
bool isCDEdition;
};

uint32 StarTrekEngine::getFeatures() const {
@@ -53,10 +52,6 @@ Common::Platform StarTrekEngine::getPlatform() const {
return _gameDescription->desc.platform;
}

bool StarTrekEngine::isCDEdition() const {
return _gameDescription->isCDEdition;
}

uint8 StarTrekEngine::getGameType() const {
return _gameDescription->gameType;
}
@@ -91,8 +86,7 @@ static const StarTrekGameDescription gameDescriptions[] = {
GUIO0()
},
GType_ST25,
0,
true,
GF_CDROM,
},

{ // ST25 DOS floppy edition (EN)
@@ -107,7 +101,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
false,
},

{ // ST25 DOS floppy edition (GER)
@@ -122,7 +115,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
false,
},

{ // ST25 Amiga ? (EN)
@@ -137,7 +129,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
false,
},

{ // ST25 Amiga ? (GER)
@@ -152,7 +143,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
false,
},

{ // ST25 Amiga ? (FR)
@@ -167,7 +157,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
false,
},

{ // ST25 Mac ? (EN)
@@ -182,7 +171,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
false,
},

{ // ST25 Mac floppy edition (EN)
@@ -197,7 +185,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
0,
false,
},

{ // ST25 DOS demo ? (EN)
@@ -212,7 +199,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
GF_DEMO,
false,
},

{ // ST25 MAC demo ? (EN)
@@ -227,7 +213,6 @@ static const StarTrekGameDescription gameDescriptions[] = {
},
GType_ST25,
GF_DEMO,
false,
},

{ // STJR DOS CD-ROM edition (EN)
@@ -241,11 +226,10 @@ static const StarTrekGameDescription gameDescriptions[] = {
GUIO0()
},
GType_STJR,
0,
true,
GF_CDROM,
},

{ AD_TABLE_END_MARKER, 0, 0, 0 }
{ AD_TABLE_END_MARKER, 0, 0 }
};

} // End of namespace StarTrek
@@ -63,7 +63,7 @@ Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
_midiSlotList.push_back(&_midiSlots[i]);
}

if (!_vm->isCDEdition())
if (!(_vm->getFeatures() & GF_CDROM))
_vm->_sfxWorking = false;
else if (!SearchMan.hasFile("voc/speech.mrk")) {
warning("Couldn't find 'voc/speech.mrk'. The 'trekcd/voc/' directory should be dumped from the CD. Continuing without CD audio");
@@ -529,7 +529,7 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
}

void StarTrekEngine::playSoundEffectIndex(int index) {
if (!isCDEdition())
if (!(getFeatures() & GF_CDROM))
_sound->playMidiTrack(index);
else {
switch (index) {
@@ -121,7 +121,8 @@ enum StarTrekGameType {
};

enum StarTrekGameFeatures {
GF_DEMO = (1 << 0)
GF_DEMO = (1 << 0),
GF_CDROM = (1 << 1)
};

enum kDebugLevels {
@@ -639,7 +640,6 @@ class StarTrekEngine : public ::Engine {
public:
const StarTrekGameDescription *_gameDescription;
uint32 getFeatures() const;
bool isCDEdition() const;
Common::Platform getPlatform() const;
uint8 getGameType() const;
Common::Language getLanguage() const;

0 comments on commit c6834a9

Please sign in to comment.