[Scummvm-cvs-logs] scummvm master -> c2cb1019a697943f9afd3c5dd6253f5f76be9033
fuzzie
fuzzie at fuzzie.org
Sat Nov 5 10:49:05 CET 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c2cb1019a6 COMPOSER: Parse ambients (V1 sprite buttons).
Commit: c2cb1019a697943f9afd3c5dd6253f5f76be9033
https://github.com/scummvm/scummvm/commit/c2cb1019a697943f9afd3c5dd6253f5f76be9033
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-11-05T02:47:39-07:00
Commit Message:
COMPOSER: Parse ambients (V1 sprite buttons).
Changed paths:
engines/composer/composer.cpp
engines/composer/composer.h
engines/composer/resource.h
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index 5c66d9f..af08ad6 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -399,6 +399,13 @@ void ComposerEngine::loadLibrary(uint id) {
newLib._buttons.push_back(button);
}
+ Common::Array<uint16> ambientResources = library._archive->getResourceIDList(ID_AMBI);
+ for (uint i = 0; i < ambientResources.size(); i++) {
+ Common::SeekableReadStream *stream = library._archive->getResource(ID_AMBI, ambientResources[i]);
+ Button button(stream);
+ newLib._buttons.insert(newLib._buttons.begin(), button);
+ }
+
// add background sprite, if it exists
if (hasResource(ID_BMAP, 1000))
setBackground(1000);
@@ -526,6 +533,26 @@ Button::Button(Common::SeekableReadStream *stream, uint16 id, uint gameType) {
delete stream;
}
+// AMBI-style button
+Button::Button(Common::SeekableReadStream *stream) {
+ _id = 0;
+ _zorder = 0;
+ _active = true;
+ _type = kButtonSprites;
+ _scriptIdRollOn = 0;
+ _scriptIdRollOff = 0;
+
+ _scriptId = stream->readUint16LE();
+
+ uint16 count = stream->readUint16LE();
+ for (uint j = 0; j < count; j++) {
+ uint16 spriteId = stream->readUint16LE();
+ _spriteIds.push_back(spriteId);
+ }
+
+ delete stream;
+}
+
bool Button::contains(const Common::Point &pos) const {
switch (_type) {
case kButtonRect:
diff --git a/engines/composer/composer.h b/engines/composer/composer.h
index 0d11817..d92add1 100644
--- a/engines/composer/composer.h
+++ b/engines/composer/composer.h
@@ -69,6 +69,7 @@ class Button {
public:
Button() { }
Button(Common::SeekableReadStream *stream, uint16 id, uint gameType);
+ Button(Common::SeekableReadStream *stream);
bool contains(const Common::Point &pos) const;
diff --git a/engines/composer/resource.h b/engines/composer/resource.h
index e2ce235..aeaa5b9 100644
--- a/engines/composer/resource.h
+++ b/engines/composer/resource.h
@@ -35,6 +35,7 @@ struct Animation;
#define ID_LBRC MKTAG('L','B','R','C') // Main FourCC
+#define ID_AMBI MKTAG('A','M','B','I') // Ambient (v1 sprite button)
#define ID_ANIM MKTAG('A','N','I','M') // Animation
#define ID_BMAP MKTAG('B','M','A','P') // Bitmap
#define ID_BUTN MKTAG('B','U','T','N') // Button
More information about the Scummvm-git-logs
mailing list