mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-18 07:39:08 +00:00
VOYEUR: Add support for creating a PictureResource from a Graphics::Surface
This commit is contained in:
parent
2c0a94d174
commit
1256fb6b66
@ -697,10 +697,12 @@ bool BoltEntry::hasResource() const {
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
RectResource::RectResource(const byte *src, int size) {
|
||||
int count = 1;
|
||||
if (size != 8) {
|
||||
int count;
|
||||
if ((size % 8) == 2) {
|
||||
count = READ_LE_UINT16(src);
|
||||
src += 2;
|
||||
} else {
|
||||
count = size / 8;
|
||||
}
|
||||
|
||||
for (int i = 0; i < count; ++i, src += 8) {
|
||||
@ -815,6 +817,19 @@ PictureResource::PictureResource(BoltFilesState &state, const byte *src) {
|
||||
}
|
||||
}
|
||||
|
||||
PictureResource::PictureResource(Graphics::Surface *surface) {
|
||||
_flags = 0;
|
||||
_select = 0;
|
||||
_pick = 0;
|
||||
_onOff = 0;
|
||||
_depth = 0;
|
||||
_maskData = 0;
|
||||
_planeSize = 0;
|
||||
|
||||
_bounds = Common::Rect(0, 0, surface->w, surface->h);
|
||||
_imgData = (byte *)surface->getPixels();
|
||||
}
|
||||
|
||||
PictureResource::PictureResource() {
|
||||
_flags = 0;
|
||||
_select = 0;
|
||||
@ -967,7 +982,7 @@ void ViewPortResource::setupViewPort(PictureResource *page, Common::Rect *clipRe
|
||||
if (yDiff > 0)
|
||||
r.setHeight(yDiff <= r.height() ? r.height() - yDiff : 0);
|
||||
}
|
||||
// clip = (0x20, 0x14, width: 0x140, height: 0C8h
|
||||
|
||||
_activePage = page;
|
||||
_field18 = 0;
|
||||
_clipRect = r;
|
||||
|
@ -274,6 +274,7 @@ public:
|
||||
PictureResource(BoltFilesState &state, const byte *src);
|
||||
PictureResource(int flags, int select, int pick, int onOff, int depth,
|
||||
const Common::Rect &bounds, int maskData, byte *imgData, int planeSize);
|
||||
PictureResource::PictureResource(Graphics::Surface *surface);
|
||||
PictureResource();
|
||||
virtual ~PictureResource();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user