aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/view.h
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-05 01:37:57 +0000
committerFilippos Karapetis2010-01-05 01:37:57 +0000
commitd99aa0f12634bed7b5101b4b5a64f50ee744961b (patch)
tree037401495ebf794eaa3b7386b49ee03dbe1cdac1 /engines/sci/graphics/view.h
parent2f1a909696838533758acdb026b1fd9c3631d6f0 (diff)
downloadscummvm-rg350-d99aa0f12634bed7b5101b4b5a64f50ee744961b.tar.gz
scummvm-rg350-d99aa0f12634bed7b5101b4b5a64f50ee744961b.tar.bz2
scummvm-rg350-d99aa0f12634bed7b5101b4b5a64f50ee744961b.zip
More renaming
svn-id: r47009
Diffstat (limited to 'engines/sci/graphics/view.h')
-rw-r--r--engines/sci/graphics/view.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h
new file mode 100644
index 0000000000..109a37f065
--- /dev/null
+++ b/engines/sci/graphics/view.h
@@ -0,0 +1,91 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef SCI_GRAPHICS_VIEW_H
+#define SCI_GRAPHICS_VIEW_H
+
+namespace Sci {
+
+struct CelInfo {
+ int16 width, height;
+ char displaceX;
+ byte displaceY;
+ byte clearKey;
+ uint16 offsetEGA;
+ uint16 offsetRLE;
+ uint16 offsetLiteral;
+ byte *rawBitmap;
+};
+
+struct LoopInfo {
+ bool mirrorFlag;
+ uint16 celCount;
+ CelInfo *cel;
+};
+
+#define SCI_VIEW_EGAMAPPING_SIZE 16
+#define SCI_VIEW_EGAMAPPING_COUNT 8
+
+class View {
+public:
+ View(ResourceManager *resMan, Screen *screen, SciPalette *palette, GuiResourceId resourceId);
+ ~View();
+
+ GuiResourceId getResourceId();
+ int16 getWidth(LoopNo loopNo, CelNo celNo);
+ int16 getHeight(LoopNo loopNo, CelNo celNo);
+ CelInfo *getCelInfo(LoopNo loopNo, CelNo celNo);
+ LoopInfo *getLoopInfo(LoopNo loopNo);
+ void getCelRect(LoopNo loopNo, CelNo celNo, int16 x, int16 y, int16 z, Common::Rect *outRect);
+ byte *getBitmap(LoopNo loopNo, CelNo celNo);
+ void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, LoopNo loopNo, CelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight = -1);
+ uint16 getLoopCount() const { return _loopCount; }
+ uint16 getCelCount(LoopNo loopNo) { return _loop[loopNo].celCount; }
+ Palette *getPalette();
+
+private:
+ void initData(GuiResourceId resourceId);
+ void unpackCel(LoopNo loopNo, CelNo celNo, byte *outPtr, uint16 pixelCount);
+ void unditherBitmap(byte *bitmap, int16 width, int16 height, byte clearKey);
+
+ ResourceManager *_resMan;
+ Screen *_screen;
+ SciPalette *_palette;
+
+ GuiResourceId _resourceId;
+ Resource *_resource;
+ byte *_resourceData;
+
+ uint16 _loopCount;
+ LoopInfo *_loop;
+ bool _embeddedPal;
+ Palette _viewPalette;
+
+ byte *_EGAmapping;
+};
+
+} // End of namespace Sci
+
+#endif