aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
authorPaul Gilbert2009-05-16 04:03:37 +0000
committerPaul Gilbert2009-05-16 04:03:37 +0000
commit358be385b53790d90e6974e0a237936fa59fbbb1 (patch)
tree9d24cdb2ab7fb0c98782153c4af7393f1384076c /engines/cruise
parentc3cf7420bd097df594b1d278091bdfe4acea2cdc (diff)
downloadscummvm-rg350-358be385b53790d90e6974e0a237936fa59fbbb1.tar.gz
scummvm-rg350-358be385b53790d90e6974e0a237936fa59fbbb1.tar.bz2
scummvm-rg350-358be385b53790d90e6974e0a237936fa59fbbb1.zip
Replaced value with proper constant, and named a previously un-named structure field
svn-id: r40616
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/backgroundIncrust.cpp14
-rw-r--r--engines/cruise/backgroundIncrust.h2
-rw-r--r--engines/cruise/saveload.cpp2
3 files changed, 10 insertions, 8 deletions
diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp
index df882ca85a..3d9abacea3 100644
--- a/engines/cruise/backgroundIncrust.cpp
+++ b/engines/cruise/backgroundIncrust.cpp
@@ -37,7 +37,7 @@ void resetBackgroundIncrustList(backgroundIncrustStruct *pHead) {
// blit background to another one
void addBackgroundIncrustSub1(int fileIdx, int X, int Y, char *ptr2, int16 scale, char *destBuffer, char *dataPtr) {
- assert(*dataPtr != 0);
+ assert((dataPtr != NULL) && (*dataPtr != 0));
buildPolyModel(X, Y, scale, ptr2, destBuffer, dataPtr);
}
@@ -142,7 +142,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx, int16 objectIdx,
newElement->X = params.X;
newElement->Y = params.Y;
newElement->scale = params.scale;
- newElement->field_E = params.fileIdx;
+ newElement->frame = params.fileIdx;
newElement->spriteId = filesDatabase[params.fileIdx].subData.index;
newElement->ptr = NULL;
strcpy(newElement->name, filesDatabase[params.fileIdx].subData.name);
@@ -195,7 +195,7 @@ void regenerateBackgroundIncrust(backgroundIncrustStruct *pHead) {
backgroundIncrustStruct* pl2 = pl->next;
bool bLoad = false;
- int frame = pl->field_E;
+ int frame = pl->frame;
//int screen = pl->backgroundIdx;
if ((filesDatabase[frame].subData.ptr == NULL) || (strcmp(pl->name, filesDatabase[frame].subData.name))) {
@@ -207,13 +207,15 @@ void regenerateBackgroundIncrust(backgroundIncrustStruct *pHead) {
}
}
- if (frame >= -1) {
- if (filesDatabase[frame].subData.resourceType == 4) { // sprite
+ if (frame >= 0) {
+ if (filesDatabase[frame].subData.resourceType == OBJ_TYPE_SPRITE) {
+ // Sprite
int width = filesDatabase[frame].width;
int height = filesDatabase[frame].height;
drawSprite(width, height, NULL, filesDatabase[frame].subData.ptr, pl->Y, pl->X, backgroundScreens[pl->backgroundIdx], filesDatabase[frame].subData.ptrMask);
- } else { // poly
+ } else {
+ // Poly
addBackgroundIncrustSub1(frame, pl->X, pl->Y, NULL, pl->scale, (char*)backgroundScreens[pl->backgroundIdx], (char *)filesDatabase[frame].subData.ptr);
}
}
diff --git a/engines/cruise/backgroundIncrust.h b/engines/cruise/backgroundIncrust.h
index 92db79cf13..19982ee91c 100644
--- a/engines/cruise/backgroundIncrust.h
+++ b/engines/cruise/backgroundIncrust.h
@@ -37,7 +37,7 @@ struct backgroundIncrustStruct {
uint16 overlayIdx;
int16 X;
int16 Y;
- uint16 field_E;
+ uint16 frame;
uint16 scale;
uint16 backgroundIdx;
uint16 scriptNumber;
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index 62db18923a..1301402254 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -453,7 +453,7 @@ static void syncIncrust(Common::Serializer &s) {
s.syncAsSint16LE(t->overlayIdx);
s.syncAsSint16LE(t->X);
s.syncAsSint16LE(t->Y);
- s.syncAsSint16LE(t->field_E);
+ s.syncAsSint16LE(t->frame);
s.syncAsSint16LE(t->scale);
s.syncAsSint16LE(t->backgroundIdx);
s.syncAsSint16LE(t->scriptNumber);