DREAMWEB: Minor cleanup

This commit is contained in:
Willem Jan Palenstijn 2011-12-23 20:45:51 +01:00
parent b6a6778843
commit 625a5ef2ed
2 changed files with 6 additions and 6 deletions

View File

@ -100,8 +100,8 @@ uint8 DreamBase::getMapAd(const uint8 *setData, uint16 *x, uint16 *y) {
return 1; return 1;
} }
void DreamBase::calcFrFrame(uint16 frameSeg, uint16 frameNum, uint8 *width, uint8 *height, uint16 x, uint16 y, ObjPos *objPos) { void DreamBase::calcFrFrame(const Frame *frameBase, uint16 frameNum, uint8 *width, uint8 *height, uint16 x, uint16 y, ObjPos *objPos) {
const Frame *frame = (const Frame *)getSegment(frameSeg).ptr(frameNum * sizeof(Frame), sizeof(Frame)); const Frame *frame = frameBase + frameNum;
*width = frame->width; *width = frame->width;
*height = frame->height; *height = frame->height;
@ -148,7 +148,7 @@ void DreamBase::showAllObs() {
if (currentFrame == 0xff) if (currentFrame == 0xff)
continue; continue;
uint8 width, height; uint8 width, height;
calcFrFrame(data.word(kSetframes), currentFrame, &width, &height, x, y, objPos); calcFrFrame(frameBase, currentFrame, &width, &height, x, y, objPos);
setEntry->index = setEntry->frames[0]; setEntry->index = setEntry->frames[0];
if ((setEntry->type == 0) && (setEntry->priority != 5) && (setEntry->priority != 6)) { if ((setEntry->type == 0) && (setEntry->priority != 5) && (setEntry->priority != 6)) {
x += data.word(kMapadx); x += data.word(kMapadx);
@ -229,7 +229,7 @@ void DreamBase::showAllFree() {
if (mapAd != 0) { if (mapAd != 0) {
uint8 width, height; uint8 width, height;
uint16 currentFrame = 3 * i; uint16 currentFrame = 3 * i;
calcFrFrame(data.word(kFreeframes), currentFrame, &width, &height, x, y, objPos); calcFrFrame(frameBase, currentFrame, &width, &height, x, y, objPos);
if ((width != 0) || (height != 0)) { if ((width != 0) || (height != 0)) {
x += data.word(kMapadx); x += data.word(kMapadx);
y += data.word(kMapady); y += data.word(kMapady);
@ -277,7 +277,7 @@ void DreamBase::showAllEx() {
continue; continue;
uint8 width, height; uint8 width, height;
uint16 currentFrame = 3 * i; uint16 currentFrame = 3 * i;
calcFrFrame(data.word(kExtras), currentFrame, &width, &height, x, y, objPos); calcFrFrame(frameBase, currentFrame, &width, &height, x, y, objPos);
if ((width != 0) || (height != 0)) { if ((width != 0) || (height != 0)) {
assert(currentFrame < 256); assert(currentFrame < 256);
showFrame(frameBase, x + data.word(kMapadx), y + data.word(kMapady), currentFrame, 0); showFrame(frameBase, x + data.word(kMapadx), y + data.word(kMapady), currentFrame, 0);

View File

@ -78,7 +78,7 @@ public:
uint8 getXAd(const uint8 *setData, uint8 *result); uint8 getXAd(const uint8 *setData, uint8 *result);
uint8 getYAd(const uint8 *setData, uint8 *result); uint8 getYAd(const uint8 *setData, uint8 *result);
uint8 getMapAd(const uint8 *setData, uint16 *x, uint16 *y); uint8 getMapAd(const uint8 *setData, uint16 *x, uint16 *y);
void calcFrFrame(uint16 frameSeg, uint16 frameNum, uint8* width, uint8* height, uint16 x, uint16 y, ObjPos *objPos); void calcFrFrame(const Frame *frameBase, uint16 frameNum, uint8* width, uint8* height, uint16 x, uint16 y, ObjPos *objPos);
void makeBackOb(SetObject *objData, uint16 x, uint16 y); void makeBackOb(SetObject *objData, uint16 x, uint16 y);
void showAllObs(); void showAllObs();
bool addAlong(const uint8 *mapFlags); bool addAlong(const uint8 *mapFlags);