diff options
Diffstat (limited to 'engines/xeen')
-rw-r--r-- | engines/xeen/interface_scene.cpp | 30 | ||||
-rw-r--r-- | engines/xeen/sprites.cpp | 9 | ||||
-rw-r--r-- | engines/xeen/sprites.h | 12 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/darkside_cutscenes.cpp | 4 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp | 28 | ||||
-rw-r--r-- | engines/xeen/xeen.cpp | 1 |
6 files changed, 49 insertions, 35 deletions
diff --git a/engines/xeen/interface_scene.cpp b/engines/xeen/interface_scene.cpp index 4f03362b91..51cb6d8b13 100644 --- a/engines/xeen/interface_scene.cpp +++ b/engines/xeen/interface_scene.cpp @@ -145,18 +145,18 @@ OutdoorDrawList::OutdoorDrawList() : _sky1(_data[0]), _sky2(_data[1]), _data[107] = DrawStruct(0, 200, 40, 0, SPRFLAG_HORIZ_FLIPPED | SPRFLAG_SCENE_CLIPPED); _data[108] = DrawStruct(0, 8, 47); _data[109] = DrawStruct(0, 169, 47, 0, SPRFLAG_HORIZ_FLIPPED); - _data[110] = DrawStruct(1, -56, -4, SCALE_ENLARGE, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); - _data[111] = DrawStruct(0, -5, 2, 0, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); - _data[112] = DrawStruct(0, -67, 2, 0, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); + _data[110] = DrawStruct(1, -56, -4, SCALE_ENLARGE, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); + _data[111] = DrawStruct(0, -5, 2, 0, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); + _data[112] = DrawStruct(0, -67, 2, 0, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); _data[113] = DrawStruct(0, 44, 73); _data[114] = DrawStruct(0, 44, 73); - _data[115] = DrawStruct(0, 58, 14, 0, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); + _data[115] = DrawStruct(0, 58, 14, 0, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); _data[116] = DrawStruct(0, 169, 73); _data[117] = DrawStruct(0, 169, 73); - _data[118] = DrawStruct(0, -5, 14, 0, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); + _data[118] = DrawStruct(0, -5, 14, 0, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); _data[119] = DrawStruct(0, 110, 73); _data[120] = DrawStruct(0, 110, 73); - _data[121] = DrawStruct(0, -5, 14, 0, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); + _data[121] = DrawStruct(0, -5, 14, 0, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); _data[122] = DrawStruct(0, 110, 73); _data[123] = DrawStruct(0, 110, 73); _data[124] = DrawStruct(0, 72, 43); @@ -345,17 +345,17 @@ IndoorDrawList::IndoorDrawList() : _data[146] = DrawStruct(0, 200, 12, 0, SPRFLAG_HORIZ_FLIPPED); _data[147] = DrawStruct(0, 200, 24, 0, SPRFLAG_SCENE_CLIPPED); _data[148] = DrawStruct(0, 32, 24); - _data[149] = DrawStruct(0, -5, 2, 0, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); - _data[150] = DrawStruct(0, -67, 10, 0, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); + _data[149] = DrawStruct(0, -5, 2, 0, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); + _data[150] = DrawStruct(0, -67, 10, 0, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); _data[151] = DrawStruct(0, 44, 73); _data[152] = DrawStruct(0, 44, 73); - _data[153] = DrawStruct(0, 58, 14, 0, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); + _data[153] = DrawStruct(0, 58, 14, 0, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); _data[154] = DrawStruct(0, 169, 73); _data[155] = DrawStruct(0, 169, 73); - _data[156] = DrawStruct(0, -5, 14, 0, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); + _data[156] = DrawStruct(0, -5, 14, 0, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); _data[157] = DrawStruct(0, 110, 73); _data[158] = DrawStruct(0, 110, 73); - _data[159] = DrawStruct(0, -5, 14, 0, SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED); + _data[159] = DrawStruct(0, -5, 14, 0, SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED); _data[160] = DrawStruct(0, 110, 73); _data[161] = DrawStruct(0, 110, 73); _data[162] = DrawStruct(0, 72, 43); @@ -485,7 +485,7 @@ void InterfaceScene::drawOutdoorsScene() { ds2._y = 73; } - ds2._flags = SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED; + ds2._flags = SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED; ds2._sprites = &_charPowSprites; } @@ -496,7 +496,7 @@ void InterfaceScene::drawOutdoorsScene() { if (ds1._scale == SCALE_ENLARGE) ds1._x /= 3; - ds1._flags = SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED; + ds1._flags = SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED; ds1._sprites = &_charPowSprites; } } @@ -623,7 +623,7 @@ void InterfaceScene::drawIndoorsScene() { ds1._y = 73; } - ds1._flags = SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED; + ds1._flags = SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED; ds1._sprites = &_charPowSprites; } @@ -633,7 +633,7 @@ void InterfaceScene::drawIndoorsScene() { ds2._scale = combat._pow[idx]._elemScale; if (ds2._scale == SCALE_ENLARGE) ds2._x /= 3; - ds2._flags = SPRFLAG_4000 | SPRFLAG_SCENE_CLIPPED; + ds2._flags = SPRFLAG_BOTTOM_CLIPPED | SPRFLAG_SCENE_CLIPPED; ds2._sprites = &_charPowSprites; } } diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp index e55a69e821..4811f10628 100644 --- a/engines/xeen/sprites.cpp +++ b/engines/xeen/sprites.cpp @@ -33,6 +33,8 @@ namespace Xeen { #define SCENE_CLIP_LEFT 8 #define SCENE_CLIP_RIGHT 223 +int SpriteResource::_clippedBottom; + SpriteResource::SpriteResource() { _filesize = 0; _data = nullptr; @@ -324,11 +326,14 @@ void SpriteResource::draw(int windowIndex, int frame, const Common::Point &destP void SpriteResource::draw(XSurface &dest, int frame, const Common::Point &destPos, const Common::Rect &bounds, uint flags, int scale) { + Common::Rect r = bounds; + if (flags & SPRFLAG_BOTTOM_CLIPPED) + r.clip(SCREEN_WIDTH, _clippedBottom); // Sprites can consist of separate background & foreground - drawOffset(dest, _index[frame]._offset1, destPos, bounds, flags, scale); + drawOffset(dest, _index[frame]._offset1, destPos, r, flags, scale); if (_index[frame]._offset2) - drawOffset(dest, _index[frame]._offset2, destPos, bounds, flags, scale); + drawOffset(dest, _index[frame]._offset2, destPos, r, flags, scale); } void SpriteResource::draw(XSurface &dest, int frame) { diff --git a/engines/xeen/sprites.h b/engines/xeen/sprites.h index a86f5ab367..fe4c45c63a 100644 --- a/engines/xeen/sprites.h +++ b/engines/xeen/sprites.h @@ -40,9 +40,8 @@ enum { }; enum SpriteFlags { - SPRFLAG_800 = 0x800, SPRFLAG_SCENE_CLIPPED = 0x2000, - SPRFLAG_4000 = 0x4000, SPRFLAG_HORIZ_FLIPPED = 0x8000, - SPRFLAG_RESIZE = 0x10000 + SPRFLAG_800 = 0x800, SPRFLAG_SCENE_CLIPPED = 0x2000, SPRFLAG_BOTTOM_CLIPPED = 0x4000, + SPRFLAG_HORIZ_FLIPPED = 0x8000, SPRFLAG_RESIZE = 0x10000 }; class SpriteResource { @@ -55,6 +54,7 @@ private: byte *_data; int _scaledWidth, _scaledHeight; Common::String _filename; + static int _clippedBottom; /** * Load a sprite resource from a stream @@ -174,6 +174,12 @@ public: * Returns true if the sprite resource is empty (ie. nothing is loaded) */ bool empty() const { return _index.size() == 0; } + + /** + * Set the bottom Y position where sprites are clipped if SPRFLAG_BOTTOM_CLIPPED + * is applied + */ + static void setClippedBottom(int y) { _clippedBottom = y; } }; } // End of namespace Xeen diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp index 9b62b5a258..1fd01d501c 100644 --- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp +++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp @@ -907,7 +907,7 @@ bool DarkSideCutscenes::showDarkSideEnding1() { SpriteResource faceEnd("face.end"); screen.restoreBackground(); - faceEnd.draw(0, 0, Common::Point(29, 76), SPRFLAG_4000); + faceEnd.draw(0, 0, Common::Point(29, 76), SPRFLAG_BOTTOM_CLIPPED); screen.update(); screen.fadeIn(); @@ -924,7 +924,7 @@ bool DarkSideCutscenes::showDarkSideEnding1() { sound.stopSong(); screen.restoreBackground(); - faceEnd.draw(0, 0, Common::Point(29, idx), SPRFLAG_4000); + faceEnd.draw(0, 0, Common::Point(29, idx), SPRFLAG_BOTTOM_CLIPPED); screen.update(); WAIT(2); diff --git a/engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp b/engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp index 4ed7f88304..4972266f90 100644 --- a/engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp +++ b/engines/xeen/worldofxeen/worldofxeen_cutscenes.cpp @@ -42,9 +42,9 @@ void WorldOfXeenCutscenes::showWorldOfXeenEnding(GooberState state, uint score) if (worldEnding3()) worldEnding4(); - windows[41].setBounds(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); sound.stopAllAudio(); screen.fadeOut(); + screen.freePages(); } bool WorldOfXeenCutscenes::worldEnding1() { @@ -55,6 +55,7 @@ bool WorldOfXeenCutscenes::worldEnding1() { Window &w0 = windows[0]; Graphics::ManagedSurface savedBg(SCREEN_WIDTH, SCREEN_HEIGHT); + SpriteResource::setClippedBottom(185); sound.playSong("outday3.m"); if (!showPharaohEndText(Res.WORLD_END_TEXT[0])) return false; @@ -84,7 +85,6 @@ bool WorldOfXeenCutscenes::worldEnding1() { // Fade out the screen and the music sound.songCommand(223); windows[41].writeString("\x1\xD"); - windows[41].setBounds(Common::Rect(0, 0, SCREEN_WIDTH, 185)); screen.fadeOut(); while (!_vm->shouldExit() && sound.isSoundPlaying()) @@ -221,8 +221,8 @@ bool WorldOfXeenCutscenes::worldEnding1() { sound.playSound("cast.voc"); screen.blitFrom(savedBg); - sc17.draw(41, 0, Common::Point(33, idx), SPRFLAG_4000); - sc17.draw(41, frame, Common::Point(33, idx), SPRFLAG_4000); + sc17.draw(41, 0, Common::Point(33, idx), SPRFLAG_BOTTOM_CLIPPED); + sc17.draw(41, frame, Common::Point(33, idx), SPRFLAG_BOTTOM_CLIPPED); setSubtitle(Res.WORLD_END_TEXT[4]); w0.update(); @@ -237,8 +237,8 @@ bool WorldOfXeenCutscenes::worldEnding1() { sound.playSound("cast.voc"); screen.blitFrom(savedBg); - sc17.draw(41, 0, Common::Point(33, 68), SPRFLAG_4000); - sc17.draw(41, idx, Common::Point(33, 68), SPRFLAG_4000); + sc17.draw(41, 0, Common::Point(33, 68), SPRFLAG_BOTTOM_CLIPPED); + sc17.draw(41, idx, Common::Point(33, 68), SPRFLAG_BOTTOM_CLIPPED); setSubtitle(Res.WORLD_END_TEXT[4]); w0.update(); @@ -246,7 +246,7 @@ bool WorldOfXeenCutscenes::worldEnding1() { } screen.blitFrom(savedBg); - sc17.draw(0, 0, Common::Point(33, 68), SPRFLAG_4000); + sc17.draw(0, 0, Common::Point(33, 68), SPRFLAG_BOTTOM_CLIPPED); setSubtitle(Res.WORLD_END_TEXT[4]); w0.update(); screen.fadeOut(); @@ -284,10 +284,11 @@ bool WorldOfXeenCutscenes::worldEnding1() { screen.blitFrom(savedBg); setSubtitle(Res.WORLD_END_TEXT[5]); w0.update(); + SpriteResource::setClippedBottom(185); for (int yp = 185; yp > 13; yp -= 6) { screen.blitFrom(savedBg); - staff.draw(41, 0, Common::Point(196, yp), SPRFLAG_4000); + staff.draw(41, 0, Common::Point(196, yp), SPRFLAG_BOTTOM_CLIPPED); setSubtitle(Res.WORLD_END_TEXT[5]); w0.update(); @@ -313,12 +314,13 @@ bool WorldOfXeenCutscenes::worldEnding1() { } // Together, they placed the Cube of Power... + SpriteResource::setClippedBottom(118); screen.loadBackground("tablmain.raw"); savedBg.blitFrom(screen); screen.loadPage(1); sc20[0].draw(0, 0, Common::Point(26, 55)); hands.draw(0, 0, Common::Point(58, 17)); - cube.draw(0, 0, Common::Point(101, 11), SPRFLAG_4000); + cube.draw(0, 0, Common::Point(101, 11), SPRFLAG_BOTTOM_CLIPPED); w0.update(); sound.playSound("cast.voc"); @@ -329,7 +331,7 @@ bool WorldOfXeenCutscenes::worldEnding1() { screen.blitFrom(savedBg); sc20[0].draw(0, 0, Common::Point(26, 55)); hands.draw(0, 0, Common::Point(58, 17)); - cube.draw(0, idx, Common::Point(101, 11), SPRFLAG_4000); + cube.draw(0, idx, Common::Point(101, 11), SPRFLAG_BOTTOM_CLIPPED); setSubtitle(Res.WORLD_END_TEXT[6]); w0.update(); @@ -344,7 +346,7 @@ bool WorldOfXeenCutscenes::worldEnding1() { screen.blitFrom(savedBg); sc20[0].draw(0, 0, Common::Point(26, 55)); hands.draw(0, idx, Common::Point(58, 17)); - cube.draw(0, frame, Common::Point(101, 11), SPRFLAG_4000); + cube.draw(0, frame, Common::Point(101, 11), SPRFLAG_BOTTOM_CLIPPED); setSubtitle(Res.WORLD_END_TEXT[6]); w0.update(); @@ -360,7 +362,7 @@ bool WorldOfXeenCutscenes::worldEnding1() { screen.blitFrom(savedBg); sc20[0].draw(0, 0, Common::Point(26, 55)); - cube.draw(0, frame, Common::Point(101, yp), SPRFLAG_4000); + cube.draw(0, frame, Common::Point(101, yp), SPRFLAG_BOTTOM_CLIPPED); setSubtitle(Res.WORLD_END_TEXT[6]); w0.update(); @@ -433,6 +435,7 @@ bool WorldOfXeenCutscenes::worldEnding1() { WAIT(3); } + screen.fadeOut(); return true; } @@ -452,7 +455,6 @@ bool WorldOfXeenCutscenes::worldEnding2() { }; SpriteResource sc24("sc24.eg2"); - screen.fadeOut(); screen.loadBackground("eg23prt2.raw"); savedBg.blitFrom(screen); sc23[0].draw(0, 0); diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp index c209420086..d4c6fa045b 100644 --- a/engines/xeen/xeen.cpp +++ b/engines/xeen/xeen.cpp @@ -193,6 +193,7 @@ bool XeenEngine::canSaveGameStateCurrently() { void XeenEngine::playGame() { _files->setGameCc(0); _sound->stopAllAudio(); + SpriteResource::setClippedBottom(140); play(); } |