diff options
287 files changed, 5116 insertions, 3445 deletions
diff --git a/Makefile.common b/Makefile.common index 2aa3325b5d..744ac493e3 100644 --- a/Makefile.common +++ b/Makefile.common @@ -106,7 +106,7 @@ ifdef CXX_UPDATE_DEP_FLAG %.o: %.m $(QUIET)$(MKDIR) $(*D)/$(DEPDIR) - $(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(OBJCFLAGS) -c $(<) -o $*.o + $(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(CPPFLAGS) $(OBJCFLAGS) -c $(<) -o $*.o # Build rule for assembler files with preprocessing %.o: %.S @@ -25,6 +25,11 @@ For a more comprehensive changelog of the latest experimental code, see: - Added support for the Macintosh version of SPY Fox in Hold the Mustard. - Added a difficulty selection dialog for Loom FM-TOWNS. + iPhone port: + - Changed "F5 (menu)" gesture to open up the global main menu instead. + - Added support for custom cursor palettes, this makes the moderm theme use + the red pointer cursor for example. + Windows port: - Changed default savegames location for Windows NT4/2000/XP/Vista/7. (The migration batch file can be used to copy savegames from the old diff --git a/audio/decoders/flac.cpp b/audio/decoders/flac.cpp index d06a7b9c0e..bbaf5fd5ae 100644 --- a/audio/decoders/flac.cpp +++ b/audio/decoders/flac.cpp @@ -209,7 +209,7 @@ FLACStream::FLACStream(Common::SeekableReadStream *inStream, bool dispose) ::FLAC__seekable_stream_decoder_set_write_callback(_decoder, &FLACStream::callWrapWrite); ::FLAC__seekable_stream_decoder_set_metadata_callback(_decoder, &FLACStream::callWrapMetadata); ::FLAC__seekable_stream_decoder_set_error_callback(_decoder, &FLACStream::callWrapError); - ::FLAC__seekable_stream_decoder_set_client_data(_decoder, (void*)this); + ::FLAC__seekable_stream_decoder_set_client_data(_decoder, (void *)this); success = (::FLAC__seekable_stream_decoder_init(_decoder) == FLAC__SEEKABLE_STREAM_DECODER_OK); #else @@ -223,7 +223,7 @@ FLACStream::FLACStream(Common::SeekableReadStream *inStream, bool dispose) &FLACStream::callWrapWrite, &FLACStream::callWrapMetadata, &FLACStream::callWrapError, - (void*)this + (void *)this ) == FLAC__STREAM_DECODER_INIT_STATUS_OK); #endif if (success) { diff --git a/audio/decoders/iff_sound.cpp b/audio/decoders/iff_sound.cpp index 4efdce0338..b0c41f0180 100644 --- a/audio/decoders/iff_sound.cpp +++ b/audio/decoders/iff_sound.cpp @@ -75,7 +75,7 @@ struct A8SVXLoader { case ID_BODY: _dataSize = chunk._size; - _data = (int8*)malloc(_dataSize); + _data = (int8 *)malloc(_dataSize); assert(_data); loadData(chunk._stream); return true; diff --git a/audio/decoders/qdm2.cpp b/audio/decoders/qdm2.cpp index 113b88fbf6..735fb2b6a0 100644 --- a/audio/decoders/qdm2.cpp +++ b/audio/decoders/qdm2.cpp @@ -589,7 +589,7 @@ DECL_FFT(32768,16384,8192) DECL_FFT(65536,32768,16384) void fftCalc(FFTContext *s, FFTComplex *z) { - static void (* const fftDispatch[])(FFTComplex*) = { + static void (* const fftDispatch[])(FFTComplex *) = { fft4, fft8, fft16, fft32, fft64, fft128, fft256, fft512, fft1024, fft2048, fft4096, fft8192, fft16384, fft32768, fft65536, }; @@ -857,8 +857,8 @@ void rdftCalc(RDFTContext *s, float *data) { if (s->inverse) { data[0] *= k1; data[1] *= k1; - fftPermute(&s->fft, (FFTComplex*)data); - fftCalc(&s->fft, (FFTComplex*)data); + fftPermute(&s->fft, (FFTComplex *)data); + fftCalc(&s->fft, (FFTComplex *)data); } } diff --git a/audio/softsynth/mt32/Part.h b/audio/softsynth/mt32/Part.h index befb05c532..5c59c6d61f 100644 --- a/audio/softsynth/mt32/Part.h +++ b/audio/softsynth/mt32/Part.h @@ -37,8 +37,8 @@ private: unsigned int activePartialCount; PatchCache patchCache[4]; - Common::List<Poly*> freePolys; - Common::List<Poly*> activePolys; + Common::List<Poly *> freePolys; + Common::List<Poly *> activePolys; void setPatch(const PatchParam *patch); unsigned int midiKeyToKey(unsigned int midiKey); diff --git a/audio/softsynth/opl/dbopl.cpp b/audio/softsynth/opl/dbopl.cpp index 02c2317b25..43eb40e7ba 100644 --- a/audio/softsynth/opl/dbopl.cpp +++ b/audio/softsynth/opl/dbopl.cpp @@ -1131,14 +1131,14 @@ void Chip::WriteBD( Bit8u val ) { #define REGOP( _FUNC_ ) \ index = ( ( reg >> 3) & 0x20 ) | ( reg & 0x1f ); \ if ( OpOffsetTable[ index ] ) { \ - Operator* regOp = (Operator*)( ((char *)this ) + OpOffsetTable[ index ] ); \ + Operator* regOp = (Operator *)( ((char *)this ) + OpOffsetTable[ index ] ); \ regOp->_FUNC_( this, val ); \ } #define REGCHAN( _FUNC_ ) \ index = ( ( reg >> 4) & 0x10 ) | ( reg & 0xf ); \ if ( ChanOffsetTable[ index ] ) { \ - Channel* regChan = (Channel*)( ((char *)this ) + ChanOffsetTable[ index ] ); \ + Channel* regChan = (Channel *)( ((char *)this ) + ChanOffsetTable[ index ] ); \ regChan->_FUNC_( this, val ); \ } diff --git a/audio/softsynth/sid.h b/audio/softsynth/sid.h index 19577e94d1..88da0eb326 100644 --- a/audio/softsynth/sid.h +++ b/audio/softsynth/sid.h @@ -55,7 +55,7 @@ class WaveformGenerator { public: WaveformGenerator(); - void set_sync_source(WaveformGenerator*); + void set_sync_source(WaveformGenerator *); void updateClock(cycle_count delta_t); void synchronize(); @@ -272,7 +272,7 @@ class Voice { public: Voice(); - void set_sync_source(Voice*); + void set_sync_source(Voice *); void reset(); void writeCONTROL_REG(reg8); diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index 78072b0021..99d12c73dc 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -60,6 +60,8 @@ DefaultEventManager::DefaultEventManager(Common::EventSource *boss) : // EventDispatcher will automatically free the keymapper _dispatcher.registerMapper(_keymapper); _remap = false; +#else + _dispatcher.registerMapper(new Common::DefaultEventMapper()); #endif } @@ -100,67 +102,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { _currentKeyDown.flags = event.kbd.flags; _keyRepeatTime = time + kKeyRepeatInitialDelay; - // Global Main Menu - if (event.kbd.hasFlags(Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_F5) { - if (g_engine && !g_engine->isPaused()) { - Common::Event menuEvent; - menuEvent.type = Common::EVENT_MAINMENU; - - // FIXME: GSoC RTL branch passes the F6 key event to the - // engine, and also enqueues a EVENT_MAINMENU. For now, - // we just drop the key event and return an EVENT_MAINMENU - // instead. This way, we don't have to add special cases - // to engines (like it was the case for LURE in the RTL branch). - // - // However, this has other consequences, possibly negative ones. - // Like, what happens with key repeat for the trigger key? - - //pushEvent(menuEvent); - event = menuEvent; - - // FIXME: Since now we do not push another MAINMENU event onto - // our event stack, the GMM would never open, so we have to do - // that here. Of course when the engine would handle MAINMENU - // as an event now and open up the GMM itself it would open the - // menu twice. - if (g_engine && !g_engine->isPaused()) - g_engine->openMainMenuDialog(); - - if (_shouldQuit) - event.type = Common::EVENT_QUIT; - else if (_shouldRTL) - event.type = Common::EVENT_RTL; - } - } -#ifdef ENABLE_VKEYBD - else if (event.kbd.keycode == Common::KEYCODE_F7 && event.kbd.hasFlags(0)) { - if (_vk->isDisplaying()) { - _vk->close(true); - } else { - if (g_engine) - g_engine->pauseEngine(true); - _vk->show(); - if (g_engine) - g_engine->pauseEngine(false); - result = false; - } - } -#endif -#ifdef ENABLE_KEYMAPPER - else if (event.kbd.keycode == Common::KEYCODE_F8 && event.kbd.hasFlags(0)) { - if (!_remap) { - _remap = true; - Common::RemapDialog _remapDialog; - if (g_engine) - g_engine->pauseEngine(true); - _remapDialog.runModal(); - if (g_engine) - g_engine->pauseEngine(false); - _remap = false; - } - } -#endif - else if (event.kbd.keycode == Common::KEYCODE_BACKSPACE) { + if (event.kbd.keycode == Common::KEYCODE_BACKSPACE) { // WORKAROUND: Some engines incorrectly attempt to use the // ascii value instead of the keycode to detect the backspace // key (a non-portable behavior). This fails at least on @@ -214,7 +156,34 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { else if (_shouldRTL) event.type = Common::EVENT_RTL; break; - +#ifdef ENABLE_VKEYBD + case Common::EVENT_VIRTUAL_KEYBOARD: + if (_vk->isDisplaying()) { + _vk->close(true); + } else { + if (g_engine) + g_engine->pauseEngine(true); + _vk->show(); + if (g_engine) + g_engine->pauseEngine(false); + result = false; + } + break; +#endif +#ifdef ENABLE_KEYMAPPER + case Common::EVENT_KEYMAPPER_REMAP: + if (!_remap) { + _remap = true; + Common::RemapDialog _remapDialog; + if (g_engine) + g_engine->pauseEngine(true); + _remapDialog.runModal(); + if (g_engine) + g_engine->pauseEngine(false); + _remap = false; + } + break; +#endif case Common::EVENT_RTL: if (ConfMan.getBool("confirm_exit")) { if (g_engine) diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index 3a8025f5e8..4d89b78861 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -92,6 +92,8 @@ public: #endif #ifdef ENABLE_KEYMAPPER + // IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use + // this, please talk to tsoliman and/or LordHoto. virtual Common::Keymapper *getKeymapper() { return _keymapper; } #endif }; diff --git a/backends/events/maemosdl/maemosdl-events.cpp b/backends/events/maemosdl/maemosdl-events.cpp index acca1a3c02..0046d297eb 100644 --- a/backends/events/maemosdl/maemosdl-events.cpp +++ b/backends/events/maemosdl/maemosdl-events.cpp @@ -33,10 +33,25 @@ MaemoSdlEventSource::MaemoSdlEventSource() : SdlEventSource(), _clickEnabled(tru } +struct KeymapEntry { + SDLKey sym; + Common::KeyCode keycode; + uint16 ascii; +}; + +static const KeymapEntry keymapEntries[] = { + {SDLK_F4, Common::KEYCODE_F11, 0}, + {SDLK_F5, Common::KEYCODE_F12, 0}, + {SDLK_F6, Common::KEYCODE_F13, 0}, + {SDLK_F7, Common::KEYCODE_F14, 0}, + {SDLK_F8, Common::KEYCODE_F15, 0}, + {SDLK_LAST, Common::KEYCODE_INVALID, 0} +}; + bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { Model model = Model(((OSystem_SDL_Maemo *)g_system)->getModel()); - debug(10, "Model: %s %u %s %s", model.hwId, model.modelType, model.hwAlias, model.hwKeyboard ? "true" : "false"); + debug(10, "Model: %s %u %s %s", model.hwId, model.modelType, model.hwAlias, model.hasHwKeyboard ? "true" : "false"); // List of special N810 keys: // SDLK_F4 -> menu @@ -45,6 +60,20 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { // SDLK_F7 -> zoom + // SDLK_F8 -> zoom - +#ifdef ENABLE_KEYMAPPER + if (ev.type == SDL_KEYDOWN || ev.type == SDL_KEYUP) { + const KeymapEntry *entry; + for (entry = keymapEntries; entry->sym != SDLK_LAST; ++entry) { + if (ev.key.keysym.sym == entry->sym) { + SDLModToOSystemKeyFlags(SDL_GetModState(), event); + event.type = ev.type == SDL_KEYDOWN ? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP; + event.kbd.keycode = entry->keycode; + event.kbd.ascii = entry->ascii; + return true; + } + } + } +#else switch (ev.type) { case SDL_KEYDOWN:{ if (ev.key.keysym.sym == SDLK_F4 @@ -56,7 +85,7 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { debug(9, "remapping to main menu"); return true; } else if (ev.key.keysym.sym == SDLK_F6) { - if (!model.hwKeyboard) { + if (!model.hasHwKeyboard) { event.type = Common::EVENT_KEYDOWN; event.kbd.keycode = Common::KEYCODE_F7; event.kbd.ascii = Common::ASCII_F7; @@ -95,7 +124,7 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { event.type = Common::EVENT_MAINMENU; return true; } else if (ev.key.keysym.sym == SDLK_F6) { - if (!model.hwKeyboard) { + if (!model.hasHwKeyboard) { event.type = Common::EVENT_KEYUP; event.kbd.keycode = Common::KEYCODE_F7; event.kbd.ascii = Common::ASCII_F7; @@ -132,6 +161,7 @@ bool MaemoSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { break; } } +#endif // Invoke parent implementation of this method return SdlEventSource::remapKey(ev, event); } @@ -158,18 +188,19 @@ bool MaemoSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &even bool MaemoSdlEventSource::toggleClickMode() { _clickEnabled = !_clickEnabled; - ((SurfaceSdlGraphicsManager*) _graphicsManager)->displayMessageOnOSD( + ((SurfaceSdlGraphicsManager *) _graphicsManager)->displayMessageOnOSD( _clickEnabled ? _("Clicking Enabled") : _("Clicking Disabled")); return _clickEnabled; } MaemoSdlEventObserver::MaemoSdlEventObserver(MaemoSdlEventSource *eventSource) { - assert(_eventSource); + assert(eventSource); _eventSource = eventSource; } bool MaemoSdlEventObserver::notifyEvent(const Common::Event &event) { +#ifdef ENABLE_KEYMAPPER if (event.type != Common::EVENT_CUSTOM_BACKEND) return false; if (event.customType == kEventClickMode) { @@ -177,6 +208,7 @@ bool MaemoSdlEventObserver::notifyEvent(const Common::Event &event) { _eventSource->toggleClickMode(); return true; } +#endif return false; } diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp index 9f70e7a7c9..fc78f7580b 100644 --- a/backends/fs/symbian/symbian-fs.cpp +++ b/backends/fs/symbian/symbian-fs.cpp @@ -70,7 +70,7 @@ SymbianFilesystemNode::SymbianFilesystemNode(const Common::String &path) { TPtrC8 ptr((const unsigned char*)_path.c_str(),_path.size()); fname.Copy(ptr); - if (static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession().Entry(fname, fileAttribs) == KErrNone) { + if (static_cast<OSystem_SDL_Symbian *>(g_system)->FsSession().Entry(fname, fileAttribs) == KErrNone) { _isValid = true; _isDirectory = fileAttribs.IsDir(); } else { @@ -87,7 +87,7 @@ bool SymbianFilesystemNode::exists() const { TFileName fname; TPtrC8 ptr((const unsigned char*) _path.c_str(), _path.size()); fname.Copy(ptr); - bool fileExists = BaflUtils::FileExists(static_cast<OSystem_SDL_Symbian*> (g_system)->FsSession(), fname); + bool fileExists = BaflUtils::FileExists(static_cast<OSystem_SDL_Symbian *> (g_system)->FsSession(), fname); if (!fileExists) { TParsePtrC parser(fname); if (parser.PathPresent() && parser.Path().Compare(_L("\\")) == KErrNone && !parser.NameOrExtPresent()) { @@ -125,7 +125,7 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b if (_isPseudoRoot) { // Drives enumeration - RFs& fs = static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(); + RFs& fs = static_cast<OSystem_SDL_Symbian *>(g_system)->FsSession(); TInt driveNumber; TChar driveLetter; TUint driveLetterValue; @@ -153,7 +153,7 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b sprintf(path,"%c:\\", driveNumber+'A'); SymbianFilesystemNode entry(false); - entry._displayName = (char*) driveString8.PtrZ(); // drive_name + entry._displayName = (char *) driveString8.PtrZ(); // drive_name entry._isDirectory = true; entry._isValid = true; entry._isPseudoRoot = false; @@ -170,7 +170,7 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b if (_path.lastChar() != '\\') fname.Append('\\'); - if (static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession().GetDir(fname, KEntryAttNormal|KEntryAttDir, 0, dirPtr) == KErrNone) { + if (static_cast<OSystem_SDL_Symbian *>(g_system)->FsSession().GetDir(fname, KEntryAttNormal|KEntryAttDir, 0, dirPtr) == KErrNone) { CleanupStack::PushL(dirPtr); TInt cnt = dirPtr->Count(); for (TInt loop = 0; loop < cnt; loop++) { diff --git a/backends/fs/symbian/symbianstream.cpp b/backends/fs/symbian/symbianstream.cpp index 39249578f7..fa7842d3b1 100644 --- a/backends/fs/symbian/symbianstream.cpp +++ b/backends/fs/symbian/symbianstream.cpp @@ -70,22 +70,22 @@ TSymbianFileEntry* CreateSymbianFileEntry(const char* name, const char* mode) { switch (mode[0]) { case 'a': - if (fileEntry->_fileHandle.Open(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { - if (fileEntry->_fileHandle.Create(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->_fileHandle.Open(static_cast<OSystem_SDL_Symbian *>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->_fileHandle.Create(static_cast<OSystem_SDL_Symbian *>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { delete fileEntry; fileEntry = NULL; } } break; case 'r': - if (fileEntry->_fileHandle.Open(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->_fileHandle.Open(static_cast<OSystem_SDL_Symbian *>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { delete fileEntry; fileEntry = NULL; } break; case 'w': - if (fileEntry->_fileHandle.Replace(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->_fileHandle.Replace(static_cast<OSystem_SDL_Symbian *>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { delete fileEntry; fileEntry = NULL; } @@ -96,7 +96,7 @@ TSymbianFileEntry* CreateSymbianFileEntry(const char* name, const char* mode) { } size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry* handle) { - TSymbianFileEntry* entry = ((TSymbianFileEntry*)(handle)); + TSymbianFileEntry* entry = ((TSymbianFileEntry *)(handle)); TUint32 totsize = size*numItems; TPtr8 pointer ( (unsigned char*) ptr, totsize); @@ -169,29 +169,29 @@ SymbianStdioStream::SymbianStdioStream(void *handle) : _handle(handle) { } SymbianStdioStream::~SymbianStdioStream() { - ((TSymbianFileEntry*)(_handle))->_fileHandle.Close(); + ((TSymbianFileEntry *)(_handle))->_fileHandle.Close(); - delete (TSymbianFileEntry*)(_handle); + delete (TSymbianFileEntry *)(_handle); } bool SymbianStdioStream::err() const { - return ((TSymbianFileEntry*)(_handle))->_lastError != 0; + return ((TSymbianFileEntry *)(_handle))->_lastError != 0; } void SymbianStdioStream::clearErr() { - ((TSymbianFileEntry*)(_handle))->_lastError = 0; - ((TSymbianFileEntry*)(_handle))->_eofReached = 0; + ((TSymbianFileEntry *)(_handle))->_lastError = 0; + ((TSymbianFileEntry *)(_handle))->_eofReached = 0; } bool SymbianStdioStream::eos() const { - TSymbianFileEntry* entry = ((TSymbianFileEntry*)(_handle)); + TSymbianFileEntry* entry = ((TSymbianFileEntry *)(_handle)); return entry->_eofReached != 0; } int32 SymbianStdioStream::pos() const { TInt pos = 0; - TSymbianFileEntry* entry = ((TSymbianFileEntry*)(_handle)); + TSymbianFileEntry* entry = ((TSymbianFileEntry *)(_handle)); entry->_lastError = entry->_fileHandle.Seek(ESeekCurrent, pos); if (entry->_lastError == KErrNone && entry->_inputPos != KErrNotFound) { @@ -204,7 +204,7 @@ int32 SymbianStdioStream::pos() const { int32 SymbianStdioStream::size() const { TInt length = 0; - ((TSymbianFileEntry*)(_handle))->_fileHandle.Size(length); + ((TSymbianFileEntry *)(_handle))->_fileHandle.Size(length); return length; } @@ -214,7 +214,7 @@ bool SymbianStdioStream::seek(int32 offs, int whence) { TSeek seekMode = ESeekStart; TInt pos = offs; - TSymbianFileEntry* entry = ((TSymbianFileEntry*)(_handle)); + TSymbianFileEntry* entry = ((TSymbianFileEntry *)(_handle)); switch (whence) { case SEEK_SET: @@ -246,11 +246,11 @@ uint32 SymbianStdioStream::read(void *ptr, uint32 len) { uint32 SymbianStdioStream::write(const void *ptr, uint32 len) { TPtrC8 pointer( (unsigned char*) ptr, len); - ((TSymbianFileEntry*)(_handle))->_inputPos = KErrNotFound; - ((TSymbianFileEntry*)(_handle))->_lastError = ((TSymbianFileEntry*)(_handle))->_fileHandle.Write(pointer); - ((TSymbianFileEntry*)(_handle))->_eofReached = EFalse; + ((TSymbianFileEntry *)(_handle))->_inputPos = KErrNotFound; + ((TSymbianFileEntry *)(_handle))->_lastError = ((TSymbianFileEntry *)(_handle))->_fileHandle.Write(pointer); + ((TSymbianFileEntry *)(_handle))->_eofReached = EFalse; - if (((TSymbianFileEntry*)(_handle))->_lastError == KErrNone) { + if (((TSymbianFileEntry *)(_handle))->_lastError == KErrNone) { return len; } @@ -258,7 +258,7 @@ uint32 SymbianStdioStream::write(const void *ptr, uint32 len) { } bool SymbianStdioStream::flush() { - ((TSymbianFileEntry*)(_handle))->_fileHandle.Flush(); + ((TSymbianFileEntry *)(_handle))->_fileHandle.Flush(); return true; } diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp index c32ad2da94..030f394f81 100644 --- a/backends/fs/windows/windows-fs.cpp +++ b/backends/fs/windows/windows-fs.cpp @@ -87,7 +87,7 @@ void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const c char* WindowsFilesystemNode::toAscii(TCHAR *str) { #ifndef UNICODE - return (char*)str; + return (char *)str; #else static char asciiString[MAX_PATH]; WideCharToMultiByte(CP_ACP, 0, str, _tcslen(str) + 1, asciiString, sizeof(asciiString), NULL, NULL); diff --git a/backends/graphics/null/null-graphics.h b/backends/graphics/null/null-graphics.h index 28b24f6aca..2e6b24d147 100644 --- a/backends/graphics/null/null-graphics.h +++ b/backends/graphics/null/null-graphics.h @@ -27,7 +27,7 @@ static const OSystem::GraphicsMode s_noGraphicsModes[] = { {0, 0, 0} }; -class NullGraphicsManager : GraphicsManager { +class NullGraphicsManager : public GraphicsManager { public: virtual ~NullGraphicsManager() {} @@ -38,6 +38,7 @@ public: const OSystem::GraphicsMode *getSupportedGraphicsModes() const { return s_noGraphicsModes; } int getDefaultGraphicsMode() const { return 0; } bool setGraphicsMode(int mode) { return true; } + void resetGraphicsScale(){} int getGraphicsMode() const { return 0; } inline Graphics::PixelFormat getScreenFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index cca8058625..45804b5d6e 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -501,26 +501,13 @@ void OpenGLGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch if (w <= 0 || h <= 0) return; - if (_overlayFormat.aBits() == 1) { - // Copy buffer with the alpha bit on for all pixels for correct - // overlay drawing. - const uint16 *src = (const uint16 *)buf; - uint16 *dst = (uint16 *)_overlayData.pixels + y * _overlayData.w + x; - for (int i = 0; i < h; i++) { - for (int e = 0; e < w; e++) - dst[e] = src[e] | 0x1; - src += pitch; - dst += _overlayData.w; - } - } else { - // Copy buffer data to internal overlay surface - const byte *src = (const byte *)buf; - byte *dst = (byte *)_overlayData.pixels + y * _overlayData.pitch; - for (int i = 0; i < h; i++) { - memcpy(dst + x * _overlayData.format.bytesPerPixel, src, w * _overlayData.format.bytesPerPixel); - src += pitch * sizeof(buf[0]); - dst += _overlayData.pitch; - } + // Copy buffer data to internal overlay surface + const byte *src = (const byte *)buf; + byte *dst = (byte *)_overlayData.pixels + y * _overlayData.pitch; + for (int i = 0; i < h; i++) { + memcpy(dst + x * _overlayData.format.bytesPerPixel, src, w * _overlayData.format.bytesPerPixel); + src += pitch * sizeof(buf[0]); + dst += _overlayData.pitch; } // Extend dirty area if not full screen redraw is flagged diff --git a/backends/keymapper/action.cpp b/backends/keymapper/action.cpp index 6ee506e7c3..515ec70e32 100644 --- a/backends/keymapper/action.cpp +++ b/backends/keymapper/action.cpp @@ -28,9 +28,8 @@ namespace Common { -Action::Action(Keymap *boss, const char *i, String des, ActionType typ, - KeyType prefKey, int pri, int flg) - : _boss(boss), description(des), type(typ), preferredKey(prefKey), +Action::Action(Keymap *boss, const char *i, String des, int pri, int flg) + : _boss(boss), description(des), priority(pri), flags(flg), _hwKey(0) { assert(i); assert(_boss); diff --git a/backends/keymapper/action.h b/backends/keymapper/action.h index 308a76aa88..bf3773b7e3 100644 --- a/backends/keymapper/action.h +++ b/backends/keymapper/action.h @@ -27,7 +27,6 @@ #ifdef ENABLE_KEYMAPPER -#include "backends/keymapper/types.h" #include "common/events.h" #include "common/func.h" #include "common/list.h" @@ -54,8 +53,6 @@ struct Action { /** Events to be sent when mapped key is pressed */ List<Event> events; - ActionType type; - KeyType preferredKey; int priority; int group; int flags; @@ -67,8 +64,6 @@ private: public: Action(Keymap *boss, const char *id, String des = "", - ActionType typ = kGenericActionType, - KeyType prefKey = kGenericKeyType, int pri = 0, int flg = 0 ); void addEvent(const Event &evt) { diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h index 713b086791..8c46ee6358 100644 --- a/backends/keymapper/hardware-key.h +++ b/backends/keymapper/hardware-key.h @@ -27,7 +27,6 @@ #ifdef ENABLE_KEYMAPPER -#include "backends/keymapper/types.h" #include "common/textconsole.h" namespace Common { @@ -50,12 +49,8 @@ struct HardwareKey { */ KeyState key; - KeyType type; - ActionType preferredAction; - - HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "", - KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType) - : key(ky), description(desc), type(typ), preferredAction(prefAct) { + HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "") + : key(ky), description(desc) { assert(i); Common::strlcpy(hwKeyId, i, HWKEY_ID_SIZE); } @@ -69,7 +64,6 @@ struct KeyTableEntry { KeyCode keycode; uint16 ascii; const char *desc; - KeyType preferredAction; bool shiftable; }; @@ -103,19 +97,19 @@ public: HardwareKeySet() { } virtual ~HardwareKeySet() { - List<const HardwareKey*>::const_iterator it; + List<const HardwareKey *>::const_iterator it; for (it = _keys.begin(); it != _keys.end(); it++) delete *it; } - void addHardwareKey(HardwareKey *key) { + void addHardwareKey(const HardwareKey *key) { checkForKey(key); _keys.push_back(key); } const HardwareKey *findHardwareKey(const char *id) const { - List<const HardwareKey*>::const_iterator it; + List<const HardwareKey *>::const_iterator it; for (it = _keys.begin(); it != _keys.end(); it++) { if (strncmp((*it)->hwKeyId, id, HWKEY_ID_SIZE) == 0) @@ -125,7 +119,7 @@ public: } const HardwareKey *findHardwareKey(const KeyState& keystate) const { - List<const HardwareKey*>::const_iterator it; + List<const HardwareKey *>::const_iterator it; for (it = _keys.begin(); it != _keys.end(); it++) { if ((*it)->key == keystate) @@ -134,7 +128,7 @@ public: return 0; } - const List<const HardwareKey*> &getHardwareKeys() const { + const List<const HardwareKey *> &getHardwareKeys() const { return _keys; } @@ -170,15 +164,15 @@ public: snprintf(fullKeyDesc, 100, "%s%s", mod->desc, key->desc); } - addHardwareKey(new HardwareKey(fullKeyId, KeyState(key->keycode, ascii, mod->flag), fullKeyDesc, key->preferredAction )); + addHardwareKey(new HardwareKey(fullKeyId, KeyState(key->keycode, ascii, mod->flag), fullKeyDesc)); } } } private: - void checkForKey(HardwareKey *key) { - List<const HardwareKey*>::iterator it; + void checkForKey(const HardwareKey *key) { + List<const HardwareKey *>::iterator it; for (it = _keys.begin(); it != _keys.end(); it++) { if (strncmp((*it)->hwKeyId, key->hwKeyId, HWKEY_ID_SIZE) == 0) @@ -188,7 +182,7 @@ private: } } - List<const HardwareKey*> _keys; + List<const HardwareKey *> _keys; }; } // End of namespace Common diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp index 6fc1b1e08d..5bee1a246d 100644 --- a/backends/keymapper/keymap.cpp +++ b/backends/keymapper/keymap.cpp @@ -24,14 +24,17 @@ #ifdef ENABLE_KEYMAPPER +#include "common/system.h" + #include "backends/keymapper/hardware-key.h" +#include "backends/keymapper/keymapper-defaults.h" #define KEYMAP_KEY_PREFIX "keymap_" namespace Common { Keymap::Keymap(const Keymap& km) : _actions(km._actions), _keymap(), _configDomain(0) { - List<Action*>::iterator it; + List<Action *>::iterator it; for (it = _actions.begin(); it != _actions.end(); ++it) { const HardwareKey *hwKey = (*it)->getMappedKey(); @@ -43,7 +46,7 @@ Keymap::Keymap(const Keymap& km) : _actions(km._actions), _keymap(), _configDoma } Keymap::~Keymap() { - List<Action*>::iterator it; + List<Action *>::iterator it; for (it = _actions.begin(); it != _actions.end(); ++it) delete *it; @@ -57,7 +60,7 @@ void Keymap::addAction(Action *action) { } void Keymap::registerMapping(Action *action, const HardwareKey *hwKey) { - HashMap<KeyState, Action*>::iterator it; + HashMap<KeyState, Action *>::iterator it; it = _keymap.find(hwKey->key); @@ -82,7 +85,7 @@ Action *Keymap::getAction(const char *id) { } Action *Keymap::findAction(const char *id) { - List<Action*>::iterator it; + List<Action *>::iterator it; for (it = _actions.begin(); it != _actions.end(); ++it) { if (strncmp((*it)->id, id, ACTION_ID_SIZE) == 0) @@ -92,7 +95,7 @@ Action *Keymap::findAction(const char *id) { } const Action *Keymap::findAction(const char *id) const { - List<Action*>::const_iterator it; + List<Action *>::const_iterator it; for (it = _actions.begin(); it != _actions.end(); ++it) { if (strncmp((*it)->id, id, ACTION_ID_SIZE) == 0) @@ -103,7 +106,7 @@ const Action *Keymap::findAction(const char *id) const { } Action *Keymap::getMappedAction(const KeyState& ks) const { - HashMap<KeyState, Action*>::iterator it; + HashMap<KeyState, Action *>::iterator it; it = _keymap.find(ks); @@ -121,35 +124,50 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) { if (!_configDomain) return; - ConfigManager::Domain::iterator it; - String prefix = KEYMAP_KEY_PREFIX + _name + "_"; - - for (it = _configDomain->begin(); it != _configDomain->end(); ++it) { - const String& key = it->_key; - - if (!key.hasPrefix(prefix.c_str())) - continue; + if (_actions.empty()) + return; - // parse Action ID - const char *actionId = key.c_str() + prefix.size(); - Action *ua = getAction(actionId); + Common::KeymapperDefaultBindings *defaults = g_system->getKeymapperDefaultBindings(); - if (!ua) { - warning("'%s' keymap does not contain Action with ID %s", - _name.c_str(), actionId); - _configDomain->erase(key); + HashMap<String, const HardwareKey *> mappedKeys; + List<Action*>::iterator it; + String prefix = KEYMAP_KEY_PREFIX + _name + "_"; - continue; + for (it = _actions.begin(); it != _actions.end(); ++it) { + Action* ua = *it; + String actionId(ua->id); + String confKey = prefix + actionId; + + String hwKeyId = _configDomain->getVal(confKey); + + bool defaulted = false; + // fall back to the platform-specific defaults + if (hwKeyId.empty() && defaults) { + hwKeyId = defaults->getDefaultBinding(_name, actionId); + if (!hwKeyId.empty()) + defaulted = true; } + // there's no mapping + if (hwKeyId.empty()) + continue; - const HardwareKey *hwKey = hwKeys->findHardwareKey(it->_value.c_str()); + const HardwareKey *hwKey = hwKeys->findHardwareKey(hwKeyId.c_str()); if (!hwKey) { - warning("HardwareKey with ID '%s' not known", it->_value.c_str()); - _configDomain->erase(key); + warning("HardwareKey with ID '%s' not known", hwKeyId.c_str()); continue; } + if (defaulted) { + if (mappedKeys.contains(hwKeyId)) { + debug(1, "Action [%s] not falling back to hardcoded default value [%s] because the key is in use", confKey.c_str(), hwKeyId.c_str()); + continue; + } + warning("Action [%s] fell back to hardcoded default value [%s]", confKey.c_str(), hwKeyId.c_str()); + } + + mappedKeys.setVal(hwKeyId, hwKey); + // map the key ua->mapKey(hwKey); } } @@ -158,7 +176,7 @@ void Keymap::saveMappings() { if (!_configDomain) return; - List<Action*>::const_iterator it; + List<Action *>::const_iterator it; String prefix = KEYMAP_KEY_PREFIX + _name + "_"; for (it = _actions.begin(); it != _actions.end(); ++it) { @@ -179,7 +197,7 @@ void Keymap::saveMappings() { } bool Keymap::isComplete(const HardwareKeySet *hwKeys) { - List<Action*>::iterator it; + List<Action *>::iterator it; bool allMapped = true; uint numberMapped = 0; @@ -194,147 +212,6 @@ bool Keymap::isComplete(const HardwareKeySet *hwKeys) { return allMapped || (numberMapped == hwKeys->size()); } -// TODO: -// - current weakness: -// - if an action finds a key with required type but a parent action with -// higher priority is using it, that key is never used -void Keymap::automaticMapping(HardwareKeySet *hwKeys) { -#if 0 //disabling the broken automapper for now - // Create copies of action and key lists. - List<Action*> actions(_actions); - List<const HardwareKey*> keys(hwKeys->getHardwareKeys()); - - List<Action*>::iterator actIt; - List<const HardwareKey*>::iterator keyIt, selectedKey; - - // Remove actions and keys from local lists that have already been mapped. - actIt = actions.begin(); - - while (actIt != actions.end()) { - Action *act = *actIt; - const HardwareKey *key = act->getMappedKey(); - - if (key) { - keys.remove(key); - actIt = actions.erase(actIt); - } else { - ++actIt; - } - } - - // Sort remaining actions by priority. - ActionPriorityComp priorityComp; - sort(actions.begin(), actions.end(), priorityComp); - - // First mapping pass: - // - Match if a key's preferred action type is the same as the action's - // type, or vice versa. - // - Priority is given to: - // - keys that match action types over key types. - // - keys that have not been used by parent maps. - // - If a key has been used by a parent map the new action must have a - // higher priority than the parent action. - // - As soon as the number of skipped actions equals the number of keys - // remaining we stop matching. This means that the second pass will assign keys - // to these higher priority skipped actions. - uint skipped = 0; - actIt = actions.begin(); - - while (actIt != actions.end() && skipped < keys.size()) { - selectedKey = keys.end(); - int matchRank = 0; - Action *act = *actIt; - - for (keyIt = keys.begin(); keyIt != keys.end(); ++keyIt) { - if ((*keyIt)->preferredAction == act->type && act->type != kGenericActionType) { - Action *parentAct = getParentMappedAction((*keyIt)->key); - - if (!parentAct) { - selectedKey = keyIt; - break; - } else if (parentAct->priority <= act->priority && matchRank < 3) { - selectedKey = keyIt; - matchRank = 3; - } - } else if ((*keyIt)->type == act->preferredKey && act->preferredKey != kGenericKeyType && matchRank < 2) { - Action *parentAct = getParentMappedAction((*keyIt)->key); - - if (!parentAct) { - selectedKey = keyIt; - matchRank = 2; - } else if (parentAct->priority <= act->priority && matchRank < 1) { - selectedKey = keyIt; - matchRank = 1; - } - } - } - if (selectedKey != keys.end()) { - // Map action and delete action & key from local lists. - act->mapKey(*selectedKey); - keys.erase(selectedKey); - actIt = actions.erase(actIt); - } else { - // Skip action (will be mapped in next pass). - ++actIt; - ++skipped; - } - } - - // Second mapping pass: - // - Maps any remaining actions to keys - // - priority given to: - // - keys that have no parent action - // - keys whose parent action has lower priority than the new action - // - keys whose parent action has the lowest priority - // - is guaranteed to match a key if they are not all used up - for (actIt = actions.begin(); actIt != actions.end(); ++actIt) { - selectedKey = keys.end(); - - int matchRank = 0; - int lowestPriority = 0; - Action *act = *actIt; - - for (keyIt = keys.begin(); keyIt != keys.end(); ++keyIt) { - Action *parentAct = getParentMappedAction((*keyIt)->key); - - if (!parentAct) { - selectedKey = keyIt; - break; - } else if (matchRank < 2) { - if (parentAct->priority <= act->priority) { - matchRank = 2; - selectedKey = keyIt; - } else if (parentAct->priority < lowestPriority || matchRank == 0) { - matchRank = 1; - lowestPriority = parentAct->priority; - selectedKey = keyIt; - } - } - } - - if (selectedKey != keys.end()) { - act->mapKey(*selectedKey); - keys.erase(selectedKey); - } else {// no match = no keys left - break; - } - } -#endif -} - -Action *Keymap::getParentMappedAction(KeyState key) { - if (_parent) { - Action *act = _parent->getMappedAction(key); - - if (act) - return act; - else - return _parent->getParentMappedAction(key); - } else { - return 0; - } -} - } // End of namespace Common #endif // #ifdef ENABLE_KEYMAPPER diff --git a/backends/keymapper/keymap.h b/backends/keymapper/keymap.h index 73f2293653..2e9f08533e 100644 --- a/backends/keymapper/keymap.h +++ b/backends/keymapper/keymap.h @@ -52,7 +52,7 @@ template<> struct Hash<KeyState> class Keymap { public: - Keymap(const String& name, Keymap *parent = 0) : _name(name), _parent(parent) {} + Keymap(const String& name) : _name(name) {} Keymap(const Keymap& km); ~Keymap(); @@ -67,7 +67,7 @@ public: /** * Get the list of all the Actions contained in this Keymap */ - List<Action*>& getActions() { return _actions; } + List<Action *>& getActions() { return _actions; } /** * Find the Action that a key is mapped to @@ -91,9 +91,6 @@ public: */ void saveMappings(); - - void automaticMapping(HardwareKeySet *hwKeys); - /** * Returns true if all UserAction's in Keymap are mapped, or, * all HardwareKey's from the given set have been used up. @@ -101,7 +98,6 @@ public: bool isComplete(const HardwareKeySet *hwKeys); const String& getName() { return _name; } - Keymap *getParent() { return _parent; } private: friend struct Action; @@ -131,14 +127,9 @@ private: Action *findAction(const char *id); const Action *findAction(const char *id) const; - void internalMapKey(Action *action, HardwareKey *hwKey); - - Action *getParentMappedAction(KeyState key); - String _name; - Keymap *_parent; - List<Action*> _actions; - HashMap<KeyState, Action*> _keymap; + List<Action *> _actions; + HashMap<KeyState, Action *> _keymap; ConfigManager::Domain *_configDomain; }; diff --git a/backends/keymapper/keymapper-defaults.h b/backends/keymapper/keymapper-defaults.h new file mode 100644 index 0000000000..5b84ebeaa9 --- /dev/null +++ b/backends/keymapper/keymapper-defaults.h @@ -0,0 +1,56 @@ +/* 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. +* +*/ + +#ifdef ENABLE_KEYMAPPER + +#ifndef KEYMAPPER_DEFAULTS_H +#define KEYMAPPER_DEFAULTS_H + +#include "common/scummsys.h" +#include "common/hashmap.h" +#include "common/str.h" +#include "common/hash-str.h" + +namespace Common { + +class KeymapperDefaultBindings : HashMap<String, String> { +public: + /** + * This sets a default hwKey for a given Keymap Action + * @param keymapId String representing Keymap id (Keymap.name) + * @param actionId String representing Action id (Action.id) + * @param hwKeyId String representing the HardwareKey id (HardwareKey.hwKeyId) + */ + void setDefaultBinding(String keymapId, String actionId, String hwKeyId) { setVal(keymapId + "_" + actionId, hwKeyId); } + /** + * This retrieves the assigned default hwKey for a given Keymap Action + * @param keymapId String representing Keymap id (Keymap.name) + * @param actionId String representing Action id (Action.id) + * @return hwKeyId String representing the HardwareKey id (HardwareKey.hwKeyId) + */ + String getDefaultBinding(String keymapId, String actionId) { return getVal(keymapId + "_" + actionId); } +}; + +} //namespace Common + +#endif // #ifndef KEYMAPPER_DEFAULTS_H +#endif // #ifdef ENABLE_KEYMAPPER diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp index 10cff9418b..aafdd604a2 100644 --- a/backends/keymapper/keymapper.cpp +++ b/backends/keymapper/keymapper.cpp @@ -104,7 +104,6 @@ void Keymapper::initKeymap(Domain &domain, Keymap *map) { map->loadMappings(_hardwareKeys); if (map->isComplete(_hardwareKeys) == false) { - map->automaticMapping(_hardwareKeys); map->saveMappings(); ConfMan.flushToDisk(); } @@ -180,26 +179,35 @@ void Keymapper::popKeymap(const char *name) { } -bool Keymapper::notifyEvent(const Common::Event &ev) { +List<Event> Keymapper::mapEvent(const Event &ev, EventSource *source) { + if (source && !source->allowMapping()) { + return DefaultEventMapper::mapEvent(ev, source); + } + + List<Event> mappedEvents; + if (ev.type == Common::EVENT_KEYDOWN) - return mapKeyDown(ev.kbd); + mappedEvents = mapKeyDown(ev.kbd); else if (ev.type == Common::EVENT_KEYUP) - return mapKeyUp(ev.kbd); + mappedEvents = mapKeyUp(ev.kbd); + + if (!mappedEvents.empty()) + return mappedEvents; else - return false; + return DefaultEventMapper::mapEvent(ev, source); } -bool Keymapper::mapKeyDown(const KeyState& key) { +List<Event> Keymapper::mapKeyDown(const KeyState& key) { return mapKey(key, true); } -bool Keymapper::mapKeyUp(const KeyState& key) { +List<Event> Keymapper::mapKeyUp(const KeyState& key) { return mapKey(key, false); } -bool Keymapper::mapKey(const KeyState& key, bool keyDown) { +List<Event> Keymapper::mapKey(const KeyState& key, bool keyDown) { if (!_enabled || _activeMaps.empty()) - return false; + return List<Event>(); Action *action = 0; @@ -217,7 +225,7 @@ bool Keymapper::mapKey(const KeyState& key, bool keyDown) { if (action) _keysDown[key] = action; } else { - HashMap<KeyState, Action*>::iterator it = _keysDown.find(key); + HashMap<KeyState, Action *>::iterator it = _keysDown.find(key); if (it != _keysDown.end()) { action = it->_value; @@ -226,11 +234,9 @@ bool Keymapper::mapKey(const KeyState& key, bool keyDown) { } if (!action) - return false; + return List<Event>(); - executeAction(action, keyDown); - - return true; + return executeAction(action, keyDown); } Action *Keymapper::getAction(const KeyState& key) { @@ -239,7 +245,8 @@ Action *Keymapper::getAction(const KeyState& key) { return action; } -void Keymapper::executeAction(const Action *action, bool keyDown) { +List<Event> Keymapper::executeAction(const Action *action, bool keyDown) { + List<Event> mappedEvents; List<Event>::const_iterator it; for (it = action->events.begin(); it != action->events.end(); ++it) { @@ -279,8 +286,9 @@ void Keymapper::executeAction(const Action *action, bool keyDown) { } evt.mouse = _eventMan->getMousePos(); - addEvent(evt); + mappedEvents.push_back(evt); } + return mappedEvents; } const HardwareKey *Keymapper::findHardwareKey(const KeyState& key) { diff --git a/backends/keymapper/keymapper.h b/backends/keymapper/keymapper.h index d2aa89cad6..31bfcbc080 100644 --- a/backends/keymapper/keymapper.h +++ b/backends/keymapper/keymapper.h @@ -39,7 +39,7 @@ namespace Common { const char *const kGuiKeymapName = "gui"; const char *const kGlobalKeymapName = "global"; -class Keymapper : public Common::EventMapper, private Common::ArtificialEventSource { +class Keymapper : public Common::DefaultEventMapper { public: struct MapRecord { @@ -77,6 +77,9 @@ public: Keymapper(EventManager *eventMan); ~Keymapper(); + // EventMapper interface + virtual List<Event> mapEvent(const Event &ev, EventSource *source); + /** * Registers a HardwareKeySet with the Keymapper * @note should only be called once (during backend initialisation) @@ -86,7 +89,7 @@ public: /** * Get a list of all registered HardwareKeys */ - const List<const HardwareKey*> &getHardwareKeys() const { + const List<const HardwareKey *> &getHardwareKeys() const { assert(_hardwareKeys); return _hardwareKeys->getHardwareKeys(); } @@ -137,31 +140,27 @@ public: */ void popKeymap(const char *name = 0); - // Implementation of the EventMapper interface - bool notifyEvent(const Common::Event &ev); - bool pollEvent(Common::Event &ev) { return Common::ArtificialEventSource::pollEvent(ev); } - /** * @brief Map a key press event. * If the active keymap contains a Action mapped to the given key, then * the Action's events are pushed into the EventManager's event queue. * @param key key that was pressed * @param keyDown true for key down, false for key up - * @return true if key was mapped + * @return mapped events */ - bool mapKey(const KeyState& key, bool keyDown); + List<Event> mapKey(const KeyState& key, bool keyDown); /** * @brief Map a key down event. * @see mapKey */ - bool mapKeyDown(const KeyState& key); + List<Event> mapKeyDown(const KeyState& key); /** * @brief Map a key up event. * @see mapKey */ - bool mapKeyUp(const KeyState& key); + List<Event> mapKeyUp(const KeyState& key); /** * Enable/disable the keymapper @@ -189,14 +188,14 @@ private: void pushKeymap(Keymap *newMap, bool transparent, bool global); Action *getAction(const KeyState& key); - void executeAction(const Action *act, bool keyDown); + List<Event> executeAction(const Action *act, bool keyDown); EventManager *_eventMan; bool _enabled; Stack<MapRecord> _activeMaps; - HashMap<KeyState, Action*> _keysDown; + HashMap<KeyState, Action *> _keysDown; }; diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index 4b95a1a021..a869909196 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -57,14 +57,13 @@ RemapDialog::~RemapDialog() { } void RemapDialog::open() { - bool divider = false; const Stack<Keymapper::MapRecord> &activeKeymaps = _keymapper->getActiveStack(); if (activeKeymaps.size() > 0) { if (activeKeymaps.top().keymap->getName() == Common::kGuiKeymapName) _topKeymapIsGui = true; + // Add the entry for the "effective" special view. See RemapDialog::loadKeymap() _kmPopUp->appendEntry(activeKeymaps.top().keymap->getName() + _(" (Effective)")); - divider = true; } Keymapper::Domain *_globalKeymaps = &_keymapper->getGlobalDomain(); @@ -92,41 +91,42 @@ void RemapDialog::open() { debug(3, "RemapDialog::open keymaps: %d", keymapCount); - _keymapTable = (Keymap **)malloc(sizeof(Keymap*) * keymapCount); + _keymapTable = (Keymap **)malloc(sizeof(Keymap *) * keymapCount); Keymapper::Domain::iterator it; uint32 idx = 0; if (activeKeymaps.size() > 1) { - if (divider) - _kmPopUp->appendEntry(""); int topIndex = activeKeymaps.size() - 1; + bool active = activeKeymaps[topIndex].transparent; for (int i = topIndex - 1; i >= 0; --i) { Keymapper::MapRecord mr = activeKeymaps[i]; - _kmPopUp->appendEntry(mr.keymap->getName() + _(" (Active)"), idx); + // Add an entry for each keymap in the stack after the top keymap. Mark it Active if it is + // reachable or Blocked if an opaque keymap is on top of it thus blocking access to it. + _kmPopUp->appendEntry(mr.keymap->getName() + (active ? _(" (Active)") : _(" (Blocked)")), idx); _keymapTable[idx++] = mr.keymap; + active &= mr.transparent; } - divider = true; } + _kmPopUp->appendEntry(""); + + // Now add entries for all known keymaps. Note that there will be duplicates with the stack entries. + if (_globalKeymaps) { - if (divider) - _kmPopUp->appendEntry(""); for (it = _globalKeymaps->begin(); it != _globalKeymaps->end(); ++it) { + // "global" means its keybindings apply to all games; saved in a global conf domain _kmPopUp->appendEntry(it->_value->getName() + _(" (Global)"), idx); _keymapTable[idx++] = it->_value; } - divider = true; } if (_gameKeymaps) { - if (divider) - _kmPopUp->appendEntry(""); for (it = _gameKeymaps->begin(); it != _gameKeymaps->end(); ++it) { + // "game" means its keybindings are saved per-target _kmPopUp->appendEntry(it->_value->getName() + _(" (Game)"), idx); _keymapTable[idx++] = it->_value; } - divider = true; } _changes = false; @@ -321,9 +321,11 @@ void RemapDialog::loadKeymap() { debug(3, "RemapDialog::loadKeymap active keymaps: %u", activeKeymaps.size()); if (!activeKeymaps.empty() && _kmPopUp->getSelected() == 0) { - // load active keymaps + // This is the "effective" view which shows all effective actions: + // - all of the topmost keymap action + // - all mapped actions that are reachable - List<const HardwareKey*> freeKeys(_keymapper->getHardwareKeys()); + List<const HardwareKey *> freeKeys(_keymapper->getHardwareKeys()); int topIndex = activeKeymaps.size() - 1; @@ -334,7 +336,7 @@ void RemapDialog::loadKeymap() { // add most active keymap's keys Keymapper::MapRecord top = activeKeymaps[topIndex]; - List<Action*>::iterator actIt; + List<Action *>::iterator actIt; debug(3, "RemapDialog::loadKeymap top keymap: %s", top.keymap->getName().c_str()); for (actIt = top.keymap->getActions().begin(); actIt != top.keymap->getActions().end(); ++actIt) { Action *act = *actIt; @@ -351,7 +353,7 @@ void RemapDialog::loadKeymap() { for (int i = topIndex - 1; i >= 0; --i) { Keymapper::MapRecord mr = activeKeymaps[i]; debug(3, "RemapDialog::loadKeymap keymap: %s", mr.keymap->getName().c_str()); - List<const HardwareKey*>::iterator keyIt = freeKeys.begin(); + List<const HardwareKey *>::iterator keyIt = freeKeys.begin(); while (keyIt != freeKeys.end()) { Action *act = mr.keymap->getMappedAction((*keyIt)->key); @@ -371,9 +373,12 @@ void RemapDialog::loadKeymap() { } } else if (_kmPopUp->getSelected() != -1) { + // This is the regular view of a keymap that isn't the topmost one. + // It shows all of that keymap's actions + Keymap *km = _keymapTable[_kmPopUp->getSelectedTag()]; - List<Action*>::iterator it; + List<Action *>::iterator it; for (it = km->getActions().begin(); it != km->getActions().end(); ++it) { ActionInfo info = {*it, false, (*it)->description}; diff --git a/backends/keymapper/types.h b/backends/keymapper/types.h deleted file mode 100644 index ed2e498bd0..0000000000 --- a/backends/keymapper/types.h +++ /dev/null @@ -1,74 +0,0 @@ -/* 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. -* -*/ - -#ifndef KEYMAPPER_TYPES_H -#define KEYMAPPER_TYPES_H - -#include "common/scummsys.h" - -#ifdef ENABLE_KEYMAPPER - -namespace Common { - -enum KeyType { - kGenericKeyType, - kDirUpKeyType, - kDirDownKeyType, - kDirLeftKeyType, - kDirRightKeyType, - kActionKeyType, - kTriggerLeftKeyType, - kTriggerRightKeyType, - kStartKeyType, - kSelectKeyType, - /* ... */ - - kKeyTypeMax -}; - -enum ActionType { - kGenericActionType, - - // common actions - kDirUpActionType, - kDirDownActionType, - kDirLeftActionType, - kDirRightActionType, - kLeftClickActionType, - kRightClickActionType, - kSaveActionType, - kMenuActionType, - kQuitActionType, - kVirtualKeyboardActionType, - kKeyRemapActionType, - kVolumeUpActionType, - kVolumeDownActionType, - - - kActionTypeMax -}; - -} // End of namespace Common - -#endif // #ifdef ENABLE_KEYMAPPER - -#endif // #ifndef KEYMAPPER_TYPES_H diff --git a/backends/mutex/null/null-mutex.h b/backends/mutex/null/null-mutex.h index fdb32b241c..7ae10cedb8 100644 --- a/backends/mutex/null/null-mutex.h +++ b/backends/mutex/null/null-mutex.h @@ -28,7 +28,7 @@ /** * Null mutex manager */ -class NullMutexManager : MutexManager { +class NullMutexManager : public MutexManager { public: virtual OSystem::MutexRef createMutex() { return OSystem::MutexRef(); } virtual void lockMutex(OSystem::MutexRef mutex) {} diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp index 0e116a7145..a58b93e3bb 100644 --- a/backends/platform/android/events.cpp +++ b/backends/platform/android/events.cpp @@ -227,17 +227,14 @@ void OSystem_Android::setupKeymapper() { HardwareKeySet *keySet = new HardwareKeySet(); keySet->addHardwareKey( - new HardwareKey("n", KeyState(KEYCODE_n), "n (vk)", - kTriggerLeftKeyType, - kVirtualKeyboardActionType)); + new HardwareKey("n", KeyState(KEYCODE_n), "n (vk)")); mapper->registerHardwareKeySet(keySet); Keymap *globalMap = new Keymap(kGlobalKeymapName); Action *act; - act = new Action(globalMap, "VIRT", "Display keyboard", - kVirtualKeyboardActionType); + act = new Action(globalMap, "VIRT", "Display keyboard"); act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0)); mapper->addGlobalKeymap(globalMap); diff --git a/backends/platform/bada/application.cpp b/backends/platform/bada/application.cpp index bf585d2782..ba8e544983 100644 --- a/backends/platform/bada/application.cpp +++ b/backends/platform/bada/application.cpp @@ -68,7 +68,7 @@ void BadaScummVM::OnUserEventReceivedN(RequestId requestId, // assertion failure termination String *message = NULL; if (args) { - message = (String*)args->GetAt(0); + message = (String *)args->GetAt(0); } if (!message) { message = new String("Unknown error"); diff --git a/backends/platform/bada/audio.cpp b/backends/platform/bada/audio.cpp index b868e91357..65a5a80fa5 100644 --- a/backends/platform/bada/audio.cpp +++ b/backends/platform/bada/audio.cpp @@ -238,7 +238,7 @@ void AudioThread::OnAudioOutBufferEndReached(Osp::Media::AudioOut &src) { void AudioThread::OnTimerExpired(Timer &timer) { if (_ready < NUM_AUDIO_BUFFERS) { uint len = _audioBuffer[_head].GetCapacity(); - int samples = _mixer->mixCallback((byte*)_audioBuffer[_head].GetPointer(), len); + int samples = _mixer->mixCallback((byte *)_audioBuffer[_head].GetPointer(), len); if (samples) { _head = (_head + 1) % NUM_AUDIO_BUFFERS; _ready++; diff --git a/backends/platform/bada/fs.cpp b/backends/platform/bada/fs.cpp index 0ae0cde43d..37ca496d18 100644 --- a/backends/platform/bada/fs.cpp +++ b/backends/platform/bada/fs.cpp @@ -170,17 +170,17 @@ uint32 BadaFileStream::read(void *ptr, uint32 len) { uint32 available = bufferLength - bufferIndex; if (len <= available) { // use allocation - memcpy((byte*)ptr, &buffer[bufferIndex], len); + memcpy((byte *)ptr, &buffer[bufferIndex], len); bufferIndex += len; result = len; } else { // use remaining allocation - memcpy((byte*)ptr, &buffer[bufferIndex], available); + memcpy((byte *)ptr, &buffer[bufferIndex], available); uint32 remaining = len - available; result = available; if (remaining) { - result += file->Read(((byte*)ptr) + available, remaining); + result += file->Read(((byte *)ptr) + available, remaining); } bufferIndex = bufferLength = 0; } @@ -192,11 +192,11 @@ uint32 BadaFileStream::read(void *ptr, uint32 len) { if (bufferLength < len) { len = bufferLength; } - memcpy((byte*)ptr, buffer, len); + memcpy((byte *)ptr, buffer, len); result = bufferIndex = len; } } else { - result = file->Read((byte*)ptr, len); + result = file->Read((byte *)ptr, len); bufferIndex = bufferLength = 0; } } else { diff --git a/backends/platform/bada/missing.cpp b/backends/platform/bada/missing.cpp index a5433ec61a..10d45ca4b5 100644 --- a/backends/platform/bada/missing.cpp +++ b/backends/platform/bada/missing.cpp @@ -96,7 +96,7 @@ int sprintf(char *str, const char *format, ...) { char *strdup(const char *strSource) { char *buffer; int len = strlen(strSource) + 1; - buffer = (char*)malloc(len); + buffer = (char *)malloc(len); if (buffer) { memcpy(buffer, strSource, len); } diff --git a/backends/platform/bada/portdefs.h b/backends/platform/bada/portdefs.h index 7d85a9ec35..813c5acde3 100644 --- a/backends/platform/bada/portdefs.h +++ b/backends/platform/bada/portdefs.h @@ -65,9 +65,9 @@ void stderr_vfprintf(void*, const char *format, va_list ap); #undef fputs #undef fflush -#define stderr (void*)0 -#define stdout (void*)1 -#define stdin (void*)2 +#define stderr (void *)0 +#define stdout (void *)1 +#define stdin (void *)2 #define fputs(str, file) #define fflush(file) #define sscanf simple_sscanf diff --git a/backends/platform/dc/audio.cpp b/backends/platform/dc/audio.cpp index 35cb51f349..4f01531486 100644 --- a/backends/platform/dc/audio.cpp +++ b/backends/platform/dc/audio.cpp @@ -59,7 +59,7 @@ void OSystem_Dreamcast::checkSound() if (n<100) return; - _mixer->mixCallback((byte*)temp_sound_buffer, + _mixer->mixCallback((byte *)temp_sound_buffer, 2*SAMPLES_TO_BYTES(n)); if (fillpos+n > curr_ring_buffer_samples) { diff --git a/backends/platform/dc/dcloader.cpp b/backends/platform/dc/dcloader.cpp index 675f7ad8c7..56193c282a 100644 --- a/backends/platform/dc/dcloader.cpp +++ b/backends/platform/dc/dcloader.cpp @@ -385,8 +385,8 @@ void *DLObject::symbol(const char *name) for (int c = symbol_cnt; c--; s++) if ((s->st_info>>4 == 1 || s->st_info>>4 == 2) && strtab[s->st_name] == '_' && !strcmp(name, strtab+s->st_name+1)) { - DBG(("=> %p\n", (void*)s->st_value)); - return (void*)s->st_value; + DBG(("=> %p\n", (void *)s->st_value)); + return (void *)s->st_value; } seterror("Symbol \"%s\" not found.", name); diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp index 76658c6590..e886b55869 100644 --- a/backends/platform/dc/display.cpp +++ b/backends/platform/dc/display.cpp @@ -334,8 +334,8 @@ void OSystem_Dreamcast::updateScreenTextures(void) unsigned short *dst = (unsigned short *)screen_tx[_screen_buffer]; unsigned char *src = screen; - // while ((*((volatile unsigned int *)(void*)0xa05f810c) & 0x3ff) != 200); - // *((volatile unsigned int *)(void*)0xa05f8040) = 0xff0000; + // while ((*((volatile unsigned int *)(void *)0xa05f810c) & 0x3ff) != 200); + // *((volatile unsigned int *)(void *)0xa05f8040) = 0xff0000; if (_screenFormat == 0) for ( int y = 0; y<_screen_h; y++ ) @@ -379,7 +379,7 @@ void OSystem_Dreamcast::updateScreenPolygons(void) struct polygon_list mypoly; struct packed_colour_vertex_list myvertex; - // *((volatile unsigned int *)(void*)0xa05f8040) = 0x00ff00; + // *((volatile unsigned int *)(void *)0xa05f8040) = 0x00ff00; mypoly.cmd = TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_OPAQUE|TA_CMD_POLYGON_SUBLIST| @@ -395,7 +395,7 @@ void OSystem_Dreamcast::updateScreenPolygons(void) mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0; ta_begin_frame(); - // *((volatile unsigned int *)(void*)0xa05f8040) = 0x0000ff; + // *((volatile unsigned int *)(void *)0xa05f8040) = 0x0000ff; ta_commit_list(&mypoly); myvertex.cmd = TA_CMD_VERTEX; @@ -493,12 +493,12 @@ void OSystem_Dreamcast::updateScreenPolygons(void) _softkbd.draw(330.0*sin(0.013*_softkbd_motion) - 320.0, 200.0, 120-_softkbd_motion); - // *((volatile unsigned int *)(void*)0xa05f8040) = 0xffff00; + // *((volatile unsigned int *)(void *)0xa05f8040) = 0xffff00; drawMouse(_ms_cur_x, _ms_cur_y, _ms_cur_w, _ms_cur_h, _ms_buf, _ms_visible); - // *((volatile unsigned int *)(void*)0xa05f8040) = 0xff00ff; + // *((volatile unsigned int *)(void *)0xa05f8040) = 0xff00ff; ta_commit_frame(); - // *((volatile unsigned int *)(void*)0xa05f8040) = 0x0; + // *((volatile unsigned int *)(void *)0xa05f8040) = 0x0; _last_screen_refresh = Timer(); } diff --git a/backends/platform/ds/arm7/source/main.cpp b/backends/platform/ds/arm7/source/main.cpp index 2e9cacc669..6e714b22fa 100644 --- a/backends/platform/ds/arm7/source/main.cpp +++ b/backends/platform/ds/arm7/source/main.cpp @@ -46,10 +46,10 @@ #include "cartreset_nolibfat.h" -#define TOUCH_CAL_X1 (*(vs16*)0x027FFCD8) -#define TOUCH_CAL_Y1 (*(vs16*)0x027FFCDA) -#define TOUCH_CAL_X2 (*(vs16*)0x027FFCDE) -#define TOUCH_CAL_Y2 (*(vs16*)0x027FFCE0) +#define TOUCH_CAL_X1 (*(vs16 *)0x027FFCD8) +#define TOUCH_CAL_Y1 (*(vs16 *)0x027FFCDA) +#define TOUCH_CAL_X2 (*(vs16 *)0x027FFCDE) +#define TOUCH_CAL_Y2 (*(vs16 *)0x027FFCE0) #define SCREEN_WIDTH 256 #define SCREEN_HEIGHT 192 s32 TOUCH_WIDTH = TOUCH_CAL_X2 - TOUCH_CAL_X1; @@ -71,10 +71,10 @@ int temp; int adpcmBufferNum = 0; // those are pixel positions of the two points you click when calibrating -#define TOUCH_CNTRL_X1 (*(vu8*)0x027FFCDC) -#define TOUCH_CNTRL_Y1 (*(vu8*)0x027FFCDD) -#define TOUCH_CNTRL_X2 (*(vu8*)0x027FFCE2) -#define TOUCH_CNTRL_Y2 (*(vu8*)0x027FFCE3) +#define TOUCH_CNTRL_X1 (*(vu8 *)0x027FFCDC) +#define TOUCH_CNTRL_Y1 (*(vu8 *)0x027FFCDD) +#define TOUCH_CNTRL_X2 (*(vu8 *)0x027FFCE2) +#define TOUCH_CNTRL_Y2 (*(vu8 *)0x027FFCE3) ////////////////////////////////////////////////////////////////////// @@ -330,7 +330,7 @@ void performSleep() { // int saveInts = REG_IE; // REG_IE = (1 << 22) | IRQ_VBLANK; // Lid open -// *((u32*) (0x0380FFF8)) = *((u32*) (0x0380FFF8)) | (REG_IE & REG_IF); +// *((u32 *) (0x0380FFF8)) = *((u32 *) (0x0380FFF8)) | (REG_IE & REG_IF); // VBLANK_INTR_WAIT_FLAGS = IRQ_VBLANK; diff --git a/backends/platform/ds/arm9/source/blitters.cpp b/backends/platform/ds/arm9/source/blitters.cpp index 0076b302fd..1e8d56615d 100644 --- a/backends/platform/ds/arm9/source/blitters.cpp +++ b/backends/platform/ds/arm9/source/blitters.cpp @@ -222,8 +222,8 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3 u32 d10 = 0x80008000 | (rd1 << 26) | (gd1 << 21) | (bd1 << 16) | (rd0 << 10) | (gd0 << 5) | bd0; u32 d32 = 0x80008000 | (rd3 << 26) | (gd3 << 21) | (bd3 << 16) | (rd2 << 10) | (gd2 << 5) | bd2; - ((u32*)dest)[0] = d10; - ((u32*)dest)[1] = d32; + ((u32 *)dest)[0] = d10; + ((u32 *)dest)[1] = d32; } #else static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3, u16 s4, @@ -290,7 +290,7 @@ static inline void RescaleBlock_5x8888_To_4x1555( u32 s0, u32 s1, u32 s2, u32 s3 gd0 = DIV_BY_5[gd0]; gd1 = DIV_BY_5[gd1]; bd0 = DIV_BY_5[bd0]; bd1 = DIV_BY_5[bd1]; u32 d10 = 0x80008000 | (rd1 << 26) | (gd1 << 21) | (bd1 << 16) | (rd0 << 10) | (gd0 << 5) | bd0; - ((u32*)dest)[0] = d10; + ((u32 *)dest)[0] = d10; u32 d2 = 2*s2 + 2*s3 + s3; u32 d3 = s3 + 4*s4; @@ -307,7 +307,7 @@ static inline void RescaleBlock_5x8888_To_4x1555( u32 s0, u32 s1, u32 s2, u32 s3 bd2 = DIV_BY_5[bd2]; bd3 = DIV_BY_5[bd3]; u32 d32 = 0x80008000 | (rd3 << 26) | (gd3 << 21) | (bd3 << 16) | (rd2 << 10) | (gd2 << 5) | bd2; - ((u32*)dest)[1] = d32; + ((u32 *)dest)[1] = d32; } // Can't work in place @@ -377,7 +377,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16 *dest, const u8 *src, int destStri void Rescale_320x256xPAL8_To_256x256x1555(u16 *dest, const u8 *src, int destStride, int srcStride, const u16 *palette) { u16 fastRam[256]; for (size_t i = 0; i < 128; ++i) - ((u32*)fastRam)[i] = ((const u32*)palette)[i]; + ((u32 *)fastRam)[i] = ((const u32*)palette)[i]; for (size_t i = 0; i < 200; ++i) { Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam); diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index dfd906d816..cedbdcb167 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -926,7 +926,7 @@ void displayMode16Bit() { SUB_BG0_Y0 = 0; consoleInit(NULL, 0, BgType_Text4bpp, BgSize_T_256x256, 4, 0, false, true); -// consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(4), (u16*)CHAR_BASE_BLOCK_SUB(0), 16); +// consoleInitDefault((u16 *)SCREEN_BASE_BLOCK_SUB(4), (u16 *)CHAR_BASE_BLOCK_SUB(0), 16); for (int r = 0; r < 32 * 32; r++) { ((u16 *) SCREEN_BASE_BLOCK_SUB(4))[r] = buffer[r]; @@ -2414,7 +2414,7 @@ void initHardware() { BG_PALETTE[255] = RGB15(31,31,31);//by default font will be rendered with color 255 //consoleInit() is a lot more flexible but this gets you up and running quick -// consoleInitDefault((u16*)SCREEN_BASE_BLOCK(0), (u16*)CHAR_BASE_BLOCK(1), 16); +// consoleInitDefault((u16 *)SCREEN_BASE_BLOCK(0), (u16 *)CHAR_BASE_BLOCK(1), 16); //consolePrintSet(0, 6); //irqs are nice @@ -2886,7 +2886,7 @@ void dsExceptionHandler() { setExceptionHandler(NULL); u32 currentMode = getCPSR() & 0x1f; - u32 thumbState = ((*(u32*)0x027FFD90) & 0x20); + u32 thumbState = ((*(u32 *)0x027FFD90) & 0x20); u32 codeAddress, exceptionAddress = 0; diff --git a/backends/platform/iphone/blit_arm.h b/backends/platform/iphone/blit_arm.h deleted file mode 100644 index 77bb3578ab..0000000000 --- a/backends/platform/iphone/blit_arm.h +++ /dev/null @@ -1,35 +0,0 @@ -/* 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. - * - */ - -extern "C" void blitLandscapeScreenRect16bpp(uint16 *dst, uint16 *src, - int width, - int height, - int screenWidth, - int screenHeight); - -extern "C" void blitLandscapeScreenRect8bpp(uint16 *dst, - byte *src, - int width, - int height, - uint16 *palette, - int screenWidth, - int screenHeight); diff --git a/backends/platform/iphone/blit_arm.s b/backends/platform/iphone/blit_arm.s deleted file mode 100644 index 04f9a87614..0000000000 --- a/backends/platform/iphone/blit_arm.s +++ /dev/null @@ -1,137 +0,0 @@ -@ 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. -@ -@ @author Robin Watts (robin@wss.co.uk) - - .text - - .global _blitLandscapeScreenRect16bpp - .global _blitLandscapeScreenRect8bpp - - -_blitLandscapeScreenRect16bpp: - @ r0 = dst - @ r1 = src - @ r2 = w - @ r3 = h - @ <> = _screenWidth - @ <> = _screenHeight - mov r12,r13 - stmfd r13!,{r4-r11,r14} - ldmfd r12,{r12,r14} @ r12 = _screenWidth - @ r14 = _screenHeight - add r14,r14,r3 @ r14 = _screenHeight + h - mvn r11,#0 - mla r11,r3,r12,r11 @ r11= _screenWidth*h-1 - add r12,r12,r12 -xloop: - subs r4,r3,#5 @ r4 = y = h - ble thin -yloop: - ldrh r5, [r1],r12 @ r5 = *src src += _screenWidth - ldrh r6, [r1],r12 @ r6 = *src src += _screenWidth - ldrh r7, [r1],r12 @ r7 = *src src += _screenWidth - ldrh r8, [r1],r12 @ r8 = *src src += _screenWidth - ldrh r9, [r1],r12 @ r9 = *src src += _screenWidth - ldrh r10,[r1],r12 @ r10= *src src += _screenWidth - subs r4,r4,#6 - strh r5, [r0],#2 @ *dst++ = r5 - strh r6, [r0],#2 @ *dst++ = r6 - strh r7, [r0],#2 @ *dst++ = r7 - strh r8, [r0],#2 @ *dst++ = r8 - strh r9, [r0],#2 @ *dst++ = r9 - strh r10,[r0],#2 @ *dst++ = r10 - bgt yloop -thin: - adds r4,r4,#5 - beq lineend -thin_loop: - ldrh r5,[r1],r12 @ r5 = *src src += _screenWidth - subs r4,r4,#1 - strh r5,[r0],#2 @ *dst++ = r5 - bgt thin_loop -lineend: - sub r0,r0,r14,LSL #1 @ dst -= _screenHeight + h - sub r1,r1,r11,LSL #1 @ src += 1-_screenWidth*h - subs r2,r2,#1 - bgt xloop - - ldmfd r13!,{r4-r11,PC} - -_blitLandscapeScreenRect8bpp: - @ r0 = dst - @ r1 = src - @ r2 = w - @ r3 = h - @ <> = _palette - @ <> = _screenWidth - @ <> = _screenHeight - mov r12,r13 - stmfd r13!,{r4-r11,r14} - ldmfd r12,{r11,r12,r14} @ r11 = _palette - @ r12 = _screenWidth - @ r14 = _screenHeight - add r14,r14,r3 @ r14 = _screenHeight + h - mvn r6,#0 - mla r6,r3,r12,r6 @ r6 = _screenWidth*h-1 -xloop8: - mov r4,r3 @ r4 = y = h - subs r4,r3,#4 @ r4 = y = h - ble thin8 -yloop8: - ldrb r5, [r1],r12 @ r5 = *src src += _screenWidth - ldrb r7, [r1],r12 @ r7 = *src src += _screenWidth - ldrb r8, [r1],r12 @ r8 = *src src += _screenWidth - ldrb r9, [r1],r12 @ r9 = *src src += _screenWidth - ldrb r10,[r1],r12 @ r10= *src src += _screenWidth - add r5, r5, r5 - add r7, r7, r7 - add r8, r8, r8 - add r9, r9, r9 - add r10,r10,r10 - ldrh r5, [r11,r5] - ldrh r7, [r11,r7] - ldrh r8, [r11,r8] - ldrh r9, [r11,r9] - ldrh r10,[r11,r10] - subs r4,r4,#5 - strh r5, [r0],#2 @ *dst++ = r5 - strh r7, [r0],#2 @ *dst++ = r7 - strh r8, [r0],#2 @ *dst++ = r8 - strh r9, [r0],#2 @ *dst++ = r9 - strh r10,[r0],#2 @ *dst++ = r10 - bgt yloop8 -thin8: - adds r4,r4,#4 - beq lineend8 -thin_loop8: - ldrb r5,[r1],r12 @ r5 = *src src += _screenWidth - add r5,r5,r5 - ldrh r5,[r11,r5] - subs r4,r4,#1 - strh r5,[r0],#2 @ *dst++ = r5 - bgt thin_loop8 -lineend8: - sub r0,r0,r14,LSL #1 @ dst -= _screenHeight + h - sub r1,r1,r6 @ src += 1-_screenWidth*h - subs r2,r2,#1 - bgt xloop8 - - ldmfd r13!,{r4-r11,PC} diff --git a/backends/platform/iphone/iphone_common.h b/backends/platform/iphone/iphone_common.h index 0cbcb77bcb..2f03309215 100644 --- a/backends/platform/iphone/iphone_common.h +++ b/backends/platform/iphone/iphone_common.h @@ -20,6 +20,8 @@ * */ +#ifndef BACKENDS_PLATFORM_IPHONE_IPHONE_COMMON_H +#define BACKENDS_PLATFORM_IPHONE_IPHONE_COMMON_H enum InputEvent { kInputMouseDown, @@ -41,13 +43,17 @@ enum ScreenOrientation { kScreenOrientationFlippedLandscape }; -typedef enum -{ +enum UIViewSwipeDirection { kUIViewSwipeUp = 1, kUIViewSwipeDown = 2, kUIViewSwipeLeft = 4, kUIViewSwipeRight = 8 -} UIViewSwipeDirection; +}; + +typedef enum { + kGraphicsModeLinear = 0, + kGraphicsModeNone = 1 +} GraphicsModes; #ifdef IPHONE_OFFICIAL void iphone_main(int argc, char **argv); @@ -64,20 +70,24 @@ void iphone_main(int argc, char *argv[]); #endif // On the ObjC side +void iPhone_setGraphicsMode(int mode); void iPhone_updateScreen(int mouseX, int mouseY); -void iPhone_updateScreenRect(unsigned short* screen, int x1, int y1, int x2, int y2); -void iPhone_updateOverlayRect(unsigned short* screen, int x1, int y1, int x2, int y2); +void iPhone_updateScreenRect(unsigned short *screen, int x1, int y1, int x2, int y2); +void iPhone_updateOverlayRect(unsigned short *screen, int x1, int y1, int x2, int y2); void iPhone_initSurface(int width, int height); -bool iPhone_fetchEvent(int *outEvent, float *outX, float *outY); -const char* iPhone_getDocumentsDir(); +bool iPhone_fetchEvent(int *outEvent, int *outX, int *outY); +const char *iPhone_getDocumentsDir(); bool iPhone_isHighResDevice(); int iPhone_getScreenHeight(); int iPhone_getScreenWidth(); void iPhone_enableOverlay(int state); -void iPhone_setMouseCursor(short* buffer, int width, int height); +void iPhone_showCursor(int state); +void iPhone_setMouseCursor(unsigned short *buffer, int width, int height, int hotspotX, int hotspotY); uint getSizeNextPOT(uint size); #ifdef __cplusplus } #endif + +#endif diff --git a/backends/platform/iphone/iphone_keyboard.h b/backends/platform/iphone/iphone_keyboard.h index eecad09398..b13ac35616 100644 --- a/backends/platform/iphone/iphone_keyboard.h +++ b/backends/platform/iphone/iphone_keyboard.h @@ -20,17 +20,22 @@ * */ +#ifndef BACKENDS_PLATFORM_IPHONE_IPHONE_KEYBOARD_H +#define BACKENDS_PLATFORM_IPHONE_IPHONE_KEYBOARD_H + #import <UIKit/UIKit.h> #import <UIKit/UITextView.h> @interface SoftKeyboard : UIView { id inputDelegate; - UITextView* inputView; + UITextView *inputView; } - (id)initWithFrame:(CGRect)frame; -- (UITextView*)inputView; +- (UITextView *)inputView; - (void)setInputDelegate:(id)delegate; - (void)handleKeyPress:(unichar)c; @end + +#endif diff --git a/backends/platform/iphone/iphone_keyboard.m b/backends/platform/iphone/iphone_keyboard.m index 1624d02977..b00930ab31 100644 --- a/backends/platform/iphone/iphone_keyboard.m +++ b/backends/platform/iphone/iphone_keyboard.m @@ -20,7 +20,7 @@ * */ -#import "iphone_keyboard.h" +#include "iphone_keyboard.h" @interface UITextInputTraits - (void)setAutocorrectionType:(int)type; @@ -29,17 +29,17 @@ @end @interface TextInputHandler : UITextView { - SoftKeyboard* softKeyboard; + SoftKeyboard *softKeyboard; } -- (id)initWithKeyboard:(SoftKeyboard*)keyboard; +- (id)initWithKeyboard:(SoftKeyboard *)keyboard; @end @implementation TextInputHandler -- (id)initWithKeyboard:(SoftKeyboard*)keyboard; { +- (id)initWithKeyboard:(SoftKeyboard *)keyboard; { self = [super initWithFrame:CGRectMake(0.0f, 0.0f, 0.0f, 0.0f)]; softKeyboard = keyboard; @@ -80,7 +80,7 @@ return self; } -- (UITextView*)inputView { +- (UITextView *)inputView { return inputView; } diff --git a/backends/platform/iphone/iphone_main.m b/backends/platform/iphone/iphone_main.m index c2ec328bf5..051da417ea 100644 --- a/backends/platform/iphone/iphone_main.m +++ b/backends/platform/iphone/iphone_main.m @@ -28,30 +28,30 @@ void iphone_main(int argc, char *argv[]); @interface iPhoneMain : UIApplication { - UIWindow* _window; - iPhoneView* _view; + UIWindow *_window; + iPhoneView *_view; } -- (void) mainLoop: (id)param; -- (iPhoneView*) getView; -- (UIWindow*) getWindow; +- (void)mainLoop:(id)param; +- (iPhoneView *)getView; +- (UIWindow *)getWindow; - (void)didRotate:(NSNotification *)notification; @end static int gArgc; -static char** gArgv; +static char **gArgv; -int main(int argc, char** argv) { +int main(int argc, char **argv) { gArgc = argc; gArgv = argv; - NSAutoreleasePool *autoreleasePool = [ - [ NSAutoreleasePool alloc ] init - ]; + NSAutoreleasePool *autoreleasePool = [ + [NSAutoreleasePool alloc] init + ]; - int returnCode = UIApplicationMain(argc, argv, @"iPhoneMain", @"iPhoneMain"); - [ autoreleasePool release ]; - return returnCode; + int returnCode = UIApplicationMain(argc, argv, @"iPhoneMain", @"iPhoneMain"); + [autoreleasePool release]; + return returnCode; } @implementation iPhoneMain @@ -63,14 +63,14 @@ int main(int argc, char** argv) { return self; } -- (void) mainLoop: (id)param { +- (void)mainLoop:(id)param { [[NSAutoreleasePool alloc] init]; iphone_main(gArgc, gArgv); exit(0); } -- (iPhoneView*) getView { +- (iPhoneView *)getView { return _view; } @@ -78,38 +78,36 @@ int main(int argc, char** argv) { CGRect rect = [[UIScreen mainScreen] bounds]; // hide the status bar - [application setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO]; - [application setStatusBarHidden:YES animated:YES]; + [application setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO]; + [application setStatusBarHidden:YES animated:YES]; _window = [[UIWindow alloc] initWithFrame:rect]; [_window retain]; - _view = [[iPhoneView alloc] initWithFrame: rect]; + _view = [[iPhoneView alloc] initWithFrame:rect]; _view.multipleTouchEnabled = YES; - [_window setContentView: _view]; + [_window setContentView:_view]; [_window addSubview:_view]; [_window makeKeyAndVisible]; [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(didRotate:) - name:@"UIDeviceOrientationDidChangeNotification" object:nil]; + selector:@selector(didRotate:) + name:@"UIDeviceOrientationDidChangeNotification" + object:nil]; [NSThread detachNewThreadSelector:@selector(mainLoop:) toTarget:self withObject:nil]; } -- (void)applicationDidResume -{ +- (void)applicationDidResume { } -- (void)applicationWillSuspend -{ +- (void)applicationWillSuspend { } -- (void)applicationWillTerminate -{ +- (void)applicationWillTerminate { } - (void)applicationSuspend:(struct __GSEvent *)event { @@ -122,14 +120,14 @@ int main(int argc, char** argv) { // Workaround, need to "hide" and unhide the statusbar to properly remove it, // since the Springboard has put it back without apparently flagging our application. - [self setStatusBarHidden:YES animated:YES]; - [self setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO]; - [self setStatusBarHidden:YES animated:YES]; + [self setStatusBarHidden:YES animated:YES]; + [self setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO]; + [self setStatusBarHidden:YES animated:YES]; } - (void)didRotate:(NSNotification *)notification { - int screenOrientation = [[UIDevice currentDevice] orientation]; - [_view deviceOrientationChanged: screenOrientation]; + UIDeviceOrientation screenOrientation = [[UIDevice currentDevice] orientation]; + [_view deviceOrientationChanged:screenOrientation]; } - (UIWindow*) getWindow { diff --git a/backends/platform/iphone/iphone_video.h b/backends/platform/iphone/iphone_video.h index 223f025978..f2253f3e21 100644 --- a/backends/platform/iphone/iphone_video.h +++ b/backends/platform/iphone/iphone_video.h @@ -20,8 +20,8 @@ * */ -#ifndef _IPHONE_VIDEO__H -#define _IPHONE_VIDEO__H +#ifndef BACKENDS_PLATFORM_IPHONE_IPHONE_VIDEO_H +#define BACKENDS_PLATFORM_IPHONE_IPHONE_VIDEO_H #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> @@ -31,28 +31,27 @@ #import <OpenGLES/ES1/gl.h> #import <OpenGLES/ES1/glext.h> -#import "iphone_keyboard.h" +#include "iphone_keyboard.h" -@interface iPhoneView : UIView -{ - void* _screenSurface; - NSMutableArray* _events; - SoftKeyboard* _keyboardView; - CALayer* _screenLayer; +@interface iPhoneView : UIView { + void *_screenSurface; + NSMutableArray *_events; + SoftKeyboard *_keyboardView; - int _widthOffset; - int _heightOffset; - - EAGLContext* _context; + EAGLContext *_context; GLuint _viewRenderbuffer; GLuint _viewFramebuffer; - GLint _backingWidth; - GLint _backingHeight; - GLint _visibleWidth; - GLint _visibleHeight; GLuint _screenTexture; GLuint _overlayTexture; GLuint _mouseCursorTexture; + + UIDeviceOrientation _orientation; + + GLfloat _gameScreenVertCoords[4 * 2]; + GLfloat _gameScreenTexCoords[4 * 2]; + + GLfloat _overlayVertCoords[4 * 2]; + GLfloat _overlayTexCoords[4 * 2]; } - (id)initWithFrame:(struct CGRect)frame; @@ -63,17 +62,19 @@ - (void)initSurface; +- (void)setGraphicsMode; + - (void)updateSurface; - (void)updateMainSurface; - (void)updateOverlaySurface; - (void)updateMouseSurface; - (void)clearColorBuffer; --(void)updateMouseCursor; +- (void)updateMouseCursor; - (id)getEvent; -- (void)deviceOrientationChanged:(int)orientation; +- (void)deviceOrientationChanged:(UIDeviceOrientation)orientation; - (void)applicationSuspend; @@ -81,6 +82,4 @@ @end - - -#endif /* _IPHONE_VIDEO__H */ +#endif diff --git a/backends/platform/iphone/iphone_video.m b/backends/platform/iphone/iphone_video.m index eb16676428..5cd9534611 100644 --- a/backends/platform/iphone/iphone_video.m +++ b/backends/platform/iphone/iphone_video.m @@ -24,62 +24,81 @@ #include "iphone_common.h" static iPhoneView *sharedInstance = nil; +static GraphicsModes _graphicsMode = kGraphicsModeLinear; static int _width = 0; static int _height = 0; static int _fullWidth; static int _fullHeight; -static CGRect _screenRect; +static CGRect _gameScreenRect; -static char* _textureBuffer = 0; -static int _textureWidth = 0; -static int _textureHeight = 0; +static char *_gameScreenTextureBuffer = 0; +static int _gameScreenTextureWidth = 0; +static int _gameScreenTextureHeight = 0; -static char* _overlayTexBuffer = 0; +static char *_overlayTexBuffer = 0; static int _overlayTexWidth = 0; static int _overlayTexHeight = 0; static int _overlayWidth = 0; static int _overlayHeight = 0; -static float _overlayPortraitRatio = 1.0f; +static CGRect _overlayRect; -NSLock* _lock = nil; static int _needsScreenUpdate = 0; static int _overlayIsEnabled = 0; -static UITouch* _firstTouch = NULL; -static UITouch* _secondTouch = NULL; +static UITouch *_firstTouch = NULL; +static UITouch *_secondTouch = NULL; -static short* _mouseCursor = NULL; +static unsigned short *_mouseCursor = NULL; static int _mouseCursorHeight = 0; static int _mouseCursorWidth = 0; +static int _mouseCursorHotspotX = 0; +static int _mouseCursorHotspotY = 0; static int _mouseX = 0; static int _mouseY = 0; +static int _mouseCursorEnabled = 0; -// static long lastTick = 0; -// static int frames = 0; +static GLint _renderBufferWidth; +static GLint _renderBufferHeight; + +#if 0 +static long lastTick = 0; +static int frames = 0; +#endif #define printOpenGLError() printOglError(__FILE__, __LINE__) -int printOglError(const char *file, int line) -{ - int retCode = 0; +int printOglError(const char *file, int line) { + int retCode = 0; // returns 1 if an OpenGL error occurred, 0 otherwise. GLenum glErr = glGetError(); - while( glErr != GL_NO_ERROR) - { - fprintf(stderr, "glError: %u (%s: %d)\n", glErr, file, line ); + while (glErr != GL_NO_ERROR) { + fprintf(stderr, "glError: %u (%s: %d)\n", glErr, file, line); retCode = 1; glErr = glGetError(); } return retCode; } -void iPhone_setMouseCursor(short* buffer, int width, int height) { +void iPhone_setGraphicsMode(int mode) { + _graphicsMode = mode; + + [sharedInstance performSelectorOnMainThread:@selector(setGraphicsMode) withObject:nil waitUntilDone: YES]; +} + +void iPhone_showCursor(int state) { + _mouseCursorEnabled = state; +} + +void iPhone_setMouseCursor(unsigned short *buffer, int width, int height, int hotspotX, int hotspotY) { _mouseCursor = buffer; _mouseCursorWidth = width; _mouseCursorHeight = height; + _mouseCursorHotspotX = hotspotX; + _mouseCursorHotspotY = hotspotY; + [sharedInstance performSelectorOnMainThread:@selector(updateMouseCursor) withObject:nil waitUntilDone: YES]; } @@ -104,14 +123,8 @@ bool iPhone_isHighResDevice() { void iPhone_updateScreen(int mouseX, int mouseY) { //printf("Mouse: (%i, %i)\n", mouseX, mouseY); - //_mouseX = _overlayHeight - (float)mouseX / _width * _overlayHeight; - //_mouseY = (float)mouseY / _height * _overlayWidth; - - //_mouseX = _overlayHeight - mouseX; - //_mouseY = mouseY; - - _mouseX = (_overlayWidth - mouseX) / (float)_overlayWidth * _overlayHeight; - _mouseY = mouseY / (float)_overlayHeight * _overlayWidth; + _mouseX = mouseX; + _mouseY = mouseY; if (!_needsScreenUpdate) { _needsScreenUpdate = 1; @@ -119,17 +132,17 @@ void iPhone_updateScreen(int mouseX, int mouseY) { } } -void iPhone_updateScreenRect(unsigned short* screen, int x1, int y1, int x2, int y2) { +void iPhone_updateScreenRect(unsigned short *screen, int x1, int y1, int x2, int y2) { int y; for (y = y1; y < y2; ++y) - memcpy(&_textureBuffer[(y * _textureWidth + x1 )* 2], &screen[y * _width + x1], (x2 - x1) * 2); + memcpy(&_gameScreenTextureBuffer[(y * _gameScreenTextureWidth + x1) * 2], &screen[y * _width + x1], (x2 - x1) * 2); } -void iPhone_updateOverlayRect(unsigned short* screen, int x1, int y1, int x2, int y2) { +void iPhone_updateOverlayRect(unsigned short *screen, int x1, int y1, int x2, int y2) { int y; //printf("Overlaywidth: %u, fullwidth %u\n", _overlayWidth, _fullWidth); for (y = y1; y < y2; ++y) - memcpy(&_overlayTexBuffer[(y * _overlayTexWidth + x1 )* 2], &screen[y * _overlayWidth + x1], (x2 - x1) * 2); + memcpy(&_overlayTexBuffer[(y * _overlayTexWidth + x1) * 2], &screen[y * _overlayWidth + x1], (x2 - x1) * 2); } void iPhone_initSurface(int width, int height) { @@ -138,7 +151,7 @@ void iPhone_initSurface(int width, int height) { [sharedInstance performSelectorOnMainThread:@selector(initSurface) withObject:nil waitUntilDone: YES]; } -bool iPhone_fetchEvent(int *outEvent, float *outX, float *outY) { +bool iPhone_fetchEvent(int *outEvent, int *outX, int *outY) { id event = [sharedInstance getEvent]; if (event == nil) { return false; @@ -152,92 +165,234 @@ bool iPhone_fetchEvent(int *outEvent, float *outX, float *outY) { } *outEvent = [type intValue]; - *outX = [[event objectForKey:@"x"] floatValue]; - *outY = [[event objectForKey:@"y"] floatValue]; + *outX = [[event objectForKey:@"x"] intValue]; + *outY = [[event objectForKey:@"y"] intValue]; return true; } uint getSizeNextPOT(uint size) { - if ((size & (size - 1)) || !size) { - int log = 0; + if ((size & (size - 1)) || !size) { + int log = 0; - while (size >>= 1) - ++log; + while (size >>= 1) + ++log; - size = (2 << log); - } + size = (2 << log); + } - return size; + return size; } -const char* iPhone_getDocumentsDir() { +const char *iPhone_getDocumentsDir() { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; return [documentsDirectory UTF8String]; } -bool getLocalMouseCoords(CGPoint *point) { +/** + * Converts portrait mode coordinates into rotated mode coordinates. + */ +static bool convertToRotatedCoords(UIDeviceOrientation orientation, CGPoint point, CGPoint *result) { + switch (orientation) { + case UIDeviceOrientationLandscapeLeft: + result->x = point.y; + result->y = _renderBufferWidth - point.x; + return true; + + case UIDeviceOrientationLandscapeRight: + result->x = _renderBufferHeight - point.y; + result->y = point.x; + return true; + + case UIDeviceOrientationPortrait: + result->x = point.x; + result->y = point.y; + return true; + + default: + return false; + } +} + +static bool normalizeMouseCoords(CGPoint *point, CGRect area) { + if (point->x < CGRectGetMinX(area) || point->x > CGRectGetMaxX(area) || + point->y < CGRectGetMinY(area) || point->y > CGRectGetMaxY(area)) { + return false; + } + + point->x = (point->x - CGRectGetMinX(area)) / CGRectGetWidth(area); + point->y = (point->y - CGRectGetMinY(area)) / CGRectGetHeight(area); + return true; +} + +static bool getMouseCoords(UIDeviceOrientation orientation, CGPoint point, int *x, int *y) { + if (!convertToRotatedCoords(orientation, point, &point)) + return false; + + int width, height; if (_overlayIsEnabled) { - point->x = point->x / _overlayHeight; - point->y = point->y / _overlayWidth; + if (!normalizeMouseCoords(&point, _overlayRect)) + return false; + + width = _overlayWidth; + height = _overlayHeight; } else { - if (point->x < _screenRect.origin.x || point->x >= _screenRect.origin.x + _screenRect.size.width || - point->y < _screenRect.origin.y || point->y >= _screenRect.origin.y + _screenRect.size.height) { - return false; - } + if (!normalizeMouseCoords(&point, _gameScreenRect)) + return false; - point->x = (point->x - _screenRect.origin.x) / _screenRect.size.width; - point->y = (point->y - _screenRect.origin.y) / _screenRect.size.height; + width = _width; + height = _height; } + *x = point.x * width; + *y = point.y * height; + return true; } +static void setFilterModeForTexture(GLuint tex, GraphicsModes mode) { + if (!tex) + return; + + glBindTexture(GL_TEXTURE_2D, tex); printOpenGLError(); + + GLint filter = GL_LINEAR; + + switch (mode) { + case kGraphicsModeLinear: + filter = GL_LINEAR; + break; + + case kGraphicsModeNone: + filter = GL_NEAREST; + break; + } + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); printOpenGLError(); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); printOpenGLError(); +} @implementation iPhoneView -+ (Class) layerClass -{ ++ (Class)layerClass { return [CAEAGLLayer class]; } +- (void)createContext { + CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer; + + eaglLayer.opaque = YES; + eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGB565, kEAGLDrawablePropertyColorFormat, nil]; + + _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; + + // In case creating the OpenGL ES context failed, we will error out here. + if (_context == nil) { + fprintf(stderr, "Could not create OpenGL ES context\n"); + exit(-1); + } + + if ([EAGLContext setCurrentContext:_context]) { + glGenFramebuffersOES(1, &_viewFramebuffer); printOpenGLError(); + glGenRenderbuffersOES(1, &_viewRenderbuffer); printOpenGLError(); + + glBindFramebufferOES(GL_FRAMEBUFFER_OES, _viewFramebuffer); printOpenGLError(); + glBindRenderbufferOES(GL_RENDERBUFFER_OES, _viewRenderbuffer); printOpenGLError(); + [_context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(id<EAGLDrawable>)self.layer]; + + glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, _viewRenderbuffer); printOpenGLError(); + + // Retrieve the render buffer size. This *should* match the frame size, + // i.e. _fullWidth and _fullHeight. + glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &_renderBufferWidth); printOpenGLError(); + glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &_renderBufferHeight); printOpenGLError(); + + if (glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) { + NSLog(@"Failed to make complete framebuffer object %x.", glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES)); + return; + } + + _overlayHeight = _renderBufferWidth; + _overlayWidth = _renderBufferHeight; + _overlayTexWidth = getSizeNextPOT(_overlayHeight); + _overlayTexHeight = getSizeNextPOT(_overlayWidth); + + // Since the overlay size won't change the whole run, we can + // precalculate the texture coordinates for the overlay texture here + // and just use it later on. + _overlayTexCoords[2] = _overlayTexCoords[6] = _overlayWidth / (GLfloat)_overlayTexWidth; + _overlayTexCoords[5] = _overlayTexCoords[7] = _overlayHeight / (GLfloat)_overlayTexHeight; + + int textureSize = _overlayTexWidth * _overlayTexHeight * 2; + _overlayTexBuffer = (char *)malloc(textureSize); + memset(_overlayTexBuffer, 0, textureSize); + + glViewport(0, 0, _renderBufferWidth, _renderBufferHeight); printOpenGLError(); + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); printOpenGLError(); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glEnable(GL_TEXTURE_2D); printOpenGLError(); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); printOpenGLError(); + glEnableClientState(GL_VERTEX_ARRAY); printOpenGLError(); + } +} + - (id)initWithFrame:(struct CGRect)frame { self = [super initWithFrame: frame]; - if([[UIScreen mainScreen] respondsToSelector: NSSelectorFromString(@"scale")]) - { - if([self respondsToSelector: NSSelectorFromString(@"contentScaleFactor")]) - { + if ([[UIScreen mainScreen] respondsToSelector: NSSelectorFromString(@"scale")]) { + if ([self respondsToSelector: NSSelectorFromString(@"contentScaleFactor")]) { //self.contentScaleFactor = [[UIScreen mainScreen] scale]; } } _fullWidth = frame.size.width; _fullHeight = frame.size.height; - _screenLayer = nil; sharedInstance = self; - _lock = [NSLock new]; _keyboardView = nil; - _context = nil; _screenTexture = 0; _overlayTexture = 0; _mouseCursorTexture = 0; + _gameScreenVertCoords[0] = _gameScreenVertCoords[1] = + _gameScreenVertCoords[2] = _gameScreenVertCoords[3] = + _gameScreenVertCoords[4] = _gameScreenVertCoords[5] = + _gameScreenVertCoords[6] = _gameScreenVertCoords[7] = 0; + + _gameScreenTexCoords[0] = _gameScreenTexCoords[1] = + _gameScreenTexCoords[2] = _gameScreenTexCoords[3] = + _gameScreenTexCoords[4] = _gameScreenTexCoords[5] = + _gameScreenTexCoords[6] = _gameScreenTexCoords[7] = 0; + + _overlayVertCoords[0] = _overlayVertCoords[1] = + _overlayVertCoords[2] = _overlayVertCoords[3] = + _overlayVertCoords[4] = _overlayVertCoords[5] = + _overlayVertCoords[6] = _overlayVertCoords[7] = 0; + + _overlayTexCoords[0] = _overlayTexCoords[1] = + _overlayTexCoords[2] = _overlayTexCoords[3] = + _overlayTexCoords[4] = _overlayTexCoords[5] = + _overlayTexCoords[6] = _overlayTexCoords[7] = 0; + + // Initialize the OpenGL ES context + [self createContext]; + return self; } --(void) dealloc { +- (void)dealloc { [super dealloc]; if (_keyboardView != nil) { [_keyboardView dealloc]; } - if (_screenTexture) - free(_textureBuffer); - + free(_gameScreenTextureBuffer); free(_overlayTexBuffer); } @@ -246,16 +401,24 @@ bool getLocalMouseCoords(CGPoint *point) { } - (void)drawRect:(CGRect)frame { - // if (lastTick == 0) { - // lastTick = time(0); - // } - // - // frames++; - // if (time(0) > lastTick) { - // lastTick = time(0); - // printf("FPS: %i\n", frames); - // frames = 0; - // } +#if 0 + if (lastTick == 0) { + lastTick = time(0); + } + + frames++; + if (time(0) > lastTick) { + lastTick = time(0); + printf("FPS: %i\n", frames); + frames = 0; + } +#endif +} + +- (void)setGraphicsMode { + setFilterModeForTexture(_screenTexture, _graphicsMode); + setFilterModeForTexture(_overlayTexture, _graphicsMode); + setFilterModeForTexture(_mouseCursorTexture, _graphicsMode); } - (void)updateSurface { @@ -264,28 +427,25 @@ bool getLocalMouseCoords(CGPoint *point) { } _needsScreenUpdate = 0; - if (_overlayIsEnabled) { - glClear(GL_COLOR_BUFFER_BIT); printOpenGLError(); - } + glClear(GL_COLOR_BUFFER_BIT); printOpenGLError(); [self updateMainSurface]; - if (_overlayIsEnabled) { + if (_overlayIsEnabled) [self updateOverlaySurface]; + + if (_mouseCursorEnabled) [self updateMouseSurface]; - } glBindRenderbufferOES(GL_RENDERBUFFER_OES, _viewRenderbuffer); printOpenGLError(); [_context presentRenderbuffer:GL_RENDERBUFFER_OES]; } --(void)updateMouseCursor { +- (void)updateMouseCursor { if (_mouseCursorTexture == 0) { glGenTextures(1, &_mouseCursorTexture); printOpenGLError(); - glBindTexture(GL_TEXTURE_2D, _mouseCursorTexture); printOpenGLError(); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); printOpenGLError(); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); printOpenGLError(); + setFilterModeForTexture(_mouseCursorTexture, _graphicsMode); } glBindTexture(GL_TEXTURE_2D, _mouseCursorTexture); printOpenGLError(); @@ -296,73 +456,75 @@ bool getLocalMouseCoords(CGPoint *point) { } - (void)updateMainSurface { - GLfloat vertices[] = { - 0.0f + _heightOffset, 0.0f + _widthOffset, - _visibleWidth - _heightOffset, 0.0f + _widthOffset, - 0.0f + _heightOffset, _visibleHeight - _widthOffset, - _visibleWidth - _heightOffset, _visibleHeight - _widthOffset - }; - - float texWidth = _width / (float)_textureWidth; - float texHeight = _height / (float)_textureHeight; - - const GLfloat texCoords[] = { - texWidth, 0.0f, - 0.0f, 0.0f, - texWidth, texHeight, - 0.0f, texHeight - }; - - glVertexPointer(2, GL_FLOAT, 0, vertices); printOpenGLError(); - glTexCoordPointer(2, GL_FLOAT, 0, texCoords); printOpenGLError(); + glVertexPointer(2, GL_FLOAT, 0, _gameScreenVertCoords); printOpenGLError(); + glTexCoordPointer(2, GL_FLOAT, 0, _gameScreenTexCoords); printOpenGLError(); glBindTexture(GL_TEXTURE_2D, _screenTexture); printOpenGLError(); // Unfortunately we have to update the whole texture every frame, since glTexSubImage2D is actually slower in all cases // due to the iPhone internals having to convert the whole texture back from its internal format when used. // In the future we could use several tiled textures instead. - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, _textureWidth, _textureHeight, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, _textureBuffer); printOpenGLError(); - glDisable(GL_BLEND); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, _gameScreenTextureWidth, _gameScreenTextureHeight, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, _gameScreenTextureBuffer); printOpenGLError(); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); printOpenGLError(); } - (void)updateOverlaySurface { - GLfloat vertices[] = { - 0.0f, 0.0f, - _overlayHeight, 0.0f, - 0.0f, _overlayWidth * _overlayPortraitRatio, - _overlayHeight, _overlayWidth * _overlayPortraitRatio - }; - - float texWidth = _overlayWidth / (float)_overlayTexWidth; - float texHeight = _overlayHeight / (float)_overlayTexHeight; - - const GLfloat texCoords[] = { - texWidth, 0.0f, - 0.0f, 0.0f, - texWidth, texHeight, - 0.0f, texHeight - }; - - glVertexPointer(2, GL_FLOAT, 0, vertices); printOpenGLError(); - glTexCoordPointer(2, GL_FLOAT, 0, texCoords); printOpenGLError(); + glVertexPointer(2, GL_FLOAT, 0, _overlayVertCoords); printOpenGLError(); + glTexCoordPointer(2, GL_FLOAT, 0, _overlayTexCoords); printOpenGLError(); glBindTexture(GL_TEXTURE_2D, _overlayTexture); printOpenGLError(); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _overlayTexWidth, _overlayTexHeight, 0, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, _overlayTexBuffer); printOpenGLError(); - glEnable(GL_BLEND); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); printOpenGLError(); } - (void)updateMouseSurface { + int width = _mouseCursorWidth; + int height = _mouseCursorHeight; - int width = _mouseCursorWidth / (float)_backingWidth * _backingHeight; - int height = _mouseCursorHeight / (float)_backingHeight * _backingWidth; + int mouseX = _mouseX; + int mouseY = _mouseY; + + int hotspotX = _mouseCursorHotspotX; + int hotspotY = _mouseCursorHotspotY; + + CGRect *rect; + int maxWidth, maxHeight; + + if (!_overlayIsEnabled) { + rect = &_gameScreenRect; + maxWidth = _width; + maxHeight = _height; + } else { + rect = &_overlayRect; + maxWidth = _overlayWidth; + maxHeight = _overlayHeight; + } + + const GLfloat scaleX = CGRectGetWidth(*rect) / (GLfloat)maxWidth; + const GLfloat scaleY = CGRectGetHeight(*rect) / (GLfloat)maxHeight; + + mouseX = mouseX * scaleX; + mouseY = mouseY * scaleY; + hotspotX = hotspotX * scaleX; + hotspotY = hotspotY * scaleY; + width = width * scaleX; + height = height * scaleY; + + mouseX -= hotspotX; + mouseY -= hotspotY; + + mouseX += CGRectGetMinX(*rect); + mouseY += CGRectGetMinY(*rect); GLfloat vertices[] = { - _mouseX, _mouseY, - _mouseX + height, _mouseY, - _mouseX, _mouseY + width, - _mouseX + height, _mouseY + width + // Top left + mouseX , mouseY, + // Top right + mouseX + width, mouseY, + // Bottom left + mouseX , mouseY + height, + // Bottom right + mouseX + width, mouseY + height }; //printf("Cursor: width %u height %u\n", _mouseCursorWidth, _mouseCursorHeight); @@ -371,112 +533,87 @@ bool getLocalMouseCoords(CGPoint *point) { float texHeight = _mouseCursorHeight / (float)getSizeNextPOT(_mouseCursorHeight); const GLfloat texCoords[] = { - texWidth, 0.0f, - 0.0f, 0.0f, - texWidth, texHeight, - 0.0f, texHeight + // Top left + 0 , 0, + // Top right + texWidth, 0, + // Bottom left + 0 , texHeight, + // Bottom right + texWidth, texHeight }; glVertexPointer(2, GL_FLOAT, 0, vertices); printOpenGLError(); glTexCoordPointer(2, GL_FLOAT, 0, texCoords); printOpenGLError(); glBindTexture(GL_TEXTURE_2D, _mouseCursorTexture); printOpenGLError(); - glEnable(GL_BLEND); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); printOpenGLError(); } - (void)initSurface { - _textureWidth = getSizeNextPOT(_width); - _textureHeight = getSizeNextPOT(_height); - - UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; + _gameScreenTextureWidth = getSizeNextPOT(_width); + _gameScreenTextureHeight = getSizeNextPOT(_height); - //printf("Window: (%d, %d), Surface: (%d, %d), Texture(%d, %d)\n", _fullWidth, _fullHeight, _width, _height, _textureWidth, _textureHeight); + _gameScreenTexCoords[2] = _gameScreenTexCoords[6] = _width / (GLfloat)_gameScreenTextureWidth; + _gameScreenTexCoords[5] = _gameScreenTexCoords[7] = _height / (GLfloat)_gameScreenTextureHeight; - if (_context == nil) { - orientation = UIDeviceOrientationLandscapeRight; - CAEAGLLayer *eaglLayer = (CAEAGLLayer*) self.layer; - - eaglLayer.opaque = YES; - eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGB565, kEAGLDrawablePropertyColorFormat, nil]; - - _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; - if (!_context || [EAGLContext setCurrentContext:_context]) { - glGenFramebuffersOES(1, &_viewFramebuffer); printOpenGLError(); - glGenRenderbuffersOES(1, &_viewRenderbuffer); printOpenGLError(); + _orientation = [[UIDevice currentDevice] orientation]; - glBindFramebufferOES(GL_FRAMEBUFFER_OES, _viewFramebuffer); printOpenGLError(); - glBindRenderbufferOES(GL_RENDERBUFFER_OES, _viewRenderbuffer); printOpenGLError(); - [_context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(id<EAGLDrawable>)self.layer]; - glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, _viewRenderbuffer); printOpenGLError(); + switch (_orientation) { + case UIDeviceOrientationLandscapeLeft: + case UIDeviceOrientationLandscapeRight: + case UIDeviceOrientationPortrait: + break; - glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &_backingWidth); printOpenGLError(); - glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &_backingHeight); printOpenGLError(); - - if (glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) { - NSLog(@"Failed to make complete framebuffer object %x.", glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES)); - return; - } + default: + _orientation = UIDeviceOrientationPortrait; + } - _overlayHeight = _backingWidth; - _overlayWidth = _backingHeight; - _overlayTexWidth = getSizeNextPOT(_overlayHeight); - _overlayTexHeight = getSizeNextPOT(_overlayWidth); + //printf("Window: (%d, %d), Surface: (%d, %d), Texture(%d, %d)\n", _fullWidth, _fullHeight, _width, _height, _gameScreenTextureWidth, _gameScreenTextureHeight); - int textureSize = _overlayTexWidth * _overlayTexHeight * 2; - _overlayTexBuffer = (char *)malloc(textureSize); - memset(_overlayTexBuffer, 0, textureSize); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); - glViewport(0, 0, _backingWidth, _backingHeight); printOpenGLError(); - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); printOpenGLError(); + int screenWidth, screenHeight; - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + // Set the origin (0,0) depending on the rotation mode. + if (_orientation == UIDeviceOrientationLandscapeRight) { + glRotatef( 90, 0, 0, 1); printOpenGLError(); + glOrthof(0, _renderBufferHeight, _renderBufferWidth, 0, 0, 1); printOpenGLError(); - glEnable(GL_TEXTURE_2D); printOpenGLError(); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); printOpenGLError(); - glEnableClientState(GL_VERTEX_ARRAY); printOpenGLError(); - } - } + screenWidth = _renderBufferHeight; + screenHeight = _renderBufferWidth; + } else if (_orientation == UIDeviceOrientationLandscapeLeft) { + glRotatef(-90, 0, 0, 1); printOpenGLError(); + glOrthof(0, _renderBufferHeight, _renderBufferWidth, 0, 0, 1); printOpenGLError(); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); + screenWidth = _renderBufferHeight; + screenHeight = _renderBufferWidth; + } else if (_orientation == UIDeviceOrientationPortrait) { + glOrthof(0, _renderBufferWidth, _renderBufferHeight, 0, 0, 1); printOpenGLError(); - if (orientation == UIDeviceOrientationLandscapeRight) { - glRotatef(-90, 0, 0, 1); printOpenGLError(); - } else if (orientation == UIDeviceOrientationLandscapeLeft) { - glRotatef(90, 0, 0, 1); printOpenGLError(); - } else { - glRotatef(180, 0, 0, 1); printOpenGLError(); + screenWidth = _renderBufferWidth; + screenHeight = _renderBufferHeight; } - glOrthof(0, _backingWidth, 0, _backingHeight, 0, 1); printOpenGLError(); - if (_screenTexture > 0) { glDeleteTextures(1, &_screenTexture); printOpenGLError(); } glGenTextures(1, &_screenTexture); printOpenGLError(); - glBindTexture(GL_TEXTURE_2D, _screenTexture); printOpenGLError(); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); printOpenGLError(); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); printOpenGLError(); + setFilterModeForTexture(_screenTexture, _graphicsMode); if (_overlayTexture > 0) { glDeleteTextures(1, &_overlayTexture); printOpenGLError(); } glGenTextures(1, &_overlayTexture); printOpenGLError(); - glBindTexture(GL_TEXTURE_2D, _overlayTexture); printOpenGLError(); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); printOpenGLError(); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); printOpenGLError(); - - if (_textureBuffer) { - free(_textureBuffer); - } + setFilterModeForTexture(_overlayTexture, _graphicsMode); - int textureSize = _textureWidth * _textureHeight * 2; - _textureBuffer = (char*)malloc(textureSize); - memset(_textureBuffer, 0, textureSize); + free(_gameScreenTextureBuffer); + int textureSize = _gameScreenTextureWidth * _gameScreenTextureHeight * 2; + _gameScreenTextureBuffer = (char *)malloc(textureSize); + memset(_gameScreenTextureBuffer, 0, textureSize); glBindRenderbufferOES(GL_RENDERBUFFER_OES, _viewRenderbuffer); printOpenGLError(); @@ -487,37 +624,42 @@ bool getLocalMouseCoords(CGPoint *point) { [[_keyboardView inputView] removeFromSuperview]; } - if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight) { - _visibleHeight = _backingHeight; - _visibleWidth = _backingWidth; + float overlayPortraitRatio; - float ratioDifference = ((float)_height / (float)_width) / ((float)_fullWidth / (float)_fullHeight); + if (_orientation == UIDeviceOrientationLandscapeLeft || _orientation == UIDeviceOrientationLandscapeRight) { + GLfloat gameScreenRatio = (GLfloat)_width / (GLfloat)_height; + GLfloat screenRatio = (GLfloat)screenWidth / (GLfloat)screenHeight; + + // These are the width/height according to the portrait layout! int rectWidth, rectHeight; - if (ratioDifference < 1.0f) { - rectWidth = _fullWidth * ratioDifference; - rectHeight = _fullHeight; - _widthOffset = (_fullWidth - rectWidth) / 2; - _heightOffset = 0; + int xOffset, yOffset; + + if (gameScreenRatio < screenRatio) { + // When the game screen ratio is less than the screen ratio + // we need to scale the width, since the game screen was higher + // compared to the width than our output screen is. + rectWidth = screenHeight * gameScreenRatio; + rectHeight = screenHeight; + xOffset = (screenWidth - rectWidth) / 2; + yOffset = 0; } else { - rectWidth = _fullWidth; - rectHeight = _fullHeight / ratioDifference; - _heightOffset = (_fullHeight - rectHeight) / 2; - _widthOffset = 0; + // When the game screen ratio is bigger than the screen ratio + // we need to scale the height, since the game screen was wider + // compared to the height than our output screen is. + rectWidth = screenWidth; + rectHeight = screenWidth / gameScreenRatio; + xOffset = 0; + yOffset = (screenHeight - rectHeight) / 2; } - //printf("Rect: %i, %i, %i, %i\n", _widthOffset, _heightOffset, rectWidth, rectHeight); - _screenRect = CGRectMake(_widthOffset, _heightOffset, rectWidth, rectHeight); - _overlayPortraitRatio = 1.0f; + //printf("Rect: %i, %i, %i, %i\n", xOffset, yOffset, rectWidth, rectHeight); + _gameScreenRect = CGRectMake(xOffset, yOffset, rectWidth, rectHeight); + overlayPortraitRatio = 1.0f; } else { float ratio = (float)_height / (float)_width; - int height = _fullWidth * ratio; - //printf("Making rect (%u, %u)\n", _fullWidth, height); - _screenRect = CGRectMake(0, 0, _fullWidth - 1, height - 1); - - _visibleHeight = height; - _visibleWidth = _backingWidth; - _heightOffset = 0.0f; - _widthOffset = 0.0f; + int height = screenWidth * ratio; + //printf("Making rect (%u, %u)\n", screenWidth, height); + _gameScreenRect = CGRectMake(0, 0, screenWidth, height); CGRect keyFrame = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); if (_keyboardView == nil) { @@ -528,8 +670,18 @@ bool getLocalMouseCoords(CGPoint *point) { [self addSubview:[_keyboardView inputView]]; [self addSubview: _keyboardView]; [[_keyboardView inputView] becomeFirstResponder]; - _overlayPortraitRatio = (_overlayHeight * ratio) / _overlayWidth; + overlayPortraitRatio = (_overlayHeight * ratio) / _overlayWidth; } + + _overlayRect = CGRectMake(0, 0, screenWidth, screenHeight * overlayPortraitRatio); + + _gameScreenVertCoords[0] = _gameScreenVertCoords[4] = CGRectGetMinX(_gameScreenRect); + _gameScreenVertCoords[1] = _gameScreenVertCoords[3] = CGRectGetMinY(_gameScreenRect); + _gameScreenVertCoords[2] = _gameScreenVertCoords[6] = CGRectGetMaxX(_gameScreenRect); + _gameScreenVertCoords[5] = _gameScreenVertCoords[7] = CGRectGetMaxY(_gameScreenRect); + + _overlayVertCoords[2] = _overlayVertCoords[6] = CGRectGetMaxX(_overlayRect); + _overlayVertCoords[5] = _overlayVertCoords[7] = CGRectGetMaxY(_overlayRect); } - (void)clearColorBuffer { @@ -546,7 +698,6 @@ bool getLocalMouseCoords(CGPoint *point) { return nil; } - id event = [_events objectAtIndex: 0]; [_events removeObjectAtIndex: 0]; @@ -554,161 +705,163 @@ bool getLocalMouseCoords(CGPoint *point) { return event; } -- (void)addEvent:(NSDictionary*)event { - +- (void)addEvent:(NSDictionary *)event { if (_events == nil) _events = [[NSMutableArray alloc] init]; [_events addObject: event]; } -- (void)deviceOrientationChanged:(int)orientation { +- (void)deviceOrientationChanged:(UIDeviceOrientation)orientation { + switch (orientation) { + case UIDeviceOrientationLandscapeLeft: + case UIDeviceOrientationLandscapeRight: + case UIDeviceOrientationPortrait: + _orientation = orientation; + break; + + default: + return; + } + [self addEvent: [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:kInputOrientationChanged], @"type", - [NSNumber numberWithFloat:(float)orientation], @"x", - [NSNumber numberWithFloat:0], @"y", + [NSNumber numberWithInt:orientation], @"x", + [NSNumber numberWithInt:0], @"y", nil ] ]; } -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -{ +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSSet *allTouches = [event allTouches]; + int x, y; switch ([allTouches count]) { - case 1: - { - UITouch *touch = [touches anyObject]; - CGPoint point = [touch locationInView:self]; - if (!getLocalMouseCoords(&point)) - return; - - _firstTouch = touch; - [self addEvent: - [[NSDictionary alloc] initWithObjectsAndKeys: - [NSNumber numberWithInt:kInputMouseDown], @"type", - [NSNumber numberWithFloat:point.x], @"x", - [NSNumber numberWithFloat:point.y], @"y", - nil - ] - ]; - break; + case 1: { + UITouch *touch = [touches anyObject]; + CGPoint point = [touch locationInView:self]; + if (!getMouseCoords(_orientation, point, &x, &y)) + return; + + _firstTouch = touch; + [self addEvent: + [[NSDictionary alloc] initWithObjectsAndKeys: + [NSNumber numberWithInt:kInputMouseDown], @"type", + [NSNumber numberWithInt:x], @"x", + [NSNumber numberWithInt:y], @"y", + nil + ] + ]; + break; } - case 2: - { - UITouch *touch = [touches anyObject]; - CGPoint point = [touch locationInView:self]; - if (!getLocalMouseCoords(&point)) - return; - _secondTouch = touch; - [self addEvent: - [[NSDictionary alloc] initWithObjectsAndKeys: - [NSNumber numberWithInt:kInputMouseSecondDown], @"type", - [NSNumber numberWithFloat:point.x], @"x", - [NSNumber numberWithFloat:point.y], @"y", - nil - ] - ]; - break; + case 2: { + UITouch *touch = [touches anyObject]; + CGPoint point = [touch locationInView:self]; + if (!getMouseCoords(_orientation, point, &x, &y)) + return; + + _secondTouch = touch; + [self addEvent: + [[NSDictionary alloc] initWithObjectsAndKeys: + [NSNumber numberWithInt:kInputMouseSecondDown], @"type", + [NSNumber numberWithInt:x], @"x", + [NSNumber numberWithInt:y], @"y", + nil + ] + ]; + break; } } } -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event -{ +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { //NSSet *allTouches = [event allTouches]; + int x, y; - for (UITouch* touch in touches) { + for (UITouch *touch in touches) { if (touch == _firstTouch) { - CGPoint point = [touch locationInView:self]; - if (!getLocalMouseCoords(&point)) + if (!getMouseCoords(_orientation, point, &x, &y)) return; [self addEvent: [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:kInputMouseDragged], @"type", - [NSNumber numberWithFloat:point.x], @"x", - [NSNumber numberWithFloat:point.y], @"y", + [NSNumber numberWithInt:x], @"x", + [NSNumber numberWithInt:y], @"y", nil ] ]; - } else if (touch == _secondTouch) { - CGPoint point = [touch locationInView:self]; - if (!getLocalMouseCoords(&point)) + if (!getMouseCoords(_orientation, point, &x, &y)) return; [self addEvent: [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:kInputMouseSecondDragged], @"type", - [NSNumber numberWithFloat:point.x], @"x", - [NSNumber numberWithFloat:point.y], @"y", + [NSNumber numberWithInt:x], @"x", + [NSNumber numberWithInt:y], @"y", nil ] ]; - } } } -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event -{ +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { NSSet *allTouches = [event allTouches]; + int x, y; switch ([allTouches count]) { - case 1: - { - UITouch *touch = [[allTouches allObjects] objectAtIndex:0]; - CGPoint point = [touch locationInView:self]; - if (!getLocalMouseCoords(&point)) - return; - - [self addEvent: - [[NSDictionary alloc] initWithObjectsAndKeys: - [NSNumber numberWithInt:kInputMouseUp], @"type", - [NSNumber numberWithFloat:point.x], @"x", - [NSNumber numberWithFloat:point.y], @"y", - nil - ] - ]; - break; + case 1: { + UITouch *touch = [[allTouches allObjects] objectAtIndex:0]; + CGPoint point = [touch locationInView:self]; + if (!getMouseCoords(_orientation, point, &x, &y)) + return; + + [self addEvent: + [[NSDictionary alloc] initWithObjectsAndKeys: + [NSNumber numberWithInt:kInputMouseUp], @"type", + [NSNumber numberWithInt:x], @"x", + [NSNumber numberWithInt:y], @"y", + nil + ] + ]; + break; } - case 2: - { - UITouch *touch = [[allTouches allObjects] objectAtIndex:1]; - CGPoint point = [touch locationInView:self]; - if (!getLocalMouseCoords(&point)) - return; - [self addEvent: - [[NSDictionary alloc] initWithObjectsAndKeys: - [NSNumber numberWithInt:kInputMouseSecondUp], @"type", - [NSNumber numberWithFloat:point.x], @"x", - [NSNumber numberWithFloat:point.y], @"y", - nil - ] - ]; - break; + case 2: { + UITouch *touch = [[allTouches allObjects] objectAtIndex:1]; + CGPoint point = [touch locationInView:self]; + if (!getMouseCoords(_orientation, point, &x, &y)) + return; + + [self addEvent: + [[NSDictionary alloc] initWithObjectsAndKeys: + [NSNumber numberWithInt:kInputMouseSecondUp], @"type", + [NSNumber numberWithInt:x], @"x", + [NSNumber numberWithInt:y], @"y", + nil + ] + ]; + break; } } } -- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event -{ - +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { } - (void)handleKeyPress:(unichar)c { [self addEvent: [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:kInputKeyPressed], @"type", - [NSNumber numberWithFloat:(float)c], @"x", - [NSNumber numberWithFloat:0], @"y", + [NSNumber numberWithInt:c], @"x", + [NSNumber numberWithInt:0], @"y", nil ] ]; @@ -724,8 +877,8 @@ bool getLocalMouseCoords(CGPoint *point) { [self addEvent: [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:kInputSwipe], @"type", - [NSNumber numberWithFloat:(float)num], @"x", - [NSNumber numberWithFloat:0], @"y", + [NSNumber numberWithInt:num], @"x", + [NSNumber numberWithInt:0], @"y", nil ] ]; @@ -735,8 +888,8 @@ bool getLocalMouseCoords(CGPoint *point) { [self addEvent: [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:kInputApplicationSuspended], @"type", - [NSNumber numberWithFloat:0], @"x", - [NSNumber numberWithFloat:0], @"y", + [NSNumber numberWithInt:0], @"x", + [NSNumber numberWithInt:0], @"y", nil ] ]; @@ -746,8 +899,8 @@ bool getLocalMouseCoords(CGPoint *point) { [self addEvent: [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:kInputApplicationResumed], @"type", - [NSNumber numberWithFloat:0], @"x", - [NSNumber numberWithFloat:0], @"y", + [NSNumber numberWithInt:0], @"x", + [NSNumber numberWithInt:0], @"y", nil ] ]; diff --git a/backends/platform/iphone/module.mk b/backends/platform/iphone/module.mk index 9768e6ded4..ea5115782f 100644 --- a/backends/platform/iphone/module.mk +++ b/backends/platform/iphone/module.mk @@ -7,8 +7,7 @@ MODULE_OBJS := \ osys_video.o \ iphone_main.o \ iphone_video.o \ - iphone_keyboard.o \ - blit_arm.o + iphone_keyboard.o # We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) diff --git a/backends/platform/iphone/osys_events.cpp b/backends/platform/iphone/osys_events.cpp index 1ab1db0f27..c167da35e6 100644 --- a/backends/platform/iphone/osys_events.cpp +++ b/backends/platform/iphone/osys_events.cpp @@ -40,98 +40,66 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) { _timerCallbackNext = curTime + _timerCallbackTimer; } - if (_queuedInputEvent.type != (Common::EventType)0 && curTime >= _queuedEventTime) { + if (_queuedInputEvent.type != Common::EVENT_INVALID && curTime >= _queuedEventTime) { event = _queuedInputEvent; - _queuedInputEvent.type = (Common::EventType)0; + _queuedInputEvent.type = Common::EVENT_INVALID; return true; } int eventType; - float xUnit, yUnit; - - if (iPhone_fetchEvent(&eventType, &xUnit, &yUnit)) { - int x = 0; - int y = 0; - switch (_screenOrientation) { - case kScreenOrientationPortrait: - if (_overlayVisible) { - x = (int)(xUnit * _overlayWidth); - y = (int)(yUnit * _overlayHeight); - } else { - x = (int)(xUnit * _screenWidth); - y = (int)(yUnit * _screenHeight); - } - break; - case kScreenOrientationLandscape: - if (_overlayVisible) { - x = (int)(yUnit * _overlayWidth); - y = (int)((1.0 - xUnit) * _overlayHeight); - } else { - x = (int)(yUnit * _screenWidth); - y = (int)((1.0 - xUnit) * _screenHeight); - } - break; - case kScreenOrientationFlippedLandscape: - if (_overlayVisible) { - x = (int)((1.0 - yUnit) * _overlayWidth); - y = (int)(xUnit * _overlayHeight); - } else { - x = (int)((1.0 - yUnit) * _screenWidth); - y = (int)(xUnit * _screenHeight); - } - break; - } + int x, y; + if (iPhone_fetchEvent(&eventType, &x, &y)) { switch ((InputEvent)eventType) { - case kInputMouseDown: - if (!handleEvent_mouseDown(event, x, y)) - return false; - break; + case kInputMouseDown: + if (!handleEvent_mouseDown(event, x, y)) + return false; + break; - case kInputMouseUp: + case kInputMouseUp: if (!handleEvent_mouseUp(event, x, y)) return false; - break; - - case kInputMouseDragged: - if (!handleEvent_mouseDragged(event, x, y)) - return false; - break; - case kInputMouseSecondDragged: - if (!handleEvent_mouseSecondDragged(event, x, y)) - return false; - break; - case kInputMouseSecondDown: - _secondaryTapped = true; - if (!handleEvent_secondMouseDown(event, x, y)) - return false; - break; - case kInputMouseSecondUp: - _secondaryTapped = false; - if (!handleEvent_secondMouseUp(event, x, y)) - return false; - break; - case kInputOrientationChanged: - handleEvent_orientationChanged((int)xUnit); - return false; - break; + break; - case kInputApplicationSuspended: - suspendLoop(); + case kInputMouseDragged: + if (!handleEvent_mouseDragged(event, x, y)) + return false; + break; + case kInputMouseSecondDragged: + if (!handleEvent_mouseSecondDragged(event, x, y)) + return false; + break; + case kInputMouseSecondDown: + _secondaryTapped = true; + if (!handleEvent_secondMouseDown(event, x, y)) + return false; + break; + case kInputMouseSecondUp: + _secondaryTapped = false; + if (!handleEvent_secondMouseUp(event, x, y)) return false; - break; + break; + case kInputOrientationChanged: + handleEvent_orientationChanged(x); + return false; + break; - case kInputKeyPressed: - handleEvent_keyPressed(event, (int)xUnit); - break; + case kInputApplicationSuspended: + suspendLoop(); + return false; + break; - case kInputSwipe: - if (!handleEvent_swipe(event, (int)xUnit)) - return false; - break; + case kInputKeyPressed: + handleEvent_keyPressed(event, x); + break; + + case kInputSwipe: + if (!handleEvent_swipe(event, x)) + return false; + break; - default: - break; + default: + break; } return true; @@ -170,8 +138,7 @@ bool OSystem_IPHONE::handleEvent_mouseUp(Common::Event &event, int x, int y) { _secondaryTapped = false; if (!handleEvent_secondMouseUp(event, x, y)) return false; - } - else if (_mouseClickAndDragEnabled) { + } else if (_mouseClickAndDragEnabled) { event.type = Common::EVENT_LBUTTONUP; event.mouse.x = _mouseX; event.mouse.y = _mouseY; @@ -206,8 +173,7 @@ bool OSystem_IPHONE::handleEvent_secondMouseDown(Common::Event &event, int x, in _queuedInputEvent.type = Common::EVENT_RBUTTONDOWN; _queuedInputEvent.mouse.x = _mouseX; _queuedInputEvent.mouse.y = _mouseY; - } - else + } else return false; return true; @@ -216,7 +182,7 @@ bool OSystem_IPHONE::handleEvent_secondMouseDown(Common::Event &event, int x, in bool OSystem_IPHONE::handleEvent_secondMouseUp(Common::Event &event, int x, int y) { int curTime = getMillis(); - if (curTime - _lastSecondaryDown < 400 ) { + if (curTime - _lastSecondaryDown < 400) { //printf("Right tap!\n"); if (curTime - _lastSecondaryTap < 400 && !_overlayVisible) { //printf("Right escape!\n"); @@ -262,7 +228,7 @@ bool OSystem_IPHONE::handleEvent_mouseDragged(Common::Event &event, int x, int y //printf("Mouse dragged at (%u, %u)\n", x, y); int mouseNewPosX; int mouseNewPosY; - if (_touchpadModeEnabled ) { + if (_touchpadModeEnabled) { int deltaX = _lastPadX - x; int deltaY = _lastPadY - y; _lastPadX = x; @@ -319,12 +285,9 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x, if (absX < kMaxDeviation && vecY >= kNeededLength) { // Swipe down - event.type = Common::EVENT_KEYDOWN; - _queuedInputEvent.type = Common::EVENT_KEYUP; + event.type = Common::EVENT_MAINMENU; + _queuedInputEvent.type = Common::EVENT_INVALID; - event.kbd.flags = _queuedInputEvent.kbd.flags = 0; - event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_F5; - event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_F5; _queuedEventTime = getMillis() + kQueuedInputEventDelay; return true; } @@ -371,17 +334,17 @@ void OSystem_IPHONE::handleEvent_orientationChanged(int orientation) { ScreenOrientation newOrientation; switch (orientation) { - case 1: - newOrientation = kScreenOrientationPortrait; - break; - case 3: - newOrientation = kScreenOrientationLandscape; - break; - case 4: - newOrientation = kScreenOrientationFlippedLandscape; - break; - default: - return; + case 1: + newOrientation = kScreenOrientationPortrait; + break; + case 3: + newOrientation = kScreenOrientationLandscape; + break; + case 4: + newOrientation = kScreenOrientationFlippedLandscape; + break; + default: + return; } @@ -403,50 +366,50 @@ void OSystem_IPHONE::handleEvent_keyPressed(Common::Event &event, int keyPresse // We remap some of the iPhone keyboard keys. // The first ten here are the row of symbols below the numeric keys. switch (keyPressed) { - case 45: - keyPressed = Common::KEYCODE_F1; - ascii = Common::ASCII_F1; - break; - case 47: - keyPressed = Common::KEYCODE_F2; - ascii = Common::ASCII_F2; - break; - case 58: - keyPressed = Common::KEYCODE_F3; - ascii = Common::ASCII_F3; - break; - case 59: - keyPressed = Common::KEYCODE_F4; - ascii = Common::ASCII_F4; - break; - case 40: - keyPressed = Common::KEYCODE_F5; - ascii = Common::ASCII_F5; - break; - case 41: - keyPressed = Common::KEYCODE_F6; - ascii = Common::ASCII_F6; - break; - case 36: - keyPressed = Common::KEYCODE_F7; - ascii = Common::ASCII_F7; - break; - case 38: - keyPressed = Common::KEYCODE_F8; - ascii = Common::ASCII_F8; - break; - case 64: - keyPressed = Common::KEYCODE_F9; - ascii = Common::ASCII_F9; - break; - case 34: - keyPressed = Common::KEYCODE_F10; - ascii = Common::ASCII_F10; - break; - case 10: - keyPressed = Common::KEYCODE_RETURN; - ascii = Common::ASCII_RETURN; - break; + case 45: + keyPressed = Common::KEYCODE_F1; + ascii = Common::ASCII_F1; + break; + case 47: + keyPressed = Common::KEYCODE_F2; + ascii = Common::ASCII_F2; + break; + case 58: + keyPressed = Common::KEYCODE_F3; + ascii = Common::ASCII_F3; + break; + case 59: + keyPressed = Common::KEYCODE_F4; + ascii = Common::ASCII_F4; + break; + case 40: + keyPressed = Common::KEYCODE_F5; + ascii = Common::ASCII_F5; + break; + case 41: + keyPressed = Common::KEYCODE_F6; + ascii = Common::ASCII_F6; + break; + case 36: + keyPressed = Common::KEYCODE_F7; + ascii = Common::ASCII_F7; + break; + case 38: + keyPressed = Common::KEYCODE_F8; + ascii = Common::ASCII_F8; + break; + case 64: + keyPressed = Common::KEYCODE_F9; + ascii = Common::ASCII_F9; + break; + case 34: + keyPressed = Common::KEYCODE_F10; + ascii = Common::ASCII_F10; + break; + case 10: + keyPressed = Common::KEYCODE_RETURN; + ascii = Common::ASCII_RETURN; + break; } event.type = Common::EVENT_KEYDOWN; _queuedInputEvent.type = Common::EVENT_KEYUP; @@ -460,60 +423,60 @@ void OSystem_IPHONE::handleEvent_keyPressed(Common::Event &event, int keyPresse bool OSystem_IPHONE::handleEvent_swipe(Common::Event &event, int direction) { Common::KeyCode keycode = Common::KEYCODE_INVALID; switch (_screenOrientation) { - case kScreenOrientationPortrait: - switch ((UIViewSwipeDirection)direction) { - case kUIViewSwipeUp: - keycode = Common::KEYCODE_UP; - break; - case kUIViewSwipeDown: - keycode = Common::KEYCODE_DOWN; - break; - case kUIViewSwipeLeft: - keycode = Common::KEYCODE_LEFT; - break; - case kUIViewSwipeRight: - keycode = Common::KEYCODE_RIGHT; - break; - default: - return false; - } + case kScreenOrientationPortrait: + switch ((UIViewSwipeDirection)direction) { + case kUIViewSwipeUp: + keycode = Common::KEYCODE_UP; + break; + case kUIViewSwipeDown: + keycode = Common::KEYCODE_DOWN; break; - case kScreenOrientationLandscape: - switch ((UIViewSwipeDirection)direction) { - case kUIViewSwipeUp: - keycode = Common::KEYCODE_LEFT; - break; - case kUIViewSwipeDown: - keycode = Common::KEYCODE_RIGHT; - break; - case kUIViewSwipeLeft: - keycode = Common::KEYCODE_DOWN; - break; - case kUIViewSwipeRight: - keycode = Common::KEYCODE_UP; - break; - default: - return false; - } + case kUIViewSwipeLeft: + keycode = Common::KEYCODE_LEFT; break; - case kScreenOrientationFlippedLandscape: - switch ((UIViewSwipeDirection)direction) { - case kUIViewSwipeUp: - keycode = Common::KEYCODE_RIGHT; - break; - case kUIViewSwipeDown: - keycode = Common::KEYCODE_LEFT; - break; - case kUIViewSwipeLeft: - keycode = Common::KEYCODE_UP; - break; - case kUIViewSwipeRight: - keycode = Common::KEYCODE_DOWN; - break; - default: - return false; - } + case kUIViewSwipeRight: + keycode = Common::KEYCODE_RIGHT; break; + default: + return false; + } + break; + case kScreenOrientationLandscape: + switch ((UIViewSwipeDirection)direction) { + case kUIViewSwipeUp: + keycode = Common::KEYCODE_LEFT; + break; + case kUIViewSwipeDown: + keycode = Common::KEYCODE_RIGHT; + break; + case kUIViewSwipeLeft: + keycode = Common::KEYCODE_DOWN; + break; + case kUIViewSwipeRight: + keycode = Common::KEYCODE_UP; + break; + default: + return false; + } + break; + case kScreenOrientationFlippedLandscape: + switch ((UIViewSwipeDirection)direction) { + case kUIViewSwipeUp: + keycode = Common::KEYCODE_RIGHT; + break; + case kUIViewSwipeDown: + keycode = Common::KEYCODE_LEFT; + break; + case kUIViewSwipeLeft: + keycode = Common::KEYCODE_UP; + break; + case kUIViewSwipeRight: + keycode = Common::KEYCODE_DOWN; + break; + default: + return false; + } + break; } event.kbd.keycode = _queuedInputEvent.kbd.keycode = keycode; diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp index 4bc567c39d..2bdc09c9ce 100644 --- a/backends/platform/iphone/osys_main.cpp +++ b/backends/platform/iphone/osys_main.cpp @@ -45,7 +45,9 @@ const OSystem::GraphicsMode OSystem_IPHONE::s_supportedGraphicsModes[] = { - {0, 0, 0} + { "linear", "Linear filtering", kGraphicsModeLinear }, + { "none", "No filtering", kGraphicsModeNone }, + { 0, 0, 0 } }; AQCallbackStruct OSystem_IPHONE::s_AudioQueue; @@ -53,18 +55,16 @@ SoundProc OSystem_IPHONE::s_soundCallback = NULL; void *OSystem_IPHONE::s_soundParam = NULL; OSystem_IPHONE::OSystem_IPHONE() : - _mixer(NULL), _offscreen(NULL), - _overlayVisible(false), _fullscreen(NULL), + _mixer(NULL), _gameScreenRaw(NULL), + _overlayVisible(false), _gameScreenConverted(NULL), _mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), _queuedEventTime(0), - _secondaryTapped(false), _lastSecondaryTap(0), + _mouseNeedTextureUpdate(false), _secondaryTapped(false), _lastSecondaryTap(0), _screenOrientation(kScreenOrientationFlippedLandscape), _mouseClickAndDragEnabled(false), _gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false), _fullScreenOverlayIsDirty(false), _mouseDirty(false), _timeSuspended(0), _lastDragPosX(-1), _lastDragPosY(-1), _screenChangeCount(0), - _overlayHeight(0), _overlayWidth(0), _overlayBuffer(0) -{ - _queuedInputEvent.type = (Common::EventType)0; - _lastDrawnMouseRect = Common::Rect(0, 0, 0, 0); - + _overlayHeight(0), _overlayWidth(0), _overlayBuffer(0), _mouseCursorPaletteEnabled(false), + _currentGraphicsMode(kGraphicsModeLinear) { + _queuedInputEvent.type = Common::EVENT_INVALID; _touchpadModeEnabled = !iPhone_isHighResDevice(); _fsFactory = new POSIXFilesystemFactory(); } @@ -73,8 +73,8 @@ OSystem_IPHONE::~OSystem_IPHONE() { AudioQueueDispose(s_AudioQueue.queue, true); delete _mixer; - delete _offscreen; - delete _fullscreen; + free(_gameScreenRaw); + free(_gameScreenConverted); } int OSystem_IPHONE::timerHandler(int t) { @@ -102,26 +102,50 @@ void OSystem_IPHONE::initBackend() { } bool OSystem_IPHONE::hasFeature(Feature f) { - return false; + switch (f) { + case kFeatureCursorPalette: + return true; + + default: + return false; + } } void OSystem_IPHONE::setFeatureState(Feature f, bool enable) { + switch (f) { + case kFeatureCursorPalette: + if (_mouseCursorPaletteEnabled != enable) { + _mouseNeedTextureUpdate = true; + _mouseDirty = true; + _mouseCursorPaletteEnabled = enable; + } + break; + + default: + break; + } } bool OSystem_IPHONE::getFeatureState(Feature f) { - return false; + switch (f) { + case kFeatureCursorPalette: + return _mouseCursorPaletteEnabled; + + default: + return false; + } } void OSystem_IPHONE::suspendLoop() { bool done = false; int eventType; - float xUnit, yUnit; + int x, y; uint32 startTime = getMillis(); stopSoundsystem(); while (!done) { - if (iPhone_fetchEvent(&eventType, &xUnit, &yUnit)) + if (iPhone_fetchEvent(&eventType, &x, &y)) if ((InputEvent)eventType == kInputApplicationResumed) done = true; usleep(100000); @@ -226,7 +250,6 @@ Common::String OSystem_IPHONE::getDefaultConfigFileName() { #endif } - void OSystem_IPHONE::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { // Get URL of the Resource directory of the .app bundle CFURLRef fileUrl = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()); @@ -272,7 +295,7 @@ void iphone_main(int argc, char *argv[]) { } #ifdef IPHONE_OFFICIAL - chdir( iPhone_getDocumentsDir() ); + chdir(iPhone_getDocumentsDir()); #else system("mkdir " SCUMMVM_ROOT_PATH); system("mkdir " SCUMMVM_SAVE_PATH); diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index 37896cceeb..e4b3d358d5 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -20,6 +20,9 @@ * */ +#ifndef BACKENDS_PLATFORM_IPHONE_OSYS_MAIN_H +#define BACKENDS_PLATFORM_IPHONE_OSYS_MAIN_H + #include "graphics/surface.h" #include "iphone_common.h" #include "backends/base-backend.h" @@ -42,32 +45,36 @@ typedef void (*SoundProc)(void *param, byte *buf, int len); typedef int (*TimerProc)(int interval); -typedef struct AQCallbackStruct { - AudioQueueRef queue; - uint32 frameCount; - AudioQueueBufferRef buffers[AUDIO_BUFFERS]; - AudioStreamBasicDescription dataFormat; -} AQCallbackStruct; +struct AQCallbackStruct { + AudioQueueRef queue; + uint32 frameCount; + AudioQueueBufferRef buffers[AUDIO_BUFFERS]; + AudioStreamBasicDescription dataFormat; +}; class OSystem_IPHONE : public EventsBaseBackend, public PaletteManager { protected: - static const OSystem::GraphicsMode s_supportedGraphicsModes[]; static AQCallbackStruct s_AudioQueue; static SoundProc s_soundCallback; static void *s_soundParam; + int _currentGraphicsMode; + Audio::MixerImpl *_mixer; Graphics::Surface _framebuffer; - byte *_offscreen; + byte *_gameScreenRaw; OverlayColor *_overlayBuffer; uint16 _overlayHeight; uint16 _overlayWidth; - uint16 *_fullscreen; + uint16 *_gameScreenConverted; - uint16 _palette[256]; + // For use with the game texture + uint16 _gamePalette[256]; + // For use with the mouse texture + uint16 _gamePaletteRGBA5551[256]; bool _overlayVisible; uint16 _screenWidth; uint16 _screenHeight; @@ -76,16 +83,18 @@ protected: uint32 _timeSuspended; bool _mouseVisible; + bool _mouseCursorPaletteEnabled; + uint16 _mouseCursorPalette[256]; byte *_mouseBuf; byte _mouseKeyColor; uint _mouseWidth, _mouseHeight; uint _mouseX, _mouseY; int _mouseHotspotX, _mouseHotspotY; bool _mouseDirty; + bool _mouseNeedTextureUpdate; long _lastMouseDown; long _lastMouseTap; long _queuedEventTime; - Common::Rect _lastDrawnMouseRect; Common::Event _queuedInputEvent; bool _secondaryTapped; long _lastSecondaryDown; @@ -121,7 +130,6 @@ public: virtual bool getFeatureState(Feature f); virtual const GraphicsMode *getSupportedGraphicsModes() const; virtual int getDefaultGraphicsMode() const; - bool setGraphicsMode(const char *name); virtual bool setGraphicsMode(int mode); virtual int getGraphicsMode() const; virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format); @@ -154,6 +162,7 @@ public: virtual void warpMouse(int x, int y); virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 255, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL); + virtual void setCursorPalette(const byte *colors, uint start, uint num); virtual bool pollEvent(Common::Event &event); virtual uint32 getMillis(); @@ -167,7 +176,7 @@ public: static void mixCallback(void *sys, byte *samples, int len); virtual void setupMixer(void); virtual void setTimerCallback(TimerProc callback, int interval); - virtual int getScreenChangeID() const { return _screenChangeCount; } + virtual int getScreenChangeID() const { return _screenChangeCount; } virtual void quit(); virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); @@ -186,12 +195,11 @@ protected: void internUpdateScreen(); void dirtyFullScreen(); void dirtyFullOverlayScreen(); - void clipRectToScreen(int16 &x, int16 &y, int16 &w, int16 &h); void suspendLoop(); - void drawDirtyRect(const Common::Rect& dirtyRect); - void drawDirtyOverlayRect(const Common::Rect& dirtyRect); - void drawMouseCursorOnRectUpdate(const Common::Rect& updatedRect, const Common::Rect& mouseRect); - void updateHardwareSurfaceForRect(const Common::Rect& updatedRect); + void drawDirtyRect(const Common::Rect &dirtyRect); + void drawDirtyOverlayRect(const Common::Rect &dirtyRect); + void updateHardwareSurfaceForRect(const Common::Rect &updatedRect); + void updateMouseTexture(); static void AQBufferCallback(void *in, AudioQueueRef inQ, AudioQueueBufferRef outQB); static int timerHandler(int t); @@ -208,3 +216,5 @@ protected: bool handleEvent_mouseDragged(Common::Event &event, int x, int y); bool handleEvent_mouseSecondDragged(Common::Event &event, int x, int y); }; + +#endif diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp index fa425b108a..78c6cd4625 100644 --- a/backends/platform/iphone/osys_video.cpp +++ b/backends/platform/iphone/osys_video.cpp @@ -25,25 +25,30 @@ #include "osys_main.h" -const OSystem::GraphicsMode* OSystem_IPHONE::getSupportedGraphicsModes() const { +const OSystem::GraphicsMode *OSystem_IPHONE::getSupportedGraphicsModes() const { return s_supportedGraphicsModes; } int OSystem_IPHONE::getDefaultGraphicsMode() const { - return -1; -} - -bool OSystem_IPHONE::setGraphicsMode(const char *mode) { - return true; + return kGraphicsModeLinear; } bool OSystem_IPHONE::setGraphicsMode(int mode) { - return true; + switch (mode) { + case kGraphicsModeNone: + case kGraphicsModeLinear: + _currentGraphicsMode = mode; + iPhone_setGraphicsMode(mode); + return true; + + default: + return false; + } } int OSystem_IPHONE::getGraphicsMode() const { - return -1; + return _currentGraphicsMode; } void OSystem_IPHONE::initSize(uint width, uint height, const Graphics::PixelFormat *format) { @@ -52,10 +57,10 @@ void OSystem_IPHONE::initSize(uint width, uint height, const Graphics::PixelForm _screenWidth = width; _screenHeight = height; - free(_offscreen); + free(_gameScreenRaw); - _offscreen = (byte *)malloc(width * height); - bzero(_offscreen, width * height); + _gameScreenRaw = (byte *)malloc(width * height); + bzero(_gameScreenRaw, width * height); //free(_overlayBuffer); @@ -63,10 +68,10 @@ void OSystem_IPHONE::initSize(uint width, uint height, const Graphics::PixelForm //_overlayBuffer = (OverlayColor *)malloc(fullSize); clearOverlay(); - free(_fullscreen); + free(_gameScreenConverted); - _fullscreen = (uint16 *)malloc(fullSize); - bzero(_fullscreen, fullSize); + _gameScreenConverted = (uint16 *)malloc(fullSize); + bzero(_gameScreenConverted, fullSize); iPhone_initSurface(width, height); @@ -81,6 +86,7 @@ void OSystem_IPHONE::initSize(uint width, uint height, const Graphics::PixelForm _fullScreenIsDirty = false; dirtyFullScreen(); _mouseVisible = false; + _mouseCursorPaletteEnabled = false; _screenChangeCount++; updateScreen(); } @@ -98,7 +104,8 @@ void OSystem_IPHONE::setPalette(const byte *colors, uint start, uint num) { const byte *b = colors; for (uint i = start; i < start + num; ++i) { - _palette[i] = Graphics::RGBToColor<Graphics::ColorMasks<565> >(b[0], b[1], b[2]); + _gamePalette[i] = Graphics::RGBToColor<Graphics::ColorMasks<565> >(b[0], b[1], b[2]); + _gamePaletteRGBA5551[i] = Graphics::RGBToColor<Graphics::ColorMasks<5551> >(b[0], b[1], b[2]); b += 3; } @@ -110,7 +117,7 @@ void OSystem_IPHONE::grabPalette(byte *colors, uint start, uint num) { byte *b = colors; for (uint i = start; i < start + num; ++i) { - Graphics::colorToRGB<Graphics::ColorMasks<565> >(_palette[i], b[0], b[1], b[2]); + Graphics::colorToRGB<Graphics::ColorMasks<565> >(_gamePalette[i], b[0], b[1], b[2]); b += 3; } } @@ -146,7 +153,7 @@ void OSystem_IPHONE::copyRectToScreen(const byte *buf, int pitch, int x, int y, } - byte *dst = _offscreen + y * _screenWidth + x; + byte *dst = _gameScreenRaw + y * _screenWidth + x; if (_screenWidth == pitch && pitch == w) memcpy(dst, buf, h * w); else { @@ -158,32 +165,6 @@ void OSystem_IPHONE::copyRectToScreen(const byte *buf, int pitch, int x, int y, } } -void OSystem_IPHONE::clipRectToScreen(int16 &x, int16 &y, int16 &w, int16 &h) { - if (x < 0) { - w += x; - x = 0; - } - - if (y < 0) { - h += y; - y = 0; - } - - if (w > _screenWidth - x) - w = _screenWidth - x; - - if (h > _screenHeight - y) - h = _screenHeight - y; - - if (w < 0) { - w = 0; - } - - if (h < 0) { - h = 0; - } -} - void OSystem_IPHONE::updateScreen() { //printf("updateScreen(): %i dirty rects.\n", _dirtyRects.size()); @@ -191,47 +172,24 @@ void OSystem_IPHONE::updateScreen() { return; internUpdateScreen(); + _mouseDirty = false; _fullScreenIsDirty = false; _fullScreenOverlayIsDirty = false; - iPhone_updateScreen(_mouseX - _mouseHotspotX, _mouseY - _mouseHotspotY); + iPhone_updateScreen(_mouseX, _mouseY); } void OSystem_IPHONE::internUpdateScreen() { - int16 mouseX = _mouseX - _mouseHotspotX; - int16 mouseY = _mouseY - _mouseHotspotY; - int16 mouseWidth = _mouseWidth; - int16 mouseHeight = _mouseHeight; - - clipRectToScreen(mouseX, mouseY, mouseWidth, mouseHeight); - - Common::Rect mouseRect(mouseX, mouseY, mouseX + mouseWidth, mouseY + mouseHeight); - - if (_mouseDirty) { - if (!_fullScreenIsDirty) { - _dirtyRects.push_back(_lastDrawnMouseRect); - _dirtyRects.push_back(mouseRect); - } - if (!_fullScreenOverlayIsDirty && _overlayVisible) { - _dirtyOverlayRects.push_back(_lastDrawnMouseRect); - _dirtyOverlayRects.push_back(mouseRect); - } - _mouseDirty = false; - _lastDrawnMouseRect = mouseRect; + if (_mouseNeedTextureUpdate) { + updateMouseTexture(); + _mouseNeedTextureUpdate = false; } while (_dirtyRects.size()) { Common::Rect dirtyRect = _dirtyRects.remove_at(_dirtyRects.size() - 1); //printf("Drawing: (%i, %i) -> (%i, %i)\n", dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom); - drawDirtyRect(dirtyRect); - - if (_overlayVisible) - drawDirtyOverlayRect(dirtyRect); - else - drawMouseCursorOnRectUpdate(dirtyRect, mouseRect); - updateHardwareSurfaceForRect(dirtyRect); } @@ -240,94 +198,38 @@ void OSystem_IPHONE::internUpdateScreen() { Common::Rect dirtyRect = _dirtyOverlayRects.remove_at(_dirtyOverlayRects.size() - 1); //printf("Drawing: (%i, %i) -> (%i, %i)\n", dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom); - drawDirtyOverlayRect(dirtyRect); - //drawMouseCursorOnRectUpdate(dirtyRect, mouseRect); - //updateHardwareSurfaceForRect(dirtyRect); } } } -void OSystem_IPHONE::drawDirtyRect(const Common::Rect& dirtyRect) { +void OSystem_IPHONE::drawDirtyRect(const Common::Rect &dirtyRect) { int h = dirtyRect.bottom - dirtyRect.top; int w = dirtyRect.right - dirtyRect.left; - byte *src = &_offscreen[dirtyRect.top * _screenWidth + dirtyRect.left]; - uint16 *dst = &_fullscreen[dirtyRect.top * _screenWidth + dirtyRect.left]; + byte *src = &_gameScreenRaw[dirtyRect.top * _screenWidth + dirtyRect.left]; + uint16 *dst = &_gameScreenConverted[dirtyRect.top * _screenWidth + dirtyRect.left]; for (int y = h; y > 0; y--) { for (int x = w; x > 0; x--) - *dst++ = _palette[*src++]; + *dst++ = _gamePalette[*src++]; dst += _screenWidth - w; src += _screenWidth - w; } } -void OSystem_IPHONE::drawDirtyOverlayRect(const Common::Rect& dirtyRect) { - // int h = dirtyRect.bottom - dirtyRect.top; - // - // uint16 *src = (uint16 *)&_overlayBuffer[dirtyRect.top * _screenWidth + dirtyRect.left]; - // uint16 *dst = &_fullscreen[dirtyRect.top * _screenWidth + dirtyRect.left]; - // int x = (dirtyRect.right - dirtyRect.left) * 2; - // for (int y = h; y > 0; y--) { - // memcpy(dst, src, x); - // src += _screenWidth; - // dst += _screenWidth; - // } +void OSystem_IPHONE::drawDirtyOverlayRect(const Common::Rect &dirtyRect) { iPhone_updateOverlayRect(_overlayBuffer, dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom); } -void OSystem_IPHONE::drawMouseCursorOnRectUpdate(const Common::Rect& updatedRect, const Common::Rect& mouseRect) { - //draw mouse on top - if (_mouseVisible && (updatedRect.intersects(mouseRect))) { - int srcX = 0; - int srcY = 0; - int left = _mouseX - _mouseHotspotX; - if (left < 0) { - srcX -= left; - left = 0; - } - int top = _mouseY - _mouseHotspotY; - if (top < 0) { - srcY -= top; - top = 0; - } - - int bottom = top + _mouseHeight; - if (bottom > _screenWidth) - bottom = _screenWidth; - - int displayWidth = _mouseWidth; - if (_mouseWidth + left > _screenWidth) - displayWidth = _screenWidth - left; - - int displayHeight = _mouseHeight; - if (_mouseHeight + top > _screenHeight) - displayHeight = _screenHeight - top; - - byte *src = &_mouseBuf[srcY * _mouseWidth + srcX]; - uint16 *dst = &_fullscreen[top * _screenWidth + left]; - for (int y = displayHeight; y > srcY; y--) { - for (int x = displayWidth; x > srcX; x--) { - if (*src != _mouseKeyColor) - *dst = _palette[*src]; - dst++; - src++; - } - dst += _screenWidth - displayWidth + srcX; - src += _mouseWidth - displayWidth + srcX; - } - } -} - -void OSystem_IPHONE::updateHardwareSurfaceForRect(const Common::Rect& updatedRect) { - iPhone_updateScreenRect(_fullscreen, updatedRect.left, updatedRect.top, updatedRect.right, updatedRect.bottom ); +void OSystem_IPHONE::updateHardwareSurfaceForRect(const Common::Rect &updatedRect) { + iPhone_updateScreenRect(_gameScreenConverted, updatedRect.left, updatedRect.top, updatedRect.right, updatedRect.bottom); } Graphics::Surface *OSystem_IPHONE::lockScreen() { //printf("lockScreen()\n"); - _framebuffer.pixels = _offscreen; + _framebuffer.pixels = _gameScreenRaw; _framebuffer.w = _screenWidth; _framebuffer.h = _screenHeight; _framebuffer.pitch = _screenWidth; @@ -431,6 +333,7 @@ int16 OSystem_IPHONE::getOverlayWidth() { bool OSystem_IPHONE::showMouse(bool visible) { bool last = _mouseVisible; _mouseVisible = visible; + iPhone_showCursor(visible); _mouseDirty = true; return last; @@ -463,24 +366,6 @@ void OSystem_IPHONE::dirtyFullOverlayScreen() { void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) { //printf("setMouseCursor(%i, %i, scale %u)\n", hotspotX, hotspotY, cursorTargetScale); - int texWidth = getSizeNextPOT(w); - int texHeight = getSizeNextPOT(h); - int bufferSize = texWidth * texHeight * sizeof(int16); - int16* mouseBuf = (int16*)malloc(bufferSize); - memset(mouseBuf, 0, bufferSize); - - for (uint x = 0; x < w; ++x) { - for (uint y = 0; y < h; ++y) { - byte color = buf[y * w + x]; - if (color != keycolor) - mouseBuf[y * texWidth + x] = _palette[color] | 0x1; - else - mouseBuf[y * texWidth + x] = 0x0; - } - } - - iPhone_setMouseCursor(mouseBuf, w, h); - if (_mouseBuf != NULL && (_mouseWidth != w || _mouseHeight != h)) { free(_mouseBuf); _mouseBuf = NULL; @@ -500,4 +385,45 @@ void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspot memcpy(_mouseBuf, buf, w * h); _mouseDirty = true; + _mouseNeedTextureUpdate = true; +} + +void OSystem_IPHONE::setCursorPalette(const byte *colors, uint start, uint num) { + assert(start + num <= 256); + + for (uint i = start; i < start + num; ++i, colors += 3) + _mouseCursorPalette[i] = Graphics::RGBToColor<Graphics::ColorMasks<5551> >(colors[0], colors[1], colors[2]); + + // FIXME: This is just stupid, our client code seems to assume that this + // automatically enables the cursor palette. + _mouseCursorPaletteEnabled = true; + + if (_mouseCursorPaletteEnabled) + _mouseDirty = _mouseNeedTextureUpdate = true; +} + +void OSystem_IPHONE::updateMouseTexture() { + int texWidth = getSizeNextPOT(_mouseWidth); + int texHeight = getSizeNextPOT(_mouseHeight); + int bufferSize = texWidth * texHeight * sizeof(int16); + uint16 *mouseBuf = (uint16 *)malloc(bufferSize); + memset(mouseBuf, 0, bufferSize); + + const uint16 *palette; + if (_mouseCursorPaletteEnabled) + palette = _mouseCursorPalette; + else + palette = _gamePaletteRGBA5551; + + for (uint x = 0; x < _mouseWidth; ++x) { + for (uint y = 0; y < _mouseHeight; ++y) { + const byte color = _mouseBuf[y * _mouseWidth + x]; + if (color != _mouseKeyColor) + mouseBuf[y * texWidth + x] = palette[color] | 0x1; + else + mouseBuf[y * texWidth + x] = 0x0; + } + } + + iPhone_setMouseCursor(mouseBuf, _mouseWidth, _mouseHeight, _mouseHotspotX, _mouseHotspotY); } diff --git a/backends/platform/linuxmoto/hardwarekeys.cpp b/backends/platform/linuxmoto/hardwarekeys.cpp index cbd9dccf52..da093c6508 100644 --- a/backends/platform/linuxmoto/hardwarekeys.cpp +++ b/backends/platform/linuxmoto/hardwarekeys.cpp @@ -33,60 +33,59 @@ struct Key { KeyCode keycode; uint16 ascii; const char *desc; - KeyType preferredAction; bool shiftable; }; static const Key keys[] = { - { "FIRE", KEYCODE_RETURN, ASCII_RETURN, "Fire", kActionKeyType, false }, - { "CAMERA", KEYCODE_PAUSE, 0, "Camera", kActionKeyType, false }, - { "HANGUP", KEYCODE_ESCAPE, ASCII_ESCAPE, "Hangup", kStartKeyType, false }, - { "CALL", KEYCODE_SPACE, ASCII_SPACE, "Call", kActionKeyType, false }, - { "PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, false }, - { "MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, false }, + { "FIRE", KEYCODE_RETURN, ASCII_RETURN, "Fire", false }, + { "CAMERA", KEYCODE_PAUSE, 0, "Camera", false }, + { "HANGUP", KEYCODE_ESCAPE, ASCII_ESCAPE, "Hangup", false }, + { "CALL", KEYCODE_SPACE, ASCII_SPACE, "Call", false }, + { "PLUS", KEYCODE_PLUS, '+', "+", false }, + { "MINUS", KEYCODE_MINUS, '-', "-", false }, #ifdef MOTOMAGX - {"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", kActionKeyType, false}, - {"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", kActionKeyType, false}, - {"HASH", KEYCODE_HASH, '#', "#", kActionKeyType, false}, - {"ASTERISK", KEYCODE_ASTERISK, '*', "*", kActionKeyType, false}, - {"LEFTSOFT", KEYCODE_F9, ASCII_F9, "LeftSoft", kActionKeyType, false}, - {"RIGHTSOFT", KEYCODE_F11, ASCII_F11, "RightSoft", kActionKeyType, false}, - {"0", KEYCODE_0, '0', "0", kActionKeyType, false}, - {"1", KEYCODE_1, '1', "1", kActionKeyType, false}, - {"2", KEYCODE_2, '2', "2", kActionKeyType, false}, - {"3", KEYCODE_3, '3', "3", kActionKeyType, false}, - {"4", KEYCODE_4, '4', "4", kActionKeyType, false}, - {"5", KEYCODE_5, '5', "5", kActionKeyType, false}, - {"6", KEYCODE_6, '6', "6", kActionKeyType, false}, - {"7", KEYCODE_7, '7', "7", kActionKeyType, false}, - {"8", KEYCODE_8, '8', "8", kActionKeyType, false}, - {"9", KEYCODE_9, '9', "9", kActionKeyType, false}, + {"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", false}, + {"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", false}, + {"HASH", KEYCODE_HASH, '#', "#", false}, + {"ASTERISK", KEYCODE_ASTERISK, '*', "*", false}, + {"LEFTSOFT", KEYCODE_F9, ASCII_F9, "LeftSoft", false}, + {"RIGHTSOFT", KEYCODE_F11, ASCII_F11, "RightSoft", false}, + {"0", KEYCODE_0, '0', "0", false}, + {"1", KEYCODE_1, '1', "1", false}, + {"2", KEYCODE_2, '2', "2", false}, + {"3", KEYCODE_3, '3', "3", false}, + {"4", KEYCODE_4, '4', "4", false}, + {"5", KEYCODE_5, '5', "5", false}, + {"6", KEYCODE_6, '6', "6", false}, + {"7", KEYCODE_7, '7', "7", false}, + {"8", KEYCODE_8, '8', "8", false}, + {"9", KEYCODE_9, '9', "9", false}, #endif #ifdef MOTOEZX - { "a", KEYCODE_a, 'a', "a", kActionKeyType, true }, - { "b", KEYCODE_b, 'b', "b", kActionKeyType, true }, - { "c", KEYCODE_c, 'c', "c", kActionKeyType, true }, - { "d", KEYCODE_d, 'd', "d", kActionKeyType, true }, - { "e", KEYCODE_e, 'e', "e", kActionKeyType, true }, - { "f", KEYCODE_f, 'f', "f", kActionKeyType, true }, - { "g", KEYCODE_g, 'g', "g", kActionKeyType, true }, - { "h", KEYCODE_h, 'h', "h", kActionKeyType, true }, - { "i", KEYCODE_i, 'i', "i", kActionKeyType, true }, - { "j", KEYCODE_j, 'j', "j", kActionKeyType, true }, + { "a", KEYCODE_a, 'a', "a", true }, + { "b", KEYCODE_b, 'b', "b", true }, + { "c", KEYCODE_c, 'c', "c", true }, + { "d", KEYCODE_d, 'd', "d", true }, + { "e", KEYCODE_e, 'e', "e", true }, + { "f", KEYCODE_f, 'f', "f", true }, + { "g", KEYCODE_g, 'g', "g", true }, + { "h", KEYCODE_h, 'h', "h", true }, + { "i", KEYCODE_i, 'i', "i", true }, + { "j", KEYCODE_j, 'j', "j", true }, #endif // Numeric keypad // Arrows + Home/End pad - {"UP", KEYCODE_UP, 0, "Up", kDirUpKeyType, false}, - {"DOWN", KEYCODE_DOWN, 0, "Down", kDirDownKeyType, false}, - {"RIGHT", KEYCODE_RIGHT, 0, "Right", kDirRightKeyType, false}, - {"LEFT", KEYCODE_LEFT, 0, "Left", kDirLeftKeyType, false}, + {"UP", KEYCODE_UP, 0, "Up", false}, + {"DOWN", KEYCODE_DOWN, 0, "Down", false}, + {"RIGHT", KEYCODE_RIGHT, 0, "Right", false}, + {"LEFT", KEYCODE_LEFT, 0, "Left", false}, // Function keys // Miscellaneous function keys - {0, KEYCODE_INVALID, 0, 0, kGenericKeyType, false} + {0, KEYCODE_INVALID, 0, 0, false} }; struct Mod { diff --git a/backends/platform/maemo/maemo-common.h b/backends/platform/maemo/maemo-common.h index cd4bb3b027..453c70c45f 100644 --- a/backends/platform/maemo/maemo-common.h +++ b/backends/platform/maemo/maemo-common.h @@ -28,10 +28,10 @@ namespace Maemo { enum ModelType { - kModelType770 = 1, - kModelTypeN800 = 2, - kModelTypeN810 = 4, - kModelTypeN900 = 8, + kModelType770 = 1 << 0, + kModelTypeN800 = 1 << 1, + kModelTypeN810 = 1 << 2, + kModelTypeN900 = 1 << 3, kModelTypeInvalid = 0 }; @@ -39,16 +39,17 @@ struct Model { const char *hwId; ModelType modelType; const char *hwAlias; - bool hwKeyboard; + bool hasHwKeyboard; + bool hasMenuKey; }; static const Model models[] = { - {"SU-18", kModelType770, "770", false}, - {"RX-34", kModelTypeN800, "N800", false}, - {"RX-44", kModelTypeN810, "N810", true}, - {"RX-48", kModelTypeN810, "N810W", true}, - {"RX-51", kModelTypeN900, "N900", true}, - {0, kModelTypeInvalid, 0, true} + {"SU-18", kModelType770, "770", false, true}, + {"RX-34", kModelTypeN800, "N800", false, true}, + {"RX-44", kModelTypeN810, "N810", true, true}, + {"RX-48", kModelTypeN810, "N810W", true, true}, + {"RX-51", kModelTypeN900, "N900", true, false}, + {0, kModelTypeInvalid, 0, true, true} }; enum CustomEventType { diff --git a/backends/platform/maemo/maemo-keys.h b/backends/platform/maemo/maemo-keys.h index 6725b1164d..e1337515a7 100644 --- a/backends/platform/maemo/maemo-keys.h +++ b/backends/platform/maemo/maemo-keys.h @@ -41,100 +41,95 @@ static const ModifierTableEntry maemoModifiers[] = { }; static const KeyTableEntry maemoKeys[] = { - {"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", kActionKeyType, false}, - {"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", kActionKeyType, false}, - {"CLEAR", KEYCODE_CLEAR, 0, "Clear", kActionKeyType, false}, - {"RETURN", KEYCODE_RETURN, ASCII_RETURN, "MCenter", kActionKeyType, false}, - {"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", kStartKeyType, false}, - {"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", kActionKeyType, false}, - {"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", kActionKeyType, false}, - {"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", kActionKeyType, false}, - {"HASH", KEYCODE_HASH, '#', "#", kActionKeyType, false}, - {"DOLLAR", KEYCODE_DOLLAR, '$', "$", kActionKeyType, false}, - {"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", kActionKeyType, false}, - {"QUOTE", KEYCODE_QUOTE, '\'', "'", kActionKeyType, false}, - {"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", kActionKeyType, false}, - {"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", kActionKeyType, false}, - {"ASTERISK", KEYCODE_ASTERISK, '*', "*", kActionKeyType, false}, - {"PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, false}, - {"COMMA", KEYCODE_COMMA, ',', ",", kActionKeyType, false}, - {"MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, false}, - {"PERIOD", KEYCODE_PERIOD, '.', ".", kActionKeyType, false}, - {"SLASH", KEYCODE_SLASH, '/', "/", kActionKeyType, false}, - {"0", KEYCODE_0, '0', "0", kActionKeyType, false}, - {"1", KEYCODE_1, '1', "1", kActionKeyType, false}, - {"2", KEYCODE_2, '2', "2", kActionKeyType, false}, - {"3", KEYCODE_3, '3', "3", kActionKeyType, false}, - {"4", KEYCODE_4, '4', "4", kActionKeyType, false}, - {"5", KEYCODE_5, '5', "5", kActionKeyType, false}, - {"6", KEYCODE_6, '6', "6", kActionKeyType, false}, - {"7", KEYCODE_7, '7', "7", kActionKeyType, false}, - {"8", KEYCODE_8, '8', "8", kActionKeyType, false}, - {"9", KEYCODE_9, '9', "9", kActionKeyType, false}, - {"COLON", KEYCODE_COLON, ':', ":", kActionKeyType, false}, - {"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", kActionKeyType, false}, - {"LESS", KEYCODE_LESS, '<', "<", kActionKeyType, false}, - {"EQUALS", KEYCODE_EQUALS, '=', "=", kActionKeyType, false}, - {"GREATER", KEYCODE_GREATER, '>', ">", kActionKeyType, false}, - {"QUESTION", KEYCODE_QUESTION, '?', "?", kActionKeyType, false}, - {"AT", KEYCODE_AT, '@', "@", kActionKeyType, false}, - - {"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", kActionKeyType, false}, - {"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", kActionKeyType, false}, - {"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", kActionKeyType, false}, - {"CARET", KEYCODE_CARET, '^', "^", kActionKeyType, false}, - {"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", kActionKeyType, false}, - {"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", kActionKeyType, false}, - {"a", KEYCODE_a, 'a', "a", kActionKeyType, true}, - {"b", KEYCODE_b, 'b', "b", kActionKeyType, true}, - {"c", KEYCODE_c, 'c', "c", kActionKeyType, true}, - {"d", KEYCODE_d, 'd', "d", kActionKeyType, true}, - {"e", KEYCODE_e, 'e', "e", kActionKeyType, true}, - {"f", KEYCODE_f, 'f', "f", kActionKeyType, true}, - {"g", KEYCODE_g, 'g', "g", kActionKeyType, true}, - {"h", KEYCODE_h, 'h', "h", kActionKeyType, true}, - {"i", KEYCODE_i, 'i', "i", kActionKeyType, true}, - {"j", KEYCODE_j, 'j', "j", kActionKeyType, true}, - {"k", KEYCODE_k, 'k', "k", kActionKeyType, true}, - {"l", KEYCODE_l, 'l', "l", kActionKeyType, true}, - {"m", KEYCODE_m, 'm', "m", kActionKeyType, true}, - {"n", KEYCODE_n, 'n', "n", kActionKeyType, true}, - {"o", KEYCODE_o, 'o', "o", kActionKeyType, true}, - {"p", KEYCODE_p, 'p', "p", kActionKeyType, true}, - {"q", KEYCODE_q, 'q', "q", kActionKeyType, true}, - {"r", KEYCODE_r, 'r', "r", kActionKeyType, true}, - {"s", KEYCODE_s, 's', "s", kActionKeyType, true}, - {"t", KEYCODE_t, 't', "t", kActionKeyType, true}, - {"u", KEYCODE_u, 'u', "u", kActionKeyType, true}, - {"v", KEYCODE_v, 'v', "v", kActionKeyType, true}, - {"w", KEYCODE_w, 'w', "w", kActionKeyType, true}, - {"x", KEYCODE_x, 'x', "x", kActionKeyType, true}, - {"y", KEYCODE_y, 'y', "y", kActionKeyType, true}, - {"z", KEYCODE_z, 'z', "z", kActionKeyType, true}, - {"DELETE", KEYCODE_DELETE, 0, "Del", kActionKeyType, false}, - - {"KP_ENTER", KEYCODE_KP_ENTER, 0, "Enter", kActionKeyType, false}, + {"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", false}, + {"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", false}, + {"CLEAR", KEYCODE_CLEAR, 0, "Clear", false}, + {"RETURN", KEYCODE_RETURN, ASCII_RETURN, "MCenter", false}, + {"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", false}, + {"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", false}, + {"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", false}, + {"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", false}, + {"HASH", KEYCODE_HASH, '#', "#", false}, + {"DOLLAR", KEYCODE_DOLLAR, '$', "$", false}, + {"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", false}, + {"QUOTE", KEYCODE_QUOTE, '\'', "'", false}, + {"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", false}, + {"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", false}, + {"ASTERISK", KEYCODE_ASTERISK, '*', "*", false}, + {"PLUS", KEYCODE_PLUS, '+', "+", false}, + {"COMMA", KEYCODE_COMMA, ',', ",", false}, + {"MINUS", KEYCODE_MINUS, '-', "-", false}, + {"PERIOD", KEYCODE_PERIOD, '.', ".", false}, + {"SLASH", KEYCODE_SLASH, '/', "/", false}, + {"0", KEYCODE_0, '0', "0", false}, + {"1", KEYCODE_1, '1', "1", false}, + {"2", KEYCODE_2, '2', "2", false}, + {"3", KEYCODE_3, '3', "3", false}, + {"4", KEYCODE_4, '4', "4", false}, + {"5", KEYCODE_5, '5', "5", false}, + {"6", KEYCODE_6, '6', "6", false}, + {"7", KEYCODE_7, '7', "7", false}, + {"8", KEYCODE_8, '8', "8", false}, + {"9", KEYCODE_9, '9', "9", false}, + {"COLON", KEYCODE_COLON, ':', ":", false}, + {"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", false}, + {"LESS", KEYCODE_LESS, '<', "<", false}, + {"EQUALS", KEYCODE_EQUALS, '=', "=", false}, + {"GREATER", KEYCODE_GREATER, '>', ">", false}, + {"QUESTION", KEYCODE_QUESTION, '?', "?", false}, + {"AT", KEYCODE_AT, '@', "@", false}, + + {"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", false}, + {"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", false}, + {"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", false}, + {"CARET", KEYCODE_CARET, '^', "^", false}, + {"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", false}, + {"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", false}, + {"a", KEYCODE_a, 'a', "a", true}, + {"b", KEYCODE_b, 'b', "b", true}, + {"c", KEYCODE_c, 'c', "c", true}, + {"d", KEYCODE_d, 'd', "d", true}, + {"e", KEYCODE_e, 'e', "e", true}, + {"f", KEYCODE_f, 'f', "f", true}, + {"g", KEYCODE_g, 'g', "g", true}, + {"h", KEYCODE_h, 'h', "h", true}, + {"i", KEYCODE_i, 'i', "i", true}, + {"j", KEYCODE_j, 'j', "j", true}, + {"k", KEYCODE_k, 'k', "k", true}, + {"l", KEYCODE_l, 'l', "l", true}, + {"m", KEYCODE_m, 'm', "m", true}, + {"n", KEYCODE_n, 'n', "n", true}, + {"o", KEYCODE_o, 'o', "o", true}, + {"p", KEYCODE_p, 'p', "p", true}, + {"q", KEYCODE_q, 'q', "q", true}, + {"r", KEYCODE_r, 'r', "r", true}, + {"s", KEYCODE_s, 's', "s", true}, + {"t", KEYCODE_t, 't', "t", true}, + {"u", KEYCODE_u, 'u', "u", true}, + {"v", KEYCODE_v, 'v', "v", true}, + {"w", KEYCODE_w, 'w', "w", true}, + {"x", KEYCODE_x, 'x', "x", true}, + {"y", KEYCODE_y, 'y', "y", true}, + {"z", KEYCODE_z, 'z', "z", true}, + {"DELETE", KEYCODE_DELETE, 0, "Del", false}, + + {"KP_ENTER", KEYCODE_KP_ENTER, 0, "Enter", false}, // Arrows + Home/End pad - {"UP", KEYCODE_UP, 0, "Up", kDirUpKeyType, false}, - {"DOWN", KEYCODE_DOWN, 0, "Down", kDirDownKeyType, false}, - {"RIGHT", KEYCODE_RIGHT, 0, "Right", kDirRightKeyType, false}, - {"LEFT", KEYCODE_LEFT, 0, "Left", kDirLeftKeyType, false}, + {"UP", KEYCODE_UP, 0, "Up", false}, + {"DOWN", KEYCODE_DOWN, 0, "Down", false}, + {"RIGHT", KEYCODE_RIGHT, 0, "Right", false}, + {"LEFT", KEYCODE_LEFT, 0, "Left", false}, // Function keys - {"F1", KEYCODE_F1, ASCII_F1, "F1", kActionKeyType, false}, - {"F2", KEYCODE_F2, ASCII_F2, "F2", kActionKeyType, false}, - {"F3", KEYCODE_F3, ASCII_F3, "F3", kActionKeyType, false}, - {"F4", KEYCODE_F4, ASCII_F4, "Menu", kActionKeyType, false}, - {"F5", KEYCODE_F5, ASCII_F5, "Home", kActionKeyType, false}, - {"F6", KEYCODE_F6, ASCII_F6, "FullScreen", kActionKeyType, false}, - {"F7", KEYCODE_F7, ASCII_F7, "Zoom+", kActionKeyType, false}, - {"F8", KEYCODE_F8, ASCII_F8, "Zoom-", kActionKeyType, false}, - {"F9", KEYCODE_F9, ASCII_F9, "F9", kActionKeyType, false}, - - {0, KEYCODE_INVALID, 0, 0, kGenericKeyType, false} -}; + {"MENU", KEYCODE_F11, 0, "Menu", false}, + {"HOME", KEYCODE_F12, 0, "Home", false}, + {"FULLSCREEN", KEYCODE_F13, 0, "FullScreen", false}, + {"ZOOMPLUS", KEYCODE_F14, 0, "Zoom+", false}, + {"ZOOMMINUS", KEYCODE_F15, 0, "Zoom-", false}, + {0, KEYCODE_INVALID, 0, 0, false} +}; } // namespace Common diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp index 77d630fc30..209e527e3f 100644 --- a/backends/platform/maemo/maemo.cpp +++ b/backends/platform/maemo/maemo.cpp @@ -32,6 +32,7 @@ #include "backends/events/maemosdl/maemosdl-events.h" #include "backends/graphics/maemosdl/maemosdl-graphics.h" #include "backends/keymapper/keymapper.h" +#include "backends/keymapper/keymapper-defaults.h" #include "common/textconsole.h" #include "common/translation.h" @@ -48,8 +49,41 @@ OSystem_SDL_Maemo::OSystem_SDL_Maemo() OSystem_SDL_Maemo::~OSystem_SDL_Maemo() { delete _eventObserver; +#ifdef ENABLE_KEYMAPPER + delete _keymapperDefaultBindings; +#endif } +#ifdef ENABLE_KEYMAPPER +static void registerDefaultKeyBindings(Common::KeymapperDefaultBindings *_keymapperDefaultBindings, Model _model) { + _keymapperDefaultBindings->setDefaultBinding("gui", "REM", "HOME"); + _keymapperDefaultBindings->setDefaultBinding("global", "REM", "HOME"); + + if (_model.hasMenuKey && _model.hasHwKeyboard) { + _keymapperDefaultBindings->setDefaultBinding("gui", "FUL", "FULLSCREEN"); + _keymapperDefaultBindings->setDefaultBinding("global", "FUL", "FULLSCREEN"); + } + + if (_model.hasHwKeyboard) { + _keymapperDefaultBindings->setDefaultBinding("gui", "VIR", "C+ZOOMMINUS"); + _keymapperDefaultBindings->setDefaultBinding("global", "VIR", "C+ZOOMMINUS"); + } else { + _keymapperDefaultBindings->setDefaultBinding("gui", "VIR", "FULLSCREEN"); + _keymapperDefaultBindings->setDefaultBinding("global", "VIR", "FULLSCREEN"); + } + + if (_model.hasMenuKey ) + _keymapperDefaultBindings->setDefaultBinding("global", "MEN", "MENU"); + else + _keymapperDefaultBindings->setDefaultBinding("global", "MEN", "S+C+M"); + + _keymapperDefaultBindings->setDefaultBinding("gui", "CLO", "ESCAPE"); + + _keymapperDefaultBindings->setDefaultBinding("maemo", "RCL", "ZOOMPLUS"); + _keymapperDefaultBindings->setDefaultBinding("maemo", "CLK", "ZOOMMINUS"); +} +#endif + void OSystem_SDL_Maemo::initBackend() { // Create the events manager if (_eventSource == 0) @@ -61,9 +95,18 @@ void OSystem_SDL_Maemo::initBackend() { if (_eventObserver == 0) _eventObserver = new MaemoSdlEventObserver((MaemoSdlEventSource *)_eventSource); +#ifdef ENABLE_KEYMAPPER + if (_keymapperDefaultBindings == 0) + _keymapperDefaultBindings = new Common::KeymapperDefaultBindings(); +#endif + ConfMan.set("vkeybdpath", DATA_PATH); - _model = Model(detectModel()); + _model = detectModel(); + +#ifdef ENABLE_KEYMAPPER + registerDefaultKeyBindings(_keymapperDefaultBindings, _model); +#endif // Call parent implementation of this method OSystem_POSIX::initBackend(); @@ -146,13 +189,13 @@ Common::Keymap *OSystem_SDL_Maemo::getGlobalKeymap() { evt.customType = Maemo::kEventClickMode; act->addEvent(evt); - act = new Action(globalMap, "LCLK", _("Left Click"), kLeftClickActionType); + act = new Action(globalMap, "LCLK", _("Left Click")); act->addLeftClickEvent(); act = new Action(globalMap, "MCLK", _("Middle Click")); act->addMiddleClickEvent(); - act = new Action(globalMap, "RCLK", _("Right Click"), kRightClickActionType); + act = new Action(globalMap, "RCLK", _("Right Click")); act->addRightClickEvent(); return globalMap; diff --git a/backends/platform/maemo/maemo.h b/backends/platform/maemo/maemo.h index 382770219b..4b84ae573a 100644 --- a/backends/platform/maemo/maemo.h +++ b/backends/platform/maemo/maemo.h @@ -44,6 +44,7 @@ public: #ifdef ENABLE_KEYMAPPER virtual Common::HardwareKeySet *getHardwareKeySet(); virtual Common::Keymap *getGlobalKeymap(); + virtual Common::KeymapperDefaultBindings *getKeymapperDefaultBindings() { return _keymapperDefaultBindings; } #endif Model getModel() { return _model; } @@ -55,6 +56,9 @@ private: const Model detectModel(); Model _model; MaemoSdlEventObserver *_eventObserver; +#ifdef ENABLE_KEYMAPPER + Common::KeymapperDefaultBindings *_keymapperDefaultBindings; +#endif }; } // namespace Maemo diff --git a/backends/platform/n64/osys_n64_utilities.cpp b/backends/platform/n64/osys_n64_utilities.cpp index 94d727e421..f007a1bd25 100644 --- a/backends/platform/n64/osys_n64_utilities.cpp +++ b/backends/platform/n64/osys_n64_utilities.cpp @@ -100,9 +100,9 @@ void refillAudioBuffers(void) { Audio::MixerImpl *localmixer = (Audio::MixerImpl *)osys->getMixer(); while (_requiredSoundSlots) { - sndBuf = (byte*)getAIBuffer(); + sndBuf = (byte *)getAIBuffer(); - localmixer->mixCallback((byte*)sndBuf, osys->_audioBufferSize); + localmixer->mixCallback((byte *)sndBuf, osys->_audioBufferSize); putAIBuffer(); diff --git a/backends/platform/ps2/DmaPipe.cpp b/backends/platform/ps2/DmaPipe.cpp index c6f6ab72ac..a346a67566 100644 --- a/backends/platform/ps2/DmaPipe.cpp +++ b/backends/platform/ps2/DmaPipe.cpp @@ -48,7 +48,7 @@ private: DmaPipe::DmaPipe(uint32 size) { size &= ~0x1F; - _buf = (uint64*)memalign(64, size); + _buf = (uint64 *)memalign(64, size); _curPipe = 0; _pipes[0] = new SinglePipe(_buf, size >> 4); _pipes[1] = new SinglePipe(_buf + (size >> 4), size >> 4); @@ -260,7 +260,7 @@ void SinglePipe::init(void) { _buf[0] = 0x0000000070000000; _buf[1] = 0; _chainHead = _buf; - _chainSize = (uint16*)_chainHead; + _chainSize = (uint16 *)_chainHead; _bufPos = _buf + 2; } @@ -272,7 +272,7 @@ void SinglePipe::appendChain(uint64 dmaTag) { _chainHead = _bufPos; _chainHead[0] = dmaTag; _chainHead[1] = 0; - _chainSize = (uint16*)_chainHead; + _chainSize = (uint16 *)_chainHead; _bufPos += 2; } diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp index b70e8b13fa..8df6198c38 100644 --- a/backends/platform/ps2/Gs2dScreen.cpp +++ b/backends/platform/ps2/Gs2dScreen.cpp @@ -130,9 +130,9 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) { _height = height; _pitch = (width + 127) & ~127; - _screenBuf = (uint8*)memalign(64, _width * _height); - _overlayBuf = (uint16*)memalign(64, _width * _height * 2); - _clut = (uint32*)memalign(64, 256 * 4); + _screenBuf = (uint8 *)memalign(64, _width * _height); + _overlayBuf = (uint16 *)memalign(64, _width * _height * 2); + _clut = (uint32 *)memalign(64, 256 * 4); memset(_screenBuf, 0, _width * _height); memset(_clut, 0, 256 * sizeof(uint32)); @@ -291,11 +291,11 @@ void Gs2dScreen::quit(void) { } void Gs2dScreen::createAnimTextures(void) { - uint8 *buf = (uint8*)memalign(64, 16 * 64); + uint8 *buf = (uint8 *)memalign(64, 16 * 64); memset(buf, 0, 16 * 64); uint32 vramDest = _texPtrs[TEXT]; for (int i = 0; i < 16; i++) { - uint32 *destPos = (uint32*)buf; + uint32 *destPos = (uint32 *)buf; for (int ch = 15; ch >= 0; ch--) { const uint32 *src = (const uint32*)(_binaryData + ((_binaryPattern[i] >> ch) & 1) * 4 * 14); for (int line = 0; line < 14; line++) @@ -331,8 +331,8 @@ void Gs2dScreen::newScreenSize(uint16 width, uint16 height) { // malloc new buffers free(_screenBuf); free(_overlayBuf); - _screenBuf = (uint8*)memalign(64, _width * _height); - _overlayBuf = (uint16*)memalign(64, _width * _height * 2); + _screenBuf = (uint8 *)memalign(64, _width * _height); + _overlayBuf = (uint16 *)memalign(64, _width * _height * 2); memset(_screenBuf, 0, _width * height); memset(_overlayBuf, 0, _width * height * 2); memset(_clut, 0, 256 * sizeof(uint32)); @@ -556,7 +556,7 @@ void Gs2dScreen::copyPrintfOverlay(const uint8 *buf) { } void Gs2dScreen::clearPrintfOverlay(void) { - uint8 *tmpBuf = (uint8*)memalign(64, 320 * 200); + uint8 *tmpBuf = (uint8 *)memalign(64, 320 * 200); memset(tmpBuf, 4, 320 * 200); _dmaPipe->uploadTex(_texPtrs[PRINTF], 3 * 128, 0, 0, GS_PSMT8H, tmpBuf, 320, 200); _dmaPipe->flush(); @@ -619,7 +619,7 @@ void Gs2dScreen::setMouseOverlay(const uint8 *buf, uint16 width, uint16 height, _mTraCol = transpCol; _clutChanged = true; } - uint8 *bufCopy = (uint8*)memalign(64, M_SIZE * M_SIZE); // make a copy to align to 64 bytes + uint8 *bufCopy = (uint8 *)memalign(64, M_SIZE * M_SIZE); // make a copy to align to 64 bytes memset(bufCopy, _mTraCol, M_SIZE * M_SIZE); for (int cnt = 0; cnt < height; cnt++) memcpy(bufCopy + cnt * M_SIZE, buf + cnt * width, width); diff --git a/backends/platform/ps2/fileio.cpp b/backends/platform/ps2/fileio.cpp index ef01f3a693..1ec16a3817 100644 --- a/backends/platform/ps2/fileio.cpp +++ b/backends/platform/ps2/fileio.cpp @@ -52,7 +52,7 @@ Ps2File::Ps2File() { _eof = false; _err = false; - _cacheBuf = (uint8*)memalign(64, CACHE_SIZE * 2); + _cacheBuf = (uint8 *)memalign(64, CACHE_SIZE * 2); _cacheOpRunning = 0; _filePos = _physFilePos = _cachePos = 0; @@ -362,7 +362,7 @@ uint32 Ps2File::read(void *dest, uint32 len) { _eof = true; } - uint8 *destBuf = (uint8*)dest; + uint8 *destBuf = (uint8 *)dest; if ((_filePos < _cachePos) || (_filePos + len > _cachePos + _bytesInCache)) cacheReadSync(); // we have to read from CD, sync cache. @@ -413,7 +413,7 @@ uint32 Ps2File::read(void *dest, uint32 len) { #ifdef __PS2_FILE_SEMA__ SignalSema(_sema); #endif - return destBuf - (uint8*)dest; + return destBuf - (uint8 *)dest; } uint32 Ps2File::write(const void *src, uint32 len) { @@ -518,7 +518,7 @@ FILE *ps2_fopen(const char *fname, const char *mode) { } int ps2_fclose(FILE *stream) { - Ps2File *file = (Ps2File*)stream; + Ps2File *file = (Ps2File *)stream; delete file; @@ -528,10 +528,10 @@ int ps2_fclose(FILE *stream) { size_t ps2_fread(void *buf, size_t r, size_t n, FILE *stream) { assert(r != 0); - return ((Ps2File*)stream)->read(buf, r * n) / r; + return ((Ps2File *)stream)->read(buf, r * n) / r; } size_t ps2_fwrite(const void *buf, size_t r, size_t n, FILE *stream) { assert(r != 0); - return ((Ps2File*)stream)->write(buf, r * n) / r; + return ((Ps2File *)stream)->write(buf, r * n) / r; } diff --git a/backends/platform/ps2/icon.cpp b/backends/platform/ps2/icon.cpp index 9852e6d40b..bda4843647 100644 --- a/backends/platform/ps2/icon.cpp +++ b/backends/platform/ps2/icon.cpp @@ -960,13 +960,13 @@ void PS2Icon::setup(mcIcon *icon) { memcpy(icon->head, "PS2D", 4); icon->nlOffset = strlen(_info) + 1; strcpy(title, _info); - strcpy_sjis((short*)&(icon->title), title); + strcpy_sjis((short *)&(icon->title), title); icon->trans = 0x10; memcpy(icon->bgCol, _bgcolor, sizeof(_bgcolor)); memcpy(icon->lightDir, _lightdir, sizeof(_lightdir)); memcpy(icon->lightCol, _lightcol, sizeof(_lightcol)); memcpy(icon->lightAmbient, _ambient, sizeof(_ambient)); - strcpy((char*)icon->view, "scummvm.icn"); - strcpy((char*)icon->copy, "scummvm.icn"); - strcpy((char*)icon->del, "scummvm.icn"); + strcpy((char *)icon->view, "scummvm.icn"); + strcpy((char *)icon->copy, "scummvm.icn"); + strcpy((char *)icon->del, "scummvm.icn"); } diff --git a/backends/platform/ps2/ps2mutex.cpp b/backends/platform/ps2/ps2mutex.cpp index 5b30fa7862..ae63fe5724 100644 --- a/backends/platform/ps2/ps2mutex.cpp +++ b/backends/platform/ps2/ps2mutex.cpp @@ -57,7 +57,7 @@ OSystem::MutexRef OSystem_PS2::createMutex(void) { void OSystem_PS2::lockMutex(MutexRef mutex) { WaitSema(_mutexSema); - Ps2Mutex *sysMutex = (Ps2Mutex*)mutex; + Ps2Mutex *sysMutex = (Ps2Mutex *)mutex; int tid = GetThreadId(); assert(tid != 0); @@ -75,7 +75,7 @@ void OSystem_PS2::lockMutex(MutexRef mutex) { void OSystem_PS2::unlockMutex(MutexRef mutex) { WaitSema(_mutexSema); - Ps2Mutex *sysMutex = (Ps2Mutex*)mutex; + Ps2Mutex *sysMutex = (Ps2Mutex *)mutex; int tid = GetThreadId(); if (sysMutex->owner && sysMutex->count && (sysMutex->owner == tid)) @@ -90,7 +90,7 @@ void OSystem_PS2::unlockMutex(MutexRef mutex) { void OSystem_PS2::deleteMutex(MutexRef mutex) { WaitSema(_mutexSema); - Ps2Mutex *sysMutex = (Ps2Mutex*)mutex; + Ps2Mutex *sysMutex = (Ps2Mutex *)mutex; if (sysMutex->owner || sysMutex->count) printf("WARNING: Deleting LOCKED mutex!\n"); DeleteSema(sysMutex->sema); diff --git a/backends/platform/ps2/ps2pad.cpp b/backends/platform/ps2/ps2pad.cpp index eeb9dfbd93..b6afc217e6 100644 --- a/backends/platform/ps2/ps2pad.cpp +++ b/backends/platform/ps2/ps2pad.cpp @@ -30,7 +30,7 @@ Ps2Pad::Ps2Pad(OSystem_PS2 *system) { _system = system; - _padBuf = (uint8*)memalign(64, 256); + _padBuf = (uint8 *)memalign(64, 256); _padStatus = STAT_NONE; padInit(0); // initialize library diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index 481227dd02..d4e993da63 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -384,8 +384,8 @@ void OSystem_PS2::initTimer(void) { ee_thread_t timerThread, soundThread, thisThread; ReferThreadStatus(GetThreadId(), &thisThread); - _timerStack = (uint8*)malloc(TIMER_STACK_SIZE); - _soundStack = (uint8*)malloc(SOUND_STACK_SIZE); + _timerStack = (uint8 *)malloc(TIMER_STACK_SIZE); + _soundStack = (uint8 *)malloc(SOUND_STACK_SIZE); // give timer thread a higher priority than main thread timerThread.initial_priority = thisThread.current_priority - 1; @@ -435,7 +435,7 @@ void OSystem_PS2::timerThreadCallback(void) { } void OSystem_PS2::soundThreadCallback(void) { - int16 *soundBufL = (int16*)memalign(64, SMP_PER_BLOCK * sizeof(int16) * 2); + int16 *soundBufL = (int16 *)memalign(64, SMP_PER_BLOCK * sizeof(int16) * 2); int16 *soundBufR = soundBufL + SMP_PER_BLOCK; int bufferedSamples = 0; @@ -453,9 +453,9 @@ void OSystem_PS2::soundThreadCallback(void) { if (bufferedSamples <= 8 * SMP_PER_BLOCK) { // we have to produce more samples, call sound mixer // the scratchpad at 0x70000000 is used as temporary soundbuffer - //_scummSoundProc(_scummSoundParam, (uint8*)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16)); - // Audio::Mixer::mixCallback(_scummMixer, (byte*)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16)); - _scummMixer->mixCallback((byte*)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16)); + //_scummSoundProc(_scummSoundParam, (uint8 *)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16)); + // Audio::Mixer::mixCallback(_scummMixer, (byte *)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16)); + _scummMixer->mixCallback((byte *)0x70000000, SMP_PER_BLOCK * 2 * sizeof(int16)); // demux data into 2 buffers, L and R __asm__ ( @@ -635,7 +635,7 @@ void OSystem_PS2::clearOverlay(void) { } void OSystem_PS2::grabOverlay(OverlayColor *buf, int pitch) { - _screen->grabOverlay((uint16*)buf, (uint16)pitch); + _screen->grabOverlay((uint16 *)buf, (uint16)pitch); } void OSystem_PS2::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { @@ -738,12 +738,12 @@ void OSystem_PS2::msgPrintf(int millis, const char *format, ...) { lnSta = lnEnd + 1; } - uint8 *scrBuf = (uint8*)memalign(64, 320 * 200); + uint8 *scrBuf = (uint8 *)memalign(64, 320 * 200); memset(scrBuf, 4, 320 * 200); uint8 *dstPos = scrBuf + ((200 - posY) >> 1) * 320 + (320 - maxWidth) / 2; for (int y = 0; y < posY; y++) { - uint8 *srcPos = (uint8*)surf.getBasePtr((300 - maxWidth) / 2, y); + uint8 *srcPos = (uint8 *)surf.getBasePtr((300 - maxWidth) / 2, y); for (int x = 0; x < maxWidth; x++) dstPos[x] = srcPos[x] + 5; dstPos += 320; diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp index cdb130e2a0..10a732b1e3 100644 --- a/backends/platform/psp/display_manager.cpp +++ b/backends/platform/psp/display_manager.cpp @@ -210,14 +210,14 @@ void MasterGuRenderer::guProgramDisplayBufferSizes() { switch (GuRenderer::_displayManager->getOutputBitsPerPixel()) { case 16: sceGuDrawBuffer(GU_PSM_4444, (void *)0, PSP_BUFFER_WIDTH); - sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, (void*)(PSP_FRAME_SIZE * sizeof(uint16)), PSP_BUFFER_WIDTH); - sceGuDepthBuffer((void*)(PSP_FRAME_SIZE * sizeof(uint16) * 2), PSP_BUFFER_WIDTH); + sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, (void *)(PSP_FRAME_SIZE * sizeof(uint16)), PSP_BUFFER_WIDTH); + sceGuDepthBuffer((void *)(PSP_FRAME_SIZE * sizeof(uint16) * 2), PSP_BUFFER_WIDTH); VramAllocator::instance().allocate(PSP_FRAME_SIZE * sizeof(uint16) * 2); break; case 32: sceGuDrawBuffer(GU_PSM_8888, (void *)0, PSP_BUFFER_WIDTH); - sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, (void*)(PSP_FRAME_SIZE * sizeof(uint32)), PSP_BUFFER_WIDTH); - sceGuDepthBuffer((void*)(PSP_FRAME_SIZE * sizeof(uint32) * 2), PSP_BUFFER_WIDTH); + sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, (void *)(PSP_FRAME_SIZE * sizeof(uint32)), PSP_BUFFER_WIDTH); + sceGuDepthBuffer((void *)(PSP_FRAME_SIZE * sizeof(uint32) * 2), PSP_BUFFER_WIDTH); VramAllocator::instance().allocate(PSP_FRAME_SIZE * sizeof(uint32) * 2); break; } diff --git a/backends/platform/sdl/hardwarekeys.cpp b/backends/platform/sdl/hardwarekeys.cpp index 1469698a8b..5fb4473ebd 100644 --- a/backends/platform/sdl/hardwarekeys.cpp +++ b/backends/platform/sdl/hardwarekeys.cpp @@ -29,139 +29,139 @@ using namespace Common; static const KeyTableEntry sdlKeys[] = { - {"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", kActionKeyType, false}, - {"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", kActionKeyType, false}, - {"CLEAR", KEYCODE_CLEAR, 0, "Clear", kActionKeyType, false}, - {"RETURN", KEYCODE_RETURN, ASCII_RETURN, "Return", kActionKeyType, false}, - {"PAUSE", KEYCODE_PAUSE, 0, "Pause", kActionKeyType, false}, - {"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", kStartKeyType, false}, - {"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", kActionKeyType, false}, - {"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", kActionKeyType, false}, - {"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", kActionKeyType, false}, - {"HASH", KEYCODE_HASH, '#', "#", kActionKeyType, false}, - {"DOLLAR", KEYCODE_DOLLAR, '$', "$", kActionKeyType, false}, - {"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", kActionKeyType, false}, - {"QUOTE", KEYCODE_QUOTE, '\'', "'", kActionKeyType, false}, - {"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", kActionKeyType, false}, - {"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", kActionKeyType, false}, - {"ASTERISK", KEYCODE_ASTERISK, '*', "*", kActionKeyType, false}, - {"PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, false}, - {"COMMA", KEYCODE_COMMA, ',', ",", kActionKeyType, false}, - {"MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, false}, - {"PERIOD", KEYCODE_PERIOD, '.', ".", kActionKeyType, false}, - {"SLASH", KEYCODE_SLASH, '/', "/", kActionKeyType, false}, - {"0", KEYCODE_0, '0', "0", kActionKeyType, false}, - {"1", KEYCODE_1, '1', "1", kActionKeyType, false}, - {"2", KEYCODE_2, '2', "2", kActionKeyType, false}, - {"3", KEYCODE_3, '3', "3", kActionKeyType, false}, - {"4", KEYCODE_4, '4', "4", kActionKeyType, false}, - {"5", KEYCODE_5, '5', "5", kActionKeyType, false}, - {"6", KEYCODE_6, '6', "6", kActionKeyType, false}, - {"7", KEYCODE_7, '7', "7", kActionKeyType, false}, - {"8", KEYCODE_8, '8', "8", kActionKeyType, false}, - {"9", KEYCODE_9, '9', "9", kActionKeyType, false}, - {"COLON", KEYCODE_COLON, ':', ":", kActionKeyType, false}, - {"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", kActionKeyType, false}, - {"LESS", KEYCODE_LESS, '<', "<", kActionKeyType, false}, - {"EQUALS", KEYCODE_EQUALS, '=', "=", kActionKeyType, false}, - {"GREATER", KEYCODE_GREATER, '>', ">", kActionKeyType, false}, - {"QUESTION", KEYCODE_QUESTION, '?', "?", kActionKeyType, false}, - {"AT", KEYCODE_AT, '@', "@", kActionKeyType, false}, + {"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", false}, + {"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", false}, + {"CLEAR", KEYCODE_CLEAR, 0, "Clear", false}, + {"RETURN", KEYCODE_RETURN, ASCII_RETURN, "Return", false}, + {"PAUSE", KEYCODE_PAUSE, 0, "Pause", false}, + {"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", false}, + {"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", false}, + {"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", false}, + {"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", false}, + {"HASH", KEYCODE_HASH, '#', "#", false}, + {"DOLLAR", KEYCODE_DOLLAR, '$', "$", false}, + {"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", false}, + {"QUOTE", KEYCODE_QUOTE, '\'', "'", false}, + {"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", false}, + {"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", false}, + {"ASTERISK", KEYCODE_ASTERISK, '*', "*", false}, + {"PLUS", KEYCODE_PLUS, '+', "+", false}, + {"COMMA", KEYCODE_COMMA, ',', ",", false}, + {"MINUS", KEYCODE_MINUS, '-', "-", false}, + {"PERIOD", KEYCODE_PERIOD, '.', ".", false}, + {"SLASH", KEYCODE_SLASH, '/', "/", false}, + {"0", KEYCODE_0, '0', "0", false}, + {"1", KEYCODE_1, '1', "1", false}, + {"2", KEYCODE_2, '2', "2", false}, + {"3", KEYCODE_3, '3', "3", false}, + {"4", KEYCODE_4, '4', "4", false}, + {"5", KEYCODE_5, '5', "5", false}, + {"6", KEYCODE_6, '6', "6", false}, + {"7", KEYCODE_7, '7', "7", false}, + {"8", KEYCODE_8, '8', "8", false}, + {"9", KEYCODE_9, '9', "9", false}, + {"COLON", KEYCODE_COLON, ':', ":", false}, + {"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", false}, + {"LESS", KEYCODE_LESS, '<', "<", false}, + {"EQUALS", KEYCODE_EQUALS, '=', "=", false}, + {"GREATER", KEYCODE_GREATER, '>', ">", false}, + {"QUESTION", KEYCODE_QUESTION, '?', "?", false}, + {"AT", KEYCODE_AT, '@', "@", false}, - {"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", kActionKeyType, false}, - {"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", kActionKeyType, false}, - {"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", kActionKeyType, false}, - {"CARET", KEYCODE_CARET, '^', "^", kActionKeyType, false}, - {"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", kActionKeyType, false}, - {"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", kActionKeyType, false}, - {"a", KEYCODE_a, 'a', "a", kActionKeyType, true}, - {"b", KEYCODE_b, 'b', "b", kActionKeyType, true}, - {"c", KEYCODE_c, 'c', "c", kActionKeyType, true}, - {"d", KEYCODE_d, 'd', "d", kActionKeyType, true}, - {"e", KEYCODE_e, 'e', "e", kActionKeyType, true}, - {"f", KEYCODE_f, 'f', "f", kActionKeyType, true}, - {"g", KEYCODE_g, 'g', "g", kActionKeyType, true}, - {"h", KEYCODE_h, 'h', "h", kActionKeyType, true}, - {"i", KEYCODE_i, 'i', "i", kActionKeyType, true}, - {"j", KEYCODE_j, 'j', "j", kActionKeyType, true}, - {"k", KEYCODE_k, 'k', "k", kActionKeyType, true}, - {"l", KEYCODE_l, 'l', "l", kActionKeyType, true}, - {"m", KEYCODE_m, 'm', "m", kActionKeyType, true}, - {"n", KEYCODE_n, 'n', "n", kActionKeyType, true}, - {"o", KEYCODE_o, 'o', "o", kActionKeyType, true}, - {"p", KEYCODE_p, 'p', "p", kActionKeyType, true}, - {"q", KEYCODE_q, 'q', "q", kActionKeyType, true}, - {"r", KEYCODE_r, 'r', "r", kActionKeyType, true}, - {"s", KEYCODE_s, 's', "s", kActionKeyType, true}, - {"t", KEYCODE_t, 't', "t", kActionKeyType, true}, - {"u", KEYCODE_u, 'u', "u", kActionKeyType, true}, - {"v", KEYCODE_v, 'v', "v", kActionKeyType, true}, - {"w", KEYCODE_w, 'w', "w", kActionKeyType, true}, - {"x", KEYCODE_x, 'x', "x", kActionKeyType, true}, - {"y", KEYCODE_y, 'y', "y", kActionKeyType, true}, - {"z", KEYCODE_z, 'z', "z", kActionKeyType, true}, - {"DELETE", KEYCODE_DELETE, 0, "Del", kActionKeyType, false}, + {"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", false}, + {"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", false}, + {"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", false}, + {"CARET", KEYCODE_CARET, '^', "^", false}, + {"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", false}, + {"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", false}, + {"a", KEYCODE_a, 'a', "a", true}, + {"b", KEYCODE_b, 'b', "b", true}, + {"c", KEYCODE_c, 'c', "c", true}, + {"d", KEYCODE_d, 'd', "d", true}, + {"e", KEYCODE_e, 'e', "e", true}, + {"f", KEYCODE_f, 'f', "f", true}, + {"g", KEYCODE_g, 'g', "g", true}, + {"h", KEYCODE_h, 'h', "h", true}, + {"i", KEYCODE_i, 'i', "i", true}, + {"j", KEYCODE_j, 'j', "j", true}, + {"k", KEYCODE_k, 'k', "k", true}, + {"l", KEYCODE_l, 'l', "l", true}, + {"m", KEYCODE_m, 'm', "m", true}, + {"n", KEYCODE_n, 'n', "n", true}, + {"o", KEYCODE_o, 'o', "o", true}, + {"p", KEYCODE_p, 'p', "p", true}, + {"q", KEYCODE_q, 'q', "q", true}, + {"r", KEYCODE_r, 'r', "r", true}, + {"s", KEYCODE_s, 's', "s", true}, + {"t", KEYCODE_t, 't', "t", true}, + {"u", KEYCODE_u, 'u', "u", true}, + {"v", KEYCODE_v, 'v', "v", true}, + {"w", KEYCODE_w, 'w', "w", true}, + {"x", KEYCODE_x, 'x', "x", true}, + {"y", KEYCODE_y, 'y', "y", true}, + {"z", KEYCODE_z, 'z', "z", true}, + {"DELETE", KEYCODE_DELETE, 0, "Del", false}, // Numeric keypad - {"KP0", KEYCODE_KP0, 0, "KP0", kActionKeyType, false}, - {"KP1", KEYCODE_KP1, 0, "KP1", kActionKeyType, false}, - {"KP2", KEYCODE_KP2, 0, "KP2", kActionKeyType, false}, - {"KP3", KEYCODE_KP3, 0, "KP3", kActionKeyType, false}, - {"KP4", KEYCODE_KP4, 0, "KP4", kActionKeyType, false}, - {"KP5", KEYCODE_KP5, 0, "KP5", kActionKeyType, false}, - {"KP6", KEYCODE_KP6, 0, "KP6", kActionKeyType, false}, - {"KP7", KEYCODE_KP7, 0, "KP7", kActionKeyType, false}, - {"KP8", KEYCODE_KP8, 0, "KP8", kActionKeyType, false}, - {"KP9", KEYCODE_KP9, 0, "KP9", kActionKeyType, false}, - {"KP_PERIOD", KEYCODE_KP_PERIOD, 0, "KP.", kActionKeyType, false}, - {"KP_DIVIDE", KEYCODE_KP_DIVIDE, 0, "KP/", kActionKeyType, false}, - {"KP_MULTIPLY", KEYCODE_KP_MULTIPLY, 0, "KP*", kActionKeyType, false}, - {"KP_MINUS", KEYCODE_KP_MINUS, 0, "KP-", kActionKeyType, false}, - {"KP_PLUS", KEYCODE_KP_PLUS, 0, "KP+", kActionKeyType, false}, - {"KP_ENTER", KEYCODE_KP_ENTER, 0, "KP Enter", kActionKeyType, false}, - {"KP_EQUALS", KEYCODE_KP_EQUALS, 0, "KP=", kActionKeyType, false}, + {"KP0", KEYCODE_KP0, 0, "KP0", false}, + {"KP1", KEYCODE_KP1, 0, "KP1", false}, + {"KP2", KEYCODE_KP2, 0, "KP2", false}, + {"KP3", KEYCODE_KP3, 0, "KP3", false}, + {"KP4", KEYCODE_KP4, 0, "KP4", false}, + {"KP5", KEYCODE_KP5, 0, "KP5", false}, + {"KP6", KEYCODE_KP6, 0, "KP6", false}, + {"KP7", KEYCODE_KP7, 0, "KP7", false}, + {"KP8", KEYCODE_KP8, 0, "KP8", false}, + {"KP9", KEYCODE_KP9, 0, "KP9", false}, + {"KP_PERIOD", KEYCODE_KP_PERIOD, 0, "KP.", false}, + {"KP_DIVIDE", KEYCODE_KP_DIVIDE, 0, "KP/", false}, + {"KP_MULTIPLY", KEYCODE_KP_MULTIPLY, 0, "KP*", false}, + {"KP_MINUS", KEYCODE_KP_MINUS, 0, "KP-", false}, + {"KP_PLUS", KEYCODE_KP_PLUS, 0, "KP+", false}, + {"KP_ENTER", KEYCODE_KP_ENTER, 0, "KP Enter", false}, + {"KP_EQUALS", KEYCODE_KP_EQUALS, 0, "KP=", false}, // Arrows + Home/End pad - {"UP", KEYCODE_UP, 0, "Up", kDirUpKeyType, false}, - {"DOWN", KEYCODE_DOWN, 0, "Down", kDirDownKeyType, false}, - {"RIGHT", KEYCODE_RIGHT, 0, "Right", kDirRightKeyType, false}, - {"LEFT", KEYCODE_LEFT, 0, "Left", kDirLeftKeyType, false}, - {"INSERT", KEYCODE_INSERT, 0, "Insert", kActionKeyType, false}, - {"HOME", KEYCODE_HOME, 0, "Home", kActionKeyType, false}, - {"END", KEYCODE_END, 0, "End", kActionKeyType, false}, - {"PAGEUP", KEYCODE_PAGEUP, 0, "PgUp", kActionKeyType, false}, - {"PAGEDOWN", KEYCODE_PAGEDOWN, 0, "PgDn", kActionKeyType, false}, + {"UP", KEYCODE_UP, 0, "Up", false}, + {"DOWN", KEYCODE_DOWN, 0, "Down", false}, + {"RIGHT", KEYCODE_RIGHT, 0, "Right", false}, + {"LEFT", KEYCODE_LEFT, 0, "Left", false}, + {"INSERT", KEYCODE_INSERT, 0, "Insert", false}, + {"HOME", KEYCODE_HOME, 0, "Home", false}, + {"END", KEYCODE_END, 0, "End", false}, + {"PAGEUP", KEYCODE_PAGEUP, 0, "PgUp", false}, + {"PAGEDOWN", KEYCODE_PAGEDOWN, 0, "PgDn", false}, // Function keys - {"F1", KEYCODE_F1, ASCII_F1, "F1", kActionKeyType, false}, - {"F2", KEYCODE_F2, ASCII_F2, "F2", kActionKeyType, false}, - {"F3", KEYCODE_F3, ASCII_F3, "F3", kActionKeyType, false}, - {"F4", KEYCODE_F4, ASCII_F4, "F4", kActionKeyType, false}, - {"F5", KEYCODE_F5, ASCII_F5, "F5", kActionKeyType, false}, - {"F6", KEYCODE_F6, ASCII_F6, "F6", kActionKeyType, false}, - {"F7", KEYCODE_F7, ASCII_F7, "F7", kActionKeyType, false}, - {"F8", KEYCODE_F8, ASCII_F8, "F8", kActionKeyType, false}, - {"F9", KEYCODE_F9, ASCII_F9, "F9", kActionKeyType, false}, - {"F10", KEYCODE_F10, ASCII_F10, "F10", kActionKeyType, false}, - {"F11", KEYCODE_F11, ASCII_F11, "F11", kActionKeyType, false}, - {"F12", KEYCODE_F12, ASCII_F12, "F12", kActionKeyType, false}, - {"F13", KEYCODE_F13, 0, "F13", kActionKeyType, false}, - {"F14", KEYCODE_F14, 0, "F14", kActionKeyType, false}, - {"F15", KEYCODE_F15, 0, "F15", kActionKeyType, false}, + {"F1", KEYCODE_F1, ASCII_F1, "F1", false}, + {"F2", KEYCODE_F2, ASCII_F2, "F2", false}, + {"F3", KEYCODE_F3, ASCII_F3, "F3", false}, + {"F4", KEYCODE_F4, ASCII_F4, "F4", false}, + {"F5", KEYCODE_F5, ASCII_F5, "F5", false}, + {"F6", KEYCODE_F6, ASCII_F6, "F6", false}, + {"F7", KEYCODE_F7, ASCII_F7, "F7", false}, + {"F8", KEYCODE_F8, ASCII_F8, "F8", false}, + {"F9", KEYCODE_F9, ASCII_F9, "F9", false}, + {"F10", KEYCODE_F10, ASCII_F10, "F10", false}, + {"F11", KEYCODE_F11, ASCII_F11, "F11", false}, + {"F12", KEYCODE_F12, ASCII_F12, "F12", false}, + {"F13", KEYCODE_F13, 0, "F13", false}, + {"F14", KEYCODE_F14, 0, "F14", false}, + {"F15", KEYCODE_F15, 0, "F15", false}, // Miscellaneous function keys - {"HELP", KEYCODE_HELP, 0, "Help", kActionKeyType, false}, - {"PRINT", KEYCODE_PRINT, 0, "Print", kActionKeyType, false}, - {"SYSREQ", KEYCODE_SYSREQ, 0, "SysRq", kActionKeyType, false}, - {"BREAK", KEYCODE_BREAK, 0, "Break", kActionKeyType, false}, - {"MENU", KEYCODE_MENU, 0, "Menu", kActionKeyType, false}, + {"HELP", KEYCODE_HELP, 0, "Help", false}, + {"PRINT", KEYCODE_PRINT, 0, "Print", false}, + {"SYSREQ", KEYCODE_SYSREQ, 0, "SysRq", false}, + {"BREAK", KEYCODE_BREAK, 0, "Break", false}, + {"MENU", KEYCODE_MENU, 0, "Menu", false}, // Power Macintosh power key - {"POWER", KEYCODE_POWER, 0, "Power", kActionKeyType, false}, + {"POWER", KEYCODE_POWER, 0, "Power", false}, // Some european keyboards - {"EURO", KEYCODE_EURO, 0, "Euro", kActionKeyType, false}, + {"EURO", KEYCODE_EURO, 0, "Euro", false}, // Atari keyboard has Undo - {"UNDO", KEYCODE_UNDO, 0, "Undo", kActionKeyType, false}, - {0, KEYCODE_INVALID, 0, 0, kGenericKeyType, false} + {"UNDO", KEYCODE_UNDO, 0, "Undo", false}, + {0, KEYCODE_INVALID, 0, 0, false} }; static const ModifierTableEntry sdlModifiers[] = { diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index 05c779a4e0..7a8b1e7b70 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -175,7 +175,7 @@ bool OSystem_POSIX::displayLogFile() { } else if (pid == 0) { // Try xdg-open first - execlp("xdg-open", "xdg-open", _logFilePath.c_str(), (char*)0); + execlp("xdg-open", "xdg-open", _logFilePath.c_str(), (char *)0); // If we're here, that clearly failed. @@ -184,7 +184,7 @@ bool OSystem_POSIX::displayLogFile() { // Try xterm+less next - execlp("xterm", "xterm", "-e", "less", _logFilePath.c_str(), (char*)0); + execlp("xterm", "xterm", "-e", "less", _logFilePath.c_str(), (char *)0); // TODO: If less does not exist we could fall back to 'more'. // However, we'll have to use 'xterm -hold' for that to prevent the diff --git a/backends/platform/webos/webos.cpp b/backends/platform/webos/webos.cpp index abf572e6be..710a3f79be 100644 --- a/backends/platform/webos/webos.cpp +++ b/backends/platform/webos/webos.cpp @@ -58,7 +58,7 @@ HardwareKeySet *OSystem_SDL_WebOS::getHardwareKeySet() { // Add WebOS specific keys keySet->addHardwareKey(new HardwareKey("FORWARD", - KeyState((KeyCode) 229, 229, 0), "Forward", kActionKeyType)); + KeyState((KeyCode) 229, 229, 0), "Forward")); // Return the modified hardware key set return keySet; diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 4e17827e5c..a57fcb9628 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -87,15 +87,15 @@ extern "C" void *__wrap_malloc(size_t size) { void *ptr = __real_malloc(size+4); // printf("malloc(%d) = %p\n", size, ptr); if (ptr != NULL) { - *((HANDLE*)ptr) = 0; - return 4+(char*)ptr; + *((HANDLE *)ptr) = 0; + return 4+(char *)ptr; } return NULL; } HANDLE H = CreateFileMapping((HANDLE)INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size+4, 0); void *ptr = MapViewOfFile(H, FILE_MAP_ALL_ACCESS, 0, 0, 0); - *((HANDLE*)ptr) = H; - return 4+(char*)ptr; + *((HANDLE *)ptr) = H; + return 4+(char *)ptr; } extern "C" void __wrap_free(void *ptr) { @@ -104,9 +104,9 @@ extern "C" void __wrap_free(void *ptr) { printf("free(%p)\n", ptr); */ if (ptr != NULL) { - HANDLE H = *(HANDLE*)((char *)ptr-4); + HANDLE H = *(HANDLE *)((char *)ptr-4); if (H == 0) { - __real_free((char*)ptr-4); + __real_free((char *)ptr-4); return; } UnmapViewOfFile((char *)ptr-4); diff --git a/backends/plugins/elf/elf-loader.cpp b/backends/plugins/elf/elf-loader.cpp index d75010196a..d60ddce57e 100644 --- a/backends/plugins/elf/elf-loader.cpp +++ b/backends/plugins/elf/elf-loader.cpp @@ -480,7 +480,7 @@ void *DLObject::symbol(const char *name) { !strcmp(name, _strtab + s->st_name)) { // We found the symbol debug(2, "elfloader: => 0x%08x", s->st_value); - return (void*)s->st_value; + return (void *)s->st_value; } // We didn't find the symbol diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index 4cc451247b..5c9105b0eb 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -74,7 +74,7 @@ Win32TaskbarManager::Win32TaskbarManager() : _taskbar(NULL), _count(0), _icon(NU 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, - reinterpret_cast<void**> (&(_taskbar))); + reinterpret_cast<void **> (&(_taskbar))); if (SUCCEEDED(hr)) { // Initialize taskbar object @@ -274,7 +274,7 @@ void Win32TaskbarManager::addRecent(const Common::String &name, const Common::St GetModuleFileNameW(NULL, path, MAX_PATH); // Create a shell link. - if (SUCCEEDED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC, IID_IShellLinkW, reinterpret_cast<void**> (&link)))) { + if (SUCCEEDED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC, IID_IShellLinkW, reinterpret_cast<void **> (&link)))) { // Convert game name and description to Unicode. LPWSTR game = ansiToUnicode(name.c_str()); LPWSTR desc = ansiToUnicode(description.c_str()); @@ -296,7 +296,7 @@ void Win32TaskbarManager::addRecent(const Common::String &name, const Common::St // The link's display name must be set via property store. IPropertyStore* propStore; - HRESULT hr = link->QueryInterface(IID_IPropertyStore, reinterpret_cast<void**> (&(propStore))); + HRESULT hr = link->QueryInterface(IID_IPropertyStore, reinterpret_cast<void **> (&(propStore))); if (SUCCEEDED(hr)) { PROPVARIANT pv; pv.vt = VT_LPWSTR; diff --git a/base/main.cpp b/base/main.cpp index 81f9b91aa7..5311b6fd78 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -274,7 +274,7 @@ static void setupKeymapper(OSystem &system) { // Now create the global keymap Keymap *primaryGlobalKeymap = new Keymap(kGlobalKeymapName); Action *act; - act = new Action(primaryGlobalKeymap, "MENU", _("Menu"), kMenuActionType); + act = new Action(primaryGlobalKeymap, "MENU", _("Menu")); act->addEvent(EVENT_MAINMENU); act = new Action(primaryGlobalKeymap, "SKCT", _("Skip")); @@ -286,11 +286,13 @@ static void setupKeymapper(OSystem &system) { act = new Action(primaryGlobalKeymap, "SKLI", _("Skip line")); act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0)); - act = new Action(primaryGlobalKeymap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType); - act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0)); +#ifdef ENABLE_VKEYBD + act = new Action(primaryGlobalKeymap, "VIRT", _("Display keyboard")); + act->addEvent(EVENT_VIRTUAL_KEYBOARD); +#endif - act = new Action(primaryGlobalKeymap, "REMP", _("Remap keys"), kKeyRemapActionType); - act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0)); + act = new Action(primaryGlobalKeymap, "REMP", _("Remap keys")); + act->addEvent(EVENT_KEYMAPPER_REMAP); act = new Action(primaryGlobalKeymap, "FULS", _("Toggle FullScreen")); act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT)); diff --git a/common/EventDispatcher.cpp b/common/EventDispatcher.cpp index 4e3f671cfd..4c7286bbb5 100644 --- a/common/EventDispatcher.cpp +++ b/common/EventDispatcher.cpp @@ -48,24 +48,16 @@ void EventDispatcher::dispatch() { dispatchPoll(); for (List<SourceEntry>::iterator i = _sources.begin(); i != _sources.end(); ++i) { - const bool allowMapping = i->source->allowMapping(); - while (i->source->pollEvent(event)) { // We only try to process the events via the setup event mapper, when // we have a setup mapper and when the event source allows mapping. - if (_mapper && allowMapping) { - if (_mapper->notifyEvent(event)) { - // We allow the event mapper to create multiple events, when - // eating an event. - while (_mapper->pollEvent(event)) - dispatchEvent(event); - - // Try getting another event from the current EventSource. - continue; - } - } + assert(_mapper); + List<Event> mappedEvents = _mapper->mapEvent(event, i->source); - dispatchEvent(event); + for (List<Event>::iterator j = mappedEvents.begin(); j != mappedEvents.end(); ++j) { + const Event mappedEvent = *j; + dispatchEvent(mappedEvent); + } } } } diff --git a/backends/platform/iphone/blit.cpp b/common/EventMapper.cpp index 58de22bf75..2808a7b5fd 100644 --- a/backends/platform/iphone/blit.cpp +++ b/common/EventMapper.cpp @@ -20,29 +20,35 @@ * */ -#include "common/scummsys.h" -#include "blit_arm.h" - -void blitLandscapeScreenRect16bpp(uint16 *dst, uint16 *src, int width, int height, int screenWidth, int screenHeight) -{ - for (int x = width; x > 0; x--) { - for (int y = height; y > 0; y--) { - *(dst++) = *src; - src += screenWidth; - } - dst -= screenHeight + height; - src += 1 - height * screenWidth; - } -} +#include "common/events.h" -void blitLandscapeScreenRect8bpp(uint16 *dst, byte *src, int width, int height, uint16 *palette, int screenWidth, int screenHeight) -{ - for (int x = width; x > 0; x--) { - for (int y = height; y > 0; y--) { - *(dst++) = palette[*src]; - src += screenWidth; +namespace Common { + +List<Event> DefaultEventMapper::mapEvent(const Event &ev, EventSource *source) { + List<Event> events; + Event mappedEvent; + if (ev.type == EVENT_KEYDOWN) { + if (ev.kbd.hasFlags(KBD_CTRL) && ev.kbd.keycode == KEYCODE_F5) { + mappedEvent.type = EVENT_MAINMENU; + } +#ifdef ENABLE_VKEYBD + else if (ev.kbd.keycode == KEYCODE_F7 && ev.kbd.hasFlags(0)) { + mappedEvent.type = EVENT_VIRTUAL_KEYBOARD; } - dst -= screenHeight + height; - src += 1 - height * screenWidth; +#endif +#ifdef ENABLE_KEYMAPPER + else if (ev.kbd.keycode == KEYCODE_F8 && ev.kbd.hasFlags(0)) { + mappedEvent.type = EVENT_KEYMAPPER_REMAP; + } +#endif } + + // if it didn't get mapped, just pass it through + if (mappedEvent.type == EVENT_INVALID) + mappedEvent = ev; + events.push_back(mappedEvent); + return events; } + + +} // namespace Common diff --git a/common/events.h b/common/events.h index d3c7064499..69cca9b54a 100644 --- a/common/events.h +++ b/common/events.h @@ -78,7 +78,12 @@ enum EventType { , // IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use // this, please talk to tsoliman and/or LordHoto. - EVENT_CUSTOM_BACKEND = 13 + EVENT_CUSTOM_BACKEND = 18, + EVENT_KEYMAPPER_REMAP = 19 +#endif +#ifdef ENABLE_VKEYBD + , + EVENT_VIRTUAL_KEYBOARD = 20 #endif }; @@ -213,10 +218,20 @@ public: * * An example for this is the Keymapper. */ -class EventMapper : public EventSource, public EventObserver { +class EventMapper { +public: + virtual ~EventMapper() {} + + /** + * Map an incoming event to one or more action events + */ + virtual List<Event> mapEvent(const Event &ev, EventSource *source) = 0; +}; + +class DefaultEventMapper : public EventMapper { public: - /** For event mappers resulting events should never be mapped */ - bool allowMapping() const { return false; } + // EventMapper interface + virtual List<Event> mapEvent(const Event &ev, EventSource *source); }; /** diff --git a/common/fft.cpp b/common/fft.cpp index 5852698b61..034570964f 100644 --- a/common/fft.cpp +++ b/common/fft.cpp @@ -231,7 +231,7 @@ DECL_FFT(14, 16384, 8192, 4096) DECL_FFT(15, 32768, 16384, 8192) DECL_FFT(16, 65536, 32768, 16384) -static void (* const fft_dispatch[])(Complex*) = { +static void (* const fft_dispatch[])(Complex *) = { fft4, fft8, fft16, fft32, fft64, fft128, fft256, fft512, fft1024, fft2048, fft4096, fft8192, fft16384, fft32768, fft65536, }; diff --git a/common/huffman.h b/common/huffman.h index 4175d0d309..3b23340b2e 100644 --- a/common/huffman.h +++ b/common/huffman.h @@ -68,7 +68,7 @@ private: typedef List<Symbol> CodeList; typedef Array<CodeList> CodeLists; - typedef Array<Symbol*> SymbolList; + typedef Array<Symbol *> SymbolList; /** Lists of codes and their symbols, sorted by code length. */ CodeLists _codes; diff --git a/common/list.h b/common/list.h index a1e761f55d..044b9d7a49 100644 --- a/common/list.h +++ b/common/list.h @@ -226,7 +226,7 @@ public: } const_iterator end() const { - return const_iterator(const_cast<NodeBase*>(&_anchor)); + return const_iterator(const_cast<NodeBase *>(&_anchor)); } protected: diff --git a/common/memorypool.cpp b/common/memorypool.cpp index 19adc54d00..e3742eeae0 100644 --- a/common/memorypool.cpp +++ b/common/memorypool.cpp @@ -33,7 +33,7 @@ static size_t adjustChunkSize(size_t chunkSize) { // You must at least fit the pointer in the node (technically unneeded considering the next rounding statement) chunkSize = MAX(chunkSize, sizeof(void *)); // There might be an alignment problem on some platforms when trying to load a void* on a non natural boundary - // so we round to the next sizeof(void*) + // so we round to the next sizeof(void *) chunkSize = (chunkSize + sizeof(void *) - 1) & (~(sizeof(void *) - 1)); return chunkSize; diff --git a/common/memorypool.h b/common/memorypool.h index 5ba09cebed..9a4e523d53 100644 --- a/common/memorypool.h +++ b/common/memorypool.h @@ -105,7 +105,7 @@ template<size_t CHUNK_SIZE, size_t NUM_INTERNAL_CHUNKS = 32> class FixedSizeMemoryPool : public MemoryPool { private: enum { - REAL_CHUNK_SIZE = (CHUNK_SIZE + sizeof(void*) - 1) & (~(sizeof(void*) - 1)) + REAL_CHUNK_SIZE = (CHUNK_SIZE + sizeof(void *) - 1) & (~(sizeof(void *) - 1)) }; byte _storage[NUM_INTERNAL_CHUNKS * REAL_CHUNK_SIZE]; diff --git a/common/module.mk b/common/module.mk index 7434df7052..ae5e41cb8c 100644 --- a/common/module.mk +++ b/common/module.mk @@ -8,6 +8,7 @@ MODULE_OBJS := \ debug.o \ error.o \ EventDispatcher.o \ + EventMapper.o \ EventRecorder.o \ file.o \ fs.o \ diff --git a/common/quicktime.h b/common/quicktime.h index d7e2691c2b..efd2adbd21 100644 --- a/common/quicktime.h +++ b/common/quicktime.h @@ -155,7 +155,7 @@ protected: uint16 height; CodecType codecType; - Array<SampleDesc*> sampleDescs; + Array<SampleDesc *> sampleDescs; uint32 editCount; EditListEntry *editList; @@ -180,7 +180,7 @@ protected: uint32 _duration; Rational _scaleFactorX; Rational _scaleFactorY; - Array<Track*> _tracks; + Array<Track *> _tracks; uint32 _beginOffset; MacResManager *_resFork; diff --git a/common/str.cpp b/common/str.cpp index a48a290c0b..84805082ac 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -793,7 +793,7 @@ size_t strlcpy(char *dst, const char *src, size_t size) { } // Move to the terminating zero of the source - // string, we need this to determin the length + // string, we need this to determine the length // of the source string. while (*src) ++src; @@ -841,7 +841,7 @@ size_t strlcat(char *dst, const char *src, size_t size) { *dst = 0; // Move to the terminating zero of the source - // string, we need this to determin the length + // string, we need this to determine the length // of the source string. while (*src) ++src; diff --git a/common/system.h b/common/system.h index c5e8214d22..85a9f6a77e 100644 --- a/common/system.h +++ b/common/system.h @@ -54,6 +54,7 @@ class WriteStream; #ifdef ENABLE_KEYMAPPER class HardwareKeySet; class Keymap; +class KeymapperDefaultBindings; #endif } @@ -938,6 +939,8 @@ public: #ifdef ENABLE_KEYMAPPER /** * Register hardware keys with keymapper + * IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use + * this, please talk to tsoliman and/or LordHoto. * * @return HardwareKeySet with all keys and recommended mappings * @@ -947,6 +950,8 @@ public: /** * Return a platform-specific global keymap + * IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use + * this, please talk to tsoliman and/or LordHoto. * * @return Keymap with actions appropriate for the platform * @@ -955,6 +960,17 @@ public: * See keymapper documentation for further reference. */ virtual Common::Keymap *getGlobalKeymap() { return 0; } + + /** + * Return platform-specific default keybindings + * IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use + * this, please talk to tsoliman and/or LordHoto. + * + * @return KeymapperDefaultBindings populated with keybindings + * + * See keymapper documentation for further reference. + */ + virtual Common::KeymapperDefaultBindings *getKeymapperDefaultBindings() { return 0; } #endif //@} diff --git a/common/unzip.cpp b/common/unzip.cpp index 8061f712d4..8cfcd605fa 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -111,7 +111,7 @@ typedef struct { #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ + from (void *) without cast */ typedef struct TagunzFile__ { int unused; } unzFile__; typedef unzFile__ *unzFile; #else @@ -1062,7 +1062,7 @@ int unzOpenCurrentFile (unzFile file) { if (pfile_in_zip_read_info==NULL) return UNZ_INTERNALERROR; - pfile_in_zip_read_info->read_buffer=(char*)malloc(UNZ_BUFSIZE); + pfile_in_zip_read_info->read_buffer=(char *)malloc(UNZ_BUFSIZE); pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; pfile_in_zip_read_info->pos_local_extrafield=0; @@ -1151,7 +1151,7 @@ int unzReadCurrentFile(unzFile file, voidp buf, unsigned len) { if (len==0) return 0; - pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; + pfile_in_zip_read_info->stream.next_out = (Bytef *)buf; pfile_in_zip_read_info->stream.avail_out = (uInt)len; @@ -1177,7 +1177,7 @@ int unzReadCurrentFile(unzFile file, voidp buf, unsigned len) { pfile_in_zip_read_info->rest_read_compressed-=uReadThis; - pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.next_in = (Bytef *)pfile_in_zip_read_info->read_buffer; pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; } diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp index d37bfeb99a..ea3d44cf87 100644 --- a/common/xmlparser.cpp +++ b/common/xmlparser.cpp @@ -39,7 +39,7 @@ XMLParser::~XMLParser() { delete _XMLkeys; delete _stream; - for (List<XMLKeyLayout*>::iterator i = _layoutList.begin(); + for (List<XMLKeyLayout *>::iterator i = _layoutList.begin(); i != _layoutList.end(); ++i) delete *i; diff --git a/common/xmlparser.h b/common/xmlparser.h index 81752543c2..1e474b596c 100644 --- a/common/xmlparser.h +++ b/common/xmlparser.h @@ -68,9 +68,9 @@ class SeekableReadStream; struct CustomXMLKeyLayout : public XMLKeyLayout {\ typedef bool (parserName::*ParserCallback)(ParserNode *node);\ ParserCallback callback;\ - bool doCallback(XMLParser *parent, ParserNode *node) {return ((kLocalParserName*)parent->*callback)(node);} };\ + bool doCallback(XMLParser *parent, ParserNode *node) {return ((kLocalParserName *)parent->*callback)(node);} };\ virtual void buildLayout() { \ - Common::Stack<XMLKeyLayout*> layout; \ + Common::Stack<XMLKeyLayout *> layout; \ CustomXMLKeyLayout *lay = 0; \ XMLKeyLayout::XMLKeyProperty prop; \ _XMLkeys = new CustomXMLKeyLayout; \ @@ -334,7 +334,7 @@ protected: */ virtual void cleanup() {} - List<XMLKeyLayout*> _layoutList; + List<XMLKeyLayout *> _layoutList; private: char _char; @@ -346,7 +346,7 @@ private: String _error; /** Current error message */ String _token; /** Current text token */ - Stack<ParserNode*> _activeKey; /** Node stack of the parsed keys */ + Stack<ParserNode *> _activeKey; /** Node stack of the parsed keys */ }; } // End of namespace Common diff --git a/devtools/create_kyradat/extract.cpp b/devtools/create_kyradat/extract.cpp index b755b8d3ec..34308f1b5b 100644 --- a/devtools/create_kyradat/extract.cpp +++ b/devtools/create_kyradat/extract.cpp @@ -314,7 +314,7 @@ bool extractStrings(PAKFile &out, const ExtractInformation *info, const byte *da input += 0x11; output += 0x0F; } - strcpy((char*) output, (const char*) input); + strcpy((char *) output, (const char*) input); uint32 stringsize = strlen((const char*)output) + 1; input += stringsize; output += stringsize; // skip empty entries @@ -370,7 +370,7 @@ bool extractStrings(PAKFile &out, const ExtractInformation *info, const byte *da } else if (patch == 5) { const byte *c = data + size; do { - strcpy((char*) output, (const char*) input); + strcpy((char *) output, (const char*) input); uint32 stringsize = strlen((const char*)output) + 1; input += stringsize; output += stringsize; @@ -403,7 +403,7 @@ bool extractStrings(PAKFile &out, const ExtractInformation *info, const byte *da output += 44; data += 44; for (int t = 1; t != 10; t++) { - sprintf((char*) output, "COST%d_SH.PAK", t); + sprintf((char *) output, "COST%d_SH.PAK", t); output += 13; } data += 126; @@ -576,7 +576,7 @@ bool extractHofSeqData(PAKFile &out, const ExtractInformation *info, const byte byte *buffer = new byte[bufferSize]; assert(buffer); memset(buffer, 0, bufferSize ); - uint16 *header = (uint16*) buffer; + uint16 *header = (uint16 *) buffer; byte *output = buffer + headerSize; uint16 *hdout = header; @@ -751,7 +751,7 @@ bool extractHofSeqData(PAKFile &out, const ExtractInformation *info, const byte byte *finBuffer = new byte[finBufferSize]; assert(finBuffer); uint16 diff = headerSize - finHeaderSize; - uint16 *finHeader = (uint16*) finBuffer; + uint16 *finHeader = (uint16 *) finBuffer; for (int i = 1; i < finHeaderSize; i++) WRITE_BE_UINT16(&finHeader[i], (READ_BE_UINT16(&header[i]) - diff)); @@ -760,7 +760,7 @@ bool extractHofSeqData(PAKFile &out, const ExtractInformation *info, const byte memcpy (finBuffer + finHeaderSize, buffer + headerSize, finBufferSize - finHeaderSize); delete[] buffer; - finHeader = (uint16*) (finBuffer + ((numSequences + 2) * sizeof(uint16))); + finHeader = (uint16 *) (finBuffer + ((numSequences + 2) * sizeof(uint16))); for (int i = 0; i < numNestedSequences; i++) { uint8 * offs = finBuffer + READ_BE_UINT16(finHeader++) + 26; uint16 ctrl = READ_BE_UINT16(offs); diff --git a/devtools/skycpt/AsciiCptCompile.cpp b/devtools/skycpt/AsciiCptCompile.cpp index 154c13b8cd..f339f6816c 100644 --- a/devtools/skycpt/AsciiCptCompile.cpp +++ b/devtools/skycpt/AsciiCptCompile.cpp @@ -49,7 +49,7 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE * int main(int argc, char* argv[]) { uint8 testBuf[4] = { 0x11, 0x22, 0x33, 0x44 }; - if (*(uint32*)testBuf != 0x44332211) { + if (*(uint32 *)testBuf != 0x44332211) { printf("Sorry, this program only works on little endian systems.\nGoodbye.\n"); return 0; } diff --git a/devtools/skycpt/TextFile.cpp b/devtools/skycpt/TextFile.cpp index e9887dc87b..038b1b9329 100644 --- a/devtools/skycpt/TextFile.cpp +++ b/devtools/skycpt/TextFile.cpp @@ -60,7 +60,7 @@ char *TextFile::giveLine(uint32 num) { } void TextFile::read(FILE *inf) { - char *line = (char*)malloc(4096); + char *line = (char *)malloc(4096); _lines = (char**)malloc(4096 * sizeof(char *)); _numLines = 0; uint32 linesMax = 4096; @@ -78,7 +78,7 @@ void TextFile::read(FILE *inf) { start++; } uint32 length = crop(start); - _lines[_numLines] = (char*)malloc(length + 1); + _lines[_numLines] = (char *)malloc(length + 1); memcpy(_lines[_numLines], start, length + 1); _numLines++; } diff --git a/devtools/skycpt/cptcompiler.cpp b/devtools/skycpt/cptcompiler.cpp index f6ee926075..2c7d33c73b 100644 --- a/devtools/skycpt/cptcompiler.cpp +++ b/devtools/skycpt/cptcompiler.cpp @@ -50,7 +50,7 @@ void processMainLists(FILE *inf, CptObj *destArr, uint16 *idList) { char line[1024]; dofgets(line, 1024, inf); assert(lineMatchSection(line, "MAINLISTS")); - uint16 *resBuf = (uint16*)malloc(MAX_OBJ_SIZE); + uint16 *resBuf = (uint16 *)malloc(MAX_OBJ_SIZE); uint32 idNum = 0; do { dofgets(line, 1024, inf); @@ -60,7 +60,7 @@ void processMainLists(FILE *inf, CptObj *destArr, uint16 *idList) { CptObj *dest = destArr + id; assertEmpty(dest); dest->type = MAINLIST; - dest->dbgName = (char*)malloc(strlen(cptName) + 1); + dest->dbgName = (char *)malloc(strlen(cptName) + 1); strcpy(dest->dbgName, cptName); memset(resBuf, 0, MAX_OBJ_SIZE); uint32 resPos = 0; @@ -82,7 +82,7 @@ void processMainLists(FILE *inf, CptObj *destArr, uint16 *idList) { } while (1); assert(resPos < (MAX_OBJ_SIZE / 2)); dest->len = resPos; - dest->data = (uint16*)malloc(resPos * 2); + dest->data = (uint16 *)malloc(resPos * 2); memcpy(dest->data, resBuf, resPos * 2); } else break; @@ -95,7 +95,7 @@ void processCpts(FILE *inf, CptObj *destArr) { char line[1024]; dofgets(line, 1024, inf); assert(lineMatchSection(line, "COMPACTS")); - uint16 *resBuf = (uint16*)malloc(MAX_OBJ_SIZE); + uint16 *resBuf = (uint16 *)malloc(MAX_OBJ_SIZE); do { dofgets(line, 1024, inf); if (!isEndOfSection(line)) { @@ -103,7 +103,7 @@ void processCpts(FILE *inf, CptObj *destArr) { uint16 id = getInfo(line, "COMPACT", cptName); CptObj *dest = destArr + id; assertEmpty(dest); - dest->dbgName = (char*)malloc(strlen(cptName) + 1); + dest->dbgName = (char *)malloc(strlen(cptName) + 1); dest->type = COMPACT; strcpy(dest->dbgName, cptName); memset(resBuf, 0, MAX_OBJ_SIZE); @@ -134,7 +134,7 @@ void processCpts(FILE *inf, CptObj *destArr) { } while (1); assert(resPos < (MAX_OBJ_SIZE / 2)); dest->len = resPos; - dest->data = (uint16*)malloc(resPos * 2); + dest->data = (uint16 *)malloc(resPos * 2); memcpy(dest->data, resBuf, resPos * 2); } else break; @@ -147,7 +147,7 @@ void processTurntabs(FILE *inf, CptObj *destArr) { char line[1024]; dofgets(line, 1024, inf); assert(lineMatchSection(line, "TURNTABS")); - uint16 *resBuf = (uint16*)malloc(MAX_OBJ_SIZE); + uint16 *resBuf = (uint16 *)malloc(MAX_OBJ_SIZE); do { dofgets(line, 1024, inf); if (!isEndOfSection(line)) { @@ -155,7 +155,7 @@ void processTurntabs(FILE *inf, CptObj *destArr) { uint16 id = getInfo(line, "TURNTAB", cptName); CptObj *dest = destArr + id; assertEmpty(dest); - dest->dbgName = (char*)malloc(strlen(cptName) + 1); + dest->dbgName = (char *)malloc(strlen(cptName) + 1); dest->type = TURNTAB; strcpy(dest->dbgName, cptName); memset(resBuf, 0, MAX_OBJ_SIZE); @@ -176,7 +176,7 @@ void processTurntabs(FILE *inf, CptObj *destArr) { } while (1); assert(resPos < (MAX_OBJ_SIZE / 2)); dest->len = resPos; - dest->data = (uint16*)malloc(resPos * 2); + dest->data = (uint16 *)malloc(resPos * 2); memcpy(dest->data, resBuf, resPos * 2); } else break; @@ -189,7 +189,7 @@ void processBins(FILE *inf, CptObj *destArr, const char *typeName, const char *o char line[1024]; dofgets(line, 1024, inf); assert(lineMatchSection(line, typeName)); - uint16 *resBuf = (uint16*)malloc(MAX_OBJ_SIZE); + uint16 *resBuf = (uint16 *)malloc(MAX_OBJ_SIZE); do { dofgets(line, 1024, inf); if (!isEndOfSection(line)) { @@ -197,7 +197,7 @@ void processBins(FILE *inf, CptObj *destArr, const char *typeName, const char *o uint16 id = getInfo(line, objName, cptName); CptObj *dest = destArr + id; assertEmpty(dest); - dest->dbgName = (char*)malloc(strlen(cptName) + 1); + dest->dbgName = (char *)malloc(strlen(cptName) + 1); dest->type = cTypeId; strcpy(dest->dbgName, cptName); memset(resBuf, 0, MAX_OBJ_SIZE); @@ -218,7 +218,7 @@ void processBins(FILE *inf, CptObj *destArr, const char *typeName, const char *o } while (1); assert(resPos < (MAX_OBJ_SIZE / 2)); dest->len = resPos; - dest->data = (uint16*)malloc(resPos * 2); + dest->data = (uint16 *)malloc(resPos * 2); memcpy(dest->data, resBuf, resPos * 2); } else break; @@ -242,7 +242,7 @@ void processSymlinks(FILE *inf, CptObj *destArr, uint16 *baseLists) { uint16 fromId = getInfo(line, "SYMLINK", cptName); CptObj *from = destArr + fromId; assertEmpty(from); - dlinkNames[dlinkCount] = (char*)malloc(strlen(cptName) + 1); + dlinkNames[dlinkCount] = (char *)malloc(strlen(cptName) + 1); strcpy(dlinkNames[dlinkCount], cptName); dofgets(line, 1024, inf); @@ -272,7 +272,7 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE * CptObj *resCpts; uint16 baseLists[NUM_DATA_LISTS]; memset(baseLists, 0, NUM_DATA_LISTS * 2); - resCpts = (CptObj*)malloc(MAX_CPTS * sizeof(CptObj)); + resCpts = (CptObj *)malloc(MAX_CPTS * sizeof(CptObj)); memset(resCpts, 0, MAX_CPTS * sizeof(CptObj)); printf(" MainLists...\n"); processMainLists(inf, resCpts, baseLists); @@ -323,7 +323,7 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE * fwrite(&binSize, 1, 4, debOutf); fwrite(&binSize, 1, 4, resOutf); - char *asciiBuf = (char*)malloc(ASCII_SIZE); + char *asciiBuf = (char *)malloc(ASCII_SIZE); char *asciiPos = asciiBuf; // now process all the compacts @@ -491,7 +491,7 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE * assert((ftell(res288) / 2) < 65536); uint16 resSize = (uint16)(ftell(res288) / 2); fseek(res288, 0, SEEK_SET); - uint16 *buf288 = (uint16*)malloc(resSize * 2); + uint16 *buf288 = (uint16 *)malloc(resSize * 2); fread(buf288, 2, resSize, res288); fclose(res288); fwrite(&resSize, 1, 2, debOutf); @@ -514,7 +514,7 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE * fseek(resDiff, 0, SEEK_END); assert(ftell(resDiff) == (resSize * 2)); fseek(resDiff, 0, SEEK_SET); - uint16 *bufDif = (uint16*)malloc(resSize *2); + uint16 *bufDif = (uint16 *)malloc(resSize *2); fread(bufDif, 2, resSize, resDiff); fclose(resDiff); for (uint16 eCnt = 0; eCnt < resSize; eCnt++) diff --git a/engines/agi/agi.h b/engines/agi/agi.h index e9923aba2e..ea3afa5ca3 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -631,7 +631,7 @@ struct AgiGame { AgiLogic *_curLogic; // words - Common::Array<AgiWord*> words[26]; + Common::Array<AgiWord *> words[26]; // view table VtEntry viewTable[MAX_VIEWTABLE]; diff --git a/engines/agi/menu.h b/engines/agi/menu.h index e659c71fab..1d5828d78a 100644 --- a/engines/agi/menu.h +++ b/engines/agi/menu.h @@ -33,8 +33,8 @@ namespace Agi { struct AgiMenu; struct AgiMenuOption; -typedef Common::List<AgiMenu*> MenuList; -typedef Common::List<AgiMenuOption*> MenuOptionList; +typedef Common::List<AgiMenu *> MenuList; +typedef Common::List<AgiMenuOption *> MenuOptionList; class GfxMgr; class PictureMgr; diff --git a/engines/agi/preagi_mickey.h b/engines/agi/preagi_mickey.h index 673839a592..18b0593d78 100644 --- a/engines/agi/preagi_mickey.h +++ b/engines/agi/preagi_mickey.h @@ -704,7 +704,7 @@ protected: void readOfsData(int, int, uint8*, long); bool chooseY_N(int, bool); int choose1to9(int); - void printStr(char*); + void printStr(char *); void printLine(const char*); void printExeStr(int); void printExeMsg(int); diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp index 50b2945383..b7d2801076 100644 --- a/engines/agi/preagi_troll.cpp +++ b/engines/agi/preagi_troll.cpp @@ -455,7 +455,7 @@ int TrollEngine::drawRoom(char *menu) { _gfx->doUpdate(); char tmp[10]; - strncat(menu, (char*)_gameData + _locMessagesIdx[_currentRoom], 39); + strncat(menu, (char *)_gameData + _locMessagesIdx[_currentRoom], 39); for (int i = 0; i < 3; i++) { if (_roomDescs[_roomPicture - 1].options[i]) { @@ -725,7 +725,7 @@ void TrollEngine::fillOffsets() { void TrollEngine::init() { _picture->setPictureVersion(AGIPIC_V15); - //SetScreenPar(320, 200, (char*)ibm_fontdata); + //SetScreenPar(320, 200, (char *)ibm_fontdata); const int gaps[] = { 0x3A40, 0x4600, 0x4800, 0x5800, 0x5a00, 0x6a00, 0x6c00, 0x7400, 0x7600, 0x7c00, 0x7e00, 0x8e00, diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp index b15950f31d..bfc8d4d8f3 100644 --- a/engines/agi/sound_2gs.cpp +++ b/engines/agi/sound_2gs.cpp @@ -68,10 +68,10 @@ int SoundGen2GS::readBuffer(int16 *buffer, const int numSamples) { static uint data_available = 0; static uint data_offset = 0; uint n = numSamples << 1; - uint8 *p = (uint8*)buffer; + uint8 *p = (uint8 *)buffer; while (n > data_available) { - memcpy(p, (uint8*)_out + data_offset, data_available); + memcpy(p, (uint8 *)_out + data_offset, data_available); p += data_available; n -= data_available; @@ -81,7 +81,7 @@ int SoundGen2GS::readBuffer(int16 *buffer, const int numSamples) { data_offset = 0; } - memcpy(p, (uint8*)_out + data_offset, n); + memcpy(p, (uint8 *)_out + data_offset, n); data_offset += n; data_available -= n; diff --git a/engines/agi/sound_sarien.cpp b/engines/agi/sound_sarien.cpp index a2baf89d12..576801bc56 100644 --- a/engines/agi/sound_sarien.cpp +++ b/engines/agi/sound_sarien.cpp @@ -330,7 +330,7 @@ void SoundGenSarien::fillAudio(int16 *stream, uint len) { debugC(5, kDebugLevelSound, "(%p, %d)", (void *)stream, len); while (len > data_available) { - memcpy((uint8 *)stream + p, (uint8*)_sndBuffer + data_offset, data_available); + memcpy((uint8 *)stream + p, (uint8 *)_sndBuffer + data_offset, data_available); p += data_available; len -= data_available; @@ -339,7 +339,7 @@ void SoundGenSarien::fillAudio(int16 *stream, uint len) { data_offset = 0; } - memcpy((uint8 *)stream + p, (uint8*)_sndBuffer + data_offset, len); + memcpy((uint8 *)stream + p, (uint8 *)_sndBuffer + data_offset, len); data_offset += len; data_available -= len; } diff --git a/engines/agi/sprite.cpp b/engines/agi/sprite.cpp index 8d13be3f68..ea2d329fb0 100644 --- a/engines/agi/sprite.cpp +++ b/engines/agi/sprite.cpp @@ -55,7 +55,7 @@ void *SpritesMgr::poolAlloc(int size) { // Adjust size to sizeof(void *) boundary to prevent data misalignment // errors. - const int alignPadding = sizeof(void*) - 1; + const int alignPadding = sizeof(void *) - 1; size = (size + alignPadding) & ~alignPadding; x = _poolTop; diff --git a/engines/agi/sprite.h b/engines/agi/sprite.h index 68f0e32b86..851c2438fb 100644 --- a/engines/agi/sprite.h +++ b/engines/agi/sprite.h @@ -27,7 +27,7 @@ namespace Agi { struct Sprite; -typedef Common::List<Sprite*> SpriteList; +typedef Common::List<Sprite *> SpriteList; class AgiEngine; class GfxMgr; diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp index 1001c66b20..4400112247 100644 --- a/engines/agi/words.cpp +++ b/engines/agi/words.cpp @@ -130,7 +130,7 @@ int AgiEngine::findWord(const char *word, int *flen) { return -1; *flen = 0; - Common::Array<AgiWord*> &a = _game.words[c]; + Common::Array<AgiWord *> &a = _game.words[c]; for (int i = 0; i < (int)a.size(); i++) { int wlen = strlen(a[i]->word); diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index c7176fe7e8..29d1b36e19 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -312,7 +312,7 @@ void MoviePlayerDXA::startSound() { _fileStream->seek(size, SEEK_CUR); - in.open((const char *)"audio.wav"); + in.open("audio.wav"); if (!in.isOpen()) { error("Can't read offset file 'audio.wav'"); } diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp index 3fa3dbd7ff..b3ef31f30f 100644 --- a/engines/cge/detection.cpp +++ b/engines/cge/detection.cpp @@ -104,7 +104,7 @@ static const ADFileBasedFallback fileBasedFallback[] = { class CGEMetaEngine : public AdvancedMetaEngine { public: CGEMetaEngine() : AdvancedMetaEngine(CGE::gameDescriptions, sizeof(ADGameDescription), CGEGames) { - _singleid = "Soltys"; + _singleid = "soltys"; } virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index 01e05bed6d..918d522606 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -1801,7 +1801,7 @@ void maskBgOverlay(const byte *bgPtr, const byte *maskPtr, int16 width, int16 he for (it = g_cine->_bgIncrustList.begin(); it != g_cine->_bgIncrustList.end(); ++it) { tmpWidth = g_cine->_animDataTable[it->frame]._realWidth; tmpHeight = g_cine->_animDataTable[it->frame]._height; - mask = (byte*)malloc(tmpWidth * tmpHeight); + mask = (byte *)malloc(tmpWidth * tmpHeight); if (it->param == 0) { generateMask(g_cine->_animDataTable[it->frame].data(), mask, tmpWidth * tmpHeight, it->part); diff --git a/engines/composer/detection.cpp b/engines/composer/detection.cpp index af355402c2..835f3c5683 100644 --- a/engines/composer/detection.cpp +++ b/engines/composer/detection.cpp @@ -53,9 +53,12 @@ Common::Language ComposerEngine::getLanguage() const { static const PlainGameDescriptor composerGames[] = { {"composer", "Composer Game"}, + {"babayaga", "Magic Tales: Baba Yaga and the Magic Geese"}, {"darby", "Darby the Dragon"}, {"gregory", "Gregory and the Hot Air Balloon"}, + {"imoking", "Magic Tales: Imo and the King"}, {"liam", "Magic Tales: Liam Finds a Story"}, + {"littlesamurai", "Magic Tales: The Little Samurai"}, {"princess", "The Princess and the Crab"}, {"sleepingcub", "Sleeping Cub's Test of Courage"}, {0, 0} @@ -64,6 +67,90 @@ static const PlainGameDescriptor composerGames[] = { namespace Composer { static const ComposerGameDescription gameDescriptions[] = { + // Magic Tales: Baba Yaga and the Magic Geese - from bug #3485018 + { + { + "babayaga", + "", + AD_ENTRY1s("book.ini", "412b7f4b0ef07f442009d28e3a819974", 3852), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + + // Magic Tales: Baba Yaga and the Magic Geese Mac - from bug #3466402 + { + { + "babayaga", + "", + AD_ENTRY1("Baba Yaga", "ae3a4445f42fe10253da7ee4ea0d37"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + + // Magic Tales: Imo and the King - from bug #3485018 + { + { + "imoking", + "", + AD_ENTRY1s("book.ini", "62b52a1763cce7d7d6ccde9f9d32fd4b", 3299), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + + // Magic Tales: Imo and the King Mac - from bug #3466402 + { + { + "imoking", + "", + AD_ENTRY1("imo and the king", "b0277885fec943b5f19409f35b33964c"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + + // Magic Tales: The Little Samurai - from bug #3485018 + { + { + "littlesamurai", + "", + AD_ENTRY1s("book.ini", "7a851869d022a9041e0dd11e5bace09b", 3747), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + + // Magic Tales: The Little Samurai Mac - from bug #3466402 + { + { + "littlesamurai", + "", + AD_ENTRY1("The Little Samurai", "38121dd649c24e8676aa108cf35d44b5"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + // from Liam Finds a Story CD { { @@ -91,6 +178,24 @@ static const ComposerGameDescription gameDescriptions[] = { GType_ComposerV2 }, + // Liam Finds a Story Mac - from bug #3463201 + { + { + "liam", + 0, + { + {"liam finds a story.ini", 0, "85a1ca6002ded8572920bbdb73d35b0a", -1}, + {"page99.rsc", 0, "11b0a19c6b6d73c39e2bd289a457c1dc", -1}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV2 + }, + // from Liam Finds a Story CD { { @@ -208,6 +313,24 @@ static const ComposerGameDescription gameDescriptions[] = { GType_ComposerV2 }, + // The Princess and the Crab Mac - From Bug #3461984 + { + { + "princess", + 0, + { + {"the princess and the crab.ini", 0, "f6b551a7304643004bd5e4df7ac1e76e", -1}, + {"page99.rsc", 0, "fd5ebd3b5e36c4651c50241619525355", -1}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV2 + }, + { // Provided by sev { "sleepingcub", @@ -225,6 +348,24 @@ static const ComposerGameDescription gameDescriptions[] = { GType_ComposerV2 }, + // Sleeping Cub Mac - From Bug #3461369 + { + { + "sleepingcub", + 0, + { + {"sleeping cub.ini", 0, "39642a4036cb51443f5e90052c3ad0b2", -1}, + {"page99.rsc", 0, "219fbd9bd2ff87c7023814405d753145", -1}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV2 + }, + { AD_TABLE_END_MARKER, 0 } }; @@ -235,6 +376,7 @@ using namespace Composer; // we match from data too, to stop detection from a non-top-level directory const static char *directoryGlobs[] = { "data", + "liam", "programs", "princess", "sleepcub", diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp index 4d1284a802..9da5413013 100644 --- a/engines/cruise/background.cpp +++ b/engines/cruise/background.cpp @@ -129,7 +129,7 @@ int loadBackground(const char *name, int idx) { flagSpeed = 0; } - if (!strcmp((char*)ptr, "PAL")) { + if (!strcmp((char *)ptr, "PAL")) { memcpy(palScreen[idx], ptr + 4, 256*3); gfxModuleData_setPal256(palScreen[idx]); } else { diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp index 39286670ed..ddda8dee45 100644 --- a/engines/cruise/backgroundIncrust.cpp +++ b/engines/cruise/backgroundIncrust.cpp @@ -46,7 +46,7 @@ void backupBackground(backgroundIncrustStruct *pIncrust, int X, int Y, int width pIncrust->savedX = X; pIncrust->savedY = Y; - pIncrust->ptr = (uint8*)MemAlloc(width * height); + pIncrust->ptr = (uint8 *)MemAlloc(width * height); for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { int xp = j + X; @@ -169,7 +169,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx, int16 objectIdx, int sizeTable[4]; // 0 = left, 1 = right, 2 = bottom, 3 = top // this function checks if the dataPtr is not 0, else it retrives the data for X, Y, scale and DataPtr again (OLD: mainDrawSub1Sub1) - flipPoly(params.fileIdx, (int16*)filesDatabase[params.fileIdx].subData.ptr, params.scale, &newFrame, newElement->X, newElement->Y, &newX, &newY, &newScale); + flipPoly(params.fileIdx, (int16 *)filesDatabase[params.fileIdx].subData.ptr, params.scale, &newFrame, newElement->X, newElement->Y, &newX, &newY, &newScale); // this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2) getPolySize(newX, newY, newScale, sizeTable, (unsigned char*)newFrame); @@ -213,7 +213,7 @@ void regenerateBackgroundIncrust(backgroundIncrustStruct *pHead) { drawSprite(width, height, NULL, filesDatabase[frame].subData.ptr, pl->Y, pl->X, backgroundScreens[pl->backgroundIdx], filesDatabase[frame].subData.ptrMask); } else { // Poly - addBackgroundIncrustSub1(frame, pl->X, pl->Y, NULL, pl->scale, (char*)backgroundScreens[pl->backgroundIdx], (char *)filesDatabase[frame].subData.ptr); + addBackgroundIncrustSub1(frame, pl->X, pl->Y, NULL, pl->scale, (char *)backgroundScreens[pl->backgroundIdx], (char *)filesDatabase[frame].subData.ptr); } backgroundChanged[pl->backgroundIdx] = true; diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h index 94f8759d01..9782df8f09 100644 --- a/engines/cruise/cruise.h +++ b/engines/cruise/cruise.h @@ -116,7 +116,7 @@ public: static uint32 const cookie = 0x41424344; }; - Common::List<MemInfo*> _memList; + Common::List<MemInfo *> _memList; typedef Common::List<Common::Rect> RectList; diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index a1337aefa7..6e2847d6d7 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -45,7 +45,7 @@ typedef CruiseEngine::MemInfo MemInfo; void MemoryList() { if (!_vm->_memList.empty()) { debug("Current list of un-freed memory blocks:"); - Common::List<MemInfo*>::iterator i; + Common::List<MemInfo *>::iterator i; for (i = _vm->_memList.begin(); i != _vm->_memList.end(); ++i) { MemInfo const *const v = *i; debug("%s - %d", v->fname, v->lineNum); @@ -691,7 +691,7 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) { if ((filesDatabase[j].subData.resourceType == OBJ_TYPE_POLY) && (filesDatabase[j].subData.ptr)) { int zoom = params.scale; - int16* dataPtr = (int16*)filesDatabase[j].subData.ptr; + int16* dataPtr = (int16 *)filesDatabase[j].subData.ptr; if (*dataPtr == 0) { int16 offset; @@ -723,7 +723,7 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) { y -= newY; } - if (dataPtr && findPoly((char*)dataPtr, x, y, zoom, mouseX, mouseY)) { + if (dataPtr && findPoly((char *)dataPtr, x, y, zoom, mouseX, mouseY)) { *outObjOvl = linkedObjOvl; *outObjIdx = linkedObjIdx; diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp index 76479d7a10..94d075ecc3 100644 --- a/engines/cruise/dataLoader.cpp +++ b/engines/cruise/dataLoader.cpp @@ -420,7 +420,7 @@ int loadSetEntry(const char *name, uint8 *ptr, int currentEntryIdx, int currentD int sec = 0; uint16 numIdx; - if (!strcmp((char*)ptr, "SEC")) { + if (!strcmp((char *)ptr, "SEC")) { sec = 1; } diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp index a6680f7a02..2fd86a11b7 100644 --- a/engines/cruise/font.cpp +++ b/engines/cruise/font.cpp @@ -106,7 +106,7 @@ void loadFNT(const char *fileName) { fontFileHandle.read(header, 4); - if (strcmp((char*)header, "FNT") == 0) { + if (strcmp((char *)header, "FNT") == 0) { uint32 fontSize = fontFileHandle.readUint32BE(); _systemFNT = (uint8 *)mallocAndZero(fontSize); diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 27b9be7e79..610465e962 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -142,7 +142,7 @@ int16 Op_AddProc() { if (procBss) { for (long int i = 0; i < pop1; i++) { - int16* ptr = (int16*)(procBss + i * 2); + int16* ptr = (int16 *)(procBss + i * 2); *ptr = param[i]; bigEndianShortToNative(ptr); } @@ -1046,7 +1046,7 @@ int16 Op_ComputeLine() { int y1 = popVar(); int x1 = popVar(); - point* pDest = (point*)popPtr(); + point* pDest = (point *)popPtr(); int maxValue = cor_droite(x1, y1, x2, y2, pDest); @@ -1334,7 +1334,7 @@ int16 Op_TrackAnim() { // setup actor position } int16 Op_BgName() { - char* bgName = (char*)popPtr(); + char* bgName = (char *)popPtr(); int bgIdx = popVar(); if ((bgIdx >= 0) && (bgIdx < NBSCREENS) && bgName) { @@ -1524,7 +1524,7 @@ int16 Op_Itoa() { param[i] = popVar(); int val = popVar(); - char* pDest = (char*)popPtr(); + char* pDest = (char *)popPtr(); if (!nbp) sprintf(txt, "%d", val); @@ -1645,7 +1645,7 @@ int16 Op_SetVolume() { } int16 Op_SongExist() { - const char *songName = (char*)popPtr(); + const char *songName = (char *)popPtr(); if (songName) { char name[33]; diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp index 9a5df69cae..24f65500db 100644 --- a/engines/cruise/mainDraw.cpp +++ b/engines/cruise/mainDraw.cpp @@ -185,7 +185,7 @@ void flipPoly(int fileId, int16 *dataPtr, int scale, char** newFrame, int X, int Y -= newY; } - *newFrame = (char*)dataPtr; + *newFrame = (char *)dataPtr; *outX = X; *outY = Y; *outScale = scale; @@ -1077,7 +1077,7 @@ void mainDrawPolygons(int fileIndex, cellStruct *plWork, int X, int scale, int Y int sizeTable[4]; // 0 = left, 1 = right, 2 = bottom, 3 = top // this function checks if the dataPtr is not 0, else it retrives the data for X, Y, scale and DataPtr again (OLD: mainDrawSub1Sub1) - flipPoly(fileIndex, (int16*)dataPtr, scale, &newFrame, X, Y, &newX, &newY, &newScale); + flipPoly(fileIndex, (int16 *)dataPtr, scale, &newFrame, X, Y, &newX, &newY, &newScale); // this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2) getPolySize(newX, newY, newScale, sizeTable, (unsigned char*)newFrame); @@ -1143,7 +1143,7 @@ void mainDrawPolygons(int fileIndex, cellStruct *plWork, int X, int scale, int Y } // this function builds the poly model and then calls the draw functions (OLD: mainDrawSub1Sub5) - buildPolyModel(newX, newY, newScale, (char*)polygonMask, destBuffer, newFrame); + buildPolyModel(newX, newY, newScale, (char *)polygonMask, destBuffer, newFrame); } void drawMessage(const gfxEntryStruct *pGfxPtr, int globalX, int globalY, int width, int newColor, uint8 *ouputPtr) { @@ -1419,7 +1419,7 @@ void mainDraw(int16 param) { currentObjPtr = cellHead.next; #ifdef _DEBUG - /* polyOutputBuffer = (char*)bgPtr; + /* polyOutputBuffer = (char *)bgPtr; drawCtp(); */ #endif diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index e2bd1ebc34..26bea0441c 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -924,10 +924,10 @@ Common::Error loadSavegameData(int saveGameIdx) { if (ptr) { ASSERT(0); - //*(int16*)(currentcellHead->datas+0x2E) = getSprite(ptr,*(int16*)(currentcellHead->datas+0xE)); + //*(int16 *)(currentcellHead->datas+0x2E) = getSprite(ptr,*(int16 *)(currentcellHead->datas+0xE)); } else { ASSERT(0); - //*(int16*)(currentcellHead->datas+0x2E) = 0; + //*(int16 *)(currentcellHead->datas+0x2E) = 0; } } diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp index cf28548e7d..d753d938bd 100644 --- a/engines/cruise/script.cpp +++ b/engines/cruise/script.cpp @@ -33,7 +33,7 @@ scriptInstanceStruct procHead; scriptInstanceStruct *currentScriptPtr; int8 getByteFromScript() { - int8 var = *(int8*)(currentData3DataPtr + currentScriptPtr->scriptOffset); + int8 var = *(int8 *)(currentData3DataPtr + currentScriptPtr->scriptOffset); ++currentScriptPtr->scriptOffset; return (var); @@ -202,7 +202,7 @@ int32 opcodeType1() { di = currentScriptPtr->overlayNumber; } - if ((var == 0x85) && !strcmp((char*)currentCtpName, "S26.CTP") && !di && mode == 1) { // patch in bar + if ((var == 0x85) && !strcmp((char *)currentCtpName, "S26.CTP") && !di && mode == 1) { // patch in bar var = 0x87; } diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index 92ce7d31d9..965cdabf3e 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -318,7 +318,7 @@ void Text::repeatedlySplitLongLines(uint maxWidth) { } void Text::splitLinesLongerThan(uint maxWidth) { - char *start = const_cast<char*> (_text.c_str()); // hacky + char *start = const_cast<char *> (_text.c_str()); // hacky while (1) { char *end = strchr(start, '|'); if (end) { diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp index 761ce7696f..4779d0baef 100644 --- a/engines/dreamweb/saveload.cpp +++ b/engines/dreamweb/saveload.cpp @@ -260,7 +260,7 @@ void DreamWebEngine::saveGame() { } char descbuf[17] = { 2, 0 }; - Common::strlcpy((char*)descbuf + 1, game_description.c_str(), 16); + Common::strlcpy((char *)descbuf + 1, game_description.c_str(), 16); unsigned int desclen = game_description.size(); if (desclen > 15) desclen = 15; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index d93add6b42..5f8ea53ada 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -30,76 +30,91 @@ namespace DreamWeb { uint8 g_keyBuffer[16]; const Room g_roomData[] = { + // location 0 { "DREAMWEB.R00", // Ryan's apartment 5,255,33,10, 255,255,255,0, 1,6,2,255,3,255,255,255,255,255,0 }, + // location 1 { "DREAMWEB.R01", 1,255,44,10, 255,255,255,0, 7,2,255,255,255,255,6,255,255,255,1 }, + // location 2: Louis' (?) { "DREAMWEB.R02", 2,255,33,0, 255,255,255,0, 1,0,255,255,1,255,3,255,255,255,2 }, + // location 3 { "DREAMWEB.R03", 5,255,33,10, 255,255,255,0, 2,2,0,2,4,255,0,255,255,255,3 }, + // location 4 { "DREAMWEB.R04", 23,255,11,30, 255,255,255,0, 1,4,0,5,255,255,3,255,255,255,4 }, + // location 5: In hotel, lift noise audible (?) { "DREAMWEB.R05", 5,255,22,30, // if demo: 22,255,22,30, 255,255,255,0, 1,2,0,4,255,255,3,255,255,255,5 }, + // location 6: sarters (?) { "DREAMWEB.R06", 5,255,11,30, 255,255,255,0, 1,0,0,1,2,255,0,255,255,255,6 }, + // location 7 { "DREAMWEB.R07", 255,255,0,20, 255,255,255,0, 2,2,255,255,255,255,0,255,255,255,7 }, + // location 8: TV studio (?) { "DREAMWEB.R08", 8,255,0,10, 255,255,255,0, 1,2,255,255,255,255,0,11,40,0,8 }, + // location 9 { "DREAMWEB.R09", 9,255,22,10, 255,255,255,0, 4,6,255,255,255,255,0,255,255,255,9 }, + // location 10 { "DREAMWEB.R10", 10,255,33,30, 255,255,255,0, 2,0,255,255,2,2,4,22,30,255,10 }, // 22,30,0 switches // off path 0 in skip + // location 11 { "DREAMWEB.R11", 11,255,11,20, 255,255,255,0, 0,4,255,255,255,255,255,255,255,255,11 }, + // location 12 { "DREAMWEB.R12", 12,255,22,20, 255,255,255,0, 1,4,255,255,255,255,255,255,255,255,12 }, + // location 13: boathouse (?) { "DREAMWEB.R13", 12,255,22,20, 255,255,255,0, 1,4,255,255,255,255,255,255,255,255,13 }, + // location 14 { "DREAMWEB.R14", 14,255,44,20, 255,255,255,0, @@ -110,166 +125,196 @@ const Room g_roomData[] = { { "", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, { "", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, + // location 19 { "DREAMWEB.R19", 19,255,0,0, 255,255,255,0, 0,4,255,255,255,255,255,255,255,255,19 }, + // location 20: Sart room (?) { "DREAMWEB.R20", 22,255,0,20, 255,255,255,0, 1,4,2,15,255,255,255,255,255,255,20 }, + // location 21: lift noise audible (?) { "DREAMWEB.R21", 5,255,11,10, // if demo: 22,255,11,10, 255,255,255,0, 1,4,2,15,1,255,255,255,255,255,21 }, + // location 22: pool room (?) { "DREAMWEB.R22", 22,255,22,10, 255,255,255,0, 0,4,255,255,1,255,255,255,255,255,22 }, + // location 23 { "DREAMWEB.R23", 23,255,22,30, 255,255,255,0, 1,4,2,15,3,255,255,255,255,255,23 }, + // location 24: only room in which initialInv() is active, i.e. we get initial inventory here { "DREAMWEB.R24", 5,255,44,0, 255,255,255,0, 1,6,2,15,255,255,255,255,255,255,24 }, + // location 25: helicopter (?) { "DREAMWEB.R25", 22,255,11,40, 255,255,255,0, 1,0,255,255,255,255,255,255,255,255,25 }, + // location 26: reached via trap door (?) { "DREAMWEB.R26", 9,255,22,20, 255,255,255,0, 4,2,255,255,255,255,255,255,255,255,26 }, + // location 27: rock room (?) { "DREAMWEB.R27", 22,255,11,20, 255,255,255,0, 0,6,255,255,255,255,255,255,255,255,27 }, + // location 28: related to TV studiou (?), see resetLocation() { "DREAMWEB.R28", 5,255,11,30, 255,255,255,0, 0,0,255,255,2,255,255,255,255,255,28 }, + // location 29: aide (?) { "DREAMWEB.R29", 22,255,11,10, 255,255,255,0, 0,2,255,255,255,255,255,255,255,255,29 }, - + // location 30 { "DREAMWEB.R05", // Duplicate of hotel lobby, but emerging from the lift. 5,255,22,10, // if demo: 22,255,22,10 255,255,255,0, 1,4,1,15,255,255,255,255,255,255,5 }, + // location 31 { "DREAMWEB.R04", // Duplicate of pool hall lobby, 23,255,22,20, // but emerging from the lift. 255,255,255,0, 1,4,2,15,255,255,255,255,255,255,4 }, + // location 32 { "DREAMWEB.R10", // entering alley via skip 10,255,22,30, 255,255,255,0, 3,6,255,255,255,255,255,255,255,255,10 }, + // location 33 { "DREAMWEB.R12", // on the beach, getting up. 12,255,22,20, 255,255,255,0, 0,2,255,255,255,255,255,255,255,255,12 }, + // location 34 { "DREAMWEB.R03", // Duplicate of Eden's lobby 5,255,44,0, // but emerging from the lift 255,255,255,0, 1,6,2,255,4,255,255,255,255,255,3 }, + // location 35: Location when starting the game, after dream (?) { "DREAMWEB.R24", // Duplicate of Eden's flat 5,255,22,0, // but starting on the bed 255,255,255,0, 3,6,0,255,255,255,255,33,0,3,24 }, // 33,0,3 turns off path for lift + // location 36 { "DREAMWEB.R22", // Duplicate 22,255,22,20, // of hotel but in pool room 255,255,255,0, 1,4,255,255,255,255,255,255,255,255,22 }, + // location 37 { "DREAMWEB.R22", // Duplicate 22,255,22,20, // of hotel but in pool room 255,255,255,0, // coming out of bedroom 0,2,255,255,255,255,255,255,255,255,22 }, + // location 38 { "DREAMWEB.R11", // Duplicate 11,255,22,30, // of carpark but getting 255,255,255,0, // up off the floor 0,0,255,255,255,255,255,255,255,255,11 }, + // location 39 { "DREAMWEB.R28", 5,255,11,20, 255,255,255,0, 0,6,255,255,2,255,255,255,255,255,28 }, + // location 40 { "DREAMWEB.R21", 5,255,11,10, // if demo: 22,255,11,10 255,255,255,0, 1,4,2,15,1,255,255,255,255,255,21 }, + // location 41 { "DREAMWEB.R26", 9,255,0,40, 255,255,255,0, 0,0,255,255,255,255,255,255,255,255,26 }, + // location 42 { "DREAMWEB.R19", 19,255,0,0, 255,255,255,0, 2,2,255,255,255,255,255,255,255,255,19 }, + // location 43 { "DREAMWEB.R08", // leaving tvstudio into street 8,255,11,40, 255,255,255,0, 0,4,255,255,255,255,255,255,255,255,8 }, + // location 44 { "DREAMWEB.R01", 1,255,44,10, 255,255,255,0, 3,6,255,255,255,255,255,255,255,255,1 }, + // location 45 { "DREAMWEB.R45", // Dream room 35,255,22,30, 255,255,255,0, 0,6,255,255,255,255,255,255,255,255,45 }, + // location 46 { "DREAMWEB.R46", // Dream room 35,255,22,40, 255,255,255,0, 0,4,255,255,255,255,255,255,255,255,46 }, + // location 47 { "DREAMWEB.R47", // Dream room 35,255,0,0, 255,255,255,0, 0,0,255,255,255,255,255,255,255,255,47 }, + // location 48 { "DREAMWEB.R45", // Dream room 35,255,22,30, 255,255,255,0, 4,0,255,255,255,255,255,255,255,255,45 }, + // location 49 { "DREAMWEB.R46", // Dream room 35,255,22,50, 255,255,255,0, 0,4,255,255,255,255,255,255,255,255,46 }, - + // location 50 { "DREAMWEB.R50", // Intro sequence one 35,255,22,30, 255,255,255,0, diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index a8b4417459..68415233f4 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -373,7 +373,7 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) { DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) { rect.translate(0, -80); _vm->_graphicsMan->_foreground.frameRect(rect, 250); - _vm->_system->copyRectToScreen((byte*)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320); + _vm->_system->copyRectToScreen((byte *)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320); _vm->_system->updateScreen(); } diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp index 892c144393..896e8fa2ce 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -1104,7 +1104,7 @@ void Scheduler::restoreEvents(Common::ReadStream *f) { if ((index == -1) && (subElem == -1)) _events[i].action = 0; else - _events[i].action = (act*)&_actListArr[index][subElem]; + _events[i].action = (act *)&_actListArr[index][subElem]; _events[i].localActionFl = (f->readByte() == 1) ? true : false; _events[i].time = f->readUint32BE(); diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp index 9dcd7d346a..d0b4e3dfe8 100644 --- a/engines/hugo/sound.cpp +++ b/engines/hugo/sound.cpp @@ -256,7 +256,7 @@ void SoundHandler::checkMusic() { } void SoundHandler::loopPlayer(void *refCon) { - ((SoundHandler*)refCon)->pcspkr_player(); + ((SoundHandler *)refCon)->pcspkr_player(); } /** diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h index e3ea533c63..dff2427ddb 100644 --- a/engines/kyra/eobcommon.h +++ b/engines/kyra/eobcommon.h @@ -623,7 +623,7 @@ protected: uint32 _envAudioTimer; uint16 _teleporterPulse; - Common::Array<const int16*> _dscWallMapping; + Common::Array<const int16 *> _dscWallMapping; const int16 *_dscShapeCoords; const uint8 *_dscItemPosIndex; @@ -945,11 +945,11 @@ protected: void printNoEffectWarning(); void spellCallback_start_empty() {} - bool spellCallback_end_empty(void*) { return true; } + bool spellCallback_end_empty(void *) { return true; } void spellCallback_start_armor(); void spellCallback_start_burningHands(); void spellCallback_start_detectMagic(); - bool spellCallback_end_detectMagic(void*); + bool spellCallback_end_detectMagic(void *); void spellCallback_start_magicMissile(); bool spellCallback_end_magicMissile(void *obj); void spellCallback_start_shockingGrasp(); @@ -981,7 +981,7 @@ protected: void spellCallback_start_fleshToStone(); void spellCallback_start_stoneToFlesh(); void spellCallback_start_trueSeeing(); - bool spellCallback_end_trueSeeing(void*); + bool spellCallback_end_trueSeeing(void *); void spellCallback_start_slayLiving(); void spellCallback_start_powerWordStun(); void spellCallback_start_causeLightWounds(); diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index fd2c1870a8..0ba173d9d0 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -171,7 +171,7 @@ KyraEngine_HoF::~KyraEngine_HoF() { delete[] _conversationState[i]; delete[] _conversationState; - for (Common::Array<const TIMOpcode*>::iterator i = _timOpcodes.begin(); i != _timOpcodes.end(); ++i) + for (Common::Array<const TIMOpcode *>::iterator i = _timOpcodes.begin(); i != _timOpcodes.end(); ++i) delete *i; _timOpcodes.clear(); } diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h index 320f930b56..182854cdf1 100644 --- a/engines/kyra/kyra_hof.h +++ b/engines/kyra/kyra_hof.h @@ -656,7 +656,7 @@ protected: int t2_resetChat(const TIM *tim, const uint16 *param); int t2_playSoundEffect(const TIM *tim, const uint16 *param); - Common::Array<const TIMOpcode*> _timOpcodes; + Common::Array<const TIMOpcode *> _timOpcodes; // sound int _oldTalkFile; diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 4e07c8f343..39ed0d038a 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -183,7 +183,7 @@ KyraEngine_MR::~KyraEngine_MR() { delete[] _sceneStrings; delete[] _talkObjectList; - for (Common::Array<const Opcode*>::iterator i = _opcodesDialog.begin(); i != _opcodesDialog.end(); ++i) + for (Common::Array<const Opcode *>::iterator i = _opcodesDialog.begin(); i != _opcodesDialog.end(); ++i) delete *i; _opcodesDialog.clear(); diff --git a/engines/kyra/kyra_mr.h b/engines/kyra/kyra_mr.h index 7c022534a2..004236ca04 100644 --- a/engines/kyra/kyra_mr.h +++ b/engines/kyra/kyra_mr.h @@ -463,7 +463,7 @@ private: void npcChatSequence(const char *str, int object, int vocHigh, int vocLow); - Common::Array<const Opcode*> _opcodesDialog; + Common::Array<const Opcode *> _opcodesDialog; int o3d_updateAnim(EMCState *script); int o3d_delay(EMCState *script); diff --git a/engines/kyra/kyra_rpg.cpp b/engines/kyra/kyra_rpg.cpp index b8d56b3ecb..b28292562a 100644 --- a/engines/kyra/kyra_rpg.cpp +++ b/engines/kyra/kyra_rpg.cpp @@ -148,7 +148,7 @@ Common::Error KyraRpgEngine::init() { _levelDecorationProperties = new LevelDecorationProperty[100]; memset(_levelDecorationProperties, 0, 100 * sizeof(LevelDecorationProperty)); _levelDecorationShapes = new uint8*[400]; - memset(_levelDecorationShapes, 0, 400 * sizeof(uint8*)); + memset(_levelDecorationShapes, 0, 400 * sizeof(uint8 *)); _levelBlockProperties = new LevelBlockProperty[1025]; memset(_levelBlockProperties, 0, 1025 * sizeof(LevelBlockProperty)); @@ -178,7 +178,7 @@ Common::Error KyraRpgEngine::init() { _vcnExpTable[i] = i & 0x0f; _doorShapes = new uint8*[6]; - memset(_doorShapes, 0, 6 * sizeof(uint8*)); + memset(_doorShapes, 0, 6 * sizeof(uint8 *)); initStaticResource(); diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 67332eccdb..04bfab2cb8 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -326,7 +326,7 @@ protected: // opcode virtual void setupOpcodeTable() = 0; - Common::Array<const Opcode*> _opcodes; + Common::Array<const Opcode *> _opcodes; int o1_queryGameFlag(EMCState *script); int o1_setGameFlag(EMCState *script); diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 72d743710d..563416bf1e 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -224,7 +224,7 @@ protected: // Sequences EMCData _animationScriptData; EMCState _animationScriptState; - Common::Array<const Opcode*> _opcodesAnimation; + Common::Array<const Opcode *> _opcodesAnimation; void runAnimationScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload); @@ -252,7 +252,7 @@ protected: virtual void uninitAnimationShapes(int count, uint8 *filedata) = 0; // Shapes - typedef Common::HashMap<int, uint8*> ShapeMap; + typedef Common::HashMap<int, uint8 *> ShapeMap; ShapeMap _gameShapes; uint8 *getShapePtr(int index) const; diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index bb8f24eb66..dbd461267f 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -447,7 +447,7 @@ private: uint16 _envSfxQueuedBlocks[10]; int _nextSpeechId; int _nextSpeaker; - typedef Common::List<Audio::SeekableAudioStream*> SpeechList; + typedef Common::List<Audio::SeekableAudioStream *> SpeechList; SpeechList _speechList; int _curTlkFile; @@ -762,14 +762,14 @@ private: // tim opcode void setupOpcodeTable(); - Common::Array<const TIMOpcode*> _timIntroOpcodes; + Common::Array<const TIMOpcode *> _timIntroOpcodes; int tlol_setupPaletteFade(const TIM *tim, const uint16 *param); int tlol_loadPalette(const TIM *tim, const uint16 *param); int tlol_setupPaletteFadeEx(const TIM *tim, const uint16 *param); int tlol_processWsaFrame(const TIM *tim, const uint16 *param); int tlol_displayText(const TIM *tim, const uint16 *param); - Common::Array<const TIMOpcode*> _timOutroOpcodes; + Common::Array<const TIMOpcode *> _timOutroOpcodes; int tlol_fadeInScene(const TIM *tim, const uint16 *param); int tlol_unusedResourceFunc(const TIM *tim, const uint16 *param); int tlol_fadeInPalette(const TIM *tim, const uint16 *param); @@ -778,7 +778,7 @@ private: int tlol_delayForChat(const TIM *tim, const uint16 *param); int tlol_fadeOutSound(const TIM *tim, const uint16 *param); - Common::Array<const TIMOpcode*> _timIngameOpcodes; + Common::Array<const TIMOpcode *> _timIngameOpcodes; int tlol_initSceneWindowDialogue(const TIM *tim, const uint16 *param); int tlol_restoreAfterSceneWindowDialogue(const TIM *tim, const uint16 *param); int tlol_giveItem(const TIM *tim, const uint16 *param); @@ -1156,7 +1156,7 @@ private: // spells typedef Common::Functor1Mem<ActiveSpell *, int, LoLEngine> SpellProc; - Common::Array<const SpellProc*> _spellProcs; + Common::Array<const SpellProc *> _spellProcs; typedef void (LoLEngine::*SpellProcCallback)(WSAMovie_v2 *, int, int); int castSpell(int charNum, int spellType, int spellLevel); diff --git a/engines/kyra/saveload_rpg.cpp b/engines/kyra/saveload_rpg.cpp index 2e9f0228cf..f3eef0d811 100644 --- a/engines/kyra/saveload_rpg.cpp +++ b/engines/kyra/saveload_rpg.cpp @@ -118,7 +118,7 @@ void KyraRpgEngine::restoreFlyingObjectTempData(LevelTempData *tmp) { } void KyraRpgEngine::releaseFlyingObjectTempData(LevelTempData *tmp) { - EoBFlyingObject *p = (EoBFlyingObject*)tmp->flyingObjects; + EoBFlyingObject *p = (EoBFlyingObject *)tmp->flyingObjects; delete[] p; } diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 2b701e3b81..6a76cfd0d5 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -3200,7 +3200,7 @@ void Screen::crossFadeRegion(int x1, int y1, int x2, int y2, int w, int h, int s hideMouse(); - uint16 *wB = (uint16*)_pagePtrs[14]; + uint16 *wB = (uint16 *)_pagePtrs[14]; uint8 *hB = _pagePtrs[14] + 640; for (int i = 0; i < w; i++) diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index dd74692a5d..62ea35af9e 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -554,7 +554,7 @@ protected: uint8 _sjisInvisibleColor; Palette *_screenPalette; - Common::Array<Palette*> _palettes; + Common::Array<Palette *> _palettes; Palette *_internFadePalette; Font *_fonts[FID_NUM]; diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index 1981341063..303cbb45aa 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -95,7 +95,7 @@ bool EMCInterpreter::callback(Common::IFFChunk &chunk) { return false; } -bool EMCInterpreter::load(const char *filename, EMCData *scriptData, const Common::Array<const Opcode*> *opcodes) { +bool EMCInterpreter::load(const char *filename, EMCData *scriptData, const Common::Array<const Opcode *> *opcodes) { Common::SeekableReadStream *stream = _vm->resource()->createReadStream(filename); if (!stream) { error("Couldn't open script file '%s'", filename); diff --git a/engines/kyra/script.h b/engines/kyra/script.h index dffb4e27f5..ccbe733e4d 100644 --- a/engines/kyra/script.h +++ b/engines/kyra/script.h @@ -41,7 +41,7 @@ struct EMCData { uint16 *ordr; uint16 dataSize; - const Common::Array<const Opcode*> *sysFuncs; + const Common::Array<const Opcode *> *sysFuncs; }; struct EMCState { @@ -109,7 +109,7 @@ class EMCInterpreter { public: EMCInterpreter(KyraEngine_v1 *vm); - bool load(const char *filename, EMCData *data, const Common::Array<const Opcode*> *opcodes); + bool load(const char *filename, EMCData *data, const Common::Array<const Opcode *> *opcodes); void unload(EMCData *data); void init(EMCState *scriptState, const EMCData *data); diff --git a/engines/kyra/script_eob.h b/engines/kyra/script_eob.h index 391791522a..fc8b4cfc31 100644 --- a/engines/kyra/script_eob.h +++ b/engines/kyra/script_eob.h @@ -99,7 +99,7 @@ private: InfProc *proc; Common::String desc; }; - Common::Array<const InfOpcode*> _opcodes; + Common::Array<const InfOpcode *> _opcodes; int8 *_scriptData; uint16 _scriptSize; diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp index 73b6915c89..b80b8105a1 100644 --- a/engines/kyra/script_hof.cpp +++ b/engines/kyra/script_hof.cpp @@ -1480,7 +1480,7 @@ typedef Common::Functor2Mem<const TIM *, const uint16 *, int, KyraEngine_HoF> TI #define OpcodeTimUnImpl() _timOpcodes.push_back(new TIMOpcodeV2(this, 0)) void KyraEngine_HoF::setupOpcodeTable() { - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; _opcodes.reserve(176); SetOpcodeTable(_opcodes); diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp index 56b2a48b89..afe11aba02 100644 --- a/engines/kyra/script_mr.cpp +++ b/engines/kyra/script_mr.cpp @@ -1129,7 +1129,7 @@ typedef Common::Functor1Mem<EMCState *, int, KyraEngine_MR> OpcodeV3; #define Opcode(x) table->push_back(new OpcodeV3(this, &KyraEngine_MR::x)) #define OpcodeUnImpl() table->push_back(new OpcodeV3(this, 0)) void KyraEngine_MR::setupOpcodeTable() { - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; _opcodes.reserve(176); SetOpcodeTable(_opcodes); diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 7995ad21f1..177d7993a0 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -135,7 +135,7 @@ bool TIMInterpreter::callback(Common::IFFChunk &chunk) { return false; } -TIM *TIMInterpreter::load(const char *filename, const Common::Array<const TIMOpcode*> *opcodes) { +TIM *TIMInterpreter::load(const char *filename, const Common::Array<const TIMOpcode *> *opcodes) { if (!_vm->resource()->exists(filename)) return 0; diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h index e132ed78c5..aa512daae8 100644 --- a/engines/kyra/script_tim.h +++ b/engines/kyra/script_tim.h @@ -146,7 +146,7 @@ struct TIM { uint16 *avtl; uint8 *text; - const Common::Array<const TIMOpcode*> *opcodes; + const Common::Array<const TIMOpcode *> *opcodes; // TODO: Get rid of this ugly HACK to allow the // Lands of Lore outro to be working properly. @@ -159,7 +159,7 @@ public: TIMInterpreter(KyraEngine_v1 *engine, Screen_v2 *screen_v2, OSystem *system); virtual ~TIMInterpreter(); - TIM *load(const char *filename, const Common::Array<const TIMOpcode*> *opcodes); + TIM *load(const char *filename, const Common::Array<const TIMOpcode *> *opcodes); void unload(TIM *&tim) const; bool callback(Common::IFFChunk &chunk); diff --git a/engines/lastexpress/entities/alexei.cpp b/engines/lastexpress/entities/alexei.cpp index 073ca3f175..54c2d87b89 100644 --- a/engines/lastexpress/entities/alexei.cpp +++ b/engines/lastexpress/entities/alexei.cpp @@ -355,7 +355,7 @@ IMPLEMENT_FUNCTION_IS(16, Alexei, function16, TimeValue) break; case kActionDefault: - getEntities()->drawSequenceLeft(kEntityAlexei, (char*)¶ms->seq); + getEntities()->drawSequenceLeft(kEntityAlexei, (char *)¶ms->seq); getObjects()->update(kObjectCompartment2, kEntityAlexei, kObjectLocation1, kCursorHandKnock, kCursorHand); getObjects()->update(kObjectHandleInsideBathroom, kEntityAlexei, kObjectLocation1, kCursorHandKnock, kCursorHand); break; diff --git a/engines/lastexpress/entities/entity_intern.h b/engines/lastexpress/entities/entity_intern.h index bf75e022de..2da0da15b3 100644 --- a/engines/lastexpress/entities/entity_intern.h +++ b/engines/lastexpress/entities/entity_intern.h @@ -94,7 +94,7 @@ void class::setup_##name() { \ // Expose parameters and check validity #define EXPOSE_PARAMS(type) \ - type *params = (type*)_data->getCurrentParameters(); \ + type *params = (type *)_data->getCurrentParameters(); \ if (!params) \ error("[EXPOSE_PARAMS] Trying to call an entity function with invalid parameters"); \ @@ -307,7 +307,7 @@ void class::setup_##name() { \ ////////////////////////////////////////////////////////////////////////// #define RESET_ENTITY_STATE(entity, class, function) \ getEntities()->resetState(entity); \ - ((class*)getEntities()->get(entity))->function(); + ((class *)getEntities()->get(entity))->function(); ////////////////////////////////////////////////////////////////////////// // Parameters macros (for default IIII parameters) diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp index 894663dda6..f27087a609 100644 --- a/engines/lastexpress/game/entities.cpp +++ b/engines/lastexpress/game/entities.cpp @@ -615,9 +615,9 @@ void Entities::resetSequences(EntityIndex entityIndex) const { getData(entityIndex)->field_4A9 = false; getData(entityIndex)->field_4AA = false; - strcpy((char*)&getData(entityIndex)->sequenceNameCopy, ""); - strcpy((char*)&getData(entityIndex)->sequenceName, ""); - strcpy((char*)&getData(entityIndex)->sequenceName2, ""); + strcpy((char *)&getData(entityIndex)->sequenceNameCopy, ""); + strcpy((char *)&getData(entityIndex)->sequenceName, ""); + strcpy((char *)&getData(entityIndex)->sequenceName2, ""); getScenes()->resetQueue(); } diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp index 0aecae22ec..bf0abdea07 100644 --- a/engines/lure/sound.cpp +++ b/engines/lure/sound.cpp @@ -635,7 +635,7 @@ MidiMusic::MidiMusic(MidiDriver *driver, ChannelEntry channels[NUM_CHANNELS], for (uint i = 0; i < packedSize; i++) #if defined(SCUMM_NEED_ALIGNMENT) - memcpy(dataDest++, (byte*)((byte*)data + *(idx + i) * sizeof(uint16)), sizeof(uint16)); + memcpy(dataDest++, (byte *)((byte *)data + *(idx + i) * sizeof(uint16)), sizeof(uint16)); #else *dataDest++ = data[*(idx + i)]; #endif diff --git a/engines/made/database.cpp b/engines/made/database.cpp index 454fe09a38..2b87f97392 100644 --- a/engines/made/database.cpp +++ b/engines/made/database.cpp @@ -56,7 +56,7 @@ const char *Object::getString() { void Object::setString(const char *str) { if (getClass() == 0x7FFF) { - char *objStr = (char*)getData(); + char *objStr = (char *)getData(); if (str) strncpy(objStr, str, getSize()); else @@ -86,10 +86,10 @@ int16 Object::getVectorSize() { int16 Object::getVectorItem(int16 index) { if (getClass() == 0x7FFF) { - byte *vector = (byte*)getData(); + byte *vector = (byte *)getData(); return vector[index]; } else if (getClass() <= 0x7FFE) { - int16 *vector = (int16*)getData(); + int16 *vector = (int16 *)getData(); return READ_LE_UINT16(&vector[index]); } else { // should never reach here @@ -100,10 +100,10 @@ int16 Object::getVectorItem(int16 index) { void Object::setVectorItem(int16 index, int16 value) { if (getClass() == 0x7FFF) { - byte *vector = (byte*)getData(); + byte *vector = (byte *)getData(); vector[index] = value; } else if (getClass() <= 0x7FFE) { - int16 *vector = (int16*)getData(); + int16 *vector = (int16 *)getData(); WRITE_LE_UINT16(&vector[index], value); } } @@ -526,7 +526,7 @@ int16 *GameDatabaseV2::findObjectProperty(int16 objectIndex, int16 propertyId, i error("GameDatabaseV2::findObjectProperty(%04X, %04X) Not an object", objectIndex, propertyId); } - int16 *prop = (int16*)obj->getData(); + int16 *prop = (int16 *)obj->getData(); byte count1 = obj->getCount1(); byte count2 = obj->getCount2(); @@ -553,7 +553,7 @@ int16 *GameDatabaseV2::findObjectProperty(int16 objectIndex, int16 propertyId, i obj = getObject(parentObjectIndex); - prop = (int16*)obj->getData(); + prop = (int16 *)obj->getData(); count1 = obj->getCount1(); count2 = obj->getCount2(); @@ -750,7 +750,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i error("GameDatabaseV2::findObjectProperty(%04X, %04X) Not an object", objectIndex, propertyId); } - int16 *prop = (int16*)obj->getData(); + int16 *prop = (int16 *)obj->getData(); byte count1 = obj->getCount1(); byte count2 = obj->getCount2(); @@ -762,7 +762,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i if ((READ_LE_UINT16(prop) & 0x3FFF) == propertyId) { if (READ_LE_UINT16(prop) & 0x4000) { propertyFlag = 1; - return (int16*)_gameState + READ_LE_UINT16(propPtr1); + return (int16 *)_gameState + READ_LE_UINT16(propPtr1); } else { propertyFlag = obj->getFlags() & 1; return propPtr1; @@ -782,7 +782,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i obj = getObject(parentObjectIndex); - prop = (int16*)obj->getData(); + prop = (int16 *)obj->getData(); count1 = obj->getCount1(); count2 = obj->getCount2(); @@ -794,7 +794,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i if ((READ_LE_UINT16(prop) & 0x3FFF) == propertyId) { if (READ_LE_UINT16(prop) & 0x4000) { propertyFlag = 1; - return (int16*)_gameState + READ_LE_UINT16(propPtr1); + return (int16 *)_gameState + READ_LE_UINT16(propPtr1); } else { propertyFlag = obj->getFlags() & 1; return propPtr1; @@ -806,7 +806,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i if ((READ_LE_UINT16(prop) & 0x3FFF) == propertyId) { if (READ_LE_UINT16(prop) & 0x4000) { propertyFlag = 1; - return (int16*)_gameState + READ_LE_UINT16(propertyPtr); + return (int16 *)_gameState + READ_LE_UINT16(propertyPtr); } else { propertyFlag = obj->getFlags() & 1; return propertyPtr; diff --git a/engines/made/database.h b/engines/made/database.h index 63f0557196..89b4b45357 100644 --- a/engines/made/database.h +++ b/engines/made/database.h @@ -151,9 +151,9 @@ public: void dumpObject(int16 index); protected: - typedef Common::HashMap<uint32, int16*> ObjectPropertyCacheMap; + typedef Common::HashMap<uint32, int16 *> ObjectPropertyCacheMap; MadeEngine *_vm; - Common::Array<Object*> _objects; + Common::Array<Object *> _objects; ObjectPropertyCacheMap _objectPropertyCache; byte *_gameState; uint32 _gameStateSize; diff --git a/engines/made/graphics.cpp b/engines/made/graphics.cpp index 30496d8595..4d3fc7116a 100644 --- a/engines/made/graphics.cpp +++ b/engines/made/graphics.cpp @@ -83,7 +83,7 @@ void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, u if ((maskFlags != 0) && (maskFlags != 2) && (pixelFlags != 0) && (pixelFlags != 2) && (cmdFlags != 0)) error("decompressImage() Unsupported flags: cmdFlags = %02X; maskFlags = %02X, pixelFlags = %02X", cmdFlags, maskFlags, pixelFlags); - byte *destPtr = (byte*)surface.getBasePtr(0, 0); + byte *destPtr = (byte *)surface.getBasePtr(0, 0); byte lineBuf[640 * 4]; byte bitBuf[40]; @@ -196,7 +196,7 @@ void decompressMovieImage(byte *source, Graphics::Surface &surface, uint16 cmdOf byte *maskBuffer = source + maskOffs; byte *pixelBuffer = source + pixelOffs; - byte *destPtr = (byte*)surface.getBasePtr(0, 0); + byte *destPtr = (byte *)surface.getBasePtr(0, 0); byte bitBuf[40]; diff --git a/engines/made/resource.h b/engines/made/resource.h index 537801bdc8..a789069272 100644 --- a/engines/made/resource.h +++ b/engines/made/resource.h @@ -111,7 +111,7 @@ public: int16 getWidth() const { return _width; } int16 getHeight() const { return _height; } protected: - Common::Array<Graphics::Surface*> _frames; + Common::Array<Graphics::Surface *> _frames; uint16 _flags; int16 _width, _height; }; @@ -210,7 +210,7 @@ protected: bool _isV1; typedef Common::Array<ResourceSlot> ResourceSlots; - typedef Common::HashMap<uint32, ResourceSlots*> ResMap; + typedef Common::HashMap<uint32, ResourceSlots *> ResMap; void openResourceBlock(const char *filename, Common::File *blockFile, uint32 resType); ResMap _resSlots; @@ -224,7 +224,7 @@ protected: ResourceSlot *slot = getResourceSlot(resType, index); if (!slot) return NULL; - T *res = (T*)getResourceFromCache(slot); + T *res = (T *)getResourceFromCache(slot); if (!res) { byte *buffer; uint32 size; diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp index 168902d577..b49bfff840 100644 --- a/engines/made/screen.cpp +++ b/engines/made/screen.cpp @@ -179,10 +179,10 @@ void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 f clipHeight = clipInfo.clipRect.bottom - y; } - source = (byte*)sourceSurface->getBasePtr(0, startY); - dest = (byte*)clipInfo.destSurface->getBasePtr(x, y); + source = (byte *)sourceSurface->getBasePtr(0, startY); + dest = (byte *)clipInfo.destSurface->getBasePtr(x, y); if (_vm->getGameID() != GID_RTZ) - maskp = (byte*)_maskDrawCtx.destSurface->getBasePtr(x, y); + maskp = (byte *)_maskDrawCtx.destSurface->getBasePtr(x, y); int32 sourcePitch, linePtrAdd, sourceAdd; byte *linePtr; @@ -633,7 +633,7 @@ void Screen::printChar(uint c, int16 x, int16 y, byte color) { return; byte p; - byte *dest = (byte*)_fontDrawCtx.destSurface->getBasePtr(x, y); + byte *dest = (byte *)_fontDrawCtx.destSurface->getBasePtr(x, y); for (uint yc = 0; yc < height; yc++) { p = charData[yc]; diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp index ff0d393885..4e0d463b53 100644 --- a/engines/made/screenfx.cpp +++ b/engines/made/screenfx.cpp @@ -231,10 +231,10 @@ void ScreenEffects::copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, i vfxY1 = y1 & 7; - byte *source = (byte*)surface->getBasePtr(x1, y1); + byte *source = (byte *)surface->getBasePtr(x1, y1); Graphics::Surface *vgaScreen = _screen->lockScreen(); - byte *dest = (byte*)vgaScreen->getBasePtr(x1, y1); + byte *dest = (byte *)vgaScreen->getBasePtr(x1, y1); int16 addX = x2 / 16; diff --git a/engines/made/scriptfuncs.h b/engines/made/scriptfuncs.h index 6b3301755d..03d29c4592 100644 --- a/engines/made/scriptfuncs.h +++ b/engines/made/scriptfuncs.h @@ -68,7 +68,7 @@ protected: Audio::SoundHandle _pcSpeakerHandle1, _pcSpeakerHandle2; Audio::PCSpeaker *_pcSpeaker1, *_pcSpeaker2; - Common::Array<const ExternalFunc*> _externalFuncs; + Common::Array<const ExternalFunc *> _externalFuncs; Common::Array<const char *> _externalFuncNames; GenericResource *_musicRes; diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index 2b1b28716e..08df0a2cbe 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -1011,6 +1011,22 @@ static const MohawkGameDescription gameDescriptions[] = { 0, }, + // Tortoise and the Hare Hebrew variant - From georgeqgreg on bug #3441928 + { + { + "tortoise", + "", + AD_ENTRY1("TORTB.LB", "23135777370cf1ff00aa7247e93642d3"), + Common::HE_ISR, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_LIVINGBOOKSV2, + 0, + 0, + }, + // From afholman in bug#3309308 { { @@ -1293,6 +1309,23 @@ static const MohawkGameDescription gameDescriptions[] = { 0 }, + // Just Grandma and Me 2.0 Macintosh + // From aluff in bug #3461368 + { + { + "grandma", + "v2.0", + AD_ENTRY1("BookOutline", "99fe5c8ace79f0542e6390bc3b58f25a"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_UNSTABLE, + GUIO1(GUIO_NOASPECT) + }, + GType_LIVINGBOOKSV3, + 0, + 0 + }, + // Just Grandma and Me 1.0 // From scoriae { @@ -1782,6 +1815,23 @@ static const MohawkGameDescription gameDescriptions[] = { 0 }, + // Arthur Birthday (English) Version 2.0 Macintosh + // From aluff in bug #3461368 + { + { + "arthurbday", + "", + AD_ENTRY1("BookOutline", "8e4fddb5b761c8cf2a3b448dd38422be"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_UNSTABLE, + GUIO1(GUIO_NOASPECT) + }, + GType_LIVINGBOOKSV3, + 0, + 0 + }, + { { "arthurbday", @@ -2251,6 +2301,22 @@ static const MohawkGameDescription gameDescriptions[] = { 0 }, + // From aluff in bug #3461368 + { + { + "beardark", + "", + AD_ENTRY1("BookOutline", "b56746b3b2c062c8588bfb6b28e137c1"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_LIVINGBOOKSV3, + 0, + 0 + }, + { { "arthurcomp", diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index dcb0c7940d..2ffabf1e8c 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -108,9 +108,9 @@ GraphicsManager::~GraphicsManager() { } void GraphicsManager::clearCache() { - for (Common::HashMap<uint16, MohawkSurface*>::iterator it = _cache.begin(); it != _cache.end(); it++) + for (Common::HashMap<uint16, MohawkSurface *>::iterator it = _cache.begin(); it != _cache.end(); it++) delete it->_value; - for (Common::HashMap<uint16, Common::Array<MohawkSurface*> >::iterator it = _subImageCache.begin(); it != _subImageCache.end(); it++) { + for (Common::HashMap<uint16, Common::Array<MohawkSurface *> >::iterator it = _subImageCache.begin(); it != _subImageCache.end(); it++) { Common::Array<MohawkSurface *> &array = it->_value; for (uint i = 0; i < array.size(); i++) delete array[i]; diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h index 463608a2aa..8fa5d5f895 100644 --- a/engines/mohawk/graphics.h +++ b/engines/mohawk/graphics.h @@ -99,8 +99,8 @@ protected: private: // An image cache that stores images until clearCache() is called - Common::HashMap<uint16, MohawkSurface*> _cache; - Common::HashMap<uint16, Common::Array<MohawkSurface*> > _subImageCache; + Common::HashMap<uint16, MohawkSurface *> _cache; + Common::HashMap<uint16, Common::Array<MohawkSurface *> > _subImageCache; }; #ifdef ENABLE_MYST @@ -222,7 +222,7 @@ private: uint16 frameCount; Common::Rect rect; uint16 speed; - Common::Array<Common::SeekableReadStream*> frameScripts; + Common::Array<Common::SeekableReadStream *> frameScripts; // Cur frame uint16 curFrame; diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 02f0a46e3f..30770f7ec9 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -173,7 +173,7 @@ public: MystGraphics *_gfx; MystGameState *_gameState; MystScriptParser *_scriptParser; - Common::Array<MystResource*> _resources; + Common::Array<MystResource *> _resources; MystResource *_dragResource; Common::RandomSource *_rnd; diff --git a/engines/mohawk/myst_areas.h b/engines/mohawk/myst_areas.h index 136356ea4f..297a7cc92b 100644 --- a/engines/mohawk/myst_areas.h +++ b/engines/mohawk/myst_areas.h @@ -137,7 +137,7 @@ public: protected: uint16 _var7; uint16 _numSubResources; - Common::Array<MystResource*> _subResources; + Common::Array<MystResource *> _subResources; }; class MystResourceType8 : public MystResourceType7 { diff --git a/engines/mohawk/myst_scripts.h b/engines/mohawk/myst_scripts.h index 18f5b27a6d..ccb76e0dc8 100644 --- a/engines/mohawk/myst_scripts.h +++ b/engines/mohawk/myst_scripts.h @@ -143,7 +143,7 @@ protected: const char *desc; }; - Common::Array<MystOpcode*> _opcodes; + Common::Array<MystOpcode *> _opcodes; MystResource *_invokingResource; diff --git a/engines/mohawk/riven_external.h b/engines/mohawk/riven_external.h index 5f5d0cb0b2..9f076325a2 100644 --- a/engines/mohawk/riven_external.h +++ b/engines/mohawk/riven_external.h @@ -53,7 +53,7 @@ private: ExternalCmd proc; }; - Common::Array<RivenExternalCmd*> _externalCommands; + Common::Array<RivenExternalCmd *> _externalCommands; void setupCommands(); // Supplementary Functions diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h index 2932ba5939..a871f0afa0 100644 --- a/engines/mohawk/riven_scripts.h +++ b/engines/mohawk/riven_scripts.h @@ -125,7 +125,7 @@ private: DECLARE_OPCODE(activateMLST); }; -typedef Common::Array<RivenScript*> RivenScriptList; +typedef Common::Array<RivenScript *> RivenScriptList; class RivenScriptManager { public: diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index 7958906897..8d72fa3f72 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -261,7 +261,7 @@ bool VideoManager::updateMovies() { // Clip the width/height to make sure we stay on the screen (Myst does this a few times) uint16 width = MIN<int32>(_videoStreams[i]->getWidth(), _vm->_system->getWidth() - _videoStreams[i].x); uint16 height = MIN<int32>(_videoStreams[i]->getHeight(), _vm->_system->getHeight() - _videoStreams[i].y); - _vm->_system->copyRectToScreen((byte*)frame->pixels, frame->pitch, _videoStreams[i].x, _videoStreams[i].y, width, height); + _vm->_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, _videoStreams[i].x, _videoStreams[i].y, width, height); // We've drawn something to the screen, make sure we update it updateScreen = true; diff --git a/engines/parallaction/balloons.cpp b/engines/parallaction/balloons.cpp index f74eef18e1..1ddd401b20 100644 --- a/engines/parallaction/balloons.cpp +++ b/engines/parallaction/balloons.cpp @@ -179,7 +179,7 @@ protected: uint16 rx = 10; uint16 ry = 4 + _lines * _font->height(); // y - byte *dst = (byte*)_surf->getBasePtr(rx, ry); + byte *dst = (byte *)_surf->getBasePtr(rx, ry); _font->setColor(_color); _font->drawString(dst, _surf->w, _line.c_str()); } @@ -494,7 +494,7 @@ protected: uint16 rx = _x + (_surf->w - _lineWidth) / 2; uint16 ry = _y + _lines * _font->height(); // y - byte *dst = (byte*)_surf->getBasePtr(rx, ry); + byte *dst = (byte *)_surf->getBasePtr(rx, ry); _font->setColor(_color); _font->drawString(dst, _surf->w, _line.c_str()); } diff --git a/engines/parallaction/callables_br.cpp b/engines/parallaction/callables_br.cpp index ac5ff88560..7d3e63dfba 100644 --- a/engines/parallaction/callables_br.cpp +++ b/engines/parallaction/callables_br.cpp @@ -26,31 +26,31 @@ namespace Parallaction { -void Parallaction_br::_c_null(void*) { +void Parallaction_br::_c_null(void *) { // do nothing :) } -void Parallaction_br::_c_blufade(void*) { +void Parallaction_br::_c_blufade(void *) { warning("Parallaction_br::_c_blufade() not yet implemented"); } -void Parallaction_br::_c_resetpalette(void*) { +void Parallaction_br::_c_resetpalette(void *) { warning("Parallaction_br::_c_resetpalette() not yet implemented"); } -void Parallaction_br::_c_ferrcycle(void*) { +void Parallaction_br::_c_ferrcycle(void *) { warning("Parallaction_br::_c_ferrcycle() not yet implemented"); } -void Parallaction_br::_c_lipsinc(void*) { +void Parallaction_br::_c_lipsinc(void *) { warning("Unexpected lipsinc routine call! Please notify the team"); } -void Parallaction_br::_c_albcycle(void*) { +void Parallaction_br::_c_albcycle(void *) { warning("Parallaction_br::_c_albcycle() not yet implemented"); } -void Parallaction_br::_c_password(void*) { +void Parallaction_br::_c_password(void *) { warning("Parallaction_br::_c_password() not yet implemented"); } diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp index 77f54fcc98..64885c7ff3 100644 --- a/engines/parallaction/callables_ns.cpp +++ b/engines/parallaction/callables_ns.cpp @@ -260,7 +260,7 @@ void Parallaction_ns::stopMovingSarcophagus() { void Parallaction_ns::_c_moveSarc(void *parm) { if (!_movingSarcophagus) { - startMovingSarcophagus(*(ZonePtr*)parm); + startMovingSarcophagus(*(ZonePtr *)parm); } else { stopMovingSarcophagus(); } @@ -417,18 +417,18 @@ void Parallaction_ns::_c_testResult(void *parm) { return; } -void Parallaction_ns::_c_offSound(void*) { +void Parallaction_ns::_c_offSound(void *) { _soundManI->stopSfx(0); _soundManI->stopSfx(1); _soundManI->stopSfx(2); _soundManI->stopSfx(3); } -void Parallaction_ns::_c_startMusic(void*) { +void Parallaction_ns::_c_startMusic(void *) { _soundManI->playMusic(); } -void Parallaction_ns::_c_closeMusic(void*) { +void Parallaction_ns::_c_closeMusic(void *) { _soundManI->stopMusic(); } @@ -490,7 +490,7 @@ void Parallaction_ns::_c_moveSheet(void *parm) { } void zeroMask(int x, int y, int color, void *data) { - BackgroundInfo *info = (BackgroundInfo*)data; + BackgroundInfo *info = (BackgroundInfo *)data; uint16 _ax = x + y * info->_mask->w; info->_mask->data[_ax >> 2] &= ~(3 << ((_ax & 3) << 1)); @@ -575,16 +575,16 @@ int16 projectorProgram[] = { 25, 116, 25, 115, 25, 114, 25, 113, 25, 112, 25, 111, 25, 110, 25, -1, -1 }; -void Parallaction_ns::_c_projector(void*) { +void Parallaction_ns::_c_projector(void *) { _gfx->setHalfbriteMode(true); _gfx->setProjectorProgram(projectorProgram); } -void Parallaction_ns::_c_HBOff(void*) { +void Parallaction_ns::_c_HBOff(void *) { _gfx->setHalfbriteMode(false); } -void Parallaction_ns::_c_HBOn(void*) { +void Parallaction_ns::_c_HBOn(void *) { _gfx->setHalfbriteMode(true); } diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp index 72f26cb6b9..0cb329e0f0 100644 --- a/engines/parallaction/debug.cpp +++ b/engines/parallaction/debug.cpp @@ -69,14 +69,14 @@ bool Debugger::Cmd_Location(int argc, const char **argv) { switch (argc) { case 3: - character = const_cast<char*>(argv[2]); - location = const_cast<char*>(argv[1]); + character = const_cast<char *>(argv[2]); + location = const_cast<char *>(argv[1]); sprintf(tmp, "%s.%s", location, character); _vm->scheduleLocationSwitch(tmp); break; case 2: - location = const_cast<char*>(argv[1]); + location = const_cast<char *>(argv[1]); _vm->scheduleLocationSwitch(location); break; diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index 61172d0896..f20e05771a 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -38,7 +38,7 @@ void ILBMLoader::setupBuffer(uint32 w, uint32 h) { } _surf->create(w, h, Graphics::PixelFormat::createFormatCLUT8()); _mode = Graphics::ILBMDecoder::ILBM_UNPACK_PLANES; - _intBuffer = (byte*)_surf->pixels; + _intBuffer = (byte *)_surf->pixels; break; case BODYMODE_MASKBUFFER: @@ -82,7 +82,7 @@ bool ILBMLoader::callback(Common::IFFChunk &chunk) { case ID_CRNG: if (_crng) { PaletteFxRange *ptr = &_crng[_numCRNG]; - chunk._stream->read((byte*)ptr, chunk._size); + chunk._stream->read((byte *)ptr, chunk._size); ptr->_timer = FROM_BE_16(ptr->_timer); ptr->_step = FROM_BE_16(ptr->_step); ptr->_flags = FROM_BE_16(ptr->_flags); diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index f9e368ab39..5e39c893db 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -283,7 +283,7 @@ Sprites* DosDisk_br::createSprites(Common::ReadStream *stream) { spr->w = stream->readUint16LE(); spr->h = stream->readUint16LE(); - spr->packedData = (byte*)malloc(spr->size); + spr->packedData = (byte *)malloc(spr->size); stream->read(spr->packedData, spr->size); } delete stream; @@ -450,7 +450,7 @@ void AmigaDisk_br::init() { void AmigaDisk_br::adjustForPalette(Graphics::Surface &surf, int transparentColor) { uint size = surf.w * surf.h; - byte *data = (byte*)surf.pixels; + byte *data = (byte *)surf.pixels; for (uint i = 0; i < size; i++, data++) { if (transparentColor == -1 || transparentColor != *data) *data += 16; @@ -609,7 +609,7 @@ GfxObj* AmigaDisk_br::loadStatic(const char* name) { stream->read(shadow, shadowSize); for (int32 i = 0; i < surf->h; ++i) { byte *src = shadow + shadowWidth * i; - byte *dst = (byte*)surf->pixels + surf->pitch * i; + byte *dst = (byte *)surf->pixels + surf->pitch * i; for (int32 j = 0; j < surf->w; ++j, ++dst) { byte bit = src[j/8] & (1 << (7 - (j & 7))); @@ -637,7 +637,7 @@ Sprites* AmigaDisk_br::createSprites(Common::ReadStream *stream) { spr->w = stream->readUint16BE(); spr->h = stream->readUint16BE() - 1; - spr->packedData = (byte*)malloc(spr->size); + spr->packedData = (byte *)malloc(spr->size); stream->read(spr->packedData, spr->size); } @@ -725,7 +725,7 @@ GfxObj* AmigaDisk_br::loadObjects(const char *name, uint8 part) { max = 72; byte *data = new byte[max * 2601]; - byte *srcPtr = (byte*)loader._surf->getBasePtr(0,0); + byte *srcPtr = (byte *)loader._surf->getBasePtr(0,0); int w = loader._surf->w; // Convert to the expected display format diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index e145743f09..b2285d0da3 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -473,7 +473,7 @@ void DosDisk_ns::loadBackground(BackgroundInfo& info, const char *filename) { // read bitmap, mask and path data and extract them into the 3 buffers info.bg.create(info.width, info.height, Graphics::PixelFormat::createFormatCLUT8()); createMaskAndPathBuffers(info); - unpackBackground(stream, (byte*)info.bg.pixels, info._mask->data, info._path->data); + unpackBackground(stream, (byte *)info.bg.pixels, info._mask->data, info._path->data); delete stream; } @@ -661,10 +661,10 @@ public: stream.seek(-4, SEEK_END); uint32 decrlen = stream.readUint32BE() >> 8; - byte *dest = (byte*)malloc(decrlen); + byte *dest = (byte *)malloc(decrlen); uint32 crlen = stream.size() - 4; - byte *src = (byte*)malloc(crlen); + byte *src = (byte *)malloc(crlen); stream.seek(4, SEEK_SET); stream.read(src, crlen); @@ -757,14 +757,14 @@ void AmigaDisk_ns::unpackFrame(byte *dst, byte *src, uint16 planeSize) { */ void AmigaDisk_ns::patchFrame(byte *dst, byte *dlta, uint16 bytesPerPlane, uint16 height) { - uint32 *dataIndex = (uint32*)dlta; - uint32 *ofslenIndex = (uint32*)dlta + 8; + uint32 *dataIndex = (uint32 *)dlta; + uint32 *ofslenIndex = (uint32 *)dlta + 8; - uint16 *base = (uint16*)dlta; + uint16 *base = (uint16 *)dlta; uint16 wordsPerLine = bytesPerPlane >> 1; for (uint j = 0; j < NUM_PLANES; j++) { - uint16 *dst16 = (uint16*)(dst + j * bytesPerPlane * height); + uint16 *dst16 = (uint16 *)(dst + j * bytesPerPlane * height); uint16 *data = base + READ_BE_UINT32(dataIndex); dataIndex++; @@ -804,7 +804,7 @@ void AmigaDisk_ns::unpackBitmap(byte *dst, byte *src, uint16 numFrames, uint16 b uint size = READ_BE_UINT32(src + 4); if (tempBuffer == 0) - tempBuffer = (byte*)malloc(planeSize * NUM_PLANES); + tempBuffer = (byte *)malloc(planeSize * NUM_PLANES); memcpy(tempBuffer, baseFrame, planeSize * NUM_PLANES); diff --git a/engines/parallaction/exec.h b/engines/parallaction/exec.h index b7b8a571f4..b966d677cd 100644 --- a/engines/parallaction/exec.h +++ b/engines/parallaction/exec.h @@ -55,7 +55,7 @@ struct CommandContext { // in Parallaction_XX }; typedef Common::Functor1<CommandContext&, void> CommandOpcode; -typedef Common::Array<const CommandOpcode*> CommandOpcodeSet; +typedef Common::Array<const CommandOpcode *> CommandOpcodeSet; #define DECLARE_UNQUALIFIED_COMMAND_OPCODE(op) void cmdOp_##op(CommandContext &) struct ProgramContext { @@ -67,7 +67,7 @@ struct ProgramContext { bool _suspend; }; typedef Common::Functor1<ProgramContext&, void> ProgramOpcode; -typedef Common::Array<const ProgramOpcode*> ProgramOpcodeSet; +typedef Common::Array<const ProgramOpcode *> ProgramOpcodeSet; #define DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(op) void instOp_##op(ProgramContext &) diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp index cc7f320e1c..d4c9aefd32 100644 --- a/engines/parallaction/font.cpp +++ b/engines/parallaction/font.cpp @@ -57,17 +57,17 @@ public: _numGlyphs = stream.readByte(); _height = stream.readUint32BE(); - _widths = (byte*)malloc(_numGlyphs); + _widths = (byte *)malloc(_numGlyphs); stream.read(_widths, _numGlyphs); - _offsets = (uint*)malloc(_numGlyphs * sizeof(uint)); + _offsets = (uint *)malloc(_numGlyphs * sizeof(uint)); _offsets[0] = 0; for (uint i = 1; i < _numGlyphs; i++) _offsets[i] = _offsets[i-1] + _widths[i-1] * _height; uint size = _offsets[_numGlyphs-1] + _widths[_numGlyphs-1] * _height; - _data = (byte*)malloc(size); + _data = (byte *)malloc(size); stream.read(_data, size); } @@ -503,25 +503,25 @@ AmigaFont::AmigaFont(Common::SeekableReadStream &stream) { stream.seek(32); // skips dummy header _dataSize = stream.size() - stream.pos(); - _data = (byte*)malloc(_dataSize); + _data = (byte *)malloc(_dataSize); stream.read(_data, _dataSize); - _font = (AmigaDiskFont*)(_data + 78); + _font = (AmigaDiskFont *)(_data + 78); _font->_ySize = FROM_BE_16(_font->_ySize); _font->_xSize = FROM_BE_16(_font->_xSize); _font->_baseline = FROM_BE_16(_font->_baseline); _font->_modulo = FROM_BE_16(_font->_modulo); - _charLoc = (CharLoc*)(_data + FROM_BE_32(_font->_charLoc)); + _charLoc = (CharLoc *)(_data + FROM_BE_32(_font->_charLoc)); _charData = _data + FROM_BE_32(_font->_charData); _charSpace = 0; _charKern = 0; if (_font->_charSpace != 0) - _charSpace = (uint16*)(_data + FROM_BE_32(_font->_charSpace)); + _charSpace = (uint16 *)(_data + FROM_BE_32(_font->_charSpace)); if (_font->_charKern != 0) - _charKern = (uint16*)(_data + FROM_BE_32(_font->_charKern)); + _charKern = (uint16 *)(_data + FROM_BE_32(_font->_charKern)); } diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index c351551e36..852235ce34 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -235,7 +235,7 @@ void Gfx::drawGfxObject(GfxObj *obj, Graphics::Surface &surf) { } void Gfx::drawText(Font *font, Graphics::Surface* surf, uint16 x, uint16 y, const char *text, byte color) { - byte *dst = (byte*)surf->getBasePtr(x, y); + byte *dst = (byte *)surf->getBasePtr(x, y); font->setColor(color); font->drawString(dst, surf->w, text); } @@ -308,7 +308,7 @@ void Gfx::bltMaskScale(const Common::Rect& r, byte *data, Graphics::Surface *sur dp.y = dstRect.top; byte *s = data + srcRect.left + srcRect.top * width; - byte *d = (byte*)surf->getBasePtr(dp.x, dp.y); + byte *d = (byte *)surf->getBasePtr(dp.x, dp.y); uint line = 0, col = 0; @@ -380,7 +380,7 @@ void Gfx::bltMaskNoScale(const Common::Rect& r, byte *data, Graphics::Surface *s q.translate(-r.left, -r.top); byte *s = data + q.left + q.top * r.width(); - byte *d = (byte*)surf->getBasePtr(dp.x, dp.y); + byte *d = (byte *)surf->getBasePtr(dp.x, dp.y); uint sPitch = r.width() - q.width(); uint dPitch = surf->w - q.width(); @@ -422,7 +422,7 @@ void Gfx::bltNoMaskNoScale(const Common::Rect& r, byte *data, Graphics::Surface q.translate(-r.left, -r.top); byte *s = data + q.left + q.top * r.width(); - byte *d = (byte*)surf->getBasePtr(dp.x, dp.y); + byte *d = (byte *)surf->getBasePtr(dp.x, dp.y); uint sPitch = r.width() - q.width(); uint dPitch = surf->w - q.width(); diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index a006edf114..6868505c52 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -44,7 +44,7 @@ namespace Parallaction { void halfbritePixel(int x, int y, int color, void *data) { Graphics::Surface *surf = (Graphics::Surface *)data; - byte *pixel = (byte*)surf->getBasePtr(x, y); + byte *pixel = (byte *)surf->getBasePtr(x, y); *pixel &= ~0x20; } @@ -319,7 +319,7 @@ void Gfx::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int y += _scrollPosY; } - byte *dst = (byte*)_backBuffer.getBasePtr(x, y); + byte *dst = (byte *)_backBuffer.getBasePtr(x, y); for (int i = 0; i < h; i++) { memcpy(dst, buf, w); buf += pitch; @@ -357,7 +357,7 @@ void Gfx::unlockScreen() { void Gfx::updateScreenIntern() { if (_doubleBuffering) { - byte *data = (byte*)_backBuffer.getBasePtr(_scrollPosX, _scrollPosY); + byte *data = (byte *)_backBuffer.getBasePtr(_scrollPosX, _scrollPosY); _vm->_system->copyRectToScreen(data, _backBuffer.pitch, 0, 0, _vm->_screenWidth, _vm->_screenHeight); } @@ -425,7 +425,7 @@ void Gfx::updateScreen() { // background may not cover the whole screen, so adjust bulk update size uint w = _backgroundInfo->width; uint h = _backgroundInfo->height; - byte *backgroundData = (byte*)_backgroundInfo->bg.getBasePtr(0, 0); + byte *backgroundData = (byte *)_backgroundInfo->bg.getBasePtr(0, 0); uint16 backgroundPitch = _backgroundInfo->bg.pitch; copyRectToScreen(backgroundData, backgroundPitch, _backgroundInfo->_x, _backgroundInfo->_y, w, h); } @@ -450,7 +450,7 @@ void Gfx::applyHalfbriteEffect_NS(Graphics::Surface &surf) { return; } - byte *buf = (byte*)surf.pixels; + byte *buf = (byte *)surf.pixels; for (int i = 0; i < surf.w*surf.h; i++) { *buf++ |= 0x20; } @@ -493,7 +493,7 @@ void Gfx::patchBackground(Graphics::Surface &surf, int16 x, int16 y, bool mask) r.moveTo(x, y); uint16 z = (mask) ? _backgroundInfo->getMaskLayer(y) : LAYER_FOREGROUND; - blt(r, (byte*)surf.pixels, &_backgroundInfo->bg, z, 100, 0); + blt(r, (byte *)surf.pixels, &_backgroundInfo->bg, z, 100, 0); } void Gfx::fillBackground(const Common::Rect& r, byte color) { @@ -502,7 +502,7 @@ void Gfx::fillBackground(const Common::Rect& r, byte color) { void Gfx::invertBackground(const Common::Rect& r) { - byte *d = (byte*)_backgroundInfo->bg.getBasePtr(r.left, r.top); + byte *d = (byte *)_backgroundInfo->bg.getBasePtr(r.left, r.top); for (int i = 0; i < r.height(); i++) { for (int j = 0; j < r.width(); j++) { @@ -536,12 +536,12 @@ GfxObj *Gfx::renderFloatingLabel(Font *font, char *text) { setupLabelSurface(*cnv, w, h); font->setColor((_gameType == GType_BRA) ? 0 : 7); - font->drawString((byte*)cnv->pixels + 1, cnv->w, text); - font->drawString((byte*)cnv->pixels + 1 + cnv->w * 2, cnv->w, text); - font->drawString((byte*)cnv->pixels + cnv->w, cnv->w, text); - font->drawString((byte*)cnv->pixels + 2 + cnv->w, cnv->w, text); + font->drawString((byte *)cnv->pixels + 1, cnv->w, text); + font->drawString((byte *)cnv->pixels + 1 + cnv->w * 2, cnv->w, text); + font->drawString((byte *)cnv->pixels + cnv->w, cnv->w, text); + font->drawString((byte *)cnv->pixels + 2 + cnv->w, cnv->w, text); font->setColor((_gameType == GType_BRA) ? 11 : 1); - font->drawString((byte*)cnv->pixels + 1 + cnv->w, cnv->w, text); + font->drawString((byte *)cnv->pixels + 1 + cnv->w, cnv->w, text); } else { w = font->getStringWidth(text); h = font->height(); @@ -703,8 +703,8 @@ void Gfx::unregisterLabel(GfxObj *label) { void Gfx::copyRect(const Common::Rect &r, Graphics::Surface &src, Graphics::Surface &dst) { - byte *s = (byte*)src.getBasePtr(r.left, r.top); - byte *d = (byte*)dst.getBasePtr(0, 0); + byte *s = (byte *)src.getBasePtr(r.left, r.top); + byte *d = (byte *)dst.getBasePtr(0, 0); for (uint16 i = 0; i < r.height(); i++) { memcpy(d, s, r.width()); @@ -1017,7 +1017,7 @@ void MaskBuffer::create(uint16 width, uint16 height) { internalWidth = w >> 2; h = height; size = (internalWidth * h); - data = (byte*)calloc(size, 1); + data = (byte *)calloc(size, 1); } void MaskBuffer::free() { @@ -1096,7 +1096,7 @@ void PathBuffer::create(uint16 width, uint16 height) { internalWidth = w >> 3; h = height; size = (internalWidth * h); - data = (byte*)calloc(size, 1); + data = (byte *)calloc(size, 1); } void PathBuffer::free() { diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index dacf7715ae..b43dd193b5 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -103,7 +103,7 @@ public: } byte* getData(uint16 index) { assert(index == 0); - return (byte*)_surf->getBasePtr(0,0); + return (byte *)_surf->getBasePtr(0,0); } void getRect(uint16 index, Common::Rect &r) { assert(index == 0); @@ -341,12 +341,12 @@ public: */ struct BackgroundInfo { protected: - typedef Common::Array<MaskBuffer*> MaskPatches; + typedef Common::Array<MaskBuffer *> MaskPatches; MaskPatches _maskPatches; MaskBuffer _maskBackup; void clearMaskData(); - typedef Common::Array<PathBuffer*> PathPatches; + typedef Common::Array<PathBuffer *> PathPatches; PathPatches _pathPatches; PathBuffer _pathBackup; void clearPathData(); @@ -415,7 +415,7 @@ public: }; -typedef Common::Array<GfxObj*> GfxObjArray; +typedef Common::Array<GfxObj *> GfxObjArray; #define SCENE_DRAWLIST_SIZE 100 class Gfx { diff --git a/engines/parallaction/gui.h b/engines/parallaction/gui.h index 95c5653220..a6eed240c4 100644 --- a/engines/parallaction/gui.h +++ b/engines/parallaction/gui.h @@ -36,7 +36,7 @@ namespace Parallaction { class MenuInputState; class MenuInputHelper { - typedef Common::HashMap<Common::String, MenuInputState*> StateMap; + typedef Common::HashMap<Common::String, MenuInputState *> StateMap; StateMap _map; MenuInputState *_state; diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp index 56148d78d8..5bc5acf630 100644 --- a/engines/parallaction/gui_br.cpp +++ b/engines/parallaction/gui_br.cpp @@ -488,10 +488,10 @@ public: _font->setColor(0); int x = (w - questionW)/2; int y = 13; - _font->drawString((byte*)surf->getBasePtr(x, y), surf->pitch, question); + _font->drawString((byte *)surf->getBasePtr(x, y), surf->pitch, question); x = (w - optionW)/2; y = 13 + _font->height()*2; - _font->drawString((byte*)surf->getBasePtr(x,y), surf->pitch, option); + _font->drawString((byte *)surf->getBasePtr(x,y), surf->pitch, option); _obj = new GfxObj(kGfxObjTypeMenu, new SurfaceToFrames(surf), "quitdialog"); assert(_obj); diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index 8fd9f56802..1cae63be42 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -183,7 +183,7 @@ ItemPosition InventoryRenderer::hitTest(const Common::Point &p) const { void InventoryRenderer::drawItem(ItemPosition pos, ItemName name) { Common::Rect r; getItemRect(pos, r); - byte* d = (byte*)_surf.getBasePtr(r.left, r.top); + byte* d = (byte *)_surf.getBasePtr(r.left, r.top); drawItem(name, d, _surf.pitch); } @@ -238,7 +238,7 @@ void InventoryRenderer::getItemRect(ItemPosition pos, Common::Rect &r) { } Inventory::Inventory(int maxItems, InventoryItem *verbs) : _numItems(0), _maxItems(maxItems) { - _items = (InventoryItem*)calloc(_maxItems, sizeof(InventoryItem)); + _items = (InventoryItem *)calloc(_maxItems, sizeof(InventoryItem)); int i = 0; for ( ; verbs[i]._id; i++) { diff --git a/engines/parallaction/inventory.h b/engines/parallaction/inventory.h index 91c06d1e93..a3b7bf953f 100644 --- a/engines/parallaction/inventory.h +++ b/engines/parallaction/inventory.h @@ -108,7 +108,7 @@ public: void highlightItem(ItemPosition pos, byte color); void drawItem(ItemName name, byte *buffer, uint pitch); - byte* getData() const { return (byte*)_surf.pixels; } + byte* getData() const { return (byte *)_surf.pixels; } void getRect(Common::Rect &r) const; int16 getNumLines() const; diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp index fe21732f03..d3529c5dd9 100644 --- a/engines/parallaction/objects.cpp +++ b/engines/parallaction/objects.cpp @@ -386,11 +386,11 @@ ScriptVar::~ScriptVar() { Table::Table(uint32 size) : _size(size), _used(0), _disposeMemory(true) { - _data = (char**)calloc(size, sizeof(char*)); + _data = (char**)calloc(size, sizeof(char *)); } Table::Table(uint32 size, const char **data) : _size(size), _used(size), _disposeMemory(false) { - _data = const_cast<char**>(data); + _data = const_cast<char **>(data); } Table::~Table() { diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 6c3ff11d15..0d56b62e2f 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -447,7 +447,7 @@ private: // callables data - typedef void (Parallaction_ns::*Callable)(void*); + typedef void (Parallaction_ns::*Callable)(void *); const Callable *_callables; ZonePtr _moveSarcGetZone; ZonePtr _moveSarcExaZone; @@ -468,37 +468,37 @@ private: PathWalker_NS *_walker; // common callables - void _c_play_boogie(void*); - void _c_startIntro(void*); - void _c_endIntro(void*); - void _c_moveSheet(void*); - void _c_sketch(void*); - void _c_shade(void*); - void _c_score(void*); - void _c_fade(void*); - void _c_moveSarc(void*); - void _c_contaFoglie(void*); - void _c_zeroFoglie(void*); - void _c_trasformata(void*); - void _c_offMouse(void*); - void _c_onMouse(void*); - void _c_setMask(void*); - void _c_endComment(void*); - void _c_frankenstein(void*); - void _c_finito(void*); - void _c_ridux(void*); - void _c_testResult(void*); + void _c_play_boogie(void *); + void _c_startIntro(void *); + void _c_endIntro(void *); + void _c_moveSheet(void *); + void _c_sketch(void *); + void _c_shade(void *); + void _c_score(void *); + void _c_fade(void *); + void _c_moveSarc(void *); + void _c_contaFoglie(void *); + void _c_zeroFoglie(void *); + void _c_trasformata(void *); + void _c_offMouse(void *); + void _c_onMouse(void *); + void _c_setMask(void *); + void _c_endComment(void *); + void _c_frankenstein(void *); + void _c_finito(void *); + void _c_ridux(void *); + void _c_testResult(void *); // dos specific callables - void _c_null(void*); + void _c_null(void *); // amiga specific callables - void _c_projector(void*); - void _c_HBOff(void*); - void _c_offSound(void*); - void _c_startMusic(void*); - void _c_closeMusic(void*); - void _c_HBOn(void*); + void _c_projector(void *); + void _c_HBOff(void *); + void _c_offSound(void *); + void _c_startMusic(void *); + void _c_closeMusic(void *); + void _c_HBOn(void *); }; @@ -582,7 +582,7 @@ private: void startIngameMenu(); void freeCharacter(); - typedef void (Parallaction_br::*Callable)(void*); + typedef void (Parallaction_br::*Callable)(void *); const Callable *_callables; static const Callable _dosCallables[6]; static const Callable _amigaCallables[6]; @@ -592,13 +592,13 @@ private: PathWalker_BR *_walker; // dos callables - void _c_null(void*); - void _c_blufade(void*); - void _c_resetpalette(void*); - void _c_ferrcycle(void*); - void _c_lipsinc(void*); - void _c_albcycle(void*); - void _c_password(void*); + void _c_null(void *); + void _c_blufade(void *); + void _c_resetpalette(void *); + void _c_ferrcycle(void *); + void _c_lipsinc(void *); + void _c_albcycle(void *); + void _c_password(void *); }; extern Parallaction *_vm; diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h index 1cf8e2f7ff..3e2604eda2 100644 --- a/engines/parallaction/parser.h +++ b/engines/parallaction/parser.h @@ -57,7 +57,7 @@ public: typedef Common::Functor0<void> Opcode; -typedef Common::Array<const Opcode*> OpcodeSet; +typedef Common::Array<const Opcode *> OpcodeSet; @@ -69,8 +69,8 @@ public: uint _lookup; - Common::Stack<OpcodeSet*> _opcodes; - Common::Stack<Table*> _statements; + Common::Stack<OpcodeSet *> _opcodes; + Common::Stack<Table *> _statements; OpcodeSet *_currentOpcodes; Table *_currentStatements; @@ -199,7 +199,7 @@ protected: void addCommand(); void clearSet(OpcodeSet &opcodes) { - for (Common::Array<const Opcode*>::iterator i = opcodes.begin(); i != opcodes.end(); ++i) + for (Common::Array<const Opcode *>::iterator i = opcodes.begin(); i != opcodes.end(); ++i) delete *i; opcodes.clear(); } @@ -357,7 +357,7 @@ protected: virtual void parseRValue(ScriptVar &var, const char *str); void clearSet(OpcodeSet &opcodes) { - for (Common::Array<const Opcode*>::iterator i = opcodes.begin(); i != opcodes.end(); ++i) + for (Common::Array<const Opcode *>::iterator i = opcodes.begin(); i != opcodes.end(); ++i) delete *i; opcodes.clear(); } diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index 82940340bc..0904dbf655 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -1131,7 +1131,7 @@ void LocationParser_br::init() { _locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_br), _locationZoneStmtRes_br); _locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_br), _locationAnimStmtRes_br); - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; SetOpcodeTable(_commandParsers); WARNING_PARSER(unexpected); @@ -1234,7 +1234,7 @@ void ProgramParser_br::init() { _instructionNames = new Table(ARRAYSIZE(_instructionNamesRes_br), _instructionNamesRes_br); - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; SetOpcodeTable(_instructionParsers); INSTRUCTION_PARSER(defLocal); // invalid opcode -> local definition diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index 36b8640a60..f1d1db53e9 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -1107,7 +1107,7 @@ void LocationParser_ns::init() { _locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_ns), _locationZoneStmtRes_ns); _locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_ns), _locationAnimStmtRes_ns); - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; SetOpcodeTable(_commandParsers); WARNING_PARSER(unexpected); @@ -1177,7 +1177,7 @@ void ProgramParser_ns::init() { _instructionNames = new Table(ARRAYSIZE(_instructionNamesRes_ns), _instructionNamesRes_ns); - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; SetOpcodeTable(_instructionParsers); INSTRUCTION_PARSER(defLocal); // invalid opcode -> local definition INSTRUCTION_PARSER(animation); // on diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp index 16ffd24a82..0925e55309 100644 --- a/engines/parallaction/sound_br.cpp +++ b/engines/parallaction/sound_br.cpp @@ -378,7 +378,7 @@ Audio::AudioStream *AmigaSoundMan_br::loadChannelData(const char *filename, Chan if (_vm->getFeatures() & GF_DEMO) { uint32 dataSize = stream->size(); - int8 *data = (int8*)malloc(dataSize); + int8 *data = (int8 *)malloc(dataSize); if (stream->read(data, dataSize) != dataSize) error("DosSoundMan_br::loadChannelData: Read failed"); diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index b5d4c72ea4..3cc25b36b0 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -165,7 +165,7 @@ void DosSoundMan_ns::playCharacterMusic(const char *character) { return; } - char *name = const_cast<char*>(character); + char *name = const_cast<char *>(character); const char *newMusicFile = 0; if (!scumm_stricmp(name, _dinoName)) { diff --git a/engines/queen/music.cpp b/engines/queen/music.cpp index 858692703c..2835954003 100644 --- a/engines/queen/music.cpp +++ b/engines/queen/music.cpp @@ -303,7 +303,7 @@ void MidiMusic::playMusic() { for (uint i = 0; i < packedSize; i++) #if defined(SCUMM_NEED_ALIGNMENT) - memcpy(&_buf[i], (byte*)((byte*)data + *(idx + i) * sizeof(uint16)), sizeof(uint16)); + memcpy(&_buf[i], (byte *)((byte *)data + *(idx + i) * sizeof(uint16)), sizeof(uint16)); #else _buf[i] = data[*(idx + i)]; #endif diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index 8b2d1e9dad..fd602ff4fb 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -501,7 +501,7 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { } anim = getAnimation(animId); - displayBuffer = (byte*)_vm->_render->getBackGroundSurface()->pixels; + displayBuffer = (byte *)_vm->_render->getBackGroundSurface()->pixels; if (playing) { anim->state = ANIM_PLAYING; diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp index 8e98f0fbe7..62250a0820 100644 --- a/engines/saga/gfx.cpp +++ b/engines/saga/gfx.cpp @@ -156,7 +156,7 @@ void Surface::transitionDissolve(const byte *sourceBuffer, const Common::Rect &s if (sourceRect.contains(x1, y1)) { color = sourceBuffer[(x1-sourceRect.left) + sourceRect.width()*(y1-sourceRect.top)]; if (flags == 0 || color) - ((byte*)pixels)[seq] = color; + ((byte *)pixels)[seq] = color; } } } diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp index ec6b13f313..945b4ad5a7 100644 --- a/engines/saga/isomap.cpp +++ b/engines/saga/isomap.cpp @@ -346,7 +346,7 @@ int16 IsoMap::findMulti(int16 tileIndex, int16 absU, int16 absV, int16 absH) { if (offset + sizeof(int16) > _multiTableData.size() * sizeof(int16)) { error("wrong multiTileEntryData->offset"); } - tiles = (int16*)((byte*)&_multiTableData.front() + offset); + tiles = (int16 *)((byte *)&_multiTableData.front() + offset); tileIndex = *tiles; if (tileIndex >= 256) { warning("something terrible happened"); diff --git a/engines/saga/resource.h b/engines/saga/resource.h index 2124f3e29f..a8e2e92361 100644 --- a/engines/saga/resource.h +++ b/engines/saga/resource.h @@ -157,7 +157,7 @@ protected: virtual void processPatches(Resource *resource, const GamePatchDescription *patchFiles) { } }; -typedef Common::List<ResourceContext*> ResourceContextList; +typedef Common::List<ResourceContext *> ResourceContextList; struct MetaResource { int16 sceneIndex; diff --git a/engines/saga/script.h b/engines/saga/script.h index 227b58a298..c4ea2d62b3 100644 --- a/engines/saga/script.h +++ b/engines/saga/script.h @@ -196,9 +196,9 @@ public: case kAddressModule: return _moduleBase; case kAddressStack: - return (byte*)&_stackBuf[_frameIndex]; + return (byte *)&_stackBuf[_frameIndex]; case kAddressThread: - return (byte*)_threadVars; + return (byte *)_threadVars; default: return _commonBase; } diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 395ba4a8c7..9607a8e66d 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -1433,7 +1433,7 @@ bool Console::cmdSaid(int argc, const char **argv) { _engine->getVocabulary()->dumpParseTree(); _engine->getVocabulary()->parserIsValid = true; - int ret = said((byte*)spec, true); + int ret = said((byte *)spec, true); DebugPrintf("kSaid: %s\n", (ret == SAID_NO_MATCH ? "No match" : "Match")); } @@ -1605,7 +1605,7 @@ bool Console::cmdWindowList(int argc, const char **argv) { bool Console::cmdSavedBits(int argc, const char **argv) { SegManager *segman = _engine->_gamestate->_segMan; SegmentId id = segman->findSegmentByType(SEG_TYPE_HUNK); - HunkTable* hunks = (HunkTable*)segman->getSegmentObj(id); + HunkTable* hunks = (HunkTable *)segman->getSegmentObj(id); if (!hunks) { DebugPrintf("No hunk segment found.\n"); return true; @@ -1617,7 +1617,7 @@ bool Console::cmdSavedBits(int argc, const char **argv) { uint16 offset = entries[i].offset; const Hunk& h = hunks->_table[offset]; if (strcmp(h.type, "SaveBits()") == 0) { - byte* memoryPtr = (byte*)h.mem; + byte* memoryPtr = (byte *)h.mem; if (memoryPtr) { DebugPrintf("%04x:%04x:", PRINT_REG(entries[i])); @@ -1671,7 +1671,7 @@ bool Console::cmdShowSavedBits(int argc, const char **argv) { SegManager *segman = _engine->_gamestate->_segMan; SegmentId id = segman->findSegmentByType(SEG_TYPE_HUNK); - HunkTable* hunks = (HunkTable*)segman->getSegmentObj(id); + HunkTable* hunks = (HunkTable *)segman->getSegmentObj(id); if (!hunks) { DebugPrintf("No hunk segment found.\n"); return true; diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index ce903626e7..aade40fd9f 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -823,7 +823,7 @@ reg_t kFileIOWriteRaw(EngineState *s, int argc, reg_t *argv) { int size = argv[2].toUint16(); char *buf = new char[size]; bool success = false; - s->_segMan->memcpy((byte*)buf, argv[1], size); + s->_segMan->memcpy((byte *)buf, argv[1], size); debugC(kDebugLevelFile, "kFileIO(writeRaw): %d, %d", handle, size); FileHandle *f = getFileFromHandle(s, handle); diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp index f30f4e923e..cddd01e10c 100644 --- a/engines/sci/engine/message.cpp +++ b/engines/sci/engine/message.cpp @@ -345,7 +345,7 @@ bool MessageState::stringLit(Common::String &outStr, const Common::String &inStr } bool MessageState::stringStage(Common::String &outstr, const Common::String &inStr, uint &index) { - // Stage directions of the form (n*), where n is anything but a digit or a lowercase character + // Stage directions of the form (n *), where n is anything but a digit or a lowercase character if (inStr[index] != '(') return false; diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 554a6b6a2c..ef61b2e28a 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -727,7 +727,7 @@ void logKernelCall(const KernelFunction *kernelCall, const KernelSubFunction *ke switch (mobj->getType()) { case SEG_TYPE_HUNK: { - HunkTable *ht = (HunkTable*)mobj; + HunkTable *ht = (HunkTable *)mobj; int index = argv[parmNr].offset; if (ht->isValidEntry(index)) { // NOTE: This ", deleted" isn't as useful as it could diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 04c61f7b7c..cc127c8dbc 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -691,7 +691,7 @@ void SegManager::memcpy(reg_t dest, const byte* src, size_t n) { if (dest_r.isRaw) { // raw -> raw - ::memcpy((char*)dest_r.raw, src, n); + ::memcpy((char *)dest_r.raw, src, n); } else { // raw -> non-raw for (uint i = 0; i < n; i++) diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index fcf9774a08..36b7d92c07 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -306,7 +306,7 @@ SegmentRef StringTable::dereference(reg_t pointer) { SegmentRef ret; ret.isRaw = true; ret.maxSize = _table[pointer.offset].getSize(); - ret.raw = (byte*)_table[pointer.offset].getRawData(); + ret.raw = (byte *)_table[pointer.offset].getRawData(); return ret; } diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index a939b042a7..daab532d0e 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -125,12 +125,17 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) { error("cursor resource %d has invalid size", resourceId); resourceData = resource->data; - // hotspot is specified for SCI1 cursors - hotspot.x = READ_LE_UINT16(resourceData); - hotspot.y = READ_LE_UINT16(resourceData + 2); - // bit 0 of resourceData[3] is set on <SCI1 games, which means center hotspot - if ((hotspot.x == 0) && (hotspot.y == 256)) - hotspot.x = hotspot.y = SCI_CURSOR_SCI0_HEIGHTWIDTH / 2; + + if (getSciVersion() <= SCI_VERSION_0_LATE) { + // SCI0 cursors contain hotspot flags, not actual hotspot coordinates. + // If bit 0 of resourceData[3] is set, the hotspot should be centered, + // otherwise it's in the top left of the mouse cursor. + hotspot.x = hotspot.y = resourceData[3] ? SCI_CURSOR_SCI0_HEIGHTWIDTH / 2 : 0; + } else { + // Cursors in newer SCI versions contain actual hotspot coordinates. + hotspot.x = READ_LE_UINT16(resourceData); + hotspot.y = READ_LE_UINT16(resourceData + 2); + } // Now find out what colors we are supposed to use colorMapping[0] = 0; // Black is hardcoded @@ -140,7 +145,7 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) { // Special case for the magnifier cursor in LB1 (bug #3487092). // No other SCI0 game has a cursor resource of 1, so this is handled // specifically for LB1. - if (resourceId == 1) + if (g_sci->getGameId() == GID_LAURABOW && resourceId == 1) colorMapping[3] = _screen->getColorWhite(); // Seek to actual data @@ -170,6 +175,11 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) { rawBitmap = upscaledBitmap; } + if (hotspot.x >= heightWidth || hotspot.y >= heightWidth) { + error("cursor %d's hotspot (%d, %d) is out of range of the cursor's dimensions (%dx%d)", + resourceId, hotspot.x, hotspot.y, heightWidth, heightWidth); + } + CursorMan.replaceCursor(rawBitmap, heightWidth, heightWidth, hotspot.x, hotspot.y, SCI_CURSOR_SCI0_TRANSPARENCYCOLOR); kernelShow(); diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 6469bc0cb3..4020518b72 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -438,7 +438,7 @@ void GfxScreen::bitsSaveScreen(Common::Rect rect, byte *screen, uint16 screenWid screen += (rect.top * screenWidth) + rect.left; for (y = rect.top; y < rect.bottom; y++) { - memcpy(memoryPtr, (void*)screen, width); memoryPtr += width; + memcpy(memoryPtr, (void *)screen, width); memoryPtr += width; screen += screenWidth; } } @@ -458,7 +458,7 @@ void GfxScreen::bitsSaveDisplayScreen(Common::Rect rect, byte *&memoryPtr) { } for (y = rect.top; y < rect.bottom; y++) { - memcpy(memoryPtr, (void*)screen, width); memoryPtr += width; + memcpy(memoryPtr, (void *)screen, width); memoryPtr += width; screen += _displayWidth; } } @@ -503,7 +503,7 @@ void GfxScreen::bitsRestoreScreen(Common::Rect rect, byte *&memoryPtr, byte *scr screen += (rect.top * screenWidth) + rect.left; for (y = rect.top; y < rect.bottom; y++) { - memcpy((void*) screen, memoryPtr, width); memoryPtr += width; + memcpy((void *) screen, memoryPtr, width); memoryPtr += width; screen += screenWidth; } } @@ -523,7 +523,7 @@ void GfxScreen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr) { } for (y = rect.top; y < rect.bottom; y++) { - memcpy((void*) screen, memoryPtr, width); memoryPtr += width; + memcpy((void *) screen, memoryPtr, width); memoryPtr += width; screen += _displayWidth; } } diff --git a/engines/sci/parser/said.cpp b/engines/sci/parser/said.cpp index d44109faec..eff4a29f49 100644 --- a/engines/sci/parser/said.cpp +++ b/engines/sci/parser/said.cpp @@ -743,7 +743,7 @@ static void node_print_desc(ParseTreeNode* node) { } } #else -static void node_print_desc(ParseTreeNode*) { } +static void node_print_desc(ParseTreeNode *) { } #endif diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 41697d4a07..131a85f371 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -524,7 +524,7 @@ MidiDriver_AmigaMac::InstrumentSample *MidiDriver_AmigaMac::readInstrumentSCI0(C instrument->size = seg_size[0]; instrument->loop_size = seg_size[1]; - instrument->loop = (int8*)malloc(instrument->loop_size + 1); + instrument->loop = (int8 *)malloc(instrument->loop_size + 1); memcpy(instrument->loop, instrument->samples + loop_offset, instrument->loop_size); instrument->samples[instrument->size] = instrument->loop[0]; @@ -708,7 +708,7 @@ void MidiDriver_AmigaMac::generateSamples(int16 *data, int len) { if (len == 0) return; - int16 *buffers = (int16*)malloc(len * 2 * kChannels); + int16 *buffers = (int16 *)malloc(len * 2 * kChannels); memset(buffers, 0, len * 2 * kChannels); @@ -869,7 +869,7 @@ bool MidiDriver_AmigaMac::loadInstrumentsSCI0Mac(Common::SeekableReadStream &fil instrument->size = seg_size[0]; instrument->loop_size = seg_size[1] - seg_size[0]; - instrument->loop = (int8*)malloc(instrument->loop_size + 1); + instrument->loop = (int8 *)malloc(instrument->loop_size + 1); memcpy(instrument->loop, instrument->samples + loop_offset, instrument->loop_size); instrument->samples[instrument->size] = instrument->loop[0]; diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 53496428e3..b8722b6963 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -2040,7 +2040,7 @@ void Actor_v0::limbFrameCheck(int limb) { _limbFrameRepeat[limb] = _limbFrameRepeatNew[limb]; // 0x25C3 - _cost.active[limb] = ((V0CostumeLoader*)_vm->_costumeLoader)->getFrame(this, limb); + _cost.active[limb] = ((V0CostumeLoader *)_vm->_costumeLoader)->getFrame(this, limb); _cost.curpos[limb] = 0; _needRedraw = true; diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index 2bbf3b3801..6e7e9ff688 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -668,7 +668,7 @@ void ClassicCostumeRenderer::procPCEngine(Codec1 &v1) { (v1.mask_ptr && (mask[0] & maskbit)); if (pcolor && !masked) { - WRITE_UINT16(dst, ((uint16*)_palette)[pcolor]); + WRITE_UINT16(dst, ((uint16 *)_palette)[pcolor]); } xPos += xStep; diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 36f06a4889..42f11498d9 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -636,7 +636,7 @@ void ScummEngine_v5::setBuiltinCursor(int idx) { byte *dst2 = (_textSurfaceMultiplier == 2) ? dst1 + 16 * scl : dst1; if (_outputPixelFormat.bytesPerPixel == 2) { for (int b = 0; b < scl; b += 2) { - *((uint16*)dst1) = *((uint16*)dst2) = color; + *((uint16 *)dst1) = *((uint16 *)dst2) = color; dst1 += 2; dst2 += 2; } diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 3e1ad53ed6..b47982af00 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -598,7 +598,7 @@ static void detectGames(const Common::FSList &fslist, Common::List<DetectorResul } if (isDiskImg) - closeDiskImage((ScummDiskImage*)tmp); + closeDiskImage((ScummDiskImage *)tmp); delete tmp; } diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index bc6cfc761e..48ccdfd1cf 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -1136,7 +1136,7 @@ void ScummEngine::clearTextSurface() { _townsScreen->fillLayerRect(1, 0, 0, _textSurface.w, _textSurface.h, 0); #endif - fill((byte*)_textSurface.pixels, _textSurface.pitch, + fill((byte *)_textSurface.pixels, _textSurface.pitch, #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE _game.platform == Common::kPlatformFMTowns ? 0 : #endif @@ -2773,7 +2773,7 @@ void GdiNES::drawStripNESMask(byte *dst, int stripnr, int top, int height) const void readOffsetTable(const byte *ptr, uint16 **table, int *count) { int pos = 0; *count = READ_LE_UINT16(ptr) / 2 + 1; - *table = (uint16*)malloc(*count * sizeof(uint16)); + *table = (uint16 *)malloc(*count * sizeof(uint16)); for (int i = 0; i < *count; i++) { (*table)[i] = READ_LE_UINT16(ptr + pos) + pos + 2; pos += 2; @@ -2977,10 +2977,10 @@ void GdiPCEngine::decodePCEngineTileData(const byte *ptr) { if (_distaff) { free(_PCE.staffTiles); - _PCE.staffTiles = (byte*)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); + _PCE.staffTiles = (byte *)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); } else { free(_PCE.roomTiles); - _PCE.roomTiles = (byte*)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); + _PCE.roomTiles = (byte *)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); } for (int i = 0; i < _PCE.numTiles; ++i) { @@ -3023,7 +3023,7 @@ void GdiPCEngine::decodePCEngineMaskData(const byte *ptr) { readOffsetTable(ptr, &maskOffsets, &_PCE.numMasks); free(_PCE.masks); - _PCE.masks = (byte*)malloc(_PCE.numMasks * 8 * sizeof(byte)); + _PCE.masks = (byte *)malloc(_PCE.numMasks * 8 * sizeof(byte)); for (int i = 0; i < _PCE.numMasks; ++i) { mask = &_PCE.masks[i * 8]; diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index 6a3f50a1af..8bffcab4a0 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -39,7 +39,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in int m = _textSurfaceMultiplier; uint8 *src1 = vs->getPixels(srcX, srcY); - uint8 *src2 = (uint8*)_textSurface.getBasePtr(srcX * m, (srcY + vs->topline - _screenTop) * m); + uint8 *src2 = (uint8 *)_textSurface.getBasePtr(srcX * m, (srcY + vs->topline - _screenTop) * m); uint8 *dst1 = _townsScreen->getLayerPixels(0, dstX, dstY); uint8 *dst2 = _townsScreen->getLayerPixels(1, dstX * m, dstY * m); @@ -52,7 +52,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in for (int h = 0; h < height; ++h) { if (_outputPixelFormat.bytesPerPixel == 2) { for (int w = 0; w < width; ++w) { - *(uint16*)dst1 = _16BitPalette[*src1++]; + *(uint16 *)dst1 = _16BitPalette[*src1++]; dst1 += _outputPixelFormat.bytesPerPixel; } @@ -245,7 +245,7 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void l->numCol = numCol; l->bpp = ((numCol - 1) & 0xff00) ? 2 : 1; l->pitch = width * l->bpp; - l->palette = (uint8*)pal; + l->palette = (uint8 *)pal; if (l->palette && _pixelFormat.bytesPerPixel == 1) warning("TownsScreen::setupLayer(): Layer palette usage requires 16 bit graphics setting.\nLayer palette will be ignored."); @@ -304,7 +304,7 @@ void TownsScreen::fillLayerRect(int layer, int x, int y, int w, int h, int col) for (int i = 0; i < h; ++i) { if (l->bpp == 2) { for (int ii = 0; ii < w; ++ii) { - *(uint16*)pos = col; + *(uint16 *)pos = col; pos += 2; } pos += (l->pitch - w * 2); @@ -472,10 +472,10 @@ void TownsScreen::updateOutputBuffer() { if (col || l->onBottom) { if (l->numCol == 16) col = (col >> 4) & (col & 0x0f); - *(uint16*)dst = l->bltTmpPal[col]; + *(uint16 *)dst = l->bltTmpPal[col]; } } else { - *(uint16*)dst = *(uint16*)src; + *(uint16 *)dst = *(uint16 *)src; } dst += 2; } diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index 85e2a2f1dd..1007d2a7b0 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -652,7 +652,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) * even addresses, so the use of (void *) in the * following cast shuts the compiler from warning * unnecessarily. */ - size = voxStream->readBuffer((int16*)(void *)sound, size * 2); + size = voxStream->readBuffer((int16 *)(void *)sound, size * 2); size *= 2; // 16bits. delete voxStream; diff --git a/engines/scumm/player_apple2.h b/engines/scumm/player_apple2.h index c3e1b7fc60..b4a7d409fb 100644 --- a/engines/scumm/player_apple2.h +++ b/engines/scumm/player_apple2.h @@ -209,7 +209,7 @@ public: } uint32 readSamples(void *buffer, int numSamples) { - return _buffer.read((byte*)buffer, numSamples * 2) / 2; + return _buffer.read((byte *)buffer, numSamples * 2) / 2; } private: diff --git a/engines/scumm/player_sid.cpp b/engines/scumm/player_sid.cpp index ecfaef22c1..7a609364e5 100644 --- a/engines/scumm/player_sid.cpp +++ b/engines/scumm/player_sid.cpp @@ -1293,7 +1293,7 @@ int Player_SID::readBuffer(int16 *buffer, const int numSamples) { _cpuCyclesLeft = timingProps[_videoSystem].cyclesPerFrame; } // fetch samples - int sampleCount = _sid->updateClock(_cpuCyclesLeft, (short*)buffer, samplesLeft); + int sampleCount = _sid->updateClock(_cpuCyclesLeft, (short *)buffer, samplesLeft); samplesLeft -= sampleCount; buffer += sampleCount; } diff --git a/engines/scumm/player_v1.cpp b/engines/scumm/player_v1.cpp index 8afede8c5a..8e784e9866 100644 --- a/engines/scumm/player_v1.cpp +++ b/engines/scumm/player_v1.cpp @@ -351,8 +351,8 @@ parse_again: *_value_ptr_2 = _start_2; } debug(6, "chunk 1: %lu: %d step %d for %d, %lu: %d step %d for %d", - (long)(_value_ptr - (uint*)_channels), _start, _delta, _time_left, - (long)(_value_ptr_2 - (uint*)_channels), _start_2, _delta_2, _time_left_2); + (long)(_value_ptr - (uint *)_channels), _start, _delta, _time_left, + (long)(_value_ptr_2 - (uint *)_channels), _start_2, _delta_2, _time_left_2); break; case 2: diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index f445a44ded..b2093e9c1a 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -232,7 +232,7 @@ void ScummEngine::askForDisk(const char *filename, int disknum) { #endif } else { sprintf(buf, "Cannot find file: '%s'", filename); - InfoDialog dialog(this, (char*)buf); + InfoDialog dialog(this, (char *)buf); runDialog(dialog); error("Cannot find file: '%s'", filename); } @@ -350,7 +350,7 @@ void ScummEngine_v7::readIndexBlock(uint32 blocktype, uint32 itemsize) { switch (blocktype) { case MKTAG('A','N','A','M'): // Used by: The Dig, FT num = _fileHandle->readUint16LE(); - ptr = (char*)malloc(num * 9); + ptr = (char *)malloc(num * 9); _fileHandle->read(ptr, num * 9); _imuseDigital->setAudioNames(num, ptr); break; diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 6e54377199..beac077fd1 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -875,21 +875,21 @@ void ScummEngine::saveOrLoad(Serializer *s) { // vm.localvar grew from 25 to 40 script entries and then from // 16 to 32 bit variables (but that wasn't reflect here)... and // THEN from 16 to 25 variables. - MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 17, 25, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(8), VER(8)), - MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 17, 40, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(9), VER(14)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 17, 25, (byte *)vm.localvar[1] - (byte *)vm.localvar[0], VER(8), VER(8)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 17, 40, (byte *)vm.localvar[1] - (byte *)vm.localvar[0], VER(9), VER(14)), // We used to save 25 * 40 = 1000 blocks; but actually, each 'row consisted of 26 entry, // i.e. 26 * 40 = 1040. Thus the last 40 blocks of localvar where not saved at all. To be // able to load this screwed format, we use a trick: We load 26 * 38 = 988 blocks. // Then, we mark the followin 12 blocks (24 bytes) as obsolete. - MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 26, 38, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(15), VER(17)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 26, 38, (byte *)vm.localvar[1] - (byte *)vm.localvar[0], VER(15), VER(17)), MK_OBSOLETE_ARRAY(ScummEngine, vm.localvar[39][0], sleUint16, 12, VER(15), VER(17)), // This was the first proper multi dimensional version of the localvars, with 32 bit values - MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint32, 26, 40, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(18), VER(19)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint32, 26, 40, (byte *)vm.localvar[1] - (byte *)vm.localvar[0], VER(18), VER(19)), // Then we doubled the script slots again, from 40 to 80 - MKARRAY2(ScummEngine, vm.localvar[0][0], sleUint32, 26, NUM_SCRIPT_SLOT, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(20)), + MKARRAY2(ScummEngine, vm.localvar[0][0], sleUint32, 26, NUM_SCRIPT_SLOT, (byte *)vm.localvar[1] - (byte *)vm.localvar[0], VER(20)), MKARRAY(ScummEngine, _resourceMapper[0], sleByte, 128, VER(8)), @@ -1538,7 +1538,7 @@ void ScummEngine_v5::saveOrLoad(Serializer *s) { ScummEngine::saveOrLoad(s); const SaveLoadEntry cursorEntries[] = { - MKARRAY2(ScummEngine_v5, _cursorImages[0][0], sleUint16, 16, 4, (byte*)_cursorImages[1] - (byte*)_cursorImages[0], VER(44)), + MKARRAY2(ScummEngine_v5, _cursorImages[0][0], sleUint16, 16, 4, (byte *)_cursorImages[1] - (byte *)_cursorImages[0], VER(44)), MKARRAY(ScummEngine_v5, _cursorHotspots[0], sleByte, 8, VER(44)), MKEND() }; diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h index 90feee6dc0..d5f7ea526e 100644 --- a/engines/scumm/saveload.h +++ b/engines/scumm/saveload.h @@ -74,13 +74,13 @@ namespace Scumm { * what POD means refer to <http://en.wikipedia.org/wiki/Plain_Old_Data_Structures> or * to <http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=32&rl=1>) */ -#define OFFS(type,item) (((ptrdiff_t)(&((type*)42)->type::item))-42) +#define OFFS(type,item) (((ptrdiff_t)(&((type *)42)->type::item))-42) /** * Similar to the OFFS macro, this macro computes the size (in bytes) of a * member of a given struct/class type. */ -#define SIZE(type,item) sizeof(((type*)42)->type::item) +#define SIZE(type,item) sizeof(((type *)42)->type::item) // Any item that is still in use automatically gets a maxVersion equal to CURRENT_VER #define MKLINE(type,item,saveas,minVer) {OFFS(type,item),saveas,SIZE(type,item),minVer,CURRENT_VER} diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp index 8340f62dbc..1de9f08168 100644 --- a/engines/scumm/script_v4.cpp +++ b/engines/scumm/script_v4.cpp @@ -350,7 +350,7 @@ void ScummEngine_v4::loadIQPoints(byte *ptr, int size) { file = _saveFileMan->openForLoading(filename); if (file != NULL) { - byte *tmp = (byte*)malloc(size); + byte *tmp = (byte *)malloc(size); int nread = file->read(tmp, size); if (nread == size) { memcpy(ptr, tmp, size); @@ -414,7 +414,7 @@ void ScummEngine_v4::o4_saveLoadGame() { // use name entered by the user char* ptr; int firstSlot = (_game.id == GID_LOOM) ? STRINGID_SAVENAME1_LOOM : STRINGID_SAVENAME1; - ptr = (char*)getStringAddress(slot + firstSlot - 1); + ptr = (char *)getStringAddress(slot + firstSlot - 1); strncpy(name, ptr, sizeof(name)); } diff --git a/engines/scumm/script_v8.cpp b/engines/scumm/script_v8.cpp index c8b92be3c8..f6f376f3c9 100644 --- a/engines/scumm/script_v8.cpp +++ b/engines/scumm/script_v8.cpp @@ -1122,7 +1122,7 @@ void ScummEngine_v8::o8_kernelSetFunctions() { } case 26: { // saveGameWrite // FIXME: This doesn't work - char *address = (char*)getStringAddress(args[2]); + char *address = (char *)getStringAddress(args[2]); debug(0, "o8_kernelSetFunctions: saveGame(%d, %s)", args[1], address); break; } diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index bcb45e2e92..975307d0d0 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -112,7 +112,7 @@ void ScummEngine::showMessageDialog(const byte *msg) { if (_string[3].color == 0) _string[3].color = 4; - InfoDialog dialog(this, (char*)buf); + InfoDialog dialog(this, (char *)buf); VAR(VAR_KEYPRESS) = runDialog(dialog); } diff --git a/engines/sky/autoroute.cpp b/engines/sky/autoroute.cpp index 5273b21807..ab791cb066 100644 --- a/engines/sky/autoroute.cpp +++ b/engines/sky/autoroute.cpp @@ -242,7 +242,7 @@ uint16 AutoRoute::autoRoute(Compact *cpt) { clipCoordX(cpt->arTargetX, destX, initDestX); clipCoordY(cpt->arTargetY, destY, initDestY); - uint16 *routeDest = (uint16*)_skyCompact->fetchCpt(cpt->animScratchId); + uint16 *routeDest = (uint16 *)_skyCompact->fetchCpt(cpt->animScratchId); memset(routeDest, 0, 64); if ((startX == destX) && (startY == destY)) return 2; diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp index fd81cb9bea..cf9bd55b1a 100644 --- a/engines/sky/compact.cpp +++ b/engines/sky/compact.cpp @@ -34,7 +34,7 @@ namespace Sky { #define SKY_CPT_SIZE 419427 -#define OFFS(type,item) (((ptrdiff_t)(&((type*)42)->item))-42) +#define OFFS(type,item) (((ptrdiff_t)(&((type *)42)->item))-42) #define MK32(type,item) OFFS(type, item),0,0,0 #define MK16(type,item) OFFS(type, item),0 #define MK32_A5(type, item) MK32(type, item[0]), MK32(type, item[1]), \ @@ -147,28 +147,28 @@ SkyCompact::SkyCompact() { _numDataLists = _cptFile->readUint16LE(); _cptNames = (char***)malloc(_numDataLists * sizeof(char**)); _dataListLen = (uint16 *)malloc(_numDataLists * sizeof(uint16)); - _cptSizes = (uint16 **)malloc(_numDataLists * sizeof(uint16*)); - _cptTypes = (uint16 **)malloc(_numDataLists * sizeof(uint16*)); + _cptSizes = (uint16 **)malloc(_numDataLists * sizeof(uint16 *)); + _cptTypes = (uint16 **)malloc(_numDataLists * sizeof(uint16 *)); _compacts = (Compact***)malloc(_numDataLists * sizeof(Compact**)); for (int i = 0; i < _numDataLists; i++) { _dataListLen[i] = _cptFile->readUint16LE(); - _cptNames[i] = (char**)malloc(_dataListLen[i] * sizeof(char*)); + _cptNames[i] = (char**)malloc(_dataListLen[i] * sizeof(char *)); _cptSizes[i] = (uint16 *)malloc(_dataListLen[i] * sizeof(uint16)); _cptTypes[i] = (uint16 *)malloc(_dataListLen[i] * sizeof(uint16)); - _compacts[i] = (Compact**)malloc(_dataListLen[i] * sizeof(Compact*)); + _compacts[i] = (Compact**)malloc(_dataListLen[i] * sizeof(Compact *)); } uint32 rawSize = _cptFile->readUint32LE() * sizeof(uint16); - uint16 *rawPos = _rawBuf = (uint16*)malloc(rawSize); + uint16 *rawPos = _rawBuf = (uint16 *)malloc(rawSize); uint32 srcSize = _cptFile->readUint32LE() * sizeof(uint16); - uint16 *srcBuf = (uint16*)malloc(srcSize); + uint16 *srcBuf = (uint16 *)malloc(srcSize); uint16 *srcPos = srcBuf; _cptFile->read(srcBuf, srcSize); uint32 asciiSize = _cptFile->readUint32LE(); - char *asciiPos = _asciiBuf = (char*)malloc(asciiSize); + char *asciiPos = _asciiBuf = (char *)malloc(asciiSize); _cptFile->read(_asciiBuf, asciiSize); // and fill them with the compact data @@ -177,7 +177,7 @@ SkyCompact::SkyCompact() { _cptSizes[lcnt][ecnt] = READ_LE_UINT16(srcPos++); if (_cptSizes[lcnt][ecnt]) { _cptTypes[lcnt][ecnt] = READ_LE_UINT16(srcPos++); - _compacts[lcnt][ecnt] = (Compact*)rawPos; + _compacts[lcnt][ecnt] = (Compact *)rawPos; _cptNames[lcnt][ecnt] = asciiPos; asciiPos += strlen(asciiPos) + 1; @@ -193,7 +193,7 @@ SkyCompact::SkyCompact() { free(srcBuf); uint16 numDlincs = _cptFile->readUint16LE(); - uint16 *dlincBuf = (uint16*)malloc(numDlincs * 2 * sizeof(uint16)); + uint16 *dlincBuf = (uint16 *)malloc(numDlincs * 2 * sizeof(uint16)); uint16 *dlincPos = dlincBuf; _cptFile->read(dlincBuf, numDlincs * 2 * sizeof(uint16)); // these compacts don't actually exist but only point to other ones... @@ -213,13 +213,13 @@ SkyCompact::SkyCompact() { // if this is v0.0288, parse this diff data uint16 numDiffs = _cptFile->readUint16LE(); uint16 diffSize = _cptFile->readUint16LE(); - uint16 *diffBuf = (uint16*)malloc(diffSize * sizeof(uint16)); + uint16 *diffBuf = (uint16 *)malloc(diffSize * sizeof(uint16)); _cptFile->read(diffBuf, diffSize * sizeof(uint16)); if (SkyEngine::_systemVars.gameVersion == 288) { uint16 *diffPos = diffBuf; for (cnt = 0; cnt < numDiffs; cnt++) { uint16 cptId = READ_LE_UINT16(diffPos++); - uint16 *rawCpt = (uint16*)fetchCpt(cptId); + uint16 *rawCpt = (uint16 *)fetchCpt(cptId); rawCpt += READ_LE_UINT16(diffPos++); uint16 len = READ_LE_UINT16(diffPos++); for (uint16 elemCnt = 0; elemCnt < len; elemCnt++) @@ -231,7 +231,7 @@ SkyCompact::SkyCompact() { // these are the IDs that have to be saved into savegame files. _numSaveIds = _cptFile->readUint16LE(); - _saveIds = (uint16*)malloc(_numSaveIds * sizeof(uint16)); + _saveIds = (uint16 *)malloc(_numSaveIds * sizeof(uint16)); _cptFile->read(_saveIds, _numSaveIds * sizeof(uint16)); for (cnt = 0; cnt < _numSaveIds; cnt++) _saveIds[cnt] = FROM_LE_16(_saveIds[cnt]); @@ -318,7 +318,7 @@ uint16 *SkyCompact::getSub(Compact *cpt, uint16 mode) { } uint16 *SkyCompact::getGrafixPtr(Compact *cpt) { - uint16 *gfxBase = (uint16*)fetchCpt(cpt->grafixProgId); + uint16 *gfxBase = (uint16 *)fetchCpt(cpt->grafixProgId); if (gfxBase == NULL) return NULL; @@ -358,7 +358,7 @@ MegaSet *SkyCompact::getMegaSet(Compact *cpt) { */ uint16 *SkyCompact::getTurnTable(Compact *cpt, uint16 dir) { MegaSet *m = getMegaSet(cpt); - TurnTable *turnTable = (TurnTable*)fetchCpt(m->turnTableId); + TurnTable *turnTable = (TurnTable *)fetchCpt(m->turnTableId); switch (dir) { case 0: return turnTable->turnTableUp; @@ -418,7 +418,7 @@ void *SkyCompact::getCompactElem(Compact *cpt, uint16 off) { uint8 *SkyCompact::createResetData(uint16 gameVersion) { _cptFile->seek(_resetDataPos); uint32 dataSize = _cptFile->readUint16LE() * sizeof(uint16); - uint16 *resetBuf = (uint16*)malloc(dataSize); + uint16 *resetBuf = (uint16 *)malloc(dataSize); _cptFile->read(resetBuf, dataSize); uint16 numDiffs = _cptFile->readUint16LE(); for (uint16 cnt = 0; cnt < numDiffs; cnt++) { @@ -429,7 +429,7 @@ uint8 *SkyCompact::createResetData(uint16 gameVersion) { uint16 pos = _cptFile->readUint16LE(); resetBuf[pos] = TO_LE_16(_cptFile->readUint16LE()); } - return (uint8*)resetBuf; + return (uint8 *)resetBuf; } else _cptFile->seek(diffFields * 2 * sizeof(uint16), SEEK_CUR); } diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index 036659a677..c1ed763281 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -1160,7 +1160,7 @@ uint32 Control::prepareSaveData(uint8 *destBuf) { for (cnt = 0; cnt < _skyCompact->_numSaveIds; cnt++) { uint16 numElems; - uint16 *rawCpt = (uint16*)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, NULL, NULL); + uint16 *rawCpt = (uint16 *)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, NULL, NULL); for (uint16 elemCnt = 0; elemCnt < numElems; elemCnt++) STOSW(destPos, rawCpt[elemCnt]); } @@ -1209,9 +1209,9 @@ void Control::importOldCompact(Compact* destCpt, uint8 **srcPos, uint16 numElems else if (graphType == OG_COMPACT) destCpt->grafixProgId = target; else if (graphType == OG_TALKTABLE) - destCpt->grafixProgId = ((uint16*)_skyCompact->fetchCpt(CPT_TALK_TABLE_LIST))[target]; + destCpt->grafixProgId = ((uint16 *)_skyCompact->fetchCpt(CPT_TALK_TABLE_LIST))[target]; else if (graphType == OG_COMPACTELEM) - destCpt->grafixProgId = *(uint16*)_skyCompact->getCompactElem(destCpt, target); + destCpt->grafixProgId = *(uint16 *)_skyCompact->getCompactElem(destCpt, target); else error("Illegal GrafixProg type encountered for compact %s", name); } @@ -1330,7 +1330,7 @@ uint16 Control::parseSaveData(uint8 *srcBuf) { LODSD(srcPos, mouseType); LODSD(srcPos, palette); - _skyLogic->parseSaveData((uint32*)srcPos); + _skyLogic->parseSaveData((uint32 *)srcPos); srcPos += NUM_SKY_SCRIPTVARS * sizeof(uint32); for (cnt = 0; cnt < 60; cnt++) @@ -1339,7 +1339,7 @@ uint16 Control::parseSaveData(uint8 *srcBuf) { if (saveRev == SAVE_FILE_REVISION) { for (cnt = 0; cnt < _skyCompact->_numSaveIds; cnt++) { uint16 numElems; - uint16 *rawCpt = (uint16*)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, NULL, NULL); + uint16 *rawCpt = (uint16 *)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, NULL, NULL); for (uint16 elemCnt = 0; elemCnt < numElems; elemCnt++) LODSW(srcPos, rawCpt[elemCnt]); } @@ -1348,19 +1348,19 @@ uint16 Control::parseSaveData(uint8 *srcBuf) { uint16 numElems; uint16 type; char name[128]; - uint16 *rawCpt = (uint16*)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, &type, name); + uint16 *rawCpt = (uint16 *)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, &type, name); if (type == COMPACT) { - importOldCompact((Compact*)rawCpt, &srcPos, numElems, type, name); + importOldCompact((Compact *)rawCpt, &srcPos, numElems, type, name); } else if (type == ROUTEBUF) { assert(numElems == 32); for (uint32 elemCnt = 0; elemCnt < numElems; elemCnt++) LODSW(srcPos, rawCpt[elemCnt]); } } - uint16 *rawCpt = (uint16*)_skyCompact->fetchCpt(0xBF); + uint16 *rawCpt = (uint16 *)_skyCompact->fetchCpt(0xBF); for (cnt = 0; cnt < 3; cnt++) LODSW(srcPos, rawCpt[cnt]); - rawCpt = (uint16*)_skyCompact->fetchCpt(0xC2); + rawCpt = (uint16 *)_skyCompact->fetchCpt(0xC2); for (cnt = 0; cnt < 13; cnt++) LODSW(srcPos, rawCpt[cnt]); } @@ -1467,7 +1467,7 @@ void Control::restartGame() { return; // no restart for floppy demo uint8 *resetData = _skyCompact->createResetData((uint16)SkyEngine::_systemVars.gameVersion); - parseSaveData((uint8*)resetData); + parseSaveData((uint8 *)resetData); free(resetData); _skyScreen->forceRefresh(); diff --git a/engines/sky/control.h b/engines/sky/control.h index 42ada564df..280f7e19cd 100644 --- a/engines/sky/control.h +++ b/engines/sky/control.h @@ -136,7 +136,7 @@ class ConResource { public: ConResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen); virtual ~ConResource() {} - void setSprite(void *pSpData) { _spriteData = (DataFileHeader*)pSpData; } + void setSprite(void *pSpData) { _spriteData = (DataFileHeader *)pSpData; } void setText(uint32 pText) { if (pText) _text = pText + 0x7000; else _text = 0; } void setXY(uint16 x, uint16 y) { _x = x; _y = y; } bool isMouseOver(uint32 mouseX, uint32 mouseY); diff --git a/engines/sky/disk.cpp b/engines/sky/disk.cpp index 99b707dcf1..e97aeb01a2 100644 --- a/engines/sky/disk.cpp +++ b/engines/sky/disk.cpp @@ -117,7 +117,7 @@ uint8 *Disk::loadFile(uint16 fileNr) { cflag = (uint8)((fileFlags >> 23) & 0x1); //if cflag == 0 then file is compressed, 1 == uncompressed - DataFileHeader *fileHeader = (DataFileHeader*)fileDest; + DataFileHeader *fileHeader = (DataFileHeader *)fileDest; if ((!cflag) && ((FROM_LE_16(fileHeader->flag) >> 7) & 1)) { debug(4, "File is RNC compressed."); @@ -175,7 +175,7 @@ uint8 *Disk::loadFile(uint16 fileNr) { } uint16 *Disk::loadScriptFile(uint16 fileNr) { - uint16 *buf = (uint16*)loadFile(fileNr); + uint16 *buf = (uint16 *)loadFile(fileNr); #ifdef SCUMM_BIG_ENDIAN for (uint i = 0; i < _lastLoadedFileSize / 2; i++) buf[i] = FROM_LE_16(buf[i]); diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index f1ea4d2df2..2f75a19b69 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -633,8 +633,8 @@ Intro::Intro(Disk *disk, Screen *screen, MusicBase *music, Sound *sound, Text *t _skyText = text; _mixer = mixer; _system = system; - _textBuf = (uint8*)malloc(10000); - _saveBuf = (uint8*)malloc(10000); + _textBuf = (uint8 *)malloc(10000); + _saveBuf = (uint8 *)malloc(10000); _bgBuf = NULL; _relDelay = 0; } @@ -774,7 +774,7 @@ bool Intro::nextPart(uint16 *&data) { } bool Intro::floppyScrollFlirt() { - uint8 *scrollScreen = (uint8*)malloc(FRAME_SIZE * 2); + uint8 *scrollScreen = (uint8 *)malloc(FRAME_SIZE * 2); memset(scrollScreen, 0, FRAME_SIZE); memcpy(scrollScreen + FRAME_SIZE, _skyScreen->giveCurrent(), FRAME_SIZE); uint8 *scrollPos = scrollScreen + FRAME_SIZE; @@ -828,8 +828,8 @@ bool Intro::commandFlirt(uint16 *&data) { _skyText->displayText(*data++, _textBuf, true, INTRO_TEXT_WIDTH, 255); break; case IC_SHOW_TEXT: - ((DataFileHeader*)_textBuf)->s_x = *data++; - ((DataFileHeader*)_textBuf)->s_y = *data++; + ((DataFileHeader *)_textBuf)->s_x = *data++; + ((DataFileHeader *)_textBuf)->s_y = *data++; showTextBuf(); break; case IC_REMOVE_TEXT: @@ -858,10 +858,10 @@ bool Intro::commandFlirt(uint16 *&data) { } void Intro::showTextBuf() { - uint16 x = ((DataFileHeader*)_textBuf)->s_x; - uint16 y = ((DataFileHeader*)_textBuf)->s_y; - uint16 width = ((DataFileHeader*)_textBuf)->s_width; - uint16 height = ((DataFileHeader*)_textBuf)->s_height; + uint16 x = ((DataFileHeader *)_textBuf)->s_x; + uint16 y = ((DataFileHeader *)_textBuf)->s_y; + uint16 width = ((DataFileHeader *)_textBuf)->s_width; + uint16 height = ((DataFileHeader *)_textBuf)->s_height; uint8 *screenBuf = _skyScreen->giveCurrent() + y * GAME_SCREEN_WIDTH + x; memcpy(_saveBuf, _textBuf, sizeof(DataFileHeader)); uint8 *saveBuf = _saveBuf + sizeof(DataFileHeader); @@ -880,10 +880,10 @@ void Intro::showTextBuf() { } void Intro::restoreScreen() { - uint16 x = ((DataFileHeader*)_saveBuf)->s_x; - uint16 y = ((DataFileHeader*)_saveBuf)->s_y; - uint16 width = ((DataFileHeader*)_saveBuf)->s_width; - uint16 height = ((DataFileHeader*)_saveBuf)->s_height; + uint16 x = ((DataFileHeader *)_saveBuf)->s_x; + uint16 y = ((DataFileHeader *)_saveBuf)->s_y; + uint16 width = ((DataFileHeader *)_saveBuf)->s_width; + uint16 height = ((DataFileHeader *)_saveBuf)->s_height; uint8 *screenBuf = _skyScreen->giveCurrent() + y * GAME_SCREEN_WIDTH + x; uint8 *saveBuf = _saveBuf + sizeof(DataFileHeader); for (uint16 cnt = 0; cnt < height; cnt++) { diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp index 18fb4f7e82..e92e768272 100644 --- a/engines/sky/logic.cpp +++ b/engines/sky/logic.cpp @@ -382,8 +382,8 @@ void Logic::mainAnim() { } }; - uint16 animId = *(uint16*)_skyCompact->getCompactElem(_compact, C_ANIM_UP + _compact->megaSet + dir * 4); - uint16 *animList = (uint16*)_skyCompact->fetchCpt(animId); + uint16 animId = *(uint16 *)_skyCompact->getCompactElem(_compact, C_ANIM_UP + _compact->megaSet + dir * 4); + uint16 *animList = (uint16 *)_skyCompact->fetchCpt(animId); uint16 arAnimIndex = _compact->arAnimIndex; if (!animList[arAnimIndex / 2]) { @@ -400,7 +400,7 @@ void Logic::mainAnim() { } void Logic::arTurn() { - uint16 *turnData = (uint16*)_skyCompact->fetchCpt(_compact->turnProgId) + _compact->turnProgPos; + uint16 *turnData = (uint16 *)_skyCompact->fetchCpt(_compact->turnProgId) + _compact->turnProgPos; _compact->frame = *turnData++; _compact->turnProgPos++; @@ -453,7 +453,7 @@ void Logic::anim() { } void Logic::turn() { - uint16 *turnData = (uint16*)_skyCompact->fetchCpt(_compact->turnProgId) + _compact->turnProgPos; + uint16 *turnData = (uint16 *)_skyCompact->fetchCpt(_compact->turnProgId) + _compact->turnProgPos; if (*turnData) { _compact->frame = *turnData; _compact->turnProgPos++; @@ -1425,12 +1425,12 @@ uint16 Logic::script(uint16 scriptNo, uint16 offset) { bool Logic::fnCacheChip(uint32 a, uint32 b, uint32 c) { _skySound->fnStopFx(); - _skyDisk->fnCacheChip((uint16*)_skyCompact->fetchCpt((uint16)a)); + _skyDisk->fnCacheChip((uint16 *)_skyCompact->fetchCpt((uint16)a)); return true; } bool Logic::fnCacheFast(uint32 a, uint32 b, uint32 c) { - _skyDisk->fnCacheFast((uint16*)_skyCompact->fetchCpt((uint16)a)); + _skyDisk->fnCacheFast((uint16 *)_skyCompact->fetchCpt((uint16)a)); return true; } @@ -1577,7 +1577,7 @@ bool Logic::fnGetTo(uint32 targetPlaceId, uint32 mode, uint32 c) { warning("can't find _compact's getToTable. Place compact is NULL"); return false; } - uint16 *getToTable = (uint16*)_skyCompact->fetchCpt(cpt->getToTableId); + uint16 *getToTable = (uint16 *)_skyCompact->fetchCpt(cpt->getToTableId); if (!getToTable) { warning("Place compact's getToTable is NULL"); return false; @@ -1596,7 +1596,7 @@ bool Logic::fnGetTo(uint32 targetPlaceId, uint32 mode, uint32 c) { bool Logic::fnSetToStand(uint32 a, uint32 b, uint32 c) { _compact->mood = 1; // high level stood still - _compact->grafixProgId = *(uint16*)_skyCompact->getCompactElem(_compact, C_STAND_UP + _compact->megaSet + _compact->dir * 4); + _compact->grafixProgId = *(uint16 *)_skyCompact->getCompactElem(_compact, C_STAND_UP + _compact->megaSet + _compact->dir * 4); _compact->grafixProgPos = 0; uint16 *standList = _skyCompact->getGrafixPtr(_compact); @@ -2158,8 +2158,8 @@ bool Logic::fnSetMegaSet(uint32 mega, uint32 setNo, uint32 c) { bool Logic::fnMoveItems(uint32 listNo, uint32 screenNo, uint32 c) { // Move a list of id's to another screen - uint16 *p = (uint16*)_skyCompact->fetchCpt(CPT_MOVE_LIST); - p = (uint16*)_skyCompact->fetchCpt(p[listNo]); + uint16 *p = (uint16 *)_skyCompact->fetchCpt(CPT_MOVE_LIST); + p = (uint16 *)_skyCompact->fetchCpt(p[listNo]); for (int i = 0; i < 2; i++) { if (!*p) return true; @@ -2528,7 +2528,7 @@ void Logic::stdSpeak(Compact *target, uint32 textNum, uint32 animNum, uint32 bas animNum += target->megaSet / NEXT_MEGA_SET; animNum &= 0xFF; - uint16 *talkTable = (uint16*)_skyCompact->fetchCpt(CPT_TALK_TABLE_LIST); + uint16 *talkTable = (uint16 *)_skyCompact->fetchCpt(CPT_TALK_TABLE_LIST); target->grafixProgId = talkTable[animNum]; target->grafixProgPos = 0; uint16 *animPtr = _skyCompact->getGrafixPtr(target); diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp index 98f942889e..74a92c8f00 100644 --- a/engines/sky/mouse.cpp +++ b/engines/sky/mouse.cpp @@ -319,7 +319,7 @@ void Mouse::fnOpenCloseHand(bool open) { if (open) cursor++; - uint32 size = ((DataFileHeader*)_objectMouseData)->s_sp_size; + uint32 size = ((DataFileHeader *)_objectMouseData)->s_sp_size; uint8 *srcData; uint8 *destData; diff --git a/engines/sky/music/adlibchannel.cpp b/engines/sky/music/adlibchannel.cpp index 896b58aa22..99509554c7 100644 --- a/engines/sky/music/adlibchannel.cpp +++ b/engines/sky/music/adlibchannel.cpp @@ -49,32 +49,32 @@ AdLibChannel::AdLibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) { if (SkyEngine::_systemVars.gameVersion == 109) { //instrumentDataLoc = (_musicData[0x11D0] << 8) | _musicData[0x11CF]; - //_frequenceTable = (uint16*)(_musicData + 0x835); + //_frequenceTable = (uint16 *)(_musicData + 0x835); //_registerTable = _musicData + 0xE35; //_opOutputTable = _musicData + 0xE47; //_adlibRegMirror = _musicData + 0xF4A; instrumentDataLoc = READ_LE_UINT16(_musicData + 0x1204); - _frequenceTable = (uint16*)(_musicData + 0x868); + _frequenceTable = (uint16 *)(_musicData + 0x868); _registerTable = _musicData + 0xE68; _opOutputTable = _musicData + 0xE7A; _adlibRegMirror = _musicData + 0xF7D; } else if (SkyEngine::_systemVars.gameVersion == 267) { instrumentDataLoc = READ_LE_UINT16(_musicData + 0x11FB); - _frequenceTable = (uint16*)(_musicData + 0x7F4); + _frequenceTable = (uint16 *)(_musicData + 0x7F4); _registerTable = _musicData + 0xDF4; _opOutputTable = _musicData + 0xE06; _adlibRegMirror = _musicData + 0xF55; } else { instrumentDataLoc = READ_LE_UINT16(_musicData + 0x1205); - _frequenceTable = (uint16*)(_musicData + 0x7FE); + _frequenceTable = (uint16 *)(_musicData + 0x7FE); _registerTable = _musicData + 0xDFE; _opOutputTable = _musicData + 0xE10; _adlibRegMirror = _musicData + 0xF5F; } _instrumentMap = _musicData+instrumentDataLoc; - _instruments = (InstrumentStruct*)(_instrumentMap+0x80); + _instruments = (InstrumentStruct *)(_instrumentMap+0x80); } AdLibChannel::~AdLibChannel() { diff --git a/engines/sky/music/gmmusic.cpp b/engines/sky/music/gmmusic.cpp index 85240ea82e..84f6a654d0 100644 --- a/engines/sky/music/gmmusic.cpp +++ b/engines/sky/music/gmmusic.cpp @@ -31,7 +31,7 @@ namespace Sky { void GmMusic::passTimerFunc(void *param) { - ((GmMusic*)param)->timerCall(); + ((GmMusic *)param)->timerCall(); } GmMusic::GmMusic(MidiDriver *pMidiDrv, Audio::Mixer *pMixer, Disk *pDisk) : MusicBase(pMixer, pDisk) { diff --git a/engines/sky/music/mt32music.cpp b/engines/sky/music/mt32music.cpp index 18ebf123ff..a3fdd42713 100644 --- a/engines/sky/music/mt32music.cpp +++ b/engines/sky/music/mt32music.cpp @@ -31,7 +31,7 @@ namespace Sky { void MT32Music::passTimerFunc(void *param) { - ((MT32Music*)param)->timerCall(); + ((MT32Music *)param)->timerCall(); } MT32Music::MT32Music(MidiDriver *pMidiDrv, Audio::Mixer *pMixer, Disk *pDisk) : MusicBase(pMixer, pDisk) { diff --git a/engines/sky/text.cpp b/engines/sky/text.cpp index 3e119b3b20..38a01116fe 100644 --- a/engines/sky/text.cpp +++ b/engines/sky/text.cpp @@ -136,7 +136,7 @@ void Text::getText(uint32 textNr) { //load text #"textNr" into textBuffer textNr &= 0x1F; if (blockNr) { - uint16 *blockPtr = (uint16*)(textDataPtr + 4); + uint16 *blockPtr = (uint16 *)(textDataPtr + 4); uint32 nr32MsgBlocks = blockNr >> 5; do { @@ -298,7 +298,7 @@ DisplayedText Text::displayText(char *textPtr, uint8 *dest, bool center, uint16 uint32 numBytes = (dtLineSize * numLines) + sizeof(DataFileHeader) + 4; if (!dest) - dest = (uint8*)malloc(numBytes); + dest = (uint8 *)malloc(numBytes); // clear text sprite buffer memset(dest + sizeof(DataFileHeader), 0, numBytes - sizeof(DataFileHeader)); diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp index 1bb08fd36f..40a4021a5c 100644 --- a/engines/sword2/music.cpp +++ b/engines/sword2/music.cpp @@ -115,7 +115,7 @@ static Audio::AudioStream *getAudioStream(SoundFileHandle *fh, const char *base, fh->idxLen = fh->file.readUint32LE(); fh->file.seek(entrySize * 4); - fh->idxTab = (uint32*)malloc(fh->idxLen * 3 * sizeof(uint32)); + fh->idxTab = (uint32 *)malloc(fh->idxLen * 3 * sizeof(uint32)); for (uint32 cnt = 0; cnt < fh->idxLen; cnt++) { fh->idxTab[cnt * 3 + 0] = fh->file.readUint32LE(); fh->idxTab[cnt * 3 + 1] = fh->file.readUint32LE(); diff --git a/engines/sword25/util/lua/luaconf.h b/engines/sword25/util/lua/luaconf.h index f5affe9fd7..38ff9e1320 100644 --- a/engines/sword25/util/lua/luaconf.h +++ b/engines/sword25/util/lua/luaconf.h @@ -643,7 +643,7 @@ union luai_Cast { double l_d; long l_l; }; ** CHANGE it if you have a way to implement it in your system. */ #define lua_popen(L,c,m) ((void)((void)c, m), \ - luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) + luaL_error(L, LUA_QL("popen") " not supported"), (FILE *)0) #define lua_pclose(L,file) ((void)((void)L, file), 0) /* diff --git a/engines/sword25/util/pluto/pluto.cpp b/engines/sword25/util/pluto/pluto.cpp index 957f5af795..d645e5ed2a 100644 --- a/engines/sword25/util/pluto/pluto.cpp +++ b/engines/sword25/util/pluto/pluto.cpp @@ -159,7 +159,7 @@ static int persistspecialobject(PersistInfo *pi, int defaction) lua_pushvalue(pi->L, -3); /* perms reftbl ... obj mt __persist obj */ #ifdef PLUTO_PASS_USERDATA_TO_PERSIST - lua_pushlightuserdata(pi->L, (void*)pi->writer); + lua_pushlightuserdata(pi->L, (void *)pi->writer); lua_pushlightuserdata(pi->L, pi->ud); /* perms reftbl ... obj mt __persist obj ud */ lua_call(pi->L, 3, 1); @@ -663,7 +663,7 @@ static void persist(PersistInfo *pi) } lua_pushvalue(pi->L, -1); /* perms reftbl ... obj obj */ - lua_pushlightuserdata(pi->L, (void*)(++(pi->counter))); + lua_pushlightuserdata(pi->L, (void *)(++(pi->counter))); /* perms reftbl ... obj obj ref */ lua_rawset(pi->L, 2); /* perms reftbl ... obj */ @@ -854,7 +854,7 @@ static void registerobject(int ref, UnpersistInfo *upi) { /* perms reftbl ... obj */ lua_checkstack(upi->L, 2); - lua_pushlightuserdata(upi->L, (void*)ref); + lua_pushlightuserdata(upi->L, (void *)ref); /* perms reftbl ... obj ref */ lua_pushvalue(upi->L, -2); /* perms reftbl ... obj ref obj */ @@ -989,7 +989,7 @@ static void unpersisttable(int ref, UnpersistInfo *upi) static UpVal *makeupval(lua_State *L, int stackpos) { UpVal *uv = pdep_new(L, UpVal); - pdep_link(L, (GCObject*)uv, LUA_TUPVAL); + pdep_link(L, (GCObject *)uv, LUA_TUPVAL); uv->tt = LUA_TUPVAL; uv->v = &uv->u.value; uv->u.l.prev = NULL; @@ -1025,8 +1025,8 @@ static Proto *makefakeproto(lua_State *L, lu_byte nups) static void boxupval_start(lua_State *L) { LClosure *lcl; - lcl = (LClosure*)pdep_newLclosure(L, 1, hvalue(&L->l_gt)); - pushclosure(L, (Closure*)lcl); + lcl = (LClosure *)pdep_newLclosure(L, 1, hvalue(&L->l_gt)); + pushclosure(L, (Closure *)lcl); /* ... func */ lcl->p = makefakeproto(L, 1); @@ -1053,7 +1053,7 @@ static void unboxupval(lua_State *L) LClosure *lcl; UpVal *uv; - lcl = (LClosure*)clvalue(getobject(L, -1)); + lcl = (LClosure *)clvalue(getobject(L, -1)); uv = lcl->upvals[0]; lua_pop(L, 1); /* ... */ @@ -1071,8 +1071,8 @@ static void unpersistfunction(int ref, UnpersistInfo *upi) verify(LIF(Z,read)(&upi->zio, &nupvalues, sizeof(lu_byte)) == 0); - lcl = (LClosure*)pdep_newLclosure(upi->L, nupvalues, hvalue(&upi->L->l_gt)); - pushclosure(upi->L, (Closure*)lcl); + lcl = (LClosure *)pdep_newLclosure(upi->L, nupvalues, hvalue(&upi->L->l_gt)); + pushclosure(upi->L, (Closure *)lcl); /* perms reftbl ... func */ /* Put *some* proto in the closure, before the GC can find it */ @@ -1393,9 +1393,9 @@ static void unpersistthread(int ref, UnpersistInfo *upi) verify(LIF(Z,read)(&upi->zio, &stackpos, sizeof(size_t)) == 0); uv->v = L2->stack + stackpos; - gcunlink(upi->L, (GCObject*)uv); + gcunlink(upi->L, (GCObject *)uv); uv->marked = luaC_white(g); - *nextslot = (GCObject*)uv; + *nextslot = (GCObject *)uv; nextslot = &uv->next; uv->u.l.prev = &G(L2)->uvhead; uv->u.l.next = G(L2)->uvhead.u.l.next; @@ -1482,7 +1482,7 @@ static int inreftable(lua_State *L, int ref) int res; lua_checkstack(L, 1); /* perms reftbl ... */ - lua_pushlightuserdata(L, (void*)ref); + lua_pushlightuserdata(L, (void *)ref); /* perms reftbl ... ref */ lua_gettable(L, 2); /* perms reftbl ... obj? */ @@ -1571,7 +1571,7 @@ static void unpersist(UnpersistInfo *upi) lua_pushnil(upi->L); /* perms reftbl ... nil */ } else { - lua_pushlightuserdata(upi->L, (void*)ref); + lua_pushlightuserdata(upi->L, (void *)ref); /* perms reftbl ... ref */ lua_gettable(upi->L, 2); /* perms reftbl ... obj? */ diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 1fce032633..0f662e22bd 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -169,7 +169,7 @@ struct SizeMD5 { }; typedef Common::HashMap<Common::String, SizeMD5, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> SizeMD5Map; typedef Common::HashMap<Common::String, Common::FSNode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FileMap; -typedef Common::Array<const ADGameDescription*> ADGameDescList; +typedef Common::Array<const ADGameDescription *> ADGameDescList; /** * Fallback detection scans the list of Discworld 2 targets to see if it can detect an installation diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index 545310185c..4f3cc36994 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -67,7 +67,7 @@ uint8* psxPJCRLEUnwinder(uint16 imageWidth, uint16 imageHeight, uint8 *srcIdx) { // Calculate needed index numbers, align width and height not next multiple of four imageWidth = (imageWidth % 4) ? ((imageWidth / 4) + 1) * 4 : imageWidth; imageHeight = (imageHeight % 4) ? ((imageHeight / 4) + 1) * 4 : imageHeight; - destinationBuffer = (uint8*)malloc((imageWidth * imageHeight) / 8); + destinationBuffer = (uint8 *)malloc((imageWidth * imageHeight) / 8); dstIdx = destinationBuffer; remainingBlocks = (imageWidth * imageHeight) / 16; diff --git a/engines/tinsel/heapmem.cpp b/engines/tinsel/heapmem.cpp index 026dc9457e..819493bda1 100644 --- a/engines/tinsel/heapmem.cpp +++ b/engines/tinsel/heapmem.cpp @@ -234,8 +234,8 @@ static MEM_NODE *MemoryAlloc(long size) { MEM_NODE *pHeap = &heapSentinel; #ifdef SCUMM_NEED_ALIGNMENT - const int alignPadding = sizeof(void*) - 1; - size = (size + alignPadding) & ~alignPadding; //round up to nearest multiple of sizeof(void*), this ensures the addresses that are returned are alignment-safe. + const int alignPadding = sizeof(void *) - 1; + size = (size + alignPadding) & ~alignPadding; //round up to nearest multiple of sizeof(void *), this ensures the addresses that are returned are alignment-safe. #endif // compact the heap to make up room for 'size' bytes, if necessary @@ -310,8 +310,8 @@ MEM_NODE *MemoryNoAlloc() { MEM_NODE *MemoryAllocFixed(long size) { #ifdef SCUMM_NEED_ALIGNMENT - const int alignPadding = sizeof(void*) - 1; - size = (size + alignPadding) & ~alignPadding; //round up to nearest multiple of sizeof(void*), this ensures the addresses that are returned are alignment-safe. + const int alignPadding = sizeof(void *) - 1; + size = (size + alignPadding) & ~alignPadding; //round up to nearest multiple of sizeof(void *), this ensures the addresses that are returned are alignment-safe. #endif // Search for a free entry in s_fixedMnodesList diff --git a/engines/toltecs/menu.cpp b/engines/toltecs/menu.cpp index 7e7349802d..172ec0a565 100644 --- a/engines/toltecs/menu.cpp +++ b/engines/toltecs/menu.cpp @@ -406,7 +406,7 @@ void MenuSystem::clickItem(ItemID id) { } void MenuSystem::restoreRect(int x, int y, int w, int h) { - byte *src = (byte*)_background->getBasePtr(x, y); + byte *src = (byte *)_background->getBasePtr(x, y); byte *dst = _vm->_screen->_frontScreen + x + y * 640; while (h--) { memcpy(dst, src, w); @@ -416,7 +416,7 @@ void MenuSystem::restoreRect(int x, int y, int w, int h) { } void MenuSystem::shadeRect(int x, int y, int w, int h, byte color1, byte color2) { - byte *src = (byte*)_background->getBasePtr(x, y); + byte *src = (byte *)_background->getBasePtr(x, y); for (int xc = 0; xc < w; xc++) { src[xc] = color2; src[xc + h * 640] = color1; diff --git a/engines/toltecs/movie.cpp b/engines/toltecs/movie.cpp index 28021950a7..76d42ebf0a 100644 --- a/engines/toltecs/movie.cpp +++ b/engines/toltecs/movie.cpp @@ -215,7 +215,7 @@ void MoviePlayer::fetchAudioChunks() { byte chunkType = _vm->_arc->readByte(); uint32 chunkSize = _vm->_arc->readUint32LE(); if (chunkType == 4) { - byte *chunkBuffer = (byte*)malloc(chunkSize); + byte *chunkBuffer = (byte *)malloc(chunkSize); _vm->_arc->read(chunkBuffer, chunkSize); _audioStream->queueBuffer(chunkBuffer, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); chunkBuffer = NULL; diff --git a/engines/toltecs/resource.h b/engines/toltecs/resource.h index 7f4694f0f6..3fed2e11ca 100644 --- a/engines/toltecs/resource.h +++ b/engines/toltecs/resource.h @@ -71,7 +71,7 @@ public: void purgeCache(); protected: - typedef Common::HashMap<uint, Resource*> ResourceMap; + typedef Common::HashMap<uint, Resource *> ResourceMap; ToltecsEngine *_vm; diff --git a/engines/toltecs/screen.cpp b/engines/toltecs/screen.cpp index d66ed18d8c..b781490b69 100644 --- a/engines/toltecs/screen.cpp +++ b/engines/toltecs/screen.cpp @@ -658,7 +658,7 @@ void Screen::drawSurface(int16 x, int16 y, Graphics::Surface *surface) { int16 skipX = 0; int16 width = surface->w; int16 height = surface->h; - byte *surfacePixels = (byte*)surface->getBasePtr(0, 0); + byte *surfacePixels = (byte *)surface->getBasePtr(0, 0); byte *frontScreen; // Not on screen, skip diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp index 107f4ea11e..9683831980 100644 --- a/engines/toltecs/script.cpp +++ b/engines/toltecs/script.cpp @@ -786,7 +786,7 @@ void ScriptInterpreter::sfGetRandomNumber() { } void ScriptInterpreter::sfDrawGuiTextMulti() { - _vm->_screen->drawGuiTextMulti((byte*)localPtr(arg16(3))); + _vm->_screen->drawGuiTextMulti((byte *)localPtr(arg16(3))); } void ScriptInterpreter::sfUpdateVerbLine() { @@ -907,11 +907,11 @@ void ScriptInterpreter::sfDrawGuiImage() { } void ScriptInterpreter::sfAddAnimatedSpriteNoLoop() { - _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte*)localPtr(0), (int16*)localPtr(arg16(9)), false, 2); + _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte *)localPtr(0), (int16 *)localPtr(arg16(9)), false, 2); } void ScriptInterpreter::sfAddAnimatedSprite() { - _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte*)localPtr(0), (int16*)localPtr(arg16(9)), true, 2); + _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte *)localPtr(0), (int16 *)localPtr(arg16(9)), true, 2); } void ScriptInterpreter::sfAddStaticSprite() { @@ -919,11 +919,11 @@ void ScriptInterpreter::sfAddStaticSprite() { } void ScriptInterpreter::sfAddAnimatedSpriteScaled() { - _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte*)localPtr(0), (int16*)localPtr(arg16(9)), true, 1); + _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte *)localPtr(0), (int16 *)localPtr(arg16(9)), true, 1); } void ScriptInterpreter::sfFindPath() { - _vm->_segmap->findPath((int16*)(getSlotData(arg16(13)) + arg16(11)), arg16(9), arg16(7), arg16(5), arg16(3)); + _vm->_segmap->findPath((int16 *)(getSlotData(arg16(13)) + arg16(11)), arg16(9), arg16(7), arg16(5), arg16(3)); } void ScriptInterpreter::sfWalk() { diff --git a/engines/toltecs/script.h b/engines/toltecs/script.h index 1a5a9c90ad..0c1898c525 100644 --- a/engines/toltecs/script.h +++ b/engines/toltecs/script.h @@ -77,7 +77,7 @@ protected: }; ToltecsEngine *_vm; - Common::Array<const ScriptFunction*> _scriptFuncs; + Common::Array<const ScriptFunction *> _scriptFuncs; Common::Array<const char *> _scriptFuncNames; byte *_stack; diff --git a/engines/toltecs/segmap.cpp b/engines/toltecs/segmap.cpp index 10e5f56096..f7d806c67b 100644 --- a/engines/toltecs/segmap.cpp +++ b/engines/toltecs/segmap.cpp @@ -269,7 +269,7 @@ struct LineData { }; void plotProc(int x, int y, int color, void *data) { - LineData *ld = (LineData*)data; + LineData *ld = (LineData *)data; ld->surf[x + y * ld->pitch] = color; } @@ -373,7 +373,7 @@ void SegmentMap::loadSegmapMaskRectSurface(byte *maskData, SegmapMaskRect &maskR maskRect.surface->create(maskRect.width, maskRect.height, Graphics::PixelFormat::createFormatCLUT8()); byte *backScreen = _vm->_screen->_backScreen + maskRect.x + (maskRect.y * _vm->_sceneWidth); - byte *dest = (byte*)maskRect.surface->getBasePtr(0, 0); + byte *dest = (byte *)maskRect.surface->getBasePtr(0, 0); for (int16 h = 0; h < maskRect.height; h++) { int16 w = maskRect.width; diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp index b9adfa7eeb..77822ab078 100644 --- a/engines/toon/audio.cpp +++ b/engines/toon/audio.cpp @@ -514,7 +514,7 @@ Common::SeekableReadStream *AudioStreamPackage::getStream(int32 id, bool ownMemo int32 size = 0; getInfo(id, &offset, &size); if (ownMemory) { - byte *memory = (byte*)malloc(size); + byte *memory = (byte *)malloc(size); _file->seek(offset); _file->read(memory, size); return new Common::MemoryReadStream(memory, size, DisposeAfterUse::YES); diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp index 715bd33433..0e5189957b 100644 --- a/engines/toon/character.cpp +++ b/engines/toon/character.cpp @@ -997,7 +997,7 @@ bool Character::loadShadowAnimation(const Common::String &animName) { void Character::plotPath(Graphics::Surface& surface) { for (int i = 0; i < _currentPathNodeCount; i++) { - *(byte*)surface.getBasePtr(_currentPathX[i], _currentPathY[i]) = ( i < _currentPathNode); + *(byte *)surface.getBasePtr(_currentPathX[i], _currentPathY[i]) = ( i < _currentPathNode); } } diff --git a/engines/toon/script_func.h b/engines/toon/script_func.h index ef1cb59f47..e22c4b34fa 100644 --- a/engines/toon/script_func.h +++ b/engines/toon/script_func.h @@ -39,7 +39,7 @@ public: Common::Array<const OpcodeV2 *> _opcodes; ToonEngine *_vm; -#define SYSFUNC(x) int32 x(EMCState*) +#define SYSFUNC(x) int32 x(EMCState *) SYSFUNC(sys_Cmd_Dummy); SYSFUNC(sys_Cmd_Change_Actor_X_And_Y); SYSFUNC(sys_Cmd_Init_Talking_Character); diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index d88d012759..c2ce426052 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -4107,7 +4107,8 @@ void SceneHandler::process(Event &event) { // Check for displaying right-click dialog if ((event.eventType == EVENT_BUTTON_DOWN) && (event.btnState == BTNSHIFT_RIGHT) && - g_globals->_player._uiEnabled) { + g_globals->_player._uiEnabled && + ((g_vm->getGameID() != GType_Ringworld2) || (R2_GLOBALS._sceneManager._sceneNumber != 1330))) { g_globals->_game->rightClick(); event.handled = true; diff --git a/engines/tsage/core.h b/engines/tsage/core.h index ef6d4735c0..45bb3506d5 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -373,6 +373,7 @@ public: bool loadPalette(int paletteNum); void loadPalette(const byte *pSrc, int start, int count); + void replace(const ScenePalette *src) { loadPalette(src->_palette, 0, 256); } void refresh(); void setPalette(int index, int count); void getEntry(int index, uint *r, uint *g, uint *b); diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 12add10c58..0c458f5c35 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -74,7 +74,6 @@ enum { class TSageMetaEngine : public AdvancedMetaEngine { public: TSageMetaEngine() : AdvancedMetaEngine(TsAGE::gameDescriptions, sizeof(TsAGE::tSageGameDescription), tSageGameTitles) { - _md5Bytes = 5000; _singleid = "tsage"; _guioptions = GUIO1(GUIO_NOSPEECH); } diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index 583cd8e15b..d538cbacbf 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -140,6 +140,8 @@ static const tSageGameDescription gameDescriptions[] = { GType_BlueForce, GF_CD | GF_ALT_REGIONS }, +#if 0 + // Blue Force Spanish doesn't yet work // Blue Force Spanish CD { { @@ -154,7 +156,7 @@ static const tSageGameDescription gameDescriptions[] = { GType_BlueForce, GF_CD | GF_ALT_REGIONS }, - +#endif // Return to Ringworld { { diff --git a/engines/tsage/events.h b/engines/tsage/events.h index 2917256382..cf2d1a34ed 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -87,16 +87,20 @@ enum CursorType { // Ringworld 2 objects R2_OPTO_DISK = 1, R2_READER = 2, R2_NEGATOR_GUN = 3, R2_STEPPING_DISKS = 4, - R2_ATTRACTOR_UNIT = 5, R2_SENSOR_PROBE = 6, - R2_SONIC_STUNNER = 7, R2_8 = 8, R2_9 = 9, R2_10 = 10, R2_11 = 11, R2_AEROSOL = 12, R2_13 = 13, - R2_OPTICAL_FIBRE = 14, R2_CLAMP = 15, R2_16 = 16, R2_17 = 17, R2_18 = 18, R2_19 = 19, - R2_REBREATHER_TANK = 20, R2_21 = 21, R2_22 = 22, R2_23 = 23, R2_24 = 24, R2_25 = 25, - R2_26 = 26, R2_27 = 27, R2_28 = 28, - R2_29 = 29, R2_30 = 30, R2_31 = 31, R2_32 = 32, R2_33 = 33, R2_34 = 34, R2_35 = 35, - R2_36 = 36, R2_37 = 37, R2_38 = 38, R2_39 = 39, R2_40 = 40, R2_41 = 41, R2_42 = 42, - R2_43 = 43, R2_44 = 44, R2_45 = 45, R2_46 = 46, R2_47 = 47, R2_48 = 48, R2_49 = 49, - R2_50 = 50, R2_51 = 51, R2_52 = 52, - R2_LAST_INVENT = 53, + R2_ATTRACTOR_UNIT = 5, R2_SENSOR_PROBE = 6, R2_SONIC_STUNNER = 7, + R2_CABLE_HARNESS = 8, R2_COM_SCANNER = 9, R2_SPENT_POWER_CAPSULE = 10, + R2_CHARGED_POWER_CAPSULE = 11, R2_AEROSOL = 12, R2_REMOTE_CONTROL = 13, + R2_OPTICAL_FIBRE = 14, R2_CLAMP = 15, R2_ATTRACTOR_CABLE_HARNESS = 16, + R2_FUEL_CELL = 17, R2_GYROSCOPE = 18, R2_AIRBAG = 19, R2_REBREATHER_TANK = 20, + R2_RESERVE_REBREATHER_TANK = 21, R2_GUIDANCE_MODULE = 22, R2_THRUSTER_VALVE = 23, + R2_BALLOON_BACKPACK = 24, R2_RADAR_MECHANISM = 25, R2_JOYSTICK = 26, + R2_IGNITOR = 27, R2_DIAGNOSTICS_DISPLAY = 28, R2_GLASS_DOME = 29, R2_WICK_LAMP = 30, + R2_SCRITH_KEY = 31, R2_TANNER_MASK = 32, R2_PURE_GRAIN_ALCOHOL = 33, R2_SAPPHIRE_BLUE = 34, + R2_ANCIENT_SCROLLS = 35, R2_FLUTE = 36, R2_GUNPOWDER = 37, R2_NONAME = 38, + R2_COM_SCANNER_2 = 39, R2_SUPERCONDUCTOR_WIRE = 40, R2_PILLOW = 41, R2_FOOD_TRAY = 42, + R2_LASER_HACKSAW = 43, R2_PHOTON_STUNNER = 44, R2_BATTERY = 45, R2_SOAKED_FACEMASK = 46, + R2_LIGHT_BULB = 47, R2_ALCOHOL_LAMP = 48, R2_ALCOHOL_LAMP_2 = 49, R2_ALCOHOL_LAMP_3 = 50, + R2_BROKEN_DISPLAY = 51, R2_TOOLBOX = 52, R2_LAST_INVENT = 53, // Ringworld 2 cursors R2CURSORS_START = 0x8000, EXITCURSOR_N = 0x8007, EXITCURSOR_S = 0x8008, EXITCURSOR_W = 0x8009, @@ -145,7 +149,7 @@ public: Common::EventType type() { return _event.type; } uint32 getFrameNumber() const { return _frameNumber; } void delay(int numFrames); - bool isInventoryIcon() const { return _currentCursor < 256; } + bool isInventoryIcon() const { return (_currentCursor >= 0) && (_currentCursor < 256); } void proc1() { warning("TODO: EventsClass::proc1"); } virtual void listenerSynchronize(Serializer &s); diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index 824f20e9b2..f6f870be20 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -135,7 +135,7 @@ uint16 BitReader::readToken() { /*-------------------------------------------------------------------------*/ TLib::TLib(MemoryManager &memManager, const Common::String &filename) : - _memoryManager(memManager) { + _filename(filename), _memoryManager(memManager) { // If the resource strings list isn't yet loaded, load them if (_resStrings.size() == 0) { @@ -158,25 +158,35 @@ TLib::~TLib() { _resStrings.clear(); } +/** + * Load a section index from the given position in the file + */ void TLib::loadSection(uint32 fileOffset) { _resources.clear(); _file.seek(fileOffset); _sections.fileOffset = fileOffset; - if (_file.readUint32BE() != 0x544D492D) + loadSection(_file, _resources); +} + +/** + * Inner logic for decoding a section index into a passed resource list object + */ +void TLib::loadSection(Common::File &f, ResourceList &resources) { + if (f.readUint32BE() != 0x544D492D) error("Data block is not valid Rlb data"); - /*uint8 unknown1 = */_file.readByte(); - uint16 numEntries = _file.readByte(); + /*uint8 unknown1 = */f.readByte(); + uint16 numEntries = f.readByte(); for (uint i = 0; i < numEntries; ++i) { - uint16 id = _file.readUint16LE(); - uint16 size = _file.readUint16LE(); - uint16 uncSize = _file.readUint16LE(); - uint8 sizeHi = _file.readByte(); - uint8 type = _file.readByte() >> 5; + uint16 id = f.readUint16LE(); + uint16 size = f.readUint16LE(); + uint16 uncSize = f.readUint16LE(); + uint8 sizeHi = f.readByte(); + uint8 type = f.readByte() >> 5; assert(type <= 1); - uint32 offset = _file.readUint32LE(); + uint32 offset = f.readUint32LE(); ResourceEntry re; re.id = id; @@ -185,7 +195,7 @@ void TLib::loadSection(uint32 fileOffset) { re.size = ((sizeHi & 0xF) << 16) | size; re.uncompressedSize = ((sizeHi & 0xF0) << 12) | uncSize; - _resources.push_back(re); + resources.push_back(re); } } @@ -443,6 +453,36 @@ bool TLib::getMessage(int resNum, int lineNum, Common::String &result, bool supp /*--------------------------------------------------------------------------*/ +/** + * Open up the main resource file and get an entry from the root section + */ +bool TLib::getSectionEntry(Common::File &f, ResourceType resType, int rlbNum, int resNum, + ResourceEntry &resEntry) { + // Try and open the resource file + if (!f.open(_filename)) + return false; + + // Load the root section index + ResourceList resList; + loadSection(f, resList); + + // Loop through the index for the desired entry + ResourceList::iterator iter; + for (iter = _resources.begin(); iter != _resources.end(); ++iter) { + ResourceEntry &re = *iter; + if (re.id == resNum) { + // Found it, so exit + resEntry = re; + return true; + } + } + + // No matching entry found + return false; +} + +/*--------------------------------------------------------------------------*/ + ResourceManager::~ResourceManager() { for (uint idx = 0; idx < _libList.size(); ++idx) delete _libList[idx]; diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h index 0410fa3f42..2b5561b184 100644 --- a/engines/tsage/resources.h +++ b/engines/tsage/resources.h @@ -145,10 +145,12 @@ private: MemoryManager &_memoryManager; private: Common::File _file; + Common::String _filename; ResourceList _resources; SectionList _sections; void loadSection(uint32 fileOffset); + void loadSection(Common::File &f, ResourceList &resources); void loadIndex(); public: TLib(MemoryManager &memManager, const Common::String &filename); @@ -159,6 +161,8 @@ public: bool getPalette(int paletteNum, byte *palData, uint *startNum, uint *numEntries); byte *getSubResource(int resNum, int rlbNum, int index, uint *size, bool suppressErrors = false); bool getMessage(int resNum, int lineNum, Common::String &result, bool suppressErrors = false); + + bool getSectionEntry(Common::File &f, ResourceType resType, int rlbNum, int resNum, ResourceEntry &resEntry); }; class ResourceManager { @@ -174,6 +178,7 @@ public: void getPalette(int paletteNum, byte *palData, uint *startNum, uint *numEntries, bool suppressErrors = false); byte *getSubResource(int resNum, int rlbNum, int index, uint *size, bool suppressErrors = false); Common::String getMessage(int resNum, int lineNum, bool suppressErrors = false); + TLib &first() { return **_libList.begin(); } }; diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 4f7578b1fa..89cf831088 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -143,7 +143,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { case 1800: return new Scene1800(); case 1850: - error("Missing scene %d from group 1", sceneNumber); + return new Scene1850(); case 1875: return new Scene1875(); case 1900: @@ -419,13 +419,13 @@ bool SceneExt::display(CursorType action, Event &event) { R2_GLOBALS._sound4.play(45); break; - case R2_9: - case R2_39: + case R2_COM_SCANNER: + case R2_COM_SCANNER_2: R2_GLOBALS._sound3.play(44); SceneItem::display2(2, action); R2_GLOBALS._sound3.stop(); break; - case R2_44: + case R2_PHOTON_STUNNER: R2_GLOBALS._sound3.play(99); SceneItem::display2(2, action); break; @@ -859,51 +859,51 @@ void Ringworld2InvObjectList::reset() { setObjectScene(R2_ATTRACTOR_UNIT, 400); setObjectScene(R2_SENSOR_PROBE, 400); setObjectScene(R2_SONIC_STUNNER, 500); - setObjectScene(R2_8, 700); - setObjectScene(R2_9, 800); - setObjectScene(R2_10, 100); - setObjectScene(R2_11, 400); + setObjectScene(R2_CABLE_HARNESS, 700); + setObjectScene(R2_COM_SCANNER, 800); + setObjectScene(R2_SPENT_POWER_CAPSULE, 100); + setObjectScene(R2_CHARGED_POWER_CAPSULE, 400); setObjectScene(R2_AEROSOL, 500); - setObjectScene(R2_13, 1550); + setObjectScene(R2_REMOTE_CONTROL, 1550); setObjectScene(R2_OPTICAL_FIBRE, 850); setObjectScene(R2_CLAMP, 850); - setObjectScene(R2_16, 0); - setObjectScene(R2_17, 1550); - setObjectScene(R2_18, 1550); - setObjectScene(R2_19, 1550); + setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 0); + setObjectScene(R2_FUEL_CELL, 1550); + setObjectScene(R2_GYROSCOPE, 1550); + setObjectScene(R2_AIRBAG, 1550); setObjectScene(R2_REBREATHER_TANK, 500); - setObjectScene(R2_21, 500); - setObjectScene(R2_22, 1550); - setObjectScene(R2_23, 1580); - setObjectScene(R2_24, 9999); - setObjectScene(R2_25, 1550); - setObjectScene(R2_26, 1550); - setObjectScene(R2_27, 1580); - setObjectScene(R2_28, 1550); - setObjectScene(R2_29, 2525); - setObjectScene(R2_30, 2440); - setObjectScene(R2_31, 2455); - setObjectScene(R2_32, 2535); - setObjectScene(R2_33, 2530); - setObjectScene(R2_34, 1950); - setObjectScene(R2_35, 1950); - setObjectScene(R2_36, 9999); - setObjectScene(R2_37, 2430); - setObjectScene(R2_38, 9999); - setObjectScene(R2_39, 2); - setObjectScene(R2_40, 9999); - setObjectScene(R2_41, 3150); - setObjectScene(R2_42, 0); - setObjectScene(R2_43, 3260); - setObjectScene(R2_44, 2); - setObjectScene(R2_45, 1550); - setObjectScene(R2_46, 0); - setObjectScene(R2_47, 3150); - setObjectScene(R2_48, 2435); - setObjectScene(R2_49, 2440); - setObjectScene(R2_50, 2435); - setObjectScene(R2_51, 1580); - setObjectScene(R2_52, 3260); + setObjectScene(R2_RESERVE_REBREATHER_TANK, 500); + setObjectScene(R2_GUIDANCE_MODULE, 1550); + setObjectScene(R2_THRUSTER_VALVE, 1580); + setObjectScene(R2_BALLOON_BACKPACK, 9999); + setObjectScene(R2_RADAR_MECHANISM, 1550); + setObjectScene(R2_JOYSTICK, 1550); + setObjectScene(R2_IGNITOR, 1580); + setObjectScene(R2_DIAGNOSTICS_DISPLAY, 1550); + setObjectScene(R2_GLASS_DOME, 2525); + setObjectScene(R2_WICK_LAMP, 2440); + setObjectScene(R2_SCRITH_KEY, 2455); + setObjectScene(R2_TANNER_MASK, 2535); + setObjectScene(R2_PURE_GRAIN_ALCOHOL, 2530); + setObjectScene(R2_SAPPHIRE_BLUE, 1950); + setObjectScene(R2_ANCIENT_SCROLLS, 1950); + setObjectScene(R2_FLUTE, 9999); + setObjectScene(R2_GUNPOWDER, 2430); + setObjectScene(R2_NONAME, 9999); + setObjectScene(R2_COM_SCANNER_2, 2); + setObjectScene(R2_SUPERCONDUCTOR_WIRE, 9999); + setObjectScene(R2_PILLOW, 3150); + setObjectScene(R2_FOOD_TRAY, 0); + setObjectScene(R2_LASER_HACKSAW, 3260); + setObjectScene(R2_PHOTON_STUNNER, 2); + setObjectScene(R2_BATTERY, 1550); + setObjectScene(R2_SOAKED_FACEMASK, 0); + setObjectScene(R2_LIGHT_BULB, 3150); + setObjectScene(R2_ALCOHOL_LAMP, 2435); + setObjectScene(R2_ALCOHOL_LAMP_2, 2440); + setObjectScene(R2_ALCOHOL_LAMP_3, 2435); + setObjectScene(R2_BROKEN_DISPLAY, 1580); + setObjectScene(R2_TOOLBOX, 3260); } void Ringworld2InvObjectList::setObjectScene(int objectNum, int sceneNumber) { @@ -1551,36 +1551,130 @@ void Scene1200::sub9DAD6(int indx) { /*--------------------------------------------------------------------------*/ -ActionObject::ActionObject(): EventHandler() { +AnimationPlayer::AnimationPlayer(): EventHandler() { + _endAction = NULL; + + _fieldA = NULL; + _field16 = NULL; + + _screenBounds = R2_GLOBALS._gfxManagerInstance._bounds; + _rect1 = R2_GLOBALS._gfxManagerInstance._bounds; + _field3C = 0; + _field3A = 1; + _field5A = 0; + _field58 = 0; _endAction = NULL; } -void ActionObject::synchronize(Serializer &s) { - EventHandler::synchronize(s); +AnimationPlayer::~AnimationPlayer() { + if (!method3()) + method4(); +} - SYNC_POINTER(_endAction); +void AnimationPlayer::synchronize(Serializer &s) { + EventHandler::synchronize(s); + warning("TODO AnimationPlayer::load"); } -void ActionObject::remove() { +void AnimationPlayer::remove() { if (_endAction) _endAction->signal(); _endAction = NULL; } -bool ActionObject::load(int rlbNum, Action *endAction) { - warning("TODO ActionOjbect::load"); - return true; +void AnimationPlayer::process(Event &event) { + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE) && + (_field3A)) { + _field90C = _field576; + } } -/*--------------------------------------------------------------------------*/ +void AnimationPlayer::dispatch() { + uint32 gameFrame = R2_GLOBALS._events.getFrameNumber(); + uint32 gameDiff = (gameFrame > _gameFrame) ? gameFrame - _gameFrame : _gameFrame - gameFrame; + + if (gameDiff >= _field910) { + drawFrame(_field904 % _field57C); + ++_field904; + _field90C = _field904 / _field57C; + + if (_field90C == _field90E) + method2(); + + _field908 = _field904; + _gameFrame = gameFrame; + } +} + +bool AnimationPlayer::load(int rlbNum, Action *endAction) { + ResourceEntry resEntry; + if (!g_resourceManager->first().getSectionEntry(_resourceFile, RES_IMAGE, rlbNum, 0, resEntry)) { + warning("Couldn't find resource index"); + // TODO: Complete animation loading + } + + _resourceFile.close(); + return false; +} + +void AnimationPlayer::drawFrame(int frameIndex) { + uint32 v = READ_LE_UINT32(_dataP); +warning("v = %d", v); +//TODO + + // End check + if (_field56 == 42) { + _screenBounds.expandPanes(); -void ActionObjectExt::synchronize(Serializer &s) { - ActionObject::synchronize(s); - s.syncAsSint16LE(_v1); + R2_GLOBALS._sceneObjects->draw(); + } else { + if (R2_GLOBALS._sceneManager._hasPalette) { + R2_GLOBALS._sceneManager._hasPalette = false; + R2_GLOBALS._scenePalette.refresh(); + } + } } +void AnimationPlayer::method2() { +} + +bool AnimationPlayer::method3() { + return (_field90C >= _field576); +} + +void AnimationPlayer::method4() { + if (_field38) { + switch (_field3C) { + case 0: + R2_GLOBALS._scenePalette.replace(&_palette); + changePane(); + R2_GLOBALS._sceneManager._hasPalette = true; + break; + case 2: + proc14(); + break; + default: + changePane(); + break; + } + } + +// TODO +} + +/*--------------------------------------------------------------------------*/ + +AnimationPlayerExt::AnimationPlayerExt(): AnimationPlayer() { + _v = 0; + _field3A = 0; +} + +void AnimationPlayerExt::synchronize(Serializer &s) { + AnimationPlayer::synchronize(s); + s.syncAsSint16LE(_v); +} } // End of namespace Ringworld2 diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index 925a3d6522..98fcaae981 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -325,29 +325,55 @@ public: virtual Common::String getClassName() { return "UnkObject1200"; } }; -class ActionObject: public EventHandler { +class AnimationPlayer: public EventHandler { public: - EventHandler *_endAction; + Common::File _resourceFile; + void *_fieldA; + void *_field16; + + byte *_dataP; Rect _rect1, _screenBounds; + int _field38; int _field3A, _field3C; int _field56; int _field58, _field5A; ScenePalette _palette; byte _palData[256 * 3]; + Action *_endAction; + int _field576; + int _field57C; + int _palStart, _palSize; + int _field904; + int _field908; + int _field90C; + int _field90E; + uint _field910; + uint32 _gameFrame; public: - ActionObject(); + AnimationPlayer(); + ~AnimationPlayer(); virtual void synchronize(Serializer &s); virtual void remove(); + virtual void process(Event &event); + virtual void dispatch(); + virtual void flipPane() {} + virtual void changePane() {} + virtual void proc14() {} bool load(int rlbNum, Action *endAction = NULL); - bool proc1() { return false; } - void proc2() {} + void drawFrame(int frameIndex); + void method2(); + bool method3(); + void method4(); + void method5() {} }; -class ActionObjectExt: public ActionObject { +class AnimationPlayerExt: public AnimationPlayer { +public: + int _v; public: - int _v1; + AnimationPlayerExt(); virtual void synchronize(Serializer &s); }; diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 2b2b5e71ef..dab9afb269 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -1499,25 +1499,25 @@ Scene180::Scene180(): SceneExt(), _webbsterSpeaker(27) { GfxFont font; font.setFontNumber(7); - _fontHeight = font.getHeight(); + _fontHeight = font.getHeight() + 1; _sceneMode = (R2_GLOBALS._sceneManager._previousScene == 205) ? 10 : 0; _gameTextSpeaker._displayMode = 9; - _stripManager.addSpeaker(&_gameTextSpeaker); - _stripManager.addSpeaker(&_webbsterSpeaker); - _stripManager.addSpeaker(&_tealSpeaker); - _stripManager.addSpeaker(&_dutyOfficerSpeaker); - - signal(); } void Scene180::postInit(SceneObjectList *OwnerList) { - SceneExt::postInit(); loadScene(9999); + SceneExt::postInit(); - R2_GLOBALS._player._uiEnabled = false; + R2_GLOBALS._uiElements._active = true; R2_GLOBALS._player.disableControl(); + _stripManager.addSpeaker(&_gameTextSpeaker); + _stripManager.addSpeaker(&_webbsterSpeaker); + _stripManager.addSpeaker(&_tealSpeaker); + _stripManager.addSpeaker(&_dutyOfficerSpeaker); + + signal(); } void Scene180::remove() { @@ -1547,7 +1547,7 @@ void Scene180::synchronize(Serializer &s) { void Scene180::signal() { R2_GLOBALS._playStream.stop(); - switch (_sceneMode) { + switch (_sceneMode++) { case 0: setFrameInc(6); break; @@ -1555,13 +1555,13 @@ void Scene180::signal() { case 1: _field412 = 1; R2_GLOBALS._sceneManager._hasPalette = true; - _actionObject._field3C = 2; - _actionObject._v1 = 1; - _actionObject._field56 = 1; + _animationPlayer._field3C = 2; + _animationPlayer._v = 1; + _animationPlayer._field56 = 1; R2_GLOBALS._scene180Mode = 1; - _actionObject.load(1, NULL); - R2_GLOBALS._scenePalette.loadPalette(_actionObject._palData, 0, 256); + _animationPlayer.load(1, NULL); + R2_GLOBALS._scenePalette.loadPalette(_animationPlayer._palData, 0, 256); R2_GLOBALS._sound1.play(1); break; @@ -1598,14 +1598,14 @@ void Scene180::signal() { break; case 5: - _actionObject._field3C = 2; - _actionObject._v1 = 1; - _actionObject._field56 = 1; + _animationPlayer._field3C = 2; + _animationPlayer._v = 1; + _animationPlayer._field56 = 1; R2_GLOBALS._scene180Mode = 2; - _actionObject.load(2); + _animationPlayer.load(2); _field412 = 1; - R2_GLOBALS._scenePalette.addFader(_actionObject._palData, 256, 6, NULL); + R2_GLOBALS._scenePalette.addFader(_animationPlayer._palData, 256, 6, NULL); R2_GLOBALS._sound1.play(2); break; @@ -1701,11 +1701,11 @@ void Scene180::signal() { case 29: _field412 = 1; - _actionObject._field3C = 0; - _actionObject._v1 = 1; - _actionObject._field56 = 42; + _animationPlayer._field3C = 0; + _animationPlayer._v = 1; + _animationPlayer._field56 = 42; R2_GLOBALS._scene180Mode = 3; - _actionObject.load(3); + _animationPlayer.load(3); break; case 31: @@ -1801,12 +1801,12 @@ void Scene180::signal() { break; case 40: - _actionObject._field3C = 2; - _actionObject._field56 = 1; + _animationPlayer._field3C = 2; + _animationPlayer._field56 = 1; R2_GLOBALS._scene180Mode = 4; - if (_actionObject.load(4)) { - _actionObject.dispatch(); - R2_GLOBALS._scenePalette.addFader(_actionObject._palData, 256, 8, this); + if (_animationPlayer.load(4)) { + _animationPlayer.dispatch(); + R2_GLOBALS._scenePalette.addFader(_animationPlayer._palData, 256, 8, this); } else { _sceneMode = 43; setFrameInc(1); @@ -1815,7 +1815,7 @@ void Scene180::signal() { case 41: _field412 = 1; - _actionObject._v1 = 1; + _animationPlayer._v = 1; break; case 42: @@ -1834,19 +1834,19 @@ void Scene180::signal() { break; case 45: - R2_GLOBALS._scenePalette.addFader(_actionObject._palData, 256, 28, this); + R2_GLOBALS._scenePalette.addFader(_animationPlayer._palData, 256, 28, this); break; case 48: _field412 = 1; - _actionObject._field3C = 2; - _actionObject._v1 = 1; - _actionObject._field56 = 1; + _animationPlayer._field3C = 2; + _animationPlayer._v = 1; + _animationPlayer._field56 = 1; R2_GLOBALS._scene180Mode = 15; - _actionObject.load(15, NULL); + _animationPlayer.load(15, NULL); R2_GLOBALS._sound1.play(9); - R2_GLOBALS._scenePalette.addFader(_actionObject._palData, 256, 6, NULL); + R2_GLOBALS._scenePalette.addFader(_animationPlayer._palData, 256, 6, NULL); break; case 49: @@ -1884,11 +1884,11 @@ void Scene180::process(Event &event) { void Scene180::dispatch() { if (_frameInc) { - uint32 frameNumber = R2_GLOBALS._events.getFrameNumber(); + uint32 gameFrame = R2_GLOBALS._events.getFrameNumber(); - if (frameNumber >= (uint32)_frameNumber) { - _frameInc = frameNumber - _frameNumber; - _frameNumber = frameNumber; + if (gameFrame >= (uint32)_frameNumber) { + _frameInc -= gameFrame - _frameNumber; + _frameNumber = gameFrame; if (_frameInc <= 0) { _frameInc = 0; @@ -1897,15 +1897,15 @@ void Scene180::dispatch() { } } - if (_actionObject._v1) { - if (_actionObject.proc1()) { - _actionObject._v1 = 0; - _actionObject.proc2(); - _actionObject.remove(); + if (_animationPlayer._v) { + if (_animationPlayer.method3()) { + _animationPlayer._v = 0; + _animationPlayer.method4(); + _animationPlayer.remove(); signal(); } else { - _actionObject.dispatch(); + _animationPlayer.dispatch(); } } @@ -4884,7 +4884,7 @@ bool Scene500::Object3::startAction(CursorType action, Event &event) { } return true; - case R2_21: + case R2_RESERVE_REBREATHER_TANK: SceneItem::display2(500, 53); return true; @@ -5442,7 +5442,7 @@ bool Scene600::Actor5::startAction(CursorType action, Event &event) { return true; } - if ((R2_GLOBALS.getFlag(9)) && (R2_INVENTORY.getObjectScene(R2_9) == 600)) + if ((R2_GLOBALS.getFlag(9)) && (R2_INVENTORY.getObjectScene(R2_COM_SCANNER) == 600)) SceneItem::display(600, 31, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); else { R2_GLOBALS._player.disableControl(); @@ -5457,7 +5457,7 @@ bool Scene600::Actor6::startAction(CursorType action, Event &event) { if ((action < CURSOR_WALK) && (action >= R2CURSORS_START)) { switch (action) { - case R2_9: + case R2_COM_SCANNER: if (R2_GLOBALS.getFlag(6)) { if (R2_GLOBALS.getFlag(8)) { SceneItem::display(600, 29, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); @@ -5828,7 +5828,7 @@ bool Scene700::Item12::startAction(CursorType action, Event &event) { Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; switch (action) { - case R2_8: + case R2_CABLE_HARNESS: R2_GLOBALS._player.disableControl(); scene->_actor5.postInit(); scene->_actor5.setup(701, 3, 2); @@ -5837,7 +5837,7 @@ bool Scene700::Item12::startAction(CursorType action, Event &event) { scene->_actor5.hide(); scene->_sceneMode = 20; break; - case R2_16: + case R2_ATTRACTOR_CABLE_HARNESS: R2_GLOBALS._player.disableControl(); scene->_actor5.postInit(); scene->_actor5.setup(701, 2, 8); @@ -5908,7 +5908,7 @@ bool Scene700::Actor5::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_USE: - switch (R2_INVENTORY.getObjectScene(R2_8)) { + switch (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS)) { case 0: if ((_strip == 2) && (_frame == 1)) { R2_GLOBALS._player.disableControl(); @@ -5937,7 +5937,7 @@ bool Scene700::Actor5::startAction(CursorType action, Event &event) { break; case R2_ATTRACTOR_UNIT: R2_GLOBALS._player.disableControl(); - if (R2_INVENTORY.getObjectScene(R2_8) == 700) { + if (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 700) { scene->_sceneMode = 706; scene->setAction(&scene->_sequenceManager, scene, 706, &R2_GLOBALS._player, &scene->_actor5, NULL); } else { @@ -6020,12 +6020,12 @@ void Scene700::postInit(SceneObjectList *OwnerList) { _actor9.setPosition(Common::Point(324, 53)); _actor9.setDetails(700, 33, -1, 35, 1, (SceneItem *) NULL); - if ((R2_INVENTORY.getObjectScene(R2_8) != 1) && (R2_INVENTORY.getObjectScene(R2_16) != 1)) { + if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) != 1) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) != 1)) { _actor5.postInit(); _actor5.fixPriority(10); - switch (R2_INVENTORY.getObjectScene(R2_16)) { + switch (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS)) { case 0: - switch (R2_INVENTORY.getObjectScene(R2_8)) { + switch (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS)) { case 0: _actor5.setup(701, 3, 2); _actor5.setPosition(Common::Point(243, 98)); @@ -6041,7 +6041,7 @@ void Scene700::postInit(SceneObjectList *OwnerList) { } break; case 700: - switch (R2_INVENTORY.getObjectScene(R2_8)) { + switch (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS)) { case 0: if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) _actor5.setup(701, 2, 1); @@ -6191,10 +6191,10 @@ void Scene700::signal() { R2_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); R2_GLOBALS._player._strip = 7; if (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_UNIT) == 0) { - R2_INVENTORY.setObjectScene(R2_16, 1); - R2_INVENTORY.setObjectScene(R2_8, 0); + R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 1); + R2_INVENTORY.setObjectScene(R2_CABLE_HARNESS, 0); } else { - R2_INVENTORY.setObjectScene(R2_8, 1); + R2_INVENTORY.setObjectScene(R2_CABLE_HARNESS, 1); } R2_GLOBALS._player.enableControl(); break; @@ -6219,7 +6219,7 @@ void Scene700::signal() { break; case 17: R2_INVENTORY.setObjectScene(R2_ATTRACTOR_UNIT, 0); - R2_INVENTORY.setObjectScene(R2_16, 700); + R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 700); R2_GLOBALS._player.setVisage(11); R2_GLOBALS._player.changeZoom(100); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -6228,7 +6228,7 @@ void Scene700::signal() { R2_GLOBALS._player.enableControl(); break; case 20: - R2_INVENTORY.setObjectScene(R2_8, 0); + R2_INVENTORY.setObjectScene(R2_CABLE_HARNESS, 0); R2_GLOBALS._player.enableControl(); break; case 21: @@ -6236,7 +6236,7 @@ void Scene700::signal() { if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) _actor5.animate(ANIM_MODE_6, NULL); - R2_INVENTORY.setObjectScene(R2_16, 700); + R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 700); R2_GLOBALS._player.enableControl(); break; case 701: @@ -6254,7 +6254,7 @@ void Scene700::signal() { if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) _actor5.animate(ANIM_MODE_6, NULL); R2_INVENTORY.setObjectScene(R2_ATTRACTOR_UNIT, 0); - R2_INVENTORY.setObjectScene(R2_16, 700); + R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 700); R2_GLOBALS._player.enableControl(); break; case 709: @@ -6462,7 +6462,7 @@ void Scene800::postInit(SceneObjectList *OwnerList) { _cabinet.setPosition(Common::Point(169, 79)); _cabinet.setDetails(800, 41, -1, -1, 1, (SceneItem *)NULL); - if (R2_INVENTORY.getObjectScene(R2_9) == 800) { + if (R2_INVENTORY.getObjectScene(R2_COM_SCANNER) == 800) { _comScanner.postInit(); _comScanner.setup(801, 2, 1); _comScanner.setPosition(Common::Point(174, 73)); @@ -6548,7 +6548,7 @@ void Scene800::signal() { case 811: R2_GLOBALS._player.enableControl(); _comScanner.remove(); - R2_INVENTORY.setObjectScene(R2_9, 1); + R2_INVENTORY.setObjectScene(R2_COM_SCANNER, 1); break; default: R2_GLOBALS._player.enableControl(); @@ -7152,7 +7152,7 @@ bool Scene900::Actor4::startAction(CursorType action, Event &event) { scene->_aSound1.play(30); setup(900, 3, 11); R2_GLOBALS._v565E5 = 1; - if ((R2_INVENTORY.getObjectScene(R2_8) == 0) && (R2_INVENTORY.getObjectScene(R2_16 == 700)) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70) && (scene->_actor2._animateMode != ANIM_MODE_6)) { + if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS == 700)) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70) && (scene->_actor2._animateMode != ANIM_MODE_6)) { scene->_actor2.animate(ANIM_MODE_6, NULL); } else { if (((scene->_actor3._percent * 49) / 100) + scene->_actor3._position.x == scene->_actor2._position.x) { @@ -7172,9 +7172,9 @@ bool Scene900::Actor4::startAction(CursorType action, Event &event) { setup(900, 3, 9); R2_GLOBALS._v565E5 = 0; - if ((R2_INVENTORY.getObjectScene(R2_8) == 0) && (R2_INVENTORY.getObjectScene(R2_16) == 700) && (scene->_actor2._frame < 8) && (scene->_actor2._animateMode != ANIM_MODE_5)) { + if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (scene->_actor2._frame < 8) && (scene->_actor2._animateMode != ANIM_MODE_5)) { scene->_actor2.animate(ANIM_MODE_5, NULL); - } else if ((R2_INVENTORY.getObjectScene(R2_8) == 700) && (R2_INVENTORY.getObjectScene(R2_16) == 700) && (scene->_actor2._frame < 8)) { + } else if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 700) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (scene->_actor2._frame < 8)) { R2_GLOBALS._v565E7 = 0; if (scene->_actor2._animateMode != 5) { R2_GLOBALS._player.disableControl(); @@ -7288,13 +7288,13 @@ void Scene900::postInit(SceneObjectList *OwnerList) { _actor3._effect = 1; _actor3.setDetails(900, 6, -1, 8, 1, (SceneItem *) NULL); - if ((R2_INVENTORY.getObjectScene(R2_8) != 1) && (R2_INVENTORY.getObjectScene(R2_16) != 1)) { + if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) != 1) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) != 1)) { _actor2.postInit(); _actor2.setPosition(Common::Point(0, 0)); _actor2.fixPriority(1); - if (R2_INVENTORY.getObjectScene(R2_8) == 0) { - if (R2_INVENTORY.getObjectScene(R2_16) != 700) { + if (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) { + if (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) != 700) { _actor2.setup(901, 3, 2); } else if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) { _actor2.setup(901, 2, 1); @@ -7446,11 +7446,11 @@ void Scene900::dispatch() { } if (R2_GLOBALS._sceneObjects->contains(&_actor2)) { - if ((R2_GLOBALS._v565E5 != 0) && (R2_INVENTORY.getObjectScene(R2_8) == 0) && (R2_INVENTORY.getObjectScene(R2_16) == 700) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) { + if ((R2_GLOBALS._v565E5 != 0) && (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) { if ((_actor2._frame > 1) && (_actor2._animateMode != ANIM_MODE_6)) _actor2.animate(ANIM_MODE_6, NULL); } else { - if ((_actor2._frame < 8) && (_actor2._animateMode != ANIM_MODE_5) && (R2_GLOBALS._v565E7 == 0) && (R2_INVENTORY.getObjectScene(R2_8) == 0) && (R2_INVENTORY.getObjectScene(R2_16) == 700) && (_sceneMode != 4)) + if ((_actor2._frame < 8) && (_actor2._animateMode != ANIM_MODE_5) && (R2_GLOBALS._v565E7 == 0) && (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (_sceneMode != 4)) _actor2.animate(ANIM_MODE_5, NULL); } } diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h index f3c8b0bccf..d757080156 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.h +++ b/engines/tsage/ringworld2/ringworld2_scenes0.h @@ -204,7 +204,7 @@ public: SceneActor _object1, _object2, _object3, _object4, _object5; ScenePalette _palette; SceneText _textList[20]; - ActionObjectExt _actionObject; + AnimationPlayerExt _animationPlayer; SequenceManager _sequenceManager; Action1 _action1; ASoundExt _sound1; @@ -287,7 +287,7 @@ private: int xMultiply, int yMultiply, int xCenter, int yCenter); void handleText(); public: - ActionObject _actionObject; + AnimationPlayer _animationPlayer; int _fontHeight; SceneText _textList[15]; Object *_objList1[3]; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index cf8d214d6b..23a9eb2590 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -279,7 +279,7 @@ bool Scene1100::Actor17::startAction(CursorType action, Event &event) { break; case R2_SONIC_STUNNER: // No break on purpose - case R2_44: + case R2_PHOTON_STUNNER: if (_visage == 1105) { R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._characterIndex == 1) { @@ -1634,7 +1634,7 @@ void Scene1337::unkObj1337_1::synchronize(Serializer &s) { } Scene1337::Scene1337() { - _fieldA30 = 0; + _autoplay = false; _field3E24 = 0; _field3E26 = 0; @@ -3846,7 +3846,7 @@ void Scene1337::process(Event &event) { if (event.btnState != BTNSHIFT_RIGHT) { subD183F(R2_GLOBALS._v5780E, 1); event.handled = true; - } else if (_unkFctPtr412 != NULL) { + } else if (_unkFctPtr412) { FunctionPtrType tmpFctPtr = _unkFctPtr412; _unkFctPtr412 = NULL; (this->*tmpFctPtr)(); @@ -3854,7 +3854,7 @@ void Scene1337::process(Event &event) { } } else if (event.eventType == EVENT_KEYPRESS) { if (event.kbd.keycode == Common::KEYCODE_SPACE) { - if (_unkFctPtr412 != NULL) { + if (_unkFctPtr412) { FunctionPtrType tmpFctPtr = _unkFctPtr412; _unkFctPtr412 = NULL; (this->*tmpFctPtr)(); @@ -3939,7 +3939,7 @@ void Scene1337::subC20F9() { break; } - if (_fieldA30 == 0) + if (!_autoplay) _unkFctPtr412 = &Scene1337::subC20E5; else subC20E5(); @@ -4436,8 +4436,11 @@ void Scene1337::subC2C2F() { for (int i = 0; i <= 3; i++) { if (tmpRandIndx != 3) { + // The variables 'i' and 'j' are not used in the inner code of the loop. + // It's understandable for 'i', which helps making sure that tmpVal is used properly, + // but it's suspect for j for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[j]._arr3[0]._field34 == 0) && (subC32B1(j, _arrunkObj1337[3]._arr1[randIndx]._field34))) { + if ((_arrunkObj1337[tmpRandIndx]._arr3[0]._field34 == 0) && (subC32B1(tmpRandIndx, _arrunkObj1337[3]._arr1[randIndx]._field34))) { tmpVal = j; } } @@ -4916,7 +4919,7 @@ void Scene1337::subPostInit() { _background1.setup2(9531, 1, 1, 249, 168, 155, 0); - _fieldA30 = 0; + _autoplay = false; _field424C = 0; _field424E = 0; } @@ -5668,9 +5671,10 @@ void Scene1337::subCF979() { for (int i = 0; i <= 3; i++) { if (subC27F9(_arrunkObj1337[0]._arr1[i]._field34) != -1) { + // The variable 'j' is not used in the inner code of the loop. It's suspect for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[2]._arr3[0]._field34 == 0) && (subC32B1(2, _arrunkObj1337[0]._arr1[j]._field34))) { - subC3456(&_arrunkObj1337[0]._arr1[j], &_arrunkObj1337[2]._arr3[0]); + if ((_arrunkObj1337[2]._arr3[0]._field34 == 0) && (subC32B1(2, _arrunkObj1337[0]._arr1[i]._field34))) { + subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[2]._arr3[0]); found = true; } } @@ -6690,7 +6694,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { SceneItem::display(1550, 71, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); return true; break; - case R2_17: + case R2_FUEL_CELL: scene->_field412 = 1; if (_fieldA4 == 6) { R2_GLOBALS._player.disableControl(); @@ -6704,7 +6708,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_18: + case R2_GYROSCOPE: scene->_field412 = 1; if (_fieldA4 == 3) { R2_GLOBALS._player.disableControl(); @@ -6718,7 +6722,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_22: + case R2_GUIDANCE_MODULE: scene->_field412 = 1; if (_fieldA4 == 1) { R2_GLOBALS._player.disableControl(); @@ -6732,7 +6736,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_23: + case R2_THRUSTER_VALVE: scene->_field412 = 1; if (_fieldA4 == 4) { R2_GLOBALS._player.disableControl(); @@ -6743,7 +6747,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_25: + case R2_RADAR_MECHANISM: scene->_field412 = 1; if (_fieldA4 == 2) { R2_GLOBALS._player.disableControl(); @@ -6757,7 +6761,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_27: + case R2_IGNITOR: scene->_field412 = 1; if (_fieldA4 == 5) { R2_GLOBALS._player.disableControl(); @@ -6768,7 +6772,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_45: + case R2_BATTERY: scene->_field412 = 1; if (_fieldA4 == 7) { R2_GLOBALS._player.disableControl(); @@ -6794,37 +6798,37 @@ void Scene1550::UnkObj15502::subA5CDF(int strip) { setup(1517, _fieldA4, 1); switch (_fieldA4 - 1) { case 0: - if (R2_INVENTORY.getObjectScene(R2_22) == 0) + if (R2_INVENTORY.getObjectScene(R2_GUIDANCE_MODULE) == 0) setFrame(5); setPosition(Common::Point(287, 85)); break; case 1: - if (R2_INVENTORY.getObjectScene(R2_25) == 0) + if (R2_INVENTORY.getObjectScene(R2_RADAR_MECHANISM) == 0) setFrame(5); setPosition(Common::Point(248, 100)); break; case 2: - if (R2_INVENTORY.getObjectScene(R2_28) == 0) + if (R2_INVENTORY.getObjectScene(R2_DIAGNOSTICS_DISPLAY) == 0) setFrame(5); setPosition(Common::Point(217, 85)); break; case 3: - if (R2_INVENTORY.getObjectScene(R2_23)) + if (R2_INVENTORY.getObjectScene(R2_THRUSTER_VALVE)) setFrame(5); setPosition(Common::Point(161, 121)); break; case 4: - if (R2_INVENTORY.getObjectScene(R2_27)) + if (R2_INVENTORY.getObjectScene(R2_IGNITOR)) setFrame(5); setPosition(Common::Point(117, 121)); break; case 5: - if (R2_INVENTORY.getObjectScene(R2_17)) + if (R2_INVENTORY.getObjectScene(R2_FUEL_CELL)) setFrame(5); setPosition(Common::Point(111, 85)); break; case 6: - if (R2_INVENTORY.getObjectScene(R2_45)) + if (R2_INVENTORY.getObjectScene(R2_BATTERY)) setFrame(5); setPosition(Common::Point(95, 84)); break; @@ -7129,7 +7133,7 @@ bool Scene1550::Actor13::startAction(CursorType action, Event &event) { if (scene->_field415 != 2) return SceneActor::startAction(action, event); - if (R2_INVENTORY.getObjectScene(R2_45) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_BATTERY) == 1550) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1564; scene->setAction(&scene->_sequenceManager1, scene, 1564, &R2_GLOBALS._player, NULL); @@ -7141,7 +7145,7 @@ bool Scene1550::Actor13::startAction(CursorType action, Event &event) { if (scene->_field415 != 2) return SceneActor::startAction(action, event); - if (R2_INVENTORY.getObjectScene(R2_45) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_BATTERY) == 1550) { SceneItem::display(1550, 74, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } else SceneItem::display(1550, 64, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); @@ -7184,7 +7188,7 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); if (R2_GLOBALS._sceneManager._previousScene == -1) - R2_GLOBALS.setFlag(R2_16); + R2_GLOBALS.setFlag(R2_ATTRACTOR_CABLE_HARNESS); if ((R2_GLOBALS._player._characterScene[1] != 1550) && (R2_GLOBALS._player._characterScene[1] != 1580)) { R2_GLOBALS._player._characterScene[1] = 1550; @@ -7477,7 +7481,7 @@ void Scene1550::signal() { case 1552: // No break on purpose case 1588: - R2_INVENTORY.setObjectScene(R2_19, R2_GLOBALS._player._characterIndex); + R2_INVENTORY.setObjectScene(R2_AIRBAG, R2_GLOBALS._player._characterIndex); _actor8.remove(); _field412 = 0; R2_GLOBALS._player.enableControl(); @@ -7492,7 +7496,7 @@ void Scene1550::signal() { case 1555: // No break on purpose case 1589: - R2_INVENTORY.setObjectScene(R2_18, R2_GLOBALS._player._characterIndex); + R2_INVENTORY.setObjectScene(R2_GYROSCOPE, R2_GLOBALS._player._characterIndex); _actor10.remove(); R2_GLOBALS._player.enableControl(); break; @@ -7516,7 +7520,7 @@ void Scene1550::signal() { _field415 = 2; break; case 1564: - R2_INVENTORY.setObjectScene(R2_45, 1); + R2_INVENTORY.setObjectScene(R2_BATTERY, 1); _sceneMode = 1565; setAction(&_sequenceManager1, this, 1565, &R2_GLOBALS._player, NULL); break; @@ -7529,7 +7533,7 @@ void Scene1550::signal() { case 1579: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_22, 0); + R2_INVENTORY.setObjectScene(R2_GUIDANCE_MODULE, 0); R2_GLOBALS._player.enableControl(); break; case 1570: @@ -7537,7 +7541,7 @@ void Scene1550::signal() { case 1580: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_25, 0); + R2_INVENTORY.setObjectScene(R2_RADAR_MECHANISM, 0); R2_GLOBALS._player.enableControl(); break; case 1571: @@ -7545,19 +7549,19 @@ void Scene1550::signal() { case 1581: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_18, 0); + R2_INVENTORY.setObjectScene(R2_GYROSCOPE, 0); R2_GLOBALS._player.enableControl(); break; case 1572: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_23, 0); + R2_INVENTORY.setObjectScene(R2_THRUSTER_VALVE, 0); R2_GLOBALS._player.enableControl(); break; case 1573: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_27, 0); + R2_INVENTORY.setObjectScene(R2_IGNITOR, 0); R2_GLOBALS._player.enableControl(); break; case 1574: @@ -7565,7 +7569,7 @@ void Scene1550::signal() { case 1582: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_17, 0); + R2_INVENTORY.setObjectScene(R2_FUEL_CELL, 0); R2_GLOBALS._player.enableControl(); break; case 1575: @@ -7573,7 +7577,7 @@ void Scene1550::signal() { case 1583: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_45, 0); + R2_INVENTORY.setObjectScene(R2_BATTERY, 0); R2_GLOBALS._player.enableControl(); break; case 1576: @@ -7598,14 +7602,14 @@ void Scene1550::signal() { case 1586: // No break on purpose case 1587: - R2_INVENTORY.setObjectScene(R2_28, R2_GLOBALS._player._characterIndex); + R2_INVENTORY.setObjectScene(R2_DIAGNOSTICS_DISPLAY, R2_GLOBALS._player._characterIndex); _actor1.remove(); _field412 = 0; R2_GLOBALS._player.enableControl(); break; case 1592: _actor9.remove(); - R2_INVENTORY.setObjectScene(R2_26, 1); + R2_INVENTORY.setObjectScene(R2_JOYSTICK, 1); if (R2_GLOBALS._player._characterIndex == 1) { R2_GLOBALS._v565EC[2] = R2_GLOBALS._v565EC[1]; R2_GLOBALS._v565EC[4] = R2_GLOBALS._v565EC[3]; @@ -8393,7 +8397,7 @@ void Scene1550::subA2B2F() { R2_GLOBALS._walkRegions.enableRegion(k5A78D); R2_GLOBALS._walkRegions.enableRegion(k5A790); R2_GLOBALS._walkRegions.enableRegion(k5A791); - if (R2_INVENTORY.getObjectScene(R2_26) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_JOYSTICK) == 1550) { _actor9.postInit(); _actor9.setup(1562, 3, 1); _actor9.setPosition(Common::Point(150, 70)); @@ -8482,7 +8486,7 @@ void Scene1550::subA2B2F() { _actor1.setPosition(Common::Point(259, 133)); _actor1.fixPriority(105); _actor1.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); - if (R2_INVENTORY.getObjectScene(R2_18) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_GYROSCOPE) == 1550) { _actor10.postInit(); _actor10.setup(1550, 7, 2); _actor10.setPosition(Common::Point(227, 30)); @@ -8501,7 +8505,7 @@ void Scene1550::subA2B2F() { _actor1.setup(1550, 1, 3); _actor1.setPosition(Common::Point(76, 64)); _actor1.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); - if (R2_INVENTORY.getObjectScene(R2_28) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_DIAGNOSTICS_DISPLAY) == 1550) { _actor11.postInit(); _actor11.setup(1504, 4, 1); _actor11.setPosition(Common::Point(49, 35)); @@ -8510,7 +8514,7 @@ void Scene1550::subA2B2F() { _actor11.fixPriority(65); _actor11.setDetails(1550, 14, 15, 63, 2, (SceneItem *) NULL); } - if (R2_INVENTORY.getObjectScene(R2_19) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1550) { _actor8.postInit(); _actor8.setup(1550, 7, 1); _actor8.setPosition(Common::Point(45, 44)); @@ -9050,7 +9054,7 @@ void Scene1580::synchronize(Serializer &s) { bool Scene1580::Hotspot1::startAction(CursorType action, Event &event) { Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; - if (action == R2_26) { + if (action == R2_JOYSTICK) { R2_INVENTORY.setObjectScene(26, 1580); R2_GLOBALS._sceneItems.remove(&scene->_item1); scene->_actor2.postInit(); @@ -9069,7 +9073,7 @@ bool Scene1580::Hotspot1::startAction(CursorType action, Event &event) { bool Scene1580::Hotspot2::startAction(CursorType action, Event &event) { Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; - if (action == R2_28) { + if (action == R2_DIAGNOSTICS_DISPLAY) { R2_INVENTORY.setObjectScene(28, 1580); R2_GLOBALS._player.disableControl(); R2_GLOBALS._sceneItems.remove(&scene->_item2); @@ -9171,14 +9175,14 @@ bool Scene1580::Actor6::startAction(CursorType action, Event &event) { return true; } break; - case R2_9: + case R2_COM_SCANNER: scene->_sceneMode = 30; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); scene->_stripManager.start(529, scene); return true; break; - case R2_39: + case R2_COM_SCANNER_2: scene->_sceneMode = 30; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -9203,14 +9207,14 @@ bool Scene1580::Actor7::startAction(CursorType action, Event &event) { return true; } break; - case R2_9: + case R2_COM_SCANNER: scene->_sceneMode = 30; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); scene->_stripManager.start(529, scene); return true; break; - case R2_39: + case R2_COM_SCANNER_2: scene->_sceneMode = 30; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -10442,7 +10446,7 @@ void Scene1800::synchronize(Serializer &s) { } bool Scene1800::Hotspot5::startAction(CursorType action, Event &event) { - if ((action != R2_9) && (action != R2_39)) + if ((action != R2_COM_SCANNER) && (action != R2_COM_SCANNER_2)) return false; Scene1800 *scene = (Scene1800 *)R2_GLOBALS._sceneManager._scene; @@ -10952,6 +10956,781 @@ void Scene1800::saveCharacter(int characterIndex) { } /*-------------------------------------------------------------------------- + * Scene 1850 - + * + *--------------------------------------------------------------------------*/ +Scene1850::Scene1850() { + warning("STUBBED: Scene1850()"); +} + +void Scene1850::synchronize(Serializer &s) { + warning("STUBBED: Scene1850::synchronize()"); +} + +bool Scene1850::Hotspot2::startAction(CursorType action, Event &event) { + if (action != CURSOR_USE) + return SceneHotspot::startAction(action, event); + + Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; + + R2_GLOBALS._player.disableControl(); + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + scene->_sceneMode = 1852; + if (R2_GLOBALS.getFlag(32)) + scene->setAction(&scene->_sequenceManager1, scene, 1871, &R2_GLOBALS._player, NULL); + else + scene->setAction(&scene->_sequenceManager1, scene, 1852, &R2_GLOBALS._player, NULL); + } else if (R2_GLOBALS.getFlag(30)) { + scene->_field41E = 1; + scene->_sceneMode = 1860; + + if (R2_GLOBALS.getFlag(32)) + scene->setAction(&scene->_sequenceManager1, scene, 1860, &R2_GLOBALS._player, &scene->_actor5, NULL); + else + scene->setAction(&scene->_sequenceManager1, scene, 1859, &R2_GLOBALS._player, &scene->_actor5, NULL); + + R2_GLOBALS.clearFlag(30); + } else { + scene->_sceneMode = 1853; + + if (R2_GLOBALS.getFlag(32)) + scene->setAction(&scene->_sequenceManager1, scene, 1872, &R2_GLOBALS._player, NULL); + else + scene->setAction(&scene->_sequenceManager1, scene, 1853, &R2_GLOBALS._player, NULL); + } + + return true; +} + +bool Scene1850::Actor5::startAction(CursorType action, Event &event) { + Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_USE: + if ((R2_GLOBALS._player._characterIndex != R2_SEEKER) || (R2_GLOBALS.getFlag(33)) || (R2_GLOBALS.getFlag(30))) + return SceneActor::startAction(action, event); + + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 1857; + + if (R2_GLOBALS.getFlag(32)) + scene->setAction(&scene->_sequenceManager1, scene, 1858, &R2_GLOBALS._player, &scene->_actor5, NULL); + else + scene->setAction(&scene->_sequenceManager1, scene, 1857, &R2_GLOBALS._player, &scene->_actor5, NULL); + + R2_GLOBALS.setFlag(30); + return true; + break; + case CURSOR_LOOK: + if (R2_GLOBALS.getFlag(34)) + SceneItem::display(1850, 2, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + else + SceneItem::display(1850, 1, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + + return true; + break; + case R2_AIRBAG: + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + if (R2_GLOBALS.getFlag(70)) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 30; + + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + scene->_stripManager.start(558, scene); + + return true; + } else { + return SceneActor::startAction(action, event); + } + } else if (R2_GLOBALS.getFlag(30)) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 1875; + scene->_actor2.postInit(); + + if (R2_GLOBALS.getFlag(32)) + scene->setAction(&scene->_sequenceManager1, scene, 1876, &R2_GLOBALS._player, &scene->_actor2, NULL); + else + scene->setAction(&scene->_sequenceManager1, scene, 1875, &R2_GLOBALS._player, &scene->_actor2, NULL); + + return true; + } else if (R2_GLOBALS.getFlag(70)) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 30; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + scene->_stripManager.start(557, scene); + R2_GLOBALS.setFlag(69); + + return true; + } else { + return SceneActor::startAction(action, event); + } + break; + case R2_REBREATHER_TANK: + if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1850) { + if (R2_GLOBALS.getFlag(30)) + return SceneActor::startAction(action, event);; + + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 1878; + scene->setAction(&scene->_sequenceManager1, scene, 1878, &R2_GLOBALS._player, &scene->_actor5, &scene->_actor2, NULL); + } + + return true; + break; + default: + return SceneActor::startAction(action, event); + break; + } +} + +bool Scene1850::Actor6::startAction(CursorType action, Event &event) { + if (action != CURSOR_USE) + return SceneHotspot::startAction(action, event); + + Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; + + if (R2_GLOBALS.getFlag(32)) { + SceneItem::display(3240, 4, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + return true; + } + + R2_GLOBALS._player.disableControl(); + if (scene->_field412 == 1851) + R2_GLOBALS._player._effect = 1; + + if (_position.x >= 160) + R2_GLOBALS.setFlag(29); + else + R2_GLOBALS.clearFlag(29); + + if ((R2_GLOBALS._player._characterIndex == R2_SEEKER) && (R2_GLOBALS.getFlag(30))) { + if (_position.x >= 160) + scene->_field41E = 3; + else + scene->_field41E = 2; + + scene->_sceneMode = 1860; + + if (R2_GLOBALS.getFlag(32)) { + scene->setAction(&scene->_sequenceManager1, scene, 1860, &R2_GLOBALS._player, &scene->_actor5, NULL); + } else { + scene->setAction(&scene->_sequenceManager1, scene, 1859, &R2_GLOBALS._player, &scene->_actor5, NULL); + } + } else { + scene->_sceneMode = 11; + if (_position.x >= 160) { + scene->setAction(&scene->_sequenceManager1, scene, 1866, &R2_GLOBALS._player, &scene->_actor7, NULL); + } else { + scene->setAction(&scene->_sequenceManager1, scene, 1865, &R2_GLOBALS._player, &scene->_actor6, NULL); + } + } + + return true; +} + +bool Scene1850::Actor8::startAction(CursorType action, Event &event) { + if ((action != CURSOR_USE) || (_position.y != 120)) + return SceneHotspot::startAction(action, event); + + Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; + + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 1881; + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + scene->setAction(&scene->_sequenceManager1, scene, 1881, &R2_GLOBALS._player, NULL); + } else { + scene->setAction(&scene->_sequenceManager1, scene, 1880, &R2_GLOBALS._player, NULL); + } + + return true; +} + +void Scene1850::postInit(SceneObjectList *OwnerList) { + loadScene(1850); + + if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] != 1850) + R2_GLOBALS.clearFlag(31); + + _palette1.loadPalette(0); + + if (R2_GLOBALS.getFlag(31)) { + _field412 = 1850; + g_globals->_scenePalette.loadPalette(1850); + } else { + _field412 = 1851; + g_globals->_scenePalette.loadPalette(1851); + } + + SceneExt::postInit(); + + if (R2_GLOBALS._sceneManager._previousScene == 3150) + R2_GLOBALS._sound1.play(116); + + _stripManager.addSpeaker(&_quinnSpeaker); + _stripManager.addSpeaker(&_seekerSpeaker); + + _field418 = 0; + _field41E = 0; + _field41A = Common::Point(0, 0); + + R2_GLOBALS._player._characterScene[1] = 1850; + R2_GLOBALS._player._characterScene[2] = 1850; + + _item2.setDetails(Rect(101, 56, 111, 63), 1850, 19, -1, -1, 1, NULL); + + _actor6.postInit(); + _actor6.setup(1850, 3, 1); + _actor6.setPosition(Common::Point(66, 102)); + _actor6.setDetails(1850, 22, -1, -1, 1, (SceneItem *) NULL); + + _actor7.postInit(); + _actor7.setup(1850, 2, 1); + _actor7.setPosition(Common::Point(253, 102)); + _actor7.setDetails(1850, 22, -1, -1, 1, (SceneItem *) NULL); + + R2_GLOBALS._walkRegions.enableRegion(1); + + _actor5.postInit(); + + if (R2_GLOBALS.getFlag(34)) { + R2_GLOBALS._walkRegions.enableRegion(2); + _actor5.setup(1851, 4, 3); + } else if (R2_GLOBALS.getFlag(30)) { + _actor5.setup(1851, 2, 2); + } else { + R2_GLOBALS._walkRegions.enableRegion(5); + if (R2_GLOBALS.getFlag(33)) { + R2_GLOBALS._walkRegions.enableRegion(2); + _actor5.setup(1851, 1, 3); + } else { + _actor5.setup(1851, 2, 1); + } + } + + _actor5.setPosition(Common::Point(219, 130)); + _actor5.fixPriority(114); + _actor5.setDetails(1850, -1, -1, -1, 1, (SceneItem *) NULL); + + R2_GLOBALS._player.postInit(); + + _actor1.postInit(); + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *) NULL); + } else { + _actor1.setDetails(9001, 0, 5, 3, 1, (SceneItem *) NULL); + } + + if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 1850) { + R2_GLOBALS._player._effect = 6; + _actor1._effect = 6; + if (R2_GLOBALS.getFlag(31)) { + R2_GLOBALS._player._shade = 0; + _actor1._shade = 0; + } else { + R2_GLOBALS._player._shade = 6; + _actor1._shade = 6; + } + + if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1850) { + _actor2.postInit(); + if (R2_GLOBALS.getFlag(34)) { + _actor2.setup(1851, 4, 2); + _actor2.fixPriority(114); + } else { + _actor2.setup(1851, 4, 1); + } + + _actor2.setPosition(Common::Point(179, 113)); + + if ((_actor5._strip == 1) && (_actor5._frame == 3)){ + _actor2.hide(); + } + + _actor2.setDetails(1850, 6, -1, -1, 1, (SceneItem *) NULL); + } + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (R2_GLOBALS.getFlag(32)) { + R2_GLOBALS._player.setVisage(1511); + _actor1.setVisage(1508); + + _actor3.postInit(); + _actor3.setup(1853, 3, 1); + _actor3.setPosition(Common::Point(122, 113)); + _actor3.fixPriority(114); + _actor3._effect = 6; + + // Totally useless test + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor3.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); + } else { + // And the associated dead code + _actor3.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL); + } + + _actor4.postInit(); + _actor4.setup(1853, 3, 2); + _actor4.setPosition(Common::Point(139, 111)); + _actor4.fixPriority(114); + _actor4._effect = 6; + + // Still totally useless test + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor4.setDetails(1850, 29, -1, -1, 2, (SceneItem *) NULL); + } else { + // Another piece of dead code + _actor4.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); + } + + if (R2_GLOBALS.getFlag(31)) { + _actor3._shade = 0; + _actor4._shade = 0; + } else { + _actor3._shade = 6; + _actor4._shade = 6; + } + } else { + R2_GLOBALS._player.setVisage(1500); + _actor1.setVisage(1505); + } + } else { // Not Quinn + if (R2_GLOBALS.getFlag(32)) { + R2_GLOBALS._player.setVisage(1508); + _actor1.setVisage(1511); + + _actor3.postInit(); + _actor3.setup(1853, 3, 1); + _actor3.setPosition(Common::Point(122, 113)); + _actor3.fixPriority(114); + _actor3._effect = 6; + + // Totally useless test + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + // Dead code + _actor3.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); + } else { + _actor3.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL); + } + + _actor4.postInit(); + _actor4.setup(1853, 3, 2); + _actor4.setPosition(Common::Point(139, 111)); + _actor4.fixPriority(114); + _actor4._effect = 6; + + // Again, useless test + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + // and dead code + _actor4.setDetails(1850, 29, -1, -1, 1, (SceneItem *) NULL); + } else { + _actor4.setDetails(1850, 28, -1, -1, 1, (SceneItem *) NULL); + } + + if (R2_GLOBALS.getFlag(31)) { + _actor3._shade = 0; + _actor4._shade = 0; + } else { + _actor3._shade = 6; + _actor4._shade = 6; + } + } else { + R2_GLOBALS._player.setVisage(1505); + _actor1.setVisage(1500); + } + } + + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.setStrip(3); + R2_GLOBALS._player.setPosition(Common::Point(80, 114)); + + _actor1.animate(ANIM_MODE_1, NULL); + _actor1.setObjectWrapper(new SceneObjectWrapper()); + _actor1.setStrip(3); + _actor1.setPosition(Common::Point(180, 96)); + + if (R2_GLOBALS.getFlag(30)) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor1.animate(ANIM_MODE_NONE, NULL); + _actor1.setObjectWrapper(NULL); + if (R2_GLOBALS.getFlag(32)) { + _actor1.setup(1854, 1, 3); + } else { + _actor1.setup(1854, 2, 3); + } + + _actor1.setPosition(Common::Point(164, 106)); + } else { + _actor1.animate(ANIM_MODE_NONE, NULL); + _actor1.setObjectWrapper(NULL); + if (R2_GLOBALS.getFlag(32)) { + R2_GLOBALS._player.setup(1854, 1, 3); + } else { + R2_GLOBALS._player.setup(1854, 2, 3); + } + + R2_GLOBALS._player.setPosition(Common::Point(164, 106)); + } + } + + R2_GLOBALS._player.enableControl(); + } else { // R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] != 1850 + R2_GLOBALS._player._effect = 1; + _actor1._effect = 1; + R2_GLOBALS._player.disableControl(); + _sceneMode = 10; + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (R2_GLOBALS.getFlag(29)) { + setAction(&_sequenceManager1, this, 1863, &R2_GLOBALS._player, &_actor1, &_actor7, NULL); + } else { + setAction(&_sequenceManager1, this, 1861, &R2_GLOBALS._player, &_actor1, &_actor6, NULL); + } + } else { + if (R2_GLOBALS.getFlag(29)) { + setAction(&_sequenceManager1, this, 1864, &R2_GLOBALS._player, &_actor1, &_actor7, NULL); + } else { + setAction(&_sequenceManager1, this, 1862, &R2_GLOBALS._player, &_actor1, &_actor6, NULL); + } + } + } + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + _actor1._moveDiff = Common::Point(5, 3); + } else { + R2_GLOBALS._player._moveDiff = Common::Point(5, 3); + _actor1._moveDiff = Common::Point(3, 2); + } + + _actor8.postInit(); + _actor8.setup(1850, 1, 1); + + if (R2_GLOBALS.getFlag(62)) { + _actor8.setPosition(Common::Point(159, 120)); + } else { + _actor8.setPosition(Common::Point(159, 184)); + } + + _actor8.fixPriority(113); + + if (R2_GLOBALS.getFlag(34)) { + _actor8.setDetails(1850, 25, -1, -1, 4, &_actor5); + } else { + _actor8.setDetails(1850, 25, -1, -1, 2, (SceneItem *) NULL); + } + + if (!R2_GLOBALS.getFlag(62)) { + _actor8.hide(); + } + + _item1.setDetails(Rect(0, 0, 320, 200), 1850, 16, -1, -1, 1, NULL); + + R2_GLOBALS._player._oldCharacterScene[1] = 1850; + R2_GLOBALS._player._oldCharacterScene[2] = 1850; +} + +void Scene1850::remove() { + g_globals->_scenePalette.loadPalette(0); + + R2_GLOBALS._scenePalette._palette[771] = 255; + R2_GLOBALS._scenePalette._palette[772] = 255; + R2_GLOBALS._scenePalette._palette[773] = 255; + + SceneExt::remove(); +} + +void Scene1850::signal() { + switch (_sceneMode) { + case 10: + R2_GLOBALS._player._effect = 6; + R2_GLOBALS._player._shade = 6; + + _actor1._effect = 6; + _actor1._shade = 6; + + R2_GLOBALS._walkRegions.enableRegion(5); + + if (R2_GLOBALS.getFlag(68)) { + R2_GLOBALS._player.enableControl(); + } else { + R2_GLOBALS.setFlag(68); + _sceneMode = 20; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(554, this); + } + break; + case 11: + R2_GLOBALS.clearFlag(30); + R2_GLOBALS._sceneManager.changeScene(1800); + break; + case 15: + _sceneMode = 16; + break; + case 16: + _sceneMode = 1870; + setAction(&_sequenceManager1, this, 1870, &R2_GLOBALS._player, &_actor1, &_actor3, &_actor4, NULL); + break; + case 20: + R2_GLOBALS._player.enableControl(CURSOR_TALK); + break; + case 21: + R2_GLOBALS._player.disableControl(); + _sceneMode = 1877; + setAction(&_sequenceManager1, this, 1877, &R2_GLOBALS._player, &_actor1, &_actor5, NULL); + break; + case 30: + R2_GLOBALS._player.disableControl(); + _sceneMode = 1882; + setAction(&_sequenceManager1, this, 1882, &R2_GLOBALS._player, NULL); + break; + case 1852: + // No break on purpose: + case 1853: + if (_field412 == 1851) { + R2_GLOBALS.setFlag(31); + _palette1.loadPalette(1850); + _field412 = 1850; + } else { + R2_GLOBALS.clearFlag(31); + _palette1.loadPalette(1851); + _field412 = 1851; + } + + _field418 = 1; + if (R2_GLOBALS.getFlag(30)) { + _actor8.setAction(&_sequenceManager2, NULL, 1867, &_actor8, NULL); + } else if (R2_GLOBALS.getFlag(34)) { + if (R2_GLOBALS.getFlag(62)) { + R2_GLOBALS.clearFlag(62); + _actor8.setAction(&_sequenceManager2, this, 1851, &_actor8, NULL); + } else { + R2_GLOBALS.setFlag(62); + _actor8.setAction(&_sequenceManager2, this, 1850, &_actor8, NULL); + } + } else if (R2_GLOBALS.getFlag(33)) { + R2_GLOBALS.setFlag(62); + R2_GLOBALS.setFlag(34); + R2_GLOBALS._walkRegions.enableRegion(2); + + _actor2.postInit(); + _actor2.setDetails(1850, 6, -1, -1, 5, &_actor5); + + _sceneMode = 1879; + + _actor8.setAction(&_sequenceManager2, this, 1879, &_actor5, &_actor8, &_actor2, NULL); + } else { + _actor8.setAction(&_sequenceManager2, NULL, 1867, &_actor8, NULL); + } + + if (R2_GLOBALS.getFlag(34)) + R2_GLOBALS._scenePalette.addFader(_palette1._palette, 256, 5, NULL); + else + R2_GLOBALS._scenePalette.addFader(_palette1._palette, 256, 5, this); + + if (_field412 == 1851) + _field416 = -20; + else + _field416 = 20; + + _field414 = 20; + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (_sceneMode == 1879) + _sceneMode = 1854; + + if (R2_GLOBALS.getFlag(32)) { + setAction(&_sequenceManager1, NULL, 1873, &R2_GLOBALS._player, NULL); + } else { + setAction(&_sequenceManager1, NULL, 1854, &R2_GLOBALS._player, NULL); + } + } else { + if (_sceneMode == 1879) + _sceneMode = 1855; + + if (R2_GLOBALS.getFlag(32)) { + setAction(&_sequenceManager1, NULL, 1874, &R2_GLOBALS._player, NULL); + } else { + setAction(&_sequenceManager1, NULL, 1855, &R2_GLOBALS._player, NULL); + } + } + break; + case 1857: + if (R2_GLOBALS.getFlag(69)) { + R2_GLOBALS._player.enableControl(); + R2_GLOBALS._player._canWalk = false; + } else { + _sceneMode = 1858; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(555, this); + R2_GLOBALS.setFlag(69); + } + break; + case 1858: + R2_GLOBALS._player.disableControl(); + _sceneMode = 1859; + setAction(&_sequenceManager1, this, 1859, &R2_GLOBALS._player, &_actor5, NULL); + R2_GLOBALS.clearFlag(30); + break; + case 1859: + R2_GLOBALS.setFlag(70); + _sceneMode = 20; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(575, this); + break; + case 1860: + if (_field41A.x != 0) { + R2_GLOBALS._player.enableControl(); + + PlayerMover *mover = new PlayerMover(); + R2_GLOBALS._player.addMover(mover, &_field41A, this); + + _field41A = Common::Point(0, 0); + } + + switch (_field41E) { + case 1: + _sceneMode = 1853; + if (R2_GLOBALS.getFlag(32)) { + setAction(&_sequenceManager1, this, 1872, &R2_GLOBALS._player, NULL); + } else { + setAction(&_sequenceManager1, this, 1853, &R2_GLOBALS._player, NULL); + } + break; + case 2: + _sceneMode = 11; + setAction(&_sequenceManager1, this, 1865, &R2_GLOBALS._player, &_actor6, NULL); + break; + case 3: + warning("_field41E == 3"); + _sceneMode = 11; + setAction(&_sequenceManager1, this, 1866, &R2_GLOBALS._player, &_actor7, NULL); + break; + default: + break; + } + + _field41E = 0; + break; + case 1870: + R2_GLOBALS._walkRegions.enableRegion(5); + R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1); + R2_GLOBALS.setFlag(32); + R2_GLOBALS._player.enableControl(CURSOR_ARROW); + break; + case 1875: + R2_INVENTORY.setObjectScene(R2_AIRBAG, 1850); + _sceneMode = 21; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(561, this); + break; + case 1877: + _actor3.postInit(); + _actor3._effect = 6; + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor3.setDetails(1850, 28, -1, -1, 2, (SceneItem *)NULL); + } else { + _actor3.setDetails(1850, 30, -1, -1, 2, (SceneItem *)NULL); + } + + _actor4.postInit(); + _actor4._effect = 6; + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor4.setDetails(1850, 29, -1, -1, 2, (SceneItem *)NULL); + } else { + _actor4.setDetails(1850, 28, -1, -1, 2, (SceneItem *)NULL); + } + + if (R2_GLOBALS.getFlag(31)) { + _actor3._shade = 0; + _actor4._shade = 0; + } else { + _actor3._shade = 6; + _actor4._shade = 6; + } + + R2_GLOBALS.clearFlag(30); + _sceneMode = 15; + setAction(&_sequenceManager1, this, 1869, &R2_GLOBALS._player, &_actor3, NULL); + setAction(&_sequenceManager2, this, 1868, &_actor1, &_actor4, NULL); + break; + case 1878: + R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1850); + R2_GLOBALS.setFlag(33); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._player.enableControl(); + break; + case 1879: + R2_GLOBALS._player.enableControl(); + break; + case 1881: + R2_GLOBALS._sceneManager.changeScene(1875); + break; + case 1882: + R2_INVENTORY.setObjectScene(R2_AIRBAG, 1); + R2_GLOBALS._player.enableControl(); + break; + default: + R2_GLOBALS._player.enableControl(); + break; + } +} + +void Scene1850::process(Event &event) { + if ( (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_ARROW) + && (R2_GLOBALS._player._characterIndex == R2_SEEKER) && (R2_GLOBALS.getFlag(30))) { + _field41A = event.mousePos; + R2_GLOBALS._player.disableControl(); + _sceneMode = 1860; + if (R2_GLOBALS.getFlag(32)) { + setAction(&_sequenceManager1, this, 1860, &R2_GLOBALS._player, &_actor5, NULL); + } else { + setAction(&_sequenceManager1, this, 1859, &R2_GLOBALS._player, &_actor5, NULL); + } + R2_GLOBALS.clearFlag(32); + event.handled = true; + } + + Scene::process(event); +} + +void Scene1850::dispatch() { + if (_field418 != 0) { + _field414--; + if (_field414 == 0) + _field418 = 0; + + if (_field416 >= 0) { + R2_GLOBALS._player._shade = (_field414 * 6) / _field416; + } else { + R2_GLOBALS._player._shade = ((_field414 * 6) / _field416) + 6; + } + R2_GLOBALS._player._flags |= OBJFLAG_PANES; + + _actor1._shade = R2_GLOBALS._player._shade; + _actor1._flags |= OBJFLAG_PANES; + + _actor3._shade = R2_GLOBALS._player._shade; + _actor3._flags |= OBJFLAG_PANES; + + _actor4._shade = R2_GLOBALS._player._shade; + _actor4._flags |= OBJFLAG_PANES; + } + + if (R2_GLOBALS.getFlag(32)) { + _actor3.setPosition(Common::Point(_actor8._position.x - 37, _actor8._position.y - 71)); + _actor4.setPosition(Common::Point(_actor8._position.x - 20, _actor8._position.y - 73)); + } + + if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1850) { + _actor2.setPosition(Common::Point(_actor8._position.x + 20, _actor8._position.y - 71)); + } + + Scene::dispatch(); +} + +/*-------------------------------------------------------------------------- * Scene 1875 - * *--------------------------------------------------------------------------*/ @@ -11231,10 +12010,10 @@ void Scene1900::postInit(SceneObjectList *OwnerList) { _stripManager.setFontNumber(3); _stripManager.addSpeaker(&_seekerSpeaker); - _exit1.setDetails(Rect(0, 105, 14, 145), R2_9, 2000); + _exit1.setDetails(Rect(0, 105, 14, 145), R2_COM_SCANNER, 2000); _exit1.setDest(Common::Point(14, 135)); - _exit2.setDetails(Rect(305, 105, 320, 145), R2_10, 2000); + _exit2.setDetails(Rect(305, 105, 320, 145), R2_SPENT_POWER_CAPSULE, 2000); _exit2.setDest(Common::Point(315, 135)); R2_GLOBALS._player.postInit(); @@ -11752,7 +12531,7 @@ bool Scene1945::Hotspot3::startAction(CursorType action, Event &event) { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; switch (action) { - case R2_37: + case R2_GUNPOWDER: R2_GLOBALS._player.disableControl(); scene->_sceneMode = 0; if ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) @@ -11817,7 +12596,7 @@ bool Scene1945::Hotspot4::startAction(CursorType action, Event &event) { } bool Scene1945::Actor3::startAction(CursorType action, Event &event) { - if ((action == R2_50) && (action == R2_49)) { + if ((action == R2_ALCOHOL_LAMP_3) && (action == R2_ALCOHOL_LAMP_2)) { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; scene->_fieldEAE = action; @@ -11981,7 +12760,7 @@ void Scene1945::signal() { } return; case 1942: - R2_INVENTORY.setObjectScene(R2_37, 0); + R2_INVENTORY.setObjectScene(R2_GUNPOWDER, 0); _actor3.setDetails(1945, 15, -1, -1, 2, (SceneItem *) NULL); R2_GLOBALS.setFlag(42); break; @@ -12239,7 +13018,7 @@ bool Scene1950::Hotspot2::startAction(CursorType action, Event &event) { } bool Scene1950::Actor2::startAction(CursorType action, Event &event) { - if (action != R2_31) + if (action != R2_SCRITH_KEY) return SceneActor::startAction(action, event); Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; @@ -12416,7 +13195,7 @@ void Scene1950::Actor8::signal() { bool Scene1950::Actor8::startAction(CursorType action, Event &event) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - if ((R2_GLOBALS._v56613[(scene->_field41C - 1) * 4] == 0) || (action != R2_44)) + if ((R2_GLOBALS._v56613[(scene->_field41C - 1) * 4] == 0) || (action != R2_PHOTON_STUNNER)) return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); @@ -13826,7 +14605,7 @@ void Scene1950::signal() { void Scene1950::process(Event &event) { if ( (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._player._uiEnabled) - && (R2_GLOBALS._events.getCursor() == R2_47) + && (R2_GLOBALS._events.getCursor() == R2_LIGHT_BULB) && (R2_GLOBALS._player._bounds.contains(event.mousePos)) && (R2_INVENTORY.getObjectScene(31) == 0)) { event.handled = true; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 4c412dbcb0..5906030c5f 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -263,7 +263,7 @@ public: ASound _aSound1; ASound _aSound2; BackgroundSceneObject _background1; - int _fieldA30; + bool _autoplay; unkObj1337_1 _arrunkObj1337[4]; SceneItem _item1; SceneObject _object1; @@ -879,6 +879,58 @@ public: virtual void saveCharacter(int characterIndex); }; +class Scene1850 : public SceneExt { + class Hotspot2 : public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + + class Actor5 : public SceneActor { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Actor6 : public SceneActor { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Actor8 : public SceneActor { + public: + virtual bool startAction(CursorType action, Event &event); + }; + +public: + int _field412; + int _field414; + int _field416; + int _field418; + Common::Point _field41A; + int _field41E; + ScenePalette _palette1; + SpeakerQuinn _quinnSpeaker; + SpeakerSeeker _seekerSpeaker; + NamedHotspot _item1; + Hotspot2 _item2; + SceneActor _actor1; + SceneActor _actor2; + SceneActor _actor3; + SceneActor _actor4; + Actor5 _actor5; + Actor6 _actor6; + Actor6 _actor7; + Actor8 _actor8; + SequenceManager _sequenceManager1; + SequenceManager _sequenceManager2; + + Scene1850(); + void synchronize(Serializer &s); + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void signal(); + virtual void process(Event &event); + virtual void dispatch(); +}; + class Scene1875 : public SceneExt { class Actor1875 : public SceneActor { public: diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index 3cc541493d..5567519046 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -1269,13 +1269,13 @@ void Scene2400::signal() { bool Scene2425::Item1::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_37) && (!R2_GLOBALS.getFlag(84))) { + if ((action == R2_GUNPOWDER) && (!R2_GLOBALS.getFlag(84))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2426; scene->setAction(&scene->_sequenceManager, scene, 2426, &R2_GLOBALS._player, &scene->_actor1, NULL); R2_GLOBALS.setFlag(84); return true; - } else if (action == R2_37) { + } else if (action == R2_GUNPOWDER) { R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); return NamedHotspot::startAction(R2_STEPPING_DISKS, event); @@ -1286,13 +1286,13 @@ bool Scene2425::Item1::startAction(CursorType action, Event &event) { bool Scene2425::Item2::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_37) && (R2_GLOBALS.getFlag(84))) { + if ((action == R2_GUNPOWDER) && (R2_GLOBALS.getFlag(84))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2427; scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_actor1, NULL); R2_GLOBALS.clearFlag(84); return true; - } else if (action == R2_37) { + } else if (action == R2_GUNPOWDER) { R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); return NamedHotspot::startAction(R2_STEPPING_DISKS, event); @@ -1303,7 +1303,7 @@ bool Scene2425::Item2::startAction(CursorType action, Event &event) { bool Scene2425::Item3::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if (action != R2_37) + if (action != R2_GUNPOWDER) return NamedHotspot::startAction(action, event); else { R2_GLOBALS._player.disableControl(); @@ -1320,7 +1320,7 @@ bool Scene2425::Item3::startAction(CursorType action, Event &event) { } bool Scene2425::Item4::startAction(CursorType action, Event &event) { - if (action != R2_37) + if (action != R2_GUNPOWDER) return NamedHotspot::startAction(action, event); else { R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); @@ -1332,19 +1332,19 @@ bool Scene2425::Item4::startAction(CursorType action, Event &event) { bool Scene2425::Actor1::startAction(CursorType action, Event &event) { if (action == R2_STEPPING_DISKS) { if (R2_GLOBALS._player._characterIndex == 2) { - R2_GLOBALS._events.setCursor(R2_37); + R2_GLOBALS._events.setCursor(R2_GUNPOWDER); return true; } else { return SceneActor::startAction(action, event); } - } else if (R2_GLOBALS._events.getCursor() == R2_37) + } else if (R2_GLOBALS._events.getCursor() == R2_GUNPOWDER) return false; else return SceneActor::startAction(action, event); } bool Scene2425::Actor2::startAction(CursorType action, Event &event) { - if (action != R2_37) + if (action != R2_GUNPOWDER) return SceneActor::startAction(action, event); else { R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); @@ -1601,12 +1601,12 @@ void Scene2430::signal() { break; case 2430: _actor2.remove(); - R2_INVENTORY.setObjectScene(R2_37, 2); + R2_INVENTORY.setObjectScene(R2_GUNPOWDER, 2); R2_GLOBALS._player.enableControl(); break; case 2435: _actor3.remove(); - R2_INVENTORY.setObjectScene(R2_50, 2); + R2_INVENTORY.setObjectScene(R2_ALCOHOL_LAMP_3, 2); R2_GLOBALS._player.enableControl(); break; default: @@ -1627,18 +1627,18 @@ bool Scene2435::Actor2::startAction(CursorType action, Event &event) { Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene; switch (action) { - case R2_34: + case R2_SAPPHIRE_BLUE: R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_ARROW); R2_GLOBALS.setFlag(82); scene->_stripManager.start(603, scene); return true; - case R2_35: + case R2_ANCIENT_SCROLLS: R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_ARROW); R2_GLOBALS.setFlag(82); scene->_stripManager.start(602, scene); - R2_INVENTORY.setObjectScene(R2_35, 2000); + R2_INVENTORY.setObjectScene(R2_ANCIENT_SCROLLS, 2000); return true; case CURSOR_TALK: R2_GLOBALS._player.disableControl(); @@ -1647,7 +1647,7 @@ bool Scene2435::Actor2::startAction(CursorType action, Event &event) { if ((R2_GLOBALS._player._characterIndex == 1) || (R2_GLOBALS.getFlag(82))) { scene->_stripManager.start(605, scene); return true; - } else if (R2_INVENTORY.getObjectScene(R2_35) == 2) { + } else if (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2) { scene->_stripManager.start(601, scene); return true; } else { @@ -2204,7 +2204,7 @@ void Scene2450::signal() { bool Scene2455::Actor1::startAction(CursorType action, Event &event) { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; - if (action == R2_29) { + if (action == R2_GLASS_DOME) { if ((R2_INVENTORY.getObjectScene(49) == 2455) || (R2_INVENTORY.getObjectScene(50) == 2455)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2458; @@ -2224,7 +2224,7 @@ bool Scene2455::Actor2::startAction(CursorType action, Event &event) { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; switch (action) { - case R2_49: + case R2_ALCOHOL_LAMP_2: if (R2_INVENTORY.getObjectScene(50) != 2455) { R2_GLOBALS._player.disableControl(); scene->_actor1.postInit(); @@ -2236,7 +2236,7 @@ bool Scene2455::Actor2::startAction(CursorType action, Event &event) { return true; } break; - case R2_50: + case R2_ALCOHOL_LAMP_3: if (R2_INVENTORY.getObjectScene(49) != 2455) { R2_GLOBALS._player.disableControl(); scene->_actor1.postInit(); @@ -3513,7 +3513,7 @@ void Scene2700::signal() { } void Scene2700::process(Event &event) { if ((R2_GLOBALS._player._canWalk) && (event.eventType == EVENT_BUTTON_DOWN)) { - if (R2_GLOBALS._events.getCursor() == R2_36) { + if (R2_GLOBALS._events.getCursor() == R2_FLUTE) { if (R2_GLOBALS._player._bounds.contains(event.mousePos)) { _sceneMode = 10; _field414 = 2710; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 99bcf3df44..2b97cba8e9 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -385,7 +385,7 @@ bool Scene3150::Item5::startAction(CursorType action, Event &event) { scene->_sceneMode = 3154; scene->setAction(&scene->_sequenceManager, scene, 3154, &R2_GLOBALS._player, &scene->_actor3, NULL); return true; - case R2_40: + case R2_SUPERCONDUCTOR_WIRE: if ((R2_INVENTORY.getObjectScene(47) != 3150) && (R2_GLOBALS.getFlag(75))) { R2_GLOBALS._player.disableControl(); scene->_actor3.postInit(); @@ -407,7 +407,7 @@ bool Scene3150::Item6::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; switch (action) { - case R2_41: + case R2_PILLOW: R2_GLOBALS._player.disableControl(); scene->_actor4.postInit(); scene->_actor4._effect = 6; @@ -416,7 +416,7 @@ bool Scene3150::Item6::startAction(CursorType action, Event &event) { scene->_sceneMode = 3158; scene->setAction(&scene->_sequenceManager, scene, 3158, &R2_GLOBALS._player, &scene->_actor4, NULL); return true; - case R2_42: + case R2_FOOD_TRAY: if ((R2_INVENTORY.getObjectScene(47) != 3150) && (R2_INVENTORY.getObjectScene(40) == 3150) && (R2_GLOBALS.getFlag(75))) { scene->_actor5.postInit(); scene->_actor5._effect = 6; @@ -447,7 +447,7 @@ bool Scene3150::Actor4::startAction(CursorType action, Event &event) { scene->_sceneMode = 3151; scene->setAction(&scene->_sequenceManager, scene, 3151, &R2_GLOBALS._player, &scene->_actor4, NULL); return true; - case R2_42: + case R2_FOOD_TRAY: return false; default: return SceneActor::startAction(action, event); @@ -498,7 +498,7 @@ bool Scene3150::Actor6::startAction(CursorType action, Event &event) { bool Scene3150::Actor7::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_43) && (!R2_GLOBALS.getFlag(80))) { + if ((action == R2_LASER_HACKSAW) && (!R2_GLOBALS.getFlag(80))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3160; scene->setAction(&scene->_sequenceManager, scene, 3160, &R2_GLOBALS._player, &scene->_actor7, NULL); @@ -4325,7 +4325,7 @@ bool Scene3600::Actor13::startAction(CursorType action, Event &event) { return true; case R2_SONIC_STUNNER: // No break on purpose - case R2_44: + case R2_PHOTON_STUNNER: if (action == R2_SONIC_STUNNER) R2_GLOBALS._sound3.play(43); else diff --git a/engines/tsage/user_interface.cpp b/engines/tsage/user_interface.cpp index 428bf8c038..ca9fddc6ce 100644 --- a/engines/tsage/user_interface.cpp +++ b/engines/tsage/user_interface.cpp @@ -82,7 +82,7 @@ void UIQuestion::showDescription(CursorType cursor) { } break; case GType_Ringworld2: - if ((cursor == R2_9) || (cursor == R2_39)) { + if ((cursor == R2_COM_SCANNER) || (cursor == R2_COM_SCANNER_2)) { // Show communicator warning("TODO: Communicator"); } else { diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index ce363d3461..7817725664 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -77,7 +77,7 @@ inline frac_t fp_sqroot(uint32 x) { HELPER MACROS for Bresenham's circle drawing algorithm Note the proper spelling on this header. */ -#define BE_ALGORITHM() { \ +#define BE_ALGORITHM() do { \ if (f >= 0) { \ y--; \ ddF_y += 2; \ @@ -87,35 +87,63 @@ inline frac_t fp_sqroot(uint32 x) { px += pitch; \ ddF_x += 2; \ f += ddF_x + 1; \ -} +} while(0) -#define BE_DRAWCIRCLE(ptr1,ptr2,ptr3,ptr4,x,y,px,py) { \ +#define BE_DRAWCIRCLE_TOP(ptr1,ptr2,x,y,px,py) do { \ *(ptr1 + (y) - (px)) = color; \ *(ptr1 + (x) - (py)) = color; \ *(ptr2 - (x) - (py)) = color; \ *(ptr2 - (y) - (px)) = color; \ +} while (0) + +#define BE_DRAWCIRCLE_BOTTOM(ptr3,ptr4,x,y,px,py) do { \ *(ptr3 - (y) + (px)) = color; \ *(ptr3 - (x) + (py)) = color; \ *(ptr4 + (x) + (py)) = color; \ *(ptr4 + (y) + (px)) = color; \ -} +} while (0) -#define BE_DRAWCIRCLE_XCOLOR(ptr1,ptr2,ptr3,ptr4,x,y,px,py) { \ +#define BE_DRAWCIRCLE(ptr1,ptr2,ptr3,ptr4,x,y,px,py) do { \ + BE_DRAWCIRCLE_TOP(ptr1,ptr2,x,y,px,py); \ + BE_DRAWCIRCLE_BOTTOM(ptr3,ptr4,x,y,px,py); \ +} while (0) + +#define BE_DRAWCIRCLE_BCOLOR(ptr1,ptr2,ptr3,ptr4,x,y,px,py) do { \ + *(ptr1 + (y) - (px)) = color1; \ + *(ptr1 + (x) - (py)) = color1; \ + *(ptr2 - (x) - (py)) = color1; \ + *(ptr2 - (y) - (px)) = color1; \ + *(ptr3 - (y) + (px)) = color1; \ + *(ptr3 - (x) + (py)) = color1; \ + *(ptr4 + (x) + (py)) = color2; \ + *(ptr4 + (y) + (px)) = color2; \ +} while (0) + +#define BE_DRAWCIRCLE_XCOLOR_TOP(ptr1,ptr2,x,y,px,py) do { \ *(ptr1 + (y) - (px)) = color1; \ *(ptr1 + (x) - (py)) = color2; \ *(ptr2 - (x) - (py)) = color2; \ *(ptr2 - (y) - (px)) = color1; \ +} while (0) + +#define BE_DRAWCIRCLE_XCOLOR_BOTTOM(ptr3,ptr4,x,y,px,py) do { \ *(ptr3 - (y) + (px)) = color3; \ *(ptr3 - (x) + (py)) = color4; \ *(ptr4 + (x) + (py)) = color4; \ *(ptr4 + (y) + (px)) = color3; \ -} +} while (0) -#define BE_RESET() { \ +#define BE_DRAWCIRCLE_XCOLOR(ptr1,ptr2,ptr3,ptr4,x,y,px,py) do { \ + BE_DRAWCIRCLE_XCOLOR_TOP(ptr1,ptr2,x,y,px,py); \ + BE_DRAWCIRCLE_XCOLOR_BOTTOM(ptr3,ptr4,x,y,px,py); \ +} while (0) + + +#define BE_RESET() do { \ f = 1 - r; \ ddF_x = 0; ddF_y = -2 * r; \ x = 0; y = r; px = 0; py = pitch * r; \ -} +} while (0) #define TRIANGLE_MAINX() \ if (error_term >= 0) { \ @@ -140,19 +168,63 @@ inline frac_t fp_sqroot(uint32 x) { ptr_left += pitch; /** HELPER MACROS for WU's circle drawing algorithm **/ -#define WU_DRAWCIRCLE(ptr1,ptr2,ptr3,ptr4,x,y,px,py,a) { \ +#define WU_DRAWCIRCLE_TOP(ptr1,ptr2,x,y,px,py,a) do { \ this->blendPixelPtr(ptr1 + (y) - (px), color, a); \ this->blendPixelPtr(ptr1 + (x) - (py), color, a); \ this->blendPixelPtr(ptr2 - (x) - (py), color, a); \ this->blendPixelPtr(ptr2 - (y) - (px), color, a); \ +} while (0) + +#define WU_DRAWCIRCLE_BOTTOM(ptr3,ptr4,x,y,px,py,a) do { \ this->blendPixelPtr(ptr3 - (y) + (px), color, a); \ this->blendPixelPtr(ptr3 - (x) + (py), color, a); \ this->blendPixelPtr(ptr4 + (x) + (py), color, a); \ this->blendPixelPtr(ptr4 + (y) + (px), color, a); \ -} +} while (0) + +#define WU_DRAWCIRCLE(ptr1,ptr2,ptr3,ptr4,x,y,px,py,a) do { \ + WU_DRAWCIRCLE_TOP(ptr1,ptr2,x,y,px,py,a); \ + WU_DRAWCIRCLE_BOTTOM(ptr3,ptr4,x,y,px,py,a); \ +} while (0) + + +// Color depending on y +// Note: this is only for the outer pixels +#define WU_DRAWCIRCLE_XCOLOR_TOP(ptr1,ptr2,x,y,px,py,a,func) do { \ + this->func(ptr1 + (y) - (px), color1, a); \ + this->func(ptr1 + (x) - (py), color2, a); \ + this->func(ptr2 - (x) - (py), color2, a); \ + this->func(ptr2 - (y) - (px), color1, a); \ +} while (0) + +#define WU_DRAWCIRCLE_XCOLOR_BOTTOM(ptr3,ptr4,x,y,px,py,a,func) do { \ + this->func(ptr3 - (y) + (px), color3, a); \ + this->func(ptr3 - (x) + (py), color4, a); \ + this->func(ptr4 + (x) + (py), color4, a); \ + this->func(ptr4 + (y) + (px), color3, a); \ +} while (0) + +#define WU_DRAWCIRCLE_XCOLOR(ptr1,ptr2,ptr3,ptr4,x,y,px,py,a,func) do { \ + WU_DRAWCIRCLE_XCOLOR_TOP(ptr1,ptr2,x,y,px,py,a,func); \ + WU_DRAWCIRCLE_XCOLOR_BOTTOM(ptr3,ptr4,x,y,px,py,a,func); \ +} while (0) + +// Color depending on corner (tl,tr,bl: color1, br: color2) +// Note: this is only for the outer pixels +#define WU_DRAWCIRCLE_BCOLOR(ptr1,ptr2,ptr3,ptr4,x,y,px,py,a) do { \ + this->blendPixelPtr(ptr1 + (y) - (px), color1, a); \ + this->blendPixelPtr(ptr1 + (x) - (py), color1, a); \ + this->blendPixelPtr(ptr2 - (x) - (py), color1, a); \ + this->blendPixelPtr(ptr2 - (y) - (px), color1, a); \ + this->blendPixelPtr(ptr3 - (y) + (px), color1, a); \ + this->blendPixelPtr(ptr3 - (x) + (py), color1, a); \ + this->blendPixelPtr(ptr4 + (x) + (py), color2, a); \ + this->blendPixelPtr(ptr4 + (y) + (px), color2, a); \ +} while (0) + // optimized Wu's algorithm -#define WU_ALGORITHM() { \ +#define WU_ALGORITHM() do { \ oldT = T; \ T = fp_sqroot(rsq - y*y) ^ 0xFFFF; \ py += pitch; \ @@ -160,8 +232,8 @@ inline frac_t fp_sqroot(uint32 x) { x--; px -= pitch; \ } \ a2 = (T >> 8); \ - a1 = ~a2 >> 4; \ -} + a1 = ~a2; \ +} while (0) namespace Graphics { @@ -447,18 +519,10 @@ applyScreenShading(GUI::ThemeEngine::ShadingStyle shadingStyle) { if (shadingStyle == GUI::ThemeEngine::kShadingDim) { - int n = (pixels + 7) >> 3; - switch (pixels % 8) { - case 0: do { - *ptr = (*ptr & colorMask) >> 1; ++ptr; - case 7: *ptr = (*ptr & colorMask) >> 1; ++ptr; - case 6: *ptr = (*ptr & colorMask) >> 1; ++ptr; - case 5: *ptr = (*ptr & colorMask) >> 1; ++ptr; - case 4: *ptr = (*ptr & colorMask) >> 1; ++ptr; - case 3: *ptr = (*ptr & colorMask) >> 1; ++ptr; - case 2: *ptr = (*ptr & colorMask) >> 1; ++ptr; - case 1: *ptr = (*ptr & colorMask) >> 1; ++ptr; - } while (--n > 0); + // TODO: Check how this interacts with kFeatureOverlaySupportsAlpha + for (int i = 0; i < pixels; ++i) { + *ptr = ((*ptr & colorMask) >> 1) | _alphaMask; + ++ptr; } } else if (shadingStyle == GUI::ThemeEngine::kShadingLuminance) { @@ -473,8 +537,8 @@ applyScreenShading(GUI::ThemeEngine::ShadingStyle shadingStyle) { template<typename PixelType> inline void VectorRendererSpec<PixelType>:: blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha) { - register int idst = *ptr; - register int isrc = color; + int idst = *ptr; + int isrc = color; *ptr = (PixelType)( (_redMask & ((idst & _redMask) + @@ -486,9 +550,53 @@ blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha) { (_blueMask & ((idst & _blueMask) + ((int)(((int)(isrc & _blueMask) - (int)(idst & _blueMask)) * alpha) >> 8))) | - (_alphaMask & ((idst & _alphaMask) + - ((alpha >> _format.aLoss) << _format.aShift) - - (((int)(idst & _alphaMask) * alpha) >> 8)))); + (idst & _alphaMask)); +} + +template<typename PixelType> +inline void VectorRendererSpec<PixelType>:: +blendPixelDestAlphaPtr(PixelType *ptr, PixelType color, uint8 alpha) { + int idst = *ptr; + // This function is only used for corner pixels in rounded rectangles, so + // the performance hit of this if shouldn't be too high. + // We're also ignoring the cases where dst has intermediate alpha. + if ((idst & _alphaMask) == 0) { + // set color and alpha channels + *ptr = (PixelType)(color & (_redMask | _greenMask | _blueMask)) | + ((alpha >> _format.aLoss) << _format.aShift); + } else { + // blend color with background + blendPixelPtr(ptr, color, alpha); + } +} + +template<typename PixelType> +inline void VectorRendererSpec<PixelType>:: +darkenFill(PixelType *ptr, PixelType *end) { + PixelType mask = (PixelType)((3 << _format.rShift) | (3 << _format.gShift) | (3 << _format.bShift)); + + if (!g_system->hasFeature(OSystem::kFeatureOverlaySupportsAlpha)) { + // !kFeatureOverlaySupportsAlpha (but might have alpha bits) + + while (ptr != end) { + *ptr = ((*ptr & ~mask) >> 2) | _alphaMask; + ++ptr; + } + } else { + // kFeatureOverlaySupportsAlpha + // assuming at least 3 alpha bits + + mask |= 3 << _format.aShift; + PixelType addA = (PixelType)(255 >> _format.aLoss) << _format.aShift; + addA -= (addA >> 2); + + while (ptr != end) { + // Darken the colour, and increase the alpha + // (0% -> 75%, 100% -> 100%) + *ptr = (PixelType)(((*ptr & ~mask) >> 2) + addA); + ++ptr; + } + } } /******************************************************************** @@ -674,36 +782,7 @@ drawRoundedSquare(int x, int y, int r, int w, int h) { drawRoundedSquareShadow(x, y, r, w, h, Base::_shadowOffset); } - switch (Base::_fillMode) { - case kFillDisabled: - if (Base::_strokeWidth) - drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillDisabled); - break; - - case kFillForeground: - drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillForeground); - break; - - case kFillBackground: - VectorRendererSpec::drawRoundedSquareAlg(x, y, r, w, h, _bgColor, kFillBackground); - drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillDisabled); - break; - - case kFillGradient: - if (Base::_strokeWidth > 1) { - drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillForeground); - VectorRendererSpec::drawRoundedSquareAlg(x + Base::_strokeWidth/2, y + Base::_strokeWidth/2, - r - Base::_strokeWidth/2, w - Base::_strokeWidth, h - Base::_strokeWidth, 0, kFillGradient); - } else { - VectorRendererSpec::drawRoundedSquareAlg(x, y, r, w, h, 0, kFillGradient); - if (Base::_strokeWidth) - drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillDisabled); - } - break; - } - - if (Base::_bevel) - drawRoundedSquareFakeBevel(x, y, r, w, h, Base::_bevel); + drawRoundedSquareAlg(x, y, r, w, h, _fgColor, Base::_fillMode); } template<typename PixelType> @@ -722,10 +801,14 @@ drawTab(int x, int y, int r, int w, int h) { switch (Base::_fillMode) { case kFillDisabled: + // FIXME: Implement this return; case kFillGradient: case kFillBackground: + // FIXME: This is broken for the AA renderer. + // See the rounded rect alg for how to fix it. (The border should + // be drawn before the interior, both inside drawTabAlg.) drawTabAlg(x, y, w, h, r, (Base::_fillMode == kFillBackground) ? _bgColor : _fgColor, Base::_fillMode); if (Base::_strokeWidth) drawTabAlg(x, y, w, h, r, _fgColor, kFillDisabled, (Base::_dynamicData >> 16), (Base::_dynamicData & 0xFFFF)); @@ -842,17 +925,10 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer: while (x++ < y) { BE_ALGORITHM(); - *(ptr_tr + (y) - (px)) = color; - *(ptr_tr + (x) - (py)) = color; - *(ptr_tl - (x) - (py)) = color; - *(ptr_tl - (y) - (px)) = color; + BE_DRAWCIRCLE_TOP(ptr_tr, ptr_tl, x, y, px, py); - if (Base::_strokeWidth > 1) { - *(ptr_tr + (y) - (px - pitch)) = color; - *(ptr_tr + (x) - (py)) = color; - *(ptr_tl - (x) - (py)) = color; - *(ptr_tl - (y) - (px - pitch)) = color; - } + if (Base::_strokeWidth > 1) + BE_DRAWCIRCLE_TOP(ptr_tr, ptr_tl, x, y, px - pitch, py); } } @@ -898,18 +974,12 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer: gradientFill(ptr_tl - x - py, w - 2 * r + 2 * x, x1 + r - x - y, real_radius - y); gradientFill(ptr_tl - y - px, w - 2 * r + 2 * y, x1 + r - y - x, real_radius - x); - *(ptr_tr + (y) - (px)) = color1; - *(ptr_tr + (x) - (py)) = color2; - *(ptr_tl - (x) - (py)) = color2; - *(ptr_tl - (y) - (px)) = color1; + BE_DRAWCIRCLE_XCOLOR_TOP(ptr_tr, ptr_tl, x, y, px, py); } else { colorFill<PixelType>(ptr_tl - x - py, ptr_tr + x - py, color); colorFill<PixelType>(ptr_tl - y - px, ptr_tr + y - px, color); - *(ptr_tr + (y) - (px)) = color; - *(ptr_tr + (x) - (py)) = color; - *(ptr_tl - (x) - (py)) = color; - *(ptr_tl - (y) - (px)) = color; + BE_DRAWCIRCLE_TOP(ptr_tr, ptr_tl, x, y, px, py); } } @@ -1013,8 +1083,9 @@ drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, P PixelType *ptr_fill = (PixelType *)_activeSurface->getBasePtr(x, y); if (fill) { + assert((_bgColor & ~_alphaMask) == 0); // only support black while (height--) { - blendFill(ptr_fill, ptr_fill + w, _bgColor, 200); + darkenFill(ptr_fill, ptr_fill + w); ptr_fill += pitch; } } @@ -1362,49 +1433,28 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto int f, ddF_x, ddF_y; int x, y, px, py; int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel; - int sw = 0, sp = 0, hp = h * pitch; - PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r); - PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r); - PixelType *ptr_bl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + h - r); - PixelType *ptr_br = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + h - r); - PixelType *ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1); + // TODO: Split this up into border, bevel and interior functions - int real_radius = r; - int short_h = h - (2 * r) + 2; - int long_h = h; - - if (fill_m == kFillDisabled) { - while (sw++ < Base::_strokeWidth) { - colorFill<PixelType>(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color); - colorFill<PixelType>(ptr_fill + hp - sp + r, ptr_fill + w + hp + 1 - sp - r, color); - sp += pitch; - - BE_RESET(); - r--; - - while (x++ < y) { - BE_ALGORITHM(); - BE_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py); + if (fill_m != kFillDisabled) { + PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r); + PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r); + PixelType *ptr_bl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + h - r); + PixelType *ptr_br = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + h - r); + PixelType *ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1); - if (Base::_strokeWidth > 1) { - BE_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x - 1, y, px, py); - BE_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px - pitch, py); - } - } - } + int real_radius = r; + int short_h = h - (2 * r) + 2; + int long_h = h; - ptr_fill += pitch * real_radius; - while (short_h--) { - colorFill<PixelType>(ptr_fill, ptr_fill + Base::_strokeWidth, color); - colorFill<PixelType>(ptr_fill + w - Base::_strokeWidth + 1, ptr_fill + w + 1, color); - ptr_fill += pitch; - } - } else { BE_RESET(); - PixelType color1, color2, color3, color4; + + PixelType color1 = color; + if (fill_m == kFillBackground) + color1 = _bgColor; if (fill_m == kFillGradient) { + PixelType color2, color3, color4; precalcGradient(long_h); while (x++ < y) { @@ -1427,11 +1477,11 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto while (x++ < y) { BE_ALGORITHM(); - colorFill<PixelType>(ptr_tl - x - py, ptr_tr + x - py, color); - colorFill<PixelType>(ptr_tl - y - px, ptr_tr + y - px, color); + colorFill<PixelType>(ptr_tl - x - py, ptr_tr + x - py, color1); + colorFill<PixelType>(ptr_tl - y - px, ptr_tr + y - px, color1); - colorFill<PixelType>(ptr_bl - x + py, ptr_br + x + py, color); - colorFill<PixelType>(ptr_bl - y + px, ptr_br + y + px, color); + colorFill<PixelType>(ptr_bl - x + py, ptr_br + x + py, color1); + colorFill<PixelType>(ptr_bl - y + px, ptr_br + y + px, color1); // do not remove - messes up the drawing at lower resolutions BE_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py); @@ -1443,8 +1493,53 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto if (fill_m == kFillGradient) { gradientFill(ptr_fill, w + 1, x1, real_radius++); } else { - colorFill<PixelType>(ptr_fill, ptr_fill + w + 1, color); + colorFill<PixelType>(ptr_fill, ptr_fill + w + 1, color1); + } + ptr_fill += pitch; + } + } + + + if (Base::_strokeWidth) { + int sw = 0, sp = 0, hp = h * pitch; + + PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r); + PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r); + PixelType *ptr_bl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + h - r); + PixelType *ptr_br = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + h - r); + PixelType *ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1); + + int real_radius = r; + int short_h = h - (2 * r) + 2; + + // TODO: A gradient effect on the bevel + PixelType color1, color2; + color1 = Base::_bevel ? _bevelColor : color; + color2 = color; + + while (sw++ < Base::_strokeWidth) { + colorFill<PixelType>(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color1); + colorFill<PixelType>(ptr_fill + hp - sp + r, ptr_fill + w + hp + 1 - sp - r, color2); + sp += pitch; + + BE_RESET(); + r--; + + while (x++ < y) { + BE_ALGORITHM(); + BE_DRAWCIRCLE_BCOLOR(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py); + + if (Base::_strokeWidth > 1) { + BE_DRAWCIRCLE_BCOLOR(ptr_tr, ptr_tl, ptr_bl, ptr_br, x - 1, y, px, py); + BE_DRAWCIRCLE_BCOLOR(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px - pitch, py); + } } + } + + ptr_fill += pitch * real_radius; + while (short_h--) { + colorFill<PixelType>(ptr_fill, ptr_fill + Base::_strokeWidth, color1); + colorFill<PixelType>(ptr_fill + w - Base::_strokeWidth + 1, ptr_fill + w + 1, color2); ptr_fill += pitch; } } @@ -1586,64 +1681,6 @@ drawRoundedSquareShadow(int x1, int y1, int r, int w, int h, int blur) { } } -template<typename PixelType> -void VectorRendererSpec<PixelType>:: -drawRoundedSquareFakeBevel(int x1, int y1, int r, int w, int h, int amount) { - int x, y; - const int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel; - int px, py; - int sw = 0, sp = 0; - - uint32 rsq = r*r; - frac_t T = 0, oldT; - uint8 a1, a2; - - PixelType color = _bevelColor; //_format.RGBToColor(63, 60, 17); - - PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r); - PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r); - PixelType *ptr_bl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + h - r); - PixelType *ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1); - - int short_h = h - 2 * r; - - while (sw++ < amount) { - colorFill<PixelType>(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color); - sp += pitch; - - x = r - (sw - 1); - y = 0; - T = 0; - px = pitch * x; - py = 0; - - while (x > y++) { - WU_ALGORITHM(); - - blendPixelPtr(ptr_tr + (y) - (px - pitch), color, a2); - blendPixelPtr(ptr_tr + (x - 1) - (py), color, a2); - blendPixelPtr(ptr_tl - (x - 1) - (py), color, a2); - blendPixelPtr(ptr_tl - (y) - (px - pitch), color, a2); - blendPixelPtr(ptr_bl - (y) + (px - pitch), color, a2); - blendPixelPtr(ptr_bl - (x - 1) + (py), color, a2); - - blendPixelPtr(ptr_tr + (y) - (px), color, a1); - blendPixelPtr(ptr_tr + (x) - (py), color, a1); - blendPixelPtr(ptr_tl - (x) - (py), color, a1); - blendPixelPtr(ptr_tl - (y) - (px), color, a1); - blendPixelPtr(ptr_bl - (y) + (px), color, a1); - blendPixelPtr(ptr_bl - (x) + (py), color, a1); - } - } - - ptr_fill += pitch * r; - while (short_h-- >= 0) { - colorFill<PixelType>(ptr_fill, ptr_fill + amount, color); - ptr_fill += pitch; - } -} - - /******************************************************************************/ @@ -1706,28 +1743,26 @@ drawLineAlg(int x1, int y1, int x2, int y2, int dx, int dy, PixelType color) { Base::putPixel(x2, y2, color); } -/** ROUNDED SQUARES **/ +/** TAB ALGORITHM */ template<typename PixelType> void VectorRendererAA<PixelType>:: -drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m) { - int x, y; - const int pitch = Base::_activeSurface->pitch / Base::_activeSurface->format.bytesPerPixel; - int px, py; - int sw = 0, sp = 0, hp = h * pitch; +drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m, int baseLeft, int baseRight) { + int x, y, px, py; + int pitch = Base::_activeSurface->pitch / Base::_activeSurface->format.bytesPerPixel; + int sw = 0, sp = 0, hp = 0; - uint32 rsq = r*r; frac_t T = 0, oldT; uint8 a1, a2; + uint32 rsq = r*r; PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r); PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r); - PixelType *ptr_bl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + h - r); - PixelType *ptr_br = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + h - r); PixelType *ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1); - int short_h = h - 2 * r; + int real_radius = r; - if (fill_m == VectorRenderer::kFillDisabled) { + if (fill_m == Base::kFillDisabled) { + color = 0; while (sw++ < Base::_strokeWidth) { colorFill<PixelType>(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color); colorFill<PixelType>(ptr_fill + hp - sp + r, ptr_fill + w + hp + 1 - sp - r, color); @@ -1739,48 +1774,265 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto px = pitch * x; py = 0; + while (x > y++) { WU_ALGORITHM(); - if (sw != 1 && sw != Base::_strokeWidth) - a2 = a1 = 255; + // sw == 1: outside, sw = _strokeWidth: inside + if (sw != Base::_strokeWidth) + a2 = 255; - WU_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, (x - 1), y, (px - pitch), py, a2); - WU_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py, a1); + // inner arc + WU_DRAWCIRCLE_TOP(ptr_tr, ptr_tl, x, y, px, py, a2); + + if (sw == 1) // outer arc + WU_DRAWCIRCLE_TOP(ptr_tr, ptr_tl, x, y, px - pitch, py, a1); } } - ptr_fill += pitch * r; - while (short_h-- >= 0) { + int short_h = h - r + 2; + + ptr_fill += pitch * real_radius; + while (short_h--) { colorFill<PixelType>(ptr_fill, ptr_fill + Base::_strokeWidth, color); colorFill<PixelType>(ptr_fill + w - Base::_strokeWidth + 1, ptr_fill + w + 1, color); ptr_fill += pitch; } + + if (baseLeft) { + sw = 0; + ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1 + h + 1); + while (sw++ < Base::_strokeWidth) { + colorFill<PixelType>(ptr_fill - baseLeft, ptr_fill, color); + ptr_fill += pitch; + } + } + + if (baseRight) { + sw = 0; + ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w, y1 + h + 1); + while (sw++ < Base::_strokeWidth) { + colorFill<PixelType>(ptr_fill, ptr_fill + baseRight, color); + ptr_fill += pitch; + } + } } else { - x = r; + PixelType color1, color2; + color1 = color2 = color; + + int long_h = h; + int short_h = h - real_radius + 2; + x = real_radius; y = 0; T = 0; px = pitch * x; py = 0; - while (x > 1 + y++) { + Base::precalcGradient(long_h); + + while (x > y++) { WU_ALGORITHM(); - colorFill<PixelType>(ptr_tl - x - py, ptr_tr + x - py, color); - colorFill<PixelType>(ptr_tl - y - px, ptr_tr + y - px, color); + if (fill_m == Base::kFillGradient) { + color1 = Base::calcGradient(real_radius - x, long_h); + color2 = Base::calcGradient(real_radius - y, long_h); + + Base::gradientFill(ptr_tl - x - py + 1, w - 2 * r + 2 * x - 1, x1 + r - x - y + 1, real_radius - y); + + // Only fill each horizontal line once (or we destroy + // the gradient effect at the edges) + if (T < oldT || y == 1) + Base::gradientFill(ptr_tl - y - px + 1, w - 2 * r + 2 * y - 1, x1 + r - y - x + 1, real_radius - x); + + WU_DRAWCIRCLE_XCOLOR_TOP(ptr_tr, ptr_tl, x, y, px, py, a1, Base::blendPixelPtr); + } else { + colorFill<PixelType>(ptr_tl - x - py + 1, ptr_tr + x - py, color); + if (T < oldT || y == 1) + colorFill<PixelType>(ptr_tl - y - px + 1, ptr_tr + y - px, color); + + WU_DRAWCIRCLE_TOP(ptr_tr, ptr_tl, x, y, px, py, a1); + } + } + + ptr_fill += pitch * r; + while (short_h--) { + if (fill_m == Base::kFillGradient) { + Base::gradientFill(ptr_fill, w + 1, x1, real_radius++); + } else { + colorFill<PixelType>(ptr_fill, ptr_fill + w + 1, color); + } + ptr_fill += pitch; + } + } +} + + +/** ROUNDED SQUARES **/ +template<typename PixelType> +void VectorRendererAA<PixelType>:: +drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m) { + int x, y; + const int pitch = Base::_activeSurface->pitch / Base::_activeSurface->format.bytesPerPixel; + int px, py; + + uint32 rsq = r*r; + frac_t T = 0, oldT; + uint8 a1, a2; + + // TODO: Split this up into border, bevel and interior functions + + if (Base::_strokeWidth) { + PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r); + PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r); + PixelType *ptr_bl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + h - r); + PixelType *ptr_br = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + h - r); + PixelType *ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1); + + int sw = 0, sp = 0; + int short_h = h - 2 * r; + int hp = h * pitch; - colorFill<PixelType>(ptr_bl - x + py, ptr_br + x + py, color); - colorFill<PixelType>(ptr_bl - y + px, ptr_br + y + px, color); + int strokeWidth = Base::_strokeWidth; + // If we're going to fill the inside, draw a slightly thicker border + // so we can blend the inside on top of it. + if (fill_m != Base::kFillDisabled) strokeWidth++; - WU_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py, a1); + // TODO: A gradient effect on the bevel + PixelType color1, color2; + color1 = Base::_bevel ? Base::_bevelColor : color; + color2 = color; + + + while (sw++ < strokeWidth) { + colorFill<PixelType>(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color1); + colorFill<PixelType>(ptr_fill + hp - sp + r, ptr_fill + w + hp + 1 - sp - r, color2); + sp += pitch; + + x = r - (sw - 1); + y = 0; + T = 0; + px = pitch * x; + py = 0; + + while (x > y++) { + WU_ALGORITHM(); + + // sw == 1: outside, sw = _strokeWidth: inside + // We always draw the outer edge AAed, but the inner edge + // only when the inside isn't filled + if (sw != strokeWidth || fill_m != Base::kFillDisabled) + a2 = 255; + + // inner arc + WU_DRAWCIRCLE_BCOLOR(ptr_tr, ptr_tl, ptr_bl, ptr_br, (x - 1), y, (px - pitch), py, a2); + + if (sw == 1) // outer arc + WU_DRAWCIRCLE_BCOLOR(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py, a1); + } } ptr_fill += pitch * r; while (short_h-- >= 0) { - colorFill<PixelType>(ptr_fill, ptr_fill + w + 1, color); + colorFill<PixelType>(ptr_fill, ptr_fill + Base::_strokeWidth, color1); + colorFill<PixelType>(ptr_fill + w - Base::_strokeWidth + 1, ptr_fill + w + 1, color2); ptr_fill += pitch; } } + + r -= Base::_strokeWidth; + x1 += Base::_strokeWidth; + y1 += Base::_strokeWidth; + w -= 2*Base::_strokeWidth; + h -= 2*Base::_strokeWidth; + rsq = r*r; + + if (w <= 0 || h <= 0) + return; // Only border is visible + + if (fill_m != Base::kFillDisabled) { + if (fill_m == Base::kFillBackground) + color = Base::_bgColor; + + PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r); + PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r); + PixelType *ptr_bl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + h - r); + PixelType *ptr_br = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + h - r); + PixelType *ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1); + + int short_h = h - 2 * r; + x = r; + y = 0; + T = 0; + px = pitch * x; + py = 0; + + if (fill_m == Base::kFillGradient) { + + Base::precalcGradient(h); + + PixelType color1, color2, color3, color4; + while (x > y++) { + WU_ALGORITHM(); + + color1 = Base::calcGradient(r - x, h); + color2 = Base::calcGradient(r - y, h); + color3 = Base::calcGradient(h - r + x, h); + color4 = Base::calcGradient(h - r + y, h); + + Base::gradientFill(ptr_tl - x - py + 1, w - 2 * r + 2 * x - 1, x1 + r - x - y + 1, r - y); + + // Only fill each horizontal line once (or we destroy + // the gradient effect at the edges) + if (T < oldT || y == 1) + Base::gradientFill(ptr_tl - y - px + 1, w - 2 * r + 2 * y - 1, x1 + r - y - x + 1, r - x); + + Base::gradientFill(ptr_bl - x + py + 1, w - 2 * r + 2 * x - 1, x1 + r - x - y + 1, h - r + y); + + // Only fill each horizontal line once (or we destroy + // the gradient effect at the edges) + if (T < oldT || y == 1) + Base::gradientFill(ptr_bl - y + px + 1, w - 2 * r + 2 * y - 1, x1 + r - y - x + 1, h - r + x); + + // This shape is used for dialog backgrounds. + // If we're drawing on top of an empty overlay background, + // and the overlay supports alpha, we have to do AA by + // setting the dest alpha channel, instead of blending with + // dest color channels. + if (!g_system->hasFeature(OSystem::kFeatureOverlaySupportsAlpha)) + WU_DRAWCIRCLE_XCOLOR(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py, a1, blendPixelPtr); + else + WU_DRAWCIRCLE_XCOLOR(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py, a1, blendPixelDestAlphaPtr); + } + + ptr_fill += pitch * r; + while (short_h-- >= 0) { + Base::gradientFill(ptr_fill, w + 1, x1, r++); + ptr_fill += pitch; + } + + } else { + + while (x > 1 + y++) { + WU_ALGORITHM(); + + colorFill<PixelType>(ptr_tl - x - py + 1, ptr_tr + x - py, color); + if (T < oldT || y == 1) + colorFill<PixelType>(ptr_tl - y - px + 1, ptr_tr + y - px, color); + + colorFill<PixelType>(ptr_bl - x + py + 1, ptr_br + x + py, color); + if (T < oldT || y == 1) + colorFill<PixelType>(ptr_bl - y + px + 1, ptr_br + y + px, color); + + WU_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py, a1); + } + + ptr_fill += pitch * r; + while (short_h-- >= 0) { + colorFill<PixelType>(ptr_fill, ptr_fill + w + 1, color); + ptr_fill += pitch; + } + } + } } /** CIRCLES **/ diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h index fe64f9774d..4ed80cb55f 100644 --- a/graphics/VectorRendererSpec.h +++ b/graphics/VectorRendererSpec.h @@ -103,7 +103,7 @@ protected: * @param alpha Alpha intensity of the pixel (0-255) */ inline void blendPixel(int x, int y, PixelType color, uint8 alpha) { - blendPixelPtr((PixelType*)Base::_activeSurface->getBasePtr(x, y), color, alpha); + blendPixelPtr((PixelType *)Base::_activeSurface->getBasePtr(x, y), color, alpha); } /** @@ -121,6 +121,24 @@ protected: inline void blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha); /** + * Blends a single pixel on the surface in the given pixel pointer, using supplied color + * and Alpha intensity. + * If the destination pixel has 0 alpha, set the color and alpha channels, + * overwriting the destination pixel entirely. + * If the destination pixel has non-zero alpha, blend dest with src. + * + * This is implemented to prevent blendPixel() to calculate the surface pointer on each call. + * Optimized drawing algorithms should call this function when possible. + * + * @see blendPixel + * @param ptr Pointer to the pixel to blend on top of + * @param color Color of the pixel + * @param alpha Alpha intensity of the pixel (0-255) + */ + inline void blendPixelDestAlphaPtr(PixelType *ptr, PixelType color, uint8 alpha); + + + /** * PRIMITIVE DRAWING ALGORITHMS * * Generic algorithms for drawing all kinds of aliased primitive shapes. @@ -172,7 +190,6 @@ protected: */ virtual void drawSquareShadow(int x, int y, int w, int h, int blur); virtual void drawRoundedSquareShadow(int x, int y, int r, int w, int h, int blur); - virtual void drawRoundedSquareFakeBevel(int x, int y, int r, int w, int h, int amount); /** * Calculates the color gradient on a given point. @@ -202,6 +219,8 @@ protected: while (first != last) blendPixelPtr(first++, color, alpha); } + void darkenFill(PixelType *first, PixelType *last); + const PixelFormat _format; const PixelType _redMask, _greenMask, _blueMask, _alphaMask; @@ -278,6 +297,10 @@ protected: // VectorRenderer::applyConvolutionMatrix(VectorRenderer::kConvolutionHardBlur, // Common::Rect(x, y, x + w + blur * 2, y + h + blur * 2)); } + + virtual void drawTabAlg(int x, int y, int w, int h, int r, + PixelType color, VectorRenderer::FillMode fill_m, + int baseLeft = 0, int baseRight = 0); }; #endif diff --git a/graphics/iff.cpp b/graphics/iff.cpp index 4bb971f299..7434a6bebc 100644 --- a/graphics/iff.cpp +++ b/graphics/iff.cpp @@ -206,7 +206,7 @@ struct PBMLoader { case ID_BODY: if (_surface) { _surface->create(_decoder._header.width, _decoder._header.height, PixelFormat::createFormatCLUT8()); - _decoder.loadBitmap((byte*)_surface->pixels, chunk._stream); + _decoder.loadBitmap((byte *)_surface->pixels, chunk._stream); } return true; // stop the parser } @@ -234,7 +234,7 @@ bool PackBitsReadStream::eos() const { } uint32 PackBitsReadStream::read(void *dataPtr, uint32 dataSize) { - byte *out = (byte*)dataPtr; + byte *out = (byte *)dataPtr; uint32 left = dataSize; uint32 lenR = 0, lenW = 0; diff --git a/graphics/imagedec.cpp b/graphics/imagedec.cpp index eb595a750e..9552f095fa 100644 --- a/graphics/imagedec.cpp +++ b/graphics/imagedec.cpp @@ -117,7 +117,7 @@ Surface *BMPDecoder::decodeImage(Common::SeekableReadStream &stream, const Pixel assert(newSurf); newSurf->create(info.width, info.height, format); assert(newSurf->pixels); - OverlayColor *curPixel = (OverlayColor*)newSurf->pixels + (newSurf->h-1) * newSurf->w; + OverlayColor *curPixel = (OverlayColor *)newSurf->pixels + (newSurf->h-1) * newSurf->w; int pitchAdd = info.width % 4; for (int i = 0; i < newSurf->h; ++i) { for (int i2 = 0; i2 < newSurf->w; ++i2) { diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp index ef540b8cd8..88f3cc2077 100644 --- a/graphics/scaler/thumbnail_intern.cpp +++ b/graphics/scaler/thumbnail_intern.cpp @@ -46,7 +46,7 @@ void createThumbnail_2(const uint8 *src, uint32 srcPitch, uint8 *dstPtr, uint32 assert(height % 2 == 0); for (int y = 0; y < height; y += 2) { for (int x = 0; x < width; x += 2, dstPtr += 2) { - *((uint16*)dstPtr) = quadBlockInterpolate<bitFormat>(src + 2 * x, srcPitch); + *((uint16 *)dstPtr) = quadBlockInterpolate<bitFormat>(src + 2 * x, srcPitch); } dstPtr += (dstPitch - 2 * width / 2); src += 2 * srcPitch; @@ -64,7 +64,7 @@ void createThumbnail_4(const uint8 *src, uint32 srcPitch, uint8 *dstPtr, uint32 uint16 downleft = quadBlockInterpolate<bitFormat>(src + srcPitch * 2 + 2 * x, srcPitch); uint16 downright = quadBlockInterpolate<bitFormat>(src + srcPitch * 2 + 2 * (x + 2), srcPitch); - *((uint16*)dstPtr) = interpolate16_1_1_1_1<Graphics::ColorMasks<bitFormat> >(upleft, upright, downleft, downright); + *((uint16 *)dstPtr) = interpolate16_1_1_1_1<Graphics::ColorMasks<bitFormat> >(upleft, upright, downleft, downright); } dstPtr += (dstPitch - 2 * width / 4); src += 4 * srcPitch; @@ -116,9 +116,9 @@ static bool grabScreen565(Graphics::Surface *surf) { byte r = 0, g = 0, b = 0; if (screenFormat.bytesPerPixel == 1) { - r = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 3]; - g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 3 + 1]; - b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 3 + 2]; + r = palette[((uint8 *)screen->pixels)[y * screen->pitch + x] * 3]; + g = palette[((uint8 *)screen->pixels)[y * screen->pitch + x] * 3 + 1]; + b = palette[((uint8 *)screen->pixels)[y * screen->pitch + x] * 3 + 2]; } else if (screenFormat.bytesPerPixel == 2) { uint16 col = READ_UINT16(screen->getBasePtr(x, y)); screenFormat.colorToRGB(col, r, g, b); diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 465af5448f..e7f49e9b2a 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -112,17 +112,19 @@ void GuiManager::initKeymap() { Action *act; Keymap *guiMap = new Keymap(kGuiKeymapName); - act = new Action(guiMap, "CLOS", _("Close"), kQuitActionType); + act = new Action(guiMap, "CLOS", _("Close")); act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0)); - act = new Action(guiMap, "CLIK", _("Mouse click"), kLeftClickActionType); + act = new Action(guiMap, "CLIK", _("Mouse click")); act->addLeftClickEvent(); - act = new Action(guiMap, "VIRT", _("Display keyboard"), kVirtualKeyboardActionType); - act->addKeyEvent(KeyState(KEYCODE_F7, ASCII_F7, 0)); +#ifdef ENABLE_VKEYBD + act = new Action(guiMap, "VIRT", _("Display keyboard")); + act->addEvent(EVENT_VIRTUAL_KEYBOARD); +#endif - act = new Action(guiMap, "REMP", _("Remap keys"), kKeyRemapActionType); - act->addKeyEvent(KeyState(KEYCODE_F8, ASCII_F8, 0)); + act = new Action(guiMap, "REMP", _("Remap keys")); + act->addEvent(EVENT_KEYMAPPER_REMAP); act = new Action(guiMap, "FULS", _("Toggle FullScreen")); act->addKeyEvent(KeyState(KEYCODE_RETURN, ASCII_RETURN, KBD_ALT)); diff --git a/gui/launcher.cpp b/gui/launcher.cpp index d1e6569c56..5bb358452a 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -1084,7 +1084,7 @@ void LauncherDialog::updateButtons() { void LauncherDialog::reflowLayout() { #ifndef DISABLE_FANCY_THEMES if (g_gui.xmlEval()->getVar("Globals.ShowLauncherLogo") == 1 && g_gui.theme()->supportsImages()) { - StaticTextWidget *ver = (StaticTextWidget*)findWidget("Launcher.Version"); + StaticTextWidget *ver = (StaticTextWidget *)findWidget("Launcher.Version"); if (ver) { ver->setAlign((Graphics::TextAlign)g_gui.xmlEval()->getVar("Launcher.Version.Align", Graphics::kTextAlignCenter)); ver->setLabel(gScummVMVersionDate); @@ -1095,7 +1095,7 @@ void LauncherDialog::reflowLayout() { _logo->useThemeTransparency(true); _logo->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageLogo)); } else { - StaticTextWidget *ver = (StaticTextWidget*)findWidget("Launcher.Version"); + StaticTextWidget *ver = (StaticTextWidget *)findWidget("Launcher.Version"); if (ver) { ver->setAlign((Graphics::TextAlign)g_gui.xmlEval()->getVar("Launcher.Version.Align", Graphics::kTextAlignCenter)); ver->setLabel(gScummVMFullVersion); diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip Binary files differindex f56e4e919c..84416636bc 100644 --- a/gui/themes/scummmodern.zip +++ b/gui/themes/scummmodern.zip diff --git a/gui/themes/scummmodern/scummmodern_gfx.stx b/gui/themes/scummmodern/scummmodern_gfx.stx index af444be340..b420ce0903 100644 --- a/gui/themes/scummmodern/scummmodern_gfx.stx +++ b/gui/themes/scummmodern/scummmodern_gfx.stx @@ -398,7 +398,7 @@ <!-- Background of the slider widget --> <drawdata id = 'widget_slider' cache = 'false'> <drawstep func = 'roundedsq' - stroke = '0' + stroke = '1' radius = '5' fill = 'foreground' fg_color = 'paleyellow' @@ -687,6 +687,7 @@ radius = '5' fg_color = 'paleyellow' shadow = '0' + stroke = '1' bevel = '1' bevel_color = 'shadowcolor' /> diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat Binary files differindex 9f6083790c..0dcd6065a8 100644 --- a/gui/themes/translations.dat +++ b/gui/themes/translations.dat diff --git a/po/ca_ES.po b/po/ca_ES.po index 446ac4260a..6dc8b6a008 100644 --- a/po/ca_ES.po +++ b/po/ca_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-10-04 20:51+0100\n" "Last-Translator: Jordi Vilalta Prat <jvprat@jvprat.com>\n" "Language-Team: Catalan <scummvm-devel@lists.sf.net>\n" @@ -76,6 +76,11 @@ msgstr "Mostra el teclat" msgid "Remap keys" msgstr "Assigna les tecles" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "Commuta la pantalla completa" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "SelЗleccioneu una acciѓ a assignar" @@ -87,7 +92,7 @@ msgstr "Assigna" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -601,7 +606,7 @@ msgstr "Modes de tramat especials suportats per alguns jocs" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Mode pantalla completa" @@ -1021,11 +1026,11 @@ msgstr "Pausa" msgid "Skip line" msgstr "Salta la lэnia" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Error al executar el joc:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "No s'ha pogut trobar cap motor capaч d'executar el joc seleccionat" @@ -1903,7 +1908,7 @@ msgstr "Vola a la dreta" msgid "Fly to lower right" msgstr "Vola avall i a la dreta" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1912,7 +1917,7 @@ msgstr "" "El suport de MIDI natiu requereix l'actualitzaciѓ Roland de LucasArts,\n" "perђ no s'ha trobat %s. S'utilitzarр AdLib." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1923,7 +1928,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1934,7 +1939,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1945,7 +1950,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1995,11 +2000,11 @@ msgid "Cutscene file '%s' not found!" msgstr "No s'ha trobat el fitxer d'escena '%s'!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "No s'ha pogut carregar l'estat del joc del fitxer." -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "No s'ha pogut desar l'estat del joc al fitxer." @@ -2268,11 +2273,11 @@ msgstr "Emulador d'Apple II GS (NO IMPLEMENTAT)" msgid "C64 Audio Emulator" msgstr "Emulador d'рudio C64" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "Iniciant l'Emulador de MT-32" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "Emulador de MT-32" @@ -2288,15 +2293,20 @@ msgstr "Emulador d'IBM PCjr" msgid "Keymap:" msgstr "Assignacions de teclat:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr " (Actiu)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr " (Actiu)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr " (Global)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr " (Joc)" @@ -2392,6 +2402,30 @@ msgstr "Mode Touchpad activat." msgid "Touchpad mode disabled." msgstr "Mode Touchpad desactivat." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Clic esquerre" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "Element mig esquerre" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Clic dret" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" msgstr "Amaga ScummVM" @@ -2423,12 +2457,12 @@ msgid "Normal (no scaling)" msgstr "Normal (no escalat)" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "S'ha activat la correcciѓ de la relaciѓ d'aspecte" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "S'ha desactivat la correcciѓ de la relaciѓ d'aspecte" @@ -2437,7 +2471,7 @@ msgid "Active graphics filter:" msgstr "Filtre de grрfics actiu:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Mode de finestra" @@ -2461,11 +2495,11 @@ msgstr "Mode de vэdeo actual" msgid "Current scale" msgstr "Escala actual" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Mode de filtre actiu: Lineal" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Mode de filtre actiu: Prђxim" @@ -2489,19 +2523,6 @@ msgstr "Esquerra" msgid "Right" msgstr "Dreta" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Clic esquerre" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Clic dret" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2864,11 +2885,11 @@ msgstr "Mostra el teclat numшric" msgid "Control Mouse" msgstr "Controla el ratolэ" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Clicat activat" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Clicat desactivat" diff --git a/po/cs_CZ.po b/po/cs_CZ.po index ac91c69a76..433a6f620c 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.4.0git\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-12-27 17:46+0100\n" "Last-Translator: Zbynьk Schwarz <zbynek.schwarz@gmail.com>\n" "Language-Team: \n" @@ -80,6 +80,11 @@ msgstr "Zobrazit klсvesnici" msgid "Remap keys" msgstr "Pјemapovat klсvesy" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "Zapnout celou obrazovku" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Zvolte шinnost k mapovсnэ" @@ -91,7 +96,7 @@ msgstr "Mapovat" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -598,7 +603,7 @@ msgstr "Speciсlnэ reОimy chvьnэ podporovanщ nьkter§mi hrami" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "ReОim celщ obrazovky" @@ -1011,11 +1016,11 @@ msgstr "Pauza" msgid "Skip line" msgstr "Pјeskoшit јсdek" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Chyba pјi spuЙtьnэ hry:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Nelze nalщzt Осdnщ jсdro schopnщ vybranou hru spustit" @@ -1892,7 +1897,7 @@ msgstr "Letьt doprava" msgid "Fly to lower right" msgstr "Letьt doprava dolљ" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1901,7 +1906,7 @@ msgstr "" "Pјirozenс podpora MIDI vyОaduje Aktualizaci Roland od LucasArts,\n" "ale %s chybэ. Mэsto toho je pouОit AdLib." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1912,7 +1917,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1923,7 +1928,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1934,7 +1939,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1984,11 +1989,11 @@ msgid "Cutscene file '%s' not found!" msgstr "Soubor videa '%s' nenalezen'" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "Nelze naшэst stav hry ze souboru." -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "Nelze uloОit stav hry do souboru." @@ -2248,11 +2253,11 @@ msgstr "Apple II GS Emulсtor (NENЭ ZAVEDEN)" msgid "C64 Audio Emulator" msgstr "Emulсtor zvuku C64" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "Zavсdэm MT-32 Emulсtor" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "MT-32 Emulсtor" @@ -2268,15 +2273,20 @@ msgstr "IBM PCjr Emulсtor" msgid "Keymap:" msgstr "Mapa Klсves:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr "(Aktivnэ)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr "(Aktivnэ)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr "(Globсlnэ)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr "(Hra)" @@ -2372,6 +2382,30 @@ msgstr "Touchpad reОim zapnut" msgid "Touchpad mode disabled." msgstr "Touchpad reОim vypnut" +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Levщ Kliknutэ" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "PoloОka vlevo uprostјed" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Pravщ kliknutэ" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" msgstr "Skr§t ScummVM" @@ -2403,12 +2437,12 @@ msgid "Normal (no scaling)" msgstr "Normсlnэ (bez zmьny velikosti)" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "Povolena korekce pomьru stran" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "Zakсzсna korekce pomьru stran" @@ -2417,7 +2451,7 @@ msgid "Active graphics filter:" msgstr "Aktivnэ grafick§ filtr:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "ReОim do okna" @@ -2441,11 +2475,11 @@ msgstr "Souшasn§ reОim obrazu" msgid "Current scale" msgstr "Souшasnс velikost" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Aktivnэ reОim filtru: Lineсrnэ" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Aktivnэ reОim filtru: NejbliОЙэ" @@ -2469,19 +2503,6 @@ msgstr "Doleva" msgid "Right" msgstr "Doprava" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Levщ Kliknutэ" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Pravщ kliknutэ" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2846,11 +2867,11 @@ msgstr "Zobrazit Klсvesnici" msgid "Control Mouse" msgstr "Ovlсdсnэ MyЙi" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Kliknutэ Povoleno" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Kliknutэ Zakсzсno" diff --git a/po/da_DA.po b/po/da_DA.po index c1f2aae0a7..e31affb0f7 100644 --- a/po/da_DA.po +++ b/po/da_DA.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-01-08 22:53+0100\n" "Last-Translator: Steffen Nyeland <steffen@nyeland.dk>\n" "Language-Team: Steffen Nyeland <steffen@nyeland.dk>\n" @@ -76,6 +76,11 @@ msgstr "Vis tastatur" msgid "Remap keys" msgstr "Kortlцg taster" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "Skift fuldskцrm" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Vцlg en handling at kortlцgge" @@ -87,7 +92,7 @@ msgstr "Kortlцg" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -347,7 +352,7 @@ msgstr "~A~fslut" #: gui/launcher.cpp:578 backends/platform/sdl/macosx/appmenu_osx.mm:96 msgid "Quit ScummVM" -msgstr "Afslut ScummVM" +msgstr "Slut ScummVM" #: gui/launcher.cpp:579 msgid "A~b~out..." @@ -597,7 +602,7 @@ msgstr "Speciel farvereduceringstilstand understјttet a nogle spil" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Fuldskцrms tilstand" @@ -1009,11 +1014,11 @@ msgstr "Pause" msgid "Skip line" msgstr "Spring linje over" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Fejl ved kјrsel af spil:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Kunne ikke finde nogen motor istand til at afvikle det valgte spil" @@ -1892,14 +1897,14 @@ msgstr "Flyv til hјjre" msgid "Fly to lower right" msgstr "Flyv nederst til hјjre" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1910,7 +1915,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1921,7 +1926,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1932,7 +1937,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1980,7 +1985,7 @@ msgid "Cutscene file '%s' not found!" msgstr "" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 #, fuzzy msgid "Failed to load game state from file." msgstr "" @@ -1988,7 +1993,7 @@ msgstr "" "\n" "%s" -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 #, fuzzy msgid "Failed to save game state to file." msgstr "" @@ -2230,12 +2235,12 @@ msgstr "Apple II GS emulator (IKKE IMPLEMENTERET)" msgid "C64 Audio Emulator" msgstr "C64 lyd emulator" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 #, fuzzy msgid "Initializing MT-32 Emulator" msgstr "Initialisere MT-32 emulator" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "MT-32 emulator" @@ -2251,15 +2256,20 @@ msgstr "IBM PCjr emulator" msgid "Keymap:" msgstr "Tasteoversigt:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr " (Aktiv)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr " (Aktiv)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr " (Global)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr " (Spil)" @@ -2357,28 +2367,51 @@ msgstr "Pegeplade tilstand aktiveret." msgid "Touchpad mode disabled." msgstr "Pegeplade tilstand deaktiveret." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Venstre klik" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "Midterste hјjre punkt" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Hјjre klik" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 #, fuzzy msgid "Hide ScummVM" -msgstr "Afslut ScummVM" +msgstr "Skjul ScummVM" #: backends/platform/sdl/macosx/appmenu_osx.mm:83 msgid "Hide Others" -msgstr "" +msgstr "Skjul andre" #: backends/platform/sdl/macosx/appmenu_osx.mm:88 msgid "Show All" -msgstr "" +msgstr "Vis alle" #: backends/platform/sdl/macosx/appmenu_osx.mm:110 #: backends/platform/sdl/macosx/appmenu_osx.mm:121 -#, fuzzy msgid "Window" -msgstr "Windows MIDI" +msgstr "Vindue" #: backends/platform/sdl/macosx/appmenu_osx.mm:115 msgid "Minimize" -msgstr "" +msgstr "Minimer" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" @@ -2390,13 +2423,13 @@ msgid "Normal (no scaling)" msgstr "Normal (ingen skalering)" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Skift billedformat korrektion" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Skift billedformat korrektion" @@ -2407,7 +2440,7 @@ msgid "Active graphics filter:" msgstr "Skift mellem grafik filtre" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 #, fuzzy msgid "Windowed mode" msgstr "Rendere tilstand:" @@ -2433,11 +2466,11 @@ msgstr "Aktuel videotilstand:" msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "" @@ -2461,19 +2494,6 @@ msgstr "Venstre" msgid "Right" msgstr "Hјjre" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Venstre klik" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Hјjre klik" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2848,11 +2868,11 @@ msgstr "Vis tastatur" msgid "Control Mouse" msgstr "" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "" diff --git a/po/de_DE.po b/po/de_DE.po index e92f4238b6..e62f81de4d 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.4.0git\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2012-01-29 21:11+0100\n" "Last-Translator: Simon Sawatzki <SimSaw@gmx.de>\n" "Language-Team: Simon Sawatzki <SimSaw@gmx.de> (Lead), Lothar Serra Mari " @@ -78,6 +78,11 @@ msgstr "Tastatur anzeigen" msgid "Remap keys" msgstr "Tasten neu zuweisen" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "Vollbild-/Fenster-Modus" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Eine Aktion zum Zuweisen auswфhlen" @@ -89,7 +94,7 @@ msgstr "Zuweisen" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -603,7 +608,7 @@ msgstr "" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Vollbildmodus" @@ -1026,11 +1031,11 @@ msgstr "Pause" msgid "Skip line" msgstr "Zeile ќberspringen" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Fehler beim Ausfќhren des Spiels:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Konnte keine Spiel-Engine finden, die dieses Spiel starten kann." @@ -1915,7 +1920,7 @@ msgstr "Nach rechts fliegen" msgid "Fly to lower right" msgstr "Nach unten rechts fliegen" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1924,7 +1929,7 @@ msgstr "" "Systemeigene MIDI-мnterstќtzung erfordert das Roland-Upgrade von LucasArts,\n" "aber %s fehlt. Stattdessen wird AdLib verwendet." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1935,7 +1940,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1946,7 +1951,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1957,7 +1962,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2008,11 +2013,11 @@ msgid "Cutscene file '%s' not found!" msgstr "Zwischensequenz \"%s\" nicht gefunden!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "Konnte Spielstand aus Datei nicht laden." -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "Konnte Spielstand nicht in Datei speichern." @@ -2278,11 +2283,11 @@ msgstr "Apple-II-GS-Emulator (NICHT INTEGRIERT)" msgid "C64 Audio Emulator" msgstr "C64-Audio-Emulator" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "MT-32-Emulator wird gestartet" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "MT-32-Emulation" @@ -2298,15 +2303,20 @@ msgstr "IBM-PCjr-Emulator" msgid "Keymap:" msgstr "Tasten-Layout:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr " (Aktiv)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr " (Aktiv)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr " (Global)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr " (Spiel)" @@ -2402,17 +2412,41 @@ msgstr "Touchpad-Modus aktiviert." msgid "Touchpad mode disabled." msgstr "Touchpad-Modus ausgeschaltet." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Linksklick" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "Mittlerer linker Gegenstand" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Rechtsklick" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" -msgstr "ScummVM verbergen" +msgstr "ScummVM ausblenden" #: backends/platform/sdl/macosx/appmenu_osx.mm:83 msgid "Hide Others" -msgstr "Andere verbergen" +msgstr "Andere ausblenden" #: backends/platform/sdl/macosx/appmenu_osx.mm:88 msgid "Show All" -msgstr "Alles zeigen" +msgstr "Alle einblenden" #: backends/platform/sdl/macosx/appmenu_osx.mm:110 #: backends/platform/sdl/macosx/appmenu_osx.mm:121 @@ -2421,7 +2455,7 @@ msgstr "Fenster" #: backends/platform/sdl/macosx/appmenu_osx.mm:115 msgid "Minimize" -msgstr "Minimieren" +msgstr "Im Dock ablegen" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" @@ -2433,12 +2467,12 @@ msgid "Normal (no scaling)" msgstr "Normal ohn.Skalieren" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "Seitenverhфltniskorrektur an" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "Seitenverhфltniskorrektur aus" @@ -2447,7 +2481,7 @@ msgid "Active graphics filter:" msgstr "Aktiver Grafikfilter:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Fenstermodus" @@ -2471,11 +2505,11 @@ msgstr "Aktueller Grafikmodus" msgid "Current scale" msgstr "Aktueller Vergrіпerungsfaktor" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Aktiver Filtermodus: linear" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Aktiver Filtermodus: nфchste Nachbarn" @@ -2499,19 +2533,6 @@ msgstr "Links" msgid "Right" msgstr "Rechts" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Linksklick" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Rechtsklick" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2876,11 +2897,11 @@ msgstr "Ziffernblock zeigen" msgid "Control Mouse" msgstr "Maus steuern" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Klicken aktiviert" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Klicken deaktiviert" diff --git a/po/es_ES.po b/po/es_ES.po index 5472df2ae2..64274ceb24 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.4.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-10-23 21:53+0100\n" "Last-Translator: Tomсs Maidagan\n" "Language-Team: \n" @@ -76,6 +76,11 @@ msgstr "Mostrar el teclado" msgid "Remap keys" msgstr "Asignar teclas" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "Activar pantalla completa" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Elige la acciѓn a asociar" @@ -87,7 +92,7 @@ msgstr "Asignar" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -347,7 +352,7 @@ msgstr "~S~alir" #: gui/launcher.cpp:578 backends/platform/sdl/macosx/appmenu_osx.mm:96 msgid "Quit ScummVM" -msgstr "Cerrar ScummVM" +msgstr "Salir de ScummVM" #: gui/launcher.cpp:579 msgid "A~b~out..." @@ -597,7 +602,7 @@ msgstr "Modos especiales de expansiѓn soportados por algunos juegos" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Pantalla completa" @@ -1016,11 +1021,11 @@ msgstr "Pausar" msgid "Skip line" msgstr "Saltar frase" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Error al ejecutar el juego:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "No se ha podido encontrar ningњn motor capaz de ejecutar el juego" @@ -1898,7 +1903,7 @@ msgstr "Volar a la derecha" msgid "Fly to lower right" msgstr "Volar abajo y a la derecha" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1907,7 +1912,7 @@ msgstr "" "El soporte MIDI nativo requiere la actualizaciѓn Roland de LucasArts,\n" "pero %s no estс disponible. Se usarс AdLib." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1918,7 +1923,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1929,7 +1934,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1940,7 +1945,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1990,11 +1995,11 @@ msgid "Cutscene file '%s' not found!" msgstr "No se ha encontrado el vэdeo '%s'" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "Fallo al cargar el estado del juego desde el archivo." -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "Fallo al guardar el estado del juego en el archivo." @@ -2262,11 +2267,11 @@ msgstr "Emulador de Apple II GS (NO IMPLEMENTADO)" msgid "C64 Audio Emulator" msgstr "Emulador de C64 Audio" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "Iniciando el emulador de MT-32" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "Emulador de MT-32" @@ -2282,15 +2287,20 @@ msgstr "Emulador de IBM PCjr" msgid "Keymap:" msgstr "Asignaciѓn de teclas:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr "(Activa)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr "(Activa)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr "(General)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr "(Juego)" @@ -2386,9 +2396,33 @@ msgstr "Modo Touchpad activado." msgid "Touchpad mode disabled." msgstr "Modo Touchpad desactivado." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Clic izquierdo" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "Objeto izquierdo del medio" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Clic derecho" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" -msgstr "Oculta ScummVM" +msgstr "Ocultar ScummVM" #: backends/platform/sdl/macosx/appmenu_osx.mm:83 msgid "Hide Others" @@ -2417,12 +2451,12 @@ msgid "Normal (no scaling)" msgstr "Normal" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "Activar la correcciѓn de aspecto" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "Desactivar la correcciѓn de aspecto" @@ -2431,7 +2465,7 @@ msgid "Active graphics filter:" msgstr "Filtro de grсficos activo:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Modo ventana" @@ -2455,11 +2489,11 @@ msgstr "Modo de vэdeo actual" msgid "Current scale" msgstr "Escala actual" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Modo de filtro activo: lineal" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Modo de filtro activo: el mсs cercano" @@ -2483,19 +2517,6 @@ msgstr "Izquierda" msgid "Right" msgstr "Derecha" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Clic izquierdo" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Clic derecho" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2859,11 +2880,11 @@ msgstr "Mostrar el teclado numщrico" msgid "Control Mouse" msgstr "Control del ratѓn" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Clic activado" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Clic desactivado" diff --git a/po/fr_FR.po b/po/fr_FR.po index c3f767599a..2523293efe 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-10-23 14:52+0100\n" "Last-Translator: Thierry Crozat <criezy@scummvm.org>\n" "Language-Team: French <scummvm-devel@lists.sf.net>\n" @@ -77,6 +77,10 @@ msgstr "Afficher le clavier" msgid "Remap keys" msgstr "Changer l'affectation des touches" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +msgid "Toggle FullScreen" +msgstr "Basculer en plein щcran" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Sщlectionnez une action р affecter" @@ -88,7 +92,7 @@ msgstr "Affecter" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -600,7 +604,7 @@ msgstr "Mode spщcial de tramage supportщ par certains jeux" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Plein щcran" @@ -1022,11 +1026,11 @@ msgstr "Mettre en pause" msgid "Skip line" msgstr "Passer la phrase" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Erreur lors de l'щxщcution du jeu:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Impossible de trouver un moteur pour exщcuter le jeu sщlectionnщ" @@ -1381,9 +1385,8 @@ msgid "Refer to your Loom(TM) manual for help." msgstr "" #: engines/scumm/dialogs.cpp:658 -#, fuzzy msgid "Standard" -msgstr "Standard (16bpp)" +msgstr "Standard" #: engines/scumm/dialogs.cpp:659 msgid "Practice" @@ -1906,7 +1909,7 @@ msgstr "Voler vers la droite" msgid "Fly to lower right" msgstr "Voler vers la bas р droite" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1915,7 +1918,7 @@ msgstr "" "Support MIDI natif requiшre la mise р jour Roland de LucasArt,\n" "mais %s manque. Utilise AdLib р la place." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1926,7 +1929,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1937,7 +1940,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1948,7 +1951,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1999,11 +2002,11 @@ msgid "Cutscene file '%s' not found!" msgstr "Fichier de sщquence '%s' non trouvщ!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "Щchec du chargement de l'щtat du jeu depuis le disque." -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "Щchec de l'enregistrement de l'щtat du jeu sur le disque." @@ -2017,57 +2020,49 @@ msgstr "Щchec de la sauvegarde." #: engines/kyra/lol.cpp:478 msgid "Attack 1" -msgstr "" +msgstr "Attaque 1" #: engines/kyra/lol.cpp:479 msgid "Attack 2" -msgstr "" +msgstr "Attaque 2" #: engines/kyra/lol.cpp:480 msgid "Attack 3" -msgstr "" +msgstr "Attaque 3" #: engines/kyra/lol.cpp:481 msgid "Move Forward" -msgstr "" +msgstr "Avancer" #: engines/kyra/lol.cpp:482 msgid "Move Back" -msgstr "" +msgstr "Reculer" #: engines/kyra/lol.cpp:483 -msgid "Slide Left" -msgstr "" +msgstr "Faire un pas vers la Gauche" #: engines/kyra/lol.cpp:484 -#, fuzzy -msgid "Slide Right" -msgstr "Droite" +msgstr "Faire un pas vers la Droite" #: engines/kyra/lol.cpp:485 -#, fuzzy msgid "Turn Left" -msgstr "Щteindre" +msgstr "Tourner vers la Gauche" #: engines/kyra/lol.cpp:486 -#, fuzzy msgid "Turn Right" -msgstr "Droit" +msgstr "Tourner vers la Droite" #: engines/kyra/lol.cpp:487 -#, fuzzy msgid "Rest" -msgstr "Charger" +msgstr "Se Reposer" #: engines/kyra/lol.cpp:488 -#, fuzzy msgid "Options" -msgstr "~O~ptions" +msgstr "Options" #: engines/kyra/lol.cpp:489 -#, fuzzy msgid "Choose Spell" -msgstr "Choisir" +msgstr "Choisir un Sort" #: engines/kyra/sound_midi.cpp:475 msgid "" @@ -2270,11 +2265,11 @@ msgstr "Щmulateur Apple II GS (PAS IMPLЩMENTЩ)" msgid "C64 Audio Emulator" msgstr "Щmulateur C64 Audio" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "Initialisation de l'Щmulateur MT-32" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "Щmulateur MT-32" @@ -2290,15 +2285,20 @@ msgstr "Щmulateur IBM PCjr" msgid "Keymap:" msgstr "Affectation des touches:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr "(Actif)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr "(Actif)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr "(Global)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr "(Jeu)" @@ -2394,17 +2394,40 @@ msgstr "Mode touchpad activщ" msgid "Touchpad mode disabled." msgstr "Mode touchpad dщsactivщ" +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "Mode Clic" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Clic Gauche" + +#: backends/platform/maemo/maemo.cpp:187 +msgid "Middle Click" +msgstr "Clic Milieu" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Clic Droit" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" -msgstr "Cacher ScummVM" +msgstr "Masquer ScummVM" #: backends/platform/sdl/macosx/appmenu_osx.mm:83 msgid "Hide Others" -msgstr "Masquer les Autres" +msgstr "Masquer les autres" #: backends/platform/sdl/macosx/appmenu_osx.mm:88 msgid "Show All" -msgstr "Tout Afficher" +msgstr "Tout afficher" #: backends/platform/sdl/macosx/appmenu_osx.mm:110 #: backends/platform/sdl/macosx/appmenu_osx.mm:121 @@ -2413,7 +2436,7 @@ msgstr "Fenъtre" #: backends/platform/sdl/macosx/appmenu_osx.mm:115 msgid "Minimize" -msgstr "Minimiser" +msgstr "Placer dans le Dock" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" @@ -2425,12 +2448,12 @@ msgid "Normal (no scaling)" msgstr "Normal" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "Activer la correction du rapport d'aspect" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "Dщsactiver la correction du rapport d'aspect" @@ -2439,7 +2462,7 @@ msgid "Active graphics filter:" msgstr "Mode graphique actif:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Mode Fenъtre" @@ -2463,11 +2486,11 @@ msgstr "Mode vidщo actuel" msgid "Current scale" msgstr "Щchelle actuelle" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Filtre actif: Linщaire" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Filtre actif: Plus proche" @@ -2491,19 +2514,6 @@ msgstr "Gauche" msgid "Right" msgstr "Droite" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Clic Gauche" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Clic Droit" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2868,11 +2878,11 @@ msgstr "Afficher le clavier" msgid "Control Mouse" msgstr "Contrєles la Souris" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Clic Activщ" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Clic Dщsactivщ" diff --git a/po/hu_HU.po b/po/hu_HU.po index 96cdefc8d9..b4802eacba 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -7,14 +7,14 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" -"PO-Revision-Date: 2011-12-31 08:50+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" +"PO-Revision-Date: 2012-02-17 07:10+0100\n" "Last-Translator: Gruby <grubycza@hotmail.com>\n" "Language-Team: Hungarian\n" -"Language: Magyar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-2\n" "Content-Transfer-Encoding: 8bit\n" +"Language: Magyar\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "X-Poedit-Language: Hungarian\n" "X-Poedit-Country: HUNGARY\n" @@ -80,6 +80,10 @@ msgstr "Billentyћzet beсllэtсsok" msgid "Remap keys" msgstr "Billentyћk сtсllэtсsa" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +msgid "Toggle FullScreen" +msgstr "Teljeskщpernyѕ kapcsolѓ" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Vсlassz mћveletet a kiosztсshoz" @@ -91,7 +95,7 @@ msgstr "Kiosztсs" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -599,7 +603,7 @@ msgstr "Nщhсny jсtщk tсmogatja a speciсlis сrnyalсsi mѓdokat" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Teljeskщpernyѕs mѓd:" @@ -1010,11 +1014,11 @@ msgstr "Szќnet" msgid "Skip line" msgstr "Sor сtlщpщse" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Hiba a jсtщk futtatсsakor:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Nem talсlhatѓ olyan jсtщkmotor ami a vсlasztott jсtщkot tсmogatja" @@ -1890,7 +1894,7 @@ msgstr "Jobbra repќlщs" msgid "Fly to lower right" msgstr "Jobbra le repќlщs" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1899,7 +1903,7 @@ msgstr "" "Native MIDI tсmogatсshoz kell a Roland Upgrade a LucasArts-tѓl,\n" "a %s hiсnyzik. AdLib-ot hasznсlok helyette." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1910,7 +1914,7 @@ msgstr "" "\n" "%s fсjlba nem sikerќlt" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1921,7 +1925,7 @@ msgstr "" "\n" "%s fсjlbѓl nem sikerќlt" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1932,7 +1936,7 @@ msgstr "" "\n" "%s fсjlba elkщszќlt" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1982,11 +1986,11 @@ msgid "Cutscene file '%s' not found!" msgstr "'%s' сtvezetѕ fсjl nem talсlhatѓ" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "Jсtщkсllсs betіltщse fсjlbѓl nem sikerќlt." -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "Jсtщkсllсs mentщse fсjlba nem sikerќlt." @@ -2244,11 +2248,11 @@ msgstr "Apple II GS Emulсtor (NEM TСMOGATOTT)" msgid "C64 Audio Emulator" msgstr "C64 Audio Emulсtor" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "MT-32 Emulсtor inicializсlсsa" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "MT-32 Emulсtor" @@ -2264,15 +2268,19 @@ msgstr "IBM PCjr Emulсtor" msgid "Keymap:" msgstr "Billentyћzet kiosztсs:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +msgid " (Effective)" +msgstr " (Tщnyleges)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr " (Aktэv)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr " (Globсlis)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr " (Jсtщk)" @@ -2368,6 +2376,29 @@ msgstr "Touchpad mѓd engedщlyezve." msgid "Touchpad mode disabled." msgstr "Touchpad mѓd letiltva." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "Kattintсs Mѓd" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Bal katt" + +#: backends/platform/maemo/maemo.cpp:187 +msgid "Middle Click" +msgstr "Kіzщpsѕ katt" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Jobb katt" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" msgstr "ScummVM elrejtщse" @@ -2399,12 +2430,12 @@ msgid "Normal (no scaling)" msgstr "Normсl (nincs сtmщretezщs)" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "Mщretarсny korrekciѓ engedщlyezve" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "Mщretarсny korrekciѓ letiltva" @@ -2413,7 +2444,7 @@ msgid "Active graphics filter:" msgstr "Aktэv grafikus szћrѕk:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Ablakos mѓd" @@ -2437,11 +2468,11 @@ msgstr "Jelenlegi videѓmѓd" msgid "Current scale" msgstr "Aktuсlis mщretezщs" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Aktэv filter mѓd: Lineсris" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Aktэv filter mѓd: Kіzelэtѕ" @@ -2465,19 +2496,6 @@ msgstr "Bal" msgid "Right" msgstr "Jobb" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Bal katt" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Jobb katt" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2838,11 +2856,11 @@ msgstr "Kщzi billentyћzet" msgid "Control Mouse" msgstr "Egщr irсnyitсs" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Kattintсs engedve" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Kattintсs tiltva" diff --git a/po/it_IT.po b/po/it_IT.po index b988f78599..43ae6cb60d 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-10-08 17:29+0100\n" "Last-Translator: Matteo 'Maff' Angelino <matteo.maff at gmail dot com>\n" "Language-Team: Italian\n" @@ -76,6 +76,11 @@ msgstr "Mostra tastiera" msgid "Remap keys" msgstr "Riprogramma tasti" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "Attiva / disattiva schermo intero" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Scegli un'azione da mappare" @@ -87,7 +92,7 @@ msgstr "Mappa" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -346,7 +351,7 @@ msgstr "C~h~iudi" #: gui/launcher.cpp:578 backends/platform/sdl/macosx/appmenu_osx.mm:96 msgid "Quit ScummVM" -msgstr "Chiudi ScummVM" +msgstr "Esci da ScummVM" #: gui/launcher.cpp:579 msgid "A~b~out..." @@ -599,7 +604,7 @@ msgstr "Modalitр di resa grafica speciali supportate da alcuni giochi" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Modalitр a schermo intero" @@ -1016,11 +1021,11 @@ msgstr "Pausa" msgid "Skip line" msgstr "Salta battuta" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Errore nell'esecuzione del gioco:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "" "Impossibile trovare un motore in grado di eseguire il gioco selezionato" @@ -1899,7 +1904,7 @@ msgstr "Vola a destra" msgid "Fly to lower right" msgstr "Vola in basso a destra" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1908,7 +1913,7 @@ msgstr "" "Il supporto nativo MIDI richiede il Roland Upgrade della LucasArts,\n" "ma %s non ш presente. Verrр usato AdLib." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1919,7 +1924,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1930,7 +1935,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1941,7 +1946,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1992,11 +1997,11 @@ msgid "Cutscene file '%s' not found!" msgstr "File della scena di intermezzo '%s' non trovato!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "Impossibile caricare il gioco dal file." -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "Impossibile salvare il gioco nel file." @@ -2265,11 +2270,11 @@ msgstr "Emulatore Apple II GS (NON IMPLEMENTATO)" msgid "C64 Audio Emulator" msgstr "Emulatore audio C64" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "Avvio in corso dell'emulatore MT-32" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "Emulatore MT-32" @@ -2285,15 +2290,20 @@ msgstr "Emulatore IBM PCjr" msgid "Keymap:" msgstr "Mappa tasti:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr " (Attivo)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr " (Attivo)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr " (Globale)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr " (Gioco)" @@ -2389,17 +2399,41 @@ msgstr "Modalitр touchpad attivata." msgid "Touchpad mode disabled." msgstr "Modalitр touchpad disattivata." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Clic sinistro" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "Oggetto al centro a sinistra" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Clic destro" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" msgstr "Nascondi ScummVM" #: backends/platform/sdl/macosx/appmenu_osx.mm:83 msgid "Hide Others" -msgstr "Nascondi altri" +msgstr "Nascondi altre" #: backends/platform/sdl/macosx/appmenu_osx.mm:88 msgid "Show All" -msgstr "Mostra tutti" +msgstr "Mostra tutte" #: backends/platform/sdl/macosx/appmenu_osx.mm:110 #: backends/platform/sdl/macosx/appmenu_osx.mm:121 @@ -2408,7 +2442,7 @@ msgstr "Finestra" #: backends/platform/sdl/macosx/appmenu_osx.mm:115 msgid "Minimize" -msgstr "Minimizza" +msgstr "Contrai" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" @@ -2420,12 +2454,12 @@ msgid "Normal (no scaling)" msgstr "Normale (no ridim.)" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "Correzione proporzioni attivata" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "Correzione proporzioni disattivata" @@ -2434,7 +2468,7 @@ msgid "Active graphics filter:" msgstr "Filtro grafico attivo:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Modalitр finestra" @@ -2458,11 +2492,11 @@ msgstr "Modalitр visualizzazione attuale" msgid "Current scale" msgstr "Dimensioni attuali" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Modalitр filtro attiva: Lineare" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Modalitр filtro attiva: Piљ vicino" @@ -2486,19 +2520,6 @@ msgstr "Sinistra" msgid "Right" msgstr "Destra" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Clic sinistro" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Clic destro" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2865,11 +2886,11 @@ msgstr "Mostra tastiera" msgid "Control Mouse" msgstr "" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "" diff --git a/po/nb_NO.po b/po/nb_NO.po index 981c5b0425..a4cf94e210 100644 --- a/po/nb_NO.po +++ b/po/nb_NO.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-04-25 22:56+0100\n" "Last-Translator: Einar Johan T. Sјmхen <einarjohants@gmail.com>\n" "Language-Team: somaen <einarjohants@gmail.com>\n" @@ -80,6 +80,11 @@ msgstr "Vis tastatur" msgid "Remap keys" msgstr "Omkoble taster" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "Veksle fullskjerm" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Velg en handling for kobling" @@ -91,7 +96,7 @@ msgstr "Koble" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -601,7 +606,7 @@ msgstr "Spesiel dithering-modus stјttet av enkelte spill" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Fullskjermsmodus" @@ -1013,11 +1018,11 @@ msgstr "Pause" msgid "Skip line" msgstr "Hopp over linje" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Problem ved kjјring av spill:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Kunne ikke finne noen motor som kunne kjјre det valgte spillet" @@ -1889,14 +1894,14 @@ msgstr "Fly til hјyre" msgid "Fly to lower right" msgstr "Fly til nedre hјyre" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1907,7 +1912,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1918,7 +1923,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1929,7 +1934,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1980,7 +1985,7 @@ msgid "Cutscene file '%s' not found!" msgstr "" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 #, fuzzy msgid "Failed to load game state from file." msgstr "" @@ -1988,7 +1993,7 @@ msgstr "" "\n" "%s" -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 #, fuzzy msgid "Failed to save game state to file." msgstr "" @@ -2230,12 +2235,12 @@ msgstr "Apple II GS Emulator (IKKE IMPLEMENTERT)" msgid "C64 Audio Emulator" msgstr "C64 Lydemulator" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 #, fuzzy msgid "Initializing MT-32 Emulator" msgstr "Initialiserer MT-32-Emulator" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "MT-32 Emulator" @@ -2251,15 +2256,20 @@ msgstr "IBM PCjr Emulator" msgid "Keymap:" msgstr "Tastkobling:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr " (Aktiv)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr " (Aktiv)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr " (Global)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr " (Spill)" @@ -2357,28 +2367,51 @@ msgstr "Touchpad-modus aktivert." msgid "Touchpad mode disabled." msgstr "Touchpad-modus deaktivert." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Venstreklikk" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "Midtre venstre gjenstand" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Hјyreklikk" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 #, fuzzy msgid "Hide ScummVM" -msgstr "Avslutt ScummVM" +msgstr "Skjul ScummVM" #: backends/platform/sdl/macosx/appmenu_osx.mm:83 msgid "Hide Others" -msgstr "" +msgstr "Skjul andre" #: backends/platform/sdl/macosx/appmenu_osx.mm:88 msgid "Show All" -msgstr "" +msgstr "Vis alle" #: backends/platform/sdl/macosx/appmenu_osx.mm:110 #: backends/platform/sdl/macosx/appmenu_osx.mm:121 -#, fuzzy msgid "Window" -msgstr "Windows MIDI" +msgstr "Vindu" #: backends/platform/sdl/macosx/appmenu_osx.mm:115 msgid "Minimize" -msgstr "" +msgstr "Minimer" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" @@ -2390,13 +2423,13 @@ msgid "Normal (no scaling)" msgstr "Normal (ingen skalering)" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Veksle aspekt-rate korrigering" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Veksle aspekt-rate korrigering" @@ -2407,7 +2440,7 @@ msgid "Active graphics filter:" msgstr "Bytt grafikkfiltre" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 #, fuzzy msgid "Windowed mode" msgstr "Tegnemodus:" @@ -2433,11 +2466,11 @@ msgstr "Nхvцrende videomodus:" msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "" @@ -2461,19 +2494,6 @@ msgstr "Venstre" msgid "Right" msgstr "Hјyre" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Venstreklikk" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Hјyreklikk" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2849,11 +2869,11 @@ msgstr "Vis tastatur" msgid "Control Mouse" msgstr "" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "" diff --git a/po/nn_NO.po b/po/nn_NO.po index feec7ab264..7865d6c504 100644 --- a/po/nn_NO.po +++ b/po/nn_NO.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-04-25 23:07+0100\n" "Last-Translator: Einar Johan T. Sјmхen <einarjohants@gmail.com>\n" "Language-Team: somaen <einarjohants@gmail.com>\n" @@ -80,6 +80,11 @@ msgstr "Syn Tastatur" msgid "Remap keys" msgstr "Omkople tastar" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "Veksle fullskjerm" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Vel ei handling for kopling:" @@ -91,7 +96,7 @@ msgstr "Kople" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -600,7 +605,7 @@ msgstr "Spesielle dithering-modus som stјttast av nokre spel" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Fullskjermsmodus" @@ -1010,11 +1015,11 @@ msgstr "Pause" msgid "Skip line" msgstr "Hopp over linje" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Feil under kјyring av spel:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Kunne ikkje finne nokon motor som kunne kјyre det velde spelet." @@ -1889,14 +1894,14 @@ msgstr "Fly til hјgre" msgid "Fly to lower right" msgstr "Fly til nedre hјgre" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1904,7 +1909,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1912,7 +1917,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1920,7 +1925,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1971,11 +1976,11 @@ msgid "Cutscene file '%s' not found!" msgstr "" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "" -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "" @@ -2206,12 +2211,12 @@ msgstr "Apple II GS Emulator (IKKJE IMPLEMENTERT)" msgid "C64 Audio Emulator" msgstr "C64 Lydemulator" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 #, fuzzy msgid "Initializing MT-32 Emulator" msgstr "Initialiserar MT-32-emulator" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "MT-32 Emulator" @@ -2227,15 +2232,20 @@ msgstr "IBM PCjr Emulator" msgid "Keymap:" msgstr "Tastkopling:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr " (Aktivt)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr " (Aktivt)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr " (Global)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr " (Spel)" @@ -2331,6 +2341,30 @@ msgstr "" msgid "Touchpad mode disabled." msgstr "" +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Venstreklikk" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "Midtre venstre gjenstand" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Hјgreklikk" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 #, fuzzy msgid "Hide ScummVM" @@ -2346,9 +2380,8 @@ msgstr "" #: backends/platform/sdl/macosx/appmenu_osx.mm:110 #: backends/platform/sdl/macosx/appmenu_osx.mm:121 -#, fuzzy msgid "Window" -msgstr "Windows MIDI" +msgstr "" #: backends/platform/sdl/macosx/appmenu_osx.mm:115 msgid "Minimize" @@ -2364,13 +2397,13 @@ msgid "Normal (no scaling)" msgstr "Normal (inga skalering)" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 #, fuzzy msgid "Enabled aspect ratio correction" msgstr "Veksle aspekt-korrigering" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 #, fuzzy msgid "Disabled aspect ratio correction" msgstr "Veksle aspekt-korrigering" @@ -2381,7 +2414,7 @@ msgid "Active graphics filter:" msgstr "Veksle grafikkfiltre" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 #, fuzzy msgid "Windowed mode" msgstr "Teiknemodus:" @@ -2407,11 +2440,11 @@ msgstr "Gjeldende videomodus:" msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "" @@ -2435,19 +2468,6 @@ msgstr "Venstre" msgid "Right" msgstr "Hјgre" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Venstreklikk" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Hјgreklikk" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2820,11 +2840,11 @@ msgstr "Syn tastatur" msgid "Control Mouse" msgstr "" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "" diff --git a/po/pl_PL.po b/po/pl_PL.po index ac5da144e5..36aad63180 100644 --- a/po/pl_PL.po +++ b/po/pl_PL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-10-24 21:14+0100\n" "Last-Translator: MichaГ ZiБbkowski <mziab@o2.pl>\n" "Language-Team: Grajpopolsku.pl <grajpopolsku@gmail.com>\n" @@ -80,6 +80,11 @@ msgstr "WyЖwietl klawiaturъ" msgid "Remap keys" msgstr "Dostosuj klawisze" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "WГБcz/wyГБcz peГny ekran" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Wybierz akcjъ do przypisania" @@ -91,7 +96,7 @@ msgstr "Przypisz" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -357,7 +362,7 @@ msgstr "I~n~formacje..." #: gui/launcher.cpp:579 backends/platform/sdl/macosx/appmenu_osx.mm:70 msgid "About ScummVM" -msgstr "O ScummVM" +msgstr "KsiБПka ScummVM" #: gui/launcher.cpp:580 msgid "~O~ptions..." @@ -597,7 +602,7 @@ msgstr "Specjalne tryby ditheringu wspierane przez niektѓre gry" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "PeГny ekran" @@ -1012,11 +1017,11 @@ msgstr "Wstrzymaj" msgid "Skip line" msgstr "Pomiё liniъ" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "BГБd podczas uruchamiania gry:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Nie udaГo siъ znaleМц silnika zdolnego do uruchomienia zaznaczonej gry" @@ -1890,7 +1895,7 @@ msgstr "Leц w prawo" msgid "Fly to lower right" msgstr "Leц w dѓГ, w prawo" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1899,7 +1904,7 @@ msgstr "" "Natywne wsparcie MIDI wymaga aktualizacji Rolanda od LucasArts,\n" "ale brakuje %s. PrzeГБczam na tryb AdLib." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1910,7 +1915,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1921,7 +1926,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1932,7 +1937,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1982,11 +1987,11 @@ msgid "Cutscene file '%s' not found!" msgstr "Nie znaleziono pliku przerywnika '%s'!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "Nie udaГo siъ wczytaц stanu gry z pliku." -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "Nie udaГo siъ zapisaц stanu gry do pliku." @@ -2253,11 +2258,11 @@ msgstr "Emulator Apple II GS (NIE ZAIMPLEMENTOWANY)" msgid "C64 Audio Emulator" msgstr "Emulator dМwiъku C64" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "Inicjalizacja emulatora MT-32" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "Emulator MT-32" @@ -2273,15 +2278,20 @@ msgstr "Emulator IBM PCjr" msgid "Keymap:" msgstr "Klawisze:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr " (Aktywny)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr " (Aktywny)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr " (Globalny)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr " (Gra)" @@ -2377,13 +2387,37 @@ msgstr "Tryb touchpada wГБczony." msgid "Touchpad mode disabled." msgstr "Tryb touchpada wyГБczony." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Klikniъcie LPM" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "Przedmiot na Жrodku, z lewej" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Klikniъcie PPM" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" -msgstr "Schowaj ScummVM" +msgstr "Ukryj ScummVM" #: backends/platform/sdl/macosx/appmenu_osx.mm:83 msgid "Hide Others" -msgstr "Schowaj pozostaГe" +msgstr "Ukryj pozostaГe" #: backends/platform/sdl/macosx/appmenu_osx.mm:88 msgid "Show All" @@ -2396,7 +2430,7 @@ msgstr "Okno" #: backends/platform/sdl/macosx/appmenu_osx.mm:115 msgid "Minimize" -msgstr "Minimalizuj" +msgstr "Miniaturka" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" @@ -2408,12 +2442,12 @@ msgid "Normal (no scaling)" msgstr "ZwykГy (bez skalowania)" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "WГБczono korekcjъ formatu obrazu" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "WyГБczono korekcjъ formatu obrazu" @@ -2422,7 +2456,7 @@ msgid "Active graphics filter:" msgstr "Aktywny filtr graficzny:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Okno" @@ -2446,11 +2480,11 @@ msgstr "Obecny tryb wideo" msgid "Current scale" msgstr "Aktualne powiъkszenie" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Aktywny tryb filtru: dwuliniowy" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Aktywny tryb filtru: najbliПszy sБsiad" @@ -2474,19 +2508,6 @@ msgstr "W lewo" msgid "Right" msgstr "W prawo" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Klikniъcie LPM" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Klikniъcie PPM" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2847,11 +2868,11 @@ msgstr "PokaП klawiaturъ" msgid "Control Mouse" msgstr "Steruj myszkБ" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Klikanie wГБczone" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Klikanie wyГБczone" diff --git a/po/pt_BR.po b/po/pt_BR.po index 860bc55152..34ce904f25 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-10-21 21:30-0300\n" "Last-Translator: Saulo Benigno <saulobenigno@gmail.com>\n" "Language-Team: ScummBR (www.scummbr.com) <scummbr@yahoo.com.br>\n" @@ -80,6 +80,11 @@ msgstr "Mostrar teclado" msgid "Remap keys" msgstr "Remapear teclas" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "Habilita Tela Cheia" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Selecione uma aчуo para mapear" @@ -91,7 +96,7 @@ msgstr "Mapear" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -605,7 +610,7 @@ msgstr "Modos especiais de dithering suportados por alguns jogos" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Modo Tela Cheia" @@ -1021,11 +1026,11 @@ msgstr "Pausar" msgid "Skip line" msgstr "Pula linha" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Erro ao executar o jogo:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "" "Nуo foi possэvel encontrar qualquer programa capaz de rodar o jogo " @@ -1906,7 +1911,7 @@ msgstr "Voar para direita" msgid "Fly to lower right" msgstr "Voar para direita inferior" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1916,7 +1921,7 @@ msgstr "" "LucasArts,\n" "mas %s estс faltando. Utilizando AdLib ao invщs." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1927,7 +1932,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1938,7 +1943,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1949,7 +1954,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -2000,14 +2005,14 @@ msgid "Cutscene file '%s' not found!" msgstr "Arquivo de vэdeo '%s' nуo encontrado!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "" "Falha ao carregar o estado do jogo a partir do arquivo:\n" "\n" "%s" -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "" "Falha ao salvar o estado do jogo para o arquivo:\n" @@ -2279,11 +2284,11 @@ msgstr "Emulador Apple II GS (NУO IMPLEMENTADO)" msgid "C64 Audio Emulator" msgstr "Emulador Som C64" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "Inicializando Emulador MT-32" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "Emulador MT-32" @@ -2299,15 +2304,20 @@ msgstr "Emulador IBM PCjr" msgid "Keymap:" msgstr "Mapa de Teclas:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr "(Ativo)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr "(Ativo)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr "(Global)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr "(Jogo)" @@ -2403,6 +2413,30 @@ msgstr "Modo Touchpad ligado." msgid "Touchpad mode disabled." msgstr "Modo Touchpad desligado." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Clique com o botуo esquerdo" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "Item do meio na esquerda" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Clique com o botуo direito" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" msgstr "Ocultar ScummVM" @@ -2413,7 +2447,7 @@ msgstr "Ocultar Outros" #: backends/platform/sdl/macosx/appmenu_osx.mm:88 msgid "Show All" -msgstr "Exibir Todos" +msgstr "Mostrar Tudo" #: backends/platform/sdl/macosx/appmenu_osx.mm:110 #: backends/platform/sdl/macosx/appmenu_osx.mm:121 @@ -2434,12 +2468,12 @@ msgid "Normal (no scaling)" msgstr "Normal (sem escala)" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "Correчуo de proporчуo habilitada" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "Correчуo de proporчуo desabilitada" @@ -2448,7 +2482,7 @@ msgid "Active graphics filter:" msgstr "Ativa os filtros grсficos" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Modo janela" @@ -2472,11 +2506,11 @@ msgstr "Modo de vэdeo atual" msgid "Current scale" msgstr "Escala atual" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Filtro de imagem ativo: Linear" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Filtro de imagem ativo: Nearest" @@ -2500,19 +2534,6 @@ msgstr "Esquerda" msgid "Right" msgstr "Direita" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Clique com o botуo esquerdo" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Clique com o botуo direito" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2876,11 +2897,11 @@ msgstr "Mostrar teclado" msgid "Control Mouse" msgstr "Controle do Mouse" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Clicando Habilitado" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Clicando Desabilitado" diff --git a/po/ru_RU.po b/po/ru_RU.po index 4254d5cc64..b14479069c 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" -"PO-Revision-Date: 2011-08-20 13:22+0200\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" +"PO-Revision-Date: 2012-02-16 13:09+0200+0200\n" "Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n" "Language-Team: Russian\n" "Language: Russian\n" @@ -78,6 +78,10 @@ msgstr "Показать клавиатуру" msgid "Remap keys" msgstr "Переназначить клавиши" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +msgid "Toggle FullScreen" +msgstr "Переключение на весь экран" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Выберите действие для назначения" @@ -89,7 +93,7 @@ msgstr "Назначить" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -348,7 +352,7 @@ msgstr "~В~ыход" #: gui/launcher.cpp:578 backends/platform/sdl/macosx/appmenu_osx.mm:96 msgid "Quit ScummVM" -msgstr "Выход из ScummVM" +msgstr "Завершить ScummVM" #: gui/launcher.cpp:579 msgid "A~b~out..." @@ -597,7 +601,7 @@ msgstr "Специальные режимы рендеринга, поддерживаемые некоторыми играми" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Полноэкранный режим" @@ -1018,11 +1022,11 @@ msgstr "Пауза" msgid "Skip line" msgstr "Пропустить строку" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Ошибка запуска игры:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Не могу найти движок для запуска выбранной игры" @@ -1370,24 +1374,23 @@ msgstr "Озвучка и текст" #: engines/scumm/dialogs.cpp:653 msgid "Select a Proficiency Level." -msgstr "" +msgstr "Выберите уровень сложности." #: engines/scumm/dialogs.cpp:655 msgid "Refer to your Loom(TM) manual for help." -msgstr "" +msgstr "За помощью обратитесь к инстукции Loom(TM)" #: engines/scumm/dialogs.cpp:658 -#, fuzzy msgid "Standard" -msgstr "Стандартный растеризатор (16bpp)" +msgstr "Стандартный" #: engines/scumm/dialogs.cpp:659 msgid "Practice" -msgstr "" +msgstr "Практикант" #: engines/scumm/dialogs.cpp:660 msgid "Expert" -msgstr "" +msgstr "Эксперт" #: engines/scumm/help.cpp:73 msgid "Common keyboard commands:" @@ -1902,7 +1905,7 @@ msgstr "Лететь вправо" msgid "Fly to lower right" msgstr "Лететь вправо-вниз" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1911,7 +1914,7 @@ msgstr "" "Режим \"родного\" MIDI требует обновление Roland Upgrade от\n" "LucasArts, но не хватает %s. Переключаюсь на AdLib." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1922,7 +1925,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1933,7 +1936,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1944,7 +1947,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1994,11 +1997,11 @@ msgid "Cutscene file '%s' not found!" msgstr "Файл заставки '%s' не найден!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "Не удалось загрузить сохранённую игру из файла." -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "Не удалось сохранить игру в файл." @@ -2012,57 +2015,51 @@ msgstr "Не удалось сохранить игру" #: engines/kyra/lol.cpp:478 msgid "Attack 1" -msgstr "" +msgstr "Атака 1" #: engines/kyra/lol.cpp:479 msgid "Attack 2" -msgstr "" +msgstr "Атака 2" #: engines/kyra/lol.cpp:480 msgid "Attack 3" -msgstr "" +msgstr "Атака 3" #: engines/kyra/lol.cpp:481 msgid "Move Forward" -msgstr "" +msgstr "Идти вперёд" #: engines/kyra/lol.cpp:482 msgid "Move Back" -msgstr "" +msgstr "Идти назад" #: engines/kyra/lol.cpp:483 msgid "Slide Left" -msgstr "" +msgstr "Скользить влево" #: engines/kyra/lol.cpp:484 -#, fuzzy msgid "Slide Right" -msgstr "Вправо" +msgstr "Скользить вправо" #: engines/kyra/lol.cpp:485 -#, fuzzy msgid "Turn Left" -msgstr "Выключить" +msgstr "Поворот налево" #: engines/kyra/lol.cpp:486 -#, fuzzy msgid "Turn Right" -msgstr "Курсор вправо" +msgstr "Поворот направо" #: engines/kyra/lol.cpp:487 -#, fuzzy msgid "Rest" -msgstr "Восствновить" +msgstr "Отдохнуть" #: engines/kyra/lol.cpp:488 -#, fuzzy msgid "Options" -msgstr "~О~пции" +msgstr "Опции" #: engines/kyra/lol.cpp:489 -#, fuzzy msgid "Choose Spell" -msgstr "Выбрать" +msgstr "Выбрать заклинание" #: engines/kyra/sound_midi.cpp:475 msgid "" @@ -2265,11 +2262,11 @@ msgstr "Эмулятор Apple II GS (отсутствует)" msgid "C64 Audio Emulator" msgstr "Эмулятор звука C64" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "Настраиваю эмулятор MT-32" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "Эмулятор MT-32" @@ -2285,15 +2282,19 @@ msgstr "Эмулятор IBM PCjr" msgid "Keymap:" msgstr "Таблица клавиш:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +msgid " (Effective)" +msgstr " (Действующая)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr " (Активная)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr " (Глобальная)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr " (Игры)" @@ -2389,17 +2390,40 @@ msgstr "Режим тачпада включен." msgid "Touchpad mode disabled." msgstr "Режим тачпада выключен." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "Режим щелчка" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Левый щелчок" + +#: backends/platform/maemo/maemo.cpp:187 +msgid "Middle Click" +msgstr "Средний щелчок" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Правый щелчок" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" -msgstr "Спрятать ScummVM" +msgstr "Скрыть ScummVM" #: backends/platform/sdl/macosx/appmenu_osx.mm:83 msgid "Hide Others" -msgstr "Спрятать Другие" +msgstr "Скрыть остальные" #: backends/platform/sdl/macosx/appmenu_osx.mm:88 msgid "Show All" -msgstr "Показать всё" +msgstr "Показать все" #: backends/platform/sdl/macosx/appmenu_osx.mm:110 #: backends/platform/sdl/macosx/appmenu_osx.mm:121 @@ -2408,7 +2432,7 @@ msgstr "Окно" #: backends/platform/sdl/macosx/appmenu_osx.mm:115 msgid "Minimize" -msgstr "Минимизировать" +msgstr "Убрать в Dock" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45 msgid "Normal (no scaling)" @@ -2420,12 +2444,12 @@ msgid "Normal (no scaling)" msgstr "Без увеличения" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "Коррекция соотношения сторон включена" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "Коррекция соотношения сторон выключена" @@ -2434,7 +2458,7 @@ msgid "Active graphics filter:" msgstr "Активный графический фильтр:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Оконный режим" @@ -2458,11 +2482,11 @@ msgstr "Текущий видеорежим" msgid "Current scale" msgstr "Текущий масштаб" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Активный режим фильтра: Линейный" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Активный режим фильтра: Ближайший" @@ -2486,19 +2510,6 @@ msgstr "Влево" msgid "Right" msgstr "Вправо" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Левый щелчок" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Правый щелчок" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2859,11 +2870,11 @@ msgstr "Показать клавиатуру" msgid "Control Mouse" msgstr "Управление мышью" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Щелчки включены" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Щелчки выключены" diff --git a/po/scummvm.pot b/po/scummvm.pot index 7676fa6fa1..750d5fec1d 100644 --- a/po/scummvm.pot +++ b/po/scummvm.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.5.0git\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -77,6 +77,10 @@ msgstr "" msgid "Remap keys" msgstr "" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +msgid "Toggle FullScreen" +msgstr "" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "" @@ -88,7 +92,7 @@ msgstr "" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -591,7 +595,7 @@ msgstr "" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "" @@ -996,11 +1000,11 @@ msgstr "" msgid "Skip line" msgstr "" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "" @@ -1861,14 +1865,14 @@ msgstr "" msgid "Fly to lower right" msgstr "" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" "but %s is missing. Using AdLib instead." msgstr "" -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1876,7 +1880,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1884,7 +1888,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1892,7 +1896,7 @@ msgid "" "%s" msgstr "" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1939,11 +1943,11 @@ msgid "Cutscene file '%s' not found!" msgstr "" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "" -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "" @@ -2165,11 +2169,11 @@ msgstr "" msgid "C64 Audio Emulator" msgstr "" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "" @@ -2185,15 +2189,19 @@ msgstr "" msgid "Keymap:" msgstr "" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +msgid " (Effective)" +msgstr "" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr "" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr "" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr "" @@ -2289,6 +2297,29 @@ msgstr "" msgid "Touchpad mode disabled." msgstr "" +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:187 +msgid "Middle Click" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" msgstr "" @@ -2320,12 +2351,12 @@ msgid "Normal (no scaling)" msgstr "" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "" @@ -2334,7 +2365,7 @@ msgid "Active graphics filter:" msgstr "" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "" @@ -2358,11 +2389,11 @@ msgstr "" msgid "Current scale" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "" @@ -2386,19 +2417,6 @@ msgstr "" msgid "Right" msgstr "" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2757,10 +2775,10 @@ msgstr "" msgid "Control Mouse" msgstr "" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "" diff --git a/po/se_SE.po b/po/se_SE.po index b7fef60fad..41bda1dd8a 100644 --- a/po/se_SE.po +++ b/po/se_SE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" "PO-Revision-Date: 2011-11-27 19:00+0100\n" "Last-Translator: Hampus Flink <hampus.flink@gmail.com>\n" "Language-Team: \n" @@ -80,6 +80,11 @@ msgstr "Visa tangentbord" msgid "Remap keys" msgstr "Stфll in tangenter" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +#, fuzzy +msgid "Toggle FullScreen" +msgstr "Fullskфrmslфge" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Vфlj en handling att stфlla in" @@ -91,7 +96,7 @@ msgstr "Stфll in" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -601,7 +606,7 @@ msgstr "Speciella gitterlфgen stіdda av vissa spel" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Fullskфrmslфge" @@ -1016,11 +1021,11 @@ msgstr "Paus" msgid "Skip line" msgstr "Skippa rad" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Fel under kіrning av spel:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Kunde inte hitta en motor kapabel till att kіra det valda spelet" @@ -1899,7 +1904,7 @@ msgstr "Flyg хt hіger" msgid "Fly to lower right" msgstr "Flyg хt nedre hіger" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1908,7 +1913,7 @@ msgstr "" "Stіd fіr Native MIDI krфver Roland-uppdateringen frхn LucasArts,\n" "men %s saknas. Anvфnder AdLib istфllet." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1919,7 +1924,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1930,7 +1935,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1941,7 +1946,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1991,11 +1996,11 @@ msgid "Cutscene file '%s' not found!" msgstr "Filmscensfilen '%s' hittades ej!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "Kunde inte lфsa spardata frхn filen" -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "Kunde inte skriva spardata till filen." @@ -2256,11 +2261,11 @@ msgstr "Apple II GS-emulator (INTE IMPLEMENTERAD)" msgid "C64 Audio Emulator" msgstr "C64 ljudemulator" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "Initialiserar MT-32 emulator" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "MT-32 emulator" @@ -2276,15 +2281,20 @@ msgstr "IBM PCjr-emulator" msgid "Keymap:" msgstr "Tangenter:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +#, fuzzy +msgid " (Effective)" +msgstr "(Aktiv)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr "(Aktiv)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr "(Global)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr "(Spel)" @@ -2380,13 +2390,37 @@ msgstr "Touchpad-lфge aktiverat." msgid "Touchpad mode disabled." msgstr "Touchpad-lфge inaktiverat." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Vфnsterklick" + +#: backends/platform/maemo/maemo.cpp:187 +#, fuzzy +msgid "Middle Click" +msgstr "Mellersta vфnstra fіremхlet" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Hіgerklick" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" -msgstr "Dіlj ScummVM" +msgstr "Gіm ScummVM" #: backends/platform/sdl/macosx/appmenu_osx.mm:83 msgid "Hide Others" -msgstr "Dіlj іvriga" +msgstr "Gіm іvriga" #: backends/platform/sdl/macosx/appmenu_osx.mm:88 msgid "Show All" @@ -2411,12 +2445,12 @@ msgid "Normal (no scaling)" msgstr "Normalt (ingen skalning)" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "Korrektion av bildfіrhхllande pх" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "Korrektion av bildfіrhхllande av" @@ -2425,7 +2459,7 @@ msgid "Active graphics filter:" msgstr "Aktivt grafikfilter:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Fіnsterlфge" @@ -2449,11 +2483,11 @@ msgstr "Nuvarande visningslфge" msgid "Current scale" msgstr "Nuvarande skala" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Aktivt filterlфge: Linjфrt" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Aktivt filterlфge: Nфrmast" @@ -2477,19 +2511,6 @@ msgstr "Vфnster" msgid "Right" msgstr "Hіger" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Vфnsterklick" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Hіgerklick" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2853,11 +2874,11 @@ msgstr "Visa tangentbord" msgid "Control Mouse" msgstr "Kontrollera musen" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Klickning aktiverad" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Klickning deaktiverad" diff --git a/po/uk_UA.po b/po/uk_UA.po index cb29d20165..db0c7153a6 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: ScummVM 1.3.0svn\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" -"POT-Creation-Date: 2012-01-28 21:48+0100\n" -"PO-Revision-Date: 2011-08-20 13:30+0200\n" +"POT-Creation-Date: 2012-02-16 12:32+0200\n" +"PO-Revision-Date: 2012-02-16 13:09+0200\n" "Last-Translator: Eugene Sandulenko\n" "Language-Team: Ukrainian\n" "Language: Ukrainian\n" @@ -78,6 +78,10 @@ msgstr "Показати клавіатуру" msgid "Remap keys" msgstr "Перепризначити клавіші" +#: gui/gui-manager.cpp:127 base/main.cpp:295 +msgid "Toggle FullScreen" +msgstr "Перемкнути повноекранний режим" + #: gui/KeysDialog.h:36 gui/KeysDialog.cpp:145 msgid "Choose an action to map" msgstr "Виберіть дію для призначення" @@ -89,7 +93,7 @@ msgstr "Призначити" #: gui/KeysDialog.cpp:42 gui/launcher.cpp:320 gui/launcher.cpp:959 #: gui/launcher.cpp:963 gui/massadd.cpp:91 gui/options.cpp:1222 #: engines/engine.cpp:361 engines/engine.cpp:372 engines/scumm/dialogs.cpp:192 -#: engines/scumm/scumm.cpp:1784 engines/agos/animation.cpp:551 +#: engines/scumm/scumm.cpp:1775 engines/agos/animation.cpp:551 #: engines/groovie/script.cpp:420 engines/sky/compact.cpp:131 #: engines/sky/compact.cpp:141 engines/sword1/animation.cpp:449 #: engines/sword1/animation.cpp:459 engines/sword1/animation.cpp:465 @@ -598,7 +602,7 @@ msgstr "Спеціальні режими растрування, які підтримують деякі ігри" #: gui/options.cpp:761 #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2248 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:476 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:472 msgid "Fullscreen mode" msgstr "Повноекранний режим" @@ -1015,11 +1019,11 @@ msgstr "Пауза" msgid "Skip line" msgstr "Пропустити рядок" -#: base/main.cpp:445 +#: base/main.cpp:455 msgid "Error running game:" msgstr "Помилка запуску гри:" -#: base/main.cpp:469 +#: base/main.cpp:479 msgid "Could not find any engine capable of running the selected game" msgstr "Не можу знайти движок для запуску вибраної гри" @@ -1365,24 +1369,23 @@ msgstr "Озвучка та текст" #: engines/scumm/dialogs.cpp:653 msgid "Select a Proficiency Level." -msgstr "" +msgstr "Оберіть режим складності." #: engines/scumm/dialogs.cpp:655 msgid "Refer to your Loom(TM) manual for help." -msgstr "" +msgstr "За допомогою звертайтеся до інструкції Loom(TM)." #: engines/scumm/dialogs.cpp:658 -#, fuzzy msgid "Standard" -msgstr "Стандартний растеризатор (16bpp)" +msgstr "Стандартний" #: engines/scumm/dialogs.cpp:659 msgid "Practice" -msgstr "" +msgstr "Практика" #: engines/scumm/dialogs.cpp:660 msgid "Expert" -msgstr "" +msgstr "Експерт" #: engines/scumm/help.cpp:73 msgid "Common keyboard commands:" @@ -1897,7 +1900,7 @@ msgstr "Летіти направо" msgid "Fly to lower right" msgstr "Летіти донизу направо" -#: engines/scumm/scumm.cpp:1782 +#: engines/scumm/scumm.cpp:1773 #, c-format msgid "" "Native MIDI support requires the Roland Upgrade from LucasArts,\n" @@ -1906,7 +1909,7 @@ msgstr "" "Режим \"рідного\" MIDI потребує поновлення Roland Upgrade від\n" "LucasArts, проте %s відсутній. Перемикаюсь на AdLib." -#: engines/scumm/scumm.cpp:2272 engines/agos/saveload.cpp:189 +#: engines/scumm/scumm.cpp:2271 engines/agos/saveload.cpp:189 #, c-format msgid "" "Failed to save game state to file:\n" @@ -1917,7 +1920,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2279 engines/agos/saveload.cpp:154 +#: engines/scumm/scumm.cpp:2278 engines/agos/saveload.cpp:154 #, c-format msgid "" "Failed to load game state from file:\n" @@ -1928,7 +1931,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2291 engines/agos/saveload.cpp:197 +#: engines/scumm/scumm.cpp:2290 engines/agos/saveload.cpp:197 #, c-format msgid "" "Successfully saved game state in file:\n" @@ -1939,7 +1942,7 @@ msgstr "" "\n" "%s" -#: engines/scumm/scumm.cpp:2506 +#: engines/scumm/scumm.cpp:2505 msgid "" "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To " "play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' " @@ -1989,11 +1992,11 @@ msgid "Cutscene file '%s' not found!" msgstr "Файл заставки '%s' не знайдено!" #: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283 -#: engines/tinsel/saveload.cpp:482 +#: engines/tinsel/saveload.cpp:500 msgid "Failed to load game state from file." msgstr "Не вдалося завантажити стан гри з файлу." -#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:495 +#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:513 msgid "Failed to save game state to file." msgstr "Не вдалося зберегти стан гри у файл." @@ -2007,57 +2010,51 @@ msgstr "Не вдалося записати гру" #: engines/kyra/lol.cpp:478 msgid "Attack 1" -msgstr "" +msgstr "Атака 1" #: engines/kyra/lol.cpp:479 msgid "Attack 2" -msgstr "" +msgstr "Атака 2" #: engines/kyra/lol.cpp:480 msgid "Attack 3" -msgstr "" +msgstr "Атака 3" #: engines/kyra/lol.cpp:481 msgid "Move Forward" -msgstr "" +msgstr "Рухатись уперед" #: engines/kyra/lol.cpp:482 msgid "Move Back" -msgstr "" +msgstr "Рухатись назад" #: engines/kyra/lol.cpp:483 msgid "Slide Left" -msgstr "" +msgstr "Ковзати наліво" #: engines/kyra/lol.cpp:484 -#, fuzzy msgid "Slide Right" -msgstr "Направо" +msgstr "Ковзати направо" #: engines/kyra/lol.cpp:485 -#, fuzzy msgid "Turn Left" -msgstr "Вимкнути" +msgstr "Повернутися наліво" #: engines/kyra/lol.cpp:486 -#, fuzzy msgid "Turn Right" -msgstr "Курсор направо" +msgstr "Повернутися направо" #: engines/kyra/lol.cpp:487 -#, fuzzy msgid "Rest" -msgstr "Відновити" +msgstr "Відпочити" #: engines/kyra/lol.cpp:488 -#, fuzzy msgid "Options" -msgstr "~Н~алаштування" +msgstr "Налаштування" #: engines/kyra/lol.cpp:489 -#, fuzzy msgid "Choose Spell" -msgstr "Вибрати" +msgstr "Вибрати закляття" #: engines/kyra/sound_midi.cpp:475 msgid "" @@ -2258,11 +2255,11 @@ msgstr "Apple II GS Емулятор (НЕ РЕАЛІЗОВАНО)" msgid "C64 Audio Emulator" msgstr "C64 Аудіо Емулятор" -#: audio/softsynth/mt32.cpp:329 +#: audio/softsynth/mt32.cpp:293 msgid "Initializing MT-32 Emulator" msgstr "Налаштовую емулятор MT-32" -#: audio/softsynth/mt32.cpp:543 +#: audio/softsynth/mt32.cpp:512 msgid "MT-32 Emulator" msgstr "Емулятор MT-32" @@ -2278,15 +2275,19 @@ msgstr "Емулятор IBM PCjr" msgid "Keymap:" msgstr "Мапа клавіш:" -#: backends/keymapper/remap-dialog.cpp:64 +#: backends/keymapper/remap-dialog.cpp:66 +msgid " (Effective)" +msgstr " (Ефективна)" + +#: backends/keymapper/remap-dialog.cpp:106 msgid " (Active)" msgstr " (Активна)" -#: backends/keymapper/remap-dialog.cpp:98 +#: backends/keymapper/remap-dialog.cpp:116 msgid " (Global)" msgstr " (Глобальна)" -#: backends/keymapper/remap-dialog.cpp:108 +#: backends/keymapper/remap-dialog.cpp:126 msgid " (Game)" msgstr " (Ігри)" @@ -2382,6 +2383,29 @@ msgstr "Режим тачпаду увімкнено." msgid "Touchpad mode disabled." msgstr "Режим тачпаду вимкнено." +#: backends/platform/maemo/maemo.cpp:178 +msgid "Click Mode" +msgstr "Режим кліків" + +#: backends/platform/maemo/maemo.cpp:184 +#: backends/platform/symbian/src/SymbianActions.cpp:42 +#: backends/platform/wince/CEActionsPocket.cpp:60 +#: backends/platform/wince/CEActionsSmartphone.cpp:43 +#: backends/platform/bada/form.cpp:281 +msgid "Left Click" +msgstr "Лівий клік" + +#: backends/platform/maemo/maemo.cpp:187 +msgid "Middle Click" +msgstr "Середній клік" + +#: backends/platform/maemo/maemo.cpp:190 +#: backends/platform/symbian/src/SymbianActions.cpp:43 +#: backends/platform/wince/CEActionsSmartphone.cpp:44 +#: backends/platform/bada/form.cpp:273 +msgid "Right Click" +msgstr "Правий клік" + #: backends/platform/sdl/macosx/appmenu_osx.mm:78 msgid "Hide ScummVM" msgstr "Сховати ScummVM" @@ -2413,12 +2437,12 @@ msgid "Normal (no scaling)" msgstr "Без збільшення" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2147 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:537 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:533 msgid "Enabled aspect ratio correction" msgstr "Корекцію співвідношення сторін увімкнено" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2153 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:538 msgid "Disabled aspect ratio correction" msgstr "Корекцію співвідношення сторін вимкнено" @@ -2427,7 +2451,7 @@ msgid "Active graphics filter:" msgstr "Поточний графічний фільтр:" #: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2250 -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:481 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:477 msgid "Windowed mode" msgstr "Віконний режим" @@ -2451,11 +2475,11 @@ msgstr "Поточний відеорежим" msgid "Current scale" msgstr "Поточний масштаб" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:562 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:558 msgid "Active filter mode: Linear" msgstr "Активний режим фільтрації: Лінійний" -#: backends/graphics/openglsdl/openglsdl-graphics.cpp:564 +#: backends/graphics/openglsdl/openglsdl-graphics.cpp:560 msgid "Active filter mode: Nearest" msgstr "Активний режим фільтрації: Найближче" @@ -2479,19 +2503,6 @@ msgstr "Наліво" msgid "Right" msgstr "Направо" -#: backends/platform/symbian/src/SymbianActions.cpp:42 -#: backends/platform/wince/CEActionsPocket.cpp:60 -#: backends/platform/wince/CEActionsSmartphone.cpp:43 -#: backends/platform/bada/form.cpp:281 -msgid "Left Click" -msgstr "Лівий клік" - -#: backends/platform/symbian/src/SymbianActions.cpp:43 -#: backends/platform/wince/CEActionsSmartphone.cpp:44 -#: backends/platform/bada/form.cpp:273 -msgid "Right Click" -msgstr "Правий клік" - #: backends/platform/symbian/src/SymbianActions.cpp:46 #: backends/platform/wince/CEActionsSmartphone.cpp:47 msgid "Zone" @@ -2854,11 +2865,11 @@ msgstr "Показати клавіатуру" msgid "Control Mouse" msgstr "Управління мишею" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Enabled" msgstr "Кліки увімкнено" -#: backends/events/maemosdl/maemosdl-events.cpp:129 +#: backends/events/maemosdl/maemosdl-events.cpp:192 msgid "Clicking Disabled" msgstr "Кліки вимкнено" diff --git a/test/common/pack.h b/test/common/pack.h index 724457f838..f62b31e9dc 100644 --- a/test/common/pack.h +++ b/test/common/pack.h @@ -15,7 +15,7 @@ struct TestStruct { #include <common/pack-end.h> // END STRUCT PACKING -#define OFFS(type,item) (((ptrdiff_t)(&((type*)42)->type::item))-42) +#define OFFS(type,item) (((ptrdiff_t)(&((type *)42)->type::item))-42) class PackTestSuite : public CxxTest::TestSuite { diff --git a/video/dxa_decoder.cpp b/video/dxa_decoder.cpp index ca62228178..7d1112a59c 100644 --- a/video/dxa_decoder.cpp +++ b/video/dxa_decoder.cpp @@ -318,7 +318,7 @@ void DXADecoder::decode13(int size) { for (uint32 by = 0; by < _curHeight; by += BLOCKH) { for (uint32 bx = 0; bx < _width; bx += BLOCKW) { uint8 type = *codeBuf++; - uint8 *b2 = (uint8*)_frameBuffer1 + bx + by * _width; + uint8 *b2 = (uint8 *)_frameBuffer1 + bx + by * _width; switch (type) { case 0: @@ -369,7 +369,7 @@ void DXADecoder::decode13(int size) { if (mbyte & 0x08) my = -my; - uint8 *b1 = (uint8*)_frameBuffer2 + (bx+mx) + (by+my) * _width; + uint8 *b1 = (uint8 *)_frameBuffer2 + (bx+mx) + (by+my) * _width; for (int yc = 0; yc < BLOCKH; yc++) { memcpy(b2, b1, BLOCKW); b1 += _width; @@ -385,7 +385,7 @@ void DXADecoder::decode13(int size) { for (int subBlock = 0; subBlock < 4; subBlock++) { int sx = bx + subX[subBlock], sy = by + subY[subBlock]; - b2 = (uint8*)_frameBuffer1 + sx + sy * _width; + b2 = (uint8 *)_frameBuffer1 + sx + sy * _width; switch (subMask & 0xC0) { // 00: skip case 0x00: @@ -413,7 +413,7 @@ void DXADecoder::decode13(int size) { if (mbyte & 0x08) my = -my; - uint8 *b1 = (uint8*)_frameBuffer2 + (sx+mx) + (sy+my) * _width; + uint8 *b1 = (uint8 *)_frameBuffer2 + (sx+mx) + (sy+my) * _width; for (int yc = 0; yc < BLOCKH / 2; yc++) { memcpy(b2, b1, BLOCKW / 2); b1 += _width; |