[Scummvm-git-logs] scummvm master -> c1ed17ce861d7434f5b1aabb70a54cef250b6378
dreammaster
dreammaster at scummvm.org
Fri Jul 28 04:31:31 CEST 2017
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:
c1ed17ce86 TITANIC: Cleanup/renaming of inventory glyph animatin code
Commit: c1ed17ce861d7434f5b1aabb70a54cef250b6378
https://github.com/scummvm/scummvm/commit/c1ed17ce861d7434f5b1aabb70a54cef250b6378
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-07-27T22:31:24-04:00
Commit Message:
TITANIC: Cleanup/renaming of inventory glyph animatin code
Changed paths:
engines/titanic/pet_control/pet_inventory.cpp
engines/titanic/pet_control/pet_inventory.h
engines/titanic/pet_control/pet_inventory_glyphs.cpp
engines/titanic/pet_control/pet_inventory_glyphs.h
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index aa1bb31..e7e8e1f 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -244,13 +244,13 @@ CGameObject *CPetInventory::getImage(int index) {
return nullptr;
}
-void CPetInventory::playMovie(CGameObject *movie, int flag) {
+void CPetInventory::playMovie(CGameObject *movie, bool repeat) {
if (_movie)
_movie->stopMovie();
_movie = movie;
if (_movie) {
- if (flag)
+ if (repeat)
_movie->playMovie(0, 14, MOVIE_REPEAT);
else
_movie->playMovie(0);
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 7efc075..8a95efb 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -166,7 +166,7 @@ public:
/**
* Play the animated movie for an object
*/
- void playMovie(CGameObject *movie, int flag);
+ void playMovie(CGameObject *movie, bool repeat = true);
};
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index bda88ba..9422eb6 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -36,7 +36,7 @@ const uint ITEM_MODES[40] = {
};
void CPetInventoryGlyph::enter() {
- startBackgroundMovie();
+ startRepeatedMovie();
}
void CPetInventoryGlyph::leave() {
@@ -59,7 +59,7 @@ void CPetInventoryGlyph::drawAt(CScreenManager *screenManager, const Point &pt,
_image = nullptr;
if (_background && isHighlighted_) {
_background->setPosition(pt);
- startBackgroundMovie();
+ startRepeatedMovie();
}
}
@@ -302,19 +302,19 @@ int CPetInventoryGlyph::getItemIndex(CGameObject *item, bool isLoading) {
return movieFrame;
}
-void CPetInventoryGlyph::startBackgroundMovie() {
+void CPetInventoryGlyph::startRepeatedMovie() {
if (_owner) {
CPetInventory *section = dynamic_cast<CPetInventory *>(_owner->getOwner());
if (section)
- section->playMovie(_background, MOVIE_REPEAT);
+ section->playMovie(_background, true);
}
}
-void CPetInventoryGlyph::startForegroundMovie() {
+void CPetInventoryGlyph::startSingularMovie() {
if (_owner) {
CPetInventory *section = dynamic_cast<CPetInventory *>(_owner->getOwner());
if (section)
- section->playMovie(_image, MOVIE_REPEAT);
+ section->playMovie(_image, false);
}
}
@@ -322,17 +322,19 @@ void CPetInventoryGlyph::stopMovie() {
if (_owner) {
CPetInventory *section = dynamic_cast<CPetInventory *>(_owner->getOwner());
if (section)
- section->playMovie(nullptr, MOVIE_REPEAT);
+ section->playMovie(nullptr);
}
}
void CPetInventoryGlyph::reposition(const Point &pt) {
if (_image) {
+ // Special transformation of item to piece of Titania
_image->setPosition(pt);
- startForegroundMovie();
+ startSingularMovie();
} else if (_background) {
+ // Standard repeating animation
_background->setPosition(pt);
- startBackgroundMovie();
+ startRepeatedMovie();
}
}
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
index cf1cfb3..e35ecc0 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.h
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -44,14 +44,15 @@ private:
int getItemIndex(CGameObject *item, bool isLoading);
/**
- * Start any movie for the background
+ * Start a repeated animation for the item
*/
- void startBackgroundMovie();
+ void startRepeatedMovie();
/**
- * Start any movie for the foreground item
+ * Start a singular (non-repeating) animation for the item,
+ * such as an item's transformation into a piece of Titania
*/
- void startForegroundMovie();
+ void startSingularMovie();
/**
* Stop any previously started foreground or background movie
More information about the Scummvm-git-logs
mailing list