Skip to content

Commit

Permalink
DM: Add default parameters to DipslayMan::f132_blitToBitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendegúz Nagy committed Aug 26, 2016
1 parent c756d17 commit f01a03e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion engines/dm/gfx.cpp
Expand Up @@ -1018,7 +1018,9 @@ void DisplayMan::f466_loadIntoBitmap(uint16 index, byte *destBitmap) {
}

void DisplayMan::f132_blitToBitmap(byte *srcBitmap, byte *destBitmap, Box &box, uint16 srcX, uint16 srcY, uint16 srcWidth,
uint16 destWidth, Color transparent) {
uint16 destWidth, Color transparent, int16 srcHeight, int16 destHight) {
// Note: if you want to use srcHeight and destHight parameters, remove the defaults values and
// and complete the function calls at the callsites, otherwise their value can be the default -1
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];
Expand Down
5 changes: 4 additions & 1 deletion engines/dm/gfx.h
Expand Up @@ -547,8 +547,11 @@ class DisplayMan {
void f99_copyBitmapAndFlipHorizontal(byte *srcBitmap, byte *destBitmap, uint16 byteWidth, uint16 height);


/* srcHeight and destHeight are not necessary for blitting, only error checking, thus they are defaulted for existing code which
does not pass anything, newly imported calls do pass srcHeght and srcWidth, so this is a ceonvenience change so the the parameters
match the original exatcly, if need arises for heights then we'll have to retrospectively add them in old function calls*/
void f132_blitToBitmap(byte *srcBitmap, byte *destBitmap, Box &box, uint16 srcX, uint16 srcY, uint16 srcWidth,
uint16 destWidth, Color transparent = k255_ColorNoTransparency); // @ F0132_VIDEO_Blit
uint16 destWidth, Color transparent = k255_ColorNoTransparency, int16 srcHeight = -1, int16 destHight = -1); // @ F0132_VIDEO_Blit

void f133_blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask, byte *tmp, Box &box, int16 lastUnitIndex,
int16 firstUnitIndex, int16 destPixelWidth, Color transparent,
Expand Down

0 comments on commit f01a03e

Please sign in to comment.