From eff87179da0554446837a732bb6855f6c7f8a890 Mon Sep 17 00:00:00 2001 From: Matthew Stewart Date: Mon, 23 Jul 2018 05:36:32 -0400 Subject: STARTREK: Half-done implementation of drawR3Shape Handles drawing, scaling, probably rotating objects in space. --- engines/startrek/graphics.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'engines/startrek/graphics.cpp') diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp index 6fe1c8f9ba..1612dc0347 100644 --- a/engines/startrek/graphics.cpp +++ b/engines/startrek/graphics.cpp @@ -105,6 +105,10 @@ void Graphics::fillBackgroundRect(const Common::Rect &rect, byte color) { } } +byte *Graphics::getBackgroundPixels() { + return _backgroundImage->pixels; +} + void Graphics::clearScreenAndPriBuffer() { Common::fill(_priData, _priData + sizeof(_priData), 0); @@ -131,6 +135,17 @@ void Graphics::loadPalette(const Common::String &paletteName) { lutStream->read(_lutData, 256); } +void Graphics::copyRectBetweenBitmaps(Bitmap *destBitmap, int destX, int destY, Bitmap *srcBitmap, int srcX, int srcY, int width, int height) { + byte *src = srcBitmap->pixels + srcX + srcY * srcBitmap->width; + byte *dest = destBitmap->pixels + destX + destY * destBitmap->width; + + for (int y = 0; y < height; y++) { + memcpy(dest, src, width); + src += srcBitmap->width; + dest += destBitmap->width; + } +} + void Graphics::fadeinScreen() { while (_paletteFadeLevel <= 100) { TrekEvent event; -- cgit v1.2.3