mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 00:45:10 +00:00
SWORD25: Take advantage of Surface::getPixels.
This commit is contained in:
parent
5f8bce839f
commit
1550e9804b
@ -130,10 +130,10 @@ void MoviePlayer::update() {
|
||||
assert(s->format.bytesPerPixel == 4);
|
||||
|
||||
#ifdef THEORA_INDIRECT_RENDERING
|
||||
const byte *frameData = (const byte *)s->getBasePtr(0, 0);
|
||||
const byte *frameData = (const byte *)s->getPixels();
|
||||
_outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch);
|
||||
#else
|
||||
g_system->copyRectToScreen(s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h));
|
||||
g_system->copyRectToScreen(s->getPixels(), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h));
|
||||
g_system->updateScreen();
|
||||
#endif
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ bool ImgLoader::decodePNGImage(const byte *fileDataPtr, uint fileSize, byte *&un
|
||||
width = pngSurface->w;
|
||||
height = pngSurface->h;
|
||||
uncompressedDataPtr = new byte[pngSurface->pitch * pngSurface->h];
|
||||
memcpy(uncompressedDataPtr, (byte *)pngSurface->getBasePtr(0, 0), pngSurface->pitch * pngSurface->h);
|
||||
memcpy(uncompressedDataPtr, (byte *)pngSurface->getPixels(), pngSurface->pitch * pngSurface->h);
|
||||
pngSurface->free();
|
||||
|
||||
delete pngSurface;
|
||||
|
@ -287,7 +287,7 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
|
||||
if ((width != srcImage.w) || (height != srcImage.h)) {
|
||||
// Scale the image
|
||||
img = imgScaled = scale(srcImage, width, height);
|
||||
savedPixels = (byte *)img->getBasePtr(0, 0);
|
||||
savedPixels = (byte *)img->getPixels();
|
||||
} else {
|
||||
img = &srcImage;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace Sword25 {
|
||||
|
||||
bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream) {
|
||||
// Convert the RGBA data to RGB
|
||||
const byte *pSrc = (const byte *)data->getBasePtr(0, 0);
|
||||
const byte *pSrc = (const byte *)data->getPixels();
|
||||
|
||||
// Write our own custom header
|
||||
stream->writeUint32BE(MKTAG('S','C','R','N')); // SCRN, short for "Screenshot"
|
||||
@ -85,7 +85,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data)
|
||||
uint x, y;
|
||||
x = y = 0;
|
||||
|
||||
for (byte *pDest = (byte *)thumbnail.getBasePtr(0, 0); pDest < ((byte *)thumbnail.getBasePtr(0, thumbnail.h)); ) {
|
||||
for (byte *pDest = (byte *)thumbnail.getPixels(); pDest < ((byte *)thumbnail.getBasePtr(0, thumbnail.h)); ) {
|
||||
// Get an average over a 4x4 pixel block in the source image
|
||||
int alpha, red, green, blue;
|
||||
alpha = red = green = blue = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user