[Scummvm-git-logs] scummvm master -> 78132c5138c5a989add6afae75ee63bf0fc2ed8a
dreammaster
dreammaster at scummvm.org
Mon Sep 19 02:48:45 CEST 2016
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ffc31b8802 XEEN: Extra space in sprite line decoding as workaround for bad data
78132c5138 XEEN: More of Darkside endgame sequence
Commit: ffc31b880243f886ef265e9f4b9906328116cdd2
https://github.com/scummvm/scummvm/commit/ffc31b880243f886ef265e9f4b9906328116cdd2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-09-18T20:47:37-04:00
Commit Message:
XEEN: Extra space in sprite line decoding as workaround for bad data
Changed paths:
engines/xeen/sprites.cpp
engines/xeen/sprites.h
diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp
index 3758a0f..d0e9f07 100644
--- a/engines/xeen/sprites.cpp
+++ b/engines/xeen/sprites.cpp
@@ -171,10 +171,11 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi
// Initialize the array to hold the temporary data for the line. We do this to make it simpler
// to handle both deciding which pixels to draw in a scaled image, as well as when images
- // have been horizontally flipped
- int tempLine[SCREEN_WIDTH];
- Common::fill(&tempLine[0], &tempLine[SCREEN_WIDTH], -1);
- int *lineP = flipped ? &tempLine[width - 1 - xOffset] : &tempLine[xOffset];
+ // have been horizontally flipped. Note that we allocate an extra line for before and after our
+ // work line, just in case the sprite is screwed up and overruns the line
+ int tempLine[SCREEN_WIDTH * 3];
+ Common::fill(&tempLine[SCREEN_WIDTH], &tempLine[SCREEN_WIDTH * 3], -1);
+ int *lineP = flipped ? &tempLine[SCREEN_WIDTH + width - 1 - xOffset] : &tempLine[SCREEN_WIDTH + xOffset];
// Build up the line
int byteCount, opr1, opr2;
@@ -259,7 +260,7 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi
// Handle drawing out the line
byte *destP = (byte *)dest.getBasePtr(destPos.x, destPos.y);
int16 xp = destPos.x;
- lineP = &tempLine[0];
+ lineP = &tempLine[SCREEN_WIDTH];
for (int xCtr = 0; xCtr < width; ++xCtr, ++lineP) {
bit = (scaleMaskX >> 15) & 1;
diff --git a/engines/xeen/sprites.h b/engines/xeen/sprites.h
index f660daa..025c8db 100644
--- a/engines/xeen/sprites.h
+++ b/engines/xeen/sprites.h
@@ -35,8 +35,11 @@ namespace Xeen {
class XeenEngine;
class Window;
-enum SpriteFlags { SPRFLAG_SCENE_CLIPPED = 0x2000, SPRFLAG_4000 = 0x4000,
- SPRFLAG_HORIZ_FLIPPED = 0x8000, SPRFLAG_RESIZE = 0x10000 };
+enum SpriteFlags {
+ SPRFLAG_800 = 0x800, SPRFLAG_SCENE_CLIPPED = 0x2000,
+ SPRFLAG_4000 = 0x4000, SPRFLAG_HORIZ_FLIPPED = 0x8000,
+ SPRFLAG_RESIZE = 0x10000
+};
class SpriteResource {
private:
Commit: 78132c5138c5a989add6afae75ee63bf0fc2ed8a
https://github.com/scummvm/scummvm/commit/78132c5138c5a989add6afae75ee63bf0fc2ed8a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-09-18T20:48:23-04:00
Commit Message:
XEEN: More of Darkside endgame sequence
Changed paths:
engines/xeen/events.h
engines/xeen/screen.h
engines/xeen/sound.cpp
engines/xeen/worldofxeen/darkside_cutscenes.cpp
diff --git a/engines/xeen/events.h b/engines/xeen/events.h
index 7847ecd..f8fafca 100644
--- a/engines/xeen/events.h
+++ b/engines/xeen/events.h
@@ -106,7 +106,7 @@ public:
uint32 timeElapsed4() const { return _frameCounter - _gameCounters[4]; }
uint32 timeElapsed5() const { return _frameCounter - _gameCounters[5]; }
- bool wait(uint numFrames, bool interruptable = false);
+ bool wait(uint numFrames, bool interruptable = true);
void ipause(uint amount);
};
diff --git a/engines/xeen/screen.h b/engines/xeen/screen.h
index 854a05a..8a17d62 100644
--- a/engines/xeen/screen.h
+++ b/engines/xeen/screen.h
@@ -169,7 +169,7 @@ public:
/**
* Merge the two pages along a horizontal split point
*/
- void horizMerge(int xp);
+ void horizMerge(int xp = 0);
/**
* Merge the two pages along a vertical split point
diff --git a/engines/xeen/sound.cpp b/engines/xeen/sound.cpp
index d53f197..1da8798 100644
--- a/engines/xeen/sound.cpp
+++ b/engines/xeen/sound.cpp
@@ -40,6 +40,7 @@ Sound::~Sound() {
void Sound::playSound(Common::SeekableReadStream &s, int unused) {
stopSound();
+ s.seek(0);
Common::SeekableReadStream *srcStream = s.readStream(s.size());
Audio::SeekableAudioStream *stream = Audio::makeVOCStream(srcStream,
Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
index 0c806de..f845a62 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
@@ -236,9 +236,6 @@ bool DarkSideCutscenes::showDarkSideEnding() {
Screen &screen = *_vm->_screen;
Sound &sound = *_vm->_sound;
- File ido2("ido2.voc");
- SpriteResource box("box.vga");
-
sound.playSong("dngon3.m");
screen.loadBackground("scene1.raw");
screen.loadPalette("endgame.pal");
@@ -249,6 +246,7 @@ bool DarkSideCutscenes::showDarkSideEnding() {
if (events.wait(30))
return false;
+ screen.fadeOut(4);
screen.loadBackground("scene2-b.raw");
screen.update();
screen.saveBackground();
@@ -282,12 +280,99 @@ bool DarkSideCutscenes::showDarkSideEnding() {
if (events.wait(2))
return false;
}
+ faceEnd.clear();
// Alamar says "Come to me"
sound.playSound("come2.voc");
if (!subtitlesWait(27))
return false;
+ // Show the entire throne room
+ screen.loadBackground("mainback.raw");
+ SpriteResource sc03a("sc03a.end"), sc03b("sc03b.end"), sc03c("sc03c.end");
+ sc03a.draw(screen, 0, Common::Point(250, 0));
+
+ screen.saveBackground();
+ screen.update();
+ events.updateGameCounter();
+ if (events.wait(30))
+ return false;
+
+ // Silhouette of door opening
+ sound.playSound("door.voc");
+ for (int idx = 0; idx < 6; ++idx) {
+ events.updateGameCounter();
+ screen.restoreBackground();
+ sc03b.draw(screen, idx, Common::Point(72, 125));
+ screen.update();
+
+ if (events.wait(4))
+ return false;
+ }
+
+ // Silhouette of playing entering
+ for (int idx = 0; idx < 19; ++idx) {
+ events.updateGameCounter();
+ screen.restoreBackground();
+ sc03c.draw(screen, idx, Common::Point(72, 125));
+ screen.update();
+
+ if (idx == 3 || idx == 11)
+ sound.playFX(7);
+ if (idx == 7 || idx == 16)
+ sound.playFX(8);
+
+ if (events.wait(4))
+ return false;
+ }
+
+ sc03a.clear();
+ sc03b.clear();
+ sc03c.clear();
+
+ // Box throwing
+ screen.loadBackground("scene4.raw");
+ screen.loadPage(0);
+ screen.loadBackground("scene4-1.raw");
+ screen.loadPage(1);
+ SpriteResource disk("disk.end");
+ File whoosh("whoosh.voc");
+
+ screen.horizMerge();
+ int yp = 101, ctr = 0, frameNum = 0;
+ for (int xp = 0; xp < 320; xp += 2) {
+ events.updateGameCounter();
+ screen.horizMerge(xp);
+
+ disk.draw(screen, frameNum, Common::Point(xp / 2, yp));
+ if (xp < 44)
+ disk.draw(screen, 11, Common::Point(-xp, 22), SPRFLAG_800);
+ disk.draw(screen, 10, Common::Point(0, 134));
+
+ if (!(xp % 22))
+ sound.playSound(whoosh);
+ events.wait(1);
+
+ if (++ctr % 2)
+ frameNum = (frameNum + 1) % 10;
+
+ if (xp < 100)
+ --yp;
+ else if (xp > 150)
+ ++yp;
+ }
+
+ // Play landing thud
+ if (events.wait(10))
+ return false;
+
+ sound.playSound("thud.voc");
+ while (!_vm->shouldQuit() && !events.isKeyMousePressed()
+ && sound.isPlaying()) {
+ events.pollEventsAndWait();
+ }
+
+
// TODO
events.wait(5000);
More information about the Scummvm-git-logs
mailing list