aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinterGrascph2016-05-12 21:10:45 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commitaf6e6ca4682981e6d193968e508531055e18c52e (patch)
treedcb0e438b0077da6b18f5071401df38f7a625a55
parent16199b4091e4fae39a6569d985e2b460c7d2516b (diff)
downloadscummvm-rg350-af6e6ca4682981e6d193968e508531055e18c52e.tar.gz
scummvm-rg350-af6e6ca4682981e6d193968e508531055e18c52e.tar.bz2
scummvm-rg350-af6e6ca4682981e6d193968e508531055e18c52e.zip
DM: Refactor Frame POD
-rw-r--r--engines/dm/gfx.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 11c2d81875..603021e8a1 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -30,17 +30,22 @@ enum GraphicIndice {
gCeilingIndice = 76
};
+// The frames in the orignal sources contain inclusive boundaries and byte widths, not pixel widths
struct Frame {
- // FIXME: these bundaries are inclusive, workaround by adding +1 in the drawFrame methods
uint16 destFromX, destToX, destFromY, destToY;
- // srcWidth and srcHeight (present in the original sources) is redundant here, can be deduced from gaphicsIndice
+ uint16 srcWidth, srcHeight;
uint16 srcX, srcY;
+
+ Frame(uint16 destFromX, uint16 destToX, uint16 destFromY, uint16 destToY,
+ uint16 srcWidth, uint16 srcHeight, uint16 srcX, uint16 srcY):
+ destFromX(destFromX), destToX(destToX + 1), destFromY(destFromY), destToY(destToY + 1),
+ srcWidth(srcWidth * 2), srcHeight(srcHeight), srcX(srcX), srcY(srcY) {}
};
-Frame gCeilingFrame = {0, 223, 0, 28, 0, 0};
-Frame gFloorFrame = {0, 223, 66, 135, 0, 0};
-Frame gWallFrameD3L2 = {0, 15, 25, 73, 0, 0}; // @ FRAME G0711_s_Graphic558_Frame_Wall_D3L2
-Frame gWallFrameD3R2 = {208, 223, 25, 73, 0, 0}; // @ G0712_s_Graphic558_Frame_Wall_D3R2
+Frame gCeilingFrame(0, 223, 0, 28, 112, 29, 0, 0);
+Frame gFloorFrame(0, 223, 66, 135, 112, 70, 0, 0);
+Frame gWallFrameD3L2(0, 15, 25, 73, 8, 49, 0, 0); // @ FRAME G0711_s_Graphic558_Frame_Wall_D3L2
+Frame gWallFrameD3R2(208, 223, 25, 73, 8, 49, 0, 0); // @ G0712_s_Graphic558_Frame_Wall_D3R2
extern Viewport gDefultViewPort = {0, 0};
extern Viewport gDungeonViewport = {0, 64}; // TODO: I guessed the numbers
@@ -59,8 +64,8 @@ DisplayMan::~DisplayMan() {
delete[] _packedItemPos;
delete[] _vgaBuffer;
delete[] _bitmaps;
- delete[] _wallSetBitMaps[13]; // copy of another bitmap, just flipped
- delete[] _wallSetBitMaps[14]; // copy of another bitmap, just flipped
+ delete[] _wallSetBitMaps[13]; // copy of another bitmap, but flipped
+ delete[] _wallSetBitMaps[14]; // copy of another bitmap, but flipped
}
void DisplayMan::setUpScreens(uint16 width, uint16 height) {
@@ -244,7 +249,7 @@ uint16 DisplayMan::height(uint16 index) {
}
void DisplayMan::drawWallSetBitmap(byte *bitmap, Frame &f, uint16 srcWidth) {
- blitToScreen(bitmap, srcWidth, f.srcX, f.srcY, f.destFromX, f.destToX + 1, f.destFromY, f.destToY + 1, kColorFlesh, gDungeonViewport);
+ blitToScreen(bitmap, srcWidth, f.srcX, f.srcY, f.destFromX, f.destToX, f.destFromY, f.destToY, kColorFlesh, gDungeonViewport);
}