Permalink
Browse files

BLADERUNNER: Added shorty mode

Available via ScummVM game options
  • Loading branch information...
peterkohaut committed Feb 10, 2019
1 parent 0a08d2e commit 60a30b904bb9edf15e7b21f1aa4741259de0461f
@@ -727,7 +727,9 @@ bool Actor::draw(Common::Rect *screenRect) {
float drawAngle = M_PI - _facing * (M_PI / 512.0f);
float drawScale = _scale;

// TODO: Handle SHORTY mode
if (_vm->_shortyMode) {
drawScale = 0.7f;
}

_vm->_sliceRenderer->drawInWorld(_animationId, _animationFrame, drawPosition, drawAngle, drawScale, _vm->_surfaceFront, _vm->_zbuffer->getData());
_vm->_sliceRenderer->getScreenRectangle(screenRect, _animationId, _animationFrame, drawPosition, drawAngle, drawScale);
@@ -28,9 +28,10 @@

namespace BladeRunner {

AudStream::AudStream(byte *data) {
AudStream::AudStream(byte *data, int overrideFrequency) {
_hash = 0;
_cache = nullptr;
_overrideFrequency = overrideFrequency;

init(data);
}
@@ -40,6 +41,7 @@ AudStream::AudStream(AudioCache *cache, int32 hash) {

_cache = cache;
_hash = hash;
_overrideFrequency = -1;

_cache->incRef(_hash);

@@ -45,19 +45,20 @@ class AudStream : public Audio::RewindableAudioStream {
uint32 _sizeDecompressed;
byte _flags;
byte _compressionType;
int _overrideFrequency;

ADPCMWestwoodDecoder _decoder;

void init(byte *data);

public:
AudStream(byte *data);
AudStream(byte *data, int overrideFrequency = -1);
AudStream(AudioCache *cache, int32 hash);
~AudStream();

int readBuffer(int16 *buffer, const int numSamples);
bool isStereo() const { return false; }
int getRate() const { return _frequency; };
int getRate() const { return _overrideFrequency > 0 ? _overrideFrequency : _frequency; };
bool endOfData() const { return _p == _end; }
bool rewind();
int getLength() const;
@@ -59,7 +59,6 @@ AudioSpeech::~AudioSpeech() {
}

bool AudioSpeech::playSpeech(const Common::String &name, int pan) {
// debug("AudioSpeech::playSpeech(\"%s\")", name);
Common::ScopedPtr<Common::SeekableReadStream> r(_vm->getResourceStream(name));

if (!r) {
@@ -82,9 +81,7 @@ bool AudioSpeech::playSpeech(const Common::String &name, int pan) {
return false;
}

AudStream *audioStream = new AudStream(_data);

// TODO: shorty mode - set rate of sound to 33khz
AudStream *audioStream = new AudStream(_data, _vm->_shortyMode ? 33000 : -1);

_channel = _vm->_audioMixer->play(
Audio::Mixer::kSpeechSoundType,
@@ -414,6 +414,7 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
_subtitlesEnabled = ConfMan.getBool("subtitles");

_sitcomMode = ConfMan.getBool("sitcom");
_shortyMode = ConfMan.getBool("shorty");

_items = new Items(this);

@@ -195,6 +195,7 @@ class BladeRunnerEngine : public Engine {
bool _vqaStopIsRequested;
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;

int _walkSoundId;
int _walkSoundVolume;
@@ -50,7 +50,15 @@ static const ADExtraGuiOptionsMap optionsList[] = {
false
}
},

{
GAMEOPTION_SHORTY,
{
_s("Shorty mode"),
_s("Game will shrink the actors and make their voices high pitched"),
"shorty",
false
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};

@@ -26,6 +26,7 @@
#include "engines/advancedDetector.h"

#define GAMEOPTION_SITCOM GUIO_GAMEOPTIONS1
#define GAMEOPTION_SHORTY GUIO_GAMEOPTIONS2

namespace BladeRunner {

@@ -38,7 +39,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
GUIO1(GAMEOPTION_SITCOM)
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
},

// BladeRunner (German)
@@ -49,7 +50,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
GUIO1(GAMEOPTION_SITCOM)
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
},

// BladeRunner (French) - Bug #9722
@@ -60,7 +61,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
GUIO1(GAMEOPTION_SITCOM)
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
},

// BladeRunner (Italian)
@@ -71,7 +72,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
GUIO1(GAMEOPTION_SITCOM)
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
},

// BladeRunner (Russian)
@@ -82,7 +83,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::RU_RUS,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
GUIO1(GAMEOPTION_SITCOM)
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
},

// BladeRunner (Spanish)
@@ -93,7 +94,7 @@ static const ADGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
GUIO1(GAMEOPTION_SITCOM)
GUIO2(GAMEOPTION_SITCOM, GAMEOPTION_SHORTY)
},

AD_TABLE_END_MARKER
@@ -375,7 +375,7 @@ void SliceRenderer::drawInWorld(int animationId, int animationFrame, Vector3 pos
assert(_setEffects);
//assert(_view);

setupFrameInWorld(animationId, animationFrame, position, facing);
setupFrameInWorld(animationId, animationFrame, position, facing, scale);

assert(_sliceFramePtr);

0 comments on commit 60a30b9

Please sign in to comment.