NEVERHOOD: Add drawDoubleSurface2Alpha

This commit is contained in:
Vladimir Serbinenko 2022-12-22 08:47:39 +01:00 committed by Eugene Sandulenko
parent 03a59a2953
commit f4da2d054a
2 changed files with 26 additions and 0 deletions

View File

@ -276,6 +276,31 @@ void Screen::drawDoubleSurface2(const Graphics::Surface *surface, NDrawRect &dra
}
void Screen::drawDoubleSurface2Alpha(const Graphics::Surface *surface, NDrawRect &drawRect, byte alphaColor) {
const byte *source = (const byte*)surface->getPixels();
byte *dest = (byte*)_backScreen->getBasePtr(drawRect.x, drawRect.y);
for (int16 yc = 0; yc < surface->h; yc++) {
byte *row = dest;
for (int16 xc = 0; xc < surface->w; xc++) {
if (*source != alphaColor) {
row[0] = *source;
row[1] = *source;
row[_backScreen->pitch] = *source;
row[_backScreen->pitch + 1] = *source;
}
source++;
row += 2;
}
dest += _backScreen->pitch;
dest += _backScreen->pitch;
}
_fullRefresh = true; // See Screen::update
}
void Screen::drawUnk(const Graphics::Surface *surface, NDrawRect &drawRect, NDrawRect &sysRect, NRect &clipRect, bool transparent, byte version) {
int16 x, y;

View File

@ -84,6 +84,7 @@ public:
const Graphics::Surface *shadowSurface = NULL, byte alphaColor = 0);
void drawSurface3(const Graphics::Surface *surface, int16 x, int16 y, NDrawRect &drawRect, NRect &clipRect, bool transparent, byte version);
void drawDoubleSurface2(const Graphics::Surface *surface, NDrawRect &drawRect);
void drawDoubleSurface2Alpha(const Graphics::Surface *surface, NDrawRect &drawRect, byte alphaColor);
void drawUnk(const Graphics::Surface *surface, NDrawRect &drawRect, NDrawRect &sysRect, NRect &clipRect, bool transparent, byte version);
void drawSurfaceClipRects(const Graphics::Surface *surface, NDrawRect &drawRect, NRect *clipRects, uint clipRectsCount, bool transparent, byte version);
void setSmackerDecoder(Video::SmackerDecoder *smackerDecoder) { _smackerDecoder = smackerDecoder; }