2009-10-03 20:49:18 +00:00
|
|
|
/* 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$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-01-05 01:37:57 +00:00
|
|
|
#ifndef SCI_GRAPHICS_VIEW_H
|
|
|
|
#define SCI_GRAPHICS_VIEW_H
|
2009-10-04 20:01:21 +00:00
|
|
|
|
2009-10-03 20:49:18 +00:00
|
|
|
namespace Sci {
|
|
|
|
|
2010-01-05 01:37:57 +00:00
|
|
|
struct CelInfo {
|
2009-10-03 20:49:18 +00:00
|
|
|
int16 width, height;
|
2010-01-11 20:31:12 +00:00
|
|
|
int16 displaceX;
|
|
|
|
int16 displaceY;
|
2009-10-03 20:49:18 +00:00
|
|
|
byte clearKey;
|
2009-10-04 21:57:31 +00:00
|
|
|
uint16 offsetEGA;
|
2010-01-29 00:03:10 +00:00
|
|
|
uint32 offsetRLE;
|
|
|
|
uint32 offsetLiteral;
|
2009-10-03 20:49:18 +00:00
|
|
|
byte *rawBitmap;
|
|
|
|
};
|
|
|
|
|
2010-01-05 01:37:57 +00:00
|
|
|
struct LoopInfo {
|
2009-10-03 20:49:18 +00:00
|
|
|
bool mirrorFlag;
|
2009-10-05 07:10:01 +00:00
|
|
|
uint16 celCount;
|
2010-01-05 01:37:57 +00:00
|
|
|
CelInfo *cel;
|
2009-10-03 20:49:18 +00:00
|
|
|
};
|
|
|
|
|
2009-10-25 20:46:14 +00:00
|
|
|
#define SCI_VIEW_EGAMAPPING_SIZE 16
|
|
|
|
#define SCI_VIEW_EGAMAPPING_COUNT 8
|
|
|
|
|
2010-01-05 01:37:57 +00:00
|
|
|
class View {
|
2009-10-03 20:49:18 +00:00
|
|
|
public:
|
2010-01-05 01:37:57 +00:00
|
|
|
View(ResourceManager *resMan, Screen *screen, SciPalette *palette, GuiResourceId resourceId);
|
|
|
|
~View();
|
2009-10-03 20:49:18 +00:00
|
|
|
|
2009-10-05 07:10:01 +00:00
|
|
|
GuiResourceId getResourceId();
|
2010-01-06 17:25:54 +00:00
|
|
|
int16 getWidth(int16 loopNo, int16 celNo);
|
|
|
|
int16 getHeight(int16 loopNo, int16 celNo);
|
|
|
|
CelInfo *getCelInfo(int16 loopNo, int16 celNo);
|
|
|
|
LoopInfo *getLoopInfo(int16 loopNo);
|
|
|
|
void getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect *outRect);
|
2010-01-16 14:20:00 +00:00
|
|
|
void getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, int16 scaleX, int16 scaleY, Common::Rect *outRect);
|
2010-01-06 17:25:54 +00:00
|
|
|
byte *getBitmap(int16 loopNo, int16 celNo);
|
2010-01-16 16:17:45 +00:00
|
|
|
void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires);
|
|
|
|
void drawScaled(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, int16 loopNo, int16 celNo, byte priority, int16 scaleX, int16 scaleY);
|
2009-10-06 19:57:55 +00:00
|
|
|
uint16 getLoopCount() const { return _loopCount; }
|
2010-01-12 18:24:37 +00:00
|
|
|
uint16 getCelCount(int16 loopNo);
|
2010-01-05 01:37:57 +00:00
|
|
|
Palette *getPalette();
|
2009-10-06 14:37:25 +00:00
|
|
|
|
2009-10-03 20:49:18 +00:00
|
|
|
private:
|
2009-10-05 07:10:01 +00:00
|
|
|
void initData(GuiResourceId resourceId);
|
2010-01-06 17:25:54 +00:00
|
|
|
void unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint16 pixelCount);
|
2009-10-10 17:40:29 +00:00
|
|
|
void unditherBitmap(byte *bitmap, int16 width, int16 height, byte clearKey);
|
2009-10-03 20:49:18 +00:00
|
|
|
|
2009-10-06 12:33:36 +00:00
|
|
|
ResourceManager *_resMan;
|
2010-01-05 01:37:57 +00:00
|
|
|
Screen *_screen;
|
|
|
|
SciPalette *_palette;
|
2009-10-03 20:49:18 +00:00
|
|
|
|
2009-10-05 07:10:01 +00:00
|
|
|
GuiResourceId _resourceId;
|
2009-10-09 12:10:17 +00:00
|
|
|
Resource *_resource;
|
2009-10-03 20:49:18 +00:00
|
|
|
byte *_resourceData;
|
|
|
|
|
|
|
|
uint16 _loopCount;
|
2010-01-05 01:37:57 +00:00
|
|
|
LoopInfo *_loop;
|
2009-10-03 20:49:18 +00:00
|
|
|
bool _embeddedPal;
|
2010-01-05 01:37:57 +00:00
|
|
|
Palette _viewPalette;
|
2009-10-24 19:29:06 +00:00
|
|
|
|
|
|
|
byte *_EGAmapping;
|
2009-10-03 20:49:18 +00:00
|
|
|
};
|
|
|
|
|
2009-10-04 21:26:33 +00:00
|
|
|
} // End of namespace Sci
|
2009-10-04 20:01:21 +00:00
|
|
|
|
|
|
|
#endif
|