aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-14 09:28:58 +0000
committerFilippos Karapetis2009-10-14 09:28:58 +0000
commit8570068f584ad48b50d5fd0fa77cafb447e9a302 (patch)
tree663a302cb0c310dfa120bddbac48690143569374 /engines/sci/gui
parent8c17b257eab6c7b84e0a779ae1a1cb068cc44cce (diff)
downloadscummvm-rg350-8570068f584ad48b50d5fd0fa77cafb447e9a302.tar.gz
scummvm-rg350-8570068f584ad48b50d5fd0fa77cafb447e9a302.tar.bz2
scummvm-rg350-8570068f584ad48b50d5fd0fa77cafb447e9a302.zip
- Moved cel width and height calculation in the GUI
- Merged the engine states of the old and new GUI svn-id: r45057
Diffstat (limited to 'engines/sci/gui')
-rw-r--r--engines/sci/gui/gui.cpp18
-rw-r--r--engines/sci/gui/gui.h9
2 files changed, 24 insertions, 3 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index 8473d3fafb..974e8bece8 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -634,6 +634,24 @@ void SciGui::moveCursor(Common::Point pos) {
// FIXME!
}
+int16 SciGui::getCelWidth(int view, int loop, int cel) {
+ SciGuiView *cursorView = new SciGuiView(_s->resMan, _screen, _palette, view);
+ sciViewCelInfo *celInfo = cursorView->getCelInfo(loop, cel);
+ int16 width = celInfo->width;
+ delete cursorView;
+
+ return width;
+}
+
+int16 SciGui::getCelHeight(int view, int loop, int cel) {
+ SciGuiView *cursorView = new SciGuiView(_s->resMan, _screen, _palette, view);
+ sciViewCelInfo *celInfo = cursorView->getCelInfo(loop, cel);
+ int16 height = celInfo->height;
+ delete cursorView;
+
+ return height;
+}
+
bool SciGui::debugUndither(bool flag) {
_screen->unditherSetState(flag);
return false;
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index f171cfde72..85c5fa51ca 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -121,6 +121,9 @@ public:
virtual void setCursorPos(Common::Point pos);
virtual void moveCursor(Common::Point pos);
+ int16 getCelWidth(int view, int loop, int cel);
+ int16 getCelHeight(int view, int loop, int cel);
+
virtual bool debugUndither(bool flag);
virtual bool debugShowMap(int mapNo);
@@ -129,13 +132,13 @@ public:
protected:
SciGuiCursor *_cursor;
+ EngineState *_s;
+ SciGuiScreen *_screen;
+ SciGuiPalette *_palette;
private:
virtual void initPriorityBands();
- EngineState *_s;
- SciGuiScreen *_screen;
- SciGuiPalette *_palette;
SciGuiGfx *_gfx;
SciGuiresources *_resources;
SciGuiWindowMgr *_windowMgr;