Skip to content

Commit

Permalink
BLADERUNNER: Added shorty mode
Browse files Browse the repository at this point in the history
Available via ScummVM game options
  • Loading branch information
peterkohaut committed Feb 10, 2019
1 parent 0a08d2e commit 60a30b9
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 16 deletions.
4 changes: 3 additions & 1 deletion engines/bladerunner/actor.cpp
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion engines/bladerunner/aud_stream.cpp
Expand Up @@ -28,9 +28,10 @@

namespace BladeRunner {

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

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

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

_cache->incRef(_hash);

Expand Down
5 changes: 3 additions & 2 deletions engines/bladerunner/aud_stream.h
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions engines/bladerunner/audio_speech.cpp
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions engines/bladerunner/bladerunner.cpp
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions engines/bladerunner/bladerunner.h
Expand Up @@ -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;
Expand Down
10 changes: 9 additions & 1 deletion engines/bladerunner/detection.cpp
Expand Up @@ -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
};

Expand Down
13 changes: 7 additions & 6 deletions engines/bladerunner/detection_tables.h
Expand Up @@ -26,6 +26,7 @@
#include "engines/advancedDetector.h"

#define GAMEOPTION_SITCOM GUIO_GAMEOPTIONS1
#define GAMEOPTION_SHORTY GUIO_GAMEOPTIONS2

namespace BladeRunner {

Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion engines/bladerunner/slice_renderer.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit 60a30b9

Please sign in to comment.