aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/dm/TODOs/todo.txt1
-rw-r--r--engines/dm/gfx.cpp23
2 files changed, 15 insertions, 9 deletions
diff --git a/engines/dm/TODOs/todo.txt b/engines/dm/TODOs/todo.txt
index 44cc616f65..1699a8b931 100644
--- a/engines/dm/TODOs/todo.txt
+++ b/engines/dm/TODOs/todo.txt
@@ -16,6 +16,5 @@ Todo:
Code stuff todo:
Complete stub methods(blitShrink, blitmask, scroller, etc.)
Save file f433_processCommand140_saveGame fails silently, add error checking
- Clean up f113_drawField
\ No newline at end of file
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 94820d9bb4..0fe319eedc 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -2771,17 +2771,24 @@ uint32 DisplayMan::getCompressedDataSize(uint16 index) {
}
void DisplayMan::f113_drawField(FieldAspect* fieldAspect, Box& box) {
- warning(false, "STUB METHOD: f113_drawField");
+ byte* bitmapMask = nullptr;
if (fieldAspect->_mask != kMaskFieldAspectNoMask) {
- DisplayMan &dispMan = *_vm->_displayMan;
-
- byte *bitmapMask = dispMan._g74_tmpBitmap;
- memmove(bitmapMask, dispMan.f489_getNativeBitmapOrGraphic(k69_FieldMask_D3R_GraphicIndice + getFlag(fieldAspect->_mask, kMaskFieldAspectIndex)),
- fieldAspect->_height * fieldAspect->_byteWidth * 2 * sizeof(bitmapMask[0]));
- if (getFlag(fieldAspect->_mask, kMaskFieldAspectFlipMask))
- dispMan.f130_flipBitmapHorizontal(bitmapMask, fieldAspect->_byteWidth, fieldAspect->_height);
+ bitmapMask = _g74_tmpBitmap;
+ memmove(bitmapMask, f489_getNativeBitmapOrGraphic(k69_FieldMask_D3R_GraphicIndice + getFlag(fieldAspect->_mask, kMaskFieldAspectIndex)),
+ fieldAspect->_height * fieldAspect->_byteWidth * 2);
+ if (getFlag(fieldAspect->_mask, kMaskFieldAspectFlipMask)) {
+ f130_flipBitmapHorizontal(bitmapMask, fieldAspect->_byteWidth, fieldAspect->_height);
+ }
}
+
+ f491_isDerivedBitmapInCache(k0_DerivedBitmapViewport);
+ byte *bitmap = f489_getNativeBitmapOrGraphic(k73_FieldTeleporterGraphicIndice + fieldAspect->_nativeBitmapRelativeIndex);
+ f133_blitBoxFilledWithMaskedBitmap(bitmap, _g296_bitmapViewport, bitmapMask, f492_getDerivedBitmap(k0_DerivedBitmapViewport), box,
+ _vm->getRandomNumber(2) + fieldAspect->_baseStartUnitIndex, _vm->getRandomNumber(32), k112_byteWidthViewport,
+ (Color)fieldAspect->_transparentColor, fieldAspect->_xPos, 0, 136, fieldAspect->_bitplaneWordCount);
+ f493_addDerivedBitmap(k0_DerivedBitmapViewport);
+ f480_releaseBlock(k0_DerivedBitmapViewport | 0x8000);
}
int16 DisplayMan::f459_getScaledBitmapByteCount(int16 byteWidth, int16 height, int16 scale) {