aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Augereau2011-07-30 14:32:19 +0200
committerBertrand Augereau2011-07-30 14:32:19 +0200
commit2d0dfffe00628125da8aa43ebe188377ab9331f7 (patch)
treed1dbbefee1bf1b193562ded226f411857ac21620
parent8b0ac65f68e4fd2829b6c0205f72ef53d7a888b0 (diff)
downloadscummvm-rg350-2d0dfffe00628125da8aa43ebe188377ab9331f7.tar.gz
scummvm-rg350-2d0dfffe00628125da8aa43ebe188377ab9331f7.tar.bz2
scummvm-rg350-2d0dfffe00628125da8aa43ebe188377ab9331f7.zip
DREAMWEB: Introduced the Frame struct
-rw-r--r--engines/dreamweb/structs.h11
-rw-r--r--engines/dreamweb/vgagrafx.cpp14
2 files changed, 18 insertions, 7 deletions
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index b4d8c7e1c9..0e0215f126 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -73,3 +73,14 @@ struct ObjData {
uint8 b17;
uint8 b18[256]; // NB: Don't know the size yet
};
+
+struct Frame {
+ uint8 width;
+ uint8 height;
+ uint16 _ptr;
+ uint16 ptr() const { return READ_LE_UINT16(&_ptr); }
+ void setPtr(uint16 v) { WRITE_LE_UINT16(&_ptr, v); }
+ uint8 x;
+ uint8 y;
+};
+
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 25e5a93ebf..b10ef811b3 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -321,8 +321,8 @@ void DreamGenContext::showframe(uint16 src, uint16 x, uint16 y, uint16 frameNumb
ds = src;
ah = effectsFlag;
- si = frameNumber * 6;
- if (ds.word(si) == 0) {
+ const Frame *frame = (const Frame *)ds.ptr(frameNumber * sizeof(Frame), 6);
+ if ((frame->width == 0) && (frame->height == 0)) {
*width = 0;
*height = 0;
return;
@@ -330,14 +330,14 @@ void DreamGenContext::showframe(uint16 src, uint16 x, uint16 y, uint16 frameNumb
//notblankshow:
if ((effectsFlag & 128) == 0) {
- x += ds.byte(si + 4);
- y += ds.byte(si + 5);
+ x += frame->x;
+ y += frame->y;
}
//skipoffsets:
- *width = ds.byte(si + 0);
- *height = ds.byte(si + 1);
- si = ds.word(si+2) + 2080;
+ *width = frame->width;
+ *height = frame->height;
+ si = frame->ptr() + 2080;
const uint8 *pSrc = ds.ptr(si, *width * *height);
if (effectsFlag) {