diff options
218 files changed, 8625 insertions, 4472 deletions
diff --git a/.gitignore b/.gitignore index 3868edbbda..17012f3bb7 100644 --- a/.gitignore +++ b/.gitignore @@ -174,6 +174,9 @@ ipch/ LLVM32/ LLVM64/ +#Ignore gettext generated files +/messages.mo + #Ignore Qt Creator project files ScummVM.config ScummVM.creator diff --git a/audio/decoders/quicktime.cpp b/audio/decoders/quicktime.cpp index 787b547495..547abd2aa4 100644 --- a/audio/decoders/quicktime.cpp +++ b/audio/decoders/quicktime.cpp @@ -585,7 +585,7 @@ bool QuickTimeAudioDecoder::AudioSampleDesc::isAudioCodecSupported() const { if (_codecTag == MKTAG('m', 'p', '4', 'a')) { Common::String audioType; - switch (_parentTrack->objectTypeMP4) { + switch (_objectTypeMP4) { case 0x40: // AAC #ifdef USE_FAAD return true; @@ -643,13 +643,13 @@ void QuickTimeAudioDecoder::AudioSampleDesc::initCodec() { switch (_codecTag) { case MKTAG('Q', 'D', 'M', '2'): #ifdef AUDIO_QDM2_H - _codec = makeQDM2Decoder(_parentTrack->extraData); + _codec = makeQDM2Decoder(_extraData); #endif break; case MKTAG('m', 'p', '4', 'a'): #ifdef USE_FAAD - if (_parentTrack->objectTypeMP4 == 0x40) - _codec = makeAACDecoder(_parentTrack->extraData); + if (_objectTypeMP4 == 0x40) + _codec = makeAACDecoder(_extraData); #endif break; default: diff --git a/audio/mixer.cpp b/audio/mixer.cpp index 0620d07a29..16cf5640eb 100644 --- a/audio/mixer.cpp +++ b/audio/mixer.cpp @@ -333,7 +333,7 @@ void MixerImpl::stopHandle(SoundHandle handle) { } void MixerImpl::muteSoundType(SoundType type, bool mute) { - assert(0 <= type && type < ARRAYSIZE(_soundTypeSettings)); + assert(0 <= (int)type && (int)type < ARRAYSIZE(_soundTypeSettings)); _soundTypeSettings[type].mute = mute; for (int i = 0; i != NUM_CHANNELS; ++i) { @@ -343,7 +343,7 @@ void MixerImpl::muteSoundType(SoundType type, bool mute) { } bool MixerImpl::isSoundTypeMuted(SoundType type) const { - assert(0 <= type && type < ARRAYSIZE(_soundTypeSettings)); + assert(0 <= (int)type && (int)type < ARRAYSIZE(_soundTypeSettings)); return _soundTypeSettings[type].mute; } @@ -468,7 +468,7 @@ bool MixerImpl::hasActiveChannelOfType(SoundType type) { } void MixerImpl::setVolumeForSoundType(SoundType type, int volume) { - assert(0 <= type && type < ARRAYSIZE(_soundTypeSettings)); + assert(0 <= (int)type && (int)type < ARRAYSIZE(_soundTypeSettings)); // Check range if (volume > kMaxMixerVolume) @@ -489,7 +489,7 @@ void MixerImpl::setVolumeForSoundType(SoundType type, int volume) { } int MixerImpl::getVolumeForSoundType(SoundType type) const { - assert(0 <= type && type < ARRAYSIZE(_soundTypeSettings)); + assert(0 <= (int)type && (int)type < ARRAYSIZE(_soundTypeSettings)); return _soundTypeSettings[type].volume; } diff --git a/audio/rate_arm_asm.s b/audio/rate_arm_asm.s index ac999f66e4..a727209d39 100644 --- a/audio/rate_arm_asm.s +++ b/audio/rate_arm_asm.s @@ -36,6 +36,7 @@ .global _ARM_LinearRate_S .global _ARM_LinearRate_R + .align 2 _ARM_CopyRate_M: @ r0 = len @ r1 = obuf @@ -73,6 +74,7 @@ CopyRate_M_loop: LDMFD r13!,{r4-r7,PC} + .align 2 _ARM_CopyRate_S: @ r0 = len @ r1 = obuf @@ -111,6 +113,7 @@ CopyRate_S_loop: LDMFD r13!,{r4-r7,PC} + .align 2 _ARM_CopyRate_R: @ r0 = len @ r1 = obuf @@ -149,6 +152,7 @@ CopyRate_R_loop: LDMFD r13!,{r4-r7,PC} + .align 2 _ARM_SimpleRate_M: @ r0 = AudioStream &input @ r1 = input.readBuffer @@ -229,6 +233,7 @@ SimpleRate_M_read: B SimpleRate_M_read_return + .align 2 _ARM_SimpleRate_S: @ r0 = AudioStream &input @ r1 = input.readBuffer @@ -308,6 +313,7 @@ SimpleRate_S_read: + .align 2 _ARM_SimpleRate_R: @ r0 = AudioStream &input @ r1 = input.readBuffer @@ -386,6 +392,7 @@ SimpleRate_R_read: B SimpleRate_R_read_return + .align 2 _ARM_LinearRate_M: @ r0 = AudioStream &input @ r1 = input.readBuffer @@ -478,6 +485,7 @@ LinearRate_M_read: BLT LinearRate_M_end B LinearRate_M_read_return + .align 2 _ARM_LinearRate_S: @ r0 = AudioStream &input @ r1 = input.readBuffer @@ -580,6 +588,7 @@ LinearRate_S_read: BLT LinearRate_S_end B LinearRate_S_read_return + .align 2 _ARM_LinearRate_R: @ r0 = AudioStream &input @ r1 = input.readBuffer diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp index 2c5728990c..d91aef5533 100644 --- a/backends/midi/camd.cpp +++ b/backends/midi/camd.cpp @@ -31,11 +31,13 @@ #include "common/error.h" #include "common/endian.h" #include "common/util.h" +#include "common/str.h" #include "audio/musicplugin.h" #include "audio/mpu401.h" #include <proto/camd.h> #include <proto/exec.h> +#include <proto/dos.h> /* * CAMD sequencer driver @@ -56,6 +58,7 @@ private: struct Library *_CamdBase; struct CamdIFace *_ICamd; struct MidiLink *_midi_link; + char _outport[128]; char *getDevice(); void closeAll(); @@ -155,13 +158,18 @@ char *MidiDriver_CAMD::getDevice() { if (strstr(dev, "out") != NULL) { // This is an output device, return this - retname = dev; + Common::strlcpy(_outport, dev, sizeof(_outport)); + retname = _outport; } else { // Search the next one cluster = _ICamd->NextCluster(cluster); } } + // If the user has a preference outport set, use this instead + if(IDOS->GetVar("DefMidiOut", _outport, 128, 0)) + retname = _outport; + _ICamd->UnlockCAMD(key); } diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 92293493f0..b71a98338b 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -759,8 +759,8 @@ void OSystem_Android::setMouseCursor(const void *buf, uint w, uint h, uint16 *d = (uint16 *)tmp; for (uint16 y = 0; y < h; ++y, d += pitch / 2 - w) for (uint16 x = 0; x < w; ++x, d++) - if (*s++ != (keycolor & 0xffff)) - *d |= 1; + if (*s++ == (keycolor & 0xffff)) + *d = 0; _mouse_texture->updateBuffer(0, 0, w, h, tmp, pitch); diff --git a/backends/platform/tizen/system.cpp b/backends/platform/tizen/system.cpp index 585eb206ea..a235456670 100644 --- a/backends/platform/tizen/system.cpp +++ b/backends/platform/tizen/system.cpp @@ -266,8 +266,8 @@ result TizenSystem::initModules() { return E_OUT_OF_MEMORY; } - _graphicsManager = (GraphicsManager *)new TizenGraphicsManager(_appForm); - if (!_graphicsManager || graphicsManager->Construct() != E_SUCCESS) { + _graphicsManager = new TizenGraphicsManager(_appForm); + if (!_graphicsManager || getGraphics()->Construct() != E_SUCCESS) { return E_OUT_OF_MEMORY; } diff --git a/backends/platform/tizen/system.h b/backends/platform/tizen/system.h index 1974055088..3f668baf34 100644 --- a/backends/platform/tizen/system.h +++ b/backends/platform/tizen/system.h @@ -73,7 +73,7 @@ public: bool isClosing() { return _appForm->isClosing(); } TizenGraphicsManager *getGraphics() { - return (TizenGraphicsManager *)_graphicsManager; + return dynamic_cast<TizenGraphicsManager *>(_graphicsManager); } private: diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index 001cfea31e..bb91242f98 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -717,8 +717,8 @@ void OSystem_Wii::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, u16 *d = (u16 *) tmp; for (u16 y = 0; y < h; ++y) { for (u16 x = 0; x < w; ++x) { - if (*s++ != _mouseKeyColor) - *d++ |= 7 << 12; + if (*s++ == _mouseKeyColor) + *d++ &= ~(7 << 12); else d++; } diff --git a/common/EventMapper.cpp b/common/EventMapper.cpp index 84774742c6..30896d7514 100644 --- a/common/EventMapper.cpp +++ b/common/EventMapper.cpp @@ -37,11 +37,17 @@ List<Event> DefaultEventMapper::mapEvent(const Event &ev, EventSource *source) { #ifdef ENABLE_VKEYBD else if (ev.kbd.keycode == KEYCODE_F7 && ev.kbd.hasFlags(0)) { mappedEvent.type = EVENT_VIRTUAL_KEYBOARD; + + // Avoid blocking F7 events from engine. + addDelayedEvent(100, ev); } #endif #ifdef ENABLE_KEYMAPPER else if (ev.kbd.keycode == KEYCODE_F8 && ev.kbd.hasFlags(0)) { mappedEvent.type = EVENT_KEYMAPPER_REMAP; + + // Avoid blocking F8 events from engine. + addDelayedEvent(100, ev); } #endif } diff --git a/common/quicktime.cpp b/common/quicktime.cpp index 6ab5a42b89..76880e1016 100644 --- a/common/quicktime.cpp +++ b/common/quicktime.cpp @@ -529,7 +529,7 @@ int QuickTimeParser::readSTSD(Atom atom) { _fd->readByte(); _fd->readByte(); _fd->readByte(); // flags uint32 entryCount = _fd->readUint32BE(); - track->sampleDescs.resize(entryCount); + track->sampleDescs.reserve(entryCount); for (uint32 i = 0; i < entryCount; i++) { // Parsing Sample description table Atom a = { 0, 0, 0 }; @@ -541,7 +541,7 @@ int QuickTimeParser::readSTSD(Atom atom) { _fd->readUint16BE(); // reserved _fd->readUint16BE(); // index - track->sampleDescs[i] = readSampleDesc(track, format, size - 16); + track->sampleDescs.push_back(readSampleDesc(track, format, size - 16)); debug(0, "size=%d 4CC= %s codec_type=%d", size, tag2str(format), track->codecType); @@ -692,8 +692,14 @@ int QuickTimeParser::readWAVE(Atom atom) { if (atom.size > (1 << 30)) return -1; - if (track->sampleDescs[0]->getCodecTag() == MKTAG('Q', 'D', 'M', '2')) // Read extra data for QDM2 - track->extraData = _fd->readStream(atom.size); + // We should only get here within an stsd atom + if (track->sampleDescs.empty()) + return -1; + + SampleDesc *sampleDesc = track->sampleDescs.back(); + + if (sampleDesc->getCodecTag() == MKTAG('Q', 'D', 'M', '2')) // Read extra data for QDM2 + sampleDesc->_extraData = _fd->readStream(atom.size); else if (atom.size > 8) return readDefault(atom); else @@ -735,6 +741,12 @@ int QuickTimeParser::readESDS(Atom atom) { Track *track = _tracks.back(); + // We should only get here within an stsd atom + if (track->sampleDescs.empty()) + return -1; + + SampleDesc *sampleDesc = track->sampleDescs.back(); + _fd->readUint32BE(); // version + flags byte tag; @@ -750,7 +762,7 @@ int QuickTimeParser::readESDS(Atom atom) { if (tag != kMP4DecConfigDescTag) return 0; - track->objectTypeMP4 = _fd->readByte(); + sampleDesc->_objectTypeMP4 = _fd->readByte(); _fd->readByte(); // stream type _fd->readUint16BE(); _fd->readByte(); // buffer size _fd->readUint32BE(); // max bitrate @@ -761,9 +773,9 @@ int QuickTimeParser::readESDS(Atom atom) { if (tag != kMP4DecSpecificDescTag) return 0; - track->extraData = _fd->readStream(length); + sampleDesc->_extraData = _fd->readStream(length); - debug(0, "MPEG-4 object type = %02x", track->objectTypeMP4); + debug(0, "MPEG-4 object type = %02x", sampleDesc->_objectTypeMP4); return 0; } @@ -773,8 +785,14 @@ int QuickTimeParser::readSMI(Atom atom) { Track *track = _tracks.back(); + // We should only get here within an stsd atom + if (track->sampleDescs.empty()) + return -1; + + SampleDesc *sampleDesc = track->sampleDescs.back(); + // This atom just contains SVQ3 extra data - track->extraData = _fd->readStream(atom.size); + sampleDesc->_extraData = _fd->readStream(atom.size); return 0; } @@ -794,6 +812,12 @@ void QuickTimeParser::close() { QuickTimeParser::SampleDesc::SampleDesc(Track *parentTrack, uint32 codecTag) { _parentTrack = parentTrack; _codecTag = codecTag; + _extraData = 0; + _objectTypeMP4 = 0; +} + +QuickTimeParser::SampleDesc::~SampleDesc() { + delete _extraData; } QuickTimeParser::Track::Track() { @@ -814,11 +838,9 @@ QuickTimeParser::Track::Track() { codecType = CODEC_TYPE_MOV_OTHER; editCount = 0; editList = 0; - extraData = 0; frameCount = 0; duration = 0; startTime = 0; - objectTypeMP4 = 0; mediaDuration = 0; } @@ -829,7 +851,6 @@ QuickTimeParser::Track::~Track() { delete[] sampleSizes; delete[] keyframes; delete[] editList; - delete extraData; for (uint32 i = 0; i < sampleDescs.size(); i++) delete sampleDescs[i]; diff --git a/common/quicktime.h b/common/quicktime.h index caa92578b1..f5fd578e3a 100644 --- a/common/quicktime.h +++ b/common/quicktime.h @@ -108,10 +108,13 @@ protected: class SampleDesc { public: SampleDesc(Track *parentTrack, uint32 codecTag); - virtual ~SampleDesc() {} + virtual ~SampleDesc(); uint32 getCodecTag() const { return _codecTag; } + SeekableReadStream *_extraData; + byte _objectTypeMP4; + protected: Track *_parentTrack; uint32 _codecTag; @@ -150,16 +153,12 @@ protected: uint32 editCount; EditListEntry *editList; - SeekableReadStream *extraData; - uint32 frameCount; uint32 duration; uint32 mediaDuration; uint32 startTime; Rational scaleFactorX; Rational scaleFactorY; - - byte objectTypeMP4; }; virtual SampleDesc *readSampleDesc(Track *track, uint32 format, uint32 descSize) = 0; diff --git a/common/zlib.cpp b/common/zlib.cpp index 448e1eadd5..c22ea1e660 100644 --- a/common/zlib.cpp +++ b/common/zlib.cpp @@ -27,6 +27,7 @@ #include "common/ptr.h" #include "common/util.h" #include "common/stream.h" +#include "common/debug.h" #include "common/textconsole.h" #if defined(USE_ZLIB) @@ -140,6 +141,10 @@ bool inflateZlibInstallShield(byte *dst, uint dstLen, const byte *src, uint srcL return true; } +#ifndef RELEASE_BUILD +static bool _shownBackwardSeekingWarning = false; +#endif + /** * A simple wrapper class which can be used to wrap around an arbitrary * other SeekableReadStream and will then provide on-the-fly decompression support. @@ -159,11 +164,10 @@ protected: uint32 _pos; uint32 _origSize; bool _eos; - bool _shownBackwardSeekingWarning; public: - GZipReadStream(SeekableReadStream *w, uint32 knownSize = 0) : _wrapped(w), _stream(), _shownBackwardSeekingWarning(false) { + GZipReadStream(SeekableReadStream *w, uint32 knownSize = 0) : _wrapped(w), _stream() { assert(w != 0); // Verify file header is correct @@ -263,13 +267,15 @@ public: // from the start of the file. A rather wasteful operation, best // to avoid it. :/ +#ifndef RELEASE_BUILD if (!_shownBackwardSeekingWarning) { // We only throw this warning once per stream, to avoid // getting the console swarmed with warnings when consecutive // seeks are made. - warning("Backward seeking in GZipReadStream detected"); + debug(1, "Backward seeking in GZipReadStream detected"); _shownBackwardSeekingWarning = true; } +#endif _pos = 0; _wrapped->seek(0, SEEK_SET); @@ -850,7 +850,9 @@ Fine tuning of the installation directories: Special configuration feature: --host=HOST cross-compile to target HOST (arm-linux, ...) - special targets: android for Android + special targets: android-arm for Android ARM + android-mips for Android MIPS + android-x86 for Android x86 tizen for Samsung Tizen caanoo for Caanoo dingux for Dingux @@ -965,6 +967,7 @@ Optional Libraries: --with-freetype2-prefix=DIR Prefix where the freetype-config script is installed (optional) + --disable-freetype2 disable freetype2 TTF library usage [autodetect] --with-nasm-prefix=DIR Prefix where nasm executable is installed (optional) --disable-nasm disable assembly language optimizations [autodetect] @@ -1271,11 +1274,21 @@ get_system_exe_extension $guessed_host NATIVEEXEEXT=$_exeext case $_host in -android | android-v7a | ouya) +android | android-arm | android-v7a | android-arm-v7a | ouya) _host_os=android _host_cpu=arm _host_alias=arm-linux-androideabi ;; +android-mips) + _host_os=android + _host_cpu=mipsel + _host_alias=mipsel-linux-android + ;; +android-x86) + _host_os=android + _host_cpu=i686 + _host_alias=i686-linux-android + ;; arm-riscos) _host_os=riscos _host_cpu=arm @@ -1475,8 +1488,16 @@ caanoo | gp2x | gp2xwiz | openpandora | ps2) esac if test "$_debug_build" != no; then - # debug mode not explicitly disabled -> compile with -g - CXXFLAGS="$CXXFLAGS -g" + # debug mode not explicitly disabled -> compile with debug information + case $_host_os in + amigaos*) + # AmigaOS debugger uses plain stabs, with no gdb extensions. + CXXFLAGS="$CXXFLAGS -gstabs" + ;; + *) + # Use the system default format for debug info. + CXXFLAGS="$CXXFLAGS -g" + esac fi if test "$_release_build" = yes; then @@ -2033,27 +2054,49 @@ echo_n "Checking hosttype... " echo $_host_os case $_host_os in amigaos*) - LDFLAGS="$LDFLAGS -use-dynld" + LDFLAGS="$LDFLAGS -use-dynld -Wl,--export-dynamic" LDFLAGS="$LDFLAGS -L/sdk/local/newlib/lib" # We have to use 'long' for our 4 byte typedef because AmigaOS already typedefs (u)int32 # as (unsigned) long, and consequently we'd get a compiler error otherwise. type_4_byte='long' + # Supress format warnings as the long 4 byte causes noisy warnings. + CXXFLAGS="$CXXFLAGS -Wno-format" add_line_to_config_mk 'AMIGAOS = 1' ;; android) case $_host in - android) + android | android-arm) CXXFLAGS="$CXXFLAGS -march=armv5te" CXXFLAGS="$CXXFLAGS -mtune=xscale" CXXFLAGS="$CXXFLAGS -msoft-float" ABI="armeabi" + ANDROID_PLATFORM=4 + ANDROID_PLATFORM_ARCH="arm" ;; - android-v7a) + android-v7a | android-arm-v7a) CXXFLAGS="$CXXFLAGS -march=armv7-a" CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp" CXXFLAGS="$CXXFLAGS -mfpu=vfp" LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8" ABI="armeabi-v7a" + ANDROID_PLATFORM=4 + ANDROID_PLATFORM_ARCH="arm" + ;; + android-mips) + CXXFLAGS="$CXXFLAGS -march=mips32" + CXXFLAGS="$CXXFLAGS -mtune=mips32" + ABI="mips" + # Platform version 9 is needed as earlier versions of platform do not support this arch. + ANDROID_PLATFORM=9 + ANDROID_PLATFORM_ARCH="mips" + ;; + android-x86) + CXXFLAGS="$CXXFLAGS -march=i686" + CXXFLAGS="$CXXFLAGS -mtune=i686" + ABI="x86" + # Platform version 9 is needed as earlier versions of platform do not support this arch. + ANDROID_PLATFORM=9 + ANDROID_PLATFORM_ARCH="x86" ;; ouya) CXXFLAGS="$CXXFLAGS -march=armv7-a" @@ -2061,9 +2104,15 @@ case $_host_os in CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp" CXXFLAGS="$CXXFLAGS -mfpu=neon" ABI="armeabi-v7a" + ANDROID_PLATFORM=4 + ANDROID_PLATFORM_ARCH="arm" ;; esac - CXXFLAGS="$CXXFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm" + + # Setup platform version and arch + CXXFLAGS="$CXXFLAGS --sysroot=$ANDROID_NDK/platforms/android-$ANDROID_PLATFORM/arch-$ANDROID_PLATFORM_ARCH" + LDFLAGS="$LDFLAGS --sysroot=$ANDROID_NDK/platforms/android-$ANDROID_PLATFORM/arch-$ANDROID_PLATFORM_ARCH" + CXXFLAGS="$CXXFLAGS -fpic" CXXFLAGS="$CXXFLAGS -ffunction-sections" CXXFLAGS="$CXXFLAGS -funwind-tables" @@ -2076,16 +2125,23 @@ case $_host_os in fi CXXFLAGS="$CXXFLAGS -finline-limit=300" _optimization_level=-Os - CXXFLAGS="$CXXFLAGS -mthumb-interwork" - # FIXME: Why is the following in CXXFLAGS and not in DEFINES? Change or document this. - CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5__" - CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5T__" - CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5E__" - CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5TE__" - # supress 'mangling of 'va_list' has changed in GCC 4.4' + + if test "$_host" = android -o "$_host" = android-arm; then + CXXFLAGS="$CXXFLAGS -mthumb-interwork" + # FIXME: Why is the following in CXXFLAGS and not in DEFINES? Change or document this. + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5__" + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5T__" + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5E__" + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5TE__" + fi + + # surpress 'mangling of 'va_list' has changed in GCC 4.4' warning CXXFLAGS="$CXXFLAGS -Wno-psabi" - LDFLAGS="$LDFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm" - LDFLAGS="$LDFLAGS -mthumb-interwork" + + if test "$_host" = android -o "$_host" = android-arm; then + LDFLAGS="$LDFLAGS -mthumb-interwork" + fi + LDFLAGS="$LDFLAGS -L$ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/`$CXX -dumpversion`/libs/$ABI/" LIBS="$LIBS -lsupc++" add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK" @@ -2352,7 +2408,7 @@ if test -n "$_host"; then # Cross-compiling mode - add your target here if needed echo "Cross-compiling to $_host" case "$_host" in - android | android-v7a | ouya) + android | android-arm | android-v7a | android-arm-v7a | android-mips | android-x86 | ouya) # we link a .so as default LDFLAGS="$LDFLAGS -shared" LDFLAGS="$LDFLAGS -Wl,-Bsymbolic,--no-undefined" @@ -2497,6 +2553,7 @@ if test -n "$_host"; then ;; iphone) DEFINES="$DEFINES -DIPHONE" + ASFLAGS="$ASFLAGS -arch armv6" _backend="iphone" _build_scalers=no _mt32emu=no diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp index d42989b618..7da7bd4ef0 100644 --- a/devtools/create_kyradat/create_kyradat.cpp +++ b/devtools/create_kyradat/create_kyradat.cpp @@ -45,7 +45,7 @@ enum { - kKyraDatVersion = 84 + kKyraDatVersion = 85 }; const ExtractFilename extractFilenames[] = { diff --git a/devtools/create_kyradat/resources/lok_dos_oldfloppy_russian.h b/devtools/create_kyradat/resources/lok_dos_oldfloppy_russian.h index 9b4a033bd5..d0afaf6c50 100644 --- a/devtools/create_kyradat/resources/lok_dos_oldfloppy_russian.h +++ b/devtools/create_kyradat/resources/lok_dos_oldfloppy_russian.h @@ -1,31 +1,20 @@ -static const char *const k1IntroStringsDOSOldFloppyRussian[81] = { +static const char *const k1IntroStringsDOSOldFloppyRussian[51] = { "This is a text test - 1", "This is a text test - 2", "\x08""p""\x18\x14""e""\x1F"", Ka""\x1B\x1B""a""\x1A""...", - "..", "...""\x08""o""\x14""e""\x1B\x18\x1F""e""\x1B""{ Kopo""\x1B""e""\x14""c""\x1A""o""\x19"" Ma""\x15\x18\x18""!", - "ystics!", "\x12"" ""\x1D""e ""\x18""c""\x1E""y""\x15""a""\x1B"" ""\x1F""e""\x13""~?", - "", "Ma""\x1B\x1A""o""\x1B\x1C""!", "\x12"" ""\x14""\\epa y""\x17\x1D""a""\x1B"" o ""\x1F\x14""oe""\x1C"" ""\x1E""o""\x13""e""\x15""e...", - ".", "... ""\x18"" o""\x7F\x18\x16""a""\x1B"" ""\x1F""e""\x13""~ y""\x14\x18\x16""e""\x1F""{.", - "e now.", "K \\e""\x1C""y c""\x1E""e]""\x18\x1F""{?", - "?", "\x12"" ""\x17\x16""ec{ ""\x02""oc""\x1E""o""\x16\x18\x1D""!", "T""\x14""oe ""\x1E""po""\x1A\x1B""~""\x1F\x18""e ""\x1C""e""\x1D""~ ""\x1D""e y""\x16""ep""\x7F\x18\x1F"".", - "ght.", "Ta""\x1A"" y""\x13""e""\x19"" ""\x1C""e""\x1D""~!", - "!", "\t ""\x1C""e""\x1D""~ oc""\x1F""a""\x1B""ac{ e^e ""\x1C""a""\x15\x18""~", "He co""\x1C\x1D""e""\x14""a""\x19""c~...", - "u, have no doubt...", "...""\x1F""e""\x1E""ep{ ""\x1F""` ""\x1A""a""\x1C""e""\x1D""{...", - "", "...""\x1D""o ~ oc""\x1F""a""\x14\x18\x1B"" ""\x15\x1B""a""\x17""a.", - "s.", "\x12"" ""\x1D""e ""\x13""y""\x16""y ""\x1E\x1B""a""\x1A""a""\x1F""{ o K""\x18""pa""\x1D\x16\x18\x18""...", "...""\x1D""o ""\x17""a""\x1E""pe""\x1F\x18\x1F""{ ""\x1F""e""\x13""e ""\x1D""e ""\x1C""o""\x15""y.", "Malcolm the Jester has broken free!", @@ -33,52 +22,33 @@ static const char *const k1IntroStringsDOSOldFloppyRussian[81] = { "...source of all magic in Kyrandia!", "", "Ka""\x1A"" ""\x1F""` ""\x1E""oc""\x1C""e""\x1B""!", - "ip ME!", "Ho ""\x1D\x18""\\e""\x15""o, y ""\x1C""e""\x1D""~ ec""\x1F""{ ""\x1A""oe-\\""\x1F""o...", - "..", "Bo""\x1F"" ""\x1A""o""\x1C""e""\x16\x18""~!", - "x!", "Ho ~ \\ec""\x1F\x1D""o ""\x1E""pe""\x16""y""\x1E""pe""\x7F\x16""a}.", - "ing.", "He ""\x1E""p`""\x15""a""\x19"" ""\x1D""a ""\x10""TO ""\x16""epe""\x14""o!", "He ""\x14\x17\x13\x18""pa""\x19""c~ ""\x1D""a ""\x10""TO ""\x16""epe""\x14""o ""\x13""e""\x1B""o\\""\x1A""a!", - "rrel!", "\x02""AB!", "Ta""\x1A"" c""\x1C""e]""\x1D""ee...", - "t way...", "...He ""\x1F""a""\x1A"" ""\x1B\x18""?", "Xa xa xa...", "Pa""\x17\x14""e ""\x1E""a""\x1B""{[` ""\x1D""e ""\x1E""pe""\x1A""pac""\x1D""`", "Ka""\x1A"" ""\x17\x16""opo""\x14""o o""\x7F\x18\x1F""{!", - "ive!", "\x01""p|""\x1D\x16""o""\x1D""!", "\x03""e""\x16""! M` c""\x16""e""\x1B""a""\x1B\x18"" |""\x1F""o!", - "t!", "He""\x1F""! T` c""\x16""e""\x1B""a""\x1B""!", "\tpa Kopo""\x1B""} ""\x01""p|""\x1D\x16""o""\x1D""y!", - "n!", "\tpa Kopo""\x1B""e""\x14""c""\x1A""o""\x19"" Ma""\x15\x18\x18""!", - "tics!", "Te""\x1E""ep{ ""\x1C""o""\x7F\x1D""o ""\x17""a""\x1D""~""\x1F""{c~ K""\x18""pa""\x1D\x16\x18""e""\x19"" ""\x14\x1C""ec""\x1F""e!", - "!", "O""\x1F\x1B\x18""\\""\x1D""o!", - "!", "\x06"" ""\x1C""o""\x19"" ""\x1E""ep""\x14""`""\x19"" Kopo""\x1B""e""\x14""c""\x1A\x18\x19"" \t""\x1A""a""\x17""...", - "", "\x12"" o""\x13""_~""\x14\x1B""~} ca""\x1D\x16""a""\x1B\x18\x18"" o@""\x18""[""\x18""a""\x1B""{""\x1D""o""\x19"" o""\x13""y""\x14""{} K""\x18""pa""\x1D\x16\x18\x18""!", - "ia!", "O""\x1F\x1B\x18""\\""\x1D""o, ""\x01""p|""\x1D\x16""o""\x1D""!", - "!", "\x05""e""\x1C\x1B""~ ""\x13""o""\x1B""{]e ""\x1D""e c""\x1F""pa""\x16""ae""\x1F""...", "\x06"" c ""\x1F\x14""o""\x18""x ""\x16""py""\x17""e""\x19"" c""\x1D""~""\x1F""o ""\x17""a""\x1A\x1B""~""\x1F\x18""e!", - "ed!", "\x03""opo""\x15""a~ ""\x01""p""\x18\x1D"".", "Ma""\x1B\x1A""o""\x1B\x1C"" oc""\x14""o""\x13""o""\x16\x18\x1B""c~!", - "ee!", "C""\x1A""opo o""\x1D"" ""\x1E""p""\x18\x16""e""\x1F"" ""\x17""a ""\x1C\x1D""o""\x19"".", - "", "\x08""o""\x1C""o""\x15\x18"" ""\x01""p|""\x1D\x16""o""\x1D""y...", - "...", "" }; @@ -246,15 +216,11 @@ static const char *const k1PoisonGoneStringDOSOldFloppyRussian[2] = { static const StringListProvider k1PoisonGoneStringDOSOldFloppyRussianProvider = { ARRAYSIZE(k1PoisonGoneStringDOSOldFloppyRussian), k1PoisonGoneStringDOSOldFloppyRussian }; -static const char *const k1ThePoisonStringsDOSOldFloppyRussian[8] = { +static const char *const k1ThePoisonStringsDOSOldFloppyRussian[4] = { "O""\x1F""pa""\x14""a...", - "...", "He ""\x1C""o""\x15""y ""\x16""`]a""\x1F""{...", - "", "M""\x1D""e ""\x1D""exopo]o...", - "good...", - "\x10\x1F""a ""\x17\x1C""e~...", - "ust\r~""\x16""o""\x14\x18\x1F""a!" + "\x10\x1F""a ""\x17\x1C""e~\r~""\x16""o""\x14\x18\x1F""a!" }; static const StringListProvider k1ThePoisonStringsDOSOldFloppyRussianProvider = { ARRAYSIZE(k1ThePoisonStringsDOSOldFloppyRussian), k1ThePoisonStringsDOSOldFloppyRussian }; @@ -266,10 +232,9 @@ static const char *const k1FluteStringsDOSOldFloppyRussian[2] = { static const StringListProvider k1FluteStringsDOSOldFloppyRussianProvider = { ARRAYSIZE(k1FluteStringsDOSOldFloppyRussian), k1FluteStringsDOSOldFloppyRussian }; -static const char *const k1WispJewelStringsDOSOldFloppyRussian[4] = { +static const char *const k1WispJewelStringsDOSOldFloppyRussian[3] = { "I'm not really feeling up to it right now.", "Ha""\x14""ep""\x1D""oe ~ ""\x16""o""\x1B\x7F""e""\x1D"" ""\x1E""o""\x1B""o""\x7F\x18\x1F""{ ", - "y ", ",c""\x1D""a\\a""\x1B""a" }; @@ -287,16 +252,11 @@ static const char *const k1FlaskFullStringDOSOldFloppyRussian[1] = { static const StringListProvider k1FlaskFullStringDOSOldFloppyRussianProvider = { ARRAYSIZE(k1FlaskFullStringDOSOldFloppyRussian), k1FlaskFullStringDOSOldFloppyRussian }; -static const char *const k1FullFlaskStringDOSOldFloppyRussian[9] = { - "\n""\x1B""~""\x7F\x1A""a ""\x1F""e""\x1E""ep{ ""\x1E""o""\x1B\x1D""a ", - "ed\rc""\x14""e""\x7F""e""\x19"", c""\x14""ep""\x1A""a}^e""\x19"" ""\x14""o""\x16""o""\x19"".", - "r.", - "\n""\x1B""~""\x7F\x1A""a ""\x1F""e""\x1E""ep{ ""\x1E""o""\x1B\x1D""a ", - "ed\rco""\x1B""e""\x1D""o""\x19"" ""\x14""o""\x16""o""\x19"".", - ".", - "\n""\x1B""~""\x7F\x1A""a ""\x1F""e""\x1E""ep{ ""\x1E""o""\x1B\x1D""a ", - "ed\r""\x1C\x18\x1D""epa""\x1B""{""\x1D""o""\x19"" ""\x14""o""\x16""o""\x19"".", - "" +static const char *const k1FullFlaskStringDOSOldFloppyRussian[4] = { + "\n""\x1B""~""\x7F\x1A""a ""\x1F""e""\x1E""ep{ ""\x1E""o""\x1B\x1D""a\red\rc""\x14""e""\x7F""e""\x19"", c""\x14""ep""\x1A""a }^e""\x19"" ""\x14""o""\x16""o""\x19"".", + "\n""\x1B""~""\x7F\x1A""a ""\x1F""e""\x1E""ep{ ""\x1E""o""\x1B\x1D""a\red\rco""\x1B""e""\x1D""o""\x19"" ""\x14""o""\x16""o""\x19"".", + "\n""\x1B""~""\x7F\x1A""a ""\x1F""e""\x1E""ep{ ""\x1E""o""\x1B\x1D""a\red\r""\x1C\x18\x1D""epa""\x1B""{""\x1D""o""\x19"" ""\x14""o""\x16""o""\x19"".", + " o""\x1B""]. ""\x14""o""\x16""o""\x19""." }; static const StringListProvider k1FullFlaskStringDOSOldFloppyRussianProvider = { ARRAYSIZE(k1FullFlaskStringDOSOldFloppyRussian), k1FullFlaskStringDOSOldFloppyRussian }; @@ -313,31 +273,21 @@ static const char *const k1VeryCleverStringDOSOldFloppyRussian[1] = { static const StringListProvider k1VeryCleverStringDOSOldFloppyRussianProvider = { ARRAYSIZE(k1VeryCleverStringDOSOldFloppyRussian), k1VeryCleverStringDOSOldFloppyRussian }; -static const char *const k1GUIStringsDOSOldFloppyRussian[39] = { +static const char *const k1GUIStringsDOSOldFloppyRussian[28] = { "\x07""e""\x15""e""\x1D\x16""a K""\x18""pa""\x1D\x16\x18\x18", - "andia", "\x05""a""\x15""py""\x17\x18\x1F""{", - "e", "Coxpa""\x1D\x18\x1F""{ ""\x18\x15""py", "\t""\x1E""pa""\x14\x1B""e""\x1D\x18""e", - "ls", "\x05""a""\x1A""o""\x1D""\\""\x18\x1F""{", - "ng", "\x08""po""\x16""o""\x1B\x7F\x18\x1F""{", - "", "\t""\x1E""pa""\x14\x1B""e""\x1D\x18""e", - "ls", "Ka""\x1A""y} ""\x18\x15""py B` xo""\x1F\x18\x1F""e ""\x17""a""\x15""py""\x17\x18\x1F""{?", - "oad?", "B`""\x13""ep""\x18\x1F""e ""\x1E""o""\x17\x18""[""\x18""} coxpa""\x1D""e""\x1D\x18""~:", - "", "< ""\x08""\tCTO >", "O""\x1F\x1C""e""\x1D""a", "B""\x14""e""\x16\x18\x1F""e o""\x1E\x18""ca""\x1D\x18""e coxpa""\x1D""~e""\x1C""o""\x19"" ""\x18\x15""p`:", - "ame:", "Save", "C""\x1E\x18"" c""\x1E""o""\x1A""o""\x19\x1D""o, ""\x01""p|""\x1D\x16""o""\x1D"".", - "", "B` y""\x14""epe""\x1D""`, \\""\x1F""o xo""\x1F\x18\x1F""e ""\x17""a""\x1A""o""\x1D""\\""\x18\x1F""{ ""\x18\x15""py?", "XXX", "XXX", @@ -352,7 +302,6 @@ static const char *const k1GUIStringsDOSOldFloppyRussian[39] = { "Te""\x1A""c""\x1F"" ", "My""\x17""`""\x1A""a ", "\x05\x14""y""\x1A\x18"" ", - "" }; static const StringListProvider k1GUIStringsDOSOldFloppyRussianProvider = { ARRAYSIZE(k1GUIStringsDOSOldFloppyRussian), k1GUIStringsDOSOldFloppyRussian }; diff --git a/devtools/create_lure/create_lure_dat.cpp b/devtools/create_lure/create_lure_dat.cpp index eca18b3d2f..0ac07c460d 100644 --- a/devtools/create_lure/create_lure_dat.cpp +++ b/devtools/create_lure/create_lure_dat.cpp @@ -1348,7 +1348,7 @@ const char *germanTextStrings[NUM_TEXT_ENTRIES] = { "Abbrechen", "Schneller Text\x8b", "Langsamer Text\x8b", "Sound an", "Sound aus", "(nichts)", " nach ", " an ", " f\x8cr ", "und dann", "Schlu\x92", "Sicher (j/n)?", - "Du tr\x8dgst", "niets", "und du hast ", "silberm\x8cnzen", "silberm\x8cnzen" + "Du tr\x8dgst ", "nichts.", "und du hast ", "silberm\x8cnzen", "silberm\x8cnzen", "keinen ", "keine ", "kein ", "der ", "die ", "das ", "den ", "einen ", "eine ", "ein " }; @@ -1359,7 +1359,7 @@ const char *spanishTextStrings[NUM_TEXT_ENTRIES] = { "Cr\x7f" "ditos", "Reiniciar", "Salvar juego", "Recuperar jue", "Abandonar", "Texto r\x98pido\x8b", "Texto lento \x8b", "Sonido activado ", "Sonido desactivado ", "(nada)", " con ", " a ", " con ", "y luego", "eso es todo", "\x94" "Est\x98s seguro? (S/N)", - "Llevas ", "nada", "y tienes ", "moneda", "monedas" + "Llevas ", "nada", "y tienes ", "moneda", "monedas", "el ", "la ", "los ", "las ", "este ", "esta ", "estos ", "estas ", NULL, NULL }; diff --git a/dists/engine-data/kyra.dat b/dists/engine-data/kyra.dat Binary files differindex af8755471c..37b3b0ef0b 100644 --- a/dists/engine-data/kyra.dat +++ b/dists/engine-data/kyra.dat diff --git a/dists/engine-data/lure.dat b/dists/engine-data/lure.dat Binary files differindex 4e0d2894af..8ca69224da 100644 --- a/dists/engine-data/lure.dat +++ b/dists/engine-data/lure.dat diff --git a/doc/cz/PrectiMe b/doc/cz/PrectiMe index 390d20ab1d..0f475b9539 100644 --- a/doc/cz/PrectiMe +++ b/doc/cz/PrectiMe @@ -1,1688 +1,1750 @@ -PĹEÄTIMÄ ScummVM ------------------------------------------------------------------------- - -Pro vĂce informacĂ, seznamy kompatibility, podrobnosti o dotacĂch, nejnovÄjĹĄĂ verze, -novinky o vĂ˝voji a dalĹĄĂ, prosĂm navĹĄtivte domovskou strĂĄnku ScummVM na: http://www.scummvm.org/ - - -Obsah: ------- -1.0) Ăvod - * 1.1 O ScummVM - * 1.2 RychlĂ˝ nĂĄvod -2.0) Kontakt - * 2.1 HlĂĄĹĄenĂ chyb -3.0) PodporovanĂŠ hry - * 3.1 Ochrana proti kopĂrovĂĄnĂ - * 3.2 PoznĂĄmky ke hrĂĄm Commodore64 - * 3.3 PoznĂĄmky k Maniac Mansion NES - * 3.4 PoznĂĄmky ke hrĂĄm Macintosh - * 3.5 PoznĂĄmky ke hrĂĄm Multi-CD - * 3.6 PoznĂĄmky k The Curse of Monkey Island - * 3.7 PoznĂĄmky ke hrĂĄm Broken Sword - * 3.8 PoznĂĄmky k Beneath a Steel Sky - * 3.9 PoznĂĄmky k Flight of the Amazon Queen - * 3.10 PoznĂĄmky ke Gobliiins - * 3.11 PoznĂĄmky k Inherit the Earth: Quest for the Orb - * 3.12 PoznĂĄmky k Simon the Sorcerer - * 3.13 PoznĂĄmky k The Feeble Files - * 3.14 PoznĂĄmky k The Legend of Kyrandia - * 3.15 PoznĂĄmky k PĹedvĂdavĂŠmu VstupnĂmu Dialogu her Sierra AGI - * 3.16 PoznĂĄmky k Mickey's Space Adventure - * 3.17 PoznĂĄmky k Winnie the Pooh - * 3.18 PoznĂĄmky k Troll's Tale - * 3.19 PoznĂĄmky k DraÄĂ Historie - * 3.20 ZnĂĄmĂŠ problĂŠmy -4.0) PodporovanĂŠ platformy -5.0) SpuĹĄtÄnĂ ScummVM - * 5.1 MoĹžnosti pĹĂkazovĂŠho ĹĂĄdku - * 5.2 Volby jazyka - * 5.3 GrafickĂŠ filtry - * 5.4 GlobĂĄlnĂ menu - * 5.5 KlĂĄvesovĂŠ zkratky -6.0) UloĹženĂŠ hry - * 6.1 AutomatickĂŠ uklĂĄdĂĄnĂ - * 6.2 PĹevod uloĹženĂ˝ch her - * 6.3 ZobrazenĂ/NaÄtenĂ uloĹženĂ˝ch her z pĹĂkazovĂŠho ĹĂĄdku -7.0) Hudba a zvuk - * 7.1 Emulace AdLib - * 7.2 Emulace FluidSynth MIDI - * 7.3 Emulace MT-32 - * 7.4 Emulace MIDI - * 7.5 PĹirozenĂĄ podpora MIDI - * 7.6 Podpora nativnĂho UNIX, ALSA a sekvencĂŠru dmedia - * 7.7 Podpora MIDI serveru TiMidity++ - * 7.8 PouĹžitĂ komprimovanĂ˝ch zvukovĂ˝ch souborĹŻ (MP3, Ogg Vorbis, Flac) - * 7.9 VĂ˝stupnĂ vzorkovacĂ kmitoÄet -8.0) Soubor s nastavenĂm - * 8.1 RozpoznĂĄvanĂĄ klĂÄovĂĄ slova nastavenĂ - * 8.2 VlastnĂ hernĂ volby, kterĂŠ mohou bĂ˝t pĹepĂnĂĄny pomoci grafickĂŠho rozhranĂ -9.0) SestavenĂ - - -1.0) Ăvod: ----- ----- - -1.1) O ScummVM: ----- ---------- -ScummVM je program, kterĂ˝ VĂĄm umoĹžĹuje spouĹĄtÄt urÄitĂŠ klasickĂŠ grafickĂŠ point-and-click adventury, za pĹedpokladu, Ĺže jiĹž mĂĄte jejich datovĂŠ soubory. A teÄ ta chytrĂĄ ÄĂĄst: ScummVM jenom nahrazuje spouĹĄtÄÄe, kterĂŠ jsou dodĂĄvĂĄny se hrou, coĹž VĂĄm umoĹžĹuje hrĂĄt hry v systĂŠmech, pro kterĂŠ nikdy nebyly navrĹženy! - -PĹŻvodnÄ byl navrĹžen pro spouĹĄtÄnĂ her SCUMM od LucasArts SCUMM, jako napĹ. Maniac Mansion, Monkey Island, Day of the Tentacle nebo Sam and Max. SCUMM znamenĂĄ 'NĂĄstroj pro VytvĂĄĹenĂ Skriptu pro Maniac Mansion', coĹž byla prvnĂ hra, pro kterou LucasArts tento systĂŠm navrhl. A mnohem pozdÄji dal svĂŠ jmĂŠno ScummVM ('VM' znamenĂĄ VirtuĂĄlnĂ Stroj). - -Postupem Äasu byla pĹidĂĄna podpora pro spoustu her mimo SCUMM a -ScummVM nynĂ takĂŠ podporuje mnoho AGI a SCI her od Sierra (napĹ. King's -Quest 1-6, Space Quest 1-5, ...), Discworld 1 a 2, Simon the Sorcerer 1 and 2, Beneath A Steel Sky, Lure of the Temptress, Broken Sword I a II, Flight of the Amazon Queen, Gobliiins 1-3, sĂŠrie The Legend of Kyrandia, mnoho ze SCUMM her pro dÄti od Humongous Entertainment (vÄetnÄ her Freddi Fish a Putt Putt) a mnoho dalĹĄĂch. Na strĂĄnce kompatibility mĹŻĹžete najĂt ĂşplnĂ˝ seznam s podrobnostmi, kterĂŠ adventury jsou podporovĂĄny a jak dobĹe. ScummVM je neustĂĄle zlepĹĄovĂĄn a proto navĹĄtÄvujte naĹĄe strĂĄnky Äasto. - -Mezi systĂŠmy, na kterĂ˝ch mĹŻĹžete tyto hrĂĄt, jsou bÄĹžnĂŠ stolnĂ poÄĂtaÄe (majĂcĂ Windows, Linux, Mac OS X, ...), hernĂ konzole -(Dreamcast, Nintendo DS a Wii, PS2, PSP, ...), chytrĂŠ telefony (Android, -iPhone, PocketPC, Symbian ...) a dalĹĄĂ. - -V souÄasnosti je ScummVM stĂĄle velkou ÄĂĄstĂ ve vĂ˝voji. NezapomeĹte, Ĺže i kdyĹž se snaĹžĂme zajistit, aby mnoho her bylo moĹžno dokonÄit pouze s pĂĄr vĂĄĹžnĂ˝mi chybami, pĂĄdy programu mohou nastat a my neposkytujeme ŞådnĂŠ zĂĄruky. PĹes to vĹĄechno, nÄkterĂŠ hry byly podporovĂĄny po dlouhou dobu -A mÄly by fungovat v poĹĂĄdku se vĹĄemi novÄjĹĄĂmi stabilnĂmi verzemi. Jak dobĹe bude hra ve ScummVM fungovat mĹŻĹžete zjistit prohlĂŠdnutĂm strĂĄnky kompatibility. -VlastnÄ, pokud troĹĄiÄku zahledĂĄte, mĹŻĹžete zjistit, Ĺže ScummVM je pouĹžĂvĂĄn i komerÄnÄ pro znovu vydĂĄnĂ nÄkterĂ˝ch podporovanĂ˝ch her na modernĂch platformĂĄch. To ukazuje, Ĺže i nÄkolik spoleÄnostĂ je spokojeno s kvalitou softwaru a jako moc dobĹe mĹŻĹže nÄkterĂŠ hry spouĹĄtÄt. - -Pokud mĂĄte ScummVM rĂĄdi, mĹŻĹžete ho podpoĹit dotacĂ pomocĂ tlaÄĂtka PayPal na strĂĄnce ScummVM. To nĂĄm pomĹŻĹže zakoupit nĂĄstroje potĹebnĂŠ ke snadnÄjĹĄĂmu a rychlejĹĄĂmu vĂ˝voji ScummVM. Pokud nemĹŻĹžete podpoĹit dotacĂ, pomozte a pĹispÄjte zĂĄplatou! - -1.2) RychlĂ˝ nĂĄvod: ----- ------------- -Pro ty netrpÄlivĂŠ z VĂĄs je tu nĂĄvod, jak ScummVM spustit v nÄkolika krocĂch. - -1. StĂĄhnÄte si ScummVM z <http://www.scummvm.org/downloads.php> a nainstalujte ho. - -2. Na VaĹĄem pevnĂŠm disku vytvoĹte sloĹžku a zkopĂrujte datovĂŠ soubory z pĹŻvodnĂho mĂŠdia do tĂŠto sloĹžky. Zopakujte pro vĹĄechny hry, kterĂŠ chcete hrĂĄt - -3. SpusĹĽte ScummVM, zvolte 'PĹidat hru', zvolte adresĂĄĹ s datovĂ˝mi soubory hry (nesnaĹžte se volit datovĂŠ soubory samotnĂŠ!) a stisknÄte -'Zvolit'. - -4. MÄlo by se objevit dialogovĂŠ okno umoĹžĹujĂcĂ VĂĄm pozmÄnit rĹŻznĂĄ nastavenĂ, pokud tak chcete (i kdyĹž by mÄlo bĂ˝t v poĹĂĄdku vĹĄechno nechat ve vĂ˝chozĂm nastavenĂ). DialogovĂŠ okno potvrÄte. - -5. V seznamu vyberte hru, kterou chcete hrĂĄt a stisknÄte 'Spustit'. - -V budoucnu byste mÄli bĂ˝t schopni pĹeskoÄit na krok 5, pokud nechcete pĹidat dalĹĄĂ hry. - -Rada: Pokud chcete pĹidat vĂce her najednou, zkuste stisknout a drĹžet klĂĄvesu shift pĹedtĂm, neĹž kliknete na 'PĹidat hru' â tlaÄĂtko se zmÄnĂ na 'HromadnĂŠ PĹidĂĄnĂ' a pokud ho stisknÄte, jste znovu poŞådĂĄni o zvolenĂ sloĹžky, ale tentokrĂĄt ScummVM prohledĂĄ vĹĄechny podsloĹžky pro podporovanĂŠ hry. - - -2.0) Kontakt: ----- -------- -NejjednoduĹĄĹĄĂm zpĹŻsobem, jak kontaktovat tĂ˝m ScummVM je pĹedloĹženĂm hlĂĄĹĄenĂ o chybÄ (viz oddĂl 2.1) nebo pouĹžitĂm naĹĄich fĂłr na http://forums.scummvm.org . -MĹŻĹžete se takĂŠ pĹipojit a odesĂlat a e-maily na korespondenÄnĂ seznam scummvm-devel, nebo s nĂĄmi chatovat na IRC (#scummvm na irc.freenode.net) NeŞådejte nĂĄs, prosĂm, o podporu nefungujĂcĂ hry â nejdĹĂve si pĹeÄtÄte nejÄastÄjĹĄĂ otĂĄzky na naĹĄĂ strĂĄnce - -2.1) HlĂĄĹĄenĂ chyb: ----- ------------- -Abyste mohli nahlĂĄsit chybu, nejdĹĂve si, prosĂme, vytvoĹte si ĂşÄet na SourceForge a kliknÄte na odkaz "Bug Tracker" na naĹĄĂ strĂĄnce. UjistÄte se, prosĂm, Ĺže se chyba dĂĄ znovu zjistit a stĂĄle se objevuje v nejnovÄjĹĄĂ verzi git/dennĂho sestavenĂ. TakĂŠ na naĹĄĂ strĂĄnce zkontrolujte seznam znĂĄmĂ˝ch problĂŠmĹŻ (nĂĹže) a seznam kompatibility pro tuto hru, abyste se ujistili, Ĺže problĂŠm jiĹž nenĂ znĂĄm: - - http://www.scummvm.org/compatibility - -ProsĂme, nenahlaĹĄujte chyby ve hrĂĄch, kterĂŠ nejsou v seznamu v sekci 'Supported Games' nebo seznamu kompatibility uvedeny jako dokonÄitelnĂŠ. My âvĂme-, Ĺže tyto hry majĂ chyby. - -ZahrĹte, prosĂm, nĂĄsledujĂcĂ informace: - - Verzi ScummVM (PROSĂME, vyzkouĹĄejte nejnovÄjĹĄĂ sestavenĂ git/Daily) - - Podrobnosti o chybÄ, vÄetnÄ postupu na jejĂ znovu opakovĂĄnĂ - - Jazyk hry (angliÄtina, nÄmÄina, ...) - - Verze hry (s ĹeÄĂ, z diskety, ...) - - Platforma a kompilĂĄtor (Win32, Linux, FreeBSD, ...) - - Pokud moĹžno, pĹiloĹžte uloĹženou hru - - Pokud se tato chyba objevila pouze nedĂĄvno, poznamenejte si poslednĂ verzi bez chyby a prvnĂ verzi s touto chybou. Takto ji mĹŻĹžeme rychle spravit tĂm, Ĺže se podĂvĂĄme na provedenĂŠ zmÄny. - -Nakonec prosĂme, abyste kaĹždou chybu nahlaĹĄovali samostatnÄ; neohlaĹĄujte nÄkolik chyb v jednom hlĂĄĹĄenĂ. (Jinak bude obtĂĹžnĂŠ sledovat stav kaĹždĂŠ jednotlivĂŠ chyby). - - -3.0) PodporovanĂŠ hry: ----- ---------------- -V tuto chvĂli je o nĂĄsledujĂcĂch hrĂĄch znĂĄmo, Ĺže fungujĂ a mÄly by bĂ˝t hratelnĂŠ aĹž dokonce: - -Hry SCUMM od LucasArts: - Maniac Mansion [maniac] - Zak McKracken and the Alien Mindbenders [zak] - Indiana Jones and the Last Crusade [indy3] - Loom [loom] - The Secret of Monkey Island [monkey] - Monkey Island 2: LeChuck's Revenge [monkey2] - Indiana Jones and the Fate of Atlantis [atlantis] - Day of the Tentacle [tentacle] - Sam & Max Hit the Road [samnmax] - Full Throttle [ft] - The Dig [dig] - The Curse of Monkey Island [comi] - -Hry AGI od Sierra: - The Black Cauldron [bc] - Gold Rush! [goldrush] - King's Quest I [kq1] - King's Quest II [kq2] - King's Quest III [kq3] - King's Quest IV [kq4] - Leisure Suit Larry in the Land of the - Lounge Lizards [lsl1] - Mixed-Up Mother Goose [mixedup] - Manhunter 1: New York [mh1] - Manhunter 2: San Francisco [mh2] - Police Quest I: In Pursuit of the Death - Angel [pq1] - Space Quest I: The Sarien Encounter [sq1] - Space Quest II: Vohaul's Revenge [sq2] - Fanmade Games [agi-fanmade] - -Hry AGOS od Adventuresoft/Horrorsoft: - Elvira - Mistress of the Dark [elvira1] - Elvira II - The Jaws of Cerberus [elvira2] - Personal Nightmare [pn] - Waxworks [waxworks] - Simon the Sorcerer 1 [simon1] - Simon the Sorcerer 2 [simon2] - Simon the Sorcerer's Puzzle Pack - - Demon In My Pocket [dimp] - Simon the Sorcerer's Puzzle Pack - - Jumble [jumble] - Simon the Sorcerer's Puzzle Pack - - NoPatience [puzzle] - Simon the Sorcerer's Puzzle Pack - - Swampy Adventures [swampy] - The Feeble Files [feeble] - -Hry GOB od Coktel Vision: - Bambou le sauveur de la jungle [bambou] - Bargon Attack [bargon] - Fascination [fascination] - Geisha [geisha] - Gobliiins [gob1] - Gobliins 2 [gob2] - Goblins 3 [gob3] - Lost in Time [lostintime] - Once Upon A Time: Little Red Riding Hood [littlered] - The Bizarre Adventures of Woodruff - and the Schnibble [woodruff] - Urban Runner [urban] - Ween: The Prophecy [ween] - -Hry MADE od Activision: - Leather Goddesses of Phobos 2 [lgop2] - Return to Zork [rtz] - Rodney's Funscreen [rodney] - The Manhole [manhole] - -DalĹĄĂ hry: - Beneath a Steel Sky [sky] - Broken Sword: The Shadow of the Templars [sword1] - Broken Sword II: The Smoking Mirror [sword2] - Cruise for a Corpse [cruise] - Discworld [dw] - Discworld 2: Missing Presumed ...!? [dw2] - Dragon History [draci] - Drascula: The Vampire Strikes Back [drascula] - Eye of the Beholder [eob] - Eye of the Beholder II: The Legend of - Darkmoon [eob2] - Flight of the Amazon Queen [queen] - Future Wars [fw] - Inherit the Earth: Quest for the Orb [ite] - Nippon Safes Inc. [nippon] - Lands of Lore: The Throne of Chaos [lol] - The Journeyman Project: Pegasus Prime [pegasus] - The Legend of Kyrandia [kyra1] - The Legend of Kyrandia: The Hand of Fate [kyra2] - The Legend of Kyrandia: Malcolm's Revenge [kyra3] - Touche: The Adventures of the Fifth - Musketeer [touche] - -Hry SCUMM od Humongous Entertainment: - Backyard Baseball [baseball] - Backyard Baseball 2001 [baseball2001] - Backyard Baseball 2003 [baseball2003] - Backyard Football [football] - Big Thinkers First Grade [thinker1] - Big Thinkers Kindergarten [thinkerk] - Blue's 123 Time Activities [Blues123Time] - Blue's ABC Time Activities [BluesABCTime] - Blue's Art Time Activities [arttime] - Blue's Birthday Adventure [BluesBirthday] - Blue's Reading Time Activities [readtime] - Fatty Bear's Birthday Surprise [fbear] - Fatty Bear's Fun Pack [fbpack] - Freddi Fish 1: The Case of the Missing - Kelp Seeds [freddi] - Freddi Fish 2: The Case of the Haunted - Schoolhouse [freddi2] - Freddi Fish 3: The Case of the Stolen - Conch Shell [freddi3] - Freddi Fish 4: The Case of the Hogfish - Rustlers of Briny Gulch [freddi4] - Freddi Fish 5: The Case of the Creature - of Coral Cove [freddicove] - Freddi Fish and Luther's Maze Madness [maze] - Freddi Fish and Luther's Water Worries [water] - Let's Explore the Airport with Buzzy [airport] - Let's Explore the Farm with Buzzy [farm] - Let's Explore the Jungle with Buzzy [jungle] - Pajama Sam 1: No Need to Hide When It's - Dark Outside [pajama] - Pajama Sam 2: Thunder and Lightning - Aren't so Frightening [pajama2] - Pajama Sam 3: You Are What You Eat - From Your Head to Your Feet [pajama3] - Pajama Sam's Lost & Found [lost] - Pajama Sam's Sock Works [socks] - Putt-Putt Joins the Parade [puttputt] - Putt-Putt Goes to the Moon [puttmoon] - Putt-Putt Saves the Zoo [puttzoo] - Putt-Putt Travels Through Time [putttime] - Putt-Putt Enters the Race [puttrace] - Putt-Putt Joins the Circus [puttcircus] - Putt-Putt and Pep's Balloon-O-Rama [balloon] - Putt-Putt and Pep's Dog on a Stick [dog] - Putt-Putt & Fatty Bear's Activity Pack [activity] - Putt-Putt's Fun Pack [funpack] - SPY Fox 1: Dry Cereal [spyfox] - SPY Fox 2: Some Assembly Required [spyfox2] - SPY Fox 3: Operation Ozone [spyozon] - SPY Fox in Cheese Chase [chase] - SPY Fox in Hold the Mustard [mustard] - -Hry Living Books: - Aesop's Fables: The Tortoise and the Hare [tortoise] - Arthur's Birthday [arthurbday] - Arthur's Teacher Trouble [arthur] - Dr. Seuss's ABC [seussabc] - Green Eggs and Ham [greeneggs] - Harry and the Haunted House [harryhh] - Just Grandma and Me [grandma] - Little Monster at School [lilmonster] - Ruff's Bone [ruff] - Sheila Rae, the Brave [sheila] - Stellaluna [stellaluna] - The Berenstain Bears Get in a Fight [bearfight] - The Berenstain Bears in the Dark [beardark] - The New Kid on the Block [newkid] - -NĂĄsledujĂcĂ hry by mÄly jĂt spustit, ale zatĂm nejsou ĂşplnÄ hratelnĂŠ. Hrajte je pouze na vlastnĂ riziko a prosĂme, abyste pro tyto hry nenahlaĹĄovali chyby. -Pokud chcete mĂt nejnovÄjĹĄĂ zprĂĄvy o kompatibilitĂĄch her, navĹĄtivte naĹĄĂ strĂĄnku a prohlĂŠdnÄte si tabulku kompatibilit. - - Backyard Football 2002 [football2002] - Backyard Soccer [soccer] - Backyard Soccer MLS [soccermls] - Backyard Soccer 2004 [soccer2004] - Blue's Treasure Hunt [BluesTreasureHunt] - Pajama Sam: Games to Play on Any Day [pjgames] - -NĂĄsledujĂcĂ hry jsou odvozeny od jĂĄdra SCUMM, ale ScummVM je nepodporuje (zatĂm): - - OstatnĂ hry od Humongous Entertainment - -NezapomeĹte, prosĂm, Ĺže jĂĄdra mohou obsahovat chyby a nezavedenĂŠ funkce, kterĂŠ nÄkdy zabrĂĄnĂ hru dokonÄit. UklĂĄdejte Äasto a nahlaste chyby, prosĂm (instrukce pro hlĂĄĹĄenĂ chyb jsou výťe), pokud na takovou chybu narazĂte v 'podporovanĂŠ' hĹe. - - -3.1) Ochrana proti kopĂrovĂĄnĂ: ----- ------------------------- -TĂ˝m ScummVM nepodporuje pirĂĄtstvĂ. NicmĂŠnÄ existujĂ pĹĂpady, kdy hernĂ spoleÄnosti (jako LucasArts) sami ve svĂ˝ch hrĂĄch poskytujĂ 'cracknutĂŠ' -spouĹĄtÄÄe â v tÄchto pĹĂpadech datovĂŠ soubory obsahujĂ skripty pro ochranu proti kopĂrovĂĄnĂ, ale pĹevadÄÄ je obejde (toto mĹŻĹže podobnÄ provĂĄdÄt nelegĂĄlnÄ cracknutĂĄ verze, s tĂm rozdĂlem, Ĺže zde toto provedl vĂ˝robce hry. Neexistuje ŞådnĂ˝ zpĹŻsob, jak mĹŻĹžeme rozliĹĄit legitimnĂ a pirĂĄtskĂŠ datovĂŠ soubory, takĹže v hrĂĄch, o kterĂ˝ch vĂme, Ĺže byla nÄkdy prodĂĄvĂĄna cracknutĂĄ verze pĹŻvodnĂho pĹevadÄÄe bude ScummVM muset vĹždy ochranu pĹeskoÄit. - -V nÄkterĂ˝ch pĹĂpadech ScummVM pĹesto zobrazĂ obrazovku ochrany proti kopĂrovĂĄnĂ. Zkuste zadat jakoukoli odpovÄÄ. Je tu moĹžnost, Ĺže toto bude fungovat. - -ScummVM pĹeskakuje ochranu v nĂĄsledujĂcĂch hrĂĄch: - - * Beneath a Steel Sky - -- potlaÄeno s laskavĂ˝m svolenĂm Revolution Software. - * Dreamweb - -- seznam dostupnĂ˝ch pĹĂkazĹŻ v terminĂĄlech ve hĹe je nynĂ zobrazen - kdyĹž hrĂĄÄ pouĹžije pĹĂkaz 'help' - * Inherit the Earth: Quest for the Orb (Floppy version) - -- potlaÄeno s laskavĂ˝m svolenĂm Wyrmkeep Entertainment, - protoĹže byla potlaÄena ve vĹĄech vydĂĄnĂch hry na CD. - * Loom (EGA DOS) - * Maniac Mansion - * Monkey Island 2: LeChuck's Revenge - * Simon the Sorcerer 1 (Floppy version) - * Simon the Sorcerer 2 (Floppy version) - -- potlaÄeno s laskavĂ˝m svolenĂm from Adventure Soft, - protoĹže byla potlaÄena ve vĹĄech vydĂĄnĂch hry na CD. - * The Secret of Monkey Island (VGA) - * Waxworks - * Zak McKracken and the Alien Mindbenders - - -3.2) PoznĂĄmky ke hrĂĄm Commodore64: ----- ----------------------------- -Jak Maniac Mansion tak Zak McKracken mohou bĂ˝t spuĹĄtÄny, ale Maniac Mansion nenĂ jeĹĄtÄ hratelnĂ˝. JednoduĹĄe pojmenujte disky D64 jako -"maniac1.d64" a "maniac2.d64" nebo "zak1.d64" a "zak2.d64", pak by mÄl ScummVM automaticky hru zjistit, pokud ho odkĂĄĹžete na sprĂĄvnou sloĹžku. - -Nebo mĹŻĹžete pouĹžĂt 'extract_mm_c64' z balĂÄku nĂĄstrojĹŻ pro extrahovĂĄnĂ datovĂ˝ch souborĹŻ. Pak ale ScummVM hru ĹĂĄdnÄ automaticky nezjistĂ ScummVM, a musĂte se ujistit, Ĺže platforma je nastavena na Commodore64. DoporuÄujeme pouĹžĂt mnohem jednoduĹĄĹĄĂ postup popsanĂ˝ v pĹedchozĂm odstavci. - - -3.3) PoznĂĄmky ke Maniac Mansion NES: ----- ------------------------- -PodporovanĂŠ verze jsou BritskĂĄ angliÄtina (E), FrancouzĹĄtina (F), NÄmÄina (G), ItalĹĄtina (I), Ĺ vĂŠdĹĄtina (SW) a AmerickĂĄ angliÄtina (U). ScummVM pro spuĹĄtÄnĂ vyĹžaduje pouze ÄĂĄst PRG a ne celĂ˝ ROM. - -Abyste mohli hru spustit, musĂte vyjmout prvnĂch 16 bajtĹŻ z ROM, s kterĂ˝m pracujete. JakĂ˝koli hex editor bude fungovat, pokud mĹŻĹžete kopĂrovat/vklĂĄdat. PotĂŠ. Co ROM otevĹete pomocĂ hex editoru, zkopĂrujte vĹĄechno z druhĂŠho ĹĂĄdku (17. bajt) na konec. PotĂŠ, co toto provedete, vloĹžte ho do novĂŠho hex souboru. Pojmenujte ho "Maniac Mansion (XX).prg" kde XX znamenĂĄ verzi, se kterou pracujete (E, F, G, I, SW, nebo U). KoneÄnĂĄ velikost by mÄla bĂ˝t pĹesnÄ 262144 bajtĹŻ. - -Pokud hru pĹidĂĄvĂĄte ruÄnÄ, ujistÄte se, Ĺže platforma je nastavena na NES. - -NejbÄĹžnÄjĹĄĂ chyby, kterĂŠ zabraĹujĂ spuĹĄtÄnĂ hry: - - * Ĺ patnĂ˝ soubor - * ROM byl extrahovĂĄn pomocĂ nĂĄstrojĹŻ z verze 0.7.0 - * SnaĹžĂte se do ScummVM vklĂĄdat CELĂ ROM a ne jenom PRG ÄĂĄst. - -Je takĂŠ moĹžno extrahovat oddÄlenĂŠ soubory LFL z PRG ÄĂĄsti. Pro toto pouĹžijte nĂĄstroj 'extract_mm_nes' z balĂÄku nĂĄstrojĹŻ. - - -3.4) PoznĂĄmky ke hrĂĄm Macintosh: ----- --------------------------- -VĹĄechny adventury LucasArts zaloĹženĂŠ na SCUMM, kromÄ COMI, takĂŠ existujĂ ve verzĂch pro in Macintosh. ScummVM mĹŻĹže vÄtĹĄinu (vĹĄechny?) pouĹžĂt, nicmĂŠnÄ, v nÄkterĂ˝ch pĹĂpadech je nutnĂĄ dodateÄnĂĄ prĂĄce. NejdĹĂve, pokud pro toto nepouĹžĂvĂĄte Macintosh, pĹĂstup k datĹŻm na CD/disketÄ mĹŻĹže bĂ˝t obtĂĹžnĂ˝. DĹŻvodem je to, Ĺže Mac pouĹžĂvĂĄ zvlĂĄĹĄtnĂ formĂĄt disku nazvanĂ˝ HFS, kterĂ˝ ostatnĂ systĂŠmy vÄtĹĄinou nepodporujĂ. NicmĂŠnÄ existuje, nÄkolik nĂĄstrojĹŻ, kterĂŠ jsou zadarmo a umoĹžĹujĂ ÄĂst takovĂŠto svazky HFS. NapĹĂklad "HFVExplorer" pro Windows a "hfsutils" pro Linux a ostatnĂ UnixovĂŠ operaÄnĂ systĂŠmy. - -VÄtĹĄina novÄjĹĄĂch her na Macintosh je dodĂĄvĂĄna pouze s jednĂm datovĂ˝m souborem (v nÄkterĂ˝ch pĹĂpadech byl tento soubor uÄinÄn neviditelnĂ˝m, takĹže moĹžnĂĄ budete potĹebovat dodateÄnĂŠ nĂĄstroje, abyste ho mohli zkopĂrovat). ScummVM je schopen takovĂ˝to soubor pouĹžĂt pĹĂmo; jednoduĹĄe odkaĹžte ScummVM na sloĹžku obsahujĂcĂ tento soubor a mÄlo by to fungovat (tak jako s kaĹždou podporovanou hrou). - -V balĂÄku nĂĄstrojĹŻ takĂŠ poskytujeme nĂĄstroj nazvanĂ˝ 'extract_scumm_mac', kterĂ˝ extrahuje data z tÄchto datovĂ˝ch souborĹŻ, ale toto nenĂ ani potĹeba, ani doporuÄeno. - -Pro dalĹĄĂ informace o kopĂrovĂĄnĂ hernĂch souborĹŻ Macintosh na VĂĄĹĄ pevnĂ˝ disk si prohlĂŠdnÄte: - - http://wiki.scummvm.org/index.php/HOWTO-Mac_Games - - -3.5) PoznĂĄmky ke hrĂĄm Multi-CD: ----- -------------------------- -ObecnÄ ScummVM moc dobĹe nefunguje s hrami na Multi-CD. To je proto, Ĺže ScummVM pĹedpoklĂĄdĂĄ, Ĺže vĹĄechno o hĹe mĹŻĹže bĂ˝t nalezeno v jednĂŠ sloĹžce. I kdyĹž ScummVM mĂĄ schopnost poŞådat uĹživatele, aby vymÄnil CD, pĹŻvodnĂ spouĹĄtÄÄ souboru vÄtĹĄinou nainstaluje malĂŠ mnoĹžstvĂ souborĹŻ na pevnĂ˝ disk. Pokud tyto soubory nelze najĂt na vĹĄech CD, ScummVM bude mĂt potĂĹže. - -NaĹĄtÄstĂ mĹŻĹže ScummVM hry bez problĂŠmĹŻ spouĹĄtÄt pĹĂmo z pevnĂŠho disku, pokud vytvoĹĂte sloĹžku se sprĂĄvnou kombinacĂ souborĹŻ. VÄtĹĄinou, kdyĹž se soubor objevĂ na vĂce, neĹž jednom CD mĹŻĹžete vybrat jeden z nich. - - -3.6) PoznĂĄmky k The Curse of Monkey Island: ----- -------------------------------------- -Pro tuto hru budete potĹebovat soubory comi.la0, comi.la1 a comi.la2. -Soubor comi.la0 mĹŻĹžete nalĂŠzt na vĹĄech CD hry, ale protoĹže jsou stejnĂŠ, mĹŻĹžete pouĹžĂt kterĂ˝koli z nich. - -DĂĄle potĹebujete vytvoĹit podsloĹžku "resource" obsahujĂcĂ vĹĄechny soubory z âobou- podsloĹžek "resource" na dvou CD. NÄkterĂŠ soubory se objevujĂ na obou CD, ale znovu jsou stejnĂŠ. - - -3.7) PoznĂĄmky ke hrĂĄm Broken Sword: ----- ------------------------------ -Pokyny pro hry Broken Sword jsou pro verze od Sold-Out Software, kde kaĹždĂĄ hra je na dvou CD, protoĹže tyto verze byly nejdostupnÄjĹĄĂ v dobÄ, kdy je ScummVM zaÄal podporovat. DoufĂĄme, Ĺže jsou dostateÄnÄ obecnĂŠ pro pouĹžitĂ i v jinĂ˝ch vydĂĄnĂch her. - - -3.7.1) Videa z her Broken Sword: ------- ------------------------- -Videa pro hry Broken Sword majĂ v sobÄ trochu historie (viz dalĹĄĂ oddĂl, pokud jste zvÄdavĂ), ale obecnÄ jedinĂŠ, co potĹebujete udÄlat, je zkopĂrovat soubory .SMK ze sloĹžek "SMACKS" nebo "SMACKSHI" na CD do stejnĂŠ sloĹžky jako ostatnĂ datovĂŠ soubory hry. (Broken Sword mĂĄ takĂŠ sloĹžku "SMACKSLO" se stejnĂ˝mi videi, ale ty jsou niŞťà kvality.) MĹŻĹžete je umĂstit do podsloĹžky s nĂĄzvem "video", pokud VĂĄm to pĹijde hezÄĂ. - -Ve verzĂch pro PlayStation, mĹŻĹžete pĹŻvodnĂ videa vypsat z disku. KaĹždĂ˝ soubor, kterĂ˝ mĂĄ pĹĂponu "STR", byste mÄli vypsat jako *Äist* sektory z disku (vĹĄech 2352 bajtĹŻ na sektor). MĹŻĹžete takĂŠ mĂst toho pouĹžĂt pĹeformĂĄtovanĂĄ videa, kterĂĄ jsou zmĂnÄna nĂĹže, ale to nebude fungovat pro vĹĄechny videa v Broken Sword II. Pro vĂce informacĂ si prohlĂŠdnÄte: - - http://wiki.scummvm.org/index.php/HOWTO-PlayStation_Videos - -NÄkterĂĄ vydĂĄnĂ hry, a takĂŠ verze pro PlayStation, Smacker videa nemajĂ. Revolution Software nĂĄm laskavÄ dovolilo poskytovat pĹeformĂĄtovanĂĄ videa ke staĹženĂ na naĹĄĂ strĂĄnce: - - http://www.scummvm.org/downloads.php - -Tato videa jsou poskytovĂĄna ve formĂĄtu DXA se zvukem ve formĂĄtu FLAC. Jejich kvalita se rovnĂĄ originĂĄlu dĂky pouĹžitĂ bezztrĂĄtovĂŠ komprese. ZobrazenĂ tÄchto videĂ vyĹžaduje, aby verze ScummVM byla sestavena s podporou FLAC i zlib. - -Pro systĂŠmy, kterĂŠ jsou pĹĂliĹĄ pomalĂŠ, aby zvlĂĄdli dekĂłdovat formĂĄt FLAC byl zvuk videĂ takĂŠ poskytnut oddÄlenÄ ve formĂĄtu OGG Vorbis audio. Toto vyĹžaduje, aby verze ScummVM byla sestavena s podporou libVorbis a zlib. - -Pro Broken Sword takĂŠ poskytujeme pĹĂdavek pro titulky. JednoduĹĄe ho rozbalte a nĂĄsledujte pokyny v souboru readme.txt. BalĂÄek v souÄasnosti nefunguje ve videĂch na PlayStation. (Broken Sword II jiĹž titulky mĂĄ; nenĂ tĹeba dalĹĄĂ prĂĄce pro jejich pĹidĂĄnĂ.) - - -3.7.2) Videa her Broken Sword ve zpÄtnĂŠm pohledu: ------- ------------------------------------------ -PĹŻvodnĂ vydĂĄnĂ her Broken Sword pouĹžĂvalo formĂĄt Smacker⢠od RAD Game Tools. ProtoĹže spoleÄnost RAD nebyla ochotna nĂĄm otevĹĂt starĹĄĂ zastaralĂŠ verze tohoto formĂĄtu a poŞådala, abychom neprovĂĄdÄli jeho zpÄtnou analĂ˝zu, museli jsme nalĂŠzt jinĂŠ ĹeĹĄenĂ. - -V Broken Sword II bylo moĹžnĂŠ pĹehrĂĄt ĹeÄ, aniĹž by se muselo pĹehrĂĄvat video. To zĹŻstalo jako nouzovĂŠ ĹeĹĄenĂ aĹž do ScummVM 1.0.0, ale pro vĹĄechny stabilnĂ verze to nikdy nebylo jedinĂŠ ĹeĹĄenĂ. - -Ve ScummVM 0.6.0 jsme pouĹžĂvali MPEG, coĹž zajistilo rozumnĂ˝ kompromis mezi velikostĂ a kvalitou. Ve ScummVM 0.10.0 bylo toto nahrazeno DXA -(pĹŻvodnÄ pĹidĂĄno pro "The Feeble Files" od AdventureSoft). To nĂĄm dalo moĹžnost zajistit videa ve stejnĂŠ kvalitÄ jako pĹŻvodnĂ, za cenu vÄtĹĄĂ velikosti. - -Nakonec na zaÄĂĄtku roku 2006 byl formĂĄt Smacker zpÄtnÄ analyzovĂĄn pro projekt FFmpeg. DĂky jejich tvrdĂŠ prĂĄci ScummVM 1.0.0 nynĂ podporuje pĹŻvodnĂ videa. ZĂĄroveĹ byla ukonÄena podpora MPEG. Z technickĂŠho hlediska je toto dobĹe, protoĹže pĹehrĂĄvĂĄnĂ videĂ MPEG bylo velmi sloĹžitĂŠ a stejnÄ nevypadaly tak dobĹe jako verze ve formĂĄtu DXA a Smacker. - - -3.7.3) Broken Sword: ------- ------------- -Pro tuto hru budete potĹebovat vĹĄechny soubory ze seskupenĂ sloĹžek na obou CD. Pro verze Windows a Macintosh budete takĂŠ potĹebovat soubory speech.clu ze sloĹžek speech, ale protoĹže soubory nejsou stejnĂŠ, budete je muset pĹejmenovat na speech1.clu a speech2.clu z CD 1 a 2 v tomto poĹadĂ. Verze na PlayStation vyĹžaduje speech.tab, speech.dat, speech.lis, a speech.inf. - -DĂĄle verze pro Windows a Macintosh vyĹžadujĂ podsloĹžku music se vĹĄemi soubory z podsloĹžek music na obou CD. NÄkterĂŠ z tÄchto souborĹŻ se objevujĂ na obou CD, ale v tÄchto pĹĂpadech jsou buÄ stejnĂŠ, nebo, v jednom pĹĂpadÄ, je tĂŠmÄĹ stejnĂ˝, Ĺže to nemĂĄ ŞådnĂ˝ vĂ˝znam. Verze pro PlayStation vYĹžaduje tunes.dat a tunes.tab. - - -3.7.4) Broken Sword II: ------- ---------------- -Pro tuto hru budete potĹebovat vĹĄechny soubory ze seskupenĂ sloĹžek na obou CD. (Abych pravdu Ĺekl, pĂĄr z nich nemusĂ bĂ˝t nezbytnÄ nutnĂŠ, ale ty, o kterĂ˝ch nemĂĄm jistotu, jsou velmi malĂŠ.) -Je takĂŠ tĹeba pĹejmenovat soubory speech.clu a music.clu na speech1.clu, -speech2.clu, music1.clu a music2.clu, aby ScummVM mohl zjistit, kterĂŠ jsou z CD 1 a kterĂŠ z CD 2. VĹĄechny ostatnĂ soubory, kterĂŠ jsou umĂstÄny v seskupenĂ sloĹžek, jsou stejnĂŠ. PouĹžijte kterĂŠkoli soubory chcete. - -KromÄ toho budete potĹebovat soubory cd.inf a, pĹĂpadnÄ, startup.inf ze sloĹžky sword2 na CD 1. - - -3.8) PoznĂĄmky k Beneath a Steel Sky: ----- ------------------------------- -Od ScummVM 0.8.0 potĹebujete dodateÄnĂ˝ soubor 'SKY.CPT', abyste mohli Beneath a Steel Sky spustit. - -Tento soubor je dostupnĂ˝ na strĂĄnce 'Downloads' domovskĂŠ strĂĄnky ScummVM. -MĹŻĹžete ho umĂstit buÄ do sloĹžky obsahujĂcĂ ostatnĂ datovĂŠ soubory (SKY.DNR, SKY.DSK), na VaĹĄi dodateÄnou cestu, nebo do sloĹžky. Kde se nachĂĄzĂ spouĹĄtÄcĂ soubor ScummVM. - - -3.9) PoznĂĄmky k Flight of the Amazon Queen: ----- -------------------------------------- -Abyste mohli pouĹžĂt tu verzi, kterĂĄ nenĂ volnÄ ĹĄiĹitelnĂĄ -(z pĹŻvodnĂho CD), musĂte mĂt soubor 'queen.tbl' -(dostupnĂ˝ ze strĂĄnky 'Downloads' naĹĄĂ domovskĂŠ strĂĄnky) a umĂstit ho buÄ do sloĹžky obsahujĂcĂ soubor hry 'queen.1', na VaĹĄi dodateÄnou cestu, nebo do sloĹžky. Kde se nachĂĄzĂ spouĹĄtÄcĂ soubor ScummVM. - -TakĂŠ mĹŻĹžete pouĹžĂt nĂĄstroj 'compress_queen' z balĂÄku nĂĄstrojĹŻ pro 'znovu sestavenĂ' VaĹĄeho datovĂŠho souboru FOTAQ pro zahrnutĂ tabulky pro tuto konkrĂŠtnĂ verzi, ÄĂmĹž odstranĂte zĂĄvislost na soubor 'queen.tbl' pĹi spuĹĄtÄnĂ. Tento nĂĄstroj VĂĄm takĂŠ umoĹžĹuje komprimovat ĹeÄ a zvukovĂŠ efekty do formĂĄtu MP3, OGG nebo FLAC. - - -3.10) PoznĂĄmky ke Gobliiins: ------ ---------------------- -CD verze sĂŠrie Gobliiins obsahuje jednu velkou zvukovou stopu, kterou potĹebujete vyjmout (viz oddĂl o pouĹžitĂ komprimovanĂ˝ch zvukovĂ˝ch souborĹŻ) a zkopĂrovat ji do hernĂ sloĹžky, pokud chcete ve hĹe hudbu, aniĹž byste museli CD mĂt stĂĄle v jednotce. V tĂŠto stopÄ jsou takĂŠ ĹeÄ a jejĂ hlasitost se tedy takĂŠ mÄnĂ podle hlasitosti hudby. - - -3.11) PoznĂĄmky k Inherit the Earth: Quest for the Orb: ------ ------------------------------------------------ -Abyste mohli spustit verzi pro Mac OS X od Wyrmkeep musĂte data zkopĂrovat z CD na VĂĄĹĄ pevnĂ˝ disk. Pokud pouĹžĂvĂĄte PC, pak se podĂvejte na: - - http://wiki.scummvm.org/index.php/HOWTO-Mac_Games - -I kdyĹž se v tomto ÄlĂĄnku pĂĹĄe hlavnÄ o hrĂĄch SCUMM, je zde takĂŠ zmĂnÄn nĂĄstroj "HFVExplorer", kterĂ˝ potĹebujete k extrakci souborĹŻ. NezapomeĹte, Ĺže data ĹeÄi "Inherit the Earth Voices" musĂte umĂstit do stejnĂŠho adresĂĄĹe, kde jsou uloĹžena data hry: - - Inherit the Earth.app/Contents/Resources - -Ve starĂŠ verzi pro Mac OS 9 potĹebujete soubory zkopĂrovat ve formĂĄtu MacBinary, protoĹže by mÄli obsahovat jak zdrojovĂŠ, tak datovĂŠ vidlice. ZkopĂrujte vĹĄechny soubory 'ITE *'. - - -3.12) PoznĂĄmky k Simon the Sorcerer 1 a 2: ------ ------------------------------------ -Pokud mĂĄte dvojitou verzi Simon the Sorcerer 1 nebo 2 na CD, verzi pro Windows naleznete v hlavnĂ sloĹžce na CD a verzi pro DOS ve sloĹžce DOS na CD. - - -3.13) PoznĂĄmky k The Feeble Files: ------ ---------------------------- -Pokud mĂĄte verzi pro Windows, je tĹeba si uvÄdomit pĂĄr vÄcĂ. - -Mnoho souborĹŻ, kterĂŠ hra vyĹžaduje, je uloĹženo v souboru InstallShield s nĂĄzvem data1.cab, kterĂ˝ ScummVM nemĹŻĹže rozbalit. Budete muset pouĹžĂt pĹŻvodnĂ instalĂĄtor, nebo i5comp pro rozbalenĂ obsahu tohoto souboru. NĂĄstroj pro dekomprimaci i5comp mĹŻĹže bĂ˝t nalezen pĹi hledĂĄnĂ na internetu. - -Abyste mohli pouĹžĂt soubory s ĹeÄĂ ve ScummVM, musĂ bĂ˝t pĹejmenovĂĄny nĂĄsledovnÄ: -PĹejmenovat voices.wav na CD1 na voices1.wav -PĹejmenovat voices.wav na CD2 na voices2.wav -PĹejmenovat voices.wav na CD3 na voices3.wav -PĹejmenovat voices.wav na CD4 na voices4.wav - -3.14) PoznĂĄmky k The Legend of Kyrandia: ------ ---------------------------------- -Abyste mohli spustit The Legend of Kyrandia ve ScummVM potĹebujete soubor 'kyra.dat'. -Soubor by mÄl bĂ˝t vĹždykcy souÄĂĄstĂ oficiĂĄlnĂch balĂÄkĹŻ ScummVM. V pĹĂpadÄ, Ĺže ScummVM -hlĂĄsĂ, Ĺže soubor chybĂĄ, mĹŻĹžete ho najĂt na strĂĄnce ScummVM v sekci 'Downloads'. -NezapomeĹte, Ĺže souÄasnĂĄ verze ScummVM pro Windows by mÄla soubor obsahovat ve spouĹĄtÄÄi a tudĂĹž ho -musĂte mĂt pouze, kdyĹž ScummVM soubor nemĹŻĹže nalĂŠzt. - -3.15) PoznĂĄmky k PĹedvĂdavĂŠmu VstupnĂmu Dialogu her Sierra AGI: ------ --------------------------------------------------------- -PĹedvĂdavĂ˝ VstupnĂ Dialog je pomĹŻcka ScummVM pro spouĹĄtÄnĂ her pouĹžĂvajĂcĂ jĂĄdro AGI (kterĂ˝ je znĂĄm, Ĺže vyĹžaduje vstup z pĹĂkazovĂŠ ĹĂĄdky) na zaĹĂzenĂch s omezenou podporou klĂĄvesnice. V tÄchto situacĂch, kdy zadĂĄvĂĄnĂ pomocĂ emulovanĂŠ klĂĄvesnice je dosti ĂşnavnĂŠ, mĹŻĹžou bĂ˝t pĹĂkazy rychle a snadno zadĂĄny pomocĂ PĹedvĂdavĂŠho VstupnĂho Dialogu. - -Abyste zapnuli pĹedvĂdavĂ˝ vstup v hrĂĄch AGI, potĹebujete zkopĂrovat soubor pred.dic do dodateÄnĂŠ sloĹžky ScummVM nebo do sloĹžky hry, kterou chcete hrĂĄt. Tento slovnĂk byl vytvoĹen analĂ˝zou vĹĄech znĂĄmĂ˝ch her AGI a obsahuje maximĂĄlnĂ sadu bÄĹžnĂ˝ch slov. - -Pokud je slovnĂk zjiĹĄtÄn, je PĹedvĂdavĂ˝ VstupnĂ Dialog zobrazen buÄ pĹi klinutĂ na oblast pĹĂkazovĂŠho ĹĂĄdku (kdykoliv je poĹžadovĂĄn vstup klĂĄvesnice, i v rĂĄmeÄcĂch dialogovĂ˝ch oken), nebo v nÄkterĂ˝ch verzĂch pro jinĂŠ systĂŠmy stisknutĂm urÄenĂŠ klĂĄvesovĂŠ zkratky. - -PĹedvĂdavĂ˝ VstupnĂ Dialog pracuje ve tĹech reĹžimech, kterĂŠ jsou pĹepĂnĂĄny tlaÄĂtkem (*)Pre/123/Abc. HlavnĂ vstupnĂ metodou je pĹedvĂdavĂ˝ reĹžim -(Pre), kterĂ˝ pĹipomĂnĂĄ "rychlĂŠ zadĂĄvĂĄnĂ" v mobilnĂch telefonech. -Abeceda je rozdÄlena do 9 sad, kterĂŠ pĹirozenÄ odpovĂdajĂ 9 klĂĄvesĂĄm ÄĂselnĂŠ klĂĄvesnice (0 je mezera). Pro psanĂ slova zmĂĄÄknÄte jednou ÄĂslo sady, kterĂĄ obsahuje pĂsmeno slova, kterĂŠ chcete napsat, pak pokraÄujete k dalĹĄĂmu. NapĹĂklad, pokud chcete napsat pĹĂkaz 'look', mÄli byste zmĂĄÄknout 5665. Jak postupnÄ pĂĹĄete ÄĂselnĂ˝ kĂłd zamýťlenĂŠho slova, je slovnĂk prohledĂĄvĂĄn pro znĂĄmĂĄ slova, kterĂĄ se shodujĂ s VaĹĄĂm vstupem aĹž do tohoto bodu. Jak maÄkĂĄte vĂce klĂĄves, slovnĂk se pĹiblĂŞà ke sprĂĄvnĂŠmu slovu. To je dĹŻvod, proÄ vypsanĂŠ slovo se mĹŻĹže nĂĄhle zmÄnit mezi stisky klĂĄves. NÄkdy se ale vyskytnou pĹĂpady, kdy vĂce neĹž jedno slovo mĂĄ stejnĂŠ ÄĂselnĂŠ zastoupenĂ. NapĹĂklad slova 'quit' a 'suit' odpovĂdajĂ stejnĂ˝m ÄĂslĹŻm, a to 7848. V tÄchto pĹĂpadech se rozsvĂtĂ tlaÄĂtko dalĹĄĂ -(#). Jeho stisknutĂm mĹŻĹžete prochĂĄzet seznam slov, kterĂĄ sdĂlejĂ stejnĂ˝ kĂłd a nakonec pĹijmout to sprĂĄvnĂŠ stisknutĂm (0)mezera nebo tlaÄĂtka Ok. - -Druhou vstupnĂ metodou (123) je ÄĂselnĂ˝ vstup: KaĹždou klĂĄvesu, kterou stisknÄte, je doslova zadĂĄna jako ÄĂslo. - -TĹetĂ vstupnĂ metodou (Abc) je vstupnĂ reĹžim Alfa/opakovanĂŠho stisknutĂ tlaÄĂtka. Tento reĹžim je urÄen pro zadĂĄvĂĄnĂ textu bez pomoci od slovnĂku pĹedvĂdavĂŠho reĹžimu (Pre). Text je zadĂĄvĂĄn po jednotlivĂ˝ch pĂsmenech. Pro kaĹždĂŠ pĂsmeno nejdĹĂve stisknÄte ÄĂslo sady, kterĂŠ obsahuje pĂsmeno, kterĂŠ chcete, pak pouĹžijte tlaÄĂtko dalĹĄĂ (#) pro prochĂĄzenĂ pĂsmeny a opakujte s dalĹĄĂm ÄĂslem. NapĹĂklad, pro zadĂĄnĂ slova 'look' musĂte stisknout nĂĄsledujĂcĂ: 5##6##6##5# - -DialogovĂŠ okno je plnÄ pouĹžitelnĂŠ pomocĂ myĹĄi, ale v nÄkterĂ˝ch verzĂch ScummVM pro jinĂŠ platformy, je pouĹžitĂ dialogu pohodlnÄjĹĄĂ pomocĂ ÄĂselnĂŠ klĂĄvesnice. NÄkterĂĄ tlaÄĂtka dialogu mohou bĂ˝t takĂŠ pouĹžĂvĂĄna pomocĂ ĹĄipkovĂ˝ch klĂĄves a enter. - - -3.16) PoznĂĄmky k Mickey's Space Adventure: ------ ------------------------------------ -Abyste mohli Mickey's Space Adventure hrĂĄt ve ScummVM, potĹebujete spolu s datovĂ˝mi soubory hry takĂŠ pĹŻvodnĂ spouĹĄtÄÄ (mickey.exe). - -Pro tuto hru ve ScummVM, existuje rozĹĄĂĹenĂĄ podpora myĹĄi, i kdyĹž v pĹŻvodnĂ hĹe takovĂĄto podpora nebyla. PoloĹžky menu mohou bĂ˝t vybrĂĄny pomocĂ myĹĄi a je takĂŠ moĹžnĂŠ se myĹĄĂ pĹesunout do jinĂ˝ch mĂst. KdyĹž se kurzor myĹĄi nachĂĄzĂ na okraji obrazovky, zÄervenĂĄ, pokud je moĹžnĂŠ jĂt v tomto smÄru. HrĂĄÄ pak mĹŻĹže jednoduĹĄe kliknout na okraje hernĂ obrazovky pro zmÄnu mĂsta, podobnÄ jako mnoho adventur, coĹž je jednoduĹĄĹĄĂ a pĹĂmoÄaĹejĹĄĂ neĹž pohyb pomocĂ menu. - - -3.17) Winnie the Pooh notes: ------ ---------------------- -Je moĹžnĂŠ importovat uloĹženĂŠ hry z pĹŻvodnĂ hry do ScummVM. - -Pro tuto hru ve ScummVM, existuje rozĹĄĂĹenĂĄ podpora myĹĄi, i kdyĹž v pĹŻvodnĂ hĹe takovĂĄto podpora nebyla. PoloĹžky menu mohou bĂ˝t vybrĂĄny pomocĂ myĹĄi a je takĂŠ moĹžnĂŠ se myĹĄĂ pĹesunout do jinĂ˝ch mĂst. KdyĹž se kurzor myĹĄi nachĂĄzĂ na okraji obrazovky, zÄervenĂĄ, pokud je moĹžnĂŠ jĂt v tomto smÄru. HrĂĄÄ pak mĹŻĹže jednoduĹĄe kliknout na okraje hernĂ obrazovky pro zmÄnu mĂsta, podobnÄ jako mnoho adventur, coĹž je jednoduĹĄĹĄĂ a pĹĂmoÄaĹejĹĄĂ neĹž pohyb pomocĂ menu. - - -3.18) PoznĂĄmky k Troll's Tale: ------ ------------------------ -PĹŻvodnĂ hra vychĂĄzela na zavĂĄdÄcĂm disku PC, proto je nutnĂŠ vypsat obsah tohoto disku jako obraz disku a pĹejmenovat ho na "troll.img", abyste tuho hru mohli hrĂĄt ve ScummVM. - - -3.19) PoznĂĄmky k DraÄĂ Historie: ------ -------------------------- -ExistujĂ 4 jazykovĂŠ varianty tĂŠto hry: ÄeskĂĄ, anglickĂĄ, polskĂĄ a -nÄmeckĂĄ. KaĹždĂĄ je umĂstÄna v oddÄlenĂŠm archivu. JedinĂĄ oficiĂĄlnĂ verze je ÄeskĂĄ, a anglickĂĄ, polskĂĄ a nÄmeckĂĄ byly vĹždycky nedokonÄenĂŠ prĂĄce a nikdy nebyly oficiĂĄlnÄ vydĂĄny. I kdyĹž texty byly zcela pĹeloĹženy, je znĂĄmo, Ĺže nÄkterĂŠ z nich obsahujĂ pĹeklepy. - -Pro tuto hru existuje nepovinnĂ˝ ÄeskĂ˝ dabing. Z dĹŻvodu velikosti si ho mĹŻĹžete dodateÄnÄ stĂĄhnout a pak ho rozbalit do adresĂĄĹe hry. MĹŻĹžete takĂŠ ÄeskĂ˝ dabing poslouchat se vĹĄemi jazykovĂ˝mi varianty hry, zatĂmco Ätete titulky. - -VĹĄechny hernĂ soubory a nĂĄvody mĹŻĹžou bĂ˝t stĂĄhnuty z -http://www.ucw.cz/draci-historie/index-en.html - - -3.20) ZnĂĄmĂŠ ProblĂŠmy: ------ --------------- -Toto vydĂĄnĂ mĂĄ nĂĄsledujĂcĂ znĂĄmĂŠ problĂŠmy. NenĂ tĹeba je ohlaĹĄovat, i kdyĹž zĂĄplaty pro jejich opravu jsou vĂtĂĄny. Pokud objevĂte chybu, kterĂĄ nenĂ zde v seznamu, ani nenĂ v seznamu kompatibility na internetovĂŠ strĂĄnce, prohlĂŠdnÄte si, prosĂm, ÄĂĄst o hlĂĄĹĄenĂ chyb. - - Hry CD Audio: -- PĹi hranĂ her, kterĂŠ pouĹžĂvajĂ CD Audio (hry FM-TOWNS, Loom CD, atd) mĹŻĹže u uĹživatelĹŻ Microsoft Windows 2000/XP dochĂĄzet k nĂĄhodnĂ˝m pĂĄdĹŻm. To je dĂky dlouhotrvajĂcĂ chybÄ Windows, kterĂĄ mĂĄ za nĂĄsledek poĹĄkozenĂŠ soubory pĹi ÄtenĂ z CD. Abyste se tomuto vyhnuli, zkopĂrujte, prosĂm, soubory na pevnĂ˝ disk - - Verze FM-TOWNS: -- Verze KandĹži vyĹžaduje ROM pĂsma FM-TOWNS - - Loom: -- VypnutĂ titulkĹŻ pomocĂ souboru nastavenĂ je nevypne spolehlivÄ, protoĹže skripty Loom je znovu automaticky zapnou -- Podpora MIDI ve verzi EGA vyĹžaduje aktualizaci Roland LucasArts -- Verze KandĹži na PC-Engine vyĹžaduje rom systĂŠmovĂŠ karty - - The Secret of Monkey Island: -- Podpora MIDI ve verzi EGA vyĹžaduje aktualizaci Roland LucasArts - - Beneath a Steel Sky: -- Verze pro Amiga nejsou podporovĂĄny -- Demoverze z diskety nejsou podporovĂĄny -- NenĂ chyba: Ve verzi na CD chybĂ v jistĂ˝ch dialozĂch ĹeÄ, to je normĂĄlnĂ. - - Elvira - Mistress of the Dark -- Ve verzi pro Atari ST nefunguje hudba - - Elvira II - The Jaws of Cerberus -- Ve verzi pro Atari ST nefunguje hudba - -- Ve verzi pro PC nefungujĂ zvukovĂŠ efekty -- Ve verzi pro Atari ST jsou problĂŠmy s paletou - - Inherit the Earth: Quest for the Orb -- Verze pro Amiga nejsou podporovĂĄny - - Simon the Sorcerer 1: -- V anglickĂ˝ch a nÄmeckĂ˝ch verzĂch na CD nejsou titulky dostupnĂŠ, protoĹže jim vÄtĹĄina titulkĹŻ chybĂ. - - Simon the Sorcerer 2: -- Kombinace ĹeÄi a titulkĹŻ Äasto zpĹŻsobĂ, Ĺže ĹeÄ je pĹeruĹĄena brzo, toto je omezenĂ pĹŻvodnĂ hry. -- Ve verzĂch pro Amiga a Macintosh je podporovĂĄn pouze vĂ˝chozĂ jazyk datovĂ˝ch souborĹŻ (angliÄtina). - - Simon the Sorcerer's Puzzle Pack: -- ŽådnĂĄ podpora pro zobrazovĂĄnĂ, zadĂĄvĂĄnĂ, uklĂĄdĂĄnĂ, Äi naÄĂtĂĄnĂ nejvyĹĄĹĄĂch skĂłre. -- ŽådnĂĄ podpora pro zobrazovĂĄnĂ nĂĄzvĹŻ poloĹžek, kdyĹž na nÄ najedete myĹĄĂ ve Swampy Adventures. - - The Feeble Files: -- Titulky jsou Äasto nedokonÄenĂŠ. V pĹŻvodnĂ hĹe byly vĹždy zakĂĄzĂĄny. - - The Legend of Kyrandia: -- Ve verzĂch na disketÄ pro Mac nenà ŞådnĂĄ hudba ani zvukovĂŠ efekty. -- CD Macintosh pouĹžĂvĂĄ zahrnutou hudbu a zvukovĂŠ efekty z DOS. - - Hry Humongous Entertainment: - - Pouze pĹŻvodnĂ rozhranĂ pro uloĹženĂ a naÄtenĂ mohou bĂ˝t pouĹžity. - - ŽådnĂĄ podpora pro hru vĂce hrĂĄÄĹŻ nebo tisknutĂ obrĂĄzkĹŻ - -4.0) PodporovanĂŠ Platformy: ----- ---------------------- -ScummVM byl vytvoĹen tak, aby mohl fungovat na mnoha platformĂĄch a operaÄnĂch systĂŠmech. -Odkazy na tyto verze mĹŻĹžou bĂ˝t nalezeny buÄ na strĂĄnkĂĄch ScummVM nebo vyhledĂĄvĂĄnĂm na internetu. Mnoho dĂkĹŻ naĹĄim programĂĄtorĹŻm za jejich ĂşsilĂ. Pokud mĂĄte verzi ScummVM pro jinou platformu/systĂŠm a chcete ho odevzdat do hlavnĂho ĂşloĹžiĹĄtÄ, nevĂĄhejte nĂĄs kontaktovat! - -PodporovanĂŠ platformy zahrnujĂ (mimo jinĂŠ): - - UNIX (Linux, Solaris, IRIX, *BSD, ...) - Windows - Windows CE a Windows Mobile (vÄetnÄ SmartphonĹŻ a PocketPCs) - Mac OS X - AmigaOS - Android - BeOS - Dreamcast - GP2x - iPhone (vÄetnÄ iPod Touch a iPad) - Maemo (Nokia Internet tablet N810) - Nintendo 64 - Nintendo DS - Nintendo GameCube - Nintendo Wii - OS/2 - PlayStation 2 - PlayStation Portable - Symbian - WebOS - -Verze pro Dreamcast nepodporuje The Curse of Monkey Island, ani The Dig. Verze pro Nintendo DS nepodporuje Full Throttle, The Dig, nebo The Curse of Monkey Island. -Pro dalĹĄĂ omezenĂ v zĂĄvislosti na platformÄ se, prosĂm, podĂvejte na naĹĄĂ Wiki: - http://wiki.scummvm.org/index.php/Platforms - -Ve verzi pro Macintosh je stisknutĂ pravĂŠho tlaÄĂtka myĹĄi emulovĂĄno pomocĂ Cmd-kliknutĂ (to je, Ĺže stisknete tlaÄĂtko myĹĄi pĹi drĹženĂ klĂĄvesy -Command/Apple/Vrtule). - -TakĂŠ existujĂ neoficiĂĄlnĂ verze pro rĹŻznĂŠ platformy, vÄetnÄ PlayStation 3, Xbox, a Xbox 360. NezapomeĹte, Ĺže my jsme tyto verze nevytvoĹili, takĹže je nemĹŻĹžeme ani schvĂĄlit ani podporovat. PouĹžĂvejte na vlastnĂ riziko! - - -5.0) SpuĹĄtÄnĂ ScummVM: ----- ----------------- -VĹĄimnÄte si prosĂm, Ĺže ScummVM bude uloĹženĂŠ hry standardnÄ uklĂĄdat do sloĹžky z kterĂŠ je spuĹĄtÄn, takĹže byste se mÄli vyhnout jeho spouĹĄtÄnĂ z vĂce umĂstÄnĂ. DalĹĄĂ informace, vÄetnÄ jak urÄit sloĹžku pro uloĹženĂŠ hry pro zamezenĂ tohoto problĂŠmu, najdete v oddĂlu 6.0. - -ScummVM mĹŻĹže bĂ˝t takĂŠ spuĹĄtÄn pĹĂmo pomocĂ spouĹĄtÄcĂho souboru. V tomto pĹĂpadÄ bude aktivovĂĄn zabudovanĂ˝ spouĹĄtÄÄ. OdsuÄ mĹŻĹžete pĹidat hry -(kliknÄte na 'PĹidat hru'), nebo spustit ty, co uĹž jsou nastaveny. -Hry mohou bĂ˝t takĂŠ pĹidĂĄny ve velkĂŠm mnoĹžstvĂ. StisknutĂm shift + 'PĹidat -Hru' (VĹĄimnÄte si, Ĺže se tlaÄĂtko zmÄnĂ na 'HromadnĂŠ PĹidĂĄnĂ'), mĹŻĹžete zvolit sloĹžku, v kterĂŠ zaÄĂt, a ScummVM se potĂŠ pokusĂ zjistit hry ve vĹĄech podsloĹžkĂĄch tĂŠto sloĹžky. - -ScummVM mĹŻĹže takĂŠ hru spustit pĹĂmo pomocĂ argumentĹŻ pĹĂkazovĂŠ ĹĂĄdky -- viz dalĹĄĂ ÄĂĄst. - - -5.1) MoĹžnosti pĹĂkazovĂŠho ĹĂĄdku: ----- --------------------------- - - PouĹžitĂ: scummvm [MOĹ˝NOSTI]... [HRA] - - [HRA] KrĂĄtkĂŠ jmĂŠno hry pro naÄtenĂ. NapĹĂklad 'monkey'pro Monkey Island. To mĹŻĹže bĂ˝t buÄ id hry, nebo uĹživatelem urÄenĂ˝ cĂl. - -v, --version ZobrazĂ informace o verzi ScummVM a ukonÄĂ se - -h, --help ZobrazĂ struÄnou nĂĄpovÄdu a ukonÄĂ se - -z, --list-games ZobrazĂ seznam podporovanĂ˝ch her a ukonÄĂ se - -t, --list-targets ZobrazĂ seznam nastavenĂ˝ch cĂlĹŻ a ukonÄĂ se - --list-saves=CĂL ZobrazĂ seznam uloĹž. her pro urÄenou hru (CĂL) - --console PovolĂ okno konzole (vĂ˝chozĂ: zapnuto) (Pouze pro Windows) - -c, --config=NastavenĂ PouĹžije jinĂ˝ soubor s nastavenĂm - -p, --path=CESTA Cesta, kde je hra nainstalovĂĄna - -x, --save-slot[=ÄĂSLO] Pozice uloĹženĂŠ hry pro naÄtenĂ (vĂ˝chozĂ: automatickĂĄ) - -f, --fullscreen Vynutit reĹžim celĂŠ obrazovky - -F, --no-fullscreen Vynutit reĹžim do okna - -g, --gfx-mode=REĹ˝IM Vybere reĹžim obrazu (viz takĂŠ ÄĂĄst 5.3) - --gui-theme=VZHLED Vybere vzhled rozhranĂ (vĂ˝chozĂ, modernĂ, klasickĂ˝) - --themepath=CESTA Cesta kde jsou vzhledy rozhranĂ uloĹženy - --list-themes ZobrazĂ seznam vĹĄech pouĹžitelnĂ˝ch vzhledĹŻ - -e, --music-driver=REĹ˝IM Vybere ovladaÄ hudby (viz takĂŠ ÄĂĄst 7.0) - --list-audio-devices ZobrazĂ seznam vĹĄech dostupnĂ˝ch zvukovĂ˝ch zaĹĂzenĂ - -q, --language=JAZYK Vybere jazyk hry (viz takĂŠ ÄĂĄst 5.2) - -m, --music-volume=Ä. NastavĂ hlasitost hudby, 0-255 (vĂ˝chozĂ: 192) - -s, --sfx-volume=Ä. NastavĂ hlasitost zvukĹŻ, 0-255 (vĂ˝chozĂ: 192) - -r, --speech-volume=Ä. NastavĂ hlasitost hlasĹŻ, 0-255 (vĂ˝chozĂ: 192) - --midi-gain=Ä. NastavĂ zvýťenĂ pro pĹehrĂĄvĂĄnĂ MIDI, 0-1000 (vĂ˝chozĂ: 100) (podporovĂĄno pouze nÄkterĂ˝mi ovladaÄi MIDI) - -n, --subtitles Zapne titulky (pouĹžijte v hrĂĄch s ĹeÄĂ) - -b, --boot-param=Ä. PĹedĂĄ ÄĂslo zavĂĄdÄjĂcĂmu skriptu (parametr zavedenĂ) - -d, --debuglevel=Ä. NastavĂ ĂşroveĹ podrobnostĂ ladÄnĂ - --debugflags=PĹĂZNAKY PovolĂ urÄitĂŠ pĹĂznaky ladÄnĂ jĂĄdra (oddÄlenĂŠ ÄĂĄrkami) - -u, --dump-scripts PovolĂ vĂ˝pis skriptu, pokud sloĹžka s nĂĄzvem 'dumps' existuje v souÄasnĂŠ sloĹžce - --cdrom=ÄĂSLO Jednotka CD z kterĂŠ pĹehrĂĄvat CD audio (vĂ˝chozĂ: 0 = prvnĂ jednotka) - --joystick[=ÄĂSLO] PovolĂ vstup z joysticku (vĂ˝chozĂ: 0 = prvnĂ joystick) - --platform=SLOVO UrÄĂ platformu hry (povolenĂŠ hodnoty: 2gs, 3do, acorn, amiga, atari, c64, fmtowns, mac, nes, pc, pce, segacd, windows) - --savepath=CESTA Cesta, kde jsou umĂstÄny uloĹženĂŠ hry - --extrapath=CESTA DodateÄnĂĄ cesta pro dalĹĄĂ data hry - --soundfont=SOUBOR Vybere SoundFont pro pĹehrĂĄvĂĄnĂ MIDI (PodporovĂĄno pouze nÄkterĂ˝mi ovladaÄi MIDI) - --multi-midi PovolĂ kombinaci AdLib a pĹirozenĂŠho MIDI - --native-mt32 PravĂ˝ Roland MT-32 (zakĂĄĹže emulaci GM) - --enable-gs PovolĂ reĹžim Roland GS pro pĹehrĂĄvĂĄnĂ MIDI - --output-rate=FREKVENCE VĂ˝stupnĂ vzorkovacĂ kmitoÄet v Hz (napĹ. 22050) - --opl-driver=OVLADAÄ Vybere emulĂĄtor AdLib (OPL) (db, mame) - --aspect-ratio PovolĂ korekci pomÄru stran - --render-mode=REĹ˝IM PovolĂ dodateÄnĂŠ reĹžimy vykreslenĂ (cga, ega, hercGreen, hercAmber, amiga) - --alt-intro PouĹžije alternativnĂ intro pro CD verze Beneath a Steel Sky a Flight of the Amazon Queen - --copy-protection PovolĂ ochranu proti kopĂrovĂĄnĂ v hrĂĄch, kdyĹž ji ScummVM standardnÄ zakazuje. - --talkspeed=ÄĂSLO NastavĂ zdrĹženĂ mluvenĂ v hrĂĄch SCUMM, nebo rychlost mluvenĂ v jinĂ˝ch hrĂĄch (vĂ˝chozĂ: 60) - --demo-mode SpustĂ reĹžim dema v Maniac Mansion (KlasickĂĄ verze) - --tempo=NUM NastavĂ rychlost hudby (v procentech, 50-200) pro hry SCUMM (vĂ˝chozĂ: 100) - - -VĂ˝znam vĹĄech dlouhĂ˝ch moĹžnostĂ (to jsou ty, kterĂŠ zaÄĂnajĂ dvojitou pomlÄkou) mĹŻĹže bĂ˝t pĹevrĂĄcen, kdyĹž pĹed nÄ pĹidĂĄte "no-". NapĹĂklad, ---no-aspect-ratio vypne korekci pomÄru stran. To je uĹžiteÄnĂŠ, kdyĹž chcete potlaÄit nastavenĂ v souboru. - -KrĂĄtkĂŠ jmĂŠno hry ('cĂl hry'), kterĂ˝ vidĂte na konci pĹĂkazovĂŠho ĹĂĄdku, urÄuje, kterĂĄ hra je spuĹĄtÄna. BuÄ odpovĂdĂĄ libovolnĂŠmu cĂli urÄenĂŠho uĹživatelem (ze souboru s nastavenĂm), nebo zabudovanĂŠmu id hry. KrĂĄtkĂ˝ seznam zabudovanĂ˝ch id mĹŻĹže bĂ˝t nalezen v ÄĂĄsti list 3.0. - -PĹĂklady: - * Win32: - SpuĹĄtÄnĂ Monkey Island, celĂĄ obrazovka, z pevnĂŠho disku: - C:\Games\LucasArts\scummvm.exe -f -pC:\Games\LucasArts\monkey\ monkey - SpuĹĄtÄnĂ Full Throttle z CD, celĂĄ obrazovka a se zapnutĂ˝mi titulky: - C:\Games\LucasArts\scummvm.exe -f -n -pD:\resource\ ft - - * Unix: - SpuĹĄtÄnĂ Monkey Island, celĂĄ obrazovka, z pevnĂŠho disku: - - /path/to/scummvm -f -p/games/LucasArts/monkey/ monkey - SpuĹĄtÄnĂ Full Throttle z CD, celĂĄ obrazovka a se zapnutĂ˝mi titulky: - /path/to/scummvm -f -n -p/cdrom/resource/ ft - - -5.2) Volby jazyka: ----- ------------- -ScummVM obsahuje volby jazyka pro Maniac Mansion, Zak McKracken, -The Dig, The Curse of Monkey Island, Beneath a Steel Sky a -Broken Sword. - -NezapomeĹte, Ĺže kromÄ Beneath a Steel Sky, Broken Sword, mnohajazykovĂŠ verze her Goblins a Nippon Safes Inc., pouĹžitĂ tĂŠto moĹžnosti *nezmÄnĂ* jazyk hry (kterĂ˝ je vÄtĹĄinou pevnÄ zakĂłdovĂĄn), ale spĂĹĄe je pouĹžita pro vybrĂĄnĂ sprĂĄvnĂŠho pĂsma (napĹ. pro nÄmeckou verzi obsahujĂcĂ pĹehlĂĄsky). - -VĂ˝jimky jsou The Dig a The Curse of Monkey Island -- neanglickĂŠ -Verze mohou bĂ˝t nastaveny na 'English'. NicmĂŠnÄ toto ovlivĹuje pouze titulky; ĹeÄ ve hĹe zĹŻstane stejnĂĄ. - -Maniac Mansion a Zak McKracken - en - AngliÄtina (vĂ˝chozĂ) - de - NÄmÄina - fr - FrancouzĹĄtina - it - ItalĹĄtina - es - Ĺ panÄlĹĄtina - -The Dig - jp - JaponĹĄtina - zh - ÄĂnĹĄtina - kr - KorejĹĄtina - -The Curse of Monkey Island - en - AngliÄtina (vĂ˝chozĂ) - de - NÄmÄina - fr - FrancouzĹĄtina - it - ItalĹĄtina - pt - PortugalĹĄtina - es - Ĺ panÄlĹĄtina - jp - JaponĹĄtina - zh - ÄĂnĹĄtina - kr - KorejĹĄtina - -Beneath a Steel Sky - gb - AngliÄtina (VelkĂĄ BritĂĄnie) (vĂ˝chozĂ) - en - AngliÄtina (USA) - de - NÄmÄina - fr - FrancouzĹĄtina - it - ItalĹĄtina - pt - PortugalĹĄtina - es - Ĺ panÄlĹĄtina - se - Ĺ vĂŠdĹĄtina - -Broken Sword - en - AngliÄtina (vĂ˝chozĂ) - de - NÄmÄina - fr - FrancouzĹĄtina - it - ItalĹĄtina - pt - PortugalĹĄtina - es - Ĺ panÄlĹĄtina - cz - ÄeĹĄtina - - -5.3) GrafickĂŠ filtry: ----- ---------------- -ScummVM nabĂzĂ nÄkolik filtrĹŻ vyhlazujĂcĂch hrany jako pokus o zlepĹĄenĂ obrazovĂŠ kvality. Jsou to stejnĂŠ filtry, kterĂŠ pouĹžĂvĂĄ i mnoho jinĂ˝ch emulĂĄtorĹŻ, jako MAME. Tyto filtry vezmou pĹŻvodnĂ grafiku hry a zvÄtĹĄĂ ji o urÄitou pevnou hodnotu (vÄtĹĄinou 2x nebo 3x) neĹž ji VĂĄm zobrazĂ. TakĹže napĹĂklad, pokud hra pĹŻvodnÄ pracovala v rozliĹĄenĂ 320x200 (typickĂŠ pro vÄtĹĄinu her SCUMM), pak pouĹžitĂm filtru s faktorem zvÄtĹĄenĂ 2x, ve skuteÄnosti dostanete rozliĹĄenĂ 640x400. PodobnÄ s filtrem 3x dostanete 960x600. - -Jsou to: - 1x - Bez filtrovĂĄnĂ, bez zvÄtĹĄenĂ. NejrychlejĹĄĂ. - 2x - Bez filtrovĂĄnĂ, zvÄtĹĄenĂ 2x (vĂ˝chozĂ pro hry 640x480). - 3x - Bez filtrovĂĄnĂ, zvÄtĹĄenĂ 3x. - 2xsai - Filtr 2xSAI, zvÄtĹĄenĂ 2x. - super2xsai â VylepĹĄenĂŠ filtrovĂĄnĂ 2xSAI, zvÄtĹĄenĂ 2x. - supereagle â MĂŠnÄ rozostĹenĂ˝ neĹž 2xSAI, ale pomalejĹĄĂ. ZvÄtĹĄenĂ 2x. - advmame2x - NespolĂŠhĂĄ na rozostĹenĂ jako 2xSAI, rychlĂŠ. ZvÄtĹĄenĂ 2x. - advmame3x - NespolĂŠhĂĄ na rozostĹenĂ jako 2xSAI, rychlĂŠ. ZvÄtĹĄenĂ 3x. - hq2x - Velmi hezkĂĄ vysokĂĄ kvalita, ale pomalĂ˝. ZvÄtĹĄenĂ 2x. - hq3x - Velmi hezkĂĄ vysokĂĄ kvalita, ale pomalĂ˝. ZvÄtĹĄenĂ 3x. - tv2x - Filtr proklĂĄdĂĄnĂ, snaŞà se emulovat TV. ZvÄtĹĄenĂ 2x. - dotmatrix - Efekt bodovĂŠ matice. ZvÄtĹĄenĂ 2x. - -Abyste filtr vybrali, zvolte ho ve spouĹĄtÄÄi, nebo pĹedejte scummvm jeho jmĂŠno pomocĂ moĹžnosti '-g', napĹĂklad: - - scummvm -gadvmame2x monkey2 - -PoznĂĄmka #1: Ne vĹĄechny jĂĄdra podporujĂ vĹĄechny (nebo dokonce ŞådnĂŠ) z filtrĹŻ vypsanĂ˝ch výťe; nÄkterĂŠ mohou podporovat i dalĹĄĂ. Filtry vypsanĂŠ výťe jsou ty podporovanĂŠ standardnĂm jĂĄdrem SDL. - -PoznĂĄmka #2: Filtry mohou bĂ˝t velmi pomalĂŠ, kdyĹž je ScummVM sestaven v nastavenĂ pro ladÄnĂ bez optimalizacĂ. PouĹžitĂ jakĂŠkoliv formy vyhlazenĂ hran/lineĂĄrnĂho filtrovĂĄnĂ bude mĂt vĹždycky dopad na rychlost. - -PoznĂĄmka #3: Verze FM-TOWNS hry Zak McKracken mĂĄ pĹŻvodnĂ rozliĹĄenĂ 320x240, coĹž znamenĂĄ, Ĺže filtry v tĂŠto hĹe budou zvÄtĹĄovat na 640x480 -nebo 960x720. ObdobnÄ hry, kterĂŠ majĂ pĹŻvodnĂ rozliĹĄenĂ 640x480 (jako -Curse of Monkey Island nebo Broken Sword) budou zvÄtĹĄeny na 1280x960 a -1920x1440. - - -5.4) GlobĂĄlnĂ menu: ----- -------------- -GlobĂĄlnĂ Menu je obecnĂŠ menu, kterĂŠ je dostupnĂŠ vĹĄem jĂĄdrĹŻm her stisknutĂm Ctrl-F5. Z tohoto menu jsou dostupnĂŠ nĂĄsledujĂcĂ tlaÄĂtka: PokraÄovat, Volby, O programu, NĂĄvrat do SpouĹĄtÄÄe, a UkonÄit. VĂ˝bÄrem -'Volby' bude zobrazeno dialogovĂŠ okno, kde mĹŻĹžou bĂ˝t upravena zĂĄkladnĂ nastavenĂ zvuku, jako hladiny hlasitosti. VĂ˝bÄrem 'NĂĄvrat do SpouĹĄtÄÄe' souÄasnou hru ukonÄĂ a uĹživatele navrĂĄtĂ do spouĹĄtÄÄe ScummVM, kde mĹŻĹže bĂ˝t vybrĂĄna dalĹĄĂ hra ke hranĂ. - -PoznĂĄmka: NĂĄvrat do SpouĹĄtÄÄe nenĂ podporovĂĄn vĹĄemi jĂĄdry a tlaÄĂtko nebude v GlobĂĄlnĂm Menu funkÄnĂ, pokud nenĂ podporovĂĄno. - -JĂĄdra, kterĂĄ v souÄasnosti podporujĂ nĂĄvrat do spouĹĄtÄÄe, jsou: - - AGI - AGOS - CINE - COMPOSER - CRUISE - DRACI - DRASCULA - GOB - GROOVIE - HUGO - KYRA - LURE - MADE - MOHAWK - PARALLACTION - QUEEN - SAGA - SCI - SCUMM - SKY - SWORD1 - SWORD2 - TEENAGENT - TOUCHE - TSAGE - TUCKER - - -5.5) KlĂĄvesovĂŠ zkratky: ----- ------------------ -ScummVM podporuje rĹŻznĂŠ zkratky ve hĹe. LiĹĄĂ se mezi rĹŻznĂ˝mi hrami SCUMM a jinĂ˝mi hrami. - - SpoleÄnĂŠ: - Ctrl-F5 - ZobrazĂ GlobĂĄlnĂ Menu - Cmd-q - UkonÄit (Mac OS X) - Ctrl-q - UkonÄit (dalĹĄĂ unixy vÄetnÄ Linux) - Ctrl-z OR Alt-x - Quit (dalĹĄĂ platformy) - Ctrl-u - ZeslabĂ vĹĄechny zvuky - Ctrl-m - PĹepĂnat zachycenĂ myĹĄi - Ctrl-Alt 1-8 - PĹepĂnat mezi grafickĂ˝mi filtry - Ctrl-Alt + and - - ZvÄtĹĄit/ZmenĹĄit faktor zvÄtĹĄenĂ -Ctrl-Alt a - PĹepĂnat korekci pomÄru stran. VÄtĹĄina her pouĹžĂvĂĄ rozliĹĄenĂ 320x200 pixelĹŻ, coĹž mĹŻĹže na vÄtĹĄinÄ novÄjĹĄĂch monitorĹŻ vypadat splĂĄcle. Korekce pomÄru stran obraz roztĂĄhne, aby mĂsto toho pouĹžil 320x240, nebo jeho nĂĄsobky - Alt-Enter - PĹepĂnĂĄ celou obrazovku/do okna - Alt-s - VytvoĹit snĂmek obrazovky (pouze jĂĄdro SDL) - - SCUMM: - Ctrl 0-9 and Alt 0-9 - NahrĂĄt a uloĹžit stav hry - Ctrl-d - Spustit ladÄnĂ - Ctrl-f - Zapnout rychlĂ˝ reĹžim - Ctrl-g - PĹepnout do velmi VELMI rychlĂŠho reĹžimu - Ctrl-t - PĹepĂnat mezi 'Pouze ĹeÄ', - 'ĹeÄ a Titulky' a 'Pouze titulky' - Tilda (~) - Zobrazit/skrĂ˝t konzoli ladÄnĂ - [ and ] - Hlasitost hudby, zvýťit/snĂĹžit - - and + - Rychlost textu, pomalejĹĄĂ/rychlejĹĄĂ - F5 - ZobrazĂ rĂĄmeÄek pro uloĹženĂ/naÄtenĂ - Alt-F5 - ZobrazĂ pĹŻvodnĂ rĂĄmeÄek pro uloĹženĂ/naÄtenĂ, pokud hra nÄjakĂ˝ mĂĄ. Zde mĹŻĹžete hru naÄĂst i uloĹžit, nicmĂŠnÄ pro tento ĂşÄel nenĂ urÄen a v nÄkterĂ˝ch hrĂĄch mĹŻĹže zpĹŻsobit pĂĄd ScummVM. - i - ZobrazĂ IQ body (Indiana Jones and the Last Crusade a Indiana Jones and the Fate of Atlantis) - MezernĂk - PozastavenĂ - TeÄka (.) - V nÄkterĂ˝ch hrĂĄch pĹeskoÄĂ souÄasnĂ˝ ĹĂĄdek textu - Enter - Simulovat stisknutĂ levĂŠho tlaÄĂtka myĹĄi - Tab - Simulovat stisknutĂ pravĂŠho tlaÄĂtka myĹĄi - - Beneath a Steel Sky: - Ctrl-d - SpustĂ ladÄnĂ - Ctrl-f - Zapnout rychlĂ˝ reĹžim - Ctrl-g - PĹepnout do velmi VELMI rychlĂŠho reĹžimu - F5 - ZobrazĂ rĂĄmeÄek pro uloĹženĂ/naÄtenĂ - Escape - PĹeskoÄĂ Ăşvod hry - Period (.) - PĹeskoÄĂ souÄasnĂ˝ ĹĂĄdek textu - - Broken Sword: - F5 nebo Escape - ZobrazĂ rĂĄmeÄek pro uloĹženĂ/naÄtenĂ - - Broken Sword II: - Ctrl-d - Spustit ladÄnĂ - Ctrl-f - Zapnout rychlĂ˝ reĹžim - p - PozastavenĂ - - DraÄĂ Historie: - F5 - ZobrazĂ GlobĂĄlnĂ Menu - LevĂŠ klinutĂ - JĂt, zkoumat - PravĂŠ klinutĂ - PouĹžĂt, mluvit - Posun myĹĄi nahoru, i - InventĂĄĹ - Posun myĹĄi dolĹŻ, m - Mapa - Escape - PĹeskoÄĂ Ăşvod, odejde z mapy/inventĂĄĹe - JakĂŠkoliv kliknutĂ - PĹeskoÄĂ souÄasnÄ dabovanou vÄtu - q - ZapnutĂ/vypnutĂ rychlĂŠho chozenĂ - - Flight of the Amazon Queen: - Ctrl-d - Spustit ladÄnĂ - Ctrl-f - Zapnout rychlĂ˝ reĹžim - F1 - PouĹžĂt DenĂk (uklĂĄdĂĄnĂ/naÄĂtĂĄnĂ) - F11 - RychlĂŠ naÄtenĂ - F12 - RychlĂŠ uklĂĄdĂĄnĂ - Escape - PĹeskoÄĂ video - MezernĂk - PĹeskoÄĂ souÄasnĂ˝ ĹĂĄdek textu - - Future Wars - F1 - Prozkoumat - F2 - VzĂt - F3 - InventĂĄĹ - F4 - PouĹžĂt - F5 - Aktivovat - F6 - Mluvit - F9 - Menu "Aktivovat" - F10 - Menu "PouĹžĂt" - Escape - Zobrazit menu pĹĂkazĹŻ - - Nippon Safes - Ctrl-d - Spustit ladÄnĂ - l - NaÄĂst hru - s - UloĹžit hru - - Simon the Sorcerer 1 a 2: - Ctrl 0-9 a Alt 0-9 - NaÄĂst a uloĹžit stav hry - Ctrl-d - Spustit ladÄnĂ - Ctrl-f - Zapnout rychlĂ˝ reĹžim - F1 - F3 - Rychlost textu, rychlejĹĄĂ - pomalejĹĄĂ - F10 - ZobrazĂ vĹĄechny postavy a objekty s kterĂ˝mi mĹŻĹžete nÄco dÄlat - Escape - PĹeskoÄit videa - - a + - Hlasitost hudby, snĂĹžit/zvýťit - m - Hudba vypnout/zapnout - s - ZvukovĂŠ efekty zapnout/vypnout - b - Zvuky pozadĂ zapnout/vypnout [Pouze Simon the Sorcerer 2] - Pause - PozastavenĂ - t - PĹepĂnat mezi ĹeÄĂ a kombinacĂ ĹeÄi a titulkĹŻ [Simon the Sorcerer 1 CD (jinĂŠ neĹž angliÄtina a nÄmÄina) a Simon the Sorcerer 2 CD (vĹĄechny jazyky)] - v - PĹepĂnat mezi titulky a kombinacĂ ĹeÄi a titulkĹŻ [Pouze Simon the Sorcerer 2 CD] - - Simon the Sorcerer's Puzzle Pack - Ctrl-d - Spustit ladÄnĂ - Ctrl-f - Zapnout rychlĂ˝ reĹžim - F12 - Zapnout/vypnout reĹžim rychle rychlosti ve Swampy Adventures - - a + - Hlasitost hudby, snĂĹžit/zvýťit - m - Hudba vypnout/zapnout - s - ZvukovĂŠ efekty zapnout/vypnout - Pause - PozastavenĂ - - The Feeble Files - Ctrl-d - Spustit ladÄnĂ - Ctrl-f - Zapnout rychlĂ˝ reĹžim - F7 - VymÄnit postavy - F9 - Zapnout/vypnout jmĂŠna hitboxĹŻ - s - ZvukovĂŠ efekty zapnout/vypnout - Pause - PozastavenĂ - t - PĹepĂnat mezi ĹeÄĂ a kombinacĂ ĹeÄi a titulkĹŻ - v - PĹepĂnat mezi titulky a kombinacĂ ĹeÄi a titulkĹŻ - - The Legend of Kyrandia: - Ctrl 0-9 and Alt 0-9 - NaÄĂst a uloĹžit stav hry - - Ctrl-d - Spustit ladÄnĂ - - TeenAgent - F5 - ZobrazĂ GlobĂĄlnĂ Menu - - Touche: The Adventures of the Fifth Musketeer: - Ctrl-f - Zapnout rychlĂ˝ reĹžim - F5 - Zobrazit moĹžnosti - F9 - Zapnout reĹžim rychlĂŠ chĹŻze - F10 - Vypnout reĹžim rychlĂŠ chĹŻze - Escape - UkonÄit - MezernĂk - PĹeskoÄĂ souÄasnĂ˝ ĹĂĄdek textu - t - PĹepnout mezi 'Pouze ĹeÄ', - 'ĹeÄ a Text' a ' Pouze Text' - -NezapomeĹte, Ĺže pouĹžĂvĂĄnĂ Ctrl-f nebo Ctrl-g nenĂ doporuÄeno: hry mohou spadnout, kdyĹž bÄŞà rychlostĂ vyĹĄĹĄĂ neĹž jejich normĂĄlnĂ, protoĹže skripty ztratĂ synchronizaci. - -PoznĂĄmka pro uĹživatele WinCE: KvĹŻli omezenĂŠmu vstupu z klĂĄvesnice ve vÄtĹĄinÄ zaĹĂzenĂ je malĂŠ mnoĹžstvĂ klĂĄvesovĂ˝ch zkratek podporovĂĄno pomocĂ znovu mapovĂĄnĂ a/nebo ÄinnostĂ panelĹŻ. ProsĂm pĹeÄtÄte si soubor README-WinCE.txt. - - -6.0) UloĹženĂŠ hry: ----- ------------ -UloĹženĂŠ hry jsou na nÄkterĂ˝ch platformĂĄch standardnÄ umĂstÄny do souÄasnĂŠ sloĹžky a v jinĂ˝ch do pĹednastavenĂŠ sloĹžky. To mĹŻĹžete urÄit v souboru s nastavenĂm pomocĂ parametru savepath. PodĂvejte se na vzorovĂ˝ soubor s nastavenĂm dĂĄle v tomto souboru. - -Platformy, kterĂŠ v souÄasnosti majĂ jinĂŠ vĂ˝chozĂ sloĹžky jsou: - Mac OS X: - $HOME/Documents/ScummVM Savegames/ - - JinĂŠ unixy: - $HOME/.scummvm/ - - Windows Vista/7: - \Users\uĹžjmĂŠno\AppData\Roaming\ScummVM\Saved games\ - - Windows 2000/XP: - \Documents and Settings\uĹžjmĂŠno\Application Data\ScummVM\Saved games\ - - Windows NT4: - <windir>\Profiles\uĹžjmĂŠno\Application Data\ScummVM\Saved games\ - -UloĹženĂŠ hry jsou ve Windows NT4/2000/XP/Vista/7 uklĂĄdĂĄny ve skrytĂŠ sloĹžce, -do kterĂŠ mĹŻĹžete vstoupit spuĹĄtÄnĂm "%APPDATA%\ScummVM\Saved Games\" nebo -povolenĂm zobrazenĂ skrytĂ˝ch sloĹžek v PrĹŻzkumnĂku Windows. - -PoznĂĄmka pro uĹživatele Windows NT4/2000/XP/Vista/7: VĂ˝chozĂ umĂstÄnĂ uloĹženĂ˝ch her -bylo ve ScummVM 1.5.0 zmÄnÄno. DĂĄvkovĂ˝ soubor pĹesunu mĹŻĹže bĂ˝t pouĹžit pro zkopĂrovĂĄnĂ -uloĹženĂ˝ch her ze starĂŠho vĂ˝chozĂho umĂstÄnĂ do novĂŠho. - -6.1) 6.1 AutomatickĂŠ uklĂĄdĂĄnĂ: ----- ------------------------- -V nÄkterĂ˝ch hrĂĄch, (a to "Beneath a Steel Sky", "Flight of the Amazon -Queen", vĹĄechny hry AGI, a vĹĄechny hry SCUMM), bude ScummVM standardnÄ automaticky uklĂĄdat souÄasnĂ˝ stav kaĹždĂ˝ch pÄt minut (upravitelnĂŠ pomocĂ nastavenĂ "autouklĂĄdĂĄnĂ"). Pro jĂĄdra AGI a SCUMM, je bude uklĂĄdat do pozice 0. V jĂĄdru SCUMM mĹŻĹže bĂ˝t tento uloĹženĂ˝ stav znovu naÄten pomocĂ Ctrl-0 nebo menu F5. - - -6.2) PĹevod uloĹženĂ˝ch her: ----- --------------------- -PouĹžitĂ uloĹženĂ˝ch her z pĹŻvodnĂch verzĂ nenĂ podporovĂĄno vĹĄemi jĂĄdry. Pouze nĂĄsledujĂcĂ hry mohou pouĹžĂt pĹŻvodnĂ verze. - - Elvira 1 - - PĹidejte 8 bajtĹŻ (nĂĄzev uloĹženĂŠ hry) na zaÄĂĄtek souboru uloĹženĂŠ hry - - PĹejmenujte ho na 'elvira1.xxx' - - Elvira 2 - - PĹidejte 8 bajtĹŻ (nĂĄzev uloĹženĂŠ hry) na zaÄĂĄtek souboru uloĹženĂŠ hry - - PĹejmenujte ho na 'elvira2-pc.xxx' (verze DOS) nebo 'elvira2.xxx' (JinĂŠ verze) - - Waxworks - - PĹidejte 8 bajtĹŻ (nĂĄzev uloĹženĂŠ hry) na zaÄĂĄtek souboru uloĹženĂŠ hry - - PĹejmenujte ho na 'waxworks-pc.xxx' (verze DOS) nebo 'waxworks.xxx' (JinĂŠ verze) - - Simon the Sorcerer 1 - - PĹejmenuje soubor uloĹženĂŠ hry na 'simon1.xxx' - - Simon the Sorcerer 2 - - PĹejmenuje soubor uloĹženĂŠ hry na 'simon2.xxx' - - The Feeble Files - - PĹejmenuje soubor uloĹženĂŠ hry na 'feeble.xxx' - -Kde 'xxx' je ÄĂslo pozice uloĹženĂŠ hry (tj. 001) ve ScummVM - - -6.3) ZobrazenĂ/NaÄtenĂ uloĹženĂ˝ch her z pĹĂkazovĂŠho ĹĂĄdku: ----- ---------------------------------------------------- - ---list-saves: - - Tento pĹepĂnaÄ mĹŻĹže bĂ˝t pouĹžit k zobrazenĂ seznamu souÄasnĂ˝ch uloĹženĂ˝ch her urÄenĂŠ cĂlovĂŠ hry a jejĂ odpovĂdajĂcĂ pozice. - - PouĹžitĂ: --list-saves=[CĂL], kde [CĂL] je cĂlovĂĄ hra. - - JĂĄdra, kterĂĄ v souÄasnosti podporujĂ --list-saves jsou: - - AGI - AGOS - CGE - CINE - CRUISE - DRACI - GROOVIE - HUGO - KYRA - LURE - MOHAWK - PARALLACTION - QUEEN - SAGA - SCI - SCUMM - SKY - SWORD1 - SWORD2 - TEENAGENT - TINSEL - TOON - TOUCHE - TSAGE - TUCKER - ---save-slot/-x: - - Tento pĹepĂnaÄ mĹŻĹže bĂ˝t pouĹžit k naÄtenĂ uloĹženĂŠ hry pĹĂmo z pĹĂkazovĂŠho ĹĂĄdku. - - PouĹžitĂ: --save-slot[POZICE] nebo -x[POZICE], kde [POZICE] je ÄĂslo uloĹženĂŠ pozice. - - JĂĄdra, kterĂĄ v souÄasnosti podporujĂ--save-slot/-x jsou: - - AGI - CGE - CINE - CRUISE - DRACI - GROOVIE - HUGO - KYRA - LURE - MOHAWK - QUEEN - SAGA - SCI - SCUMM - SKY - SWORD1 - SWORD2 - TEENAGENT - TINSEL - TOON - TOUCHE - TSAGE - TUCKER - - -7.0) Hudba a Zvuk: ----- ------------- -Ve vÄtĹĄinÄ operaÄnĂch systĂŠmĹŻ a pro vÄtĹĄinu her bude ScummVM standardnÄ pouĹžĂvat MT-32 nebo emulaci AdLib pro pĹehrĂĄvĂĄnĂ hudby. MIDI nemusĂ bĂ˝t -DostupnĂŠ ve vĹĄech operaÄnĂch systĂŠmech, nebo potĹebuje ruÄnĂ nastavenĂ. Pokud chcete MIDI pouĹžĂt, mĂĄte nÄkolik rĹŻznĂ˝ch voleb pro vĂ˝stup, v zĂĄvislosti na VaĹĄem operaÄnĂm systĂŠmu a nastavenĂ. - - null - PrĂĄzdnĂ˝ vĂ˝stup. NepĹehrĂĄvat Şådnou hudbu. - adlib - VnitĹnĂ emulace AdLib - fluidsynth â Emulace FluidSynth MIDI - mt32 - VnitĹnĂ emulace MT-32 - pcjr - VnitĹnĂ emulace PCjr (pouĹžitelnĂŠ pouze ve hrĂĄch SCUMM) - pcspk - VnitĹnĂ emulace reproduktoru PC - towns - VnitĹnĂ emulace FM-TOWNS YM2612 - (pouĹžitelnĂŠ pouze v hrĂĄch SCUMM FM-TOWNS) - alsa - VĂ˝stup pomocĂ zaĹĂzenĂ sekvencĂŠru ALSA. Viz nĂĹže. - core - Zvuk CoreAudio, pro uĹživatele Mac OS X. - coremidi - Zvuk CoreMIDI, pro uĹživatele Mac OS X. PouĹžĂvejte pouze, pokud mĂĄte hardwarovĂ˝ syntetizĂĄtor MIDI. - seq - PouĹžitĂ /dev/sequencer pro MIDI v systĂŠmu *nix. Viz nĂĹže - timidity - PĹipojenĂ k MIDI serveru TiMidity++. Viz nĂĹže. - windows - Windows MIDI. PouĹžije zabudovanĂ˝ sekvencĂŠr, pro Windows - -Abyste vybrali ovladaÄ zvuku, zvolte ho ve spouĹĄtÄÄi, nebo pĹedejte jeho jmĂŠno ScummVM pomocĂ moĹžnosti '-e', napĹĂklad: - - scummvm -eadlib monkey2 - - -7.1) PĹehrĂĄvĂĄnĂ zvuku pomocĂ emulace AdLib: ----- -------------------------------------- -StandardnÄ bude karta AdLib emulovĂĄna a ScummVM hudbu pĹehrĂĄvĂĄ jako vzorkovanĂŠ vlny. To je vĂ˝chozĂ reĹžim pro vÄtĹĄinu her a nabĂzĂ nejlepĹĄĂ kompatibilitu mezi stroji a hrami. - - -7.2) PĹehrĂĄvĂĄnĂ zvuku pomocĂ emulace FluidSynth MIDI: ----- ------------------------------------------------ -Pokud byl ScummVM sestaven s podporou libfluidsynth bude schopen pĹehrĂĄvat hudbu MIDI pomocĂ ovladaÄe FluidSynth. Budete muset ale urÄit, kterĂ˝ SoundFont pouĹžĂt. - -ProtoĹže vĂ˝chozĂ hlasitost vĂ˝stupu od FluidSynth mĹŻĹže bĂ˝t velmi nĂzkĂĄ, -ScummVM standardnÄ nastavĂ zvýťenĂ, aby dostal silnÄjĹĄĂ signĂĄl. To mĹŻĹže bĂ˝t dĂĄle upaveno pouĹžitĂm moĹžnosti pĹĂkazovĂŠho ĹĂĄdku --midi-gain, nebo nastavenĂm "midi_gain" v konfiguraÄnĂm souboru. - -NastavenĂ mĹŻĹže nabĂ˝vat hodnoty od 0 po 1000 a vĂ˝chozĂ je 100. (Toto odpovĂdĂĄ nastavenĂ zvýťenĂ FluidSynth's 0.0 aĹž 10.0, coĹž je pravdÄpodobnÄ mÄĹeno v decibelech.) - -POZNĂMKA: PoĹžadavky na procesor pro FluidSynth mĹŻĹžou bĂ˝t v nÄkterĂ˝ch pĹĂpadech dosti vysokĂŠ. Je doporuÄeno mĂt rychlĂŠ CPU. - - -7.3) PĹehrĂĄvĂĄnĂ zvuku pomocĂ emulace MT-32: ----- -------------------------------------- -NÄkterĂŠ hry, kterĂŠ obsahujĂ hudebnĂ data MIDI, takĂŠ majĂ vylepĹĄenĂŠ stopuy urÄenĂŠ pro zvukovĂ˝ modul MT-32. ScummVM mĹŻĹže toto zaĹĂzenĂ nynĂ emulovat, nicmĂŠnÄ aby toto zaĹĂzenĂ fungovalo, musĂte mĂt pĹŻvodnĂ ROMy MT-32: - -MT32_PCM.ROM - IC21 (512KB) -MT32_CONTROL.ROM - IC26 (32KB) a IC27 (32KB), proklĂĄdanĂŠ podle bajtu - -Tyto ROMy umĂstÄte do hernĂho adresĂĄĹe, ve VaĹĄĂ dodateÄnĂŠ cestÄ, nebo v adresĂĄĹi, kde je umĂstÄn spouĹĄtÄÄ ScummVM. - -S tĂmto ovladaÄem nemusĂte zadĂĄvat --native-mt32, protoĹže je automaticky zapnut. - -POZNĂMKA: PoĹžadavky na procesor pro emulĂĄtor jsou velmi vysokĂŠ; rychlĂŠ -CPU je velmi doporuÄeno. - - -7.4) PĹehrĂĄvĂĄnĂ zvuku pomocĂ emulace MIDI: ----- ------------------------------------- -NÄkterĂŠ hry (jako Sam & Max) obsahujĂ pouze hudebnĂ data MIDI. Toto brĂĄnilo, aby hudba v tÄchto hrĂĄch fungovala na platformĂĄch, kterĂŠ MIDI nepodporujĂ, nebo na zvukovĂ˝ch kartĂĄch, kterĂŠ neposkytujĂ ovladaÄe MIDI (napĹ. mnoho zvukovĂ˝ch karet nebude v Linuxu MIDI pĹehrĂĄvat). ScummVM nynĂ mĹŻĹže MIDI emulovat pomocĂ vzorkovanĂ˝ch vln a AdLib, emulaci MIDI FluidSynth nebo emulace MT-32 pomocĂ moĹžnostĂ -eadlib, -efluidsynth nebo -emt32 v tomto poĹadĂ. NicmĂŠnÄ pokud mĂĄte moĹžnost pouĹžĂt pĹirozenĂŠ MIDI, doporuÄujeme pouĹžĂt jeden z reĹžimĹŻ MIDI nĂĹže pro nejlepĹĄĂ zvuk. - - -7.5) PĹehrĂĄvĂĄnĂ zvuku pomocĂ emulace PĹirozenĂŠho MIDI: ----- ------------------------------------------------- -PouĹžijte vhodnou moĹžnosti pĹĂkazovĂŠho ĹĂĄdku -e<reĹžim> ze seznamu výťe pro vybrĂĄnĂ VaĹĄeho upĹednostĹovanĂŠho zaĹĂzenĂ MIDI. NapĹĂklad pokud chcete pouĹžĂt ovladaÄ Windows MIDI, pouĹžijte moĹžnost -ewindows. - - -7.5.1) PouĹžitĂ moĹžnostĂ MIDI k pĹizpĹŻsobenĂ vĂ˝stupu pĹirozenĂŠ MIDI: ------- ------------------------------------------------------------ -ScummVM podporuje rĹŻznĂŠ reĹžimy MIDI v zĂĄvislosti na schopnostech VaĹĄeho zaĹĂzenĂ MIDI. - -Pokud je zadĂĄno --native-mt32, ScummVM se k VaĹĄemu zaĹĂzenĂ bude chovat jako ke skuteÄnĂŠ MT-32. ProtoĹže mapovĂĄnĂ instrumentĹŻ a vĂ˝hradnĂ systĂŠmovĂŠ pĹĂkazy MT-32 se liĹĄĂ od zaĹĂzenĂ General MIDI, tuto moĹžnost byste mÄli povolit, pouze kdyĹž pouĹžĂvĂĄte skuteÄnĂŠ Roland MT-32, LAPC-I,CM-64, CM-32L, CM-500, nebo zaĹĂzenĂ GS s mapou MT-32. - -Pokud je zadĂĄno --enable-gs, ScummVM zavede VaĹĄe zaĹĂzenĂ kompatibilnĂ s GS pomocĂ nastavenĂ, kterĂĄ napodobujĂ nastavenĂ dozvuku MT-32, (nedostatek) chĂłru, citlivost ohĂ˝banĂ tĂłnu, atd. Pokud je toto spoleÄnÄ pouĹžito s --native-mt32, ScummVM vybere mapu kompatibilnĂ s MT-32 a bicĂ soupravu na VaĹĄem zaĹĂzenĂ GS. Toto nastavenĂ funguje lĂŠpe neĹž standardnĂ emulace GM nebo GS ve hrĂĄch, kterĂŠ nemajĂ vlastnĂ mapovĂĄnĂ instrumentĹŻ (Loom a Monkey1). ObÄ nastavenĂ byste mÄli pouĹžĂt pouze tehdy, pokud mĂĄte zaĹĂzenĂ GS, kterĂŠ mĂĄ mapu MT-32, jako SC-55, SC-88, SC-88 Pro, SC-8820, SC-8850, atd. NezapomeĹte, Ĺže --enable-gs je automaticky zakĂĄzĂĄno v DOTT a Samnmax, protoĹže samostatnÄ pouĹžĂvajĂ General MIDI. - -Pokud nenĂ ani jedna z moĹžnostĂ výťe povolena, ScummVM VaĹĄe zaĹĂzenĂ zavede v reĹžimu General MIDI a pouĹžije emulaci GM v hrĂĄch se zvukovĂ˝m doprovodem MT-32. - -NÄkterĂŠ hry obsahujĂ zvukovĂŠ efekty pouze v AdLib. Pro tyto hry, byste mÄli zadat --multi-midi, abyste zkombinovali hudbu MIDI se zvukovĂ˝mi efekty AdLib. - - -7.6) PĹehrĂĄvĂĄnĂ zvuku pomocĂ SekvencĂŠru MIDI: [POUZE UNIX] ----- ---------------------------------------- -Pokud VĂĄĹĄ ovladaÄ podporuje sekvencĂŠr, mĹŻĹžete nastavit promÄnnou prostĹedĂ "SCUMMVM_MIDI" na VaĹĄem zaĹĂzenĂ sekvencĂŠru â napĹĂklad na /dev/sequencer - -Pokud mĂĄte problĂŠm se zvukem v tomto nastavenĂ, moĹžnĂĄ budete muset nastavit promÄnnou prostĹedĂ "SCUMMVM_MIDIPORT" na 1 nebo 2. Toto vybere port, kterĂ˝ bude pouĹžit ve zvolenĂŠm sekvencĂŠru. Pak spusĹĽte scummvm s parametrem -eseq. To by mÄlo fungovat pro nÄkolik karet a mĹŻĹže nabĂzet lepĹĄĂ vĂ˝kon a kvalitu, neĹž emulace AdLib. NicmĂŠnÄ pro systĂŠmy, kde podpora sekvencĂŠru nefunguje, mĹŻĹžete vĹždycky pĹejĂt na emulaci AdLib. - - -7.6.1) PĹehrĂĄvĂĄnĂ zvuku pomocĂ SekvencĂŠru ALSA: [POUZE UNIX] ------- ---------------------------------------- -Pokud MĂĄte nainstalovĂĄn ovladaÄ ALSA s podporou sekvencĂŠru, pak mĹŻĹžete nastavit promÄnnou prostĹedĂ "SCUMMVM_PORT" nebo promÄnnou souboru s nastavenĂm "alsa_port" pro urÄenĂ portu VaĹĄeho sekvencĂŠru. Pokud ani jedno nenĂ nastaveno, jsou standardnÄ vyzkouĹĄeny oba porty "65:0" a "17:0". - -Zde je krĂĄtkĂ˝ nĂĄvod, jak sekvencĂŠr pouĹžĂt s VaĹĄĂ zvukovou kartou. Ve vĹĄech pĹĂpadech, pro zĂskĂĄnĂ seznamu vĹĄech portĹŻ sekvencĂŠru, zkuste pĹĂkaz "aconnect -o -l". To by mÄlo mĂt vĂ˝stup podobnĂ˝ tomuto: - -client 14: 'Midi Through' [type=kernel] - 0 'Midi Through Port-0' -client 16: 'SBLive! Value [CT4832]' [type=kernel] - 0 'EMU10K1 MPU-401 (UART)' -client 17: 'Emu10k1 WaveTable' [type=kernel] - 0 'Emu10k1 Port 0 ' - 1 'Emu10k1 Port 1 ' - 2 'Emu10k1 Port 2 ' - 3 'Emu10k1 Port 3 ' -client 128: 'TiMidity' [type=user] - 0 'TiMidity port 0 ' - 1 'TiMidity port 1 ' - 2 'TiMidity port 2 ' - 3 'TiMidity port 3 ' - -NejdĹŻleĹžitÄjĹĄĂ ÄĂĄst zde je, Ĺže existujĂ ÄtyĹi vĂ˝stupy WaveTable MIDI umĂstÄnĂŠ na 17:0, 17:1, 17:2 a 17:3, a ÄtyĹi porty TiMidity umĂstÄnĂŠ na 128:0, 128:1, 128:2 a 128:3. - -Pokud na VaĹĄĂ kartÄ mĂĄte Äip FM FM, jako tĹeba SB16, pak musĂte naÄĂst SoundFonts pomocĂ softwaru sbiload. NapĹĂklad: - - sbiload -p 17:0 /etc/std.o3 /etc/drums.o3 - -Pokud je VaĹĄe karta schopnĂĄ pouĹžĂvat WaveTable, musĂte naÄĂst SoundFont sbk nebo sf2 pomocĂ softwaru sfxload nebo asfxload. NapĹĂklad: - - sfxload /cesta/k/8mbgmsfx.sf2 - -Pokud VaĹĄe karta neumĂ s MIDI pracovat, existujĂ dvÄ moĹžnosti: FluidSynth a TiMidity. DoporuÄujeme FluidSynth, protoĹže v mnoha systĂŠmech bude TiMidity 'zaostĂĄvat' za hudbou. To je velmi znatelnĂŠ v hrĂĄch pouĹžĂvajĂcĂ -iMUSE, kterĂ˝ pouĹžĂvĂĄ rychlĂŠ a dynamickĂŠ pĹechody hudby. -SpuĹĄtÄnĂm TiMidity jako root mu umoĹžnĂ nastavit prioritu v reĂĄlnĂŠm Äase, coĹž mĹŻĹže zaostĂĄvĂĄnĂ snĂĹžit. - -PĹĂkaz pro TiMidity, aby se stal sekvencĂŠrem ALSA: - - timidity -iAqqq -B2,8 -Os1S -s 44100 & - -(Pokud s tĂmto nastavenĂm dostĂĄvĂĄte zkreslenĂ˝ vĂ˝stup, mĹŻĹžete zkusit vynechat -B2,8 nebo zmÄnit hodnotu.) - -PĹĂkaz pro TiMidity, aby se stal sekvencĂŠrem ALSA (pouĹžitĂm SoundFonts): - - fluidsynth -m alsa_seq /cesta/k/8mbgmsfx.sf2 - -Jakmile je TiMidity nebo FluidSynth spuĹĄtÄn, pouĹžijte pĹĂkaz 'aconnect -o -l' jak je pospĂĄno výťe v tĂŠto ÄĂĄsti. - - -7.6.2) PĹehrĂĄvĂĄnĂ zvuku pomocĂ SekvencĂŠru IRIX dmedia: [POUZE UNIX] ------- ----------------------------------------------- -Pokud pouĹžĂvĂĄte IRIX a ovladaÄ dmedia s podporou sekvencĂŠru, mĹŻĹžete nastavit promÄnnou prostĹedĂ "SCUMMVM_MIDIPORT" nebo promÄnnou souboru s nastavenĂm "dmedia_port" pro urÄenĂ portu VaĹĄeho sekvencĂŠru. StandardnÄ je pouĹžit prvnĂ port. - -Abyste zĂskali seznam nastavenĂ˝ch rozhranĂ midi ve VaĹĄem systĂŠmu, spusĹĽte pĹĂkaz "startmidi" bez parametrĹŻ. VzorovĂ˝ vĂ˝stup: - - 2 MIDI interfaces configured: - Serial Port 2 - Software Synth - -V tomto pĹĂpadÄ mĹŻĹžete ScummVM nastavit, aby pouĹžil "Software Synth" mĂsto standardnĂho "Serial Port 2" pĹidĂĄnĂm ĹĂĄdku - - dmedia_port=Software Synth - -do VaĹĄeho souboru s nastavenĂm v ÄĂĄsti [scummvm], nebo nastavenĂm SCUMMVM_PORT=Software Synth ve VaĹĄem prostĹedĂ. - - -7.7) PouĹžitĂ MIDI serveru TiMidity++: ----- -------------------------------- -Pokud na VaĹĄem systĂŠmu chybĂ jakĂ˝koliv sekvencĂŠr MIDI, ale pĹesto chcete lepĹĄĂ kvalitu MIDI, neĹž kterou mĹŻĹže nabĂdnout standardnĂ emulace AdLib, mĹŻĹžete zkusit MIDI server TiMidity++. ProhlĂŠdnÄte si http://timidity.sourceforge.net/ pro staĹženĂ a pokyny k instalaci. - -NejdĹĂve musĂte spustit daemona: - - timidity -ir 7777 - -NynĂ mĹŻĹžete spustit ScummVM a zkusit vybrat TiMidity jako vĂ˝stup pro hudbu. StandardnÄ se pĹipojĂ k localhost:7777, ale hostitele/port mĹŻĹžete zmÄnit pomocĂ promÄnnĂŠ prostĹedĂ "TIMIDITY_HOST". MĹŻĹžete takĂŠ urÄit -"ÄĂslo zaĹĂzenĂ" pouĹžitĂm promÄnnĂŠ "SCUMMVM_MIDIPORT". - - -7.8) PouĹžitĂ komprimovanĂ˝ch zvukovĂ˝ch souborĹŻ ----- ---------------------------------------- - -7.8.0) PouĹžitĂ souborĹŻ MP3 pro CD audio: ------- --------------------------------- -PouĹžijte LAME nebo jinĂ˝ kodĂŠr MP3 pro vyjmutĂ stop cd audio do souborĹŻ. -Soubory pojmenujte track1.mp3 track2.mp3 atd. ScummVM musĂ bĂ˝t sestaven s podporou MAD pro pouĹžitĂ tĂŠto moĹžnosti. Soubory budete muset z CD vyjmout ve formĂĄtu WAV, pak je pĹevĂŠst do formĂĄtu MP3 v konstantnĂ pĹenosovĂŠ rychlosti. To mĹŻĹže bĂ˝t provedeno pomocĂ nĂĄsledujĂcĂho pĹĂkazovĂŠho ĹĂĄdku: - - lame -t -q 0 -b 96 track1.wav track1.mp3 - - -7.8.1) PouĹžitĂ souborĹŻ Ogg Vorbis pro CD audio: ------- ---------------------------------------- -PouĹžijte oggenc nebo jinĂ˝ kodĂŠr vorbis k pĹevedenĂ zvukovĂ˝ch stop do souborĹŻ. Pojmenujte je track1.ogg track2.ogg atd. ScummVM musĂ bĂ˝t sestaven s podporou vorbis pro pouĹžitĂ tĂŠto moĹžnosti. Soubory budete muset z CD vyjmout ve formĂĄtu WAV, pak je pĹevĂŠst do formĂĄtu vorbis. To mĹŻĹže bĂ˝t provedeno pomocĂ nĂĄsledujĂcĂho pĹĂkazovĂŠho ĹĂĄdku pro oggenc, kde hodnota po q urÄuje poĹžadovanou kvalitu od 0 do 10: - - oggenc -q 5 track1.wav - - -7.8.2) PouĹžitĂ souborĹŻ Flac pro CD audio: ------- ---------------------------------- -PouĹžijte flac nebo jinĂ˝ kodĂŠr flac k pĹevedenĂ zvukovĂ˝ch stop do souborĹŻ. -Pojmenujte je track1.flac track2.flac atd. Pokud VĂĄĹĄ souborovĂ˝ systĂŠm podporuje pĹĂpony pouze se tĹemi pĂsmeny, pojmenujte je track1.fla track2.fla atd. ScummVM musĂ bĂ˝t sestaven s podporou flac pro pouĹžitĂ tĂŠto moĹžnosti. Soubory budete muset z CD vyjmout ve formĂĄtu WAV, pak je pĹevĂŠst do formĂĄtu flac. To mĹŻĹže bĂ˝t provedeno pomocĂ nĂĄsledujĂcĂho pĹĂkazovĂŠho ĹĂĄdku pro flac: - - flac --best track1.wav - -NezapomeĹte, Ĺže kvalita bude vĹždy stejnĂĄ, rĹŻznĂŠ moĹžnosti kodĂŠru ovlivĹujĂ dobu kĂłdovĂĄnĂ a vĂ˝slednou velikost souboru. - - -7.8.3) KomprimovĂĄnĂ MONSTER.SOU pomocĂ MP3: ------- ------------------------------------ -PotĹebujete LAME a nĂĄĹĄ nĂĄstroj 'compress_scumm_sou' z balĂÄku -scummvm-tools, abyste toto mohli provĂŠst a ScummVM musĂ bĂ˝t sestaven s podporou MAD. - - compress_scumm_sou monster.sou - -Nakonec dostanete mnohem menĹĄĂ soubor monster.so3, tento soubor zkopĂrujte do VaĹĄĂ sloĹžky hry. Pak mĹŻĹžete soubor monster.sou odstranit. - - -7.8.4) KomprimovĂĄnĂ MONSTER.SOU pomocĂ Ogg Vorbis: ------- ------------------------------------------- -Tak jako výťe, ale ScummVM musĂ bĂ˝t sestaven s podporou OGG. SpusĹĽte: - - compress_scumm_sou --vorbis monster.sou - -To by mÄlo vytvoĹit menĹĄĂ soubor monster.sog file, kterĂ˝ byste mÄli zkopĂrovat do sloĹžky hry. KĂłdovĂĄnĂ Ogg mĹŻĹže trvat mnohem dĂŠle neĹž u MP3, takĹže mÄjte po ruce dobrou knĂĹžku. - - -7.8.5) KomprimovĂĄnĂ MONSTER.SOU pomocĂ Flac: ------- ------------------------------------- -Tak jako výťe, ale ScummVM musĂ bĂ˝t sestaven s podporou Flac. SpusĹĽte: - - compress_scumm_sou --flac monster.sou - -To by mÄlo vytvoĹit menĹĄĂ soubor monster.sof, kterĂ˝ byste mÄli zkopĂrovat do sloĹžky hry. NezapomeĹte, Ĺže kvalita bude vĹždy stejnĂĄ, rĹŻznĂŠ moĹžnosti kodĂŠru ovlivĹujĂ dobu kĂłdovĂĄnĂ a vĂ˝slednou velikost souboru. ZmÄna velikosti bloku (-b <hodnota>), mĂĄ nejvÄtĹĄĂ vliv na vĂ˝slednou velikost souboru -- 1152 se zdĂĄ bĂ˝t dobrĂĄ hodnota pro tento druh zvukovĂ˝ch souborĹŻ. PĹeÄtÄte si dokumentaci kodĂŠru pĹedtĂm, neĹž pouĹžijete dalĹĄĂ hodnoty. - - -7.8.6) KomprimovĂĄnĂ hudby/zvuku/hlasu v hrĂĄch AGOS: ------- -------------------------------------------- -Pro tento Ăşkol pouĹžijte nĂĄĹĄ nĂĄstroj 'compress_agos' z balĂÄku scummvm-tools. MĹŻĹžete volit mezi nÄkolika cĂlovĂ˝mi formĂĄty, ale nezapomeĹte, Ĺže je mĹŻĹžete pouĹžĂt pouze tehdy, kdyĹž ScummVM byl sestaven se zapnutou podporou konkrĂŠtnĂho dekodĂŠru. - - compress_agos effects (Pro CD verzi Simon 1 od Acorn) - compress_agos simon (Pro CD verzi Simon 1 od Acorn) - compress_agos effects.voc (Pro DOS CD verzi Simon 1) - compress_agos simon.voc (Pro DOS CD verzi Simon 1) - compress_agos simon.wav (Pro Windows CD verzi Simon 1) - compress_agos simon2.voc (Pro DOS CD verzi Simon 2) - compress_agos simon2.wav (Pro Windows CD verzi Simon 2) - compress_agos mac (Pro Macintosh verzi Simon 2) - - compress_agos voices1.wav (Pro Windows verzi Feeble na 2CD/4CD) - compress_agos voices2.wav (Pro Windows verzi Feeble na 2CD/4CD) - compress_agos voices3.wav (Pro Windows verzi Feeble na 4CD) - compress_agos voices4.wav (Pro Windows verzi Feeble na 4CD) - - compress_agos Music (Pro Windows verzi Puzzle Pack) - -Pro Ogg Vorbis pĹidejte k volbĂĄm --vorbis, tj. - - compress_agos --vorbis - -Pro Flac pĹidejte k volbĂĄm --flac a dodateÄnĂŠ parametry, tj. - - compress_agos --flac - -Nakonec dostanete mnohem menĹĄĂ soubor *.mp3, *.ogg nebo *.fla, zkopĂrujte ho do VaĹĄĂ sloĹžky hry. StarĂ˝ soubor mĹŻĹžete bezpeÄnĂŠ odebrat. - - -7.8.7) KomprimovĂĄnĂ ĹeÄi/hudby v Broken Sword: ------- --------------------------------------- -NĂĄstroj 'compress_sword1' z balĂÄku scummvm-tools mĹŻĹže pĹevĂŠst hudbu a ĹeÄ do MP3, Ogg Vorbis a takĂŠ Flac. NejsnadnÄjĹĄĂm zpĹŻsobem, jak soubory pĹevĂŠst, je prostĂŠ zkopĂrovĂĄnĂ spouĹĄtÄÄe do VaĹĄĂ sloĹžky BS1 (spolu s kodĂŠrem lame) a pak ho odsud spustit. Tak bude vĹĄechno automaticky pĹevedeno na MP3. PotĂŠ, mĹŻĹžete ruÄnÄ odstranit soubory SPEECH?.CLU a hudebnĂ soubory wave. - -SpuĹĄtÄnĂm "compress_sword1 --vorbis" soubory zkomprimuje pomocĂ Ogg Vorbis mĂsto MP3. - -SpuĹĄtÄnĂm "compress_sword1 --flac" soubory zkomprimuje pomocĂ Flac -mĂsto MP3. - -PouĹžijte "compress_sword1 --help", abyste dostali ĂşplnĂ˝ seznam moĹžnostĂ. - - -7.8.8) KomprimovĂĄnĂ ĹeÄi/hudby v Broken Sword II: ------- ------------------------------------------ -Pro tento Ăşkol pouĹžijte nĂĄĹĄ nĂĄstroj 'compress_sword2'. MĹŻĹžete volit mezi nÄkolika cĂlovĂ˝mi formĂĄty, ale nezapomeĹte, Ĺže je mĹŻĹžete pouĹžĂt pouze tehdy, kdyĹž ScummVM byl sestaven se zapnutou podporou konkrĂŠtnĂho dekodĂŠru. - - compress_sword2 speech1.clu - compress_sword2 music1.clu - -Pro Ogg Vorbis pĹidejte --vorbis k moĹžnostem, tj. - - compress_sword2 --vorbis - -Nakonec budete mĂt mnohem menĹĄĂ soubor *.cl3 nebo *.clg, tento soubor zkopĂrujte do sloĹžky hry. StarĂ˝ soubor mĹŻĹžete bezpeÄnĂŠ odstranit. - -Je moĹžnĂŠ pouĹžĂt Flac pro komprimaci pĹidĂĄnĂm moĹžnosti by --flac. NicmĂŠnÄ vĂ˝slednĂ˝ soubor *.clf je ve skuteÄnosti vÄtĹĄĂ neĹž pĹŻvodnĂ. - -NezapomeĹte, prosĂm, Ĺže compress_sword2 bude fungovat pouze se ÄtyĹmi soubory ĹeÄi/hudby v Broken Sword II. Nebude fungovat s dalĹĄĂmi soubory *.clu, ani nebude fungovat se soubory ĹeÄi z Broken Sword. - - -7.9) VĂ˝stupnĂ vzorkovacĂ kmitoÄet: ----- ----------------------------- -VĂ˝stupnĂ vzorkovacĂ kmitoÄet ĹĂkĂĄ ScummVM, kolik vzorkĹŻ zvuku mĂĄ hrĂĄt v kanĂĄlu za sekundu. Je toho hodnÄ, co by se dalo ĹĂct o tomto tĂŠmatu, ale vÄtĹĄina toho je zde nepodstatnĂŠ. KrĂĄtkĂĄ verze je, Ĺže vÄtĹĄinÄ her staÄĂ 22050 Hz, ale v nÄkterĂ˝ch pĹĂpadech je lepĹĄĂ 44100 Hz. Na extrĂŠmnÄ pomalĂ˝ch systĂŠmech byste radÄji mÄli pouĹžĂt 11025 Hz, ale je nepravdÄpodobnÄ, Ĺže byste se s tĂmto museli zabĂ˝vat. - -Abychom to rozvedli, vÄtĹĄina zvukĹŻ, kterĂŠ ScummVM musĂ pĹehrĂĄt, byla vzorkovĂĄna buÄ na 22050 Hz, nebo 11025 Hz. PouĹžitĂm vyĹĄĹĄĂho kmitoÄtu jako kouzlem nezvýťà kvalitu tÄchto zvukĹŻ. Proto je 22050 Hz v poĹĂĄdku. - -NÄkterĂŠ hry pouĹžĂvajĂ CD audio. Pokud pro toto pouĹžĂvĂĄte komprimovanĂŠ soubory, jsou pravdÄpodobnÄ vzorkovanĂ˝ na kmitoÄtu 44100 Hz, takĹže pro tyto hry je toto pravdÄpodobnÄ lepĹĄĂ volba kmitoÄtu. - -PĹi pouĹžitĂ ovladaÄĹŻ hudby AdLib, FM Towns, PC Speaker nebo IBM PCjr je -ScummVM zodpovÄdnĂ˝ za vytvĂĄĹenĂ vzorkĹŻ. VÄtĹĄinou bude 22050 Hz staÄit, ale existuje alespoĹ jedna stopa hudby AdLib Beneath a Steel Sky, kterĂĄ znĂ lĂŠpe pĹi 44100 Hz. - -PouĹžitĂ kmitoÄtĹŻ mezi nenĂ doporuÄeno. Za prvĂŠ VaĹĄe zvukovĂĄ karta ho nemusĂ podporovat. Teoreticky by se ScummVM mÄl vrĂĄtit k rozumnĂŠmu kmitoÄtu, ale nespolĂŠhejte na to. DĹŻleĹžitÄjĹĄĂ je ale to, Ĺže ScummVM musĂ pĹevzorkovat vĹĄechny zvuky na jejich vĂ˝stupnĂ kmitoÄet. To je mnohem snadnÄjĹĄĂ k provedenĂ, kdyĹž vĂ˝stupnĂ kmitoÄet je nĂĄsobkem pĹŻvodnĂho. - - -8.0) Soubor s nastavenĂm: ----- -------------------- -StandardnÄ je soubor s nastavenĂm uloĹžen a naÄĂtĂĄn: - - Windows Vista/7: - \Users\jmĂŠno uĹživatele\AppData\Roaming\ScummVM\scummvm.ini, - - Windows 2000/XP: - \Documents and Settings\jmĂŠno uĹž\Application Data\ScummVM\scummvm.ini - - Windows NT4: - <sloĹžkawin>\Profiles\jmĂŠno uĹž\Application Data\ScummVM\scummvm.ini, - - Windows 95/98/ME: - <sloĹžkawin>\scummvm.ini, - - Pokud ve Windows nainstalovĂĄna dĹĂvÄjĹĄĂ verze ScummVM bude ponechĂĄno dĹĂvÄjĹĄĂ umĂstÄnĂ '<sloĹžkawin>\scummvm.ini'. - - Unix: - ~/.scummvmrc - - Mac OS X: - ~/Library/Preferences/ScummVM Preferences - (zde ~ oznaÄuje VaĹĄi domovskou sloĹžku) - - DalĹĄĂ: - scummvm.ini v souÄasnĂŠ sloĹžce - -VzorovĂ˝ soubor s nastavenĂm vypadĂĄ takto: - - [scummvm] - gfx_mode=supereagle - fullscreen=true - savepath=C:\saves\ - - [sky] - path=C:\games\SteelSky\ - - [germansky] - gameid=sky - language=de - path=C:\games\SteelSky\ - description=Beneath a Steel Sky w/ German subtitles - - [germandott] - gameid=tentacle - path=C:\german\tentacle\ - description=German version of DOTT - - [tentacle] - path=C:\tentacle\ - subtitles=true - music_volume=40 - sfx_volume=255 - - [loomcd] - cdrom=1 - path=C:\loom\ - talkspeed=5 - savepath=C:\loom\saves\ - - [monkey2] - path=C:\amiga_mi2\ - music_driver=windows - -8.1) RozpoznĂĄvanĂĄ klĂÄovĂĄ slova nastavenĂ ----- ------------------------------------ -Jsou rozpoznĂĄvĂĄna nĂĄsledujĂcĂ klĂÄovĂĄ slova: - - path ĹetÄzec Cesta, kde jsou umĂstÄny datovĂŠ soubory hry - autosave_period ÄĂslo VteĹiny mezi autouklĂĄdĂĄnĂm (vĂ˝chozĂ: 300) - save_slot ÄĂslo ÄĂslo uloĹženĂŠ, kterĂŠ pĹi spuĹĄtÄnĂ naÄĂst. - savepath ĹetÄzec Cesta, kde hra bude uklĂĄdat uloĹženĂŠ hry. - versioninfo ĹetÄzec Verze ScummVM, kterĂĄ vytvoĹila soubor. - gameid ĹetÄzec SkuteÄnĂŠ id hry. UĹžiteÄnĂŠ, pokud mĂĄte nÄkolik verzĂ stejnĂŠ hry a chcete pro nÄ rĹŻznĂŠ pĹezdĂvky. Viz pĹĂklad. - description ĹetÄzec Popis hry jak se zobrazĂ ve spouĹĄtÄÄi. - language ĹetÄzec UrÄĂ jazyk (en, us, de, fr, it, pt, es, - jp, zh, kr, se, gb, hb, cz, ru) - speech_mute boolean Pokud true, ĹeÄ je ztlumena - subtitles boolean Pokud true jsou titulky zapnuty. - talkspeed ÄĂslo ZpoĹždÄnĂ textu v hrĂĄch SCUMM, nebo rychlost textu v jinĂ˝ch hrĂĄch. - fullscreen boolean ReĹžim celĂŠ obrazovky - aspect_ratio boolean Povolit korekci pomÄru stran - gfx_mode ĹetÄzec GrafickĂ˝ reĹžim (normĂĄlnĂ, 2x, 3x, 2xsai, super2xsai, supereagle, advmame2x, advmame3x,hq2x, hq3x, tv2x, dotmatrix) - confirm_exit boolean Zeptat se uĹživatele na potvrzenĂ pĹed ukonÄenĂm (pouze jĂĄdro SDL). - console boolean Povolit okno konzole (vĂ˝chozĂ: zapnuto) (pouze Windows). - cdrom ÄĂslo ÄĂslo jednotky CD-ROM, kterou pouĹžĂt pro zvuk. Pokud je zĂĄpornĂŠ, k pokusu o pĹĂstup k CD-ROM nedojde. - joystick_num ÄĂslo ÄĂslo zaĹĂzenĂ joysticku, kterĂŠ pouĹžĂt pro vstup - music_driver ĹetÄzec KterĂŠ hudebnĂ jĂĄdro pouĹžĂt. - opl_driver ĹetÄzec KterĂ˝ emulĂĄtor AdLib (OPL) pouĹžĂt. - output_rate ÄĂslo KterĂ˝ vĂ˝stupnĂ vzorkovacĂ kmitoÄet pouĹžĂt v Hz. RozumnĂŠ hodnoty jsou 11025, 22050 a 44100. - alsa_port ĹetÄzec KterĂ˝ port pouĹžĂt pro vĂ˝stup pĹi pouĹžitĂ hudebnĂho ovladaÄe ALSA. - music_volume ÄĂslo NastavenĂ hlasitosti hudby (0-255) - multi_midi boolean Pokud true, jsou povoleny smĂĹĄenĂ˝ AdLib a pĹŻvodnĂ MIDI. - soundfont ĹetÄzec KterĂ˝ SoundFont pouĹžĂt pro pĹehrĂĄvĂĄnĂ MIDI. (PodporovĂĄno pouze nÄkterĂ˝mi ovladaÄi MIDI.) - native_mt32 boolean Pokud true, zakĂĄĹže emulaci GM a pĹedpoklĂĄdĂĄ, Ĺže je dostupnĂ˝ pravĂ˝ Roland MT-32. - enable_gs boolean Pokud true, povolĂ funkce urÄenĂŠ pro Roland GS ke zlepĹĄenĂ emulace GM. Pokud je native_mt32 takĂŠ nastaven na true, zaĹĂzenĂ GS zvolĂ mapu MT-32 pro pĹehrĂĄvĂĄnĂ sprĂĄvnĂ˝ch instrumentĹŻ. - sfx_volume ÄĂslo NastavenĂ hlasitosti zvuku (0-255) - tempo ÄĂslo Rychlost hudby (50-200) (vĂ˝chozĂ: 100) - speech_volume ÄĂslo NastavenĂ hlasitosti ĹeÄi (0-255) - midi_gain ÄĂslo ZvýťenĂ MIDI (0-1000) (vĂ˝chozĂ: 100) (PodporovĂĄno pouze nÄkterĂ˝mi ovladaÄi MIDI.) - copy_protection boolean PovolĂ ochranu proti kopĂrovĂĄnĂ v urÄitĂ˝ch hrĂĄch, kde by ji ScummVM standardnÄ zakĂĄzal. - demo_mode boolean Spustit demoverzi v Maniac Mansion - alt_intro boolean PouĹžĂt alternativnĂ Ăşvod pro CD verze Beneath a Steel Sky a Flight of the Amazon Queen - boot_param ÄĂslo PĹedĂĄ toto ÄĂslo zavĂĄdÄcĂmu skriptu - -Hry Sierra pouĹžĂvajĂcĂ jĂĄdro AGI pĹidĂĄvajĂ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo: - -originalsaveload boolean Pokud true, jsou pouĹžity pĹŻvodnĂ obrazovky nahrĂĄvĂĄnĂ/uloĹženĂ mĂsto vylepĹĄenĂ˝ch ze ScummVM - -Hry Sierra pouĹžĂvajĂcĂ jĂĄdro SCI pĹidĂĄvajĂ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova: - - disable_dithering boolean Odstranit artefakty chvÄnĂ v nÄkterĂ˝ch hrĂĄch EGA - prefer_digitalsfx boolean Pokud true, jsou upĹednostĹovĂĄny digitĂĄlnĂ zvukovĂŠ efekty pĹed syntetizovanĂ˝mi - originalsaveload boolean Pokud true, jsou pouĹžity pĹŻvodnĂ obrazovky nahrĂĄvĂĄnĂ/uloĹženĂ mĂsto vylepĹĄenĂ˝ch ze ScummVM - native_fb01 bool Pokud true, je ovladaÄ hudby pro kartu IBM Music Feature nebo modul syntetizĂĄtoru Yahama FB-01 FM pouĹžit jako vĂ˝stup MIDI -Broken Sword II pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova: - - gfx_details ÄĂslo NastavenĂ grafickĂ˝ch detailĹŻ (0-3) - music_mute boolean Pokud true, hudba je ztlumena - object_labels boolean Pokud true, popisky objektĹŻ jsou povoleny - reverse_stereo boolean Pokud true, kanĂĄly stereo jsou obrĂĄceny - sfx_mute boolean Pokud true, zvukovĂŠ efekty jsou ztlumeny - -Flight of the Amazon Queen pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova: - - music_mute boolean Pokud true, hudba je ztlumena - sfx_mute boolean Pokud true, zvukovĂŠ efekty jsou ztlumeny - -Jones in the Fast Lane pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo: - - music_mute boolean Pokud true, je pouĹžito CD audio mĂsto zvukĹŻ ve hĹe - -King's Quest VI Windows pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo: - - windows_cursors boolean Pokud true, jsou pouĹžity pĹŻvodnĂ ÄernobĂlĂŠ kurzory mĂsto kurzorĹŻ z DOS. Pokud false, jsou ve verzi Windows pouĹžity kurzory DOS, zvÄtĹĄenĂŠ, aby se shodovaly se zbytkem zvÄtĹĄenĂŠ grafiky - -Lands of Lore: The Throne of Chaos pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova: - - smooth_scrolling boolean Pokud true, je posunovĂĄnĂ pĹi zmÄnÄ z jednĂŠ obrazovky na druhou plynulejĹĄĂ - floating_cursors boolean Pokud true, je kurzor zmÄnÄn na smÄrovou ĹĄipku pĹi najetĂ na okraj obrazovky. HrĂĄÄ pak mĹŻĹže kliknout pro pohyb v tomto smÄru. - -Space Quest IV CD pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo: - - silver_cursors boolean Pokud true, je mĂsto pĹŻvodnĂch zlatĂ˝ch kurzorĹŻ pouĹžita alternativnĂ sada stĹĂbrnĂ˝ch - -Simon the Sorcerer 1 a 2 pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova: - - music_mute boolean Pokud true, hudba je ztlumena - sfx_mute boolean Pokud true, zvukovĂŠ efekty jsou ztlumeny - -The Legend of Kyrandia pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo: - - walkspeed celĂŠ ÄĂslo Rychlost chĹŻze (0-4) - -The Legend of Kyrandia: The Hand of Fate pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo: - - walkspeed ÄĂslo Rychlost chĹŻze (3 nebo 5, coĹž znamenĂĄ - rychle nebo pomalu) - -The Legend of Kyrandia: Malcolm's Revenge pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova: - - walkspeed ÄĂslo Rychlost chĹŻze (3 nebo 5, coĹž znamenĂĄ - rychle nebo pomalu) - studio_audience boolean Pokud true, je slyĹĄet potlesk a smĂch kdykoliv Malcolm provede nÄco vtipnĂŠho - skip_support boolean Pokud true, hrĂĄÄ mĹŻĹže pĹeskakovat text a scĂŠny hry - helium_mode boolean Pokud true, lidĂŠ znÄjĂ tak, jakoby se nadĂ˝chali hĂŠlia - -The 7th Guest pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo: - - fast_movie_speed boolean Pokud true, jsou videa pĹehrĂĄvĂĄna pĹi zvýťenĂŠ - rychlosti, stejnĂŠ jako ve verzi pro iOS. - Videa bez zvuku jsou stĂĄle pĹehrĂĄvĂĄna pĹi - normĂĄlnĂ rychlosti, aby nedoĹĄlo k desynchronizaci - hudby - -8.2) VlastnĂ hernĂ volby, kterĂŠ mohou bĂ˝t pĹepĂnĂĄny pomoci grafickĂŠho ----- ---------------------------------------------------------------- -rozhranĂ --------- -Mnoho vlastnĂch hernĂch voleb v pĹedchozĂ ÄĂĄsti mĹŻĹže bĂ˝t pĹepnuto pĹes grafickĂŠ rozhranĂ. Pokud je takovĂĄto volba pro urÄitou hru dostupnĂĄ, objevĂ se karta "JĂĄdro" pĹi pĹidĂĄvĂĄnĂ nebo ĂşpravÄ nastavenĂ tĂŠto hry. -Pokud vlastnĂ moĹžnosti nejsou zobrazeny, musĂ bĂ˝t konkrĂŠtnĂ hry spuĹĄtÄny jednou nebo znovu pĹidĂĄny do seznamu her spouĹĄtÄÄe ScummVM. Toto aktualizuje nastavenĂ kaĹždĂŠ poloĹžky, ÄĂmĹž umoĹžnĂ zobrazenĂ vlastnĂch voleb. - -9.0) SestavenĂ: ----- ---------- -Pro aktuĂĄlnĂ pĹehled o tom, jak ScummVM sestavit pro rĹŻznĂŠ platformy, prohlĂŠdnÄte si, prosĂm, naĹĄĂ Wiki, zvlĂĄĹĄtÄ tuto strĂĄnku: - - http://wiki.scummvm.org/index.php/Compiling_ScummVM - -Pokud sestavujete ve Windows, Linux nebo Mac OS X, potĹebujete SDL-1.2.2 -Nebo novÄjĹĄĂ (starĹĄĂ verze mohou fungovat, ale nejsou podporovĂĄny) a podporovanĂ˝ kompilĂĄtor. VÄtĹĄina kompilĂĄtorĹŻ, vÄetnÄ GCC, mingw a novÄjĹĄĂch verzĂ Microsoft Visual C++ jsou podporovĂĄny. Pokud chcete pouĹžĂt stopy CD komprimovanĂŠ do MP3 nebo soubory .SOU, musĂte nainstalovat knihovnu MAD; podobnÄ potĹebujete vhodnĂŠ knihovny pro komprimovanĂ˝ zvuk pomocĂ Ogg Vorbis a FLAC. Pro komprimovanĂŠ uloĹženĂŠ stavy je potĹeba mĂt zlib. - -NÄkterĂŠ ÄĂĄsti ScummVM, zvlĂĄĹĄtÄ zvÄtĹĄovaÄe, majĂ vysoce optimalizovanĂŠ verze napsanĂŠ v assembleru. Pokud si pĹejete tuto moĹžnost pouĹžĂt, potĹebuje mĂt nainstalovĂĄn assembler nasm (viz http://nasm.sf.net). NezapomeĹte, Ĺže v souÄasnosti mĂĄme pouze verze optimalizovanĂŠ pro x86 MMX, a nebudou sestaveny pro jinĂŠ procesory. - -Na Win9x/NT/XP mĹŻĹžete urÄit USE_WINDBG a pĹipojit WinDbg pro prochĂĄzenĂ ladĂcĂch zprĂĄv (viz http://www.sysinternals.com/ntw2k/freeware/debugview.shtml). - - GCC a MinGW32: - * Zadejte "./configure" - * Zadejte "make" (nebo "gmake", Äi "gnumake", v zĂĄvislosti na tom, jak je GNU make ve VaĹĄem systĂŠmu nazvĂĄn) a ScummVM snad bude pro VĂĄs sestaven. - * Pro dalĹĄĂ informace si prohlĂŠdnÄte: - http://wiki.scummvm.org/index.php/Compiling_ScummVM/GCC - Äi - http://wiki.scummvm.org/index.php/Compiling_ScummVM/MinGW - - Microsoft Visual C++ 8/9/10: - * PĹeÄtÄte si, jak vytvoĹit soubory projektu ve "dists\msvc8", - "dists\msvc9" pĹĂsluĹĄnÄ "dists\msvc10". - * OtevĹete vĂ˝slednĂ˝ soubor projektu. - * Zadejte cestu k potĹebnĂ˝m knihovnĂĄm a hlsiÄkovĂ˝m souborĹŻm v - Tools|Options|Projects and Solutions|VC++ Directories". - * TeÄ by program mÄl bĂ˝t ĂşspÄĹĄnÄ sestaven. - * Pro dalĹĄĂ informace si prohlĂŠdnÄte: - http://wiki.scummvm.org/index.php/Compiling_ScummVM/VS2005 - - Windows Mobile: - * PĹeÄtÄte si prosĂm: - http://wiki.scummvm.org/index.php/Compiling_ScummVM/Windows_CE - - Mac OS X: - * UjistÄte se, Ĺže mĂĄte nainstalovĂĄny nĂĄstroje pro vĂ˝vojĂĄĹe. - * BalĂÄek SDL pro vĂ˝vojĂĄĹe na OS X, kterĂ˝ je dostupnĂ˝ na strĂĄnce SDL _nenĂ_ vhodnĂ˝. SpĂĹĄe potĹebujete sestavenĂ v unixovĂŠm stylu. Jeden takovĂ˝ zpĹŻsob, jak ho nainstalovat je pomocĂ Fink - (http://fink.sf.net). TakĂŠ mĹŻĹžete SDL sestavit ruÄnÄ ze zdrojovĂŠho kĂłdu pomocĂ systĂŠmu sestavenĂ pro unix (configure a make). - * Ve sloĹžce ScummVM zadejte "./configure". - * NynĂ mĹŻĹžete zadat 'make' pro vytvoĹenĂ spouĹĄtÄÄe pĹĂkazovĂŠho ĹĂĄdku. - * Abyste zĂskali verzi, kterou mĹŻĹžete spustit z Finder, zadejte 'make bundle' coĹž vytvoĹĂ ScummVM.app (to funguje pouze, kdyĹž mĂĄte SDL nainstalovĂĄn do /sw, coĹž se pĹi instalaci Fink provede). Pokud jste SDL nainstalovali jinĂ˝m zpĹŻsobem, budete muset upravit ports.mk). - * Pro dalĹĄĂ informace si prohlĂŠdnÄte: - http://wiki.scummvm.org/index.php/Compiling_ScummVM/MacOS_X_Crosscompiling - - AmigaOS 4 (KĹĂĹžovĂĄ kompilace pomocĂ Cygwin): - * UjistÄte se, Ĺže mĂĄte nainstalovĂĄn SDL, mĹŻĹžete takĂŠ potĹebovat - libogg, libvorbis, libvorbisfile, zlib, libmad. - * Zadejte ./configure --host=ppc-amigaos - * Pokud dostanete chybu o sdl-config, pouĹžijte parametr --with-sdl-prefix pro nastavenĂ cesty. - * Zkontrolujte soubor 'config.mk' a pokud je vĹĄe v poĹĂĄdku: - * SpusĹĽte 'make'. - * KĹĂĹžovĂĄ kompilace pomocĂ Linux mĹŻĹže bĂ˝t takĂŠ tak lehkĂĄ. - - iPhone: - * PĹeÄtÄte si prosĂm: - http://wiki.scummvm.org/index.php/Compiling_ScummVM/iPhone - - Maemo: - * Nainstalujte Maemo SDK s rootstrap 4.1.2 - * Nainstalujte libmad, Tremor, FLAC ze zdroje - * SpusĹĽte 'ln -s backends/platform/maemo/debian' - * Aktualizujte debian/changelog - * SpusĹĽte 'sb2 dpkg-buildpackage -b' - ------------------------------------------------------------------------- -HodnÄ Ĺ tÄstĂ a Ĺ ĹĽastnĂŠ AdventurovĂĄnĂ! -TĂ˝m ScummVM. -http://www.scummvm.org/ ------------------------------------------------------------------------- - - - - +PĹEÄTIMÄ ScummVM
+------------------------------------------------------------------------
+
+Pro vĂce informacĂ, seznamy kompatibility, podrobnosti o dotacĂch, nejnovÄjĹĄĂ verze,
+novinky o vĂ˝voji a dalĹĄĂ, prosĂm navĹĄtivte domovskou strĂĄnku ScummVM na: http://www.scummvm.org/
+
+
+Obsah:
+------
+1.0) Ăvod
+ * 1.1 O ScummVM
+ * 1.2 RychlĂ˝ nĂĄvod
+2.0) Kontakt
+ * 2.1 HlĂĄĹĄenĂ chyb
+3.0) PodporovanĂŠ hry
+ * 3.1 Ochrana proti kopĂrovĂĄnĂ
+ * 3.2 PoznĂĄmky ke hrĂĄm Commodore64
+ * 3.3 PoznĂĄmky k Maniac Mansion NES
+ * 3.4 PoznĂĄmky ke hrĂĄm Macintosh
+ * 3.5 PoznĂĄmky ke hrĂĄm Multi-CD
+ * 3.6 PoznĂĄmky k The Curse of Monkey Island
+ * 3.7 PoznĂĄmky ke hrĂĄm Broken Sword
+ * 3.8 PoznĂĄmky k Beneath a Steel Sky
+ * 3.9 PoznĂĄmky k Flight of the Amazon Queen
+ * 3.10 PoznĂĄmky ke Gobliiins
+ * 3.11 PoznĂĄmky k Inherit the Earth: Quest for the Orb
+ * 3.12 PoznĂĄmky k Simon the Sorcerer
+ * 3.13 PoznĂĄmky k The Feeble Files
+ * 3.14 PoznĂĄmky k The Legend of Kyrandia
+ * 3.15 PoznĂĄmky k PĹedvĂdavĂŠmu VstupnĂmu Dialogu her Sierra AGI
+ * 3.16 PoznĂĄmky k Mickey's Space Adventure
+ * 3.17 PoznĂĄmky k Winnie the Pooh
+ * 3.18 PoznĂĄmky k Troll's Tale
+ * 3.19 PoznĂĄmky k DraÄĂ Historie
+ * 3.20 Titulky a hlasy soubÄĹžnÄ v hrĂĄch Sierra SCI
+ * 3.21 ZnĂĄmĂŠ problĂŠmy
+4.0) PodporovanĂŠ platformy
+5.0) SpuĹĄtÄnĂ ScummVM
+ * 5.1 MoĹžnosti pĹĂkazovĂŠho ĹĂĄdku
+ * 5.2 Volby jazyka
+ * 5.3 GrafickĂŠ filtry
+ * 5.4 GlobĂĄlnĂ menu
+ * 5.5 KlĂĄvesovĂŠ zkratky
+6.0) UloĹženĂŠ hry
+ * 6.1 AutomatickĂŠ uklĂĄdĂĄnĂ
+ * 6.2 PĹevod uloĹženĂ˝ch her
+ * 6.3 ZobrazenĂ/NaÄtenĂ uloĹženĂ˝ch her z pĹĂkazovĂŠho ĹĂĄdku
+7.0) Hudba a zvuk
+ * 7.1 Emulace AdLib
+ * 7.2 Emulace FluidSynth MIDI
+ * 7.3 Emulace MT-32
+ * 7.4 Emulace MIDI
+ * 7.5 PĹirozenĂĄ podpora MIDI
+ * 7.6 Podpora nativnĂho UNIX, ALSA a sekvencĂŠru dmedia
+ * 7.7 Podpora MIDI serveru TiMidity++
+ * 7.8 PouŞità komprimovaných zvukových souborů (MP3, Ogg Vorbis, Flac)
+ * 7.9 VĂ˝stupnĂ vzorkovacĂ kmitoÄet
+8.0) Soubor s nastavenĂm
+ * 8.1 RozpoznĂĄvanĂĄ klĂÄovĂĄ slova nastavenĂ
+ * 8.2 VlastnĂ hernĂ volby, kterĂŠ mohou bĂ˝t pĹepĂnĂĄny pomoci grafickĂŠho rozhranĂ
+9.0) SestavenĂ
+
+
+1.0) Ăvod:
+---- -----
+
+1.1) O ScummVM:
+---- ----------
+ScummVM je program, kterĂ˝ VĂĄm umoĹžĹuje spouĹĄtÄt urÄitĂŠ klasickĂŠ grafickĂŠ point-and-click adventury, za pĹedpokladu, Ĺže jiĹž mĂĄte jejich datovĂŠ soubory. A teÄ ta chytrĂĄ ÄĂĄst: ScummVM jenom nahrazuje spouĹĄtÄÄe, kterĂŠ jsou dodĂĄvĂĄny se hrou, coĹž VĂĄm umoĹžĹuje hrĂĄt hry v systĂŠmech, pro kterĂŠ nikdy nebyly navrĹženy!
+
+PĹŻvodnÄ byl navrĹžen pro spouĹĄtÄnĂ her SCUMM od LucasArts SCUMM, jako napĹ. Maniac Mansion, Monkey Island, Day of the Tentacle nebo Sam and Max. SCUMM znamenĂĄ 'NĂĄstroj pro VytvĂĄĹenĂ Skriptu pro Maniac Mansion', coĹž byla prvnĂ hra, pro kterou LucasArts tento systĂŠm navrhl. A mnohem pozdÄji dal svĂŠ jmĂŠno ScummVM ('VM' znamenĂĄ VirtuĂĄlnĂ Stroj).
+
+Postupem Äasu byla pĹidĂĄna podpora pro spoustu her mimo SCUMM a
+ScummVM nynĂ takĂŠ podporuje mnoho AGI a SCI her od Sierra (napĹ. King's
+Quest 1-6, Space Quest 1-5, ...), Discworld 1 a 2, Simon the Sorcerer 1 and 2, Beneath A Steel Sky, Lure of the Temptress, Broken Sword I a II, Flight of the Amazon Queen, Gobliiins 1-3, sĂŠrie The Legend of Kyrandia, mnoho ze SCUMM her pro dÄti od Humongous Entertainment (vÄetnÄ her Freddi Fish a Putt Putt) a mnoho dalĹĄĂch. Na strĂĄnce kompatibility mĹŻĹžete najĂt ĂşplnĂ˝ seznam s podrobnostmi, kterĂŠ adventury jsou podporovĂĄny a jak dobĹe. ScummVM je neustĂĄle zlepĹĄovĂĄn a proto navĹĄtÄvujte naĹĄe strĂĄnky Äasto.
+
+Mezi systĂŠmy, na kterĂ˝ch mĹŻĹžete tyto hrĂĄt, jsou bÄĹžnĂŠ stolnĂ poÄĂtaÄe (majĂcĂ Windows, Linux, Mac OS X, ...), hernĂ konzole
+(Dreamcast, Nintendo DS a Wii, PS2, PSP, ...), chytrĂŠ telefony (Android,
+iPhone, PocketPC, Symbian ...) a dalĹĄĂ.
+
+V souÄasnosti je ScummVM stĂĄle velkou ÄĂĄstĂ ve vĂ˝voji. NezapomeĹte, Ĺže i kdyĹž se snaĹžĂme zajistit, aby mnoho her bylo moĹžno dokonÄit pouze s pĂĄr vĂĄĹžnĂ˝mi chybami, pĂĄdy programu mohou nastat a my neposkytujeme ŞådnĂŠ zĂĄruky. PĹes to vĹĄechno, nÄkterĂŠ hry byly podporovĂĄny po dlouhou dobu
+A mÄly by fungovat v poĹĂĄdku se vĹĄemi novÄjĹĄĂmi stabilnĂmi verzemi. Jak dobĹe bude hra ve ScummVM fungovat mĹŻĹžete zjistit prohlĂŠdnutĂm strĂĄnky kompatibility.
+VlastnÄ, pokud troĹĄiÄku zahledĂĄte, mĹŻĹžete zjistit, Ĺže ScummVM je pouĹžĂvĂĄn i komerÄnÄ pro znovu vydĂĄnĂ nÄkterĂ˝ch podporovanĂ˝ch her na modernĂch platformĂĄch. To ukazuje, Ĺže i nÄkolik spoleÄnostĂ je spokojeno s kvalitou softwaru a jako moc dobĹe mĹŻĹže nÄkterĂŠ hry spouĹĄtÄt.
+
+Pokud mĂĄte ScummVM rĂĄdi, mĹŻĹžete ho podpoĹit dotacĂ pomocĂ tlaÄĂtka PayPal na strĂĄnce ScummVM. To nĂĄm pomĹŻĹže zakoupit nĂĄstroje potĹebnĂŠ ke snadnÄjĹĄĂmu a rychlejĹĄĂmu vĂ˝voji ScummVM. Pokud nemĹŻĹžete podpoĹit dotacĂ, pomozte a pĹispÄjte zĂĄplatou!
+
+1.2) RychlĂ˝ nĂĄvod:
+---- -------------
+Pro ty netrpÄlivĂŠ z VĂĄs je tu nĂĄvod, jak ScummVM spustit v nÄkolika krocĂch.
+
+1. StĂĄhnÄte si ScummVM z <http://www.scummvm.org/downloads.php> a nainstalujte ho.
+
+2. Na VaĹĄem pevnĂŠm disku vytvoĹte sloĹžku a zkopĂrujte datovĂŠ soubory z pĹŻvodnĂho mĂŠdia do tĂŠto sloĹžky. Zopakujte pro vĹĄechny hry, kterĂŠ chcete hrĂĄt
+
+3. SpusĹĽte ScummVM, zvolte 'PĹidat hru', zvolte adresĂĄĹ s datovĂ˝mi soubory hry (nesnaĹžte se volit datovĂŠ soubory samotnĂŠ!) a stisknÄte
+'Zvolit'.
+
+4. MÄlo by se objevit dialogovĂŠ okno umoĹžĹujĂcĂ VĂĄm pozmÄnit rĹŻznĂĄ nastavenĂ, pokud tak chcete (i kdyĹž by mÄlo bĂ˝t v poĹĂĄdku vĹĄechno nechat ve vĂ˝chozĂm nastavenĂ). DialogovĂŠ okno potvrÄte.
+
+5. VÂ seznamu vyberte hru, kterou chcete hrĂĄt a stisknÄte 'Spustit'.
+
+V budoucnu byste mÄli bĂ˝t schopni pĹeskoÄit na krok 5, pokud nechcete pĹidat dalĹĄĂ hry.
+
+Rada: Pokud chcete pĹidat vĂce her najednou, zkuste stisknout a drĹžet klĂĄvesu shift pĹedtĂm, neĹž kliknete na 'PĹidat hru' â tlaÄĂtko se zmÄnĂ na 'HromadnĂŠ PĹidĂĄnĂ' a pokud ho stisknÄte, jste znovu poŞådĂĄni o zvolenĂ sloĹžky, ale tentokrĂĄt ScummVM prohledĂĄ vĹĄechny podsloĹžky pro podporovanĂŠ hry.
+
+
+2.0) Kontakt:
+---- --------
+NejjednoduĹĄĹĄĂm zpĹŻsobem, jak kontaktovat tĂ˝m ScummVM je pĹedloĹženĂm hlĂĄĹĄenĂ o chybÄ (viz oddĂl 2.1) nebo pouĹžitĂm naĹĄich fĂłr na http://forums.scummvm.org .
+MĹŻĹžete se takĂŠ pĹipojit a odesĂlat a e-maily na korespondenÄnĂ seznam scummvm-devel, nebo s nĂĄmi chatovat na IRC (#scummvm na irc.freenode.net) NeŞådejte nĂĄs, prosĂm, o podporu nefungujĂcĂ hry â nejdĹĂve si pĹeÄtÄte nejÄastÄjĹĄĂ otĂĄzky na naĹĄĂ strĂĄnce
+
+2.1) HlĂĄĹĄenĂ chyb:
+---- -------------
+Abyste mohli nahlĂĄsit chybu, nejdĹĂve si, prosĂme, vytvoĹte si ĂşÄet na SourceForge a kliknÄte na odkaz "Bug Tracker" na naĹĄĂ strĂĄnce. UjistÄte se, prosĂm, Ĺže se chyba dĂĄ znovu zjistit a stĂĄle se objevuje v nejnovÄjĹĄĂ verzi git/dennĂho sestavenĂ. TakĂŠ na naĹĄĂ strĂĄnce zkontrolujte seznam znĂĄmĂ˝ch problĂŠmĹŻ (nĂĹže) a seznam kompatibility pro tuto hru, abyste se ujistili, Ĺže problĂŠm jiĹž nenĂ znĂĄm:
+
+ http://www.scummvm.org/compatibility
+
+ProsĂme, nenahlaĹĄujte chyby ve hrĂĄch, kterĂŠ nejsou v seznamu v sekci 'Supported Games' nebo seznamu kompatibility uvedeny jako dokonÄitelnĂŠ. My âvĂme-, Ĺže tyto hry majĂ chyby.
+
+ZahrĹte, prosĂm, nĂĄsledujĂcĂ informace:
+ - Verzi ScummVM (PROSĂME, vyzkouĹĄejte nejnovÄjĹĄĂ sestavenĂ git/Daily)
+ - Podrobnosti o chybÄ, vÄetnÄ postupu na jejĂ znovu opakovĂĄnĂ
+ - Jazyk hry (angliÄtina, nÄmÄina, ...)
+ - Verze hry (s ĹeÄĂ, z diskety, ...)
+ - Platforma a kompilĂĄtor (Win32, Linux, FreeBSD, ...)
+ - Pokud moĹžno, pĹiloĹžte uloĹženou hru
+ - Pokud se tato chyba objevila pouze nedĂĄvno, poznamenejte si poslednĂ verzi bez chyby a prvnĂ verzi s touto chybou. Takto ji mĹŻĹžeme rychle spravit tĂm, Ĺže se podĂvĂĄme na provedenĂŠ zmÄny.
+
+Nakonec prosĂme, abyste kaĹždou chybu nahlaĹĄovali samostatnÄ; neohlaĹĄujte nÄkolik chyb v jednom hlĂĄĹĄenĂ. (Jinak bude obtĂĹžnĂŠ sledovat stav kaĹždĂŠ jednotlivĂŠ chyby).
+
+
+3.0) PodporovanĂŠ hry:
+---- ----------------
+V tuto chvĂli je o nĂĄsledujĂcĂch hrĂĄch znĂĄmo, Ĺže fungujĂ a mÄly by bĂ˝t hratelnĂŠ aĹž dokonce:
+
+Hry SCUMM od LucasArts:
+ Maniac Mansion [maniac]
+ Zak McKracken and the Alien Mindbenders [zak]
+ Indiana Jones and the Last Crusade [indy3]
+ Loom [loom]
+ The Secret of Monkey Island [monkey]
+ Monkey Island 2: LeChuck's Revenge [monkey2]
+ Indiana Jones and the Fate of Atlantis [atlantis]
+ Day of the Tentacle [tentacle]
+ Sam & Max Hit the Road [samnmax]
+ Full Throttle [ft]
+ The Dig [dig]
+ The Curse of Monkey Island [comi]
+
+Hry AGI od Sierra:
+ The Black Cauldron [bc]
+ Gold Rush! [goldrush]
+ King's Quest I [kq1]
+ King's Quest II [kq2]
+ King's Quest III [kq3]
+ King's Quest IV [kq4]
+ Leisure Suit Larry in the Land of the
+ Lounge Lizards [lsl1]
+ Mixed-Up Mother Goose [mixedup]
+ Manhunter 1: New York [mh1]
+ Manhunter 2: San Francisco [mh2]
+ Police Quest I: In Pursuit of the Death
+ Angel [pq1]
+ Space Quest I: The Sarien Encounter [sq1]
+ Space Quest II: Vohaul's Revenge [sq2]
+ Fanmade Games [agi-fanmade]
+
+Hry AGOS od Adventuresoft/Horrorsoft:
+ Elvira - Mistress of the Dark [elvira1]
+ Elvira II - The Jaws of Cerberus [elvira2]
+ Personal Nightmare [pn]
+ Waxworks [waxworks]
+ Simon the Sorcerer 1 [simon1]
+ Simon the Sorcerer 2 [simon2]
+ Simon the Sorcerer's Puzzle Pack
+ - Demon In My Pocket [dimp]
+ Simon the Sorcerer's Puzzle Pack
+ - Jumble [jumble]
+ Simon the Sorcerer's Puzzle Pack
+ - NoPatience [puzzle]
+ Simon the Sorcerer's Puzzle Pack
+ - Swampy Adventures [swampy]
+ The Feeble Files [feeble]
+
+Hry GOB od Coktel Vision:
+ Bambou le sauveur de la jungle [bambou]
+ Bargon Attack [bargon]
+ Fascination [fascination]
+ Geisha [geisha]
+ Gobliiins [gob1]
+ Gobliins 2 [gob2]
+ Goblins 3 [gob3]
+ Lost in Time [lostintime]
+ Once Upon A Time: Little Red Riding Hood [littlered]
+ The Bizarre Adventures of Woodruff
+ and the Schnibble [woodruff]
+ Urban Runner [urban]
+ Ween: The Prophecy [ween]
+
+Hry MADE od Activision:
+ Leather Goddesses of Phobos 2 [lgop2]
+ Return to Zork [rtz]
+ Rodney's Funscreen [rodney]
+ The Manhole [manhole]
+
+DalĹĄĂ hry:
+ Beneath a Steel Sky [sky]
+ Broken Sword: The Shadow of the Templars [sword1]
+ Broken Sword II: The Smoking Mirror [sword2]
+ Cruise for a Corpse [cruise]
+ Discworld [dw]
+ Discworld 2: Missing Presumed ...!? [dw2]
+ Dragon History [draci]
+ Drascula: The Vampire Strikes Back [drascula]
+ Eye of the Beholder [eob]
+ Eye of the Beholder II: The Legend of
+ Darkmoon [eob2]
+ Flight of the Amazon Queen [queen]
+ Future Wars [fw]
+ Inherit the Earth: Quest for the Orb [ite]
+ Nippon Safes Inc. [nippon]
+ Lands of Lore: The Throne of Chaos [lol]
+ The Journeyman Project: Pegasus Prime [pegasus]
+ The Legend of Kyrandia [kyra1]
+ The Legend of Kyrandia: The Hand of Fate [kyra2]
+ The Legend of Kyrandia: Malcolm's Revenge [kyra3]
+ Touche: The Adventures of the Fifth
+ Musketeer [touche]
+
+Hry SCUMM od Humongous Entertainment:
+ Backyard Baseball [baseball]
+ Backyard Baseball 2001 [baseball2001]
+ Backyard Baseball 2003 [baseball2003]
+ Backyard Football [football]
+ Big Thinkers First Grade [thinker1]
+ Big Thinkers Kindergarten [thinkerk]
+ Blue's 123 Time Activities [Blues123Time]
+ Blue's ABC Time Activities [BluesABCTime]
+ Blue's Art Time Activities [arttime]
+ Blue's Birthday Adventure [BluesBirthday]
+ Blue's Reading Time Activities [readtime]
+ Fatty Bear's Birthday Surprise [fbear]
+ Fatty Bear's Fun Pack [fbpack]
+ Freddi Fish 1: The Case of the Missing
+ Kelp Seeds [freddi]
+ Freddi Fish 2: The Case of the Haunted
+ Schoolhouse [freddi2]
+ Freddi Fish 3: The Case of the Stolen
+ Conch Shell [freddi3]
+ Freddi Fish 4: The Case of the Hogfish
+ Rustlers of Briny Gulch [freddi4]
+ Freddi Fish 5: The Case of the Creature
+ of Coral Cove [freddicove]
+ Freddi Fish and Luther's Maze Madness [maze]
+ Freddi Fish and Luther's Water Worries [water]
+ Let's Explore the Airport with Buzzy [airport]
+ Let's Explore the Farm with Buzzy [farm]
+ Let's Explore the Jungle with Buzzy [jungle]
+ Pajama Sam 1: No Need to Hide When It's
+ Dark Outside [pajama]
+ Pajama Sam 2: Thunder and Lightning
+ Aren't so Frightening [pajama2]
+ Pajama Sam 3: You Are What You Eat
+ From Your Head to Your Feet [pajama3]
+ Pajama Sam's Lost & Found [lost]
+ Pajama Sam's Sock Works [socks]
+ Putt-Putt Joins the Parade [puttputt]
+ Putt-Putt Goes to the Moon [puttmoon]
+ Putt-Putt Saves the Zoo [puttzoo]
+ Putt-Putt Travels Through Time [putttime]
+ Putt-Putt Enters the Race [puttrace]
+ Putt-Putt Joins the Circus [puttcircus]
+ Putt-Putt and Pep's Balloon-O-Rama [balloon]
+ Putt-Putt and Pep's Dog on a Stick [dog]
+ Putt-Putt & Fatty Bear's Activity Pack [activity]
+ Putt-Putt's Fun Pack [funpack]
+ SPY Fox 1: Dry Cereal [spyfox]
+ SPY Fox 2: Some Assembly Required [spyfox2]
+ SPY Fox 3: Operation Ozone [spyozon]
+ SPY Fox in Cheese Chase [chase]
+ SPY Fox in Hold the Mustard [mustard]
+
+Hry Living Books:
+ Aesop's Fables: The Tortoise and the Hare [tortoise]
+ Arthur's Birthday [arthurbday]
+ Arthur's Teacher Trouble [arthur]
+ Dr. Seuss's ABC [seussabc]
+ Green Eggs and Ham [greeneggs]
+ Harry and the Haunted House [harryhh]
+ Just Grandma and Me [grandma]
+ Little Monster at School [lilmonster]
+ Ruff's Bone [ruff]
+ Sheila Rae, the Brave [sheila]
+ Stellaluna [stellaluna]
+ The Berenstain Bears Get in a Fight [bearfight]
+ The Berenstain Bears in the Dark [beardark]
+ The New Kid on the Block [newkid]
+
+NĂĄsledujĂcĂ hry by mÄly jĂt spustit, ale zatĂm nejsou ĂşplnÄ hratelnĂŠ. Hrajte je pouze na vlastnĂ riziko a prosĂme, abyste pro tyto hry nenahlaĹĄovali chyby.
+Pokud chcete mĂt nejnovÄjĹĄĂ zprĂĄvy o kompatibilitĂĄch her, navĹĄtivte naĹĄĂ strĂĄnku a prohlĂŠdnÄte si tabulku kompatibilit.
+
+ Backyard Football 2002 [football2002]
+ Backyard Soccer [soccer]
+ Backyard Soccer MLS [soccermls]
+ Backyard Soccer 2004 [soccer2004]
+ Blue's Treasure Hunt [BluesTreasureHunt]
+ Pajama Sam: Games to Play on Any Day [pjgames]
+
+NĂĄsledujĂcĂ hry jsou odvozeny od jĂĄdra SCUMM, ale ScummVM je nepodporuje (zatĂm):
+
+ OstatnĂ hry od Humongous Entertainment
+
+NezapomeĹte, prosĂm, Ĺže jĂĄdra mohou obsahovat chyby a nezavedenĂŠ funkce, kterĂŠ nÄkdy zabrĂĄnĂ hru dokonÄit. UklĂĄdejte Äasto a nahlaste chyby, prosĂm (instrukce pro hlĂĄĹĄenĂ chyb jsou výťe), pokud na takovou chybu narazĂte v 'podporovanĂŠ' hĹe.
+
+
+3.1) Ochrana proti kopĂrovĂĄnĂ:
+---- -------------------------
+TĂ˝m ScummVM nepodporuje pirĂĄtstvĂ. NicmĂŠnÄ existujĂ pĹĂpady, kdy hernĂ spoleÄnosti (jako LucasArts) sami ve svĂ˝ch hrĂĄch poskytujĂ 'cracknutĂŠ'
+spouĹĄtÄÄe â v tÄchto pĹĂpadech datovĂŠ soubory obsahujĂ skripty pro ochranu proti kopĂrovĂĄnĂ, ale pĹevadÄÄ je obejde (toto mĹŻĹže podobnÄ provĂĄdÄt nelegĂĄlnÄ cracknutĂĄ verze, s tĂm rozdĂlem, Ĺže zde toto provedl vĂ˝robce hry. Neexistuje ŞådnĂ˝ zpĹŻsob, jak mĹŻĹžeme rozliĹĄit legitimnĂ a pirĂĄtskĂŠ datovĂŠ soubory, takĹže v hrĂĄch, o kterĂ˝ch vĂme, Ĺže byla nÄkdy prodĂĄvĂĄna cracknutĂĄ verze pĹŻvodnĂho pĹevadÄÄe bude ScummVM muset vĹždy ochranu pĹeskoÄit.
+
+V nÄkterĂ˝ch pĹĂpadech ScummVM pĹesto zobrazĂ obrazovku ochrany proti kopĂrovĂĄnĂ. Zkuste zadat jakoukoli odpovÄÄ. Je tu moĹžnost, Ĺže toto bude fungovat.
+
+ScummVM pĹeskakuje ochranu v nĂĄsledujĂcĂch hrĂĄch:
+
+ * Beneath a Steel Sky
+ -- potlaÄeno s laskavĂ˝m svolenĂm Revolution Software.
+ * Dreamweb
+ -- seznam dostupnĂ˝ch pĹĂkazĹŻ v terminĂĄlech ve hĹe je nynĂ zobrazen
+ kdyĹž hrĂĄÄ pouĹžije pĹĂkaz 'help'
+ * Inherit the Earth: Quest for the Orb (Floppy version)
+ -- potlaÄeno s laskavĂ˝m svolenĂm Wyrmkeep Entertainment,
+ protoĹže byla potlaÄena ve vĹĄech vydĂĄnĂch hry na CD.
+ * Loom (EGA DOS)
+ * Maniac Mansion
+ * Monkey Island 2: LeChuck's Revenge
+ * Simon the Sorcerer 1 (Floppy version)
+ * Simon the Sorcerer 2 (Floppy version)
+ -- potlaÄeno s laskavĂ˝m svolenĂm from Adventure Soft,
+ protoĹže byla potlaÄena ve vĹĄech vydĂĄnĂch hry na CD.
+ * The Secret of Monkey Island (VGA)
+ * Waxworks
+ * Zak McKracken and the Alien Mindbenders
+
+
+3.2) Poznåmky ke hråm Commodore64:
+---- -----------------------------
+Jak Maniac Mansion tak Zak McKracken mohou bĂ˝t spuĹĄtÄny, ale Maniac Mansion nenĂ jeĹĄtÄ hratelnĂ˝. JednoduĹĄe pojmenujte disky D64 jako
+"maniac1.d64" a "maniac2.d64" nebo "zak1.d64" a "zak2.d64", pak by mÄl ScummVM automaticky hru zjistit, pokud ho odkĂĄĹžete na sprĂĄvnou sloĹžku.
+
+Nebo mĹŻĹžete pouĹžĂt 'extract_mm_c64' z balĂÄku nĂĄstrojĹŻ pro extrahovĂĄnĂ datovĂ˝ch souborĹŻ. Pak ale ScummVM hru ĹĂĄdnÄ automaticky nezjistĂ ScummVM, a musĂte se ujistit, Ĺže platforma je nastavena na Commodore64. DoporuÄujeme pouĹžĂt mnohem jednoduĹĄĹĄĂ postup popsanĂ˝ v pĹedchozĂm odstavci.
+
+
+3.3) PoznĂĄmky ke Maniac Mansion NES:
+---- -------------------------
+PodporovanĂŠ verze jsou BritskĂĄ angliÄtina (E), FrancouzĹĄtina (F), NÄmÄina (G), ItalĹĄtina (I), Ĺ vĂŠdĹĄtina (SW) a AmerickĂĄ angliÄtina (U). ScummVM pro spuĹĄtÄnĂ vyĹžaduje pouze ÄĂĄst PRG a ne celĂ˝ ROM.
+
+Abyste mohli hru spustit, musĂte vyjmout prvnĂch 16 bajtĹŻ z ROM, s kterĂ˝m pracujete. JakĂ˝koli hex editor bude fungovat, pokud mĹŻĹžete kopĂrovat/vklĂĄdat. PotĂŠ. Co ROM otevĹete pomocĂ hex editoru, zkopĂrujte vĹĄechno z druhĂŠho ĹĂĄdku (17. bajt) na konec. PotĂŠ, co toto provedete, vloĹžte ho do novĂŠho hex souboru. Pojmenujte ho "Maniac Mansion (XX).prg" kde XX znamenĂĄ verzi, se kterou pracujete (E, F, G, I, SW, nebo U). KoneÄnĂĄ velikost by mÄla bĂ˝t pĹesnÄ 262144 bajtĹŻ.
+
+Pokud hru pĹidĂĄvĂĄte ruÄnÄ, ujistÄte se, Ĺže platforma je nastavena na NES.
+
+NejbÄĹžnÄjĹĄĂ chyby, kterĂŠ zabraĹujĂ spuĹĄtÄnĂ hry:
+
+ * Ĺ patnĂ˝ soubor
+ * ROM byl extrahovĂĄn pomocĂ nĂĄstrojĹŻ z verze 0.7.0
+ * SnaĹžĂte se do ScummVM vklĂĄdat CELĂ ROM a ne jenom PRG ÄĂĄst.
+
+Je takĂŠ moĹžno extrahovat oddÄlenĂŠ soubory LFL z PRG ÄĂĄsti. Pro toto pouĹžijte nĂĄstroj 'extract_mm_nes' z balĂÄku nĂĄstrojĹŻ.
+
+
+3.4) PoznĂĄmky ke hrĂĄm Macintosh:
+---- ---------------------------
+VĹĄechny adventury LucasArts zaloĹženĂŠ na SCUMM, kromÄ COMI, takĂŠ existujĂ ve verzĂch pro in Macintosh. ScummVM mĹŻĹže vÄtĹĄinu (vĹĄechny?) pouĹžĂt, nicmĂŠnÄ, v nÄkterĂ˝ch pĹĂpadech je nutnĂĄ dodateÄnĂĄ prĂĄce. NejdĹĂve, pokud pro toto nepouĹžĂvĂĄte Macintosh, pĹĂstup k datĹŻm na CD/disketÄ mĹŻĹže bĂ˝t obtĂĹžnĂ˝. DĹŻvodem je to, Ĺže Mac pouĹžĂvĂĄ zvlĂĄĹĄtnĂ formĂĄt disku nazvanĂ˝ HFS, kterĂ˝ ostatnĂ systĂŠmy vÄtĹĄinou nepodporujĂ. NicmĂŠnÄ existuje, nÄkolik nĂĄstrojĹŻ, kterĂŠ jsou zadarmo a umoĹžĹujĂ ÄĂst takovĂŠto svazky HFS. NapĹĂklad "HFVExplorer" pro Windows a "hfsutils" pro Linux a ostatnĂ UnixovĂŠ operaÄnĂ systĂŠmy.
+
+VÄtĹĄina novÄjĹĄĂch her na Macintosh je dodĂĄvĂĄna pouze s jednĂm datovĂ˝m souborem (v nÄkterĂ˝ch pĹĂpadech byl tento soubor uÄinÄn neviditelnĂ˝m, takĹže moĹžnĂĄ budete potĹebovat dodateÄnĂŠ nĂĄstroje, abyste ho mohli zkopĂrovat). ScummVM je schopen takovĂ˝to soubor pouĹžĂt pĹĂmo; jednoduĹĄe odkaĹžte ScummVM na sloĹžku obsahujĂcĂ tento soubor a mÄlo by to fungovat (tak jako s kaĹždou podporovanou hrou).
+
+V balĂÄku nĂĄstrojĹŻ takĂŠ poskytujeme nĂĄstroj nazvanĂ˝ 'extract_scumm_mac', kterĂ˝ extrahuje data z tÄchto datovĂ˝ch souborĹŻ, ale toto nenĂ ani potĹeba, ani doporuÄeno.
+
+Pro dalĹĄĂ informace o kopĂrovĂĄnĂ hernĂch souborĹŻ Macintosh na VĂĄĹĄ pevnĂ˝ disk si prohlĂŠdnÄte:
+
+ http://wiki.scummvm.org/index.php/HOWTO-Mac_Games
+
+
+3.5) PoznĂĄmky ke hrĂĄm Multi-CD:
+---- --------------------------
+ObecnÄ ScummVM moc dobĹe nefunguje s hrami na Multi-CD. To je proto, Ĺže ScummVM pĹedpoklĂĄdĂĄ, Ĺže vĹĄechno o hĹe mĹŻĹže bĂ˝t nalezeno v jednĂŠ sloĹžce. I kdyĹž ScummVM mĂĄ schopnost poŞådat uĹživatele, aby vymÄnil CD, pĹŻvodnĂ spouĹĄtÄÄ souboru vÄtĹĄinou nainstaluje malĂŠ mnoĹžstvĂ souborĹŻ na pevnĂ˝ disk. Pokud tyto soubory nelze najĂt na vĹĄech CD, ScummVM bude mĂt potĂĹže.
+
+NaĹĄtÄstĂ mĹŻĹže ScummVM hry bez problĂŠmĹŻ spouĹĄtÄt pĹĂmo z pevnĂŠho disku, pokud vytvoĹĂte sloĹžku se sprĂĄvnou kombinacĂ souborĹŻ. VÄtĹĄinou, kdyĹž se soubor objevĂ na vĂce, neĹž jednom CD mĹŻĹžete vybrat jeden z nich.
+
+
+3.6) PoznĂĄmky k The Curse of Monkey Island:
+---- --------------------------------------
+Pro tuto hru budete potĹebovat soubory comi.la0, comi.la1 a comi.la2.
+Soubor comi.la0 mĹŻĹžete nalĂŠzt na vĹĄech CD hry, ale protoĹže jsou stejnĂŠ, mĹŻĹžete pouĹžĂt kterĂ˝koli z nich.
+
+DĂĄle potĹebujete vytvoĹit podsloĹžku "resource" obsahujĂcĂ vĹĄechny soubory z âobou- podsloĹžek "resource" na dvou CD. NÄkterĂŠ soubory se objevujĂ na obou CD, ale znovu jsou stejnĂŠ.
+
+
+3.7) PoznĂĄmky ke hrĂĄm Broken Sword:
+---- ------------------------------
+Pokyny pro hry Broken Sword jsou pro verze od Sold-Out Software, kde kaĹždĂĄ hra je na dvou CD, protoĹže tyto verze byly nejdostupnÄjĹĄĂ v dobÄ, kdy je ScummVM zaÄal podporovat. DoufĂĄme, Ĺže jsou dostateÄnÄ obecnĂŠ pro pouĹžitĂ i v jinĂ˝ch vydĂĄnĂch her.
+
+
+3.7.1) Videa z her Broken Sword:
+------ -------------------------
+Videa pro hry Broken Sword majĂ v sobÄ trochu historie (viz dalĹĄĂ oddĂl, pokud jste zvÄdavĂ), ale obecnÄ jedinĂŠ, co potĹebujete udÄlat, je zkopĂrovat soubory .SMK ze sloĹžek "SMACKS" nebo "SMACKSHI" na CD do stejnĂŠ sloĹžky jako ostatnĂ datovĂŠ soubory hry. (Broken Sword mĂĄ takĂŠ sloĹžku "SMACKSLO" se stejnĂ˝mi videi, ale ty jsou niŞťà kvality.) MĹŻĹžete je umĂstit do podsloĹžky s nĂĄzvem "video", pokud VĂĄm to pĹijde hezÄĂ.
+
+Ve verzĂch pro PlayStation, mĹŻĹžete pĹŻvodnĂ videa vypsat z disku. KaĹždĂ˝ soubor, kterĂ˝ mĂĄ pĹĂponu "STR", byste mÄli vypsat jako *Äist* sektory z disku (vĹĄech 2352 bajtĹŻ na sektor). MĹŻĹžete takĂŠ mĂst toho pouĹžĂt pĹeformĂĄtovanĂĄ videa, kterĂĄ jsou zmĂnÄna nĂĹže, ale to nebude fungovat pro vĹĄechny videa v Broken Sword II. Pro vĂce informacĂ si prohlĂŠdnÄte:
+
+ http://wiki.scummvm.org/index.php/HOWTO-PlayStation_Videos
+
+NÄkterĂĄ vydĂĄnĂ hry, a takĂŠ verze pro PlayStation, Smacker videa nemajĂ. Revolution Software nĂĄm laskavÄ dovolilo poskytovat pĹeformĂĄtovanĂĄ videa ke staĹženĂ na naĹĄĂ strĂĄnce:
+
+ http://www.scummvm.org/downloads.php
+
+Tato videa jsou poskytovĂĄna ve formĂĄtu DXA se zvukem ve formĂĄtu FLAC. Jejich kvalita se rovnĂĄ originĂĄlu dĂky pouĹžitĂ bezztrĂĄtovĂŠ komprese. ZobrazenĂ tÄchto videĂ vyĹžaduje, aby verze ScummVM byla sestavena s podporou FLAC i zlib.
+
+Pro systĂŠmy, kterĂŠ jsou pĹĂliĹĄ pomalĂŠ, aby zvlĂĄdli dekĂłdovat formĂĄt FLAC byl zvuk videĂ takĂŠ poskytnut oddÄlenÄ ve formĂĄtu OGG Vorbis audio. Toto vyĹžaduje, aby verze ScummVM byla sestavena s podporou libVorbis a zlib.
+
+Pro Broken Sword takĂŠ poskytujeme pĹĂdavek pro titulky. JednoduĹĄe ho rozbalte a nĂĄsledujte pokyny v souboru readme.txt. BalĂÄek v souÄasnosti nefunguje ve videĂch na PlayStation. (Broken Sword II jiĹž titulky mĂĄ; nenĂ tĹeba dalĹĄĂ prĂĄce pro jejich pĹidĂĄnĂ.)
+
+
+3.7.2) Videa her Broken Sword ve zpÄtnĂŠm pohledu:
+------ ------------------------------------------
+PĹŻvodnĂ vydĂĄnĂ her Broken Sword pouĹžĂvalo formĂĄt Smacker⢠od RAD Game Tools. ProtoĹže spoleÄnost RAD nebyla ochotna nĂĄm otevĹĂt starĹĄĂ zastaralĂŠ verze tohoto formĂĄtu a poŞådala, abychom neprovĂĄdÄli jeho zpÄtnou analĂ˝zu, museli jsme nalĂŠzt jinĂŠ ĹeĹĄenĂ.
+
+V Broken Sword II bylo moĹžnĂŠ pĹehrĂĄt ĹeÄ, aniĹž by se muselo pĹehrĂĄvat video. To zĹŻstalo jako nouzovĂŠ ĹeĹĄenĂ aĹž do ScummVM 1.0.0, ale pro vĹĄechny stabilnĂ verze to nikdy nebylo jedinĂŠ ĹeĹĄenĂ.
+
+Ve ScummVM 0.6.0 jsme pouĹžĂvali MPEG, coĹž zajistilo rozumnĂ˝ kompromis mezi velikostĂ a kvalitou. Ve ScummVM 0.10.0 bylo toto nahrazeno DXA
+(pĹŻvodnÄ pĹidĂĄno pro "The Feeble Files" od AdventureSoft). To nĂĄm dalo moĹžnost zajistit videa ve stejnĂŠ kvalitÄ jako pĹŻvodnĂ, za cenu vÄtĹĄĂ velikosti.
+
+Nakonec na zaÄĂĄtku roku 2006 byl formĂĄt Smacker zpÄtnÄ analyzovĂĄn pro projekt FFmpeg. DĂky jejich tvrdĂŠ prĂĄci ScummVM 1.0.0 nynĂ podporuje pĹŻvodnĂ videa. ZĂĄroveĹ byla ukonÄena podpora MPEG. ZÂ technickĂŠho hlediska je toto dobĹe, protoĹže pĹehrĂĄvĂĄnĂ videĂ MPEG bylo velmi sloĹžitĂŠ a stejnÄ nevypadaly tak dobĹe jako verze ve formĂĄtu DXA a Smacker.
+
+
+3.7.3) Broken Sword:
+------ -------------
+Pro tuto hru budete potĹebovat vĹĄechny soubory ze seskupenĂ sloĹžek na obou CD. Pro verze Windows a Macintosh budete takĂŠ potĹebovat soubory speech.clu ze sloĹžek speech, ale protoĹže soubory nejsou stejnĂŠ, budete je muset pĹejmenovat na speech1.clu a speech2.clu z CD 1 a 2 v tomto poĹadĂ. Verze na PlayStation vyĹžaduje speech.tab, speech.dat, speech.lis, a speech.inf.
+
+DĂĄle verze pro Windows a Macintosh vyĹžadujĂ podsloĹžku music se vĹĄemi soubory z podsloĹžek music na obou CD. NÄkterĂŠ z tÄchto souborĹŻ se objevujĂ na obou CD, ale v tÄchto pĹĂpadech jsou buÄ stejnĂŠ, nebo, v jednom pĹĂpadÄ, je tĂŠmÄĹ stejnĂ˝, Ĺže to nemĂĄ ŞådnĂ˝ vĂ˝znam. Verze pro PlayStation vYĹžaduje tunes.dat a tunes.tab.
+
+
+3.7.4) Broken Sword II:
+------ ----------------
+Pro tuto hru budete potĹebovat vĹĄechny soubory ze seskupenĂ sloĹžek na obou CD. (Abych pravdu Ĺekl, pĂĄr z nich nemusĂ bĂ˝t nezbytnÄ nutnĂŠ, ale ty, o kterĂ˝ch nemĂĄm jistotu, jsou velmi malĂŠ.)
+Je takĂŠ tĹeba pĹejmenovat soubory speech.clu a music.clu na speech1.clu,
+speech2.clu, music1.clu a music2.clu, aby ScummVM mohl zjistit, kterĂŠ jsou z CD 1 a kterĂŠ z CD 2. VĹĄechny ostatnĂ soubory, kterĂŠ jsou umĂstÄny v seskupenĂ sloĹžek, jsou stejnĂŠ. PouĹžijte kterĂŠkoli soubory chcete.
+
+KromÄ toho budete potĹebovat soubory cd.inf a, pĹĂpadnÄ, startup.inf ze sloĹžky sword2 na CD 1.
+
+
+3.8) PoznĂĄmky k Beneath a Steel Sky:
+---- -------------------------------
+Od ScummVM 0.8.0 potĹebujete dodateÄnĂ˝ soubor 'SKY.CPT', abyste mohli Beneath a Steel Sky spustit.
+
+Tento soubor je dostupnĂ˝ na strĂĄnce 'Downloads' domovskĂŠ strĂĄnky ScummVM.
+MĹŻĹžete ho umĂstit buÄ do sloĹžky obsahujĂcĂ ostatnĂ datovĂŠ soubory (SKY.DNR, SKY.DSK), na VaĹĄi dodateÄnou cestu, nebo do sloĹžky. Kde se nachĂĄzĂ spouĹĄtÄcĂ soubor ScummVM.
+
+
+3.9) PoznĂĄmky k Flight of the Amazon Queen:
+---- --------------------------------------
+Abyste mohli pouĹžĂt tu verzi, kterĂĄ nenĂ volnÄ ĹĄiĹitelnĂĄ
+(z pĹŻvodnĂho CD), musĂte mĂt soubor 'queen.tbl'
+(dostupnĂ˝ ze strĂĄnky 'Downloads' naĹĄĂ domovskĂŠ strĂĄnky) a umĂstit ho buÄ do sloĹžky obsahujĂcĂ soubor hry 'queen.1', na VaĹĄi dodateÄnou cestu, nebo do sloĹžky. Kde se nachĂĄzĂ spouĹĄtÄcĂ soubor ScummVM.
+
+TakĂŠ mĹŻĹžete pouĹžĂt nĂĄstroj 'compress_queen' z balĂÄku nĂĄstrojĹŻ pro 'znovu sestavenĂ' VaĹĄeho datovĂŠho souboru FOTAQ pro zahrnutĂ tabulky pro tuto konkrĂŠtnĂ verzi, ÄĂmĹž odstranĂte zĂĄvislost na soubor 'queen.tbl' pĹi spuĹĄtÄnĂ. Tento nĂĄstroj VĂĄm takĂŠ umoĹžĹuje komprimovat ĹeÄ a zvukovĂŠ efekty do formĂĄtu MP3, OGG nebo FLAC.
+
+
+3.10) PoznĂĄmky ke Gobliiins:
+----- ----------------------
+CD verze sĂŠrie Gobliiins obsahuje jednu velkou zvukovou stopu, kterou potĹebujete vyjmout (viz oddĂl o pouĹžitĂ komprimovanĂ˝ch zvukovĂ˝ch souborĹŻ) a zkopĂrovat ji do hernĂ sloĹžky, pokud chcete ve hĹe hudbu, aniĹž byste museli CD mĂt stĂĄle v jednotce. V tĂŠto stopÄ jsou takĂŠ ĹeÄ a jejĂ hlasitost se tedy takĂŠ mÄnĂ podle hlasitosti hudby.
+
+
+3.11) PoznĂĄmky k Inherit the Earth: Quest for the Orb:
+----- ------------------------------------------------
+Abyste mohli spustit verzi pro Mac OS X od Wyrmkeep musĂte data zkopĂrovat z CD na VĂĄĹĄ pevnĂ˝ disk. Pokud pouĹžĂvĂĄte PC, pak se podĂvejte na:
+
+ http://wiki.scummvm.org/index.php/HOWTO-Mac_Games
+
+I kdyĹž se v tomto ÄlĂĄnku pĂĹĄe hlavnÄ o hrĂĄch SCUMM, je zde takĂŠ zmĂnÄn nĂĄstroj "HFVExplorer", kterĂ˝ potĹebujete k extrakci souborĹŻ. NezapomeĹte, Ĺže data ĹeÄi "Inherit the Earth Voices" musĂte umĂstit do stejnĂŠho adresĂĄĹe, kde jsou uloĹžena data hry:
+
+ Inherit the Earth.app/Contents/Resources
+
+Ve starĂŠ verzi pro Mac OS 9 potĹebujete soubory zkopĂrovat ve formĂĄtu MacBinary, protoĹže by mÄli obsahovat jak zdrojovĂŠ, tak datovĂŠ vidlice. ZkopĂrujte vĹĄechny soubory 'ITE *'.
+
+
+3.12) PoznĂĄmky k Simon the Sorcerer 1 a 2:
+----- ------------------------------------
+Pokud måte dvojitou verzi Simon the Sorcerer 1 nebo 2 na CD, verzi pro Windows naleznete v hlavnà sloŞce na CD a verzi pro DOS ve sloŞce DOS na CD.
+
+
+3.13) PoznĂĄmky k The Feeble Files:
+----- ----------------------------
+Pokud mĂĄte verzi pro Windows, je tĹeba si uvÄdomit pĂĄr vÄcĂ.
+
+Mnoho souborĹŻ, kterĂŠ hra vyĹžaduje, je uloĹženo v souboru InstallShield s nĂĄzvem data1.cab, kterĂ˝ ScummVM nemĹŻĹže rozbalit. Budete muset pouĹžĂt pĹŻvodnĂ instalĂĄtor, nebo i5comp pro rozbalenĂ obsahu tohoto souboru. NĂĄstroj pro dekomprimaci i5comp mĹŻĹže bĂ˝t nalezen pĹi hledĂĄnĂ na internetu.
+
+Abyste mohli pouĹžĂt soubory s ĹeÄĂ ve ScummVM, musĂ bĂ˝t pĹejmenovĂĄny nĂĄsledovnÄ:
+PĹejmenovat voices.wav na CD1 na voices1.wav
+PĹejmenovat voices.wav na CD2 na voices2.wav
+PĹejmenovat voices.wav na CD3 na voices3.wav
+PĹejmenovat voices.wav na CD4 na voices4.wav
+
+3.14) PoznĂĄmky k The Legend of Kyrandia:
+----- ----------------------------------
+Abyste mohli spustit The Legend of Kyrandia ve ScummVM potĹebujete soubor 'kyra.dat'.
+Soubor by mÄl bĂ˝t vĹždykcy souÄĂĄstĂ oficiĂĄlnĂch balĂÄkĹŻ ScummVM. V pĹĂpadÄ, Ĺže ScummVM
+hlĂĄsĂ, Ĺže soubor chybĂĄ, mĹŻĹžete ho najĂt na strĂĄnce ScummVM v sekci 'Downloads'.
+NezapomeĹte, Ĺže souÄasnĂĄ verze ScummVM pro Windows by mÄla soubor obsahovat ve spouĹĄtÄÄi a tudĂĹž ho
+musĂte mĂt pouze, kdyĹž ScummVM soubor nemĹŻĹže nalĂŠzt.
+
+3.15) PoznĂĄmky k PĹedvĂdavĂŠmu VstupnĂmu Dialogu her Sierra AGI:
+----- ---------------------------------------------------------
+PĹedvĂdavĂ˝ VstupnĂ Dialog je pomĹŻcka ScummVM pro spouĹĄtÄnĂ her pouĹžĂvajĂcĂ jĂĄdro AGI (kterĂ˝ je znĂĄm, Ĺže vyĹžaduje vstup z pĹĂkazovĂŠ ĹĂĄdky) na zaĹĂzenĂch s omezenou podporou klĂĄvesnice. V tÄchto situacĂch, kdy zadĂĄvĂĄnĂ pomocĂ emulovanĂŠ klĂĄvesnice je dosti ĂşnavnĂŠ, mĹŻĹžou bĂ˝t pĹĂkazy rychle a snadno zadĂĄny pomocĂ PĹedvĂdavĂŠho VstupnĂho Dialogu.
+
+Abyste zapnuli pĹedvĂdavĂ˝ vstup v hrĂĄch AGI, potĹebujete zkopĂrovat soubor pred.dic do dodateÄnĂŠ sloĹžky ScummVM nebo do sloĹžky hry, kterou chcete hrĂĄt. Tento slovnĂk byl vytvoĹen analĂ˝zou vĹĄech znĂĄmĂ˝ch her AGI a obsahuje maximĂĄlnĂ sadu bÄĹžnĂ˝ch slov.
+
+Pokud je slovnĂk zjiĹĄtÄn, je PĹedvĂdavĂ˝ VstupnĂ Dialog zobrazen buÄ pĹi klinutĂ na oblast pĹĂkazovĂŠho ĹĂĄdku (kdykoliv je poĹžadovĂĄn vstup klĂĄvesnice, i v rĂĄmeÄcĂch dialogovĂ˝ch oken), nebo v nÄkterĂ˝ch verzĂch pro jinĂŠ systĂŠmy stisknutĂm urÄenĂŠ klĂĄvesovĂŠ zkratky.
+
+PĹedvĂdavĂ˝ VstupnĂ Dialog pracuje ve tĹech reĹžimech, kterĂŠ jsou pĹepĂnĂĄny tlaÄĂtkem (*)Pre/123/Abc. HlavnĂ vstupnĂ metodou je pĹedvĂdavĂ˝ reĹžim
+(Pre), kterĂ˝ pĹipomĂnĂĄ "rychlĂŠ zadĂĄvĂĄnĂ" v mobilnĂch telefonech.
+Abeceda je rozdÄlena do 9 sad, kterĂŠ pĹirozenÄ odpovĂdajĂ 9 klĂĄvesĂĄm ÄĂselnĂŠ klĂĄvesnice (0 je mezera). Pro psanĂ slova zmĂĄÄknÄte jednou ÄĂslo sady, kterĂĄ obsahuje pĂsmeno slova, kterĂŠ chcete napsat, pak pokraÄujete k dalĹĄĂmu. NapĹĂklad, pokud chcete napsat pĹĂkaz 'look', mÄli byste zmĂĄÄknout 5665. Jak postupnÄ pĂĹĄete ÄĂselnĂ˝ kĂłd zamýťlenĂŠho slova, je slovnĂk prohledĂĄvĂĄn pro znĂĄmĂĄ slova, kterĂĄ se shodujĂ s VaĹĄĂm vstupem aĹž do tohoto bodu. Jak maÄkĂĄte vĂce klĂĄves, slovnĂk se pĹiblĂŞà ke sprĂĄvnĂŠmu slovu. To je dĹŻvod, proÄ vypsanĂŠ slovo se mĹŻĹže nĂĄhle zmÄnit mezi stisky klĂĄves. NÄkdy se ale vyskytnou pĹĂpady, kdy vĂce neĹž jedno slovo mĂĄ stejnĂŠ ÄĂselnĂŠ zastoupenĂ. NapĹĂklad slova 'quit' a 'suit' odpovĂdajĂ stejnĂ˝m ÄĂslĹŻm, a to 7848. V tÄchto pĹĂpadech se rozsvĂtĂ tlaÄĂtko dalĹĄĂ
+(#). Jeho stisknutĂm mĹŻĹžete prochĂĄzet seznam slov, kterĂĄ sdĂlejĂ stejnĂ˝ kĂłd a nakonec pĹijmout to sprĂĄvnĂŠ stisknutĂm (0)mezera nebo tlaÄĂtka Ok.
+
+Druhou vstupnĂ metodou (123) je ÄĂselnĂ˝ vstup: KaĹždou klĂĄvesu, kterou stisknÄte, je doslova zadĂĄna jako ÄĂslo.
+
+TĹetĂ vstupnĂ metodou (Abc) je vstupnĂ reĹžim Alfa/opakovanĂŠho stisknutĂ tlaÄĂtka. Tento reĹžim je urÄen pro zadĂĄvĂĄnĂ textu bez pomoci od slovnĂku pĹedvĂdavĂŠho reĹžimu (Pre). Text je zadĂĄvĂĄn po jednotlivĂ˝ch pĂsmenech. Pro kaĹždĂŠ pĂsmeno nejdĹĂve stisknÄte ÄĂslo sady, kterĂŠ obsahuje pĂsmeno, kterĂŠ chcete, pak pouĹžijte tlaÄĂtko dalĹĄĂ (#) pro prochĂĄzenĂ pĂsmeny a opakujte s dalĹĄĂm ÄĂslem. NapĹĂklad, pro zadĂĄnĂ slova 'look' musĂte stisknout nĂĄsledujĂcĂ: 5##6##6##5#
+
+DialogovĂŠ okno je plnÄ pouĹžitelnĂŠ pomocĂ myĹĄi, ale v nÄkterĂ˝ch verzĂch ScummVM pro jinĂŠ platformy, je pouĹžitĂ dialogu pohodlnÄjĹĄĂ pomocĂ ÄĂselnĂŠ klĂĄvesnice. NÄkterĂĄ tlaÄĂtka dialogu mohou bĂ˝t takĂŠ pouĹžĂvĂĄna pomocĂ ĹĄipkovĂ˝ch klĂĄves a enter.
+
+
+3.16) PoznĂĄmky k Mickey's Space Adventure:
+----- ------------------------------------
+Abyste mohli Mickey's Space Adventure hrĂĄt ve ScummVM, potĹebujete spolu s datovĂ˝mi soubory hry takĂŠ pĹŻvodnĂ spouĹĄtÄÄ (mickey.exe).
+
+Pro tuto hru ve ScummVM, existuje rozĹĄĂĹenĂĄ podpora myĹĄi, i kdyĹž v pĹŻvodnĂ hĹe takovĂĄto podpora nebyla. PoloĹžky menu mohou bĂ˝t vybrĂĄny pomocĂ myĹĄi a je takĂŠ moĹžnĂŠ se myĹĄĂ pĹesunout do jinĂ˝ch mĂst. KdyĹž se kurzor myĹĄi nachĂĄzĂ na okraji obrazovky, zÄervenĂĄ, pokud je moĹžnĂŠ jĂt v tomto smÄru. HrĂĄÄ pak mĹŻĹže jednoduĹĄe kliknout na okraje hernĂ obrazovky pro zmÄnu mĂsta, podobnÄ jako mnoho adventur, coĹž je jednoduĹĄĹĄĂ a pĹĂmoÄaĹejĹĄĂ neĹž pohyb pomocĂ menu.
+
+
+3.17) Winnie the Pooh notes:
+----- ----------------------
+Je moŞnÊ importovat uloŞenÊ hry z původnà hry do ScummVM.
+
+Pro tuto hru ve ScummVM, existuje rozĹĄĂĹenĂĄ podpora myĹĄi, i kdyĹž v pĹŻvodnĂ hĹe takovĂĄto podpora nebyla. PoloĹžky menu mohou bĂ˝t vybrĂĄny pomocĂ myĹĄi a je takĂŠ moĹžnĂŠ se myĹĄĂ pĹesunout do jinĂ˝ch mĂst. KdyĹž se kurzor myĹĄi nachĂĄzĂ na okraji obrazovky, zÄervenĂĄ, pokud je moĹžnĂŠ jĂt v tomto smÄru. HrĂĄÄ pak mĹŻĹže jednoduĹĄe kliknout na okraje hernĂ obrazovky pro zmÄnu mĂsta, podobnÄ jako mnoho adventur, coĹž je jednoduĹĄĹĄĂ a pĹĂmoÄaĹejĹĄĂ neĹž pohyb pomocĂ menu.
+
+
+3.18) PoznĂĄmky k Troll's Tale:
+----- ------------------------
+PĹŻvodnĂ hra vychĂĄzela na zavĂĄdÄcĂm disku PC, proto je nutnĂŠ vypsat obsah tohoto disku jako obraz disku a pĹejmenovat ho na "troll.img", abyste tuho hru mohli hrĂĄt ve ScummVM.
+
+
+3.19) PoznĂĄmky k DraÄĂ Historie:
+----- --------------------------
+ExistujĂ 4 jazykovĂŠ varianty tĂŠto hry: ÄeskĂĄ, anglickĂĄ, polskĂĄ a
+nÄmeckĂĄ. KaĹždĂĄ je umĂstÄna v oddÄlenĂŠm archivu. JedinĂĄ oficiĂĄlnĂ verze je ÄeskĂĄ, a anglickĂĄ, polskĂĄ a nÄmeckĂĄ byly vĹždycky nedokonÄenĂŠ prĂĄce a nikdy nebyly oficiĂĄlnÄ vydĂĄny. I kdyĹž texty byly zcela pĹeloĹženy, je znĂĄmo, Ĺže nÄkterĂŠ z nich obsahujĂ pĹeklepy.
+
+Pro tuto hru existuje nepovinnĂ˝ ÄeskĂ˝ dabing. Z dĹŻvodu velikosti si ho mĹŻĹžete dodateÄnÄ stĂĄhnout a pak ho rozbalit do adresĂĄĹe hry. MĹŻĹžete takĂŠ ÄeskĂ˝ dabing poslouchat se vĹĄemi jazykovĂ˝mi varianty hry, zatĂmco Ätete titulky.
+
+Vťechny hernà soubory a nåvody můŞou být ståhnuty z
+http://www.ucw.cz/draci-historie/index-en.html
+
+3.20) Titulky a hlasy soubÄĹžnÄ v hrĂĄch Sierra SCI:
+----- --------------------------------------------
+UrÄitĂŠ CD verze her Sierra SCI majĂ textovĂĄ i hlasovĂĄ data.
+NÄkterĂŠ z nich majĂ volbu pro pĹepĂnĂĄnĂ mezi nimi, ale existujĂ pĹĂpady
+kde nenĂ moĹžnost povolit oba najednou. Ve ScummVM je moĹžnĂŠ si uĹžĂt tento
+kombinovanĂ˝ reĹžim, kde jsou zvuk i text zobrazeny souÄasnÄ. Tento reĹžim
+můŞe být povolen v nastavenà zvuku ScummVM, ale kaŞdå hra se chovå jinak
+vzhledem k povolenĂ textu a hlasu.
+
+Hry na CD, kde zvuk i titulky lze zobrazit souÄasnÄ:
+ EcoQuest 1 CD
+ Freddy Pharkas CD
+ King's Quest 6 CD
+ Laura Bow 2 CD
+ Leisure Suit Larry 6 CD
+ Space Quest 4 CD
+
+EcoQuest 1 CD:
+ Hlas i text lze zapnout pomocĂ volby "Mode" v oknÄ nastavenĂ,
+ nebo pĹes nastavenĂ zvuku ScummVM.
+
+Freddy Pharkas CD:
+ Ve hĹe neexistuje moĹžnost pro povolenĂ hlasu a textu. Pro tuto funkci
+ je tĹeba pouĹžĂt nastavenĂ zvuku ve ScummVM. NÄkterĂŠ mluvenĂŠ dialogy
+ chybĂ v textech hry.
+
+King's Quest 6 CD
+ Hlas i text lze zapnout pomocĂ volby "Mode" v oknÄ nastavenĂ (kde je ve
+ ScummVM pĹidĂĄna dodateÄnĂĄ volba "Dual"), nebo pomocĂ nastavenĂ
+ zvuku ve ScummVM.
+
+Laura Bow 2 CD
+ Hlas i text lze zapnout pomocĂ volby "Mode" v oknÄ nastavenĂ (kde je ve
+ ScummVM pĹidĂĄna dodateÄnĂĄ volba "Dual"), nebo pomocĂ nastavenĂ
+ zvuku ve ScummVM.
+
+Leisure Suit Larry 6 CD
+ Ve hĹe lze povolit buÄ hlas, nebo hlas a text. Neexistuje moĹžnost pro
+ povolenĂ textu. Pouze nastavenĂ zvuku ve ScummVM lze pouĹžĂt pro
+ zobrazenĂ jen titulkĹŻ.
+
+Space Quest 4 CD:
+ Hlas a text lze povolit pomocĂ tlaÄĂtka "Display Mode" v
+ nastavenĂ hry, nebo pomocĂ nastavenĂ zvuku ve ScummVM.
+
+
+3.21) ZnĂĄmĂŠ ProblĂŠmy:
+----- ---------------
+Toto vydĂĄnĂ mĂĄ nĂĄsledujĂcĂ znĂĄmĂŠ problĂŠmy. NenĂ tĹeba je ohlaĹĄovat, i kdyĹž zĂĄplaty pro jejich opravu jsou vĂtĂĄny. Pokud objevĂte chybu, kterĂĄ nenĂ zde v seznamu, ani nenĂ v seznamu kompatibility na internetovĂŠ strĂĄnce, prohlĂŠdnÄte si, prosĂm, ÄĂĄst o hlĂĄĹĄenĂ chyb.
+
+ Hry CD Audio:
+- PĹi hranĂ her, kterĂŠ pouĹžĂvajĂ CD Audio (hry FM-TOWNS, Loom CD, atd) mĹŻĹže u uĹživatelĹŻ Microsoft Windows 2000/XP dochĂĄzet k nĂĄhodnĂ˝m pĂĄdĹŻm. To je dĂky dlouhotrvajĂcĂ chybÄ Windows, kterĂĄ mĂĄ za nĂĄsledek poĹĄkozenĂŠ soubory pĹi ÄtenĂ z CD. Abyste se tomuto vyhnuli, zkopĂrujte, prosĂm, soubory na pevnĂ˝ disk
+
+ Verze FM-TOWNS:
+- Verze KandĹži vyĹžaduje ROM pĂsma FM-TOWNS
+
+ Loom:
+- VypnutĂ titulkĹŻ pomocĂ souboru nastavenĂ je nevypne spolehlivÄ, protoĹže skripty Loom je znovu automaticky zapnou
+- Podpora MIDI ve verzi EGA vyĹžaduje aktualizaci Roland LucasArts
+- Verze KandĹži na PC-Engine vyĹžaduje rom systĂŠmovĂŠ karty
+
+ The Secret of Monkey Island:
+- Podpora MIDI ve verzi EGA vyĹžaduje aktualizaci Roland LucasArts
+
+ Beneath a Steel Sky:
+- Verze pro Amiga nejsou podporovĂĄny
+- Demoverze z diskety nejsou podporovåny
+- NenĂ chyba: Ve verzi na CD chybĂ v jistĂ˝ch dialozĂch ĹeÄ, to je normĂĄlnĂ.
+
+ Elvira - Mistress of the Dark
+- Ve verzi pro Atari ST nefunguje hudba
+
+ Elvira II - The Jaws of Cerberus
+- Ve verzi pro Atari ST nefunguje hudba
+
+- Ve verzi pro PC nefungujĂ zvukovĂŠ efekty
+- Ve verzi pro Atari ST jsou problĂŠmy s paletou
+
+ Inherit the Earth: Quest for the Orb
+- Verze pro Amiga nejsou podporovĂĄny
+
+ Simon the Sorcerer 1:
+- V anglickĂ˝ch a nÄmeckĂ˝ch verzĂch na CD nejsou titulky dostupnĂŠ, protoĹže jim vÄtĹĄina titulkĹŻ chybĂ.
+
+ Simon the Sorcerer 2:
+- Kombinace ĹeÄi a titulkĹŻ Äasto zpĹŻsobĂ, Ĺže ĹeÄ je pĹeruĹĄena brzo, toto je omezenĂ pĹŻvodnĂ hry.
+- Ve verzĂch pro Amiga a Macintosh je podporovĂĄn pouze vĂ˝chozĂ jazyk datovĂ˝ch souborĹŻ (angliÄtina).
+
+ Simon the Sorcerer's Puzzle Pack:
+- ŽådnĂĄ podpora pro zobrazovĂĄnĂ, zadĂĄvĂĄnĂ, uklĂĄdĂĄnĂ, Äi naÄĂtĂĄnĂ nejvyĹĄĹĄĂch skĂłre.
+- ŽådnĂĄ podpora pro zobrazovĂĄnĂ nĂĄzvĹŻ poloĹžek, kdyĹž na nÄ najedete myĹĄĂ ve Swampy Adventures.
+
+ The Feeble Files:
+- Titulky jsou Äasto nedokonÄenĂŠ. VÂ pĹŻvodnĂ hĹe byly vĹždy zakĂĄzĂĄny.
+
+ The Legend of Kyrandia:
+- Ve verzĂch na disketÄ pro Mac nenà ŞådnĂĄ hudba ani zvukovĂŠ efekty.
+- CD Macintosh pouĹžĂvĂĄ zahrnutou hudbu a zvukovĂŠ efekty z DOS.
+
+ Hry Humongous Entertainment:
+ - Pouze pĹŻvodnĂ rozhranĂ pro uloĹženĂ a naÄtenĂ mohou bĂ˝t pouĹžity.
+ - ŽådnĂĄ podpora pro hru vĂce hrĂĄÄĹŻ nebo tisknutĂ obrĂĄzkĹŻ
+
+4.0) PodporovanĂŠ Platformy:
+---- ----------------------
+ScummVM byl vytvoĹen tak, aby mohl fungovat na mnoha platformĂĄch a operaÄnĂch systĂŠmech.
+Odkazy na tyto verze mĹŻĹžou bĂ˝t nalezeny buÄ na strĂĄnkĂĄch ScummVM nebo vyhledĂĄvĂĄnĂm na internetu. Mnoho dĂkĹŻ naĹĄim programĂĄtorĹŻm za jejich ĂşsilĂ. Pokud mĂĄte verzi ScummVM pro jinou platformu/systĂŠm a chcete ho odevzdat do hlavnĂho ĂşloĹžiĹĄtÄ, nevĂĄhejte nĂĄs kontaktovat!
+
+PodporovanĂŠ platformy zahrnujĂ (mimo jinĂŠ):
+
+ UNIX (Linux, Solaris, IRIX, *BSD, ...)
+ Windows
+ Windows CE a Windows Mobile (vÄetnÄ SmartphonĹŻ a PocketPCs)
+ Mac OS X
+ AmigaOS
+ Android
+ BeOS
+ Dreamcast
+ GP2x
+ iPhone (vÄetnÄ iPod Touch a iPad)
+ Maemo (Nokia Internet tablet N810)
+ Nintendo 64
+ Nintendo DS
+ Nintendo GameCube
+ Nintendo Wii
+ OS/2
+ PlayStation 2
+ PlayStation Portable
+ Symbian
+ WebOS
+
+Verze pro Dreamcast nepodporuje The Curse of Monkey Island, ani The Dig. Verze pro Nintendo DS nepodporuje Full Throttle, The Dig, nebo The Curse of Monkey Island.
+Pro dalĹĄĂ omezenĂ v zĂĄvislosti na platformÄ se, prosĂm, podĂvejte na naĹĄĂ Wiki:
+ http://wiki.scummvm.org/index.php/Platforms
+
+Ve verzi pro Macintosh je stisknutĂ pravĂŠho tlaÄĂtka myĹĄi emulovĂĄno pomocĂ Cmd-kliknutĂ (to je, Ĺže stisknete tlaÄĂtko myĹĄi pĹi drĹženĂ klĂĄvesy
+Command/Apple/Vrtule).
+
+TakĂŠ existujĂ neoficiĂĄlnĂ verze pro rĹŻznĂŠ platformy, vÄetnÄ PlayStation 3, Xbox, a Xbox 360. NezapomeĹte, Ĺže my jsme tyto verze nevytvoĹili, takĹže je nemĹŻĹžeme ani schvĂĄlit ani podporovat. PouĹžĂvejte na vlastnĂ riziko!
+
+
+5.0) SpuĹĄtÄnĂ ScummVM:
+---- -----------------
+VĹĄimnÄte si prosĂm, Ĺže ScummVM bude uloĹženĂŠ hry standardnÄ uklĂĄdat do sloĹžky z kterĂŠ je spuĹĄtÄn, takĹže byste se mÄli vyhnout jeho spouĹĄtÄnĂ z vĂce umĂstÄnĂ. DalĹĄĂ informace, vÄetnÄ jak urÄit sloĹžku pro uloĹženĂŠ hry pro zamezenĂ tohoto problĂŠmu, najdete v oddĂlu 6.0.
+
+ScummVM mĹŻĹže bĂ˝t takĂŠ spuĹĄtÄn pĹĂmo pomocĂ spouĹĄtÄcĂho souboru. V tomto pĹĂpadÄ bude aktivovĂĄn zabudovanĂ˝ spouĹĄtÄÄ. OdsuÄ mĹŻĹžete pĹidat hry
+(kliknÄte na 'PĹidat hru'), nebo spustit ty, co uĹž jsou nastaveny.
+Hry mohou bĂ˝t takĂŠ pĹidĂĄny ve velkĂŠm mnoĹžstvĂ. StisknutĂm shift + 'PĹidat
+Hru' (VĹĄimnÄte si, Ĺže se tlaÄĂtko zmÄnĂ na 'HromadnĂŠ PĹidĂĄnĂ'), mĹŻĹžete zvolit sloĹžku, v kterĂŠ zaÄĂt, a ScummVM se potĂŠ pokusĂ zjistit hry ve vĹĄech podsloĹžkĂĄch tĂŠto sloĹžky.
+
+ScummVM mĹŻĹže takĂŠ hru spustit pĹĂmo pomocĂ argumentĹŻ pĹĂkazovĂŠ ĹĂĄdky -- viz dalĹĄĂ ÄĂĄst.
+
+
+5.1) MoĹžnosti pĹĂkazovĂŠho ĹĂĄdku:
+---- ---------------------------
+
+ PouĹžitĂ: scummvm [MOĹ˝NOSTI]... [HRA]
+
+ [HRA] KrĂĄtkĂŠ jmĂŠno hry pro naÄtenĂ. NapĹĂklad 'monkey'pro Monkey Island. To mĹŻĹže bĂ˝t buÄ id hry, nebo uĹživatelem urÄenĂ˝ cĂl.
+ -v, --version ZobrazĂ informace o verzi ScummVM a ukonÄĂ se
+ -h, --help ZobrazĂ struÄnou nĂĄpovÄdu a ukonÄĂ se
+ -z, --list-games ZobrazĂ seznam podporovanĂ˝ch her a ukonÄĂ se
+ -t, --list-targets ZobrazĂ seznam nastavenĂ˝ch cĂlĹŻ a ukonÄĂ se
+ --list-saves=CĂL ZobrazĂ seznam uloĹž. her pro urÄenou hru (CĂL)
+ --console PovolĂ okno konzole (vĂ˝chozĂ: zapnuto) (Pouze pro Windows)
+ -c, --config=NastavenĂ PouĹžije jinĂ˝ soubor s nastavenĂm
+ -p, --path=CESTA Cesta, kde je hra nainstalovĂĄna
+ -x, --save-slot[=ÄĂSLO] Pozice uloĹženĂŠ hry pro naÄtenĂ (vĂ˝chozĂ: automatickĂĄ)
+ -f, --fullscreen Vynutit reĹžim celĂŠ obrazovky
+ -F, --no-fullscreen Vynutit reĹžim do okna
+ -g, --gfx-mode=REĹ˝IM Vybere reĹžim obrazu (viz takĂŠ ÄĂĄst 5.3)
+ --gui-theme=VZHLED Vybere vzhled rozhranĂ (vĂ˝chozĂ, modernĂ, klasickĂ˝)
+ --themepath=CESTA Cesta kde jsou vzhledy rozhranĂ uloĹženy
+ --list-themes Zobrazà seznam vťech pouŞitelných vzhledů
+ -e, --music-driver=REĹ˝IM Vybere ovladaÄ hudby (viz takĂŠ ÄĂĄst 7.0)
+ --list-audio-devices ZobrazĂ seznam vĹĄech dostupnĂ˝ch zvukovĂ˝ch zaĹĂzenĂ
+ -q, --language=JAZYK Vybere jazyk hry (viz takĂŠ ÄĂĄst 5.2)
+ -m, --music-volume=Ä. NastavĂ hlasitost hudby, 0-255 (vĂ˝chozĂ: 192)
+ -s, --sfx-volume=Ä. NastavĂ hlasitost zvukĹŻ, 0-255 (vĂ˝chozĂ: 192)
+ -r, --speech-volume=Ä. NastavĂ hlasitost hlasĹŻ, 0-255 (vĂ˝chozĂ: 192)
+ --midi-gain=Ä. NastavĂ zvýťenĂ pro pĹehrĂĄvĂĄnĂ MIDI, 0-1000 (vĂ˝chozĂ: 100) (podporovĂĄno pouze nÄkterĂ˝mi ovladaÄi MIDI)
+ -n, --subtitles Zapne titulky (pouĹžijte v hrĂĄch s ĹeÄĂ)
+ -b, --boot-param=Ä. PĹedĂĄ ÄĂslo zavĂĄdÄjĂcĂmu skriptu (parametr zavedenĂ)
+ -d, --debuglevel=Ä. NastavĂ ĂşroveĹ podrobnostĂ ladÄnĂ
+ --debugflags=PĹĂZNAKY PovolĂ urÄitĂŠ pĹĂznaky ladÄnĂ jĂĄdra (oddÄlenĂŠ ÄĂĄrkami)
+ -u, --dump-scripts PovolĂ vĂ˝pis skriptu, pokud sloĹžka s nĂĄzvem 'dumps' existuje v souÄasnĂŠ sloĹžce
+ --cdrom=ÄĂSLO Jednotka CD z kterĂŠ pĹehrĂĄvat CD audio (vĂ˝chozĂ: 0 = prvnĂ jednotka)
+ --joystick[=ÄĂSLO] PovolĂ vstup z joysticku (vĂ˝chozĂ: 0 = prvnĂ joystick)
+ --platform=SLOVO UrÄĂ platformu hry (povolenĂŠ hodnoty: 2gs, 3do, acorn, amiga, atari, c64, fmtowns, mac, nes, pc, pce, segacd, windows)
+ --savepath=CESTA Cesta, kde jsou umĂstÄny uloĹženĂŠ hry
+ --extrapath=CESTA DodateÄnĂĄ cesta pro dalĹĄĂ data hry
+ --soundfont=SOUBOR Vybere SoundFont pro pĹehrĂĄvĂĄnĂ MIDI (PodporovĂĄno pouze nÄkterĂ˝mi ovladaÄi MIDI)
+ --multi-midi PovolĂ kombinaci AdLib a pĹirozenĂŠho MIDI
+ --native-mt32 PravĂ˝ Roland MT-32 (zakĂĄĹže emulaci GM)
+ --enable-gs PovolĂ reĹžim Roland GS pro pĹehrĂĄvĂĄnĂ MIDI
+ --output-rate=FREKVENCE VĂ˝stupnĂ vzorkovacĂ kmitoÄet v Hz (napĹ. 22050)
+ --opl-driver=OVLADAÄ Vybere emulĂĄtor AdLib (OPL) (db, mame)
+ --aspect-ratio PovolĂ korekci pomÄru stran
+ --render-mode=REĹ˝IM PovolĂ dodateÄnĂŠ reĹžimy vykreslenĂ (cga, ega, hercGreen, hercAmber, amiga)
+ --alt-intro PouĹžije alternativnĂ intro pro CD verze Beneath a Steel Sky a Flight of the Amazon Queen
+ --copy-protection PovolĂ ochranu proti kopĂrovĂĄnĂ v hrĂĄch, kdyĹž ji ScummVM standardnÄ zakazuje.
+ --talkspeed=ÄĂSLO NastavĂ zdrĹženĂ mluvenĂ v hrĂĄch SCUMM, nebo rychlost mluvenĂ v jinĂ˝ch hrĂĄch (vĂ˝chozĂ: 60)
+ --demo-mode SpustĂ reĹžim dema v Maniac Mansion (KlasickĂĄ verze)
+ --tempo=NUM NastavĂ rychlost hudby (v procentech, 50-200) pro hry SCUMM (vĂ˝chozĂ: 100)
+
+
+VĂ˝znam vĹĄech dlouhĂ˝ch moĹžnostĂ (to jsou ty, kterĂŠ zaÄĂnajĂ dvojitou pomlÄkou) mĹŻĹže bĂ˝t pĹevrĂĄcen, kdyĹž pĹed nÄ pĹidĂĄte "no-". NapĹĂklad,
+--no-aspect-ratio vypne korekci pomÄru stran. To je uĹžiteÄnĂŠ, kdyĹž chcete potlaÄit nastavenĂ v souboru.
+
+KrĂĄtkĂŠ jmĂŠno hry ('cĂl hry'), kterĂ˝ vidĂte na konci pĹĂkazovĂŠho ĹĂĄdku, urÄuje, kterĂĄ hra je spuĹĄtÄna. BuÄ odpovĂdĂĄ libovolnĂŠmu cĂli urÄenĂŠho uĹživatelem (ze souboru s nastavenĂm), nebo zabudovanĂŠmu id hry. KrĂĄtkĂ˝ seznam zabudovanĂ˝ch id mĹŻĹže bĂ˝t nalezen v ÄĂĄsti list 3.0.
+
+PĹĂklady:
+ * Win32:
+ SpuĹĄtÄnĂ Monkey Island, celĂĄ obrazovka, z pevnĂŠho disku:
+ C:\Games\LucasArts\scummvm.exe -f -pC:\Games\LucasArts\monkey\ monkey
+ SpuĹĄtÄnĂ Full Throttle z CD, celĂĄ obrazovka a se zapnutĂ˝mi titulky:
+ C:\Games\LucasArts\scummvm.exe -f -n -pD:\resource\ ft
+
+ * Unix:
+ SpuĹĄtÄnĂ Monkey Island, celĂĄ obrazovka, z pevnĂŠho disku:
+
+ /path/to/scummvm -f -p/games/LucasArts/monkey/ monkey
+ SpuĹĄtÄnĂ Full Throttle z CD, celĂĄ obrazovka a se zapnutĂ˝mi titulky:
+ /path/to/scummvm -f -n -p/cdrom/resource/ ft
+
+
+5.2) Volby jazyka:
+---- -------------
+ScummVM obsahuje volby jazyka pro Maniac Mansion, Zak McKracken,
+The Dig, The Curse of Monkey Island, Beneath a Steel Sky a
+Broken Sword.
+
+NezapomeĹte, Ĺže kromÄ Beneath a Steel Sky, Broken Sword, mnohajazykovĂŠ verze her Goblins a Nippon Safes Inc., pouĹžitĂ tĂŠto moĹžnosti *nezmÄnĂ* jazyk hry (kterĂ˝ je vÄtĹĄinou pevnÄ zakĂłdovĂĄn), ale spĂĹĄe je pouĹžita pro vybrĂĄnĂ sprĂĄvnĂŠho pĂsma (napĹ. pro nÄmeckou verzi obsahujĂcĂ pĹehlĂĄsky).
+
+Výjimky jsou The Dig a The Curse of Monkey Island -- neanglickÊ
+Verze mohou bĂ˝t nastaveny na 'English'. NicmĂŠnÄ toto ovlivĹuje pouze titulky; ĹeÄ ve hĹe zĹŻstane stejnĂĄ.
+
+Maniac Mansion a Zak McKracken
+ en - AngliÄtina (vĂ˝chozĂ)
+ de - NÄmÄina
+ fr - FrancouzĹĄtina
+ it - ItalĹĄtina
+ es - Ĺ panÄlĹĄtina
+
+The Dig
+ jp - JaponĹĄtina
+ zh - ÄĂnĹĄtina
+ kr - KorejĹĄtina
+
+The Curse of Monkey Island
+ en - AngliÄtina (vĂ˝chozĂ)
+ de - NÄmÄina
+ fr - FrancouzĹĄtina
+ it - ItalĹĄtina
+ pt - PortugalĹĄtina
+ es - Ĺ panÄlĹĄtina
+ jp - JaponĹĄtina
+ zh - ÄĂnĹĄtina
+ kr - KorejĹĄtina
+
+Beneath a Steel Sky
+ gb - AngliÄtina (VelkĂĄ BritĂĄnie) (vĂ˝chozĂ)
+ en - AngliÄtina (USA)
+ de - NÄmÄina
+ fr - FrancouzĹĄtina
+ it - ItalĹĄtina
+ pt - PortugalĹĄtina
+ es - Ĺ panÄlĹĄtina
+ se - Ĺ vĂŠdĹĄtina
+
+Broken Sword
+ en - AngliÄtina (vĂ˝chozĂ)
+ de - NÄmÄina
+ fr - FrancouzĹĄtina
+ it - ItalĹĄtina
+ pt - PortugalĹĄtina
+ es - Ĺ panÄlĹĄtina
+ cz - ÄeĹĄtina
+
+
+5.3) GrafickĂŠ filtry:
+---- ----------------
+ScummVM nabĂzĂ nÄkolik filtrĹŻ vyhlazujĂcĂch hrany jako pokus o zlepĹĄenĂ obrazovĂŠ kvality. Jsou to stejnĂŠ filtry, kterĂŠ pouĹžĂvĂĄ i mnoho jinĂ˝ch emulĂĄtorĹŻ, jako MAME. Tyto filtry vezmou pĹŻvodnĂ grafiku hry a zvÄtĹĄĂ ji o urÄitou pevnou hodnotu (vÄtĹĄinou 2x nebo 3x) neĹž ji VĂĄm zobrazĂ. TakĹže napĹĂklad, pokud hra pĹŻvodnÄ pracovala v rozliĹĄenĂ 320x200 (typickĂŠ pro vÄtĹĄinu her SCUMM), pak pouĹžitĂm filtru s faktorem zvÄtĹĄenĂ 2x, ve skuteÄnosti dostanete rozliĹĄenĂ 640x400. PodobnÄ s filtrem 3x dostanete 960x600.
+
+Jsou to:
+ 1x - Bez filtrovĂĄnĂ, bez zvÄtĹĄenĂ. NejrychlejĹĄĂ.
+ 2x - Bez filtrovĂĄnĂ, zvÄtĹĄenĂ 2x (vĂ˝chozĂ pro hry 640x480).
+ 3x - Bez filtrovĂĄnĂ, zvÄtĹĄenĂ 3x.
+ 2xsai - Filtr 2xSAI, zvÄtĹĄenĂ 2x.
+ super2xsai â VylepĹĄenĂŠ filtrovĂĄnĂ 2xSAI, zvÄtĹĄenĂ 2x.
+ supereagle â MĂŠnÄ rozostĹenĂ˝ neĹž 2xSAI, ale pomalejĹĄĂ. ZvÄtĹĄenĂ 2x.
+ advmame2x - NespolĂŠhĂĄ na rozostĹenĂ jako 2xSAI, rychlĂŠ. ZvÄtĹĄenĂ 2x.
+ advmame3x - NespolĂŠhĂĄ na rozostĹenĂ jako 2xSAI, rychlĂŠ. ZvÄtĹĄenĂ 3x.
+ hq2x - Velmi hezkĂĄ vysokĂĄ kvalita, ale pomalĂ˝. ZvÄtĹĄenĂ 2x.
+ hq3x - Velmi hezkĂĄ vysokĂĄ kvalita, ale pomalĂ˝. ZvÄtĹĄenĂ 3x.
+ tv2x - Filtr proklĂĄdĂĄnĂ, snaŞà se emulovat TV. ZvÄtĹĄenĂ 2x.
+ dotmatrix - Efekt bodovĂŠ matice. ZvÄtĹĄenĂ 2x.
+
+Abyste filtr vybrali, zvolte ho ve spouĹĄtÄÄi, nebo pĹedejte scummvm jeho jmĂŠno pomocĂ moĹžnosti '-g', napĹĂklad:
+
+ scummvm -gadvmame2x monkey2
+
+PoznĂĄmka #1: Ne vĹĄechny jĂĄdra podporujĂ vĹĄechny (nebo dokonce ŞådnĂŠ) z filtrĹŻ vypsanĂ˝ch výťe; nÄkterĂŠ mohou podporovat i dalĹĄĂ. Filtry vypsanĂŠ výťe jsou ty podporovanĂŠ standardnĂm jĂĄdrem SDL.
+
+PoznĂĄmka #2: Filtry mohou bĂ˝t velmi pomalĂŠ, kdyĹž je ScummVM sestaven v nastavenĂ pro ladÄnĂ bez optimalizacĂ. PouĹžitĂ jakĂŠkoliv formy vyhlazenĂ hran/lineĂĄrnĂho filtrovĂĄnĂ bude mĂt vĹždycky dopad na rychlost.
+
+PoznĂĄmka #3: Verze FM-TOWNS hry Zak McKracken mĂĄ pĹŻvodnĂ rozliĹĄenĂ 320x240, coĹž znamenĂĄ, Ĺže filtry v tĂŠto hĹe budou zvÄtĹĄovat na 640x480
+nebo 960x720. ObdobnÄ hry, kterĂŠ majĂ pĹŻvodnĂ rozliĹĄenĂ 640x480 (jako
+Curse of Monkey Island nebo Broken Sword) budou zvÄtĹĄeny na 1280x960 a
+1920x1440.
+
+
+5.4) GlobĂĄlnĂ menu:
+---- --------------
+GlobĂĄlnĂ Menu je obecnĂŠ menu, kterĂŠ je dostupnĂŠ vĹĄem jĂĄdrĹŻm her stisknutĂm Ctrl-F5. Z tohoto menu jsou dostupnĂŠ nĂĄsledujĂcĂ tlaÄĂtka: PokraÄovat, Volby, O programu, NĂĄvrat do SpouĹĄtÄÄe, a UkonÄit. VĂ˝bÄrem
+'Volby' bude zobrazeno dialogovĂŠ okno, kde mĹŻĹžou bĂ˝t upravena zĂĄkladnĂ nastavenĂ zvuku, jako hladiny hlasitosti. VĂ˝bÄrem 'NĂĄvrat do SpouĹĄtÄÄe' souÄasnou hru ukonÄĂ a uĹživatele navrĂĄtĂ do spouĹĄtÄÄe ScummVM, kde mĹŻĹže bĂ˝t vybrĂĄna dalĹĄĂ hra ke hranĂ.
+
+PoznĂĄmka: NĂĄvrat do SpouĹĄtÄÄe nenĂ podporovĂĄn vĹĄemi jĂĄdry a tlaÄĂtko nebude v GlobĂĄlnĂm Menu funkÄnĂ, pokud nenĂ podporovĂĄno.
+
+JĂĄdra, kterĂĄ v souÄasnosti podporujĂ nĂĄvrat do spouĹĄtÄÄe, jsou:
+
+ AGI
+ AGOS
+ CINE
+ COMPOSER
+ CRUISE
+ DRACI
+ DRASCULA
+ GOB
+ GROOVIE
+ HUGO
+ KYRA
+ LURE
+ MADE
+ MOHAWK
+ PARALLACTION
+ QUEEN
+ SAGA
+ SCI
+ SCUMM
+ SKY
+ SWORD1
+ SWORD2
+ TEENAGENT
+ TOUCHE
+ TSAGE
+ TUCKER
+
+
+5.5) KlĂĄvesovĂŠ zkratky:
+---- ------------------
+ScummVM podporuje rĹŻznĂŠ zkratky ve hĹe. LiĹĄĂ se mezi rĹŻznĂ˝mi hrami SCUMM a jinĂ˝mi hrami.
+
+ SpoleÄnĂŠ:
+ Ctrl-F5 - ZobrazĂ GlobĂĄlnĂ Menu
+ Cmd-q - UkonÄit (Mac OS X)
+ Ctrl-q - UkonÄit (dalĹĄĂ unixy vÄetnÄ Linux)
+ Ctrl-z OR Alt-x - Quit (dalĹĄĂ platformy)
+ Ctrl-u - ZeslabĂ vĹĄechny zvuky
+ Ctrl-m - PĹepĂnat zachycenĂ myĹĄi
+ Ctrl-Alt 1-8 - PĹepĂnat mezi grafickĂ˝mi filtry
+ Ctrl-Alt + and - - ZvÄtĹĄit/ZmenĹĄit faktor zvÄtĹĄenĂ
+Ctrl-Alt a - PĹepĂnat korekci pomÄru stran. VÄtĹĄina her pouĹžĂvĂĄ rozliĹĄenĂ 320x200 pixelĹŻ, coĹž mĹŻĹže na vÄtĹĄinÄ novÄjĹĄĂch monitorĹŻ vypadat splĂĄcle. Korekce pomÄru stran obraz roztĂĄhne, aby mĂsto toho pouĹžil 320x240, nebo jeho nĂĄsobky
+ Alt-Enter - PĹepĂnĂĄ celou obrazovku/do okna
+ Alt-s - VytvoĹit snĂmek obrazovky (pouze jĂĄdro SDL)
+
+ SCUMM:
+ Ctrl 0-9 and Alt 0-9 - NahrĂĄt a uloĹžit stav hry
+ Ctrl-d - Spustit ladÄnĂ
+ Ctrl-f - Zapnout rychlĂ˝ reĹžim
+ Ctrl-g - PĹepnout do velmi VELMI rychlĂŠho reĹžimu
+ Ctrl-t - PĹepĂnat mezi 'Pouze ĹeÄ',
+ 'ĹeÄ a Titulky' a 'Pouze titulky'
+ Tilda (~) - Zobrazit/skrĂ˝t konzoli ladÄnĂ
+ [ and ] - Hlasitost hudby, zvýťit/snĂĹžit
+ - and + - Rychlost textu, pomalejĹĄĂ/rychlejĹĄĂ
+ F5 - ZobrazĂ rĂĄmeÄek pro uloĹženĂ/naÄtenĂ
+ Alt-F5 - ZobrazĂ pĹŻvodnĂ rĂĄmeÄek pro uloĹženĂ/naÄtenĂ, pokud hra nÄjakĂ˝ mĂĄ. Zde mĹŻĹžete hru naÄĂst i uloĹžit, nicmĂŠnÄ pro tento ĂşÄel nenĂ urÄen a v nÄkterĂ˝ch hrĂĄch mĹŻĹže zpĹŻsobit pĂĄd ScummVM.
+ i - ZobrazĂ IQ body (Indiana Jones and the Last Crusade a Indiana Jones and the Fate of Atlantis)
+ MezernĂk - PozastavenĂ
+ TeÄka (.) - V nÄkterĂ˝ch hrĂĄch pĹeskoÄĂ souÄasnĂ˝ ĹĂĄdek textu
+ Enter - Simulovat stisknutĂ levĂŠho tlaÄĂtka myĹĄi
+ Tab - Simulovat stisknutĂ pravĂŠho tlaÄĂtka myĹĄi
+
+ Beneath a Steel Sky:
+ Ctrl-d - SpustĂ ladÄnĂ
+ Ctrl-f - Zapnout rychlĂ˝ reĹžim
+ Ctrl-g - PĹepnout do velmi VELMI rychlĂŠho reĹžimu
+ F5 - ZobrazĂ rĂĄmeÄek pro uloĹženĂ/naÄtenĂ
+ Escape - PĹeskoÄĂ Ăşvod hry
+ Period (.) - PĹeskoÄĂ souÄasnĂ˝ ĹĂĄdek textu
+
+ Broken Sword:
+ F5 nebo Escape - ZobrazĂ rĂĄmeÄek pro uloĹženĂ/naÄtenĂ
+
+ Broken Sword II:
+ Ctrl-d - Spustit ladÄnĂ
+ Ctrl-f - Zapnout rychlĂ˝ reĹžim
+ p - PozastavenĂ
+
+ DraÄĂ Historie:
+ F5 - ZobrazĂ GlobĂĄlnĂ Menu
+ LevĂŠ klinutĂ - JĂt, zkoumat
+ PravĂŠ klinutĂ - PouĹžĂt, mluvit
+ Posun myĹĄi nahoru, i - InventĂĄĹ
+ Posun myĹĄi dolĹŻ, m - Mapa
+ Escape - PĹeskoÄĂ Ăşvod, odejde z mapy/inventĂĄĹe
+ JakĂŠkoliv kliknutĂ - PĹeskoÄĂ souÄasnÄ dabovanou vÄtu
+ q - ZapnutĂ/vypnutĂ rychlĂŠho chozenĂ
+
+ Flight of the Amazon Queen:
+ Ctrl-d - Spustit ladÄnĂ
+ Ctrl-f - Zapnout rychlĂ˝ reĹžim
+ F1 - PouĹžĂt DenĂk (uklĂĄdĂĄnĂ/naÄĂtĂĄnĂ)
+ F11 - RychlĂŠ naÄtenĂ
+ F12 - RychlĂŠ uklĂĄdĂĄnĂ
+ Escape - PĹeskoÄĂ video
+ MezernĂk - PĹeskoÄĂ souÄasnĂ˝ ĹĂĄdek textu
+
+ Future Wars
+ F1 - Prozkoumat
+ F2 - VzĂt
+ F3 - InventĂĄĹ
+ F4 - PouĹžĂt
+ F5 - Aktivovat
+ F6 - Mluvit
+ F9 - Menu "Aktivovat"
+ F10 - Menu "PouĹžĂt"
+ Escape - Zobrazit menu pĹĂkazĹŻ
+
+ Nippon Safes
+ Ctrl-d - Spustit ladÄnĂ
+ l - NaÄĂst hru
+ s - UloĹžit hru
+
+ Simon the Sorcerer 1 a 2:
+ Ctrl 0-9 a Alt 0-9 - NaÄĂst a uloĹžit stav hry
+ Ctrl-d - Spustit ladÄnĂ
+ Ctrl-f - Zapnout rychlĂ˝ reĹžim
+ F1 - F3 - Rychlost textu, rychlejĹĄĂ - pomalejĹĄĂ
+ F10 - ZobrazĂ vĹĄechny postavy a objekty s kterĂ˝mi mĹŻĹžete nÄco dÄlat
+ Escape - PĹeskoÄit videa
+ - a + - Hlasitost hudby, snĂĹžit/zvýťit
+ m - Hudba vypnout/zapnout
+ s - ZvukovĂŠ efekty zapnout/vypnout
+ b - Zvuky pozadĂ zapnout/vypnout [Pouze Simon the Sorcerer 2]
+ Pause - PozastavenĂ
+ t - PĹepĂnat mezi ĹeÄĂ a kombinacĂ ĹeÄi a titulkĹŻ [Simon the Sorcerer 1 CD (jinĂŠ neĹž angliÄtina a nÄmÄina) a Simon the Sorcerer 2 CD (vĹĄechny jazyky)]
+ v - PĹepĂnat mezi titulky a kombinacĂ ĹeÄi a titulkĹŻ [Pouze Simon the Sorcerer 2 CD]
+
+ Simon the Sorcerer's Puzzle Pack
+ Ctrl-d - Spustit ladÄnĂ
+ Ctrl-f - Zapnout rychlĂ˝ reĹžim
+ F12 - Zapnout/vypnout reĹžim rychle rychlosti ve Swampy Adventures
+ - a + - Hlasitost hudby, snĂĹžit/zvýťit
+ m - Hudba vypnout/zapnout
+ s - ZvukovĂŠ efekty zapnout/vypnout
+ Pause - PozastavenĂ
+
+ The Feeble Files
+ Ctrl-d - Spustit ladÄnĂ
+ Ctrl-f - Zapnout rychlĂ˝ reĹžim
+ F7 - VymÄnit postavy
+ F9 - Zapnout/vypnout jmĂŠna hitboxĹŻ
+ s - ZvukovĂŠ efekty zapnout/vypnout
+ Pause - PozastavenĂ
+ t - PĹepĂnat mezi ĹeÄĂ a kombinacĂ ĹeÄi a titulkĹŻ
+ v - PĹepĂnat mezi titulky a kombinacĂ ĹeÄi a titulkĹŻ
+
+ The Legend of Kyrandia:
+ Ctrl 0-9 and Alt 0-9 - NaÄĂst a uloĹžit stav hry
+
+ Ctrl-d - Spustit ladÄnĂ
+
+ TeenAgent
+ F5 - ZobrazĂ GlobĂĄlnĂ Menu
+
+ Touche: The Adventures of the Fifth Musketeer:
+ Ctrl-f - Zapnout rychlĂ˝ reĹžim
+ F5 - Zobrazit moĹžnosti
+ F9 - Zapnout reĹžim rychlĂŠ chĹŻze
+ F10 - Vypnout reĹžim rychlĂŠ chĹŻze
+ Escape - UkonÄit
+ MezernĂk - PĹeskoÄĂ souÄasnĂ˝ ĹĂĄdek textu
+ t - PĹepnout mezi 'Pouze ĹeÄ',
+ 'ĹeÄ a Text' a ' Pouze Text'
+
+NezapomeĹte, Ĺže pouĹžĂvĂĄnĂ Ctrl-f nebo Ctrl-g nenĂ doporuÄeno: hry mohou spadnout, kdyĹž bÄŞà rychlostĂ vyĹĄĹĄĂ neĹž jejich normĂĄlnĂ, protoĹže skripty ztratĂ synchronizaci.
+
+PoznĂĄmka pro uĹživatele WinCE: KvĹŻli omezenĂŠmu vstupu z klĂĄvesnice ve vÄtĹĄinÄ zaĹĂzenĂ je malĂŠ mnoĹžstvĂ klĂĄvesovĂ˝ch zkratek podporovĂĄno pomocĂ znovu mapovĂĄnĂ a/nebo ÄinnostĂ panelĹŻ. ProsĂm pĹeÄtÄte si soubor README-WinCE.txt.
+
+
+6.0) UloĹženĂŠ hry:
+---- ------------
+UloĹženĂŠ hry jsou na nÄkterĂ˝ch platformĂĄch standardnÄ umĂstÄny do souÄasnĂŠ sloĹžky a v jinĂ˝ch do pĹednastavenĂŠ sloĹžky. To mĹŻĹžete urÄit v souboru s nastavenĂm pomocĂ parametru savepath. PodĂvejte se na vzorovĂ˝ soubor s nastavenĂm dĂĄle v tomto souboru.
+
+Platformy, kterĂŠ v souÄasnosti majĂ jinĂŠ vĂ˝chozĂ sloĹžky jsou:
+ Mac OS X:
+ $HOME/Documents/ScummVM Savegames/
+
+ JinĂŠ unixy:
+ $HOME/.scummvm/
+
+ Windows Vista/7:
+ \Users\uĹžjmĂŠno\AppData\Roaming\ScummVM\Saved games\
+
+ Windows 2000/XP:
+ \Documents and Settings\uĹžjmĂŠno\Application Data\ScummVM\Saved games\
+
+ Windows NT4:
+ <windir>\Profiles\uĹžjmĂŠno\Application Data\ScummVM\Saved games\
+
+UloĹženĂŠ hry jsou ve Windows NT4/2000/XP/Vista/7 uklĂĄdĂĄny ve skrytĂŠ sloĹžce,
+do kterĂŠ mĹŻĹžete vstoupit spuĹĄtÄnĂm "%APPDATA%\ScummVM\Saved Games\" nebo
+povolenĂm zobrazenĂ skrytĂ˝ch sloĹžek v PrĹŻzkumnĂku Windows.
+
+PoznĂĄmka pro uĹživatele Windows NT4/2000/XP/Vista/7: VĂ˝chozĂ umĂstÄnĂ uloĹženĂ˝ch her
+bylo ve ScummVM 1.5.0 zmÄnÄno. DĂĄvkovĂ˝ soubor pĹesunu mĹŻĹže bĂ˝t pouĹžit pro zkopĂrovĂĄnĂ
+uloĹženĂ˝ch her ze starĂŠho vĂ˝chozĂho umĂstÄnĂ do novĂŠho.
+
+6.1) 6.1 AutomatickĂŠ uklĂĄdĂĄnĂ:
+---- -------------------------
+V nÄkterĂ˝ch hrĂĄch, (a to "Beneath a Steel Sky", "Flight of the Amazon
+Queen", vĹĄechny hry AGI, a vĹĄechny hry SCUMM), bude ScummVM standardnÄ automaticky uklĂĄdat souÄasnĂ˝ stav kaĹždĂ˝ch pÄt minut (upravitelnĂŠ pomocĂ nastavenĂ "autouklĂĄdĂĄnĂ"). Pro jĂĄdra AGI a SCUMM, je bude uklĂĄdat do pozice 0. V jĂĄdru SCUMM mĹŻĹže bĂ˝t tento uloĹženĂ˝ stav znovu naÄten pomocĂ Ctrl-0 nebo menu F5.
+
+
+6.2) PĹevod uloĹženĂ˝ch her:
+---- ---------------------
+PouĹžitĂ uloĹženĂ˝ch her z pĹŻvodnĂch verzĂ nenĂ podporovĂĄno vĹĄemi jĂĄdry. Pouze nĂĄsledujĂcĂ hry mohou pouĹžĂt pĹŻvodnĂ verze.
+
+ Elvira 1
+ - PĹidejte 8 bajtĹŻ (nĂĄzev uloĹženĂŠ hry) na zaÄĂĄtek souboru uloĹženĂŠ hry
+ - PĹejmenujte ho na 'elvira1.xxx'
+
+ Elvira 2
+ - PĹidejte 8 bajtĹŻ (nĂĄzev uloĹženĂŠ hry) na zaÄĂĄtek souboru uloĹženĂŠ hry
+ - PĹejmenujte ho na 'elvira2-pc.xxx' (verze DOS) nebo 'elvira2.xxx' (JinĂŠ verze)
+
+ Waxworks
+ - PĹidejte 8 bajtĹŻ (nĂĄzev uloĹženĂŠ hry) na zaÄĂĄtek souboru uloĹženĂŠ hry
+ - PĹejmenujte ho na 'waxworks-pc.xxx' (verze DOS) nebo 'waxworks.xxx' (JinĂŠ verze)
+
+ Simon the Sorcerer 1
+ - PĹejmenuje soubor uloĹženĂŠ hry na 'simon1.xxx'
+
+ Simon the Sorcerer 2
+ - PĹejmenuje soubor uloĹženĂŠ hry na 'simon2.xxx'
+
+ The Feeble Files
+ - PĹejmenuje soubor uloĹženĂŠ hry na 'feeble.xxx'
+
+Kde 'xxx' je ÄĂslo pozice uloĹženĂŠ hry (tj. 001) ve ScummVM
+
+
+6.3) ZobrazenĂ/NaÄtenĂ uloĹženĂ˝ch her z pĹĂkazovĂŠho ĹĂĄdku:
+---- ----------------------------------------------------
+
+--list-saves:
+
+ Tento pĹepĂnaÄ mĹŻĹže bĂ˝t pouĹžit k zobrazenĂ seznamu souÄasnĂ˝ch uloĹženĂ˝ch her urÄenĂŠ cĂlovĂŠ hry a jejĂ odpovĂdajĂcĂ pozice.
+
+ PouĹžitĂ: --list-saves=[CĂL], kde [CĂL] je cĂlovĂĄ hra.
+
+ JĂĄdra, kterĂĄ v souÄasnosti podporujĂ --list-saves jsou:
+
+ AGI
+ AGOS
+ CGE
+ CINE
+ CRUISE
+ DRACI
+ GROOVIE
+ HUGO
+ KYRA
+ LURE
+ MOHAWK
+ PARALLACTION
+ QUEEN
+ SAGA
+ SCI
+ SCUMM
+ SKY
+ SWORD1
+ SWORD2
+ TEENAGENT
+ TINSEL
+ TOON
+ TOUCHE
+ TSAGE
+ TUCKER
+
+--save-slot/-x:
+
+ Tento pĹepĂnaÄ mĹŻĹže bĂ˝t pouĹžit k naÄtenĂ uloĹženĂŠ hry pĹĂmo z pĹĂkazovĂŠho ĹĂĄdku.
+
+ PouĹžitĂ: --save-slot[POZICE] nebo -x[POZICE], kde [POZICE] je ÄĂslo uloĹženĂŠ pozice.
+
+ JĂĄdra, kterĂĄ v souÄasnosti podporujĂ--save-slot/-x jsou:
+
+ AGI
+ CGE
+ CINE
+ CRUISE
+ DRACI
+ GROOVIE
+ HUGO
+ KYRA
+ LURE
+ MOHAWK
+ QUEEN
+ SAGA
+ SCI
+ SCUMM
+ SKY
+ SWORD1
+ SWORD2
+ TEENAGENT
+ TINSEL
+ TOON
+ TOUCHE
+ TSAGE
+ TUCKER
+
+
+7.0) Hudba a Zvuk:
+---- -------------
+Ve vÄtĹĄinÄ operaÄnĂch systĂŠmĹŻ a pro vÄtĹĄinu her bude ScummVM standardnÄ pouĹžĂvat MT-32 nebo emulaci AdLib pro pĹehrĂĄvĂĄnĂ hudby. MIDI nemusĂ bĂ˝t
+DostupnĂŠ ve vĹĄech operaÄnĂch systĂŠmech, nebo potĹebuje ruÄnĂ nastavenĂ. Pokud chcete MIDI pouĹžĂt, mĂĄte nÄkolik rĹŻznĂ˝ch voleb pro vĂ˝stup, v zĂĄvislosti na VaĹĄem operaÄnĂm systĂŠmu a nastavenĂ.
+
+ null - PrĂĄzdnĂ˝ vĂ˝stup. NepĹehrĂĄvat Şådnou hudbu.
+ adlib - VnitĹnĂ emulace AdLib
+ fluidsynth â Emulace FluidSynth MIDI
+ mt32 - VnitĹnĂ emulace MT-32
+ pcjr - VnitĹnĂ emulace PCjr (pouĹžitelnĂŠ pouze ve hrĂĄch SCUMM)
+ pcspk - VnitĹnĂ emulace reproduktoru PC
+ towns - VnitĹnĂ emulace FM-TOWNS YM2612
+ (pouĹžitelnĂŠ pouze v hrĂĄch SCUMM FM-TOWNS)
+ alsa - VĂ˝stup pomocĂ zaĹĂzenĂ sekvencĂŠru ALSA. Viz nĂĹže.
+ core - Zvuk CoreAudio, pro uĹživatele Mac OS X.
+ coremidi - Zvuk CoreMIDI, pro uĹživatele Mac OS X. PouĹžĂvejte pouze, pokud mĂĄte hardwarovĂ˝ syntetizĂĄtor MIDI.
+ seq - PouĹžitĂ /dev/sequencer pro MIDI v systĂŠmu *nix. Viz nĂĹže
+ timidity - PĹipojenĂ k MIDI serveru TiMidity++. Viz nĂĹže.
+ windows - Windows MIDI. PouĹžije zabudovanĂ˝ sekvencĂŠr, pro Windows
+
+Abyste vybrali ovladaÄ zvuku, zvolte ho ve spouĹĄtÄÄi, nebo pĹedejte jeho jmĂŠno ScummVM pomocĂ moĹžnosti '-e', napĹĂklad:
+
+ scummvm -eadlib monkey2
+
+
+7.1) PĹehrĂĄvĂĄnĂ zvuku pomocĂ emulace AdLib:
+---- --------------------------------------
+StandardnÄ bude karta AdLib emulovĂĄna a ScummVM hudbu pĹehrĂĄvĂĄ jako vzorkovanĂŠ vlny. To je vĂ˝chozĂ reĹžim pro vÄtĹĄinu her a nabĂzĂ nejlepĹĄĂ kompatibilitu mezi stroji a hrami.
+
+
+7.2) PĹehrĂĄvĂĄnĂ zvuku pomocĂ emulace FluidSynth MIDI:
+---- ------------------------------------------------
+Pokud byl ScummVM sestaven s podporou libfluidsynth bude schopen pĹehrĂĄvat hudbu MIDI pomocĂ ovladaÄe FluidSynth. Budete muset ale urÄit, kterĂ˝ SoundFont pouĹžĂt.
+
+ProtoĹže vĂ˝chozĂ hlasitost vĂ˝stupu od FluidSynth mĹŻĹže bĂ˝t velmi nĂzkĂĄ,
+ScummVM standardnÄ nastavĂ zvýťenĂ, aby dostal silnÄjĹĄĂ signĂĄl. To mĹŻĹže bĂ˝t dĂĄle upaveno pouĹžitĂm moĹžnosti pĹĂkazovĂŠho ĹĂĄdku --midi-gain, nebo nastavenĂm "midi_gain" v konfiguraÄnĂm souboru.
+
+NastavenĂ mĹŻĹže nabĂ˝vat hodnoty od 0 po 1000 a vĂ˝chozĂ je 100. (Toto odpovĂdĂĄ nastavenĂ zvýťenĂ FluidSynth's 0.0 aĹž 10.0, coĹž je pravdÄpodobnÄ mÄĹeno v decibelech.)
+
+POZNĂMKA: PoĹžadavky na procesor pro FluidSynth mĹŻĹžou bĂ˝t v nÄkterĂ˝ch pĹĂpadech dosti vysokĂŠ. Je doporuÄeno mĂt rychlĂŠ CPU.
+
+
+7.3) PĹehrĂĄvĂĄnĂ zvuku pomocĂ emulace MT-32:
+---- --------------------------------------
+NÄkterĂŠ hry, kterĂŠ obsahujĂ hudebnĂ data MIDI, takĂŠ majĂ vylepĹĄenĂŠ stopuy urÄenĂŠ pro zvukovĂ˝ modul MT-32. ScummVM mĹŻĹže toto zaĹĂzenĂ nynĂ emulovat, nicmĂŠnÄ aby toto zaĹĂzenĂ fungovalo, musĂte mĂt pĹŻvodnĂ ROMy MT-32:
+
+MT32_PCM.ROM - IC21 (512KB)
+MT32_CONTROL.ROM - IC26 (32KB) a IC27 (32KB), proklĂĄdanĂŠ podle bajtu
+
+Tyto ROMy umĂstÄte do hernĂho adresĂĄĹe, ve VaĹĄĂ dodateÄnĂŠ cestÄ, nebo v adresĂĄĹi, kde je umĂstÄn spouĹĄtÄÄ ScummVM.
+
+SÂ tĂmto ovladaÄem nemusĂte zadĂĄvat --native-mt32, protoĹže je automaticky zapnut.
+
+POZNĂMKA: PoĹžadavky na procesor pro emulĂĄtor jsou velmi vysokĂŠ; rychlĂŠ
+CPU je velmi doporuÄeno.
+
+
+7.4) PĹehrĂĄvĂĄnĂ zvuku pomocĂ emulace MIDI:
+---- -------------------------------------
+NÄkterĂŠ hry (jako Sam & Max) obsahujĂ pouze hudebnĂ data MIDI. Toto brĂĄnilo, aby hudba v tÄchto hrĂĄch fungovala na platformĂĄch, kterĂŠ MIDI nepodporujĂ, nebo na zvukovĂ˝ch kartĂĄch, kterĂŠ neposkytujĂ ovladaÄe MIDI (napĹ. mnoho zvukovĂ˝ch karet nebude v Linuxu MIDI pĹehrĂĄvat). ScummVM nynĂ mĹŻĹže MIDI emulovat pomocĂ vzorkovanĂ˝ch vln a AdLib, emulaci MIDI FluidSynth nebo emulace MT-32 pomocĂ moĹžnostĂ -eadlib, -efluidsynth nebo -emt32 v tomto poĹadĂ. NicmĂŠnÄ pokud mĂĄte moĹžnost pouĹžĂt pĹirozenĂŠ MIDI, doporuÄujeme pouĹžĂt jeden z reĹžimĹŻ MIDI nĂĹže pro nejlepĹĄĂ zvuk.
+
+
+7.5) PĹehrĂĄvĂĄnĂ zvuku pomocĂ emulace PĹirozenĂŠho MIDI:
+---- -------------------------------------------------
+PouĹžijte vhodnou moĹžnosti pĹĂkazovĂŠho ĹĂĄdku -e<reĹžim> ze seznamu výťe pro vybrĂĄnĂ VaĹĄeho upĹednostĹovanĂŠho zaĹĂzenĂ MIDI. NapĹĂklad pokud chcete pouĹžĂt ovladaÄ Windows MIDI, pouĹžijte moĹžnost -ewindows.
+
+
+7.5.1) PouĹžitĂ moĹžnostĂ MIDI k pĹizpĹŻsobenĂ vĂ˝stupu pĹirozenĂŠ MIDI:
+------ ------------------------------------------------------------
+ScummVM podporuje rĹŻznĂŠ reĹžimy MIDI v zĂĄvislosti na schopnostech VaĹĄeho zaĹĂzenĂ MIDI.
+
+Pokud je zadĂĄno --native-mt32, ScummVM se k VaĹĄemu zaĹĂzenĂ bude chovat jako ke skuteÄnĂŠ MT-32. ProtoĹže mapovĂĄnĂ instrumentĹŻ a vĂ˝hradnĂ systĂŠmovĂŠ pĹĂkazy MT-32 se liĹĄĂ od zaĹĂzenĂ General MIDI, tuto moĹžnost byste mÄli povolit, pouze kdyĹž pouĹžĂvĂĄte skuteÄnĂŠ Roland MT-32, LAPC-I,CM-64, CM-32L, CM-500, nebo zaĹĂzenĂ GS s mapou MT-32.
+
+Pokud je zadĂĄno --enable-gs, ScummVM zavede VaĹĄe zaĹĂzenĂ kompatibilnĂ s GS pomocĂ nastavenĂ, kterĂĄ napodobujĂ nastavenĂ dozvuku MT-32, (nedostatek) chĂłru, citlivost ohĂ˝banĂ tĂłnu, atd. Pokud je toto spoleÄnÄ pouĹžito s --native-mt32, ScummVM vybere mapu kompatibilnĂ s MT-32 a bicĂ soupravu na VaĹĄem zaĹĂzenĂ GS. Toto nastavenĂ funguje lĂŠpe neĹž standardnĂ emulace GM nebo GS ve hrĂĄch, kterĂŠ nemajĂ vlastnĂ mapovĂĄnĂ instrumentĹŻ (Loom a Monkey1). ObÄ nastavenĂ byste mÄli pouĹžĂt pouze tehdy, pokud mĂĄte zaĹĂzenĂ GS, kterĂŠ mĂĄ mapu MT-32, jako SC-55, SC-88, SC-88 Pro, SC-8820, SC-8850, atd. NezapomeĹte, Ĺže --enable-gs je automaticky zakĂĄzĂĄno v DOTT a Samnmax, protoĹže samostatnÄ pouĹžĂvajĂ General MIDI.
+
+Pokud nenĂ ani jedna z moĹžnostĂ výťe povolena, ScummVM VaĹĄe zaĹĂzenĂ zavede v reĹžimu General MIDI a pouĹžije emulaci GM v hrĂĄch se zvukovĂ˝m doprovodem MT-32.
+
+NÄkterĂŠ hry obsahujĂ zvukovĂŠ efekty pouze v AdLib. Pro tyto hry, byste mÄli zadat --multi-midi, abyste zkombinovali hudbu MIDI se zvukovĂ˝mi efekty AdLib.
+
+
+7.6) PĹehrĂĄvĂĄnĂ zvuku pomocĂ SekvencĂŠru MIDI: [POUZE UNIX]
+---- ----------------------------------------
+Pokud VĂĄĹĄ ovladaÄ podporuje sekvencĂŠr, mĹŻĹžete nastavit promÄnnou prostĹedĂ "SCUMMVM_MIDI" na VaĹĄem zaĹĂzenĂ sekvencĂŠru â napĹĂklad na /dev/sequencer
+
+Pokud mĂĄte problĂŠm se zvukem v tomto nastavenĂ, moĹžnĂĄ budete muset nastavit promÄnnou prostĹedĂ "SCUMMVM_MIDIPORT" na 1 nebo 2. Toto vybere port, kterĂ˝ bude pouĹžit ve zvolenĂŠm sekvencĂŠru. Pak spusĹĽte scummvm s parametrem -eseq. To by mÄlo fungovat pro nÄkolik karet a mĹŻĹže nabĂzet lepĹĄĂ vĂ˝kon a kvalitu, neĹž emulace AdLib. NicmĂŠnÄ pro systĂŠmy, kde podpora sekvencĂŠru nefunguje, mĹŻĹžete vĹždycky pĹejĂt na emulaci AdLib.
+
+
+7.6.1) PĹehrĂĄvĂĄnĂ zvuku pomocĂ SekvencĂŠru ALSA: [POUZE UNIX]
+------ ----------------------------------------
+Pokud MĂĄte nainstalovĂĄn ovladaÄ ALSA s podporou sekvencĂŠru, pak mĹŻĹžete nastavit promÄnnou prostĹedĂ "SCUMMVM_PORT" nebo promÄnnou souboru s nastavenĂm "alsa_port" pro urÄenĂ portu VaĹĄeho sekvencĂŠru. Pokud ani jedno nenĂ nastaveno, jsou standardnÄ vyzkouĹĄeny oba porty "65:0" a "17:0".
+
+Zde je krĂĄtkĂ˝ nĂĄvod, jak sekvencĂŠr pouĹžĂt s VaĹĄĂ zvukovou kartou. Ve vĹĄech pĹĂpadech, pro zĂskĂĄnĂ seznamu vĹĄech portĹŻ sekvencĂŠru, zkuste pĹĂkaz "aconnect -o -l". To by mÄlo mĂt vĂ˝stup podobnĂ˝ tomuto:
+
+client 14: 'Midi Through' [type=kernel]
+ 0 'Midi Through Port-0'
+client 16: 'SBLive! Value [CT4832]' [type=kernel]
+ 0 'EMU10K1 MPU-401 (UART)'
+client 17: 'Emu10k1 WaveTable' [type=kernel]
+ 0 'Emu10k1 Port 0 '
+ 1 'Emu10k1 Port 1 '
+ 2 'Emu10k1 Port 2 '
+ 3 'Emu10k1 Port 3 '
+client 128: 'TiMidity' [type=user]
+ 0 'TiMidity port 0 '
+ 1 'TiMidity port 1 '
+ 2 'TiMidity port 2 '
+ 3 'TiMidity port 3 '
+
+NejdĹŻleĹžitÄjĹĄĂ ÄĂĄst zde je, Ĺže existujĂ ÄtyĹi vĂ˝stupy WaveTable MIDI umĂstÄnĂŠ na 17:0, 17:1, 17:2 a 17:3, a ÄtyĹi porty TiMidity umĂstÄnĂŠ na 128:0, 128:1, 128:2 a 128:3.
+
+Pokud na VaĹĄĂ kartÄ mĂĄte Äip FM FM, jako tĹeba SB16, pak musĂte naÄĂst SoundFonts pomocĂ softwaru sbiload. NapĹĂklad:
+
+ sbiload -p 17:0 /etc/std.o3 /etc/drums.o3
+
+Pokud je VaĹĄe karta schopnĂĄ pouĹžĂvat WaveTable, musĂte naÄĂst SoundFont sbk nebo sf2 pomocĂ softwaru sfxload nebo asfxload. NapĹĂklad:
+
+ sfxload /cesta/k/8mbgmsfx.sf2
+
+Pokud VaĹĄe karta neumĂ s MIDI pracovat, existujĂ dvÄ moĹžnosti: FluidSynth a TiMidity. DoporuÄujeme FluidSynth, protoĹže v mnoha systĂŠmech bude TiMidity 'zaostĂĄvat' za hudbou. To je velmi znatelnĂŠ v hrĂĄch pouĹžĂvajĂcĂ
+iMUSE, kterĂ˝ pouĹžĂvĂĄ rychlĂŠ a dynamickĂŠ pĹechody hudby.
+SpuĹĄtÄnĂm TiMidity jako root mu umoĹžnĂ nastavit prioritu v reĂĄlnĂŠm Äase, coĹž mĹŻĹže zaostĂĄvĂĄnĂ snĂĹžit.
+
+PĹĂkaz pro TiMidity, aby se stal sekvencĂŠrem ALSA:
+
+ timidity -iAqqq -B2,8 -Os1S -s 44100 &
+
+(Pokud s tĂmto nastavenĂm dostĂĄvĂĄte zkreslenĂ˝ vĂ˝stup, mĹŻĹžete zkusit vynechat -B2,8 nebo zmÄnit hodnotu.)
+
+PĹĂkaz pro TiMidity, aby se stal sekvencĂŠrem ALSA (pouĹžitĂm SoundFonts):
+
+ fluidsynth -m alsa_seq /cesta/k/8mbgmsfx.sf2
+
+Jakmile je TiMidity nebo FluidSynth spuĹĄtÄn, pouĹžijte pĹĂkaz 'aconnect -o -l' jak je pospĂĄno výťe v tĂŠto ÄĂĄsti.
+
+
+7.6.2) PĹehrĂĄvĂĄnĂ zvuku pomocĂ SekvencĂŠru IRIX dmedia: [POUZE UNIX]
+------ -----------------------------------------------
+Pokud pouĹžĂvĂĄte IRIX a ovladaÄ dmedia s podporou sekvencĂŠru, mĹŻĹžete nastavit promÄnnou prostĹedĂ "SCUMMVM_MIDIPORT" nebo promÄnnou souboru s nastavenĂm "dmedia_port" pro urÄenĂ portu VaĹĄeho sekvencĂŠru. StandardnÄ je pouĹžit prvnĂ port.
+
+Abyste zĂskali seznam nastavenĂ˝ch rozhranĂ midi ve VaĹĄem systĂŠmu, spusĹĽte pĹĂkaz "startmidi" bez parametrĹŻ. VzorovĂ˝ vĂ˝stup:
+
+ 2 MIDI interfaces configured:
+ Serial Port 2
+ Software Synth
+
+VÂ tomto pĹĂpadÄ mĹŻĹžete ScummVM nastavit, aby pouĹžil "Software Synth" mĂsto standardnĂho "Serial Port 2" pĹidĂĄnĂm ĹĂĄdku
+
+ dmedia_port=Software Synth
+
+do VaĹĄeho souboru s nastavenĂm v ÄĂĄsti [scummvm], nebo nastavenĂm SCUMMVM_PORT=Software Synth ve VaĹĄem prostĹedĂ.
+
+
+7.7) PouĹžitĂ MIDI serveru TiMidity++:
+---- --------------------------------
+Pokud na VaĹĄem systĂŠmu chybĂ jakĂ˝koliv sekvencĂŠr MIDI, ale pĹesto chcete lepĹĄĂ kvalitu MIDI, neĹž kterou mĹŻĹže nabĂdnout standardnĂ emulace AdLib, mĹŻĹžete zkusit MIDI server TiMidity++. ProhlĂŠdnÄte si http://timidity.sourceforge.net/ pro staĹženĂ a pokyny k instalaci.
+
+NejdĹĂve musĂte spustit daemona:
+
+ timidity -ir 7777
+
+NynĂ mĹŻĹžete spustit ScummVM a zkusit vybrat TiMidity jako vĂ˝stup pro hudbu. StandardnÄ se pĹipojĂ k localhost:7777, ale hostitele/port mĹŻĹžete zmÄnit pomocĂ promÄnnĂŠ prostĹedĂ "TIMIDITY_HOST". MĹŻĹžete takĂŠ urÄit
+"ÄĂslo zaĹĂzenĂ" pouĹžitĂm promÄnnĂŠ "SCUMMVM_MIDIPORT".
+
+
+7.8) PouŞità komprimovaných zvukových souborů
+---- ----------------------------------------
+
+7.8.0) PouĹžitĂ souborĹŻ MP3 pro CD audio:
+------ ---------------------------------
+PouĹžijte LAME nebo jinĂ˝ kodĂŠr MP3 pro vyjmutĂ stop cd audio do souborĹŻ.
+Soubory pojmenujte track1.mp3 track2.mp3 atd. ScummVM musĂ bĂ˝t sestaven s podporou MAD pro pouĹžitĂ tĂŠto moĹžnosti. Soubory budete muset z CD vyjmout ve formĂĄtu WAV, pak je pĹevĂŠst do formĂĄtu MP3 v konstantnĂ pĹenosovĂŠ rychlosti. To mĹŻĹže bĂ˝t provedeno pomocĂ nĂĄsledujĂcĂho pĹĂkazovĂŠho ĹĂĄdku:
+
+ lame -t -q 0 -b 96 track1.wav track1.mp3
+
+
+7.8.1) PouĹžitĂ souborĹŻ Ogg Vorbis pro CD audio:
+------ ----------------------------------------
+PouĹžijte oggenc nebo jinĂ˝ kodĂŠr vorbis k pĹevedenĂ zvukovĂ˝ch stop do souborĹŻ. Pojmenujte je track1.ogg track2.ogg atd. ScummVM musĂ bĂ˝t sestaven s podporou vorbis pro pouĹžitĂ tĂŠto moĹžnosti. Soubory budete muset z CD vyjmout ve formĂĄtu WAV, pak je pĹevĂŠst do formĂĄtu vorbis. To mĹŻĹže bĂ˝t provedeno pomocĂ nĂĄsledujĂcĂho pĹĂkazovĂŠho ĹĂĄdku pro oggenc, kde hodnota po q urÄuje poĹžadovanou kvalitu od 0 do 10:
+
+ oggenc -q 5 track1.wav
+
+
+7.8.2) PouĹžitĂ souborĹŻ Flac pro CD audio:
+------ ----------------------------------
+PouĹžijte flac nebo jinĂ˝ kodĂŠr flac k pĹevedenĂ zvukovĂ˝ch stop do souborĹŻ.
+Pojmenujte je track1.flac track2.flac atd. Pokud VĂĄĹĄ souborovĂ˝ systĂŠm podporuje pĹĂpony pouze se tĹemi pĂsmeny, pojmenujte je track1.fla track2.fla atd. ScummVM musĂ bĂ˝t sestaven s podporou flac pro pouĹžitĂ tĂŠto moĹžnosti. Soubory budete muset z CD vyjmout ve formĂĄtu WAV, pak je pĹevĂŠst do formĂĄtu flac. To mĹŻĹže bĂ˝t provedeno pomocĂ nĂĄsledujĂcĂho pĹĂkazovĂŠho ĹĂĄdku pro flac:
+
+ flac --best track1.wav
+
+NezapomeĹte, Ĺže kvalita bude vĹždy stejnĂĄ, rĹŻznĂŠ moĹžnosti kodĂŠru ovlivĹujĂ dobu kĂłdovĂĄnĂ a vĂ˝slednou velikost souboru.
+
+
+7.8.3) KomprimovĂĄnĂ MONSTER.SOU pomocĂ MP3:
+------ ------------------------------------
+PotĹebujete LAME a nĂĄĹĄ nĂĄstroj 'compress_scumm_sou' z balĂÄku
+scummvm-tools, abyste toto mohli provÊst a ScummVM musà být sestaven s podporou MAD.
+
+ compress_scumm_sou monster.sou
+
+Nakonec dostanete mnohem menĹĄĂ soubor monster.so3, tento soubor zkopĂrujte do VaĹĄĂ sloĹžky hry. Pak mĹŻĹžete soubor monster.sou odstranit.
+
+
+7.8.4) KomprimovĂĄnĂ MONSTER.SOU pomocĂ Ogg Vorbis:
+------ -------------------------------------------
+Tak jako výťe, ale ScummVM musà být sestaven s podporou OGG. Spusżte:
+
+ compress_scumm_sou --vorbis monster.sou
+
+To by mÄlo vytvoĹit menĹĄĂ soubor monster.sog file, kterĂ˝ byste mÄli zkopĂrovat do sloĹžky hry. KĂłdovĂĄnĂ Ogg mĹŻĹže trvat mnohem dĂŠle neĹž u MP3, takĹže mÄjte po ruce dobrou knĂĹžku.
+
+
+7.8.5) KomprimovĂĄnĂ MONSTER.SOU pomocĂ Flac:
+------ -------------------------------------
+Tak jako výťe, ale ScummVM musà být sestaven s podporou Flac. Spusżte:
+
+ compress_scumm_sou --flac monster.sou
+
+To by mÄlo vytvoĹit menĹĄĂ soubor monster.sof, kterĂ˝ byste mÄli zkopĂrovat do sloĹžky hry. NezapomeĹte, Ĺže kvalita bude vĹždy stejnĂĄ, rĹŻznĂŠ moĹžnosti kodĂŠru ovlivĹujĂ dobu kĂłdovĂĄnĂ a vĂ˝slednou velikost souboru. ZmÄna velikosti bloku (-b <hodnota>), mĂĄ nejvÄtĹĄĂ vliv na vĂ˝slednou velikost souboru -- 1152 se zdĂĄ bĂ˝t dobrĂĄ hodnota pro tento druh zvukovĂ˝ch souborĹŻ. PĹeÄtÄte si dokumentaci kodĂŠru pĹedtĂm, neĹž pouĹžijete dalĹĄĂ hodnoty.
+
+
+7.8.6) KomprimovĂĄnĂ hudby/zvuku/hlasu v hrĂĄch AGOS:
+------ --------------------------------------------
+Pro tento Ăşkol pouĹžijte nĂĄĹĄ nĂĄstroj 'compress_agos' z balĂÄku scummvm-tools. MĹŻĹžete volit mezi nÄkolika cĂlovĂ˝mi formĂĄty, ale nezapomeĹte, Ĺže je mĹŻĹžete pouĹžĂt pouze tehdy, kdyĹž ScummVM byl sestaven se zapnutou podporou konkrĂŠtnĂho dekodĂŠru.
+
+ compress_agos effects (Pro CD verzi Simon 1 od Acorn)
+ compress_agos simon (Pro CD verzi Simon 1 od Acorn)
+ compress_agos effects.voc (Pro DOS CD verzi Simon 1)
+ compress_agos simon.voc (Pro DOS CD verzi Simon 1)
+ compress_agos simon.wav (Pro Windows CD verzi Simon 1)
+ compress_agos simon2.voc (Pro DOS CD verzi Simon 2)
+ compress_agos simon2.wav (Pro Windows CD verzi Simon 2)
+ compress_agos mac (Pro Macintosh verzi Simon 2)
+
+ compress_agos voices1.wav (Pro Windows verzi Feeble na 2CD/4CD)
+ compress_agos voices2.wav (Pro Windows verzi Feeble na 2CD/4CD)
+ compress_agos voices3.wav (Pro Windows verzi Feeble na 4CD)
+ compress_agos voices4.wav (Pro Windows verzi Feeble na 4CD)
+
+ compress_agos Music (Pro Windows verzi Puzzle Pack)
+
+Pro Ogg Vorbis pĹidejte k volbĂĄm --vorbis, tj.
+
+ compress_agos --vorbis
+
+Pro Flac pĹidejte k volbĂĄm --flac a dodateÄnĂŠ parametry, tj.
+
+ compress_agos --flac
+
+Nakonec dostanete mnohem menĹĄĂ soubor *.mp3, *.ogg nebo *.fla, zkopĂrujte ho do VaĹĄĂ sloĹžky hry. StarĂ˝ soubor mĹŻĹžete bezpeÄnĂŠ odebrat.
+
+
+7.8.7) KomprimovĂĄnĂ ĹeÄi/hudby v Broken Sword:
+------ ---------------------------------------
+NĂĄstroj 'compress_sword1' z balĂÄku scummvm-tools mĹŻĹže pĹevĂŠst hudbu a ĹeÄ do MP3, Ogg Vorbis a takĂŠ Flac. NejsnadnÄjĹĄĂm zpĹŻsobem, jak soubory pĹevĂŠst, je prostĂŠ zkopĂrovĂĄnĂ spouĹĄtÄÄe do VaĹĄĂ sloĹžky BS1 (spolu s kodĂŠrem lame) a pak ho odsud spustit. Tak bude vĹĄechno automaticky pĹevedeno na MP3. PotĂŠ, mĹŻĹžete ruÄnÄ odstranit soubory SPEECH?.CLU a hudebnĂ soubory wave.
+
+SpuĹĄtÄnĂm "compress_sword1 --vorbis" soubory zkomprimuje pomocĂ Ogg Vorbis mĂsto MP3.
+
+SpuĹĄtÄnĂm "compress_sword1 --flac" soubory zkomprimuje pomocĂ Flac
+mĂsto MP3.
+
+PouĹžijte "compress_sword1 --help", abyste dostali ĂşplnĂ˝ seznam moĹžnostĂ.
+
+
+7.8.8) KomprimovĂĄnĂ ĹeÄi/hudby v Broken Sword II:
+------ ------------------------------------------
+Pro tento Ăşkol pouĹžijte nĂĄĹĄ nĂĄstroj 'compress_sword2'. MĹŻĹžete volit mezi nÄkolika cĂlovĂ˝mi formĂĄty, ale nezapomeĹte, Ĺže je mĹŻĹžete pouĹžĂt pouze tehdy, kdyĹž ScummVM byl sestaven se zapnutou podporou konkrĂŠtnĂho dekodĂŠru.
+
+ compress_sword2 speech1.clu
+ compress_sword2 music1.clu
+
+Pro Ogg Vorbis pĹidejte --vorbis k moĹžnostem, tj.
+
+ compress_sword2 --vorbis
+
+Nakonec budete mĂt mnohem menĹĄĂ soubor *.cl3 nebo *.clg, tento soubor zkopĂrujte do sloĹžky hry. StarĂ˝ soubor mĹŻĹžete bezpeÄnĂŠ odstranit.
+
+Je moĹžnĂŠ pouĹžĂt Flac pro komprimaci pĹidĂĄnĂm moĹžnosti by --flac. NicmĂŠnÄ vĂ˝slednĂ˝ soubor *.clf je ve skuteÄnosti vÄtĹĄĂ neĹž pĹŻvodnĂ.
+
+NezapomeĹte, prosĂm, Ĺže compress_sword2 bude fungovat pouze se ÄtyĹmi soubory ĹeÄi/hudby v Broken Sword II. Nebude fungovat s dalĹĄĂmi soubory *.clu, ani nebude fungovat se soubory ĹeÄi z Broken Sword.
+
+
+7.9) VĂ˝stupnĂ vzorkovacĂ kmitoÄet:
+---- -----------------------------
+VĂ˝stupnĂ vzorkovacĂ kmitoÄet ĹĂkĂĄ ScummVM, kolik vzorkĹŻ zvuku mĂĄ hrĂĄt v kanĂĄlu za sekundu. Je toho hodnÄ, co by se dalo ĹĂct o tomto tĂŠmatu, ale vÄtĹĄina toho je zde nepodstatnĂŠ. KrĂĄtkĂĄ verze je, Ĺže vÄtĹĄinÄ her staÄĂ 22050 Hz, ale v nÄkterĂ˝ch pĹĂpadech je lepĹĄĂ 44100 Hz. Na extrĂŠmnÄ pomalĂ˝ch systĂŠmech byste radÄji mÄli pouĹžĂt 11025 Hz, ale je nepravdÄpodobnÄ, Ĺže byste se s tĂmto museli zabĂ˝vat.
+
+Abychom to rozvedli, vÄtĹĄina zvukĹŻ, kterĂŠ ScummVM musĂ pĹehrĂĄt, byla vzorkovĂĄna buÄ na 22050 Hz, nebo 11025 Hz. PouĹžitĂm vyĹĄĹĄĂho kmitoÄtu jako kouzlem nezvýťà kvalitu tÄchto zvukĹŻ. Proto je 22050 Hz v poĹĂĄdku.
+
+NÄkterĂŠ hry pouĹžĂvajĂ CD audio. Pokud pro toto pouĹžĂvĂĄte komprimovanĂŠ soubory, jsou pravdÄpodobnÄ vzorkovanĂ˝ na kmitoÄtu 44100 Hz, takĹže pro tyto hry je toto pravdÄpodobnÄ lepĹĄĂ volba kmitoÄtu.
+
+PĹi pouĹžitĂ ovladaÄĹŻ hudby AdLib, FM Towns, PC Speaker nebo IBM PCjr je
+ScummVM zodpovÄdnĂ˝ za vytvĂĄĹenĂ vzorkĹŻ. VÄtĹĄinou bude 22050 Hz staÄit, ale existuje alespoĹ jedna stopa hudby AdLib Beneath a Steel Sky, kterĂĄ znĂ lĂŠpe pĹi 44100 Hz.
+
+PouĹžitĂ kmitoÄtĹŻ mezi nenĂ doporuÄeno. Za prvĂŠ VaĹĄe zvukovĂĄ karta ho nemusĂ podporovat. Teoreticky by se ScummVM mÄl vrĂĄtit k rozumnĂŠmu kmitoÄtu, ale nespolĂŠhejte na to. DĹŻleĹžitÄjĹĄĂ je ale to, Ĺže ScummVM musĂ pĹevzorkovat vĹĄechny zvuky na jejich vĂ˝stupnĂ kmitoÄet. To je mnohem snadnÄjĹĄĂ k provedenĂ, kdyĹž vĂ˝stupnĂ kmitoÄet je nĂĄsobkem pĹŻvodnĂho.
+
+
+8.0) Soubor s nastavenĂm:
+---- --------------------
+StandardnÄ je soubor s nastavenĂm uloĹžen a naÄĂtĂĄn:
+
+ Windows Vista/7:
+ \Users\jmĂŠno uĹživatele\AppData\Roaming\ScummVM\scummvm.ini,
+
+ Windows 2000/XP:
+ \Documents and Settings\jmĂŠno uĹž\Application Data\ScummVM\scummvm.ini
+
+ Windows NT4:
+ <sloĹžkawin>\Profiles\jmĂŠno uĹž\Application Data\ScummVM\scummvm.ini,
+
+ Windows 95/98/ME:
+ <sloĹžkawin>\scummvm.ini,
+
+ Pokud ve Windows nainstalovĂĄna dĹĂvÄjĹĄĂ verze ScummVM bude ponechĂĄno dĹĂvÄjĹĄĂ umĂstÄnĂ '<sloĹžkawin>\scummvm.ini'.
+
+ Unix:
+ ~/.scummvmrc
+
+ Mac OS X:
+ ~/Library/Preferences/ScummVM Preferences
+ (zde ~ oznaÄuje VaĹĄi domovskou sloĹžku)
+
+ DalĹĄĂ:
+ scummvm.ini v souÄasnĂŠ sloĹžce
+
+VzorovĂ˝ soubor s nastavenĂm vypadĂĄ takto:
+
+ [scummvm]
+ gfx_mode=supereagle
+ fullscreen=true
+ savepath=C:\saves\
+
+ [sky]
+ path=C:\games\SteelSky\
+
+ [germansky]
+ gameid=sky
+ language=de
+ path=C:\games\SteelSky\
+ description=Beneath a Steel Sky w/ German subtitles
+
+ [germandott]
+ gameid=tentacle
+ path=C:\german\tentacle\
+ description=German version of DOTT
+
+ [tentacle]
+ path=C:\tentacle\
+ subtitles=true
+ music_volume=40
+ sfx_volume=255
+
+ [loomcd]
+ cdrom=1
+ path=C:\loom\
+ talkspeed=5
+ savepath=C:\loom\saves\
+
+ [monkey2]
+ path=C:\amiga_mi2\
+ music_driver=windows
+
+8.1) RozpoznĂĄvanĂĄ klĂÄovĂĄ slova nastavenĂ
+---- ------------------------------------
+Jsou rozpoznĂĄvĂĄna nĂĄsledujĂcĂ klĂÄovĂĄ slova:
+
+ path ĹetÄzec Cesta, kde jsou umĂstÄny datovĂŠ soubory hry
+ autosave_period ÄĂslo VteĹiny mezi autouklĂĄdĂĄnĂm (vĂ˝chozĂ: 300)
+ save_slot ÄĂslo ÄĂslo uloĹženĂŠ, kterĂŠ pĹi spuĹĄtÄnĂ naÄĂst.
+ savepath ĹetÄzec Cesta, kde hra bude uklĂĄdat uloĹženĂŠ hry.
+ versioninfo ĹetÄzec Verze ScummVM, kterĂĄ vytvoĹila soubor.
+ gameid ĹetÄzec SkuteÄnĂŠ id hry. UĹžiteÄnĂŠ, pokud mĂĄte nÄkolik verzĂ stejnĂŠ hry a chcete pro nÄ rĹŻznĂŠ pĹezdĂvky. Viz pĹĂklad.
+ description ĹetÄzec Popis hry jak se zobrazĂ ve spouĹĄtÄÄi.
+ language ĹetÄzec UrÄĂ jazyk (en, us, de, fr, it, pt, es,
+ jp, zh, kr, se, gb, hb, cz, ru)
+ speech_mute boolean Pokud true, ĹeÄ je ztlumena
+ subtitles boolean Pokud true jsou titulky zapnuty.
+ talkspeed ÄĂslo ZpoĹždÄnĂ textu v hrĂĄch SCUMM, nebo rychlost textu v jinĂ˝ch hrĂĄch.
+ fullscreen boolean ReĹžim celĂŠ obrazovky
+ aspect_ratio boolean Povolit korekci pomÄru stran
+ gfx_mode ĹetÄzec GrafickĂ˝ reĹžim (normĂĄlnĂ, 2x, 3x, 2xsai, super2xsai, supereagle, advmame2x, advmame3x,hq2x, hq3x, tv2x, dotmatrix)
+ confirm_exit boolean Zeptat se uĹživatele na potvrzenĂ pĹed ukonÄenĂm (pouze jĂĄdro SDL).
+ console boolean Povolit okno konzole (vĂ˝chozĂ: zapnuto) (pouze Windows).
+ cdrom ÄĂslo ÄĂslo jednotky CD-ROM, kterou pouĹžĂt pro zvuk. Pokud je zĂĄpornĂŠ, k pokusu o pĹĂstup k CD-ROM nedojde.
+ joystick_num ÄĂslo ÄĂslo zaĹĂzenĂ joysticku, kterĂŠ pouĹžĂt pro vstup
+ music_driver ĹetÄzec KterĂŠ hudebnĂ jĂĄdro pouĹžĂt.
+ opl_driver ĹetÄzec KterĂ˝ emulĂĄtor AdLib (OPL) pouĹžĂt.
+ output_rate ÄĂslo KterĂ˝ vĂ˝stupnĂ vzorkovacĂ kmitoÄet pouĹžĂt v Hz. RozumnĂŠ hodnoty jsou 11025, 22050 a 44100.
+ alsa_port ĹetÄzec KterĂ˝ port pouĹžĂt pro vĂ˝stup pĹi pouĹžitĂ hudebnĂho ovladaÄe ALSA.
+ music_volume ÄĂslo NastavenĂ hlasitosti hudby (0-255)
+ multi_midi boolean Pokud true, jsou povoleny smĂĹĄenĂ˝ AdLib a pĹŻvodnĂ MIDI.
+ soundfont ĹetÄzec KterĂ˝ SoundFont pouĹžĂt pro pĹehrĂĄvĂĄnĂ MIDI. (PodporovĂĄno pouze nÄkterĂ˝mi ovladaÄi MIDI.)
+ native_mt32 boolean Pokud true, zakĂĄĹže emulaci GM a pĹedpoklĂĄdĂĄ, Ĺže je dostupnĂ˝ pravĂ˝ Roland MT-32.
+ enable_gs boolean Pokud true, povolĂ funkce urÄenĂŠ pro Roland GS ke zlepĹĄenĂ emulace GM. Pokud je native_mt32 takĂŠ nastaven na true, zaĹĂzenĂ GS zvolĂ mapu MT-32 pro pĹehrĂĄvĂĄnĂ sprĂĄvnĂ˝ch instrumentĹŻ.
+ sfx_volume ÄĂslo NastavenĂ hlasitosti zvuku (0-255)
+ tempo ÄĂslo Rychlost hudby (50-200) (vĂ˝chozĂ: 100)
+ speech_volume ÄĂslo NastavenĂ hlasitosti ĹeÄi (0-255)
+ midi_gain ÄĂslo ZvýťenĂ MIDI (0-1000) (vĂ˝chozĂ: 100) (PodporovĂĄno pouze nÄkterĂ˝mi ovladaÄi MIDI.)
+ copy_protection boolean PovolĂ ochranu proti kopĂrovĂĄnĂ v urÄitĂ˝ch hrĂĄch, kde by ji ScummVM standardnÄ zakĂĄzal.
+ demo_mode boolean Spustit demoverzi v Maniac Mansion
+ alt_intro boolean PouĹžĂt alternativnĂ Ăşvod pro CD verze Beneath a Steel Sky a Flight of the Amazon Queen
+ boot_param ÄĂslo PĹedĂĄ toto ÄĂslo zavĂĄdÄcĂmu skriptu
+
+Hry Sierra pouĹžĂvajĂcĂ jĂĄdro AGI pĹidĂĄvajĂ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo:
+
+originalsaveload boolean Pokud true, jsou pouĹžity pĹŻvodnĂ obrazovky nahrĂĄvĂĄnĂ/uloĹženĂ mĂsto vylepĹĄenĂ˝ch ze ScummVM
+
+Hry Sierra pouĹžĂvajĂcĂ jĂĄdro SCI pĹidĂĄvajĂ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova:
+
+ disable_dithering boolean Odstranit artefakty chvÄnĂ v nÄkterĂ˝ch hrĂĄch EGA
+ prefer_digitalsfx boolean Pokud true, jsou upĹednostĹovĂĄny digitĂĄlnĂ zvukovĂŠ efekty pĹed syntetizovanĂ˝mi
+ originalsaveload boolean Pokud true, jsou pouĹžity pĹŻvodnĂ obrazovky nahrĂĄvĂĄnĂ/uloĹženĂ mĂsto vylepĹĄenĂ˝ch ze ScummVM
+ native_fb01 bool Pokud true, je ovladaÄ hudby pro kartu IBM Music Feature nebo modul syntetizĂĄtoru Yahama FB-01 FM pouĹžit jako vĂ˝stup MIDI
+Broken Sword II pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova:
+
+ gfx_details ÄĂslo NastavenĂ grafickĂ˝ch detailĹŻ (0-3)
+ music_mute boolean Pokud true, hudba je ztlumena
+ object_labels boolean Pokud true, popisky objektĹŻ jsou povoleny
+ reverse_stereo boolean Pokud true, kanĂĄly stereo jsou obrĂĄceny
+ sfx_mute boolean Pokud true, zvukovĂŠ efekty jsou ztlumeny
+
+Flight of the Amazon Queen pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova:
+
+ music_mute boolean Pokud true, hudba je ztlumena
+ sfx_mute boolean Pokud true, zvukovĂŠ efekty jsou ztlumeny
+
+Hopkins FBI pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo:
+ enable_gore boolean Pokud true, povolĂ nÄkterĂŠ nepivnnĂŠ krvavĂŠ scĂŠny ve hĹe
+
+Jones in the Fast Lane pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo:
+
+ music_mute boolean Pokud true, je pouĹžito CD audio mĂsto zvukĹŻ ve hĹe
+
+King's Quest VI Windows pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo:
+
+ windows_cursors boolean Pokud true, jsou pouĹžity pĹŻvodnĂ ÄernobĂlĂŠ kurzory mĂsto kurzorĹŻ z DOS. Pokud false, jsou ve verzi Windows pouĹžity kurzory DOS, zvÄtĹĄenĂŠ, aby se shodovaly se zbytkem zvÄtĹĄenĂŠ grafiky
+
+Lands of Lore: The Throne of Chaos pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova:
+
+ smooth_scrolling boolean Pokud true, je posunovĂĄnĂ pĹi zmÄnÄ z jednĂŠ obrazovky na druhou plynulejĹĄĂ
+ floating_cursors boolean Pokud true, je kurzor zmÄnÄn na smÄrovou ĹĄipku pĹi najetĂ na okraj obrazovky. HrĂĄÄ pak mĹŻĹže kliknout pro pohyb v tomto smÄru.
+
+Space Quest IV CD pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo:
+
+ silver_cursors boolean Pokud true, je mĂsto pĹŻvodnĂch zlatĂ˝ch kurzorĹŻ pouĹžita alternativnĂ sada stĹĂbrnĂ˝ch
+
+Simon the Sorcerer 1 a 2 pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova:
+
+ music_mute boolean Pokud true, hudba je ztlumena
+ sfx_mute boolean Pokud true, zvukovĂŠ efekty jsou ztlumeny
+
+Soltys pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo:
+ enable_color_blind bool Pokud true, jsou pĹŻvodnĂ barvy nahrazeny odstĂny ĹĄedi
+
+The Legend of Kyrandia pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo:
+
+ walkspeed celĂŠ ÄĂslo Rychlost chĹŻze (0-4)
+
+The Legend of Kyrandia: The Hand of Fate pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo:
+
+ walkspeed ÄĂslo Rychlost chĹŻze (3 nebo 5, coĹž znamenĂĄ
+ rychle nebo pomalu)
+
+The Legend of Kyrandia: Malcolm's Revenge pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova:
+
+ walkspeed ÄĂslo Rychlost chĹŻze (3 nebo 5, coĹž znamenĂĄ
+ rychle nebo pomalu)
+ studio_audience boolean Pokud true, je slyĹĄet potlesk a smĂch kdykoliv Malcolm provede nÄco vtipnĂŠho
+ skip_support boolean Pokud true, hrĂĄÄ mĹŻĹže pĹeskakovat text a scĂŠny hry
+ helium_mode boolean Pokud true, lidĂŠ znÄjĂ tak, jakoby se nadĂ˝chali hĂŠlia
+
+The Neverhood pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂĄ slova:
+
+ originalsaveload boolean Pokud true, jsou pouĹžity pĹŻvodnĂ obrazovky pro
+ naÄĂtĂĄnĂ/uklĂĄdĂĄnĂ mĂsto obrazovek ScummVM
+ skiphallofrecordsscenes boolean
+ Pokud true, umoĹžnĂ hrĂĄÄi pĹeskoÄit
+ obrazovky v SĂni zĂĄznamĹŻ
+ scalemakingofvideos boolean Pokud true, je zmÄnÄno rozliĹĄenĂ dokumentu o
+ vytvĂĄĹenĂ hry tak, aby zaplnilo celou obrazovku
+
+The 7th Guest pĹidĂĄvĂĄ nĂĄsledujĂcĂ nestandardnĂ klĂÄovĂŠ slovo:
+
+ fast_movie_speed boolean Pokud true, jsou videa pĹehrĂĄvĂĄna pĹi zvýťenĂŠ
+ rychlosti, stejnĂŠ jako ve verzi pro iOS.
+ Videa bez zvuku jsou stĂĄle pĹehrĂĄvĂĄna pĹi
+ normĂĄlnĂ rychlosti, aby nedoĹĄlo k desynchronizaci
+ hudby
+
+8.2) VlastnĂ hernĂ volby, kterĂŠ mohou bĂ˝t pĹepĂnĂĄny pomoci grafickĂŠho
+---- ----------------------------------------------------------------
+rozhranĂ
+--------
+Mnoho vlastnĂch hernĂch voleb v pĹedchozĂ ÄĂĄsti mĹŻĹže bĂ˝t pĹepnuto pĹes grafickĂŠ rozhranĂ. Pokud je takovĂĄto volba pro urÄitou hru dostupnĂĄ, objevĂ se karta "JĂĄdro" pĹi pĹidĂĄvĂĄnĂ nebo ĂşpravÄ nastavenĂ tĂŠto hry.
+Pokud vlastnĂ moĹžnosti nejsou zobrazeny, musĂ bĂ˝t konkrĂŠtnĂ hry spuĹĄtÄny jednou nebo znovu pĹidĂĄny do seznamu her spouĹĄtÄÄe ScummVM. Toto aktualizuje nastavenĂ kaĹždĂŠ poloĹžky, ÄĂmĹž umoĹžnĂ zobrazenĂ vlastnĂch voleb.
+
+9.0) SestavenĂ:
+---- ----------
+Pro aktuĂĄlnĂ pĹehled o tom, jak ScummVM sestavit pro rĹŻznĂŠ platformy, prohlĂŠdnÄte si, prosĂm, naĹĄĂ Wiki, zvlĂĄĹĄtÄ tuto strĂĄnku:
+
+ http://wiki.scummvm.org/index.php/Compiling_ScummVM
+
+Pokud sestavujete ve Windows, Linux nebo Mac OS X, potĹebujete SDL-1.2.2
+Nebo novÄjĹĄĂ (starĹĄĂ verze mohou fungovat, ale nejsou podporovĂĄny) a podporovanĂ˝ kompilĂĄtor. VÄtĹĄina kompilĂĄtorĹŻ, vÄetnÄ GCC, mingw a novÄjĹĄĂch verzĂ Microsoft Visual C++ jsou podporovĂĄny. Pokud chcete pouĹžĂt stopy CD komprimovanĂŠ do MP3 nebo soubory .SOU, musĂte nainstalovat knihovnu MAD; podobnÄ potĹebujete vhodnĂŠ knihovny pro komprimovanĂ˝ zvuk pomocĂ Ogg Vorbis a FLAC. Pro komprimovanĂŠ uloĹženĂŠ stavy je potĹeba mĂt zlib.
+
+NÄkterĂŠ ÄĂĄsti ScummVM, zvlĂĄĹĄtÄ zvÄtĹĄovaÄe, majĂ vysoce optimalizovanĂŠ verze napsanĂŠ v assembleru. Pokud si pĹejete tuto moĹžnost pouĹžĂt, potĹebuje mĂt nainstalovĂĄn assembler nasm (viz http://nasm.sf.net). NezapomeĹte, Ĺže v souÄasnosti mĂĄme pouze verze optimalizovanĂŠ pro x86 MMX, a nebudou sestaveny pro jinĂŠ procesory.
+
+Na Win9x/NT/XP mĹŻĹžete urÄit USE_WINDBG a pĹipojit WinDbg pro prochĂĄzenĂ ladĂcĂch zprĂĄv (viz http://www.sysinternals.com/ntw2k/freeware/debugview.shtml).
+
+ GCC a MinGW32:
+ * Zadejte "./configure"
+ * Zadejte "make" (nebo "gmake", Äi "gnumake", v zĂĄvislosti na tom, jak je GNU make ve VaĹĄem systĂŠmu nazvĂĄn) a ScummVM snad bude pro VĂĄs sestaven.
+ * Pro dalĹĄĂ informace si prohlĂŠdnÄte:
+ http://wiki.scummvm.org/index.php/Compiling_ScummVM/GCC
+ Äi
+ http://wiki.scummvm.org/index.php/Compiling_ScummVM/MinGW
+
+ Microsoft Visual C++ 8/9/10:
+ * PĹeÄtÄte si, jak vytvoĹit soubory projektu ve "dists\msvc8",
+ "dists\msvc9" pĹĂsluĹĄnÄ "dists\msvc10".
+ * OtevĹete vĂ˝slednĂ˝ soubor projektu.
+ * Zadejte cestu k potĹebnĂ˝m knihovnĂĄm a hlsiÄkovĂ˝m souborĹŻm v
+ Tools|Options|Projects and Solutions|VC++ Directories".
+ * TeÄ by program mÄl bĂ˝t ĂşspÄĹĄnÄ sestaven.
+ * Pro dalĹĄĂ informace si prohlĂŠdnÄte:
+ http://wiki.scummvm.org/index.php/Compiling_ScummVM/VS2005
+
+ Windows Mobile:
+ * PĹeÄtÄte si prosĂm:
+ http://wiki.scummvm.org/index.php/Compiling_ScummVM/Windows_CE
+
+ Mac OS X:
+ * UjistÄte se, Ĺže mĂĄte nainstalovĂĄny nĂĄstroje pro vĂ˝vojĂĄĹe.
+ * BalĂÄek SDL pro vĂ˝vojĂĄĹe na OS X, kterĂ˝ je dostupnĂ˝ na strĂĄnce SDL _nenĂ_ vhodnĂ˝. SpĂĹĄe potĹebujete sestavenĂ v unixovĂŠm stylu. Jeden takovĂ˝ zpĹŻsob, jak ho nainstalovat je pomocĂ Fink
+ (http://fink.sf.net). TakĂŠ mĹŻĹžete SDL sestavit ruÄnÄ ze zdrojovĂŠho kĂłdu pomocĂ systĂŠmu sestavenĂ pro unix (configure a make).
+ * Ve sloĹžce ScummVM zadejte "./configure".
+ * NynĂ mĹŻĹžete zadat 'make' pro vytvoĹenĂ spouĹĄtÄÄe pĹĂkazovĂŠho ĹĂĄdku.
+ * Abyste zĂskali verzi, kterou mĹŻĹžete spustit z Finder, zadejte 'make bundle' coĹž vytvoĹĂ ScummVM.app (to funguje pouze, kdyĹž mĂĄte SDL nainstalovĂĄn do /sw, coĹž se pĹi instalaci Fink provede). Pokud jste SDL nainstalovali jinĂ˝m zpĹŻsobem, budete muset upravit ports.mk).
+ * Pro dalĹĄĂ informace si prohlĂŠdnÄte:
+ http://wiki.scummvm.org/index.php/Compiling_ScummVM/MacOS_X_Crosscompiling
+
+ AmigaOS 4 (KĹĂĹžovĂĄ kompilace pomocĂ Cygwin):
+ * UjistÄte se, Ĺže mĂĄte nainstalovĂĄn SDL, mĹŻĹžete takĂŠ potĹebovat
+ libogg, libvorbis, libvorbisfile, zlib, libmad.
+ * Zadejte ./configure --host=ppc-amigaos
+ * Pokud dostanete chybu o sdl-config, pouĹžijte parametr --with-sdl-prefix pro nastavenĂ cesty.
+ * Zkontrolujte soubor 'config.mk' a pokud je vĹĄe v poĹĂĄdku:
+ * SpusĹĽte 'make'.
+ * KĹĂĹžovĂĄ kompilace pomocĂ Linux mĹŻĹže bĂ˝t takĂŠ tak lehkĂĄ.
+
+ iPhone:
+ * PĹeÄtÄte si prosĂm:
+ http://wiki.scummvm.org/index.php/Compiling_ScummVM/iPhone
+
+ Maemo:
+ * Nainstalujte Maemo SDK s rootstrap 4.1.2
+ * Nainstalujte libmad, Tremor, FLAC ze zdroje
+ * SpusĹĽte 'ln -s backends/platform/maemo/debian'
+ * Aktualizujte debian/changelog
+ * SpusĹĽte 'sb2 dpkg-buildpackage -b'
+
+------------------------------------------------------------------------
+HodnÄ Ĺ tÄstĂ a Ĺ ĹĽastnĂŠ AdventurovĂĄnĂ!
+Tým ScummVM.
+http://www.scummvm.org/
+------------------------------------------------------------------------
+
+
+
+
diff --git a/engines/agi/detection_tables.h b/engines/agi/detection_tables.h index 7c9ef4cbf6..2d7fba3507 100644 --- a/engines/agi/detection_tables.h +++ b/engines/agi/detection_tables.h @@ -846,6 +846,7 @@ static const AGIGameDescription gameDescriptions[] = { FANMADE("Time Quest (Demo v0.1)", "12e1a6f03ea4b8c5531acd0400b4ed8d"), FANMADE("Time Quest (Demo v0.2)", "7b710608abc99e0861ac59b967bf3f6d"), FANMADE_SVP("Time Quest", "90314f473d8317be5cd1f0306f139aea", 300, 0x2440, Common::kPlatformCoCo3), + FANMADE("Toby's World (Demo)", "3f8ebea0eb32303e65e2a6e8341c6741"), FANMADE("Tonight The Shrieking Corpses Bleed (Demo v0.11)", "bcc57a7c8d563fa0c333107ae1c0a6e6"), FANMADE("Tonight The Shrieking Corpses Bleed (v1.01)", "36b38f621b38e8d104aa0807302dc8c9"), FANMADE("Turks' Quest - Heir to the Planet", "3d19254b737c8b218e5bc4580542b79a"), diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp index 35779323e3..8a4e87017a 100644 --- a/engines/agos/input.cpp +++ b/engines/agos/input.cpp @@ -450,7 +450,7 @@ void AGOSEngine_Feeble::handleMouseWheelDown() { void AGOSEngine_Simon1::handleMouseWheelUp() { HitArea *ha = findBox(206); - if (ha != NULL && (ha->flags & kBFBoxInUse)) { + if (ha != NULL && (ha->flags & kBFBoxInUse) && !(ha->flags & kBFBoxDead)) { if (_saveLoadRowCurPos != 1) { if (_saveLoadRowCurPos < 7) _saveLoadRowCurPos = 1; @@ -467,7 +467,7 @@ void AGOSEngine_Simon1::handleMouseWheelUp() { void AGOSEngine_Simon1::handleMouseWheelDown() { HitArea *ha = findBox(207); - if (ha != NULL && (ha->flags & kBFBoxInUse)) { + if (ha != NULL && (ha->flags & kBFBoxInUse) && !(ha->flags & kBFBoxDead)) { if (_saveDialogFlag) { _saveLoadRowCurPos += 1; if (_saveLoadRowCurPos >= _numSaveGameRows) diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp index c26fbe3331..392ee08ea1 100644 --- a/engines/agos/midi.cpp +++ b/engines/agos/midi.cpp @@ -235,6 +235,10 @@ void MidiPlayer::startTrack(int track) { _music.parser = parser; // That plugs the power cord into the wall } else if (_music.parser) { if (!_music.parser->setTrack(track)) { + // The Roland MT32 music in Simon the Sorcerer 2 + // is missing the extra tracks in many scenes, + // like the introduction sequence. + stop(); return; } _currentTrack = (byte)track; diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp index 1e299a06ed..812f46504f 100644 --- a/engines/agos/sound.cpp +++ b/engines/agos/sound.cpp @@ -121,8 +121,14 @@ Common::SeekableReadStream *BaseSound::getSoundStream(uint sound) const { int i = 1; while (_offsets[sound + i] == _offsets[sound]) i++; + uint end; + if (_offsets[sound + i] > _offsets[sound]) { + end = _offsets[sound + i]; + } else { + end = file->size(); + } - return new Common::SeekableSubReadStream(file, _offsets[sound], _offsets[sound + i], DisposeAfterUse::YES); + return new Common::SeekableSubReadStream(file, _offsets[sound], end, DisposeAfterUse::YES); } /////////////////////////////////////////////////////////////////////////////// @@ -442,12 +448,16 @@ void Sound::loadVoiceFile(const GameSpecificSettings *gss) { if (file.open("voices.idx")) { int end = file.size(); _filenums = (uint16 *)malloc((end / 6 + 1) * 2); - _offsets = (uint32 *)malloc((end / 6 + 1) * 4); + _offsets = (uint32 *)malloc((end / 6 + 1 + 1) * 4); for (int i = 1; i <= end / 6; i++) { _filenums[i] = file.readUint16BE(); _offsets[i] = file.readUint32BE(); } + // We need to add a terminator entry otherwise we get an out of + // bounds read when the offset table is accessed in + // BaseSound::getSoundStream. + _offsets[end / 6 + 1] = 0; _hasVoiceFile = true; return; diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 86ca4c8541..451b4a1c68 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -764,7 +764,7 @@ void Animation::catacombMove(byte ped) { spr1->init(5, true); // ...Load Geida. appearPed(1, geidaPed(ped)); spr1->_callEachStepFl = true; - spr1->_eachStepProc = kProcGeida; + spr1->_eachStepProc = kProcFollowAvvy; } } @@ -1121,7 +1121,7 @@ void Animation::spin(Direction dir, byte &tripnum) { } } -void Animation::geidaProcs(byte tripnum) { +void Animation::follow(byte tripnum) { AnimationType *tripSpr = _sprites[tripnum]; AnimationType *avvy = _sprites[0]; @@ -1132,14 +1132,14 @@ void Animation::geidaProcs(byte tripnum) { } if (tripSpr->_y < (avvy->_y - 2)) { - // Geida is further from the screen than Avvy. + // The following NPC is further from the screen than Avvy. spin(kDirDown, tripnum); tripSpr->_moveY = 1; tripSpr->_moveX = 0; takeAStep(tripnum); return; } else if (tripSpr->_y > (avvy->_y + 2)) { - // Avvy is further from the screen than Geida. + // Avvy is further from the screen than the following NPC. spin(kDirUp, tripnum); tripSpr->_moveY = -1; tripSpr->_moveX = 0; @@ -1205,8 +1205,9 @@ void Animation::drawSprites() { * @remarks Originally called 'trippancy_link' */ void Animation::animLink() { - if (_vm->_dropdown->isActive() || _vm->_seeScroll) + if (_vm->_dropdown->isActive() || !_vm->_animationsEnabled) return; + for (int16 i = 0; i < kSpriteNumbMax; i++) { AnimationType *curSpr = _sprites[i]; if (curSpr->_quick && curSpr->_visible) @@ -1235,8 +1236,8 @@ void Animation::animLink() { case kProcGrabAvvy : grabAvvy(i); break; - case kProcGeida : - geidaProcs(i); + case kProcFollowAvvy : + follow(i); break; default: break; diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h index 375d117893..d1ee4a3ebd 100644 --- a/engines/avalanche/animation.h +++ b/engines/avalanche/animation.h @@ -102,9 +102,8 @@ public: kProcBackAndForth, kProcFaceAvvy, kProcArrow, - kProcSpludwick, // Unused kProcGrabAvvy, - kProcGeida // Spludwick uses it as well for homing! TODO: Unify it with kProcSpludwick. + kProcFollowAvvy }; AnimationType *_sprites[kSpriteNumbMax]; @@ -167,7 +166,7 @@ private: // Movements for Homing NPCs: Spludwick and Geida. void spin(Direction dir, byte &tripnum); void takeAStep(byte &tripnum); - void geidaProcs(byte tripnum); + void follow(byte tripnum); void drawSprites(); }; diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 1bc4c5348d..6cfe4dfdb6 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -57,6 +57,7 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription * _nim = nullptr; _ghostroom = nullptr; _help = nullptr; + _highscore = nullptr; _platform = gd->desc.platform; initVariables(); @@ -81,6 +82,7 @@ AvalancheEngine::~AvalancheEngine() { delete _nim; delete _ghostroom; delete _help; + delete _highscore; for (int i = 0; i < 31; i++) { for (int j = 0; j < 2; j++) { @@ -142,7 +144,7 @@ void AvalancheEngine::initVariables() { _letMeOut = false; _thinks = 2; _thinkThing = true; - _seeScroll = false; + _animationsEnabled = true; _currentMouse = 177; _holdLeftMouse = false; @@ -165,6 +167,7 @@ Common::ErrorCode AvalancheEngine::initialize() { _nim = new Nim(this); _ghostroom = new GhostRoom(this); _help = new Help(this); + _highscore = new HighScore(this); _graphics->init(); _dialogs->init(); @@ -200,7 +203,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) { sz.syncAsByte(_carryNum); for (int i = 0; i < kObjectNum; i++) sz.syncAsByte(_objects[i]); - sz.syncAsSint16LE(_dnascore); + sz.syncAsSint16LE(_score); sz.syncAsSint32LE(_money); sz.syncAsByte(_room); if (sz.isSaving()) @@ -336,8 +339,8 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) { } -bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!! - return (!_seeScroll && _alive); +bool AvalancheEngine::canSaveGameStateCurrently() { + return (_animationsEnabled && _alive); } Common::Error AvalancheEngine::saveGameState(int slot, const Common::String &desc) { @@ -381,8 +384,8 @@ Common::String AvalancheEngine::getSaveFileName(const int slot) { return Common::String::format("%s.%03d", _targetName.c_str(), slot); } -bool AvalancheEngine::canLoadGameStateCurrently() { // TODO: Refine these!!! - return (!_seeScroll); +bool AvalancheEngine::canLoadGameStateCurrently() { + return (_animationsEnabled); } Common::Error AvalancheEngine::loadGameState(int slot) { @@ -432,7 +435,7 @@ bool AvalancheEngine::loadGame(const int16 slot) { _isLoaded = true; - _seeScroll = true; // This prevents display of the new sprites before the new picture is loaded. + _animationsEnabled = false; if (_holdTheDawn) { _holdTheDawn = false; diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index fcca396fd2..6eb5e675cc 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -46,6 +46,7 @@ #include "avalanche/help.h" #include "avalanche/shootemup.h" #include "avalanche/mainmenu.h" +#include "avalanche/highscore.h" #include "common/serializer.h" @@ -91,6 +92,7 @@ public: Nim *_nim; GhostRoom *_ghostroom; Help *_help; + HighScore *_highscore; OSystem *_system; @@ -150,7 +152,7 @@ public: // Former DNA structure byte _carryNum; // How many objects you're carrying... bool _objects[kObjectNum]; // ...and which ones they are. - int16 _dnascore; // your score, of course + int16 _score; // your score, of course int32 _money; // your current amount of dosh Room _room; // your current room bool _wonNim; // Have you *won* Nim? (That's harder.) @@ -210,7 +212,7 @@ public: bool _letMeOut; byte _thinks; bool _thinkThing; - bool _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll? + bool _animationsEnabled; // If set to TRUE, it stops the animation system working. This prevents display of the new sprites before the new picture is loaded or during the display of a scroll. Original name: seescroll. char _objectList[10]; // Called .free() for them in ~Gyro(). @@ -236,6 +238,7 @@ public: bool _isLoaded; // Is it a loaded gamestate? void callVerb(VerbCode id); + void loadBackground(byte num); void loadRoom(byte num); void thinkAbout(byte object, bool type); // Hey!!! Get it and put it!!! void incScore(byte num); // Add on no. of points diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 8f619e6a13..c8f5599687 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -202,6 +202,8 @@ void AvalancheEngine::setup() { _graphics->drawSoundLight(_sound->_soundFl); + drawToolbar(); + int16 loadSlot = ConfMan.instance().getInt("save_slot"); if (loadSlot >= 0) { _thinks = 2; // You always have money. @@ -218,8 +220,6 @@ void AvalancheEngine::setup() { newGame(); - drawToolbar(); - thinkAbout(kObjectMoney, kThing); _dialogs->displayScrollChain('Q', 83); // Info on the game, etc. @@ -249,8 +249,6 @@ void AvalancheEngine::runAvalot() { _system->delayMillis(55 - delay); // Replaces slowdown(); 55 comes from 18.2 Hz (B Flight). }; - warning("STUB: run()"); - _closing->exitGame(); } @@ -416,9 +414,7 @@ void AvalancheEngine::loadAlso(byte num) { } } -void AvalancheEngine::loadRoom(byte num) { - CursorMan.showMouse(false); - +void AvalancheEngine::loadBackground(byte num) { Common::String filename = Common::String::format("place%d.avd", num); Common::File file; if (!file.open(filename)) @@ -440,9 +436,15 @@ void AvalancheEngine::loadRoom(byte num) { _graphics->refreshBackground(); file.close(); +} +void AvalancheEngine::loadRoom(byte num) { + CursorMan.showMouse(false); + + loadBackground(num); loadAlso(num); - _background->load(num); + _background->loadSprites(num); + CursorMan.showMouse(true); } @@ -460,7 +462,7 @@ void AvalancheEngine::findPeople(byte room) { void AvalancheEngine::exitRoom(byte x) { _sound->stopSound(); _background->release(); - _seeScroll = true; // This stops the trippancy system working over the length of this procedure. + _animationsEnabled = false; switch (x) { case kRoomSpludwicks: @@ -483,7 +485,7 @@ void AvalancheEngine::exitRoom(byte x) { } _interrogation = 0; // Leaving the room cancels all the questions automatically. - _seeScroll = false; // Now it can work again! + _animationsEnabled = true; _lastRoom = _room; if (_room != kRoomMap) @@ -530,11 +532,11 @@ void AvalancheEngine::putGeidaAt(byte whichPed, byte ped) { spr1->init(5, false); // load Geida _animation->appearPed(1, whichPed); spr1->_callEachStepFl = true; - spr1->_eachStepProc = Animation::kProcGeida; + spr1->_eachStepProc = Animation::kProcFollowAvvy; } void AvalancheEngine::enterRoom(Room roomId, byte ped) { - _seeScroll = true; // This stops the trippancy system working over the length of this procedure. + _animationsEnabled = false; findPeople(roomId); _room = roomId; @@ -615,7 +617,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) { } spr1->_callEachStepFl = true; - spr1->_eachStepProc = Animation::kProcGeida; + spr1->_eachStepProc = Animation::kProcFollowAvvy; } else _whereIs[kPeopleSpludwick - 150] = kRoomNowhere; break; @@ -918,7 +920,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) { break; } - _seeScroll = false; // Now it can work again! + _animationsEnabled = true; } void AvalancheEngine::thinkAbout(byte object, bool type) { @@ -953,7 +955,7 @@ void AvalancheEngine::drawToolbar() { } void AvalancheEngine::drawScore() { - uint16 score = _dnascore; + uint16 score = _score; int8 numbers[3] = {0, 0, 0}; for (int i = 0; i < 2; i++) { byte divisor = 1; @@ -979,15 +981,14 @@ void AvalancheEngine::drawScore() { void AvalancheEngine::incScore(byte num) { for (int i = 1; i <= num; i++) { - _dnascore++; + _score++; if (_soundFx) { for (int j = 1; j <= 97; j++) - // Length os 2 is a guess, the original doesn't have a delay specified - _sound->playNote(177 + _dnascore * 3, 2); + // Length of 2 is a guess, the original doesn't have a delay specified + _sound->playNote(177 + _score * 3, 2); } } - warning("STUB: points()"); drawScore(); } @@ -1332,7 +1333,7 @@ void AvalancheEngine::resetVariables() { for (int i = 0; i < kObjectNum; i++) _objects[i] = false; - _dnascore = 0; + _score = 0; _money = 0; _room = kRoomNowhere; _saveNum = 0; @@ -1438,7 +1439,7 @@ void AvalancheEngine::newGame() { _thinkThing = true; _thinks = 2; refreshObjectList(); - _seeScroll = false; + _animationsEnabled = true; avvy->appear(300, 117, kDirRight); // Needed to initialize Avalot. //for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil; diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp index c3d6ac3481..f1ba659a55 100644 --- a/engines/avalanche/background.cpp +++ b/engines/avalanche/background.cpp @@ -261,7 +261,7 @@ void Background::update() { } } -void Background::load(byte number) { +void Background::loadSprites(byte number) { Common::File f; _filename = _filename.format("chunk%d.avd", number); if (!f.open(_filename)) diff --git a/engines/avalanche/background.h b/engines/avalanche/background.h index 98d6d36fed..e994d9eae9 100644 --- a/engines/avalanche/background.h +++ b/engines/avalanche/background.h @@ -51,7 +51,7 @@ public: ~Background(); void update(); - void load(byte number); + void loadSprites(byte number); void release(); // Setting the destination to negative coordinates means the picture should be drawn to it's original position. diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index dc1c277877..e843d17c5b 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -157,7 +157,7 @@ void Dialogs::scrollModeNormal() { Common::String e = "(c) 1994"; setReadyLight(3); - _vm->_seeScroll = true; + _vm->_animationsEnabled = false; _vm->_graphics->loadMouse(kCurFletch); _vm->_graphics->saveScreen(); @@ -216,10 +216,8 @@ void Dialogs::scrollModeNormal() { #endif setReadyLight(0); - _vm->_seeScroll = false; + _vm->_animationsEnabled = true; _vm->_holdLeftMouse = false; // Used in Lucerna::checkclick(). - - warning("STUB: Scrolls::scrollModeNormal()"); } /** @@ -290,7 +288,7 @@ bool Dialogs::theyMatch(TuneType &played) { */ void Dialogs::scrollModeMusic() { setReadyLight(3); - _vm->_seeScroll = true; + _vm->_animationsEnabled = false; CursorMan.showMouse(false); _vm->_graphics->loadMouse(kCurFletch); @@ -299,7 +297,7 @@ void Dialogs::scrollModeMusic() { played[i] = kPitchInvalid; int8 lastOne = -1, thisOne = -1; // Invalid values. - _vm->_seeScroll = true; + _vm->_animationsEnabled = false; _vm->_graphics->saveScreen(); _vm->_graphics->showScroll(); @@ -363,6 +361,7 @@ void Dialogs::scrollModeMusic() { value = 11; break; default: + error("cannot happen"); break; } @@ -392,7 +391,7 @@ void Dialogs::scrollModeMusic() { _vm->_graphics->restoreScreen(); _vm->_graphics->removeBackup(); - _vm->_seeScroll = false; + _vm->_animationsEnabled = true; CursorMan.showMouse(true); } @@ -645,9 +644,6 @@ void Dialogs::solidify(byte n) { * 'calldriver' and 'display' by using Common::String instead of a private buffer. */ void Dialogs::displayText(Common::String text) { -// bool was_virtual; // Was the mouse cursor virtual on entry to this proc? - warning("STUB: Scrolls::calldrivers()"); - _vm->_sound->stopSound(); setReadyLight(0); diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp index 0bc1f7eb8b..97adfc2581 100644 --- a/engines/avalanche/dropdown.cpp +++ b/engines/avalanche/dropdown.cpp @@ -405,8 +405,8 @@ Common::String DropDownMenu::selectGender(byte x) { void DropDownMenu::setupMenuGame() { _activeMenuItem.reset(); _activeMenuItem.setupOption("Help...", 'H', "f1", true); - _activeMenuItem.setupOption("Boss Key", 'B', "alt-B", false); - _activeMenuItem.setupOption("Untrash screen", 'U', "ctrl-f7", true); + _activeMenuItem.setupOption("Boss Key", 'B', "alt-B", true); + _activeMenuItem.setupOption("Untrash screen", 'U', "ctrl-f7", false); _activeMenuItem.setupOption("Score and rank", 'S', "f9", true); _activeMenuItem.setupOption("About Avvy...", 'A', "shift-f10", true); _activeMenuItem.display(); @@ -678,7 +678,7 @@ void DropDownMenu::setup() { _menuBar.draw(); } -void DropDownMenu::update() { // TODO: Optimize it ASAP!!! It really needs it... +void DropDownMenu::update() { _vm->_graphics->saveScreen(); Common::Point cursorPos = _vm->getMousePos(); diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h index 998c96a131..0ba39321bc 100644 --- a/engines/avalanche/enums.h +++ b/engines/avalanche/enums.h @@ -30,6 +30,7 @@ namespace Avalanche { +enum MonsterType { kMonsterTypeGhost, kMonsterTypeGlerk }; enum Flavour { kFlavourEga, kFlavourBgi, kFlavourNatural, kFlavourTwo, kFlavourOne }; diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp index 1419a0cbab..16c79fdee0 100644 --- a/engines/avalanche/ghostroom.cpp +++ b/engines/avalanche/ghostroom.cpp @@ -70,6 +70,30 @@ GhostRoom::~GhostRoom() { for (int j = 0; j < 6; j++) _greldet[j][i].free(); } + + if (_wasLoaded) { + for (int i = 0; i < 5; i++) { + for (int j = 0; j < 2; j++) { + for (int y = 0; y < 66; y++) { + delete[] _ghost[i][j][y]; + } + delete[] _ghost[i][j]; + } + delete[] _ghost[i]; + } + delete[] _ghost; + + for (int i = 0; i < 6; i++) { + for (int j = 0; j < 4; j++) { + for (int y = 0; y < 35; y++) { + delete[] _glerk[i][j][y]; + } + delete[] _glerk[i][j]; + } + delete[] _glerk[i]; + } + delete[] _glerk; + } } void GhostRoom::wait(uint16 howLong) { @@ -141,9 +165,13 @@ void GhostRoom::loadPictures() { file.seek(44); // Initializing ghost's array. + _ghost = new byte***[5]; for (int i = 0; i < 5; i++) { + _ghost[i] = new byte**[2]; for (int j = 0; j < 2; j++) { + _ghost[i][j] = new byte*[66]; for (int y = 0; y < 66; y++) { + _ghost[i][j][y] = new byte[26]; for (int x = 0; x < 26; x++) _ghost[i][j][y][x] = 0; } @@ -171,11 +199,14 @@ void GhostRoom::loadPictures() { for (int i = 0; i < 3; i++) _bat[i] = _vm->_graphics->ghostLoadPicture(file, dummyCoord); - // Initializing glerk's array. + _glerk = new byte***[6]; for (int i = 0; i < 6; i++) { + _glerk[i] = new byte**[4]; for (int j = 0; j < 4; j++) { + _glerk[i][j] = new byte*[35]; for (int y = 0; y < 35; y++) { + _glerk[i][j][y] = new byte[9]; for (int x = 0; x < 9; x++) _glerk[i][j][y][x] = 0; } @@ -245,7 +276,7 @@ void GhostRoom::run() { if (_glerkStage > 25) break; - _vm->_graphics->ghostDrawGlerk(_glerk[kGlerkFade[_glerkStage]], 456, 14); + _vm->_graphics->ghostDrawMonster(_glerk[kGlerkFade[_glerkStage]], 456, 14, kMonsterTypeGlerk); _glerkStage++; } @@ -263,7 +294,7 @@ void GhostRoom::run() { // Here comes the descending ghost: for (int y = -64; y <= 103; y++) { - _vm->_graphics->ghostDrawGhost(_ghost[1 + (abs(y / 7) % 2) * 3], 0, y); + _vm->_graphics->ghostDrawMonster(_ghost[1 + (abs(y / 7) % 2) * 3], 0, y, kMonsterTypeGhost); if (y > 0) _vm->_graphics->drawFilledRectangle(Common::Rect(0, y - 1, 26 * 8 + 1, y + 1), kColorBlack); _vm->_graphics->refreshScreen(); @@ -277,7 +308,7 @@ void GhostRoom::run() { for (int i = 0; i < 4; i++) { for (int j = 0; j < 5; j++) { _vm->_graphics->drawFilledRectangle(Common::Rect(0, 96, 26 * 8, 170), kColorBlack); - _vm->_graphics->ghostDrawGhost(_ghost[kWaveOrder[j]], 0, 96 + kAdjustment[j]); + _vm->_graphics->ghostDrawMonster(_ghost[kWaveOrder[j]], 0, 96 + kAdjustment[j], kMonsterTypeGhost); _aarghCount++; diff --git a/engines/avalanche/ghostroom.h b/engines/avalanche/ghostroom.h index ebb02f7aac..4c659128ce 100644 --- a/engines/avalanche/ghostroom.h +++ b/engines/avalanche/ghostroom.h @@ -58,11 +58,11 @@ private: static const byte kGreldetFade[18]; Common::Point dummyCoord; - byte _ghost[5][2][66][26]; + byte ****_ghost;// [5][2][66][26] Graphics::Surface _eyes[2]; Graphics::Surface _exclamation; Graphics::Surface _bat[3]; - byte _glerk[6][4][35][9]; + byte ****_glerk; // [6][4][35][9] Graphics::Surface _aargh[6]; Common::Point _aarghWhere[6]; Graphics::Surface _greenEyes[5]; diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index ae53f3e034..513cd72c8c 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -527,64 +527,65 @@ void GraphicManager::nimFree() { _nimLogo.free(); } -void GraphicManager::ghostDrawGhost(byte ghostArr[2][66][26], uint16 destX, int16 destY) { +void GraphicManager::ghostDrawMonster(byte ***picture, uint16 destX, int16 destY, MonsterType type) { + uint16 height = 0; + uint16 width = 0; + // Only for the Ghost: const byte kPlaneToUse[4] = { 0, 0, 0, 1 }; - // Constants from the original code: - uint16 height = 66; - const uint16 width = 26 * 8; - - // We have to mess around with the coords and the sizes since - // the ghost isn't always placed fully on the screen. int yStart = 0; - if (destY < 0) { - yStart = abs(destY); - height -= yStart; - destY = 0; - } - - Graphics::Surface ghostPic; - ghostPic.create(width, height, Graphics::PixelFormat::createFormatCLUT8()); - - for (int y = 0; y < height; y++) { - for (int plane = 0; plane < 4; plane++) { - for (uint16 x = 0; x < width / 8; x ++) { - byte pixel = ghostArr[kPlaneToUse[plane]][y + yStart][x]; - for (int bit = 0; bit < 8; bit++) { - byte pixelBit = (pixel >> bit) & 1; - *(byte *)ghostPic.getBasePtr(x * 8 + 7 - bit, y) += (pixelBit << plane); - } - } + + // Constants from the original code: + switch (type) { + case kMonsterTypeGhost: + height = 66; + width = 208; // 26 * 8 + + // We have to mess around with the coords and the sizes since + // the ghost isn't always placed fully on the screen. + if (destY < 0) { + yStart = abs(destY); + height -= yStart; + destY = 0; } + break; + case kMonsterTypeGlerk: + height = 35; + width = 72; // 9 * 8 + break; + default: + break; } - drawPicture(_surface, ghostPic, destX, destY); - - ghostPic.free(); -} - -void GraphicManager::ghostDrawGlerk(byte glerkArr[4][35][9], uint16 destX, uint16 destY) { - // Constants from the original code: - const uint16 height = 35; - const uint16 width = 9 * 8; - - Graphics::Surface glerkPic; - glerkPic.create(width, height, Graphics::PixelFormat::createFormatCLUT8()); + Graphics::Surface monsterPicture; + monsterPicture.create(width, height, Graphics::PixelFormat::createFormatCLUT8()); for (int y = 0; y < height; y++) { for (int plane = 0; plane < 4; plane++) { for (uint16 x = 0; x < width / 8; x++) { - byte pixel = glerkArr[plane][y][x]; + byte pixel = 0; + + switch (type) { + case kMonsterTypeGhost: + pixel = picture[kPlaneToUse[plane]][y + yStart][x]; + break; + case kMonsterTypeGlerk: + pixel = picture[plane][y][x]; + break; + default: + break; + } + for (int bit = 0; bit < 8; bit++) { byte pixelBit = (pixel >> bit) & 1; - *(byte *)glerkPic.getBasePtr(x * 8 + 7 - bit, y) += (pixelBit << plane); + *(byte *)monsterPicture.getBasePtr(x * 8 + 7 - bit, y) += (pixelBit << plane); } } } } - drawPicture(_surface, glerkPic, destX, destY); + drawPicture(_surface, monsterPicture, destX, destY); - glerkPic.free(); + monsterPicture.free(); } /** diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 7e0ed64b5f..bd8fc6c8ff 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -97,8 +97,7 @@ public: void drawWinningPic(); // Ghostroom's functions: - void ghostDrawGhost(byte ghostArr[2][66][26], uint16 destX, int16 destY); // Very similar to loadPictureSign(). TODO: Unify the two later if possible. - void ghostDrawGlerk(byte glerkArr[4][35][9], uint16 destX, uint16 destY); // Very similar to ghostDrawGhost(), but not enough to unify the two. + void ghostDrawMonster(byte ***picture, uint16 destX, int16 destY, MonsterType type); Graphics::Surface ghostLoadPicture(Common::File &file, Common::Point &coord); void ghostDrawPicture(const Graphics::Surface &picture, uint16 destX, uint16 destY); void ghostDrawBackgroundItems(Common::File &file); @@ -106,7 +105,7 @@ public: // Help's function: void helpDrawButton(int y, byte which); void helpDrawHighlight(byte which, Color color); - void helpDrawBigText(const Common::String text, int16 x, int16 y, Color color); // Very similar to drawText. TODO: Try to unify the two. + void helpDrawBigText(const Common::String text, int16 x, int16 y, Color color); // Shoot em' up's functions: void seuDrawTitle(); @@ -199,12 +198,11 @@ private: Graphics::Surface loadPictureSign(Common::File &file, uint16 width, uint16 height); // Reads a tricky type of picture used for the "game over"/"about" scrolls and in the mini-game Nim. void drawText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color); - void drawBigText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color); // Very similar to drawText. TODO: Try to unify the two. + void drawBigText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color); void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY); // Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc. // Returns the end point of the arc. (Needed in Clock.) - // TODO: Make it more accurate later. Common::Point drawArc(Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color); }; diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp index 8584bfa78c..9b077eb4fb 100644 --- a/engines/avalanche/help.cpp +++ b/engines/avalanche/help.cpp @@ -199,8 +199,8 @@ bool Help::handleMouse(const Common::Event &event) { if (_highlightWas != highlightIs) _vm->_graphics->helpDrawHighlight(_highlightWas, kColorBlue); - // Highligt the current one with the proper color: - if (_buttons[highlightIs]._trigger != Common::KEYCODE_INVALID) { + // Highlight the current one with the proper color: + if ((highlightIs != 177) && (_buttons[highlightIs]._trigger != Common::KEYCODE_INVALID)) { _highlightWas = highlightIs; _vm->_graphics->helpDrawHighlight(highlightIs, highlightColor); } diff --git a/engines/avalanche/highscore.cpp b/engines/avalanche/highscore.cpp new file mode 100644 index 0000000000..5f47aeb894 --- /dev/null +++ b/engines/avalanche/highscore.cpp @@ -0,0 +1,110 @@ +/* ScummVM - Graphic Adventure Engine +* +* ScummVM is the legal property of its developers, whose names +* are too numerous to list here. Please refer to the COPYRIGHT +* file distributed with this source distribution. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +*/ + +/* +* This code is based on the original source code of Lord Avalot d'Argent version 1.3. +* Copyright (c) 1994-1995 Mike: Mark and Thomas Thurman. +*/ + +#include "avalanche/avalanche.h" +#include "avalanche/highscore.h" + +#include "common/savefile.h" + +namespace Avalanche { + +HighScore::HighScore(AvalancheEngine *vm) { + _vm = vm; +} + +void HighScore::displayHighScores() { + warning("STUB: HighScore::displayHighScores("); +} + +void HighScore::saveHighScores() { + int firstSmaller = 0; + while ((firstSmaller < 12) && (_data[firstSmaller]._score >= _vm->_score)) + firstSmaller++; + + if (firstSmaller < 12) { + // Shift all the lower scores down a space: + for (int i = firstSmaller; i < 11; i++) + _data[i + 1] = _data[i]; + // Set the new high score: + _data[firstSmaller]._name = "Player"; // TODO: Come up with something for that. In the original it wasn't implemented at all... + _data[firstSmaller]._rank = _vm->_parser->rank(); + _data[firstSmaller]._score = _vm->_score; + } + + Common::OutSaveFile *f = g_system->getSavefileManager()->openForSaving("scores.avd"); + if (!f) { + warning("Can't create file 'scores.avd', high scores are not saved."); + return; + } + Common::Serializer sz(NULL, f); + syncHighScores(sz); + f->finalize(); + delete f; +} + +void HighScore::loadHighScroes() { + Common::File file; + if (!file.exists("scores.avd")) { + produceDefaultHighScores(); + } else { + Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading("scores.avd"); + if (!f) + return; + Common::Serializer sz(f, NULL); + syncHighScores(sz); + delete f; + } +} + +void HighScore::produceDefaultHighScores() { + for (int i = 0; i < 12; i++) { + _data[i]._score = 32 - (i + 1) * 2; + _data[i]._rank = "..."; + } + _data[0]._name = "Mike"; + _data[1]._name = "Liz"; + _data[2]._name = "Thomas"; + _data[3]._name = "Mark"; + _data[4]._name = "Mandy"; + _data[5]._name = "Andrew"; + _data[6]._name = "Lucy Tryphena"; + _data[7]._name = "Tammy the dog"; + _data[8]._name = "Avaricius"; + _data[9]._name = "Spellchick"; + _data[10]._name = "Caddelli"; + _data[11]._name = "Spludwick"; +} + +void HighScore::syncHighScores(Common::Serializer &sz) { + for (int i = 0; i < 12; i++) { + sz.syncString(_data[i]._name); + sz.syncAsUint16LE(_data[i]._score); + sz.syncString(_data[i]._rank); + } +} + +} // End of namespace Avalanche diff --git a/engines/avalanche/highscore.h b/engines/avalanche/highscore.h new file mode 100644 index 0000000000..de7ec36ed5 --- /dev/null +++ b/engines/avalanche/highscore.h @@ -0,0 +1,59 @@ +/* ScummVM - Graphic Adventure Engine +* +* ScummVM is the legal property of its developers, whose names +* are too numerous to list here. Please refer to the COPYRIGHT +* file distributed with this source distribution. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +*/ + +/* +* This code is based on the original source code of Lord Avalot d'Argent version 1.3. +* Copyright (c) 1994-1995 Mike: Mark and Thomas Thurman. +*/ + +#ifndef AVALANCHE_HIGHSCORE_H +#define AVALANCHE_HIGHSCORE_H + +namespace Avalanche { +class AvalancheEngine; + +struct HighScoreData { + Common::String _name; + uint16 _score; + Common::String _rank; +}; + +class HighScore { +public: + HighScore(AvalancheEngine *vm); + + void displayHighScores(); + void saveHighScores(); + void loadHighScroes(); + +private: + AvalancheEngine *_vm; + + HighScoreData _data[12]; + + void produceDefaultHighScores(); + void syncHighScores(Common::Serializer &sz); +}; + +} // End of namespace Avalanche + +#endif // AVALANCHE_HIGHSCORE_H diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk index d31fd0d91a..29bc039b42 100644 --- a/engines/avalanche/module.mk +++ b/engines/avalanche/module.mk @@ -20,7 +20,8 @@ MODULE_OBJS = \ ghostroom.o \ help.o \ shootemup.o \ - mainmenu.o + mainmenu.o \ + highscore.o # This module can be built as a plugin ifeq ($(ENABLE_AVALANCHE), DYNAMIC_PLUGIN) diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 44e8dde9ae..b152747ab0 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -602,7 +602,7 @@ Common::String Parser::rank() { }; for (int i = 0; i < 8; i++) { - if ((_vm->_dnascore >= ranks[i]._score) && (_vm->_dnascore < ranks[i + 1]._score)) + if ((_vm->_score >= ranks[i]._score) && (_vm->_score < ranks[i + 1]._score)) return Common::String(ranks[i]._title); } return ""; @@ -2021,8 +2021,7 @@ void Parser::doThat() { break; case 55: if (_vm->_room == kRoomArgentPub) - // play_nim(); - warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()"); + _vm->_nim->playNim(); else _vm->_dialogs->displayText(kWhat); break; @@ -2052,8 +2051,7 @@ void Parser::doThat() { _vm->_dialogs->displayText("Hello, Phaon!"); break; case kVerbCodeBoss: - // bosskey(); - warning("STUB: Parser::doThat() - case kVerbCodeboss"); + bossKey(); break; case kVerbCodePee: if (_vm->getFlag('P')) { @@ -2308,7 +2306,7 @@ void Parser::doThat() { break; case kVerbCodeScore: { Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%c " \ - "This gives you a rank of %s.%c%c%s", _vm->_dnascore, kControlCenter, kControlNewLine, kControlNewLine, + "This gives you a rank of %s.%c%c%s", _vm->_score, kControlCenter, kControlNewLine, kControlNewLine, kControlNewLine, rank().c_str(), kControlNewLine, kControlNewLine, totalTime().c_str()); _vm->_dialogs->displayText(tmpStr); } @@ -2426,6 +2424,25 @@ void Parser::doThat() { } } +void Parser::bossKey() { + _vm->_graphics->saveScreen(); + _vm->_graphics->blackOutScreen(); + _vm->_graphics->loadMouse(kCurUpArrow); + _vm->loadBackground(98); + _vm->_graphics->drawNormalText("Graph/Histo/Draw/Sample: \"JANJUN93.GRA\": (W3-AB3)", _vm->_font, 8, 120, 169, kColorDarkgray); + _vm->_graphics->drawNormalText("Press any key or click the mouse to return.", _vm->_font, 8, 144, 182, kColorDarkgray); + _vm->_graphics->refreshScreen(); + Common::Event event; + _vm->getEvent(event); + while ((!_vm->shouldQuit()) && (event.type != Common::EVENT_KEYDOWN) && (event.type != Common::EVENT_LBUTTONDOWN)){ + _vm->getEvent(event); + _vm->_graphics->refreshScreen(); + } + _vm->_graphics->restoreScreen(); + _vm->_graphics->removeBackup(); + _vm->loadBackground(_vm->_room); +} + void Parser::verbOpt(byte verb, Common::String &answer, char &ansKey) { // kVerbCodegive isn't dealt with by this procedure, but by ddm__with. switch (verb) { diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h index 46408f518a..6133c41442 100644 --- a/engines/avalanche/parser.h +++ b/engines/avalanche/parser.h @@ -72,13 +72,11 @@ public: byte _wearing; // what you're wearing Parser(AvalancheEngine *vm); - void init(); void parse(); void doThat(); void verbOpt(byte verb, Common::String &answer, char &ansKey); void drink(); - void handleInputText(const Common::Event &event); void handleBackspace(); void handleReturn(); @@ -89,7 +87,7 @@ public: void tryDropdown(); int16 getPos(const Common::String &crit, const Common::String &src); void doVerb(VerbCode id); - + Common::String rank(); void resetVariables(); void synchronize(Common::Serializer &sz); @@ -112,10 +110,7 @@ private: byte wordNum(Common::String word); void replace(Common::String oldChars, byte newChar); - - Common::String rank(); Common::String totalTime(); - void clearWords(); void cheatParse(Common::String codes); void stripPunctuation(Common::String &word); @@ -146,6 +141,7 @@ private: void playHarp(); void winSequence(); void wipeText(); + void bossKey(); }; } // End of namespace Avalanche diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp index 8d61316daa..cabd19d6f9 100644 --- a/engines/avalanche/shootemup.cpp +++ b/engines/avalanche/shootemup.cpp @@ -95,7 +95,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) { _gotOut = false; } -void ShootEmUp::run() { +uint16 ShootEmUp::run() { CursorMan.showMouse(false); _vm->_graphics->saveScreen(); _vm->fadeOut(); @@ -142,12 +142,14 @@ void ShootEmUp::run() { if (delay <= 55) _vm->_system->delayMillis(55 - delay); // Replaces slowdown(); 55 comes from 18.2 Hz (B Flight). }; - + _vm->fadeOut(); _vm->_graphics->restoreScreen(); _vm->_graphics->removeBackup(); _vm->fadeIn(); CursorMan.showMouse(true); + + return _score; } bool ShootEmUp::overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y) { diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h index 4c010aa71e..3cdcc1d5cd 100644 --- a/engines/avalanche/shootemup.h +++ b/engines/avalanche/shootemup.h @@ -35,7 +35,7 @@ class ShootEmUp { public: ShootEmUp(AvalancheEngine *vm); - void run(); + uint16 run(); private: struct Sprite { diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp index 7b6e1ee1ce..a9753b3cce 100644 --- a/engines/avalanche/timer.cpp +++ b/engines/avalanche/timer.cpp @@ -333,12 +333,11 @@ void Timer::hangAround2() { // We don't need the ShootEmUp during the whole game, it's only playable once. ShootEmUp *shootemup = new ShootEmUp(_vm); - shootemup->run(); + _shootEmUpScore = shootemup->run(); delete shootemup; } void Timer::afterTheShootemup() { - // Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented! _vm->flipRoom(_vm->_room, 1); _vm->_animation->_sprites[0]->init(0, true); // Avalot. @@ -347,27 +346,15 @@ void Timer::afterTheShootemup() { _vm->_objects[kObjectCrossbow - 1] = true; _vm->refreshObjectList(); - // Same as the added line above: TODO: Remove it later!!! - _vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", " \ - "but I haven't implemented it yet: you get the crossbow automatically.") + kControlNewLine + kControlNewLine + "Peter (uruk)"); - -#if 0 - byte shootscore, gain; - - shootscore = mem[storage_seg * storage_ofs]; - gain = (shootscore + 5) / 10; // Rounding up. - - display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" + - strf(shootscore) + " 0xF6 10) = " + strf(gain) + " points."); + byte gain = (_shootEmUpScore + 5) / 10; // Rounding up. + _vm->_dialogs->displayText(Common::String::format("%cYour score was %d.%c%cYou gain (%d \xf6 10) = %d points.", kControlItalic, _shootEmUpScore, kControlNewLine, kControlNewLine, _shootEmUpScore, gain)); if (gain > 20) { - display("But we won't let you have more than 20 points!"); - points(20); + _vm->_dialogs->displayText("But we won't let you have more than 20 points!"); + _vm->incScore(20); } else - points(gain); -#endif + _vm->incScore(gain); - warning("STUB: Timer::after_the_shootemup()"); _vm->_dialogs->displayScrollChain('Q', 70); } @@ -712,6 +699,8 @@ void Timer::resetVariables() { _times[i]._action = 0; _times[i]._reason = 0; } + + _shootEmUpScore = 0; } } // End of namespace Avalanche. diff --git a/engines/avalanche/timer.h b/engines/avalanche/timer.h index fd51544fd1..ad6ac0eae6 100644 --- a/engines/avalanche/timer.h +++ b/engines/avalanche/timer.h @@ -170,7 +170,7 @@ public: private: AvalancheEngine *_vm; - + byte _shootEmUpScore; }; } // End of namespace Avalanche. diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp index 8bcc4d3809..d2e13e525c 100644 --- a/engines/bbvs/bbvs.cpp +++ b/engines/bbvs/bbvs.cpp @@ -79,7 +79,41 @@ BbvsEngine::BbvsEngine(OSystem *syst, const ADGameDescription *gd) : Engine(syst), _gameDescription(gd) { _random = new Common::RandomSource("bbvs"); - + _currActionCommandIndex = -1; + _buttheadObject = nullptr; + _beavisObject = nullptr; + _currCameraNum = 0; + _walkAreasCount = 0; + _walkInfosCount = 0; + _walkableRectsCount = 0; + _sourceWalkArea = nullptr; + _destWalkArea = nullptr; + _currWalkDistance = kMaxDistance; + _walkReachedDestArea = false; + _hasSnapshot = false; + _snapshot = nullptr; + _snapshotStream = nullptr; + _isSaveAllowed = false; + + for (int i = 0; i < 80; i++) { + _walkAreas[i].x = 0; + _walkAreas[i].y = 0; + _walkAreas[i].width = 0; + _walkAreas[i].height = 0; + _walkAreas[i].checked = false; + _walkAreas[i].linksCount = 0; + for (int j = 0; j < 16; j++) + _walkAreas[i].links[j] = nullptr; + for (int j = 0; j < 32; j++) { + _walkAreas[i].linksD1[j] = nullptr; + _walkAreas[i].linksD2[j] = nullptr; + } + } + + for (int i = 0; i < 256; i++) { + _walkInfoPtrs[i] = nullptr; + } + Engine::syncSoundSettings(); } diff --git a/engines/bbvs/bbvs.h b/engines/bbvs/bbvs.h index 8136184e0b..6a9a13905c 100644 --- a/engines/bbvs/bbvs.h +++ b/engines/bbvs/bbvs.h @@ -199,6 +199,7 @@ struct WalkArea { bool contains(const Common::Point &pt) const; }; +const int kSnapshotSize = 23072; const int kSceneObjectsCount = 64; const int kSceneSoundsCount = 8; const int kInventoryItemStatusCount = 50; @@ -209,6 +210,7 @@ const int kSceneVisitedCount = 64; const int kMainMenu = 44; const int kCredits = 45; +const int kMaxDistance = 0xFFFFFF; static const int8 kWalkTurnTbl[] = { 7, 9, 4, 8, 6, 10, 5, 11 }; @@ -303,7 +305,6 @@ public: bool _walkReachedDestArea; bool _hasSnapshot; - uint32 _snapshotSize; byte *_snapshot; Common::SeekableMemoryWriteStream *_snapshotStream; diff --git a/engines/bbvs/saveload.cpp b/engines/bbvs/saveload.cpp index 3bb980053c..ff53cc457b 100644 --- a/engines/bbvs/saveload.cpp +++ b/engines/bbvs/saveload.cpp @@ -212,9 +212,8 @@ bool BbvsEngine::existsSavegame(int num) { } void BbvsEngine::allocSnapshot() { - _snapshotSize = 23072; - _snapshot = new byte[_snapshotSize]; - _snapshotStream = new Common::SeekableMemoryWriteStream(_snapshot, _snapshotSize); + _snapshot = new byte[kSnapshotSize]; + _snapshotStream = new Common::SeekableMemoryWriteStream(_snapshot, kSnapshotSize); } void BbvsEngine::freeSnapshot() { diff --git a/engines/bbvs/walk.cpp b/engines/bbvs/walk.cpp index cabe402a46..cf8942e525 100644 --- a/engines/bbvs/walk.cpp +++ b/engines/bbvs/walk.cpp @@ -44,8 +44,6 @@ static const int8 kWalkAnimTbl[32] = { }; void BbvsEngine::startWalkObject(SceneObject *sceneObject) { - const int kMaxDistance = 0xFFFFFF; - if (_buttheadObject != sceneObject && _beavisObject != sceneObject) return; diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp index a409d765b4..3f7aa4abc9 100644 --- a/engines/cge/cge.cpp +++ b/engines/cge/cge.cpp @@ -50,13 +50,6 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription) DebugMan.addDebugChannel(kCGEDebugFile, "file", "CGE IO debug channel"); DebugMan.addDebugChannel(kCGEDebugEngine, "engine", "CGE Engine debug channel"); - _startupMode = 1; - _oldLev = 0; - _pocPtr = 0; - _quitFlag = false; - _showBoundariesFl = false; - _startGameSlot = -1; - _recentStep = -2; _bitmapPalette = nullptr; _pocLight = nullptr; _keyboard = nullptr; @@ -83,6 +76,42 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription) _miniShp = nullptr; _miniShpList = nullptr; _console = nullptr; + _sprTv = nullptr; + _sprK1 = nullptr; + _sprK2 = nullptr; + _sprK3 = nullptr; + _font = nullptr; + _vga = nullptr; + _sys = nullptr; + + _quitFlag = false; + _showBoundariesFl = false; + _music = true; + _dark = false; + _game = false; + _endGame = false; + for (int i = 0; i < 4; i++) + _flag[i] = false; + + _startupMode = 1; + _oldLev = 0; + _pocPtr = 0; + _startGameSlot = -1; + _recentStep = -2; + _lastFrame = 0; + _lastTick = 0; + _maxScene = 0; + _now = 1; + _lev = -1; + _mode = 0; + _gameCase2Cpt = 0; + _offUseCount = 0; + _volume[0] = 0; + _volume[1] = 0; + for (int i = 0; i < kPocketNX; i++) + _pocref[i] = -1; + + initSceneValues(); } void CGEEngine::initSceneValues() { @@ -98,17 +127,16 @@ void CGEEngine::initSceneValues() { } void CGEEngine::init() { - debugC(1, kCGEDebugEngine, "CGEEngine::setup()"); + debugC(1, kCGEDebugEngine, "CGEEngine::init()"); // Initialize fields - _lastFrame = 0; - _lastTick = 0; - _hero = NULL; - _shadow = NULL; - _miniScene = NULL; - _miniShp = NULL; - _miniShpList = NULL; - _sprite = NULL; + _hero = nullptr; + _shadow = nullptr; + _miniScene = nullptr; + _miniShp = nullptr; + _miniShpList = nullptr; + _sprite = nullptr; + _resman = new ResourceManager(); // Create debugger console @@ -117,12 +145,12 @@ void CGEEngine::init() { // Initialize engine objects _font = new Font(this, "CGE"); _text = new Text(this, "CGE"); - _talk = NULL; + _talk = nullptr; _vga = new Vga(this); _sys = new System(this); _pocLight = new PocLight(this); for (int i = 0; i < kPocketNX; i++) - _pocket[i] = NULL; + _pocket[i] = nullptr; _horzLine = new HorizLine(this); _infoLine = new InfoLine(this, kInfoW); _sceneLight = new SceneLight(this); @@ -137,30 +165,6 @@ void CGEEngine::init() { _sound = new Sound(this); _offUseCount = atoi(_text->getText(kOffUseCount)); - _music = true; - - for (int i = 0; i < kPocketNX; i++) - _pocref[i] = -1; - _volume[0] = 0; - _volume[1] = 0; - - initSceneValues(); - - _maxScene = 0; - _dark = false; - _game = false; - _endGame = false; - _now = 1; - _lev = -1; - _recentStep = -2; - - for (int i = 0; i < 4; i++) - _flag[i] = false; - - _mode = 0; - _soundOk = 1; - _sprTv = NULL; - _gameCase2Cpt = 0; _startGameSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1; } diff --git a/engines/cge/cge.h b/engines/cge/cge.h index 8c5ae29e18..a65069ff46 100644 --- a/engines/cge/cge.h +++ b/engines/cge/cge.h @@ -107,7 +107,6 @@ struct SavegameHeader { Graphics::Surface *thumbnail; int saveYear, saveMonth, saveDay; int saveHour, saveMinutes; - int totalFrames; }; extern const char *savegameStr; @@ -168,7 +167,6 @@ public: int _now; int _lev; int _mode; - int _soundOk; int _gameCase2Cpt; int _offUseCount; Dac *_bitmapPalette; diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index 260fd8997a..e738b6ebb3 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -195,7 +195,6 @@ bool CGEEngine::loadGame(int slotNumber, SavegameHeader *header, bool tiny) { debugC(1, kCGEDebugEngine, "CGEEngine::loadgame(%d, header, %s)", slotNumber, tiny ? "true" : "false"); Common::MemoryReadStream *readStream; - SavegameHeader saveHeader; if (slotNumber == -1) { // Loading the data for the initial game state @@ -231,6 +230,8 @@ bool CGEEngine::loadGame(int slotNumber, SavegameHeader *header, bool tiny) { return false; } else { // Found header + SavegameHeader saveHeader; + if (!readSavegameHeader(readStream, saveHeader)) { delete readStream; return false; @@ -397,7 +398,7 @@ void CGEEngine::syncGame(Common::SeekableReadStream *readStream, Common::WriteSt } } else { // Loading game - if (_soundOk == 1 && _mode == 0) { + if (_mode == 0) { // Skip Digital and Midi volumes, useless under ScummVM sndSetVolume(); } @@ -424,7 +425,7 @@ void CGEEngine::syncGame(Common::SeekableReadStream *readStream, Common::WriteSt } bool CGEEngine::readSavegameHeader(Common::InSaveFile *in, SavegameHeader &header) { - header.thumbnail = NULL; + header.thumbnail = nullptr; // Get the savegame version header.version = in->readByte(); @@ -1483,25 +1484,6 @@ bool CGEEngine::showTitle(const char *name) { selectPocket(-1); _vga->sunrise(_vga->_sysPal); - if (_mode < 2 && !_soundOk) { - _vga->copyPage(1, 2); - _vga->copyPage(0, 1); - _vga->_showQ->append(_mouse); - _mouse->on(); - for (; !_commandHandler->idle() || Vmenu::_addr;) { - mainLoop(); - if (_quitFlag) - return false; - } - - _mouse->off(); - _vga->_showQ->clear(); - _vga->copyPage(0, 2); - _soundOk = 2; - if (_music) - _midiPlayer->loadMidi(0); - } - if (_mode < 2) { // At this point the game originally set the protection variables // used by the copy protection check @@ -1540,7 +1522,7 @@ void CGEEngine::cge_main() { if (_horzLine) _horzLine->_flags._hide = true; - if (_music && _soundOk) + if (_music) _midiPlayer->loadMidi(0); if (_startGameSlot != -1) { diff --git a/engines/cge/fileio.cpp b/engines/cge/fileio.cpp index 4fcf9f8ad8..2b1f74db02 100644 --- a/engines/cge/fileio.cpp +++ b/engines/cge/fileio.cpp @@ -93,13 +93,11 @@ ResourceManager::~ResourceManager() { delete _buff[i]._page; } -uint16 ResourceManager::XCrypt(byte *buf, uint16 length) { +void ResourceManager::XCrypt(byte *buf, uint16 length) { byte *b = buf; for (uint16 i = 0; i < length; i++) *b++ ^= kCryptSeed; - - return kCryptSeed; } bool ResourceManager::seek(int32 offs, int whence) { @@ -118,7 +116,7 @@ uint16 ResourceManager::read(byte *buf, uint16 length) { } BtPage *ResourceManager::getPage(int level, uint16 pageId) { - debugC(1, kCGEDebugFile, "IoHand::getPage(%d, %d)", level, pageId); + debugC(1, kCGEDebugFile, "ResourceManager::getPage(%d, %d)", level, pageId); if (_buff[level]._pageNo != pageId) { int32 pos = pageId * kBtSize; @@ -142,7 +140,7 @@ BtPage *ResourceManager::getPage(int level, uint16 pageId) { } BtKeypack *ResourceManager::find(const char *key) { - debugC(1, kCGEDebugFile, "IoHand::find(%s)", key); + debugC(1, kCGEDebugFile, "ResourceManager::find(%s)", key); int lev = 0; uint16 nxt = kBtValRoot; diff --git a/engines/cge/fileio.h b/engines/cge/fileio.h index 803d6b2d58..059d2c9a44 100644 --- a/engines/cge/fileio.h +++ b/engines/cge/fileio.h @@ -86,13 +86,13 @@ class ResourceManager { uint16 catRead(byte *buf, uint16 length); Common::File *_catFile; Common::File *_datFile; - uint16 XCrypt(byte *buf, uint16 length); + void XCrypt(byte *buf, uint16 length); public: ResourceManager(); ~ResourceManager(); uint16 read(byte *buf, uint16 length); - bool seek(int32 offs, int whence = 0); + bool seek(int32 offs, int whence = SEEK_SET); BtKeypack *find(const char *key); bool exist(const char *name); diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp index f47b33bf16..c6099447d8 100644 --- a/engines/cine/anim.cpp +++ b/engines/cine/anim.cpp @@ -287,7 +287,7 @@ void AnimData::load(byte *d, int type, uint16 w, uint16 h, int16 file, _fileIdx = file; _frameIdx = frame; memset(_name, 0, sizeof(_name)); - strcpy(_name, n); + Common::strlcpy(_name, n, sizeof(_name)); _realWidth = w; switch (type) { diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp index 3b80a9c037..ce808e0f6a 100644 --- a/engines/cine/bg.cpp +++ b/engines/cine/bg.cpp @@ -48,7 +48,7 @@ byte loadCtFW(const char *ctName) { } if (currentCtName != ctName) - strcpy(currentCtName, ctName); + Common::strlcpy(currentCtName, ctName, sizeof(currentCtName)); ptr = dataPtr = readBundleFile(foundFileIdx); @@ -75,7 +75,7 @@ byte loadCtOS(const char *ctName) { } if (currentCtName != ctName) - strcpy(currentCtName, ctName); + Common::strlcpy(currentCtName, ctName, sizeof(currentCtName)); ptr = dataPtr = readBundleFile(foundFileIdx); diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 797bc38938..a4af8f2201 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -55,6 +55,14 @@ CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) _console = new CineConsole(this); g_cine = this; + + for (int i = 0; i < NUM_FONT_CHARS; i++) { + _textHandler.fontParamTable[i].characterIdx = 0; + _textHandler.fontParamTable[i].characterWidth = 0; + } + _restartRequested = false; + _preLoad = false; + _timerDelayMultiplier = 12; } CineEngine::~CineEngine() { diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index ab83594054..f6419ecafc 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -730,7 +730,7 @@ void FWRenderer::loadBg16(const byte *bg, const char *name, unsigned int idx) { assert(_background); - strcpy(_bgName, name); + Common::strlcpy(_bgName, name, sizeof(_bgName)); // Load the 16 color palette _backupPal.load(bg, kLowPalNumBytes, kLowPalFormat, kLowPalNumColors, CINE_BIG_ENDIAN); @@ -1403,7 +1403,7 @@ void OSRenderer::loadBg16(const byte *bg, const char *name, unsigned int idx) { assert(_bgTable[idx].bg); - strcpy(_bgTable[idx].name, name); + Common::strlcpy(_bgTable[idx].name, name, sizeof(_bgTable[idx].name)); // Load the 16 color palette _bgTable[idx].pal.load(bg, kLowPalNumBytes, kLowPalFormat, kLowPalNumColors, CINE_BIG_ENDIAN); @@ -1441,7 +1441,7 @@ void OSRenderer::loadBg256(const byte *bg, const char *name, unsigned int idx) { assert(_bgTable[idx].bg); - strcpy(_bgTable[idx].name, name); + Common::strlcpy(_bgTable[idx].name, name, sizeof(_bgTable[idx].name)); _bgTable[idx].pal.load(bg, kHighPalNumBytes, kHighPalFormat, kHighPalNumColors, CINE_LITTLE_ENDIAN); memcpy(_bgTable[idx].bg, bg + kHighPalNumBytes, _screenSize); } diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp index a1d9b49133..f3985c691e 100644 --- a/engines/cine/pal.cpp +++ b/engines/cine/pal.cpp @@ -62,9 +62,9 @@ int16 findPaletteFromName(const char *fileName) { uint16 position = 0; uint16 i; - strcpy(buffer, fileName); + Common::strlcpy(buffer, fileName, sizeof(buffer)); - while (position < strlen(fileName)) { + while (position < strlen(buffer)) { if (buffer[position] > 'a' && buffer[position] < 'z') { buffer[position] += 'A' - 'a'; } diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp index c55972bf56..30d9461a6a 100644 --- a/engines/cine/part.cpp +++ b/engines/cine/part.cpp @@ -47,7 +47,7 @@ void loadPart(const char *partName) { g_cine->_partFileHandle.readUint16BE(); // entry size if (currentPartName != partName) - strcpy(currentPartName, partName); + Common::strlcpy(currentPartName, partName, sizeof(currentPartName)); for (uint16 i = 0; i < g_cine->_partBuffer.size(); i++) { g_cine->_partFileHandle.read(g_cine->_partBuffer[i].partName, 14); diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index c02868d5b0..c0b0c1f5da 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -1419,19 +1419,19 @@ int FWScript::o1_loadNewPrcName() { switch (param1) { case 0: debugC(5, kCineDebugScript, "Line: %d: loadPrc(\"%s\")", _line, param2); - strcpy(newPrcName, param2); + Common::strlcpy(newPrcName, param2, sizeof(newPrcName)); break; case 1: debugC(5, kCineDebugScript, "Line: %d: loadRel(\"%s\")", _line, param2); - strcpy(newRelName, param2); + Common::strlcpy(newRelName, param2, sizeof(newRelName)); break; case 2: debugC(5, kCineDebugScript, "Line: %d: loadObject(\"%s\")", _line, param2); - strcpy(newObjectName, param2); + Common::strlcpy(newObjectName, param2, sizeof(newObjectName)); break; case 3: debugC(5, kCineDebugScript, "Line: %d: loadMsg(\"%s\")", _line, param2); - strcpy(newMsgName, param2); + Common::strlcpy(newMsgName, param2, sizeof(newMsgName)); break; } return 0; diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index e2d9d22e6f..069a4787ac 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -813,7 +813,7 @@ bool PCSoundFxPlayer::load(const char *song) { if (dot) { *dot = '\0'; } - strcat(instrument, _driver->getInstrumentExtension()); + Common::strlcat(instrument, _driver->getInstrumentExtension(), sizeof(instrument)); uint32 instrumentSize; _instrumentsData[i] = readBundleSoundFile(instrument, &instrumentSize); if (!_instrumentsData[i]) { diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index aa1c22c165..8687699a44 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -557,12 +557,20 @@ int16 selectSubObject(int16 x, int16 y, int16 param) { } } + if (selectedObject >= 20) + error("Invalid value for selectedObject: %d", selectedObject); return objListTab[selectedObject]; } -// TODO: Make separate functions for Future Wars's and Operation Stealth's version of this function, this is getting too messy -// TODO: Add support for using the different prepositions for different verbs (Doesn't work currently) void makeCommandLine() { + if (g_cine->getGameType() == Cine::GType_FW) + makeFWCommandLine(); + else + makeOSCommandLine(); +} + +// TODO: Add support for using the different prepositions for different verbs (Doesn't work currently) +void makeOSCommandLine() { uint16 x, y; commandVar1 = 0; @@ -578,28 +586,16 @@ void makeCommandLine() { int16 si; getMouseData(mouseUpdateStatus, &dummyU16, &x, &y); - - if (g_cine->getGameType() == Cine::GType_FW) { - si = selectSubObject(x, y + 8, -2); - } else { - si = selectSubObject(x, y + 8, -subObjectUseTable[playerCommand]); - } + si = selectSubObject(x, y + 8, -subObjectUseTable[playerCommand]); if (si < 0) { - if (g_cine->getGameType() == Cine::GType_OS) { - canUseOnObject = 0; - } else { // Future Wars - playerCommand = -1; - g_cine->_commandBuffer = ""; - } + canUseOnObject = 0; } else { - if (g_cine->getGameType() == Cine::GType_OS) { - if (si >= 8000) { - si -= 8000; - canUseOnObject = canUseOnItemTable[playerCommand]; - } else { - canUseOnObject = 0; - } + if (si >= 8000) { + si -= 8000; + canUseOnObject = canUseOnItemTable[playerCommand]; + } else { + canUseOnObject = 0; } commandVar3[0] = si; @@ -607,27 +603,21 @@ void makeCommandLine() { g_cine->_commandBuffer += " "; g_cine->_commandBuffer += g_cine->_objectTable[commandVar3[0]].name; g_cine->_commandBuffer += " "; - if (g_cine->getGameType() == Cine::GType_OS) { - g_cine->_commandBuffer += commandPrepositionTable[playerCommand]; - } else { // Future Wars - g_cine->_commandBuffer += defaultCommandPreposition; - } + g_cine->_commandBuffer += commandPrepositionTable[playerCommand]; } } - if (g_cine->getGameType() == Cine::GType_OS || !(playerCommand != -1 && choiceResultTable[playerCommand] == 2)) { - if (playerCommand == 2) { - getMouseData(mouseUpdateStatus, &dummyU16, &x, &y); - CursorMan.showMouse(false); - processInventory(x, y + 8); - playerCommand = -1; - commandVar1 = 0; - g_cine->_commandBuffer = ""; - CursorMan.showMouse(true); - } + if (playerCommand == 2) { + getMouseData(mouseUpdateStatus, &dummyU16, &x, &y); + CursorMan.showMouse(false); + processInventory(x, y + 8); + playerCommand = -1; + commandVar1 = 0; + g_cine->_commandBuffer = ""; + CursorMan.showMouse(true); } - if (g_cine->getGameType() == Cine::GType_OS && playerCommand != 2) { + if (playerCommand != 2) { if (playerCommand != -1 && canUseOnObject != 0) { // call use on sub object int16 si; @@ -665,7 +655,55 @@ void makeCommandLine() { } } - if (g_cine->getGameType() == Cine::GType_OS || !disableSystemMenu) { + isDrawCommandEnabled = 1; + renderer->setCommand(g_cine->_commandBuffer); +} + +// TODO: Add support for using the different prepositions for different verbs (Doesn't work currently) +void makeFWCommandLine() { + uint16 x, y; + + commandVar1 = 0; + commandVar2 = -10; + + if (playerCommand != -1) { + g_cine->_commandBuffer = defaultActionCommand[playerCommand]; + } else { + g_cine->_commandBuffer = ""; + } + + if ((playerCommand != -1) && (choiceResultTable[playerCommand] == 2)) { // need object selection? + int16 si; + + getMouseData(mouseUpdateStatus, &dummyU16, &x, &y); + si = selectSubObject(x, y + 8, -2); + + if (si < 0) { + playerCommand = -1; + g_cine->_commandBuffer = ""; + } else { + commandVar3[0] = si; + commandVar1 = 1; + g_cine->_commandBuffer += " "; + g_cine->_commandBuffer += g_cine->_objectTable[commandVar3[0]].name; + g_cine->_commandBuffer += " "; + g_cine->_commandBuffer += defaultCommandPreposition; + } + } + + if (!(playerCommand != -1 && choiceResultTable[playerCommand] == 2)) { + if (playerCommand == 2) { + getMouseData(mouseUpdateStatus, &dummyU16, &x, &y); + CursorMan.showMouse(false); + processInventory(x, y + 8); + playerCommand = -1; + commandVar1 = 0; + g_cine->_commandBuffer = ""; + CursorMan.showMouse(true); + } + } + + if (!disableSystemMenu) { isDrawCommandEnabled = 1; renderer->setCommand(g_cine->_commandBuffer); } diff --git a/engines/cine/various.h b/engines/cine/various.h index 04f2d47743..eb6312997d 100644 --- a/engines/cine/various.h +++ b/engines/cine/various.h @@ -37,6 +37,8 @@ void initLanguage(Common::Language lang); int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X, uint16 Y, uint16 width, bool recheckValue = false); void makeCommandLine(); +void makeFWCommandLine(); +void makeOSCommandLine(); void makeActionMenu(); void waitPlayerInput(); void setTextWindow(uint16 param1, uint16 param2, uint16 param3, uint16 param4); diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp index c63be30f77..80fb0e8a02 100644 --- a/engines/cruise/font.cpp +++ b/engines/cruise/font.cpp @@ -148,8 +148,6 @@ void initSystem() { preloadData[i].nofree = 0; } - lowMemory = 0; - doFade = 0; fadeFlag = 0; scroll = 0; diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index e727ac73cb..7af6b73238 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -606,7 +606,7 @@ int16 Op_InitializeState() { } int16 Op_GetlowMemory() { - return lowMemory; + return 0; } int16 Op_AniDir() { diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index a991c29583..a734db4b3b 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -182,11 +182,13 @@ static void syncFilesDatabase(Common::Serializer &s) { s.syncAsUint16LE(fe.resType); s.syncAsUint16LE(fe.height); - // TODO: Have a look at the saving/loading of this pointer + // Remember whether this file database was open or not. + // Upon loading, loadSavegameData uses this information + // in order to re-open the file databases accordingly. tmp = (fe.subData.ptr) ? 1 : 0; s.syncAsUint32LE(tmp); if (s.isLoading()) { - fe.subData.ptr = (uint8 *)tmp; + fe.subData.ptr = tmp ? (uint8 *)1 : 0; } s.syncAsSint16LE(fe.subData.index); @@ -195,11 +197,11 @@ static void syncFilesDatabase(Common::Serializer &s) { s.syncAsSint16LE(fe.subData.transparency); - // TODO: Have a look at the saving/loading of this pointer + // Treat fe.subData.ptrMask the same as fe.subData.ptr. tmp = (fe.subData.ptrMask) ? 1 : 0; s.syncAsUint32LE(tmp); if (s.isLoading()) { - fe.subData.ptrMask = (uint8 *)tmp; + fe.subData.ptrMask = tmp ? (uint8 *)1 : 0; } s.syncAsUint16LE(fe.subData.resourceType); @@ -806,7 +808,6 @@ Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName) } Common::Error loadSavegameData(int saveGameIdx) { - int lowMemorySave; Common::String saveName; cellStruct *currentcellHead; @@ -878,20 +879,19 @@ Common::Error loadSavegameData(int saveGameIdx) { lastAni[0] = 0; - lowMemorySave = lowMemory; - for (int i = 0; i < NUM_FILE_ENTRIES; i++) { if (filesDatabase[i].subData.ptr) { int j; int k; - for (j = i + 1; j < NUM_FILE_ENTRIES && filesDatabase[j].subData.ptr && !strcmp(filesDatabase[i].subData.name, filesDatabase[j].subData.name) && (filesDatabase[j].subData.index == (j - i)); j++) + for (j = i + 1; j < NUM_FILE_ENTRIES && + filesDatabase[j].subData.ptr && + !strcmp(filesDatabase[i].subData.name, filesDatabase[j].subData.name) && + (filesDatabase[j].subData.index == (j - i)); + j++) ; for (k = i; k < j; k++) { - if (filesDatabase[k].subData.ptrMask) - lowMemory = 0; - filesDatabase[k].subData.ptr = NULL; filesDatabase[k].subData.ptrMask = NULL; } @@ -908,7 +908,6 @@ Common::Error loadSavegameData(int saveGameIdx) { } i = j - 1; - lowMemory = lowMemorySave; } } diff --git a/engines/cruise/vars.cpp b/engines/cruise/vars.cpp index f7c74c8e6d..9a59c8a714 100644 --- a/engines/cruise/vars.cpp +++ b/engines/cruise/vars.cpp @@ -31,7 +31,6 @@ uint8 selectColor = 3; uint8 titleColor = 2; uint8 subColor = 5; -int16 lowMemory; int16 scroll; int16 switchPal; char cmdLine[90]; diff --git a/engines/cruise/vars.h b/engines/cruise/vars.h index 8bfcdc57d4..fe3f7d6303 100644 --- a/engines/cruise/vars.h +++ b/engines/cruise/vars.h @@ -59,7 +59,6 @@ extern uint8 selectColor; extern uint8 titleColor; extern uint8 subColor; -extern int16 lowMemory; extern int16 scroll; extern int16 switchPal; extern char cmdLine[90]; diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp index 2e3a4e2e44..14e9c33bdf 100644 --- a/engines/fullpipe/behavior.cpp +++ b/engines/fullpipe/behavior.cpp @@ -83,7 +83,7 @@ void BehaviorManager::updateBehaviors() { if (!_isActive) return; - debug(0, "BehaviorManager::updateBehaviors()"); + debug(4, "BehaviorManager::updateBehaviors()"); for (uint i = 0; i < _behaviors.size(); i++) { BehaviorInfo *beh = _behaviors[i]; @@ -122,7 +122,7 @@ void BehaviorManager::updateBehaviors() { } void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorEntry *entry) { - debug(0, "BehaviorManager::updateBehavior() %d", entry->_itemsCount); + debug(4, "BehaviorManager::updateBehavior() %d", entry->_itemsCount); for (int i = 0; i < entry->_itemsCount; i++) { BehaviorEntryInfo *bhi = entry->_items[i]; if (!(bhi->_flags & 1)) { @@ -144,7 +144,7 @@ void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorEntry * } void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, BehaviorEntry *bhe) { - debug(0, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic((byte *)ani->_objectName)); + debug(4, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic((byte *)ani->_objectName)); MessageQueue *mq = 0; @@ -236,7 +236,7 @@ void BehaviorInfo::clear() { } void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) { - debug(0, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName)); + debug(4, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName)); clear(); _itemsCount = 1; @@ -260,7 +260,7 @@ void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) { } void BehaviorInfo::initObjectBehavior(GameVar *var, Scene *sc, StaticANIObject *ani) { - debug(0, "BehaviorInfo::initObjectBehavior(%s)", transCyrillic((byte *)var->_varName)); + debug(4, "BehaviorInfo::initObjectBehavior(%s)", transCyrillic((byte *)var->_varName)); clear(); diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 33ae1e524a..f76a12fb2b 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -43,6 +43,8 @@ namespace Fullpipe { #define MV_LFT_OPEN 1048 #define MV_MAN_GOLADDER 451 #define MV_MAN_GOLADDER2 2844 +#define MV_MAN_HMRKICK 1028 +#define MV_MAN_HMRKICK_COINLESS 1445 #define MV_MAN_LIFTDOWN 1052 #define MV_MAN_LIFTUP 1051 #define MV_MAN_LOOKUP 4773 @@ -219,8 +221,11 @@ namespace Fullpipe { #define SC_MAINMENU 4620 #define SC_MAP 5222 #define SC_TITLES 5166 +#define SND_CMN_015 3139 #define SND_CMN_031 3516 #define SND_CMN_032 3517 +#define SND_CMN_054 4762 +#define SND_CMN_055 4763 #define SND_CMN_060 4921 #define SND_CMN_061 4922 #define SND_CMN_070 5199 @@ -266,6 +271,27 @@ namespace Fullpipe { #define TrubaLeft 474 #define TrubaUp 680 +// Main Menu +#define PIC_MNU_AUTHORS_L 4624 +#define PIC_MNU_CONTINUE_L 4626 +#define PIC_MNU_DEBUG_L 4632 +#define PIC_MNU_EXIT_L 4622 +#define PIC_MNU_LOAD_L 4628 +#define PIC_MNU_MUSICSLIDER_D 4914 +#define PIC_MNU_MUSICSLIDER_L 4915 +#define PIC_MNU_RESTART_L 5299 +#define PIC_MNU_SAVE_L 4630 +#define PIC_MNU_SLIDER_D 4913 +#define PIC_MNU_SLIDER_L 4912 + +// Query dialog +#define PIC_MEX_BGR 5300 +#define PIC_MEX_CANCEL 5302 +#define PIC_MEX_OK 5301 +#define PIC_MOV_BGR 5343 +#define PIC_MOV_CANCEL 5345 +#define PIC_MOV_OK 5344 + // Intro #define ANI_IN1MAN 5110 #define MSG_INTR_ENDINTRO 5139 @@ -887,20 +913,41 @@ namespace Fullpipe { #define MSG_SC18_SHOWGIRLJUMPTO 1499 #define MSG_SC18_SHOWMANJUMP 1510 #define MSG_SC18_SHOWMANJUMPTO 1508 +#define MV_BOY18_JUMPFROM 1478 #define MV_BOY18_JUMPTO 1481 +#define MV_GRL18_JUMPFROM 1485 +#define MV_GRL18_JUMPTO 1488 +#define MV_KSL_CALMDOWN 1476 +#define MV_KSL_INBOY 1491 +#define MV_KSL_INGIRL 1493 #define MV_KSL_INMAN 1504 +#define MV_KSL_JUMPBOY 1473 +#define MV_KSL_JUMPGIRL 1475 +#define MV_KSL_JUMPMAN 1509 #define MV_KSL_SWING 1460 #define MV_KSL_SWINGBOY 1462 #define MV_KSL_SWINGGIRL 1464 +#define MV_KSL_SWINGMAN 1502 +#define MV_MAN18_JUMPTOTRUBA 1511 +#define MV_MAN18_STANDKRESLO 1500 #define MV_WHR18_SPIN 1300 #define PIC_SC18_DOMIN 5184 #define PIC_SC18_LADDER1 1471 #define PIC_SC18_LADDER2 1472 #define PIC_SC18_LADDER3 3299 #define PIC_SC18_RTRUBA 1520 +#define QU_SC19_MANJUMP1 1516 +#define QU_SC19_MANJUMP2 1517 +#define QU_SC19_MANJUMP3 1518 #define SND_18_006 3906 #define SND_18_010 4994 +#define ST_KSL_BOY 1463 +#define ST_KSL_GIRL 1465 +#define ST_KSL_JUMPBOY 1492 +#define ST_KSL_JUMPGIRL 1494 #define ST_KSL_JUMPMAN 1505 +#define ST_KSL_MAN 1503 +#define ST_KSL_REACT 1474 // Scene 19 #define ANI_CORDIE 1529 @@ -1255,6 +1302,65 @@ namespace Fullpipe { #define QU_SC28_WMN_START 3452 #define ST_MAN28_RIGHT 4249 +// Scene 29 +#define ANI_ASS 2120 +#define ANI_PORTER 2082 +#define ANI_SHELL_GREEN 2116 +#define ANI_SHELL_RED 2130 +#define ANI_SHOOTER1 2108 +#define ANI_SHOOTER2 2111 +#define MSG_SC29_DISABLEPORTER 2097 +#define MSG_SC29_DISABLERIDEBACK 2106 +#define MSG_SC29_ENABLEPORTER 2096 +#define MSG_SC29_ENABLERIDEBACK 2105 +#define MSG_SC29_LAUGH 4760 +#define MSG_SC29_SHOOTGREEN 2119 +#define MSG_SC29_SHOOTRED 2137 +#define MSG_SC29_SHOWLASTGREEN 2730 +#define MSG_SC29_SHOWLASTRED 2731 +#define MSG_SC29_STOPRIDE 2107 +#define MV_ASS_HITGREEN 2138 +#define MV_ASS_HITRED 2139 +#define MV_BRDCMN_GOR 4735 +#define MV_MAN29_BEND 2091 +#define MV_MAN29_HIT 2088 +#define MV_MAN29_JUMP 2090 +#define MV_MAN29_RUN 2095 +#define MV_MAN29_STANDUP 2092 +#define MV_MAN29_STANDUP_NORM 2093 +#define MV_PTR_MOVEFAST 2102 +#define MV_SHG_HITASS 2151 +#define MV_SHG_HITMAN 2147 +#define MV_SHG_NORM 2117 +#define MV_SHR_HITASS 2152 +#define MV_SHR_HITMAN 2149 +#define MV_SHR_NORM 2131 +#define MV_STR1_SHOOT 2109 +#define MV_STR2_SHOOT 2112 +#define PIC_SC29_LTRUBA 2081 +#define QU_SC29_BRD1 4741 +#define QU_SC29_BRD2 4742 +#define QU_SC29_BRDOUT1 4743 +#define QU_SC29_BRDOUT2 4744 +#define QU_SC29_ESCAPE 2129 +#define QU_SC29_MANFROM_L 2101 +#define QU_SC29_MANFROM_R 2104 +#define QU_SC29_MANTO_L 2103 +#define QU_SC29_MANTO_R 2100 +#define SND_29_014 4348 +#define SND_29_027 4757 +#define SND_29_028 4758 +#define SND_29_029 4759 +#define ST_ASS_NORM 2122 +#define ST_BRDCMN_GOR 4734 +#define ST_BRDCMN_RIGHT 4732 +#define ST_MAN29_RUNR 2140 +#define ST_MAN29_SITR 2141 +#define ST_STR1_RIGHT 2143 +#define ST_STR2_RIGHT 2144 +#define ST_STR1_STAND 2110 +#define ST_STR2_STAND 2113 + // Scene 30 #define ANI_LEG 2322 #define MSG_SC30_UPDATEPATH 2358 diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 4446af7b60..5369c05de7 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -71,6 +71,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _flgSoundList = true; _sfxVolume = 0; + _musicVolume = 0; _inputController = 0; _inputDisabled = false; @@ -95,6 +96,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _gamePaused = false; _inputArFlag = false; _recordEvents = false; + _mainMenu_debugEnabled = false; _flgGameIsRunning = true; @@ -102,6 +104,18 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _musicAllowed = -1; _musicGameVar = 0; + _musicMinDelay = 0; + _musicMaxDelay = 0; + _musicLocal = 0; + _trackStartDelay = 0; + + memset(_sceneTracks, 0, sizeof(_sceneTracks)); + memset(_trackName, 0, sizeof(_trackName)); + memset(_sceneTracksCurrentTrack, 0, sizeof(_sceneTracksCurrentTrack)); + + _numSceneTracks = 0; + _sceneTrackHasSequence = false; + _sceneTrackIsPlaying = false; _aniMan = 0; _aniMan2 = 0; @@ -190,6 +204,10 @@ void FullpipeEngine::initialize() { _mgm = new MGM; } +void FullpipeEngine::restartGame() { + warning("STUB: FullpipeEngine::restartGame()"); +} + Common::Error FullpipeEngine::run() { const Graphics::PixelFormat format(2, 5, 6, 5, 0, 11, 5, 0, 0); // Initialize backend diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 17a771bd5d..27505252ab 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -91,6 +91,7 @@ public: GUI::Debugger *getDebugger() { return _console; } void initialize(); + void restartGame(); void setMusicAllowed(int val) { _musicAllowed = val; } @@ -125,6 +126,7 @@ public: bool _flgGameIsRunning; bool _inputArFlag; bool _recordEvents; + bool _mainMenu_debugEnabled; Common::Rect _sceneRect; int _sceneWidth; @@ -149,18 +151,32 @@ public: int _currSoundListCount; bool _soundEnabled; bool _flgSoundList; + char _sceneTracks[10][260]; + int _numSceneTracks; + bool _sceneTrackHasSequence; + int _musicMinDelay; + int _musicMaxDelay; + int _musicLocal; + char _trackName[2600]; + int _trackStartDelay; + char _sceneTracksCurrentTrack[260]; + bool _sceneTrackIsPlaying; void stopAllSounds(); void toggleMute(); void playSound(int id, int flag); void playTrack(GameVar *sceneVar, const char *name, bool delayed); + int getSceneTrack(); void startSceneTrack(); + void startSoundStream1(char *trackName); void stopSoundStream2(); void stopAllSoundStreams(); void stopAllSoundInstances(int id); void updateSoundVolume(); + void setMusicVolume(int vol); int _sfxVolume; + int _musicVolume; GlobalMessageQueueList *_globalMessageQueueList; MessageHandler *_messageHandlers; @@ -296,6 +312,7 @@ public: GameVar *_musicGameVar; Audio::SoundHandle _sceneTrackHandle; + public: bool _isSaveAllowed; diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index e172b9b0f2..d9f7327a6b 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -272,7 +272,7 @@ bool preloadCallback(PreloadItem &pre, int flag) { g_fp->_currSoundList1[0] = g_fp->accessScene(SC_COMMON)->_soundList; } - g_vars->scene18_var01 = 0; + g_vars->scene18_inScene18p1 = false; if ((pre.preloadId1 != SC_18 || pre.sceneId != SC_19) && (pre.preloadId1 != SC_19 || (pre.sceneId != SC_18 && pre.sceneId != SC_19))) { if (g_fp->_scene3) { @@ -284,7 +284,7 @@ bool preloadCallback(PreloadItem &pre, int flag) { } else { scene19_setMovements(g_fp->accessScene(pre.preloadId1), pre.keyCode); - g_vars->scene18_var01 = 1; + g_vars->scene18_inScene18p1 = true; if (pre.preloadId1 == SC_18) { g_fp->_gameLoader->saveScenePicAniInfos(SC_18); diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 137af86f48..7c66a9a747 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -90,7 +90,16 @@ Background::Background() { } Background::~Background() { - warning("STUB: Background::~Background()"); + _picObjList.clear(); + + for (int i = 0; i < _bigPictureArray1Count; i++) { + for (int j = 0; j < _bigPictureArray2Count; j++) + delete _bigPictureArray[i][j]; + + free(_bigPictureArray[i]); + } + + free(_bigPictureArray); } bool Background::load(MfcArchive &file) { @@ -159,7 +168,9 @@ PictureObject::PictureObject() { } PictureObject::~PictureObject() { - warning("STUB: PictureObject::~PictureObject()"); + delete _picture; + _pictureObject2List->clear(); + delete _pictureObject2List; } PictureObject::PictureObject(PictureObject *src) : GameObject(src) { diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp index 0678d15368..7c97461a24 100644 --- a/engines/fullpipe/input.cpp +++ b/engines/fullpipe/input.cpp @@ -275,6 +275,8 @@ void FullpipeEngine::updateCursorCommon() { } void FullpipeEngine::initArcadeKeys(const char *varname) { + _arcadeKeys.clear(); + GameVar *var = getGameLoaderGameVar()->getSubVarByName(varname)->getSubVarByName("KEYPOS"); if (!var) @@ -294,6 +296,37 @@ void FullpipeEngine::initArcadeKeys(const char *varname) { } } +void FullpipeEngine::processArcade(ExCommand *cmd) { + if (!g_fp->_aniMan2) + return; + + int idx; + + if (cmd->_sceneClickX <= g_fp->_aniMan2->_ox) { + for (idx = (int)_arcadeKeys.size() - 1; idx >= 0; idx--) { + if (_arcadeKeys[idx]->x < g_fp->_aniMan2->_ox) + break; + } + + if (idx < 0) + return; + } else { + for (idx = 0; idx < (int)_arcadeKeys.size(); idx++) { + if (_arcadeKeys[idx]->x > g_fp->_aniMan2->_ox) + break; + } + + if (idx >= (int)_arcadeKeys.size()) + return; + } + + cmd->_sceneClickX = _arcadeKeys[idx]->x; + cmd->_sceneClickY = _arcadeKeys[idx]->y; + + cmd->_x = cmd->_sceneClickX - g_fp->_sceneRect.left; + cmd->_y = cmd->_sceneClickY - g_fp->_sceneRect.top; +} + void FullpipeEngine::setArcadeOverlay(int picId) { Common::Point point; Common::Point point2; diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp index 6b6ceb6eeb..84e9688e30 100644 --- a/engines/fullpipe/interaction.cpp +++ b/engines/fullpipe/interaction.cpp @@ -56,7 +56,9 @@ bool canInteractAny(GameObject *obj1, GameObject *obj2, int invId) { } InteractionController::~InteractionController() { - warning("STUB: InteractionController::~InteractionController()"); + _interactions.clear(); + + removeMessageHandler(124, -1); } bool InteractionController::load(MfcArchive &file) { @@ -427,7 +429,14 @@ Interaction::Interaction() { } Interaction::~Interaction() { - warning("STUB: Interaction::~Interaction()"); + if (_messageQueue) { + while (_messageQueue->getExCommandByIndex(0)) + _messageQueue->deleteExCommandByIndex(0, 1); + } + + delete _messageQueue; + + free(_actionName); } bool Interaction::load(MfcArchive &file) { diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp index cfe8adf86f..e79f9c54df 100644 --- a/engines/fullpipe/inventory.cpp +++ b/engines/fullpipe/inventory.cpp @@ -447,6 +447,15 @@ int Inventory2::getHoveredItem(Common::Point *point) { return 0; } +void Inventory2::clear() { + unselectItem(0); + + for (uint i = 0; i < _inventoryItems.size(); i++) + getInventoryPoolItemFieldCById(_inventoryItems[i]->itemId); + + _inventoryItems.clear(); +} + void FullpipeEngine::getAllInventory() { Inventory2 *inv = getGameLoaderInventory(); diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h index 833cccc355..46b55c5669 100644 --- a/engines/fullpipe/inventory.h +++ b/engines/fullpipe/inventory.h @@ -129,6 +129,8 @@ class Inventory2 : public Inventory { bool unselectItem(bool flag); void draw(); + + void clear(); }; } // End of namespace Fullpipe diff --git a/engines/fullpipe/messagehandlers.cpp b/engines/fullpipe/messagehandlers.cpp index b8e7b5c1db..15aa78d342 100644 --- a/engines/fullpipe/messagehandlers.cpp +++ b/engines/fullpipe/messagehandlers.cpp @@ -34,11 +34,69 @@ namespace Fullpipe { void global_messageHandler_KickStucco() { - warning("STUB: global_messageHandler_KickStucco()"); + Movement *mov = g_fp->_aniMan->getMovementById(MV_MAN_HMRKICK); + int end = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size(); + bool flip = false; + + for (int i = 0; i < end; i++) { + ExCommand *ex = mov->getDynamicPhaseByIndex(i)->_exCommand; + + if (ex) + if (ex->_messageKind == 35) + if (ex->_messageNum == SND_CMN_015) { + if (flip) { + ex->_messageNum = SND_CMN_055; + } else { + ex->_messageNum = SND_CMN_054; + flip = true; + } + } + } + + mov = g_fp->_aniMan->getMovementById(MV_MAN_HMRKICK_COINLESS); + end = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size(); + flip = false; + + for (int i = 0; i < end; i++) { + ExCommand *ex = mov->getDynamicPhaseByIndex(i)->_exCommand; + + if (ex) + if (ex->_messageKind == 35) + if (ex->_messageNum == SND_CMN_015) { + if (flip) { + ex->_messageNum = SND_CMN_055; + } else { + ex->_messageNum = SND_CMN_054; + flip = true; + } + } + } } void global_messageHandler_KickMetal() { - warning("STUB: global_messageHandler_KickMetal()"); + Movement *mov = g_fp->_aniMan->getMovementById(MV_MAN_HMRKICK); + int end = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size(); + + for (int i = 0; i < end; i++) { + ExCommand *ex = mov->getDynamicPhaseByIndex(i)->_exCommand; + + if (ex) + if (ex->_messageKind == 35) + if (ex->_messageNum == SND_CMN_054 || ex->_messageNum == SND_CMN_055) + ex->_messageNum = SND_CMN_015; + } + + mov = g_fp->_aniMan->getMovementById(MV_MAN_HMRKICK_COINLESS); + end = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size(); + + for (int i = 0; i < end; i++) { + ExCommand *ex = mov->getDynamicPhaseByIndex(i)->_exCommand; + + if (ex) + if (ex->_messageKind == 35) + if (ex->_messageNum == SND_CMN_054 || ex->_messageNum == SND_CMN_055) + ex->_messageNum = SND_CMN_015; + } } int global_messageHandler1(ExCommand *cmd) { @@ -528,9 +586,9 @@ int global_messageHandler4(ExCommand *cmd) { ExCommand2 *cmd2 = (ExCommand2 *)cmd; if (cmd->_excFlags & 1) { - ani->startAnimSteps(cmd->_messageNum, 0, cmd->_x, cmd->_y, cmd2->_points, cmd2->_pointsSize >> 3, flags); + ani->startAnimSteps(cmd->_messageNum, 0, cmd->_x, cmd->_y, cmd2->_points, cmd2->_pointsSize, flags); } else { - ani->startAnimSteps(cmd->_messageNum, cmd->_parId, cmd->_x, cmd->_y, cmd2->_points, cmd2->_pointsSize >> 3, flags); + ani->startAnimSteps(cmd->_messageNum, cmd->_parId, cmd->_x, cmd->_y, cmd2->_points, cmd2->_pointsSize, flags); } break; } diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index 9c8f5ac4e2..8257d1459f 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -699,6 +699,10 @@ void GlobalMessageQueueList::addMessageQueue(MessageQueue *msg) { push_back(msg); } +void clearGlobalMessageQueueList() { + g_fp->_globalMessageQueueList->clear(); +} + void clearGlobalMessageQueueList1() { clearMessages(); diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h index da579d58c0..e6f7f05150 100644 --- a/engines/fullpipe/messages.h +++ b/engines/fullpipe/messages.h @@ -193,6 +193,7 @@ void clearMessageHandlers(); void processMessages(); void updateGlobalMessageQueue(int id, int objid); void clearMessages(); +void clearGlobalMessageQueueList(); void clearGlobalMessageQueueList1(); bool chainQueue(int queueId, int flags); diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 603aaff026..459c714984 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -21,12 +21,13 @@ */ #include "fullpipe/fullpipe.h" -#include "fullpipe/modal.h" #include "fullpipe/messages.h" #include "fullpipe/constants.h" #include "fullpipe/motion.h" #include "fullpipe/scenes.h" #include "fullpipe/gameloader.h" +#include "fullpipe/statics.h" +#include "fullpipe/modal.h" #include "fullpipe/constants.h" @@ -718,7 +719,7 @@ bool ModalCredits::init(int counterdiff) { g_fp->_modalObject = menu; - menu->_field_34 = 1; + menu->_mfield_34 = 1; } return true; @@ -750,9 +751,513 @@ void ModalCredits::update() { } ModalMainMenu::ModalMainMenu() { - warning("STUB: ModalMainMenu::ModalMainMenu()"); + _areas.clear(); + + _lastArea = 0; + _hoverAreaId = 0; + _mfield_34 = 0; + _scene = g_fp->accessScene(SC_MAINMENU); + _debugKeyCount = 0; + _sliderOffset = 0; + _screct.left = g_fp->_sceneRect.left; + _screct.top = g_fp->_sceneRect.top; + _screct.right = g_fp->_sceneRect.right; + _screct.bottom = g_fp->_sceneRect.bottom; + + if (g_fp->_currentScene) { + _bgX = g_fp->_currentScene->_x; + _bgY = g_fp->_currentScene->_y; + } else { + _bgX = 0; + _bgY = 0; + } + + g_fp->_sceneRect.top = 0; + g_fp->_sceneRect.left = 0; + g_fp->_sceneRect.right = 800; + g_fp->_sceneRect.bottom = 600; + + MenuArea *area; + + area = new MenuArea(); + area->picIdL = PIC_MNU_EXIT_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + + area = new MenuArea(); + area->picIdL = PIC_MNU_CONTINUE_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + + if (isSaveAllowed()) { + area = new MenuArea(); + area->picIdL = PIC_MNU_SAVE_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + } + + area = new MenuArea(); + area->picIdL = PIC_MNU_LOAD_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + + area = new MenuArea(); + area->picIdL = PIC_MNU_RESTART_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + + area = new MenuArea(); + area->picIdL = PIC_MNU_AUTHORS_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + + area = new MenuArea(); + area->picIdL = PIC_MNU_SLIDER_L; + area->picObjD = _scene->getPictureObjectById(PIC_MNU_SLIDER_D, 0); + area->picObjD->_flags |= 4; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + _menuSliderIdx = _areas.size() - 1; + + area = new MenuArea(); + area->picIdL = PIC_MNU_MUSICSLIDER_L; + area->picObjD = _scene->getPictureObjectById(PIC_MNU_MUSICSLIDER_D, 0); + area->picObjD->_flags |= 4; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); + _musicSliderIdx = _areas.size() - 1; + + if (g_fp->_mainMenu_debugEnabled) + enableDebugMenuButton(); + + setSliderPos(); +} - _field_34 = 0; +void ModalMainMenu::update() { + _scene->draw(); +} + +bool ModalMainMenu::handleMessage(ExCommand *message) { + if (message->_messageKind != 17) + return false; + + Common::Point point; + + if (message->_messageNum == 29) { + point.x = message->_x; + point.y = message->_y; + + int numarea = checkHover(point); + + if (numarea >= 0) { + if (numarea == _menuSliderIdx) { + _lastArea = _areas[_menuSliderIdx]; + _sliderOffset = _lastArea->picObjL->_ox - point.x; + + return false; + } + + if (numarea == _musicSliderIdx) { + _lastArea = _areas[_musicSliderIdx]; + _sliderOffset = _lastArea->picObjL->_ox - point.x; + + return false; + } + + _hoverAreaId = _areas[numarea]->picIdL; + } + + return false; + } + + if (message->_messageNum == 30) { + if (_lastArea) + _lastArea = 0; + + return false; + } + + if (message->_messageNum != 36) + return false; + + if (message->_keyCode == 27) + _hoverAreaId = PIC_MNU_CONTINUE_L; + else + enableDebugMenu(message->_keyCode); + + return false; +} + +bool ModalMainMenu::init(int counterdiff) { + switch (_hoverAreaId) { + case PIC_MNU_RESTART_L: + g_fp->restartGame(); + + if (this == g_fp->_modalObject) + return false; + + delete this; + break; + + case PIC_MNU_EXIT_L: + { + ModalQuery *mq = new ModalQuery(); + + g_fp->_modalObject = mq; + + mq->_parentObj = this; + mq->create(_scene, (PictureObject *)_scene->_picObjList[0], PIC_MEX_BGR); + + _hoverAreaId = 0; + + return true; + } + + case PIC_MNU_DEBUG_L: + g_fp->_gameLoader->unloadScene(SC_MAINMENU); + g_fp->_sceneRect = _screct; + + if (!g_fp->_currentScene) + error("ModalMainMenu::init: Bad state"); + + g_fp->_currentScene->_x = _bgX; + g_fp->_currentScene->_y = _bgY; + + g_fp->_gameLoader->preloadScene(g_fp->_currentScene->_sceneId, SC_DBGMENU); + + return false; + + case PIC_MNU_CONTINUE_L: + if (!_mfield_34) { + g_fp->_gameLoader->unloadScene(SC_MAINMENU); + g_fp->_sceneRect = _screct; + + if (g_fp->_currentScene) { + g_fp->_currentScene->_x = _bgX; + g_fp->_currentScene->_y = _bgY; + } + + return false; + } + + g_fp->restartGame(); + + if (this == g_fp->_modalObject) + return false; + + delete this; + break; + + case PIC_MNU_AUTHORS_L: + g_fp->_modalObject = new ModalCredits(); + g_fp->_modalObject->_parentObj = this; + + _hoverAreaId = 0; + + return true; + + case PIC_MNU_SAVE_L: + case PIC_MNU_LOAD_L: + { + ModalSaveGame *sg = new ModalSaveGame(); + + g_fp->_modalObject = sg; + g_fp->_modalObject->_parentObj = _parentObj; + + int mode = 0; + if (_hoverAreaId == PIC_MNU_SAVE_L) + mode = 1; + + sg->setup(g_fp->accessScene(SC_MAINMENU), mode); + sg->setScene(g_fp->accessScene(SC_MAINMENU)); + + sg->_rect = _screct; + sg->_oldBgX = _bgX; + sg->_oldBgY = _bgY; + + delete this; + } + + break; + + default: + if (_lastArea) { + updateSliderPos(); + } else { + g_fp->_cursorId = PIC_CSR_DEFAULT; + + int idx = checkHover(g_fp->_mouseScreenPos); + + if (idx < 0) + goto LABEL_40; + + g_fp->_cursorId = PIC_CSR_DEFAULT; + + if (idx != this->_menuSliderIdx && idx != this->_musicSliderIdx ) + goto LABEL_40; + } + + g_fp->_cursorId = PIC_CSR_LIFT; + + LABEL_40: + g_fp->setCursor(g_fp->_cursorId); + + updateVolume(); + + return true; + } + + return true; +} + +void ModalMainMenu::updateVolume() { + if (g_fp->_soundEnabled ) { + for (int s = 0; s < g_fp->_currSoundListCount; s++) + for (int i = 0; i < g_fp->_currSoundList1[s]->getCount(); i++) { + updateSoundVolume(g_fp->_currSoundList1[s]->getSoundByIndex(i)); + } + } +} + +void ModalMainMenu::updateSoundVolume(Sound *snd) { + if (!snd->_objectId) + return; + + StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(snd->_objectId, -1); + if (!ani) + return; + + int a, b; + + if (ani->_ox >= _screct.left) { + int par, pan; + + if (ani->_ox <= _screct.right) { + int dx; + + if (ani->_oy <= _screct.bottom) { + if (ani->_oy >= _screct.top) { + snd->setPanAndVolume(g_fp->_sfxVolume, 0); + + return; + } + dx = _screct.top - ani->_oy; + } else { + dx = ani->_oy - _screct.bottom; + } + + par = 0; + + if (dx > 800) { + snd->setPanAndVolume(-3500, 0); + return; + } + + pan = -3500; + a = g_fp->_sfxVolume - (-3500); + b = 800 - dx; + } else { + int dx = ani->_ox - _screct.right; + + if (dx > 800) { + snd->setPanAndVolume(-3500, 0); + return; + } + + pan = -3500; + par = dx * (-3500) / -800; + a = g_fp->_sfxVolume - (-3500); + b = 800 - dx; + } + + int32 pp = b * a; //(0x51EB851F * b * a) >> 32) >> 8; // TODO FIXME + + snd->setPanAndVolume(pan + (pp >> 31) + pp, par); + + return; + } + + int dx = _screct.left - ani->_ox; + if (dx <= 800) { + int32 s = 0x51EB851F * (800 - dx) * (g_fp->_sfxVolume - (-3500)); // TODO FIXME + int32 p = -3500 + (s >> 31) + (s >> 8); + + if (p > g_fp->_sfxVolume) + p = g_fp->_sfxVolume; + + snd->setPanAndVolume(p, dx * (-3500) / 800); + } else { + snd->setPanAndVolume(-3500, 0); + } + + warning("STUB: ModalMainMenu::updateSoundVolume()"); +} + +void ModalMainMenu::updateSliderPos() { + if (_lastArea->picIdL == PIC_MNU_SLIDER_L) { + int x = g_fp->_mouseScreenPos.x + _sliderOffset; + + if (x >= 65) { + if (x > 238) + x = 238; + } else { + x = 65; + } + + _lastArea->picObjD->setOXY(x, _lastArea->picObjD->_oy); + _lastArea->picObjL->setOXY(x, _lastArea->picObjD->_oy); + + int vol = 1000 * (3 * x - 195); + g_fp->_sfxVolume = vol / 173 - 3000; + + if (!(vol / 173)) + g_fp->_sfxVolume = -10000; + + g_fp->updateSoundVolume(); + } else if (_lastArea->picIdL == PIC_MNU_MUSICSLIDER_L) { + int x = g_fp->_mouseScreenPos.x + _sliderOffset; + + if (x >= 65) { + if (x > 238) + x = 238; + } else { + x = 65; + } + + _lastArea->picObjD->setOXY(x, _lastArea->picObjD->_oy); + _lastArea->picObjL->setOXY(x, _lastArea->picObjD->_oy); + + g_fp->setMusicVolume(255 * (x - 65) / 173); + } +} + +int ModalMainMenu::checkHover(Common::Point &point) { + for (uint i = 0; i < _areas.size(); i++) { + if (_areas[i]->picObjL->isPixelHitAtPos(point.x, point.y)) { + _areas[i]->picObjL->_flags |= 4; + + return i; + } else { + _areas[i]->picObjL->_flags &= 0xFFFB; + } + } + + if (isOverArea(_areas[_menuSliderIdx]->picObjL, &point)) { + _areas[_menuSliderIdx]->picObjL->_flags |= 4; + + return _menuSliderIdx; + } + + if (isOverArea(_areas[_musicSliderIdx]->picObjL, &point)) { + _areas[_musicSliderIdx]->picObjL->_flags |= 4; + + return _musicSliderIdx; + } + + return -1; +} + +bool ModalMainMenu::isOverArea(PictureObject *obj, Common::Point *point) { + Common::Point p; + + obj->getDimensions(&p); + + int left = point->x - 8; + int right = point->x + 12; + int down = point->y - 11; + int up = point->y + 9; + + if (left >= obj->_ox && right < obj->_ox + p.x && down >= obj->_oy && up < obj->_oy + p.y) + return true; + + return false; +} + +bool ModalMainMenu::isSaveAllowed() { + if (!g_fp->_isSaveAllowed) + return false; + + if (g_fp->_aniMan->_flags & 0x100) + return false; + + for (Common::Array<MessageQueue *>::iterator s = g_fp->_globalMessageQueueList->begin(); s != g_fp->_globalMessageQueueList->end(); ++s) { + if (!(*s)->_isFinished && ((*s)->getFlags() & 1)) + return false; + } + + return true; +} + +void ModalMainMenu::enableDebugMenu(char c) { + const char deb[] = "DEBUGER"; + + if (c == deb[_debugKeyCount]) { + _debugKeyCount++; + + if (deb[_debugKeyCount] ) + return; + + enableDebugMenuButton(); + } + + _debugKeyCount = 0; +} + +void ModalMainMenu::enableDebugMenuButton() { + MenuArea *area; + + for (uint i = 0; i < _areas.size(); i++) + if (_areas[i]->picIdL == PIC_MNU_DEBUG_L) + return; + + area = new MenuArea(); + area->picIdL = PIC_MNU_DEBUG_L; + area->picObjD = 0; + area->picObjL = _scene->getPictureObjectById(area->picIdL, 0); + area->picObjL->_flags &= 0xFFFB; + _areas.push_back(area); +} + +void ModalMainMenu::setSliderPos() { + int x = 173 * (g_fp->_sfxVolume + 3000) / 3000 + 65; + PictureObject *obj = _areas[_menuSliderIdx]->picObjD; + + if (x >= 65) { + if (x > 238) + x = 238; + } else { + x = 65; + } + + obj->setOXY(x, obj->_oy); + _areas[_menuSliderIdx]->picObjL->setOXY(x, obj->_oy); + + x = 173 * g_fp->_musicVolume / 255 + 65; + obj = _areas[_musicSliderIdx]->picObjD; + + if (x >= 65) { + if (x > 238) + x = 238; + } else { + x = 65; + } + + obj->setOXY(x, obj->_oy); + _areas[_musicSliderIdx]->picObjL->setOXY(x, obj->_oy); } ModalHelp::ModalHelp() { @@ -816,6 +1321,222 @@ void ModalHelp::launch() { } } +ModalQuery::ModalQuery() { + _picObjList = 0; + _bg = 0; + _okBtn = 0; + _cancelBtn = 0; + _queryResult = -1; +} + +ModalQuery::~ModalQuery() { + _bg->_flags &= 0xFFFB; + _cancelBtn->_flags &= 0xFFFB; + _okBtn->_flags &= 0xFFFB; +} + +bool ModalQuery::create(Scene *sc, PictureObject *picObjList, int id) { + if (id == PIC_MEX_BGR) { + _bg = sc->getPictureObjectById(PIC_MEX_BGR, 0); + + if (!_bg) + return false; + + _okBtn = sc->getPictureObjectById(PIC_MEX_OK, 0); + + if (!_okBtn) + return false; + + _cancelBtn = sc->getPictureObjectById(PIC_MEX_CANCEL, 0); + + if (!_cancelBtn) + return 0; + } else { + if (id != PIC_MOV_BGR) + return false; + + _bg = sc->getPictureObjectById(PIC_MOV_BGR, 0); + + if (!_bg) + return false; + + _okBtn = sc->getPictureObjectById(PIC_MOV_OK, 0); + + if (!_okBtn) + return false; + + _cancelBtn = sc->getPictureObjectById(PIC_MOV_CANCEL, 0); + + if (!_cancelBtn) + return false; + } + + _queryResult = -1; + _picObjList = picObjList; + + return true; +} + +void ModalQuery::update() { + if (_picObjList) + _picObjList->draw(); + + _bg->draw(); + + if (_okBtn->_flags & 4) + _okBtn->draw(); + + if (_cancelBtn->_flags & 4) + _cancelBtn->draw(); +} + +bool ModalQuery::handleMessage(ExCommand *cmd) { + if (cmd->_messageKind == 17) { + if (cmd->_messageNum == 29) { + if (_okBtn->isPointInside(g_fp->_mouseScreenPos.x, g_fp->_mouseScreenPos.y)) { + _queryResult = 1; + + return false; + } + + if (_cancelBtn->isPointInside(g_fp->_mouseScreenPos.x, g_fp->_mouseScreenPos.y)) + _queryResult = 0; + } else if (cmd->_messageNum == 36 && cmd->_keyCode == 27) { + _queryResult = 0; + + return false; + } + } + + return false; +} + +bool ModalQuery::init(int counterdiff) { + if (_okBtn->isPointInside(g_fp->_mouseScreenPos.x, g_fp->_mouseScreenPos.y)) + _okBtn->_flags |= 4; + else + _okBtn->_flags &= 0xFFFB; + + if (_cancelBtn->isPointInside(g_fp->_mouseScreenPos.x, g_fp->_mouseScreenPos.y)) + _cancelBtn->_flags |= 4; + else + _cancelBtn->_flags &= 0xFFFB; + + if (_queryResult == -1) { + return true; + } else { + if (_bg->_id == PIC_MEX_BGR) { + _cancelBtn->_flags &= 0xFFFB; + _okBtn->_flags &= 0xFFFB; + + if (_queryResult == 1) { + warning("STUB: ModalQuery::init()"); + //sceneFade(g_vrtDrawHandle, (Scene *)this->_picObjList, 0); + + //if (inputArFlag) { + // g_needRestart = 1; + // return 0; + //} + //SendMessageA(hwndCallback, WM_DESTROY, 0, 0); + } + } + } + + return false; +} + +ModalSaveGame::ModalSaveGame() { + _oldBgX = 0; + _oldBgY = 0; + + _bgr = 0; + _okD = 0; + _okL = 0; + _cancelD = 0; + _cancelL = 0; + _emptyD = 0; + _emptyL = 0; + _queryRes = -1; + _rect = g_fp->_sceneRect; + _queryDlg = 0; + _mode = 1; +} + +ModalSaveGame::~ModalSaveGame() { + g_fp->_sceneRect = _rect; + + _arrayD.clear(); + _arrayL.clear(); + + for (uint i = 0; i < _filenames.size(); i++) + free(_filenames[i]); + + _filenames.clear(); +} + +void ModalSaveGame::setScene(Scene *sc) { + _queryRes = -1; + _menuScene = sc; +} + +void ModalSaveGame::processKey(int key) { + if (key == 27) + _queryRes = 0; +} + +bool ModalSaveGame::init(int counterdiff) { + if (_queryDlg) { + if (!_queryDlg->init(counterdiff)) { + if (!_queryDlg->getQueryResult()) + _queryRes = -1; + + delete _queryDlg; + _queryDlg = 0; + } + + return true; + } + + if (_queryRes == -1) + return true; + + g_fp->_sceneRect = _rect; + + if (g_fp->_currentScene) { + g_fp->_currentScene->_x = _oldBgX; + g_fp->_currentScene->_y = _oldBgY; + } + + if (!_queryRes) { + ModalMainMenu *m = new ModalMainMenu; + + g_fp->_modalObject = m; + + m->_parentObj = _parentObj; + m->_screct = _rect; + m->_bgX = _oldBgX; + m->_bgY = _oldBgY; + + delete this; + + return true; + } + + return false; +} + +void ModalSaveGame::setup(Scene *sc, int mode) { + warning("STUB: ModalSaveGame::setup()"); +} + +char *ModalSaveGame::getSaveName() { + if (_queryRes < 0) + return 0; + + return _filenames[_queryRes]; +} + + void FullpipeEngine::openHelp() { if (!_modalObject) { ModalHelp *help = new ModalHelp; diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index 7ed433b125..e2962ab595 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -27,6 +27,7 @@ namespace Fullpipe { class PictureObject; class Picture; +class Sound; class BaseModalObject { public: @@ -147,19 +148,47 @@ class ModalCredits : public BaseModalObject { virtual void saveload() {} }; +struct MenuArea { + int picIdL; + PictureObject *picObjD; + PictureObject *picObjL; +}; + class ModalMainMenu : public BaseModalObject { public: - int _field_34; + Scene *_scene; + int _hoverAreaId; + Common::Array<MenuArea *> _areas; + int _menuSliderIdx; + int _musicSliderIdx; + MenuArea *_lastArea; + int _sliderOffset; + int _mfield_34; + Common::Rect _screct; + int _bgX; + int _bgY; + int _debugKeyCount; public: ModalMainMenu(); virtual ~ModalMainMenu() {} virtual bool pollEvent() { return true; } - virtual bool handleMessage(ExCommand *message) { return false; } - virtual bool init(int counterdiff) { return true; } - virtual void update() {} + virtual bool handleMessage(ExCommand *message); + virtual bool init(int counterdiff); + virtual void update(); virtual void saveload() {} + +private: + bool isSaveAllowed(); + void enableDebugMenuButton(); + void setSliderPos(); + void enableDebugMenu(char c); + int checkHover(Common::Point &point); + void updateVolume(); + void updateSoundVolume(Sound *snd); + void updateSliderPos(); + bool isOverArea(PictureObject *obj, Common::Point *point); }; class ModalHelp : public BaseModalObject { @@ -187,25 +216,63 @@ public: class ModalQuery : public BaseModalObject { public: ModalQuery(); - virtual ~ModalQuery() {} + virtual ~ModalQuery(); virtual bool pollEvent() { return true; } - virtual bool handleMessage(ExCommand *message) { return false; } - virtual bool init(int counterdiff) { return true; } - virtual void update() {} + virtual bool handleMessage(ExCommand *message); + virtual bool init(int counterdiff); + virtual void update(); virtual void saveload() {} + + bool create(Scene *sc, PictureObject *picObjList, int picId); + int getQueryResult() { return _queryResult; } + + +private: + PictureObject *_picObjList; + PictureObject *_bg; + PictureObject *_okBtn; + PictureObject *_cancelBtn; + int _queryResult; + }; class ModalSaveGame : public BaseModalObject { public: ModalSaveGame(); - virtual ~ModalSaveGame() {} + virtual ~ModalSaveGame(); virtual bool pollEvent() { return true; } virtual bool handleMessage(ExCommand *message) { return false; } - virtual bool init(int counterdiff) { return true; } + virtual bool init(int counterdiff); virtual void update() {} virtual void saveload() {} + + void setScene(Scene *sc); + void setup(Scene *sc, int mode); + void processKey(int key); + + char *getSaveName(); + + Common::Rect _rect; + int _oldBgX; + int _oldBgY; + PictureObject *_bgr; + PictureObject *_okD; + PictureObject *_okL; + PictureObject *_cancelD; + PictureObject *_cancelL; + PictureObject *_emptyD; + PictureObject *_emptyL; + PictureObject *_fullD; + PictureObject *_fullL; + Scene *_menuScene; + int _mode; + ModalQuery *_queryDlg; + Common::Array <char *> _filenames; + Common::Array <PictureObject *> _arrayL; + Common::Array <PictureObject *> _arrayD; + int _queryRes; }; diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk index db97fa202b..3962fe64ba 100644 --- a/engines/fullpipe/module.mk +++ b/engines/fullpipe/module.mk @@ -52,6 +52,7 @@ MODULE_OBJS = \ scenes/scene26.o \ scenes/scene27.o \ scenes/scene28.o \ + scenes/scene29.o \ scenes/scene30.o \ scenes/scene31.o \ scenes/scene32.o \ diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 0881a19692..35da154570 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -159,10 +159,72 @@ void MctlCompound::freeItems() { _motionControllers[i]->_motionControllerObj->freeItems(); } -MessageQueue *MctlCompound::method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { - warning("STUB: MctlCompound::method34()"); +MessageQueue *MctlCompound::method34(StaticANIObject *ani, int sourceX, int sourceY, int fuzzyMatch, int staticsId) { + int idx = -1; + int sourceIdx = -1; - return 0; + if (!ani) + return 0; + + for (uint i = 0; i < _motionControllers.size(); i++) { + if (_motionControllers[i]->_movGraphReactObj) { + if (_motionControllers[i]->_movGraphReactObj->pointInRegion(ani->_ox, ani->_oy)) { + idx = i; + break; + } + } + } + + for (uint i = 0; i < _motionControllers.size(); i++) { + if (_motionControllers[i]->_movGraphReactObj) { + if (_motionControllers[i]->_movGraphReactObj->pointInRegion(sourceX, sourceY)) { + sourceIdx = i; + break; + } + } + } + + if (idx == -1) + return 0; + + if (sourceIdx == -1) + return 0; + + if (idx == sourceIdx) + return _motionControllers[idx]->_motionControllerObj->method34(ani, sourceX, sourceY, fuzzyMatch, staticsId); + + MctlConnectionPoint *cp = findClosestConnectionPoint(ani->_ox, ani->_oy, idx, sourceX, sourceY, sourceIdx, &sourceIdx); + + if (!cp) + return 0; + + MessageQueue *mq = _motionControllers[idx]->_motionControllerObj->doWalkTo(ani, cp->_connectionX, cp->_connectionY, 1, cp->_field_14); + + if (!mq) + return 0; + + for (uint i = 0; i < cp->_messageQueueObj->getCount(); i++) { + ExCommand *ex = new ExCommand(cp->_messageQueueObj->getExCommandByIndex(i)); + + ex->_excFlags |= 2; + + mq->addExCommandToEnd(ex); + } + + ExCommand *ex = new ExCommand(ani->_id, 51, 0, sourceX, sourceY, 0, 1, 0, 0, 0); + + ex->_excFlags |= 2; + ex->_field_20 = fuzzyMatch; + ex->_keyCode = ani->_okeyCode; + + mq->addExCommandToEnd(ex); + + if (!mq->chain(ani)) { + delete mq; + return 0; + } + + return mq; } MessageQueue *MctlCompound::doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { @@ -598,6 +660,14 @@ void MovGraph::calcNodeDistancesAndAngles() { } } +int MovGraph::getItemIndexByStaticAni(StaticANIObject *ani) { + for (uint i = 0; i < _items.size(); i++) + if (_items[i]->ani == ani) + return i; + + return -1; +} + int MovGraph2::getItemIndexByGameObjectId(int objectId) { for (uint i = 0; i < _items2.size(); i++) if (_items2[i]->_objectId == objectId) @@ -1754,6 +1824,89 @@ void MGM::clear() { _items.clear(); } +MessageQueue *MGM::genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr) { + int idx = getItemIndexById(ani->_id); + + if (idx == -1) + return 0; + + int stid = staticsId; + + if (!staticsId) { + if (ani->_movement) { + stid = ani->_movement->_staticsObj2->_staticsId; + } else { + if (!ani->_statics) + return 0; + + stid = ani->_statics->_staticsId; + } + } + + if (stid == staticsIndex) + return new MessageQueue(g_fp->_globalMessageQueueList->compact()); + + int startidx = getStaticsIndexById(idx, stid); + int endidx = getStaticsIndexById(idx, staticsIndex); + int subidx = startidx + endidx * _items[idx]->statics.size(); + + if (!_items[idx]->subItems[subidx]->movement) { + clearMovements2(idx); + recalcOffsets(idx, startidx, endidx, 0, 1); + } + + if (!_items[idx]->subItems[subidx]->movement) + return 0; + + MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact()); + Common::Point point; + ExCommand *ex; + + int i = 0; + do { + subidx = startidx + endidx * _items[idx]->statics.size(); + + _items[idx]->subItems[subidx]->movement->calcSomeXY(point, 0); + + if (pointArr) { + int sz; + + if (_items[idx]->subItems[subidx]->movement->_currMovement) + sz = _items[idx]->subItems[subidx]->movement->_currMovement->_dynamicPhases.size(); + else + sz = _items[idx]->subItems[subidx]->movement->_dynamicPhases.size(); + + ex = new ExCommand2(20, ani->_id, &pointArr[i], sz); + + ex->_messageNum = _items[idx]->subItems[subidx]->movement->_id; + } else { + ex = new ExCommand(ani->_id, 1, _items[idx]->subItems[subidx]->movement->_id, 0, 0, 0, 1, 0, 0, 0); + } + + ex->_keyCode = ani->_okeyCode; + ex->_field_3C = 1; + ex->_field_24 = 1; + + mq->addExCommandToEnd(ex); + + if (resStatId) + *resStatId = _items[idx]->subItems[subidx]->movement->_id; + + startidx = _items[idx]->subItems[subidx]->staticsIndex; + + uint step; + + if (_items[idx]->subItems[subidx]->movement->_currMovement) + step = _items[idx]->subItems[subidx]->movement->_currMovement->_dynamicPhases.size(); + else + step = _items[idx]->subItems[subidx]->movement->_dynamicPhases.size(); + + i += step; + } while (startidx != endidx); + + return mq; +} + MGMItem::MGMItem() { objId = 0; } @@ -1811,15 +1964,10 @@ int MGM::getItemIndexById(int objId) { } MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { - warning("STUB: MGM::genMovement()"); - - return 0; - -#if 0 if (!mgminfo->ani) return 0; - mov = mgminfo->ani->_movement; + Movement *mov = mgminfo->ani->_movement; if (!mov && !mgminfo->ani->_statics) return 0; @@ -1831,14 +1979,17 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { mgminfo->staticsId1 = mgminfo->ani->_statics->_staticsId; } + Common::Point point; + if (!(mgminfo->flags & 0x10) || !(mgminfo->flags & 0x20)) { int nx = mgminfo->ani->_ox; int ny = mgminfo->ani->_oy; if (mgminfo->ani->_movement) { - mgminfo->ani->calcNextStep(&point2); - nx += point2.x; - ny += point2.y; + mgminfo->ani->calcNextStep(&point); + + nx += point.x; + ny += point.y; } if (!(mgminfo->flags & 0x10)) @@ -1853,40 +2004,37 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { if (!mov) return 0; - itemIdx = getItemIndexById(mgminfo->ani->_id); - subIdx = getStaticsIndexById(itemIdx, mgminfo->staticsId1); - st2idx = getStaticsIndexById(itemIdx, mov->_staticsObj1->_staticsId); - st1idx = getStaticsIndexById(itemIdx, mov->_staticsObj2->_staticsId); - subOffset = getStaticsIndexById(itemIdx, mgminfo->staticsId2); + int itemIdx = getItemIndexById(mgminfo->ani->_id); + int subIdx = getStaticsIndexById(itemIdx, mgminfo->staticsId1); + int st2idx = getStaticsIndexById(itemIdx, mov->_staticsObj1->_staticsId); + int st1idx = getStaticsIndexById(itemIdx, mov->_staticsObj2->_staticsId); + int subOffset = getStaticsIndexById(itemIdx, mgminfo->staticsId2); clearMovements2(itemIdx); recalcOffsets(itemIdx, subIdx, st2idx, 0, 1); clearMovements2(itemIdx); recalcOffsets(itemIdx, st1idx, subOffset, 0, 1); - v71 = (Message *)(28 * itemIdx); - v16 = items[itemIdx].objId; - v17 = *(_DWORD *)(v16 + offsetof(MGMItem, staticsListCount)); - off = *(_DWORD *)(v16 + offsetof(MGMItem, subItems)); - v18 = (MGMSubItem *)(off + 24 * (subIdx + st2idx * v17)); - x1 = (int)&v18->movement->go.CObject.vmt; - v19 = (MGMSubItem *)(off + 24 * (st1idx + subOffset * v17)); - v69 = (LONG)&v19->movement->go.CObject.vmt; + MGMSubItem *sub1 = _items[itemIdx]->subItems[subIdx + st2idx * _items[itemIdx]->statics.size()]; + MGMSubItem *sub2 = _items[itemIdx]->subItems[st1idx + subOffset * _items[itemIdx]->statics.size()]; - if (subIdx != st2idx && !x1) + if (subIdx != st2idx && !sub1->movement) return 0; - if (st1idx != subOffset && !v69) + if (st1idx != subOffset && !sub2->movement) return 0; - int n1x = mgminfo->x1 - mgminfo->x2 - v18->x - v19->x; - int n1y = mgminfo->y1 - mgminfo->y2 - v18->y - v19->y; + int n1x = mgminfo->x1 - mgminfo->x2 - sub1->x - sub2->x; + int n1y = mgminfo->y1 - mgminfo->y2 - sub1->y - sub2->y; - mov->calcSomeXY(&point1, 0); + Common::Point point1; + + mov->calcSomeXY(point1, 0); int n2x = point1.x; int n2y = point1.y; int mult; + int len; if (mgminfo->flags & 0x40) { mult = mgminfo->field_10; @@ -1903,20 +2051,20 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { len = -1; n2x = mult * point1.x; n1x = mult * point1.x; - mgminfo->x1 = mgminfo->x2 + mult * point1.x + v18->x + v19->x; + mgminfo->x1 = mgminfo->x2 + mult * point1.x + sub1->x + sub2->x; } if (!(mgminfo->flags & 4)) { n2y = mult * point1.y; n1y = mult * point1.y; len = -1; - mgminfo->y1 = mgminfo->y2 + mult * point1.y + v18->y + v19->y; + mgminfo->y1 = mgminfo->y2 + mult * point1.y + sub1->y + sub2->y; } int px = 0; int py = 0; - if (x1) { + if (sub1->movement) { px = countPhases(itemIdx, subIdx, st2idx, 1); py = countPhases(itemIdx, subIdx, st2idx, 2); } @@ -1931,13 +2079,14 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { py += mov->countPhasesWithFlag(len, 2); } - if (v69) { + if (sub2->movement) { px += countPhases(itemIdx, st1idx, subOffset, 1); py += countPhases(itemIdx, st1idx, subOffset, 2); } int dx1 = n1x - n2x; int dy1 = n1y - n2y; + int x1, y1; if (px) { x1 = (int)((double)dx1 / (double)px); @@ -1951,6 +2100,8 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { y1 = 0; } + Common::Point x2, y2; + y2.x = dx1 - px * x1; y2.y = dy1 - py * y1; @@ -1967,16 +2118,19 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact()); ExCommand2 *ex2; - for (v42 = subIdx; v42 != st2idx; v42 = v43->staticsIndex) { - v43 = &(*(MGMSubItem **)((char *)&this->items->subItems + (unsigned int)v71))[v42 + st2idx * *(int *)((char *)&this->items->staticsListCount + (unsigned int)v71)]; - ex2 = buildExCommand2(v43->movement, mgminfo->ani->go._id, x1, y1, &x2, &y2, -1); + for (int i = subIdx; i != st2idx;) { + MGMSubItem *s = _items[itemIdx]->subItems[i + subOffset * _items[itemIdx]->statics.size()]; + + ex2 = buildExCommand2(s->movement, mgminfo->ani->_id, x1, y1, &x2, &y2, -1); ex2->_parId = mq->_id; ex2->_keyCode = mgminfo->ani->_okeyCode; mq->addExCommandToEnd(ex2); + + i = s->staticsIndex; } - for (i = 0; i < mult; ++i) { + for (int i = 0; i < mult; ++i) { int plen; if (i == mult - 1) @@ -1991,14 +2145,16 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { mq->addExCommandToEnd(ex2); } - for (j = st1idx; j != subOffset; j = v50->staticsIndex) { - v50 = &(*(MGMSubItem **)((char *)&this->items->subItems + (unsigned int)v71))[j + subOffset * *(int *)((char *)&this->items->staticsListCount + (unsigned int)v71)]; + for (int j = st1idx; j != subOffset;) { + MGMSubItem *s = _items[itemIdx]->subItems[j + subOffset * _items[itemIdx]->statics.size()]; - ex2 = buildExCommand2(v50->movement, mgminfo->ani->_id, x1, y1, &x2, &y2, -1); + ex2 = buildExCommand2(s->movement, mgminfo->ani->_id, x1, y1, &x2, &y2, -1); ex2->_parId = mq->_id; ex2->_keyCode = mgminfo->ani->_okeyCode; mq->addExCommandToEnd(ex2); + + j = s->staticsIndex; } ExCommand *ex = new ExCommand(mgminfo->ani->_id, 5, -1, mgminfo->x1, mgminfo->y1, 0, 1, 0, 0, 0); @@ -2011,9 +2167,25 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) { mq->addExCommandToEnd(ex); return mq; -#endif } +int MGM::countPhases(int idx, int subIdx, int endIdx, int flag) { + int res = 0; + + if (endIdx < 0) + return 0; + + while (subIdx != endIdx) { + if (subIdx < 0) + break; + + res += _items[idx]->subItems[subIdx + endIdx * _items[idx]->statics.size()]->movement->countPhasesWithFlag(-1, flag); + + subIdx = _items[idx]->subItems[subIdx + 6 * endIdx * _items[idx]->statics.size()]->staticsIndex; + } + + return res; +} void MGM::updateAnimStatics(StaticANIObject *ani, int staticsId) { if (getItemIndexById(ani->_id) == -1) return; @@ -2112,9 +2284,99 @@ void MGM::clearMovements2(int idx) { } int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) { - warning("STUB: MGM::recalcOffsets()"); + MGMItem *item = _items[idx]; + int subIdx = st1idx + st2idx * item->statics.size(); - return 0; + if (st1idx == st2idx) { + memset(&item->subItems[subIdx], 0, sizeof(item->subItems[subIdx])); + return 0; + } + + if (item->subItems[subIdx]) + return item->subItems[subIdx]->field_8; + + Common::Point point; + + for (uint i = 0; i < item->movements1.size(); i++) { + Movement *mov = item->movements1[i]; + + if (mov->_staticsObj1 == item->statics[st1idx]) { + if (!item->movements2[i] && (!flop || mov->_field_50)) { + item->movements2[i] = 1; + + int stidx = getStaticsIndex(idx, item->movements1[i]->_staticsObj2); + int recalc = recalcOffsets(idx, stidx, st2idx, flip, flop); + int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size(); + int newsz = sz + item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->field_C; + + if (recalc >= 0) { + if (!item->subItems[subIdx]->movement || item->subItems[subIdx]->field_8 > recalc + 1 || + (item->subItems[subIdx]->field_8 == recalc + 1 && item->subItems[subIdx]->field_C > newsz)) { + item->subItems[subIdx]->movement = mov; + item->subItems[subIdx]->staticsIndex = stidx; + item->subItems[subIdx]->field_8 = recalc + 1; + item->subItems[subIdx]->field_C = newsz; + + mov->calcSomeXY(point, 0); + + item->subItems[subIdx]->x = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->x + point.x; + item->subItems[subIdx]->y = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->y + point.y; + } + } + } + } else if (flip) { + if (mov->_staticsObj2 == item->statics[st1idx]) { + if (!item->movements2[i] && (!flop || mov->_field_50)) { + item->movements2[i] = 1; + + int stidx = getStaticsIndex(idx, mov->_staticsObj1); + int recalc = recalcOffsets(idx, stidx, st2idx, flip, flop); + + if (recalc >= 0) { + if (!item->subItems[subIdx]->movement || item->subItems[subIdx]->field_8 > recalc + 1) { + item->subItems[subIdx]->movement = mov; + item->subItems[subIdx]->staticsIndex = stidx; + item->subItems[subIdx]->field_8 = recalc + 1; + + int sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size(); + + item->subItems[subIdx]->field_C = sz + item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->field_C; + + mov->calcSomeXY(point, 0); + + item->subItems[subIdx]->x = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->x - point.x; + item->subItems[subIdx]->y = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->y - point.y; + } + } + } + } + } + } + + if (item->subItems[subIdx]->movement) + return item->subItems[subIdx]->field_8; + + return -1; +} + +int MGM::refreshOffsets(int objectId, int idx1, int idx2) { + int idx = getItemIndexById(objectId); + + if (idx != -1) { + int from = getStaticsIndexById(idx, idx1); + int to = getStaticsIndexById(idx, idx2); + + MGMSubItem *sub = _items[idx]->subItems[from + to * _items[idx]->statics.size()]; + + if (sub->movement) { + idx = sub->field_8; + } else { + clearMovements2(idx); + idx = recalcOffsets(idx, from, to, 0, 1); + } + } + + return idx; } Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y, int *mult, int *len, int flag) { diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index a9695e8094..4d92fd7fed 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -138,7 +138,7 @@ struct MGMItem { Common::Array<MGMSubItem *> subItems; Common::Array<Statics *> statics; Common::Array<Movement *> movements1; - Common::Array<Movement *> movements2; + Common::Array<int> movements2; MGMItem(); }; @@ -178,6 +178,9 @@ public: int recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop); Common::Point *calcLength(Common::Point *point, Movement *mov, int x, int y, int *mult, int *len, int flag); ExCommand2 *buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len); + MessageQueue *genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr); + int countPhases(int idx, int subIdx, int subOffset, int flag); + int refreshOffsets(int objectId, int idx1, int idx2); }; struct MctlLadderMovementVars { @@ -347,6 +350,7 @@ public: double calcDistance(Common::Point *point, MovGraphLink *link, int fuzzyMatch); void calcNodeDistancesAndAngles(); MovGraphNode *calcOffset(int ox, int oy); + int getItemIndexByStaticAni(StaticANIObject *ani); }; class Movement; diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 1c6369341a..7420c1b1cf 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -270,43 +270,38 @@ Vars::Vars() { scene17_handPhase = false; scene17_sceneEdgeX = 0; - scene18_var01 = 0; - scene18_var16 = 200; - scene18_var17 = 200; - scene18_var18 = 300; - scene18_var19 = 300; + scene18_inScene18p1 = false; scene18_whirlgig = 0; - scene18_var20 = 1032; - scene18_var04 = -318; - scene18_var08 = 0; - scene18_var09 = 0; - scene18_var03 = false; - scene18_var21 = 0; - scene18_var11 = 0; - scene18_var12 = 0; - scene18_var22 = 1; - scene18_var23 = -1; - scene18_var24 = 0; - scene18_var25 = 0; - scene18_var26 = 1; - scene18_var27 = -1; - scene18_var13 = -1; - scene18_var14 = -1; - scene18_var28 = 0; - scene18_var15 = 0; + scene18_wheelCenterX = 0; + scene18_wheelCenterY = 0; + scene18_bridgeIsConvoluted = false; + scene18_whirlgigMovMum = 0; + scene18_girlIsSwinging = false; + scene18_rotationCounter = 0; + scene18_manY = 0; + scene18_wheelFlipper = false; + scene18_wheelIsTurning = true; + scene18_kidIsOnWheel = -1; + scene18_boyIsOnWheel = 0; + scene18_girlIsOnWheel = 0; + scene18_boyJumpedOff = true; + scene18_jumpDistance = -1; + scene18_jumpAngle = -1; + scene18_manIsReady = false; + scene18_enteredTrubaRight = false; + scene18_manWheelPos = 0; + scene18_manWheelPosTo = -1; + scene18_kidWheelPos = 0; + scene18_kidWheelPosTo = 0; scene18_boy = 0; scene18_girl = 0; scene18_domino = 0; - scene18_var29 = 290; - scene18_var30 = -363; - scene18_var05 = 283; - scene18_var06 = -350; + scene18_boyJumpX = 290; + scene18_boyJumpY = -363; + scene18_girlJumpX = 283; + scene18_girlJumpY = -350; - scene19_var01 = 0; - scene19_var02 = 0; - scene19_var03 = 0; - scene19_var04 = 0; - scene19_var05 = false; + scene19_enteredTruba3 = false; scene20_fliesCountdown = 0; scene20_grandma = 0; @@ -383,6 +378,23 @@ Vars::Vars() { scene28_headBeardedFlipper = false; scene28_lift6inside = false; + scene29_porter = 0; + scene29_shooter1 = 0; + scene29_shooter2 = 0; + scene29_ass = 0; + scene29_manIsRiding = false; + scene29_arcadeIsOn = false; + scene29_reachedFarRight = false; + scene29_rideBackEnabled = false; + scene29_shootCountdown = 0; + scene29_shootDistance = 75; + scene29_manIsHit = 0; + scene29_scrollSpeed = 0; + scene29_scrollingDisabled = 0; + scene29_hitBall = 0; + scene29_manX = 0; + scene29_manY = 0; + scene30_leg = 0; scene30_liftFlag = 1; @@ -801,7 +813,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->preloadMovements(sceneVar); g_fp->stopAllSounds(); - if (g_vars->scene18_var01) + if (g_vars->scene18_inScene18p1) scene18_initScene1(scene); else scene18_initScene2(scene); @@ -817,10 +829,12 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { if (!g_fp->_scene3) { g_fp->_scene3 = accessScene(SC_18); g_fp->_gameLoader->loadScene(SC_18); + scene18_initScene2(g_fp->_scene3); scene18_preload(); scene19_setMovements(g_fp->_scene3, entrance->_field_4); - g_vars->scene18_var01 = 1; + + g_vars->scene18_inScene18p1 = true; } scene19_preload(); @@ -828,7 +842,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->preloadMovements(sceneVar); g_fp->stopAllSounds(); - if (g_vars->scene18_var01) + if (g_vars->scene18_inScene18p1) scene18_initScene1(scene); else scene19_initScene2(); @@ -945,7 +959,6 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { _updateCursorCallback = scene28_updateCursor; break; -#if 0 case SC_29: sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_29"); scene->preloadMovements(sceneVar); @@ -956,7 +969,6 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { addMessageHandler(sceneHandler29, 2); _updateCursorCallback = scene29_updateCursor; break; -#endif case SC_30: sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_30"); @@ -1094,10 +1106,6 @@ int defaultUpdateCursor() { return g_fp->_cursorId; } -void FullpipeEngine::processArcade(ExCommand *ex) { - warning("STUB: FullpipeEngine::processArcade()"); -} - void FullpipeEngine::updateMapPiece(int mapId, int update) { for (int i = 0; i < 200; i++) { int hiWord = (_mapTable[i] >> 16) & 0xffff; @@ -1453,5 +1461,31 @@ Ball *BallChain::sub04(Ball *ballP, Ball *ballN) { return pTail; } +void BallChain::removeBall(Ball *ball) { + if (ball == pHead) + pHead = ball->p0; + else + ball->p1->p0 = ball->p0; + + if (ball == field_8) + field_8 = ball->p1; + else + ball->p0->p1 = ball->p1; + + ball->p0 = pTail; + pTail = ball; + + numBalls--; + + if (!numBalls) { + numBalls = 0; + pTail = 0; + field_8 = 0; + pHead = 0; + free(cPlex); + cPlex = 0; + } +} + } // End of namespace Fullpipe diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index 30306fa9ab..0b7c4e7c8f 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -33,6 +33,7 @@ class MctlLadder; struct Ring; class StaticANIObject; struct Swinger; +struct WalkingBearder; int defaultUpdateCursor(); @@ -163,6 +164,10 @@ void scene28_initScene(Scene *sc); int sceneHandler28(ExCommand *ex); int scene28_updateCursor(); +int scene29_updateCursor(); +void scene29_initScene(Scene *sc); +int sceneHandler29(ExCommand *cmd); + int scene30_updateCursor(); void scene30_initScene(Scene *sc, int flag); int sceneHandler30(ExCommand *cmd); @@ -227,6 +232,7 @@ struct BallChain { void init(Ball **ball); Ball *sub04(Ball *ballP, Ball *ballN); + void removeBall(Ball *ball); void reset() { pHead = 0; pTail = 0; field_8 = 0; numBalls = 0; free(cPlex); cPlex = 0; cPlexLen = 0; } }; @@ -473,44 +479,39 @@ public: bool scene17_handPhase; int scene17_sceneEdgeX; - int scene18_var01; - int scene18_var16; - int scene18_var17; - int scene18_var18; - int scene18_var19; + bool scene18_inScene18p1; StaticANIObject *scene18_whirlgig; - Common::Array<Swinger *> scene18_var07; - int scene18_var20; - int scene18_var04; - int scene18_var08; - int scene18_var09; - bool scene18_var03; - int scene18_var21; - int scene18_var11; - int scene18_var12; - int scene18_var22; - int scene18_var23; - int scene18_var24; - int scene18_var25; - int scene18_var26; - int scene18_var27; - int scene18_var13; - int scene18_var14; - int scene18_var28; - int scene18_var15; + Common::Array<Swinger *> scene18_swingers; + int scene18_wheelCenterX; + int scene18_wheelCenterY; + bool scene18_bridgeIsConvoluted; + int scene18_whirlgigMovMum; + bool scene18_girlIsSwinging; + int scene18_rotationCounter; + int scene18_manY; + bool scene18_wheelFlipper; + bool scene18_wheelIsTurning; + int scene18_kidIsOnWheel; + int scene18_boyIsOnWheel; + int scene18_girlIsOnWheel; + bool scene18_boyJumpedOff; + int scene18_manWheelPos; + int scene18_manWheelPosTo; + int scene18_kidWheelPos; + int scene18_kidWheelPosTo; + int scene18_jumpDistance; + int scene18_jumpAngle; + bool scene18_manIsReady; + bool scene18_enteredTrubaRight; StaticANIObject *scene18_boy; StaticANIObject *scene18_girl; StaticANIObject *scene18_domino; - int scene18_var29; - int scene18_var30; - int scene18_var05; - int scene18_var06; + int scene18_boyJumpX; + int scene18_boyJumpY; + int scene18_girlJumpX; + int scene18_girlJumpY; - int scene19_var01; - int scene19_var02; - int scene19_var03; - int scene19_var04; - bool scene19_var05; + bool scene19_enteredTruba3; int scene20_fliesCountdown; StaticANIObject *scene20_grandma; @@ -590,6 +591,29 @@ public: bool scene28_headBeardedFlipper; bool scene28_lift6inside; + StaticANIObject *scene29_porter; + StaticANIObject *scene29_shooter1; + StaticANIObject *scene29_shooter2; + StaticANIObject *scene29_ass; + BallChain scene29_balls; + BallChain scene29_redBalls; + BallChain scene29_flyingRedBalls; + BallChain scene29_greenBalls; + bool scene29_manIsRiding; + bool scene29_arcadeIsOn; + bool scene29_reachedFarRight; + bool scene29_rideBackEnabled; + int scene29_shootCountdown; + int scene29_shootDistance; + int scene29_manIsHit; + int scene29_scrollSpeed; + bool scene29_scrollingDisabled; + int scene29_hitBall; + Common::Array<WalkingBearder *> scene29_bearders; + int scene29_manX; + int scene29_manY; + MGM scene29_mgm; + StaticANIObject *scene30_leg; int scene30_liftFlag; diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp index ea816bb5d1..4f6677876b 100644 --- a/engines/fullpipe/scenes/scene18and19.cpp +++ b/engines/fullpipe/scenes/scene18and19.cpp @@ -48,6 +48,9 @@ struct Swinger { int sfield_24; }; + +#define ANGLE(x) ((x) * M_PI / 180) + void scene18_preload() { g_fp->_scene3 = 0; @@ -82,29 +85,29 @@ void scene19_setSugarState(Scene *sc) { void scene19_setMovements(Scene *sc, int entranceId) { if (entranceId == TrubaRight) { - g_vars->scene18_var15 = 1; + g_vars->scene18_enteredTrubaRight = true; } else { - g_vars->scene18_var15 = 0; - g_vars->scene19_var05 = (entranceId == PIC_SC19_RTRUBA3); + g_vars->scene18_enteredTrubaRight = false; + g_vars->scene19_enteredTruba3 = (entranceId == PIC_SC19_RTRUBA3); } - for (uint i = 0; i < g_vars->scene18_var07.size(); i++) { - if (!g_vars->scene18_var15 && (g_vars->scene18_var07[i]->sflags & 0x20)) { + for (uint i = 0; i < g_vars->scene18_swingers.size(); i++) { + if (!g_vars->scene18_enteredTrubaRight && (g_vars->scene18_swingers[i]->sflags & 0x20)) { Scene *oldsc = g_fp->_currentScene; - g_vars->scene18_var07[i]->sflags = 1; + g_vars->scene18_swingers[i]->sflags = 1; g_fp->_currentScene = sc; - g_vars->scene18_var07[i]->ani->changeStatics2(ST_KSL_NORM); - g_vars->scene18_var07[i]->ani->_priority = 30; + g_vars->scene18_swingers[i]->ani->changeStatics2(ST_KSL_NORM); + g_vars->scene18_swingers[i]->ani->_priority = 30; g_fp->_currentScene = oldsc; } - sc->deleteStaticANIObject(g_vars->scene18_var07[i]->ani); + sc->deleteStaticANIObject(g_vars->scene18_swingers[i]->ani); } if (g_vars->scene18_whirlgig->_movement) { - g_vars->scene18_var09 = g_vars->scene18_whirlgig->_movement->_currDynamicPhaseIndex + 1; + g_vars->scene18_whirlgigMovMum = g_vars->scene18_whirlgig->_movement->_currDynamicPhaseIndex + 1; int mx; @@ -113,10 +116,10 @@ void scene19_setMovements(Scene *sc, int entranceId) { else mx = g_vars->scene18_whirlgig->_movement->_dynamicPhases.size(); - if (g_vars->scene18_var09 > mx - 1) - g_vars->scene18_var09 = -1; + if (g_vars->scene18_whirlgigMovMum > mx - 1) + g_vars->scene18_whirlgigMovMum = -1; } else { - g_vars->scene18_var09 = 0; + g_vars->scene18_whirlgigMovMum = 0; } sc->deleteStaticANIObject(g_vars->scene18_boy); @@ -137,7 +140,7 @@ void scene19_preload() { void scene18_setupSwingers(StaticANIObject *ani, Scene *sc) { Swinger *swinger; - g_vars->scene18_var07.clear(); + g_vars->scene18_swingers.clear(); Scene *oldsc = g_fp->_currentScene; g_fp->_currentScene = sc; @@ -145,9 +148,9 @@ void scene18_setupSwingers(StaticANIObject *ani, Scene *sc) { for (int i = 0; i < 8; i++) { swinger = new Swinger; - swinger->angle = (double)i * M_PI / 4.0; - swinger->sx = g_vars->scene18_var20 - (int)(cos(swinger->angle) * -575.0); - swinger->sy = g_vars->scene18_var04 - (int)(sin(swinger->angle) * -575.0) + 87; + swinger->angle = (double)i * ANGLE(45); + swinger->sx = g_vars->scene18_wheelCenterX - (int)(cos(swinger->angle) * -575.0); + swinger->sy = g_vars->scene18_wheelCenterY - (int)(sin(swinger->angle) * -575.0) + 87; swinger->ix = swinger->sx; swinger->iy = swinger->sy; @@ -162,27 +165,25 @@ void scene18_setupSwingers(StaticANIObject *ani, Scene *sc) { sc->addStaticANIObject(newani, 1); } else { swinger->ani = ani; - swinger->sflags = g_vars->scene18_var03 != 0 ? 4 : 1; + swinger->sflags = g_vars->scene18_girlIsSwinging ? 4 : 1; } ani->_statics = ani->getStaticsById(ST_KSL_NORM); - ani->_movement = 0; + //ani->_movement = 0; ani->setOXY(swinger->sx, swinger->sy); ani->_priority = 30; ani->_flags |= 4; - if (swinger->sflags & 2) { + if (swinger->sflags & 2) ani->startAnim(MV_KSL_SWINGBOY, 0, -1); - } else { - if (swinger->sflags & 4) - ani->startAnim(MV_KSL_SWINGGIRL, 0, -1); - else - ani->startAnim(MV_KSL_SWING, 0, -1); - } + else if (swinger->sflags & 4) + ani->startAnim(MV_KSL_SWINGGIRL, 0, -1); + else + ani->startAnim(MV_KSL_SWING, 0, -1); ani->_movement->setDynamicPhaseIndex(g_fp->_rnd->getRandomNumber(17)); - g_vars->scene18_var07.push_back(swinger); + g_vars->scene18_swingers.push_back(swinger); } g_fp->_currentScene = oldsc; @@ -191,63 +192,63 @@ void scene18_setupSwingers(StaticANIObject *ani, Scene *sc) { void scene18_initScene1(Scene *sc) { PicAniInfo info; - int oldx = g_vars->scene18_var20; - int oldy = g_vars->scene18_var04; + int oldx = g_vars->scene18_wheelCenterX; + int oldy = g_vars->scene18_wheelCenterY; - g_vars->scene18_var03 = (g_fp->getObjectState(sO_Girl) == g_fp->getObjectEnumState(sO_Girl, sO_IsSwinging)); + g_vars->scene18_girlIsSwinging = (g_fp->getObjectState(sO_Girl) == g_fp->getObjectEnumState(sO_Girl, sO_IsSwinging)); if (sc->_sceneId == SC_18) { g_vars->scene18_whirlgig = sc->getStaticANIObject1ById(ANI_WHIRLIGIG_18, -1); - g_vars->scene18_var20 = 1032; - g_vars->scene18_var04 = -318; + g_vars->scene18_wheelCenterX = 1032; + g_vars->scene18_wheelCenterY = -318; } else { g_vars->scene18_whirlgig = sc->getStaticANIObject1ById(ANI_WHIRLGIG_19, -1); - g_vars->scene18_var20 = 1024; - g_vars->scene18_var04 = 242; + g_vars->scene18_wheelCenterX = 1024; + g_vars->scene18_wheelCenterY = 242; } - int newx = g_vars->scene18_var20 - oldx; - int newy = g_vars->scene18_var04 - oldy; + int newx = g_vars->scene18_wheelCenterX - oldx; + int newy = g_vars->scene18_wheelCenterY - oldy; - g_vars->scene18_var29 += newx; - g_vars->scene18_var30 += newy; - g_vars->scene18_var05 += newx; - g_vars->scene18_var06 += newy; + g_vars->scene18_boyJumpX += newx; + g_vars->scene18_boyJumpY += newy; + g_vars->scene18_girlJumpX += newx; + g_vars->scene18_girlJumpY += newy; - for (uint i = 0; i < g_vars->scene18_var07.size(); i++) { - g_vars->scene18_var07[i]->ani->getPicAniInfo(&info); - sc->addStaticANIObject(g_vars->scene18_var07[i]->ani, 1); - g_vars->scene18_var07[i]->ani->setPicAniInfo(&info); + for (uint i = 0; i < g_vars->scene18_swingers.size(); i++) { + g_vars->scene18_swingers[i]->ani->getPicAniInfo(&info); + sc->addStaticANIObject(g_vars->scene18_swingers[i]->ani, 1); + g_vars->scene18_swingers[i]->ani->setPicAniInfo(&info); - g_vars->scene18_var07[i]->sx += newx; - g_vars->scene18_var07[i]->sy += newy; - g_vars->scene18_var07[i]->ix += newx; - g_vars->scene18_var07[i]->iy += newy; + g_vars->scene18_swingers[i]->sx += newx; + g_vars->scene18_swingers[i]->sy += newy; + g_vars->scene18_swingers[i]->ix += newx; + g_vars->scene18_swingers[i]->iy += newy; GameObject *go; - if (g_vars->scene18_var07[i]->ani->_movement) - go = g_vars->scene18_var07[i]->ani->_movement; + if (g_vars->scene18_swingers[i]->ani->_movement) + go = g_vars->scene18_swingers[i]->ani->_movement; else - go = g_vars->scene18_var07[i]->ani; + go = g_vars->scene18_swingers[i]->ani; go->setOXY(newx + go->_ox, newy + go->_oy); } - if (g_vars->scene18_var08 && g_vars->scene18_var09 != -1) { + if (g_vars->scene18_bridgeIsConvoluted && g_vars->scene18_whirlgigMovMum != -1) { g_vars->scene18_whirlgig->startAnim(sc->_sceneId != SC_18 ? MV_WHR19_SPIN : MV_WHR18_SPIN, 0, -1); - g_vars->scene18_whirlgig->_movement->setDynamicPhaseIndex(g_vars->scene18_var09); + g_vars->scene18_whirlgig->_movement->setDynamicPhaseIndex(g_vars->scene18_whirlgigMovMum); } int sndid; if (sc->_sceneId == SC_19) { - if (g_vars->scene18_var08) + if (g_vars->scene18_bridgeIsConvoluted) sndid = SND_19_015; else sndid = SND_19_016; } else { - if (g_vars->scene18_var08) + if (g_vars->scene18_bridgeIsConvoluted) sndid = SND_18_006; else sndid = SND_18_010; @@ -285,85 +286,77 @@ void scene18_initScene1(Scene *sc) { g_vars->scene18_girl->setOXY(newx + x, newy + y); - g_vars->scene18_var12 = 0; - g_vars->scene18_var13 = -1; - g_vars->scene18_var14 = -1; + g_vars->scene18_wheelFlipper = false; + g_vars->scene18_jumpDistance = -1; + g_vars->scene18_jumpAngle = -1; - if (g_vars->scene18_var15) { + if (g_vars->scene18_enteredTrubaRight) { if (sc->_sceneId == SC_19) g_fp->_aniMan2 = 0; else - g_fp->_aniMan2 = g_vars->scene18_var07[g_vars->scene18_var27]->ani; + g_fp->_aniMan2 = g_vars->scene18_swingers[g_vars->scene18_manWheelPosTo]->ani; } else { g_fp->_aniMan2 = g_fp->_aniMan; } } void scene18_initScene2(Scene *sc) { - g_vars->scene18_var16 = 200; - g_vars->scene18_var17 = 200; - g_vars->scene18_var18 = 300; - g_vars->scene18_var19 = 300; g_vars->scene18_whirlgig = sc->getStaticANIObject1ById(ANI_WHIRLIGIG_18, -1); - g_vars->scene18_var20 = 1032; - g_vars->scene18_var04 = -318; + g_vars->scene18_wheelCenterX = 1032; + g_vars->scene18_wheelCenterY = -318; StaticANIObject *armchair = sc->getStaticANIObject1ById(ANI_KRESLO, -1); armchair->loadMovementsPixelData(); - g_vars->scene18_var03 = (g_fp->getObjectState(sO_Girl) == g_fp->getObjectEnumState(sO_Girl, sO_IsSwinging)); + g_vars->scene18_girlIsSwinging = (g_fp->getObjectState(sO_Girl) == g_fp->getObjectEnumState(sO_Girl, sO_IsSwinging)); if (g_fp->getObjectState(sO_Bridge) == g_fp->getObjectEnumState(sO_Bridge, sO_Convoluted)) { - g_vars->scene18_var08 = 1; + g_vars->scene18_bridgeIsConvoluted = true; g_fp->playSound(SND_18_006, 1); } else { - g_vars->scene18_var08 = 0; + g_vars->scene18_bridgeIsConvoluted = false; g_fp->playSound(SND_18_010, 1); } scene18_setupSwingers(armchair, sc); - g_vars->scene18_var21 = 0; - g_vars->scene18_var12 = 0; - g_vars->scene18_var22 = 1; - g_vars->scene18_var23 = -1; - g_vars->scene18_var24 = 0; - g_vars->scene18_var25 = 0; - g_vars->scene18_var26 = 1; - g_vars->scene18_var27 = -1; - g_vars->scene18_var13 = -1; - g_vars->scene18_var14 = -1; - g_vars->scene18_var28 = 0; - g_vars->scene18_var15 = 0; + g_vars->scene18_rotationCounter = 0; + g_vars->scene18_wheelFlipper = false; + g_vars->scene18_wheelIsTurning = true; + g_vars->scene18_kidIsOnWheel = -1; + g_vars->scene18_boyIsOnWheel = 0; + g_vars->scene18_girlIsOnWheel = 0; + g_vars->scene18_boyJumpedOff = true; + g_vars->scene18_manWheelPosTo = -1; + g_vars->scene18_jumpDistance = -1; + g_vars->scene18_jumpAngle = -1; + g_vars->scene18_manIsReady = false; + g_vars->scene18_enteredTrubaRight = 0; g_vars->scene18_boy = sc->getStaticANIObject1ById(ANI_BOY18, -1); g_vars->scene18_girl = sc->getStaticANIObject1ById(ANI_GIRL18, -1); g_vars->scene18_domino = sc->getStaticANIObject1ById(ANI_DOMINO_18, -1); - g_vars->scene18_var29 = 290; - g_vars->scene18_var30 = -363; - g_vars->scene18_var05 = 283; - g_vars->scene18_var06 = -350; + g_vars->scene18_boyJumpX = 290; + g_vars->scene18_boyJumpY = -363; + g_vars->scene18_girlJumpX = 283; + g_vars->scene18_girlJumpY = -350; g_fp->initArcadeKeys("SC_18"); } void scene19_initScene2() { g_fp->_aniMan2 = 0; - g_vars->scene19_var01 = 200; - g_vars->scene19_var02 = 200; - g_vars->scene19_var03 = 300; - g_vars->scene19_var04 = 300; } int scene18_updateCursor() { - if (g_vars->scene18_var15) { + if (g_vars->scene18_enteredTrubaRight) { g_fp->_cursorId = PIC_CSR_DEFAULT; } else { g_fp->updateCursorCommon(); if (g_fp->_cursorId == PIC_CSR_ITN) { if (g_fp->_objectIdAtCursor == PIC_SC18_LADDER1) { - g_fp->_cursorId = (g_vars->scene18_var11 <= 250) ? PIC_CSR_GOD : PIC_CSR_GOU; + g_fp->_cursorId = (g_vars->scene18_manY <= 250) ? PIC_CSR_GOD : PIC_CSR_GOU; } else if (g_fp->_objectIdAtCursor == PIC_SC18_LADDER2 || g_fp->_objectIdAtCursor == PIC_SC18_LADDER3) { g_fp->_cursorId = PIC_CSR_GOU; } @@ -379,64 +372,316 @@ int scene19_updateCursor() { g_fp->updateCursorCommon(); if (g_fp->_objectIdAtCursor == PIC_SC19_RTRUBA31) - g_fp->_cursorId = g_vars->scene19_var05 != 0 ? PIC_CSR_GOR : PIC_CSR_DEFAULT; + g_fp->_cursorId = g_vars->scene19_enteredTruba3 ? PIC_CSR_GOR : PIC_CSR_DEFAULT; return g_fp->_cursorId; } void sceneHandler18_clickBoard() { - warning("STUB: sceneHandler18_clickBoard()"); + if (ABS(967 - g_fp->_aniMan->_ox) > 1 || ABS(379 - g_fp->_aniMan->_oy) > 1 || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) { + MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 967, 379, 1, ST_MAN_RIGHT); + ExCommand *ex = new ExCommand(0, 17, MSG_SC18_MANREADY, 0, 0, 0, 1, 0, 0, 0); + + ex->_excFlags = 2; + + mq->addExCommandToEnd(ex); + + postExCommand(g_fp->_aniMan->_id, 2, 967, 379, 0, -1); + } else { + g_vars->scene18_manIsReady = true; + } } -void sceneHandler18and19_showManJump() { +void sceneHandler18_showManJumpTo() { g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT); g_fp->_aniMan->_flags &= 0xFFFB; g_fp->_aniMan->_flags &= 0xFEFF; - g_vars->scene18_var07[g_vars->scene18_var27]->sflags = 0x20; + g_vars->scene18_swingers[g_vars->scene18_manWheelPosTo]->sflags = 0x20; - g_vars->scene18_var07[g_vars->scene18_var27]->ani->changeStatics2(ST_KSL_JUMPMAN); - g_vars->scene18_var07[g_vars->scene18_var27]->ani->startAnim(MV_KSL_INMAN, 0, -1); - g_vars->scene18_var07[g_vars->scene18_var27]->ani->_priority = 20; + g_vars->scene18_swingers[g_vars->scene18_manWheelPosTo]->ani->changeStatics2(ST_KSL_JUMPMAN); + g_vars->scene18_swingers[g_vars->scene18_manWheelPosTo]->ani->startAnim(MV_KSL_INMAN, 0, -1); + g_vars->scene18_swingers[g_vars->scene18_manWheelPosTo]->ani->_priority = 20; - g_vars->scene18_var28 = 0; - g_vars->scene18_var15 = 1; + g_vars->scene18_manIsReady = false; + g_vars->scene18_enteredTrubaRight = true; - g_fp->_aniMan2 = g_vars->scene18_var07[g_vars->scene18_var27]->ani; + g_fp->_aniMan2 = g_vars->scene18_swingers[g_vars->scene18_manWheelPosTo]->ani; } -void sceneHandler18_showManJumpTo() { - warning("STUB: sceneHandler18_showManJumpTo()"); +void sceneHandler18and19_showManJump() { + int x, y; + + if (g_vars->scene18_swingers[g_vars->scene18_manWheelPos]->ani->_movement) { + x = g_vars->scene18_swingers[g_vars->scene18_manWheelPos]->ani->_movement->_ox; + y = g_vars->scene18_swingers[g_vars->scene18_manWheelPos]->ani->_movement->_oy; + } else { + x = g_vars->scene18_swingers[g_vars->scene18_manWheelPos]->ani->_ox; + y = g_vars->scene18_swingers[g_vars->scene18_manWheelPos]->ani->_oy; + } + + g_fp->_aniMan->show1(x + 62, y + 5, MV_MAN18_JUMPTOTRUBA, 0); + g_fp->_aniMan->_priority = 35; + + int mqid = 0; + + if (g_vars->scene18_jumpDistance == 1) { + mqid = QU_SC19_MANJUMP1; + } else if (g_vars->scene18_jumpDistance == 2) { + mqid = QU_SC19_MANJUMP2; + } else if (g_vars->scene18_jumpDistance == 3) { + mqid = QU_SC19_MANJUMP3; + } + + if (mqid) { + MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(mqid), 0, 0); + + g_fp->_aniMan2 = g_fp->_aniMan; + g_vars->scene18_enteredTrubaRight = false; + + mq->setFlags(mq->getFlags() | 1); + mq->chain(0); + } + + g_vars->scene18_swingers[g_vars->scene18_manWheelPos]->sflags = 1; + + g_vars->scene18_swingers[g_vars->scene18_manWheelPos]->ani->changeStatics2(ST_KSL_NORM); + g_vars->scene18_swingers[g_vars->scene18_manWheelPos]->ani->_priority = 30; } void sceneHandler18and19_showGirlJumpTo() { - warning("STUB: sceneHandler18and19_showGirlJumpTo()"); + g_vars->scene18_girl->stopAnim_maybe(); + g_vars->scene18_girl->hide(); + + g_vars->scene18_swingers[g_vars->scene18_kidWheelPosTo]->sflags = 4; + + g_vars->scene18_swingers[g_vars->scene18_kidWheelPosTo]->ani->changeStatics2(ST_KSL_JUMPGIRL); + g_vars->scene18_swingers[g_vars->scene18_kidWheelPosTo]->ani->startAnim(MV_KSL_INGIRL, 0, -1); + + g_vars->scene18_kidIsOnWheel--; + g_vars->scene18_girlIsOnWheel--; } void sceneHandler18and19_showGirlJump() { - warning("STUB: sceneHandler18and19_showGirlJump()"); + StaticANIObject *ani = g_vars->scene18_swingers[g_vars->scene18_kidWheelPos]->ani; + int x, y; + + if (ani->_movement) { + x = ani->_movement->_ox; + y = ani->_movement->_oy; + } else { + x = ani->_ox; + y = ani->_oy; + } + + g_vars->scene18_girl->show1(x - 62, y - 10, MV_GRL18_JUMPFROM, 0); + g_vars->scene18_girl->_priority = 50; + g_vars->scene18_girl->startAnim(MV_GRL18_JUMPFROM, 0, -1); + + g_vars->scene18_swingers[g_vars->scene18_kidWheelPos]->sflags = 1; + + g_vars->scene18_swingers[g_vars->scene18_kidWheelPos]->ani->changeStatics2(ST_KSL_REACT); + g_vars->scene18_swingers[g_vars->scene18_kidWheelPos]->ani->startAnim(MV_KSL_CALMDOWN, 0, -1); + + g_vars->scene18_kidIsOnWheel = 1; + g_vars->scene18_girlIsOnWheel++; } void sceneHandler18and19_showBoyJumpTo() { - warning("STUB: sceneHandler18and19_showBoyJumpTo()"); + g_vars->scene18_boy->stopAnim_maybe(); + g_vars->scene18_boy->hide(); + + g_vars->scene18_swingers[g_vars->scene18_kidWheelPosTo]->sflags = 2; + g_vars->scene18_swingers[g_vars->scene18_kidWheelPosTo]->ani->changeStatics2(ST_KSL_JUMPBOY); + g_vars->scene18_swingers[g_vars->scene18_kidWheelPosTo]->ani->startAnim(MV_KSL_INBOY, 0, -1); + + g_vars->scene18_kidIsOnWheel--; + g_vars->scene18_boyIsOnWheel--; } void sceneHandler18and19_showBoyJump() { - warning("STUB: sceneHandler18and19_showBoyJump()"); + StaticANIObject *ani = g_vars->scene18_swingers[g_vars->scene18_kidWheelPos]->ani; + int x, y; + + if (ani->_movement) { + x = ani->_movement->_ox; + y = ani->_movement->_oy; + } else { + x = ani->_ox; + y = ani->_oy; + } + + g_vars->scene18_boy->show1(x - 48, y + 8, MV_BOY18_JUMPFROM, 0); + g_vars->scene18_boy->_priority = 50; + g_vars->scene18_boy->startAnim(MV_BOY18_JUMPFROM, 0, -1); + + g_vars->scene18_swingers[g_vars->scene18_kidWheelPos]->sflags = 1; + + g_vars->scene18_swingers[g_vars->scene18_kidWheelPos]->ani->changeStatics2(ST_KSL_REACT); + g_vars->scene18_swingers[g_vars->scene18_kidWheelPos]->ani->startAnim(MV_KSL_CALMDOWN, 0, -1); + + g_vars->scene18_boyJumpedOff = true; } void sceneHandler18and19_boyJumpTo() { g_vars->scene18_boy->stopAnim_maybe(); - g_vars->scene18_boy->show1(g_vars->scene18_var29, g_vars->scene18_var30, MV_BOY18_JUMPTO, 0); + g_vars->scene18_boy->show1(g_vars->scene18_boyJumpX, g_vars->scene18_boyJumpY, MV_BOY18_JUMPTO, 0); g_vars->scene18_boy->_priority = 50; g_vars->scene18_boy->startAnim(MV_BOY18_JUMPTO, 0, -1); } +void sceneHandler18and19_girlJumpTo() { + g_vars->scene18_girl->stopAnim_maybe(); + g_vars->scene18_girl->show1(g_vars->scene18_girlJumpX, g_vars->scene18_girlJumpY, MV_GRL18_JUMPTO, 0); + g_vars->scene18_girl->_priority = 50; + g_vars->scene18_girl->startAnim(MV_GRL18_JUMPTO, 0, -1); +} + +void sceneHandler18and19_manStandArmchair() { + g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT); + g_fp->_aniMan->_flags |= 1; + g_fp->_aniMan->_priority = 35; + g_fp->_aniMan->startAnim(MV_MAN18_STANDKRESLO, 0, -1); +} + void sceneHandler18and19_drawRiders() { - warning("STUB: sceneHandler18and19_drawRiders()"); + g_vars->scene18_rotationCounter++; + + if (g_vars->scene18_rotationCounter >= 359) + g_vars->scene18_rotationCounter = 0; + + for (uint i = 0; i < g_vars->scene18_swingers.size(); i++) { + Swinger *swinger = g_vars->scene18_swingers[i]; + + double oldangle = swinger->angle; + + swinger->angle += ANGLE(1); + + if (swinger->angle > ANGLE(360)) { + swinger->angle -= ANGLE(360); + oldangle -= ANGLE(360); + } + + int ix = g_vars->scene18_wheelCenterX - (int)(cos(swinger->angle) * -575.0); + int iy = g_vars->scene18_wheelCenterY - (int)(sin(swinger->angle) * -575.0) + 87; + + if (!g_vars->scene18_rotationCounter) { + ix = swinger->sx; + iy = swinger->sy; + swinger->angle = (double)i * ANGLE(45); + } + + if (swinger->ani->_movement) + swinger->ani->setOXY(ix - swinger->ix + swinger->ani->_movement->_ox, iy - swinger->iy + swinger->ani->_movement->_oy); + else + swinger->ani->setOXY(ix - swinger->ix + swinger->ani->_ox, iy - swinger->iy + swinger->ani->_oy); + + swinger->ix = ix; + swinger->iy = iy; + + if (!swinger->ani->_movement) { + int mv = 0; + + if (swinger->sflags & 2) { + mv = MV_KSL_SWINGBOY; + } else if (swinger->sflags & 4) { + mv = MV_KSL_SWINGGIRL; + } else if (swinger->sflags & 0x20) { + mv = MV_KSL_SWINGMAN; + } else if (swinger->sflags & 1) { + mv = MV_KSL_SWING; + } + + if (mv) + swinger->ani->startAnim(mv, 0, -1); + + if (swinger->ani->_movement) + swinger->ani->_movement->_counter = 0; + } + + if (g_vars->scene18_wheelIsTurning) { + if ((swinger->sflags & 2) && swinger->angle >= ANGLE(160) && oldangle < ANGLE(160)) { + swinger->sflags = 8; + swinger->ani->changeStatics2(ST_KSL_BOY); + swinger->ani->startAnim(MV_KSL_JUMPBOY, 0, -1); + g_vars->scene18_kidWheelPos = i; + } else if ((swinger->sflags & 4) && swinger->angle >= ANGLE(162) && oldangle < ANGLE(162)) { + swinger->sflags = 16; + swinger->ani->changeStatics2(ST_KSL_GIRL); + swinger->ani->startAnim(MV_KSL_JUMPGIRL, 0, -1); + g_vars->scene18_kidWheelPos = i; + } else if (g_vars->scene18_kidIsOnWheel) { + if (g_vars->scene18_boyIsOnWheel > 0 && (swinger->sflags & 1) && swinger->angle >= ANGLE(185) && oldangle < ANGLE(185)) { + g_vars->scene18_kidWheelPosTo = i; + sceneHandler18and19_boyJumpTo(); + } + } else if (g_vars->scene18_girlIsOnWheel > 0 && (swinger->sflags & 1) && swinger->angle >= ANGLE(187) && oldangle < ANGLE(187)) { + g_vars->scene18_kidWheelPosTo = i; + sceneHandler18and19_girlJumpTo(); + } + + if (swinger->angle >= ANGLE(200) && oldangle < ANGLE(200)) { + if (g_vars->scene18_boyJumpedOff) + g_vars->scene18_boyIsOnWheel++; + + g_vars->scene18_boyJumpedOff = false; + } + } + + if (g_vars->scene18_manIsReady && (swinger->sflags & 1) && swinger->angle >= ANGLE(83) && oldangle < ANGLE(83)) { + g_vars->scene18_manWheelPosTo = i; + sceneHandler18and19_manStandArmchair(); + } + + if (!g_vars->scene18_enteredTrubaRight) + continue; + + if ((int)i == g_vars->scene18_manWheelPosTo) { + if (swinger->angle >= ANGLE(170) && oldangle < ANGLE(170)) { + g_fp->_gameLoader->preloadScene(SC_18, TrubaRight); + } else if (swinger->angle >= ANGLE(25) && oldangle < ANGLE(25)) { + g_fp->_gameLoader->preloadScene(SC_19, TrubaRight); + } else if (swinger->angle >= ANGLE(270) && oldangle < ANGLE(270)) { + g_fp->_sceneRect.translate(1200, 0); + } + } + + if (g_vars->scene18_jumpDistance > 0) { + if (swinger->sflags & 0x20) { + double newa = (double)g_vars->scene18_jumpAngle * ANGLE(1); + + if (newa <= swinger->angle && oldangle < newa) { + swinger->ani->changeStatics2(ST_KSL_MAN); + swinger->ani->startAnim(MV_KSL_JUMPMAN, 0, -1); + swinger->ani->_priority = 35; + + g_vars->scene18_manWheelPos = i; + } + } + } + } } void sceneHandler18and19_animateRiders() { - warning("STUB: sceneHandler18and19_animateRiders()"); + for (uint i = 0; i < g_vars->scene18_swingers.size(); i++) { + Swinger *swinger = g_vars->scene18_swingers[i]; + + if (!swinger->ani->_movement) { + int mv = 0; + + if (swinger->sflags & 2) + mv = MV_KSL_SWINGBOY; + else if (swinger->sflags & 4) + mv = MV_KSL_SWINGGIRL; + else if (swinger->sflags & 0x20) + mv = MV_KSL_SWINGMAN; + + if (mv) + swinger->ani->startAnim(mv, 0, -1); + + if (swinger->ani->_movement) + swinger->ani->_movement->_counter = 0; + } + } } int sceneHandler18(ExCommand *cmd) { @@ -457,7 +702,7 @@ int sceneHandler18(ExCommand *cmd) { break; case MSG_SC18_MANREADY: - g_vars->scene18_var28 = 1; + g_vars->scene18_manIsReady = true; break; case MSG_SC18_SHOWMANJUMPTO: @@ -482,8 +727,9 @@ int sceneHandler18(ExCommand *cmd) { case 29: { - if (g_vars->scene18_var15) { + if (g_vars->scene18_enteredTrubaRight) { cmd->_messageKind = 0; + break; } @@ -498,6 +744,7 @@ int sceneHandler18(ExCommand *cmd) { if (!(g_fp->_aniMan->_flags & 0x100) && g_fp->_msgObjectId2 != g_vars->scene18_domino->_id) { handleObjectInteraction(g_fp->_aniMan, g_vars->scene18_domino, cmd->_keyCode); cmd->_messageKind = 0; + break; } } @@ -507,7 +754,7 @@ int sceneHandler18(ExCommand *cmd) { || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0)) { g_fp->processArcade(cmd); - g_vars->scene18_var28 = 0; + g_vars->scene18_manIsReady = false; break; } @@ -520,27 +767,28 @@ int sceneHandler18(ExCommand *cmd) { if (g_fp->_aniMan2) { int x = g_fp->_aniMan2->_ox; - g_vars->scene18_var11 = g_fp->_aniMan2->_oy; + g_vars->scene18_manY = g_fp->_aniMan2->_oy; - if (x < g_fp->_sceneRect.left + g_vars->scene18_var16) - g_fp->_currentScene->_x = x - g_vars->scene18_var18 - g_fp->_sceneRect.left; + if (x < g_fp->_sceneRect.left + 200) + g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left; - if (x > g_fp->_sceneRect.right - g_vars->scene18_var16) - g_fp->_currentScene->_x = x + g_vars->scene18_var18 - g_fp->_sceneRect.right; + if (x > g_fp->_sceneRect.right - 200) + g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right; } - if (g_vars->scene18_var28 && g_fp->_aniMan->_movement) - g_vars->scene18_var28 = 0; + if (g_vars->scene18_manIsReady && g_fp->_aniMan->_movement) + g_vars->scene18_manIsReady = false; - if (g_vars->scene18_var08) { - if (!g_vars->scene18_var12) + if (g_vars->scene18_bridgeIsConvoluted) { + if (!g_vars->scene18_wheelFlipper) sceneHandler18and19_drawRiders(); - g_vars->scene18_var12 = g_vars->scene18_var12 == 0; + g_vars->scene18_wheelFlipper = !g_vars->scene18_wheelFlipper; if (!g_vars->scene18_whirlgig->_movement) { g_vars->scene18_whirlgig->startAnim(MV_WHR18_SPIN, 0, -1); g_fp->_behaviorManager->updateBehaviors(); + break; } } else { @@ -548,6 +796,7 @@ int sceneHandler18(ExCommand *cmd) { } g_fp->_behaviorManager->updateBehaviors(); + break; } @@ -560,8 +809,8 @@ void sceneHandler19_updateNumRides() { if (numRides > 1) { g_fp->setObjectState(sO_Girl, g_fp->getObjectEnumState(sO_Girl, sO_IsSwinging)); - g_vars->scene18_var23 = 1; - g_vars->scene18_var25++; + g_vars->scene18_kidIsOnWheel = 1; + g_vars->scene18_girlIsOnWheel++; numRides = 0; } @@ -599,36 +848,36 @@ int sceneHandler19(ExCommand *cmd) { break; case 29: - if (g_vars->scene18_var15) { + if (g_vars->scene18_enteredTrubaRight) { switch (g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY)) { case PIC_SC19_RTRUBA1: - g_vars->scene18_var13 = 1; - g_vars->scene18_var14 = 331; + g_vars->scene18_jumpDistance = 1; + g_vars->scene18_jumpAngle = 331; cmd->_messageKind = 0; break; case PIC_SC19_RTRUBA2: - g_vars->scene18_var13 = 2; - g_vars->scene18_var14 = 350; + g_vars->scene18_jumpDistance = 2; + g_vars->scene18_jumpAngle = 350; cmd->_messageKind = 0; break; case PIC_SC19_RTRUBA3: - g_vars->scene18_var13 = 3; - g_vars->scene18_var14 = 9; + g_vars->scene18_jumpDistance = 3; + g_vars->scene18_jumpAngle = 9; cmd->_messageKind = 0; break; default: - g_vars->scene18_var13 = -1; - g_vars->scene18_var14 = -1; + g_vars->scene18_jumpDistance = -1; + g_vars->scene18_jumpAngle = -1; cmd->_messageKind = 0; break; } break; } - if (g_vars->scene19_var05) { + if (g_vars->scene19_enteredTruba3) { if (g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY) == PIC_SC19_RTRUBA3) { if (g_fp->_aniMan->isIdle()) { if (!(g_fp->_aniMan->_flags & 0x100)) { @@ -646,25 +895,26 @@ int sceneHandler19(ExCommand *cmd) { if (g_fp->_aniMan2) { int x = g_fp->_aniMan2->_ox; - g_vars->scene18_var11 = g_fp->_aniMan2->_oy; + g_vars->scene18_manY = g_fp->_aniMan2->_oy; - if (x < g_fp->_sceneRect.left + g_vars->scene18_var16) - g_fp->_currentScene->_x = x - g_vars->scene18_var18 - g_fp->_sceneRect.left; + if (x < g_fp->_sceneRect.left + 200) + g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left; - if (x > g_fp->_sceneRect.right - g_vars->scene18_var16) - g_fp->_currentScene->_x = x + g_vars->scene18_var18 - g_fp->_sceneRect.right; + if (x > g_fp->_sceneRect.right - 200) + g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right; } - if (g_vars->scene18_var08) { - if (!g_vars->scene18_var12) + if (g_vars->scene18_bridgeIsConvoluted) { + if (!g_vars->scene18_wheelFlipper) sceneHandler18and19_drawRiders(); - g_vars->scene18_var12 = !g_vars->scene18_var12; + g_vars->scene18_wheelFlipper = !g_vars->scene18_wheelFlipper; if (!g_vars->scene18_whirlgig->_movement) { g_vars->scene18_whirlgig->startAnim(MV_WHR19_SPIN, 0, -1); g_fp->_behaviorManager->updateBehaviors(); + break; } } else { @@ -672,6 +922,7 @@ int sceneHandler19(ExCommand *cmd) { } g_fp->_behaviorManager->updateBehaviors(); + break; } diff --git a/engines/fullpipe/scenes/scene29.cpp b/engines/fullpipe/scenes/scene29.cpp new file mode 100644 index 0000000000..2d5127137d --- /dev/null +++ b/engines/fullpipe/scenes/scene29.cpp @@ -0,0 +1,1125 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "fullpipe/fullpipe.h" + +#include "fullpipe/objectnames.h" +#include "fullpipe/constants.h" + +#include "fullpipe/gameloader.h" +#include "fullpipe/motion.h" +#include "fullpipe/scenes.h" +#include "fullpipe/statics.h" + +#include "fullpipe/interaction.h" +#include "fullpipe/behavior.h" + + +namespace Fullpipe { + +struct WalkingBearder { + StaticANIObject *ani; + int wbflag; + int wbcounter; +}; + +void scene29_initScene(Scene *sc) { + g_vars->scene29_porter = sc->getStaticANIObject1ById(ANI_PORTER, -1); + g_vars->scene29_shooter1 = sc->getStaticANIObject1ById(ANI_SHOOTER1, -1); + g_vars->scene29_shooter2 = sc->getStaticANIObject1ById(ANI_SHOOTER2, -1); + g_vars->scene29_ass = sc->getStaticANIObject1ById(ANI_ASS, -1); + + g_vars->scene29_balls.numBalls = 0; + g_vars->scene29_balls.pTail = 0; + g_vars->scene29_balls.field_8 = 0; + g_vars->scene29_balls.pHead = 0; + + free(g_vars->scene29_balls.cPlex); + g_vars->scene29_balls.cPlex = 0; + + StaticANIObject *ani; + + g_vars->scene29_greenBalls.numBalls = 0; + g_vars->scene29_greenBalls.pTail = 0; + g_vars->scene29_greenBalls.field_8 = 0; + g_vars->scene29_greenBalls.pHead = 0; + + free(g_vars->scene29_greenBalls.cPlex); + g_vars->scene29_greenBalls.cPlex = 0; + + ani = sc->getStaticANIObject1ById(ANI_SHELL_GREEN, -1); + Ball *b = g_vars->scene29_balls.sub04(g_vars->scene29_balls.field_8, 0); + b->ani = ani; + + if (g_vars->scene29_balls.field_8) + g_vars->scene29_balls.field_8->p0 = b; + else + g_vars->scene29_balls.pHead = b; + + g_vars->scene29_balls.field_8 = b; + + for (int i = 0; i < 2; i++) { + StaticANIObject *newani = new StaticANIObject(ani); + + sc->addStaticANIObject(newani, 1); + + b = g_vars->scene29_balls.sub04(g_vars->scene29_balls.field_8, 0); + b->ani = ani; + + if (g_vars->scene29_balls.field_8) + g_vars->scene29_balls.field_8->p0 = b; + else + g_vars->scene29_balls.pHead = b; + + g_vars->scene29_balls.field_8 = b; + } + + g_vars->scene29_redBalls.numBalls = 0; + g_vars->scene29_redBalls.pTail = 0; + g_vars->scene29_redBalls.field_8 = 0; + g_vars->scene29_redBalls.pHead = 0; + + free(g_vars->scene29_redBalls.cPlex); + g_vars->scene29_redBalls.cPlex = 0; + + g_vars->scene29_flyingRedBalls.numBalls = 0; + g_vars->scene29_flyingRedBalls.pTail = 0; + g_vars->scene29_flyingRedBalls.field_8 = 0; + g_vars->scene29_flyingRedBalls.pHead = 0; + + free(g_vars->scene29_flyingRedBalls.cPlex); + g_vars->scene29_flyingRedBalls.cPlex = 0; + + ani = sc->getStaticANIObject1ById(ANI_SHELL_RED, -1); + + b = g_vars->scene29_redBalls.sub04(g_vars->scene29_redBalls.field_8, 0); + b->ani = ani; + + if (g_vars->scene29_redBalls.field_8) + g_vars->scene29_redBalls.field_8->p0 = b; + else + g_vars->scene29_redBalls.pHead = b; + + g_vars->scene29_redBalls.field_8 = b; + + for (int i = 0; i < 2; i++) { + StaticANIObject *newani = new StaticANIObject(ani); + + sc->addStaticANIObject(newani, 1); + + b = g_vars->scene29_redBalls.sub04(g_vars->scene29_redBalls.field_8, 0); + b->ani = ani; + + if (g_vars->scene29_redBalls.field_8) + g_vars->scene29_redBalls.field_8->p0 = b; + else + g_vars->scene29_redBalls.pHead = b; + + g_vars->scene29_redBalls.field_8 = b; + } + + g_vars->scene29_bearders.clear(); + + ani = new StaticANIObject(g_fp->accessScene(SC_COMMON)->getStaticANIObject1ById(ANI_BEARDED_CMN, -1)); + + ani->_statics = ani->getStaticsById(ST_BRDCMN_EMPTY); + + sc->addStaticANIObject(ani, 1); + + WalkingBearder *wb = new WalkingBearder; + + wb->ani = ani; + wb->wbflag = 0; + wb->wbcounter = 0; + + g_vars->scene29_bearders.push_back(wb); + + g_vars->scene29_manIsRiding = false; + g_vars->scene29_arcadeIsOn = false; + g_vars->scene29_reachedFarRight = false; + g_vars->scene29_rideBackEnabled = false; + g_vars->scene29_shootCountdown = 0; + g_vars->scene29_shootDistance = 75; + g_vars->scene29_manIsHit = false; + g_vars->scene29_scrollSpeed = 0; + g_vars->scene29_scrollingDisabled = false; + g_vars->scene29_hitBall = 0; + + g_fp->setArcadeOverlay(PIC_CSR_ARCADE8); +} + +void sceneHandler29_winArcade() { + if (g_vars->scene29_shooter2->_flags & 4) { + g_vars->scene29_shootCountdown = 0; + + g_vars->scene29_shooter1->changeStatics2(ST_STR1_STAND); + g_vars->scene29_shooter2->changeStatics2(ST_STR2_STAND); + + g_vars->scene29_shooter2->_flags &= 0xFFFB; + + StaticANIObject *ani; + Ball *newball, *ball, *oldp0; + + while (g_vars->scene29_greenBalls.numBalls) { + ball = g_vars->scene29_greenBalls.pHead; + ani = g_vars->scene29_greenBalls.pHead->ani; + oldp0 = g_vars->scene29_greenBalls.pHead->p0; + g_vars->scene29_greenBalls.pHead = g_vars->scene29_greenBalls.pHead->p0; + + if (g_vars->scene29_greenBalls.pHead) + oldp0->p1 = 0; + else + g_vars->scene29_greenBalls.field_8 = 0; + + ball->p0 = g_vars->scene29_greenBalls.pTail; + g_vars->scene29_greenBalls.pTail = ball; + g_vars->scene29_greenBalls.numBalls--; + + if (!g_vars->scene29_greenBalls.numBalls) + g_vars->scene29_greenBalls.reset(); + + ani->hide(); + + newball = g_vars->scene29_balls.sub04(g_vars->scene29_balls.field_8, 0); + newball->ani = ani; + + if (g_vars->scene29_balls.field_8) + g_vars->scene29_balls.field_8->p0 = newball; + else + g_vars->scene29_balls.pHead = newball; + + g_vars->scene29_balls.field_8 = newball; + } + + while (g_vars->scene29_flyingRedBalls.numBalls) { + ball = g_vars->scene29_flyingRedBalls.pHead; + ani = g_vars->scene29_flyingRedBalls.pHead->ani; + oldp0 = g_vars->scene29_flyingRedBalls.pHead->p0; + g_vars->scene29_flyingRedBalls.pHead = g_vars->scene29_flyingRedBalls.pHead->p0; + + if (g_vars->scene29_flyingRedBalls.pHead) + oldp0->p1 = 0; + else + g_vars->scene29_flyingRedBalls.field_8 = 0; + + ball->p0 = g_vars->scene29_flyingRedBalls.pTail; + g_vars->scene29_flyingRedBalls.pTail = ball; + g_vars->scene29_flyingRedBalls.numBalls--; + + if (!g_vars->scene29_flyingRedBalls.numBalls) { + g_vars->scene29_flyingRedBalls.numBalls = 0; + g_vars->scene29_flyingRedBalls.pTail = 0; + g_vars->scene29_flyingRedBalls.field_8 = 0; + g_vars->scene29_flyingRedBalls.pHead = 0; + + free(g_vars->scene29_flyingRedBalls.cPlex); + + g_vars->scene29_flyingRedBalls.cPlex = 0; + } + + ani->hide(); + + newball = g_vars->scene29_redBalls.sub04(g_vars->scene29_redBalls.field_8, 0); + newball->ani = ani; + + if (g_vars->scene29_redBalls.field_8) + g_vars->scene29_redBalls.field_8->p0 = newball; + else + g_vars->scene29_redBalls.pHead = newball; + + g_vars->scene29_redBalls.field_8 = newball; + } + + g_vars->scene29_ass->queueMessageQueue(0); + g_vars->scene29_ass->_flags &= 0xFFFB; + + chainQueue(QU_SC29_ESCAPE, 1); + } + + g_fp->setObjectState(sO_LeftPipe_29, g_fp->getObjectEnumState(sO_LeftPipe_29, sO_IsOpened)); +} + +void sceneHandler29_shootGreen() { + if (g_vars->scene29_balls.numBalls) { + int x = g_vars->scene29_shooter1->_ox - 113; + int y = g_vars->scene29_shooter1->_oy - 48; + StaticANIObject *ani = g_vars->scene29_balls.pHead->ani; + Ball *oldhead = g_vars->scene29_balls.pHead; + Ball *oldp0 = g_vars->scene29_balls.pHead->p0; + + g_vars->scene29_balls.pHead = g_vars->scene29_balls.pHead->p0; + + if (g_vars->scene29_balls.pHead) + oldp0->p1 = 0; + else + g_vars->scene29_balls.field_8 = 0; + + oldhead->p0 = g_vars->scene29_balls.pTail; + + g_vars->scene29_balls.pTail = oldhead; + g_vars->scene29_balls.numBalls--; + + if (!g_vars->scene29_balls.numBalls) { + g_vars->scene29_balls.numBalls = 0; + g_vars->scene29_balls.pTail = 0; + g_vars->scene29_balls.field_8 = 0; + g_vars->scene29_balls.pHead = 0; + + free(g_vars->scene29_balls.cPlex); + g_vars->scene29_balls.cPlex = 0; + } + + ani->show1(x, y, MV_SHG_NORM, 0); + ani->_priority = 5; + + Ball *runPtr = g_vars->scene29_greenBalls.pTail; + Ball *lastP = g_vars->scene29_greenBalls.field_8; + + if (!g_vars->scene29_greenBalls.pTail) { + g_vars->scene29_greenBalls.cPlex = (byte *)calloc(g_vars->scene29_greenBalls.cPlexLen, sizeof(Ball)); + + byte *p1 = g_vars->scene29_greenBalls.cPlex + (g_vars->scene29_greenBalls.cPlexLen - 1) * sizeof(Ball); + + if (g_vars->scene29_greenBalls.cPlexLen - 1 < 0) { + runPtr = g_vars->scene29_greenBalls.pTail; + } else { + runPtr = g_vars->scene29_greenBalls.pTail; + + for (int j = 0; j < g_vars->scene29_greenBalls.cPlexLen; j++) { + ((Ball *)p1)->p1 = runPtr; + runPtr = (Ball *)p1; + + p1 -= sizeof(Ball); + } + + g_vars->scene29_greenBalls.pTail = runPtr; + } + } + g_vars->scene29_greenBalls.pTail = runPtr->p0; + runPtr->p1 = lastP; + runPtr->p0 = 0; + runPtr->ani = ani; + + g_vars->scene29_greenBalls.numBalls++; + + if (g_vars->scene29_greenBalls.field_8) { + g_vars->scene29_greenBalls.field_8->p0 = runPtr; + g_vars->scene29_greenBalls.field_8 = runPtr; + } else { + g_vars->scene29_greenBalls.pHead = runPtr; + g_vars->scene29_greenBalls.field_8 = runPtr; + } + } +} + +void sceneHandler29_shootRed() { + if (g_vars->scene29_balls.numBalls) { + int x = g_vars->scene29_shooter1->_ox - 101; + int y = g_vars->scene29_shooter1->_oy - 14; + StaticANIObject *ani = g_vars->scene29_balls.pHead->ani; + Ball *oldhead = g_vars->scene29_balls.pHead; + Ball *oldp0 = g_vars->scene29_balls.pHead->p0; + + g_vars->scene29_balls.pHead = g_vars->scene29_balls.pHead->p0; + + if (g_vars->scene29_balls.pHead) + oldp0->p1 = 0; + else + g_vars->scene29_balls.field_8 = 0; + + oldhead->p0 = g_vars->scene29_balls.pTail; + + g_vars->scene29_balls.pTail = oldhead; + g_vars->scene29_balls.numBalls--; + + if (!g_vars->scene29_balls.numBalls) { + g_vars->scene29_balls.numBalls = 0; + g_vars->scene29_balls.pTail = 0; + g_vars->scene29_balls.field_8 = 0; + g_vars->scene29_balls.pHead = 0; + + free(g_vars->scene29_balls.cPlex); + g_vars->scene29_balls.cPlex = 0; + } + + ani->show1(x, y, MV_SHR_NORM, 0); + ani->_priority = 5; + + Ball *runPtr = g_vars->scene29_flyingRedBalls.pTail; + Ball *lastP = g_vars->scene29_flyingRedBalls.field_8; + + if (!g_vars->scene29_flyingRedBalls.pTail) { + g_vars->scene29_flyingRedBalls.cPlex = (byte *)calloc(g_vars->scene29_flyingRedBalls.cPlexLen, sizeof(Ball)); + + byte *p1 = g_vars->scene29_flyingRedBalls.cPlex + (g_vars->scene29_flyingRedBalls.cPlexLen - 1) * sizeof(Ball); + + if (g_vars->scene29_flyingRedBalls.cPlexLen - 1 < 0) { + runPtr = g_vars->scene29_flyingRedBalls.pTail; + } else { + runPtr = g_vars->scene29_flyingRedBalls.pTail; + + for (int j = 0; j < g_vars->scene29_flyingRedBalls.cPlexLen; j++) { + ((Ball *)p1)->p1 = runPtr; + runPtr = (Ball *)p1; + + p1 -= sizeof(Ball); + } + + g_vars->scene29_flyingRedBalls.pTail = runPtr; + } + } + g_vars->scene29_flyingRedBalls.pTail = runPtr->p0; + runPtr->p1 = lastP; + runPtr->p0 = 0; + runPtr->ani = ani; + + g_vars->scene29_flyingRedBalls.numBalls++; + + if (g_vars->scene29_flyingRedBalls.field_8) { + g_vars->scene29_flyingRedBalls.field_8->p0 = runPtr; + g_vars->scene29_flyingRedBalls.field_8 = runPtr; + } else { + g_vars->scene29_flyingRedBalls.pHead = runPtr; + g_vars->scene29_flyingRedBalls.field_8 = runPtr; + } + } +} + +void sceneHandler29_manJump() { + if (!g_fp->_aniMan->_movement || g_fp->_aniMan->_movement->_id == MV_MAN29_RUN || g_fp->_aniMan->_movement->_id == MV_MAN29_STANDUP) { + g_vars->scene29_rideBackEnabled = false; + g_vars->scene29_manIsHit = false; + g_vars->scene29_reachedFarRight = true; + + g_fp->_aniMan->changeStatics2(ST_MAN29_RUNR); + g_fp->_aniMan->startAnim(MV_MAN29_JUMP, 0, -1); + } + + g_vars->scene29_manX = g_fp->_aniMan->_ox; + g_vars->scene29_manY = g_fp->_aniMan->_oy; +} + +void sceneHandler29_manBend() { + if (!g_fp->_aniMan->_movement || g_fp->_aniMan->_movement->_id == MV_MAN29_RUN || g_fp->_aniMan->_movement->_id == MV_MAN29_STANDUP) { + g_vars->scene29_rideBackEnabled = false; + g_vars->scene29_manIsHit = false; + g_vars->scene29_reachedFarRight = true; + + g_fp->_aniMan->changeStatics2(ST_MAN29_RUNR); + g_fp->_aniMan->startAnim(MV_MAN29_BEND, 0, -1); + } + + g_vars->scene29_manX = g_fp->_aniMan->_ox; + g_vars->scene29_manY = g_fp->_aniMan->_oy; +} + +bool sceneHandler29_checkRedBallHit(StaticANIObject *ani, int maxx) { + if (!g_vars->scene29_arcadeIsOn || g_vars->scene29_manIsHit) + return false; + + if ((ani->_ox >= g_vars->scene29_manX + 42 || ani->_ox <= g_vars->scene29_manX + 8) + && (ani->_ox < g_vars->scene29_manX + 8 || maxx > g_vars->scene29_manX + 27)) + return false; + + if (!g_fp->_aniMan->_movement) + return true; + + int phase = g_fp->_aniMan->_movement->_currDynamicPhaseIndex; + + if (g_fp->_aniMan->_movement->_id != MV_MAN29_BEND && g_fp->_aniMan->_movement->_id != MV_MAN29_RUN + && (g_fp->_aniMan->_movement->_id != MV_MAN29_JUMP || (phase >= 3 && phase <= 6))) + return false; + else + return true; +} + +bool sceneHandler29_checkGreenBallHit(StaticANIObject *ani, int maxx) { + if (!g_vars->scene29_arcadeIsOn || g_vars->scene29_manIsHit) + return false; + + if (ani->_ox >= g_vars->scene29_manX + 40) { + if (maxx > g_vars->scene29_manX + 27) + return false; + } else { + if (ani->_ox <= g_vars->scene29_manX + 10) { + if (ani->_ox < g_vars->scene29_manX + 40) + return false; + + if (maxx > g_vars->scene29_manX + 27) + return false; + } + } + + if (!g_fp->_aniMan->_movement) + return true; + + if (g_fp->_aniMan->_movement->_id == MV_MAN29_JUMP) + return true; + + if (g_fp->_aniMan->_movement->_id == MV_MAN29_RUN) + return true; + + if (g_fp->_aniMan->_movement->_id == MV_MAN29_BEND) { + if (g_fp->_aniMan->_movement->_currDynamicPhaseIndex < 1 || g_fp->_aniMan->_movement->_currDynamicPhaseIndex > 5) + return true; + } + + return false; +} + +void sceneHandler29_manHit() { + MGMInfo mgminfo; + + g_vars->scene29_manIsHit = true; + + g_fp->_aniMan->changeStatics2(ST_MAN29_RUNR); + g_fp->_aniMan->setOXY(g_vars->scene29_manX, g_vars->scene29_manY); + + mgminfo.ani = g_fp->_aniMan; + mgminfo.staticsId2 = ST_MAN29_SITR; + mgminfo.y1 = 463; + mgminfo.x1 = g_vars->scene29_manX <= 638 ? 351 : 0; + mgminfo.field_1C = 10; + mgminfo.field_10 = 1; + mgminfo.flags = (g_vars->scene29_manX <= 638 ? 2 : 0) | 0x44; + mgminfo.movementId = MV_MAN29_HIT; + + MessageQueue *mq = g_vars->scene29_mgm.genMovement(&mgminfo); + ExCommand *ex; + + if (mq) { + if (g_vars->scene29_manX <= 638) { + ex = new ExCommand(ANI_MAN, 1, MV_MAN29_STANDUP_NORM, 0, 0, 0, 1, 0, 0, 0); + ex->_excFlags = 2; + ex->_keyCode = g_fp->_aniMan->_okeyCode; + mq->addExCommandToEnd(ex); + + ex = new ExCommand(0, 17, MSG_SC29_STOPRIDE, 0, 0, 0, 1, 0, 0, 0); + ex->_excFlags = 2; + mq->addExCommandToEnd(ex); + + g_vars->scene29_manIsRiding = false; + g_vars->scene29_arcadeIsOn = false; + g_vars->scene29_reachedFarRight = false; + g_vars->scene29_rideBackEnabled = false; + } else { + ex = new ExCommand(ANI_MAN, 1, MV_MAN29_STANDUP, 0, 0, 0, 1, 0, 0, 0); + ex->_excFlags = 2; + ex->_keyCode = g_fp->_aniMan->_okeyCode; + mq->addExCommandToEnd(ex); + } + + mq->setFlags(mq->getFlags() | 1); + + if (!mq->chain(g_fp->_aniMan)) + delete mq; + } +} + +void sceneHandler29_assHitRed() { + if (g_vars->scene29_ass->_statics->_staticsId == ST_ASS_NORM) { + g_vars->scene29_ass->changeStatics2(ST_ASS_NORM); + g_vars->scene29_ass->startAnim(MV_ASS_HITRED, 0, -1); + } +} + +void sceneHandler29_assHitGreen() { + if (g_vars->scene29_ass->_statics->_staticsId == ST_ASS_NORM) { + g_vars->scene29_ass->changeStatics2(ST_ASS_NORM); + g_vars->scene29_ass->startAnim(MV_ASS_HITGREEN, 0, -1); + } +} + +void sceneHandler29_ballHitCheck() { + Ball *ball = g_vars->scene29_greenBalls.pHead; + Ball *newball; + int x, y; + + while (ball) { + x = ball->ani->_ox - 30; + y = ball->ani->_oy; + + if (x >= 186) { + if (sceneHandler29_checkGreenBallHit(ball->ani, x)) { + newball = g_vars->scene29_balls.sub04(g_vars->scene29_balls.field_8, 0); + newball->ani = ball->ani; + + if (g_vars->scene29_balls.field_8) + g_vars->scene29_balls.field_8->p0 = newball; + else + g_vars->scene29_balls.pHead = newball; + + g_vars->scene29_balls.field_8 = newball; + + if (ball == g_vars->scene29_greenBalls.pHead) + g_vars->scene29_greenBalls.pHead = ball->p0; + else + ball->p1->p0 = ball->p0; + + if (ball == g_vars->scene29_greenBalls.field_8) + g_vars->scene29_greenBalls.field_8 = ball->p1; + else + ball->p0->p1 = ball->p1; + + g_vars->scene29_greenBalls.init(&ball); + + sceneHandler29_manHit(); + + g_fp->playSound(SND_29_014, 0); + + ball->ani->startAnim(MV_SHG_HITMAN, 0, -1); + + g_vars->scene29_hitBall = ball->ani->_id; + } else { + ball->ani->setOXY(x, y); + } + } else { + newball = g_vars->scene29_balls.sub04(g_vars->scene29_balls.field_8, 0); + newball->ani = ball->ani; + + if (g_vars->scene29_balls.field_8) + g_vars->scene29_balls.field_8->p0 = newball; + else + g_vars->scene29_balls.pHead = newball; + + g_vars->scene29_balls.field_8 = newball; + + ball->ani->hide(); + + if (ball == g_vars->scene29_greenBalls.pHead) + g_vars->scene29_greenBalls.pHead = ball->p0; + else + ball->p1->p0 = ball->p0; + + if (ball == g_vars->scene29_greenBalls.field_8) + g_vars->scene29_greenBalls.field_8 = ball->p1; + else + ball->p0->p1 = ball->p1; + + g_vars->scene29_greenBalls.init(&ball); + + sceneHandler29_assHitGreen(); + } + + ball = ball->p0; + } + + ball = g_vars->scene29_flyingRedBalls.pHead; + + while (ball) { + x = ball->ani->_ox - 30; + y = ball->ani->_oy; + + if (x >= 147) { + if (sceneHandler29_checkRedBallHit(ball->ani, x)) { + newball = g_vars->scene29_redBalls.sub04(g_vars->scene29_redBalls.field_8, 0); + newball->ani = ball->ani; + + if (g_vars->scene29_redBalls.field_8) + g_vars->scene29_redBalls.field_8->p0 = newball; + else + g_vars->scene29_redBalls.pHead = newball; + + g_vars->scene29_redBalls.field_8 = newball; + + g_vars->scene29_flyingRedBalls.removeBall(ball); + + sceneHandler29_manHit(); + + g_fp->playSound(SND_29_027, 0); + + ball->ani->startAnim(MV_SHR_HITMAN, 0, -1); + + g_vars->scene29_hitBall = ball->ani->_id; + } else { + ball->ani->setOXY(x, y); + } + } else { + newball = g_vars->scene29_redBalls.sub04(g_vars->scene29_redBalls.field_8, 0); + newball->ani = ball->ani; + + if (g_vars->scene29_redBalls.field_8) + g_vars->scene29_redBalls.field_8->p0 = newball; + else + g_vars->scene29_redBalls.pHead = newball; + + g_vars->scene29_redBalls.field_8 = newball; + + ball->ani->hide(); + + if (ball == g_vars->scene29_flyingRedBalls.pHead) + g_vars->scene29_flyingRedBalls.pHead = ball->p0; + else + ball->p1->p0 = ball->p0; + + if (ball == g_vars->scene29_flyingRedBalls.field_8) + g_vars->scene29_flyingRedBalls.field_8 = ball->p1; + else + ball->p0->p1 = ball->p1; + + g_vars->scene29_flyingRedBalls.init(&ball); + + sceneHandler29_assHitRed(); + } + + ball = ball->p0; + } +} + +void sceneHandler29_manFromL() { + if (g_vars->scene29_manX < 497 && !g_vars->scene29_scrollingDisabled) { + getCurrSceneSc2MotionController()->setEnabled(); + getGameLoaderInteractionController()->enableFlag24(); + + g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT | 0x4000); + chainQueue(QU_SC29_MANFROM_L, 1); + + g_vars->scene29_scrollingDisabled = true; + + g_fp->_scrollSpeed = g_vars->scene29_scrollSpeed; + } +} + +void sceneHandler29_manFromR() { + getCurrSceneSc2MotionController()->setEnabled(); + getGameLoaderInteractionController()->enableFlag24(); + + chainQueue(QU_SC29_MANFROM_R, 1); + + g_vars->scene29_arcadeIsOn = false; + g_vars->scene29_rideBackEnabled = false; +} + +int sceneHandler29_updateScreenCallback() { + int res; + + res = g_fp->drawArcadeOverlay(g_vars->scene29_arcadeIsOn); + + if (!res) + g_fp->_updateScreenCallback = 0; + + return res; +} + +void sceneHandler29_manToL() { + getCurrSceneSc2MotionController()->clearEnabled(); + getGameLoaderInteractionController()->disableFlag24(); + + chainQueue(QU_SC29_MANTO_L, 1); + + g_vars->scene29_arcadeIsOn = true; + + g_vars->scene29_mgm.addItem(g_fp->_aniMan->_id); + + g_fp->_updateScreenCallback = sceneHandler29_updateScreenCallback; + + g_fp->_msgY = -1; + g_fp->_msgX = -1; +} + +void sceneHandler29_manToR() { + getCurrSceneSc2MotionController()->clearEnabled(); + getGameLoaderInteractionController()->disableFlag24(); + + chainQueue(QU_SC29_MANTO_R, 1); + + g_vars->scene29_manIsRiding = true; + g_fp->_msgY = -1; + g_fp->_msgX = -1; + + g_vars->scene29_scrollingDisabled = false; + + g_vars->scene29_scrollSpeed = g_fp->_scrollSpeed; + g_fp->_scrollSpeed = 4; +} + +void sceneHandler29_clickPorter(ExCommand *cmd) { + if (!g_fp->_aniMan->isIdle() || g_fp->_aniMan->_flags & 0x100) { + cmd->_messageKind = 0; + + return; + } + + if (g_vars->scene29_manX <= g_vars->scene29_porter->_ox) { + if (ABS(351 - g_vars->scene29_manX) > 1 || ABS(443 - g_vars->scene29_manY) > 1 + || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) { + if (g_fp->_msgX != 351 || g_fp->_msgY != 443) { + MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 351, 443, 1, ST_MAN_RIGHT); + + if (mq) { + mq->addExCommandToEnd(cmd->createClone()); + + postExCommand(g_fp->_aniMan->_id, 2, 351, 443, 0, -1); + } + } + } else { + sceneHandler29_manToL(); + } + } else { + g_vars->scene29_manX = g_fp->_aniMan->_ox; + g_vars->scene29_manY = g_fp->_aniMan->_oy; + + if (ABS(1582 - g_vars->scene29_manX) > 1 || ABS(445 - g_fp->_aniMan->_oy) > 1 + || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != (0x4000 | ST_MAN_RIGHT)) { + if (g_fp->_msgX != 1582 || g_fp->_msgY != 445) { + MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 1582, 445, 1, (0x4000 | ST_MAN_RIGHT)); + + if (mq) { + mq->addExCommandToEnd(cmd->createClone()); + + postExCommand(g_fp->_aniMan->_id, 2, 1582, 445, 0, -1); + } + } + } else { + sceneHandler29_manToR(); + } + } +} + +void sceneHandler29_shootersProcess() { + if (g_fp->_aniMan->_statics->_staticsId == ST_MAN29_RUNR) { + if (g_vars->scene29_manX > 1436) { + sceneHandler29_manFromR(); + } else { + g_vars->scene29_shootDistance = (1310 - g_vars->scene29_manX) * 5213 / 100000 + 25; + + if (!g_vars->scene29_manIsHit) + g_fp->_aniMan->startAnim(MV_MAN29_RUN, 0, -1); + } + } + + g_vars->scene29_manX = g_fp->_aniMan->_ox; + g_vars->scene29_manY = g_fp->_aniMan->_oy; +} + +void sceneHandler29_shootersEscape() { + if (g_vars->scene29_arcadeIsOn) { + g_vars->scene29_manX += 2; + + g_fp->_aniMan->setOXY(g_vars->scene29_manX, g_vars->scene29_manY); + + if (g_vars->scene29_manX > 1310 && !g_vars->scene29_shooter1->_movement && !g_vars->scene29_shooter2->_movement + && g_vars->scene29_shooter1->_statics->_staticsId == ST_STR1_RIGHT) { + g_vars->scene29_shootCountdown = 0; + + g_vars->scene29_shooter1->changeStatics2(ST_STR1_STAND); + g_vars->scene29_shooter2->changeStatics2(ST_STR2_STAND); + + chainQueue(QU_SC29_ESCAPE, 1); + + g_vars->scene29_ass->queueMessageQueue(0); + g_vars->scene29_ass->hide(); + + g_fp->setObjectState(sO_LeftPipe_29, g_fp->getObjectEnumState(sO_LeftPipe_29, sO_IsOpened)); + } + } else if (g_vars->scene29_manIsRiding) { + g_vars->scene29_manX -= 4; + + g_fp->_aniMan->setOXY(g_vars->scene29_manX, g_vars->scene29_manY); + } +} + +void sceneHandler29_manRideBack() { + g_vars->scene29_manX -= 2; + + g_fp->_aniMan->setOXY(g_vars->scene29_manX, g_vars->scene29_manY); +} + +void sceneHandler29_shoot() { + if (g_vars->scene29_arcadeIsOn && g_vars->scene29_manX < 1310) { + if (g_fp->_rnd->getRandomNumber(1) || g_vars->scene29_shooter1->_movement || g_vars->scene29_shooter1->_statics->_staticsId != ST_STR1_RIGHT) { + if (!g_vars->scene29_shooter2->_movement && g_vars->scene29_shooter2->_statics->_staticsId == ST_STR2_RIGHT) { + if (g_vars->scene29_shooter2->_flags & 4) { + g_vars->scene29_shooter2->startAnim(MV_STR2_SHOOT, 0, -1); + + g_vars->scene29_shootCountdown = 0; + } + } + } else { + g_vars->scene29_shooter1->startAnim(MV_STR1_SHOOT, 0, -1); + + g_vars->scene29_shootCountdown = 0; + } + } +} + +void sceneHandler29_animBearded() { + MessageQueue *mq; + + for (uint i = 0; i < g_vars->scene29_bearders.size(); i++) { + StaticANIObject *ani = g_vars->scene29_bearders[i]->ani; + + if (g_vars->scene29_bearders[i]->wbflag) { + int x = ani->_ox; + int y = ani->_oy; + + if (!ani->_movement && ani->_statics->_staticsId == (ST_BRDCMN_RIGHT | 0x4000)) { + x -= 4; + + if (x - g_vars->scene29_manX < 100 || !g_vars->scene29_arcadeIsOn) { + mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC29_BRDOUT1), 0, 1); + + mq->replaceKeyCode(-1, ani->_okeyCode); + mq->chain(0); + + g_vars->scene29_bearders[i]->wbflag = 0; + g_vars->scene29_bearders[i]->wbcounter = 0; + } + } + + if (!ani->_movement && ani->_statics->_staticsId == ST_BRDCMN_GOR) + ani->startAnim(MV_BRDCMN_GOR, 0, -1); + + if (ani->_movement) { + if (ani->_movement->_id == MV_BRDCMN_GOR) { + x -= 4; + + if (g_vars->scene29_manX - x < 60 || x - g_vars->scene29_manX < -260 || !g_vars->scene29_arcadeIsOn) { + ani->changeStatics2(ST_BRDCMN_RIGHT); + + mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC29_BRDOUT2), 0, 1); + + mq->replaceKeyCode(-1, ani->_okeyCode); + mq->chain(0); + + g_vars->scene29_bearders[i]->wbflag = 0; + g_vars->scene29_bearders[i]->wbcounter = 0; + } + } + } + + ani->setOXY(x, y); + continue; + } + + if (g_vars->scene29_arcadeIsOn && g_vars->scene29_bearders[i]->wbcounter > 30) { + int newx; + + if (g_fp->_rnd->getRandomNumber(1)) + goto dostuff; + + if (g_vars->scene29_manX <= 700) { + g_vars->scene29_bearders[i]->wbcounter++; + continue; + } + + if (g_vars->scene29_manX >= 1100) { + dostuff: + if (g_vars->scene29_manX <= 700 || g_vars->scene29_manX >= 1350) { + g_vars->scene29_bearders[i]->wbcounter++; + continue; + } + + mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC29_BRD2), 0, 1); + + newx = g_vars->scene29_manX - 200; + } else { + mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC29_BRD1), 0, 1); + + newx = g_vars->scene29_manX + 350; + } + + mq->getExCommandByIndex(0)->_x = newx; + mq->replaceKeyCode(-1, ani->_okeyCode); + mq->chain(0); + + g_vars->scene29_bearders[i]->wbflag = 1; + g_vars->scene29_bearders[i]->wbcounter = 0; + } + + g_vars->scene29_bearders[i]->wbcounter++; + } +} + + + +int sceneHandler29(ExCommand *cmd) { + if (cmd->_messageKind != 17) + return 0; + + switch (cmd->_messageNum) { + case MSG_CMN_WINARCADE: + sceneHandler29_winArcade(); + break; + + case MSG_SC29_LAUGH: + if (g_vars->scene29_hitBall == ANI_SHELL_GREEN) { + g_fp->playSound(SND_29_028, 0); + break; + } + + g_fp->playSound(SND_29_029, 0); + + break; + + case MSG_SC29_SHOWLASTRED: + if (g_vars->scene29_balls.numBalls) { + g_vars->scene29_redBalls.field_8->ani->show1(-1, -1, -1, 0); + g_vars->scene29_redBalls.field_8->ani->startAnim(MV_SHR_HITASS, 0, -1); + } + + break; + + case MSG_SC29_SHOOTGREEN: + sceneHandler29_shootGreen(); + break; + + case MSG_SC29_SHOOTRED: + sceneHandler29_shootRed(); + break; + + case MSG_SC29_SHOWLASTGREEN: + if (g_vars->scene29_balls.numBalls) { + g_vars->scene29_balls.field_8->ani->show1(-1, -1, -1, 0); + g_vars->scene29_balls.field_8->ani->startAnim(MV_SHG_HITASS, 0, -1); + } + + break; + + case MSG_SC29_STOPRIDE: + g_vars->scene29_manIsRiding = false; + g_vars->scene29_arcadeIsOn = false; + g_vars->scene29_reachedFarRight = false; + g_vars->scene29_rideBackEnabled = false; + + getCurrSceneSc2MotionController()->setEnabled(); + getGameLoaderInteractionController()->enableFlag24(); + break; + + case MSG_SC29_DISABLERIDEBACK: + g_vars->scene29_rideBackEnabled = false; + break; + + case MSG_SC29_ENABLERIDEBACK: + g_vars->scene29_rideBackEnabled = true; + g_vars->scene29_reachedFarRight = false; + break; + + case MSG_SC29_DISABLEPORTER: + g_vars->scene29_reachedFarRight = false; + break; + + case MSG_SC29_ENABLEPORTER: + g_vars->scene29_reachedFarRight = true; + g_vars->scene29_rideBackEnabled = false; + g_vars->scene29_manIsHit = false; + break; + + case 29: + if (!g_vars->scene29_manIsRiding || g_vars->scene29_arcadeIsOn) { + if (!g_vars->scene29_arcadeIsOn) { + StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y); + + if (ani && ani == g_vars->scene29_porter) { + sceneHandler29_clickPorter(cmd); + + cmd->_messageKind = 0; + break; + } + break; + } + + sceneHandler29_manJump(); + + cmd->_messageKind = 0; + break; + } + break; + + case 107: + if (g_vars->scene29_arcadeIsOn) + sceneHandler29_manBend(); + + break; + + case 33: + if (g_vars->scene29_arcadeIsOn) { + if (g_vars->scene29_manX > g_fp->_sceneRect.right - 500) + g_fp->_currentScene->_x = g_fp->_sceneRect.right - g_vars->scene29_manX - 350; + + if (g_vars->scene29_manX < g_fp->_sceneRect.left + 100) + g_fp->_currentScene->_x = g_vars->scene29_manX - g_fp->_sceneRect.left - 100; + + } else if (g_fp->_aniMan2) { + int x = g_fp->_aniMan2->_ox; + + if (x < g_fp->_sceneRect.left + 300) + g_fp->_currentScene->_x = x - 400 - g_fp->_sceneRect.left; + + if (x > g_fp->_sceneRect.right - 300) + g_fp->_currentScene->_x = x + 400 - g_fp->_sceneRect.right; + } + + g_vars->scene29_manX = g_fp->_aniMan->_ox; + g_vars->scene29_manY = g_fp->_aniMan->_oy; + + sceneHandler29_ballHitCheck(); + + if (!g_vars->scene29_porter->_movement) + g_vars->scene29_porter->startAnim(MV_PTR_MOVEFAST, 0, -1); + + if (g_vars->scene29_manIsRiding) + sceneHandler29_manFromL(); + else if (g_vars->scene29_arcadeIsOn && !g_fp->_aniMan->_movement) + sceneHandler29_shootersProcess(); + + if (g_vars->scene29_reachedFarRight) + sceneHandler29_shootersEscape(); + else if (g_vars->scene29_rideBackEnabled) + sceneHandler29_manRideBack(); + + g_vars->scene29_shootCountdown++; + + if (g_vars->scene29_shootCountdown > g_vars->scene29_shootDistance) + sceneHandler29_shoot(); + + sceneHandler29_animBearded(); + + g_fp->_behaviorManager->updateBehaviors(); + g_fp->startSceneTrack(); + + break; + } + + return 0; +} + +int scene29_updateCursor() { + g_fp->updateCursorCommon(); + + if (g_vars->scene29_arcadeIsOn) { + if (g_fp->_cursorId != PIC_CSR_DEFAULT_INV && g_fp->_cursorId != PIC_CSR_ITN_INV) + g_fp->_cursorId = -1; + } else if (g_vars->scene29_manIsRiding) { + if (g_fp->_cursorId != PIC_CSR_DEFAULT_INV && g_fp->_cursorId != PIC_CSR_ITN_INV) + g_fp->_cursorId = PIC_CSR_DEFAULT; + } else if (g_fp->_objectIdAtCursor == ANI_PORTER) { + if (g_fp->_cursorId == PIC_CSR_DEFAULT) + g_fp->_cursorId = PIC_CSR_ITN; + } else { + if (g_fp->_objectIdAtCursor == PIC_SC29_LTRUBA && g_fp->_cursorId == PIC_CSR_ITN) + g_fp->_cursorId = PIC_CSR_GOL; + } + return g_fp->_cursorId; +} + +} // End of namespace Fullpipe diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp index bb6aabd2b5..3c13bad854 100644 --- a/engines/fullpipe/sound.cpp +++ b/engines/fullpipe/sound.cpp @@ -26,6 +26,7 @@ #include "fullpipe/scene.h" #include "fullpipe/sound.h" #include "fullpipe/ngiarchive.h" +#include "fullpipe/messages.h" #include "common/memstream.h" #include "audio/audiostream.h" #include "audio/decoders/vorbis.h" @@ -73,6 +74,18 @@ bool SoundList::loadFile(const char *fname, char *libname) { return load(archive, libname); } +Sound *SoundList::getSoundItemById(int id) { + if (_soundItemsCount == 0) { + return _soundItems[0]->getId() != id ? 0 : _soundItems[0]; + } + + for (int i = 0; i < _soundItemsCount; i++) { + if (_soundItems[i]->getId() == id) + return _soundItems[i]; + } + return NULL; +} + Sound::Sound() { _id = 0; _directSoundBuffer = 0; @@ -80,10 +93,13 @@ Sound::Sound() { _objectId = 0; memset(_directSoundBuffers, 0, sizeof(_directSoundBuffers)); _description = 0; + _volume = 100; } Sound::~Sound() { - warning("STUB: Sound::~Sound()"); + freeSound(); + + free(_description); } bool Sound::load(MfcArchive &file, NGIArchive *archive) { @@ -119,24 +135,157 @@ void Sound::setPanAndVolumeByStaticAni() { debug(3, "STUB Sound::setPanAndVolumeByStaticAni()"); } -void FullpipeEngine::setSceneMusicParameters(GameVar *var) { +void Sound::setPanAndVolume(int vol, int pan) { + g_fp->_mixer->setChannelVolume(_handle, vol / 39); // 0..10000 + g_fp->_mixer->setChannelBalance(_handle, pan / 78); // -10000..10000 +} + +void Sound::play(int flag) { + Audio::SoundHandle handle = getHandle(); + + if (g_fp->_mixer->isSoundHandleActive(handle)) + return; + + byte *soundData = loadData(); + Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(soundData, getDataSize()); + Audio::RewindableAudioStream *wav = Audio::makeWAVStream(dataStream, DisposeAfterUse::YES); + Audio::AudioStream *audioStream = new Audio::LoopingAudioStream(wav, (flag == 1) ? 0 : 1); + + g_fp->_mixer->playStream(Audio::Mixer::kSFXSoundType, &handle, audioStream); +} + +void Sound::freeSound() { + stop(); + + free(_soundData); +} + +int Sound::getVolume() { + return g_fp->_mixer->getChannelVolume(_handle) * 39; // 0..10000 +} + +void Sound::stop() { + g_fp->_mixer->stopHandle(_handle); +} + +void FullpipeEngine::setSceneMusicParameters(GameVar *gvar) { warning("STUB: FullpipeEngine::setSceneMusicParameters()"); - // TODO: Finish this (MINDELAY, MAXDELAY, LOCAL, SEQUENCE, STARTDELAY etc) - stopAllSoundStreams(); +#if 0 + stopSoundStream2(); + + if (soundStream3) + FSOUND_Stream_Stop(soundStream4); +#endif + + if (_musicLocal) + stopAllSoundStreams(); + + GameVar *var = gvar->getSubVarByName("MUSIC"); + + memset(_sceneTracks, 0, sizeof(_sceneTracks)); + + _numSceneTracks = 0; + _sceneTrackHasSequence = false; + + if (!var) + return; + _musicGameVar = var; + + GameVar *tr = var->getSubVarByName("TRACKS"); + if (tr) { + GameVar *sub = tr->_subVars; + + while (sub) { + if (_musicAllowed & sub->_value.intValue) { + strcpy(_sceneTracks[_numSceneTracks], sub->_varName); + + _numSceneTracks++; + } + + sub = sub->_nextVarObj; + } + } + + _musicMinDelay = var->getSubVarAsInt("MINDELAY"); + _musicMaxDelay = var->getSubVarAsInt("MAXDELAY"); + _musicLocal = var->getSubVarAsInt("LOCAL"); + + GameVar *seq = var->getSubVarByName("SEQUENCE"); + + if (seq) { + _sceneTrackHasSequence = true; + + strcpy(_trackName, seq->_value.stringValue); + } + + if (_musicLocal) + stopAllSoundStreams(); + + if (!_sceneTrackIsPlaying || _musicLocal) + _trackStartDelay = var->getSubVarAsInt("STARTDELAY"); } void FullpipeEngine::startSceneTrack() { - // TODO: Finish this -#ifdef USE_VORBIS - if (g_fp->_mixer->isSoundHandleActive(_sceneTrackHandle)) - return; + if (!_sceneTrackIsPlaying && _numSceneTracks > 0) { + if (_trackStartDelay > 0) { + _trackStartDelay--; + } else { + int trackNum = getSceneTrack(); + + if (trackNum == -1) { + strcpy(_sceneTracksCurrentTrack, "silence"); + + _trackStartDelay = 2880; + _sceneTrackIsPlaying = 0; + } else { + strcpy(_sceneTracksCurrentTrack, _sceneTracks[trackNum]); + + startSoundStream1(_sceneTracksCurrentTrack); + + _sceneTrackIsPlaying = true; + } + } + } +} + +int FullpipeEngine::getSceneTrack() { + int res; + + if (_sceneTrackHasSequence) { + int num = _musicGameVar->getSubVarAsInt("TRACKS"); + + if (_trackName[num + 1] == 's') { // 'silence' + res = -1; + } else { + res = _trackName[num + 1] - '0'; + + if (res < 0 || res >= _numSceneTracks) + res = 0; + } - GameVar *musicTrackVar = _musicGameVar->getSubVarByName("MUSIC")->getSubVarByName("TRACKS")->_subVars; - if (!musicTrackVar) + int track = num + 1; + + if (!_trackName[num + 2]) + track = 0; + + _musicGameVar->setSubVarAsInt("TRACKS", track); + } else { + res = _numSceneTracks * (_updateTicks % 10) / 10; + } + + return res; +} + +void FullpipeEngine::startSoundStream1(char *trackName) { + warning("STUB: FullpipeEngine::startSoundStream1(%s)", trackName); + + stopAllSoundStreams(); + +#ifdef USE_VORBIS + if (_mixer->isSoundHandleActive(_sceneTrackHandle)) return; - char *trackName = musicTrackVar->_varName; Common::File *track = new Common::File(); if (!track->open(trackName)) { warning("Could not open %s", trackName); @@ -144,40 +293,130 @@ void FullpipeEngine::startSceneTrack() { return; } Audio::RewindableAudioStream *ogg = Audio::makeVorbisStream(track, DisposeAfterUse::YES); - g_fp->_mixer->playStream(Audio::Mixer::kMusicSoundType, &_sceneTrackHandle, ogg); + _mixer->playStream(Audio::Mixer::kMusicSoundType, &_sceneTrackHandle, ogg); #endif } void FullpipeEngine::stopAllSounds() { // TODO: Differences from stopAllSoundStreams() - g_fp->_mixer->stopAll(); + _mixer->stopAll(); } void FullpipeEngine::toggleMute() { - warning("STUB: FullpipeEngine::toggleMute()"); + if (_soundEnabled) { + _sfxVolume = _sfxVolume != -10000 ? -10000 : 0; + + updateSoundVolume(); + } } void FullpipeEngine::playSound(int id, int flag) { - SoundList *soundList = g_fp->_currentScene->_soundList; - Sound *sound = soundList->getSoundById(id); + Sound *sound = 0; + + for (int i = 0; i < _currSoundListCount; i++) { + sound = _currSoundList1[i]->getSoundItemById(id); + + if (sound) + break; + } + if (!sound) { warning("playSound: Can't find sound with ID %d", id); return; } - byte *soundData = sound->loadData(); - Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(soundData, sound->getDataSize()); - Audio::RewindableAudioStream *wav = Audio::makeWAVStream(dataStream, DisposeAfterUse::YES); - Audio::AudioStream *audioStream = new Audio::LoopingAudioStream(wav, (flag == 1) ? 0 : 1); - Audio::SoundHandle handle = sound->getHandle(); - g_fp->_mixer->playStream(Audio::Mixer::kSFXSoundType, &handle, audioStream); + + sound->play(flag); } void FullpipeEngine::playTrack(GameVar *sceneVar, const char *name, bool delayed) { warning("STUB: FullpipeEngine::playTrack(var, %s, %d)", name, delayed); +#if 0 + stopSoundStream2(); + + if (soundStream3) + FSOUND_Stream_Stop(soundStream4); +#endif + + if (_musicLocal) + stopAllSoundStreams(); + + GameVar *var = sceneVar->getSubVarByName(name); + + memset(_sceneTracks, 0, sizeof(_sceneTracks)); + + _numSceneTracks = 0; + _sceneTrackHasSequence = false; + + if (!var) + return; + + _musicGameVar = var; + + GameVar *tr = var->getSubVarByName("TRACKS"); + if (tr) { + GameVar *sub = tr->_subVars; + + while (sub) { + if (_musicAllowed & sub->_value.intValue) { + strcpy(_sceneTracks[_numSceneTracks], sub->_varName); + + _numSceneTracks++; + } + + sub = sub->_nextVarObj; + } + } + + _musicMinDelay = var->getSubVarAsInt("MINDELAY"); + _musicMaxDelay = var->getSubVarAsInt("MAXDELAY"); + _musicLocal = var->getSubVarAsInt("LOCAL"); + + GameVar *seq = var->getSubVarByName("SEQUENCE"); + + if (seq) { + _sceneTrackHasSequence = true; + + strcpy(_trackName, seq->_value.stringValue); + } + + if (delayed) { + if (_sceneTrackIsPlaying && _numSceneTracks == 1) { + if (strcmp(_sceneTracksCurrentTrack, _sceneTracks[0])) + stopAllSoundStreams(); + } + + _trackStartDelay = var->getSubVarAsInt("STARTDELAY"); + } } void global_messageHandler_handleSound(ExCommand *cmd) { - debug(0, "STUB: global_messageHandler_handleSound()"); + if (!g_fp->_soundEnabled) + return; + + Sound *snd = 0; + + for (int i = 0; i < g_fp->_currSoundListCount; i++) + snd = g_fp->_currSoundList1[i]->getSoundItemById(cmd->_messageNum); + + if (!snd) + return; + + if (cmd->_field_14 & 1) { + if (!g_fp->_flgSoundList && (cmd->_field_14 & 4)) + snd->freeSound(); + + snd->updateVolume(); + + if (snd->_objectId && g_fp->_currentScene->getStaticANIObject1ById(snd->_objectId, -1)) + snd->setPanAndVolumeByStaticAni(); + else + snd->setPanAndVolume(g_fp->_sfxVolume, 0); + + if (snd->getVolume() > -3500) + snd->play(cmd->_keyCode); + } else if (cmd->_field_14 & 2) { + snd->stop(); + } } void FullpipeEngine::stopSoundStream2() { @@ -186,21 +425,29 @@ void FullpipeEngine::stopSoundStream2() { void FullpipeEngine::stopAllSoundStreams() { // TODO: Differences from stopAllSounds() - g_fp->_mixer->stopAll(); + _mixer->stopAll(); } void FullpipeEngine::stopAllSoundInstances(int id) { - SoundList *soundList = g_fp->_currentScene->_soundList; - for (int i = 0; i < soundList->getCount(); i++) { - Sound *sound = soundList->getSoundByIndex(i); - if (sound->getId() == id) { - g_fp->_mixer->stopHandle(sound->getHandle()); - } + for (int i = 0; i < _currSoundListCount; i++) { + Sound *sound = _currSoundList1[i]->getSoundItemById(id); + + if (sound) + sound->stop(); } } void FullpipeEngine::updateSoundVolume() { - debug(3, "STUB FullpipeEngine::updateSoundVolume()"); + for (int i = 0; i < _currSoundListCount; i++) + for (int j = 0; i < _currSoundList1[i]->getCount(); j++) { + _currSoundList1[i]->getSoundByIndex(j)->setPanAndVolume(_sfxVolume, 0); + } +} + +void FullpipeEngine::setMusicVolume(int vol) { + _musicVolume = vol; + + debug(3, "STUB FullpipeEngine::setMusicVolume()"); } } // End of namespace Fullpipe diff --git a/engines/fullpipe/sound.h b/engines/fullpipe/sound.h index 8ddfc753ce..14e766f5bb 100644 --- a/engines/fullpipe/sound.h +++ b/engines/fullpipe/sound.h @@ -28,11 +28,14 @@ namespace Fullpipe { class Sound : public MemoryObject { int _id; char *_description; - int16 _objectId; int _directSoundBuffer; int _directSoundBuffers[7]; byte *_soundData; Audio::SoundHandle _handle; + int _volume; + +public: + int16 _objectId; public: Sound(); @@ -44,7 +47,13 @@ public: int getId() const { return _id; } Audio::SoundHandle getHandle() const { return _handle; } + void play(int flag); + void freeSound(); + int getVolume(); + void stop(); + void setPanAndVolumeByStaticAni(); + void setPanAndVolume(int vol, int pan); }; class SoundList : public CObject { @@ -60,13 +69,7 @@ class SoundList : public CObject { int getCount() { return _soundItemsCount; } Sound *getSoundByIndex(int idx) { return _soundItems[idx]; } - Sound *getSoundById(int id) { - for (int i = 0; i < _soundItemsCount; i++) { - if (_soundItems[i]->getId() == id) - return _soundItems[i]; - } - return NULL; - } + Sound *getSoundItemById(int id); }; } // End of namespace Fullpipe diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index 75c1c7d1ea..f1abac5778 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -105,6 +105,19 @@ bool StepArray::gotoNextPoint() { } } +void StepArray::insertPoints(Common::Point **points, int pointsCount) { + if (_currPointIndex + pointsCount >= _pointsCount) + _points = (Common::Point **)realloc(_points, sizeof(Common::Point *) * (_currPointIndex + pointsCount)); + + _maxPointIndex = _currPointIndex + pointsCount; + + for (int i = 0; i < pointsCount; i++) { + _points[_currPointIndex + i] = new Common::Point; + + *_points[_currPointIndex + i] = *points[i]; + } +} + StaticANIObject::StaticANIObject() { _shadowsOn = 1; _field_30 = 0; @@ -264,8 +277,11 @@ void StaticANIObject::deleteFromGlobalMessageQueue() { } } -void StaticANIObject::queueMessageQueue(MessageQueue *mq) { - if (isIdle() && !(_flags & 0x80)) { +bool StaticANIObject::queueMessageQueue(MessageQueue *mq) { + if (_flags & 0x80) + return false; + + if (isIdle()) { deleteFromGlobalMessageQueue(); _messageQueueId = 0; _messageNum = 0; @@ -283,6 +299,8 @@ void StaticANIObject::queueMessageQueue(MessageQueue *mq) { _messageQueueId = 0; } } + + return true; } void StaticANIObject::restartMessageQueue(MessageQueue *mq) { @@ -330,7 +348,35 @@ bool StaticANIObject::trySetMessageQueue(int msgNum, int qId) { } void StaticANIObject::startMQIfIdle(int qId, int flag) { - warning("STUB: StaticANIObject::startMQIfIdle()"); + MessageQueue *msg = g_fp->_currentScene->getMessageQueueById(qId); + + if (msg && isIdle() && !(_flags & 0x100)) { + MessageQueue *mq = new MessageQueue(msg, 0, 0); + + mq->setFlags(mq->getFlags() | flag); + + ExCommand *ex = mq->getExCommandByIndex(0); + + if (ex) { + while (ex->_messageKind != 1 || ex->_parentId != _id) { + ex->_parId = 0; + ex->_excFlags |= 2; + ex->handleMessage(); + + mq->deleteExCommandByIndex(0, 0); + + ex = mq->getExCommandByIndex(0); + + if (!ex) + return; + } + + if (ex) { + startAnim(ex->_messageNum, mq->_id, -1); + mq->deleteExCommandByIndex(0, 1); + } + } + } } bool StaticANIObject::isIdle() { @@ -978,9 +1024,26 @@ void StaticANIObject::adjustSomeXY() { } MessageQueue *StaticANIObject::changeStatics1(int msgNum) { - warning("STUB: StaticANIObject::changeStatics1(%d)", msgNum); + g_fp->_mgm->addItem(_id); - return 0; + MessageQueue *mq = g_fp->_mgm->genMQ(this, msgNum, 0, 0, 0); + + if (!mq) + return 0; + + if (mq->getCount() <= 0) { + g_fp->_globalMessageQueueList->addMessageQueue(mq); + + if (_flags & 1) + _messageQueueId = mq->_id; + } else { + if (!queueMessageQueue(mq)) + return 0; + + g_fp->_globalMessageQueueList->addMessageQueue(mq); + } + + return mq; } void StaticANIObject::changeStatics2(int objId) { @@ -1060,7 +1123,47 @@ void StaticANIObject::show1(int x, int y, int movId, int mqId) { } void StaticANIObject::show2(int x, int y, int movementId, int mqId) { - warning("STUB: StaticANIObject::show2(%d, %d, %d, %d)", x, y, movementId, mqId); + if (movementId == -1) { + _flags |= 4u; + return; + } + + if (!_messageQueueId) { + _messageQueueId = mqId; + + Movement *mov = getMovementById(movementId); + + if (mov) { + _statics = mov->_staticsObj1; + _movement = mov; + mov->gotoLastFrame(); + mov->setOXY(x, y); + mov->gotoFirstFrame(); + + Common::Point point; + + mov->getCurrDynamicPhaseXY(point); + _statics->_x = mov->_ox - point.x - mov->_mx; + _statics->_y = mov->_oy - point.y - mov->_my; + + _statics->getSomeXY(point); + _flags |= 4; + _ox = _statics->_x + point.x; + _oy = _statics->_y + point.y; + + if (mov->_currMovement) { + _flags |= 8; + } else { + if (_flags & 8) + _flags ^= 8; + } + + if (_flags & 1) + _flags ^= 1; + + _flags |= 0x20; + } + } } void StaticANIObject::playIdle() { @@ -1069,7 +1172,85 @@ void StaticANIObject::playIdle() { } void StaticANIObject::startAnimSteps(int movementId, int messageQueueId, int x, int y, Common::Point **points, int pointsCount, int someDynamicPhaseIndex) { - warning("STUB: StaticANIObject::startAnimSteps()"); + Movement *mov = 0; + + if (!(_flags & 0x80)) { + if (!_messageQueueId) + for (uint i = 0; i < _movements.size(); i++) { + if (((Movement *)_movements[i])->_id == movementId) { + mov = (Movement *)_movements[i]; + break; + } + } + } + + if (!mov) { + updateGlobalMessageQueue(messageQueueId, _id); + + return; + } + + + if (_movement || !_statics) + return; + + Common::Point point; + + _statics->getSomeXY(point); + + int newx = _ox - point.x; + int newy = _oy - point.y; + + _movement = mov; + + if (_flags & 0x40) + _movement->gotoLastFrame(); + else + _movement->gotoFirstFrame(); + + _stepArray.clear(); + _stepArray.insertPoints(points, pointsCount); + + if (!(_flags & 0x40)) { + if (!_movement->_currDynamicPhaseIndex) { + _stepArray.getCurrPoint(&point); + newx += point.x + _movement->_mx; + newy += point.y + _movement->_my; + _stepArray.gotoNextPoint(); + + ExCommand *ex = _movement->_currDynamicPhase->getExCommand(); + + if (ex) { + if (ex->_messageKind == 35) { + ExCommand *newEx = ex->createClone(); + + newEx->_excFlags |= 2u; + newEx->sendMessage(); + } + } + } + } + + _movement->getCurrDynamicPhaseXY(point); + setOXY(point.x + newx, point.y + newy); + + if ((_movement->_staticsObj2->_staticsId >> 8) & 0x40) + _flags |= 8; + else + _flags &= 0xFFF7; + + _flags |= 1; + _messageQueueId = messageQueueId; + _movement->_currDynamicPhase->_countdown = _movement->_currDynamicPhase->_initialCountdown; + _movement->_counter = 0; + _counter = _initialCounter; + _someDynamicPhaseIndex = someDynamicPhaseIndex; + + ExCommand *ex = new ExCommand(_id, 17, 23, 0, 0, movementId, 1, 0, 0, 0); + + ex->_keyCode = _okeyCode; + ex->_excFlags = 2; + ex->postMessage(); } bool StaticANIObject::startAnimEx(int movid, int parId, int flag1, int flag2) { @@ -1188,6 +1369,31 @@ bool StaticANIObject::startAnim(int movementId, int messageQueueId, int dynPhase return true; } +Common::Point *StaticANIObject::calcStepLen(Common::Point *p) { + if (_movement) { + Common::Point point; + + _movement->calcSomeXY(point, 0); + + p->x = point.x; + p->y = point.y; + + int idx = _stepArray.getCurrPointIndex() - _movement->_currDynamicPhaseIndex - 1; + + if (idx >= 0) { + _stepArray.getPoint(&point, idx, _movement->_currDynamicPhaseIndex + 2); + + p->x += point.x; + p->y += point.y; + } + } else { + p->x = 0; + p->y = 0; + } + + return p; +} + Statics::Statics() { _staticsId = 0; _picture = 0; diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 8328e7679b..d678957163 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -47,6 +47,7 @@ class StepArray : public CObject { Common::Point *getCurrPoint(Common::Point *point); Common::Point *getPoint(Common::Point *point, int index, int offset); bool gotoNextPoint(); + void insertPoints(Common::Point **points, int pointsCount); }; class StaticPhase : public Picture { @@ -216,7 +217,7 @@ public: void setAlpha(int alpha); void deleteFromGlobalMessageQueue(); - void queueMessageQueue(MessageQueue *msg); + bool queueMessageQueue(MessageQueue *msg); void restartMessageQueue(MessageQueue *msg); MessageQueue *getMessageQueue(); bool trySetMessageQueue(int msgNum, int qId); @@ -245,6 +246,7 @@ public: void draw2(); MovTable *countMovements(); + Common::Point *calcStepLen(Common::Point *p); void setSpeed(int speed); void updateStepPos(); diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp index 081afe4a05..3ee6d64bec 100644 --- a/engines/gob/draw.cpp +++ b/engines/gob/draw.cpp @@ -88,11 +88,6 @@ Draw::Draw(GobEngine *vm) : _vm(vm) { _vgaPalette[i].blue = 0; _vgaPalette[i].green = 0; } - for (int i = 0; i < 16; i++) { - _vgaSmallPalette[i].red = 0; - _vgaSmallPalette[i].blue = 0; - _vgaSmallPalette[i].green = 0; - } _showCursor = 0; _cursorIndex = 0; diff --git a/engines/gob/draw.h b/engines/gob/draw.h index ba6f183c6c..eb12e85468 100644 --- a/engines/gob/draw.h +++ b/engines/gob/draw.h @@ -115,7 +115,6 @@ public: int16 _unusedPalette1[18]; int16 _unusedPalette2[16]; Video::Color _vgaPalette[256]; - Video::Color _vgaSmallPalette[16]; // 0 (00b): No cursor // 1 (01b): Cursor would be on _backSurface diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 10364952f2..40134bbf17 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -1125,7 +1125,7 @@ void Inter_v1::o1_palLoad(OpFuncParams ¶ms) { _vm->_draw->_vgaPalette[i].blue = _vm->_game->_script->readByte(); } - memcpy(_vm->_draw->_vgaSmallPalette, _vm->_draw->_vgaPalette, 16 * 3); + memcpy(_vm->_draw->_vgaPalette, _vm->_draw->_vgaPalette, 16 * 3); break; case 53: @@ -1183,7 +1183,7 @@ void Inter_v1::o1_palLoad(OpFuncParams ¶ms) { _vm->_palAnim->fade(_vm->_global->_pPaletteDesc, 0, 0); return; } - _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaSmallPalette; + _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette; _vm->_palAnim->fade(_vm->_global->_pPaletteDesc, 0, 0); } } @@ -2489,21 +2489,21 @@ void Inter_v1::animPalette() { _vm->_video->waitRetrace(); if (_animPalDir[0] == -1) { - col = _vm->_draw->_vgaSmallPalette[_animPalLowIndex[0]]; + col = _vm->_draw->_vgaPalette[_animPalLowIndex[0]]; for (i = _animPalLowIndex[0]; i < _animPalHighIndex[0]; i++) - _vm->_draw->_vgaSmallPalette[i] = _vm->_draw->_vgaSmallPalette[i + 1]; + _vm->_draw->_vgaPalette[i] = _vm->_draw->_vgaPalette[i + 1]; - _vm->_draw->_vgaSmallPalette[_animPalHighIndex[0]] = col; + _vm->_draw->_vgaPalette[_animPalHighIndex[0]] = col; } else { - col = _vm->_draw->_vgaSmallPalette[_animPalHighIndex[0]]; + col = _vm->_draw->_vgaPalette[_animPalHighIndex[0]]; for (i = _animPalHighIndex[0]; i > _animPalLowIndex[0]; i--) - _vm->_draw->_vgaSmallPalette[i] = _vm->_draw->_vgaSmallPalette[i - 1]; + _vm->_draw->_vgaPalette[i] = _vm->_draw->_vgaPalette[i - 1]; - _vm->_draw->_vgaSmallPalette[_animPalLowIndex[0]] = col; + _vm->_draw->_vgaPalette[_animPalLowIndex[0]] = col; } - _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaSmallPalette; + _vm->_global->_pPaletteDesc->vgaPal = _vm->_draw->_vgaPalette; _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc); } diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp index 20c0688dd7..37ef291a93 100644 --- a/engines/gob/minigames/geisha/diving.cpp +++ b/engines/gob/minigames/geisha/diving.cpp @@ -389,8 +389,7 @@ void Diving::initScreen() { _vm->_util->setFrameRate(15); // Set palette - memcpy(_vm->_draw->_vgaPalette , kPalette, sizeof(kPalette)); - memcpy(_vm->_draw->_vgaSmallPalette, kPalette, sizeof(kPalette)); + memcpy(_vm->_draw->_vgaPalette, kPalette, sizeof(kPalette)); // Draw background decal _vm->_draw->_backSurface->clear(); diff --git a/engines/gob/minigames/geisha/penetration.cpp b/engines/gob/minigames/geisha/penetration.cpp index 16742c712f..0ebcd2c55b 100644 --- a/engines/gob/minigames/geisha/penetration.cpp +++ b/engines/gob/minigames/geisha/penetration.cpp @@ -840,8 +840,7 @@ void Penetration::setPalette() { _vm->_palAnim->fade(0, 0, 0); // Set palette - memcpy(_vm->_draw->_vgaPalette , kPalettes[_floor], 3 * kPaletteSize); - memcpy(_vm->_draw->_vgaSmallPalette, kPalettes[_floor], 3 * kPaletteSize); + memcpy(_vm->_draw->_vgaPalette, kPalettes[_floor], 3 * kPaletteSize); _needFadeIn = true; } diff --git a/engines/gob/resources.cpp b/engines/gob/resources.cpp index ac2deadd5f..dbed825977 100644 --- a/engines/gob/resources.cpp +++ b/engines/gob/resources.cpp @@ -209,6 +209,7 @@ void Resources::unload(bool del) { _totResourceTable = 0; _extResourceTable = 0; _totTextTable = 0; + _totResStart = 0; _totData = 0; _totSize = 0; _imData = 0; @@ -233,6 +234,8 @@ bool Resources::loadTOTResourceTable() { if (!stream) return false; + _totResStart = totProps.scriptEnd; + if ((totProps.resourcesOffset == 0xFFFFFFFF) || (totProps.resourcesOffset == 0)) // No resources here @@ -271,7 +274,6 @@ bool Resources::loadTOTResourceTable() { item.type = kResourceTOT; } - _totResStart = totProps.scriptEnd; _totSize = stream->size() - _totResStart; if (_totSize <= 0) diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 4b3fb81828..2776a0455d 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -45,7 +45,7 @@ namespace Groovie { ROQPlayer::ROQPlayer(GroovieEngine *vm) : VideoPlayer(vm), _codingTypeCount(0), - _fg(&_vm->_graphicsMan->_foreground), _bg(&_vm->_graphicsMan->_background) { + _bg(&_vm->_graphicsMan->_background) { // Create the work surfaces _currBuf = new Graphics::Surface(); diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h index 0e82983e63..cd5e91c82b 100644 --- a/engines/groovie/roq.h +++ b/engines/groovie/roq.h @@ -75,7 +75,7 @@ private: byte _codebook4[256 * 4]; // Buffers - Graphics::Surface *_fg, *_bg, *_thirdBuf; + Graphics::Surface *_bg; Graphics::Surface *_currBuf, *_prevBuf; void buildShowBuf(); byte _scaleX, _scaleY; diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index 313386e86d..391de5e49c 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -620,14 +620,14 @@ void LoLEngine::updateCompass() { if (_compassStep) _compassStep -= (((ABS(_compassStep) >> 4) + 2) * dir); - int16 d = _compassBroken ? (int8(_rnd.getRandomNumber(255)) - _compassDirection) : (_currentDirection << 6) - _compassDirection; - if (d <= -128) - d += 256; - if (d >= 128) - d -= 256; - - d >>= 2; - _compassStep += d; + int16 diff = _compassBroken ? (int8(_rnd.getRandomNumber(255)) - _compassDirection) : (_currentDirection << 6) - _compassDirection; + if (diff <= -128) + diff += 256; + if (diff >= 128) + diff -= 256; + + diff >>= 2; + _compassStep += diff; _compassStep = CLIP(_compassStep, -24, 24); _compassDirection += _compassStep; @@ -636,14 +636,9 @@ void LoLEngine::updateCompass() { if (_compassDirection > 255) _compassDirection -= 256; - if ((_compassDirection >> 6) == _currentDirection && _compassStep < 2) { - int16 d2 = d >> 16; - d ^= d2; - d -= d2; - if (d < 4) { - _compassDirection = _currentDirection << 6; - _compassStep = 0; - } + if (((((_compassDirection + 3) & 0xFD) >> 6) == _currentDirection) && (_compassStep < 2) && (ABS(diff) < 4)) { + _compassDirection = _currentDirection << 6; + _compassStep = 0; } gui_drawCompass(); diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 10cbc49c7c..725dedae3f 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -538,7 +538,8 @@ bool SoundTownsPC98_v2::init() { // check if we have access to CD audio. Resource *r = _vm->resource(); if (_musicEnabled && - (r->exists("track1.mp3") || r->exists("track1.ogg") || r->exists("track1.flac") || r->exists("track1.fla"))) + (r->exists("track1.mp3") || r->exists("track1.ogg") || r->exists("track1.flac") || r->exists("track1.fla") + || r->exists("track01.mp3") || r->exists("track01.ogg") || r->exists("track01.flac") || r->exists("track01.fla"))) _musicEnabled = 2; else _musicEnabled = 1; diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index fbbe916a5c..9b3b92b9c7 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -39,7 +39,7 @@ namespace Kyra { -#define RESFILE_VERSION 84 +#define RESFILE_VERSION 85 namespace { bool checkKyraDat(Common::SeekableReadStream *file) { diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index 9c8cc202aa..148854e04d 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -39,7 +39,7 @@ namespace LastExpress { -Animation::Animation() : _stream(NULL), _currentChunk(NULL), _overlay(NULL), _background1(NULL), _background2(NULL), _backgroundCurrent(0), _audio(NULL), _startTime(0), _changed(false), _flag(0) { +Animation::Animation() : _stream(NULL), _currentChunk(NULL), _overlay(NULL), _background1(NULL), _background2(NULL), _backgroundCurrent(0), _audio(NULL), _startTime(0), _changed(false) { } Animation::~Animation() { diff --git a/engines/lastexpress/data/animation.h b/engines/lastexpress/data/animation.h index 7f6922866a..9523cddb78 100644 --- a/engines/lastexpress/data/animation.h +++ b/engines/lastexpress/data/animation.h @@ -113,7 +113,6 @@ private: uint32 _startTime; bool _changed; - int _flag; }; } // End of namespace LastExpress diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp index c7073b560c..f43e2afdef 100644 --- a/engines/lastexpress/data/sequence.cpp +++ b/engines/lastexpress/data/sequence.cpp @@ -76,7 +76,7 @@ void FrameInfo::read(Common::SeekableReadStream *in, bool isSequence) { // AnimFrame -AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f, bool ignoreSubtype) : _palette(NULL), _ignoreSubtype(ignoreSubtype) { +AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f, bool /* ignoreSubtype */) : _palette(NULL) { _palSize = 1; // TODO: use just the needed rectangle _image.create(640, 480, Graphics::PixelFormat::createFormatCLUT8()); diff --git a/engines/lastexpress/data/sequence.h b/engines/lastexpress/data/sequence.h index dbb08a0c07..fd8b3cd27b 100644 --- a/engines/lastexpress/data/sequence.h +++ b/engines/lastexpress/data/sequence.h @@ -147,7 +147,6 @@ private: uint16 _palSize; uint16 *_palette; Common::Rect _rect; - bool _ignoreSubtype; }; class Sequence { diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp index 3fc4c2a05b..8867e8a626 100644 --- a/engines/lure/menu.cpp +++ b/engines/lure/menu.cpp @@ -31,7 +31,7 @@ #include "lure/events.h" #include "lure/lure.h" -#if defined(_WIN32_WCE) || defined(__SYMBIAN32__) || defined(WEBOS) || defined(__ANDROID__) +#if defined(_WIN32_WCE) || defined(__SYMBIAN32__) || defined(WEBOS) || defined(__ANDROID__) || defined(__WII__) #define LURE_CLICKABLE_MENUS #endif diff --git a/engines/neverhood/modules/module1000.cpp b/engines/neverhood/modules/module1000.cpp index a3b5bc67b5..b19ba05b32 100644 --- a/engines/neverhood/modules/module1000.cpp +++ b/engines/neverhood/modules/module1000.cpp @@ -228,7 +228,7 @@ uint32 Scene1001::handleMessage(int messageNum, const MessageParam ¶m, Entit } Scene1002::Scene1002(NeverhoodEngine *vm, Module *parentModule, int which) - : Scene(vm, parentModule), _isKlaymenFloor(false), _isClimbingLadder(false) { + : Scene(vm, parentModule), _isKlaymenFloor(false), _isClimbingLadder(false), _asKlaymenPeekHand(nullptr) { NRect tempClipRect; Sprite *tempSprite; diff --git a/engines/neverhood/modules/module1300.cpp b/engines/neverhood/modules/module1300.cpp index d806019e6c..60ff0411a6 100644 --- a/engines/neverhood/modules/module1300.cpp +++ b/engines/neverhood/modules/module1300.cpp @@ -603,7 +603,7 @@ uint32 Scene1305::handleMessage(int messageNum, const MessageParam ¶m, Entit } Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which) - : Scene(vm, parentModule) { + : Scene(vm, parentModule), _asKey(nullptr) { if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0) setGlobalVar(V_KEY3_LOCATION, 4); @@ -683,7 +683,6 @@ Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which) clearRectList(); sendMessage(_asElevator, NM_KLAYMEN_OPEN_DOOR, 0); } - } Scene1306::~Scene1306() { @@ -942,6 +941,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which) _sprite2 = insertStaticSprite(0x40043120, 995); _sprite3 = insertStaticSprite(0x43003100, 995); _sprite4 = NULL; + _sprite5 = nullptr; if (which < 0) { // Restoring game diff --git a/engines/neverhood/modules/module2200.cpp b/engines/neverhood/modules/module2200.cpp index f9033a9dbe..6618cb3ab0 100644 --- a/engines/neverhood/modules/module2200.cpp +++ b/engines/neverhood/modules/module2200.cpp @@ -885,7 +885,7 @@ void Scene2205::update() { } else if (_isLightOn && !getGlobalVar(V_LIGHTS_ON)) { _palette->addPalette(0xD00A028D, 0, 256, 0); changeBackground(0xD00A028D); - _ssLightSwitch->setFileHashes(0x2D339030, 0xDAC86E84); + _ssLightSwitch->setFileHashes(0xD6C86E84, 0xDAC86E84); sendMessage(_ssDoorFrame, 0x2000, 0); changeMouseCursor(0xA0289D08); _isKlaymenInLight = true; diff --git a/engines/neverhood/modules/module2300.cpp b/engines/neverhood/modules/module2300.cpp index c0edc95873..68ae07f2bb 100644 --- a/engines/neverhood/modules/module2300.cpp +++ b/engines/neverhood/modules/module2300.cpp @@ -31,14 +31,14 @@ static const uint32 kModule2300SoundList[] = { }; Module2300::Module2300(NeverhoodEngine *vm, Module *parentModule, int which) - : Module(vm, parentModule), _soundVolume(0) { + : Module(vm, parentModule), _waterfallSoundVolume(0) { _vm->_soundMan->addSoundList(0x1A214010, kModule2300SoundList); _vm->_soundMan->setSoundListParams(kModule2300SoundList, true, 50, 600, 10, 150); - _isWallBroken = getGlobalVar(V_WALL_BROKEN) != 0; + _isWaterfallRunning = getGlobalVar(V_WALL_BROKEN) != 1; - if (_isWallBroken) { + if (_isWaterfallRunning) { _vm->_soundMan->setSoundVolume(0x90F0D1C3, 0); _vm->_soundMan->playSoundLooping(0x90F0D1C3); } else { @@ -78,8 +78,8 @@ void Module2300::createScene(int sceneNum, int which) { case 1: _vm->gameState().sceneNum = 1; createNavigationScene(0x004B67E8, which); - if (_isWallBroken) { - _soundVolume = 15; + if (_isWaterfallRunning) { + _waterfallSoundVolume = 15; _vm->_soundMan->setSoundVolume(0x90F0D1C3, 15); } break; @@ -92,10 +92,10 @@ void Module2300::createScene(int sceneNum, int which) { if (getGlobalVar(V_WALL_BROKEN)) createNavigationScene(0x004B68F0, which); else { - _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume); + _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume); createNavigationScene(0x004B68A8, which); - if (_isWallBroken) { - _soundVolume = 87; + if (_isWaterfallRunning) { + _waterfallSoundVolume = 87; _vm->_soundMan->setSoundVolume(0x90F0D1C3, 87); } } @@ -161,10 +161,10 @@ void Module2300::updateScene() { } else { switch (_sceneNum) { case 1: - if (_isWallBroken && navigationScene()->isWalkingForward() && navigationScene()->getNavigationIndex() == 4 && + if (_isWaterfallRunning && navigationScene()->isWalkingForward() && navigationScene()->getNavigationIndex() == 4 && navigationScene()->getFrameNumber() % 2) { - _soundVolume++; - _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume); + _waterfallSoundVolume++; + _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume); } if (navigationScene()->isWalkingForward() && navigationScene()->getNavigationIndex() == 0 && navigationScene()->getFrameNumber() == 50) { @@ -174,9 +174,9 @@ void Module2300::updateScene() { } break; case 3: - if (_isWallBroken && navigationScene()->isWalkingForward() && navigationScene()->getFrameNumber() % 2) { - _soundVolume--; - _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume); + if (_isWaterfallRunning && navigationScene()->isWalkingForward() && navigationScene()->getFrameNumber() % 2) { + _waterfallSoundVolume--; + _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume); } break; } diff --git a/engines/neverhood/modules/module2300.h b/engines/neverhood/modules/module2300.h index 57235986d9..58bffb710c 100644 --- a/engines/neverhood/modules/module2300.h +++ b/engines/neverhood/modules/module2300.h @@ -37,8 +37,8 @@ public: virtual ~Module2300(); protected: int _sceneNum; - bool _isWallBroken; - int _soundVolume; + int _waterfallSoundVolume; + bool _isWaterfallRunning; void createScene(int sceneNum, int which); void updateScene(); }; diff --git a/engines/neverhood/modules/module2700.cpp b/engines/neverhood/modules/module2700.cpp index 9399981cfd..2a112435fc 100644 --- a/engines/neverhood/modules/module2700.cpp +++ b/engines/neverhood/modules/module2700.cpp @@ -84,7 +84,7 @@ static const uint32 kScene2725StaticSprites[] = { }; Module2700::Module2700(NeverhoodEngine *vm, Module *parentModule, int which) - : Module(vm, parentModule), _soundIndex(0), _radioMusicInitialized(false) { + : Module(vm, parentModule), _soundIndex(0), _radioMusicInitialized(false), _musicFileHash(0) { _vm->_soundMan->addMusic(0x42212411, 0x04020210); _vm->_soundMan->startMusic(0x04020210, 24, 2); diff --git a/engines/neverhood/modules/module2900.cpp b/engines/neverhood/modules/module2900.cpp index 3bf98eca35..69186514a2 100644 --- a/engines/neverhood/modules/module2900.cpp +++ b/engines/neverhood/modules/module2900.cpp @@ -34,11 +34,12 @@ namespace Neverhood { Module2900::Module2900(NeverhoodEngine *vm, Module *parentModule, int which) : Module(vm, parentModule) { + _teleporterModuleResult = -1; + if (which >= 0) setGlobalVar(V_TELEPORTER_WHICH, which); createScene(0, 0); - } void Module2900::createScene(int sceneNum, int which) { diff --git a/engines/neverhood/modules/module3000.cpp b/engines/neverhood/modules/module3000.cpp index 59b2df260e..d4809611ad 100644 --- a/engines/neverhood/modules/module3000.cpp +++ b/engines/neverhood/modules/module3000.cpp @@ -39,7 +39,7 @@ static const uint32 kModule3000SoundList[] = { }; Module3000::Module3000(NeverhoodEngine *vm, Module *parentModule, int which) - : Module(vm, parentModule), _soundVolume(0) { + : Module(vm, parentModule), _waterfallSoundVolume(0) { _vm->_soundMan->addSoundList(0x81293110, kModule3000SoundList); _vm->_soundMan->setSoundListParams(kModule3000SoundList, true, 50, 600, 5, 150); @@ -48,9 +48,9 @@ Module3000::Module3000(NeverhoodEngine *vm, Module *parentModule, int which) _vm->_soundMan->playTwoSounds(0x81293110, 0x40030A51, 0xC862CA15, 0); _vm->_soundMan->playTwoSounds(0x81293110, 0x41861371, 0x43A2507F, 0); - _isWallBroken = getGlobalVar(V_WALL_BROKEN) != 0; + _isWaterfallRunning = getGlobalVar(V_WALL_BROKEN) != 1; - if (!_isWallBroken) { + if (_isWaterfallRunning) { _vm->_soundMan->setSoundVolume(0x90F0D1C3, 0); _vm->_soundMan->playSoundLooping(0x90F0D1C3); } @@ -78,12 +78,11 @@ void Module3000::createScene(int sceneNum, int which) { static const byte kNavigationTypes06[] = {5}; debug(1, "Module3000::createScene(%d, %d)", sceneNum, which); _vm->gameState().sceneNum = sceneNum; - _isWallBroken = getGlobalVar(V_WALL_BROKEN) != 0; switch (_vm->gameState().sceneNum) { case 1: if (!getGlobalVar(V_BOLT_DOOR_OPEN)) { createNavigationScene(0x004B7C80, which); - } else if (_isWallBroken) { + } else if (getGlobalVar(V_WALL_BROKEN)) { createNavigationScene(0x004B7CE0, which); } else { createNavigationScene(0x004B7CB0, which); @@ -91,11 +90,11 @@ void Module3000::createScene(int sceneNum, int which) { break; case 2: _vm->_soundMan->playTwoSounds(0x81293110, 0x40030A51, 0xC862CA15, 0); - if (!_isWallBroken) { - _soundVolume = 90; + if (_isWaterfallRunning) { + _waterfallSoundVolume = 90; _vm->_soundMan->setSoundVolume(0x90F0D1C3, 90); } - if (_isWallBroken) { + if (getGlobalVar(V_WALL_BROKEN)) { createNavigationScene(0x004B7D58, which); } else { createNavigationScene(0x004B7D10, which); @@ -104,7 +103,7 @@ void Module3000::createScene(int sceneNum, int which) { case 3: if (getGlobalVar(V_STAIRS_DOWN)) createNavigationScene(0x004B7E60, which); - else if (_isWallBroken) + else if (getGlobalVar(V_WALL_BROKEN)) createNavigationScene(0x004B7DA0, which); else createNavigationScene(0x004B7E00, which); @@ -152,12 +151,12 @@ void Module3000::createScene(int sceneNum, int which) { // NOTE: Newly introduced sceneNums case 1001: if (!getGlobalVar(V_BOLT_DOOR_OPEN)) - if (_isWallBroken) + if (getGlobalVar(V_WALL_BROKEN)) createSmackerScene(0x00940021, true, true, false); else createSmackerScene(0x01140021, true, true, false); else - if (_isWallBroken) + if (getGlobalVar(V_WALL_BROKEN)) createSmackerScene(0x001011B1, true, true, false); else createSmackerScene(0x001021B1, true, true, false); @@ -195,8 +194,8 @@ void Module3000::updateScene() { break; case 2: _vm->_soundMan->playTwoSounds(0x81293110, 0x41861371, 0x43A2507F, 0); - if (_isWallBroken) { - _soundVolume = 0; + if (_isWaterfallRunning) { + _waterfallSoundVolume = 0; _vm->_soundMan->setSoundVolume(0x90F0D1C3, 0); } if (_moduleResult == 0) { @@ -240,7 +239,7 @@ void Module3000::updateScene() { createScene(8, -1); break; case 8: - _isWallBroken = getGlobalVar(V_WALL_BROKEN) != 0; + _isWaterfallRunning = getGlobalVar(V_WALL_BROKEN) != 1; if (_moduleResult != 1) { _vm->_soundMan->setSoundListParams(kModule3000SoundList, true, 0, 0, 0, 0); createScene(4, 1); @@ -301,12 +300,12 @@ void Module3000::updateScene() { } else if (frameNumber == 10) { _vm->_soundMan->playTwoSounds(0x81293110, 0x40030A51, 0xC862CA15, 0); } - if (!_isWallBroken && _soundVolume < 90 && frameNumber % 2) { + if (_isWaterfallRunning && _waterfallSoundVolume < 90 && frameNumber % 2) { if (frameNumber == 0) - _soundVolume = 40; + _waterfallSoundVolume = 40; else - _soundVolume++; - _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume); + _waterfallSoundVolume++; + _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume); } } } @@ -315,9 +314,9 @@ void Module3000::updateScene() { if (navigationScene()->isWalkingForward()) { uint32 frameNumber = navigationScene()->getFrameNumber(); int navigationIndex = navigationScene()->getNavigationIndex(); - if (!_isWallBroken && _soundVolume > 1 && frameNumber % 2) { - _soundVolume--; - _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume); + if (_isWaterfallRunning && _waterfallSoundVolume > 1 && frameNumber % 2) { + _waterfallSoundVolume--; + _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume); } if (navigationIndex == 0) { if (frameNumber == 35) { @@ -340,12 +339,12 @@ void Module3000::updateScene() { if (frameNumber == 40) { _vm->_soundMan->playTwoSounds(0x81293110, 0x40030A51, 0xC862CA15, 0); } - if (!_isWallBroken && _soundVolume < 90 && frameNumber % 2) { + if (_isWaterfallRunning && _waterfallSoundVolume < 90 && frameNumber % 2) { if (frameNumber == 0) - _soundVolume = 40; + _waterfallSoundVolume = 40; else - _soundVolume++; - _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume); + _waterfallSoundVolume++; + _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume); } } } diff --git a/engines/neverhood/modules/module3000.h b/engines/neverhood/modules/module3000.h index e5c251f828..3d895b8d8a 100644 --- a/engines/neverhood/modules/module3000.h +++ b/engines/neverhood/modules/module3000.h @@ -34,8 +34,8 @@ public: Module3000(NeverhoodEngine *vm, Module *parentModule, int which); virtual ~Module3000(); protected: - int _soundVolume; - bool _isWallBroken; + int _waterfallSoundVolume; + bool _isWaterfallRunning; void createScene(int sceneNum, int which); void updateScene(); }; diff --git a/engines/parallaction/saveload.h b/engines/parallaction/saveload.h index dbbbb42066..c9b724e69d 100644 --- a/engines/parallaction/saveload.h +++ b/engines/parallaction/saveload.h @@ -71,12 +71,12 @@ public: }; class SaveLoad_br : public SaveLoad { - Parallaction_br *_vm; +// Parallaction_br *_vm; virtual void doLoadGame(uint16 slot); virtual void doSaveGame(uint16 slot, const char* name); public: - SaveLoad_br(Parallaction_br *vm, Common::SaveFileManager *saveFileMan) : SaveLoad(saveFileMan, "bra"), _vm(vm) { } + SaveLoad_br(Parallaction_br *vm, Common::SaveFileManager *saveFileMan) : SaveLoad(saveFileMan, "bra") { } virtual void getGamePartProgress(bool *complete, int size); virtual void setPartComplete(const char *part); diff --git a/engines/pegasus/ai/ai_area.cpp b/engines/pegasus/ai/ai_area.cpp index 5ac8af8812..9cab568d66 100644 --- a/engines/pegasus/ai/ai_area.cpp +++ b/engines/pegasus/ai/ai_area.cpp @@ -234,6 +234,7 @@ void AIArea::playAIAreaSequence(const LowerClientSignature, const LowerAreaSigna vm->_cursor->hide(); while (_middleAreaMovie.isRunning()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); @@ -258,6 +259,7 @@ void AIArea::playAIAreaSequence(const LowerClientSignature, const LowerAreaSigna vm->_cursor->hide(); while (_rightAreaMovie.isRunning()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); diff --git a/engines/pegasus/energymonitor.cpp b/engines/pegasus/energymonitor.cpp index be9d205360..40e54afb89 100644 --- a/engines/pegasus/energymonitor.cpp +++ b/engines/pegasus/energymonitor.cpp @@ -269,6 +269,7 @@ void EnergyMonitor::calibrateEnergyBar() { // Make sure warning light is hidden... _energyLight.hide(); while (getCurrentEnergy() != (int32)kMaxJMPEnergy) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); diff --git a/engines/pegasus/fader.cpp b/engines/pegasus/fader.cpp index a2bbf22944..80ce8ef5dc 100644 --- a/engines/pegasus/fader.cpp +++ b/engines/pegasus/fader.cpp @@ -94,6 +94,7 @@ void Fader::startFaderSync(const FaderMoveSpec &spec) { start(); while (isFading()) { + InputDevice.pumpEvents(); ((PegasusEngine *)g_engine)->checkCallBacks(); useIdleTime(); } diff --git a/engines/pegasus/input.cpp b/engines/pegasus/input.cpp index b74e4a4c45..283d55421f 100644 --- a/engines/pegasus/input.cpp +++ b/engines/pegasus/input.cpp @@ -81,9 +81,7 @@ void InputDeviceManager::getInput(Input &input, const InputBits filter) { // (ie. if one uses enter to access the restore menu, we never receive // the key up event, which leads to bad things) // This is to closely emulate what the GetKeys() function did on Mac OS - Common::Event event; - while (g_system->getEventManager()->pollEvent(event)) - ; + pumpEvents(); // Now create the bitfield InputBits currentBits = 0; @@ -206,6 +204,13 @@ bool InputDeviceManager::notifyEvent(const Common::Event &event) { return false; } +void InputDeviceManager::pumpEvents() { + // Just poll for events. notifyEvent() will pick up on them. + Common::Event event; + while (g_system->getEventManager()->pollEvent(event)) + ; +} + int operator==(const Input &arg1, const Input &arg2) { return arg1._inputState == arg2._inputState; } diff --git a/engines/pegasus/input.h b/engines/pegasus/input.h index 3e938fa42a..ba6f11dba0 100644 --- a/engines/pegasus/input.h +++ b/engines/pegasus/input.h @@ -50,6 +50,8 @@ public: void waitInput(const InputBits); + void pumpEvents(); + protected: friend class Common::Singleton<SingletonBaseType>; diff --git a/engines/pegasus/interface.cpp b/engines/pegasus/interface.cpp index f2429bf36a..f8ae6a0752 100644 --- a/engines/pegasus/interface.cpp +++ b/engines/pegasus/interface.cpp @@ -604,6 +604,7 @@ void Interface::raiseInventoryDrawerSync() { raiseInventoryDrawer(false); while (_inventoryLid.isRunning()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); @@ -613,6 +614,7 @@ void Interface::raiseInventoryDrawerSync() { inventoryLidOpen(false); while (_inventoryPush.isFading()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); @@ -628,6 +630,7 @@ void Interface::lowerInventoryDrawerSync() { lowerInventoryDrawer(false); while (_inventoryPush.isFading()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); @@ -637,6 +640,7 @@ void Interface::lowerInventoryDrawerSync() { inventoryDrawerDown(false); while (_inventoryLid.isRunning()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); @@ -652,6 +656,7 @@ void Interface::raiseBiochipDrawerSync() { raiseBiochipDrawer(false); while (_biochipLid.isRunning()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); @@ -661,6 +666,7 @@ void Interface::raiseBiochipDrawerSync() { biochipLidOpen(false); while (_biochipPush.isFading()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); @@ -676,6 +682,7 @@ void Interface::lowerBiochipDrawerSync() { lowerBiochipDrawer(false); while (_biochipPush.isFading()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); @@ -685,6 +692,7 @@ void Interface::lowerBiochipDrawerSync() { biochipDrawerDown(false); while (_biochipLid.isRunning()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); diff --git a/engines/pegasus/items/inventorypicture.cpp b/engines/pegasus/items/inventorypicture.cpp index fc812faae2..bfdc382f5d 100644 --- a/engines/pegasus/items/inventorypicture.cpp +++ b/engines/pegasus/items/inventorypicture.cpp @@ -331,6 +331,7 @@ void InventoryItemsPicture::playEndMessage(DisplayElement *pushElement) { endMessage.start(); while (endMessage.isRunning()) { + InputDevice.pumpEvents(); vm->checkCallBacks(); vm->refreshDisplay(); g_system->delayMillis(10); diff --git a/engines/pegasus/items/item.cpp b/engines/pegasus/items/item.cpp index 8089f2b93d..830d3f2f34 100644 --- a/engines/pegasus/items/item.cpp +++ b/engines/pegasus/items/item.cpp @@ -39,9 +39,9 @@ namespace Pegasus { Item::Item(const ItemID id, const NeighborhoodID neighborhood, const RoomID room, const DirectionConstant direction) : IDObject(id) { - _itemNeighborhood = neighborhood; - _itemRoom = room; - _itemDirection = direction; + _originalNeighborhood = _itemNeighborhood = neighborhood; + _originalRoom = _itemRoom = room; + _originalDirection = _itemDirection = direction; _itemWeight = 1; _itemOwnerID = kNoActorID; _itemState = 0; @@ -131,6 +131,14 @@ Item::~Item() { delete[] _itemExtras.entries; } +void Item::reset() { + _itemNeighborhood = _originalNeighborhood; + _itemRoom = _originalRoom; + _itemDirection = _originalDirection; + _itemOwnerID = kNoActorID; + _itemState = 0; +} + void Item::writeToStream(Common::WriteStream *stream) { stream->writeUint16BE(_itemNeighborhood); stream->writeUint16BE(_itemRoom); diff --git a/engines/pegasus/items/item.h b/engines/pegasus/items/item.h index a1451b2a58..26cccf043c 100644 --- a/engines/pegasus/items/item.h +++ b/engines/pegasus/items/item.h @@ -339,6 +339,9 @@ public: void findItemExtra(const uint32 extraID, ItemExtraEntry &entry); + // Reset to its original state at the beginning of the game + void reset(); + protected: NeighborhoodID _itemNeighborhood; RoomID _itemRoom; @@ -347,6 +350,10 @@ protected: WeightType _itemWeight; ItemState _itemState; + NeighborhoodID _originalNeighborhood; + RoomID _originalRoom; + DirectionConstant _originalDirection; + JMPItemInfo _itemInfo; ItemStateInfo _sharedAreaInfo; ItemExtraInfo _itemExtras; diff --git a/engines/pegasus/items/itemlist.cpp b/engines/pegasus/items/itemlist.cpp index ff8cae546b..4b58d9ad78 100644 --- a/engines/pegasus/items/itemlist.cpp +++ b/engines/pegasus/items/itemlist.cpp @@ -64,4 +64,9 @@ Item *ItemList::findItemByID(const ItemID id) { return 0; } +void ItemList::resetAllItems() { + for (ItemIterator it = begin(); it != end(); it++) + (*it)->reset(); +} + } // End of namespace Pegasus diff --git a/engines/pegasus/items/itemlist.h b/engines/pegasus/items/itemlist.h index 9b59206ab3..22bef2c96e 100644 --- a/engines/pegasus/items/itemlist.h +++ b/engines/pegasus/items/itemlist.h @@ -48,6 +48,7 @@ public: virtual void readFromStream(Common::ReadStream *stream); Item *findItemByID(const ItemID id); + void resetAllItems(); }; typedef ItemList::iterator ItemIterator; diff --git a/engines/pegasus/menu.cpp b/engines/pegasus/menu.cpp index e55c006f86..4bbda8fd93 100644 --- a/engines/pegasus/menu.cpp +++ b/engines/pegasus/menu.cpp @@ -227,6 +227,7 @@ MainMenu::MainMenu() : GameMenu(kMainMenuID), _menuBackground(0), _overviewButto _menuLoop.attachFader(&_menuFader); _menuLoop.initFromAIFFFile("Sounds/Main Menu.aiff"); + _menuFader.setMasterVolume(((PegasusEngine *)g_engine)->getAmbienceLevel()); updateDisplay(); } @@ -736,6 +737,7 @@ DeathMenu::DeathMenu(const DeathReason deathReason) : GameMenu(kDeathMenuID), _d _largeSelect.startDisplaying(); } else { _triumphSound.initFromQuickTime("Sounds/Caldoria/Galactic Triumph"); + _triumphSound.setVolume(((PegasusEngine *)g_engine)->getAmbienceLevel()); _triumphSound.playSound(); } diff --git a/engines/pegasus/neighborhood/caldoria/caldoria.cpp b/engines/pegasus/neighborhood/caldoria/caldoria.cpp index 0707a83e87..9d2d6723a9 100644 --- a/engines/pegasus/neighborhood/caldoria/caldoria.cpp +++ b/engines/pegasus/neighborhood/caldoria/caldoria.cpp @@ -196,6 +196,8 @@ void Caldoria::start() { if (!pullbackMovie->loadFile("Images/Caldoria/Pullback.movie")) error("Could not load pullback movie"); + pullbackMovie->setVolume(MIN<uint>(_vm->getSoundFXLevel(), 0xFF)); + // Draw the first frame so we can fade to it const Graphics::Surface *frame = pullbackMovie->decodeNextFrame(); assert(frame); @@ -907,7 +909,7 @@ void Caldoria::arriveAtCaldoria49() { setCurrentAlternate(kAltCaldoriaNormal); // Need to force the loop to play. - if (GameState.getCurrentDirection() == kNorth) { + if (GameState.getCurrentDirection() == kNorth && !GameState.getCaldoriaSinclairShot()) { GameState.setCaldoriaFuseTimeLimit(kSinclairShootsTimeLimit); startExtraSequence(kCa49NorthVoiceAnalysis, kExtraCompletedFlag, kFilterNoInput); } @@ -1916,10 +1918,13 @@ uint Caldoria::getNumHints() { numHints = 1; } break; +#if 0 + // The hint file is missing case MakeRoomView(kCaldoria49, kEast): case MakeRoomView(kCaldoria54, kEast): numHints = 1; break; +#endif case MakeRoomView(kCaldoria49, kNorth): numHints = 1; break; @@ -1950,9 +1955,12 @@ Common::String Caldoria::getHintMovie(uint hintNum) { } return "Images/AI/Globals/XGLOB1A"; +#if 0 + // The hint file is missing case MakeRoomView(kCaldoria49, kEast): case MakeRoomView(kCaldoria54, kEast): return "Images/AI/Caldoria/X49E"; +#endif case MakeRoomView(kCaldoria49, kNorth): return "Images/AI/Caldoria/X49NB2"; } diff --git a/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp b/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp index abf34d3863..c964e3458b 100644 --- a/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp +++ b/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp @@ -1167,6 +1167,18 @@ CaldoriaBomb::~CaldoriaBomb() { delete[] _bombLevel[i]; } +void CaldoriaBomb::setSoundFXLevel(const uint16) { + // The transition sounds between levels are ambience, so overwrite what + // Neighborhood::setSoundFXLevel does and keep using the ambience volume level + if (_timer.isRunning()) + _owner->_navMovie.setVolume(((PegasusEngine *)g_engine)->getAmbienceLevel()); +} + +void CaldoriaBomb::setAmbienceLevel(const uint16 level) { + if (_timer.isRunning()) + _owner->_navMovie.setVolume(level); +} + void CaldoriaBomb::openInteraction() { _grid.moveElementTo(kCaldoriaBombGridLeft, kCaldoriaBombGridTop); _grid.setDisplayOrder(kCaldoriaBombGridOrder); @@ -1234,6 +1246,7 @@ void CaldoriaBomb::receiveNotification(Notification *notification, const Notific _timer.start(); _currentLevel = 0; _lastVertex = -1; + _owner->_navMovie.setVolume(((PegasusEngine *)g_engine)->getAmbienceLevel()); startBombAmbient("Sounds/Caldoria/BmbLoop1.22K.AIFF"); break; case kCaldoria56BombStage2: @@ -1258,6 +1271,7 @@ void CaldoriaBomb::receiveNotification(Notification *notification, const Notific _grid.hide(); _timer.stop(); _timer.hide(); + _owner->_navMovie.setVolume(((PegasusEngine *)g_engine)->getSoundFXLevel()); _owner->loadLoopSound1(""); _owner->playDeathExtra(kCaldoria56BombExplodes, kDeathNuclearExplosion); } @@ -1411,6 +1425,7 @@ void CaldoriaBomb::handleInput(const Input &input, const Hotspot *hotspot) { _timer.stop(); _grid.hide(); _timer.hide(); + _owner->_navMovie.setVolume(((PegasusEngine *)g_engine)->getSoundFXLevel()); _owner->startExtraSequence(kCaldoria56BombStage7, kExtraCompletedFlag, kFilterNoInput); break; } diff --git a/engines/pegasus/neighborhood/caldoria/caldoriabomb.h b/engines/pegasus/neighborhood/caldoria/caldoriabomb.h index 5bb39b4122..ba6d1e8998 100644 --- a/engines/pegasus/neighborhood/caldoria/caldoriabomb.h +++ b/engines/pegasus/neighborhood/caldoria/caldoriabomb.h @@ -122,6 +122,9 @@ public: CaldoriaBomb(Neighborhood *, NotificationManager *); virtual ~CaldoriaBomb(); + void setSoundFXLevel(const uint16); + void setAmbienceLevel(const uint16); + long getNumHints(); Common::String getHintMovie(uint); void doSolve(); diff --git a/engines/pegasus/neighborhood/caldoria/caldoriamessages.cpp b/engines/pegasus/neighborhood/caldoria/caldoriamessages.cpp index a3ce97d438..2ae990d775 100644 --- a/engines/pegasus/neighborhood/caldoria/caldoriamessages.cpp +++ b/engines/pegasus/neighborhood/caldoria/caldoriamessages.cpp @@ -24,6 +24,7 @@ */ #include "pegasus/gamestate.h" +#include "pegasus/pegasus.h" #include "pegasus/neighborhood/neighborhood.h" #include "pegasus/neighborhood/caldoria/caldoria.h" #include "pegasus/neighborhood/caldoria/caldoriamessages.h" @@ -45,6 +46,10 @@ void CaldoriaMessages::openInteraction() { _messageNumber = 1; } +void CaldoriaMessages::setSoundFXLevel(const uint16 fxLevel) { + _messageMovie.setVolume(fxLevel); +} + void CaldoriaMessages::initInteraction() { GameInteraction::_owner->startExtraSequence(kCaBedroomVidPhone, kExtraCompletedFlag, kFilterNoInput); } @@ -101,6 +106,7 @@ void CaldoriaMessages::play1Message(uint messageNumber) { GameState.setCaldoriaSeenMessages(true); } + _messageMovie.setVolume(((PegasusEngine *)g_engine)->getSoundFXLevel()); _messageMovie.moveElementTo(kCaldoriaMessageLeft, kCaldoriaMessageTop); _messageMovie.setDisplayOrder(kCaldoriaMessagesOrder); _messageMovie.startDisplaying(); diff --git a/engines/pegasus/neighborhood/caldoria/caldoriamessages.h b/engines/pegasus/neighborhood/caldoria/caldoriamessages.h index 955fe10ce9..b2fc7c3bf9 100644 --- a/engines/pegasus/neighborhood/caldoria/caldoriamessages.h +++ b/engines/pegasus/neighborhood/caldoria/caldoriamessages.h @@ -41,6 +41,8 @@ public: CaldoriaMessages(Neighborhood *, const NotificationID, NotificationManager *); virtual ~CaldoriaMessages() {} + void setSoundFXLevel(const uint16); + protected: void openInteraction(); void initInteraction(); diff --git a/engines/pegasus/neighborhood/mars/mars.cpp b/engines/pegasus/neighborhood/mars/mars.cpp index 435bcd4c9e..df5a75541c 100644 --- a/engines/pegasus/neighborhood/mars/mars.cpp +++ b/engines/pegasus/neighborhood/mars/mars.cpp @@ -535,6 +535,10 @@ void Mars::doorOpened() { } void Mars::setUpReactorEnergyDrain() { + // If there's no energy monitor, there's nothing to do + if (!g_energyMonitor) + return; + switch (GameState.getCurrentRoomAndView()) { case MakeRoomView(kMars51, kEast): if (GameState.isCurrentDoorOpen()) { @@ -2398,6 +2402,8 @@ void Mars::doCanyonChase() { if (!video->loadFile("Images/Mars/M44ESA.movie")) error("Could not load interface->shuttle transition video"); + video->setVolume(MIN<uint>(_vm->getSoundFXLevel(), 0xFF)); + video->start(); while (!_vm->shouldQuit() && !video->endOfVideo()) { @@ -2476,6 +2482,7 @@ void Mars::doCanyonChase() { _shuttleEnergyMeter.initShuttleEnergyMeter(); _shuttleEnergyMeter.powerUpMeter(); while (_shuttleEnergyMeter.isFading()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); g_system->updateScreen(); @@ -2607,6 +2614,7 @@ void Mars::startUpFromFinishedSpaceChase() { kShuttleJunkTop, false); initOneMovie(&_explosions, "Images/Mars/Explosions.movie", kShuttleWeaponFrontOrder, 0, 0, false); + _explosions.setVolume(_vm->getSoundFXLevel()); _explosionCallBack.initCallBack(&_explosions, kCallBackAtExtremes); _energyBeam.initShuttleWeapon(); @@ -2645,6 +2653,7 @@ void Mars::startUpFromFinishedSpaceChase() { initOneMovie(&_canyonChaseMovie, "Images/Mars/M98EAS.movie", kShuttleTractorBeamMovieOrder, kShuttleWindowLeft, kShuttleWindowTop, true); + _canyonChaseMovie.setVolume(_vm->getSoundFXLevel()); _canyonChaseMovie.setTime(_canyonChaseMovie.getDuration()); _canyonChaseMovie.redrawMovieWorld(); } @@ -2720,6 +2729,7 @@ void Mars::startUpFromSpaceChase() { kShuttleJunkTop, false); initOneMovie(&_explosions, "Images/Mars/Explosions.movie", kShuttleWeaponFrontOrder, 0, 0, false); + _explosions.setVolume(_vm->getSoundFXLevel()); _explosionCallBack.initCallBack(&_explosions, kCallBackAtExtremes); _energyBeam.initShuttleWeapon(); @@ -2783,6 +2793,10 @@ void Mars::startUpFromSpaceChase() { void Mars::setSoundFXLevel(const uint16 level) { Neighborhood::setSoundFXLevel(level); + if (GameState.getCurrentRoomAndView() == MakeRoomView(kMars48, kEast) && + !GameState.getMarsAvoidedReactorRobot()) + _loop2Fader.setMasterVolume(level); + if (_canyonChaseMovie.isMovieValid()) _canyonChaseMovie.setVolume(level); @@ -2812,6 +2826,7 @@ void Mars::marsTimerExpired(MarsTimerEvent &event) { GameState.setScoringEnteredLaunchTube(); while (_canyonChaseMovie.isRunning()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->_system->delayMillis(10); @@ -2836,6 +2851,7 @@ void Mars::marsTimerExpired(MarsTimerEvent &event) { initOneMovie(&_junk, "Images/Mars/Junk.movie", kShuttleJunkOrder, kShuttleJunkLeft, kShuttleJunkTop, false); initOneMovie(&_explosions, "Images/Mars/Explosions.movie", kShuttleWeaponFrontOrder, 0, 0, false); + _explosions.setVolume(_vm->getSoundFXLevel()); _explosionCallBack.initCallBack(&_explosions, kCallBackAtExtremes); _energyBeam.initShuttleWeapon(); @@ -2945,6 +2961,7 @@ void Mars::marsTimerExpired(MarsTimerEvent &event) { showBigExplosion(r, kShuttleAlienShipOrder); while (_explosions.isRunning()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); g_system->delayMillis(10); @@ -3138,6 +3155,7 @@ void Mars::spaceChaseClick(const Input &input, const HotSpotID id) { _shuttleEnergyMeter.drainForTractorBeam(); while (_shuttleEnergyMeter.isFading()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->_system->delayMillis(10); @@ -3167,11 +3185,13 @@ void Mars::spaceChaseClick(const Input &input, const HotSpotID id) { // Shameless reuse of a variable :P initOneMovie(&_canyonChaseMovie, "Images/Mars/M98EAS.movie", kShuttleTractorBeamMovieOrder, kShuttleWindowLeft, kShuttleWindowTop, true); + _canyonChaseMovie.setVolume(_vm->getSoundFXLevel()); _canyonChaseMovie.redrawMovieWorld(); playMovieSegment(&_canyonChaseMovie, 0, _canyonChaseMovie.getDuration()); // wait here until any junk clears... while (_junk.junkFlying()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->_system->delayMillis(10); diff --git a/engines/pegasus/neighborhood/neighborhood.cpp b/engines/pegasus/neighborhood/neighborhood.cpp index 3116bd7978..c9be349694 100644 --- a/engines/pegasus/neighborhood/neighborhood.cpp +++ b/engines/pegasus/neighborhood/neighborhood.cpp @@ -470,6 +470,7 @@ void Neighborhood::requestSpotSound(const TimeValue in, const TimeValue out, con void Neighborhood::playSpotSoundSync(const TimeValue in, const TimeValue out) { // Let the action queue play out first... while (!actionQueueEmpty()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->checkNotifications(); @@ -480,6 +481,7 @@ void Neighborhood::playSpotSoundSync(const TimeValue in, const TimeValue out) { _spotSounds.playSoundSegment(in, out); while (_spotSounds.isPlaying()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->_system->delayMillis(10); @@ -1105,6 +1107,7 @@ void Neighborhood::startTurnPush(const TurnDirection turnDirection, const TimeVa _turnPush.continueFader(); do { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->_system->delayMillis(10); @@ -1492,7 +1495,15 @@ void Neighborhood::loadLoopSound2(const Common::String &soundName, uint16 volume if (!_loop2SoundString.empty()) { _soundLoop2.initFromAIFFFile(_loop2SoundString); _soundLoop2.loopSound(); - _loop2Fader.setMasterVolume(_vm->getAmbienceLevel()); + // HACK: Some ambient loops are actually sound effects, like Ares waiting at + // the reactor and Poseidon at the launch console. Detect these and use the + // SFX volume instead of ambience. + if (soundName == "Sounds/Mars/Robot Loop.aiff" || + soundName == "Sounds/Norad/Breathing Typing.22K.AIFF" || + soundName == "Sounds/Norad/N54NAS.32K.AIFF") + _loop2Fader.setMasterVolume(_vm->getSoundFXLevel()); + else + _loop2Fader.setMasterVolume(_vm->getAmbienceLevel()); _loop2Fader.setFaderValue(0); faderMove.makeTwoKnotFaderSpec(fadeScale, 0, 0, fadeIn, volume); _loop2Fader.startFaderSync(faderMove); @@ -1577,6 +1588,7 @@ void Neighborhood::closeCroppedMovie() { void Neighborhood::playCroppedMovieOnce(const Common::String &movieName, CoordType left, CoordType top, const InputBits interruptionFilter) { openCroppedMovie(movieName, left, top); + _croppedMovie.setVolume(_vm->getSoundFXLevel()); _croppedMovie.redrawMovieWorld(); _croppedMovie.start(); @@ -1616,6 +1628,7 @@ void Neighborhood::playMovieSegment(Movie *movie, TimeValue startTime, TimeValue movie->start(); while (movie->isRunning()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->_system->delayMillis(10); diff --git a/engines/pegasus/neighborhood/neighborhood.h b/engines/pegasus/neighborhood/neighborhood.h index 3c1c5eac92..f7f2b038c6 100644 --- a/engines/pegasus/neighborhood/neighborhood.h +++ b/engines/pegasus/neighborhood/neighborhood.h @@ -91,6 +91,7 @@ struct QueueRequest { bool operator==(const QueueRequest &arg1, const QueueRequest &arg2); bool operator!=(const QueueRequest &arg1, const QueueRequest &arg2); +class CaldoriaBomb; class GameInteraction; class Item; class Neighborhood; @@ -109,6 +110,7 @@ protected: typedef Common::Queue<QueueRequest> NeighborhoodActionQueue; class Neighborhood : public IDObject, public NotificationReceiver, public InputHandler, public Idler { +friend class CaldoriaBomb; friend class StriderCallBack; public: diff --git a/engines/pegasus/neighborhood/norad/delta/globegame.cpp b/engines/pegasus/neighborhood/norad/delta/globegame.cpp index 0b95e9bc2b..5c321a8e8a 100644 --- a/engines/pegasus/neighborhood/norad/delta/globegame.cpp +++ b/engines/pegasus/neighborhood/norad/delta/globegame.cpp @@ -453,8 +453,13 @@ GlobeGame::GlobeGame(Neighborhood *handler) : GameInteraction(kNoradGlobeGameInt _neighborhoodNotification = handler->getNeighborhoodNotification(); } +void GlobeGame::setSoundFXLevel(const uint16 fxLevel) { + _monitorMovie.setVolume(fxLevel); +} + void GlobeGame::openInteraction() { _monitorMovie.initFromMovieFile("Images/Norad Delta/N79 Left Monitor"); + _monitorMovie.setVolume(((PegasusEngine *)g_engine)->getSoundFXLevel()); _monitorMovie.moveElementTo(kGlobeMonitorLeft, kGlobeMonitorTop); _monitorMovie.setDisplayOrder(kGlobeMonitorLayer); _monitorMovie.startDisplaying(); diff --git a/engines/pegasus/neighborhood/norad/delta/globegame.h b/engines/pegasus/neighborhood/norad/delta/globegame.h index 73ed48866f..93235a1784 100644 --- a/engines/pegasus/neighborhood/norad/delta/globegame.h +++ b/engines/pegasus/neighborhood/norad/delta/globegame.h @@ -98,6 +98,8 @@ public: GlobeGame(Neighborhood *); virtual ~GlobeGame() {} + void setSoundFXLevel(const uint16); + void handleInput(const Input &, const Hotspot *); void clickInHotspot(const Input &, const Hotspot *); void activateHotspots(); diff --git a/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp b/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp index 1eea2f0156..ee047d72b2 100644 --- a/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp +++ b/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp @@ -514,6 +514,17 @@ void NoradDelta::openDoor() { } } +void NoradDelta::cantMoveThatWay(CanOpenDoorReason reason) { + // WORKAROUND: The door outside the launch console room isn't treated as a door, + // so play the correct sound. + if (reason == kCantMoveBlocked && GameState.getCurrentRoomAndView() == MakeRoomView(kNorad67, kNorth)) { + cantOpenDoor(kCantOpenLocked); + return; + } + + Neighborhood::cantMoveThatWay(reason); +} + void NoradDelta::activateHotspots() { Norad::activateHotspots(); @@ -863,6 +874,13 @@ void NoradDelta::doSolve() { } } +void NoradDelta::setSoundFXLevel(const uint16 level) { + Neighborhood::setSoundFXLevel(level); + + if (GameState.getCurrentRoomAndView() == MakeRoomView(kNorad54North, kNorth)) + _loop2Fader.setMasterVolume(level); +} + Common::String NoradDelta::getSoundSpotsName() { return "Sounds/Norad/Norad Delta Spots"; } diff --git a/engines/pegasus/neighborhood/norad/delta/noraddelta.h b/engines/pegasus/neighborhood/norad/delta/noraddelta.h index 11065f2c9d..591fd691a2 100644 --- a/engines/pegasus/neighborhood/norad/delta/noraddelta.h +++ b/engines/pegasus/neighborhood/norad/delta/noraddelta.h @@ -68,6 +68,8 @@ public: bool canSolve(); void doSolve(); + void setSoundFXLevel(const uint16); + void doorOpened(); protected: @@ -90,6 +92,7 @@ protected: void arriveAtNorad79West(); TimeValue getViewTime(const RoomID, const DirectionConstant); void openDoor(); + void cantMoveThatWay(CanMoveForwardReason); void activateHotspots(); void clickInHotspot(const Input &, const Hotspot *); void receiveNotification(Notification *, const NotificationFlags); diff --git a/engines/pegasus/neighborhood/tsa/fulltsa.cpp b/engines/pegasus/neighborhood/tsa/fulltsa.cpp index 75f652ad56..92b79c038e 100644 --- a/engines/pegasus/neighborhood/tsa/fulltsa.cpp +++ b/engines/pegasus/neighborhood/tsa/fulltsa.cpp @@ -1692,7 +1692,9 @@ void FullTSA::initializeTBPMonitor(const int newMode, const ExtraID highlightExt releaseSprites(); } - _interruptionFilter = kFilterAllInput; + // Only allow input if we're not in the middle of series of queue requests. + if (actionQueueEmpty()) + _interruptionFilter = kFilterAllInput; } void FullTSA::startUpComparisonMonitor() { @@ -2643,6 +2645,7 @@ void FullTSA::receiveNotification(Notification *notification, const Notification GameState.setMarsReadyForShuttleTransport(false); GameState.setMarsFinishedCanyonChase(false); GameState.setMarsThreadedMaze(false); + GameState.setMarsSawRobotLeave(false); break; case kPlayerOnWayToWSC: _vm->jumpToNewEnvironment(kWSCID, kWSC01, kWest); diff --git a/engines/pegasus/neighborhood/tsa/tinytsa.cpp b/engines/pegasus/neighborhood/tsa/tinytsa.cpp index 0326c7f2ee..c808325b0f 100644 --- a/engines/pegasus/neighborhood/tsa/tinytsa.cpp +++ b/engines/pegasus/neighborhood/tsa/tinytsa.cpp @@ -327,6 +327,7 @@ void TinyTSA::receiveNotification(Notification *notification, const Notification GameState.setMarsReadyForShuttleTransport(false); GameState.setMarsFinishedCanyonChase(false); GameState.setMarsThreadedMaze(false); + GameState.setMarsSawRobotLeave(false); break; case kPlayerOnWayToWSC: _vm->jumpToNewEnvironment(kWSCID, kWSC01, kWest); diff --git a/engines/pegasus/neighborhood/wsc/wsc.cpp b/engines/pegasus/neighborhood/wsc/wsc.cpp index 09e2a48a52..f009b35cdc 100644 --- a/engines/pegasus/neighborhood/wsc/wsc.cpp +++ b/engines/pegasus/neighborhood/wsc/wsc.cpp @@ -2029,6 +2029,7 @@ void WSC::moleculeGameClick(const HotSpotID id) { _moleculesMovie.start(); while (_moleculesMovie.isRunning()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->_system->delayMillis(10); @@ -2063,6 +2064,7 @@ void WSC::moleculeGameClick(const HotSpotID id) { _moleculesMovie.start(); while (_moleculesMovie.isRunning()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->_system->delayMillis(10); @@ -2076,6 +2078,7 @@ void WSC::moleculeGameClick(const HotSpotID id) { while (_moleculesMovie.isRunning()) { + InputDevice.pumpEvents(); _vm->checkCallBacks(); _vm->refreshDisplay(); _vm->_system->delayMillis(10); diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp index c5edd34a01..0010180d8d 100644 --- a/engines/pegasus/pegasus.cpp +++ b/engines/pegasus/pegasus.cpp @@ -36,6 +36,7 @@ #include "backends/keymapper/keymapper.h" #include "base/plugins.h" #include "base/version.h" +#include "gui/message.h" #include "gui/saveload.h" #include "video/theora_decoder.h" #include "video/qt_decoder.h" @@ -306,6 +307,7 @@ void PegasusEngine::runIntro() { Video::VideoDecoder *video = new Video::QuickTimeDecoder(); if (video->loadFile(_introDirectory + "/BandaiLogo.movie")) { + video->setVolume(MIN<uint>(getAmbienceLevel(), 0xFF)); video->start(); while (!shouldQuit() && !video->endOfVideo() && !skipped) { @@ -337,6 +339,8 @@ void PegasusEngine::runIntro() { if (!video->loadFile(_introDirectory + "/Big Movie.movie")) error("Could not load intro movie"); + video->setVolume(MIN<uint>(getAmbienceLevel(), 0xFF)); + video->seek(Audio::Timestamp(0, 10 * 600, 600)); video->start(); @@ -379,20 +383,21 @@ Common::Error PegasusEngine::showSaveDialog() { int slot = slc.runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); - Common::Error result; + if (slot >= 0) + return saveGameState(slot, slc.getResultString()); - if (slot >= 0) { - if (saveGameState(slot, slc.getResultString()).getCode() == Common::kNoError) - result = Common::kNoError; - else - result = Common::kUnknownError; - } else { - result = Common::kUserCanceled; - } + return Common::kUserCanceled; +} - return result; +void PegasusEngine::showSaveFailedDialog(const Common::Error &status) { + Common::String failMessage = Common::String::format(_("Gamestate save failed (%s)! " + "Please consult the README for basic information, and for " + "instructions on how to obtain further assistance."), status.getDesc().c_str()); + GUI::MessageDialog dialog(failMessage); + dialog.runModal(); } + GUI::Debugger *PegasusEngine::getDebugger() { return _console; } @@ -792,6 +797,8 @@ void PegasusEngine::introTimerExpired() { if (!video->loadFile(_introDirectory + "/LilMovie.movie")) error("Failed to load little movie"); + video->setVolume(MIN<uint>(getAmbienceLevel(), 0xFF)); + bool saveAllowed = swapSaveAllowed(false); bool openAllowed = swapLoadAllowed(false); @@ -834,6 +841,7 @@ void PegasusEngine::delayShell(TimeValue time, TimeScale scale) { uint32 timeInMillis = time * 1000 / scale; while (g_system->getMillis() < startTime + timeInMillis) { + InputDevice.pumpEvents(); checkCallBacks(); _gfx->updateDisplay(); } @@ -938,6 +946,8 @@ void PegasusEngine::doGameMenuCommand(const GameMenuCommand command) { if (!video->loadFile(_introDirectory + "/Closing.movie")) error("Could not load closing movie"); + video->setVolume(MIN<uint>(getSoundFXLevel(), 0xFF)); + uint16 x = (640 - video->getWidth() * 2) / 2; uint16 y = (480 - video->getHeight() * 2) / 2; @@ -969,8 +979,14 @@ void PegasusEngine::doGameMenuCommand(const GameMenuCommand command) { resetIntroTimer(); break; case kMenuCmdPauseSave: - if (showSaveDialog().getCode() != Common::kUserCanceled) + result = showSaveDialog(); + + if (result.getCode() != Common::kUserCanceled) { + if (result.getCode() != Common::kNoError) + showSaveFailedDialog(result); + pauseMenu(false); + } break; case kMenuCmdPauseContinue: pauseMenu(false); @@ -1021,7 +1037,12 @@ void PegasusEngine::handleInput(const Input &input, const Hotspot *cursorSpot) { // Can only save during a game and not in the demo if (g_neighborhood && !isDemo()) { pauseEngine(true); - showSaveDialog(); + + Common::Error result = showSaveDialog(); + + if (result.getCode() != Common::kNoError && result.getCode() != Common::kUserCanceled) + showSaveFailedDialog(result); + pauseEngine(false); } } @@ -1669,6 +1690,9 @@ void PegasusEngine::startNewGame() { removeAllItemsFromInventory(); removeAllItemsFromBiochips(); + // Properly reset all items to their original state + g_allItems.resetAllItems(); + BiochipItem *biochip = (BiochipItem *)_allItems.findItemByID(kAIBiochip); addItemToBiochips(biochip); @@ -2159,6 +2183,7 @@ void PegasusEngine::autoDragItemIntoRoom(Item *item, Sprite *draggingSprite) { _autoDragger.autoDrag(draggingSprite, start, stop, time, kDefaultTimeScale); while (_autoDragger.isDragging()) { + InputDevice.pumpEvents(); checkCallBacks(); refreshDisplay(); _system->delayMillis(10); @@ -2192,6 +2217,7 @@ void PegasusEngine::autoDragItemIntoInventory(Item *, Sprite *draggingSprite) { _autoDragger.autoDrag(draggingSprite, start, stop, time, kDefaultTimeScale); while (_autoDragger.isDragging()) { + InputDevice.pumpEvents(); checkCallBacks(); refreshDisplay(); _system->delayMillis(10); @@ -2268,10 +2294,7 @@ void PegasusEngine::doSubChase() { drawScaledFrame(frame, 0, 0); } - Common::Event event; - while (_eventMan->pollEvent(event)) - ; - + InputDevice.pumpEvents(); _system->delayMillis(10); } diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h index fb66eb7586..d88545a4d1 100644 --- a/engines/pegasus/pegasus.h +++ b/engines/pegasus/pegasus.h @@ -257,6 +257,7 @@ private: bool _saveAllowed, _loadAllowed; // It's so nice that this was in the original code already :P Common::Error showLoadDialog(); Common::Error showSaveDialog(); + void showSaveFailedDialog(const Common::Error &status); bool _saveRequested, _loadRequested; // Misc. diff --git a/engines/queen/debug.cpp b/engines/queen/debug.cpp index 96fa81488f..3706806ac2 100644 --- a/engines/queen/debug.cpp +++ b/engines/queen/debug.cpp @@ -21,6 +21,7 @@ */ #include "common/scummsys.h" +#include "common/util.h" #include "queen/debug.h" @@ -57,8 +58,17 @@ void Debugger::postEnter() { _vm->graphics()->setupMouseCursor(); } +static bool isNumeric(const char *arg) { + const char *str = arg; + bool retVal = true; + while (retVal && (*str != '\0')) { + retVal = Common::isDigit(*str++); + } + return retVal; +} + bool Debugger::Cmd_Asm(int argc, const char **argv) { - if (argc == 2) { + if (argc == 2 && isNumeric(argv[1])) { uint16 sm = atoi(argv[1]); _vm->logic()->executeSpecialMove(sm); return false; @@ -75,12 +85,17 @@ bool Debugger::Cmd_Areas(int argc, const char **argv) { } bool Debugger::Cmd_Bob(int argc, const char **argv) { - if (argc >= 3) { + if (argc >= 3 && isNumeric(argv[1])) { int bobNum = atoi(argv[1]); if (bobNum >= Graphics::MAX_BOBS_NUMBER) { DebugPrintf("Bob %d is out of range (range: 0 - %d)\n", bobNum, Graphics::MAX_BOBS_NUMBER); } else { - int param = (argc > 3) ? atoi(argv[3]) : 0; + int param = 0; + if (argc > 3 && isNumeric(argv[3])) { + param = atoi(argv[3]); + } else { + DebugPrintf("Invalid parameter for bob command '%s'\n", argv[2]); + } BobSlot *bob = _vm->graphics()->bob(bobNum); if (!strcmp(argv[2], "toggle")) { bob->active = !bob->active; @@ -109,22 +124,21 @@ bool Debugger::Cmd_Bob(int argc, const char **argv) { bool Debugger::Cmd_GameState(int argc, const char **argv) { uint16 slot; - switch (argc) { - case 2: - slot = atoi(argv[1]); - DebugPrintf("GAMESTATE[%d] ", slot); - DebugPrintf("is %d\n", _vm->logic()->gameState(slot)); - break; - case 3: + if ((argc == 2 || argc == 3) && isNumeric(argv[1])) { slot = atoi(argv[1]); DebugPrintf("GAMESTATE[%d] ", slot); - DebugPrintf("was %d ", _vm->logic()->gameState(slot)); - _vm->logic()->gameState(slot, atoi(argv[2])); - DebugPrintf("now %d\n", _vm->logic()->gameState(slot)); - break; - default: - DebugPrintf("Usage: %s slotnum value\n", argv[0]); - break; + DebugPrintf("%s %d\n", (argc == 2) ? "is" : "was", _vm->logic()->gameState(slot)); + + if (argc == 3) { + if (isNumeric(argv[1])) { + _vm->logic()->gameState(slot, atoi(argv[2])); + DebugPrintf("now %d\n", _vm->logic()->gameState(slot)); + } else { + DebugPrintf("Usage: %s slotnum <value>\n", argv[0]); + } + } + } else { + DebugPrintf("Usage: %s slotnum <value>\n", argv[0]); } return true; } @@ -164,7 +178,7 @@ bool Debugger::Cmd_PrintBobs(int argc, const char**argv) { } bool Debugger::Cmd_Room(int argc, const char **argv) { - if (argc == 2) { + if (argc == 2 && isNumeric(argv[1])) { uint16 roomNum = atoi(argv[1]); _vm->logic()->joePos(0, 0); _vm->logic()->newRoom(roomNum); @@ -180,7 +194,7 @@ bool Debugger::Cmd_Room(int argc, const char **argv) { } bool Debugger::Cmd_Song(int argc, const char **argv) { - if (argc == 2) { + if (argc == 2 && isNumeric(argv[1])) { int16 songNum = atoi(argv[1]); _vm->sound()->playSong(songNum); DebugPrintf("Playing song %d\n", songNum); diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 29e29722d2..65acdbcdf5 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -37,6 +37,7 @@ #include "sci/engine/state.h" #include "sci/engine/kernel.h" #include "sci/engine/savegame.h" +#include "sci/sound/audio.h" #include "sci/console.h" namespace Sci { @@ -494,6 +495,21 @@ reg_t kFileIOWriteString(EngineState *s, int argc, reg_t *argv) { Common::String str = s->_segMan->getString(argv[1]); debugC(kDebugLevelFile, "kFileIO(writeString): %d", handle); + // Handle sciAudio calls in fanmade games here. sciAudio is an + // external .NET library for playing MP3 files in fanmade games. + // It runs in the background, and obtains sound commands from the + // currently running game via text files (called "conductor files"). + // We skip creating these files, and instead handle the calls + // directly. Since the sciAudio calls are only creating text files, + // this is probably the most straightforward place to handle them. + if (handle == 0xFFFF && str.hasPrefix("(sciAudio")) { + Common::List<ExecStack>::const_iterator iter = s->_executionStack.reverse_begin(); + iter--; // sciAudio + iter--; // sciAudio child + g_sci->_audio->handleFanmadeSciAudio(iter->sendp, s->_segMan); + return NULL_REG; + } + #ifdef ENABLE_SCI32 if (handle == VIRTUALFILE_HANDLE) { s->_virtualIndexFile->write(str.c_str(), str.size()); diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index a405ee5c7c..b4d245197b 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -2668,8 +2668,8 @@ void ScriptPatcher::initSignature(const SciScriptPatcherEntry *patchTable, bool uint16 curWord; uint16 curCommand; uint32 curValue; - byte byte1; - byte byte2; + byte byte1 = 0; + byte byte2 = 0; int patchEntryCount = 0; // Count entries and allocate runtime data diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 3147fbda09..8e35d6b055 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -61,6 +61,62 @@ void AudioPlayer::stopAllAudio() { audioCdStop(); } +/** + * Handles the sciAudio calls in fanmade games. + * sciAudio is an external .NET library for playing MP3 files in fanmade games. + * It runs in the background, and obtains sound commands from the + * currently running game via text files (called "conductor files"). + * For further info, check: http://sciprogramming.com/community/index.php?topic=634.0 + */ +void AudioPlayer::handleFanmadeSciAudio(reg_t sciAudioObject, SegManager *segMan) { + // TODO: This is a bare bones implementation. Only the play/playx and stop commands + // are handled for now - the other commands haven't been observed in any fanmade game + // yet. All the volume related and fading functionality is currently missing. + + Kernel *kernel = g_sci->getKernel(); + + reg_t commandReg = readSelector(segMan, sciAudioObject, kernel->findSelector("command")); + Common::String command = segMan->getString(commandReg); + + if (command == "play" || command == "playx") { +#ifdef USE_MAD + reg_t fileNameReg = readSelector(segMan, sciAudioObject, kernel->findSelector("fileName")); + Common::String fileName = segMan->getString(fileNameReg); + + int16 loopCount = (int16)readSelectorValue(segMan, sciAudioObject, kernel->findSelector("loopCount")); + // When loopCount is -1, we treat it as infinite looping, else no looping is done. + // This is observed by game scripts, which can set loopCount to all sorts of random values. + // Adjust loopCount for ScummVM's LoopingAudioStream semantics + loopCount = (loopCount == -1) ? 0 : 1; + + // Determine sound type + Audio::Mixer::SoundType soundType = Audio::Mixer::kSFXSoundType; + if (fileName.hasPrefix("music")) + soundType = Audio::Mixer::kMusicSoundType; + else if (fileName.hasPrefix("speech")) + soundType = Audio::Mixer::kSpeechSoundType; + + Common::File *sciAudio = new Common::File(); + // Replace backwards slashes + for (uint i = 0; i < fileName.size(); i++) { + if (fileName[i] == '\\') + fileName.setChar('/', i); + } + sciAudio->open("sciAudio/" + fileName); + + Audio::SeekableAudioStream *audioStream = Audio::makeMP3Stream(sciAudio, DisposeAfterUse::YES); + + // We only support one audio handle + _mixer->playStream(soundType, &_audioHandle, + Audio::makeLoopingAudioStream((Audio::RewindableAudioStream *)audioStream, loopCount)); +#endif + } else if (command == "stop") { + _mixer->stopHandle(_audioHandle); + } else { + warning("Unhandled sciAudio command: %s", command.c_str()); + } +} + int AudioPlayer::startAudio(uint16 module, uint32 number) { int sampleLen; Audio::AudioStream *audioStream = getAudioStream(number, module, &sampleLen); diff --git a/engines/sci/sound/audio.h b/engines/sci/sound/audio.h index 545d35b2ee..9e65d6e0c8 100644 --- a/engines/sci/sound/audio.h +++ b/engines/sci/sound/audio.h @@ -75,6 +75,8 @@ public: void pauseAudio(); void resumeAudio(); + void handleFanmadeSciAudio(reg_t sciAudioObject, SegManager *segMan); + void setSoundSync(ResourceId id, reg_t syncObjAddr, SegManager *segMan); void doSoundSync(reg_t syncObjAddr, SegManager *segMan); void stopSoundSync(); diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index bb1a7ffaf1..1d1b6b4f13 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -380,7 +380,7 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int int size; assert(height >= 0); - assert(slot >= 0 && slot < 4); + assert((int)slot >= 0 && (int)slot < 4); if (_game.version >= 7) { if (slot == kMainVirtScreen && (_roomHeight != 0)) diff --git a/engines/scumm/gfxARM.s b/engines/scumm/gfxARM.s index 9238888831..5cfe8ba0a4 100644 --- a/engines/scumm/gfxARM.s +++ b/engines/scumm/gfxARM.s @@ -41,6 +41,7 @@ @ In addition, we assume that text, src and dst are all word (4 byte) @ aligned. This is the same assumption that the old 'inline' version @ made. + .align 2 _asmDrawStripToScreen: @ r0 = height @ r1 = width @@ -118,6 +119,7 @@ end: @ In addition, we assume that src and dst are both word (4 byte) @ aligned. This is the same assumption that the old 'inline' version @ made. + .align 2 _asmCopy8Col: @ r0 = dst @ r1 = dstPitch diff --git a/engines/scumm/proc3ARM.s b/engines/scumm/proc3ARM.s index 75dd4b4a7f..70892faef2 100644 --- a/engines/scumm/proc3ARM.s +++ b/engines/scumm/proc3ARM.s @@ -28,14 +28,6 @@ .set space, 48 -.set _scaleIndexY, store_r14 + 28 -.set _numStrips, store_r14 + 24 -.set _palette, store_r14 + 20 -.set _shadow_table, store_r14 + 16 -.set _scaleIndexX, store_r14 + 12 -.set _scaleX, store_r14 + 8 -.set _height, store_r14 + 4 - .set store_r14, space + 36 .set store_r11, space + 32 .set store_r10, space + 28 @@ -46,6 +38,14 @@ .set store_r5, space + 8 .set store_r4, space + 4 +.set _scaleIndexY, store_r14 + 28 +.set _numStrips, store_r14 + 24 +.set _palette, store_r14 + 20 +.set _shadow_table, store_r14 + 16 +.set _scaleIndexX, store_r14 + 12 +.set _scaleX, store_r14 + 8 +.set _height, store_r14 + 4 + .set src, 48 .set height, 44 .set len, 40 @@ -71,6 +71,7 @@ @ <> = _palette @ <> = _numstrips @ <> = _scaleIndexY + .align 2 _ClassicProc3RendererShadowARM: @ shadow20 = false @ shadowed = true diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 67bd6f617d..0aaff4c094 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -188,32 +188,31 @@ bool ScummEngine::saveState(Common::WriteStream *out, bool writeHeader) { } bool ScummEngine::saveState(int slot, bool compat, Common::String &filename) { - bool saveFailed; + bool saveFailed = false; pauseEngine(true); Common::WriteStream *out = openSaveFileForWriting(slot, compat, filename); - if (!out) - return false; - - saveFailed = false; - if (!saveState(out)) + if (!out) { saveFailed = true; + } else { + if (!saveState(out)) + saveFailed = true; - out->finalize(); - if (out->err()) - saveFailed = true; - delete out; + out->finalize(); + if (out->err()) + saveFailed = true; + delete out; + } - if (saveFailed) { + if (saveFailed) debug(1, "State save as '%s' FAILED", filename.c_str()); - return false; - } - debug(1, "State saved as '%s'", filename.c_str()); + else + debug(1, "State saved as '%s'", filename.c_str()); pauseEngine(false); - return true; + return !saveFailed; } @@ -1243,7 +1242,9 @@ void ScummEngine::saveOrLoad(Serializer *s) { } s->saveUint16(0xFFFF); // End marker } else { - while ((type = (ResType)s->loadUint16()) != 0xFFFF) { + uint16 tmp; + while ((tmp = s->loadUint16()) != 0xFFFF) { + type = (ResType)tmp; while ((idx = s->loadUint16()) != 0xFFFF) { assert(idx < _res->_types[type].size()); loadResource(s, type, idx); @@ -1431,7 +1432,9 @@ void ScummEngine::saveOrLoad(Serializer *s) { } s->saveByte(0xFF); } else { - while ((type = (ResType)s->loadByte()) != 0xFF) { + uint8 tmp; + while ((tmp = s->loadByte()) != 0xFF) { + type = (ResType)tmp; idx = s->loadUint16(); _res->lock(type, idx); } diff --git a/engines/scumm/smush/codec47ARM.s b/engines/scumm/smush/codec47ARM.s index a91f932558..53e9143f39 100644 --- a/engines/scumm/smush/codec47ARM.s +++ b/engines/scumm/smush/codec47ARM.s @@ -28,6 +28,7 @@ .global _ARM_Smush_decode2 + .align 2 _ARM_Smush_decode2: @ r0 = dst @ r1 = src diff --git a/engines/sky/debug.cpp b/engines/sky/debug.cpp index a417bc2ece..63da42eec2 100644 --- a/engines/sky/debug.cpp +++ b/engines/sky/debug.cpp @@ -1108,6 +1108,15 @@ void Debugger::postEnter() { _mouse->resetCursor(); } +static bool isNumeric(const char *arg) { + const char *str = arg; + bool retVal = true; + while (retVal && (*str != '\0')) { + retVal = Common::isDigit(*str++); + } + return retVal; +} + bool Debugger::Cmd_ShowGrid(int argc, const char **argv) { _showGrid = !_showGrid; DebugPrintf("Show grid: %s\n", _showGrid ? "On" : "Off"); @@ -1299,22 +1308,20 @@ bool Debugger::Cmd_ScriptVar(int argc, const char **argv) { } bool Debugger::Cmd_Section(int argc, const char **argv) { - if (argc < 2) { - DebugPrintf("Example: %s 4\n", argv[0]); - return true; - } - - const int baseId[] = { START_ONE, START_S6, START_29, START_SC31, START_SC66, START_SC90, START_SC81 }; - int section = atoi(argv[1]); + if (argc == 2 && isNumeric(argv[1])) { + const int baseId[] = { START_ONE, START_S6, START_29, START_SC31, START_SC66, START_SC90, START_SC81 }; + int section = atoi(argv[1]); - if (section >= 0 && section <= 6) { - _logic->fnEnterSection(section == 6 ? 4 : section, 0, 0); - _logic->fnAssignBase(ID_FOSTER, baseId[section], 0); - _skyCompact->fetchCpt(ID_FOSTER)->megaSet = 0; + if (section >= 0 && section <= 6) { + _logic->fnEnterSection(section == 6 ? 4 : section, 0, 0); + _logic->fnAssignBase(ID_FOSTER, baseId[section], 0); + _skyCompact->fetchCpt(ID_FOSTER)->megaSet = 0; + } else { + DebugPrintf("Section %d is out of range (range: %d - %d)\n", section, 0, 6); + } } else { - DebugPrintf("Unknown section '%s'\n", argv[1]); + DebugPrintf("Example: %s 4\n", argv[0]); } - return true; } diff --git a/engines/tony/font.h b/engines/tony/font.h index 6e76c42750..d52547a58d 100644 --- a/engines/tony/font.h +++ b/engines/tony/font.h @@ -347,6 +347,7 @@ public: virtual ~RMDialogChoice(); // Initialization and closure + using RMGfxWoodyBuffer::init; void init(); void close(); diff --git a/engines/tony/game.h b/engines/tony/game.h index d03a975b6f..cda07de889 100644 --- a/engines/tony/game.h +++ b/engines/tony/game.h @@ -300,6 +300,7 @@ public: RMOptionScreen(); virtual ~RMOptionScreen(); + using RMGfxWoodyBuffer::init; void init(CORO_PARAM, RMGfxTargetBuffer &bigBuf, bool &result); void initLoadMenuOnly(CORO_PARAM, RMGfxTargetBuffer &bigBuf, bool bAlternateGfx, bool &result); void initSaveMenuOnly(CORO_PARAM, RMGfxTargetBuffer &bigBuf, bool bAlternateGfx, bool &result); diff --git a/engines/tony/gfxcore.h b/engines/tony/gfxcore.h index ff6c6b3dca..c9081506d7 100644 --- a/engines/tony/gfxcore.h +++ b/engines/tony/gfxcore.h @@ -71,7 +71,7 @@ public: int getDimy(); // Creation - virtual void create(int dimx, int dimy, int nBpp); + void create(int dimx, int dimy, int nBpp); virtual void destroy(); // These are valid only if the buffer is locked diff --git a/engines/tony/inventory.h b/engines/tony/inventory.h index 9b460f390d..5528e6589c 100644 --- a/engines/tony/inventory.h +++ b/engines/tony/inventory.h @@ -101,6 +101,7 @@ public: /** * Initialization and closing */ + using RMGfxWoodyBuffer::init; void init(); void close(); void reset(); @@ -209,6 +210,7 @@ public: /** * Initialization */ + using RMGfxSourceBuffer8RLEByte::init; void init(); void close(); diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 140e1afea5..5a520b0e89 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -640,58 +640,58 @@ bool Ringworld2Debugger::Cmd_ListObjects(int argc, const char **argv) { } DebugPrintf("Available objects for this game are:\n"); - DebugPrintf("1 - R2_OPTO_DISK\n"); - DebugPrintf("2 - R2_READER\n"); - DebugPrintf("3 - R2_NEGATOR_GUN\n"); - DebugPrintf("4 - R2_STEPPING_DISKS\n"); - DebugPrintf("5 - R2_ATTRACTOR_UNIT\n"); - DebugPrintf("6 - R2_SENSOR_PROBE\n"); - DebugPrintf("7 - R2_SONIC_STUNNER\n"); - DebugPrintf("8 - R2_CABLE_HARNESS\n"); - DebugPrintf("9 - R2_COM_SCANNER\n"); - DebugPrintf("10 - R2_SPENT_POWER_CAPSULE\n"); - DebugPrintf("11 - R2_CHARGED_POWER_CAPSULE\n"); - DebugPrintf("12 - R2_AEROSOL\n"); - DebugPrintf("13 - R2_REMOTE_CONTROL\n"); - DebugPrintf("14 - R2_OPTICAL_FIBER\n"); - DebugPrintf("15 - R2_CLAMP\n"); - DebugPrintf("16 - R2_ATTRACTOR_CABLE_HARNESS\n"); - DebugPrintf("17 - R2_FUEL_CELL\n"); - DebugPrintf("18 - R2_GYROSCOPE\n"); - DebugPrintf("19 - R2_AIRBAG\n"); - DebugPrintf("20 - R2_REBREATHER_TANK\n"); - DebugPrintf("21 - R2_RESERVE_REBREATHER_TANK\n"); - DebugPrintf("22 - R2_GUIDANCE_MODULE\n"); - DebugPrintf("23 - R2_THRUSTER_VALVE\n"); - DebugPrintf("24 - R2_BALLOON_BACKPACK\n"); - DebugPrintf("25 - R2_RADAR_MECHANISM\n"); - DebugPrintf("26 - R2_JOYSTICK\n"); - DebugPrintf("27 - R2_IGNITOR\n"); - DebugPrintf("28 - R2_DIAGNOSTICS_DISPLAY\n"); - DebugPrintf("29 - R2_GLASS_DOME\n"); - DebugPrintf("30 - R2_WICK_LAMP\n"); - DebugPrintf("31 - R2_SCRITH_KEY\n"); - DebugPrintf("32 - R2_TANNER_MASK\n"); - DebugPrintf("33 - R2_PURE_GRAIN_ALCOHOL\n"); - DebugPrintf("34 - R2_SAPPHIRE_BLUE\n"); - DebugPrintf("35 - R2_ANCIENT_SCROLLS\n"); - DebugPrintf("36 - R2_FLUTE\n"); - DebugPrintf("37 - R2_GUNPOWDER\n"); - DebugPrintf("38 - R2_NONAME\n"); - DebugPrintf("39 - R2_COM_SCANNER_2\n"); - DebugPrintf("40 - R2_SUPERCONDUCTOR_WIRE\n"); - DebugPrintf("41 - R2_PILLOW\n"); - DebugPrintf("42 - R2_FOOD_TRAY\n"); - DebugPrintf("43 - R2_LASER_HACKSAW\n"); - DebugPrintf("44 - R2_PHOTON_STUNNER\n"); - DebugPrintf("45 - R2_BATTERY\n"); - DebugPrintf("46 - R2_SOAKED_FACEMASK\n"); - DebugPrintf("47 - R2_LIGHT_BULB\n"); - DebugPrintf("48 - R2_ALCOHOL_LAMP\n"); - DebugPrintf("49 - R2_ALCOHOL_LAMP_2\n"); - DebugPrintf("50 - R2_ALCOHOL_LAMP_3\n"); - DebugPrintf("51 - R2_BROKEN_DISPLAY\n"); - DebugPrintf("52 - R2_TOOLBOX\n"); + DebugPrintf("1 - Scene %d - R2_OPTO_DISK\n", BF_INVENTORY.getObjectScene(1)); + DebugPrintf("2 - Scene %d - R2_READER\n", BF_INVENTORY.getObjectScene(2)); + DebugPrintf("3 - Scene %d - R2_NEGATOR_GUN\n", BF_INVENTORY.getObjectScene(3)); + DebugPrintf("4 - Scene %d - R2_STEPPING_DISKS\n", BF_INVENTORY.getObjectScene(4)); + DebugPrintf("5 - Scene %d - R2_ATTRACTOR_UNIT\n", BF_INVENTORY.getObjectScene(5)); + DebugPrintf("6 - Scene %d - R2_SENSOR_PROBE\n", BF_INVENTORY.getObjectScene(6)); + DebugPrintf("7 - Scene %d - R2_SONIC_STUNNER\n", BF_INVENTORY.getObjectScene(7)); + DebugPrintf("8 - Scene %d - R2_CABLE_HARNESS\n", BF_INVENTORY.getObjectScene(8)); + DebugPrintf("9 - Scene %d - R2_COM_SCANNER\n", BF_INVENTORY.getObjectScene(9)); + DebugPrintf("10 - Scene %d - R2_SPENT_POWER_CAPSULE\n", BF_INVENTORY.getObjectScene(10)); + DebugPrintf("11 - Scene %d - R2_CHARGED_POWER_CAPSULE\n", BF_INVENTORY.getObjectScene(11)); + DebugPrintf("12 - Scene %d - R2_AEROSOL\n", BF_INVENTORY.getObjectScene(12)); + DebugPrintf("13 - Scene %d - R2_REMOTE_CONTROL\n", BF_INVENTORY.getObjectScene(13)); + DebugPrintf("14 - Scene %d - R2_OPTICAL_FIBER\n", BF_INVENTORY.getObjectScene(14)); + DebugPrintf("15 - Scene %d - R2_CLAMP\n", BF_INVENTORY.getObjectScene(15)); + DebugPrintf("16 - Scene %d - R2_ATTRACTOR_CABLE_HARNESS\n", BF_INVENTORY.getObjectScene(16)); + DebugPrintf("17 - Scene %d - R2_FUEL_CELL\n", BF_INVENTORY.getObjectScene(17)); + DebugPrintf("18 - Scene %d - R2_GYROSCOPE\n", BF_INVENTORY.getObjectScene(18)); + DebugPrintf("19 - Scene %d - R2_AIRBAG\n", BF_INVENTORY.getObjectScene(19)); + DebugPrintf("20 - Scene %d - R2_REBREATHER_TANK\n", BF_INVENTORY.getObjectScene(20)); + DebugPrintf("21 - Scene %d - R2_RESERVE_REBREATHER_TANK\n", BF_INVENTORY.getObjectScene(21)); + DebugPrintf("22 - Scene %d - R2_GUIDANCE_MODULE\n", BF_INVENTORY.getObjectScene(22)); + DebugPrintf("23 - Scene %d - R2_THRUSTER_VALVE\n", BF_INVENTORY.getObjectScene(23)); + DebugPrintf("24 - Scene %d - R2_BALLOON_BACKPACK\n", BF_INVENTORY.getObjectScene(24)); + DebugPrintf("25 - Scene %d - R2_RADAR_MECHANISM\n", BF_INVENTORY.getObjectScene(25)); + DebugPrintf("26 - Scene %d - R2_JOYSTICK\n", BF_INVENTORY.getObjectScene(26)); + DebugPrintf("27 - Scene %d - R2_IGNITOR\n", BF_INVENTORY.getObjectScene(27)); + DebugPrintf("28 - Scene %d - R2_DIAGNOSTICS_DISPLAY\n", BF_INVENTORY.getObjectScene(28)); + DebugPrintf("29 - Scene %d - R2_GLASS_DOME\n", BF_INVENTORY.getObjectScene(29)); + DebugPrintf("30 - Scene %d - R2_WICK_LAMP\n", BF_INVENTORY.getObjectScene(30)); + DebugPrintf("31 - Scene %d - R2_SCRITH_KEY\n", BF_INVENTORY.getObjectScene(31)); + DebugPrintf("32 - Scene %d - R2_TANNER_MASK\n", BF_INVENTORY.getObjectScene(32)); + DebugPrintf("33 - Scene %d - R2_PURE_GRAIN_ALCOHOL\n", BF_INVENTORY.getObjectScene(33)); + DebugPrintf("34 - Scene %d - R2_SAPPHIRE_BLUE\n", BF_INVENTORY.getObjectScene(34)); + DebugPrintf("35 - Scene %d - R2_ANCIENT_SCROLLS\n", BF_INVENTORY.getObjectScene(35)); + DebugPrintf("36 - Scene %d - R2_FLUTE\n", BF_INVENTORY.getObjectScene(36)); + DebugPrintf("37 - Scene %d - R2_GUNPOWDER\n", BF_INVENTORY.getObjectScene(37)); + DebugPrintf("38 - Scene %d - R2_NONAME\n", BF_INVENTORY.getObjectScene(38)); + DebugPrintf("39 - Scene %d - R2_COM_SCANNER_2\n", BF_INVENTORY.getObjectScene(39)); + DebugPrintf("40 - Scene %d - R2_SUPERCONDUCTOR_WIRE\n", BF_INVENTORY.getObjectScene(40)); + DebugPrintf("41 - Scene %d - R2_PILLOW\n", BF_INVENTORY.getObjectScene(41)); + DebugPrintf("42 - Scene %d - R2_FOOD_TRAY\n", BF_INVENTORY.getObjectScene(42)); + DebugPrintf("43 - Scene %d - R2_LASER_HACKSAW\n", BF_INVENTORY.getObjectScene(43)); + DebugPrintf("44 - Scene %d - R2_PHOTON_STUNNER\n", BF_INVENTORY.getObjectScene(44)); + DebugPrintf("45 - Scene %d - R2_BATTERY\n", BF_INVENTORY.getObjectScene(45)); + DebugPrintf("46 - Scene %d - R2_SOAKED_FACEMASK\n", BF_INVENTORY.getObjectScene(46)); + DebugPrintf("47 - Scene %d - R2_LIGHT_BULB\n", BF_INVENTORY.getObjectScene(47)); + DebugPrintf("48 - Scene %d - R2_ALCOHOL_LAMP\n", BF_INVENTORY.getObjectScene(48)); + DebugPrintf("49 - Scene %d - R2_ALCOHOL_LAMP_2\n", BF_INVENTORY.getObjectScene(49)); + DebugPrintf("50 - Scene %d - R2_ALCOHOL_LAMP_3\n", BF_INVENTORY.getObjectScene(50)); + DebugPrintf("51 - Scene %d - R2_BROKEN_DISPLAY\n", BF_INVENTORY.getObjectScene(51)); + DebugPrintf("52 - Scene %d - R2_TOOLBOX\n", BF_INVENTORY.getObjectScene(52)); return true; } diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 02a21e36f8..9d61b4d182 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -129,10 +129,10 @@ public: if (in) { if (TsAGE::Saver::readSavegameHeader(in, header)) { - saveList.push_back(SaveStateDescriptor(slot, header.saveName)); + saveList.push_back(SaveStateDescriptor(slot, header._saveName)); - header.thumbnail->free(); - delete header.thumbnail; + header._thumbnail->free(); + delete header._thumbnail; } delete in; @@ -162,11 +162,11 @@ public: delete f; // Create the return descriptor - SaveStateDescriptor desc(slot, header.saveName); - desc.setThumbnail(header.thumbnail); - desc.setSaveDate(header.saveYear, header.saveMonth, header.saveDay); - desc.setSaveTime(header.saveHour, header.saveMinutes); - desc.setPlayTime(header.totalFrames * GAME_FRAME_TIME); + SaveStateDescriptor desc(slot, header._saveName); + desc.setThumbnail(header._thumbnail); + desc.setSaveDate(header._saveYear, header._saveMonth, header._saveDay); + desc.setSaveTime(header._saveHour, header._saveMinutes); + desc.setPlayTime(header._totalFrames * GAME_FRAME_TIME); return desc; } diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 95f8c85efe..3f32503fdf 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -5048,6 +5048,7 @@ void Scene3700::signal() { Scene3800::Scene3800() { _desertDirection = 0; + _skylineRect.set(0, 0, 320, 87); } void Scene3800::synchronize(Serializer &s) { @@ -5220,7 +5221,8 @@ void Scene3800::initExits() { } void Scene3800::enterArea() { - R2_GLOBALS._player.disableControl(); + R2_GLOBALS._player.disableControl(CURSOR_WALK); + switch (_desertDirection) { case 0: R2_GLOBALS._player.postInit(); @@ -5346,7 +5348,6 @@ void Scene3800::postInit(SceneObjectList *OwnerList) { _westExit.setDetails(Rect(0, 87, 14, 168), EXITCURSOR_W, 3800); _westExit.setDest(Common::Point(7, 145)); - _skylineRect.set(0, 0, 320, 87); _background.setDetails(Rect(0, 0, 320, 200), 3800, 0, 1, 2, 1, (SceneItem *) NULL); enterArea(); diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp index fe71c03973..9954b929b2 100644 --- a/engines/tsage/saveload.cpp +++ b/engines/tsage/saveload.cpp @@ -141,8 +141,8 @@ Common::Error Saver::save(int slot, const Common::String &saveName) { // Write out the savegame header tSageSavegameHeader header; - header.saveName = saveName; - header.version = TSAGE_SAVEGAME_VERSION; + header._saveName = saveName; + header._version = TSAGE_SAVEGAME_VERSION; writeSavegameHeader(saveFile, header); // Save out objects that need to come at the start of the savegame @@ -190,11 +190,11 @@ Common::Error Saver::restore(int slot) { // Read in the savegame header tSageSavegameHeader header; readSavegameHeader(saveFile, header); - if (header.thumbnail) - header.thumbnail->free(); - delete header.thumbnail; + if (header._thumbnail) + header._thumbnail->free(); + delete header._thumbnail; - serializer.setSaveVersion(header.version); + serializer.setSaveVersion(header._version); // Load in data for objects that need to come at the start of the savegame for (Common::List<SaveListener *>::iterator i = _listeners.begin(); i != _listeners.end(); ++i) { @@ -242,34 +242,34 @@ const char *SAVEGAME_STR = "SCUMMVM_TSAGE"; bool Saver::readSavegameHeader(Common::InSaveFile *in, tSageSavegameHeader &header) { char saveIdentBuffer[SAVEGAME_STR_SIZE + 1]; - header.thumbnail = NULL; + header._thumbnail = NULL; // Validate the header Id in->read(saveIdentBuffer, SAVEGAME_STR_SIZE + 1); if (strncmp(saveIdentBuffer, SAVEGAME_STR, SAVEGAME_STR_SIZE)) return false; - header.version = in->readByte(); - if (header.version > TSAGE_SAVEGAME_VERSION) + header._version = in->readByte(); + if (header._version > TSAGE_SAVEGAME_VERSION) return false; // Read in the string - header.saveName.clear(); + header._saveName.clear(); char ch; - while ((ch = (char)in->readByte()) != '\0') header.saveName += ch; + while ((ch = (char)in->readByte()) != '\0') header._saveName += ch; // Get the thumbnail - header.thumbnail = Graphics::loadThumbnail(*in); - if (!header.thumbnail) + header._thumbnail = Graphics::loadThumbnail(*in); + if (!header._thumbnail) return false; // Read in save date/time - header.saveYear = in->readSint16LE(); - header.saveMonth = in->readSint16LE(); - header.saveDay = in->readSint16LE(); - header.saveHour = in->readSint16LE(); - header.saveMinutes = in->readSint16LE(); - header.totalFrames = in->readUint32LE(); + header._saveYear = in->readSint16LE(); + header._saveMonth = in->readSint16LE(); + header._saveDay = in->readSint16LE(); + header._saveHour = in->readSint16LE(); + header._saveMinutes = in->readSint16LE(); + header._totalFrames = in->readUint32LE(); return true; } @@ -281,7 +281,7 @@ void Saver::writeSavegameHeader(Common::OutSaveFile *out, tSageSavegameHeader &h out->writeByte(TSAGE_SAVEGAME_VERSION); // Write savegame name - out->write(header.saveName.c_str(), header.saveName.size() + 1); + out->write(header._saveName.c_str(), header._saveName.size() + 1); // Get the active palette uint8 thumbPalette[256 * 3]; diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h index a6ad71699e..be5ff51ffb 100644 --- a/engines/tsage/saveload.h +++ b/engines/tsage/saveload.h @@ -38,12 +38,12 @@ typedef void (*SaveNotifierFn)(bool postFlag); class SavedObject; struct tSageSavegameHeader { - uint8 version; - Common::String saveName; - Graphics::Surface *thumbnail; - int saveYear, saveMonth, saveDay; - int saveHour, saveMinutes; - int totalFrames; + uint8 _version; + Common::String _saveName; + Graphics::Surface *_thumbnail; + int _saveYear, _saveMonth, _saveDay; + int _saveHour, _saveMinutes; + int _totalFrames; }; /*--------------------------------------------------------------------------*/ diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index b6434b3523..c5c38505a7 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -468,8 +468,9 @@ void SoundManager::sfProcessFading() { if (vtStruct->_voiceType == VOICETYPE_1) { for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { - if (vtStruct->_entries[idx]._type1._field6 >= -1) - ++vtStruct->_entries[idx]._type1._field6; + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + if (vte._field6 >= -1) + ++vte._field6; } } } @@ -499,22 +500,22 @@ void SoundManager::sfUpdateVoiceStructs() { if (vs->_voiceType == VOICETYPE_0) { for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; + VoiceStructEntryType0 &vte = vs->_entries[idx]._type0; - vse._type0._sound = vse._type0._sound2; - vse._type0._channelNum = vse._type0._channelNum2; - vse._type0._priority = vse._type0._priority2; - vse._type0._fieldA = vse._type0._field12; + vte._sound = vte._sound2; + vte._channelNum = vte._channelNum2; + vte._priority = vte._priority2; + vte._fieldA = vte._field12; } } else { vs->_field3 = vs->_numVoices; for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; + VoiceStructEntryType1 &vte = vs->_entries[idx]._type1; - vse._type1._sound = vse._type1._sound2; - vse._type1._channelNum = vse._type1._channelNum2; - vse._type1._priority = vse._type1._priority2; + vte._sound = vte._sound2; + vte._channelNum = vte._channelNum2; + vte._priority = vte._priority2; } } } @@ -529,16 +530,16 @@ void SoundManager::sfUpdateVoiceStructs2() { for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { if (vtStruct->_voiceType == VOICETYPE_0) { - VoiceStructEntryType0 &vse = vtStruct->_entries[idx]._type0; - vse._sound2 = vse._sound; - vse._channelNum2 = vse._channelNum; - vse._priority2 = vse._priority; - vse._field12 = vse._fieldA; + VoiceStructEntryType0 &vte = vtStruct->_entries[idx]._type0; + vte._sound2 = vte._sound; + vte._channelNum2 = vte._channelNum; + vte._priority2 = vte._priority; + vte._field12 = vte._fieldA; } else { - VoiceStructEntryType1 &vse = vtStruct->_entries[idx]._type1; - vse._sound2 = vse._sound; - vse._channelNum2 = vse._channelNum; - vse._priority2 = vse._priority; + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + vte._sound2 = vte._sound; + vte._channelNum2 = vte._channelNum; + vte._priority2 = vte._priority; } } } @@ -724,7 +725,7 @@ void SoundManager::sfRethinkSoundDrivers() { ve._type0._sound = NULL; ve._type0._channelNum = 0; ve._type0._priority = 0; - ve._type0._fieldA = 0; + ve._type0._fieldA = false; vs->_entries.push_back(ve); } @@ -773,32 +774,31 @@ void SoundManager::sfRethinkVoiceTypes() { if (vs->_voiceType == VOICETYPE_0) { for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; - vse._type0._sound3 = vse._type0._sound; - vse._type0._channelNum3 = vse._type0._channelNum; - vse._type0._priority3 = vse._type0._priority; - vse._type0._field1A = vse._type0._fieldA; - vse._type0._sound = NULL; - vse._type0._channelNum = 0; - vse._type0._priority = 0; - vse._type0._fieldA = 0; - vse._type0._sound2 = NULL; - vse._type0._channelNum2 = 0; - vse._type0._priority2 = 0; - vse._type0._field12 = 0; + VoiceStructEntryType0 &vte = vs->_entries[idx]._type0; + vte._sound3 = vte._sound; + vte._channelNum3 = vte._channelNum; + vte._priority3 = vte._priority; + vte._sound = NULL; + vte._channelNum = 0; + vte._priority = 0; + vte._fieldA = false; + vte._sound2 = NULL; + vte._channelNum2 = 0; + vte._priority2 = 0; + vte._field12 = false; } } else { for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; - vse._type1._sound3 = vse._type1._sound; - vse._type1._channelNum3 = vse._type1._channelNum; - vse._type1._priority3 = vse._type1._priority; - vse._type1._sound = NULL; - vse._type1._channelNum = 0; - vse._type1._priority = 0; - vse._type1._sound2 = NULL; - vse._type1._channelNum2 = 0; - vse._type1._priority2 = 0; + VoiceStructEntryType1 &vte = vs->_entries[idx]._type1; + vte._sound3 = vte._sound; + vte._channelNum3 = vte._channelNum; + vte._priority3 = vte._priority; + vte._sound = NULL; + vte._channelNum = 0; + vte._priority = 0; + vte._sound2 = NULL; + vte._channelNum2 = 0; + vte._priority2 = 0; } // Reset the number of voices available @@ -858,10 +858,11 @@ void SoundManager::sfRethinkVoiceTypes() { if (numVoices >= chNumVoices) { int channelCount = chNumVoices, idx = 0; while (channelCount > 0) { - if (!vtStruct->_entries[idx]._type1._sound2) { - vtStruct->_entries[idx]._type1._sound2 = sound; - vtStruct->_entries[idx]._type1._channelNum2 = foundIndex; - vtStruct->_entries[idx]._type1._priority2 = foundPriority; + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + if (!vte._sound2) { + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; --channelCount; } ++idx; @@ -881,10 +882,11 @@ void SoundManager::sfRethinkVoiceTypes() { } for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { - if (vtStruct->_entries[idx]._type1._priority2 == maxPriority) { - vtStruct->_entries[idx]._type1._sound2 = NULL; - vtStruct->_entries[idx]._type1._channelNum2 = 0; - vtStruct->_entries[idx]._type1._priority2 = 0; + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + if (vte._priority2 == maxPriority) { + vte._sound2 = NULL; + vte._channelNum2 = 0; + vte._priority2 = 0; ++numVoices; } } @@ -892,10 +894,11 @@ void SoundManager::sfRethinkVoiceTypes() { int voicesCtr = chNumVoices; for (uint idx = 0; (idx < vtStruct->_entries.size()) && (voicesCtr > 0); ++idx) { - if (!vtStruct->_entries[idx]._type1._sound2) { - vtStruct->_entries[idx]._type1._sound2 = sound; - vtStruct->_entries[idx]._type1._channelNum2 = foundIndex; - vtStruct->_entries[idx]._type1._priority2 = foundPriority; + VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1; + if (!vte._sound2) { + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; --voicesCtr; } } @@ -932,10 +935,11 @@ void SoundManager::sfRethinkVoiceTypes() { } if (entryIndex != -1) { - vtStruct->_entries[entryIndex]._type0._sound2 = sound; - vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; - vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; - vtStruct->_entries[entryIndex]._type0._field12 = 0; + VoiceStructEntryType0 &vte = vtStruct->_entries[entryIndex]._type0; + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; + vte._field12 = false; continue; } @@ -953,10 +957,11 @@ void SoundManager::sfRethinkVoiceTypes() { } if (entryIndex != -1) { - vtStruct->_entries[entryIndex]._type0._sound2 = sound; - vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; - vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; - vtStruct->_entries[entryIndex]._type0._field12 = 0; + VoiceStructEntryType0 &vte = vtStruct->_entries[entryIndex]._type0; + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; + vte._field12 = false; continue; } @@ -978,10 +983,11 @@ void SoundManager::sfRethinkVoiceTypes() { } if (entryIndex != -1) { - vtStruct->_entries[entryIndex]._type0._sound2 = sound; - vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; - vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; - vtStruct->_entries[entryIndex]._type0._field12 = 0; + VoiceStructEntryType0 &vte = vtStruct->_entries[entryIndex]._type0; + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; + vte._field12 = false; continue; } @@ -1017,10 +1023,11 @@ void SoundManager::sfRethinkVoiceTypes() { continue; if (entryIndex != -1) { - vtStruct->_entries[entryIndex]._type0._sound2 = sound; - vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex; - vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority; - vtStruct->_entries[entryIndex]._type0._field12 = 1; + VoiceStructEntryType0 &vte = vtStruct->_entries[entryIndex]._type0; + vte._sound2 = sound; + vte._channelNum2 = foundIndex; + vte._priority2 = foundPriority; + vte._field12 = true; continue; } @@ -1035,14 +1042,15 @@ void SoundManager::sfRethinkVoiceTypes() { for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) { if (vtStruct->_entries[idx]._field1) { - if (!vtStruct->_entries[idx]._type0._sound2) { + VoiceStructEntryType0 &vte = vtStruct->_entries[idx]._type0; + if (!vte._sound2) { if (vtStruct->_entries[idx]._voiceNum > maxVoiceNum) { maxVoiceNum = vtStruct->_entries[idx]._voiceNum; voiceIndex = idx; } } else { - if (vtStruct->_entries[idx]._type0._priority2 > maxPriority) { - maxPriority = vtStruct->_entries[idx]._type0._priority2; + if (vte._priority2 > maxPriority) { + maxPriority = vte._priority2; priorityIndex = idx; } } @@ -1060,7 +1068,7 @@ void SoundManager::sfRethinkVoiceTypes() { vteSrc._sound2 = sound; vteSrc._channelNum2 = foundIndex; vteSrc._priority2 = foundPriority; - vteSrc._field12 = 1; + vteSrc._field12 = true; continue; } @@ -1084,7 +1092,7 @@ void SoundManager::sfRethinkVoiceTypes() { vteSrc._sound2 = sound; vteSrc._channelNum2 = foundIndex; vteSrc._priority2 = foundPriority; - vteSrc._field12 = 1; + vteSrc._field12 = true; continue; } } @@ -1115,10 +1123,10 @@ void SoundManager::sfRethinkVoiceTypes() { ++total; vse._priority = vse._priority2; - vse._fieldA = 1; + vse._fieldA = true; vse._sound2 = NULL; - if (total) { + if ((total) && vse._sound) { driver->proc24(vse._channelNum, idx, vse._sound, 123, 0); driver->proc24(vse._channelNum, idx, vse._sound, 1, vse._sound->_chModulation[vse._channelNum]); driver->proc24(vse._channelNum, idx, vse._sound, 7, @@ -1135,7 +1143,7 @@ void SoundManager::sfRethinkVoiceTypes() { vse._sound = NULL; vse._channelNum = 0; vse._priority = 0; - vse._fieldA = 0; + vse._fieldA = false; } } @@ -1148,13 +1156,13 @@ void SoundManager::sfRethinkVoiceTypes() { continue; for (uint entryIndex = 0; entryIndex < vs->_entries.size(); ++entryIndex) { - if ((vs->_entries[entryIndex]._type0._sound3 != sound) || - (vs->_entries[entryIndex]._type0._channelNum3 != channelNum)) { + VoiceStructEntryType0 &vteCur = vs->_entries[entryIndex]._type0; + if ((vteCur._sound3 != sound) || (vteCur._channelNum3 != channelNum)) { // Found match - vs->_entries[entryIndex]._type0._sound = sound; - vs->_entries[entryIndex]._type0._channelNum = channelNum; - vs->_entries[entryIndex]._type0._priority = vse._priority2; - vs->_entries[entryIndex]._type0._fieldA = 0; + vteCur._sound = sound; + vteCur._channelNum = channelNum; + vteCur._priority = vse._priority2; + vteCur._fieldA = false; vse._sound2 = NULL; break; } @@ -1185,7 +1193,7 @@ void SoundManager::sfRethinkVoiceTypes() { vseFound._sound = vse._sound2; vseFound._channelNum = vse._channelNum2; vseFound._priority = vse._priority2; - vseFound._fieldA = 0; + vseFound._fieldA = false; SoundDriver *driver = vs->_entries[foundIndex]._driver; assert(driver); @@ -1215,10 +1223,10 @@ void SoundManager::sfRethinkVoiceTypes() { } else { // Type 1 for (uint idx = 0; idx < vs->_entries.size(); ++idx) { - VoiceStructEntry &vse = vs->_entries[idx]; - vse._type1._sound = NULL; - vse._type1._channelNum = 0; - vse._type1._priority = 0; + VoiceStructEntryType1 &vte = vs->_entries[idx]._type1; + vte._sound = NULL; + vte._channelNum = 0; + vte._priority = 0; } for (uint idx = 0; idx < vs->_entries.size(); ++idx) { @@ -2188,9 +2196,10 @@ void Sound::soPlaySound(VoiceTypeStruct *vtStruct, const byte *channelData, int SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; assert(driver); - vtStruct->_entries[entryIndex]._type1._field6 = 0; - vtStruct->_entries[entryIndex]._type1._field4 = v0; - vtStruct->_entries[entryIndex]._type1._field5 = 0; + VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; + vte._field6 = 0; + vte._field4 = v0; + vte._field5 = 0; driver->playSound(channelData, 0, _chProgram[channelNum], vtStruct->_entries[entryIndex]._voiceNum, v0, v1); } @@ -2207,9 +2216,10 @@ void Sound::soPlaySound2(VoiceTypeStruct *vtStruct, const byte *channelData, int assert(driver); byte *trackData = _channelData[trackCtr]; - vtStruct->_entries[entryIndex]._type1._field6 = 0; - vtStruct->_entries[entryIndex]._type1._field4 = v0; - vtStruct->_entries[entryIndex]._type1._field5 = 0; + VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; + vte._field6 = 0; + vte._field4 = v0; + vte._field5 = 0; int v1, v2; driver->playSound(trackData, 14, -1, vtStruct->_entries[entryIndex]._voiceNum, v0, 0x7F); @@ -2336,9 +2346,10 @@ void Sound::soServiceTrackType1(int trackIndex, const byte *channelData) { SoundDriver *driver = vtStruct->_entries[entryIndex]._driver; assert(driver); - vtStruct->_entries[entryIndex]._type1._field6 = 0; - vtStruct->_entries[entryIndex]._type1._field4 = *(channelData + 1); - vtStruct->_entries[entryIndex]._type1._field5 = 0; + VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1; + vte._field6 = 0; + vte._field4 = *(channelData + 1); + vte._field5 = 0; int v1, v2; driver->playSound(channelData, 14, -1, vtStruct->_entries[entryIndex]._voiceNum, *(channelData + 1), 0x7f); diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index ff9379c254..49558b4bca 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -118,15 +118,14 @@ struct VoiceStructEntryType0 { Sound *_sound; int _channelNum; int _priority; - int _fieldA; + bool _fieldA; Sound *_sound2; int _channelNum2; int _priority2; - int _field12; + bool _field12; Sound *_sound3; int _channelNum3; int _priority3; - int _field1A; }; struct VoiceStructEntryType1 { diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp index 5e3d989110..b9c184e2bb 100644 --- a/engines/tucker/graphics.cpp +++ b/engines/tucker/graphics.cpp @@ -163,13 +163,13 @@ void Graphics::copyRect(uint8 *dst, int dstPitch, uint8 *src, int srcPitch, int } void Graphics::drawStringChar(uint8 *dst, int xDst, int yDst, int pitch, uint8 chr, uint8 chrColor, const uint8 *src) { - if (chr < 32 || chr - 32 >= _charset.xCount * _charset.yCount) { + if (chr < 32 || chr - 32 >= _charset._xCount * _charset._yCount) { return; } - const int h = MIN(_charset.charH, 200 - yDst); - const int w = MIN(_charset.charW, pitch - xDst); + const int h = MIN(_charset._charH, 200 - yDst); + const int w = MIN(_charset._charW, pitch - xDst); dst += yDst * pitch + xDst; - int offset = (chr - 32) * _charset.charH * _charset.charW; + int offset = (chr - 32) * _charset._charH * _charset._charW; for (int y = 0; y < h; ++y) { for (int x = 0; x < w; ++x) { const int color = src[offset++]; @@ -189,22 +189,22 @@ void Graphics::setCharset(CharsetType type) { _charsetType = type; switch (type) { case kCharsetTypeDefault: - _charset.charW = 10; - _charset.charH = 10; - _charset.xCount = 32; - _charset.yCount = 7; + _charset._charW = 10; + _charset._charH = 10; + _charset._xCount = 32; + _charset._yCount = 7; break; case kCharsetTypeEng: - _charset.charW = 10; - _charset.charH = 8; - _charset.xCount = 32; - _charset.yCount = 3; + _charset._charW = 10; + _charset._charH = 8; + _charset._xCount = 32; + _charset._yCount = 3; break; case kCharsetTypeCredits: - _charset.charW = 19; - _charset.charH = 10; - _charset.xCount = 16; - _charset.yCount = 7; + _charset._charW = 19; + _charset._charH = 10; + _charset._xCount = 16; + _charset._yCount = 7; break; } } diff --git a/engines/tucker/graphics.h b/engines/tucker/graphics.h index 3e2745186c..3e48179a30 100644 --- a/engines/tucker/graphics.h +++ b/engines/tucker/graphics.h @@ -34,16 +34,14 @@ enum CharsetType { }; struct Charset { - int charW; - int charH; - int xCount; - int yCount; + int _charW; + int _charH; + int _xCount; + int _yCount; }; class Graphics { public: - - static int encodeRLE(const uint8 *src, uint8 *dst, int w, int h); static int encodeRAW(const uint8 *src, uint8 *dst, int w, int h); diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp index 13d5f06894..b5fb10c59e 100644 --- a/engines/tucker/locations.cpp +++ b/engines/tucker/locations.cpp @@ -33,8 +33,8 @@ static const int _data3UpdateLocation1_yTable[] = { 152, 8, 95 }; void TuckerEngine::execData3PreUpdate_locationNum1() { if (_flagsTable[1] == 1) { _flagsTable[1] = 2; - _locationSoundsTable[3].type = 2; - startSound(_locationSoundsTable[3].offset, 3, _locationSoundsTable[3].volume); + _locationSoundsTable[3]._type = 2; + startSound(_locationSoundsTable[3]._offset, 3, _locationSoundsTable[3]._volume); } _mapSequenceFlagsLocationTable[0] = (_flagsTable[1] > 0) ? 1 : 0; if (_updateLocationCounter == 0) { @@ -66,7 +66,7 @@ void TuckerEngine::execData3PreUpdate_locationNum1Helper1() { } } if (_updateLocationFlagsTable[0] == 1 && _updateLocationCounter == 0) { - setVolumeSound(12, _locationSoundsTable[12].volume); + setVolumeSound(12, _locationSoundsTable[12]._volume); } else { setVolumeSound(12, 0); } @@ -122,7 +122,7 @@ void TuckerEngine::execData3PostUpdate_locationNum1() { if (_flagsTable[63] == 0) { if (getRandomNumber() < 400) { _flagsTable[63] = 1; - startSound(_locationSoundsTable[2].offset, 2, _locationSoundsTable[2].volume); + startSound(_locationSoundsTable[2]._offset, 2, _locationSoundsTable[2]._volume); } } _locationHeightTable[1] = (_yPosCurrent > 104) ? 60 : 0; @@ -130,48 +130,48 @@ void TuckerEngine::execData3PostUpdate_locationNum1() { void TuckerEngine::updateSprite_locationNum2() { if (_flagsTable[9] == 2) { - _spritesTable[0].state = -1; + _spritesTable[0]._state = -1; return; } if (_flagsTable[9] == 1) { if (_flagsTable[10] == 1) { - _spritesTable[0].state = -1; + _spritesTable[0]._state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].state = 4; - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._state = 4; + _spritesTable[0]._needUpdate = true; } else { - _spritesTable[0].needUpdate = 0; - _spritesTable[0].state = 5; + _spritesTable[0]._needUpdate = false; + _spritesTable[0]._state = 5; _flagsTable[10] = 1; - _spritesTable[0].gfxBackgroundOffset = 0; + _spritesTable[0]._gfxBackgroundOffset = 0; } return; } if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].state = 3; - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._state = 3; + _spritesTable[0]._needUpdate = true; return; } if (_csDataHandled) { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; if (_flagsTable[199] == 0) { _flagsTable[199] = 1; setCharacterAnimation(0, 0); } else if (getRandomNumber() > 20000) { - _spritesTable[0].state = 6; + _spritesTable[0]._state = 6; } else { - _spritesTable[0].state = 3; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._state = 3; + _spritesTable[0]._updateDelay = 5; } } else { if (_flagsTable[199] == 0) { _flagsTable[199] = 1; setCharacterAnimation(1, 0); } else if (getRandomNumber() < 20000) { - _spritesTable[0].state = 1; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._state = 1; + _spritesTable[0]._updateDelay = 5; } else { - _spritesTable[0].state = 1; + _spritesTable[0]._state = 1; } } } @@ -199,7 +199,7 @@ void TuckerEngine::execData3PreUpdate_locationNum2() { if (_updateLocationYPosTable2[i] > _updateLocationYMaxTable[i]) { _updateLocationYPosTable2[i] = 0; const int num = (getRandomNumber() < 16000) ? 2 : 3; - startSound(_locationSoundsTable[num].offset, num, _locationSoundsTable[num].volume); + startSound(_locationSoundsTable[num]._offset, num, _locationSoundsTable[num]._volume); } } else if (getRandomNumber() > 32000) { const int num = getRandomNumber() / 8192; @@ -243,9 +243,9 @@ void TuckerEngine::updateSprite_locationNum3_0(int i) { int num; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { num = 5; - _spritesTable[i].needUpdate = 1; - } else if (_spritesTable[i].prevState == 5 && _spritesTable[i].animationFrame == 1) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = true; + } else if (_spritesTable[i]._prevState == 5 && _spritesTable[i]._animationFrame == 1) { + _spritesTable[i]._needUpdate = false; int r = getRandomNumber(); if (r < 12000) { num = 3; @@ -256,11 +256,11 @@ void TuckerEngine::updateSprite_locationNum3_0(int i) { } } else { num = 5; - _spritesTable[i].animationFrame = 1; - _spritesTable[i].updateDelay = 10; + _spritesTable[i]._animationFrame = 1; + _spritesTable[i]._updateDelay = 10; } - _spritesTable[i].state = num; - _spritesTable[i].prevAnimationFrame = 1; + _spritesTable[i]._state = num; + _spritesTable[i]._prevAnimationFrame = true; } void TuckerEngine::updateSprite_locationNum3_1(int i) { @@ -268,44 +268,44 @@ void TuckerEngine::updateSprite_locationNum3_1(int i) { if (_flagsTable[207] == 1) { num = -1; } else if (_flagsTable[203] == 1) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; num = 20; _flagsTable[203] = 2; } else if (_flagsTable[203] == 2) { num = 12; } else if (_flagsTable[203] == 3) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; num = 19; _flagsTable[203] = 0; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; if (_flagsTable[21] == 0) { num = 7; } else { num = 8; } } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (_csDataHandled) { num = 6; if (getRandomNumber() < 32000) { - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - } else if (_spritesTable[i].state == 6 && _spritesTable[i].animationFrame == 1) { + } else if (_spritesTable[i]._state == 6 && _spritesTable[i]._animationFrame == 1) { if (getRandomNumber() < 20000) { num = 11; - _spritesTable[i].defaultUpdateDelay = 5; + _spritesTable[i]._defaultUpdateDelay = 5; } else { num = 10; } } else { num = 6; - _spritesTable[i].animationFrame = 1; - _spritesTable[i].updateDelay = 10; + _spritesTable[i]._animationFrame = 1; + _spritesTable[i]._updateDelay = 10; } } - _spritesTable[i].state = num; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = num; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum3_2(int i) { @@ -314,32 +314,32 @@ void TuckerEngine::updateSprite_locationNum3_2(int i) { _flagsTable[205] = 0; num = 18; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; num = 17; } else if (_flagsTable[45] == 1) { _flagsTable[45] = 2; num = 16; } else if (_flagsTable[45] == 2) { num = 17; - _spritesTable[i].updateDelay = 5; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._updateDelay = 5; + _spritesTable[i]._needUpdate = false; } else if (_flagsTable[45] == 3) { _flagsTable[45] = 0; num = 16; - _updateSpriteFlag2 = 1; + _updateSpriteFlag2 = true; } else { - _spritesTable[i].needUpdate = 0; - ++_spritesTable[i].counter; - if (_spritesTable[i].counter <= 5) { + _spritesTable[i]._needUpdate = false; + ++_spritesTable[i]._counter; + if (_spritesTable[i]._counter <= 5) { num = 14; } else { - if (_spritesTable[i].counter > 8) { - _spritesTable[i].counter = 0; + if (_spritesTable[i]._counter > 8) { + _spritesTable[i]._counter = 0; } num = 15; } } - _spritesTable[i].state = num; + _spritesTable[i]._state = num; } void TuckerEngine::execData3PreUpdate_locationNum3() { @@ -362,36 +362,36 @@ void TuckerEngine::updateSprite_locationNum4(int i) { if (_flagsTable[9] == 2) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 1; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 2; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum4() { if (_flagsTable[6] == 0) { setVolumeSound(0, 0); } else { - setVolumeSound(0, _locationSoundsTable[0].volume); + setVolumeSound(0, _locationSoundsTable[0]._volume); } } void TuckerEngine::updateSprite_locationNum5_0() { - ++_spritesTable[0].counter; - if (_spritesTable[0].counter > 100) { - _spritesTable[0].counter = 0; - _spritesTable[0].state = 1; - _locationSoundsTable[1].type = 2; - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); - } else if (_spritesTable[0].counter == 50) { - _locationSoundsTable[1].type = 2; - _spritesTable[0].state = 2; - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); - } else { - _spritesTable[0].state = -1; + ++_spritesTable[0]._counter; + if (_spritesTable[0]._counter > 100) { + _spritesTable[0]._counter = 0; + _spritesTable[0]._state = 1; + _locationSoundsTable[1]._type = 2; + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); + } else if (_spritesTable[0]._counter == 50) { + _locationSoundsTable[1]._type = 2; + _spritesTable[0]._state = 2; + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); + } else { + _spritesTable[0]._state = -1; if (isSoundPlaying(1)) { stopSound(1); } @@ -399,7 +399,7 @@ void TuckerEngine::updateSprite_locationNum5_0() { } void TuckerEngine::updateSprite_locationNum5_1(int i) { - _spritesTable[i].state = 3; + _spritesTable[i]._state = 3; } void TuckerEngine::updateSprite_locationNum6_0(int i) { @@ -410,29 +410,29 @@ void TuckerEngine::updateSprite_locationNum6_0(int i) { state = 14; } else if (_flagsTable[26] == 4 || _flagsTable[26] == 5) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._needUpdate = true; state = 3; - _spritesTable[0].counter = 0; + _spritesTable[0]._counter = 0; } else if (_xPosCurrent < 370 && _flagsTable[26] == 4) { state = 2; - } else if (_spritesTable[0].counter == 0) { + } else if (_spritesTable[0]._counter == 0) { setCharacterAnimation(0, 0); - _updateSpriteFlag1 = 1; - ++_spritesTable[0].counter; + _updateSpriteFlag1 = true; + ++_spritesTable[0]._counter; return; } else { state = 1; - _spritesTable[0].updateDelay = 2; - ++_spritesTable[0].counter; - if (_spritesTable[0].counter > 100) { - _spritesTable[0].counter = 0; + _spritesTable[0]._updateDelay = 2; + ++_spritesTable[0]._counter; + if (_spritesTable[0]._counter > 100) { + _spritesTable[0]._counter = 0; } } } else { state = -1; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum6_1(int i) { @@ -440,18 +440,18 @@ void TuckerEngine::updateSprite_locationNum6_1(int i) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { if (_flagsTable[209] == 1) { state = 9; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 10; } } else { if (getRandomNumber() < 30000 || (_csDataHandled && _xPosCurrent == 248)) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 7; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 7; _miscSoundFxNum[0] = 3; _miscSoundFxDelayCounter[0] = 70; @@ -459,7 +459,7 @@ void TuckerEngine::updateSprite_locationNum6_1(int i) { _miscSoundFxDelayCounter[1] = 25; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum6_2(int i) { @@ -467,13 +467,13 @@ void TuckerEngine::updateSprite_locationNum6_2(int i) { if (_flagsTable[26] < 5 || _flagsTable[207] > 0) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 12; } else { state = 12; - _spritesTable[i].updateDelay = 2; + _spritesTable[i]._updateDelay = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum6() { @@ -483,11 +483,11 @@ void TuckerEngine::execData3PreUpdate_locationNum6() { if (_flagsTable[26] == 2) { _currentSpriteAnimationLength = 2; _currentSpriteAnimationFrame = 112; - if (_spritesTable[0].xSource < 45) { + if (_spritesTable[0]._xSource < 45) { _currentSpriteAnimationFrame2 = 144; - } else if (_spritesTable[0].xSource > 80) { + } else if (_spritesTable[0]._xSource > 80) { _currentSpriteAnimationFrame2 = 147; - } else if (_spritesTable[0].xSource < 60) { + } else if (_spritesTable[0]._xSource < 60) { _currentSpriteAnimationFrame2 = 145; } else { _currentSpriteAnimationFrame2 = 146; @@ -500,24 +500,24 @@ void TuckerEngine::execData3PreUpdate_locationNum6Helper1() { if (_flagsTable[26] == 1) { if (_flagsTable[27] < 15) { if (_flagsTable[27] == 0) { - startSound(_locationSoundsTable[2].offset, 2, _locationSoundsTable[2].volume); - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); + startSound(_locationSoundsTable[2]._offset, 2, _locationSoundsTable[2]._volume); + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); } ++_flagsTable[27]; - setVolumeSound(0, _locationSoundsTable[0].volume - _flagsTable[27] * 5); - setVolumeMusic(0, _locationMusicsTable[0].volume - _flagsTable[27] * 5); + setVolumeSound(0, _locationSoundsTable[0]._volume - _flagsTable[27] * 5); + setVolumeMusic(0, _locationMusicsTable[0]._volume - _flagsTable[27] * 5); } } else if (_flagsTable[26] == 3) { if (_flagsTable[27] > 0) { if (_flagsTable[27] == 15) { - startSound(_locationSoundsTable[2].offset, 2, _locationSoundsTable[2].volume); + startSound(_locationSoundsTable[2]._offset, 2, _locationSoundsTable[2]._volume); } --_flagsTable[27]; - setVolumeSound(0, _locationSoundsTable[0].volume - _flagsTable[27] * 5); - setVolumeMusic(0, _locationMusicsTable[0].volume - _flagsTable[27] * 5); + setVolumeSound(0, _locationSoundsTable[0]._volume - _flagsTable[27] * 5); + setVolumeMusic(0, _locationMusicsTable[0]._volume - _flagsTable[27] * 5); int volume = _flagsTable[27]; - if (volume < _locationSoundsTable[1].volume) { - volume = _locationSoundsTable[1].volume; + if (volume < _locationSoundsTable[1]._volume) { + volume = _locationSoundsTable[1]._volume; } setVolumeSound(1, volume); } @@ -538,12 +538,12 @@ void TuckerEngine::execData3PreUpdate_locationNum6Helper1() { x2 = 15 - _flagsTable[27]; } for (int i = 0; i < x1; ++i) { - execData3PreUpdate_locationNum6Helper2(20 * 640 + 325 + i * 8, _data3GfxBuf + _dataTable[238].sourceOffset); - execData3PreUpdate_locationNum6Helper2(20 * 640 + 445 - i * 8, _data3GfxBuf + _dataTable[238].sourceOffset); + execData3PreUpdate_locationNum6Helper2(20 * 640 + 325 + i * 8, _data3GfxBuf + _dataTable[238]._sourceOffset); + execData3PreUpdate_locationNum6Helper2(20 * 640 + 445 - i * 8, _data3GfxBuf + _dataTable[238]._sourceOffset); } for (int i = 0; i < x2; ++i) { - execData3PreUpdate_locationNum6Helper3(20 * 640 + 325 + x1 * 8 + i * 4, _data3GfxBuf + _dataTable[238].sourceOffset); - execData3PreUpdate_locationNum6Helper3(20 * 640 + 449 - x1 * 8 - i * 4, _data3GfxBuf + _dataTable[238].sourceOffset); + execData3PreUpdate_locationNum6Helper3(20 * 640 + 325 + x1 * 8 + i * 4, _data3GfxBuf + _dataTable[238]._sourceOffset); + execData3PreUpdate_locationNum6Helper3(20 * 640 + 449 - x1 * 8 - i * 4, _data3GfxBuf + _dataTable[238]._sourceOffset); } addDirtyRect(0, 20, 640, 51); } @@ -583,37 +583,37 @@ void TuckerEngine::execData3PostUpdate_locationNum6() { void TuckerEngine::updateSprite_locationNum7_0(int i) { int state; - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 4; } else { - _spritesTable[i].needUpdate = 0; - if (_spritesTable[i].counter > 0) { + _spritesTable[i]._needUpdate = false; + if (_spritesTable[i]._counter > 0) { state = 2; - _spritesTable[i].counter = 0; + _spritesTable[i]._counter = 0; } else { state = 1; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum7_1(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 5; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum8_0(int i) { - _spritesTable[i].state = (_flagsTable[28] < 20) ? -1 : 7; + _spritesTable[i]._state = (_flagsTable[28] < 20) ? -1 : 7; } void TuckerEngine::updateSprite_locationNum8_1(int i) { @@ -622,20 +622,20 @@ void TuckerEngine::updateSprite_locationNum8_1(int i) { state = -1; } else if (_flagsTable[28] == 18) { state = 6; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } else if (_flagsTable[29] == 0) { state = 1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 1) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 3; } if (_flagsTable[28] == 19) { _flagsTable[28] = 20; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PostUpdate_locationNum8() { @@ -662,7 +662,7 @@ void TuckerEngine::execData3PostUpdate_locationNum8() { _updateLocationYPosTable2[0] += 2; if (_updateLocationYPosTable2[0] > 120) { _updateLocationYPosTable2[0] = 0; - startSound(_locationSoundsTable[2].offset, 2, _locationSoundsTable[2].volume); + startSound(_locationSoundsTable[2]._offset, 2, _locationSoundsTable[2]._volume); } } if (_flagsTable[28] > 1 && _flagsTable[28] < 5) { @@ -674,82 +674,82 @@ void TuckerEngine::execData3PostUpdate_locationNum8() { void TuckerEngine::updateSprite_locationNum9_0(int i) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[i].needUpdate = 1; - _spritesTable[i].state = 3; + _spritesTable[i]._needUpdate = true; + _spritesTable[i]._state = 3; } else if (_updateLocationCounter2 > 0 || getRandomNumber() > 30000) { - _spritesTable[i].state = 1; + _spritesTable[i]._state = 1; if (_updateLocationCounter2 == 0) { _updateLocationCounter2 = 6; } } else if (getRandomNumber() > 30000) { - _spritesTable[i].state = 2; - _spritesTable[i].defaultUpdateDelay = 5; + _spritesTable[i]._state = 2; + _spritesTable[i]._defaultUpdateDelay = 5; } else { - _spritesTable[i].state = 1; - _spritesTable[i].animationFrame = 1; - _spritesTable[i].updateDelay = 10; + _spritesTable[i]._state = 1; + _spritesTable[i]._animationFrame = 1; + _spritesTable[i]._updateDelay = 10; } } void TuckerEngine::updateSprite_locationNum9_1(int i) { - ++_spritesTable[i].counter; - if (_spritesTable[i].counter > 10) { - _spritesTable[i].counter = 0; - _spritesTable[i].state = 5; - _spritesTable[i].defaultUpdateDelay = 5; + ++_spritesTable[i]._counter; + if (_spritesTable[i]._counter > 10) { + _spritesTable[i]._counter = 0; + _spritesTable[i]._state = 5; + _spritesTable[i]._defaultUpdateDelay = 5; } else { - _spritesTable[i].state = 4; + _spritesTable[i]._state = 4; } } void TuckerEngine::updateSprite_locationNum9_2(int i) { - _spritesTable[i].state = 6; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = 6; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum9() { if (_flagsTable[7] < 2) { _flagsTable[7] = 2; } - if (_flagsTable[8] == 0 && _locationMusicsTable[0].volume != 0) { - _locationMusicsTable[0].volume = 0; + if (_flagsTable[8] == 0 && _locationMusicsTable[0]._volume != 0) { + _locationMusicsTable[0]._volume = 0; } else { - _locationMusicsTable[0].volume = _xPosCurrent / 40; + _locationMusicsTable[0]._volume = _xPosCurrent / 40; } - setVolumeMusic(0, _locationMusicsTable[0].volume); + setVolumeMusic(0, _locationMusicsTable[0]._volume); if (!isSoundPlaying(1) && getRandomNumber() > 32000) { int i = getRandomNumber() / 5500 + 3; assert(i >= 0 && i < kLocationSoundsTableSize); - startSound(_locationSoundsTable[i].offset, i, _locationSoundsTable[i].volume); + startSound(_locationSoundsTable[i]._offset, i, _locationSoundsTable[i]._volume); } if (_flagsTable[8] == 2 && _locationMaskType == 0) { _flagsTable[8] = 0; - startSound(_locationSoundsTable[7].offset, 7, _locationSoundsTable[7].volume); + startSound(_locationSoundsTable[7]._offset, 7, _locationSoundsTable[7]._volume); } } void TuckerEngine::execData3PostUpdate_locationNum9() { - if (_spritesTable[1].state == 4) { - if (_spritesTable[1].flipX == 1) { + if (_spritesTable[1]._state == 4) { + if (_spritesTable[1]._flipX) { --_updateLocationXPosTable2[0]; if (_updateLocationXPosTable2[0] < -50) { - _spritesTable[1].flipX = 0; + _spritesTable[1]._flipX = false; _updateLocationXPosTable2[0] = -50; } } else { ++_updateLocationXPosTable2[0]; if (_updateLocationXPosTable2[0] > 500) { - _spritesTable[1].flipX = 1; + _spritesTable[1]._flipX = true; _updateLocationXPosTable2[0] = 500; } } } - _spritesTable[1].gfxBackgroundOffset = _updateLocationXPosTable2[0] + 8320; + _spritesTable[1]._gfxBackgroundOffset = _updateLocationXPosTable2[0] + 8320; for (int i = 1; i < 3; ++i) { - _spritesTable[i].colorType = 1; - _spritesTable[i].yMaxBackground = 60; + _spritesTable[i]._colorType = 1; + _spritesTable[i]._yMaxBackground = 60; drawSprite(i); - _spritesTable[i].colorType = 0; + _spritesTable[i]._colorType = 0; } } @@ -759,7 +759,7 @@ void TuckerEngine::updateSprite_locationNum10() { if (_flagsTable[99] == 1) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._needUpdate = true; if (r < 26000) { state = 1; } else if (r < 29000) { @@ -769,12 +769,12 @@ void TuckerEngine::updateSprite_locationNum10() { } } else if (_csDataHandled) { state = 2; - _spritesTable[0].updateDelay = 4; + _spritesTable[0]._updateDelay = 4; } else { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; if (r > 26000) { state = 5; - _spritesTable[0].prevAnimationFrame = 1; + _spritesTable[0]._prevAnimationFrame = true; } else if (r > 24000) { state = 6; _miscSoundFxDelayCounter[0] = 120; @@ -783,7 +783,7 @@ void TuckerEngine::updateSprite_locationNum10() { setCharacterAnimation(0, 0); } } - _spritesTable[0].state = state; + _spritesTable[0]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum10() { @@ -797,8 +797,8 @@ void TuckerEngine::execData3PreUpdate_locationNum10() { if (_flagsTable[47] == 1 && _inventoryItemsState[26] == 1) { _flagsTable[47] = 2; } - if (_spritesTable[0].state == 6 && _spritesTable[0].animationFrame == 18 && !isSoundPlaying(0)) { - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + if (_spritesTable[0]._state == 6 && _spritesTable[0]._animationFrame == 18 && !isSoundPlaying(0)) { + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); } if (_flagsTable[230] == 1 && getRandomNumber() > 32000) { _flagsTable[230] = 0; @@ -808,52 +808,52 @@ void TuckerEngine::execData3PreUpdate_locationNum10() { void TuckerEngine::updateSprite_locationNum11_0(int i) { const int r = getRandomNumber(); if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; - _spritesTable[i].state = 2; + _spritesTable[i]._needUpdate = true; + _spritesTable[i]._state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (r > 28000) { - _spritesTable[i].state = 3; + _spritesTable[i]._state = 3; } else if (r > 20000) { - _spritesTable[i].state = 4; + _spritesTable[i]._state = 4; } else { - _spritesTable[i].state = 3; - _spritesTable[i].animationFrame = 1; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._state = 3; + _spritesTable[i]._animationFrame = 1; + _spritesTable[i]._updateDelay = 5; } } } void TuckerEngine::updateSprite_locationNum11_1(int i) { if (getRandomNumber() > 20000) { - _spritesTable[i].state = 5; + _spritesTable[i]._state = 5; } else { - _spritesTable[i].animationFrame = 14; - _updateSpriteFlag1 = 1; - _spritesTable[i].state = 5; + _spritesTable[i]._animationFrame = 14; + _updateSpriteFlag1 = true; + _spritesTable[i]._state = 5; } } void TuckerEngine::updateSprite_locationNum11_2(int i) { if (getRandomNumber() > 20000) { - _spritesTable[i].state = 6; + _spritesTable[i]._state = 6; } else { - _spritesTable[i].animationFrame = 17; - _spritesTable[i].state = 6; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = 17; + _spritesTable[i]._state = 6; + _updateSpriteFlag1 = true; } } void TuckerEngine::updateSprite_locationNum11_3(int i) { - _spritesTable[i].state = 7; + _spritesTable[i]._state = 7; } void TuckerEngine::updateSprite_locationNum11_4(int i) { if (getRandomNumber() > 30000 && _flagsTable[55] < 2) { - _spritesTable[i].state = 1; - startSound(_locationSoundsTable[6].offset, 6, _locationSoundsTable[6].volume); + _spritesTable[i]._state = 1; + startSound(_locationSoundsTable[6]._offset, 6, _locationSoundsTable[6]._volume); } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } } @@ -866,10 +866,10 @@ void TuckerEngine::updateSprite_locationNum12_0(int i) { if (_flagsTable[207] > 0) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (_updateLocationCounter2 < 4) { state = 1; } else if (_updateLocationCounter2 < 8) { @@ -878,7 +878,7 @@ void TuckerEngine::updateSprite_locationNum12_0(int i) { state = 4; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum12_1(int i) { @@ -891,7 +891,7 @@ void TuckerEngine::updateSprite_locationNum12_1(int i) { } else { state = 8; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum12() { @@ -899,13 +899,13 @@ void TuckerEngine::execData3PreUpdate_locationNum12() { _flagsTable[38] = 1; } if (_flagsTable[41] == 0) { - if (_locationMusicsTable[0].volume != 100) { - _locationMusicsTable[0].volume = 100; + if (_locationMusicsTable[0]._volume != 100) { + _locationMusicsTable[0]._volume = 100; setVolumeMusic(0, 100); } } else { - if (_locationMusicsTable[0].volume != 20) { - _locationMusicsTable[0].volume = 20; + if (_locationMusicsTable[0]._volume != 20) { + _locationMusicsTable[0]._volume = 20; setVolumeMusic(0, 20); } } @@ -917,44 +917,44 @@ void TuckerEngine::updateSprite_locationNum13(int i) { if (_flagsTable[202] == 0) { _flagsTable[202] = 1; state = 3; - _spritesTable[i].stateIndex = -1; + _spritesTable[i]._stateIndex = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 4; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 5; } } else if (_flagsTable[202] == 1) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; _flagsTable[202] = 0; state = 6; } else { setCharacterAnimation(0, 0); return; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum13() { if (_flagsTable[69] == 0) { if (getRandomNumber() > 31000) { _flagsTable[69] = 1; - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); } else if (isSoundPlaying(1)) { stopSound(1); } } _flagsTable[8] = 2; - if (_spritesTable[0].state == 1) { - if (_spritesTable[0].animationFrame > 10 && _spritesTable[0].animationFrame < 20) { + if (_spritesTable[0]._state == 1) { + if (_spritesTable[0]._animationFrame > 10 && _spritesTable[0]._animationFrame < 20) { if (!isSoundPlaying(0)) { - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); } } } if (isSoundPlaying(0)) { - if (_spritesTable[0].animationFrame > 10 && _spritesTable[0].animationFrame < 20) { + if (_spritesTable[0]._animationFrame > 10 && _spritesTable[0]._animationFrame < 20) { stopSound(0); } } @@ -963,12 +963,12 @@ void TuckerEngine::execData3PreUpdate_locationNum13() { void TuckerEngine::updateSprite_locationNum14(int i) { int state = 2; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = (getRandomNumber() < 12000) ? 1 : 3; } else if (getRandomNumber() < 26000) { - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum14() { @@ -988,7 +988,7 @@ void TuckerEngine::execData3PreUpdate_locationNum14() { num = 7; } if (num != -1) { - startSound(_locationSoundsTable[num].offset, num, _locationSoundsTable[num].volume); + startSound(_locationSoundsTable[num]._offset, num, _locationSoundsTable[num]._volume); } } _locationHeightTable[14] = (_xPosCurrent < 100) ? 0 : 60; @@ -1008,11 +1008,11 @@ void TuckerEngine::execData3PreUpdate_locationNum14() { } const int num = _updateLocation14ObjNum[i]; if (num > 0) { - const int w = _dataTable[num].xSize; - const int h = _dataTable[num].ySize; + const int w = _dataTable[num]._xSize; + const int h = _dataTable[num]._ySize; const int x = _updateLocationXPosTable2[i] - w / 2; const int y = _updateLocationYPosTable2[i] / 16 - h / 2; - Graphics::decodeRLE_248(_locationBackgroundGfxBuf + y * 640 + x, _data3GfxBuf + _dataTable[num].sourceOffset, w, h, 0, 0, false); + Graphics::decodeRLE_248(_locationBackgroundGfxBuf + y * 640 + x, _data3GfxBuf + _dataTable[num]._sourceOffset, w, h, 0, 0, false); addDirtyRect(x, y, w, h); } } @@ -1063,41 +1063,41 @@ void TuckerEngine::execData3PostUpdate_locationNum14() { } void TuckerEngine::updateSprite_locationNum15_0(int i) { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } void TuckerEngine::updateSprite_locationNum15_1(int i) { int state; int r = getRandomNumber(); if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 6; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (r < 26000) { state = 5; } else if (r < 29000) { state = 2; - _spritesTable[i].prevAnimationFrame = 1; + _spritesTable[i]._prevAnimationFrame = true; } else { state = 4; - _spritesTable[4].counter = 1; + _spritesTable[4]._counter = 1; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum15_2(int i) { - _spritesTable[i].state = 3; - if (_spritesTable[4].counter > 0) { - ++_spritesTable[4].counter; - if (_spritesTable[4].counter > 6) { - _spritesTable[4].counter = 0; + _spritesTable[i]._state = 3; + if (_spritesTable[4]._counter > 0) { + ++_spritesTable[4]._counter; + if (_spritesTable[4]._counter > 6) { + _spritesTable[4]._counter = 0; } else { - _spritesTable[i].updateDelay = 2; + _spritesTable[i]._updateDelay = 2; } } else { - _spritesTable[i].updateDelay = 2; + _spritesTable[i]._updateDelay = 2; } } @@ -1106,7 +1106,7 @@ void TuckerEngine::execData3PreUpdate_locationNum15() { if (_updateLocationFadePaletteCounter > 500) { if (!isSoundPlaying(1) && getRandomNumber() > 31000) { const int i = getRandomNumber() / 4714; - startSound(_locationSoundsTable[i].offset, i, _locationSoundsTable[i].volume); + startSound(_locationSoundsTable[i]._offset, i, _locationSoundsTable[i]._volume); _updateLocationFadePaletteCounter = 0; } } @@ -1123,21 +1123,21 @@ void TuckerEngine::updateSprite_locationNum16_0(int i) { } else if (_flagsTable[82] == 2) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - if (_spritesTable[0].needUpdate == 0) { - _spritesTable[0].needUpdate = 1; + if (!_spritesTable[0]._needUpdate) { + _spritesTable[0]._needUpdate = true; state = 1; } else { state = 1; - _spritesTable[0].animationFrame = 2; - _updateSpriteFlag1 = 1; + _spritesTable[0]._animationFrame = 2; + _updateSpriteFlag1 = true; } } else if (_csDataHandled) { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; state = 4; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._updateDelay = 5; } else if (r < 30000) { state = 4; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._updateDelay = 5; } else if (r < 31000) { state = 4; if (_xPosCurrent < 300) { @@ -1149,7 +1149,7 @@ void TuckerEngine::updateSprite_locationNum16_0(int i) { } else { state = 6; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum16_1(int i) { @@ -1164,18 +1164,18 @@ void TuckerEngine::updateSprite_locationNum16_1(int i) { } else if (_flagsTable[60] == 0) { state = 10; if (isSoundPlaying(1)) { - _locationSoundsTable[1].type = 2; - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); + _locationSoundsTable[1]._type = 2; + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); } } else { state = 9; if (isSoundPlaying(0)) { - _locationSoundsTable[0].type = 2; - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + _locationSoundsTable[0]._type = 2; + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); } } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum16_2(int i) { @@ -1183,27 +1183,27 @@ void TuckerEngine::updateSprite_locationNum16_2(int i) { if (_flagsTable[78] == 0) { if (_flagsTable[60] == 1 && _flagsTable[61] == 1) { _flagsTable[78] = 1; - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); state = 7; } } else if (_flagsTable[78] == 1) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 8; } else { if (getRandomNumber() > 32000) { state = 7; } else if (getRandomNumber() > 10000) { state = 13; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { state = 13; } - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum16() { @@ -1218,26 +1218,26 @@ void TuckerEngine::updateSprite_locationNum17() { } else if (_flagsTable[82] == 2) { _flagsTable[82] = 3; _disableCharactersPath = true; - _spritesTable[0].gfxBackgroundOffset = 100; + _spritesTable[0]._gfxBackgroundOffset = 100; state = 1; - _spritesTable[0].backgroundOffset = -1; - } else if (_spritesTable[0].gfxBackgroundOffset < -160) { + _spritesTable[0]._backgroundOffset = -1; + } else if (_spritesTable[0]._gfxBackgroundOffset < -160) { state = -1; } else { state = 1; - _spritesTable[0].yMaxBackground = 0; - _spritesTable[0].colorType = 1; + _spritesTable[0]._yMaxBackground = 0; + _spritesTable[0]._colorType = 1; } - _spritesTable[0].state = state; + _spritesTable[0]._state = state; } void TuckerEngine::updateSprite_locationNum18() { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._needUpdate = true; state = 2; } else { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; state = 1; const int r = getRandomNumber(); if (r > 31000) { @@ -1246,54 +1246,54 @@ void TuckerEngine::updateSprite_locationNum18() { state = 4; } } - _spritesTable[0].gfxBackgroundOffset = 0; - _spritesTable[0].backgroundOffset = 0; - _spritesTable[0].state = state; + _spritesTable[0]._gfxBackgroundOffset = 0; + _spritesTable[0]._backgroundOffset = 0; + _spritesTable[0]._state = state; } void TuckerEngine::updateSprite_locationNum19_0(int i) { int state; if (_flagsTable[206] == 1) { state = 7; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; _flagsTable[206] = 0; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - ++_spritesTable[i].counter; - _spritesTable[i].needUpdate = 1; - if (_spritesTable[i].counter > 10) { - _spritesTable[i].counter = 0; + ++_spritesTable[i]._counter; + _spritesTable[i]._needUpdate = true; + if (_spritesTable[i]._counter > 10) { + _spritesTable[i]._counter = 0; state = 2; } else { state = 1; } } else { - _spritesTable[i].needUpdate = 0; - if (_spritesTable[i].counter > 10) { - _spritesTable[i].counter = 0; + _spritesTable[i]._needUpdate = false; + if (_spritesTable[i]._counter > 10) { + _spritesTable[i]._counter = 0; } - if (_spritesTable[i].counter == 2) { + if (_spritesTable[i]._counter == 2) { state = 4; - _spritesTable[i].prevAnimationFrame = 1; - } else if (_spritesTable[i].counter == 5) { + _spritesTable[i]._prevAnimationFrame = true; + } else if (_spritesTable[i]._counter == 5) { state = 5; - _spritesTable[i].prevAnimationFrame = 1; + _spritesTable[i]._prevAnimationFrame = true; } else { state = 5; - _spritesTable[i].updateDelay = 6; + _spritesTable[i]._updateDelay = 6; } } - _spritesTable[i].state = state; - _spritesTable[i].prevAnimationFrame = 1; + _spritesTable[i]._state = state; + _spritesTable[i]._prevAnimationFrame = true; } void TuckerEngine::updateSprite_locationNum19_1(int i) { - _spritesTable[i].state = 9; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = 9; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum19_2(int i) { - _spritesTable[i].gfxBackgroundOffset = 320; - _spritesTable[i].state = -1; + _spritesTable[i]._gfxBackgroundOffset = 320; + _spritesTable[i]._state = -1; } void TuckerEngine::updateSprite_locationNum19_3(int i) { @@ -1313,36 +1313,36 @@ void TuckerEngine::updateSprite_locationNum21() { } else if (_flagsTable[58] == 3) { state = 6; _flagsTable[58] = 4; - _locationSoundsTable[0].volume = 60; - _locationSoundsTable[5].volume = 60; + _locationSoundsTable[0]._volume = 60; + _locationSoundsTable[5]._volume = 60; } else if (_flagsTable[58] == 4) { state = 7; - _locationSoundsTable[4].volume = 60; + _locationSoundsTable[4]._volume = 60; } else if (_flagsTable[59] == 4) { - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._needUpdate = true; _flagsTable[59] = 2; state = 2; setVolumeSound(2, 0); } else if (_flagsTable[59] == 3) { _flagsTable[59] = 0; state = 4; - setVolumeSound(2, _locationSoundsTable[2].volume); + setVolumeSound(2, _locationSoundsTable[2]._volume); } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].needUpdate = 1; + _spritesTable[0]._needUpdate = true; state = 3; } else if (_flagsTable[59] == 2) { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; state = 3; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._updateDelay = 5; } else if (_flagsTable[15] == 1) { state = 3; - _spritesTable[0].updateDelay = 5; + _spritesTable[0]._updateDelay = 5; } else { - _spritesTable[0].needUpdate = 0; + _spritesTable[0]._needUpdate = false; state = 1; } - _spritesTable[0].state = state; - _spritesTable[0].gfxBackgroundOffset = 320; + _spritesTable[0]._state = state; + _spritesTable[0]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum21() { @@ -1351,7 +1351,7 @@ void TuckerEngine::execData3PreUpdate_locationNum21() { _pendingActionDelay = 0; _flagsTable[59] = 1; _nextAction = 2; - _csDataLoaded = 0; + _csDataLoaded = false; } if (_flagsTable[58] > 0 && !isSoundPlaying(0)) { const int r = getRandomNumber(); @@ -1364,17 +1364,17 @@ void TuckerEngine::execData3PreUpdate_locationNum21() { } else { num = 5; } - startSound(_locationSoundsTable[num].offset, num, _locationSoundsTable[num].volume); + startSound(_locationSoundsTable[num]._offset, num, _locationSoundsTable[num]._volume); } } - if (_spritesTable[0].state == 6) { - if (_spritesTable[0].animationFrame < 18) { - _spritesTable[0].gfxBackgroundOffset = 320 + _spritesTable[0].animationFrame * 638; + if (_spritesTable[0]._state == 6) { + if (_spritesTable[0]._animationFrame < 18) { + _spritesTable[0]._gfxBackgroundOffset = 320 + _spritesTable[0]._animationFrame * 638; } else { - _spritesTable[0].gfxBackgroundOffset = 11840 - _spritesTable[0].animationFrame * 2; + _spritesTable[0]._gfxBackgroundOffset = 11840 - _spritesTable[0]._animationFrame * 2; } } else { - _spritesTable[0].gfxBackgroundOffset = 320; + _spritesTable[0]._gfxBackgroundOffset = 320; } if (_inventoryItemsState[19] > 0) { _flagsTable[43] = 1; @@ -1397,20 +1397,20 @@ void TuckerEngine::execData3PreUpdate_locationNum22() { } if (_flagsTable[210] < 2 && !_csDataHandled && _flagsTable[54] == 1) { _nextAction = 25; - _csDataLoaded = 0; + _csDataLoaded = false; _flagsTable[210] = 2; } } void TuckerEngine::updateSprite_locationNum22() { if (_flagsTable[207] == 1) { - _spritesTable[0].state = -1; + _spritesTable[0]._state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - _spritesTable[0].needUpdate = 1; - _spritesTable[0].state = 2; + _spritesTable[0]._needUpdate = true; + _spritesTable[0]._state = 2; } else { - _spritesTable[0].needUpdate = 0; - _spritesTable[0].state = 1; + _spritesTable[0]._needUpdate = false; + _spritesTable[0]._state = 1; } } @@ -1421,37 +1421,37 @@ void TuckerEngine::updateSprite_locationNum23_0(int i) { } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum23_1(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 14; } else if (getRandomNumber() < 30000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 25; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 13; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum23_2(int i) { int state = 0; if (_flagsTable[210] == 0) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 6; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = (getRandomNumber() < 25000) ? 4 : 5; } } else if (_flagsTable[210] == 1) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; if (_flagsTable[211] == 10) { state = 34; } else if (_flagsTable[211] == 0) { @@ -1461,7 +1461,7 @@ void TuckerEngine::updateSprite_locationNum23_2(int i) { state = 31; } } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (_flagsTable[211] == 1) { state = 32; _flagsTable[211] = 0; @@ -1471,10 +1471,10 @@ void TuckerEngine::updateSprite_locationNum23_2(int i) { } } else if (_flagsTable[210] == 2) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 33; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (_flagsTable[212] == 0) { state = 3; _flagsTable[212] = 1; @@ -1488,7 +1488,7 @@ void TuckerEngine::updateSprite_locationNum23_2(int i) { } else { state = 24; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum23_3(int i) { @@ -1496,13 +1496,13 @@ void TuckerEngine::updateSprite_locationNum23_3(int i) { if (_flagsTable[210] == 0 || _flagsTable[210] == 2) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 8; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 9; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum24_0(int i) { @@ -1512,40 +1512,40 @@ void TuckerEngine::updateSprite_locationNum24_0(int i) { state = 5; } else if (_flagsTable[103] == 0) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 1; if (getRandomNumber() < 30000) { - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } } } else if (_flagsTable[103] == 1 || _flagsTable[103] == 3) { state = -1; } else { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 4; } else { if (getRandomNumber() < 30000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 6; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 6; } } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum24_1(int i) { if (_flagsTable[103] > 1) { - _spritesTable[i].state = 3; + _spritesTable[i]._state = 3; } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } } @@ -1554,11 +1554,11 @@ void TuckerEngine::updateSprite_locationNum24_2(int i) { if (_flagsTable[214] > 1) { state = -1; } else if (_flagsTable[214] == 1) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; _flagsTable[214] = 2; state = 9; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; if (_flagsTable[213] == 1) { state = 10; } else if (_flagsTable[213] == 2) { @@ -1567,10 +1567,10 @@ void TuckerEngine::updateSprite_locationNum24_2(int i) { state = 8; } } else { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 7; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum24_3(int i) { @@ -1585,18 +1585,18 @@ void TuckerEngine::updateSprite_locationNum24_3(int i) { } else { state = 11; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum24() { - _characterPrevBackFrontFacing = 0; + _characterPrevBackFrontFacing = false; if (_flagsTable[112] == 0) { _yPosCurrent = 132; _xPosCurrent = 112; } else if (_inventoryItemsState[2] == 1 && _inventoryItemsState[11] == 1 && _flagsTable[156] == 1 && _flagsTable[145] == 3) { _flagsTable[156] = 2; _nextAction = 61; - _csDataLoaded = 0; + _csDataLoaded = false; } if (_flagsTable[103] > 0 && (_inventoryItemsState[2] > 0 || _inventoryItemsState[11] > 0 || _flagsTable[156] > 0 || _flagsTable[145] == 3) && _flagsTable[217] == 0) { _flagsTable[217] = 1; @@ -1619,9 +1619,9 @@ void TuckerEngine::updateSprite_locationNum26_0(int i) { if (_flagsTable[125] > 0 && _flagsTable[125] < 300) { _flagsTable[126] = 1; } - _spritesTable[i].gfxBackgroundOffset = _flagsTable[125]; - _spritesTable[i].state = 1; - _spritesTable[i].colorType = 99; + _spritesTable[i]._gfxBackgroundOffset = _flagsTable[125]; + _spritesTable[i]._state = 1; + _spritesTable[i]._colorType = 99; } void TuckerEngine::updateSprite_locationNum26_1(int i) { @@ -1630,23 +1630,23 @@ void TuckerEngine::updateSprite_locationNum26_1(int i) { state = -1; } else if (_flagsTable[125] > 299) { state = 2; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { state = 2; } - _spritesTable[i].gfxBackgroundOffset = _flagsTable[125]; - _spritesTable[i].colorType = 1; - _spritesTable[i].state = state; + _spritesTable[i]._gfxBackgroundOffset = _flagsTable[125]; + _spritesTable[i]._colorType = 1; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum26() { - _characterPrevBackFrontFacing = 1; - _spritesTable[1].gfxBackgroundOffset = _flagsTable[125]; - _spritesTable[0].gfxBackgroundOffset = _flagsTable[125]; + _characterPrevBackFrontFacing = true; + _spritesTable[1]._gfxBackgroundOffset = _flagsTable[125]; + _spritesTable[0]._gfxBackgroundOffset = _flagsTable[125]; if (_flagsTable[125] > 0 && _flagsTable[125] < 300) { if (!isSoundPlaying(5)) { - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); - startSound(_locationSoundsTable[6].offset, 6, _locationSoundsTable[6].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); + startSound(_locationSoundsTable[6]._offset, 6, _locationSoundsTable[6]._volume); } ++_flagsTable[125]; _flagsTable[126] = 1; @@ -1656,7 +1656,7 @@ void TuckerEngine::execData3PreUpdate_locationNum26() { stopSound(6); } } - if (_panelLockedFlag == 0) { + if (!_panelLockedFlag) { if (_xPosCurrent > 207 && _xPosCurrent < 256) { _objectKeysLocationTable[26] = 0; _objectKeysPosXTable[26] = 260; @@ -1674,21 +1674,21 @@ void TuckerEngine::updateSprite_locationNum27(int i) { state = 1; _flagsTable[155] = 4; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else if (getRandomNumber() < 30000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 3; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 3; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum27() { - _characterPrevBackFrontFacing = 0; + _characterPrevBackFrontFacing = false; } void TuckerEngine::execData3PostUpdate_locationNum27() { @@ -1701,36 +1701,36 @@ void TuckerEngine::updateSprite_locationNum28_0(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 4; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { - _spritesTable[i].needUpdate = 0; - ++_spritesTable[i].counter; - if (_spritesTable[i].counter > 30) { - _spritesTable[i].counter = 0; + _spritesTable[i]._needUpdate = false; + ++_spritesTable[i]._counter; + if (_spritesTable[i]._counter > 30) { + _spritesTable[i]._counter = 0; } if (_flagsTable[86] == 1) { - if (_spritesTable[i].counter == 16 || _spritesTable[i].counter == 27) { + if (_spritesTable[i]._counter == 16 || _spritesTable[i]._counter == 27) { state = 3; } else { state = 3; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } } else { - if (_spritesTable[i].counter == 5 || _spritesTable[i].counter == 11) { + if (_spritesTable[i]._counter == 5 || _spritesTable[i]._counter == 11) { state = 5; - } else if (_spritesTable[i].counter == 16 || _spritesTable[i].counter == 27) { + } else if (_spritesTable[i]._counter == 16 || _spritesTable[i]._counter == 27) { state = 6; } else { state = 6; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum28_1(int i) { - _spritesTable[i].state = (_flagsTable[86] == 1) ? 1 : -1; + _spritesTable[i]._state = (_flagsTable[86] == 1) ? 1 : -1; } void TuckerEngine::updateSprite_locationNum28_2(int i) { @@ -1741,14 +1741,14 @@ void TuckerEngine::updateSprite_locationNum28_2(int i) { } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum28() { if (_flagsTable[86] == 0 && _xPosCurrent > 265 && _nextAction == 0) { - _panelLockedFlag = 0; + _panelLockedFlag = false; _nextAction = 21; - _csDataLoaded = 0; + _csDataLoaded = false; _pendingActionDelay = 0; _pendingActionIndex = 0; _currentActionVerb = 0; @@ -1762,21 +1762,21 @@ void TuckerEngine::execData3PostUpdate_locationNum28() { } void TuckerEngine::updateSprite_locationNum29_0(int i) { - _spritesTable[i].state = (getRandomNumber() < 32000) ? -1 : 2; + _spritesTable[i]._state = (getRandomNumber() < 32000) ? -1 : 2; } void TuckerEngine::updateSprite_locationNum29_1(int i) { int state = -1; if (getRandomNumber() >= 32000) { state = 1; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._gfxBackgroundOffset = 320; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum29_2(int i) { - _spritesTable[i].state = 3; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = 3; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum29() { @@ -1797,22 +1797,22 @@ void TuckerEngine::execData3PreUpdate_locationNum29() { } _system->getPaletteManager()->setPalette(scrollPal, 118, 5); if (_flagsTable[143] == 1) { - _locationObjectsTable[2].xPos = 999; - _locationObjectsTable[3].xPos = 187; + _locationObjectsTable[2]._xPos = 999; + _locationObjectsTable[3]._xPos = 187; } else { - _locationObjectsTable[2].xPos = 187; - _locationObjectsTable[3].xPos = 999; + _locationObjectsTable[2]._xPos = 187; + _locationObjectsTable[3]._xPos = 999; } } } void TuckerEngine::updateSprite_locationNum30_34(int i) { - _spritesTable[i].state = i + 1; + _spritesTable[i]._state = i + 1; } void TuckerEngine::execData3PreUpdate_locationNum30() { if (!isSoundPlaying(1) && getRandomNumber() > 32500) { - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); } } @@ -1829,7 +1829,7 @@ void TuckerEngine::execData3PreUpdate_locationNum31() { } void TuckerEngine::execData3PreUpdate_locationNum32() { - if (_spritesTable[0].state == 12 && _spritesTable[0].animationFrame < 22) { + if (_spritesTable[0]._state == 12 && _spritesTable[0]._animationFrame < 22) { _flagsTable[113] = 1; } else { _flagsTable[113] = 0; @@ -1843,16 +1843,16 @@ void TuckerEngine::execData3PostUpdate_locationNum32() { } void TuckerEngine::updateSprite_locationNum31_0(int i) { - _spritesTable[i].state = (getRandomNumber() < 32000) ? 3 : 1; + _spritesTable[i]._state = (getRandomNumber() < 32000) ? 3 : 1; } void TuckerEngine::updateSprite_locationNum31_1(int i) { - _spritesTable[i].state = (_flagsTable[86] == 1) ? 2 : -1; + _spritesTable[i]._state = (_flagsTable[86] == 1) ? 2 : -1; } void TuckerEngine::updateSprite_locationNum32_0(int i) { static const uint8 stateTable[] = { 12, 1, 11, 1, 11, 2, 1, 5, 5, 11, 1, 5, 5, 5 }; - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; if (_flagsTable[123] == 2) { _flagsTable[123] = 0; } @@ -1862,42 +1862,42 @@ void TuckerEngine::updateSprite_locationNum32_0(int i) { _flagsTable[222] = 2; } else if (_flagsTable[222] == 2) { state = 19; - _spritesTable[i].animationFrame = 23; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = 23; + _updateSpriteFlag1 = true; } else if (_flagsTable[123] == 1) { state = 17; _flagsTable[123] = 2; } else if (_flagsTable[222] == 3) { state = 18; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 4; } else if (_csDataHandled) { state = 5; } else { - _spritesTable[i].needUpdate = 0; - if (_spritesTable[i].counter > 13) { - _spritesTable[i].counter = 0; + _spritesTable[i]._needUpdate = false; + if (_spritesTable[i]._counter > 13) { + _spritesTable[i]._counter = 0; } - state = stateTable[_spritesTable[i].counter]; + state = stateTable[_spritesTable[i]._counter]; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum33_0(int i) { int state = 5; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 7; } else if (_flagsTable[87] == 1) { state = 8; } else if (_flagsTable[222] == 5) { state = 4; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = (getRandomNumber() < 30000) ? 5 : 6; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum33_1(int i) { @@ -1909,7 +1909,7 @@ void TuckerEngine::updateSprite_locationNum33_1(int i) { } else { state = 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum33_2(int i) { @@ -1921,37 +1921,37 @@ void TuckerEngine::updateSprite_locationNum33_2(int i) { } else { state = 9; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum33() { if (_xPosCurrent < 90) { if (_flagsTable[105] == 0) { _flagsTable[105] = 3; - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); } } else { if (_flagsTable[105] == 1) { _flagsTable[105] = 2; - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); } } if (_xPosCurrent > 230) { if (_flagsTable[106] == 0) { _flagsTable[106] = 3; - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); } } else { if (_flagsTable[106] == 1) { _flagsTable[106] = 2; - startSound(_locationSoundsTable[5].offset, 5, _locationSoundsTable[5].volume); + startSound(_locationSoundsTable[5]._offset, 5, _locationSoundsTable[5]._volume); } } } void TuckerEngine::execData3PreUpdate_locationNum34() { if (_flagsTable[143] == 1) { - _locationObjectsTable[0].xPos = 0; + _locationObjectsTable[0]._xPos = 0; } } @@ -1962,7 +1962,7 @@ void TuckerEngine::execData3PreUpdate_locationNum35() { } void TuckerEngine::updateSprite_locationNum36(int i) { - _spritesTable[i].state = (getRandomNumber() < 32000) ? 1 : 2; + _spritesTable[i]._state = (getRandomNumber() < 32000) ? 1 : 2; } void TuckerEngine::execData3PreUpdate_locationNum36() { @@ -1978,12 +1978,12 @@ void TuckerEngine::execData3PreUpdate_locationNum36() { void TuckerEngine::updateSprite_locationNum37(int i) { int j = i + 1; int offset = 200 - i * 45; - ++_spritesTable[i].counter; - if (_spritesTable[i].counter > offset) { - _spritesTable[i].state = j; - _spritesTable[i].counter = 0; + ++_spritesTable[i]._counter; + if (_spritesTable[i]._counter > offset) { + _spritesTable[i]._state = j; + _spritesTable[i]._counter = 0; } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } } @@ -2001,16 +2001,16 @@ void TuckerEngine::updateSprite_locationNum41(int i) { state = 1; _flagsTable[158] = 2; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 3; } else if (getRandomNumber() < 30000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 4; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum41() { @@ -2020,10 +2020,10 @@ void TuckerEngine::execData3PreUpdate_locationNum41() { } else if (_backgroundSpriteCurrentFrame == 7) { _flagsTable[77] = 0; } - if (_changeBackgroundSprite == 0) { + if (!_changeBackgroundSprite) { if (_backgroundSpriteCurrentFrame == 16 && !isSoundPlaying(4)) { - _locationSoundsTable[4].type = 2; - startSound(_locationSoundsTable[4].offset, 4, _locationSoundsTable[4].volume); + _locationSoundsTable[4]._type = 2; + startSound(_locationSoundsTable[4]._offset, 4, _locationSoundsTable[4]._volume); } else { if (_backgroundSpriteCurrentFrame == 28) { stopSound(4); @@ -2031,8 +2031,8 @@ void TuckerEngine::execData3PreUpdate_locationNum41() { } } else { if (_backgroundSpriteCurrentFrame == 28 && !isSoundPlaying(4)) { - _locationSoundsTable[4].type = 2; - startSound(_locationSoundsTable[4].offset, 4, _locationSoundsTable[4].volume); + _locationSoundsTable[4]._type = 2; + startSound(_locationSoundsTable[4]._offset, 4, _locationSoundsTable[4]._volume); } else { if (_backgroundSpriteCurrentFrame == 18) { stopSound(4); @@ -2040,11 +2040,11 @@ void TuckerEngine::execData3PreUpdate_locationNum41() { } } } - if (_panelLockedFlag == 1 && _yPosCurrent > 130 && _selectedObject.yPos > 135 && _nextAction == 0 && _flagsTable[223] == 0) { - _panelLockedFlag = 0; + if (_panelLockedFlag && _yPosCurrent > 130 && _selectedObject._yPos > 135 && _nextAction == 0 && _flagsTable[223] == 0) { + _panelLockedFlag = false; _csDataLoaded = false; _nextLocationNum = 0; - _selectedObject.locationObject_locationNum = 0; + _selectedObject._locationObjectLocationNum = 0; _locationMaskType = 0; _nextAction = _flagsTable[163] + 32; ++_flagsTable[163]; @@ -2057,9 +2057,9 @@ void TuckerEngine::execData3PreUpdate_locationNum41() { } } if (_flagsTable[77] == 0) { - _locationObjectsTable[3].xPos = 230; + _locationObjectsTable[3]._xPos = 230; } else { - _locationObjectsTable[3].xPos = 930; + _locationObjectsTable[3]._xPos = 930; } } } @@ -2076,13 +2076,13 @@ void TuckerEngine::updateSprite_locationNum42(int i) { _flagsTable[223] = 3; } else if (_flagsTable[223] == 3) { state = 5; - _spritesTable[i].updateDelay = 5; - _spritesTable[i].state = _spritesTable[i].firstFrame - 1; // FIXME: bug, fxNum ? - _updateSpriteFlag1 = 1; + _spritesTable[i]._updateDelay = 5; + _spritesTable[i]._state = _spritesTable[i]._firstFrame - 1; // FIXME: bug, fxNum ? + _updateSpriteFlag1 = true; } else { state = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum42() { @@ -2094,18 +2094,18 @@ void TuckerEngine::updateSprite_locationNum43_2(int i) { if (_flagsTable[237] > 0) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 5; - } else if (_csDataHandled || _spritesTable[i].counter == 2) { - _spritesTable[i].needUpdate = 0; + } else if (_csDataHandled || _spritesTable[i]._counter == 2) { + _spritesTable[i]._needUpdate = false; state = 6; - } else if (_spritesTable[i].counter == 0) { + } else if (_spritesTable[i]._counter == 0) { state = 3; } else { state = 4; - _spritesTable[i].counter = 2; + _spritesTable[i]._counter = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum43_3(int i) { @@ -2114,12 +2114,12 @@ void TuckerEngine::updateSprite_locationNum43_3(int i) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 7; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 8; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum43_4(int i) { @@ -2128,38 +2128,38 @@ void TuckerEngine::updateSprite_locationNum43_4(int i) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 9; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 10; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum43_5(int i) { - _spritesTable[i].state = (_flagsTable[236] < 4) ? -1 : 11; + _spritesTable[i]._state = (_flagsTable[236] < 4) ? -1 : 11; } void TuckerEngine::updateSprite_locationNum43_6(int i) { - _spritesTable[i].state = (_flagsTable[236] < 4) ? -1 : 12; + _spritesTable[i]._state = (_flagsTable[236] < 4) ? -1 : 12; } void TuckerEngine::execData3PreUpdate_locationNum43() { - if (_panelLockedFlag == 1 && _xPosCurrent > 67 && _selectedObject.xPos > 68 && _locationMaskType == 0) { - _panelLockedFlag = 0; - _csDataLoaded = 0; + if (_panelLockedFlag && _xPosCurrent > 67 && _selectedObject._xPos > 68 && _locationMaskType == 0) { + _panelLockedFlag = false; + _csDataLoaded = false; _nextAction = 5; } - if (_xPosCurrent > 55 && _spritesTable[2].counter == 0) { - _spritesTable[2].counter = 1; + if (_xPosCurrent > 55 && _spritesTable[2]._counter == 0) { + _spritesTable[2]._counter = 1; } } void TuckerEngine::execData3PreUpdate_locationNum44() { if (_backgroundSpriteCurrentAnimation == 1) { if (!isSoundPlaying(3) && _backgroundSpriteCurrentFrame == 1) { - _locationSoundsTable[3].type = 2; - startSound(_locationSoundsTable[3].offset, 3, _locationSoundsTable[3].volume); + _locationSoundsTable[3]._type = 2; + startSound(_locationSoundsTable[3]._offset, 3, _locationSoundsTable[3]._volume); } if (_backgroundSpriteCurrentFrame == 21) { _flagsTable[77] = 1; @@ -2169,7 +2169,7 @@ void TuckerEngine::execData3PreUpdate_locationNum44() { } } else if (_backgroundSpriteCurrentAnimation == 4) { if (_backgroundSpriteCurrentFrame == 20 && !isSoundPlaying(3)) { - startSound(_locationSoundsTable[3].offset, 3, _locationSoundsTable[3].volume); + startSound(_locationSoundsTable[3]._offset, 3, _locationSoundsTable[3]._volume); } } } @@ -2182,14 +2182,14 @@ void TuckerEngine::updateSprite_locationNum48(int i) { _flagsTable[160] = 3; state = 3; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum49(int i) { @@ -2211,20 +2211,20 @@ void TuckerEngine::updateSprite_locationNum49(int i) { _flagsTable[185] = 0; state = 4; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (getRandomNumber() < 30000 || _backgroundSpriteCurrentAnimation <= -1) { state = 3; - _spritesTable[i].updateDelay = 1; + _spritesTable[i]._updateDelay = 1; } else if (getRandomNumber() < 16000) { state = 5; } else { state = 6; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum49() { @@ -2272,38 +2272,38 @@ void TuckerEngine::updateSprite_locationNum50(int i) { _flagsTable[240] = 1; } } else { - _spritesTable[i].animationFrame = _spritesTable[i].firstFrame - 1; - _spritesTable[i].updateDelay = 5; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = _spritesTable[i]._firstFrame - 1; + _spritesTable[i]._updateDelay = 5; + _updateSpriteFlag1 = true; state = i + 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum51(int i) { if (i == 2) { - _spritesTable[i].state = 1; + _spritesTable[i]._state = 1; } else if (i == 0) { static const int stateTable[] = { 3, 3, 4, 5, 3, 3, 5, 4, 3, 3, 4, 5, 4, 4 }; - ++_spritesTable[i].counter; - if (_spritesTable[i].counter > 13) { - _spritesTable[i].counter = 0; + ++_spritesTable[i]._counter; + if (_spritesTable[i]._counter > 13) { + _spritesTable[i]._counter = 0; } - _spritesTable[i].state = stateTable[_spritesTable[i].counter]; + _spritesTable[i]._state = stateTable[_spritesTable[i]._counter]; } else { i = 1; - _spritesTable[i].state = 6; + _spritesTable[i]._state = 6; } - _spritesTable[i].colorType = 1; - _spritesTable[i].yMaxBackground = 0; + _spritesTable[i]._colorType = 1; + _spritesTable[i]._yMaxBackground = 0; } void TuckerEngine::execData3PreUpdate_locationNum52() { - if (_selectedObject.xPos > 108 && _panelLockedFlag > 0 && _nextAction == 0 && _locationMaskType == 0) { + if (_selectedObject._xPos > 108 && _panelLockedFlag && _nextAction == 0 && _locationMaskType == 0) { _nextAction = 1; - _csDataLoaded = 0; + _csDataLoaded = false; } } @@ -2313,21 +2313,21 @@ void TuckerEngine::updateSprite_locationNum53_0(int i) { } int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 1; } else if (_flagsTable[197] == 1) { state = 3; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; _flagsTable[197] = 2; } else if (_flagsTable[192] == 1) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 5; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum53_1(int i) { @@ -2339,14 +2339,14 @@ void TuckerEngine::updateSprite_locationNum53_1(int i) { } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum53() { if (_flagsTable[192] == 0 && _xPosCurrent < 200 && _nextAction == 0) { - _panelLockedFlag = 0; + _panelLockedFlag = false; _nextAction = 14; - _csDataLoaded = 0; + _csDataLoaded = false; _pendingActionDelay = 0; _pendingActionIndex = 0; _currentActionVerb = 0; @@ -2354,55 +2354,52 @@ void TuckerEngine::execData3PreUpdate_locationNum53() { } void TuckerEngine::updateSprite_locationNum54(int i) { - int state = 3; if (_flagsTable[141] == 2) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; setCharacterAnimation(0, i); _flagsTable[141] = 1; - _spritesTable[i].counter = 0; - } else if (_flagsTable[141] == 1 && _spritesTable[i].counter < 40) { + _spritesTable[i]._counter = 0; + } else if (_flagsTable[141] == 1 && _spritesTable[i]._counter < 40) { setCharacterAnimation(1, i); - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; } else if (_flagsTable[141] == 1) { setCharacterAnimation(2, i); _flagsTable[141] = 3; } else { + int state = 3; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 2; + _spritesTable[i]._needUpdate = true; state = (getRandomNumber() < 12000) ? 2 : 4; } else if (_flagsTable[141] == 3) { - state = 3; _flagsTable[141] = 0; _flagsTable[224] = 1; - _spritesTable[i].counter = 0; - if (_panelLockedFlag == 0 && _xPosCurrent > 130 && _inventoryItemsState[17] == 0) { + _spritesTable[i]._counter = 0; + if (!_panelLockedFlag && _xPosCurrent > 130 && _inventoryItemsState[17] == 0) { _nextAction = 18; _csDataLoaded = false; } } else if (getRandomNumber() < 26000) { - state = 3; - _spritesTable[i].needUpdate = 0; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._needUpdate = false; + _spritesTable[i]._updateDelay = 5; } else { - state = 3; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } if (_inventoryItemsState[17] == 1) { _flagsTable[224] = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } } void TuckerEngine::updateSprite_locationNum55(int i) { if (_flagsTable[193] > 0 && _flagsTable[193] < 14) { setCharacterAnimation(_flagsTable[193] - 1, i); - _updateSpriteFlag1 = 1; + _updateSpriteFlag1 = true; if (_flagsTable[193] == 1 || _flagsTable[193] == 3 || _flagsTable[193] == 5 || _flagsTable[193] == 7 || _flagsTable[193] == 11 || _flagsTable[193] == 13) { ++_flagsTable[193]; } } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; if (_flagsTable[193] == 14) { _flagsTable[193] = 15; } @@ -2411,26 +2408,26 @@ void TuckerEngine::updateSprite_locationNum55(int i) { void TuckerEngine::updateSprite_locationNum56(int i) { int state; - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; if (_flagsTable[153] == 1) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum57_0(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (getRandomNumber() < 30000) { state = 1; } else if (getRandomNumber() < 16000) { @@ -2439,15 +2436,15 @@ void TuckerEngine::updateSprite_locationNum57_0(int i) { state = 2; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum57_1(int i) { int state = 6; if (getRandomNumber() < 30000) { - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum57() { @@ -2472,20 +2469,20 @@ void TuckerEngine::updateSprite_locationNum58(int i) { _flagsTable[190] = 3; } } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum58() { // workaround original game glitch #2872348: do not change position on location change if (_nextLocationNum == 0 && _flagsTable[190] < 3 && _xPosCurrent > 310) { _xPosCurrent = 310; - _panelLockedFlag = 0; + _panelLockedFlag = false; } - if (_flagsTable[190] > 0 && _locationSoundsTable[0].volume > 0) { - _locationSoundsTable[0].volume = 0; - _locationSoundsTable[4].volume = 0; - _locationSoundsTable[5].volume = 0; + if (_flagsTable[190] > 0 && _locationSoundsTable[0]._volume > 0) { + _locationSoundsTable[0]._volume = 0; + _locationSoundsTable[4]._volume = 0; + _locationSoundsTable[5]._volume = 0; if (isSoundPlaying(0)) { stopSound(0); } @@ -2498,27 +2495,27 @@ void TuckerEngine::updateSprite_locationNum59(int i) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 3; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else if (_csDataHandled) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (_flagsTable[199] == 0) { _flagsTable[199] = 1; setCharacterAnimation(0, 0); return; } - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 3; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else if (_flagsTable[199] == 1) { _flagsTable[199] = 0; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; setCharacterAnimation(1, 0); return; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum60_0(int i) { @@ -2526,34 +2523,34 @@ void TuckerEngine::updateSprite_locationNum60_0(int i) { if (_flagsTable[186] > 0) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 9; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = (getRandomNumber() > 32000) ? 8 : 7; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum60_1(int i) { int state; if (_flagsTable[186] == 1) { _flagsTable[186] = 2; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; } else if (_flagsTable[186] == 2) { state = 6; _flagsTable[187] = 1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 1; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = (getRandomNumber() > 32000) ? 5 : 4; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PostUpdate_locationNum60() { @@ -2569,19 +2566,19 @@ void TuckerEngine::updateSprite_locationNum61_0(int i) { } else if (_flagsTable[88] == 2) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 0) { - if (_spritesTable[i].needUpdate == 0) { - _spritesTable[i].needUpdate = 1; + if (!_spritesTable[i]._needUpdate) { + _spritesTable[i]._needUpdate = true; state = 2; } else { state = 2; - _spritesTable[0].animationFrame = 2; - _updateSpriteFlag1 = 1; + _spritesTable[0]._animationFrame = 2; + _updateSpriteFlag1 = true; } } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; if (r < 30000) { state = 7; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else if (r < 31000) { state = 7; } else if (r < 32000) { @@ -2590,7 +2587,7 @@ void TuckerEngine::updateSprite_locationNum61_0(int i) { state = 6; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum61_1(int i) { @@ -2598,19 +2595,19 @@ void TuckerEngine::updateSprite_locationNum61_1(int i) { if (_flagsTable[151] == 1) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 14; } else if (_csDataHandled || getRandomNumber() < 29000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 12; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else if (getRandomNumber() < 20000) { state = 12; } else { state = 13; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum61_2(int i) { @@ -2651,8 +2648,8 @@ void TuckerEngine::updateSprite_locationNum61_2(int i) { if (_flagsTable[136] != 2) { _flagsTable[150] = 0; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum61() { @@ -2676,13 +2673,13 @@ void TuckerEngine::updateSprite_locationNum63_0(int i) { } else if (_flagsTable[132] != 2 || _flagsTable[133] != 1 || _flagsTable[136] > 0) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 6; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum63_1(int i) { @@ -2694,16 +2691,16 @@ void TuckerEngine::updateSprite_locationNum63_1(int i) { state = 8; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum63_2(int i) { - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; int state = -1; if (_flagsTable[132] == 2 && _flagsTable[133] == 1 && _flagsTable[136] <= 0) { if (_flagsTable[226] == 0) { state = 9; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else if (_flagsTable[226] == 1) { state = 9; _flagsTable[226] = 2; @@ -2714,16 +2711,16 @@ void TuckerEngine::updateSprite_locationNum63_2(int i) { state = 10; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum63_3(int i) { - ++_spritesTable[i].counter; + ++_spritesTable[i]._counter; int state = -1; if (_flagsTable[132] == 2 && _flagsTable[133] == 1 && _flagsTable[136] <= 0) { - if (_spritesTable[i].counter > 80) { + if (_spritesTable[i]._counter > 80) { state = 7; - _spritesTable[i].counter = 0; + _spritesTable[i]._counter = 0; } else if (getRandomNumber() > 32000) { state = 2; } else if (getRandomNumber() > 32000) { @@ -2732,7 +2729,7 @@ void TuckerEngine::updateSprite_locationNum63_3(int i) { state = 8; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum63_4(int i) { @@ -2740,7 +2737,7 @@ void TuckerEngine::updateSprite_locationNum63_4(int i) { if (_flagsTable[132] == 2 && _flagsTable[133] == 1 && _flagsTable[136] == 0) { state = 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum63() { @@ -2764,8 +2761,8 @@ void TuckerEngine::execData3PreUpdate_locationNum63() { } else { if (_flagsTable[132] == 0 || (_flagsTable[132] == 2 && _flagsTable[136] > 0)) { if (!isSoundPlaying(1)) { - _locationSoundsTable[1].type = 2; - startSound(_locationSoundsTable[1].offset, 1, _locationSoundsTable[1].volume); + _locationSoundsTable[1]._type = 2; + startSound(_locationSoundsTable[1]._offset, 1, _locationSoundsTable[1]._volume); } } else { if (isSoundPlaying(1)) { @@ -2774,8 +2771,8 @@ void TuckerEngine::execData3PreUpdate_locationNum63() { } if (_flagsTable[132] == 1) { if (!isSoundPlaying(0)) { - _locationSoundsTable[0].type = 2; - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + _locationSoundsTable[0]._type = 2; + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); } } else { if (isSoundPlaying(0)) { @@ -2784,7 +2781,7 @@ void TuckerEngine::execData3PreUpdate_locationNum63() { } if (_flagsTable[132] == 2 && _flagsTable[136] == 0) { if (!isSoundPlaying(2)) { - startSound(_locationSoundsTable[2].offset, 2, _locationSoundsTable[2].volume); + startSound(_locationSoundsTable[2]._offset, 2, _locationSoundsTable[2]._volume); } } else { if (isSoundPlaying(2)) { @@ -2807,7 +2804,7 @@ void TuckerEngine::updateSprite_locationNum65(int i) { if (_flagsTable[188] == 1) { _flagsTable[188] = 2; state = 1; - _spritesTable[i].gfxBackgroundOffset = 100; + _spritesTable[i]._gfxBackgroundOffset = 100; } else if (_flagsTable[188] > 0 && _flagsTable[189] > 0) { state = -1; if (_xPosCurrent < 150 || _yPosCurrent > 240) { @@ -2826,7 +2823,7 @@ void TuckerEngine::updateSprite_locationNum65(int i) { _flagsTable[189] = 0; } } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum65() { @@ -2836,66 +2833,66 @@ void TuckerEngine::execData3PreUpdate_locationNum65() { void TuckerEngine::updateSprite_locationNum66_0(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum66_1(int i) { int state; if (_flagsTable[191] == 0 && _xPosCurrent > 568) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 8; } else { state = 10; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } } else { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 9; } else if (getRandomNumber() > 30000) { state = 6; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 7; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } } - _spritesTable[i].state = state; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = state; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::updateSprite_locationNum66_2(int i) { - _spritesTable[i].disabled = 1; - _spritesTable[i].state = 3; + _spritesTable[i]._disabled = true; + _spritesTable[i]._state = 3; } void TuckerEngine::updateSprite_locationNum66_3(int i) { - _spritesTable[i].state = 4; + _spritesTable[i]._state = 4; } void TuckerEngine::updateSprite_locationNum66_4(int i) { - _spritesTable[i].state = 5; - _spritesTable[i].gfxBackgroundOffset = 320; + _spritesTable[i]._state = 5; + _spritesTable[i]._gfxBackgroundOffset = 320; } void TuckerEngine::execData3PreUpdate_locationNum66() { // FIXME: shouldn't be executed after using the map _flagsTable[137] = 0; if (_xPosCurrent > 583 && _flagsTable[191] == 0 && _nextAction == 0 && _locationMaskType == 0) { - _panelLockedFlag = 0; - _csDataLoaded = 0; + _panelLockedFlag = false; + _csDataLoaded = false; _nextLocationNum = 0; - _selectedObject.locationObject_locationNum = 0; + _selectedObject._locationObjectLocationNum = 0; if (_flagsTable[131] == 0) { _nextAction = 13; } else if (_flagsTable[130] == 0) { @@ -2907,25 +2904,25 @@ void TuckerEngine::execData3PreUpdate_locationNum66() { } void TuckerEngine::execData3PostUpdate_locationNum66() { - if (_spritesTable[2].flipX == 1) { + if (_spritesTable[2]._flipX) { --_updateLocationXPosTable2[0]; if (_updateLocationXPosTable2[0] < -50) { - _spritesTable[2].flipX = 0; + _spritesTable[2]._flipX = false; _updateLocationXPosTable2[0] = -50; } } else { ++_updateLocationXPosTable2[0]; if (_updateLocationXPosTable2[0] > 500) { - _spritesTable[2].flipX = 1; + _spritesTable[2]._flipX = true; _updateLocationXPosTable2[0] = 500; } } - _spritesTable[2].gfxBackgroundOffset = _updateLocationXPosTable2[0] + 8320; + _spritesTable[2]._gfxBackgroundOffset = _updateLocationXPosTable2[0] + 8320; const int spr = 2; - _spritesTable[spr].colorType = 1; - _spritesTable[spr].yMaxBackground = 0; + _spritesTable[spr]._colorType = 1; + _spritesTable[spr]._yMaxBackground = 0; drawSprite(spr); - _spritesTable[spr].colorType = 0; + _spritesTable[spr]._colorType = 0; } void TuckerEngine::updateSprite_locationNum69_1(int i) { @@ -2939,10 +2936,10 @@ void TuckerEngine::updateSprite_locationNum69_1(int i) { } else if (_flagsTable[236] == 4) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 9; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 14; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } } else if (_flagsTable[236] == 5) { state = 7; @@ -2950,7 +2947,7 @@ void TuckerEngine::updateSprite_locationNum69_1(int i) { } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum69_2(int i) { @@ -2966,10 +2963,10 @@ void TuckerEngine::updateSprite_locationNum69_2(int i) { } else if (_flagsTable[237] == 4 || _flagsTable[237] == 2 || _flagsTable[237] == 3 || _flagsTable[237] == 7) { if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 10; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 12; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } } else if (_flagsTable[237] == 5) { state = 16; @@ -2983,7 +2980,7 @@ void TuckerEngine::updateSprite_locationNum69_2(int i) { } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum69_3(int i) { @@ -2997,21 +2994,21 @@ void TuckerEngine::updateSprite_locationNum69_3(int i) { _flagsTable[238] = 1; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { state = 11; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { state = 13; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } } else { state = -1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::execData3PreUpdate_locationNum70() { const uint8 color = 103; if (_execData3Counter == 0) { - startSound(_locationSoundsTable[6].offset, 6, _locationSoundsTable[6].volume); + startSound(_locationSoundsTable[6]._offset, 6, _locationSoundsTable[6]._volume); _execData3Counter = 1; _flagsTable[143] = 0; _updateLocation70StringLen = 0; @@ -3041,7 +3038,7 @@ void TuckerEngine::execData3PreUpdate_locationNum70Helper() { if (_lastKeyPressed == Common::KEYCODE_BACKSPACE || _lastKeyPressed == Common::KEYCODE_DELETE) { if (_updateLocation70StringLen > 0) { --_updateLocation70StringLen; - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); } } else if (_lastKeyPressed == Common::KEYCODE_RETURN) { _flagsTable[143] = 1; @@ -3052,7 +3049,7 @@ void TuckerEngine::execData3PreUpdate_locationNum70Helper() { _flagsTable[143] = 2; } const int num = (_flagsTable[143] == 1) ? 4 : 5; - startSound(_locationSoundsTable[num].offset, num, _locationSoundsTable[num].volume); + startSound(_locationSoundsTable[num]._offset, num, _locationSoundsTable[num]._volume); } else if (_updateLocation70StringLen < 19) { uint8 chr = 0; switch (_lastKeyPressed) { @@ -3089,7 +3086,7 @@ void TuckerEngine::execData3PreUpdate_locationNum70Helper() { } break; } - startSound(_locationSoundsTable[0].offset, 0, _locationSoundsTable[0].volume); + startSound(_locationSoundsTable[0]._offset, 0, _locationSoundsTable[0]._volume); if (chr > 0) { _updateLocation70String[_updateLocation70StringLen] = chr; ++_updateLocation70StringLen; @@ -3104,17 +3101,17 @@ void TuckerEngine::updateSprite_locationNum71(int i) { if (_flagsTable[155] != 6 || _flagsTable[207] == 1) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 1; } else if (getRandomNumber() < 30000) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; - _spritesTable[i].updateDelay = 5; + _spritesTable[i]._updateDelay = 5; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum72(int i) { @@ -3122,28 +3119,28 @@ void TuckerEngine::updateSprite_locationNum72(int i) { if (_flagsTable[155] == 7 || _flagsTable[207] == 1) { state = -1; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 2; } else { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 1; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum74(int i) { static const uint8 stateTable[] = { 1, 3, 5, 5, 10, 16, 16 }; int num = _flagsTable[236] - 74; if (stateTable[num] + i == 21) { - if (_updateLocationFlag == 0) { - _updateLocationFlag = 1; + if (!_updateLocationFlag) { + _updateLocationFlag = true; } else { - _spritesTable[i].animationFrame = _spritesTable[i].firstFrame - 1; - _spritesTable[i].updateDelay = 5; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = _spritesTable[i]._firstFrame - 1; + _spritesTable[i]._updateDelay = 5; + _updateSpriteFlag1 = true; } } - _spritesTable[i].state = stateTable[num] + i; + _spritesTable[i]._state = stateTable[num] + i; } void TuckerEngine::updateSprite_locationNum79(int i) { @@ -3153,43 +3150,43 @@ void TuckerEngine::updateSprite_locationNum79(int i) { _flagsTable[227] = 1; } else if (_flagsTable[227] == 1 && _charSpeechSoundCounter > 0) { state = 2; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else if (_flagsTable[227] == 2) { state = 3; _flagsTable[227] = 3; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else { - _spritesTable[i].animationFrame = _spritesTable[i].firstFrame - 1; - _spritesTable[i].updateDelay = 5; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = _spritesTable[i]._firstFrame - 1; + _spritesTable[i]._updateDelay = 5; + _updateSpriteFlag1 = true; state = 3; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum81_0(int i) { int state; if (_charSpeechSoundCounter > 0 && _actionCharacterNum == i) { - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; state = 3; _flagsTable[288] = 1; } else if (_flagsTable[288] < 2) { - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; state = 2; if (_flagsTable[288] == 1) { _flagsTable[288] = 2; } } else { - _spritesTable[i].animationFrame = _spritesTable[i].firstFrame - 1; - _spritesTable[i].updateDelay = 5; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = _spritesTable[i]._firstFrame - 1; + _spritesTable[i]._updateDelay = 5; + _updateSpriteFlag1 = true; state = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } void TuckerEngine::updateSprite_locationNum81_1(int i) { - _spritesTable[i].state = 1; + _spritesTable[i]._state = 1; } void TuckerEngine::updateSprite_locationNum82(int i) { @@ -3197,20 +3194,20 @@ void TuckerEngine::updateSprite_locationNum82(int i) { if (_charSpeechSoundCounter > 0) { state = 1; _flagsTable[229] = 1; - _spritesTable[i].needUpdate = 1; + _spritesTable[i]._needUpdate = true; } else if (_flagsTable[229] == 0) { state = 1; } else if (_flagsTable[229] == 1) { state = 2; _flagsTable[229] = 2; - _spritesTable[i].needUpdate = 0; + _spritesTable[i]._needUpdate = false; } else { - _spritesTable[i].animationFrame = _spritesTable[i].firstFrame - 1; - _spritesTable[i].updateDelay = 5; - _updateSpriteFlag1 = 1; + _spritesTable[i]._animationFrame = _spritesTable[i]._firstFrame - 1; + _spritesTable[i]._updateDelay = 5; + _updateSpriteFlag1 = true; state = 2; } - _spritesTable[i].state = state; + _spritesTable[i]._state = state; } } // namespace Tucker diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index 48ddefe455..5f06334720 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -127,7 +127,7 @@ public: } bool findNextToken(DataToken t) { - const char *token = 0; + const char *token = nullptr; switch (t) { case kDataTokenDw: token = "dw"; @@ -279,7 +279,7 @@ Audio::RewindableAudioStream *CompressedSound::load(CompressedSoundType type, in void TuckerEngine::loadImage(const char *fname, uint8 *dst, int type) { char filename[80]; - strcpy(filename, fname); + Common::strlcpy(filename, fname, sizeof(filename)); Common::File f; if (!f.open(filename)) { @@ -351,11 +351,11 @@ void TuckerEngine::loadCharset2() { } void TuckerEngine::loadCharsetHelper() { - const int charW = Graphics::_charset.charW; - const int charH = Graphics::_charset.charH; + const int charW = Graphics::_charset._charW; + const int charH = Graphics::_charset._charH; int offset = 0; - for (int y = 0; y < Graphics::_charset.yCount; ++y) { - for (int x = 0; x < Graphics::_charset.xCount; ++x) { + for (int y = 0; y < Graphics::_charset._yCount; ++y) { + for (int x = 0; x < Graphics::_charset._xCount; ++x) { offset += Graphics::encodeRAW(_loadTempBuf + (y * 320) * charH + x * charW, _charsetGfxBuf + offset, charW, charH); } } @@ -408,8 +408,8 @@ void TuckerEngine::loadBudSpr(int startOffset) { loadImage(filename.c_str(), _loadTempBuf, 0); ++frame; } - int sz = Graphics::encodeRLE(_loadTempBuf + _spriteFramesTable[i].sourceOffset, _spritesGfxBuf + spriteOffset, _spriteFramesTable[i].xSize, _spriteFramesTable[i].ySize); - _spriteFramesTable[i].sourceOffset = spriteOffset; + int sz = Graphics::encodeRLE(_loadTempBuf + _spriteFramesTable[i]._sourceOffset, _spritesGfxBuf + spriteOffset, _spriteFramesTable[i]._xSize, _spriteFramesTable[i]._ySize); + _spriteFramesTable[i]._sourceOffset = spriteOffset; spriteOffset += sz; } } @@ -431,16 +431,16 @@ int TuckerEngine::loadCTable01(int index, int firstSpriteNum, int *framesCount) } const int y = t.getNextInteger(); SpriteFrame *c = &_spriteFramesTable[lastSpriteNum++]; - c->sourceOffset = y * 320 + x; - c->xSize = t.getNextInteger(); - c->ySize = t.getNextInteger(); - c->xOffset = t.getNextInteger(); - if (c->xOffset > 300) { - c->xOffset -= 500; + c->_sourceOffset = y * 320 + x; + c->_xSize = t.getNextInteger(); + c->_ySize = t.getNextInteger(); + c->_xOffset = t.getNextInteger(); + if (c->_xOffset > 300) { + c->_xOffset -= 500; } - c->yOffset = t.getNextInteger(); - if (c->yOffset > 300) { - c->yOffset -= 500; + c->_yOffset = t.getNextInteger(); + if (c->_yOffset > 300) { + c->_yOffset -= 500; } } } @@ -455,17 +455,17 @@ void TuckerEngine::loadCTable02(int fl) { loadFile("ctable02.c", _loadTempBuf); DataTokenizer t(_loadTempBuf, _fileLoadSize); while (t.findNextToken(kDataTokenDw)) { - _spriteAnimationsTable[entry].numParts = t.getNextInteger(); - if (_spriteAnimationsTable[entry].numParts < 1) { + _spriteAnimationsTable[entry]._numParts = t.getNextInteger(); + if (_spriteAnimationsTable[entry]._numParts < 1) { return; } - _spriteAnimationsTable[entry].rotateFlag = t.getNextInteger(); + _spriteAnimationsTable[entry]._rotateFlag = t.getNextInteger(); int num = t.getNextInteger(); if (num != fl) { continue; } int start = 0; - _spriteAnimationsTable[entry].firstFrameIndex = i; + _spriteAnimationsTable[entry]._firstFrameIndex = i; while (start != 999) { start = t.getNextInteger(); if (start == 9999) { // end marker in the demo version @@ -571,12 +571,12 @@ void TuckerEngine::loadData() { const int x = t.getNextInteger(); const int y = t.getNextInteger(); Data *d = &_dataTable[_dataCount]; - d->sourceOffset = y * 320 + x; - d->xSize = t.getNextInteger(); - d->ySize = t.getNextInteger(); - d->xDest = t.getNextInteger(); - d->yDest = t.getNextInteger(); - d->index = count; + d->_sourceOffset = y * 320 + x; + d->_xSize = t.getNextInteger(); + d->_ySize = t.getNextInteger(); + d->_xDest = t.getNextInteger(); + d->_yDest = t.getNextInteger(); + d->_index = count; } ++objNum; ++count; @@ -592,9 +592,9 @@ void TuckerEngine::loadData() { int TuckerEngine::loadDataHelper(int offset, int index) { for (int i = 0; i < _dataCount + 1; ++i) { - if (_dataTable[i].index == index) { - int sz = Graphics::encodeRLE(_loadTempBuf + _dataTable[i].sourceOffset, _data3GfxBuf + offset, _dataTable[i].xSize, _dataTable[i].ySize); - _dataTable[i].sourceOffset = offset; + if (_dataTable[i]._index == index) { + int sz = Graphics::encodeRLE(_loadTempBuf + _dataTable[i]._sourceOffset, _data3GfxBuf + offset, _dataTable[i]._xSize, _dataTable[i]._ySize); + _dataTable[i]._sourceOffset = offset; offset += sz; } } @@ -626,7 +626,7 @@ void TuckerEngine::loadData3() { } assert(_locationAnimationsCount < kLocationAnimationsTableSize); LocationAnimation *d = &_locationAnimationsTable[_locationAnimationsCount++]; - d->graphicNum = num; + d->_graphicNum = num; const int seqNum = t.getNextInteger(); if (seqNum > 0) { int anim = 0; @@ -636,22 +636,22 @@ void TuckerEngine::loadData3() { } ++anim; } - d->animCurrentCounter = d->animInitCounter = anim; + d->_animCurrentCounter = d->_animInitCounter = anim; while (_staticData3Table[anim + 1] != 999) { ++anim; } - d->animLastCounter = anim; + d->_animLastCounter = anim; } else { - d->animLastCounter = 0; + d->_animLastCounter = 0; } - d->getFlag = t.getNextInteger(); - d->inventoryNum = t.getNextInteger(); - d->flagNum = t.getNextInteger(); - d->flagValue = t.getNextInteger(); - d->selectable = t.getNextInteger(); - d->standX = t.getNextInteger(); - d->standY = t.getNextInteger(); - d->drawFlag = 0; + d->_getFlag = t.getNextInteger(); + d->_inventoryNum = t.getNextInteger(); + d->_flagNum = t.getNextInteger(); + d->_flagValue = t.getNextInteger(); + d->_selectable = t.getNextInteger(); + d->_standX = t.getNextInteger(); + d->_standY = t.getNextInteger(); + d->_drawFlag = false; } } } @@ -673,22 +673,22 @@ void TuckerEngine::loadData4() { } assert(_locationObjectsCount < kLocationObjectsTableSize); LocationObject *d = &_locationObjectsTable[_locationObjectsCount++]; - d->xPos = i; - d->yPos = t.getNextInteger(); - d->xSize = t.getNextInteger(); - d->ySize = t.getNextInteger(); - d->standX = t.getNextInteger(); - d->standY = t.getNextInteger(); - d->textNum = t.getNextInteger(); - d->cursorNum = t.getNextInteger(); - d->locationNum = t.getNextInteger(); - if (d->locationNum > 0) { - d->toX = t.getNextInteger(); - d->toY = t.getNextInteger(); - d->toX2 = t.getNextInteger(); - d->toY2 = t.getNextInteger(); - d->toWalkX2 = t.getNextInteger(); - d->toWalkY2 = t.getNextInteger(); + d->_xPos = i; + d->_yPos = t.getNextInteger(); + d->_xSize = t.getNextInteger(); + d->_ySize = t.getNextInteger(); + d->_standX = t.getNextInteger(); + d->_standY = t.getNextInteger(); + d->_textNum = t.getNextInteger(); + d->_cursorNum = t.getNextInteger(); + d->_locationNum = t.getNextInteger(); + if (d->_locationNum > 0) { + d->_toX = t.getNextInteger(); + d->_toY = t.getNextInteger(); + d->_toX2 = t.getNextInteger(); + d->_toY2 = t.getNextInteger(); + d->_toWalkX2 = t.getNextInteger(); + d->_toWalkY2 = t.getNextInteger(); } } } @@ -726,20 +726,20 @@ void TuckerEngine::loadActionFile() { int keyD = t.getNextInteger(); int keyE = t.getNextInteger(); Action *action = &_actionsTable[_actionsCount++]; - action->key = keyE * 1000000 + keyD * 100000 + keyA * 10000 + keyB * 1000 + keyC; - action->testFlag1Num = t.getNextInteger(); - action->testFlag1Value = t.getNextInteger(); - action->testFlag2Num = t.getNextInteger(); - action->testFlag2Value = t.getNextInteger(); - action->speech = t.getNextInteger(); - action->flipX = t.getNextInteger(); - action->index = t.getNextInteger(); - action->delay = t.getNextInteger(); - action->setFlagNum = t.getNextInteger(); - assert(action->setFlagNum >= 0 && action->setFlagNum < kFlagsTableSize); - action->setFlagValue = t.getNextInteger(); - action->fxNum = t.getNextInteger(); - action->fxDelay = t.getNextInteger(); + action->_key = keyE * 1000000 + keyD * 100000 + keyA * 10000 + keyB * 1000 + keyC; + action->_testFlag1Num = t.getNextInteger(); + action->_testFlag1Value = t.getNextInteger(); + action->_testFlag2Num = t.getNextInteger(); + action->_testFlag2Value = t.getNextInteger(); + action->_speech = t.getNextInteger(); + action->_flipX = t.getNextInteger(); + action->_index = t.getNextInteger(); + action->_delay = t.getNextInteger(); + action->_setFlagNum = t.getNextInteger(); + assert(action->_setFlagNum >= 0 && action->_setFlagNum < kFlagsTableSize); + action->_setFlagValue = t.getNextInteger(); + action->_fxNum = t.getNextInteger(); + action->_fxDelay = t.getNextInteger(); } } } @@ -756,17 +756,17 @@ void TuckerEngine::loadCharPos() { } assert(_charPosCount < 4); CharPos *charPos = &_charPosTable[_charPosCount++]; - charPos->xPos = i; - charPos->yPos = t.getNextInteger(); - charPos->xSize = t.getNextInteger(); - charPos->ySize = t.getNextInteger(); - charPos->xWalkTo = t.getNextInteger(); - charPos->yWalkTo = t.getNextInteger(); - charPos->flagNum = t.getNextInteger(); - charPos->flagValue = t.getNextInteger(); - charPos->direction = t.getNextInteger(); - charPos->name = t.getNextInteger(); - charPos->description = t.getNextInteger(); + charPos->_xPos = i; + charPos->_yPos = t.getNextInteger(); + charPos->_xSize = t.getNextInteger(); + charPos->_ySize = t.getNextInteger(); + charPos->_xWalkTo = t.getNextInteger(); + charPos->_yWalkTo = t.getNextInteger(); + charPos->_flagNum = t.getNextInteger(); + charPos->_flagValue = t.getNextInteger(); + charPos->_direction = t.getNextInteger(); + charPos->_name = t.getNextInteger(); + charPos->_description = t.getNextInteger(); } int quitLoop = 0; size_t count = 0; @@ -819,9 +819,9 @@ void TuckerEngine::loadSprA02_01() { void TuckerEngine::unloadSprA02_01() { for (int i = 1; i < kSprA02TableSize; ++i) { free(_sprA02Table[i]); - _sprA02Table[i] = 0; + _sprA02Table[i] = nullptr; } - _sprA02Table[0] = 0; + _sprA02Table[0] = nullptr; } void TuckerEngine::loadSprC02_01() { @@ -835,17 +835,17 @@ void TuckerEngine::loadSprC02_01() { _spritesCount = _sprC02LookupTable2[_locationNum]; for (int i = 0; i < kMaxCharacters; ++i) { memset(&_spritesTable[i], 0, sizeof(Sprite)); - _spritesTable[i].state = -1; - _spritesTable[i].stateIndex = -1; + _spritesTable[i]._state = -1; + _spritesTable[i]._stateIndex = -1; } } void TuckerEngine::unloadSprC02_01() { for (int i = 1; i < kSprC02TableSize; ++i) { free(_sprC02Table[i]); - _sprC02Table[i] = 0; + _sprC02Table[i] = nullptr; } - _sprC02Table[0] = 0; + _sprC02Table[0] = nullptr; } void TuckerEngine::loadFx() { @@ -857,35 +857,35 @@ void TuckerEngine::loadFx() { _currentFxSet = 0; for (int i = 0; i < _locationSoundsCount; ++i) { LocationSound *s = &_locationSoundsTable[i]; - s->offset = 0; - s->num = t.getNextInteger(); - s->volume = t.getNextInteger(); - s->type = t.getNextInteger(); - switch (s->type) { + s->_offset = 0; + s->_num = t.getNextInteger(); + s->_volume = t.getNextInteger(); + s->_type = t.getNextInteger(); + switch (s->_type) { case 5: _currentFxSet = 1; _currentFxIndex = i; - _currentFxVolume = s->volume; + _currentFxVolume = s->_volume; _currentFxDist = t.getNextInteger(); _currentFxScale = t.getNextInteger(); break; case 6: case 7: case 8: - s->startFxSpriteState = t.getNextInteger(); - s->startFxSpriteNum = t.getNextInteger(); - s->updateType = t.getNextInteger(); - if (s->type == 7) { - s->flagNum = t.getNextInteger(); - s->flagValueStartFx = t.getNextInteger(); - s->stopFxSpriteState = t.getNextInteger(); - s->stopFxSpriteNum = t.getNextInteger(); - s->flagValueStopFx = t.getNextInteger(); + s->_startFxSpriteState = t.getNextInteger(); + s->_startFxSpriteNum = t.getNextInteger(); + s->_updateType = t.getNextInteger(); + if (s->_type == 7) { + s->_flagNum = t.getNextInteger(); + s->_flagValueStartFx = t.getNextInteger(); + s->_stopFxSpriteState = t.getNextInteger(); + s->_stopFxSpriteNum = t.getNextInteger(); + s->_flagValueStopFx = t.getNextInteger(); } break; } - if (s->type == 8) { - s->type = 6; + if (s->_type == 8) { + s->_type = 6; } } t.findNextToken(kDataTokenDw); @@ -896,10 +896,10 @@ void TuckerEngine::loadFx() { int flagValue = t.getNextInteger(); if (flagValue == _flagsTable[flagNum]) { LocationMusic *m = &_locationMusicsTable[_locationMusicsCount++]; - m->offset = 0; - m->num = t.getNextInteger(); - m->volume = t.getNextInteger(); - m->flag = t.getNextInteger(); + m->_offset = 0; + m->_num = t.getNextInteger(); + m->_volume = t.getNextInteger(); + m->_flag = t.getNextInteger(); } else { for (int j = 0; j < 3; ++j) { t.getNextInteger(); @@ -924,7 +924,7 @@ void TuckerEngine::loadSound(Audio::Mixer::SoundType type, int num, int volume, return; } if (!stream) { - const char *fmt = 0; + const char *fmt = nullptr; switch (type) { case Audio::Mixer::kSFXSoundType: fmt = "fx/fx%d.wav"; @@ -1005,7 +1005,7 @@ void TuckerEngine::loadActionsTable() { } } } else { - if (_spritesTable[_csDataTableCount - 1].firstFrame - 1 != _spritesTable[_csDataTableCount - 1].animationFrame) { + if (_spritesTable[_csDataTableCount - 1]._firstFrame - 1 != _spritesTable[_csDataTableCount - 1]._animationFrame) { break; } } @@ -1031,7 +1031,7 @@ void TuckerEngine::loadActionsTable() { _panelState = 0; setCursorType(0); _csDataHandled = false; - _actionVerbLocked = 0; + _actionVerbLocked = false; _mouseClick = 1; } } diff --git a/engines/tucker/saveload.cpp b/engines/tucker/saveload.cpp index 5f40cbf904..92da2d4d9b 100644 --- a/engines/tucker/saveload.cpp +++ b/engines/tucker/saveload.cpp @@ -64,8 +64,8 @@ void TuckerEngine::saveOrLoadGameStateData(S &s) { saveOrLoadInt(s, _panelObjectsOffsetTable[i]); } saveOrLoadInt(s, _mainSpritesBaseOffset); - saveOrLoadInt(s, _selectedObject.xPos); - saveOrLoadInt(s, _selectedObject.yPos); + saveOrLoadInt(s, _selectedObject._xPos); + saveOrLoadInt(s, _selectedObject._yPos); saveOrLoadInt(s, _locationNum); saveOrLoadInt(s, _xPosCurrent); saveOrLoadInt(s, _yPosCurrent); diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index 4b36a13f76..2fb881f77e 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -306,7 +306,7 @@ void TuckerEngine::handleMeanwhileSequence() { void TuckerEngine::handleMapSequence() { loadImage("map2.pcx", _quadBackgroundGfxBuf + 89600, 0); loadImage("map1.pcx", _loadTempBuf, 1); - _selectedObject.locationObject_locationNum = 0; + _selectedObject._locationObjectLocationNum = 0; if (_flagsTable[7] > 0) { copyMapRect(0, 0, 140, 86); } @@ -419,7 +419,7 @@ void TuckerEngine::copyMapRect(int x, int y, int w, int h) { } } -int TuckerEngine::handleSpecialObjectSelectionSequence() { +bool TuckerEngine::handleSpecialObjectSelectionSequence() { char filename[40]; if (_partNum == 1 && _selectedObjectNum == 6) { strcpy(filename, "news1.pcx"); @@ -436,7 +436,7 @@ int TuckerEngine::handleSpecialObjectSelectionSequence() { } else if (_currentInfoString1SourceType == 1 && _currentActionObj1Num == 91) { strcpy(filename, "memo.pcx"); } else { - return 0; + return false; } while (_fadePaletteCounter > 0) { fadeInPalette(); @@ -460,10 +460,10 @@ int TuckerEngine::handleSpecialObjectSelectionSequence() { } if (_partNum == 3 && _selectedObjectNum == 45) { for (int i = 0; i < 13; ++i) { - const int offset = _dataTable[204 + i].yDest * 640 + _dataTable[204 + i].xDest; + const int offset = _dataTable[204 + i]._yDest * 640 + _dataTable[204 + i]._xDest; static const int itemsTable[] = { 15, 44, 25, 19, 21, 24, 12, 27, 20, 29, 35, 23, 3 }; if (_inventoryItemsState[itemsTable[i]] > 1) { - Graphics::decodeRLE(_locationBackgroundGfxBuf + _scrollOffset + offset, _data3GfxBuf + _dataTable[204 + i].sourceOffset, _dataTable[204 + i].xSize, _dataTable[204 + i].ySize); + Graphics::decodeRLE(_locationBackgroundGfxBuf + _scrollOffset + offset, _data3GfxBuf + _dataTable[204 + i]._sourceOffset, _dataTable[204 + i]._xSize, _dataTable[204 + i]._ySize); } } } @@ -479,7 +479,7 @@ int TuckerEngine::handleSpecialObjectSelectionSequence() { } } loadLoc(); - return 1; + return true; } AnimationSequencePlayer::AnimationSequencePlayer(OSystem *system, Audio::Mixer *mixer, Common::EventManager *event, CompressedSound *sound, int num) @@ -487,11 +487,20 @@ AnimationSequencePlayer::AnimationSequencePlayer(OSystem *system, Audio::Mixer * memset(_animationPalette, 0, sizeof(_animationPalette)); _soundSeqDataCount = 0; _soundSeqDataIndex = 0; - _soundSeqData = 0; + _soundSeqData = nullptr; _offscreenBuffer = (uint8 *)malloc(kScreenWidth * kScreenHeight); _updateScreenWidth = 0; _updateScreenPicture = false; - _picBufPtr = _pic2BufPtr = 0; + _picBufPtr = _pic2BufPtr = nullptr; + + _changeToNextSequence = false; + _updateFunc = nullptr; + _updateFuncIndex = 0; + _updateScreenCounter = 0; + _updateScreenIndex = -1; + _frameCounter = 0; + _frameTime = 0; + _lastFrameTime = 1; } AnimationSequencePlayer::~AnimationSequencePlayer() { @@ -722,13 +731,12 @@ void AnimationSequencePlayer::fadeOutPalette() { void AnimationSequencePlayer::unloadAnimation() { _mixer->stopAll(); free(_picBufPtr); - _picBufPtr = 0; free(_pic2BufPtr); - _pic2BufPtr = 0; + _picBufPtr = _pic2BufPtr = nullptr; } uint8 *AnimationSequencePlayer::loadPicture(const char *fileName) { - uint8 *p = 0; + uint8 *p = nullptr; Common::File f; if (f.open(fileName)) { const int sz = f.size(); diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index 7eb4856050..adf4be6b65 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -43,6 +43,33 @@ namespace Tucker { TuckerEngine::TuckerEngine(OSystem *system, Common::Language language, uint32 flags) : Engine(system), _gameLang(language), _gameFlags(flags), _rnd("tucker") { _console = new TuckerConsole(this); + + resetVariables(); + + _execData3Counter = 0; + _currentSaveLoadGameState = 1; + _fileLoadSize = 0; + _csDataSize = 0; + + _player = nullptr; + _loadTempBuf = nullptr; + _cursorGfxBuf = nullptr; + _charsetGfxBuf = nullptr; + _panelGfxBuf = nullptr; + _itemsGfxBuf = nullptr; + _spritesGfxBuf = nullptr; + _locationBackgroundGfxBuf = nullptr; + _data5Buf = nullptr; + _data3GfxBuf = nullptr; + _quadBackgroundGfxBuf = nullptr; + _objTxtBuf = nullptr; + _panelObjectsGfxBuf = nullptr; + _ptTextBuf = nullptr; + _infoBarBuf = nullptr; + _bgTextBuf = nullptr; + _charNameBuf = nullptr; + _locationBackgroundMaskBuf = nullptr; + _csDataBuf = nullptr; } TuckerEngine::~TuckerEngine() { @@ -84,17 +111,17 @@ void TuckerEngine::allocateBuffers() { _charsetGfxBuf = (uint8 *)calloc(1, 22400); _cursorGfxBuf = (uint8 *)calloc(1, 256 * 7); _infoBarBuf = (uint8 *)calloc(1, 1000); - _charNameBuf = 0; - _bgTextBuf = 0; - _objTxtBuf = 0; + _charNameBuf = nullptr; + _bgTextBuf = nullptr; + _objTxtBuf = nullptr; _panelObjectsGfxBuf = (uint8 *)calloc(1, 20000); - _data5Buf = 0; + _data5Buf = nullptr; _data3GfxBuf = (uint8 *)calloc(1, 250000); _quadBackgroundGfxBuf = (uint8 *)calloc(1, 320 * 140 * 4); _locationBackgroundMaskBuf = (uint8 *)calloc(1, 640 * 140); - _csDataBuf = 0; + _csDataBuf = nullptr; _spritesGfxBuf = (uint8 *)calloc(1, 160000); - _ptTextBuf = 0; + _ptTextBuf = nullptr; memset(_charWidthTable, 0, sizeof(_charWidthTable)); } @@ -119,7 +146,7 @@ void TuckerEngine::freeBuffers() { free(_ptTextBuf); } -void TuckerEngine::restart() { +void TuckerEngine::resetVariables() { _quitGame = false; _fastMode = false; _syncCounter = 0; @@ -131,15 +158,16 @@ void TuckerEngine::restart() { _nextLocationNum = (_gameFlags & kGameFlagDemo) == 0 ? kStartupLocationGame : kStartupLocationDemo; _gamePaused = false; _gameDebug = false; - _displayGameHints = false; _displaySpeechText = (_gameFlags & kGameFlagNoSubtitles) == 0 ? ConfMan.getBool("subtitles") : false; memset(_flagsTable, 0, sizeof(_flagsTable)); _gameHintsIndex = 0; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; _gameHintsStringNum = 0; + _displayGameHints = false; + _displayHintsText = false; + if ((_gameFlags & kGameFlagDemo) == 0) { _locationWidthTable = _locationWidthTableGame; _locationHeightTable = _locationHeightTableGame; @@ -189,7 +217,7 @@ void TuckerEngine::restart() { _switchPanelCounter = 0; _conversationOptionsCount = 0; _fadedPanel = false; - _panelLockedFlag = 0; + _panelLockedFlag = false; _conversationOptionLinesCount = 0; memset(_inventoryItemsState, 0, sizeof(_inventoryItemsState)); memset(_inventoryObjectsList, 0, sizeof(_inventoryObjectsList)); @@ -223,11 +251,11 @@ void TuckerEngine::restart() { _selectedCharacterNum = 0; _actionObj1Type = _actionObj2Type = 0; _actionObj1Num = _actionObj2Num = 0; - _actionRequiresTwoObjects = 0; - _actionVerbLocked = 0; + _actionRequiresTwoObjects = false; + _actionVerbLocked = false; _actionPosX = 0; _actionPosY = 0; - _selectedObjectLocationMask = 0; + _selectedObjectLocationMask = false; memset(&_selectedObject, 0, sizeof(_selectedObject)); _selectedCharacterDirection = 0; _selectedCharacter2Num = 0; @@ -247,10 +275,10 @@ void TuckerEngine::restart() { _nextTableToLoadIndex = 0; memset(_nextTableToLoadTable, 0, sizeof(_nextTableToLoadTable)); _soundInstructionIndex = 0; - _tableInstructionsPtr = 0; + _tableInstructionsPtr = nullptr; memset(_tableInstructionObj1Table, 0, sizeof(_tableInstructionObj1Table)); memset(_tableInstructionObj2Table, 0, sizeof(_tableInstructionObj2Table)); - _tableInstructionFlag = 0; + _tableInstructionFlag = false; _tableInstructionItemNum1 = _tableInstructionItemNum2 = 0; memset(_instructionsActionsTable, 0, sizeof(_instructionsActionsTable)); _validInstructionId = false; @@ -266,7 +294,7 @@ void TuckerEngine::restart() { _skipCurrentCharacterDraw = false; _yPosCurrent = 131; _xPosCurrent = 160; - _characterSpeechDataPtr = 0; + _characterSpeechDataPtr = nullptr; _ptTextOffset = 0; memset(_characterAnimationsTable, 0, sizeof(_characterAnimationsTable)); memset(_characterStateTable, 0, sizeof(_characterStateTable)); @@ -279,26 +307,26 @@ void TuckerEngine::restart() { _currentSpriteAnimationFrame2 = 0; _characterAnimationIndex = -1; _characterFacingDirection = _characterPrevFacingDirection = 0; - _characterBackFrontFacing = _characterPrevBackFrontFacing = 0; + _characterBackFrontFacing = _characterPrevBackFrontFacing = false; _characterAnimationNum = 0; _noCharacterAnimationChange = 0; - _changeBackgroundSprite = 0; _characterSpriteAnimationFrameCounter = 0; - _locationMaskIgnore = 0; + _locationMaskIgnore = false; _locationMaskType = 0; _locationMaskCounter = 0; - _updateSpriteFlag1 = 0; - _updateSpriteFlag2 = 0; _handleMapCounter = 0; _noPositionChangeAfterMap = false; + _changeBackgroundSprite = false; + _updateSpriteFlag1 = false; + _updateSpriteFlag2 = false; - _mirroredDrawing = 0; - _loadLocBufPtr = 0; - _backgroundSpriteDataPtr = 0; + _mirroredDrawing = false; + _loadLocBufPtr = nullptr; + _backgroundSpriteDataPtr = nullptr; _locationHeight = 0; _scrollOffset = 0; _currentGfxBackgroundCounter = 0; - _currentGfxBackground = 0; + _currentGfxBackground = nullptr; _fadePaletteCounter = 0; memset(_currentPalette, 0, sizeof(_currentPalette)); _fullRedraw = false; @@ -319,14 +347,14 @@ void TuckerEngine::restart() { memset(_updateLocation14ObjNum, 0, sizeof(_updateLocation14ObjNum)); memset(_updateLocation14Delay, 0, sizeof(_updateLocation14Delay)); _updateLocationCounter2 = 0; - _updateLocationFlag = 0; + _updateLocationFlag = false; _updateLocation70StringLen = 0; memset(_updateLocation70String, 0, sizeof(_updateLocation70String)); } void TuckerEngine::mainLoop() { allocateBuffers(); - restart(); + resetVariables(); loadCharSizeDta(); if ((_gameFlags & kGameFlagDemo) != 0) { @@ -352,7 +380,7 @@ void TuckerEngine::mainLoop() { _flagsTable[219] = 1; _flagsTable[105] = 1; - _spriteAnimationFrameIndex = _spriteAnimationsTable[14].firstFrameIndex; + _spriteAnimationFrameIndex = _spriteAnimationsTable[14]._firstFrameIndex; if (ConfMan.hasKey("save_slot")) { const int slot = ConfMan.getInt("save_slot"); @@ -412,7 +440,7 @@ void TuckerEngine::mainLoop() { } if (_flagsTable[158] == 1) { _flagsTable[158] = 0; - _skipCurrentCharacterDraw = 1; + _skipCurrentCharacterDraw = true; } _mainLoopCounter1 = 0; } @@ -440,7 +468,7 @@ void TuckerEngine::mainLoop() { updateGameHints(); } if (_panelState == 0) { - if (_panelLockedFlag == 1 || _pendingActionDelay > 0) { + if (_panelLockedFlag || _pendingActionDelay > 0) { if (!_fadedPanel) { updateItemsGfxColors(0x60, 0x80); _fadedPanel = true; @@ -450,7 +478,7 @@ void TuckerEngine::mainLoop() { clearItemsGfx(); if (_gamePaused) { drawPausedInfoBar(); - } else if (_gameHintsDisplayText == 1 && _mouseIdleCounter > 1000) { + } else if (_displayHintsText && _mouseIdleCounter > 1000) { drawGameHintString(); } else { drawInfoString(); @@ -466,10 +494,10 @@ void TuckerEngine::mainLoop() { } _currentGfxBackground = _quadBackgroundGfxBuf + (_currentGfxBackgroundCounter / 10) * 44800; if (_fadePaletteCounter < 34 && _locationNum == 22) { - _spritesTable[0].gfxBackgroundOffset = (_currentGfxBackgroundCounter / 10) * 640; + _spritesTable[0]._gfxBackgroundOffset = (_currentGfxBackgroundCounter / 10) * 640; _mainSpritesBaseOffset = _currentGfxBackgroundCounter / 10; if (_locationNum == 22 && _currentGfxBackgroundCounter <= 29) { - _spritesTable[0].gfxBackgroundOffset = 640; + _spritesTable[0]._gfxBackgroundOffset = 640; _mainSpritesBaseOffset = 1; } } @@ -489,11 +517,11 @@ void TuckerEngine::mainLoop() { drawData3(); execData3PreUpdate(); for (int i = 0; i < _spritesCount; ++i) { - if (!_spritesTable[i].disabled) { + if (!_spritesTable[i]._disabled) { drawSprite(i); } } - if (_skipCurrentCharacterDraw != 1) { + if (!_skipCurrentCharacterDraw) { if (_backgroundSpriteCurrentAnimation > -1 && _backgroundSpriteCurrentFrame > 0) { drawBackgroundSprites(); } else { @@ -522,7 +550,7 @@ void TuckerEngine::mainLoop() { --_miscSoundFxDelayCounter[num]; if (_miscSoundFxDelayCounter[num] == 0) { const int index = _miscSoundFxNum[num]; - startSound(_locationSoundsTable[index].offset, index, _locationSoundsTable[index].volume); + startSound(_locationSoundsTable[index]._offset, index, _locationSoundsTable[index]._volume); } } } @@ -565,7 +593,7 @@ void TuckerEngine::mainLoop() { } if (_inputKeys[kInputKeyHelp]) { _inputKeys[kInputKeyHelp] = false; - if (_displayGameHints && _gameHintsDisplayText == 1) { + if (_displayGameHints && _displayHintsText) { _gameHintsStringNum = _gameHintsIndex + 1; _mouseIdleCounter = 1100; } @@ -689,14 +717,14 @@ void TuckerEngine::setupNewLocation() { _mainLoopCounter2 = 0; _mainLoopCounter1 = 0; _characterFacingDirection = 0; - _actionVerbLocked = 0; - _locationMaskIgnore = 0; + _actionVerbLocked = false; + _locationMaskIgnore = false; _backgroundSprOffset = 0; if (_backgroundSpriteCurrentAnimation > 0 && _backgroundSpriteCurrentFrame > 0) { _backgroundSpriteCurrentAnimation = -1; _backgroundSpriteCurrentFrame = 0; } - if (_panelLockedFlag == 0 || (_backgroundSpriteCurrentAnimation > 0 && _locationNum != 25)) { + if (!_panelLockedFlag || (_backgroundSpriteCurrentAnimation > 0 && _locationNum != 25)) { _locationMaskType = 0; } else { _locationMaskType = 3; @@ -829,8 +857,8 @@ void TuckerEngine::updateCharPosition() { updateCharPositionHelper(); return; case 1: - if (_locationAnimationsTable[_selectedCharacter2Num].getFlag == 1) { - _speechSoundNum = _speechSoundBaseNum + _locationAnimationsTable[_selectedCharacter2Num].inventoryNum; + if (_locationAnimationsTable[_selectedCharacter2Num]._getFlag == 1) { + _speechSoundNum = _speechSoundBaseNum + _locationAnimationsTable[_selectedCharacter2Num]._inventoryNum; _characterSpeechDataPtr = _ptTextBuf; updateCharPositionHelper(); return; @@ -842,8 +870,8 @@ void TuckerEngine::updateCharPosition() { break; case 2: _characterSpeechDataPtr = _ptTextBuf; - _speechSoundNum = 2175 + _charPosTable[_selectedCharacterNum].description; - if (_charPosTable[_selectedCharacterNum].description != 0) { + _speechSoundNum = 2175 + _charPosTable[_selectedCharacterNum]._description; + if (_charPosTable[_selectedCharacterNum]._description != 0) { updateCharPositionHelper(); return; } @@ -852,59 +880,61 @@ void TuckerEngine::updateCharPosition() { } int actionKey = _currentActionObj2Num * 1000000 + _currentInfoString2SourceType * 100000 + _currentActionVerb * 10000 + _currentInfoString1SourceType * 1000 + _currentActionObj1Num; debug(3, "updateCharPosition() actionKey %d", actionKey); - int skip = 0; - Action *action = 0; - for (int i = 0; i < _actionsCount && skip == 0; ++i) { + bool skip = false; + Action *action = nullptr; + for (int i = 0; i < _actionsCount && !skip; ++i) { action = &_actionsTable[i]; - if (action->key == actionKey) { - skip = 1; - if (action->testFlag1Num != 0) { - if (action->testFlag1Num < 500) { - if (_flagsTable[action->testFlag1Num] != action->testFlag1Value) { - skip = 0; + if (action->_key == actionKey) { + skip = true; + if (action->_testFlag1Num != 0) { + if (action->_testFlag1Num < 500) { + if (action->_testFlag1Num >= 300) + error("updateCharPosition() - Unexpected value for _testFlag1Num : %d", action->_testFlag1Num); + if (_flagsTable[action->_testFlag1Num] != action->_testFlag1Value) { + skip = false; } - } else if (_inventoryItemsState[action->testFlag1Num - 500] != action->testFlag1Value) { - skip = 0; + } else if (_inventoryItemsState[action->_testFlag1Num - 500] != action->_testFlag1Value) { + skip = false; } - debug(3, "updateCharPosition() flag1 %d value %d", action->testFlag1Num, action->testFlag1Value); + debug(3, "updateCharPosition() flag1 %d value %d", action->_testFlag1Num, action->_testFlag1Value); } - if (action->testFlag2Num != 0) { - if (action->testFlag2Num < 500) { - if (_flagsTable[action->testFlag2Num] != action->testFlag2Value) { - skip = 0; + if (action->_testFlag2Num != 0) { + if (action->_testFlag2Num < 500) { + if (_flagsTable[action->_testFlag2Num] != action->_testFlag2Value) { + skip = false; } - } else if (_inventoryItemsState[action->testFlag2Num - 500] != action->testFlag2Value) { - skip = 0; + } else if (_inventoryItemsState[action->_testFlag2Num - 500] != action->_testFlag2Value) { + skip = false; } - debug(3, "updateCharPosition() flag2 %d value %d", action->testFlag2Num, action->testFlag2Value); + debug(3, "updateCharPosition() flag2 %d value %d", action->_testFlag2Num, action->_testFlag2Value); } } } - if (skip == 0) { + if (!skip) { playSpeechForAction(_currentActionVerb); _currentActionVerb = 0; return; } assert(action); - if (action->speech != 6) { - if (action->speech < 100) { - _spriteAnimationFrameIndex = _spriteAnimationsTable[action->speech].firstFrameIndex; - _currentSpriteAnimationLength = _spriteAnimationsTable[action->speech].numParts; - _mirroredDrawing = action->flipX; + if (action->_speech != 6) { + if (action->_speech < 100) { + _spriteAnimationFrameIndex = _spriteAnimationsTable[action->_speech]._firstFrameIndex; + _currentSpriteAnimationLength = _spriteAnimationsTable[action->_speech]._numParts; + _mirroredDrawing = (action->_flipX != 0); _characterFacingDirection = 5; _mainLoopCounter2 = 0; } else { - _backgroundSpriteCurrentAnimation = action->speech - 100; + _backgroundSpriteCurrentAnimation = action->_speech - 100; _backgroundSpriteCurrentFrame = 0; - _mirroredDrawing = 0; + _mirroredDrawing = false; } } - _pendingActionDelay = action->delay; - _charPositionFlagNum = action->setFlagNum; - _charPositionFlagValue = action->setFlagValue; - _pendingActionIndex = action->index; - _characterSoundFxDelayCounter = action->fxDelay; - _characterSoundFxNum = action->fxNum; + _pendingActionDelay = action->_delay; + _charPositionFlagNum = action->_setFlagNum; + _charPositionFlagValue = action->_setFlagValue; + _pendingActionIndex = action->_index; + _characterSoundFxDelayCounter = action->_fxDelay; + _characterSoundFxNum = action->_fxNum; _previousActionVerb = _currentActionVerb; _currentActionVerb = 0; } @@ -980,10 +1010,10 @@ void TuckerEngine::setBlackPalette() { void TuckerEngine::updateCursor() { setCursorNum(0); - if (_backgroundSpriteCurrentAnimation == -1 && _panelLockedFlag == 0 && _selectedObject.locationObject_locationNum > 0) { - _selectedObject.locationObject_locationNum = 0; + if (_backgroundSpriteCurrentAnimation == -1 && !_panelLockedFlag && _selectedObject._locationObjectLocationNum > 0) { + _selectedObject._locationObjectLocationNum = 0; } - if (_locationMaskType > 0 || _selectedObject.locationObject_locationNum > 0 || _pendingActionDelay > 0) { + if (_locationMaskType > 0 || _selectedObject._locationObjectLocationNum > 0 || _pendingActionDelay > 0) { return; } if (_rightMouseButtonPressed) { @@ -993,13 +1023,13 @@ void TuckerEngine::updateCursor() { _actionVerb = 0; } _updateCursorFlag = true; - _actionVerbLocked = 1; + _actionVerbLocked = true; _actionRequiresTwoObjects = false; } } else { _updateCursorFlag = false; } - if (_actionVerbLocked == 0) { + if (!_actionVerbLocked) { setActionVerbUnderCursor(); if (_actionVerb == 0 && _locationNum == 63) { _actionVerb = 8; @@ -1016,7 +1046,7 @@ void TuckerEngine::updateCursor() { } else { num = getObjectUnderCursor(); if (num > -1) { - _selectedObjectNum = _locationObjectsTable[num].textNum; + _selectedObjectNum = _locationObjectsTable[num]._textNum; } } handleMouseClickOnInventoryObject(); @@ -1027,7 +1057,7 @@ void TuckerEngine::updateCursor() { _selectedObjectNum = 0; _selectedObjectType = 0; } - if (_actionVerbLocked == 0 && _selectedObjectType == 2 && _selectedObjectNum != 21) { + if (!_actionVerbLocked && _selectedObjectType == 2 && _selectedObjectNum != 21) { _actionVerb = 2; } if (!_actionRequiresTwoObjects) { @@ -1055,7 +1085,7 @@ void TuckerEngine::updateCursor() { if (_mousePosY >= 150 && _mousePosX < 212) { if (_mousePosX < 200) { setActionVerbUnderCursor(); - _actionVerbLocked = 1; + _actionVerbLocked = true; _actionRequiresTwoObjects = false; } else if (_mousePosY < 175) { moveDownInventoryObjects(); @@ -1066,13 +1096,13 @@ void TuckerEngine::updateCursor() { if (_selectedObjectType == 3) { setActionForInventoryObject(); } else if (_actionVerb != 0) { - _actionVerbLocked = 0; + _actionVerbLocked = false; setActionState(); } else if (_actionObj1Num == 261 || (_actionObj1Num == 205 && _flagsTable[143] == 0)) { - _actionVerbLocked = 0; + _actionVerbLocked = false; setActionState(); } else { - _actionVerbLocked = 0; + _actionVerbLocked = false; _actionRequiresTwoObjects = false; _currentActionVerb = 0; setSelectedObjectKey(); @@ -1092,26 +1122,26 @@ void TuckerEngine::stopSounds() { void TuckerEngine::playSounds() { for (int i = 0; i < _locationSoundsCount; ++i) { - if (_locationSoundsTable[i].type == 1 || _locationSoundsTable[i].type == 2 || _locationSoundsTable[i].type == 5 || - (_locationSoundsTable[i].type == 7 && _flagsTable[_locationSoundsTable[i].flagNum] == _locationSoundsTable[i].flagValueStartFx)) { - startSound(_locationSoundsTable[i].offset, i, _locationSoundsTable[i].volume); + if (_locationSoundsTable[i]._type == 1 || _locationSoundsTable[i]._type == 2 || _locationSoundsTable[i]._type == 5 || + (_locationSoundsTable[i]._type == 7 && _flagsTable[_locationSoundsTable[i]._flagNum] == _locationSoundsTable[i]._flagValueStartFx)) { + startSound(_locationSoundsTable[i]._offset, i, _locationSoundsTable[i]._volume); } } for (int i = 0; i < _locationMusicsCount; ++i) { - if (_locationMusicsTable[i].flag > 0) { - startMusic(_locationMusicsTable[i].offset, i, _locationMusicsTable[i].volume); + if (_locationMusicsTable[i]._flag > 0) { + startMusic(_locationMusicsTable[i]._offset, i, _locationMusicsTable[i]._volume); } } } void TuckerEngine::updateCharactersPath() { - if (_panelLockedFlag == 0) { + if (!_panelLockedFlag) { return; } if (_backgroundSpriteCurrentAnimation != -1 && _locationNum != 25) { - if (_xPosCurrent == _selectedObject.xPos && _yPosCurrent == _selectedObject.yPos) { + if (_xPosCurrent == _selectedObject._xPos && _yPosCurrent == _selectedObject._yPos) { _locationMaskCounter = 1; - _panelLockedFlag = 0; + _panelLockedFlag = false; } return; } @@ -1120,68 +1150,68 @@ void TuckerEngine::updateCharactersPath() { if (_characterFacingDirection == 5) { _characterPrevFacingDirection = 5; } - int flag = 0; - if (_yPosCurrent > _selectedObject.yPos) { - if (testLocationMask(_xPosCurrent, _yPosCurrent - 1) == 1) { + bool flag = false; + if (_yPosCurrent > _selectedObject._yPos) { + if (testLocationMask(_xPosCurrent, _yPosCurrent - 1)) { --_yPosCurrent; _characterFacingDirection = 4; - flag = 1; + flag = true; } - } else if (_yPosCurrent < _selectedObject.yPos) { - if (testLocationMask(_xPosCurrent, _yPosCurrent + 1) == 1) { + } else if (_yPosCurrent < _selectedObject._yPos) { + if (testLocationMask(_xPosCurrent, _yPosCurrent + 1)) { ++_yPosCurrent; _characterFacingDirection = 2; - flag = 1; + flag = true; } } - if (_xPosCurrent > _selectedObject.xPos) { - if (testLocationMask(_xPosCurrent - 1, _yPosCurrent) == 1) { + if (_xPosCurrent > _selectedObject._xPos) { + if (testLocationMask(_xPosCurrent - 1, _yPosCurrent)) { --_xPosCurrent; _characterFacingDirection = 3; - _characterBackFrontFacing = 0; - flag = 1; + _characterBackFrontFacing = false; + flag = true; } - } else if (_xPosCurrent < _selectedObject.xPos) { - if (testLocationMask(_xPosCurrent + 1, _yPosCurrent) == 1) { + } else if (_xPosCurrent < _selectedObject._xPos) { + if (testLocationMask(_xPosCurrent + 1, _yPosCurrent)) { ++_xPosCurrent; _characterFacingDirection = 1; - _characterBackFrontFacing = 1; - flag = 1; + _characterBackFrontFacing = true; + flag = true; } } - if (flag == 0) { - if (_selectedObjectLocationMask == 1) { - _selectedObjectLocationMask = 0; - _selectedObject.xPos = _selectedObject.xDefaultPos; - _selectedObject.yPos = _selectedObject.yDefaultPos; + if (!flag) { + if (_selectedObjectLocationMask) { + _selectedObjectLocationMask = false; + _selectedObject._xPos = _selectedObject._xDefaultPos; + _selectedObject._yPos = _selectedObject._yDefaultPos; } else { - _panelLockedFlag = 0; + _panelLockedFlag = false; _characterFacingDirection = 0; - if (_xPosCurrent == _selectedObject.xPos && _yPosCurrent == _selectedObject.yPos) { + if (_xPosCurrent == _selectedObject._xPos && _yPosCurrent == _selectedObject._yPos) { _locationMaskCounter = 1; } } } if (_locationNum == 25) { - if ((_backgroundSpriteCurrentAnimation != 3 || _characterBackFrontFacing != 0) && (_backgroundSpriteCurrentAnimation != 6 || _characterBackFrontFacing != 1)) { + if ((_backgroundSpriteCurrentAnimation != 3 || _characterBackFrontFacing) && (_backgroundSpriteCurrentAnimation != 6 || !_characterBackFrontFacing)) { _xPosCurrent = xPos; _yPosCurrent = yPos; return; } } - if (_xPosCurrent != _selectedObject.xPos || _yPosCurrent != _selectedObject.yPos) { + if (_xPosCurrent != _selectedObject._xPos || _yPosCurrent != _selectedObject._yPos) { return; } - if (_selectedObjectLocationMask != 0) { + if (_selectedObjectLocationMask) { return; } _locationMaskCounter = 1; - _panelLockedFlag = 0; - _locationMaskIgnore = 0; + _panelLockedFlag = false; + _locationMaskIgnore = false; if (_characterPrevFacingDirection <= 0 || _characterPrevFacingDirection >= 5) { return; } - if (_selectedObject.locationObject_locationNum == 0) { + if (_selectedObject._locationObjectLocationNum == 0) { _characterFacingDirection = 5; while (_spriteAnimationFramesTable[_spriteAnimationFrameIndex] != 999) { ++_spriteAnimationFrameIndex; @@ -1200,12 +1230,12 @@ void TuckerEngine::setSoundVolumeDistance() { void TuckerEngine::updateData3DrawFlag() { for (int i = 0; i < _locationAnimationsCount; ++i) { LocationAnimation *a = &_locationAnimationsTable[i]; - if (a->flagNum > 0 && a->flagValue != _flagsTable[a->flagNum]) { - a->drawFlag = 0; - } else if (a->getFlag == 0) { - a->drawFlag = 1; + if (a->_flagNum > 0 && a->_flagValue != _flagsTable[a->_flagNum]) { + a->_drawFlag = false; + } else if (a->_getFlag == 0) { + a->_drawFlag = true; } else { - a->drawFlag = (_inventoryItemsState[a->inventoryNum] == 0) ? 1 : 0; + a->_drawFlag = (_inventoryItemsState[a->_inventoryNum] == 0); } } } @@ -1214,26 +1244,26 @@ void TuckerEngine::updateData3() { updateData3DrawFlag(); for (int i = 0; i < _locationAnimationsCount; ++i) { LocationAnimation *a = &_locationAnimationsTable[i]; - if (a->animLastCounter != 0 && a->drawFlag != 0) { - if (a->animLastCounter == a->animCurrentCounter) { - a->animCurrentCounter = a->animInitCounter; + if (a->_animLastCounter != 0 && a->_drawFlag) { + if (a->_animLastCounter == a->_animCurrentCounter) { + a->_animCurrentCounter = a->_animInitCounter; } else { - ++a->animCurrentCounter; + ++a->_animCurrentCounter; } - const int index = a->animCurrentCounter; + const int index = a->_animCurrentCounter; if (_staticData3Table[index] == 998) { _flagsTable[_staticData3Table[index + 1]] = _staticData3Table[index + 2]; - a->animCurrentCounter = a->animInitCounter; - a->drawFlag = 0; + a->_animCurrentCounter = a->_animInitCounter; + a->_drawFlag = false; } if (_locationNum == 24 && i == 0) { // workaround bug #2872385: update fish animation sequence for correct // position in aquarium. - if (a->animInitCounter == 505 && a->animCurrentCounter == 513) { - a->animCurrentCounter = 525; + if (a->_animInitCounter == 505 && a->_animCurrentCounter == 513) { + a->_animCurrentCounter = 525; } } - a->graphicNum = _staticData3Table[a->animCurrentCounter]; + a->_graphicNum = _staticData3Table[a->_animCurrentCounter]; } } updateData3DrawFlag(); @@ -1242,16 +1272,16 @@ void TuckerEngine::updateData3() { void TuckerEngine::updateSfxData3_1() { for (int i = 0; i < _locationSoundsCount; ++i) { LocationSound *s = &_locationSoundsTable[i]; - if ((s->type == 6 || s->type == 7) && s->updateType == 1) { + if ((s->_type == 6 || s->_type == 7) && s->_updateType == 1) { for (int j = 0; j < _spritesCount; ++j) { - if (_spritesTable[j].animationFrame == s->startFxSpriteNum && _spritesTable[j].state == s->startFxSpriteState) { - if (s->type == 7) { - _flagsTable[s->flagNum] = s->flagValueStartFx; + if (_spritesTable[j]._animationFrame == s->_startFxSpriteNum && _spritesTable[j]._state == s->_startFxSpriteState) { + if (s->_type == 7) { + _flagsTable[s->_flagNum] = s->_flagValueStartFx; } - startSound(s->offset, i, s->volume); - } else if (s->type == 7) { - if (_spritesTable[j].animationFrame == s->stopFxSpriteNum && _spritesTable[j].state == s->stopFxSpriteState) { - _flagsTable[s->flagNum] = s->flagValueStopFx; + startSound(s->_offset, i, s->_volume); + } else if (s->_type == 7) { + if (_spritesTable[j]._animationFrame == s->_stopFxSpriteNum && _spritesTable[j]._state == s->_stopFxSpriteState) { + _flagsTable[s->_flagNum] = s->_flagValueStopFx; stopSound(i); } } @@ -1263,15 +1293,15 @@ void TuckerEngine::updateSfxData3_1() { void TuckerEngine::updateSfxData3_2() { for (int i = 0; i < _locationSoundsCount; ++i) { LocationSound *s = &_locationSoundsTable[i]; - if ((s->type == 6 || s->type == 7) && s->updateType == 0) { - if (s->startFxSpriteNum == _backgroundSpriteCurrentFrame && s->startFxSpriteState == _backgroundSpriteCurrentAnimation) { - if (s->type == 7) { - _flagsTable[s->flagNum] = s->flagValueStartFx; + if ((s->_type == 6 || s->_type == 7) && s->_updateType == 0) { + if (s->_startFxSpriteNum == _backgroundSpriteCurrentFrame && s->_startFxSpriteState == _backgroundSpriteCurrentAnimation) { + if (s->_type == 7) { + _flagsTable[s->_flagNum] = s->_flagValueStartFx; } - startSound(s->offset, i, s->volume); - } else if (s->type == 7) { - if (s->stopFxSpriteNum == _backgroundSpriteCurrentFrame && s->stopFxSpriteState == _backgroundSpriteCurrentAnimation) { - _flagsTable[s->flagNum] = s->flagValueStopFx; + startSound(s->_offset, i, s->_volume); + } else if (s->_type == 7) { + if (s->_stopFxSpriteNum == _backgroundSpriteCurrentFrame && s->_stopFxSpriteState == _backgroundSpriteCurrentAnimation) { + _flagsTable[s->_flagNum] = s->_flagValueStopFx; stopSound(i); } } @@ -1422,7 +1452,7 @@ void TuckerEngine::redrawPanelOverBackground() { void TuckerEngine::drawConversationTexts() { int y = 141; - int flag = 0; + bool flag = false; for (int i = 0; i < _conversationOptionsCount; ++i) { int color = 108; if ((_mousePosY > y && _mousePosY < y + 11) || _nextTableToLoadIndex == i) { @@ -1431,11 +1461,11 @@ void TuckerEngine::drawConversationTexts() { drawSpeechText(0, y, _characterSpeechDataPtr, _instructionsActionsTable[i], color); if (_mousePosY > y && _mousePosY < _conversationOptionLinesCount * 10 + y + 1) { _nextTableToLoadIndex = i; - flag = 1; + flag = true; } y += _conversationOptionLinesCount * 10; } - if (flag == 0) { + if (!flag) { _nextTableToLoadIndex = -1; } } @@ -1471,31 +1501,31 @@ void TuckerEngine::updateGameHints() { if (_gameHintsIndex == 0 && _flagsTable[3] > 0) { _gameHintsIndex = 1; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } else if (_gameHintsIndex == 1 && _flagsTable[12] > 0) { _gameHintsIndex = 2; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } else if (_gameHintsIndex == 2 && _flagsTable[20] > 0) { _gameHintsIndex = 3; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } else if (_gameHintsIndex == 3 && _flagsTable[9] > 0) { _gameHintsIndex = 4; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } else if (_gameHintsIndex == 4 && _flagsTable[23] > 0) { _gameHintsIndex = 5; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } else if (_flagsTable[19] > 0) { _gameHintsIndex = 6; _gameHintsCounter = 0; - _gameHintsDisplayText = 0; + _displayHintsText = false; } ++_gameHintsCounter; if (_gameHintsCounter > 1500) { - _gameHintsDisplayText = 1; + _displayHintsText = true; } } @@ -1503,7 +1533,7 @@ void TuckerEngine::startCharacterSounds() { if (_characterSoundFxDelayCounter != 0) { --_characterSoundFxDelayCounter; if (_characterSoundFxDelayCounter <= 0) { - startSound(_locationSoundsTable[_characterSoundFxNum].offset, _characterSoundFxNum, _locationSoundsTable[_characterSoundFxNum].volume); + startSound(_locationSoundsTable[_characterSoundFxNum]._offset, _characterSoundFxNum, _locationSoundsTable[_characterSoundFxNum]._volume); } } } @@ -1513,16 +1543,16 @@ void TuckerEngine::updateSoundsTypes3_4() { return; } for (int i = 0; i < _locationSoundsCount; ++i) { - switch (_locationSoundsTable[i].type) { + switch (_locationSoundsTable[i]._type) { case 3: if (getRandomNumber() >= 32300) { - startSound(_locationSoundsTable[i].offset, 0, _locationSoundsTable[i].volume); + startSound(_locationSoundsTable[i]._offset, 0, _locationSoundsTable[i]._volume); return; } break; case 4: if (getRandomNumber() >= 32763) { - startSound(_locationSoundsTable[i].offset, 0, _locationSoundsTable[i].volume); + startSound(_locationSoundsTable[i]._offset, 0, _locationSoundsTable[i]._volume); return; } break; @@ -1532,11 +1562,11 @@ void TuckerEngine::updateSoundsTypes3_4() { void TuckerEngine::drawData3() { for (int i = 0; i < _locationAnimationsCount; ++i) { - if (_locationAnimationsTable[i].drawFlag != 0) { - int num = _locationAnimationsTable[i].graphicNum; + if (_locationAnimationsTable[i]._drawFlag) { + int num = _locationAnimationsTable[i]._graphicNum; const Data *d = &_dataTable[num]; - Graphics::decodeRLE(_locationBackgroundGfxBuf + d->yDest * 640 + d->xDest, _data3GfxBuf + d->sourceOffset, d->xSize, d->ySize); - addDirtyRect(d->xDest, d->yDest, d->xSize, d->ySize); + Graphics::decodeRLE(_locationBackgroundGfxBuf + d->_yDest * 640 + d->_xDest, _data3GfxBuf + d->_sourceOffset, d->_xSize, d->_ySize); + addDirtyRect(d->_xDest, d->_yDest, d->_xSize, d->_ySize); } } } @@ -1750,28 +1780,28 @@ void TuckerEngine::drawCurrentSprite() { // Workaround original game glitch: location 14 contains some colors from [0xE0-0xF8] in a walkable area (tracker item #3106542) const bool color248Only = (_locationNum == 14); SpriteFrame *chr = &_spriteFramesTable[_currentSpriteAnimationFrame]; - int yPos = _yPosCurrent + _mainSpritesBaseOffset - 54 + chr->yOffset; + int yPos = _yPosCurrent + _mainSpritesBaseOffset - 54 + chr->_yOffset; int xPos = _xPosCurrent; - if (_mirroredDrawing == 0) { - xPos += chr->xOffset - 14; + if (!_mirroredDrawing) { + xPos += chr->_xOffset - 14; } else { - xPos -= chr->xSize + chr->xOffset - 14; + xPos -= chr->_xSize + chr->_xOffset - 14; } - Graphics::decodeRLE_248(_locationBackgroundGfxBuf + yPos * 640 + xPos, _spritesGfxBuf + chr->sourceOffset, chr->xSize, chr->ySize, - chr->yOffset, _locationHeightTable[_locationNum], _mirroredDrawing != 0, color248Only); - addDirtyRect(xPos, yPos, chr->xSize, chr->ySize); + Graphics::decodeRLE_248(_locationBackgroundGfxBuf + yPos * 640 + xPos, _spritesGfxBuf + chr->_sourceOffset, chr->_xSize, chr->_ySize, + chr->_yOffset, _locationHeightTable[_locationNum], _mirroredDrawing, color248Only); + addDirtyRect(xPos, yPos, chr->_xSize, chr->_ySize); if (_currentSpriteAnimationLength > 1) { SpriteFrame *chr2 = &_spriteFramesTable[_currentSpriteAnimationFrame2]; - yPos = _yPosCurrent + _mainSpritesBaseOffset - 54 + chr2->yOffset; + yPos = _yPosCurrent + _mainSpritesBaseOffset - 54 + chr2->_yOffset; xPos = _xPosCurrent; - if (_mirroredDrawing == 0) { - xPos += chr2->xOffset - 14; + if (!_mirroredDrawing) { + xPos += chr2->_xOffset - 14; } else { - xPos -= chr2->xSize + chr2->xOffset - 14; + xPos -= chr2->_xSize + chr2->_xOffset - 14; } - Graphics::decodeRLE_248(_locationBackgroundGfxBuf + yPos * 640 + xPos, _spritesGfxBuf + chr2->sourceOffset, chr2->xSize, chr2->ySize, - chr2->yOffset, _locationHeightTable[_locationNum], _mirroredDrawing != 0, color248Only); - addDirtyRect(xPos, yPos, chr2->xSize, chr2->ySize); + Graphics::decodeRLE_248(_locationBackgroundGfxBuf + yPos * 640 + xPos, _spritesGfxBuf + chr2->_sourceOffset, chr2->_xSize, chr2->_ySize, + chr2->_yOffset, _locationHeightTable[_locationNum], _mirroredDrawing, color248Only); + addDirtyRect(xPos, yPos, chr2->_xSize, chr2->_ySize); } } @@ -1790,8 +1820,8 @@ void TuckerEngine::setVolumeMusic(int index, int volume) { } void TuckerEngine::startSound(int offset, int index, int volume) { - bool loop = (_locationSoundsTable[index].type == 2 || _locationSoundsTable[index].type == 5 || _locationSoundsTable[index].type == 7); - loadSound(Audio::Mixer::kSFXSoundType, _locationSoundsTable[index].num, volume, loop, &_sfxHandles[index]); + bool loop = (_locationSoundsTable[index]._type == 2 || _locationSoundsTable[index]._type == 5 || _locationSoundsTable[index]._type == 7); + loadSound(Audio::Mixer::kSFXSoundType, _locationSoundsTable[index]._num, volume, loop, &_sfxHandles[index]); } void TuckerEngine::stopSound(int index) { @@ -1803,8 +1833,8 @@ bool TuckerEngine::isSoundPlaying(int index) { } void TuckerEngine::startMusic(int offset, int index, int volume) { - bool loop = (_locationMusicsTable[index].flag == 2); - loadSound(Audio::Mixer::kMusicSoundType, _locationMusicsTable[index].num, volume, loop, &_musicHandles[index]); + bool loop = (_locationMusicsTable[index]._flag == 2); + loadSound(Audio::Mixer::kMusicSoundType, _locationMusicsTable[index]._num, volume, loop, &_musicHandles[index]); } void TuckerEngine::stopMusic(int index) { @@ -1831,14 +1861,16 @@ void TuckerEngine::rememberSpeechSound() { } void TuckerEngine::redrawPanelItems() { - const uint8 *src = 0; - uint8 *dst = 0; - int sz = 0; if (_forceRedrawPanelItems || (_redrawPanelItemsCounter != 0 && _panelState == 0)) { _forceRedrawPanelItems = false; if (_redrawPanelItemsCounter > 0) { --_redrawPanelItemsCounter; } + + const uint8 *src = nullptr; + uint8 *dst = nullptr; + int sz = 0; + switch (_panelState) { case 0: src = _panelGfxBuf; @@ -1892,25 +1924,25 @@ void TuckerEngine::redrawPanelItemsHelper() { void TuckerEngine::drawSprite(int num) { Sprite *s = &_spritesTable[num]; - if (s->animationFrame <= s->firstFrame && s->animationFrame > 0 && s->state != -1) { - const uint8 *p = s->animationData; + if (s->_animationFrame <= s->_firstFrame && s->_animationFrame > 0 && s->_state != -1) { + const uint8 *p = s->_animationData; if (!p) { return; } - int frameOffset = READ_LE_UINT24(p + s->animationFrame * 4); + int frameOffset = READ_LE_UINT24(p + s->_animationFrame * 4); int srcW = READ_LE_UINT16(p + frameOffset); int srcH = READ_LE_UINT16(p + frameOffset + 2); int srcX = READ_LE_UINT16(p + frameOffset + 8); int srcY = READ_LE_UINT16(p + frameOffset + 10); - int xPos = s->gfxBackgroundOffset + srcX; + int xPos = s->_gfxBackgroundOffset + srcX; if (xPos < 600 && (_scrollOffset + 320 < xPos || _scrollOffset - srcW > xPos)) { return; } - s->xSource = srcX; - s->gfxBackgroundOffset += s->backgroundOffset; + s->_xSource = srcX; + s->_gfxBackgroundOffset += s->_backgroundOffset; uint8 *dstPtr = _locationBackgroundGfxBuf + srcY * 640 + xPos; const uint8 *srcPtr = p + frameOffset + 12; - switch (s->colorType) { + switch (s->_colorType) { case 0: Graphics::decodeRLE(dstPtr, srcPtr, srcW, srcH); break; @@ -1918,11 +1950,11 @@ void TuckerEngine::drawSprite(int num) { Graphics::decodeRLE_224(dstPtr, srcPtr, srcW, srcH); break; default: - Graphics::decodeRLE_248(dstPtr, srcPtr, srcW, srcH, 0, s->yMaxBackground, s->flipX != 0); + Graphics::decodeRLE_248(dstPtr, srcPtr, srcW, srcH, 0, s->_yMaxBackground, s->_flipX); break; } - const int xR = srcX + (s->gfxBackgroundOffset % 640); - const int yR = srcY + (s->gfxBackgroundOffset / 640); + const int xR = srcX + (s->_gfxBackgroundOffset % 640); + const int yR = srcY + (s->_gfxBackgroundOffset / 640); addDirtyRect(xR, yR, srcW, srcH); } } @@ -1938,7 +1970,7 @@ void TuckerEngine::drawPausedInfoBar() { } const uint8 *TuckerEngine::getStringBuf(int type) const { - const uint8 *p = 0; + const uint8 *p = nullptr; switch (type) { case 0: p = _data5Buf; @@ -2031,7 +2063,7 @@ void TuckerEngine::updateCharacterAnimation() { ++_spriteAnimationFrameIndex; } _characterFacingDirection = 0; - if (_changeBackgroundSprite == 1) { + if (_changeBackgroundSprite) { if (_backgroundSpriteCurrentFrame == 0) { _backgroundSpriteDataPtr = _sprA02Table[_backgroundSpriteCurrentAnimation]; _backgroundSpriteCurrentFrame = _backgroundSpriteLastFrame = READ_LE_UINT16(_backgroundSpriteDataPtr); @@ -2040,7 +2072,7 @@ void TuckerEngine::updateCharacterAnimation() { if (_backgroundSpriteCurrentFrame < 1) { _backgroundSpriteCurrentAnimation = -1; _backgroundSpriteCurrentFrame = 0; - _changeBackgroundSprite = 0; + _changeBackgroundSprite = false; if (_nextAction == 0) { setCursorType(0); } @@ -2052,7 +2084,7 @@ void TuckerEngine::updateCharacterAnimation() { assert(_backgroundSpriteCurrentAnimation >= 0 && _backgroundSpriteCurrentAnimation < kSprA02TableSize); _backgroundSpriteDataPtr = _sprA02Table[_backgroundSpriteCurrentAnimation]; _backgroundSpriteLastFrame = READ_LE_UINT16(_backgroundSpriteDataPtr); - } else if (_locationNum == 25 && _panelLockedFlag != 1 && (_backgroundSpriteCurrentAnimation == 3 || _backgroundSpriteCurrentAnimation == 6)) { + } else if (_locationNum == 25 && !_panelLockedFlag && (_backgroundSpriteCurrentAnimation == 3 || _backgroundSpriteCurrentAnimation == 6)) { _backgroundSpriteCurrentFrame = 0; _backgroundSpriteCurrentAnimation = -1; } else { @@ -2068,9 +2100,9 @@ void TuckerEngine::updateCharacterAnimation() { } } if (_locationNum == 24 && _flagsTable[103] == 0) { - if (_panelLockedFlag == 1) { - _panelLockedFlag = 0; - _selectedObject.locationObject_locationNum = 0; + if (_panelLockedFlag) { + _panelLockedFlag = false; + _selectedObject._locationObjectLocationNum = 0; if (_actionVerb != 2) { _speechSoundNum = 2236; startSpeechSound(_speechSoundNum, _speechVolume); @@ -2105,10 +2137,10 @@ void TuckerEngine::updateCharacterAnimation() { } } else if (_locationNum == 25) { if (_backgroundSpriteCurrentFrame == 0) { - if (_characterBackFrontFacing == 0) { + if (!_characterBackFrontFacing) { if (_characterBackFrontFacing != _characterPrevBackFrontFacing) { _backgroundSpriteCurrentAnimation = 10; - } else if (_panelLockedFlag == 1) { + } else if (_panelLockedFlag) { _backgroundSpriteCurrentAnimation = 3; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 99) { _backgroundSpriteCurrentAnimation = 8; @@ -2118,7 +2150,7 @@ void TuckerEngine::updateCharacterAnimation() { } else { if (_characterBackFrontFacing != _characterPrevBackFrontFacing) { _backgroundSpriteCurrentAnimation = 2; - } else if (_panelLockedFlag == 1) { + } else if (_panelLockedFlag) { _backgroundSpriteCurrentAnimation = 6; } else if (_charSpeechSoundCounter > 0 && _actionCharacterNum == 99) { _backgroundSpriteCurrentAnimation = 9; @@ -2143,7 +2175,7 @@ void TuckerEngine::updateCharacterAnimation() { _backgroundSpriteLastFrame = READ_LE_UINT16(_backgroundSpriteDataPtr); } int frame = _spriteAnimationFramesTable[_spriteAnimationFrameIndex]; - if (_panelLockedFlag == 0 && _characterFacingDirection < 5 && _selectedObject.locationObject_locationNum == 0) { + if (!_panelLockedFlag && _characterFacingDirection < 5 && _selectedObject._locationObjectLocationNum == 0) { _characterFacingDirection = 0; } if (_charSpeechSoundCounter > 0 && _characterFacingDirection != 6 && _actionCharacterNum == 99) { @@ -2155,7 +2187,7 @@ void TuckerEngine::updateCharacterAnimation() { } int num = 0; if (frame == 999 || (_characterFacingDirection != _characterPrevFacingDirection && _characterFacingDirection < 5)) { - _mirroredDrawing = 0; + _mirroredDrawing = false; if (_characterFacingDirection == 6) { if (_csDataHandled) { switch (_selectedCharacterDirection) { @@ -2170,7 +2202,7 @@ void TuckerEngine::updateCharacterAnimation() { break; default: num = 16; - _mirroredDrawing = 1; + _mirroredDrawing = true; break; } } else { @@ -2182,7 +2214,7 @@ void TuckerEngine::updateCharacterAnimation() { } if (_characterFacingDirection == 0) { if (_csDataHandled) { - _mirroredDrawing = 0; + _mirroredDrawing = false; switch (_selectedCharacterDirection) { case 1: num = 3; @@ -2192,7 +2224,7 @@ void TuckerEngine::updateCharacterAnimation() { break; case 3: num = 1; - _mirroredDrawing = 1; + _mirroredDrawing = true; break; default: num = 5; @@ -2218,21 +2250,21 @@ void TuckerEngine::updateCharacterAnimation() { break; case 3: num = 0; - _mirroredDrawing = 1; + _mirroredDrawing = true; break; case 4: num = 2; break; } } - _currentSpriteAnimationLength = _spriteAnimationsTable[num].numParts; - _spriteAnimationFrameIndex = _spriteAnimationsTable[num].firstFrameIndex; + _currentSpriteAnimationLength = _spriteAnimationsTable[num]._numParts; + _spriteAnimationFrameIndex = _spriteAnimationsTable[num]._firstFrameIndex; frame = _spriteAnimationFramesTable[_spriteAnimationFrameIndex]; } if (_characterAnimationNum > 0) { num = _characterAnimationNum; - _currentSpriteAnimationLength = _spriteAnimationsTable[num].numParts; - _spriteAnimationFrameIndex = _spriteAnimationsTable[num].firstFrameIndex; + _currentSpriteAnimationLength = _spriteAnimationsTable[num]._numParts; + _spriteAnimationFrameIndex = _spriteAnimationsTable[num]._firstFrameIndex; frame = _spriteAnimationFramesTable[_spriteAnimationFrameIndex]; _characterAnimationNum = 0; } @@ -2287,10 +2319,10 @@ void TuckerEngine::handleMap() { if (_handleMapCounter > 19) { _handleMapCounter = 0; _locationMaskCounter = 1; - _panelLockedFlag = 0; + _panelLockedFlag = false; } } - if (_panelLockedFlag == 0 && (_backgroundSpriteCurrentAnimation == -1 || _locationNum == 25) && _locationMaskType == 3) { + if (!_panelLockedFlag && (_backgroundSpriteCurrentAnimation == -1 || _locationNum == 25) && _locationMaskType == 3) { setCursorType(0); if (_locationMaskCounter == 1) { _characterFacingDirection = 0; @@ -2298,22 +2330,22 @@ void TuckerEngine::handleMap() { } return; } - if (_selectedObject.locationObject_locationNum != 0 && _locationMaskCounter != 0 && (_backgroundSpriteCurrentAnimation <= -1 || _locationNum == 25)) { + if (_selectedObject._locationObjectLocationNum != 0 && _locationMaskCounter != 0 && (_backgroundSpriteCurrentAnimation <= -1 || _locationNum == 25)) { if (_locationNum == 25 || _backgroundSpriteCurrentAnimation != 4) { if (_locationMaskType == 0) { _locationMaskType = 1; setCursorType(2); - if (_selectedObject.locationObject_toWalkX2 > 800) { - _backgroundSpriteCurrentAnimation = _selectedObject.locationObject_toWalkX2 - 900; - if (_selectedObject.locationObject_toWalkY2 > 499) { - _changeBackgroundSprite = 1; - _backgroundSprOffset = _selectedObject.locationObject_toWalkY2 - 500; + if (_selectedObject._locationObjectToWalkX2 > 800) { + _backgroundSpriteCurrentAnimation = _selectedObject._locationObjectToWalkX2 - 900; + if (_selectedObject._locationObjectToWalkY2 > 499) { + _changeBackgroundSprite = true; + _backgroundSprOffset = _selectedObject._locationObjectToWalkY2 - 500; } else { - _backgroundSprOffset = _selectedObject.locationObject_toWalkY2; - _changeBackgroundSprite = 0; + _backgroundSprOffset = _selectedObject._locationObjectToWalkY2; + _changeBackgroundSprite = false; } _backgroundSpriteCurrentFrame = 0; - _mirroredDrawing = 0; + _mirroredDrawing = false; if (_locationNum == 25) { _backgroundSpriteDataPtr = _sprA02Table[_backgroundSpriteCurrentAnimation]; _backgroundSpriteLastFrame = READ_LE_UINT16(_backgroundSpriteDataPtr); @@ -2321,17 +2353,17 @@ void TuckerEngine::handleMap() { } } else { _locationMaskCounter = 0; - _selectedObject.xPos = _selectedObject.locationObject_toWalkX2; - _selectedObject.yPos = _selectedObject.locationObject_toWalkY2; + _selectedObject._xPos = _selectedObject._locationObjectToWalkX2; + _selectedObject._yPos = _selectedObject._locationObjectToWalkY2; _handleMapCounter = 1; - _panelLockedFlag = 1; + _panelLockedFlag = true; } return; } _locationMaskType = 2; _panelState = 0; setCursorType(0); - if (_selectedObject.locationObject_locationNum == 99) { + if (_selectedObject._locationObjectLocationNum == 99) { _noPositionChangeAfterMap = true; handleMapSequence(); return; @@ -2341,28 +2373,28 @@ void TuckerEngine::handleMap() { redrawScreen(_scrollOffset); _fadePaletteCounter = 34; } - _nextLocationNum = _selectedObject.locationObject_locationNum; - _xPosCurrent = _selectedObject.locationObject_toX; - _yPosCurrent = _selectedObject.locationObject_toY; - if (_selectedObject.locationObject_toX2 > 800) { - _backgroundSpriteCurrentAnimation = _selectedObject.locationObject_toX2 - 900; - if (_selectedObject.locationObject_toY2 > 499) { - _changeBackgroundSprite = 1; - _backgroundSprOffset = _selectedObject.locationObject_toY2 - 500; + _nextLocationNum = _selectedObject._locationObjectLocationNum; + _xPosCurrent = _selectedObject._locationObjectToX; + _yPosCurrent = _selectedObject._locationObjectToY; + if (_selectedObject._locationObjectToX2 > 800) { + _backgroundSpriteCurrentAnimation = _selectedObject._locationObjectToX2 - 900; + if (_selectedObject._locationObjectToY2 > 499) { + _changeBackgroundSprite = true; + _backgroundSprOffset = _selectedObject._locationObjectToY2 - 500; } else { - _changeBackgroundSprite = 0; - _backgroundSprOffset = _selectedObject.locationObject_toY2; + _changeBackgroundSprite = false; + _backgroundSprOffset = _selectedObject._locationObjectToY2; } _backgroundSpriteCurrentFrame = 0; } else { - _selectedObject.xPos = _selectedObject.locationObject_toX2; - _selectedObject.yPos = _selectedObject.locationObject_toY2; - _panelLockedFlag = 1; + _selectedObject._xPos = _selectedObject._locationObjectToX2; + _selectedObject._yPos = _selectedObject._locationObjectToY2; + _panelLockedFlag = true; } _scrollOffset = 0; _handleMapCounter = 0; _locationMaskCounter = 0; - _selectedObject.locationObject_locationNum = 0; + _selectedObject._locationObjectLocationNum = 0; } } } @@ -2370,79 +2402,79 @@ void TuckerEngine::handleMap() { void TuckerEngine::clearSprites() { memset(_spritesTable, 0, sizeof(_spritesTable)); for (int i = 0; i < kMaxCharacters; ++i) { - _spritesTable[i].state = -1; - _spritesTable[i].stateIndex = -1; + _spritesTable[i]._state = -1; + _spritesTable[i]._stateIndex = -1; } } void TuckerEngine::updateSprites() { const int count = (_locationNum == 9) ? 3 : _spritesCount; for (int i = 0; i < count; ++i) { - if (_spritesTable[i].stateIndex > -1) { - ++_spritesTable[i].stateIndex; - if (_characterStateTable[_spritesTable[i].stateIndex] == 99) { - _spritesTable[i].stateIndex = -1; - _spritesTable[i].state = -1; + if (_spritesTable[i]._stateIndex > -1) { + ++_spritesTable[i]._stateIndex; + if (_characterStateTable[_spritesTable[i]._stateIndex] == 99) { + _spritesTable[i]._stateIndex = -1; + _spritesTable[i]._state = -1; updateSprite(i); } else { - _spritesTable[i].animationFrame = _characterStateTable[_spritesTable[i].stateIndex]; + _spritesTable[i]._animationFrame = _characterStateTable[_spritesTable[i]._stateIndex]; } continue; } - if (_spritesTable[i].state == -1) { + if (_spritesTable[i]._state == -1) { updateSprite(i); continue; } - if (_charSpeechSoundCounter > 0 && i == _actionCharacterNum && _spritesTable[i].needUpdate == 0) { + if (_charSpeechSoundCounter > 0 && i == _actionCharacterNum && !_spritesTable[i]._needUpdate) { updateSprite(i); continue; } - if (_charSpeechSoundCounter == 0 && _spritesTable[i].needUpdate > 0) { + if (_charSpeechSoundCounter == 0 && _spritesTable[i]._needUpdate) { updateSprite(i); continue; } - if (_spritesTable[i].updateDelay > 0) { - --_spritesTable[i].updateDelay; - if (_spritesTable[i].updateDelay == 0) { + if (_spritesTable[i]._updateDelay > 0) { + --_spritesTable[i]._updateDelay; + if (_spritesTable[i]._updateDelay == 0) { updateSprite(i); } continue; } - if (_spritesTable[i].defaultUpdateDelay > 0) { - _spritesTable[i].updateDelay = _spritesTable[i].defaultUpdateDelay - 1; - ++_spritesTable[i].animationFrame; - if (_spritesTable[i].animationFrame == _spritesTable[i].firstFrame) { + if (_spritesTable[i]._defaultUpdateDelay > 0) { + _spritesTable[i]._updateDelay = _spritesTable[i]._defaultUpdateDelay - 1; + ++_spritesTable[i]._animationFrame; + if (_spritesTable[i]._animationFrame == _spritesTable[i]._firstFrame) { updateSprite(i); } continue; } - if (_spritesTable[i].nextAnimationFrame == 0) { - ++_spritesTable[i].animationFrame; - if (_spritesTable[i].firstFrame - 1 < _spritesTable[i].animationFrame) { - if (_spritesTable[i].prevAnimationFrame == 1) { - --_spritesTable[i].animationFrame; - _spritesTable[i].nextAnimationFrame = 1; + if (!_spritesTable[i]._nextAnimationFrame) { + ++_spritesTable[i]._animationFrame; + if (_spritesTable[i]._firstFrame - 1 < _spritesTable[i]._animationFrame) { + if (_spritesTable[i]._prevAnimationFrame) { + --_spritesTable[i]._animationFrame; + _spritesTable[i]._nextAnimationFrame = true; } else { updateSprite(i); } } continue; } - --_spritesTable[i].animationFrame; - if (_spritesTable[i].animationFrame == 0) { + --_spritesTable[i]._animationFrame; + if (_spritesTable[i]._animationFrame == 0) { updateSprite(i); } } } void TuckerEngine::updateSprite(int i) { - _spritesTable[i].prevState = _spritesTable[i].state; - _spritesTable[i].prevAnimationFrame = 0; - _spritesTable[i].nextAnimationFrame = 0; - _updateSpriteFlag1 = 0; - _updateSpriteFlag2 = 0; - _spritesTable[i].defaultUpdateDelay = 0; - _spritesTable[i].updateDelay = 0; + _spritesTable[i]._prevState = _spritesTable[i]._state; + _spritesTable[i]._prevAnimationFrame = false; + _spritesTable[i]._nextAnimationFrame = false; + _updateSpriteFlag1 = false; + _updateSpriteFlag2 = false; + _spritesTable[i]._defaultUpdateDelay = 0; + _spritesTable[i]._updateDelay = 0; switch (_locationNum) { case 2: updateSprite_locationNum2(); @@ -2632,7 +2664,7 @@ void TuckerEngine::updateSprite(int i) { if (i == 0) { updateSprite_locationNum32_0(0); } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } break; case 33: @@ -2643,7 +2675,7 @@ void TuckerEngine::updateSprite(int i) { } else if (i == 2) { updateSprite_locationNum33_2(2); } else { - _spritesTable[i].state = 12; + _spritesTable[i]._state = 12; } break; case 34: @@ -2654,7 +2686,7 @@ void TuckerEngine::updateSprite(int i) { break; case 37: if (i == 0) { - _spritesTable[0].state = -1; + _spritesTable[0]._state = -1; } else { updateSprite_locationNum37(i); } @@ -2670,9 +2702,9 @@ void TuckerEngine::updateSprite(int i) { updateSprite_locationNum43_2(i); } else if (i < 2) { if (_flagsTable[236] < 4) { - _spritesTable[i].state = i + 1; + _spritesTable[i]._state = i + 1; } else { - _spritesTable[i].state = -1; + _spritesTable[i]._state = -1; } } else if (i == 3) { updateSprite_locationNum43_3(3); @@ -2685,10 +2717,10 @@ void TuckerEngine::updateSprite(int i) { } break; case 45: - _spritesTable[0].state = 1; + _spritesTable[0]._state = 1; break; case 47: - _spritesTable[i].state = i + 1; + _spritesTable[i]._state = i + 1; break; case 48: updateSprite_locationNum48(0); @@ -2700,7 +2732,7 @@ void TuckerEngine::updateSprite(int i) { if (i < 6) { updateSprite_locationNum50(i); } else { - _spritesTable[i].state = i + 1; + _spritesTable[i]._state = i + 1; } break; case 51: @@ -2782,7 +2814,7 @@ void TuckerEngine::updateSprite(int i) { break; case 69: if (i == 0) { - _spritesTable[0].state = 1; + _spritesTable[0]._state = 1; } else if (i == 1) { updateSprite_locationNum69_1(1); } else if (i == 2) { @@ -2814,23 +2846,23 @@ void TuckerEngine::updateSprite(int i) { updateSprite_locationNum82(0); break; case 98: - _spritesTable[0].state = 1; + _spritesTable[0]._state = 1; break; } - if (_spritesTable[i].stateIndex <= -1) { - if (_updateSpriteFlag1 == 0) { - _spritesTable[i].animationFrame = 1; + if (_spritesTable[i]._stateIndex <= -1) { + if (!_updateSpriteFlag1) { + _spritesTable[i]._animationFrame = 1; } - if (_spritesTable[i].state < 0 || !_sprC02Table[_spritesTable[i].state]) { + if (_spritesTable[i]._state < 0 || !_sprC02Table[_spritesTable[i]._state]) { // warning("Invalid state %d for sprite %d location %d", _spritesTable[i].state, i, _locationNum); return; } - _spritesTable[i].animationData = _sprC02Table[_spritesTable[i].state]; - _spritesTable[i].firstFrame = READ_LE_UINT16(_spritesTable[i].animationData); - if (_updateSpriteFlag2 == 1) { - _spritesTable[i].state = _spritesTable[i].firstFrame; - _spritesTable[i].nextAnimationFrame = 1; - _spritesTable[i].prevAnimationFrame = 1; + _spritesTable[i]._animationData = _sprC02Table[_spritesTable[i]._state]; + _spritesTable[i]._firstFrame = READ_LE_UINT16(_spritesTable[i]._animationData); + if (_updateSpriteFlag2) { + _spritesTable[i]._state = _spritesTable[i]._firstFrame; + _spritesTable[i]._nextAnimationFrame = true; + _spritesTable[i]._prevAnimationFrame = true; } } } @@ -2844,7 +2876,7 @@ void TuckerEngine::drawStringInteger(int num, int x, int y, int digits) { Graphics::drawStringChar(_locationBackgroundGfxBuf, _scrollOffset + x, y, 640, numStr[i], 102, _charsetGfxBuf); x += 8; } - addDirtyRect(_scrollOffset + x, y, Graphics::_charset.charW * 3, Graphics::_charset.charH); + addDirtyRect(_scrollOffset + x, y, Graphics::_charset._charW * 3, Graphics::_charset._charH); } void TuckerEngine::drawStringAlt(int x, int y, int color, const uint8 *str, int strLen) { @@ -2856,7 +2888,7 @@ void TuckerEngine::drawStringAlt(int x, int y, int color, const uint8 *str, int x += _charWidthTable[chr]; ++pos; } - addDirtyRect(xStart, y, x - xStart, Graphics::_charset.charH); + addDirtyRect(xStart, y, x - xStart, Graphics::_charset._charH); } void TuckerEngine::drawItemString(int x, int num, const uint8 *str) { @@ -2911,15 +2943,15 @@ void TuckerEngine::updateItemsGfxColors(int color1, int color128) { } } -int TuckerEngine::testLocationMask(int x, int y) { - if (_locationMaskType > 0 || _locationMaskIgnore > 0) { - return 1; +bool TuckerEngine::testLocationMask(int x, int y) { + if (_locationMaskType > 0 || _locationMaskIgnore) { + return true; } if (_locationNum == 26 || _locationNum == 32) { y -= 3; } const int offset = y * 640 + x; - return _locationBackgroundMaskBuf[offset] > 0 ? 1 : 0; + return (_locationBackgroundMaskBuf[offset] > 0); } int TuckerEngine::getStringWidth(int num, const uint8 *ptr) { @@ -3096,7 +3128,7 @@ int TuckerEngine::readTableInstructionParam(int len) { ++_tableInstructionsPtr; --len; } - char *end = 0; + char *end = nullptr; const int param = strtol((const char *)_tableInstructionsPtr, &end, 10); if (end != (const char *)_tableInstructionsPtr + len) { warning("Unexpected instruction parameter length %d (%d)", (int)(end - (const char *)_tableInstructionsPtr), len); @@ -3123,7 +3155,7 @@ int TuckerEngine::executeTableInstruction() { return 0; case kCode_bub: i = readTableInstructionParam(3); - _spriteAnimationFrameIndex = _spriteAnimationsTable[i].firstFrameIndex; + _spriteAnimationFrameIndex = _spriteAnimationsTable[i]._firstFrameIndex; _characterFacingDirection = 5; _mainLoopCounter2 = 0; return 0; @@ -3137,13 +3169,13 @@ int TuckerEngine::executeTableInstruction() { _selectedCharacterDirection = readTableInstructionParam(2); return 0; case kCode_bof: - _skipCurrentCharacterDraw = 1; + _skipCurrentCharacterDraw = true; return 0; case kCode_buh: _noCharacterAnimationChange = readTableInstructionParam(2); return 0; case kCode_bon: - _skipCurrentCharacterDraw = 0; + _skipCurrentCharacterDraw = false; return 0; case kCode_bso: _backgroundSprOffset = readTableInstructionParam(3); @@ -3159,24 +3191,24 @@ int TuckerEngine::executeTableInstruction() { _charSpeechSoundCounter = kDefaultCharSpeechSoundCounter; return 0; case kCode_buw: - _selectedObject.xPos = readTableInstructionParam(3); - _selectedObject.yPos = readTableInstructionParam(3); - _locationMaskIgnore = 1; - _panelLockedFlag = 1; + _selectedObject._xPos = readTableInstructionParam(3); + _selectedObject._yPos = readTableInstructionParam(3); + _locationMaskIgnore = true; + _panelLockedFlag = true; return 0; case kCode_bux: _xPosCurrent = readTableInstructionParam(3); _yPosCurrent = readTableInstructionParam(3); return 0; case kCode_c0a: - _spritesTable[index].state = readTableInstructionParam(3); - if (_spritesTable[index].state == 999) { - _spritesTable[index].state = -1; + _spritesTable[index]._state = readTableInstructionParam(3); + if (_spritesTable[index]._state == 999) { + _spritesTable[index]._state = -1; } _mainLoopCounter1 = 0; - _spritesTable[index].updateDelay = 0; - _spritesTable[index].nextAnimationFrame = 0; - _spritesTable[index].prevAnimationFrame = 0; + _spritesTable[index]._updateDelay = 0; + _spritesTable[index]._nextAnimationFrame = false; + _spritesTable[index]._prevAnimationFrame = false; return 0; case kCode_c0c: setCharacterAnimation(readTableInstructionParam(3), index); @@ -3187,7 +3219,7 @@ int TuckerEngine::executeTableInstruction() { startSpeechSound(_partNum * 3000 + _ptTextOffset + _speechSoundNum - 3000, kMaxSoundVolume); _charSpeechSoundCounter = kDefaultCharSpeechSoundCounter; _actionTextColor = 181 + index; - if (_tableInstructionFlag == 0) { + if (!_tableInstructionFlag) { _actionPosX = _tableInstructionItemNum1; _actionPosY = _tableInstructionItemNum2; } else { @@ -3210,8 +3242,8 @@ int TuckerEngine::executeTableInstruction() { return 0; case kCode_flx: i = readTableInstructionParam(2); - _locationSoundsTable[i].type = 2; - startSound(_locationSoundsTable[i].offset, i, _locationSoundsTable[i].volume); + _locationSoundsTable[i]._type = 2; + startSound(_locationSoundsTable[i]._offset, i, _locationSoundsTable[i]._volume); return 0; case kCode_fxx: i = readTableInstructionParam(2); @@ -3221,7 +3253,7 @@ int TuckerEngine::executeTableInstruction() { return 0; case kCode_fx: i = readTableInstructionParam(2); - startSound(_locationSoundsTable[i].offset, i, _locationSoundsTable[i].volume); + startSound(_locationSoundsTable[i]._offset, i, _locationSoundsTable[i]._volume); _soundInstructionIndex = i; return 0; case kCode_gfg: @@ -3284,12 +3316,12 @@ int TuckerEngine::executeTableInstruction() { _csDataLoaded = false; return 3; case kCode_ssp: - _tableInstructionFlag = 0; + _tableInstructionFlag = false; _tableInstructionItemNum1 = readTableInstructionParam(3); _tableInstructionItemNum2 = readTableInstructionParam(3); return 0; case kCode_s0p: - _tableInstructionFlag = 1; + _tableInstructionFlag = true; _tableInstructionObj1Table[index] = readTableInstructionParam(3); _tableInstructionObj2Table[index] = readTableInstructionParam(3); return 0; @@ -3380,21 +3412,21 @@ int TuckerEngine::getObjectUnderCursor() { return -1; } for (int i = 0; i < _locationObjectsCount; ++i) { - if (_mousePosX + _scrollOffset + 1 <= _locationObjectsTable[i].xPos) { + if (_mousePosX + _scrollOffset + 1 <= _locationObjectsTable[i]._xPos) { continue; } - if (_mousePosX + _scrollOffset >= _locationObjectsTable[i].xPos + _locationObjectsTable[i].xSize) { + if (_mousePosX + _scrollOffset >= _locationObjectsTable[i]._xPos + _locationObjectsTable[i]._xSize) { continue; } - if (_mousePosY <= _locationObjectsTable[i].yPos) { + if (_mousePosY <= _locationObjectsTable[i]._yPos) { continue; } - if (_mousePosY >= _locationObjectsTable[i].yPos + _locationObjectsTable[i].ySize) { + if (_mousePosY >= _locationObjectsTable[i]._yPos + _locationObjectsTable[i]._ySize) { continue; } _selectedObjectType = 0; _selectedCharacterNum = i; - setCursorNum(_locationObjectsTable[i].cursorNum); + setCursorNum(_locationObjectsTable[i]._cursorNum); return i; } return -1; @@ -3405,127 +3437,127 @@ void TuckerEngine::setSelectedObjectKey() { if (_mousePosY > 139 && _nextAction == 0) { return; } - _panelLockedFlag = 1; + _panelLockedFlag = true; _locationMaskCounter = 0; _actionRequiresTwoObjects = false; - _selectedObject.yPos = 0; - _selectedObject.locationObject_locationNum = 0; + _selectedObject._yPos = 0; + _selectedObject._locationObjectLocationNum = 0; _pendingActionIndex = 0; if (_selectedObjectType == 0) { if (_selectedObjectNum == 0) { - _selectedObject.xPos = x; - _selectedObject.yPos = _mousePosY; + _selectedObject._xPos = x; + _selectedObject._yPos = _mousePosY; } else { - _selectedObject.xPos = _locationObjectsTable[_selectedCharacterNum].standX; - _selectedObject.yPos = _locationObjectsTable[_selectedCharacterNum].standY; + _selectedObject._xPos = _locationObjectsTable[_selectedCharacterNum]._standX; + _selectedObject._yPos = _locationObjectsTable[_selectedCharacterNum]._standY; if (_actionVerb == 0 || _actionVerb == 8) { - _selectedObject.locationObject_locationNum = _locationObjectsTable[_selectedCharacterNum].locationNum; - _selectedObject.locationObject_toX = _locationObjectsTable[_selectedCharacterNum].toX; - _selectedObject.locationObject_toY = _locationObjectsTable[_selectedCharacterNum].toY; - _selectedObject.locationObject_toX2 = _locationObjectsTable[_selectedCharacterNum].toX2; - _selectedObject.locationObject_toY2 = _locationObjectsTable[_selectedCharacterNum].toY2; - _selectedObject.locationObject_toWalkX2 = _locationObjectsTable[_selectedCharacterNum].toWalkX2; - _selectedObject.locationObject_toWalkY2 = _locationObjectsTable[_selectedCharacterNum].toWalkY2; + _selectedObject._locationObjectLocationNum = _locationObjectsTable[_selectedCharacterNum]._locationNum; + _selectedObject._locationObjectToX = _locationObjectsTable[_selectedCharacterNum]._toX; + _selectedObject._locationObjectToY = _locationObjectsTable[_selectedCharacterNum]._toY; + _selectedObject._locationObjectToX2 = _locationObjectsTable[_selectedCharacterNum]._toX2; + _selectedObject._locationObjectToY2 = _locationObjectsTable[_selectedCharacterNum]._toY2; + _selectedObject._locationObjectToWalkX2 = _locationObjectsTable[_selectedCharacterNum]._toWalkX2; + _selectedObject._locationObjectToWalkY2 = _locationObjectsTable[_selectedCharacterNum]._toWalkY2; } } } else { switch (_selectedObjectType) { case 1: - _selectedObject.xPos = _locationAnimationsTable[_selectedCharacterNum].standX; - _selectedObject.yPos = _locationAnimationsTable[_selectedCharacterNum].standY; + _selectedObject._xPos = _locationAnimationsTable[_selectedCharacterNum]._standX; + _selectedObject._yPos = _locationAnimationsTable[_selectedCharacterNum]._standY; break; case 2: - _selectedObject.xPos = _charPosTable[_selectedCharacterNum].xWalkTo; - _selectedObject.yPos = _charPosTable[_selectedCharacterNum].yWalkTo; + _selectedObject._xPos = _charPosTable[_selectedCharacterNum]._xWalkTo; + _selectedObject._yPos = _charPosTable[_selectedCharacterNum]._yWalkTo; break; case 3: - _selectedObject.xPos = _xPosCurrent; - _selectedObject.yPos = _yPosCurrent; + _selectedObject._xPos = _xPosCurrent; + _selectedObject._yPos = _yPosCurrent; break; } } - if (_selectedObject.yPos == 0) { - _selectedObject.xPos = x; - _selectedObject.yPos = _mousePosY; + if (_selectedObject._yPos == 0) { + _selectedObject._xPos = x; + _selectedObject._yPos = _mousePosY; } - _selectedObjectLocationMask = testLocationMask(_selectedObject.xPos, _selectedObject.yPos); - if (_selectedObjectLocationMask == 0 && _objectKeysLocationTable[_locationNum] == 1) { - if (_selectedObject.yPos < _objectKeysPosYTable[_locationNum]) { - while (_selectedObjectLocationMask == 0 && _selectedObject.yPos < _objectKeysPosYTable[_locationNum]) { - ++_selectedObject.yPos; - _selectedObjectLocationMask = testLocationMask(_selectedObject.xPos, _selectedObject.yPos); + _selectedObjectLocationMask = testLocationMask(_selectedObject._xPos, _selectedObject._yPos); + if (!_selectedObjectLocationMask && _objectKeysLocationTable[_locationNum] == 1) { + if (_selectedObject._yPos < _objectKeysPosYTable[_locationNum]) { + while (!_selectedObjectLocationMask && _selectedObject._yPos < _objectKeysPosYTable[_locationNum]) { + ++_selectedObject._yPos; + _selectedObjectLocationMask = testLocationMask(_selectedObject._xPos, _selectedObject._yPos); } } else { - while (_selectedObjectLocationMask == 0 && _selectedObject.yPos < _objectKeysPosYTable[_locationNum]) { - --_selectedObject.yPos; - _selectedObjectLocationMask = testLocationMask(_selectedObject.xPos, _selectedObject.yPos); + while (!_selectedObjectLocationMask && _selectedObject._yPos < _objectKeysPosYTable[_locationNum]) { + --_selectedObject._yPos; + _selectedObjectLocationMask = testLocationMask(_selectedObject._xPos, _selectedObject._yPos); } } } - if (_selectedObjectLocationMask == 1) { - _selectedObjectLocationMask = testLocationMaskArea(_xPosCurrent, _yPosCurrent, _selectedObject.xPos, _selectedObject.yPos); - if (_selectedObjectLocationMask == 1 && _objectKeysPosXTable[_locationNum] > 0) { - _selectedObject.xDefaultPos = _selectedObject.xPos; - _selectedObject.yDefaultPos = _selectedObject.yPos; - _selectedObject.xPos = _objectKeysPosXTable[_locationNum]; - _selectedObject.yPos = _objectKeysPosYTable[_locationNum]; + if (_selectedObjectLocationMask) { + _selectedObjectLocationMask = testLocationMaskArea(_xPosCurrent, _yPosCurrent, _selectedObject._xPos, _selectedObject._yPos); + if (_selectedObjectLocationMask && _objectKeysPosXTable[_locationNum] > 0) { + _selectedObject._xDefaultPos = _selectedObject._xPos; + _selectedObject._yDefaultPos = _selectedObject._yPos; + _selectedObject._xPos = _objectKeysPosXTable[_locationNum]; + _selectedObject._yPos = _objectKeysPosYTable[_locationNum]; if (_objectKeysLocationTable[_locationNum] == 1) { - _selectedObject.xPos = _selectedObject.xDefaultPos; + _selectedObject._xPos = _selectedObject._xDefaultPos; } } } } void TuckerEngine::setCharacterAnimation(int count, int spr) { - _spritesTable[spr].animationFrame = 0; - _spritesTable[spr].stateIndex = 0; + _spritesTable[spr]._animationFrame = 0; + _spritesTable[spr]._stateIndex = 0; for (int i = 0; i < count; ++i) { - while (_characterStateTable[_spritesTable[spr].stateIndex] != 99) { - ++_spritesTable[spr].stateIndex; + while (_characterStateTable[_spritesTable[spr]._stateIndex] != 99) { + ++_spritesTable[spr]._stateIndex; } - ++_spritesTable[spr].stateIndex; + ++_spritesTable[spr]._stateIndex; } - _spritesTable[spr].state = _characterStateTable[_spritesTable[spr].stateIndex]; - ++_spritesTable[spr].stateIndex; - _spritesTable[spr].animationFrame = _characterStateTable[_spritesTable[spr].stateIndex]; - ++_spritesTable[spr].stateIndex; - _spritesTable[spr].animationData = _sprC02Table[_spritesTable[spr].state]; - _spritesTable[spr].firstFrame = READ_LE_UINT16(_spritesTable[spr].animationData); + _spritesTable[spr]._state = _characterStateTable[_spritesTable[spr]._stateIndex]; + ++_spritesTable[spr]._stateIndex; + _spritesTable[spr]._animationFrame = _characterStateTable[_spritesTable[spr]._stateIndex]; + ++_spritesTable[spr]._stateIndex; + _spritesTable[spr]._animationData = _sprC02Table[_spritesTable[spr]._state]; + _spritesTable[spr]._firstFrame = READ_LE_UINT16(_spritesTable[spr]._animationData); } -int TuckerEngine::testLocationMaskArea(int xBase, int yBase, int xPos, int yPos) { +bool TuckerEngine::testLocationMaskArea(int xBase, int yBase, int xPos, int yPos) { while (true) { bool loop = false; if (yBase > yPos) { - if (testLocationMask(xBase, yBase - 1) == 1) { + if (testLocationMask(xBase, yBase - 1)) { --yBase; loop = true; } } else if (yBase < yPos) { - if (testLocationMask(xBase, yBase + 1) == 1) { + if (testLocationMask(xBase, yBase + 1)) { ++yBase; loop = true; } } if (xBase > xPos) { - if (testLocationMask(xBase - 1, yBase) == 1) { + if (testLocationMask(xBase - 1, yBase)) { --xBase; loop = true; } } else if (xBase < xPos) { - if (testLocationMask(xBase + 1, yBase) == 1) { + if (testLocationMask(xBase + 1, yBase)) { ++xBase; loop = true; } } if (xBase == xPos && yBase == yPos) { - return 0; + return false; } if (!loop) { break; } } - return 1; + return true; } void TuckerEngine::handleMouseClickOnInventoryObject() { @@ -3548,7 +3580,7 @@ void TuckerEngine::handleMouseClickOnInventoryObject() { _selectedObjectType = 0; _selectedObjectNum = 0; _actionVerb = 0; - _actionVerbLocked = 0; + _actionVerbLocked = false; _forceRedrawPanelItems = true; _panelState = 2; setCursorType(1); @@ -3573,7 +3605,7 @@ void TuckerEngine::handleMouseClickOnInventoryObject() { _actionVerb = 0; _selectedObjectType = 0; _selectedObjectNum = 0; - _actionVerbLocked = 0; + _actionVerbLocked = false; } } break; @@ -3585,23 +3617,23 @@ int TuckerEngine::setCharacterUnderCursor() { return -1; } for (int i = 0; i < _charPosCount; ++i) { - if (_mousePosX + _scrollOffset <= _charPosTable[i].xPos) { + if (_mousePosX + _scrollOffset <= _charPosTable[i]._xPos) { continue; } - if (_mousePosX + _scrollOffset >= _charPosTable[i].xPos + _charPosTable[i].xSize) { + if (_mousePosX + _scrollOffset >= _charPosTable[i]._xPos + _charPosTable[i]._xSize) { continue; } - if (_mousePosY <= _charPosTable[i].yPos) { + if (_mousePosY <= _charPosTable[i]._yPos) { continue; } - if (_mousePosY >= _charPosTable[i].yPos + _charPosTable[i].ySize) { + if (_mousePosY >= _charPosTable[i]._yPos + _charPosTable[i]._ySize) { continue; } - if (_charPosTable[i].flagNum == 0 || _flagsTable[_charPosTable[i].flagNum] == _charPosTable[i].flagValue) { + if (_charPosTable[i]._flagNum == 0 || _flagsTable[_charPosTable[i]._flagNum] == _charPosTable[i]._flagValue) { _selectedObjectType = 2; - _selectedCharacterDirection = _charPosTable[i].direction; + _selectedCharacterDirection = _charPosTable[i]._direction; _selectedCharacterNum = i; - return _charPosTable[i].name; + return _charPosTable[i]._name; } } return -1; @@ -3612,29 +3644,29 @@ int TuckerEngine::setLocationAnimationUnderCursor() { return -1; } for (int i = _locationAnimationsCount - 1; i >= 0; --i) { - if (_locationAnimationsTable[i].drawFlag == 0) { + if (!_locationAnimationsTable[i]._drawFlag) continue; - } - int num = _locationAnimationsTable[i].graphicNum; - if (_mousePosX + _scrollOffset + 1 <= _dataTable[num].xDest) { + + int num = _locationAnimationsTable[i]._graphicNum; + if (_mousePosX + _scrollOffset + 1 <= _dataTable[num]._xDest) { continue; } - if (_mousePosX + _scrollOffset >= _dataTable[num].xDest + _dataTable[num].xSize) { + if (_mousePosX + _scrollOffset >= _dataTable[num]._xDest + _dataTable[num]._xSize) { continue; } - if (_mousePosY <= _dataTable[num].yDest) { + if (_mousePosY <= _dataTable[num]._yDest) { continue; } - if (_mousePosY >= _dataTable[num].yDest + _dataTable[num].ySize) { + if (_mousePosY >= _dataTable[num]._yDest + _dataTable[num]._ySize) { continue; } - if (_locationAnimationsTable[i].selectable == 0) { + if (_locationAnimationsTable[i]._selectable == 0) { return -1; } _selectedObjectType = 1; _selectedCharacterNum = i; _selectedCharacter2Num = i; - return _locationAnimationsTable[i].selectable; + return _locationAnimationsTable[i]._selectable; } return -1; } @@ -3642,14 +3674,14 @@ int TuckerEngine::setLocationAnimationUnderCursor() { void TuckerEngine::setActionForInventoryObject() { if (_actionVerb == 0 || _actionVerb == 2 || _actionVerb == 6 || _actionVerb == 7) { playSpeechForAction(_actionVerb); - _actionVerbLocked = 0; + _actionVerbLocked = false; _actionRequiresTwoObjects = false; return; } if (_actionVerb == 3 || _actionVerb == 4) { if (!(_partNum == 2 && _selectedObjectNum == 19) && !(_partNum == 3 && _selectedObjectNum == 42)) { playSpeechForAction(_actionVerb); - _actionVerbLocked = 0; + _actionVerbLocked = false; _actionRequiresTwoObjects = false; return; } @@ -3659,13 +3691,13 @@ void TuckerEngine::setActionForInventoryObject() { _currentActionObj2Num = _actionObj2Num; _currentInfoString2SourceType = _actionObj2Type; if (_actionVerb == 1 && _selectedObjectType == 3) { - if (_panelLockedFlag == 1) { + if (_panelLockedFlag) { if (_locationMaskType != 0) { return; } - _panelLockedFlag = 0; + _panelLockedFlag = false; } - if (handleSpecialObjectSelectionSequence() == 1) { + if (handleSpecialObjectSelectionSequence()) { return; } _speechSoundNum = _actionObj1Num + _speechSoundBaseNum; @@ -3678,7 +3710,7 @@ void TuckerEngine::setActionForInventoryObject() { _actionCharacterNum = 99; setCursorType(2); _charSpeechSoundCounter = kDefaultCharSpeechSoundCounter; - _actionVerbLocked = 0; + _actionVerbLocked = false; _actionRequiresTwoObjects = false; return; } @@ -3686,7 +3718,7 @@ void TuckerEngine::setActionForInventoryObject() { if ((_partNum == 3 && (_actionObj1Num == 6 || _actionObj1Num == 3 || _actionObj1Num == 17 || _actionObj1Num == 33)) || (_partNum == 2 && _actionObj1Num == 19) || (_partNum == 3 && (_actionObj1Num == 42 && _selectedObjectNum == 18)) ) { - _actionVerbLocked = 0; + _actionVerbLocked = false; _actionRequiresTwoObjects = false; _locationMaskCounter = 1; setActionState(); @@ -3695,7 +3727,7 @@ void TuckerEngine::setActionForInventoryObject() { if (!_actionRequiresTwoObjects) { _actionRequiresTwoObjects = true; } else { - _actionVerbLocked = 0; + _actionVerbLocked = false; _actionRequiresTwoObjects = false; _locationMaskCounter = 1; setActionState(); @@ -3755,12 +3787,12 @@ void TuckerEngine::drawSpeechText(int xStart, int y, const uint8 *dataPtr, int n } } int count = 0; - int flag = 0; + bool flag = false; struct { int w, count, offset; } lines[5]; lines[0].offset = getPositionForLine(num, dataPtr); - while (flag == 0 && count < 4) { + while (!flag && count < 4) { int lineCharsCount, lineWidth; flag = splitSpeechTextLines(dataPtr, lines[count].offset, x, lineCharsCount, lineWidth); lines[count].w = lineWidth; @@ -3789,7 +3821,7 @@ void TuckerEngine::drawSpeechText(int xStart, int y, const uint8 *dataPtr, int n } } -int TuckerEngine::splitSpeechTextLines(const uint8 *dataPtr, int pos, int x, int &lineCharsCount, int &lineWidth) { +bool TuckerEngine::splitSpeechTextLines(const uint8 *dataPtr, int pos, int x, int &lineCharsCount, int &lineWidth) { int count = 0; int w = 0; lineCharsCount = 0; @@ -3803,11 +3835,11 @@ int TuckerEngine::splitSpeechTextLines(const uint8 *dataPtr, int pos, int x, int ++count; ++pos; } - int ret = 0; + bool ret = false; if (x + 1 > w) { lineCharsCount = count; lineWidth = w; - ret = 1; + ret = true; } return ret; } @@ -3819,7 +3851,7 @@ void TuckerEngine::drawSpeechTextLine(const uint8 *dataPtr, int pos, int count, x += _charWidthTable[dataPtr[pos]]; ++pos; } - addDirtyRect(xStart, y, x - xStart, Graphics::_charset.charH); + addDirtyRect(xStart, y, x - xStart, Graphics::_charset._charH); } void TuckerEngine::redrawScreen(int offset) { diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 1a970e3a0c..adcd02b2fe 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -53,133 +53,133 @@ class RewindableAudioStream; namespace Tucker { struct Action { - int key; - int testFlag1Num; - int testFlag1Value; - int testFlag2Num; - int testFlag2Value; - int speech; - int flipX; - int index; - int delay; - int setFlagNum; - int setFlagValue; - int fxNum; - int fxDelay; + int _key; + int _testFlag1Num; + int _testFlag1Value; + int _testFlag2Num; + int _testFlag2Value; + int _speech; + int _flipX; + int _index; + int _delay; + int _setFlagNum; + int _setFlagValue; + int _fxNum; + int _fxDelay; }; struct Sprite { - int state; - int gfxBackgroundOffset; - int updateDelay; - int backgroundOffset; - int needUpdate; - int stateIndex; - int counter; - int disabled; - int colorType; - int animationFrame; - int firstFrame; - uint8 *animationData; - int prevState; - int nextAnimationFrame; - int prevAnimationFrame; - int defaultUpdateDelay; - int xSource; - int yMaxBackground; - int flipX; + int _state; + int _gfxBackgroundOffset; + int _updateDelay; + int _backgroundOffset; + int _stateIndex; + int _counter; + int _colorType; + int _animationFrame; + int _firstFrame; + uint8 *_animationData; + int _prevState; + int _defaultUpdateDelay; + int _xSource; + int _yMaxBackground; + bool _disabled; + bool _flipX; + bool _needUpdate; + bool _nextAnimationFrame; + bool _prevAnimationFrame; }; struct CharPos { - int xPos; - int yPos; - int xSize; - int ySize; - int xWalkTo; - int yWalkTo; - int flagNum; - int flagValue; - int direction; - int name; - int description; + int _xPos; + int _yPos; + int _xSize; + int _ySize; + int _xWalkTo; + int _yWalkTo; + int _flagNum; + int _flagValue; + int _direction; + int _name; + int _description; }; struct SpriteFrame { - int sourceOffset; - int xOffset; - int yOffset; - int xSize; - int ySize; + int _sourceOffset; + int _xOffset; + int _yOffset; + int _xSize; + int _ySize; }; struct SpriteAnimation { - int numParts; - int rotateFlag; - int firstFrameIndex; + int _numParts; + int _rotateFlag; // Useless variable + int _firstFrameIndex; }; struct Data { - int sourceOffset; - int xSize; - int ySize; - int xDest; - int yDest; - int index; + int _sourceOffset; + int _xSize; + int _ySize; + int _xDest; + int _yDest; + int _index; }; struct LocationAnimation { - int graphicNum; - int animInitCounter; - int animCurrentCounter; - int animLastCounter; - int getFlag; - int inventoryNum; - int flagNum; - int flagValue; - int selectable; - int standX; - int standY; - int drawFlag; + int _graphicNum; + int _animInitCounter; + int _animCurrentCounter; + int _animLastCounter; + int _getFlag; + int _inventoryNum; + int _flagNum; + int _flagValue; + int _selectable; + int _standX; + int _standY; + bool _drawFlag; }; struct LocationObject { - int xPos; - int yPos; - int xSize; - int ySize; - int textNum; - int locationNum; - int toX; - int toY; - int toX2; - int toY2; - int toWalkX2; - int toWalkY2; - int standX; - int standY; - int cursorNum; + int _xPos; + int _yPos; + int _xSize; + int _ySize; + int _textNum; + int _locationNum; + int _toX; + int _toY; + int _toX2; + int _toY2; + int _toWalkX2; + int _toWalkY2; + int _standX; + int _standY; + int _cursorNum; }; struct LocationSound { - int startFxSpriteState; - int startFxSpriteNum; - int updateType; - int stopFxSpriteState; - int stopFxSpriteNum; - int offset; - int type; - int volume; - int flagValueStartFx; - int flagValueStopFx; - int flagNum; - int num; + int _startFxSpriteState; + int _startFxSpriteNum; + int _updateType; + int _stopFxSpriteState; + int _stopFxSpriteNum; + int _offset; + int _type; + int _volume; + int _flagValueStartFx; + int _flagValueStopFx; + int _flagNum; + int _num; }; struct LocationMusic { - int flag; - int offset; - int volume; - int num; + int _flag; + int _offset; + int _volume; + int _num; }; enum { @@ -232,7 +232,7 @@ enum CompressedSoundType { class CompressedSound { public: - CompressedSound() : _compressedSoundType(-1) {} + CompressedSound() : _compressedSoundType(-1), _compressedSoundFlags(0) {} void openFile(); void closeFile(); @@ -284,7 +284,7 @@ protected: int getRandomNumber(); void allocateBuffers(); void freeBuffers(); - void restart(); + void resetVariables(); void mainLoop(); void waitForTimer(int ticksCount); void parseEvents(); @@ -356,7 +356,7 @@ protected: void drawCreditsString(int x, int y, int num); void updateCharSpeechSound(bool displayText); void updateItemsGfxColors(int bit0, int bit7); - int testLocationMask(int x, int y); + bool testLocationMask(int x, int y); int getStringWidth(int num, const uint8 *ptr); int getPositionForLine(int num, const uint8 *ptr); void resetCharacterAnimationIndex(int count); @@ -369,7 +369,7 @@ protected: int getObjectUnderCursor(); void setSelectedObjectKey(); void setCharacterAnimation(int count, int spr); - int testLocationMaskArea(int xBase, int yBase, int xPos, int yPos); + bool testLocationMaskArea(int xBase, int yBase, int xPos, int yPos); void handleMouseClickOnInventoryObject(); int setCharacterUnderCursor(); int setLocationAnimationUnderCursor(); @@ -377,7 +377,7 @@ protected: void setActionState(); void playSpeechForAction(int i); void drawSpeechText(int xStart, int y, const uint8 *dataPtr, int num, int color); - int splitSpeechTextLines(const uint8 *dataPtr, int pos, int x, int &lineCharsCount, int &lineWidth); + bool splitSpeechTextLines(const uint8 *dataPtr, int pos, int x, int &lineCharsCount, int &lineWidth); void drawSpeechTextLine(const uint8 *dataPtr, int pos, int count, int x, int y, uint8 color); void redrawScreen(int offset); void redrawScreenRect(const Common::Rect &clip, const Common::Rect &dirty); @@ -578,7 +578,7 @@ protected: void handleMeanwhileSequence(); void handleMapSequence(); void copyMapRect(int x, int y, int w, int h); - int handleSpecialObjectSelectionSequence(); + bool handleSpecialObjectSelectionSequence(); uint8 *loadFile(const char *filename, uint8 *p); void loadImage(const char *filename, uint8 *dst, int a); @@ -630,14 +630,14 @@ protected: bool _gameDebug; bool _displayGameHints; int _execData3Counter; - bool _displaySpeechText; int _currentSaveLoadGameState; - int _gameHintsIndex; int _gameHintsCounter; - int _gameHintsDisplayText; int _gameHintsStringNum; + bool _displaySpeechText; + bool _displayHintsText; + int _fileLoadSize; uint8 *_loadTempBuf; uint8 *_cursorGfxBuf; @@ -685,7 +685,7 @@ protected: int _switchPanelCounter; int _conversationOptionsCount; bool _fadedPanel; - int _panelLockedFlag; + bool _panelLockedFlag; int _conversationOptionLinesCount; int _inventoryItemsState[50]; int _inventoryObjectsList[40]; @@ -742,22 +742,22 @@ protected: int _actionObj1Type, _actionObj2Type; int _actionObj1Num, _actionObj2Num; bool _actionRequiresTwoObjects; - int _actionVerbLocked; + bool _actionVerbLocked; int _actionPosX; int _actionPosY; - int _selectedObjectLocationMask; + bool _selectedObjectLocationMask; struct { - int xDefaultPos; - int yDefaultPos; - int xPos; - int yPos; - int locationObject_locationNum; - int locationObject_toX; - int locationObject_toY; - int locationObject_toX2; - int locationObject_toY2; - int locationObject_toWalkX2; - int locationObject_toWalkY2; + int _xDefaultPos; + int _yDefaultPos; + int _xPos; + int _yPos; + int _locationObjectLocationNum; + int _locationObjectToX; + int _locationObjectToY; + int _locationObjectToX2; + int _locationObjectToY2; + int _locationObjectToWalkX2; + int _locationObjectToWalkY2; } _selectedObject; int _selectedCharacterDirection; int _selectedCharacter2Num; @@ -780,7 +780,7 @@ protected: const uint8 *_tableInstructionsPtr; int _tableInstructionObj1Table[6]; int _tableInstructionObj2Table[6]; - int _tableInstructionFlag; + bool _tableInstructionFlag; int _tableInstructionItemNum1, _tableInstructionItemNum2; int _instructionsActionsTable[6]; bool _validInstructionId; @@ -810,21 +810,21 @@ protected: int _characterAnimationIndex; int _characterFacingDirection; int _characterPrevFacingDirection; - int _characterBackFrontFacing; - int _characterPrevBackFrontFacing; + bool _characterBackFrontFacing; + bool _characterPrevBackFrontFacing; int _characterAnimationNum; int _noCharacterAnimationChange; - int _changeBackgroundSprite; int _characterSpriteAnimationFrameCounter; - int _locationMaskIgnore; + bool _locationMaskIgnore; int _locationMaskType; int _locationMaskCounter; - int _updateSpriteFlag1; - int _updateSpriteFlag2; int _handleMapCounter; bool _noPositionChangeAfterMap; + bool _changeBackgroundSprite; + bool _updateSpriteFlag1; + bool _updateSpriteFlag2; - int _mirroredDrawing; + bool _mirroredDrawing; uint8 *_loadLocBufPtr; uint8 *_backgroundSpriteDataPtr; int _locationHeight; @@ -848,7 +848,7 @@ protected: int _updateLocation14ObjNum[10]; int _updateLocation14Delay[10]; int _updateLocationCounter2; - int _updateLocationFlag; + bool _updateLocationFlag; int _updateLocation70StringLen; uint8 _updateLocation70String[20]; diff --git a/engines/voyeur/animation.cpp b/engines/voyeur/animation.cpp index be6148c351..c1ded75f02 100644 --- a/engines/voyeur/animation.cpp +++ b/engines/voyeur/animation.cpp @@ -50,10 +50,10 @@ RL2Decoder::~RL2Decoder() { bool RL2Decoder::loadVideo(int videoId) { Common::String filename = Common::String::format("%s.rl2", ::Voyeur::SZ_FILENAMES[videoId * 2]); - return loadFile(filename); + return loadRL2File(filename, false); } -bool RL2Decoder::loadFile(const Common::String &file, bool palFlag) { +bool RL2Decoder::loadRL2File(const Common::String &file, bool palFlag) { bool result = VideoDecoder::loadFile(file); _paletteStart = palFlag ? 0 : 128; return result; @@ -100,7 +100,7 @@ const Common::List<Common::Rect> *RL2Decoder::getDirtyRects() const { if (_videoTrack) return _videoTrack->getDirtyRects(); - return 0; + return nullptr; } void RL2Decoder::clearDirtyRects() { @@ -115,7 +115,7 @@ void RL2Decoder::copyDirtyRectsToBuffer(uint8 *dst, uint pitch) { void RL2Decoder::readNextPacket() { int frameNumber = getCurFrame(); - RL2AudioTrack *audioTrack = getAudioTrack(); + RL2AudioTrack *audioTrack = getRL2AudioTrack(); // Handle queueing sound data if (_soundFrameNumber == -1) @@ -224,8 +224,7 @@ Common::Rational RL2Decoder::RL2FileHeader::getFrameRate() const { /*------------------------------------------------------------------------*/ RL2Decoder::RL2VideoTrack::RL2VideoTrack(const RL2FileHeader &header, RL2AudioTrack *audioTrack, - Common::SeekableReadStream *stream): - _header(header), _audioTrack(audioTrack), _fileStream(stream) { + Common::SeekableReadStream *stream): _header(header), _fileStream(stream) { _frameOffsets = nullptr; @@ -465,7 +464,7 @@ void RL2Decoder::play(VoyeurEngine *vm, int resourceOffset, int paletteStart = getPaletteStart(); int paletteCount = getPaletteCount(); - PictureResource videoFrame(getVideoTrack()->getBackSurface()); + PictureResource videoFrame(getRL2VideoTrack()->getBackSurface()); int picCtr = 0; while (!vm->shouldQuit() && !endOfVideo() && !vm->_eventsManager->_mouseClicked) { if (hasDirtyPalette()) { diff --git a/engines/voyeur/animation.h b/engines/voyeur/animation.h index dcdbf36260..b17e998214 100644 --- a/engines/voyeur/animation.h +++ b/engines/voyeur/animation.h @@ -130,7 +130,6 @@ private: private: Common::SeekableReadStream *_fileStream; const RL2FileHeader &_header; - RL2AudioTrack *_audioTrack; Graphics::Surface *_surface; Graphics::Surface *_backSurface; bool _hasBackFrame; @@ -175,7 +174,7 @@ public: virtual void close(); bool loadStream(Common::SeekableReadStream *stream); - bool loadFile(const Common::String &file, bool palFlag = false); + bool loadRL2File(const Common::String &file, bool palFlag); bool loadVideo(int videoId); int getPaletteCount() const { return _header._colorCount; } @@ -187,8 +186,8 @@ public: * @param imgPos Position to draw image data */ void play(VoyeurEngine *vm, int resourceOffset = 0, byte *frames = NULL, byte *imgPos = NULL); - RL2VideoTrack *getVideoTrack() { return _videoTrack; } - RL2AudioTrack *getAudioTrack() { return _audioTrack; } + RL2VideoTrack *getRL2VideoTrack() { return _videoTrack; } + RL2AudioTrack *getRL2AudioTrack() { return _audioTrack; } }; } // End of namespace Voyeur diff --git a/engines/voyeur/data.cpp b/engines/voyeur/data.cpp index 9e29ae4618..cc0b81a313 100644 --- a/engines/voyeur/data.cpp +++ b/engines/voyeur/data.cpp @@ -49,7 +49,7 @@ SVoy::SVoy(VoyeurEngine *vm):_vm(vm) { _audioVisualStartTime = 0; _audioVisualDuration = 0; _boltGroupId2 = 0; - _computerTextId = 0; + _computerTextId = -1; _computerTimeMin = _computerTimeMax = 0; _eventCount = 0; _fadingStep1 = 0; @@ -90,6 +90,8 @@ SVoy::SVoy(VoyeurEngine *vm):_vm(vm) { _events[i]._computerOff = 0; _events[i]._dead = 0; } + for (int i = 0; i < 6; i++) + _evCmPtrs[i] = nullptr; } void SVoy::addEvent(int hour, int minute, VoyeurEventType type, int audioVideoId, @@ -240,7 +242,7 @@ void SVoy::reviewAnEvidEvent(int eventIndex) { if (_vm->_bVoy->getBoltGroup(_vm->_playStampGroupId)) { _vm->_graphicsManager->_backColors = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + 1)._cMapResource; _vm->_graphicsManager->_backgroundPage = _vm->_bVoy->boltEntry(_vm->_playStampGroupId)._picResource; - (*_vm->_graphicsManager->_vPort)->setupViewPort(_vm->_graphicsManager->_backgroundPage); + _vm->_graphicsManager->_vPort->setupViewPort(_vm->_graphicsManager->_backgroundPage); _vm->_graphicsManager->_backColors->startFade(); _vm->doEvidDisplay(frameOff, e._dead); @@ -262,7 +264,7 @@ void SVoy::reviewComputerEvent(int eventIndex) { if (_vm->_bVoy->getBoltGroup(_vm->_playStampGroupId)) { _vm->_graphicsManager->_backColors = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + 1)._cMapResource; _vm->_graphicsManager->_backgroundPage = _vm->_bVoy->boltEntry(_vm->_playStampGroupId)._picResource; - (*_vm->_graphicsManager->_vPort)->setupViewPort(_vm->_graphicsManager->_backgroundPage); + _vm->_graphicsManager->_vPort->setupViewPort(_vm->_graphicsManager->_backgroundPage); _vm->_graphicsManager->_backColors->startFade(); _vm->flipPageAndWaitForFade(); @@ -277,7 +279,8 @@ void SVoy::reviewComputerEvent(int eventIndex) { } bool SVoy::checkForKey() { - _vm->_controlPtr->_state->_victimEvidenceIndex = 0; + StateResource *state = _vm->_controlPtr->_state; + state->_victimEvidenceIndex = 0; if (_vm->_voy->_victimMurdered) return false; @@ -286,25 +289,25 @@ bool SVoy::checkForKey() { switch (e._type) { case EVTYPE_VIDEO: - switch (_vm->_controlPtr->_state->_victimIndex) { + switch (state->_victimIndex) { case 1: if (e._audioVideoId == 33 && e._computerOn < 2 && e._computerOff >= 38) - _vm->_controlPtr->_state->_victimEvidenceIndex = 1; + state->_victimEvidenceIndex = 1; break; case 2: if (e._audioVideoId == 47 && e._computerOn < 2 && e._computerOff >= 9) - _vm->_controlPtr->_state->_victimEvidenceIndex = 2; + state->_victimEvidenceIndex = 2; break; case 3: if (e._audioVideoId == 46 && e._computerOn < 2 && e._computerOff > 2) - _vm->_controlPtr->_state->_victimEvidenceIndex = 3; + state->_victimEvidenceIndex = 3; break; case 4: if (e._audioVideoId == 40 && e._computerOn < 2 && e._computerOff > 6) - _vm->_controlPtr->_state->_victimEvidenceIndex = 4; + state->_victimEvidenceIndex = 4; break; default: @@ -313,17 +316,17 @@ bool SVoy::checkForKey() { break; case EVTYPE_AUDIO: - switch (_vm->_controlPtr->_state->_victimIndex) { + switch (state->_victimIndex) { case 1: if (e._audioVideoId == 8 && e._computerOn < 2 && e._computerOff > 26) - _vm->_controlPtr->_state->_victimEvidenceIndex = 1; + state->_victimEvidenceIndex = 1; break; case 3: if (e._audioVideoId == 20 && e._computerOn < 2 && e._computerOff > 28) - _vm->_controlPtr->_state->_victimEvidenceIndex = 3; + state->_victimEvidenceIndex = 3; if (e._audioVideoId == 35 && e._computerOn < 2 && e._computerOff > 18) - _vm->_controlPtr->_state->_victimEvidenceIndex = 3; + state->_victimEvidenceIndex = 3; break; default: @@ -332,10 +335,10 @@ bool SVoy::checkForKey() { break; case EVTYPE_EVID: - switch (_vm->_controlPtr->_state->_victimIndex) { + switch (state->_victimIndex) { case 4: if (e._audioVideoId == 0x2400 && e._computerOn == 0x4f00 && e._computerOff == 17) - _vm->_controlPtr->_state->_victimEvidenceIndex = 4; + state->_victimEvidenceIndex = 4; default: break; @@ -343,10 +346,10 @@ bool SVoy::checkForKey() { break; case EVTYPE_COMPUTER: - switch (_vm->_controlPtr->_state->_victimIndex) { + switch (state->_victimIndex) { case 2: if (e._computerOn == 13 && e._computerOff > 76) - _vm->_controlPtr->_state->_victimEvidenceIndex = 2; + state->_victimEvidenceIndex = 2; break; default: @@ -358,7 +361,7 @@ bool SVoy::checkForKey() { break; } - if (_vm->_controlPtr->_state->_victimEvidenceIndex == _vm->_controlPtr->_state->_victimIndex) + if (state->_victimEvidenceIndex == state->_victimIndex) return true; } diff --git a/engines/voyeur/debugger.cpp b/engines/voyeur/debugger.cpp index fdd0825181..234300bce5 100644 --- a/engines/voyeur/debugger.cpp +++ b/engines/voyeur/debugger.cpp @@ -92,10 +92,37 @@ bool Debugger::Cmd_Time(int argc, const char **argv) { } bool Debugger::Cmd_Hotspots(int argc, const char **argv) { + if (_vm->_voy->_computerTextId >= 0) { + DebugPrintf("Hotspot Computer Screen %d - %d,%d->%d,%d\n", + _vm->_voy->_computerTextId, + _vm->_voy->_computerScreenRect.left, + _vm->_voy->_computerScreenRect.top, + _vm->_voy->_computerScreenRect.right, + _vm->_voy->_computerScreenRect.bottom); + } + +#if 0 + // Room hotspots + BoltEntry &boltEntry = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + 4); + if (boltEntry._rectResource) { + Common::Array<RectEntry> &hotspots = boltEntry._rectResource->_entries; + for (uint hotspotIdx = 0; hotspotIdx < hotspots.size(); ++hotspotIdx) { + Common::String pos = Common::String::format("(%d,%d->%d,%d)", + hotspots[hotspotIdx].left, hotspots[hotspotIdx].top, + hotspots[hotspotIdx].right, hotspots[hotspotIdx].bottom); + int arrIndex = hotspots[hotspotIdx]._arrIndex; + if (_vm->_voy->_roomHotspotsEnabled[arrIndex - 1]) { + DebugPrintf("Hotspot Room %d - %s - Enabled\n", arrIndex, pos); + } else { + DebugPrintf("Hotspot Room - %s - Disabled\n", pos); + } + } + } +#endif + + // Outside view hotspots BoltEntry &boltEntry = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + 1); - if (!boltEntry._rectResource) { - DebugPrintf("No hotspots available\n"); - } else { + if (boltEntry._rectResource) { Common::Array<RectEntry> &hotspots = boltEntry._rectResource->_entries; for (uint hotspotIdx = 0; hotspotIdx < hotspots.size(); ++hotspotIdx) { @@ -130,7 +157,7 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) { } } - DebugPrintf("\n"); + DebugPrintf("\nEnd of list\n"); return true; } diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp index 4c1ed419a2..9a3c6d00ff 100644 --- a/engines/voyeur/events.cpp +++ b/engines/voyeur/events.cpp @@ -82,6 +82,9 @@ EventsManager::EventsManager(VoyeurEngine *vm) : _intPtr(_gameData), _fadeFirstCol = _fadeLastCol = 0; _fadeCount = 1; + + for (int i = 0; i < 4; i++) + _cycleNext[i] = nullptr; } void EventsManager::startMainClockInt() { @@ -263,18 +266,18 @@ void EventsManager::pollEvents() { } return; case Common::EVENT_LBUTTONDOWN: - _vm->_eventsManager->_newLeftClick = true; - _vm->_eventsManager->_newMouseClicked = true; + _newLeftClick = true; + _newMouseClicked = true; return; case Common::EVENT_RBUTTONDOWN: - _vm->_eventsManager->_newRightClick = true; - _vm->_eventsManager->_newMouseClicked = true; + _newRightClick = true; + _newMouseClicked = true; return; case Common::EVENT_LBUTTONUP: case Common::EVENT_RBUTTONUP: - _vm->_eventsManager->_newMouseClicked = false; - _vm->_eventsManager->_newLeftClick = false; - _vm->_eventsManager->_newRightClick = false; + _newMouseClicked = false; + _newLeftClick = false; + _newRightClick = false; return; case Common::EVENT_MOUSEMOVE: _mousePos = event.mouse; @@ -571,13 +574,13 @@ void EventsManager::getMouseInfo() { } } - _vm->_eventsManager->_mouseClicked = _vm->_eventsManager->_newMouseClicked; - _vm->_eventsManager->_leftClick = _vm->_eventsManager->_newLeftClick; - _vm->_eventsManager->_rightClick = _vm->_eventsManager->_newRightClick; + _mouseClicked = _newMouseClicked; + _leftClick = _newLeftClick; + _rightClick = _newRightClick; - _vm->_eventsManager->_newMouseClicked = false; - _vm->_eventsManager->_newLeftClick = false; - _vm->_eventsManager->_newRightClick = false; + _newMouseClicked = false; + _newLeftClick = false; + _newRightClick = false; } void EventsManager::startCursorBlink() { diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 9d1ff58b67..7369d9280e 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -29,7 +29,7 @@ namespace Voyeur { #define BOLT_GROUP_SIZE 16 -BoltFilesState::BoltFilesState() { +BoltFilesState::BoltFilesState(VoyeurEngine *vm) : _vm(vm) { _curLibPtr = NULL; _curGroupPtr = NULL; _curMemberPtr = NULL; @@ -174,20 +174,24 @@ void BoltFilesState::nextBlock() { FilesManager::FilesManager(VoyeurEngine *vm) { _curLibPtr = nullptr; - _boltFilesState._vm = vm; + _boltFilesState = new BoltFilesState(vm); +} + +FilesManager::~FilesManager() { + delete _boltFilesState; } bool FilesManager::openBoltLib(const Common::String &filename, BoltFile *&boltFile) { if (boltFile != NULL) { - _boltFilesState._curLibPtr = boltFile; + _boltFilesState->_curLibPtr = boltFile; return true; } // Create the bolt file interface object and load the index if (filename == "bvoy.blt") - boltFile = _boltFilesState._curLibPtr = new BVoyBoltFile(_boltFilesState); + boltFile = _boltFilesState->_curLibPtr = new BVoyBoltFile(*_boltFilesState); else if (filename == "stampblt.blt") - boltFile = _boltFilesState._curLibPtr = new StampBoltFile(_boltFilesState); + boltFile = _boltFilesState->_curLibPtr = new StampBoltFile(*_boltFilesState); else error("Unknown bolt file specified"); @@ -470,7 +474,7 @@ void BVoyBoltFile::initViewPort() { _state._curMemberPtr->_viewPortResource = viewPort = new ViewPortResource(_state, src); // This is done post-constructor, since viewports can be self referential, so - // we ned the _viewPortResource field to have been set before resolving the pointer + // we need the _viewPortResource field to have been set before resolving the pointer viewPort->_parent = getBoltEntryFromLong(READ_LE_UINT32(src + 2))._viewPortResource; } @@ -482,7 +486,7 @@ void BVoyBoltFile::initViewPortList() { _state, _state._curMemberPtr->_data); _state._vm->_graphicsManager->_viewPortListPtr = res; - _state._vm->_graphicsManager->_vPort = &res->_entries[0]; + _state._vm->_graphicsManager->_vPort = res->_entries[0]; } void BVoyBoltFile::initFontInfo() { @@ -683,8 +687,7 @@ void BoltEntry::load() { */ bool BoltEntry::hasResource() const { return _rectResource || _picResource || _viewPortResource || _viewPortListResource - || _fontResource || _fontInfoResource || _cMapResource - || _vInitCycleResource + || _fontResource || _fontInfoResource || _cMapResource || _vInitCycleResource || _ptrResource || _controlResource || _stateResource || _threadResource; } @@ -739,12 +742,12 @@ RectResource::RectResource(int x1, int y1, int x2, int y2) { DisplayResource::DisplayResource() { _vm = NULL; - _flags = 0; + _flags = DISPFLAG_NONE; } DisplayResource::DisplayResource(VoyeurEngine *vm) { _vm = vm; - _flags = 0; + _flags = DISPFLAG_NONE; } void DisplayResource::sFillBox(int width, int height) { @@ -753,7 +756,7 @@ void DisplayResource::sFillBox(int width, int height) { _vm->_graphicsManager->_saveBack = false; PictureResource pr; - pr._flags = 1; + pr._flags = DISPFLAG_1; pr._select = 0xff; pr._pick = 0; pr._onOff = _vm->_graphicsManager->_drawPtr->_penColor; @@ -847,7 +850,7 @@ int DisplayResource::drawText(const Common::String &msg) { break; } - if (!(fontInfo._fontFlags & 3)) { + if (!(fontInfo._fontFlags & (DISPFLAG_1 | DISPFLAG_2))) { viewPort->_fontRect.left = xp; viewPort->_fontRect.top = yp; viewPort->_fontRect.setWidth(msgWidth); @@ -862,7 +865,7 @@ int DisplayResource::drawText(const Common::String &msg) { pos.x = xp; pos.y = yp; - if (fontInfo._fontFlags & 4) { + if (fontInfo._fontFlags & DISPFLAG_4) { if (fontInfo._shadow.x <= 0) { viewPort->_fontRect.left += fontInfo._shadow.x; viewPort->_fontRect.right -= fontInfo._shadow.x * 2; @@ -943,7 +946,7 @@ int DisplayResource::drawText(const Common::String &msg) { if (i != 0) { fontChar._pick = 0; fontChar._onOff = fontInfo._shadowColor; - } else if (fontData._fontDepth == 1 || (fontInfo._fontFlags & 0x10)) { + } else if (fontData._fontDepth == 1 || (fontInfo._fontFlags & DISPFLAG_10)) { fontChar._pick = 0; fontChar._onOff = fontInfo._foreColor; } else { @@ -1121,12 +1124,13 @@ PictureResource::PictureResource(BoltFilesState &state, const byte *src): } PictureResource::PictureResource(Graphics::Surface *surface) { - _flags = 0; + _flags = DISPFLAG_NONE; _select = 0; _pick = 0; _onOff = 0; _maskData = 0; _planeSize = 0; + _keyColor = 0; _bounds = Common::Rect(0, 0, surface->w, surface->h); _imgData = (byte *)surface->getPixels(); @@ -1134,12 +1138,13 @@ PictureResource::PictureResource(Graphics::Surface *surface) { } PictureResource::PictureResource() { - _flags = 0; + _flags = DISPFLAG_NONE; _select = 0; _pick = 0; _onOff = 0; _maskData = 0; _planeSize = 0; + _keyColor = 0; _imgData = NULL; _freeImgData = DisposeAfterUse::NO; @@ -1156,6 +1161,7 @@ PictureResource::PictureResource(int flags, int select, int pick, int onOff, _imgData = imgData; _planeSize = planeSize; _freeImgData = DisposeAfterUse::NO; + _keyColor = 0; } PictureResource::~PictureResource() { @@ -1349,21 +1355,21 @@ void ViewPortResource::fillPic(byte onOff) { void ViewPortResource::drawIfaceTime() { // Hour display - _state._vm->_graphicsManager->drawANumber(*_state._vm->_graphicsManager->_vPort, + _state._vm->_graphicsManager->drawANumber(_state._vm->_graphicsManager->_vPort, (_state._vm->_gameHour / 10) == 0 ? 10 : _state._vm->_gameHour / 10, Common::Point(161, 25)); - _state._vm->_graphicsManager->drawANumber(*_state._vm->_graphicsManager->_vPort, + _state._vm->_graphicsManager->drawANumber(_state._vm->_graphicsManager->_vPort, _state._vm->_gameHour % 10, Common::Point(172, 25)); // Minute display - _state._vm->_graphicsManager->drawANumber(*_state._vm->_graphicsManager->_vPort, + _state._vm->_graphicsManager->drawANumber(_state._vm->_graphicsManager->_vPort, _state._vm->_gameMinute / 10, Common::Point(190, 25)); - _state._vm->_graphicsManager->drawANumber(*_state._vm->_graphicsManager->_vPort, + _state._vm->_graphicsManager->drawANumber(_state._vm->_graphicsManager->_vPort, _state._vm->_gameMinute % 10, Common::Point(201, 25)); // AM/PM indicator PictureResource *pic = _state._vm->_bVoy->boltEntry(_state._vm->_voy->_isAM ? 272 : 273)._picResource; - _state._vm->_graphicsManager->sDrawPic(pic, *_state._vm->_graphicsManager->_vPort, + _state._vm->_graphicsManager->sDrawPic(pic, _state._vm->_graphicsManager->_vPort, Common::Point(215, 27)); } @@ -1467,11 +1473,11 @@ FontInfoResource::FontInfoResource(BoltFilesState &state, const byte *src) { FontInfoResource::FontInfoResource() { _curFont = NULL; - _picFlags = 3; + _picFlags = DISPFLAG_1 | DISPFLAG_2; _picSelect = 0xff; _picPick = 0xff; _picOnOff = 0; - _fontFlags = 0; + _fontFlags = DISPFLAG_NONE; _justify = ALIGN_LEFT; _fontSaveBack = 0; _justifyWidth = 1; diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 16d27fb3f6..49c0b2c8a4 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -82,7 +82,7 @@ public: byte *_boltPageFrame; public: - BoltFilesState(); + BoltFilesState(VoyeurEngine *vm); byte *decompress(byte *buf, int size, int mode); void nextBlock(); @@ -204,10 +204,11 @@ public: class FilesManager { public: - BoltFilesState _boltFilesState; + BoltFilesState *_boltFilesState; BoltFile *_curLibPtr; public: FilesManager(VoyeurEngine *vm); + ~FilesManager(); bool openBoltLib(const Common::String &filename, BoltFile *&boltFile); byte *fload(const Common::String &filename, int *size); @@ -230,11 +231,21 @@ public: virtual ~RectResource() {} }; -enum DisplayFlag { DISPFLAG_1 = 1, DISPFLAG_2 = 2, DISPFLAG_4 = 4, DISPFLAG_8 = 8, +/* bvoy.blt resource types */ + +enum PictureFlag { + PICFLAG_2 = 2, PICFLAG_PIC_OFFSET = 8, PICFLAG_CLEAR_SCREEN = 0x10, + PICFLAG_20 = 0x20, PICFLAG_HFLIP = 0x40, PICFLAG_VFLIP = 0x80, PICFLAG_100 = 0x100, + PICFLAG_CLEAR_SCREEN00 = 0x1000 +}; + +enum DisplayFlag { + DISPFLAG_1 = 1, DISPFLAG_2 = 2, DISPFLAG_4 = 4, DISPFLAG_8 = 8, DISPFLAG_10 = 0x10, DISPFLAG_20 = 0x20, DISPFLAG_40 = 0x40, DISPFLAG_80 = 0x80, DISPFLAG_100 = 0x100, DISPFLAG_200 = 0x200, DISPFLAG_400 = 0x400, DISPFLAG_800 = 0x800, DISPFLAG_1000 = 0x1000, DISPFLAG_2000 = 0x2000, - DISPFLAG_4000 = 0x4000, DISPFLAG_VIEWPORT = 0x8000, DISPFLAG_CURSOR = 0x10000 }; + DISPFLAG_4000 = 0x4000, DISPFLAG_VIEWPORT = 0x8000, DISPFLAG_CURSOR = 0x10000, + DISPFLAG_NONE = 0}; class DisplayResource { private: @@ -266,13 +277,6 @@ public: bool clipRect(Common::Rect &rect); }; -/* bvoy.blt resource types */ - -enum PictureFlag { PICFLAG_2 = 2, PICFLAG_PIC_OFFSET = 8, PICFLAG_CLEAR_SCREEN = 0x10, - PICFLAG_20 = 0x20, PICFLAG_HFLIP = 0x40, PICFLAG_VFLIP = 0x80, PICFLAG_100 = 0x100, - PICFLAG_CLEAR_SCREEN00 = 0x1000 -}; - class PictureResource: public DisplayResource { private: /** diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp index d2ac182030..700944f7ef 100644 --- a/engines/voyeur/files_threads.cpp +++ b/engines/voyeur/files_threads.cpp @@ -86,6 +86,9 @@ bool ThreadResource::loadAStack(int stackId) { } void ThreadResource::unloadAStack(int stackId) { + if (stackId < 0) + return; + if ((_vm->_stampFlags & 1) && _useCount[stackId]) { if (--_useCount[stackId] == 0) { _vm->_stampLibPtr->freeBoltMember(_vm->_controlPtr->_memberIds[stackId]); @@ -458,7 +461,7 @@ void ThreadResource::parsePlayCommands() { pic = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + i * 2)._picResource; pal = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + i * 2 + 1)._cMapResource; - (*_vm->_graphicsManager->_vPort)->setupViewPort(pic); + _vm->_graphicsManager->_vPort->setupViewPort(pic); pal->startFade(); _vm->flipPageAndWaitForFade(); @@ -1038,7 +1041,7 @@ int ThreadResource::doApt() { // Draw the text description for the highlighted hotspot pic = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + hotspotId + 6)._picResource; - _vm->_graphicsManager->sDrawPic(pic, *_vm->_graphicsManager->_vPort, + _vm->_graphicsManager->sDrawPic(pic, _vm->_graphicsManager->_vPort, Common::Point(106, 200)); } @@ -1107,7 +1110,7 @@ void ThreadResource::doRoom() { vm._graphicsManager->_backColors = vm._bVoy->boltEntry(vm._playStampGroupId + 1)._cMapResource; vm._graphicsManager->_backgroundPage = vm._bVoy->boltEntry(vm._playStampGroupId)._picResource; - (*vm._graphicsManager->_vPort)->setupViewPort(vm._graphicsManager->_backgroundPage); + vm._graphicsManager->_vPort->setupViewPort(vm._graphicsManager->_backgroundPage); vm._graphicsManager->_backColors->startFade(); voy._fadingStep1 = 2; @@ -1232,7 +1235,7 @@ void ThreadResource::doRoom() { vm._graphicsManager->_backgroundPage = vm._bVoy->boltEntry( vm._playStampGroupId)._picResource; - (*vm._graphicsManager->_vPort)->setupViewPort(); + vm._graphicsManager->_vPort->setupViewPort(); vm._graphicsManager->_backColors->startFade(); _vm->flipPageAndWait(); @@ -1307,12 +1310,13 @@ int ThreadResource::doInterface() { if (_vm->_voy->_RTVNum >= _vm->_voy->_RTVLimit || _vm->_voy->_RTVNum < 0) _vm->_voy->_RTVNum = _vm->_voy->_RTVLimit - 1; - if (_vm->_voy->_transitionId < 15 && _vm->_debugger->_isTimeActive && - (_vm->_voy->_RTVLimit - 3) < _vm->_voy->_RTVNum) { + if (_vm->_voy->_transitionId < 15 && _vm->_debugger->_isTimeActive + && (_vm->_voy->_RTVLimit - 3) < _vm->_voy->_RTVNum) { _vm->_voy->_RTVNum = _vm->_voy->_RTVLimit; _vm->makeViewFinder(); _vm->initIFace(); + _vm->_eventsManager->hideCursor(); _vm->_voy->_RTVNum = _vm->_voy->_RTVLimit - 4; _vm->_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED; @@ -1324,6 +1328,8 @@ int ThreadResource::doInterface() { _vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED; chooseSTAMPButton(20); parsePlayCommands(); + + _vm->_eventsManager->showCursor(); } _vm->checkTransition(); @@ -1414,20 +1420,20 @@ int ThreadResource::doInterface() { // Regularly update the time display if (_vm->_voy->_RTANum & 2) { - _vm->_graphicsManager->drawANumber(*_vm->_graphicsManager->_vPort, + _vm->_graphicsManager->drawANumber(_vm->_graphicsManager->_vPort, _vm->_gameMinute / 10, Common::Point(190, 25)); - _vm->_graphicsManager->drawANumber(*_vm->_graphicsManager->_vPort, + _vm->_graphicsManager->drawANumber(_vm->_graphicsManager->_vPort, _vm->_gameMinute % 10, Common::Point(201, 25)); if (_vm->_voy->_RTANum & 4) { int v = _vm->_gameHour / 10; - _vm->_graphicsManager->drawANumber(*_vm->_graphicsManager->_vPort, + _vm->_graphicsManager->drawANumber(_vm->_graphicsManager->_vPort, v == 0 ? 10 : v, Common::Point(161, 25)); - _vm->_graphicsManager->drawANumber(*_vm->_graphicsManager->_vPort, + _vm->_graphicsManager->drawANumber(_vm->_graphicsManager->_vPort, _vm->_gameHour % 10, Common::Point(172, 25)); pic = _vm->_bVoy->boltEntry(_vm->_voy->_isAM ? 272 : 273)._picResource; - _vm->_graphicsManager->sDrawPic(pic, *_vm->_graphicsManager->_vPort, + _vm->_graphicsManager->sDrawPic(pic, _vm->_graphicsManager->_vPort, Common::Point(215, 27)); } } @@ -1595,13 +1601,13 @@ void ThreadResource::loadTheApt() { _vm->_voy->_aptLoadMode = -1; _vm->_graphicsManager->_backgroundPage = _vm->_bVoy->boltEntry( _vm->_playStampGroupId + 5)._picResource; - (*_vm->_graphicsManager->_vPort)->setupViewPort( + _vm->_graphicsManager->_vPort->setupViewPort( _vm->_graphicsManager->_backgroundPage); } else { _vm->_bVoy->getBoltGroup(_vm->_playStampGroupId); _vm->_graphicsManager->_backgroundPage = _vm->_bVoy->boltEntry( _vm->_playStampGroupId + 5)._picResource; - (*_vm->_graphicsManager->_vPort)->setupViewPort( + _vm->_graphicsManager->_vPort->setupViewPort( _vm->_graphicsManager->_backgroundPage); } @@ -1633,7 +1639,7 @@ void ThreadResource::freeTheApt() { _vm->_graphicsManager->resetPalette(); } - (*_vm->_graphicsManager->_vPort)->setupViewPort(nullptr); + _vm->_graphicsManager->_vPort->setupViewPort(nullptr); _vm->_bVoy->freeBoltGroup(_vm->_playStampGroupId); _vm->_playStampGroupId = -1; _vm->_voy->_viewBounds = nullptr; @@ -1693,7 +1699,7 @@ void ThreadResource::doAptAnim(int mode) { for (int idx = 0; (idx < 6) && !_vm->shouldQuit(); ++idx) { PictureResource *pic = _vm->_bVoy->boltEntry(id + idx + 1)._picResource; - (*_vm->_graphicsManager->_vPort)->setupViewPort(pic); + _vm->_graphicsManager->_vPort->setupViewPort(pic); pal->startFade(); _vm->flipPageAndWait(); diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index ea34148007..f756b9cc85 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -48,7 +48,7 @@ GraphicsManager::GraphicsManager(VoyeurEngine *vm) : _defaultDrawInfo(1, Common: _vPort = NULL; _fontPtr = NULL; Common::fill(&_VGAColors[0], &_VGAColors[PALETTE_SIZE], 0); - _fontChar = new PictureResource(0, 0xff, 0xff, 0, Common::Rect(), 0, NULL, 0); + _fontChar = new PictureResource(DISPFLAG_NONE, 0xff, 0xff, 0, Common::Rect(), 0, NULL, 0); _backColors = nullptr; } @@ -65,7 +65,7 @@ GraphicsManager::~GraphicsManager() { void GraphicsManager::setupMCGASaveRect(ViewPortResource *viewPort) { if (viewPort->_activePage) { - viewPort->_activePage->_flags |= 1; + viewPort->_activePage->_flags |= DISPFLAG_1; Common::Rect *clipRect = _clipPtr; _clipPtr = &viewPort->_clipRect; @@ -219,7 +219,7 @@ void GraphicsManager::sDrawPic(DisplayResource *srcDisplay, DisplayResource *des widthDiff2 = destPic->_bounds.width() - width2; if (destViewPort) { - if (!_saveBack || ((srcPic->_flags & DISPFLAG_800) != 0)) { + if (!_saveBack || (srcPic->_flags & DISPFLAG_800)) { backBounds.left = destPic->_bounds.left + offset.x; backBounds.top = destPic->_bounds.top + offset.y; backBounds.setWidth(width2); @@ -864,7 +864,7 @@ void GraphicsManager::fillPic(DisplayResource *display, byte onOff) { } PictureResource picResource; - picResource._flags = 0; + picResource._flags = DISPFLAG_NONE; picResource._select = 0xff; picResource._pick = 0; picResource._onOff = onOff; @@ -991,8 +991,8 @@ void GraphicsManager::screenReset() { resetPalette(); _backgroundPage = NULL; - (*_vPort)->setupViewPort(NULL); - fillPic(*_vPort, 0); + _vPort->setupViewPort(NULL); + fillPic(_vPort, 0); _vm->flipPageAndWait(); } diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index e7421915c8..221d31061d 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -66,7 +66,7 @@ public: PictureResource *_backgroundPage; int _SVGAMode; ViewPortListResource *_viewPortListPtr; - ViewPortResource **_vPort; + ViewPortResource *_vPort; bool _saveBack; Common::Rect *_clipPtr; uint _planeSelect; diff --git a/engines/voyeur/sound.cpp b/engines/voyeur/sound.cpp index ae10b2d4d9..26145bd743 100644 --- a/engines/voyeur/sound.cpp +++ b/engines/voyeur/sound.cpp @@ -28,7 +28,7 @@ namespace Voyeur { - SoundManager::SoundManager(VoyeurEngine *vm, Audio::Mixer *mixer) : _vm(vm) { + SoundManager::SoundManager(Audio::Mixer *mixer) { _mixer = mixer; _vocOffset = 0; } diff --git a/engines/voyeur/sound.h b/engines/voyeur/sound.h index fc2d3047eb..af1d0b1b46 100644 --- a/engines/voyeur/sound.h +++ b/engines/voyeur/sound.h @@ -33,12 +33,11 @@ namespace Voyeur { class SoundManager { private: - VoyeurEngine *_vm; Audio::Mixer *_mixer; Audio::SoundHandle _soundHandle; int _vocOffset; public: - SoundManager(VoyeurEngine *vm, Audio::Mixer *mixer); + SoundManager(Audio::Mixer *mixer); void playVOCMap(byte *voc, int vocSize); void stopVOCPlay(); diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index 0406ba089a..9843930bd3 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -71,8 +71,17 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc) _eventsManager = new EventsManager(this); _filesManager = new FilesManager(this); _graphicsManager = new GraphicsManager(this); - _soundManager = new SoundManager(this, _mixer); + _soundManager = new SoundManager(_mixer); _voy = new SVoy(this); + + _stampLibPtr = nullptr; + _controlGroupPtr = nullptr; + _stampData = nullptr; + _stackGroupPtr = nullptr; + _glGoState = -1; + _glGoStack = -1; + _resolvePtr = nullptr; + _mainThread = nullptr; } VoyeurEngine::~VoyeurEngine() { @@ -205,7 +214,7 @@ bool VoyeurEngine::doHeadTitle() { void VoyeurEngine::showConversionScreen() { _graphicsManager->_backgroundPage = _bVoy->boltEntry(0x502)._picResource; - (*_graphicsManager->_vPort)->setupViewPort(); + _graphicsManager->_vPort->setupViewPort(); flipPageAndWait(); // Immediate palette load to show the initial screen @@ -247,10 +256,10 @@ bool VoyeurEngine::doLock() { Common::Array<RectEntry> &hotspots = _bVoy->boltEntry(0x705)._rectResource->_entries; assert(cursorPic); - (*_graphicsManager->_vPort)->setupViewPort(); + _graphicsManager->_vPort->setupViewPort(); _graphicsManager->_backColors->startFade(); - (*_graphicsManager->_vPort)->_parent->_flags |= DISPFLAG_8; + _graphicsManager->_vPort->_parent->_flags |= DISPFLAG_8; _graphicsManager->flipPage(); _eventsManager->sWaitFlip(); @@ -271,7 +280,7 @@ bool VoyeurEngine::doLock() { _graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x708)._fontResource; _graphicsManager->_fontPtr->_fontSaveBack = 0; - _graphicsManager->_fontPtr->_fontFlags = 0; + _graphicsManager->_fontPtr->_fontFlags = DISPFLAG_NONE; Common::String dateString = "ScummVM"; Common::String displayString = Common::String::format("Last Play %s", dateString.c_str()); @@ -279,7 +288,7 @@ bool VoyeurEngine::doLock() { bool firstLoop = true; bool breakFlag = false; while (!breakFlag && !shouldQuit()) { - (*_graphicsManager->_vPort)->setupViewPort(); + _graphicsManager->_vPort->setupViewPort(); flipPageAndWait(); // Display the last play time @@ -288,7 +297,7 @@ bool VoyeurEngine::doLock() { _graphicsManager->_fontPtr->_justifyWidth = 384; _graphicsManager->_fontPtr->_justifyHeight = 97; - (*_graphicsManager->_vPort)->drawText(displayString); + _graphicsManager->_vPort->drawText(displayString); flipPageAndWait(); if (firstLoop) { @@ -347,7 +356,7 @@ bool VoyeurEngine::doLock() { } else if (key == 11) { // New code if ((password.empty() && displayString.empty()) || (password != displayString)) { - (*_graphicsManager->_vPort)->setupViewPort(); + _graphicsManager->_vPort->setupViewPort(); password = displayString; displayString = ""; continue; @@ -364,7 +373,7 @@ bool VoyeurEngine::doLock() { _soundManager->playVOCMap(wrongVoc, wrongVocSize); } - _graphicsManager->fillPic(*_graphicsManager->_vPort, 0); + _graphicsManager->fillPic(_graphicsManager->_vPort, 0); flipPageAndWait(); _graphicsManager->resetPalette(); @@ -386,7 +395,7 @@ void VoyeurEngine::showTitleScreen() { _graphicsManager->_backgroundPage = _bVoy->getPictureResource(0x500); - (*_graphicsManager->_vPort)->setupViewPort(); + _graphicsManager->_vPort->setupViewPort(); flipPageAndWait(); // Immediate palette load to show the initial screen @@ -453,11 +462,11 @@ void VoyeurEngine::doOpening() { _graphicsManager->setColor(i, 8, 8, 8); _eventsManager->_intPtr._hasPalette = true; - (*_graphicsManager->_vPort)->setupViewPort(); + _graphicsManager->_vPort->setupViewPort(); flipPageAndWait(); RL2Decoder decoder; - decoder.loadFile("a2300100.rl2"); + decoder.loadRL2File("a2300100.rl2", false); decoder.start(); while (!shouldQuit() && !decoder.endOfVideo() && !_eventsManager->_mouseClicked) { @@ -490,7 +499,7 @@ void VoyeurEngine::doOpening() { } if (textPic) { - _graphicsManager->sDrawPic(textPic, *_graphicsManager->_vPort, textPos); + _graphicsManager->sDrawPic(textPic, _graphicsManager->_vPort, textPos); flipPageAndWait(); } } @@ -511,7 +520,7 @@ void VoyeurEngine::doOpening() { void VoyeurEngine::playRL2Video(const Common::String &filename) { RL2Decoder decoder; - decoder.loadFile(filename); + decoder.loadRL2File(filename, false); decoder.start(); while (!shouldQuit() && !decoder.endOfVideo() && !_eventsManager->_mouseClicked) { @@ -585,8 +594,8 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) { if (_voy->_eventFlags & EVTFLAG_8) { assert(pic); - byte *imgData = (*_graphicsManager->_vPort)->_currentPic->_imgData; - (*_graphicsManager->_vPort)->_currentPic->_imgData = pic->_imgData; + byte *imgData = _graphicsManager->_vPort->_currentPic->_imgData; + _graphicsManager->_vPort->_currentPic->_imgData = pic->_imgData; pic->_imgData = imgData; _voy->_eventFlags &= ~EVTFLAG_8; } @@ -599,7 +608,7 @@ void VoyeurEngine::playAudio(int audioId) { _graphicsManager->_backColors = _bVoy->boltEntry(0x7F01 + BLIND_TABLE[audioId] * 2)._cMapResource; - (*_graphicsManager->_vPort)->setupViewPort(); + _graphicsManager->_vPort->setupViewPort(); _graphicsManager->_backColors->startFade(); flipPageAndWaitForFade(); @@ -619,7 +628,7 @@ void VoyeurEngine::playAudio(int audioId) { _soundManager->stopVOCPlay(); _bVoy->freeBoltGroup(0x7F00); - (*_graphicsManager->_vPort)->setupViewPort(NULL); + _graphicsManager->_vPort->setupViewPort(NULL); _voy->_eventFlags &= ~EVTFLAG_RECORDING; _voy->_playStampMode = 129; @@ -630,13 +639,13 @@ void VoyeurEngine::doTransitionCard(const Common::String &time, const Common::St _graphicsManager->setColor(224, 220, 220, 220); _eventsManager->_intPtr._hasPalette = true; - (*_graphicsManager->_vPort)->setupViewPort(NULL); - (*_graphicsManager->_vPort)->fillPic(0x80); + _graphicsManager->_vPort->setupViewPort(NULL); + _graphicsManager->_vPort->fillPic(0x80); _graphicsManager->flipPage(); _eventsManager->sWaitFlip(); flipPageAndWait(); - (*_graphicsManager->_vPort)->fillPic(0x80); + _graphicsManager->_vPort->fillPic(0x80); FontInfoResource &fi = *_graphicsManager->_fontPtr; fi._curFont = _bVoy->boltEntry(257)._fontResource; @@ -647,7 +656,7 @@ void VoyeurEngine::doTransitionCard(const Common::String &time, const Common::St fi._justifyWidth = 384; fi._justifyHeight = 120; - (*_graphicsManager->_vPort)->drawText(time); + _graphicsManager->_vPort->drawText(time); if (!location.empty()) { fi._pos = Common::Point(0, 138); @@ -655,7 +664,7 @@ void VoyeurEngine::doTransitionCard(const Common::String &time, const Common::St fi._justifyWidth = 384; fi._justifyHeight = 140; - (*_graphicsManager->_vPort)->drawText(location); + _graphicsManager->_vPort->drawText(location); } flipPageAndWait(); @@ -666,7 +675,7 @@ void VoyeurEngine::saveLastInplay() { } void VoyeurEngine::flipPageAndWait() { - (*_graphicsManager->_vPort)->_flags |= DISPFLAG_8; + _graphicsManager->_vPort->_flags |= DISPFLAG_8; _graphicsManager->flipPage(); _eventsManager->sWaitFlip(); } @@ -688,7 +697,7 @@ void VoyeurEngine::showEndingNews() { PictureResource *pic = _bVoy->boltEntry(_playStampGroupId)._picResource; CMapResource *pal = _bVoy->boltEntry(_playStampGroupId + 1)._cMapResource; - (*_graphicsManager->_vPort)->setupViewPort(pic); + _graphicsManager->_vPort->setupViewPort(pic); pal->startFade(); flipPageAndWaitForFade(); @@ -703,7 +712,7 @@ void VoyeurEngine::showEndingNews() { pal = _bVoy->boltEntry(_playStampGroupId + idx * 2 + 1)._cMapResource; } - (*_graphicsManager->_vPort)->setupViewPort(pic); + _graphicsManager->_vPort->setupViewPort(pic); pal->startFade(); flipPageAndWaitForFade(); diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h index 19e047de05..a35473ba93 100644 --- a/engines/voyeur/voyeur.h +++ b/engines/voyeur/voyeur.h @@ -42,10 +42,10 @@ /** * This is the namespace of the Voyeur engine. * - * Status of this engine: In Development + * Status of this engine: Complete * * Games using this engine: - * - Voyeur + * - Voyeur (Dos) */ namespace Voyeur { diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp index 453e72b315..a6564c32ba 100644 --- a/engines/voyeur/voyeur_game.cpp +++ b/engines/voyeur/voyeur_game.cpp @@ -232,12 +232,12 @@ void VoyeurEngine::closeStamp() { } void VoyeurEngine::doTailTitle() { - (*_graphicsManager->_vPort)->setupViewPort(NULL); + _graphicsManager->_vPort->setupViewPort(NULL); _graphicsManager->screenReset(); if (_bVoy->getBoltGroup(0x600)) { RL2Decoder decoder; - decoder.loadFile("a1100200.rl2"); + decoder.loadRL2File("a1100200.rl2", false); decoder.start(); decoder.play(this); @@ -250,7 +250,7 @@ void VoyeurEngine::doTailTitle() { PictureResource *pic = _bVoy->boltEntry(0x602)._picResource; CMapResource *pal = _bVoy->boltEntry(0x603)._cMapResource; - (*_graphicsManager->_vPort)->setupViewPort(pic); + _graphicsManager->_vPort->setupViewPort(pic); pal->startFade(); flipPageAndWaitForFade(); _eventsManager->delayClick(300); @@ -258,7 +258,7 @@ void VoyeurEngine::doTailTitle() { pic = _bVoy->boltEntry(0x604)._picResource; pal = _bVoy->boltEntry(0x605)._cMapResource; - (*_graphicsManager->_vPort)->setupViewPort(pic); + _graphicsManager->_vPort->setupViewPort(pic); pal->startFade(); flipPageAndWaitForFade(); _eventsManager->delayClick(120); @@ -283,7 +283,7 @@ void VoyeurEngine::doClosingCredits() { const char *msg = (const char *)_bVoy->memberAddr(0x404); const byte *creditList = (const byte *)_bVoy->memberAddr(0x405); - (*_graphicsManager->_vPort)->setupViewPort(NULL); + _graphicsManager->_vPort->setupViewPort(NULL); _graphicsManager->setColor(1, 180, 180, 180); _graphicsManager->setColor(2, 200, 200, 200); _eventsManager->_intPtr._hasPalette = true; @@ -292,7 +292,7 @@ void VoyeurEngine::doClosingCredits() { _graphicsManager->_fontPtr->_foreColor = 2; _graphicsManager->_fontPtr->_backColor = 2; _graphicsManager->_fontPtr->_fontSaveBack = false; - _graphicsManager->_fontPtr->_fontFlags = 0; + _graphicsManager->_fontPtr->_fontFlags = DISPFLAG_NONE; _soundManager->startVOCPlay(152); FontInfoResource &fi = *_graphicsManager->_fontPtr; @@ -302,7 +302,7 @@ void VoyeurEngine::doClosingCredits() { int flags = READ_LE_UINT16(entry + 4); if (flags & 0x10) - (*_graphicsManager->_vPort)->fillPic(0); + _graphicsManager->_vPort->fillPic(0); if (flags & 1) { fi._foreColor = 1; @@ -312,7 +312,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(0, READ_LE_UINT16(entry)); - (*_graphicsManager->_vPort)->drawText(msg); + _graphicsManager->_vPort->drawText(msg); msg += strlen(msg) + 1; } @@ -324,7 +324,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(0, READ_LE_UINT16(entry)); - (*_graphicsManager->_vPort)->drawText(msg); + _graphicsManager->_vPort->drawText(msg); msg += strlen(msg) + 1; } @@ -336,7 +336,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(38, READ_LE_UINT16(entry)); - (*_graphicsManager->_vPort)->drawText(msg); + _graphicsManager->_vPort->drawText(msg); msg += strlen(msg) + 1; fi._foreColor = 2; @@ -345,7 +345,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(198, READ_LE_UINT16(entry)); - (*_graphicsManager->_vPort)->drawText(msg); + _graphicsManager->_vPort->drawText(msg); msg += strlen(msg) + 1; } @@ -357,7 +357,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(0, READ_LE_UINT16(entry)); - (*_graphicsManager->_vPort)->drawText(msg); + _graphicsManager->_vPort->drawText(msg); msg += strlen(msg) + 1; fi._foreColor = 2; @@ -367,7 +367,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(0, READ_LE_UINT16(entry) + 13); - (*_graphicsManager->_vPort)->drawText(msg); + _graphicsManager->_vPort->drawText(msg); msg += strlen(msg) + 1; } @@ -390,15 +390,15 @@ void VoyeurEngine::doPiracy() { _graphicsManager->setColor(1, 0, 0, 0); _graphicsManager->setColor(2, 255, 255, 255); _eventsManager->_intPtr._hasPalette = true; - (*_graphicsManager->_vPort)->setupViewPort(NULL); - (*_graphicsManager->_vPort)->fillPic(1); + _graphicsManager->_vPort->setupViewPort(NULL); + _graphicsManager->_vPort->fillPic(1); FontInfoResource &fi = *_graphicsManager->_fontPtr; fi._curFont = _bVoy->boltEntry(0x101)._fontResource; fi._foreColor = 2; fi._backColor = 2; fi._fontSaveBack = false; - fi._fontFlags = 0; + fi._fontFlags = DISPFLAG_NONE; fi._justify = ALIGN_CENTER; fi._justifyWidth = 384; fi._justifyHeight = 230; @@ -407,7 +407,7 @@ void VoyeurEngine::doPiracy() { int yp, idx; for (idx = 0, yp = 33; idx < 10; ++idx) { fi._pos = Common::Point(0, yp); - (*_graphicsManager->_vPort)->drawText(PIRACY_MESSAGE[idx]); + _graphicsManager->_vPort->drawText(PIRACY_MESSAGE[idx]); yp += fi._curFont->_fontHeight + 4; } @@ -442,7 +442,7 @@ void VoyeurEngine::reviewTape() { _graphicsManager->_backColors = _bVoy->boltEntry(0x902)._cMapResource; _graphicsManager->_backgroundPage = _bVoy->boltEntry(0x901)._picResource; - (*_graphicsManager->_vPort)->setupViewPort(_graphicsManager->_backgroundPage); + _graphicsManager->_vPort->setupViewPort(_graphicsManager->_backgroundPage); _graphicsManager->_backColors->startFade(); flipPageAndWaitForFade(); @@ -460,7 +460,7 @@ void VoyeurEngine::reviewTape() { _eventsManager->_intPtr._hasPalette = true; _graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x909)._fontResource; _graphicsManager->_fontPtr->_fontSaveBack = false; - _graphicsManager->_fontPtr->_fontFlags = 0; + _graphicsManager->_fontPtr->_fontFlags = DISPFLAG_NONE; _eventsManager->getMouseInfo(); if (newX == -1) { @@ -489,7 +489,7 @@ void VoyeurEngine::reviewTape() { int yp = 45; int eventNum = eventStart; for (int lineNum = 0; lineNum < 8 && eventNum < _voy->_eventCount; ++lineNum, ++eventNum) { - _graphicsManager->_fontPtr->_picFlags = 0; + _graphicsManager->_fontPtr->_picFlags = DISPFLAG_NONE; _graphicsManager->_fontPtr->_picSelect = 0xff; _graphicsManager->_fontPtr->_picPick = 7; _graphicsManager->_fontPtr->_picOnOff = (lineNum == eventLine) ? 8 : 0; @@ -504,15 +504,15 @@ void VoyeurEngine::reviewTape() { yp += 15; } - (*_graphicsManager->_vPort)->addSaveRect( - (*_graphicsManager->_vPort)->_lastPage, tempRect); + _graphicsManager->_vPort->addSaveRect( + _graphicsManager->_vPort->_lastPage, tempRect); flipPageAndWait(); - (*_graphicsManager->_vPort)->addSaveRect( - (*_graphicsManager->_vPort)->_lastPage, tempRect); + _graphicsManager->_vPort->addSaveRect( + _graphicsManager->_vPort->_lastPage, tempRect); } - _graphicsManager->sDrawPic(cursor, *_graphicsManager->_vPort, + _graphicsManager->sDrawPic(cursor, _graphicsManager->_vPort, _eventsManager->getMousePos()); flipPageAndWait(); @@ -551,7 +551,7 @@ void VoyeurEngine::reviewTape() { int yp = 45; int eventNum = eventStart; for (int idx = 0; idx < 8 && eventNum < _voy->_eventCount; ++idx, ++eventNum) { - _graphicsManager->_fontPtr->_picFlags = 0; + _graphicsManager->_fontPtr->_picFlags = DISPFLAG_NONE; _graphicsManager->_fontPtr->_picSelect = 0xff; _graphicsManager->_fontPtr->_picPick = 7; _graphicsManager->_fontPtr->_picOnOff = (idx == eventLine) ? 8 : 0; @@ -566,12 +566,12 @@ void VoyeurEngine::reviewTape() { yp += 15; } - (*_graphicsManager->_vPort)->addSaveRect( - (*_graphicsManager->_vPort)->_lastPage, tempRect); + _graphicsManager->_vPort->addSaveRect( + _graphicsManager->_vPort->_lastPage, tempRect); flipPageAndWait(); - (*_graphicsManager->_vPort)->addSaveRect( - (*_graphicsManager->_vPort)->_lastPage, tempRect); + _graphicsManager->_vPort->addSaveRect( + _graphicsManager->_vPort->_lastPage, tempRect); flipPageAndWait(); _eventsManager->getMouseInfo(); @@ -651,7 +651,7 @@ void VoyeurEngine::reviewTape() { newY = _eventsManager->getMousePos().y; _voy->_fadingType = 0; _voy->_viewBounds = nullptr; - (*_graphicsManager->_vPort)->setupViewPort(NULL); + _graphicsManager->_vPort->setupViewPort(NULL); if (_currentVocId != -1) { _voy->_vocSecondsOffset = _voy->_RTVNum - _voy->_musicStartTime; @@ -679,7 +679,7 @@ void VoyeurEngine::reviewTape() { _graphicsManager->_backColors = _bVoy->boltEntry(0x7F01 + BLIND_TABLE[_audioVideoId])._cMapResource; - (*_graphicsManager->_vPort)->setupViewPort(_graphicsManager->_backgroundPage); + _graphicsManager->_vPort->setupViewPort(_graphicsManager->_backgroundPage); _graphicsManager->_backColors->startFade(); flipPageAndWaitForFade(); @@ -728,7 +728,7 @@ void VoyeurEngine::reviewTape() { _graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource; - (*_graphicsManager->_vPort)->fillPic(0); + _graphicsManager->_vPort->fillPic(0); flipPageAndWait(); _bVoy->freeBoltGroup(0x900); } @@ -742,7 +742,7 @@ void VoyeurEngine::doGossip() { // Load the gossip animation RL2Decoder decoder; - decoder.loadFile("a2050100.rl2", false); + decoder.loadRL2File("a2050100.rl2", false); decoder.start(); // Get the resource data for the first gossip video @@ -751,7 +751,7 @@ void VoyeurEngine::doGossip() { pal->startFade(); // Transfer initial background to video decoder - PictureResource videoFrame(decoder.getVideoTrack()->getBackSurface()); + PictureResource videoFrame(decoder.getRL2VideoTrack()->getBackSurface()); bgPic->_bounds.moveTo(0, 0); _graphicsManager->sDrawPic(bgPic, &videoFrame, Common::Point(0, 0)); @@ -768,7 +768,7 @@ void VoyeurEngine::doGossip() { // Play interview video RL2Decoder decoder2; - decoder2.loadFile("a2110100.rl2", true); + decoder2.loadRL2File("a2110100.rl2", true); decoder2.start(); _eventsManager->getMouseInfo(); @@ -789,8 +789,8 @@ void VoyeurEngine::doTapePlaying() { PictureResource *pic = _bVoy->boltEntry(0xA02)._picResource; VInitCycleResource *cycle = _bVoy->boltEntry(0xA05)._vInitCycleResource; - (*_graphicsManager->_vPort)->setupViewPort(_graphicsManager->_backgroundPage); - _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point(57, 30)); + _graphicsManager->_vPort->setupViewPort(_graphicsManager->_backgroundPage); + _graphicsManager->sDrawPic(pic, _graphicsManager->_vPort, Common::Point(57, 30)); _graphicsManager->_backColors->startFade(); flipPageAndWaitForFade(); @@ -933,7 +933,7 @@ int VoyeurEngine::getChooseButton() { + 6)._rectResource->_entries; int selectedIndex = -1; - (*_graphicsManager->_vPort)->setupViewPort(_graphicsManager->_backgroundPage); + _graphicsManager->_vPort->setupViewPort(_graphicsManager->_backgroundPage); _graphicsManager->_backColors->_steps = 0; _graphicsManager->_backColors->startFade(); flipPageAndWait(); @@ -956,7 +956,7 @@ int VoyeurEngine::getChooseButton() { selectedIndex = idx; if (selectedIndex != prevIndex) { PictureResource *btnPic = _bVoy->boltEntry(_playStampGroupId + 8 + idx)._picResource; - _graphicsManager->sDrawPic(btnPic, *_graphicsManager->_vPort, + _graphicsManager->sDrawPic(btnPic, _graphicsManager->_vPort, Common::Point(106, 200)); cursorPic = _bVoy->boltEntry(_playStampGroupId + 4)._picResource; @@ -968,11 +968,11 @@ int VoyeurEngine::getChooseButton() { if (selectedIndex == -1) { cursorPic = _bVoy->boltEntry(_playStampGroupId + 2)._picResource; PictureResource *btnPic = _bVoy->boltEntry(_playStampGroupId + 12)._picResource; - _graphicsManager->sDrawPic(btnPic, *_graphicsManager->_vPort, + _graphicsManager->sDrawPic(btnPic, _graphicsManager->_vPort, Common::Point(106, 200)); } - _graphicsManager->sDrawPic(cursorPic, *_graphicsManager->_vPort, + _graphicsManager->sDrawPic(cursorPic, _graphicsManager->_vPort, Common::Point(pt.x + 13, pt.y - 12)); flipPageAndWait(); @@ -985,7 +985,7 @@ int VoyeurEngine::getChooseButton() { void VoyeurEngine::makeViewFinder() { _graphicsManager->_backgroundPage = _bVoy->boltEntry(0x103)._picResource; _graphicsManager->sDrawPic(_graphicsManager->_backgroundPage, - *_graphicsManager->_vPort, Common::Point(0, 0)); + _graphicsManager->_vPort, Common::Point(0, 0)); CMapResource *pal = _bVoy->boltEntry(0x104)._cMapResource; int palOffset = 0; @@ -1017,7 +1017,7 @@ void VoyeurEngine::makeViewFinder() { break; } - (*_graphicsManager->_vPort)->drawIfaceTime(); + _graphicsManager->_vPort->drawIfaceTime(); doTimeBar(); pal->startFade(); @@ -1080,7 +1080,7 @@ void VoyeurEngine::initIFace() { void VoyeurEngine::doScroll(const Common::Point &pt) { Common::Rect clipRect(72, 47, 72 + 240, 47 + 148); - (*_graphicsManager->_vPort)->setupViewPort(NULL, &clipRect); + _graphicsManager->_vPort->setupViewPort(NULL, &clipRect); int base = 0; switch (_voy->_transitionId) { @@ -1104,18 +1104,18 @@ void VoyeurEngine::doScroll(const Common::Point &pt) { if (base) { PictureResource *pic = _bVoy->boltEntry(base + 3)._picResource; - _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y - 104)); + _graphicsManager->sDrawPic(pic, _graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y - 104)); pic = _bVoy->boltEntry(base + 4)._picResource; - _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y - 44)); + _graphicsManager->sDrawPic(pic, _graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y - 44)); pic = _bVoy->boltEntry(base + 5)._picResource; - _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 16)); + _graphicsManager->sDrawPic(pic, _graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 16)); pic = _bVoy->boltEntry(base + 6)._picResource; - _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 76)); + _graphicsManager->sDrawPic(pic, _graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 76)); pic = _bVoy->boltEntry(base + 7)._picResource; - _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 136)); + _graphicsManager->sDrawPic(pic, _graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 136)); } - (*_graphicsManager->_vPort)->setupViewPort(NULL); + _graphicsManager->_vPort->setupViewPort(NULL); } void VoyeurEngine::checkTransition() { @@ -1171,7 +1171,7 @@ int VoyeurEngine::doComputerText(int maxLen) { font._curFont = _bVoy->boltEntry(0x4910)._fontResource; font._foreColor = 129; font._fontSaveBack = false; - font._fontFlags = 0; + font._fontFlags = DISPFLAG_NONE; if (_voy->_vocSecondsOffset > 60) _voy->_vocSecondsOffset = 0; @@ -1182,7 +1182,7 @@ int VoyeurEngine::doComputerText(int maxLen) { font._justifyWidth = 384; font._justifyHeight = 100; font._pos = Common::Point(128, 100); - (*_graphicsManager->_vPort)->drawText(END_OF_MESSAGE); + _graphicsManager->_vPort->drawText(END_OF_MESSAGE); } else if (_voy->_RTVNum < _voy->_computerTimeMin && maxLen == 9999) { if (_currentVocId != -1) _soundManager->startVOCPlay(_currentVocId); @@ -1190,7 +1190,7 @@ int VoyeurEngine::doComputerText(int maxLen) { font._justifyWidth = 384; font._justifyHeight = 100; font._pos = Common::Point(120, 100); - (*_graphicsManager->_vPort)->drawText(START_OF_MESSAGE); + _graphicsManager->_vPort->drawText(START_OF_MESSAGE); } else { char *msg = (char *)_bVoy->memberAddr(0x4900 + _voy->_computerTextId); font._pos = Common::Point(96, 60); @@ -1210,12 +1210,12 @@ int VoyeurEngine::doComputerText(int maxLen) { _eventsManager->delay(90); _graphicsManager->_drawPtr->_pos = Common::Point(96, 54); _graphicsManager->_drawPtr->_penColor = 254; - (*_graphicsManager->_vPort)->sFillBox(196, 124); + _graphicsManager->_vPort->sFillBox(196, 124); _graphicsManager->_fontPtr->_justify = ALIGN_LEFT; _graphicsManager->_fontPtr->_justifyWidth = 384; _graphicsManager->_fontPtr->_justifyHeight = 100; _graphicsManager->_fontPtr->_pos = Common::Point(128, 100); - (*_graphicsManager->_vPort)->drawText(END_OF_MESSAGE); + _graphicsManager->_vPort->drawText(END_OF_MESSAGE); } break; } @@ -1227,7 +1227,7 @@ int VoyeurEngine::doComputerText(int maxLen) { _eventsManager->delay(90); _graphicsManager->_drawPtr->_pos = Common::Point(96, 54); _graphicsManager->_drawPtr->_penColor = 255; - (*_graphicsManager->_vPort)->sFillBox(196, 124); + _graphicsManager->_vPort->sFillBox(196, 124); yp = 60; } @@ -1238,7 +1238,7 @@ int VoyeurEngine::doComputerText(int maxLen) { _graphicsManager->_fontPtr->_justify = ALIGN_LEFT; _graphicsManager->_fontPtr->_justifyWidth = 0; _graphicsManager->_fontPtr->_justifyHeight = 0; - (*_graphicsManager->_vPort)->drawText(Common::String(c)); + _graphicsManager->_vPort->drawText(Common::String(c)); _eventsManager->delay(4); } @@ -1265,7 +1265,7 @@ void VoyeurEngine::getComputerBrush() { int xp = (384 - pic->_bounds.width()) / 2; int yp = (240 - pic->_bounds.height()) / 2 - 4; - (*_graphicsManager->_vPort)->drawPicPerm(pic, Common::Point(xp, yp)); + _graphicsManager->_vPort->drawPicPerm(pic, Common::Point(xp, yp)); CMapResource *pal = _bVoy->boltEntry(0x490F)._cMapResource; pal->startFade(); @@ -1285,14 +1285,14 @@ void VoyeurEngine::doTimeBar() { _graphicsManager->_drawPtr->_penColor = 134; _graphicsManager->_drawPtr->_pos = Common::Point(39, 92); - (*_graphicsManager->_vPort)->sFillBox(6, fullHeight - 92); + _graphicsManager->_vPort->sFillBox(6, fullHeight - 92); if (height > 0) { _graphicsManager->setColor(215, 238, 238, 238); _eventsManager->_intPtr._hasPalette = true; _graphicsManager->_drawPtr->_penColor = 215; _graphicsManager->_drawPtr->_pos = Common::Point(39, fullHeight); - (*_graphicsManager->_vPort)->sFillBox(6, height); + _graphicsManager->_vPort->sFillBox(6, height); } } } @@ -1345,7 +1345,7 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) { _bVoy->getBoltGroup(_voy->_boltGroupId2); PictureResource *pic = _bVoy->boltEntry(_voy->_boltGroupId2 + evidId * 2)._picResource; - _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point( + _graphicsManager->sDrawPic(pic, _graphicsManager->_vPort, Common::Point( (384 - pic->_bounds.width()) / 2, (240 - pic->_bounds.height()) / 2)); _bVoy->freeBoltMember(_voy->_boltGroupId2 + evidId * 2); @@ -1396,7 +1396,7 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) { continue; pic = _voy->_evPicPtrs[arrIndex]; - _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, + _graphicsManager->sDrawPic(pic, _graphicsManager->_vPort, Common::Point((384 - pic->_bounds.width()) / 2, (240 - pic->_bounds.height()) / 2)); _voy->_evCmPtrs[arrIndex]->startFade(); diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp index c5a1e91ef5..df9a8648db 100644 --- a/engines/wintermute/base/font/base_font_truetype.cpp +++ b/engines/wintermute/base/font/base_font_truetype.cpp @@ -625,6 +625,8 @@ bool BaseFontTT::initFont() { warning("Looking for %s", fontName.c_str()); _font = FontMan.getFontByName(fontName); } +#else + warning("BaseFontTT::InitFont - FreeType2-support not compiled in, TTF-fonts will not be loaded"); #endif // USE_FREETYPE2 // Fallback4: Just use the Big GUI-font. (REALLY undesireable) diff --git a/engines/wintermute/detection.cpp b/engines/wintermute/detection.cpp index 48c75f634d..a659c434d0 100644 --- a/engines/wintermute/detection.cpp +++ b/engines/wintermute/detection.cpp @@ -107,11 +107,11 @@ public: } } // Prefix to avoid collisions with actually known games - name = "wmefan-" + name; + name = "wmeunk-" + name; Common::strlcpy(s_fallbackGameIdBuf, name.c_str(), sizeof(s_fallbackGameIdBuf) - 1); s_fallbackDesc.gameid = s_fallbackGameIdBuf; if (caption != name) { - caption += " (fangame) "; + caption += " (unknown version) "; char *offset = s_fallbackGameIdBuf + name.size() + 1; uint32 remainingLength = (sizeof(s_fallbackGameIdBuf) - 1) - (name.size() + 1); Common::strlcpy(offset, caption.c_str(), remainingLength); diff --git a/engines/wintermute/detection_tables.h b/engines/wintermute/detection_tables.h index e0ceb43c1f..6556d3b34a 100644 --- a/engines/wintermute/detection_tables.h +++ b/engines/wintermute/detection_tables.h @@ -38,6 +38,7 @@ static const PlainGameDescriptor wintermuteGames[] = { {"carolreed8", "Carol Reed 8 - Amber's Blood"}, {"carolreed9", "Carol Reed 9 - Cold Case Summer"}, {"chivalry", "Chivalry is Not Dead"}, + {"corrosion", "Corrosion: Cold Winter Waiting"}, {"deadcity", "Dead City"}, {"dreaming", "Des Reves Elastiques Avec Mille Insectes Nommes Georges"}, {"dirtysplit", "Dirty Split"}, @@ -58,6 +59,8 @@ static const PlainGameDescriptor wintermuteGames[] = { {"projectdoom", "Project: Doom"}, {"reversion1", "Reversion: The Escape"}, {"reversion2", "Reversion: The Meeting"}, + {"rhiannon", "Rhiannon: Curse of the four Branches"}, + {"ritter", "1 1/2 Ritter: Auf der Suche nach der hinreissenden Herzelinde"}, {"rosemary", "Rosemary"}, {"securanote", "Securanote"}, {"shaban", "Shaban"}, @@ -70,6 +73,7 @@ static const PlainGameDescriptor wintermuteGames[] = { {"twc", "the white chamber"}, {"wintermute", "Wintermute engine game"}, {"wtetris", "Wilma Tetris"}, + {"zilm", "Zilm: A Game of Reflex"}, {0, 0} }; @@ -124,6 +128,16 @@ static const ADGameDescription gameDescriptions[] = { ADGF_UNSTABLE, GUIO0() }, + // Bickadoodle (download from http://aethericgames.com/games/bickadoodle/download-bickadoodle/) + { + "bickadoodle", + "", + AD_ENTRY1s("data.dcp", "1584d83577c32add0fce27fae91141a2", 35337728), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_UNSTABLE, + GUIO0() + }, // Book of Gron Part One { "bookofgron", @@ -237,6 +251,16 @@ static const ADGameDescription gameDescriptions[] = { ADGF_TESTING, GUIO0() }, + // Corrosion: Cold Winter Waiting + { + "corrosion", + "", + AD_ENTRY1s("data.dcp", "ae885b1a8faa0b27f43c0e8f0df02fc9", 525931618), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_TESTING, + GUIO0() + }, // Dead City (Czech) { "deadcity", @@ -428,7 +452,21 @@ static const ADGameDescription gameDescriptions[] = { ADGF_UNSTABLE, GUIO0() }, - // Ghosts in the Sheet + // Ghost in the Sheet + { + "ghostsheet", + "", + { + {"english.dcp", 0, "e6d0aad2c89996bcabe416105a3d6d3a", 12221017}, + {"data.dcp", 0, "b2f8b05328e4881e15e98e845b63f451", 168003}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_UNSTABLE, + GUIO0() + }, + // Ghost in the Sheet (Demo) { "ghostsheet", "Demo", @@ -530,6 +568,16 @@ static const ADGameDescription gameDescriptions[] = { ADGF_UNSTABLE, GUIO0() }, + // J.U.L.I.A. (English, Bundle in a box-version) + { + "julia", + "Version 1.2", + AD_ENTRY1s("data.dcp", "fe90023ccc22f35185b40b910e0d03a2", 10101373), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_UNSTABLE, + GUIO0() + }, // J.U.L.I.A. (English) (Demo) { "julia", @@ -996,6 +1044,56 @@ static const ADGameDescription gameDescriptions[] = { ADGF_UNSTABLE, GUIO0() }, + // Reversion: The Meeting Version 2.0.2412 (Chinese) + { + "reversion2", + "Version 2.0.2412", + { + {"data.dcp", 0, "f4ffc4df24b7bebad56a24930f33a2bc", 255766600}, + {"xlanguage_nz.dcp", 0, "17c79af4928e24484bee77a7e807cc2a", 10737127}, + {"Linux.dcp", 0, "21858bd77dc86b03f701fd47900e2f51", 984535}, + AD_LISTEND + }, + Common::ZH_CNA, + Common::kPlatformLinux, + ADGF_UNSTABLE, + GUIO0() + }, + // Reversion: The Meeting Version 2.0.2412 (English) + { + "reversion2", + "Version 2.0.2412", + { + {"data.dcp", 0, "f4ffc4df24b7bebad56a24930f33a2bc", 255766600}, + {"xlanguage_en.dcp", 0, "0598bf752ce93b42bcaf1094df537c7b", 8533057}, + {"Linux.dcp", 0, "21858bd77dc86b03f701fd47900e2f51", 984535}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformLinux, + ADGF_UNSTABLE, + GUIO0() + }, + // Rhiannon: Curse of the four Branches + { + "rhiannon", + "", + AD_ENTRY1s("data.dcp", "870f348900b735f1cc79c0608ce32b0e", 1046169851), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_UNSTABLE, + GUIO0() + }, + // 1 1/2 Ritter: Auf der Suche nach der hinreissenden Herzelinde + { + "ritter", + "", + AD_ENTRY1s("data.dcp", "5ac416cee605d3a30f4d59687b1cdab2", 364260278), + Common::DE_DEU, + Common::kPlatformWindows, + ADGF_UNSTABLE, + GUIO0() + }, // Rosemary { "rosemary", @@ -1108,6 +1206,16 @@ static const ADGameDescription gameDescriptions[] = { ADGF_UNSTABLE, GUIO0() }, + // Zilm: A Game of Reflex 1.0 + { + "Zilm", + "1.0", + AD_ENTRY1s("data.dcp", "098dffaf03d8adbb4cb5633e4733e63c", 351726), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_UNSTABLE, + GUIO0() + }, AD_TABLE_END_MARKER }; diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp index e8628ef6a6..5fe0d13766 100644 --- a/engines/wintermute/graphics/transparent_surface.cpp +++ b/engines/wintermute/graphics/transparent_surface.cpp @@ -84,20 +84,23 @@ void BlenderAdditive::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *o if (ina == 0) { return; } else { - if (*cb != 255) + if (*cb != 255) { *outb = MIN(*outb + ((inb * (*cb) * ina) >> 16), 255); - else + } else { *outb = MIN(*outb + (inb * ina >> 8), 255); + } - if (*cg != 255) + if (*cg != 255) { *outg = MIN(*outg + ((ing * (*cg) * ina) >> 16), 255); - else + } else { *outg = MIN(*outg + (ing * ina >> 8), 255); + } - if (*cr != 255) + if (*cr != 255) { *outr = MIN(*outr + ((inr * (*cr) * ina) >> 16), 255); - else + } else { *outr = MIN(*outr + (inr * ina >> 8), 255); + } } } @@ -120,20 +123,23 @@ void BlenderSubtractive::blendPixel(byte ina, byte inr, byte ing, byte inb, byte if (ina == 0) { return; } else { - if (*cb != 255) + if (*cb != 255) { *outb = MAX(*outb - ((inb * (*cb) * (*outb) * ina) >> 24), 0); - else + } else { *outb = MAX(*outb - (inb * (*outb) * ina >> 16), 0); + } - if (*cg != 255) + if (*cg != 255) { *outg = MAX(*outg - ((ing * (*cg) * (*outg) * ina) >> 24), 0); - else + } else { *outg = MAX(*outg - (ing * (*outg) * ina >> 16), 0); + } - if (*cr != 255) - *outr = MAX(*outr - ((inr * (*cr) * (*outr) * ina) >> 24), 0); - else + if (*cr != 255) { + *outr = MAX(*outr - ((inr * (*cr) * (*outr) * ina) >> 24), 0); + } else { *outr = MAX(*outr - (inr * (*outr) * ina >> 16), 0); + } } } @@ -152,20 +158,23 @@ void BlenderNormal::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *out if (ina == 0) { return; } else if (ina == 255) { - if (*cb != 255) + if (*cb != 255) { *outb = (inb * (*cb)) >> 8; - else + } else { *outb = inb; + } - if (*cr != 255) + if (*cr != 255) { *outr = (inr * (*cr)) >> 8; - else + } else { *outr = inr; + } - if (*cg != 255) + if (*cg != 255) { *outg = (ing * (*cg)) >> 8; - else + } else { *outg = ing; + } *outa = ina; @@ -178,26 +187,29 @@ void BlenderNormal::blendPixel(byte ina, byte inr, byte ing, byte inb, byte *out *outr = (*outr * (255 - ina) >> 8); *outg = (*outg * (255 - ina) >> 8); - if (*cb == 0) + if (*cb == 0) { *outb = *outb; - else if (*cb != 255) + } else if (*cb != 255) { *outb = *outb + (inb * ina * (*cb) >> 16); - else + } else { *outb = *outb + (inb * ina >> 8); + } - if (*cr == 0) + if (*cr == 0) { *outr = *outr; - else if (*cr != 255) + } else if (*cr != 255) { *outr = *outr + (inr * ina * (*cr) >> 16); - else + } else { *outr = *outr + (inr * ina >> 8); + } - if (*cg == 0) + if (*cg == 0) { *outg = *outg; - else if (*cg != 255) + } else if (*cg != 255) { *outg = *outg + (ing * ina * (*cg) >> 16); - else + } else { *outg = *outg + (ing * ina >> 8); + } return; } @@ -375,10 +387,10 @@ void doBlit(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, in byte *outb = &out[TransparentSurface::kBIndex]; b.blendPixel(in[TransparentSurface::kAIndex], - in[TransparentSurface::kRIndex], - in[TransparentSurface::kGIndex], - in[TransparentSurface::kBIndex], - outa, outr, outg, outb); + in[TransparentSurface::kRIndex], + in[TransparentSurface::kGIndex], + in[TransparentSurface::kBIndex], + outa, outr, outg, outb); in += inStep; out += 4; @@ -404,10 +416,10 @@ void doBlit(byte *ino, byte *outo, uint32 width, uint32 height, uint32 pitch, in byte *outb = &out[TransparentSurface::kBIndex]; b.blendPixel(in[TransparentSurface::kAIndex], - in[TransparentSurface::kRIndex], - in[TransparentSurface::kGIndex], - in[TransparentSurface::kBIndex], - outa, outr, outg, outb, &ca, &cr, &cg, &cb); + in[TransparentSurface::kRIndex], + in[TransparentSurface::kGIndex], + in[TransparentSurface::kBIndex], + outa, outr, outg, outb, &ca, &cr, &cg, &cb); in += inStep; out += 4; } @@ -427,8 +439,9 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p // Check if we need to draw anything at all int ca = (color >> 24) & 0xff; - if (ca == 0) + if (ca == 0) { return retSize; + } // Create an encapsulating surface for the data TransparentSurface srcImage(*this, false); @@ -456,17 +469,19 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p srcImage.h = pPartRect->height(); debug(6, "Blit(%d, %d, %d, [%d, %d, %d, %d], %08x, %d, %d)", posX, posY, flipping, - pPartRect->left, pPartRect->top, pPartRect->width(), pPartRect->height(), color, width, height); + pPartRect->left, pPartRect->top, pPartRect->width(), pPartRect->height(), color, width, height); } else { debug(6, "Blit(%d, %d, %d, [%d, %d, %d, %d], %08x, %d, %d)", posX, posY, flipping, 0, 0, - srcImage.w, srcImage.h, color, width, height); + srcImage.w, srcImage.h, color, width, height); } - if (width == -1) + if (width == -1) { width = srcImage.w; - if (height == -1) + } + if (height == -1) { height = srcImage.h; + } #ifdef SCALING_TESTING // Hardcode scaling to 66% to test scaling @@ -516,7 +531,7 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p yp = img->h - 1; } - byte *ino= (byte *)img->getBasePtr(xp, yp); + byte *ino = (byte *)img->getBasePtr(xp, yp); byte *outo = (byte *)target.getBasePtr(posX, posY); if (color == 0xFFFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_OPAQUE) { @@ -649,8 +664,9 @@ TransparentSurface *TransparentSurface::rotoscale(const TransformStruct &transfo target->create((uint16)dstW, (uint16)dstH, this->format); - if (transform._zoom.x == 0 || transform._zoom.y == 0) + if (transform._zoom.x == 0 || transform._zoom.y == 0) { return target; + } uint32 invAngle = 360 - (transform._angle % 360); float invCos = cos(invAngle * M_PI / 180.0); @@ -684,8 +700,12 @@ TransparentSurface *TransparentSurface::rotoscale(const TransformStruct &transfo for (int x = 0; x < dstW; x++) { int dx = (sdx >> 16); int dy = (sdy >> 16); - if (flipx) dx = sw - dx; - if (flipy) dy = sh - dy; + if (flipx) { + dx = sw - dx; + } + if (flipy) { + dy = sh - dy; + } #ifdef ENABLE_BILINEAR if ((dx > -1) && (dy > -1) && (dx < sw) && (dy < sh)) { @@ -694,7 +714,7 @@ TransparentSurface *TransparentSurface::rotoscale(const TransformStruct &transfo c00 = *sp; sp += 1; c01 = *sp; - sp += (this->pitch/4); + sp += (this->pitch / 4); c11 = *sp; sp -= 1; c10 = *sp; @@ -764,8 +784,8 @@ TransparentSurface *TransparentSurface::scale(uint16 newWidth, uint16 newHeight) bool flipx = false, flipy = false; // TODO: See mirroring comment in RenderTicket ctor - int *sax = new int[dstW+1]; - int *say = new int[dstH+1]; + int *sax = new int[dstW + 1]; + int *say = new int[dstH + 1]; assert(sax && say); /* @@ -808,14 +828,16 @@ TransparentSurface *TransparentSurface::scale(uint16 newWidth, uint16 newHeight) } } - const tColorRGBA *sp = (const tColorRGBA *) getBasePtr(0,0); - tColorRGBA *dp = (tColorRGBA *) target->getBasePtr(0,0); + const tColorRGBA *sp = (const tColorRGBA *) getBasePtr(0, 0); + tColorRGBA *dp = (tColorRGBA *) target->getBasePtr(0, 0); int spixelgap = srcW; - if (flipx) + if (flipx) { sp += spixelw; - if (flipy) + } + if (flipy) { sp += spixelgap * spixelh; + } csay = say; for (int y = 0; y < dstH; y++) { @@ -835,10 +857,11 @@ TransparentSurface *TransparentSurface::scale(uint16 newWidth, uint16 newHeight) c01 = sp; c10 = sp; if (cy < spixelh) { - if (flipy) + if (flipy) { c10 -= spixelgap; - else + } else { c10 += spixelgap; + } } c11 = c10; if (cx < spixelw) { @@ -874,10 +897,11 @@ TransparentSurface *TransparentSurface::scale(uint16 newWidth, uint16 newHeight) int *salastx = csax; csax++; int sstepx = (*csax >> 16) - (*salastx >> 16); - if (flipx) + if (flipx) { sp -= sstepx; - else + } else { sp += sstepx; + } /* * Advance destination pointer x @@ -891,10 +915,11 @@ TransparentSurface *TransparentSurface::scale(uint16 newWidth, uint16 newHeight) csay++; int sstepy = (*csay >> 16) - (*salasty >> 16); sstepy *= spixelgap; - if (flipy) + if (flipy) { sp = csp - sstepy; - else + } else { sp = csp + sstepy; + } } delete[] sax; @@ -903,14 +928,16 @@ TransparentSurface *TransparentSurface::scale(uint16 newWidth, uint16 newHeight) #else int *scaleCacheX = new int[dstW]; - for (int x = 0; x < dstW; x++) + for (int x = 0; x < dstW; x++) { scaleCacheX[x] = (x * srcW) / dstW; + } for (int y = 0; y < dstH; y++) { uint32 *destP = (uint32 *)target->getBasePtr(0, y); const uint32 *srcP = (const uint32 *)getBasePtr(0, (y * srcH) / dstH); - for (int x = 0; x < dstW; x++) + for (int x = 0; x < dstW; x++) { *destP++ = srcP[scaleCacheX[x]]; + } } delete[] scaleCacheX; diff --git a/engines/wintermute/graphics/transparent_surface.h b/engines/wintermute/graphics/transparent_surface.h index 7f6b1ac865..4ad9bf07eb 100644 --- a/engines/wintermute/graphics/transparent_surface.h +++ b/engines/wintermute/graphics/transparent_surface.h @@ -74,17 +74,17 @@ struct TransparentSurface : public Graphics::Surface { ALPHA_FULL = 2 }; - #ifdef SCUMM_LITTLE_ENDIAN +#ifdef SCUMM_LITTLE_ENDIAN static const int kAIndex = 0; static const int kBIndex = 1; static const int kGIndex = 2; static const int kRIndex = 3; - #else +#else static const int kAIndex = 3; static const int kBIndex = 2; static const int kGIndex = 1; static const int kRIndex = 0; - #endif +#endif static const int kBShift = 8;//img->format.bShift; static const int kGShift = 16;//img->format.gShift; diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index b0c469c440..e1553580ec 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -127,6 +127,7 @@ bool VideoTheoraPlayer::initialize(const Common::String &filename, const Common: #if defined (USE_THEORADEC) _theoraDecoder = new Video::TheoraDecoder(); #else + warning("VideoTheoraPlayer::initialize - Theora support not compiled in, video will be skipped: %s", filename.c_str()); return STATUS_FAILED; #endif _theoraDecoder->loadStream(_file); diff --git a/engines/zvision/fonts/truetype_font.cpp b/engines/zvision/fonts/truetype_font.cpp index 03520f18b6..ba4d72bde8 100644 --- a/engines/zvision/fonts/truetype_font.cpp +++ b/engines/zvision/fonts/truetype_font.cpp @@ -39,12 +39,9 @@ namespace ZVision { TruetypeFont::TruetypeFont(ZVision *engine, int32 fontHeight) - : _engine(engine), - _fontHeight(fontHeight), + : _fontHeight(fontHeight), _font(0), - _lineHeight(0), - _maxCharWidth(0), - _maxCharHeight(0) { + _lineHeight(0) { } TruetypeFont::~TruetypeFont(void) { diff --git a/engines/zvision/fonts/truetype_font.h b/engines/zvision/fonts/truetype_font.h index 3b5805db14..64f53a2c3b 100644 --- a/engines/zvision/fonts/truetype_font.h +++ b/engines/zvision/fonts/truetype_font.h @@ -43,12 +43,12 @@ public: ~TruetypeFont(); private: - ZVision *_engine; +// ZVision *_engine; Graphics::Font *_font; int _lineHeight; - size_t _maxCharWidth; - size_t _maxCharHeight; +// size_t _maxCharWidth; +// size_t _maxCharHeight; public: int32 _fontHeight; diff --git a/graphics/scaler/Normal2xARM.s b/graphics/scaler/Normal2xARM.s index e3592295e0..c5684c30e6 100644 --- a/graphics/scaler/Normal2xARM.s +++ b/graphics/scaler/Normal2xARM.s @@ -28,6 +28,7 @@ @ Assumes dst is aligned (so did the C) @ Assumes 16bit (so did the C) + .align 2 Normal2xARM: @ r0 = src @ r1 = srcPitch @@ -92,6 +93,7 @@ thin: @ Assumes dst is aligned (so did the C) @ Assumes 16bit (so did the C) + .align 2 Normal2xAspectMask: @ r0 = src @ r1 = srcPitch diff --git a/graphics/scaler/downscalerARM.s b/graphics/scaler/downscalerARM.s index e4662522aa..4c09381457 100644 --- a/graphics/scaler/downscalerARM.s +++ b/graphics/scaler/downscalerARM.s @@ -29,6 +29,7 @@ @ dstPtr. srcPitch and dstPitch identify how to reach subsequent @ lines. redblueMask and round allow for one routine to do both @ 565 and 555 formats. + .align 2 DownscaleAllByHalfARM: @ r0 = srcPtr @ r1 = srcPitch diff --git a/graphics/scaler/scale2xARM.s b/graphics/scaler/scale2xARM.s index 563a22eeb1..a56e78447f 100644 --- a/graphics/scaler/scale2xARM.s +++ b/graphics/scaler/scale2xARM.s @@ -37,6 +37,7 @@ @ We hold: r10 B @ r8 r14 r7 D E F @ r12 H + .align 2 scale2x_8_arm: STMFD r13!,{r4-r5,r7-r8,r10-r11,r14} LDR r4, [r13,#4*7] @@ -85,6 +86,7 @@ end8: LDMFD r13!,{r4-r5,r7-r8,r10-r11,PC} + .align 2 scale2x_16_arm: STMFD r13!,{r4-r5,r7-r8,r10-r11,r14} LDR r4, [r13,#4*7] @@ -133,6 +135,7 @@ end16: LDMFD r13!,{r4-r5,r7-r8,r10-r11,PC} + .align 2 scale2x_32_arm: STMFD r13!,{r4-r5,r7-r8,r10-r11,r14} LDR r4, [r13,#4*7] diff --git a/gui/dialog.cpp b/gui/dialog.cpp index ec392a877a..fa4e508494 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -250,7 +250,18 @@ void Dialog::handleKeyDown(Common::KeyState state) { close(); } - // TODO: tab/shift-tab should focus the next/previous focusable widget + if (state.keycode == Common::KEYCODE_TAB) { + // TODO: Maybe add Tab behaviours for all widgets too. + // searches through widgets on screen for tab widget + Widget *w = _firstWidget; + while (w) { + if (w->_type == kTabWidget) + if (w->handleKeyDown(state)) + return; + + w = w->_next; + } + } } void Dialog::handleKeyUp(Common::KeyState state) { diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat Binary files differindex 7bd1316208..1a7b49852d 100644 --- a/gui/themes/translations.dat +++ b/gui/themes/translations.dat diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp index a8b3f5450d..756781a04b 100644 --- a/gui/widgets/tab.cpp +++ b/gui/widgets/tab.cpp @@ -183,6 +183,7 @@ void TabWidget::setActiveTab(int tabID) { } _activeTab = tabID; _firstWidget = _tabs[tabID].firstWidget; + _boss->draw(); } } @@ -226,12 +227,34 @@ void TabWidget::handleMouseDown(int x, int y, int button, int clickCount) { } bool TabWidget::handleKeyDown(Common::KeyState state) { - // TODO: maybe there should be a way to switch between tabs - // using the keyboard? E.g. Alt-Shift-Left/Right-Arrow or something - // like that. + if (state.hasFlags(Common::KBD_SHIFT) && state.keycode == Common::KEYCODE_TAB) + adjustTabs(kTabBackwards); + else if (state.keycode == Common::KEYCODE_TAB) + adjustTabs(kTabForwards); + return Widget::handleKeyDown(state); } +void TabWidget::adjustTabs(int value) { + // Determine which tab is next + int tabID = _activeTab + value; + if (tabID >= (int)_tabs.size()) + tabID = 0; + else if (tabID < 0) + tabID = ((int)_tabs.size() - 1); + + // Slides _firstVisibleTab forward to the correct tab + int maxTabsOnScreen = (_w / _tabWidth); + if (tabID >= maxTabsOnScreen && (_firstVisibleTab + maxTabsOnScreen) < (int)_tabs.size()) + _firstVisibleTab++; + + // Slides _firstVisibleTab backwards to the correct tab + while (tabID < _firstVisibleTab) + _firstVisibleTab--; + + setActiveTab(tabID); +} + void TabWidget::reflowLayout() { Widget::reflowLayout(); diff --git a/gui/widgets/tab.h b/gui/widgets/tab.h index 38aa089eb5..a01ee2d9dc 100644 --- a/gui/widgets/tab.h +++ b/gui/widgets/tab.h @@ -28,6 +28,11 @@ #include "common/array.h" namespace GUI { + +enum { + kTabForwards = 1, + kTabBackwards = -1 +}; class TabWidget : public Widget { typedef Common::String String; @@ -109,6 +114,8 @@ protected: virtual void drawWidget(); virtual Widget *findWidget(int x, int y); + + virtual void adjustTabs(int value); }; } // End of namespace GUI diff --git a/po/cs_CZ.po b/po/cs_CZ.po index e03f36c938..4eced39273 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: ScummVM 1.4.0git\n" +"Project-Id-Version: ScummVM 1.7.0git\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" "POT-Creation-Date: 2014-02-14 21:53+0000\n" -"PO-Revision-Date: 2013-05-01 16:53+0100\n" +"PO-Revision-Date: 2014-02-27 21:43+0100\n" "Last-Translator: Zbyněk Schwarz <zbynek.schwarz@gmail.com>\n" "Language-Team: \n" "Language: Cesky\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" "X-Poedit-SourceCharset: iso-8859-2\n" -"X-Generator: Poedit 1.5.5\n" +"X-Generator: Poedit 1.6.4\n" "X-Poedit-Basepath: ..\n" #: gui/about.cpp:93 @@ -509,9 +509,8 @@ msgid "Do you really want to remove this game configuration?" msgstr "Opravdu chcete odstranit nastavení této hry?" #: gui/launcher.cpp:998 -#, fuzzy msgid "Do you want to load savegame?" -msgstr "Chcete hru nahrát nebo uložit?" +msgstr "Chcete načíst uloženou pozici?" #: gui/launcher.cpp:1047 msgid "This game does not support loading games from the launcher." @@ -750,15 +749,16 @@ msgid "True Roland MT-32 (no GM emulation)" msgstr "Opravdový Roland MT-32 (žádná GM emulace)" #: gui/options.cpp:890 -#, fuzzy msgid "Roland GS Device (enable MT-32 mappings)" -msgstr "Režim Roland GS (vypne mapování GM)" +msgstr "Zařízení Roland GS (zapne mapování MT-32)" #: gui/options.cpp:890 msgid "" "Check if you want to enable patch mappings to emulate an MT-32 on a Roland " "GS device" msgstr "" +"Zaškrtněte, pokud chcete povolit záplaty mapování umožňující emulovat MT-32 " +"na zařízení Roland GS" #: gui/options.cpp:899 msgid "Don't use Roland MT-32 music" @@ -1021,23 +1021,20 @@ msgid "Disabled GFX" msgstr "GFX zakázáno" #: gui/ThemeEngine.cpp:347 -#, fuzzy msgid "Standard Renderer" -msgstr "Standardní Vykreslovač (16bpp)" +msgstr "Standardní Vykreslovač" #: gui/ThemeEngine.cpp:347 engines/scumm/dialogs.cpp:658 msgid "Standard" msgstr "Standardní" #: gui/ThemeEngine.cpp:349 -#, fuzzy msgid "Antialiased Renderer" -msgstr "Vykreslovač s vyhlazenými hranami (16bpp)" +msgstr "Vykreslovač s vyhlazenými hranami" #: gui/ThemeEngine.cpp:349 -#, fuzzy msgid "Antialiased" -msgstr "S vyhlazenými hranami (16bpp)" +msgstr "S vyhlazenými hranami" #: gui/widget.cpp:322 gui/widget.cpp:324 gui/widget.cpp:330 gui/widget.cpp:332 msgid "Clear value" @@ -1667,13 +1664,12 @@ msgid "Windowed mode" msgstr "Režim do okna" #: backends/graphics/opengl/opengl-graphics.cpp:118 -#, fuzzy msgid "OpenGL" -msgstr "Otevřít" +msgstr "OpenGL" #: backends/graphics/opengl/opengl-graphics.cpp:119 msgid "OpenGL (No filtering)" -msgstr "" +msgstr "OpenGL (bez filtrování)" #: backends/platform/symbian/src/SymbianActions.cpp:38 #: backends/platform/wince/CEActionsSmartphone.cpp:39 @@ -2341,19 +2337,19 @@ msgstr "~E~fekt Vody Zapnut" #: engines/neverhood/detection.cpp:167 msgid "Skip the Hall of Records storyboard scenes" -msgstr "" +msgstr "Přeskočit scény v Síni záznamů" #: engines/neverhood/detection.cpp:168 msgid "Allows the player to skip past the Hall of Records storyboard scenes" -msgstr "" +msgstr "Umožňuje hráči přeskočit scény v Síni záznamů" #: engines/neverhood/detection.cpp:174 msgid "Scale the making of videos to full screen" -msgstr "" +msgstr "Zvětšit filmy o výrobě na celou obrazovku" #: engines/neverhood/detection.cpp:175 msgid "Scale the making of videos, so that they use the whole screen" -msgstr "" +msgstr "Zvětšit filmy o výrobě tak, aby využivaly celou obrazovku" #: engines/parallaction/saveload.cpp:133 #, c-format @@ -3180,9 +3176,8 @@ msgid "DXA cutscenes found but ScummVM has been built without zlib support" msgstr "Videa DXA nalezena, ale ScummVM byl sestaven bez podpory zlib" #: engines/sword1/animation.cpp:561 -#, fuzzy msgid "MPEG-2 cutscenes found but ScummVM has been built without MPEG-2" -msgstr "Videa PSX nalezena, ale ScummVM byl sestaven bez podpory barev RGB" +msgstr "Videa MPEG-2 nalezena, ale ScummVM byl sestaven bez MPEG-2" #: engines/sword1/animation.cpp:568 engines/sword2/animation.cpp:470 #, c-format @@ -3234,10 +3229,9 @@ msgid "" msgstr "Videa PSX nalezena, ale ScummVM byl sestaven bez podpory barev RGB" #: engines/sword2/animation.cpp:461 -#, fuzzy msgid "" "MPEG-2 cutscenes found but ScummVM has been built without MPEG-2 support" -msgstr "Videa DXA nalezena, ale ScummVM byl sestaven bez podpory zlib" +msgstr "Videa MPEG-2 nalezena, ale ScummVM byl sestaven bez podpory MPEG-2" #: engines/sword2/sword2.cpp:79 msgid "Show object labels" diff --git a/po/hu_HU.po b/po/hu_HU.po index 16ac5f383f..e4dbbe3652 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" "POT-Creation-Date: 2014-02-14 21:53+0000\n" -"PO-Revision-Date: 2013-04-25 06:38+0100\n" +"PO-Revision-Date: 2014-02-18 06:30+0100\n" "Last-Translator: George Kormendi <grubycza@hotmail.com>\n" "Language-Team: Hungarian\n" "Language: Magyar\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SourceCharset: iso-8859-1\n" -"X-Generator: Poedit 1.5.5\n" +"X-Generator: Poedit 1.6.4\n" #: gui/about.cpp:93 #, c-format @@ -508,9 +508,8 @@ msgid "Do you really want to remove this game configuration?" msgstr "Biztosan törölni akarod ezt a játékkonfigurációt?" #: gui/launcher.cpp:998 -#, fuzzy msgid "Do you want to load savegame?" -msgstr "Játékállás betöltése vagy mentése?" +msgstr "Akarod hogy betöltésem a játékállást?" #: gui/launcher.cpp:1047 msgid "This game does not support loading games from the launcher." @@ -748,15 +747,16 @@ msgid "True Roland MT-32 (no GM emulation)" msgstr "Roland MT-32 Hardver (GM emuláció nincs)" #: gui/options.cpp:890 -#, fuzzy msgid "Roland GS Device (enable MT-32 mappings)" -msgstr "Roland GS Mód (GM mapping tiltása)" +msgstr "Roland GS eszköz (MT-32 mapping engedélyezés)" #: gui/options.cpp:890 msgid "" "Check if you want to enable patch mappings to emulate an MT-32 on a Roland " "GS device" msgstr "" +"Ellenőrzés ha engedélyezni akarod az emulált MT-32 Folt leképezést a Roland " +"GS eszközön" #: gui/options.cpp:899 msgid "Don't use Roland MT-32 music" @@ -1019,23 +1019,20 @@ msgid "Disabled GFX" msgstr "GFX letiltva" #: gui/ThemeEngine.cpp:347 -#, fuzzy msgid "Standard Renderer" -msgstr "Standard leképező (16bpp)" +msgstr "Standard leképező" #: gui/ThemeEngine.cpp:347 engines/scumm/dialogs.cpp:658 msgid "Standard" msgstr "Átlagos" #: gui/ThemeEngine.cpp:349 -#, fuzzy msgid "Antialiased Renderer" -msgstr "Élsimításos leképező (16bpp)" +msgstr "Élsimításos leképező" #: gui/ThemeEngine.cpp:349 -#, fuzzy msgid "Antialiased" -msgstr "Élsimított (16bpp)" +msgstr "Élsimított" #: gui/widget.cpp:322 gui/widget.cpp:324 gui/widget.cpp:330 gui/widget.cpp:332 msgid "Clear value" @@ -1661,13 +1658,12 @@ msgid "Windowed mode" msgstr "Ablakos mód" #: backends/graphics/opengl/opengl-graphics.cpp:118 -#, fuzzy msgid "OpenGL" -msgstr "Nyit" +msgstr "OpenGL" #: backends/graphics/opengl/opengl-graphics.cpp:119 msgid "OpenGL (No filtering)" -msgstr "" +msgstr "OpenGL (Nincs szűrés)" #: backends/platform/symbian/src/SymbianActions.cpp:38 #: backends/platform/wince/CEActionsSmartphone.cpp:39 @@ -2330,19 +2326,20 @@ msgstr "Vízeffektus engedélyezve" #: engines/neverhood/detection.cpp:167 msgid "Skip the Hall of Records storyboard scenes" -msgstr "" +msgstr "Hall of Records storyboard átvezetők átugrása" #: engines/neverhood/detection.cpp:168 msgid "Allows the player to skip past the Hall of Records storyboard scenes" msgstr "" +"Lehetőség, hogy a játékos átugorja a Hall of Records storyboard átvezetőket" #: engines/neverhood/detection.cpp:174 msgid "Scale the making of videos to full screen" -msgstr "" +msgstr "Hogyan készült videók átméretezése teljesképernyőre" #: engines/neverhood/detection.cpp:175 msgid "Scale the making of videos, so that they use the whole screen" -msgstr "" +msgstr "Hogyan készült videók átméretezése, hogy teljesképernyőt használjanak" #: engines/parallaction/saveload.cpp:133 #, c-format @@ -3169,11 +3166,9 @@ msgid "DXA cutscenes found but ScummVM has been built without zlib support" msgstr "DXA átvezető elérhető, de a ScummVM zlib támogatás nincs lefordítva" #: engines/sword1/animation.cpp:561 -#, fuzzy msgid "MPEG-2 cutscenes found but ScummVM has been built without MPEG-2" msgstr "" -"PSX átvezetőfilmet találtam, de ez a ScummVM RGB színtámogatás nélkül van " -"lefordítva" +"MPEG-2 átvezetőfilmet találtam, de a ScummVM MPEG-2 nélkül van lefordítva" #: engines/sword1/animation.cpp:568 engines/sword2/animation.cpp:470 #, c-format @@ -3227,10 +3222,11 @@ msgstr "" "lefordítva" #: engines/sword2/animation.cpp:461 -#, fuzzy msgid "" "MPEG-2 cutscenes found but ScummVM has been built without MPEG-2 support" -msgstr "DXA átvezető elérhető, de a ScummVM zlib támogatás nincs lefordítva" +msgstr "" +"MPEG-2 átvezetőfilmet találtam, de a ScummVM MPEG-2 támogatás nélkül van " +"lefordítva" #: engines/sword2/sword2.cpp:79 msgid "Show object labels" diff --git a/test/common/util.h b/test/common/util.h index cd65307612..e195f13a84 100644 --- a/test/common/util.h +++ b/test/common/util.h @@ -115,7 +115,7 @@ class UtilTestSuite : public CxxTest::TestSuite { TS_ASSERT_EQUALS(Common::isAlnum('Z'), 1); TS_ASSERT_EQUALS(Common::isAlnum('1'), 1); TS_ASSERT_EQUALS(Common::isAlnum('0'), 1); - TS_ASSERT_EQUALS(Common::isAlnum('§'), 0); + TS_ASSERT_EQUALS(Common::isAlnum('\xA7'), 0); TS_ASSERT_EQUALS(Common::isAlnum('$'), 0); TS_ASSERT_EQUALS(Common::isAlnum(' '), 0); TS_ASSERT_EQUALS(Common::isAlnum('\n'), 0); @@ -136,7 +136,7 @@ class UtilTestSuite : public CxxTest::TestSuite { TS_ASSERT_EQUALS(Common::isAlpha('Z'), 1); TS_ASSERT_EQUALS(Common::isAlpha('1'), 0); TS_ASSERT_EQUALS(Common::isAlpha('0'), 0); - TS_ASSERT_EQUALS(Common::isAlpha('§'), 0); + TS_ASSERT_EQUALS(Common::isAlpha('\xA7'), 0); TS_ASSERT_EQUALS(Common::isAlpha('$'), 0); TS_ASSERT_EQUALS(Common::isAlpha(' '), 0); TS_ASSERT_EQUALS(Common::isAlpha('\n'), 0); @@ -157,7 +157,7 @@ class UtilTestSuite : public CxxTest::TestSuite { TS_ASSERT_EQUALS(Common::isDigit('Z'), 0); TS_ASSERT_EQUALS(Common::isDigit('1'), 1); TS_ASSERT_EQUALS(Common::isDigit('0'), 1); - TS_ASSERT_EQUALS(Common::isDigit('§'), 0); + TS_ASSERT_EQUALS(Common::isDigit('\xA7'), 0); TS_ASSERT_EQUALS(Common::isDigit('$'), 0); TS_ASSERT_EQUALS(Common::isDigit(' '), 0); TS_ASSERT_EQUALS(Common::isDigit('\n'), 0); @@ -178,7 +178,7 @@ class UtilTestSuite : public CxxTest::TestSuite { TS_ASSERT_EQUALS(Common::isLower('Z'), 0); TS_ASSERT_EQUALS(Common::isLower('1'), 0); TS_ASSERT_EQUALS(Common::isLower('0'), 0); - TS_ASSERT_EQUALS(Common::isLower('§'), 0); + TS_ASSERT_EQUALS(Common::isLower('\xA7'), 0); TS_ASSERT_EQUALS(Common::isLower('$'), 0); TS_ASSERT_EQUALS(Common::isLower(' '), 0); TS_ASSERT_EQUALS(Common::isLower('\n'), 0); @@ -200,7 +200,7 @@ class UtilTestSuite : public CxxTest::TestSuite { TS_ASSERT_EQUALS(Common::isUpper('Z'), 1); TS_ASSERT_EQUALS(Common::isUpper('1'), 0); TS_ASSERT_EQUALS(Common::isUpper('0'), 0); - TS_ASSERT_EQUALS(Common::isUpper('§'), 0); + TS_ASSERT_EQUALS(Common::isUpper('\xA7'), 0); TS_ASSERT_EQUALS(Common::isUpper('$'), 0); TS_ASSERT_EQUALS(Common::isUpper(' '), 0); TS_ASSERT_EQUALS(Common::isUpper('\n'), 0); diff --git a/test/cxxtest_mingw.h b/test/cxxtest_mingw.h index f407105bfe..380f638640 100644 --- a/test/cxxtest_mingw.h +++ b/test/cxxtest_mingw.h @@ -8,4 +8,4 @@ #undef main #endif // main -#endif // CXXTEST_MINGW
\ No newline at end of file +#endif // CXXTEST_MINGW diff --git a/video/flic_decoder.cpp b/video/flic_decoder.cpp index 5d27aa0a59..994f47cea8 100644 --- a/video/flic_decoder.cpp +++ b/video/flic_decoder.cpp @@ -176,7 +176,7 @@ const Graphics::Surface *FlicDecoder::FlicVideoTrack::decodeNextFrame() { uint16 newWidth = _fileStream->readUint16LE(); uint16 newHeight = _fileStream->readUint16LE(); - if ((newWidth != 0) && (newHeight != 0)) { + if ((newWidth != 0) || (newHeight != 0)) { if (newWidth == 0) newWidth = _surface->w; if (newHeight == 0) |