diff options
36 files changed, 198 insertions, 173 deletions
@@ -27,6 +27,8 @@ For a more comprehensive changelog of the latest experimental code, see: - Fixed loading savegames in the Pendulum scene. - Fixed wrong background for inventory items during chapter 6 in the Spanish version. + - Fixed animations speed (they were running two times slower than in the + original engine). Gob: - Fixed lock up for some games during sound initialization. diff --git a/doc/de/Neues b/doc/de/Neues index 106dc6ea88..754bf0fe43 100644 --- a/doc/de/Neues +++ b/doc/de/Neues @@ -28,6 +28,8 @@ Programmcodes finden Sie auf Englisch unter: - Laden eines Spielstandes in der "Pendulum"-Szene repariert. - Falscher Hintergrund für Inventar-Gegenstände im Kapitel 6 in der spanischen Version korrigiert. + - Geschwindigkeit der Animationen korrigiert. Animationen wurden nur halb + so schnell wie im originalen Interpreter abgespielt. Gob: - Aufhängen während Sound-Initialisierung in mehreren Spielen behoben. diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h index 793d4081cf..90e5a84829 100644 --- a/engines/agos/detection_tables.h +++ b/engines/agos/detection_tables.h @@ -2251,6 +2251,31 @@ static const AGOSGameDescription gameDescriptions[] = { GF_TALKIE }, + // Simon the Sorcerer 2 - Russian DOS CD + { + { + "simon2", + "CD", + + { + { "gsptr30", GAME_BASEFILE, "e26d162e573587f4601b88701292212c", 58851}, + { "icon.dat", GAME_ICONFILE, "72096a62d36e6034ea9fecc13b2dbdab", 18089}, + { "simon2.gme", GAME_GMEFILE, "9c535d403966750ae98bdaf698375a38", 19687892}, + { "stripped.txt", GAME_STRFILE, "e229f84d46fa83f99b4a7115679f3fb6", 171}, + { "tbllist", GAME_TBLFILE, "2082f8d02075e590300478853a91ffd9", 513}, + { NULL, 0, NULL, 0} + }, + Common::RU_RUS, + Common::kPlatformDOS, + ADGF_CD, + GUIO0() + }, + + GType_SIMON2, + GID_SIMON2, + GF_TALKIE + }, + // Simon the Sorcerer 2 - Czech Windows CD { { diff --git a/engines/drascula/actors.cpp b/engines/drascula/actors.cpp index a1f2c5386c..b459c4539b 100644 --- a/engines/drascula/actors.cpp +++ b/engines/drascula/actors.cpp @@ -196,10 +196,6 @@ void DrasculaEngine::moveCharacters() { return; } } - - byte *srcSurface = extraSurface; - if (currentChapter == 6 && _lang == kSpanish) - srcSurface = tableSurface; if (characterMoved == 0) { curPos[0] = 0; @@ -218,17 +214,17 @@ void DrasculaEngine::moveCharacters() { curPos[1] = 0; if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - srcSurface, screenSurface); + extraSurface, screenSurface); else reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - factor_red[curY + curHeight], srcSurface, screenSurface); + factor_red[curY + curHeight], extraSurface, screenSurface); } else if (trackProtagonist == 1) { if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - srcSurface, screenSurface); + extraSurface, screenSurface); else reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - factor_red[curY + curHeight], srcSurface, screenSurface); + factor_red[curY + curHeight], extraSurface, screenSurface); } else if (trackProtagonist == 2) { if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], @@ -260,17 +256,17 @@ void DrasculaEngine::moveCharacters() { curPos[1] = 0; if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - srcSurface, screenSurface); + extraSurface, screenSurface); else reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - factor_red[curY + curHeight], srcSurface, screenSurface); + factor_red[curY + curHeight], extraSurface, screenSurface); } else if (trackProtagonist == 1) { if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - srcSurface, screenSurface); + extraSurface, screenSurface); else reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], - factor_red[curY + curHeight], srcSurface, screenSurface); + factor_red[curY + curHeight], extraSurface, screenSurface); } else if (trackProtagonist == 2) { if (currentChapter == 2) copyRect(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5], diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp index 0ed2c61e3f..f672ad3b55 100644 --- a/engines/drascula/animation.cpp +++ b/engines/drascula/animation.cpp @@ -1612,7 +1612,7 @@ void DrasculaEngine::animation_6_6() { removeObject(20); loadPic(96, frontSurface); loadPic(97, frontSurface); - loadPic(97, _lang == kSpanish ? tableSurface : extraSurface); + loadPic(97, extraSurface); loadPic(99, backSurface); doBreak = 1; objExit = 104; @@ -2216,7 +2216,7 @@ void DrasculaEngine::activatePendulum() { _roomNumber = 102; loadPic(102, bgSurface, HALF_PAL); loadPic("an_p1.alg", drawSurface3); - loadPic("an_p2.alg", _lang == kSpanish ? tableSurface : extraSurface); + loadPic("an_p2.alg", extraSurface); loadPic("an_p3.alg", frontSurface); copyBackground(0, 171, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3); diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 75a81c20b0..d7b1fd6acd 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -359,16 +359,13 @@ Common::Error DrasculaEngine::run() { for (i = 0; i < 25; i++) memcpy(crosshairCursor + i * 40, tableSurface + 225 + (56 + i) * 320, 40); - if (_lang == kSpanish) - loadPic(currentChapter == 6 ? 97 : 974, tableSurface); + if (_lang == kSpanish && currentChapter != 6) + loadPic(974, tableSurface); if (currentChapter != 2) { loadPic(99, cursorSurface); loadPic(99, backSurface); - if (currentChapter == 6 && _lang == kSpanish) - loadPic(95, extraSurface); - else - loadPic(97, extraSurface); + loadPic(97, extraSurface); } memset(iconName, 0, sizeof(iconName)); @@ -894,7 +891,7 @@ void DrasculaEngine::pause(int duration) { } int DrasculaEngine::getTime() { - return _system->getMillis() / 20; // originally was 1 + return _system->getMillis() / 10; } void DrasculaEngine::reduce_hare_chico(int xx1, int yy1, int xx2, int yy2, int width, int height, int factor, byte *dir_inicio, byte *dir_fin) { diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 01bd267158..6bfb2e1823 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -217,6 +217,10 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) { int letterY = 0, letterX = 0, i; uint len = strlen(said); byte c; + + byte *srcSurface = tableSurface; + if (_lang == kSpanish && currentChapter == 6) + srcSurface = extraSurface; for (uint h = 0; h < len; h++) { c = toupper(said[h]); @@ -241,7 +245,7 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) { } // for copyRect(letterX, letterY, screenX, screenY, - CHAR_WIDTH, CHAR_HEIGHT, tableSurface, screenSurface); + CHAR_WIDTH, CHAR_HEIGHT, srcSurface, screenSurface); screenX = screenX + CHAR_WIDTH; if (screenX > 317) { diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp index a09b9da07d..07f192cd4c 100644 --- a/engines/drascula/interface.cpp +++ b/engines/drascula/interface.cpp @@ -123,15 +123,6 @@ void DrasculaEngine::showMenu() { int h, n, x; byte *srcSurface = (currentChapter == 6) ? tableSurface : frontSurface; x = whichObject(); - - // The original uses extraSurface to draw text in draw_abc() in the Spanish version - // while other languages use tableSurface. Here all language use tableSurface for - // chapter 6. However the code in ScummVM was changed to use tableSurface for all - // labguage in draw_abc(). So instead here for the Spanish version we use extraSurface. - // Compared to the original the use of the tableSurface and extraSurface has been swapped - // for the Spanish language all through chapter 6. - if (currentChapter == 6 && _lang == kSpanish) - srcSurface = extraSurface; for (n = 1; n < ARRAYSIZE(inventoryObjects); n++) { h = inventoryObjects[n]; diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index acfc528b0c..57d4517295 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -1501,7 +1501,7 @@ void DrasculaEngine::update_102() { if (actorFrames[kFramePendulum] <= 4) pendulumSurface = drawSurface3; else if (actorFrames[kFramePendulum] <= 11) - pendulumSurface = _lang == kSpanish ? tableSurface : extraSurface; + pendulumSurface = extraSurface; else pendulumSurface = frontSurface; diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 6c0c171664..204a6f231c 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -44,13 +44,10 @@ void DrasculaEngine::updateVolume(Audio::Mixer::SoundType soundType, int prevVol } void DrasculaEngine::volumeControls() { - byte* srcSurface = tableSurface; - if (currentChapter == 6 && _lang == kSpanish) - srcSurface = extraSurface; - if (_lang == kSpanish) - loadPic(95, srcSurface); + if (_lang == kSpanish && currentChapter != 6) + loadPic(95, tableSurface); - copyRect(1, 56, 73, 63, 177, 97, srcSurface, screenSurface); + copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface); updateScreen(73, 63, 73, 63, 177, 97, screenSurface); setCursor(kCursorCrosshair); @@ -67,11 +64,11 @@ void DrasculaEngine::volumeControls() { updateRoom(); - copyRect(1, 56, 73, 63, 177, 97, srcSurface, screenSurface); + copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface); - copyBackground(183, 56, 82, masterVolumeY, 39, 2 + masterVolume * 4, srcSurface, screenSurface); - copyBackground(183, 56, 138, voiceVolumeY, 39, 2 + voiceVolume * 4, srcSurface, screenSurface); - copyBackground(183, 56, 194, musicVolumeY, 39, 2 + musicVolume * 4, srcSurface, screenSurface); + copyBackground(183, 56, 82, masterVolumeY, 39, 2 + masterVolume * 4, tableSurface, screenSurface); + copyBackground(183, 56, 138, voiceVolumeY, 39, 2 + voiceVolume * 4, tableSurface, screenSurface); + copyBackground(183, 56, 194, musicVolumeY, 39, 2 + musicVolume * 4, tableSurface, screenSurface); updateScreen(); @@ -104,8 +101,8 @@ void DrasculaEngine::volumeControls() { } - if (_lang == kSpanish) - loadPic(currentChapter == 6 ? 95 : 974, srcSurface); + if (_lang == kSpanish && currentChapter != 6) + loadPic(974, tableSurface); selectVerb(kVerbNone); diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp index 3176c5e0f3..cc329b206b 100644 --- a/engines/drascula/talk.cpp +++ b/engines/drascula/talk.cpp @@ -440,12 +440,9 @@ void DrasculaEngine::talk(const char *said, const char *filename) { copyRect(x_talk_izq[face], y_mask_talk, curX + 8, curY - 1, TALK_WIDTH, TALK_HEIGHT, extraSurface, screenSurface); else if (notTowers) { - byte *srcSurface = extraSurface; - if (currentChapter == 6 && _lang == kSpanish) - srcSurface = tableSurface; reduce_hare_chico(x_talk_izq[face], y_mask_talk, curX + (int)((8.0f / 100) * factor_red[MIN(201, curY + curHeight)]), curY, TALK_WIDTH, TALK_HEIGHT, factor_red[MIN(201, curY + curHeight)], - srcSurface, screenSurface); + extraSurface, screenSurface); } updateRefresh(); } else if (trackProtagonist == 1) { @@ -453,11 +450,8 @@ void DrasculaEngine::talk(const char *said, const char *filename) { copyRect(x_talk_dch[face], y_mask_talk, curX + 12, curY, TALK_WIDTH, TALK_HEIGHT, extraSurface, screenSurface); else if (notTowers) { - byte *srcSurface = extraSurface; - if (currentChapter == 6 && _lang == kSpanish) - srcSurface = tableSurface; reduce_hare_chico(x_talk_dch[face], y_mask_talk, curX + (int)((12.0f / 100) * factor_red[MIN(201, curY + curHeight)]), - curY, TALK_WIDTH, TALK_HEIGHT, factor_red[MIN(201, curY + curHeight)], srcSurface, screenSurface); + curY, TALK_WIDTH, TALK_HEIGHT, factor_red[MIN(201, curY + curHeight)], extraSurface, screenSurface); } updateRefresh(); } else if (trackProtagonist == 2) { diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index ebaff32550..c2aae9ba88 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -24,6 +24,7 @@ #include "common/archive.h" #include "common/config-manager.h" +#include "audio/mixer.h" #include "engines/util.h" @@ -112,6 +113,8 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _musicLocal = 0; _trackStartDelay = 0; + _sceneTrackHandle = new Audio::SoundHandle(); + memset(_sceneTracks, 0, sizeof(_sceneTracks)); memset(_trackName, 0, sizeof(_trackName)); memset(_sceneTracksCurrentTrack, 0, sizeof(_sceneTracksCurrentTrack)); @@ -192,6 +195,7 @@ FullpipeEngine::~FullpipeEngine() { delete _rnd; delete _console; delete _globalMessageQueueList; + delete _sceneTrackHandle; } void FullpipeEngine::initialize() { diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 7f20a6d6af..fba61aa13b 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -30,8 +30,6 @@ #include "common/savefile.h" #include "common/system.h" -#include "audio/mixer.h" - #include "graphics/transparent_surface.h" #include "engines/engine.h" @@ -41,6 +39,10 @@ struct ADGameDescription; +namespace Audio { +class SoundHandle; +} + namespace Fullpipe { enum FullpipeGameFeatures { @@ -312,7 +314,7 @@ public: void lift_openLift(); GameVar *_musicGameVar; - Audio::SoundHandle _sceneTrackHandle; + Audio::SoundHandle *_sceneTrackHandle; public: diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp index 230d6c39a9..c82c2c414c 100644 --- a/engines/fullpipe/sound.cpp +++ b/engines/fullpipe/sound.cpp @@ -30,6 +30,7 @@ #include "fullpipe/statics.h" #include "common/memstream.h" +#include "audio/mixer.h" #include "audio/audiostream.h" #include "audio/decoders/vorbis.h" #include "audio/decoders/wave.h" @@ -96,12 +97,13 @@ Sound::Sound() { memset(_directSoundBuffers, 0, sizeof(_directSoundBuffers)); _description = 0; _volume = 100; + _handle = new Audio::SoundHandle(); } Sound::~Sound() { freeSound(); - free(_description); + delete _handle; } bool Sound::load(MfcArchive &file, NGIArchive *archive) { @@ -206,14 +208,14 @@ void Sound::setPanAndVolumeByStaticAni() { } void Sound::setPanAndVolume(int vol, int pan) { - g_fp->_mixer->setChannelVolume(_handle, vol / 39); // 0..10000 - g_fp->_mixer->setChannelBalance(_handle, pan / 78); // -10000..10000 + g_fp->_mixer->setChannelVolume(*_handle, vol / 39); // 0..10000 + g_fp->_mixer->setChannelBalance(*_handle, pan / 78); // -10000..10000 } void Sound::play(int flag) { - Audio::SoundHandle handle = getHandle(); + Audio::SoundHandle *handle = getHandle(); - if (g_fp->_mixer->isSoundHandleActive(handle)) + if (g_fp->_mixer->isSoundHandleActive(*handle)) return; byte *soundData = loadData(); @@ -221,7 +223,7 @@ void Sound::play(int flag) { Audio::RewindableAudioStream *wav = Audio::makeWAVStream(dataStream, DisposeAfterUse::YES); Audio::AudioStream *audioStream = new Audio::LoopingAudioStream(wav, (flag == 1) ? 0 : 1); - g_fp->_mixer->playStream(Audio::Mixer::kSFXSoundType, &handle, audioStream); + g_fp->_mixer->playStream(Audio::Mixer::kSFXSoundType, handle, audioStream); } void Sound::freeSound() { @@ -231,11 +233,11 @@ void Sound::freeSound() { } int Sound::getVolume() { - return g_fp->_mixer->getChannelVolume(_handle) * 39; // 0..10000 + return g_fp->_mixer->getChannelVolume(*_handle) * 39; // 0..10000 } void Sound::stop() { - g_fp->_mixer->stopHandle(_handle); + g_fp->_mixer->stopHandle(*_handle); } void FullpipeEngine::setSceneMusicParameters(GameVar *gvar) { @@ -353,7 +355,7 @@ void FullpipeEngine::startSoundStream1(char *trackName) { stopAllSoundStreams(); #ifdef USE_VORBIS - if (_mixer->isSoundHandleActive(_sceneTrackHandle)) + if (_mixer->isSoundHandleActive(*_sceneTrackHandle)) return; Common::File *track = new Common::File(); @@ -363,7 +365,7 @@ void FullpipeEngine::startSoundStream1(char *trackName) { return; } Audio::RewindableAudioStream *ogg = Audio::makeVorbisStream(track, DisposeAfterUse::YES); - _mixer->playStream(Audio::Mixer::kMusicSoundType, &_sceneTrackHandle, ogg); + _mixer->playStream(Audio::Mixer::kMusicSoundType, _sceneTrackHandle, ogg); #endif } diff --git a/engines/fullpipe/sound.h b/engines/fullpipe/sound.h index 14e766f5bb..983f28312b 100644 --- a/engines/fullpipe/sound.h +++ b/engines/fullpipe/sound.h @@ -23,6 +23,10 @@ #ifndef FULLPIPE_SOUND_H #define FULLPIPE_SOUND_H +namespace Audio { +class SoundHandle; +} + namespace Fullpipe { class Sound : public MemoryObject { @@ -31,7 +35,7 @@ class Sound : public MemoryObject { int _directSoundBuffer; int _directSoundBuffers[7]; byte *_soundData; - Audio::SoundHandle _handle; + Audio::SoundHandle *_handle; int _volume; public: @@ -45,7 +49,7 @@ public: virtual bool load(MfcArchive &file) { assert(0); return false; } // Disable base class void updateVolume(); int getId() const { return _id; } - Audio::SoundHandle getHandle() const { return _handle; } + Audio::SoundHandle *getHandle() const { return _handle; } void play(int flag); void freeSound(); diff --git a/engines/mads/menu_views.h b/engines/mads/menu_views.h index c203248ad9..e22b6223a7 100644 --- a/engines/mads/menu_views.h +++ b/engines/mads/menu_views.h @@ -8,20 +8,12 @@ * 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. -<<<<<<< HEAD - -======= * ->>>>>>> master * 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. -<<<<<<< HEAD - -======= * ->>>>>>> master * 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. diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index e2bc88ebf6..633b67f7e9 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -604,7 +604,8 @@ void MohawkEngine_Myst::changeToCard(uint16 card, TransitionType transition) { _gfx->runTransition(transition, Common::Rect(544, 333), 10, 0); } else { _gfx->copyBackBufferToScreen(Common::Rect(544, 333)); - _needsUpdate = true; + _system->updateScreen(); + _needsUpdate = false; } } diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index dfdd765120..e79fa6e5e6 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -1584,7 +1584,7 @@ void Control::showGameQuitMsg() { free(textBuf2); } -char Control::_quitTexts[16][35] = { +char Control::_quitTexts[18][35] = { "Game over player one", "BE VIGILANT", "Das Spiel ist aus.", @@ -1600,7 +1600,9 @@ char Control::_quitTexts[16][35] = { "Fim de jogo para o jogador um", "BE VIGILANT", "Game over player one", - "BE VIGILANT" + "BE VIGILANT", + "Irpa okohseha, irpok 1", + "JYD\x96 JDITELEH" }; uint8 Control::_crossImg[594] = { diff --git a/engines/sky/control.h b/engines/sky/control.h index 44591f299d..2089c74363 100644 --- a/engines/sky/control.h +++ b/engines/sky/control.h @@ -292,7 +292,7 @@ private: ControlStatus *_statusBar; - static char _quitTexts[16][35]; + static char _quitTexts[18][35]; static uint8 _crossImg[594]; }; diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 40b6959a9b..710313b1a1 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -336,6 +336,9 @@ Common::Error SkyEngine::init() { case Common::EN_GRB: _systemVars.language = SKY_ENGLISH; break; + case Common::RU_RUS: + _systemVars.language = SKY_RUSSIAN; + break; default: _systemVars.language = SKY_ENGLISH; break; diff --git a/engines/sky/skydefs.h b/engines/sky/skydefs.h index 167b7dade2..ed07a5e2cd 100644 --- a/engines/sky/skydefs.h +++ b/engines/sky/skydefs.h @@ -45,6 +45,7 @@ namespace Sky { #define SKY_ITALIAN 5 #define SKY_PORTUGUESE 6 #define SKY_SPANISH 7 +#define SKY_RUSSIAN 8 #define ST_COLLISION_BIT 5 diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index 907a1ec435..185c051eb6 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -52,13 +52,13 @@ namespace Wage { struct PlotData { - Graphics::Surface *surface; + Graphics::ManagedSurface *surface; Patterns *patterns; uint fillType; int thickness; Design *design; - PlotData(Graphics::Surface *s, Patterns *p, int f, int t, Design *d) : + PlotData(Graphics::ManagedSurface *s, Patterns *p, int f, int t, Design *d) : surface(s), patterns(p), fillType(f), thickness(t), design(d) {} }; @@ -83,7 +83,7 @@ Design::~Design() { delete _surface; } -void Design::paint(Graphics::Surface *surface, Patterns &patterns, int x, int y) { +void Design::paint(Graphics::ManagedSurface *surface, Patterns &patterns, int x, int y) { bool needRender = false; if (_surface == NULL) { @@ -96,11 +96,10 @@ void Design::paint(Graphics::Surface *surface, Patterns &patterns, int x, int y) } _bounds->debugPrint(4, "Calculated bounds:"); - _surface = new Graphics::Surface; + _surface = new Graphics::ManagedSurface; _surface->create(_bounds->width(), _bounds->height(), Graphics::PixelFormat::createFormatCLUT8()); - Common::Rect r(0, 0, _bounds->width(), _bounds->height()); - _surface->fillRect(r, kColorGreen); + _surface->clear(kColorGreen); needRender = true; } @@ -133,16 +132,10 @@ void Design::paint(Graphics::Surface *surface, Patterns &patterns, int x, int y) if (_bounds->width() && _bounds->height()) { const int padding = 3; - for (int i = padding; i < _bounds->height() - 2 * padding; i++) { - const byte *src = (const byte *)_surface->getBasePtr(padding, i); - byte *dst = (byte *)surface->getBasePtr(x + padding, y+i); - for (int j = padding; j < _bounds->width() - 2 * padding; j++) { - if (*src != kColorGreen) - *dst = *src; - src++; - dst++; - } - } + Common::Rect from(padding, padding, _bounds->width() - 2 * padding, _bounds->height() - 2 * padding); + Common::Rect to(from); + to.moveTo(x, y); + surface->transBlitFrom(*_surface, from, to, kColorGreen); } } @@ -269,7 +262,7 @@ void drawPixelPlain(int x, int y, int color, void *data) { *((byte *)p->surface->getBasePtr(x, y)) = (byte)color; } -void Design::drawRect(Graphics::Surface *surface, Common::ReadStream &in, +void Design::drawRect(Graphics::ManagedSurface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { int16 y1 = in.readSint16BE(); int16 x1 = in.readSint16BE(); @@ -298,7 +291,7 @@ void Design::drawRect(Graphics::Surface *surface, Common::ReadStream &in, } } -void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, +void Design::drawRoundRect(Graphics::ManagedSurface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { int16 y1 = in.readSint16BE(); int16 x1 = in.readSint16BE(); @@ -324,7 +317,7 @@ void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, Graphics::drawRoundRect(r, arc / 2, kColorBlack, false, drawPixel, &pd); } -void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, +void Design::drawPolygon(Graphics::ManagedSurface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { byte ignored = in.readSint16BE(); // ignored @@ -401,7 +394,7 @@ void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, free(ypoints); } -void Design::drawOval(Graphics::Surface *surface, Common::ReadStream &in, +void Design::drawOval(Graphics::ManagedSurface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { int16 y1 = in.readSint16BE(); int16 x1 = in.readSint16BE(); @@ -419,7 +412,7 @@ void Design::drawOval(Graphics::Surface *surface, Common::ReadStream &in, Graphics::drawEllipse(x1, y1, x2-1, y2-1, kColorBlack, false, drawPixel, &pd); } -void Design::drawBitmap(Graphics::Surface *surface, Common::SeekableReadStream &in) { +void Design::drawBitmap(Graphics::ManagedSurface *surface, Common::SeekableReadStream &in) { int numBytes = in.readSint16BE(); int y1 = in.readSint16BE(); int x1 = in.readSint16BE(); @@ -427,7 +420,7 @@ void Design::drawBitmap(Graphics::Surface *surface, Common::SeekableReadStream & int x2 = in.readSint16BE(); int w = x2 - x1; int h = y2 - y1; - Graphics::Surface tmp; + Graphics::ManagedSurface tmp; tmp.create(w, h, Graphics::PixelFormat::createFormatCLUT8()); @@ -507,11 +500,11 @@ void Design::drawBitmap(Graphics::Surface *surface, Common::SeekableReadStream & tmp.free(); } -void Design::drawRect(Graphics::Surface *surface, Common::Rect &rect, int thickness, int color, Patterns &patterns, byte fillType) { +void Design::drawRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int thickness, int color, Patterns &patterns, byte fillType) { drawRect(surface, rect.left, rect.top, rect.right, rect.bottom, thickness, color, patterns, fillType); } -void Design::drawRect(Graphics::Surface *surface, int x1, int y1, int x2, int y2, int thickness, int color, Patterns &patterns, byte fillType) { +void Design::drawRect(Graphics::ManagedSurface *surface, int x1, int y1, int x2, int y2, int thickness, int color, Patterns &patterns, byte fillType) { PlotData pd(surface, &patterns, fillType, thickness, nullptr); Graphics::drawLine(x1, y1, x2, y1, kColorBlack, drawPixel, &pd); @@ -521,32 +514,32 @@ void Design::drawRect(Graphics::Surface *surface, int x1, int y1, int x2, int y2 } -void Design::drawFilledRect(Graphics::Surface *surface, Common::Rect &rect, int color, Patterns &patterns, byte fillType) { +void Design::drawFilledRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int color, Patterns &patterns, byte fillType) { PlotData pd(surface, &patterns, fillType, 1, nullptr); for (int y = rect.top; y <= rect.bottom; y++) Graphics::drawHLine(rect.left, rect.right, y, color, drawPixel, &pd); } -void Design::drawFilledRoundRect(Graphics::Surface *surface, Common::Rect &rect, int arc, int color, Patterns &patterns, byte fillType) { +void Design::drawFilledRoundRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int arc, int color, Patterns &patterns, byte fillType) { PlotData pd(surface, &patterns, fillType, 1, nullptr); Graphics::drawRoundRect(rect, arc, color, true, drawPixel, &pd); } -void Design::drawHLine(Graphics::Surface *surface, int x1, int x2, int y, int thickness, int color, Patterns &patterns, byte fillType) { +void Design::drawHLine(Graphics::ManagedSurface *surface, int x1, int x2, int y, int thickness, int color, Patterns &patterns, byte fillType) { PlotData pd(surface, &patterns, fillType, thickness, nullptr); Graphics::drawHLine(x1, x2, y, color, drawPixel, &pd); } -void Design::drawVLine(Graphics::Surface *surface, int x, int y1, int y2, int thickness, int color, Patterns &patterns, byte fillType) { +void Design::drawVLine(Graphics::ManagedSurface *surface, int x, int y1, int y2, int thickness, int color, Patterns &patterns, byte fillType) { PlotData pd(surface, &patterns, fillType, thickness, nullptr); Graphics::drawVLine(x, y1, y2, color, drawPixel, &pd); } -FloodFill::FloodFill(Graphics::Surface *surface, byte color1, byte color2) { +FloodFill::FloodFill(Graphics::ManagedSurface *surface, byte color1, byte color2) { _surface = surface; _color1 = color1; _color2 = color2; diff --git a/engines/wage/design.h b/engines/wage/design.h index e8f42f4e04..a6e0df4c40 100644 --- a/engines/wage/design.h +++ b/engines/wage/design.h @@ -48,7 +48,7 @@ #ifndef WAGE_DESIGN_H #define WAGE_DESIGN_H -#include "graphics/surface.h" +#include "graphics/managed_surface.h" #include "common/memstream.h" #include "common/rect.h" @@ -67,14 +67,14 @@ public: return _bounds; } - void paint(Graphics::Surface *canvas, Patterns &patterns, int x, int y); + void paint(Graphics::ManagedSurface *canvas, Patterns &patterns, int x, int y); bool isPointOpaque(int x, int y); - static void drawRect(Graphics::Surface *surface, Common::Rect &rect, int thickness, int color, Patterns &patterns, byte fillType); - static void drawRect(Graphics::Surface *surface, int x1, int y1, int x2, int y2, int thickness, int color, Patterns &patterns, byte fillType); - static void drawFilledRect(Graphics::Surface *surface, Common::Rect &rect, int color, Patterns &patterns, byte fillType); - static void drawFilledRoundRect(Graphics::Surface *surface, Common::Rect &rect, int arc, int color, Patterns &patterns, byte fillType); - static void drawHLine(Graphics::Surface *surface, int x1, int x2, int y, int thickness, int color, Patterns &patterns, byte fillType); - static void drawVLine(Graphics::Surface *surface, int x, int y1, int y2, int thickness, int color, Patterns &patterns, byte fillType); + static void drawRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int thickness, int color, Patterns &patterns, byte fillType); + static void drawRect(Graphics::ManagedSurface *surface, int x1, int y1, int x2, int y2, int thickness, int color, Patterns &patterns, byte fillType); + static void drawFilledRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int color, Patterns &patterns, byte fillType); + static void drawFilledRoundRect(Graphics::ManagedSurface *surface, Common::Rect &rect, int arc, int color, Patterns &patterns, byte fillType); + static void drawHLine(Graphics::ManagedSurface *surface, int x1, int x2, int y, int thickness, int color, Patterns &patterns, byte fillType); + static void drawVLine(Graphics::ManagedSurface *surface, int x, int y1, int y2, int thickness, int color, Patterns &patterns, byte fillType); bool isBoundsCalculation() { return _boundsCalculationMode; } void adjustBounds(int16 x, int16 y); @@ -83,32 +83,32 @@ private: byte *_data; int _len; Common::Rect *_bounds; - Graphics::Surface *_surface; + Graphics::ManagedSurface *_surface; bool _boundsCalculationMode; private: void render(Patterns &patterns); - void drawRect(Graphics::Surface *surface, Common::ReadStream &in, + void drawRect(Graphics::ManagedSurface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); - void drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, + void drawRoundRect(Graphics::ManagedSurface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); - void drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, + void drawPolygon(Graphics::ManagedSurface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); - void drawOval(Graphics::Surface *surface, Common::ReadStream &in, + void drawOval(Graphics::ManagedSurface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); - void drawBitmap(Graphics::Surface *surface, Common::SeekableReadStream &in); + void drawBitmap(Graphics::ManagedSurface *surface, Common::SeekableReadStream &in); }; class FloodFill { public: - FloodFill(Graphics::Surface *surface, byte color1, byte color2); + FloodFill(Graphics::ManagedSurface *surface, byte color1, byte color2); ~FloodFill(); void addSeed(int x, int y); void fill(); private: Common::List<Common::Point *> _queue; - Graphics::Surface *_surface; + Graphics::ManagedSurface *_surface; byte _color1, _color2; byte *_visited; int _w, _h; diff --git a/engines/wage/dialog.h b/engines/wage/dialog.h index c5878acc95..ec99fc06b2 100644 --- a/engines/wage/dialog.h +++ b/engines/wage/dialog.h @@ -74,7 +74,7 @@ public: private: Gui *_gui; - Graphics::Surface _tempSurface; + Graphics::ManagedSurface _tempSurface; Common::Rect _bbox; Common::String _text; diff --git a/engines/wage/entities.cpp b/engines/wage/entities.cpp index adb053868a..49e2592949 100644 --- a/engines/wage/entities.cpp +++ b/engines/wage/entities.cpp @@ -134,7 +134,7 @@ Scene::~Scene() { delete _textBounds; } -void Scene::paint(Graphics::Surface *surface, int x, int y) { +void Scene::paint(Graphics::ManagedSurface *surface, int x, int y) { Common::Rect r(x + 5, y + 5, _design->getBounds()->width() + x - 10, _design->getBounds()->height() + y - 10); surface->fillRect(r, kColorWhite); diff --git a/engines/wage/entities.h b/engines/wage/entities.h index 33cf087322..c393f15f01 100644 --- a/engines/wage/entities.h +++ b/engines/wage/entities.h @@ -49,7 +49,7 @@ #define WAGE_ENTITIES_H namespace Graphics { - struct Surface; + class ManagedSurface; } namespace Wage { @@ -326,7 +326,7 @@ public: return _textBounds == NULL ? NULL : new Common::Rect(*_textBounds); } - void paint(Graphics::Surface *screen, int x, int y); + void paint(Graphics::ManagedSurface *screen, int x, int y); const char *getFontName(); }; diff --git a/engines/wage/gui-console.cpp b/engines/wage/gui-console.cpp index ab5df637ec..840b8e3ced 100644 --- a/engines/wage/gui-console.cpp +++ b/engines/wage/gui-console.cpp @@ -142,7 +142,7 @@ void Gui::flowText(Common::String &str) { draw(); } -void Gui::renderConsole(Graphics::Surface *g, Common::Rect &r) { +void Gui::renderConsole(Graphics::ManagedSurface *g, const Common::Rect &r) { bool fullRedraw = _consoleFullRedraw; bool textReflow = false; int surfW = r.width() + kConWOverlap * 2; @@ -150,7 +150,6 @@ void Gui::renderConsole(Graphics::Surface *g, Common::Rect &r) { Common::Rect boundsR(kConWOverlap - kConOverscan, kConHOverlap - kConOverscan, r.width() + kConWOverlap + kConOverscan, r.height() + kConHOverlap + kConOverscan); - Common::Rect fullR(0, 0, surfW, surfH); if (_console.w != surfW || _console.h != surfH) { if (_console.w != surfW) @@ -163,7 +162,7 @@ void Gui::renderConsole(Graphics::Surface *g, Common::Rect &r) { } if (fullRedraw) - _console.fillRect(fullR, kColorWhite); + _console.clear(kColorWhite); const Graphics::Font *font = getConsoleFont(); @@ -280,7 +279,6 @@ void Gui::renderConsole(Graphics::Surface *g, Common::Rect &r) { rr.bottom = _screen.h - 1; g->copyRectToSurface(_console, xcon, ycon, boundsR); - g_system->copyRectToScreen(g->getBasePtr(rr.left, rr.top), g->pitch, rr.left, rr.top, rr.width(), rr.height()); } void Gui::drawInput() { diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 50b8b00861..436d17c56f 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -68,7 +68,7 @@ static const byte palette[] = { 0x80, 0x80, 0x80, // Gray 0xff, 0xff, 0xff, // White 0x00, 0xff, 0x00, // Green - 0x00, 0x7f, 0x00 // Green2 + 0x00, 0xcf, 0x00 // Green2 }; static byte fillPatterns[][8] = { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, // kPatternSolid @@ -171,7 +171,7 @@ Gui::Gui(WageEngine *engine) { _inputTextLineNum = 0; - g_system->getPaletteManager()->setPalette(palette, 0, 4); + g_system->getPaletteManager()->setPalette(palette, 0, ARRAYSIZE(palette) / 3); CursorMan.replaceCursorPalette(palette, 0, 4); CursorMan.replaceCursor(macCursorArrow, 11, 16, 1, 1, 3); @@ -284,14 +284,18 @@ void Gui::drawScene() { MacWindow *w = _wm.getWindow(_sceneWindowId); w->setDimensions(*_scene->_designBounds); + w->setTitle(_scene->_name); + _scene->paint(w->getSurface(), 0, 0); + w->draw(&_screen); + g_system->copyRectToScreen(_screen.getBasePtr(_scene->_designBounds->left - 2, _scene->_designBounds->top - 2), + _screen.pitch, _scene->_designBounds->left - 2, _scene->_designBounds->top - 2, + _scene->_designBounds->width(), _scene->_designBounds->height()); _sceneDirty = true; _consoleDirty = true; _menuDirty = true; _consoleFullRedraw = true; - _scene->paint(&_screen, _scene->_designBounds->left, _scene->_designBounds->top); - _sceneArea.left = _scene->_designBounds->left + kBorderWidth - 2; _sceneArea.top = _scene->_designBounds->top + kBorderWidth - 2; _sceneArea.setWidth(_scene->_designBounds->width() - 2 * kBorderWidth); @@ -301,8 +305,6 @@ void Gui::drawScene() { _consoleTextArea.top = _scene->_textBounds->top + kBorderWidth - 2; _consoleTextArea.setWidth(_scene->_textBounds->width() - 2 * kBorderWidth); _consoleTextArea.setHeight(_scene->_textBounds->height() - 2 * kBorderWidth); - - paintBorder(&_screen, _sceneArea, kWindowScene); } // Render console @@ -310,18 +312,24 @@ void Gui::drawConsole() { if (!_consoleDirty && !_consoleFullRedraw && !_bordersDirty && !_sceneDirty) return; - renderConsole(&_screen, _consoleTextArea); - paintBorder(&_screen, _consoleTextArea, kWindowConsole); + MacWindow *w = _wm.getWindow(_consoleWindowId); + w->setDimensions(*_scene->_textBounds); + renderConsole(w->getSurface(), Common::Rect(kBorderWidth - 2, kBorderWidth - 2, + _scene->_textBounds->width() - kBorderWidth, _scene->_textBounds->height() - kBorderWidth)); + w->draw(&_screen); + g_system->copyRectToScreen(_screen.getBasePtr(_scene->_textBounds->left - 2, _scene->_textBounds->top - 2), + _screen.pitch, _scene->_textBounds->left - 2, _scene->_textBounds->top - 2, + _scene->_textBounds->width(), _scene->_textBounds->height()); } -void Gui::drawBox(Graphics::Surface *g, int x, int y, int w, int h) { +void Gui::drawBox(Graphics::ManagedSurface *g, int x, int y, int w, int h) { Common::Rect r(x, y, x + w + 1, y + h + 1); g->fillRect(r, kColorWhite); g->frameRect(r, kColorBlack); } -void Gui::fillRect(Graphics::Surface *g, int x, int y, int w, int h, int color) { +void Gui::fillRect(Graphics::ManagedSurface *g, int x, int y, int w, int h, int color) { Common::Rect r(x, y, x + w, y + h); g->fillRect(r, color); @@ -338,7 +346,7 @@ const int arrowPixels[ARROW_H][ARROW_W] = { {1,1,1,1,1,1,1,1,1,1,1,1}}; static void drawPixelInverted(int x, int y, int color, void *data) { - Graphics::Surface *surface = (Graphics::Surface *)data; + Graphics::ManagedSurface *surface = (Graphics::ManagedSurface *)data; if (x >= 0 && x < surface->w && y >= 0 && y < surface->h) { byte *p = (byte *)surface->getBasePtr(x, y); @@ -347,7 +355,7 @@ static void drawPixelInverted(int x, int y, int color, void *data) { } } -void Gui::paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType, int highlightedPart, float scrollPos, float scrollSize) { +void Gui::paintBorder(Graphics::ManagedSurface *g, Common::Rect &r, WindowType windowType, int highlightedPart, float scrollPos, float scrollSize) { bool active = false, scrollable = false, closeable = false, drawTitle = false; const int size = kBorderWidth; int x = r.left - size; diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 11e001b274..dc3a593bda 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -51,7 +51,7 @@ #include "common/str-array.h" #include "graphics/font.h" #include "graphics/fontman.h" -#include "graphics/surface.h" +#include "graphics/managed_surface.h" #include "common/rect.h" #include "wage/macwindow.h" @@ -117,11 +117,11 @@ private: void drawConsole(); void undrawCursor(); void drawDesktop(); - void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType, int highlightedPart = kBorderNone, + void paintBorder(Graphics::ManagedSurface *g, Common::Rect &r, WindowType windowType, int highlightedPart = kBorderNone, float scrollPos = 0.0, float scrollSize = 0.0); - void renderConsole(Graphics::Surface *g, Common::Rect &r); - void drawBox(Graphics::Surface *g, int x, int y, int w, int h); - void fillRect(Graphics::Surface *g, int x, int y, int w, int h, int color = kColorBlack); + void renderConsole(Graphics::ManagedSurface *g, const Common::Rect &r); + void drawBox(Graphics::ManagedSurface *g, int x, int y, int w, int h); + void fillRect(Graphics::ManagedSurface *g, int x, int y, int w, int h, int color = kColorBlack); void loadFonts(); void flowText(Common::String &str); const Graphics::Font *getConsoleFont(); @@ -132,7 +132,7 @@ private: void updateTextSelection(int x, int y); public: - Graphics::Surface _screen; + Graphics::ManagedSurface _screen; int _cursorX, _cursorY; bool _cursorState; Common::Rect _consoleTextArea; @@ -149,7 +149,7 @@ public: bool _menuDirty; private: - Graphics::Surface _console; + Graphics::ManagedSurface _console; Menu *_menu; Scene *_scene; bool _sceneDirty; diff --git a/engines/wage/macwindow.cpp b/engines/wage/macwindow.cpp index 3abfdf6017..41d842286a 100644 --- a/engines/wage/macwindow.cpp +++ b/engines/wage/macwindow.cpp @@ -80,29 +80,32 @@ void MacWindow::resize(int w, int h) { _surface.free(); _surface.create(w, h, Graphics::PixelFormat::createFormatCLUT8()); _borderSurface.free(); - _borderSurface.create(w + 2 * kBorderWidth, h + 2 * kBorderWidth, Graphics::PixelFormat::createFormatCLUT8()); + _borderSurface.create(w, h, Graphics::PixelFormat::createFormatCLUT8()); + _composeSurface.free(); + _composeSurface.create(w, h, Graphics::PixelFormat::createFormatCLUT8()); _dims.setWidth(w); _dims.setHeight(h); - - _borderDims.setWidth(w + 2 * kBorderWidth); - _borderDims.setHeight(h + 2 * kBorderWidth); - move(_dims.left, _dims.top); // Update _borderDims position } void MacWindow::move(int x, int y) { _dims.moveTo(x, y); - _borderDims.moveTo(x - kBorderWidth, y - kBorderWidth); } void MacWindow::setDimensions(const Common::Rect &r) { resize(r.width(), r.height()); - move(r.left, r.top); + _dims.moveTo(r.left, r.top); } -void MacWindow::draw(Graphics::Surface *g, bool forceRedraw) { +void MacWindow::draw(Graphics::ManagedSurface *g, bool forceRedraw) { if (_borderIsDirty || forceRedraw) drawBorder(); + + // Compose + _composeSurface.blitFrom(_surface, Common::Rect(0, 0, _surface.w - 2, _surface.h - 2), Common::Point(2, 2)); + _composeSurface.transBlitFrom(_borderSurface, kColorGreen); + + g->transBlitFrom(_composeSurface, _composeSurface.getBounds(), Common::Point(_dims.left - 2, _dims.top - 2), kColorGreen2); } const Graphics::Font *MacWindow::getTitleFont() { @@ -124,7 +127,7 @@ const int arrowPixels[ARROW_H][ARROW_W] = { {1,1,1,1,1,1,1,1,1,1,1,1}}; static void drawPixelInverted(int x, int y, int color, void *data) { - Graphics::Surface *surface = (Graphics::Surface *)data; + Graphics::ManagedSurface *surface = (Graphics::ManagedSurface *)data; if (x >= 0 && x < surface->w && y >= 0 && y < surface->h) { byte *p = (byte *)surface->getBasePtr(x, y); @@ -136,7 +139,7 @@ static void drawPixelInverted(int x, int y, int color, void *data) { void MacWindow::drawBorder() { _borderIsDirty = false; - bool active = _active, scrollable = _scrollable, closeable = _active, drawTitle = _title.empty(); + bool active = _active, scrollable = _scrollable, closeable = _active, drawTitle = !_title.empty(); const int size = kBorderWidth; int x = 0; int y = 0; @@ -144,7 +147,11 @@ void MacWindow::drawBorder() { int height = _borderSurface.h; Graphics::ManagedSurface *g = &_borderSurface; - g->fillRect(_borderDims, kColorGreen2); + // We draw rect with outer kColorGreen2 and inner kColorGreen, so on 2 passes we cut out + // scene by external shape of the border + int sz = kBorderWidth / 2; + g->clear(kColorGreen2); + g->fillRect(Common::Rect(sz, sz, width - sz, height - sz), kColorGreen); drawBox(g, x, y, size, size); drawBox(g, x + width - size - 1, y, size, size); diff --git a/engines/wage/macwindow.h b/engines/wage/macwindow.h index 0d7d49f06d..e635528c23 100644 --- a/engines/wage/macwindow.h +++ b/engines/wage/macwindow.h @@ -75,7 +75,7 @@ public: void move(int x, int y); void resize(int w, int h); void setDimensions(const Common::Rect &r); - void draw(Graphics::Surface *g, bool forceRedraw = false); + void draw(Graphics::ManagedSurface *g, bool forceRedraw = false); void setActive(bool active); Graphics::ManagedSurface *getSurface() { return &_surface; } void setTitle(Common::String &title) { _title = title; } @@ -92,6 +92,7 @@ private: private: Graphics::ManagedSurface _surface; Graphics::ManagedSurface _borderSurface; + Graphics::ManagedSurface _composeSurface; bool _scrollable; bool _active; bool _borderIsDirty; @@ -100,7 +101,6 @@ private: float _scrollPos, _scrollSize; Common::Rect _dims; - Common::Rect _borderDims; Common::String _title; }; diff --git a/engines/wage/macwindowmanager.cpp b/engines/wage/macwindowmanager.cpp index 14c3f236e8..72f01fac67 100644 --- a/engines/wage/macwindowmanager.cpp +++ b/engines/wage/macwindowmanager.cpp @@ -48,7 +48,7 @@ #include "common/list.h" #include "common/array.h" -#include "graphics/surface.h" +#include "graphics/managed_surface.h" #include "wage/wage.h" #include "wage/macwindow.h" @@ -94,7 +94,7 @@ void MacWindowManager::setActive(int id) { _fullRefresh = true; } -void MacWindowManager::draw(Graphics::Surface *g) { +void MacWindowManager::draw(Graphics::ManagedSurface *g) { for (Common::List<MacWindow *>::const_iterator it = _windowStack.begin(); it != _windowStack.end(); it++) (*it)->draw(g, _fullRefresh); diff --git a/engines/wage/macwindowmanager.h b/engines/wage/macwindowmanager.h index b15c7737c6..1c8ed02a85 100644 --- a/engines/wage/macwindowmanager.h +++ b/engines/wage/macwindowmanager.h @@ -60,7 +60,7 @@ public: int add(bool scrollable); void setActive(int id); - void draw(Graphics::Surface *g); + void draw(Graphics::ManagedSurface *g); MacWindow *getWindow(int id) { return _windows[id]; } diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp index 12ef8c2219..27cbf5e4f5 100644 --- a/engines/wage/menu.cpp +++ b/engines/wage/menu.cpp @@ -397,7 +397,7 @@ void Menu::renderSubmenu(MenuItem *menu) { } if (!text.empty()) { - Graphics::Surface *s = &_gui->_screen; + Graphics::ManagedSurface *s = &_gui->_screen; int tx = x, ty = y; if (!menu->subitems[i]->enabled) { @@ -406,7 +406,7 @@ void Menu::renderSubmenu(MenuItem *menu) { ty = 0; accelX -= x; - _tempSurface.fillRect(Common::Rect(0, 0, _tempSurface.w, _tempSurface.h), kColorGreen); + _tempSurface.clear(kColorGreen); } _font->drawString(s, text, tx, ty, r->width(), color); diff --git a/engines/wage/menu.h b/engines/wage/menu.h index 3550356bc6..916ef6d50e 100644 --- a/engines/wage/menu.h +++ b/engines/wage/menu.h @@ -111,8 +111,8 @@ public: private: Gui *_gui; - Graphics::Surface _screenCopy; - Graphics::Surface _tempSurface; + Graphics::ManagedSurface _screenCopy; + Graphics::ManagedSurface _tempSurface; private: const Graphics::Font *getMenuFont(); diff --git a/po/de_DE.po b/po/de_DE.po index 8cfa723ece..2943f18bfa 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: ScummVM 1.9.0git\n" "Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n" "POT-Creation-Date: 2016-04-07 08:55+0100\n" -"PO-Revision-Date: 2016-04-10 11:00+0100\n" +"PO-Revision-Date: 2016-04-15 11:00+0100\n" "Last-Translator: Lothar Serra Mari <rootfather@scummvm.org>\n" "Language-Team: Simon Sawatzki <SimSaw@gmx.de>, Lothar Serra Mari " "<rootfather@scummvm.org>\n" @@ -2967,7 +2967,7 @@ msgstr "Objektzeile zeigen" #: engines/scumm/detection.cpp:1336 msgid "Show the names of objects at the bottom of the screen" -msgstr "Die Objektzeile wird während des Spiels im unteren Bildbereich eingeblendet" +msgstr "Objektnamen und Verben am unteren Bildrand anzeigen" #: engines/scumm/dialogs.cpp:176 #, c-format |