DREAMWEB: 'showframe' takes a Frame

This commit is contained in:
Bertrand Augereau 2011-08-11 03:30:41 +02:00
parent c2e9f01ae4
commit d5a184e2f0
4 changed files with 10 additions and 10 deletions

View file

@ -67,7 +67,7 @@ void DreamGenContext::printasprite(const Sprite *sprite) {
else
c = 0;
uint8 width, height;
showframe(segRef(sprite->frameData()).ptr(0, 0), x, y, sprite->b15, c, &width, &height);
showframe((const Frame *)segRef(sprite->frameData()).ptr(0, 0), x, y, sprite->b15, c, &width, &height);
}
void DreamGenContext::clearsprites() {
@ -529,10 +529,10 @@ void DreamGenContext::findsource() {
}
}
void *DreamGenContext::findsourceCPP() {
Frame *DreamGenContext::findsourceCPP() {
push(ds);
findsource();
void *result = ds.ptr(0, 0);
Frame *result = (Frame *)ds.ptr(0, 0);
ds = pop();
return result;
}
@ -546,7 +546,7 @@ void DreamGenContext::showreelframe(Reel *reel) {
uint16 x = reel->x + data.word(kMapadx);
uint16 y = reel->y + data.word(kMapady);
data.word(kCurrentframe) = reel->frame();
void *source = findsourceCPP();
Frame *source = findsourceCPP();
uint16 frame = data.word(kCurrentframe) - data.word(kTakeoff);
uint8 width, height;
showframe(source, x, y, frame, 8, &width, &height);

View file

@ -867,7 +867,7 @@ void DreamGenContext::crosshair() {
}
push(ds);
ds = data.word(kIcons1);
uint8 *src = ds.ptr(0, 0);
Frame *src = (Frame *)ds.ptr(0, 0);
ds = pop();
uint8 width, height;
showframe(src, kZoomx + 24, kZoomy + 19, frame, 0, &width, &height);

View file

@ -65,7 +65,7 @@
void startloading(const Room *room);
Sprite *spritetable();
void showframe();
void showframe(const void *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height);
void showframe(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height);
void printasprite(const Sprite *sprite);
void width160();
void multiput(const uint8 *src, uint16 x, uint16 y, uint8 width, uint8 height);
@ -94,7 +94,7 @@
void lockeddoorway(Sprite *sprite, ObjData *objData);
void liftsprite(Sprite *sprite, ObjData *objData);
void findsource();
void *findsourceCPP();
Frame *findsourceCPP();
void showreelframe();
void showreelframe(Reel *reel);
void turnpathonCPP(uint8 param);

View file

@ -314,8 +314,8 @@ void DreamGenContext::frameoutv(uint8 *dst, const uint8 *src, uint16 pitch, uint
}
}
void DreamGenContext::showframe(const void *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) {
const Frame *frame = ((const Frame *)frameData) + frameNumber;
void DreamGenContext::showframe(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) {
const Frame *frame = frameData + frameNumber;
if ((frame->width == 0) && (frame->height == 0)) {
*width = 0;
*height = 0;
@ -371,7 +371,7 @@ void DreamGenContext::showframe(const void *frameData, uint16 x, uint16 y, uint1
void DreamGenContext::showframe() {
uint8 width, height;
showframe(ds.ptr(0, 0), di, bx, ax & 0x1ff, ah & 0xfe, &width, &height);
showframe((Frame *)ds.ptr(0, 0), di, bx, ax & 0x1ff, ah & 0xfe, &width, &height);
cl = width;
ch = height;
}