aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/screen.cpp
diff options
context:
space:
mode:
authorjohndoe1232014-03-18 14:53:17 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commitb3b0bd884dc0cec008cf050f7023bbcdb20f5999 (patch)
tree21746eda597cce6d1136b4aba70d9ec1bb4994e4 /engines/illusions/screen.cpp
parent70f0b48aaf1cf5fd294f530e23eb861405caee5c (diff)
downloadscummvm-rg350-b3b0bd884dc0cec008cf050f7023bbcdb20f5999.tar.gz
scummvm-rg350-b3b0bd884dc0cec008cf050f7023bbcdb20f5999.tar.bz2
scummvm-rg350-b3b0bd884dc0cec008cf050f7023bbcdb20f5999.zip
ILLUSIONS: Work on Actor and Control classes; fix bug in sprite decompression
Diffstat (limited to 'engines/illusions/screen.cpp')
-rw-r--r--engines/illusions/screen.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/engines/illusions/screen.cpp b/engines/illusions/screen.cpp
index 1b33b0c856..6f14f8d759 100644
--- a/engines/illusions/screen.cpp
+++ b/engines/illusions/screen.cpp
@@ -31,7 +31,7 @@ namespace Illusions {
// Screen
Screen::Screen(IllusionsEngine *vm)
- : _vm(vm) {
+ : _vm(vm), _colorKey2(0) {
_displayOn = true;
_backSurface = allocSurface(640, 480);
_decompressQueue = new SpriteDecompressQueue();
@@ -65,11 +65,6 @@ uint16 Screen::getColorKey2() {
return _colorKey2;
}
-Graphics::Surface *Screen::getBackSurface() {
- // TODO Move this outside into a screen class
- return 0;
-}
-
void Screen::updateSprites() {
_decompressQueue->decompressAll();
// NOTE Skipped doShiftBrightness and related as it seems to be unused
@@ -80,19 +75,33 @@ void Screen::updateSprites() {
}
void Screen::drawSurface10(int16 destX, int16 destY, Graphics::Surface *surface, Common::Rect &srcRect, uint16 colorKey) {
+ // Unscaled, transparent
// TODO
+ debug("Screen::drawSurface10");
}
void Screen::drawSurface11(int16 destX, int16 destY, Graphics::Surface *surface, Common::Rect &srcRect) {
- // TODO
+ // Unscaled, non-transparent
+ debug(1, "Screen::drawSurface11() destX: %d; destY: %d; srcRect: (%d, %d, %d, %d)", destX, destY, srcRect.left, srcRect.top, srcRect.right, srcRect.bottom);
+ const int16 w = srcRect.width();
+ const int16 h = srcRect.height();
+ for (int16 yc = 0; yc < h; ++yc) {
+ byte *src = (byte*)surface->getBasePtr(srcRect.left, srcRect.top + yc);
+ byte *dst = (byte*)_backSurface->getBasePtr(destX, destY + yc);
+ memcpy(dst, src, w * 2);
+ }
}
void Screen::drawSurface20(Common::Rect &dstRect, Graphics::Surface *surface, Common::Rect &srcRect, uint16 colorKey) {
+ // Scaled, transparent
// TODO
+ debug("Screen::drawSurface20");
}
void Screen::drawSurface21(Common::Rect &dstRect, Graphics::Surface *surface, Common::Rect &srcRect) {
+ // Scaled, non-transparent
// TODO
+ debug("Screen::drawSurface21");
}
} // End of namespace Illusions