From cf657d09e84f41ff8234f26e6086c48dfb2e8fb4 Mon Sep 17 00:00:00 2001 From: strangerke Date: Thu, 10 Mar 2011 00:25:29 +0100 Subject: TOON: Janitorial: Suppress blanks at end of lines --- engines/toon/anim.cpp | 14 +++++++------- engines/toon/anim.h | 2 +- engines/toon/audio.cpp | 12 ++++++------ engines/toon/audio.h | 4 ++-- engines/toon/character.cpp | 10 +++++----- engines/toon/conversation.h | 4 ++-- engines/toon/drew.cpp | 2 +- engines/toon/flux.cpp | 2 +- engines/toon/font.cpp | 2 +- engines/toon/movie.cpp | 2 +- engines/toon/picture.cpp | 6 +++--- engines/toon/resource.cpp | 8 ++++---- engines/toon/script_func.cpp | 6 +++--- engines/toon/toon.cpp | 28 ++++++++++++++-------------- 14 files changed, 51 insertions(+), 51 deletions(-) (limited to 'engines/toon') diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp index 6d0d75f077..3ab69d8574 100644 --- a/engines/toon/anim.cpp +++ b/engines/toon/anim.cpp @@ -99,7 +99,7 @@ bool Animation::loadAnimation(Common::String file) { _frames[e]._data = new uint8[decompressedSize]; if (compressedSize < decompressedSize) { decompressLZSS(imageData, _frames[e]._data, decompressedSize); - } else { + } else { memcpy(_frames[e]._data, imageData, compressedSize); } } @@ -610,7 +610,7 @@ void AnimationInstance::setZ(int32 z, bool relative) { void AnimationInstance::setLayerZ(int32 z) { _layerZ = z; - if (_vm->getAnimationManager()->hasInstance(this)) + if (_vm->getAnimationManager()->hasInstance(this)) _vm->getAnimationManager()->updateInstance(this); } @@ -688,7 +688,7 @@ AnimationManager::AnimationManager(ToonEngine *vm) : _vm(vm) { bool AnimationManager::hasInstance(AnimationInstance* instance) { for (uint32 i = 0; i < _instances.size(); i++) { - if(_instances[i] == instance) + if(_instances[i] == instance) return true; } return false; @@ -704,12 +704,12 @@ void AnimationManager::addInstance(AnimationInstance *instance) { // if the instance already exists, we skip the add for (uint32 i = 0; i < _instances.size(); i++) { - if(_instances[i] == instance) + if(_instances[i] == instance) return; } - + int found = -1; - + // here we now do an ordered insert (closer to the original game) for (uint32 i = 0; i < _instances.size(); i++) { if (_instances[i]->getLayerZ() >= instance->getLayerZ()) { @@ -723,7 +723,7 @@ void AnimationManager::addInstance(AnimationInstance *instance) { } else { _instances.insert_at(found, instance); } - + } void AnimationManager::removeInstance(AnimationInstance *instance) { diff --git a/engines/toon/anim.h b/engines/toon/anim.h index d7f64ab687..dfb6842b0e 100644 --- a/engines/toon/anim.h +++ b/engines/toon/anim.h @@ -161,7 +161,7 @@ public: AnimationInstance *createNewInstance(AnimationInstanceType type); void addInstance(AnimationInstance *instance); void removeInstance(AnimationInstance *instance); - void updateInstance(AnimationInstance* instance); + void updateInstance(AnimationInstance* instance); void removeAllInstances(AnimationInstanceType type); void render(); void update(int32 timeIncrement); diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp index 3fd89d5f91..9f1c316469 100644 --- a/engines/toon/audio.cpp +++ b/engines/toon/audio.cpp @@ -48,7 +48,7 @@ AudioManager::AudioManager(ToonEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixe for (int32 i = 0; i < 16; i++) _channels[i] = NULL; - for (int32 i = 0; i < 4; i++) + for (int32 i = 0; i < 4; i++) _audioPacks[i] = NULL; for (int32 i = 0; i < 4; i++) { @@ -288,7 +288,7 @@ AudioStreamInstance::~AudioStreamInstance() { int AudioStreamInstance::readBuffer(int16 *buffer, const int numSamples) { debugC(5, kDebugAudio, "readBuffer(buffer, %d)", numSamples); - if(_stopped) + if(_stopped) return 0; handleFade(numSamples); @@ -427,7 +427,7 @@ void AudioStreamInstance::handleFade(int32 numSamples) { debugC(5, kDebugAudio, "handleFade(%d)", numSamples); // Fading enabled only for music - if (_soundType != Audio::Mixer::kMusicSoundType) + if (_soundType != Audio::Mixer::kMusicSoundType) return; int32 finalVolume = _volume; @@ -461,7 +461,7 @@ void AudioStreamInstance::handleFade(int32 numSamples) { _musicAttenuation = 250; } else { _musicAttenuation += numSamples >> 5; - if (_musicAttenuation > 1000) + if (_musicAttenuation > 1000) _musicAttenuation = 1000; } @@ -557,7 +557,7 @@ void AudioManager::startAmbientSFX(int32 id, int32 delay, int32 mode, int32 volu } } - if (found < 0) + if (found < 0) return; _ambientSFXs[found]._lastTimer = _vm->getOldMilli() - 1; @@ -622,7 +622,7 @@ void AudioManager::updateAmbientSFX() AudioAmbientSFX* ambient = &_ambientSFXs[i]; if (ambient->_enabled && (ambient->_channel < 0 || !(_channels[ambient->_channel] && _channels[ambient->_channel]->isPlaying()))) { if(ambient->_mode == 1) { - if (_vm->randRange(0, 32767) < ambient->_delay) { + if (_vm->randRange(0, 32767) < ambient->_delay) { ambient->_channel = playSFX(ambient->_id, ambient->_volume, false); } } else { diff --git a/engines/toon/audio.h b/engines/toon/audio.h index 19e4d9a354..5feae9c5a1 100644 --- a/engines/toon/audio.h +++ b/engines/toon/audio.h @@ -138,14 +138,14 @@ public: void playVoice(int32 id, bool genericVoice); int32 playSFX(int32 id, int volume, bool genericSFX); void stopCurrentVoice(); - void stopAllSfxs(); + void stopAllSfxs(); void setMusicVolume(int32 volume); void stopMusic(); void muteVoice(bool mute); void muteMusic(bool mute); void muteSfx(bool mute); bool isVoiceMuted() { return _voiceMuted; } - bool isMusicMuted() { return _musicMuted; } + bool isMusicMuted() { return _musicMuted; } bool isSfxMuted() { return _sfxMuted; } void startAmbientSFX(int32 id, int32 delay, int32 mode, int32 volume); diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp index f1f246e549..31af1513df 100644 --- a/engines/toon/character.cpp +++ b/engines/toon/character.cpp @@ -104,7 +104,7 @@ void Character::setFacing(int32 facing) { _lastWalkTime = _vm->getSystem()->getMillis(); if ((_facing - facing + 8) % 8 > (facing - _facing + 8) % 8) dir = 1; - else + else dir = -1; while (_facing != facing) { @@ -191,7 +191,7 @@ bool Character::walkTo(int32 newPosX, int32 newPosY) { _currentPathNodeCount = _vm->getPathFinding()->getPathNodeCount(); _currentPathNode = 0; stopSpecialAnim(); - + _lastWalkTime = _vm->getSystem()->getMillis(); _numPixelToWalk = 0; @@ -434,8 +434,8 @@ void Character::update(int32 timeIncrement) { if (_animScriptId != -1) _vm->getSceneAnimationScript(_animScriptId)->_frozenForConversation = true; - - + + // TODO setup backup // _animFlags |= 0x10; @@ -525,7 +525,7 @@ void Character::update(int32 timeIncrement) { //label78 - + #if 0 if (_id == 0) debug(" drew animation name %s / flag %d / frame %d", _specialAnim->_name, _animFlags, nextFrame); diff --git a/engines/toon/conversation.h b/engines/toon/conversation.h index 784c681055..0380210e02 100644 --- a/engines/toon/conversation.h +++ b/engines/toon/conversation.h @@ -33,10 +33,10 @@ namespace Toon { class Conversation { public: - int32 _enable; // 00 + int32 _enable; // 00 struct ConvState { - int32 _data2; // 04 + int32 _data2; // 04 int16 _data3; // 08 void *_data4; // 10 } state[10]; diff --git a/engines/toon/drew.cpp b/engines/toon/drew.cpp index eefb4b8efa..b2d271a417 100644 --- a/engines/toon/drew.cpp +++ b/engines/toon/drew.cpp @@ -111,7 +111,7 @@ void CharacterDrew::update(int32 timeIncrement) { _scale = _currentScale; } else if (_currentScale < _scale) { _scale -= timeIncrement * 2; - if (_scale < _currentScale) + if (_scale < _currentScale) _scale = _currentScale; } setPosition(_x, _y); diff --git a/engines/toon/flux.cpp b/engines/toon/flux.cpp index 2b5551732b..034332af56 100644 --- a/engines/toon/flux.cpp +++ b/engines/toon/flux.cpp @@ -96,7 +96,7 @@ int32 CharacterFlux::fixFacingForAnimation(int32 originalFacing, int32 animation if (!facingMask) break; } - + return finalFacing; } diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp index 53786f8617..8ce4d32c37 100644 --- a/engines/toon/font.cpp +++ b/engines/toon/font.cpp @@ -278,7 +278,7 @@ void FontRenderer::renderMultiLineText(int32 x, int32 y, Common::String origText const byte *line = lines[i]; curX = x - lineSize[i] / 2; _vm->addDirtyRect(curX + _vm->state()->_currentScrollValue, y, curX + lineSize[i] + _vm->state()->_currentScrollValue, curY + height); - + while (*line) { byte curChar = textToFont(*line); if (curChar != 32) _currentFont->drawFontFrame(_vm->getMainSurface(), curChar, curX + _vm->state()->_currentScrollValue, curY, _currentFontColor); diff --git a/engines/toon/movie.cpp b/engines/toon/movie.cpp index 68c09fb586..6d18d82954 100644 --- a/engines/toon/movie.cpp +++ b/engines/toon/movie.cpp @@ -56,7 +56,7 @@ bool ToonstruckSmackerDecoder::loadFile(const Common::String &filename) { return true; } - + return false; } diff --git a/engines/toon/picture.cpp b/engines/toon/picture.cpp index fce711717a..18701b7a48 100644 --- a/engines/toon/picture.cpp +++ b/engines/toon/picture.cpp @@ -32,7 +32,7 @@ namespace Toon { bool Picture::loadPicture(Common::String file, bool totalPalette /*= false*/) { debugC(1, kDebugPicture, "loadPicture(%s, %d)", file.c_str(), (totalPalette) ? 1 : 0); - + uint32 size = 0; uint8 *fileData = _vm->resources()->getFileData(file, &size); if (!fileData) @@ -222,7 +222,7 @@ void Picture::drawWithRectList(Graphics::Surface& surface, int32 x, int32 y, int } - + } void Picture::draw(Graphics::Surface &surface, int32 x, int32 y, int32 dx, int32 dy) { @@ -327,7 +327,7 @@ void Picture::drawLineOnMask(int32 x, int32 y, int32 x2, int32 y2, bool walkable int32 rx = bx >> 16; int32 ry = by >> 16; - if( rx >= 0 && rx < _width-1 && ry >= 0 && ry < _height) { // sanity check: some lines in the game + if( rx >= 0 && rx < _width-1 && ry >= 0 && ry < _height) { // sanity check: some lines in the game // were drawing outside the screen causing corruption if (!walkable) { _data[_width * ry + rx] &= 0xe0; diff --git a/engines/toon/resource.cpp b/engines/toon/resource.cpp index d635c5ab79..6c70b1598d 100644 --- a/engines/toon/resource.cpp +++ b/engines/toon/resource.cpp @@ -92,7 +92,7 @@ void Resources::addToCache(Common::String packName, Common::String fileName, uin } if (!bestEntry) break; - + free(bestEntry->_data); bestEntry->_data = 0; _cacheSize -= bestEntry->_size; @@ -109,7 +109,7 @@ void Resources::addToCache(Common::String packName, Common::String fileName, uin return; } } - + CacheEntry *entry = new CacheEntry(); entry->_packName = packName; entry->_fileName = fileName; @@ -175,7 +175,7 @@ uint8 *Resources::getFileData(Common::String fileName, uint32 *fileSize) { } for (uint32 i = 0; i < _pakFiles.size(); i++) { - + locFileData = _pakFiles[i]->getFileData(fileName, &locFileSize); if (locFileData) { *fileSize = locFileSize; @@ -238,7 +238,7 @@ uint8 *PakFile::getFileData(Common::String fileName, uint32 *fileSize) { if (file.open(_packName)) { *fileSize = _files[i]._size; file.seek(_files[i]._offset); - + // Use malloc() because that's what MemoryReadStream // uses to dispose of the memory when it's done. uint8 *buffer = (uint8 *)malloc(*fileSize); diff --git a/engines/toon/script_func.cpp b/engines/toon/script_func.cpp index 84225ec76b..4687b88af9 100644 --- a/engines/toon/script_func.cpp +++ b/engines/toon/script_func.cpp @@ -461,7 +461,7 @@ int32 ScriptFunc::sys_Cmd_Actor_Talks(EMCState *state) { } int32 ScriptFunc::sys_Cmd_Say_Lines(EMCState *state) { - + // WORKAROUND: In the scene 4 (Castle), if you click twice on the closed door, Drew disappears // the script makes him disappear for the custom animation and not reappear. if (_vm->state()->_currentScene == 4 && stackPos(1) == 562) { @@ -491,7 +491,7 @@ int32 ScriptFunc::sys_Cmd_Empty_Inventory(EMCState *state) { int32 ScriptFunc::sys_Cmd_Set_Anim_Scale_Size(EMCState *state) { int32 animID = stackPos(0); int32 scale = stackPos(1); - + SceneAnimation *sceneAnim = _vm->getSceneAnimation(animID); if (sceneAnim) { sceneAnim->_animInstance->setUseMask(true); @@ -939,7 +939,7 @@ int32 ScriptFunc::sys_Cmd_Init_Scene_Anim(EMCState *state) { sceneAnim->_animInstance->setAnimationRange(stackPos(11), stackPos(11)); sceneAnim->_animInstance->setFrame(stackPos(11)); - + debugC(0, 0xfff, "Init Anim %s %d %d %d %d %d %d %d %d %d %d %d %d %d\n", GetText(12, state), stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9), stackPos(10), stackPos(11), stackPos(12)); diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index b4335d7afd..45243ab81e 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -477,7 +477,7 @@ void ToonEngine::doMagnifierEffect() { for (int32 y = -12; y <= 12; y++) { for (int32 x = -12; x <= 12; x++) { int32 dist = y * y + x * x; - if (dist > 144) + if (dist > 144) continue; int32 destPitch = surface.pitch; uint8 *curRow = (uint8 *)surface.pixels + (posY + y) * destPitch + (posX + x); @@ -495,7 +495,7 @@ void ToonEngine::copyToVirtualScreen(bool updateScreen) { _cursorAnimationInstance->setPosition(_mouseX - 40 + state()->_currentScrollValue - _cursorOffsetX, _mouseY - 40 - _cursorOffsetY, 0, false); _cursorAnimationInstance->render(); } - + // Handle dirty rects here static int32 lastScroll = 0; @@ -510,7 +510,7 @@ void ToonEngine::copyToVirtualScreen(bool updateScreen) { Common::Rect rect = _oldDirtyRects[i]; rect.translate(-state()->_currentScrollValue,0); offX = 0; - if(rect.right <= 0) + if(rect.right <= 0) continue; if (rect.left < 0) { offX = -rect.left; @@ -526,7 +526,7 @@ void ToonEngine::copyToVirtualScreen(bool updateScreen) { Common::Rect rect = _dirtyRects[i]; rect.translate(-state()->_currentScrollValue,0); offX = 0; - if (rect.right <= 0) + if (rect.right <= 0) continue; if (rect.left < 0) { offX = -rect.left; @@ -663,7 +663,7 @@ bool ToonEngine::showMainmenu(bool &loadedGame) { } while (!clickRelease) { - + if(_dirtyAll) { mainmenuPicture->draw(*_mainSurface, 0, 0, 0, 0); addDirtyRect(0,0,640,400); @@ -881,7 +881,7 @@ ToonEngine::ToonEngine(OSystem *syst, const ADGameDescription *gameDescription) _inventoryIcons = NULL; _inventoryIconSlots = NULL; _genericTexts = NULL; - _audioManager = NULL; + _audioManager = NULL; _gameState = NULL; _locationDirNotVisited = NULL; @@ -936,7 +936,7 @@ ToonEngine::~ToonEngine() { _mainSurface->free(); delete _mainSurface; } - + delete[] _finalPalette; delete[] _backupPalette; delete[] _additionalPalette1; @@ -1028,7 +1028,7 @@ void ToonEngine::simpleUpdate(bool waitCharacterToTalk) { _audioManager->updateAmbientSFX(); render(); - + } void ToonEngine::fixPaletteEntries(uint8 *palette, int num) { @@ -1295,7 +1295,7 @@ void ToonEngine::loadScene(int32 SceneId, bool forGameLoad) { _gameState->_nextSpecialEnterX = -1; _gameState->_nextSpecialEnterY = -1; } - + _script->start(&_scriptState[0], 3); while (_script->run(&_scriptState[0])) @@ -2211,7 +2211,7 @@ void ToonEngine::haveAConversation(int32 convId) { _gameState->_currentConversationId = convId; // change the music to the "conversation" music if needed. - playRoomMusic(); + playRoomMusic(); if (conv->_enable) { // fix dialog script based on new flags @@ -2291,7 +2291,7 @@ void ToonEngine::haveAConversation(int32 convId) { _gameState->_sackVisible = true; // switch back to original music - playRoomMusic(); + playRoomMusic(); } @@ -2768,7 +2768,7 @@ int32 ToonEngine::showInventory() { } _gameState->_currentScrollValue = oldScrollValue; - _gameState->_inInventory = false; + _gameState->_inInventory = false; _mouseButton = 0; _lastMouseButton = 0x3; @@ -3011,7 +3011,7 @@ void ToonEngine::drawConversationLine() { } void ToonEngine::pauseEngineIntern(bool pause) { - + Engine::pauseEngineIntern(pause); static int32 pauseStart = 0; @@ -4764,7 +4764,7 @@ void ToonEngine::addDirtyRect( int32 left, int32 top, int32 right, int32 bottom Common::Rect rect(left,top,right,bottom); - if (bottom - top <= 0 || right - left <= 0) + if (bottom - top <= 0 || right - left <= 0) return; for (uint32 i = 0; i < _dirtyRects.size(); i++) { -- cgit v1.2.3