diff options
author | Johannes Schickel | 2013-08-06 03:33:56 +0200 |
---|---|---|
committer | Johannes Schickel | 2013-08-06 03:51:11 +0200 |
commit | 6d86a66493a7f9b74eeb14a5ff4bd750805d00ee (patch) | |
tree | 963e01e7618447f35b7e0fea465140a3890a85a9 /backends/platform/ds | |
parent | 6639958d7af352db5f500292b3c0398a3c0579b0 (diff) | |
download | scummvm-rg350-6d86a66493a7f9b74eeb14a5ff4bd750805d00ee.tar.gz scummvm-rg350-6d86a66493a7f9b74eeb14a5ff4bd750805d00ee.tar.bz2 scummvm-rg350-6d86a66493a7f9b74eeb14a5ff4bd750805d00ee.zip |
NDS: Do not access Surface::pixels directly.
Diffstat (limited to 'backends/platform/ds')
-rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 2f6358d8ee..f109983fbc 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -296,7 +296,7 @@ void OSystem_DS::copyRectToScreen(const void *buf, int pitch, int x, int y, int // to save a few pennies/euro cents on the hardware. if (_frameBufferExists) { - bg = (u16 *)_framebuffer.pixels; + bg = (u16 *)_framebuffer.getPixels(); stride = _framebuffer.pitch; } else { bg = (u16 *)DS::get8BitBackBuffer(); @@ -455,7 +455,7 @@ void OSystem_DS::copyRectToScreen(const void *buf, int pitch, int x, int y, int dmaCopyHalfWords(3, src, dest1, w); - if ((!_frameBufferExists) || (buf == _framebuffer.pixels)) { + if ((!_frameBufferExists) || (buf == _framebuffer.getPixels())) { dmaCopyHalfWords(2, src, dest2, w); } @@ -476,7 +476,7 @@ void OSystem_DS::updateScreen() { _frameBufferExists = false; // Copy temp framebuffer back to screen - copyRectToScreen((byte *)_framebuffer.pixels, _framebuffer.pitch, 0, 0, _framebuffer.w, _framebuffer.h); + copyRectToScreen((byte *)_framebuffer.getPixels(), _framebuffer.pitch, 0, 0, _framebuffer.w, _framebuffer.h); } DS::displayMode16BitFlipBuffer(); @@ -755,11 +755,8 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() { if (DS::isCpuScalerEnabled()) { - _framebuffer.pixels = DS::getScalerBuffer(); - _framebuffer.w = DS::getGameWidth(); - _framebuffer.h = DS::getGameHeight(); - _framebuffer.pitch = DS::getGameWidth(); - _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); + _framebuffer.init(DS::getGameWidth(), DS::getGameHeight(), DS::getGameWidth(), + DS::getScalerBuffer(), Graphics::PixelFormat::createFormatCLUT8()); } else { @@ -780,11 +777,7 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() { dmaCopyHalfWords(3, srcLine, destLine, width); } - _framebuffer.pixels = dest; - _framebuffer.w = width; - _framebuffer.h = height; - _framebuffer.pitch = width; - _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); + _framebuffer.init(width, height, width, dest, Graphics::PixelFormat::createFormatCLUT8()); } @@ -798,8 +791,8 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() { for (int y = 0; y < DS::getGameHeight(); y++) { DC_FlushRange(image + (y * imageStrideInWords), DS::getGameWidth()); for (int x = 0; x < DS::getGameWidth() >> 1; x++) { - *(((u16 *) (_framebuffer.pixels)) + y * (DS::getGameWidth() >> 1) + x) = image[(y * imageStrideInWords) + x]; -// *(((u16 *) (surf->pixels)) + y * (DS::getGameWidth() >> 1) + x) = image[y * imageStrideInWords + x]; + *(((u16 *) (_framebuffer.getPixels())) + y * (DS::getGameWidth() >> 1) + x) = image[(y * imageStrideInWords) + x]; +// *(((u16 *) (surf->getPixels())) + y * (DS::getGameWidth() >> 1) + x) = image[y * imageStrideInWords + x]; } }*/ |