aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorMartin Kiewitz2010-02-04 20:02:48 +0000
committerMartin Kiewitz2010-02-04 20:02:48 +0000
commitfb494493225cb490f4ed173774208b377e35c692 (patch)
treebd8f0cb44a96c7c22093a289b97fb010c264056f /engines/sci/graphics
parent21cfb4c0c7ee9ec3e833beb47a7ecd5d8494b862 (diff)
downloadscummvm-rg350-fb494493225cb490f4ed173774208b377e35c692.tar.gz
scummvm-rg350-fb494493225cb490f4ed173774208b377e35c692.tar.bz2
scummvm-rg350-fb494493225cb490f4ed173774208b377e35c692.zip
SCI: putting kDrawCel info GfxPaint class, debug is using GfxPaint class as well for drawing cels
svn-id: r47885
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/gui.cpp10
-rw-r--r--engines/sci/graphics/gui.h2
-rw-r--r--engines/sci/graphics/paint.cpp3
-rw-r--r--engines/sci/graphics/paint.h1
-rw-r--r--engines/sci/graphics/paint16.cpp10
-rw-r--r--engines/sci/graphics/paint16.h1
-rw-r--r--engines/sci/graphics/paint32.cpp11
-rw-r--r--engines/sci/graphics/paint32.h1
8 files changed, 27 insertions, 12 deletions
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index f6d5650b26..5619739b53 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -276,16 +276,6 @@ void SciGui::drawMenuBar(bool clear) {
}
}
-void SciGui::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle) {
- // some calls are hiresMode even under kq6 DOS, that's why we check for upscaled hires here
- if ((!hiresMode) || (!_screen->getUpscaledHires())) {
- _paint16->drawCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
- } else {
- _paint16->drawHiresCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo, upscaledHiresHandle);
- }
- _palette->setOnScreen();
-}
-
void SciGui::graphFillBoxForeground(Common::Rect rect) {
_paint16->paintRect(rect);
}
diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h
index a996da5d74..25fe8c6a47 100644
--- a/engines/sci/graphics/gui.h
+++ b/engines/sci/graphics/gui.h
@@ -76,8 +76,6 @@ public:
virtual void drawStatus(const char *text, int16 colorPen, int16 colorBack);
virtual void drawMenuBar(bool clear);
- virtual void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode = false, reg_t upscaledHiresHandle = NULL_REG);
-
virtual void graphFillBoxForeground(Common::Rect rect);
virtual void graphFillBoxBackground(Common::Rect rect);
virtual void graphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control);
diff --git a/engines/sci/graphics/paint.cpp b/engines/sci/graphics/paint.cpp
index 40b3ad429a..674d7fb2e1 100644
--- a/engines/sci/graphics/paint.cpp
+++ b/engines/sci/graphics/paint.cpp
@@ -43,4 +43,7 @@ GfxPaint::~GfxPaint() {
void GfxPaint::kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) {
}
+void GfxPaint::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle) {
+}
+
} // End of namespace Sci
diff --git a/engines/sci/graphics/paint.h b/engines/sci/graphics/paint.h
index 1e4ad9fa8e..d569730639 100644
--- a/engines/sci/graphics/paint.h
+++ b/engines/sci/graphics/paint.h
@@ -38,6 +38,7 @@ public:
virtual ~GfxPaint();
virtual void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
+ virtual void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle);
private:
};
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index 36040500de..5df8c96d14 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -346,4 +346,14 @@ void GfxPaint16::kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, b
_ports->setPort(oldPort);
}
+void GfxPaint16::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle) {
+ // some calls are hiresMode even under kq6 DOS, that's why we check for upscaled hires here
+ if ((!hiresMode) || (!_screen->getUpscaledHires())) {
+ drawCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
+ } else {
+ drawHiresCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo, upscaledHiresHandle);
+ }
+ _palette->setOnScreen();
+}
+
} // End of namespace Sci
diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h
index e3a7989177..29068c4148 100644
--- a/engines/sci/graphics/paint16.h
+++ b/engines/sci/graphics/paint16.h
@@ -70,6 +70,7 @@ public:
void bitsFree(reg_t memoryHandle);
void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
+ void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle);
private:
ResourceManager *_resMan;
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp
index 1f318319f3..88f413e9b4 100644
--- a/engines/sci/graphics/paint32.cpp
+++ b/engines/sci/graphics/paint32.cpp
@@ -63,4 +63,15 @@ void GfxPaint32::kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, b
delete picture;
}
+// This is "hacked" together, because its only used by debug command
+void GfxPaint32::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle) {
+ View *view = _cache->getView(viewId);
+ Common::Rect celRect(50, 50, 50, 50);
+ Common::Rect translatedRect;
+ celRect.bottom += view->getHeight(loopNo, celNo);
+ celRect.right += view->getWidth(loopNo, celNo);
+ view->draw(celRect, celRect, celRect, loopNo, celNo, 255, 0, false);
+ _screen->copyRectToScreen(celRect);
+}
+
} // End of namespace Sci
diff --git a/engines/sci/graphics/paint32.h b/engines/sci/graphics/paint32.h
index 8b675d0cf7..64ec3fa948 100644
--- a/engines/sci/graphics/paint32.h
+++ b/engines/sci/graphics/paint32.h
@@ -43,6 +43,7 @@ public:
void fillRect(Common::Rect rect, byte color);
void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
+ void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle);
private:
ResourceManager *_resMan;