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$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-10-04 20:01:21 +00:00
|
|
|
#ifndef SCI_GUI_VIEW_H
|
|
|
|
#define SCI_GUI_VIEW_H
|
|
|
|
|
2009-10-03 20:49:18 +00:00
|
|
|
namespace Sci {
|
|
|
|
|
2009-10-05 07:10:01 +00:00
|
|
|
struct sciViewCelInfo {
|
2009-10-03 20:49:18 +00:00
|
|
|
int16 width, height;
|
|
|
|
char displaceX;
|
|
|
|
byte displaceY;
|
|
|
|
byte clearKey;
|
2009-10-04 21:57:31 +00:00
|
|
|
uint16 offsetEGA;
|
2009-10-03 20:49:18 +00:00
|
|
|
uint16 offsetRLE;
|
|
|
|
uint16 offsetLiteral;
|
|
|
|
byte *rawBitmap;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sciViewLoopInfo {
|
|
|
|
bool mirrorFlag;
|
2009-10-05 07:10:01 +00:00
|
|
|
uint16 celCount;
|
|
|
|
sciViewCelInfo *cel;
|
2009-10-03 20:49:18 +00:00
|
|
|
};
|
|
|
|
|
2009-10-05 07:10:01 +00:00
|
|
|
class SciGuiView {
|
2009-10-03 20:49:18 +00:00
|
|
|
public:
|
2009-10-06 16:14:40 +00:00
|
|
|
SciGuiView(ResourceManager *resMan, SciGuiScreen *screen, SciGuiPalette *palette, GuiResourceId resourceId);
|
2009-10-05 07:10:01 +00:00
|
|
|
~SciGuiView();
|
2009-10-03 20:49:18 +00:00
|
|
|
|
2009-10-05 07:10:01 +00:00
|
|
|
GuiResourceId getResourceId();
|
|
|
|
int16 getWidth(GuiViewLoopNo loopNo, GuiViewCelNo celNo);
|
|
|
|
int16 getHeight(GuiViewLoopNo loopNo, GuiViewCelNo celNo);
|
|
|
|
sciViewCelInfo *getCelInfo(GuiViewLoopNo loopNo, GuiViewCelNo celNo);
|
|
|
|
sciViewLoopInfo *getLoopInfo(GuiViewLoopNo loopNo);
|
|
|
|
void getCelRect(GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 x, int16 y, int16 z, Common::Rect *outRect);
|
|
|
|
byte *getBitmap(GuiViewLoopNo loopNo, GuiViewCelNo celNo);
|
2009-10-06 14:37:25 +00:00
|
|
|
void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 paletteNo);
|
2009-10-06 19:57:55 +00:00
|
|
|
uint16 getLoopCount() const { return _loopCount; }
|
2009-10-07 11:31:30 +00:00
|
|
|
GuiPalette *getPalette() { return &_viewPalette; }
|
|
|
|
const byte *getEgaMapping() const { return _EGAMapping; }
|
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);
|
|
|
|
void unpackCel(GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte *outPtr, uint16 pixelCount);
|
2009-10-03 20:49:18 +00:00
|
|
|
|
2009-10-06 12:33:36 +00:00
|
|
|
ResourceManager *_resMan;
|
2009-10-05 07:10:01 +00:00
|
|
|
SciGuiScreen *_screen;
|
2009-10-06 16:14:40 +00:00
|
|
|
SciGuiPalette *_palette;
|
2009-10-03 20:49:18 +00:00
|
|
|
|
2009-10-05 07:10:01 +00:00
|
|
|
GuiResourceId _resourceId;
|
2009-10-03 20:49:18 +00:00
|
|
|
byte *_resourceData;
|
|
|
|
|
|
|
|
uint16 _loopCount;
|
|
|
|
sciViewLoopInfo *_loop;
|
|
|
|
bool _embeddedPal;
|
2009-10-06 16:14:40 +00:00
|
|
|
GuiPalette _viewPalette;
|
2009-10-04 22:26:57 +00:00
|
|
|
const byte *_EGAMapping; // simple translation map for all 16 colors
|
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
|