mirror of
https://github.com/scummvm/scummvm.git
synced 2026-11-18 21:34:48 +00:00
Merge pull request #1284 from vpelletier/grim_savegame_pixelformat
GRIM: Convert save game image to original pixel format.
This commit is contained in:
commit
08e053dcab
2 files changed
+3
No files matched your search
@@ -165,6 +165,7 @@ public:
|
||||
|
||||
const Graphics::PixelBuffer &getData(int num) const { return _data->getImageData(num); }
|
||||
const Graphics::PixelBuffer &getData() const { return getData(_currImage); }
|
||||
BitmapData *getBitmapData() const { return _data; }
|
||||
void *getTexIds() const { return _data->_texIds; }
|
||||
int getNumTex() const { return _data->_numTex; }
|
||||
const Graphics::PixelFormat &getPixelFormat(int num) const;
|
||||
|
||||
@@ -1061,6 +1061,7 @@ void GrimEngine::restoreGRIM() {
|
||||
}
|
||||
|
||||
void GrimEngine::storeSaveGameImage(SaveGame *state) {
|
||||
const Graphics::PixelFormat image_format = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
|
||||
int width = 250, height = 188;
|
||||
Bitmap *screenshot;
|
||||
|
||||
@@ -1076,6 +1077,7 @@ void GrimEngine::storeSaveGameImage(SaveGame *state) {
|
||||
if (screenshot) {
|
||||
int size = screenshot->getWidth() * screenshot->getHeight();
|
||||
screenshot->setActiveImage(0);
|
||||
screenshot->getBitmapData()->convertToColorFormat(image_format);
|
||||
uint16 *data = (uint16 *)screenshot->getData().getRawBuffer();
|
||||
for (int l = 0; l < size; l++) {
|
||||
state->writeLEUint16(data[l]);
|
||||
|
||||
Reference in new issue
Block a user