aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-03 01:26:04 +0200
committerJohannes Schickel2013-08-03 04:02:48 +0200
commit103e926c0765c45267c1cfac0eb07a201e5084bd (patch)
treed3e34510140ee2d881d45cdc9297b8edec805ae9 /gui
parent19fa89b8f58df702c5cb16d03a9cb51c1acce7ab (diff)
downloadscummvm-rg350-103e926c0765c45267c1cfac0eb07a201e5084bd.tar.gz
scummvm-rg350-103e926c0765c45267c1cfac0eb07a201e5084bd.tar.bz2
scummvm-rg350-103e926c0765c45267c1cfac0eb07a201e5084bd.zip
GUI: Prefer getBasePtr instead of direct Surface::pixels access.
Diffstat (limited to 'gui')
-rw-r--r--gui/EventRecorder.cpp2
-rw-r--r--gui/ThemeEngine.cpp6
-rw-r--r--gui/widget.cpp8
3 files changed, 8 insertions, 8 deletions
diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index fd0093d266..4f569b75c5 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -522,7 +522,7 @@ bool EventRecorder::grabScreenAndComputeMD5(Graphics::Surface &screen, uint8 md5
warning("Can't save screenshot");
return false;
}
- Common::MemoryReadStream bitmapStream((const byte*)screen.pixels, screen.w * screen.h * screen.format.bytesPerPixel);
+ Common::MemoryReadStream bitmapStream((const byte*)screen.getBasePtr(0, 0), screen.w * screen.h * screen.format.bytesPerPixel);
computeStreamMD5(bitmapStream, md5);
return true;
}
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 3ce043cb39..80f3946729 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -389,7 +389,7 @@ bool ThemeEngine::init() {
_overlayFormat = _system->getOverlayFormat();
setGraphicsMode(_graphicsMode);
- if (_screen.pixels && _backBuffer.pixels) {
+ if (_screen.getBasePtr(0, 0) && _backBuffer.getBasePtr(0, 0)) {
_initOk = true;
}
@@ -439,7 +439,7 @@ bool ThemeEngine::init() {
void ThemeEngine::clearAll() {
if (_initOk) {
_system->clearOverlay();
- _system->grabOverlay(_screen.pixels, _screen.pitch);
+ _system->grabOverlay(_screen.getBasePtr(0, 0), _screen.pitch);
}
}
@@ -1326,7 +1326,7 @@ bool ThemeEngine::createCursor(const Common::String &filename, int hotspotX, int
// to 8 bit mode, and have to create a suitable palette on the fly.
uint colorsFound = 0;
Common::HashMap<int, int> colorToIndex;
- const OverlayColor *src = (const OverlayColor *)cursor->pixels;
+ const OverlayColor *src = (const OverlayColor *)cursor->getBasePtr(0, 0);
for (uint y = 0; y < _cursorHeight; ++y) {
for (uint x = 0; x < _cursorWidth; ++x) {
byte r, g, b;
diff --git a/gui/widget.cpp b/gui/widget.cpp
index c3f10a861f..197250a940 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -396,7 +396,7 @@ PicButtonWidget::~PicButtonWidget() {
void PicButtonWidget::setGfx(const Graphics::Surface *gfx) {
_gfx.free();
- if (!gfx || !gfx->pixels)
+ if (!gfx || !gfx->getBasePtr(0, 0))
return;
if (gfx->format.bytesPerPixel == 1) {
@@ -429,7 +429,7 @@ void PicButtonWidget::setGfx(int w, int h, int r, int g, int b) {
void PicButtonWidget::drawWidget() {
g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), "", _state, getFlags());
- if (_gfx.pixels) {
+ if (_gfx.getBasePtr(0, 0)) {
// Check whether the set up surface needs to be converted to the GUI
// color format.
const Graphics::PixelFormat &requiredFormat = g_gui.theme()->getPixelFormat();
@@ -646,7 +646,7 @@ GraphicsWidget::~GraphicsWidget() {
void GraphicsWidget::setGfx(const Graphics::Surface *gfx) {
_gfx.free();
- if (!gfx || !gfx->pixels)
+ if (!gfx || !gfx->getBasePtr(0, 0))
return;
if (gfx->format.bytesPerPixel == 1) {
@@ -676,7 +676,7 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
}
void GraphicsWidget::drawWidget() {
- if (_gfx.pixels) {
+ if (_gfx.getBasePtr(0, 0)) {
// Check whether the set up surface needs to be converted to the GUI
// color format.
const Graphics::PixelFormat &requiredFormat = g_gui.theme()->getPixelFormat();