BLADERUNNER: Add engine gui option to avoid use of delayMillis()
This commit is contained in:
parent
5453653a4c
commit
7c20b07ffb
6 changed files with 51 additions and 25 deletions
|
@ -111,9 +111,10 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst, const ADGameDescription *des
|
|||
|
||||
_subtitlesEnabled = false;
|
||||
|
||||
_sitcomMode = false;
|
||||
_shortyMode = false;
|
||||
_cutContent = Common::String(desc->gameId).contains("bladerunner-final");
|
||||
_sitcomMode = false;
|
||||
_shortyMode = false;
|
||||
_noDelayMillisFramelimiter = false;
|
||||
_cutContent = Common::String(desc->gameId).contains("bladerunner-final");
|
||||
|
||||
_playerLosesControlCounter = 0;
|
||||
|
||||
|
@ -559,8 +560,13 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
|
|||
// get value from the ScummVM configuration manager
|
||||
syncSoundSettings();
|
||||
|
||||
_sitcomMode = ConfMan.getBool("sitcom");
|
||||
_shortyMode = ConfMan.getBool("shorty");
|
||||
_sitcomMode = ConfMan.getBool("sitcom");
|
||||
_shortyMode = ConfMan.getBool("shorty");
|
||||
|
||||
if (!ConfMan.hasKey("nodelaymillisfl")) {
|
||||
ConfMan.setBool("nodelaymillisfl", false);
|
||||
}
|
||||
_noDelayMillisFramelimiter = ConfMan.getBool("nodelaymillisfl");
|
||||
// BLADE.INI was read here, but it was replaced by ScummVM configuration
|
||||
|
||||
_chapters = new Chapters(this);
|
||||
|
|
|
@ -215,6 +215,7 @@ public:
|
|||
bool _subtitlesEnabled; // tracks the state of whether subtitles are enabled or disabled from ScummVM GUI option or KIA checkbox (the states are synched)
|
||||
bool _sitcomMode;
|
||||
bool _shortyMode;
|
||||
bool _noDelayMillisFramelimiter;
|
||||
bool _cutContent;
|
||||
|
||||
int _walkSoundId;
|
||||
|
|
|
@ -60,6 +60,15 @@ static const ADExtraGuiOptionsMap optionsList[] = {
|
|||
false
|
||||
}
|
||||
},
|
||||
{
|
||||
GAMEOPTION_FRAMELIMITER_NODELAYMILLIS,
|
||||
{
|
||||
_s("Frame limiter high performance mode"),
|
||||
_s("This mode may result in high CPU usage! It avoids use of delayMillis() function."),
|
||||
"nodelaymillisfl",
|
||||
false
|
||||
}
|
||||
},
|
||||
AD_EXTRA_GUI_OPTIONS_TERMINATOR
|
||||
};
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
|
||||
#include "engines/advancedDetector.h"
|
||||
|
||||
#define GAMEOPTION_SITCOM GUIO_GAMEOPTIONS1
|
||||
#define GAMEOPTION_SHORTY GUIO_GAMEOPTIONS2
|
||||
#define GAMEOPTION_CUT_CONTENT GUIO_GAMEOPTIONS3
|
||||
#define GAMEOPTION_SITCOM GUIO_GAMEOPTIONS1
|
||||
#define GAMEOPTION_SHORTY GUIO_GAMEOPTIONS2
|
||||
#define GAMEOPTION_FRAMELIMITER_NODELAYMILLIS GUIO_GAMEOPTIONS3
|
||||
|
||||
namespace BladeRunner {
|
||||
|
||||
|
@ -40,7 +40,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::EN_ANY,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_TESTING,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (German)
|
||||
|
@ -51,7 +51,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::DE_DEU,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_TESTING,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (French) - Bug #9722
|
||||
|
@ -62,7 +62,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::FR_FRA,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_TESTING,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (Italian)
|
||||
|
@ -73,7 +73,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::IT_ITA,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_TESTING,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc.)
|
||||
|
@ -84,7 +84,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::RU_RUS,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_TESTING,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc. + Siberian Studio, R3)
|
||||
|
@ -95,7 +95,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::RU_RUS,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_TESTING,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc. + Siberian Studio, R4)
|
||||
|
@ -106,7 +106,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::RU_RUS,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_TESTING,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (Spanish)
|
||||
|
@ -117,7 +117,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::ES_ESP,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_TESTING,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// Versions with restored content
|
||||
|
@ -130,7 +130,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::EN_ANY,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_UNSTABLE,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (German)
|
||||
|
@ -141,7 +141,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::DE_DEU,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_UNSTABLE,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (French)
|
||||
|
@ -152,7 +152,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::FR_FRA,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_UNSTABLE,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (Italian)
|
||||
|
@ -163,7 +163,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::IT_ITA,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_UNSTABLE,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc.)
|
||||
|
@ -174,7 +174,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::RU_RUS,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_UNSTABLE,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc. + Siberian Studio, R3)
|
||||
|
@ -185,7 +185,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::RU_RUS,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_UNSTABLE,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
// BladeRunner (Russian - Fargus Multimedia + Home Systems, Inc. + Siberian Studio, R4)
|
||||
|
@ -196,7 +196,7 @@ static const ADGameDescription gameDescriptions[] = {
|
|||
Common::RU_RUS,
|
||||
Common::kPlatformWindows,
|
||||
ADGF_UNSTABLE,
|
||||
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
|
||||
GUIO3(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY, GAMEOPTION_FRAMELIMITER_NODELAYMILLIS)
|
||||
},
|
||||
|
||||
AD_TABLE_END_MARKER
|
||||
|
|
|
@ -56,7 +56,11 @@ void Framelimiter::wait() {
|
|||
uint32 frameDuration = timeNow - _timeFrameStart;
|
||||
if (frameDuration < _speedLimitMs) {
|
||||
uint32 waittime = _speedLimitMs - frameDuration;
|
||||
_vm->_system->delayMillis(waittime);
|
||||
if (_vm->_noDelayMillisFramelimiter) {
|
||||
while (_vm->_time->currentSystem() - timeNow < waittime) { }
|
||||
} else {
|
||||
_vm->_system->delayMillis(waittime);
|
||||
}
|
||||
timeNow += waittime;
|
||||
}
|
||||
// debug("frametime %i ms", timeNow - _timeFrameStart);
|
||||
|
|
|
@ -666,8 +666,14 @@ void KIA::mouseDownCallback(int buttonId, void *callbackData) {
|
|||
int endTrackId = self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(kSfxSHUTDOWN), 70, 0, 0, 50, 0);
|
||||
if (endTrackId != -1) {
|
||||
// wait until the full clip has played (similar to the original)
|
||||
uint32 timeNow = self->_vm->_time->currentSystem();
|
||||
uint32 waittime = 16;
|
||||
while (self->_vm->_audioPlayer->isActive(endTrackId)) {
|
||||
self->_vm->_system->delayMillis(16);
|
||||
if (self->_vm->_noDelayMillisFramelimiter) {
|
||||
while (self->_vm->_time->currentSystem() - timeNow < waittime) { }
|
||||
} else {
|
||||
self->_vm->_system->delayMillis(waittime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue