aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-09 14:09:45 +0000
committerMartin Kiewitz2010-01-09 14:09:45 +0000
commita815d0e12a42b8880b5f629d6053f96139a46acc (patch)
tree070c14af7b0fac7732e24258b4d10e625dfc881f /engines/sci/graphics
parent5d4ff2930bee11dfef21c66009245d144db5d205 (diff)
downloadscummvm-rg350-a815d0e12a42b8880b5f629d6053f96139a46acc.tar.gz
scummvm-rg350-a815d0e12a42b8880b5f629d6053f96139a46acc.tar.bz2
scummvm-rg350-a815d0e12a42b8880b5f629d6053f96139a46acc.zip
SCI: added new debug command "picture_visualize", which enables visualization of the drawing process of EGA pictures
svn-id: r47201
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/gfx.cpp8
-rw-r--r--engines/sci/graphics/gfx.h5
-rw-r--r--engines/sci/graphics/gui.cpp5
-rw-r--r--engines/sci/graphics/gui.h1
-rw-r--r--engines/sci/graphics/picture.cpp14
-rw-r--r--engines/sci/graphics/picture.h5
6 files changed, 29 insertions, 9 deletions
diff --git a/engines/sci/graphics/gfx.cpp b/engines/sci/graphics/gfx.cpp
index d2196d5140..d671d8e6e8 100644
--- a/engines/sci/graphics/gfx.cpp
+++ b/engines/sci/graphics/gfx.cpp
@@ -66,6 +66,8 @@ void Gfx::init(Text *text) {
_text->SetFont(0);
_menuPort->rect = Common::Rect(0, 0, _screen->getWidth(), _screen->getHeight());
_menuBarRect = Common::Rect(0, 0, _screen->getWidth(), 9);
+
+ _EGAdrawingVisualize = false;
}
void Gfx::purgeCache() {
@@ -323,8 +325,12 @@ void Gfx::BitsFree(reg_t memoryHandle) {
}
}
+void Gfx::setEGAdrawingVisualize(bool state) {
+ _EGAdrawingVisualize = state;
+}
+
void Gfx::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId) {
- SciGuiPicture *picture = new SciGuiPicture(_resMan, this, _screen, _palette, pictureId);
+ SciGuiPicture *picture = new SciGuiPicture(_resMan, this, _screen, _palette, pictureId, _EGAdrawingVisualize);
// do we add to a picture? if not -> clear screen with white
if (!addToFlag)
diff --git a/engines/sci/graphics/gfx.h b/engines/sci/graphics/gfx.h
index 1c47d6af2a..eb7a02b2a1 100644
--- a/engines/sci/graphics/gfx.h
+++ b/engines/sci/graphics/gfx.h
@@ -83,6 +83,8 @@ public:
void BitsRestore(reg_t memoryHandle);
void BitsFree(reg_t memoryHandle);
+ void setEGAdrawingVisualize(bool state);
+
void drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
void drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128);
@@ -124,6 +126,9 @@ private:
byte _priorityBands[200];
ViewCache _cachedViews;
+
+ // true means make EGA picture drawing visible
+ bool _EGAdrawingVisualize;
};
} // End of namespace Sci
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index ce03d94d14..eaf1fd4ac1 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -964,4 +964,9 @@ bool SciGui::debugShowMap(int mapNo) {
return false;
}
+bool SciGui::debugEGAdrawingVisualize(bool state) {
+ _gfx->setEGAdrawingVisualize(state);
+ return false;
+}
+
} // End of namespace Sci
diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h
index c3c5ca6d85..a42ae2fee5 100644
--- a/engines/sci/graphics/gui.h
+++ b/engines/sci/graphics/gui.h
@@ -167,6 +167,7 @@ public:
virtual bool debugUndither(bool flag);
virtual bool debugShowMap(int mapNo);
+ virtual bool debugEGAdrawingVisualize(bool state);
// FIXME: Don't store EngineState
virtual void resetEngineState(EngineState *s);
diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp
index d7d7fa63d6..4dfa80ee11 100644
--- a/engines/sci/graphics/picture.cpp
+++ b/engines/sci/graphics/picture.cpp
@@ -33,8 +33,8 @@
namespace Sci {
-SciGuiPicture::SciGuiPicture(ResourceManager *resMan, Gfx *gfx, Screen *screen, SciPalette *palette, GuiResourceId resourceId)
- : _resMan(resMan), _gfx(gfx), _screen(screen), _palette(palette), _resourceId(resourceId) {
+SciGuiPicture::SciGuiPicture(ResourceManager *resMan, Gfx *gfx, Screen *screen, SciPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize)
+ : _resMan(resMan), _gfx(gfx), _screen(screen), _palette(palette), _resourceId(resourceId), _EGAdrawingVisualize(EGAdrawingVisualize) {
assert(resourceId != -1);
initData(resourceId);
}
@@ -589,11 +589,11 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) {
default:
error("Unsupported pic-operation %X", pic_op);
}
- //printf("picop %X\n", pic_op);
- // for debug purposes
- //_screen->copyToScreen();
- //g_system->updateScreen();
- //g_system->delayMillis(500);
+ if ((_EGAdrawingVisualize) && (isEGA)) {
+ _screen->copyToScreen();
+ g_system->updateScreen();
+ g_system->delayMillis(10);
+ }
}
error("picture vector data without terminator");
}
diff --git a/engines/sci/graphics/picture.h b/engines/sci/graphics/picture.h
index fcab244a36..04a5fb8fd6 100644
--- a/engines/sci/graphics/picture.h
+++ b/engines/sci/graphics/picture.h
@@ -34,7 +34,7 @@ namespace Sci {
class SciGuiPicture {
public:
- SciGuiPicture(ResourceManager *resMan, Gfx *gfx, Screen *screen, SciPalette *palette, GuiResourceId resourceId);
+ SciGuiPicture(ResourceManager *resMan, Gfx *gfx, Screen *screen, SciPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize = false);
~SciGuiPicture();
GuiResourceId getResourceId();
@@ -75,6 +75,9 @@ private:
bool _addToFlag;
int16 _EGApaletteNo;
byte _priority;
+
+ // If true, we will show the whole EGA drawing process...
+ bool _EGAdrawingVisualize;
};
} // End of namespace Sci