mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-13 23:43:34 +00:00
NEVERHOOD: Start with the BaseSurface class (doesn't do much yet)
This commit is contained in:
parent
7d5d5f139f
commit
a262055df2
@ -24,6 +24,39 @@
|
||||
|
||||
namespace Neverhood {
|
||||
|
||||
BaseSurface::BaseSurface(NeverhoodEngine *vm, int priority, int16 width, int16 height)
|
||||
: _vm(vm), _priority(priority), _visible(true) {
|
||||
|
||||
_drawRect.x = 0;
|
||||
_drawRect.y = 0;
|
||||
_drawRect.width = width;
|
||||
_drawRect.height = height;
|
||||
_sysRect.x = 0;
|
||||
_sysRect.y = 0;
|
||||
_sysRect.width = (width + 3) & 0xFFFC; // align by 4 bytes
|
||||
_sysRect.height = height;
|
||||
_clipRect.x1 = 0;
|
||||
_clipRect.y1 = 0;
|
||||
_clipRect.x2 = 640;
|
||||
_clipRect.y2 = 480;
|
||||
_surface = new Graphics::Surface();
|
||||
_surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
|
||||
}
|
||||
|
||||
BaseSurface::~BaseSurface() {
|
||||
delete _surface;
|
||||
}
|
||||
|
||||
void BaseSurface::draw() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void BaseSurface::addDirtyRect() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
// Misc
|
||||
|
||||
void parseBitmapResource(byte *sprite, bool *rle, NDimensions *dimensions, NUnknown *unknown, byte **palette, byte **pixels) {
|
||||
|
||||
uint16 flags;
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include "common/array.h"
|
||||
#include "common/file.h"
|
||||
#include "graphics/surface.h"
|
||||
#include "neverhood/neverhood.h"
|
||||
|
||||
namespace Neverhood {
|
||||
@ -37,6 +38,36 @@ struct NUnknown {
|
||||
int16 unk1, unk2;
|
||||
};
|
||||
|
||||
struct NRect {
|
||||
int16 x1, y1, x2, y2;
|
||||
NRect() : x1(0), y1(0), x2(0), y2(0) {}
|
||||
};
|
||||
|
||||
struct NDrawRect {
|
||||
int16 x, y, width, height;
|
||||
NDrawRect() : x(0), y(0), width(0), height(0) {}
|
||||
};
|
||||
|
||||
// NOTE: "Restore" methods aren't need in the reimplementation as they're DirectDraw-specific
|
||||
|
||||
class BaseSurface {
|
||||
public:
|
||||
BaseSurface(NeverhoodEngine *vm, int priority, int16 width, int16 height);
|
||||
virtual ~BaseSurface();
|
||||
virtual void draw();
|
||||
virtual void addDirtyRect();
|
||||
protected:
|
||||
NeverhoodEngine *_vm;
|
||||
int _priority;
|
||||
bool _visible;
|
||||
Graphics::Surface *_surface;
|
||||
NDrawRect _drawRect;
|
||||
NDrawRect _sysRect;
|
||||
NRect _clipRect;
|
||||
};
|
||||
|
||||
// Misc
|
||||
|
||||
void parseBitmapResource(byte *sprite, bool *rle, NDimensions *dimensions, NUnknown *unknown, byte **palette, byte **pixels);
|
||||
void unpackSpriteRle(byte *source, int width, int height, byte *dest, int destPitch, bool flipX, bool flipY);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user