2011-07-03 12:09:48 +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.
|
2014-02-18 02:34:22 +01:00
|
|
|
*
|
2011-07-03 12:09:48 +00:00
|
|
|
* 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.
|
2014-02-18 02:34:22 +01:00
|
|
|
*
|
2011-07-03 12:09:48 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NEVERHOOD_SCREEN_H
|
|
|
|
#define NEVERHOOD_SCREEN_H
|
|
|
|
|
2012-10-17 20:49:43 +00:00
|
|
|
#include "common/array.h"
|
2011-07-03 12:09:48 +00:00
|
|
|
#include "graphics/surface.h"
|
|
|
|
#include "neverhood/neverhood.h"
|
2012-11-14 12:21:13 +00:00
|
|
|
#include "neverhood/microtiles.h"
|
2011-07-04 10:52:07 +00:00
|
|
|
#include "neverhood/graphics.h"
|
2011-07-03 12:09:48 +00:00
|
|
|
|
2016-05-21 13:44:27 +03:00
|
|
|
namespace Video {
|
|
|
|
class SmackerDecoder;
|
|
|
|
}
|
|
|
|
|
2011-07-03 12:09:48 +00:00
|
|
|
namespace Neverhood {
|
|
|
|
|
2012-10-17 20:49:43 +00:00
|
|
|
struct RenderItem {
|
|
|
|
const Graphics::Surface *_surface;
|
|
|
|
const Graphics::Surface *_shadowSurface;
|
|
|
|
int16 _destX, _destY;
|
|
|
|
int16 _srcX, _srcY, _width, _height;
|
|
|
|
bool _transparent;
|
|
|
|
byte _version;
|
|
|
|
bool _refresh;
|
|
|
|
bool operator==(const RenderItem &second) const {
|
|
|
|
return
|
|
|
|
_surface == second._surface &&
|
|
|
|
_shadowSurface == second._shadowSurface &&
|
|
|
|
_destX == second._destX &&
|
|
|
|
_destY == second._destY &&
|
|
|
|
_srcX == second._srcX &&
|
|
|
|
_srcY == second._srcY &&
|
|
|
|
_width == second._width &&
|
|
|
|
_height == second._height &&
|
|
|
|
_transparent == second._transparent &&
|
|
|
|
_version == second._version;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef Common::Array<RenderItem> RenderQueue;
|
|
|
|
|
2011-07-03 12:09:48 +00:00
|
|
|
class Screen {
|
|
|
|
public:
|
|
|
|
Screen(NeverhoodEngine *vm);
|
|
|
|
~Screen();
|
2011-07-04 10:52:07 +00:00
|
|
|
void update();
|
2012-10-14 10:28:44 +00:00
|
|
|
uint32 getNextFrameTime();
|
2013-01-29 11:57:06 +00:00
|
|
|
void saveParams();
|
|
|
|
void restoreParams();
|
2011-07-03 12:09:48 +00:00
|
|
|
void setFps(int fps);
|
|
|
|
int getFps();
|
2012-11-14 12:21:13 +00:00
|
|
|
void setYOffset(int16 yOffset);
|
|
|
|
int16 getYOffset();
|
2011-07-03 12:09:48 +00:00
|
|
|
void setPaletteData(byte *paletteData);
|
|
|
|
void unsetPaletteData(byte *paletteData);
|
2012-10-19 13:55:37 +00:00
|
|
|
byte *getPaletteData() { return _paletteData; }
|
2011-07-03 12:09:48 +00:00
|
|
|
void testPalette(byte *paletteData);
|
|
|
|
void updatePalette();
|
|
|
|
void clear();
|
2012-10-19 21:17:10 +00:00
|
|
|
void clearRenderQueue();
|
2012-10-17 20:49:43 +00:00
|
|
|
void drawSurface2(const Graphics::Surface *surface, NDrawRect &drawRect, NRect &clipRect, bool transparent, byte version,
|
2012-09-14 22:38:31 +00:00
|
|
|
const Graphics::Surface *shadowSurface = NULL);
|
2012-10-17 20:49:43 +00:00
|
|
|
void drawSurface3(const Graphics::Surface *surface, int16 x, int16 y, NDrawRect &drawRect, NRect &clipRect, bool transparent, byte version);
|
2011-07-04 17:58:38 +00:00
|
|
|
void drawDoubleSurface2(const Graphics::Surface *surface, NDrawRect &drawRect);
|
2012-10-17 20:49:43 +00:00
|
|
|
void drawUnk(const Graphics::Surface *surface, NDrawRect &drawRect, NDrawRect &sysRect, NRect &clipRect, bool transparent, byte version);
|
|
|
|
void drawSurfaceClipRects(const Graphics::Surface *surface, NDrawRect &drawRect, NRect *clipRects, uint clipRectsCount, bool transparent, byte version);
|
2012-10-09 18:30:39 +00:00
|
|
|
void setSmackerDecoder(Video::SmackerDecoder *smackerDecoder) { _smackerDecoder = smackerDecoder; }
|
2012-10-17 20:49:43 +00:00
|
|
|
void queueBlit(const Graphics::Surface *surface, int16 destX, int16 destY, NRect &ddRect, bool transparent, byte version,
|
|
|
|
const Graphics::Surface *shadowSurface = NULL);
|
|
|
|
void blitRenderItem(const RenderItem &renderItem, const Common::Rect &clipRect);
|
2011-07-03 12:09:48 +00:00
|
|
|
protected:
|
|
|
|
NeverhoodEngine *_vm;
|
2012-11-14 12:21:13 +00:00
|
|
|
MicroTileArray *_microTiles;
|
2011-07-03 12:09:48 +00:00
|
|
|
Graphics::Surface *_backScreen;
|
2013-01-29 11:57:06 +00:00
|
|
|
Video::SmackerDecoder *_smackerDecoder, *_savedSmackerDecoder;
|
2012-10-09 18:30:39 +00:00
|
|
|
int32 _ticks;
|
2013-01-29 11:57:06 +00:00
|
|
|
int32 _frameDelay, _savedFrameDelay;
|
2011-07-03 12:09:48 +00:00
|
|
|
byte *_paletteData;
|
|
|
|
bool _paletteChanged;
|
2013-01-29 11:57:06 +00:00
|
|
|
int16 _yOffset, _savedYOffset;
|
2012-10-17 20:49:43 +00:00
|
|
|
bool _fullRefresh;
|
|
|
|
RenderQueue *_renderQueue, *_prevRenderQueue;
|
2011-07-03 12:09:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Neverhood
|
|
|
|
|
|
|
|
#endif /* NEVERHOOD_SCREEN_H */
|