[Scummvm-cvs-logs] scummvm master -> 2a09159c2b0ff338e2e96491f897094ccdd6b273
sev-
sev at scummvm.org
Mon Jun 23 14:55:15 CEST 2014
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
89d789b122 GRAPHICS: Added BE/LE to TS_ macros
a493355af3 FULLPIPE: MovGraph::calcMovItems: renamed variables and added some comments
2a09159c2b FULLPIPE: Give better name to function
Commit: 89d789b122ebc362d4a4dce2bd1099904f13d78b
https://github.com/scummvm/scummvm/commit/89d789b122ebc362d4a4dce2bd1099904f13d78b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-06-23T15:39:31+03:00
Commit Message:
GRAPHICS: Added BE/LE to TS_ macros
Changed paths:
graphics/transparent_surface.h
diff --git a/graphics/transparent_surface.h b/graphics/transparent_surface.h
index ca26b26..efb2814 100644
--- a/graphics/transparent_surface.h
+++ b/graphics/transparent_surface.h
@@ -35,9 +35,13 @@
*
*/
-// TODO: Find a better solution for this.
-#define TS_RGB(R,G,B) (((R) << 24) | ((G) << 16) | (B << 8) | (A)
+#ifdef SCUMM_LITTLE_ENDIAN
+#define TS_RGB(R,G,B) ((0xff << 24) | ((R) << 16) | ((G) << 8) | (B))
#define TS_ARGB(A,R,G,B) (((R) << 24) | ((G) << 16) | ((B) << 8) | (A))
+#else
+#define TS_RGB(R,G,B) (((R) << 24) | ((G) << 16) | (B << 8) | 0xff)
+#define TS_ARGB(A,R,G,B) (((R) << 24) | ((G) << 16) | ((B) << 8) | (A))
+#endif
namespace Graphics {
Commit: a493355af3c06c1104d7a2f892b3323b499a66da
https://github.com/scummvm/scummvm/commit/a493355af3c06c1104d7a2f892b3323b499a66da
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-06-23T15:52:31+03:00
Commit Message:
FULLPIPE: MovGraph::calcMovItems: renamed variables and added some comments
Changed paths:
engines/fullpipe/motion.cpp
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 66d587f..1b7141f 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -1470,12 +1470,12 @@ Common::Array<MovArr *> *MovGraph::genMovArr(int x, int y, int *arrSize, int fla
return arr;
}
-void MovGraph::shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2) {
+void MovGraph::shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &allPaths) {
if (lnk == lnk2) {
for (uint i = 0; i < tempObList1.size(); i++)
- tempObList2.push_back(tempObList1[i]);
+ allPaths.push_back(tempObList1[i]);
- tempObList2.push_back(lnk);
+ allPaths.push_back(lnk);
} else {
lnk->_flags |= 0x80000000;
@@ -1492,39 +1492,42 @@ void MovGraph::shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<
}
if (!(l->_flags & 0xA0000000))
- shuffleTree(l, lnk2, tempObList1, tempObList2);
+ shuffleTree(l, lnk2, tempObList1, allPaths);
}
lnk->_flags &= 0x7FFFFFFF;
}
}
-Common::Array<MovItem *> *MovGraph::calcMovItems(MovArr *movarr1, MovArr *movarr2, int *listCount) {
+// Returns a list of possible paths two points in graph space
+Common::Array<MovItem *> *MovGraph::calcMovItems(MovArr *currPos, MovArr *destPos, int *pathCount) {
Common::Array<MovGraphLink *> tempObList1;
- Common::Array<MovGraphLink *> tempObList2;
+ Common::Array<MovGraphLink *> allPaths;
- shuffleTree(movarr1->_link, movarr2->_link, tempObList1, tempObList2);
+ // Get all paths between two edges of the graph
+ shuffleTree(currPos->_link, destPos->_link, tempObList1, allPaths);
- *listCount = 0;
+ *pathCount = 0;
- if (!tempObList2.size())
+ if (!allPaths.size())
return 0;
- *listCount = tempObList2.size();
+ *pathCount = allPaths.size();
Common::Array<MovItem *> *res = new Common::Array<MovItem *>;
- for (int i = 0; i < *listCount; i++) {
+ for (int i = 0; i < *pathCount; i++) {
MovItem *r = new MovItem;
- genMovItem(r, tempObList2[i], movarr1, movarr2);
+ genMovItem(r, allPaths[i], currPos, destPos);
res->push_back(r);
- delete tempObList2[i];
+ delete allPaths[i];
}
- movarr2->_link = movarr1->_link;
+ // Start the resulting path from current position
+ destPos->_link = currPos->_link;
return res;
}
Commit: 2a09159c2b0ff338e2e96491f897094ccdd6b273
https://github.com/scummvm/scummvm/commit/2a09159c2b0ff338e2e96491f897094ccdd6b273
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-06-23T15:54:28+03:00
Commit Message:
FULLPIPE: Give better name to function
Changed paths:
engines/fullpipe/motion.cpp
engines/fullpipe/motion.h
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 1b7141f..2d2fdfa 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -1470,7 +1470,7 @@ Common::Array<MovArr *> *MovGraph::genMovArr(int x, int y, int *arrSize, int fla
return arr;
}
-void MovGraph::shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &allPaths) {
+void MovGraph::findAllPaths(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &allPaths) {
if (lnk == lnk2) {
for (uint i = 0; i < tempObList1.size(); i++)
allPaths.push_back(tempObList1[i]);
@@ -1492,7 +1492,7 @@ void MovGraph::shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<
}
if (!(l->_flags & 0xA0000000))
- shuffleTree(l, lnk2, tempObList1, allPaths);
+ findAllPaths(l, lnk2, tempObList1, allPaths);
}
lnk->_flags &= 0x7FFFFFFF;
@@ -1505,7 +1505,7 @@ Common::Array<MovItem *> *MovGraph::calcMovItems(MovArr *currPos, MovArr *destPo
Common::Array<MovGraphLink *> allPaths;
// Get all paths between two edges of the graph
- shuffleTree(currPos->_link, destPos->_link, tempObList1, allPaths);
+ findAllPaths(currPos->_link, destPos->_link, tempObList1, allPaths);
*pathCount = 0;
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index 2cbf999..3c0a05b 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -370,7 +370,7 @@ public:
MovGraphNode *calcOffset(int ox, int oy);
int getItemIndexByStaticAni(StaticANIObject *ani);
Common::Array<MovArr *> *genMovArr(int x, int y, int *arrSize, int flag1, int flag2);
- void shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2);
+ void findAllPaths(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2);
Common::Array<MovItem *> *calcMovItems(MovArr *movarr1, MovArr *movarr2, int *listCount);
void genMovItem(MovItem *movitem, MovGraphLink *grlink, MovArr *movarr1, MovArr *movarr2);
bool calcChunk(int idx, int x, int y, MovArr *arr, int a6);
More information about the Scummvm-git-logs
mailing list