aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/champion.cpp37
-rw-r--r--engines/dm/dm.cpp7
-rw-r--r--engines/dm/dm.h3
-rw-r--r--engines/dm/gfx.cpp65
-rw-r--r--engines/dm/gfx.h24
-rw-r--r--engines/dm/inventory.cpp37
-rw-r--r--engines/dm/menus.cpp28
-rw-r--r--engines/dm/objectman.cpp12
-rw-r--r--engines/dm/text.cpp25
-rw-r--r--engines/dm/text.h8
10 files changed, 122 insertions, 124 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index a708251a62..62fff7f7b3 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -751,7 +751,8 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
if (_g407_party._shieldDefense > 0)
nativeBitmapIndices[AL_0_borderCount++] = k37_BorderPartyShieldIndice;
while (AL_0_borderCount--) {
- dispMan.blitToScreen(dispMan.getBitmap(nativeBitmapIndices[AL_0_borderCount]), 80, 0, 0, box, k10_ColorFlesh);
+ dispMan.blitToBitmap(dispMan.getBitmap(nativeBitmapIndices[AL_0_borderCount]), 80, 0, 0,
+ dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k10_ColorFlesh);
}
if (isInventoryChamp) {
invMan.drawStatusBoxPortrait(champIndex);
@@ -760,8 +761,9 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
champAttributes |= (k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x2000_ChampionAttributeWounds | k0x8000_ChampionAttributeActionHand);
}
} else {
- dispMan.blitToScreen(dispMan.getBitmap(k8_StatusBoxDeadChampion), 80, 0, 0, box, k255_ColorNoTransparency);
- _vm->_textMan->printTextToScreen(champStatusBoxX + 1, 5, k13_ColorLightestGray, k1_ColorDarkGary, champ->_name);
+ dispMan.blitToBitmap(dispMan.getBitmap(k8_StatusBoxDeadChampion), 80, 0, 0,
+ dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency);
+ _vm->_textMan->f53_printToLogicalScreen(champStatusBoxX + 1, 5, k13_ColorLightestGray, k1_ColorDarkGary, champ->_name);
menuMan.drawActionIcon(champIndex);
goto T0292042_green;
}
@@ -788,7 +790,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
box._x1 = champStatusBoxX;
box._x2 = box._x1 + 42 + 1;
dispMan.clearScreenBox(k1_ColorDarkGary, box);
- _vm->_textMan->printTextToScreen(champStatusBoxX + 1, 5, AL_0_colorIndex, k1_ColorDarkGary, champ->_name);
+ _vm->_textMan->f53_printToLogicalScreen(champStatusBoxX + 1, 5, AL_0_colorIndex, k1_ColorDarkGary, champ->_name);
}
}
@@ -802,7 +804,8 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
} else {
AL_2_nativeBitmapIndex = k33_SlotBoxNormalIndice;
}
- dispMan.blitToScreen(dispMan.getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0, gBoxMouth, k12_ColorDarkestGray, g296_DungeonViewport);
+ dispMan.blitToBitmap(dispMan.getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0,
+ dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, gBoxMouth, k12_ColorDarkestGray);
AL_2_nativeBitmapIndex = k33_SlotBoxNormalIndice;
for (int16 AL_0_statisticIndex = k1_ChampionStatStrength; AL_0_statisticIndex <= k6_ChampionStatAntifire; AL_0_statisticIndex++) {
if (champ->getStatistic((ChampionStatisticType)AL_0_statisticIndex, k1_ChampionStatCurrent)
@@ -811,7 +814,8 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
break;
}
}
- dispMan.blitToScreen(dispMan.getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0, gBoxEye, k12_ColorDarkestGray, g296_DungeonViewport);
+ dispMan.blitToBitmap(dispMan.getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0,
+ dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, gBoxEye, k12_ColorDarkestGray);
champAttributes |= k0x4000_ChampionAttributeViewport;
}
}
@@ -854,8 +858,8 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
if ((champAttributes & k28_ChampionIcons) && (eventMan._g599_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(AL_0_championIconIndex))) {
dispMan.clearScreenBox(g46_ChampionColor[champIndex], g54_BoxChampionIcons[AL_0_championIconIndex]);
- dispMan.blitToScreen(dispMan.getBitmap(k28_ChampionIcons), 80, championIconIndex(champ->_dir, _vm->_dungeonMan->_g308_partyDir) * 19, 0,
- g54_BoxChampionIcons[AL_0_championIconIndex], k12_ColorDarkestGray);
+ dispMan.blitToBitmap(dispMan.getBitmap(k28_ChampionIcons), 80, championIconIndex(champ->_dir, _vm->_dungeonMan->_g308_partyDir) * 19, 0,
+ dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g54_BoxChampionIcons[AL_0_championIconIndex], k12_ColorDarkestGray);
}
}
@@ -881,7 +885,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
}
if (champAttributes & k0x4000_ChampionAttributeViewport) {
- warning("MISSGIN CODE: F0097_DUNGEONVIEW_DrawViewport");
+ dispMan.f97_drawViewport(k0_viewportNotDungeonView);
}
@@ -975,8 +979,13 @@ void ChampionMan::drawSlot(uint16 champIndex, ChampionSlot slotIndex) {
if (nativeBitmapIndex != -1) {
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
- _vm->_displayMan->blitToScreen(_vm->_displayMan->getBitmap(nativeBitmapIndex), 32, 0, 0,
- box, k12_ColorDarkestGray, isInventoryChamp ? g296_DungeonViewport : gDefultViewPort);
+ if (isInventoryChamp) {
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->getBitmap(nativeBitmapIndex), 32, 0, 0,
+ _vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, box, k12_ColorDarkestGray);
+ } else {
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->getBitmap(nativeBitmapIndex), 32, 0, 0,
+ _vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, box, k12_ColorDarkestGray);
+ }
}
_vm->_objectMan->drawIconInSlotBox(slotBoxIndex, iconIndex);
@@ -998,8 +1007,9 @@ void ChampionMan::renameChampion(Champion* champ) {
box._x1 = 3;
box._x2 = box._x1 + 167;
- dispMan.clearScreenBox(k12_ColorDarkestGray, box, g296_DungeonViewport);
- dispMan.blitToScreen(dispMan.getBitmap(k27_PanelRenameChampionIndice), 144, 0, 0, g32_BoxPanel, k4_ColorCyan, g296_DungeonViewport);
+ dispMan.f135_fillBoxBitmap(dispMan._g296_bitmapViewport, box, k12_ColorDarkestGray, k112_byteWidthViewport * 2, k136_heightViewport);
+ dispMan.blitToBitmap(dispMan.getBitmap(k27_PanelRenameChampionIndice), 144, 0, 0,
+ dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k4_ColorCyan);
textMan.printToViewport(177, 58, k13_ColorLightestGray, "_______");
textMan.printToViewport(105, 76, k13_ColorLightestGray, "___________________");
Common::Point clickPos;
@@ -1009,6 +1019,7 @@ void ChampionMan::renameChampion(Champion* champ) {
if (_vm->_eventMan->hasPendingClick(clickPos, k1_LeftMouseButton) && okButtonBox.isPointInside(clickPos)) {
return;
}
+ dispMan.f97_drawViewport(k0_viewportNotDungeonView);
dispMan.updateScreen();
}
}
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index ec455c44f0..f7e9e8fbbd 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -263,11 +263,14 @@ void DMEngine::gameloop() {
if (!_inventoryMan->_g432_inventoryChampionOrdinal && !_championMan->_g300_partyIsSleeping) {
Box box(0, 224, 0, 126);
- _displayMan->clearScreenBox(k0_ColorBlack, box, g296_DungeonViewport); // dummy code
+ _displayMan->f135_fillBoxBitmap(_displayMan->_g296_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport * 2, k136_heightViewport); // dummy code
_displayMan->drawDungeon(_dungeonMan->_g308_partyDir, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY);
}
- // DUMMY CODE: next line
+
+ // DUMMY CODE: next 2 lines
_menuMan->drawMovementArrows();
+ _displayMan->f97_drawViewport(k1_viewportDungeonView);
+
_displayMan->updateScreen();
_system->delayMillis(10);
}
diff --git a/engines/dm/dm.h b/engines/dm/dm.h
index d439cfadae..7837ac4716 100644
--- a/engines/dm/dm.h
+++ b/engines/dm/dm.h
@@ -96,6 +96,9 @@ enum Cell {
k3_CellSouthWest = 3 // @ C03_CELL_SOUTHWEST
};
+#define kM1_mapIndexNone -1 // @ CM1_MAP_INDEX_NONE
+#define k255_mapIndexEntrance 255 // @ C255_MAP_INDEX_ENTRANCE
+
class Thing {
uint16 _data;
public:
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index d41bf4900a..f430222d30 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -577,8 +577,6 @@ byte g222_PalChangesCreature_D2[16] = {0, 10, 20, 30, 40, 30, 60, 70, 50, 0, 0,
-Viewport gDefultViewPort(0, 0, 320, 200);
-Viewport g296_DungeonViewport(0, 33, 224, 136); // @ G0296_puc_Bitmap_Viewport
byte g17_PalChangesNoChanges[16] = {0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150}; // @ G0017_auc_Graphic562_PaletteChanges_NoChanges
@@ -955,7 +953,7 @@ void DisplayMan::f565_viewportSetPalette(uint16* middleScreenPalette, uint16* to
void DisplayMan::f566_viewportBlitToScreen() {
warning("MISSING FUNCTIONALITY: using correct colorpalette");
- Box box(0, 33, 223, 135);
+ Box box(0, 223, 33, 33 + 135);
blitToBitmap(_g296_bitmapViewport, k112_byteWidthViewport * 2, 0, 0, _g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency);
}
@@ -1020,12 +1018,12 @@ void DisplayMan::loadIntoBitmap(uint16 index, byte *destBitmap) {
}
-void DisplayMan::blitToBitmap(byte* srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY, byte* destBitmap, uint16 destWidth, Box& box, Color transparent, Viewport& viewport) {
+void DisplayMan::blitToBitmap(byte* srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY, byte* destBitmap, uint16 destWidth, Box& box, Color transparent) {
for (uint16 y = 0; y < box._y2 - box._y1; ++y)
for (uint16 x = 0; x < box._x2 - box._x1; ++x) {
byte srcPixel = srcBitmap[srcWidth * (y + srcY) + srcX + x];
if (srcPixel != transparent)
- destBitmap[destWidth * (y + box._y1 + viewport._posY) + box._x1 + x + viewport._posX] = srcPixel;
+ destBitmap[destWidth * (y + box._y1) + box._x1 + x] = srcPixel;
}
}
@@ -1035,30 +1033,24 @@ void DisplayMan::blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcHeight
memcpy(destBitmap + destWidth*(y + destY) + destX, srcBitmap + y * srcWidth, sizeof(byte)* srcWidth);
}
-void DisplayMan::clearScreenBox(Color color, Box &box, Viewport &viewport) {
+void DisplayMan::clearScreenBox(Color color, Box &box) {
uint16 width = box._x2 - box._x1;
- for (int y = box._y1 + viewport._posY; y < box._y2 + viewport._posY; ++y)
- memset(_g348_bitmapScreen + y * _screenWidth + box._x1 + viewport._posX, color, sizeof(byte) * width);
+ for (int16 y = box._y1; y < box._y2; ++y)
+ memset(_g348_bitmapScreen + y * _screenWidth + box._x1, color, sizeof(byte) * width);
}
-void DisplayMan::blitToScreen(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY,
- Box &box,
- Color transparent, Viewport &viewport) {
- blitToBitmap(srcBitmap, srcWidth, srcX, srcY, _g348_bitmapScreen, k160_byteWidthScreen * 2, box, transparent, viewport);
+void DisplayMan::f135_fillBoxBitmap(byte* destBitmap, Box &box, Color color, int16 pixelWidth, int16 height) {
+ for (int16 y = box._y1; y < box._y2; ++y)
+ memset(destBitmap + y * pixelWidth + box._x1, color, sizeof(byte) * (box._x2 - box._x1));
}
void DisplayMan::blitBoxFilledWithMaskedBitmap(byte* src, byte* dest, byte* mask, byte* tmp, Box& box,
int16 lastUnitIndex, int16 firstUnitIndex, int16 destPixelWidth, Color transparent,
- int16 xPos, int16 yPos, int16 destHeight, int16 height2, Viewport &viewport) {
+ int16 xPos, int16 yPos, int16 destHeight, int16 height2) {
warning("STUB FUNCTION: does nothing at all");
}
-void DisplayMan::blitBoxFilledWithMaskedBitmapToScreen(byte* src, byte* mask, byte* tmp, Box& box,
- int16 lastUnitIndex, int16 firstUnitIndex, int16 destPixelWidth, Color transparent,
- int16 xPos, int16 yPos, int16 destHeight, int16 height2, Viewport& viewport) {
- blitBoxFilledWithMaskedBitmap(src, _g348_bitmapScreen, mask, tmp, box, lastUnitIndex, firstUnitIndex, _screenWidth, transparent, xPos, yPos, _screenHeight, height2, viewport);
-}
void DisplayMan::flipBitmapHorizontal(byte *bitmap, uint16 width, uint16 height) {
for (uint16 y = 0; y < height; ++y) {
@@ -1166,12 +1158,12 @@ void DisplayMan::f99_copyBitmapAndFlipHorizontal(byte* srcBitmap, byte* destBitm
void DisplayMan::drawWallSetBitmapWithoutTransparency(byte *bitmap, Frame &f) {
if (f._srcWidth)
- blitToScreen(bitmap, f._srcWidth, f._srcX, f._srcY, f._box, k255_ColorNoTransparency, g296_DungeonViewport);
+ blitToBitmap(bitmap, f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k255_ColorNoTransparency);
}
void DisplayMan::drawWallSetBitmap(byte *bitmap, Frame &f) {
if (f._srcWidth)
- blitToScreen(bitmap, f._srcWidth, f._srcX, f._srcY, f._box, k10_ColorFlesh, g296_DungeonViewport);
+ blitToBitmap(bitmap, f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k10_ColorFlesh);
}
@@ -1578,6 +1570,7 @@ void DisplayMan::drawDungeon(direction dir, int16 posX, int16 posY) {
}
delete[] tmpBitmap;
+ f97_drawViewport((_vm->_dungeonMan->_g309_partyMapIndex != k255_mapIndexEntrance) ? 1 : 0);
}
void DisplayMan::clearScreen(Color color) {
@@ -1752,16 +1745,15 @@ void DisplayMan::applyCreatureReplColors(int replacedColor, int replacementColor
}
void DisplayMan::drawFloorPitOrStairsBitmap(uint16 nativeIndex, Frame &f) {
- if (f._srcWidth) {
- blitToScreen(_bitmaps[nativeIndex], f._srcWidth, f._srcX, f._srcY, f._box, k10_ColorFlesh, g296_DungeonViewport);
- }
+ if (f._srcWidth)
+ blitToBitmap(_bitmaps[nativeIndex], f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k10_ColorFlesh);
}
void DisplayMan::drawFloorPitOrStairsBitmapFlippedHorizontally(uint16 nativeIndex, Frame &f) {
if (f._srcWidth) {
blitToBitmap(_bitmaps[nativeIndex], f._srcWidth, f._srcHeight, _g74_tmpBitmap, f._srcWidth);
flipBitmapHorizontal(_g74_tmpBitmap, f._srcWidth, f._srcHeight);
- blitToScreen(_g74_tmpBitmap, f._srcWidth, f._srcX, f._srcY, f._box, k10_ColorFlesh, g296_DungeonViewport);
+ blitToBitmap(_g74_tmpBitmap, f._srcWidth, f._srcX, f._srcY, _g296_bitmapViewport, k112_byteWidthViewport * 2, f._box, k10_ColorFlesh);
}
}
@@ -1826,7 +1818,8 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex
if (viewWallIndex == k12_ViewWall_D1C_FRONT) {
if (isInscription) {
Frame &D1CFrame = g163_FrameWalls[k6_ViewSquare_D1C];
- blitToScreen(_g700_bitmapWallSet_Wall_D1LCR, D1CFrame._srcWidth, 94, 28, g202_BoxWallPatchBehindInscription, k255_ColorNoTransparency, g296_DungeonViewport);
+ blitToBitmap(_g700_bitmapWallSet_Wall_D1LCR, D1CFrame._srcWidth, 94, 28, _g296_bitmapViewport, k112_byteWidthViewport * 2,
+ g202_BoxWallPatchBehindInscription, k255_ColorNoTransparency);
unsigned char *string = inscriptionString;
bitmapRed = _bitmaps[k120_InscriptionFontIndice];
@@ -1840,7 +1833,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex
frame._box._x2 = (frame._box._x1 = 112 - (characterCount * 4)) + 7;
frame._box._y1 = (frame._box._y2 = g203_InscriptionLineY[textLineIndex++]) - 7;
while (characterCount--) {
- blitToScreen(bitmapRed, 288, (*string++) * 8, 0, frame._box, k10_ColorFlesh, g296_DungeonViewport);
+ blitToBitmap(bitmapRed, 288, (*string++) * 8, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, frame._box, k10_ColorFlesh);
frame._box._x1 += 8;
frame._box._x2 += 8;
}
@@ -1929,12 +1922,12 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex
coordinateSetA[3] = g204_UnreadableInscriptionBoxY2[g190_WallOrnDerivedBitmapIndexIncrement[viewWallIndex] * 3 + unreadableTextLineCount - 1];
}
}
- blitToScreen(bitmapGreen, coordinateSetA[4], var_X, 0, *(Box*)coordinateSetA, k10_ColorFlesh, g296_DungeonViewport);
+ blitToBitmap(bitmapGreen, coordinateSetA[4], var_X, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, *(Box*)coordinateSetA, k10_ColorFlesh);
if ((viewWallIndex == k12_ViewWall_D1C_FRONT) && _g289_championPortraitOrdinal--) {
Box &box = g109_BoxChampionPortraitOnWall;
- blitToScreen(_bitmaps[k26_ChampionPortraitsIndice], 256, (_g289_championPortraitOrdinal & 0x7) << 5, (_g289_championPortraitOrdinal >> 3) * 29,
- box, k1_ColorDarkGary, g296_DungeonViewport);
+ blitToBitmap(_bitmaps[k26_ChampionPortraitsIndice], 256, (_g289_championPortraitOrdinal & 0x7) << 5, (_g289_championPortraitOrdinal >> 3) * 29,
+ _g296_bitmapViewport, k112_byteWidthViewport * 2, box, k1_ColorDarkGary);
}
return isAlcove;
}
@@ -2441,7 +2434,7 @@ T0115015_DrawProjectileAsObject:
AL_6_bitmapRedBanana = bitmapGreenAnt;
dunMan._g292_pileTopObject[AL_2_viewCell] = thingParam; /* The object is at the top of the pile */
}
- blitToScreen(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, boxByteGreen, k10_ColorFlesh, g296_DungeonViewport);
+ blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, k10_ColorFlesh);
if (drawProjectileAsObject)
goto T0115171_BackFromT0115015_DrawProjectileAsObject;
@@ -2692,7 +2685,7 @@ T0115077_DrawSecondHalfSquareCreature:
AL_0_creaturePosX = creaturePaddingPixelCount + (byteWidth - AL_4_xPos - 1);
}
warning("SUPER WARNINIG: we might nee noralized with on byteWidth");
- blitToScreen(AL_6_bitmapRedBanana, byteWidth, AL_0_creaturePosX, 0, boxByteGreen, (Color)transparentColor, g296_DungeonViewport);
+ blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_0_creaturePosX, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, (Color)transparentColor);
T0115126_CreatureNotVisible:
if (twoHalfSquareCreaturesFrontView) {
@@ -2827,7 +2820,7 @@ the bitmap is flipped horizontally (flipHorizontal = C1_TRUE) then a wrong part
screen. To fix this bug, "+ paddingPixelCount" must be added to the second parameter of this function call */
AL_4_xPos = MAX(paddingPixelCount, (int16)(byteWidth - projectilePosX - 1));
}
- blitToScreen(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, boxByteGreen, k10_ColorFlesh, g296_DungeonViewport);
+ blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, k10_ColorFlesh);
} else { /* Positive value: projectile aspect is the index of a OBJECT_ASPECT */
useAlcoveObjectImage = false;
projectileCoordinates[0] = projectilePosX;
@@ -2914,9 +2907,9 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:;
blitToBitmapShrinkWithPalChange(AL_6_bitmapRedBanana, 48, 32, _g74_tmpBitmap, 48, 32, g212_PalChangeSmoke);
AL_6_bitmapRedBanana = _g74_tmpBitmap;
}
- blitBoxFilledWithMaskedBitmapToScreen(AL_6_bitmapRedBanana, nullptr, getDerivedBitmap(k0_DerivedBitmapViewport), g105_BoxExplosionPattern_D0C,
- _vm->_rnd->getRandomNumber(4) + 87, _vm->_rnd->getRandomNumber(64),
- 224, (Color)(k0x0080_BlitDoNotUseMask | k10_ColorFlesh), 0, 0, 136, 93);
+ blitBoxFilledWithMaskedBitmap(AL_6_bitmapRedBanana, _g296_bitmapViewport, nullptr, getDerivedBitmap(k0_DerivedBitmapViewport), g105_BoxExplosionPattern_D0C,
+ _vm->_rnd->getRandomNumber(4) + 87, _vm->_rnd->getRandomNumber(64),
+ 224, (Color)(k0x0080_BlitDoNotUseMask | k10_ColorFlesh), 0, 0, 136, 93);
warning("IGNORED CODE: F0493_CACHE_AddDerivedBitmap");
warning("IGNORED CODE: F0493_CACHE_AddDerivedBitmap");
} else {
@@ -2979,7 +2972,7 @@ then a wrong part of the bitmap is drawn on screen. To fix this bug, "+ paddingP
if (flipVertical) {
flipBitmapVertical(AL_6_bitmapRedBanana, byteWidth, heightRedEagle);
}
- blitToScreen(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, boxByteGreen, k10_ColorFlesh, g296_DungeonViewport);
+ blitToBitmap(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, _g296_bitmapViewport, k112_byteWidthViewport * 2, boxByteGreen, k10_ColorFlesh);
}
}
} while ((thingParam = dunMan.getNextThing(thingParam)) != Thing::_endOfList);
diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h
index 60f6cdb630..7166908b83 100644
--- a/engines/dm/gfx.h
+++ b/engines/dm/gfx.h
@@ -321,14 +321,6 @@ public:
}; // @ FIELD_ASPECT
-class Viewport {
-public:
- uint16 _posX, _posY;
- uint16 _width, _height;
- Viewport() {}
- Viewport(uint16 posX, uint16 posY, uint16 width, uint16 height)
- :_posX(posX), _posY(posY), _width(width), _height(height) {}
-};
class CreatureAspect {
public:
@@ -398,9 +390,6 @@ public:
byte _D3ReplacementColor;
}; // @ CREATURE_REPLACEMENT_COLOR_SET
-extern Viewport gDefultViewPort;
-extern Viewport g296_DungeonViewport;
-
#define k0_DoorButton 0 // @ C0_DOOR_BUTTON
#define k0_WallOrnInscription 0 // @ C0_WALL_ORNAMENT_INSCRIPTION
@@ -559,20 +548,14 @@ public:
void blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY,
- byte *destBitmap, uint16 destWidth, Box &box, Color transparent = k255_ColorNoTransparency, Viewport &viewport = gDefultViewPort);
+ byte *destBitmap, uint16 destWidth, Box &box, Color transparent = k255_ColorNoTransparency);
void blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcHeight, byte *destBitmap, uint16 destWidth, uint16 destX = 0, uint16 destY = 0);
void blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask, byte *tmp, Box &box, int16 lastUnitIndex,
int16 firstUnitIndex, int16 destPixelWidth, Color transparent,
- int16 xPos, int16 yPos, int16 destHeight, int16 height2, Viewport &viewport = gDefultViewPort); // @ F0133_VIDEO_BlitBoxFilledWithMaskedBitmap
+ int16 xPos, int16 yPos, int16 destHeight, int16 height2); // @ F0133_VIDEO_BlitBoxFilledWithMaskedBitmap
void blitToBitmapShrinkWithPalChange(byte *srcBitmap, int16 srcWidth, int16 srcHight,
byte *destBitmap, int16 destWidth, int16 destHeight, byte *palChange); // @ F0129_VIDEO_BlitShrinkWithPaletteChanges
- void blitBoxFilledWithMaskedBitmapToScreen(byte *src, byte *mask, byte *tmp, Box &box, int16 lastUnitIndex,
- int16 firstUnitIndex, int16 destPixelWidth, Color transparent,
- int16 xPos, int16 yPos, int16 destHeight, int16 height2, Viewport &viewport = g296_DungeonViewport); // @ F0133_VIDEO_BlitBoxFilledWithMaskedBitmap
- void blitToScreen(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY,
- Box &box,
- Color transparent = k255_ColorNoTransparency, Viewport &viewport = gDefultViewPort);
void flipBitmapHorizontal(byte *bitmap, uint16 width, uint16 height); // @ F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally
void flipBitmapVertical(byte *bitmap, uint16 width, uint16 height);
@@ -580,7 +563,8 @@ public:
void f134_fillBitmap(byte *bitmap, uint16 width, uint16 height, Color color); // @ F0134_VIDEO_FillBitmap
void clearScreen(Color color);
- void clearScreenBox(Color color, Box &box, Viewport &viewport = gDefultViewPort); // @ D24_FillScreenBox, F0550_VIDEO_FillScreenBox
+ void clearScreenBox(Color color, Box &box); // @ D24_FillScreenBox, F0550_VIDEO_FillScreenBox
+ void f135_fillBoxBitmap(byte *destBitmap, Box &box, Color color, int16 pixelWidth, int16 height);
void drawDungeon(direction dir, int16 posX, int16 posY); // @ F0128_DUNGEONVIEW_Draw_CPSF
void updateScreen();
void f97_drawViewport(int16 palSwitchingRequestedState); // @ F0097_DUNGEONVIEW_DrawViewport
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index 04554691ba..8118356bd0 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -96,7 +96,7 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) {
champion = &cm._champions[championIndex];
dm.loadIntoBitmap(k17_InventoryGraphicIndice, dm._g296_bitmapViewport);
if (cm._g299_candidateChampionOrdinal) {
- dm.clearScreenBox(k12_ColorDarkestGray, g41_BoxFloppyZzzCross, g296_DungeonViewport);
+ dm.f135_fillBoxBitmap(dm._g296_bitmapViewport, g41_BoxFloppyZzzCross, k12_ColorDarkestGray, k112_byteWidthViewport * 2, k136_heightViewport);
}
_vm->_textMan->printToViewport(5, 116, k13_ColorLightestGray, "HEALTH");
_vm->_textMan->printToViewport(5, 124, k13_ColorLightestGray, "STAMINA");
@@ -128,7 +128,8 @@ void InventoryMan::drawStatusBoxPortrait(ChampionIndex championIndex) {
box._y2 = 28 + 1;
box._x1 = championIndex * k69_ChampionStatusBoxSpacing + 7;
box._x2 = box._x1 + 31 + 1;
- dispMan.blitToScreen(_vm->_championMan->_champions[championIndex]._portrait, 32, 0, 0, box, k255_ColorNoTransparency);
+ dispMan.blitToBitmap(_vm->_championMan->_champions[championIndex]._portrait, 32, 0, 0,
+ dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency);
}
void InventoryMan::drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color) {
@@ -161,11 +162,15 @@ void InventoryMan::drawPanelFoodWaterPoisoned() {
Champion &champ = _vm->_championMan->_champions[_g432_inventoryChampionOrdinal];
closeChest();
DisplayMan &dispMan = *_vm->_displayMan;
- dispMan.blitToScreen(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0, g32_BoxPanel, k8_ColorRed);
- dispMan.blitToScreen(dispMan.getBitmap(k30_FoodLabelIndice), 48, 0, 0, g35_BoxFood, k12_ColorDarkestGray);
- dispMan.blitToScreen(dispMan.getBitmap(k31_WaterLabelIndice), 48, 0, 0, g36_BoxWater, k12_ColorDarkestGray);
+ dispMan.blitToBitmap(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0,
+ dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g32_BoxPanel, k8_ColorRed);
+ dispMan.blitToBitmap(dispMan.getBitmap(k30_FoodLabelIndice), 48, 0, 0,
+ dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g35_BoxFood, k12_ColorDarkestGray);
+ dispMan.blitToBitmap(dispMan.getBitmap(k31_WaterLabelIndice), 48, 0, 0,
+ dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g36_BoxWater, k12_ColorDarkestGray);
if (champ._poisonEventCount) {
- dispMan.blitToScreen(dispMan.getBitmap(k32_PoisionedLabelIndice), 96, 0, 0, g37_BoxPoisoned, k12_ColorDarkestGray);
+ dispMan.blitToBitmap(dispMan.getBitmap(k32_PoisionedLabelIndice), 96, 0, 0,
+ dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g37_BoxPoisoned, k12_ColorDarkestGray);
}
drawPanelFoodOrWaterBar(champ._food, 69, k5_ColorLightBrown);
drawPanelFoodOrWaterBar(champ._water, 92, k14_ColorBlue);
@@ -173,7 +178,8 @@ void InventoryMan::drawPanelFoodWaterPoisoned() {
void InventoryMan::drawPanelResurrectReincarnate() {
_g424_panelContent = k5_PanelContentResurrectReincarnate;
- _vm->_displayMan->blitToScreen(_vm->_displayMan->getBitmap(k40_PanelResurectReincaranteIndice), 144, 0, 0, g32_BoxPanel, k6_ColorDarkGreen, g296_DungeonViewport);
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->getBitmap(k40_PanelResurectReincaranteIndice), 144, 0, 0,
+ _vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k6_ColorDarkGreen);
}
void InventoryMan::drawPanel() {
@@ -256,7 +262,7 @@ void InventoryMan::drawPanelScroll(Scroll* scroll) {
charRed++;
}
*charRed = '\0';
- dispMan.blitToScreen(dispMan.getBitmap(k23_PanelOpenScrollIndice), 144, 0, 0, g32_BoxPanel, k8_ColorRed, g296_DungeonViewport);
+ dispMan.blitToBitmap(dispMan.getBitmap(k23_PanelOpenScrollIndice), 144, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k8_ColorRed);
int16 lineCount = 1;
charRed++;
char *charGreen = charRed; // first char of the second line
@@ -308,7 +314,7 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool is
if (!isPressingEye) {
objMan.drawIconInSlotBox(k9_SlotBoxInventoryActionHand, k145_IconIndiceContainerChestOpen);
}
- dispMan.blitToScreen(dispMan.getBitmap(k25_PanelOpenChestIndice), 144, 0, 0, g32_BoxPanel, k8_ColorRed);
+ dispMan.blitToBitmap(dispMan.getBitmap(k25_PanelOpenChestIndice), 144, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g32_BoxPanel, k8_ColorRed);
int16 chestSlotIndex = 0;
Thing thing = chest->getSlot();
@@ -334,7 +340,8 @@ void InventoryMan::drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yP
box._x2 = (box._x1 = xPos) + 15 + 1;
box._y2 = (box._y1 = yPos) + 15 + 1;
_vm->_objectMan->extractIconFromBitmap(iconIndex, iconBitmap);
- _vm->_displayMan->blitToScreen(iconBitmap, 16, 0, 0, box, k255_ColorNoTransparency, g296_DungeonViewport);
+ _vm->_displayMan->blitToBitmap(iconBitmap, 16, 0, 0, _vm->_displayMan->_g296_bitmapViewport,
+ k112_byteWidthViewport * 2, box, k255_ColorNoTransparency);
}
void InventoryMan::buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, char** attribStrings, char* destString, char* prefixString, char* suffixString) {
@@ -408,8 +415,8 @@ Box g33_BoxArrowOrEye = Box(83, 98, 57, 65); // @ G0033_s_Graphic562_Box_ArrowOr
void InventoryMan::drawPanelArrowOrEye(bool pressingEye) {
DisplayMan &dispMan = *_vm->_displayMan;
- dispMan.blitToScreen(dispMan.getBitmap(pressingEye ? k19_EyeForObjectDescriptionIndice : k18_ArrowForChestContentIndice),
- 16, 0, 0, g33_BoxArrowOrEye, k8_ColorRed, g296_DungeonViewport);
+ dispMan.blitToBitmap(dispMan.getBitmap(pressingEye ? k19_EyeForObjectDescriptionIndice : k18_ArrowForChestContentIndice),
+ 16, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g33_BoxArrowOrEye, k8_ColorRed);
}
@@ -441,8 +448,10 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
openAndDrawChest(thingToDraw, (Container*)rawThingPtr, pressingEye);
} else {
IconIndice iconIndex = objMan.getIconIndex(thingToDraw);
- dispMan.blitToScreen(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0, g32_BoxPanel, k8_ColorRed, g296_DungeonViewport);
- dispMan.blitToScreen(dispMan.getBitmap(k29_ObjectDescCircleIndice), 32, 0, 0, g34_BoxObjectDescCircle, k12_ColorDarkestGray, g296_DungeonViewport);
+ dispMan.blitToBitmap(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0,
+ dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k8_ColorRed);
+ dispMan.blitToBitmap(dispMan.getBitmap(k29_ObjectDescCircleIndice), 32, 0, 0,
+ dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g34_BoxObjectDescCircle, k12_ColorDarkestGray);
char *descString = nullptr;
char str[40];
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index b2ad003739..a512a90d07 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -64,7 +64,7 @@ void MenuMan::drawMovementArrows() {
Box &dest = g2_BoxMovementArrows;
uint16 w = disp.getWidth(k13_MovementArrowsIndice);
- disp.blitToScreen(arrowsBitmap, w, 0, 0, dest, k255_ColorNoTransparency);
+ disp.blitToBitmap(arrowsBitmap, w, 0, 0, disp._g348_bitmapScreen, k160_byteWidthScreen * 2, dest, k255_ColorNoTransparency);
}
void MenuMan::clearActingChampion() {
ChampionMan &cm = *_vm->_championMan;
@@ -113,7 +113,7 @@ T0386006:
box2._x2 = box._x2 - 2; // no need to add +1 for exclusive boundaries, box already has that
box2._y1 = 95;
box2._y2 = 110 + 1;
- dm.blitToScreen(bitmapIcon, 16, 0, 0, box2);
+ dm.blitToBitmap(bitmapIcon, 16, 0, 0, dm._g348_bitmapScreen, k160_byteWidthScreen * 2, box2);
if (champion.getAttributes(k0x0008_ChampionAttributeDisableAction) || _vm->_championMan->_g299_candidateChampionOrdinal || _vm->_championMan->_g300_partyIsSleeping) {
warning("MISSING CODE: F0136_VIDEO_ShadeScreenBox");
}
@@ -208,13 +208,13 @@ void MenuMan::drawActionArea() {
box = g500_BoxActionArea2ActionMenu;
if (_g713_actionList._actionIndices[1] == k255_ChampionActionNone)
box = g501_BoxActionArea1ActionMenu;
- dispMan.blitToScreen(dispMan.getBitmap(k10_MenuActionAreaIndice), 96, 0, 0, box, k255_ColorNoTransparency);
- textMan.printWithTrailingSpacesToScreen(235, 83, k0_ColorBlack, k4_ColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._g506_actingChampionOrdinal)]._name,
- k7_ChampionNameMaximumLength);
+ dispMan.blitToBitmap(dispMan.getBitmap(k10_MenuActionAreaIndice), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency);
+ textMan.printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 235, 83, k0_ColorBlack, k4_ColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._g506_actingChampionOrdinal)]._name,
+ k7_ChampionNameMaximumLength, k200_heightScreen);
for (uint16 actionListIndex = 0; actionListIndex < 3; actionListIndex++) {
- textMan.printWithTrailingSpacesToScreen(241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack,
+ textMan.printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack,
getActionName(_g713_actionList._actionIndices[actionListIndex]),
- k12_ActionNameMaximumLength);
+ k12_ActionNameMaximumLength, k200_heightScreen);
}
}
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
@@ -253,7 +253,7 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
switch (champIndex) {
case k0_ChampionFirst:
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
- textMan.printTextToScreen(235, 48, k0_ColorBlack, k4_ColorCyan, champ._name);
+ textMan.f53_printToLogicalScreen(235, 48, k0_ColorBlack, k4_ColorCyan, champ._name);
if (champCount) {
if (champCurrHealth[1]) {
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
@@ -277,7 +277,7 @@ labelChamp3:
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
- textMan.printTextToScreen(249, 48, k0_ColorBlack, k4_ColorCyan, champ._name);
+ textMan.f53_printToLogicalScreen(249, 48, k0_ColorBlack, k4_ColorCyan, champ._name);
goto labelChamp2;
case k2_ChampionThird:
if (champCurrHealth[0]) {
@@ -287,7 +287,7 @@ labelChamp3:
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
- textMan.printTextToScreen(263, 48, k0_ColorBlack, k4_ColorCyan, champ._name);
+ textMan.f53_printToLogicalScreen(263, 48, k0_ColorBlack, k4_ColorCyan, champ._name);
goto labelChamp3;
case k3_ChampionFourth:
if (champCurrHealth[0]) {
@@ -300,7 +300,7 @@ labelChamp3:
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
- textMan.printTextToScreen(277, 48, k0_ColorBlack, k4_ColorCyan, champ._name);
+ textMan.f53_printToLogicalScreen(277, 48, k0_ColorBlack, k4_ColorCyan, champ._name);
break;
}
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
@@ -345,7 +345,7 @@ void MenuMan::setMagicCasterAndDrawSpellArea(int16 champIndex) {
return;
if (champMan._g514_magicCasterChampionIndex == kM1_ChampionNone) {
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
- dispMan.blitToScreen(dispMan.getBitmap(k9_MenuSpellAreaBackground), 96, 0, 0, g0_BoxSpellArea);
+ dispMan.blitToBitmap(dispMan.getBitmap(k9_MenuSpellAreaBackground), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g0_BoxSpellArea);
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
}
if (champIndex == kM1_ChampionNone) {
@@ -361,9 +361,9 @@ void MenuMan::setMagicCasterAndDrawSpellArea(int16 champIndex) {
buildSpellAreaLine(k2_SpellAreaAvailableSymbols);
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
drawSpellAreaControls((ChampionIndex)champIndex);
- dispMan.blitToScreen(_gK72_bitmapSpellAreaLine, 96, 0, 0, gK75_BoxSpellAreaLine2);
+ dispMan.blitToBitmap(_gK72_bitmapSpellAreaLine, 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, gK75_BoxSpellAreaLine2);
buildSpellAreaLine(k3_SpellAreaChampionSymbols);
- dispMan.blitToScreen(_gK72_bitmapSpellAreaLine, 96, 0, 0, gK76_BoxSpellAreaLine3);
+ dispMan.blitToBitmap(_gK72_bitmapSpellAreaLine, 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, gK76_BoxSpellAreaLine3);
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
}
}
diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp
index 40dc4f2066..2ce67ace6a 100644
--- a/engines/dm/objectman.cpp
+++ b/engines/dm/objectman.cpp
@@ -224,11 +224,12 @@ void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) {
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
if (slotBoxIndex >= k8_SlotBoxInventoryFirstSlot) {
- _vm->_displayMan->blitToScreen(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0,
- box, k255_ColorNoTransparency, g296_DungeonViewport);
+ _vm->_displayMan->blitToBitmap(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0,
+ _vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, box, k255_ColorNoTransparency);
+
} else {
- _vm->_displayMan->blitToScreen(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0,
- box, k255_ColorNoTransparency, gDefultViewPort);
+ _vm->_displayMan->blitToBitmap(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0,
+ _vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency);
}
}
@@ -246,7 +247,8 @@ void ObjectMan::drawLeaderObjectName(Thing thing) {
} else {
objName = _g352_objectNames[iconIndex];
}
- _vm->_textMan->printWithTrailingSpacesToScreen(233, 37, k4_ColorCyan, k0_ColorBlack, objName, k14_ObjectNameMaximumLength);
+ _vm->_textMan->printWithTrailingSpaces(_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, 233, 37,
+ k4_ColorCyan, k0_ColorBlack, objName, k14_ObjectNameMaximumLength, k200_heightScreen);
}
IconIndice ObjectMan::getIconIndexInSlotBox(uint16 slotBoxIndex) {
diff --git a/engines/dm/text.cpp b/engines/dm/text.cpp
index c313b1f29e..ebda26850d 100644
--- a/engines/dm/text.cpp
+++ b/engines/dm/text.cpp
@@ -36,7 +36,7 @@ TextMan::TextMan(DMEngine* vm) : _vm(vm) {}
#define k6_LetterHeight 6
void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY,
- Color textColor, Color bgColor, const char* text, uint16 destHeight, Viewport &viewport) {
+ Color textColor, Color bgColor, const char* text, uint16 destHeight) {
destX -= 1; // fixes missalignment, to be checked
destY -= 4; // fixes missalignment, to be checked
@@ -52,41 +52,36 @@ void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16
srcBitmap = tmp;
for (const char *begin = text, *end = text + textLength; begin != end; ++begin) {
- if (nextX + k5_LetterWidth + 1 >= (viewport._posX + viewport._width) || (*begin == '\n')) {
+ if (nextX + k5_LetterWidth + 1 >= destPixelWidth || (*begin == '\n')) {
nextX = destX;
nextY += k6_LetterHeight + 1;
}
- if (nextY + k6_LetterHeight >= (viewport._posY + viewport._height))
+ if (nextY + k6_LetterHeight >= destHeight)
break;
uint16 srcX = (1 + 5) * toupper(*begin); // 1 + 5 is not the letter width, arbitrary choice of the unpacking code
- Box box((nextX == destX) ? (nextX + 1) : nextX, nextX + k5_LetterWidth, nextY, nextY + k6_LetterHeight);
+ Box box((nextX == destX) ? (nextX + 1) : nextX, nextX + k5_LetterWidth + 1, nextY, nextY + k6_LetterHeight - 1);
_vm->_displayMan->blitToBitmap(srcBitmap, 6 * 128, (nextX == destX) ? (srcX + 1) : srcX, 0, destBitmap, destPixelWidth,
- box, k255_ColorNoTransparency, viewport);
+ box, k255_ColorNoTransparency);
nextX += k5_LetterWidth + 1;
}
}
-void TextMan::printTextToScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char* text, Viewport &viewport) {
- printTextToBitmap(_vm->_displayMan->_g348_bitmapScreen, _vm->_displayMan->_screenWidth, destX, destY, textColor, bgColor, text, _vm->_displayMan->_screenHeight, viewport);
+void TextMan::f53_printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char* text) {
+ printTextToBitmap(_vm->_displayMan->_g348_bitmapScreen, _vm->_displayMan->_screenWidth, destX, destY, textColor, bgColor, text, _vm->_displayMan->_screenHeight);
}
void TextMan::printToViewport(int16 posX, int16 posY, Color textColor, const char* text, Color bgColor) {
- printTextToScreen(posX, posY, textColor, bgColor, text, g296_DungeonViewport);
+ printTextToBitmap(_vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, posX, posY, textColor, bgColor, text, k200_heightScreen);
}
void TextMan::printWithTrailingSpaces(byte* destBitmap, int16 destPixelWidth, int16 destX, int16 destY, Color textColor,
- Color bgColor, const char* text, int16 requiredTextLength, int16 destHeight, Viewport& viewport) {
+ Color bgColor, const char* text, int16 requiredTextLength, int16 destHeight) {
Common::String str = text;
for (int16 i = str.size(); i < requiredTextLength; ++i)
str += ' ';
- printTextToBitmap(destBitmap, destPixelWidth, destX, destY, textColor, bgColor, str.c_str(), destHeight, viewport);
-}
-
-void TextMan::printWithTrailingSpacesToScreen(int16 destX, int16 destY, Color textColor, Color bgColor, const char* text, int16 strLenght, Viewport& viewport) {
- printWithTrailingSpaces(_vm->_displayMan->_g348_bitmapScreen, _vm->_displayMan->_screenWidth, destX, destY,
- textColor, bgColor, text, strLenght, _vm->_displayMan->_screenHeight, viewport);
+ printTextToBitmap(destBitmap, destPixelWidth, destX, destY, textColor, bgColor, str.c_str(), destHeight);
}
}
diff --git a/engines/dm/text.h b/engines/dm/text.h
index 48c2d6e7f9..c71f196658 100644
--- a/engines/dm/text.h
+++ b/engines/dm/text.h
@@ -38,13 +38,11 @@ class TextMan {
public:
explicit TextMan(DMEngine *vm);
void printTextToBitmap(byte *destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY,
- Color textColor, Color bgColor, const char *text, uint16 destHeight, Viewport &viewport = gDefultViewPort); // @ F0040_TEXT_Print
- void printTextToScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char *text, Viewport &viewport = gDefultViewPort); // @ F0053_TEXT_PrintToLogicalScreen
+ Color textColor, Color bgColor, const char *text, uint16 destHeight); // @ F0040_TEXT_Print
+ void f53_printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char *text); // @ F0053_TEXT_PrintToLogicalScreen
void printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = k12_ColorDarkestGray); // @ F0052_TEXT_PrintToViewport
void printWithTrailingSpaces(byte *destBitmap, int16 destPixelWidth, int16 destX, int16 destY, Color textColor, Color bgColor,
- const char *text, int16 strLenght, int16 destHeight, Viewport &viewport = gDefultViewPort); // @ F0041_TEXT_PrintWithTrailingSpaces
- void printWithTrailingSpacesToScreen(int16 destX, int16 destY, Color textColor, Color bgColor,
- const char *text, int16 strLenght, Viewport &viewport = gDefultViewPort); // @ F0041_TEXT_PrintWithTrailingSpaces
+ const char *text, int16 strLenght, int16 destHeight); // @ F0041_TEXT_PrintWithTrailingSpaces
};
}