aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorMartin Kiewitz2010-02-04 20:18:01 +0000
committerMartin Kiewitz2010-02-04 20:18:01 +0000
commite74bd30a2e249598b6ec8ec1cb6c03fd95797ddc (patch)
treeb780c7c514d0203b2428a5cb3774d72a265ad72a /engines/sci/graphics
parent822e59288f34c03e468de2111d40467e419194c4 (diff)
downloadscummvm-rg350-e74bd30a2e249598b6ec8ec1cb6c03fd95797ddc.tar.gz
scummvm-rg350-e74bd30a2e249598b6ec8ec1cb6c03fd95797ddc.tar.bz2
scummvm-rg350-e74bd30a2e249598b6ec8ec1cb6c03fd95797ddc.zip
SCI: putting most kGraph functions into GfxPaint16
svn-id: r47887
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/gui.cpp44
-rw-r--r--engines/sci/graphics/gui.h9
-rw-r--r--engines/sci/graphics/paint16.cpp44
-rw-r--r--engines/sci/graphics/paint16.h10
4 files changed, 54 insertions, 53 deletions
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index 5619739b53..4cfe7034cd 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -276,50 +276,6 @@ void SciGui::drawMenuBar(bool clear) {
}
}
-void SciGui::graphFillBoxForeground(Common::Rect rect) {
- _paint16->paintRect(rect);
-}
-
-void SciGui::graphFillBoxBackground(Common::Rect rect) {
- _paint16->eraseRect(rect);
-}
-
-void SciGui::graphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control) {
- _paint16->fillRect(rect, colorMask, color, priority, control);
-}
-
-void SciGui::graphFrameBox(Common::Rect rect, int16 color) {
- int16 oldColor = _ports->getPort()->penClr;
- _ports->penColor(color);
- _paint16->frameRect(rect);
- _ports->penColor(oldColor);
-}
-
-void SciGui::graphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
- _ports->offsetLine(startPoint, endPoint);
- _screen->drawLine(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control);
-}
-
-reg_t SciGui::graphSaveBox(Common::Rect rect, uint16 screenMask) {
- return _paint16->bitsSave(rect, screenMask);
-}
-
-reg_t SciGui::graphSaveUpscaledHiresBox(Common::Rect rect) {
- return _paint16->bitsSave(rect, SCI_SCREEN_MASK_DISPLAY);
-}
-
-void SciGui::graphRestoreBox(reg_t handle) {
- _paint16->bitsRestore(handle);
-}
-
-void SciGui::graphUpdateBox(Common::Rect rect, bool hiresMode) {
- // some calls are hiresMode even under kq6 DOS, that's why we check for upscaled hires here
- if ((!hiresMode) || (!_screen->getUpscaledHires()))
- _paint16->bitsShow(rect);
- else
- _paint16->bitsShowHires(rect);
-}
-
void SciGui::graphRedrawBox(Common::Rect rect) {
localToGlobal(&rect.left, &rect.top);
localToGlobal(&rect.right, &rect.bottom);
diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h
index 25fe8c6a47..8077fc0249 100644
--- a/engines/sci/graphics/gui.h
+++ b/engines/sci/graphics/gui.h
@@ -76,15 +76,6 @@ public:
virtual void drawStatus(const char *text, int16 colorPen, int16 colorBack);
virtual void drawMenuBar(bool clear);
- 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);
- virtual void graphFrameBox(Common::Rect rect, int16 color);
- virtual void graphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
- virtual reg_t graphSaveBox(Common::Rect rect, uint16 flags);
- virtual reg_t graphSaveUpscaledHiresBox(Common::Rect rect);
- virtual void graphRestoreBox(reg_t handle);
- virtual void graphUpdateBox(Common::Rect rect, bool hiresMode);
virtual void graphRedrawBox(Common::Rect rect);
virtual void graphAdjustPriority(int top, int bottom);
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index 5df8c96d14..7371d1f6e5 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -356,4 +356,48 @@ void GfxPaint16::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo,
_palette->setOnScreen();
}
+void GfxPaint16::kernelGraphFillBoxForeground(Common::Rect rect) {
+ paintRect(rect);
+}
+
+void GfxPaint16::kernelGraphFillBoxBackground(Common::Rect rect) {
+ eraseRect(rect);
+}
+
+void GfxPaint16::kernelGraphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control) {
+ fillRect(rect, colorMask, color, priority, control);
+}
+
+void GfxPaint16::kernelGraphFrameBox(Common::Rect rect, int16 color) {
+ int16 oldColor = _ports->getPort()->penClr;
+ _ports->penColor(color);
+ frameRect(rect);
+ _ports->penColor(oldColor);
+}
+
+void GfxPaint16::kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
+ _ports->offsetLine(startPoint, endPoint);
+ _screen->drawLine(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control);
+}
+
+reg_t GfxPaint16::kernelGraphSaveBox(Common::Rect rect, uint16 screenMask) {
+ return bitsSave(rect, screenMask);
+}
+
+reg_t GfxPaint16::kernelGraphSaveUpscaledHiresBox(Common::Rect rect) {
+ return bitsSave(rect, SCI_SCREEN_MASK_DISPLAY);
+}
+
+void GfxPaint16::kernelGraphRestoreBox(reg_t handle) {
+ bitsRestore(handle);
+}
+
+void GfxPaint16::kernelGraphUpdateBox(Common::Rect rect, bool hiresMode) {
+ // some calls are hiresMode even under kq6 DOS, that's why we check for upscaled hires here
+ if ((!hiresMode) || (!_screen->getUpscaledHires()))
+ bitsShow(rect);
+ else
+ bitsShowHires(rect);
+}
+
} // End of namespace Sci
diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h
index 29068c4148..b04bd330df 100644
--- a/engines/sci/graphics/paint16.h
+++ b/engines/sci/graphics/paint16.h
@@ -72,6 +72,16 @@ public:
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);
+ void kernelGraphFillBoxForeground(Common::Rect rect);
+ void kernelGraphFillBoxBackground(Common::Rect rect);
+ void kernelGraphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control);
+ void kernelGraphFrameBox(Common::Rect rect, int16 color);
+ void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
+ reg_t kernelGraphSaveBox(Common::Rect rect, uint16 flags);
+ reg_t kernelGraphSaveUpscaledHiresBox(Common::Rect rect);
+ void kernelGraphRestoreBox(reg_t handle);
+ void kernelGraphUpdateBox(Common::Rect rect, bool hiresMode);
+
private:
ResourceManager *_resMan;
SegManager *_segMan;