aboutsummaryrefslogtreecommitdiff
path: root/engines/neverhood/graphics.cpp
diff options
context:
space:
mode:
authorjohndoe1232012-09-14 22:38:31 +0000
committerWillem Jan Palenstijn2013-05-08 20:43:41 +0200
commitd1d1596fd136783a7bc4db9264ba1627b8511355 (patch)
treec3c0f5bf1eb0489811167c7fe339377bde0f57d4 /engines/neverhood/graphics.cpp
parentee36d5d5e3ae6f5cb357f3d68c711e2fbfbdef8b (diff)
downloadscummvm-rg350-d1d1596fd136783a7bc4db9264ba1627b8511355.tar.gz
scummvm-rg350-d1d1596fd136783a7bc4db9264ba1627b8511355.tar.bz2
scummvm-rg350-d1d1596fd136783a7bc4db9264ba1627b8511355.zip
NEVERHOOD: Add support for shadow sprites, used only for the shadow of the car/vehicle thing
Diffstat (limited to 'engines/neverhood/graphics.cpp')
-rw-r--r--engines/neverhood/graphics.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/engines/neverhood/graphics.cpp b/engines/neverhood/graphics.cpp
index 5bb9424f57..a58cdcb4b9 100644
--- a/engines/neverhood/graphics.cpp
+++ b/engines/neverhood/graphics.cpp
@@ -131,6 +131,19 @@ void BaseSurface::copyFrom(Graphics::Surface *sourceSurface, int16 x, int16 y, N
}
}
+// ShadowSurface
+
+ShadowSurface::ShadowSurface(NeverhoodEngine *vm, int priority, int16 width, int16 height, BaseSurface *shadowSurface)
+ : BaseSurface(vm, priority, width, height), _shadowSurface(shadowSurface) {
+ // Empty
+}
+
+void ShadowSurface::draw() {
+ if (_surface && _visible && _drawRect.width > 0 && _drawRect.height > 0) {
+ _vm->_screen->drawSurface2(_surface, _drawRect, _clipRect, _transparent, _shadowSurface->getSurface());
+ }
+}
+
// FontSurface
FontSurface::FontSurface(NeverhoodEngine *vm, NPointArray *tracking, uint16 numRows, byte firstChar, uint16 charWidth, uint16 charHeight)