Skip to content

Commit

Permalink
DM: Add some default statements in switches, change the scope of name…
Browse files Browse the repository at this point in the history
…space DM in gfx.cpp
  • Loading branch information
Strangerke authored and Bendegúz Nagy committed Aug 26, 2016
1 parent 0ad91df commit 8ffd4a0
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions engines/dm/gfx.cpp
Expand Up @@ -558,9 +558,7 @@ byte gAlcoveOrnIndices[kAlcoveOrnCount] = { // @ G0192_auc_Graphic558_AlcoveOrna
1, /* Square Alcove */
2, /* Vi Altar */
3}; /* Arched Alcove */
}

using namespace DM;

DisplayMan::DisplayMan(DMEngine *dmEngine) : _vm(dmEngine) {
_vgaBuffer = nullptr;
Expand Down Expand Up @@ -805,13 +803,14 @@ void DisplayMan::blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcHeight
}

void DisplayMan::flipBitmapHorizontal(byte *bitmap, uint16 width, uint16 height) {
for (uint16 y = 0; y < height; ++y)
for (uint16 y = 0; y < height; ++y) {
for (uint16 x = 0; x < width / 2; ++x) {
byte tmp;
tmp = bitmap[y*width + x];
bitmap[y*width + x] = bitmap[y*width + width - 1 - x];
bitmap[y*width + width - 1 - x] = tmp;
}
}
}

void DisplayMan::flipBitmapVertical(byte *bitmap, uint16 width, uint16 height) {
Expand Down Expand Up @@ -875,6 +874,8 @@ void DisplayMan::drawSquareD3L(direction dir, int16 posX, int16 posY) {
// ... missing code
}
break;
default:
break;
}
}

Expand All @@ -895,6 +896,8 @@ void DisplayMan::drawSquareD3R(direction dir, int16 posX, int16 posY) {
// ... missing code
}
break;
default:
break;
}
}
void DisplayMan::drawSquareD3C(direction dir, int16 posX, int16 posY) {
Expand All @@ -913,6 +916,8 @@ void DisplayMan::drawSquareD3C(direction dir, int16 posX, int16 posY) {
//... missing code
}
break;
default:
break;
}
}
void DisplayMan::drawSquareD2L(direction dir, int16 posX, int16 posY) {
Expand All @@ -935,6 +940,8 @@ void DisplayMan::drawSquareD2L(direction dir, int16 posX, int16 posY) {
case kStairsSideElemType:
drawFloorPitOrStairsBitmap(kStairsNativeIndex_Side_D2L, gStairFrames[kFrameStairsSide_D2L]);
break;
default:
break;
}
}
void DisplayMan::drawSquareD2R(direction dir, int16 posX, int16 posY) {
Expand All @@ -957,6 +964,8 @@ void DisplayMan::drawSquareD2R(direction dir, int16 posX, int16 posY) {
case kStairsSideElemType:
drawFloorPitOrStairsBitmapFlippedHorizontally(kStairsNativeIndex_Side_D2L, gStairFrames[kFrameStairsSide_D2R]);
break;
default:
break;
}
}
void DisplayMan::drawSquareD2C(direction dir, int16 posX, int16 posY) {
Expand All @@ -975,6 +984,8 @@ void DisplayMan::drawSquareD2C(direction dir, int16 posX, int16 posY) {
// ... missing code
}
break;
default:
break;
}
}
void DisplayMan::drawSquareD1L(direction dir, int16 posX, int16 posY) {
Expand All @@ -997,6 +1008,8 @@ void DisplayMan::drawSquareD1L(direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmap(kStairsNativeIndex_Down_Side_D1L, gStairFrames[kFrameStairsDownSide_D1L]);
break;
default:
break;
}
}
void DisplayMan::drawSquareD1R(direction dir, int16 posX, int16 posY) {
Expand All @@ -1019,6 +1032,8 @@ void DisplayMan::drawSquareD1R(direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmapFlippedHorizontally(kStairsNativeIndex_Down_Side_D1L, gStairFrames[kFrameStairsDownSide_D1R]);
break;
default:
break;
}
}
void DisplayMan::drawSquareD1C(direction dir, int16 posX, int16 posY) {
Expand All @@ -1040,6 +1055,8 @@ void DisplayMan::drawSquareD1C(direction dir, int16 posX, int16 posY) {
// .... code not yet implemneted
}
break;
default:
break;
}
}

Expand All @@ -1054,6 +1071,8 @@ void DisplayMan::drawSquareD0L(direction dir, int16 posX, int16 posY) {
case kWallElemType:
drawWallSetBitmap(_wallSetBitMaps[kWall_D0L], gFrameWalls[kViewSquare_D0L]);
break;
default:
break;
}
}

Expand All @@ -1068,6 +1087,8 @@ void DisplayMan::drawSquareD0R(direction dir, int16 posX, int16 posY) {
case kWallElemType:
drawWallSetBitmap(_wallSetBitMaps[kWall_D0R], gFrameWalls[kViewSquare_D0R]);
break;
default:
break;
}
}

Expand All @@ -1084,6 +1105,8 @@ void DisplayMan::drawSquareD0C(direction dir, int16 posX, int16 posY) {
drawFloorPitOrStairsBitmapFlippedHorizontally(kStairsNativeIndex_Down_Front_D0C_Left, gStairFrames[kFrameStairsDownFront_D0R]);
}
break;
default:
break;
}
}

Expand Down Expand Up @@ -1531,3 +1554,5 @@ void DisplayMan::blitToScreen(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uin
Color transparent, Viewport &viewport) {
blitToScreen(srcBitmap, srcWidth, srcX, srcY, box._x1, box._x2, box._y1, box._y2, transparent, viewport);
}

}

0 comments on commit 8ffd4a0

Please sign in to comment.