diff options
author | Johannes Schickel | 2013-08-07 12:24:59 -0700 |
---|---|---|
committer | Johannes Schickel | 2013-08-07 12:24:59 -0700 |
commit | 7f8308e0eb50c4e13ec0684619b5474983a93a66 (patch) | |
tree | 0a057f01385a11d99add1e294f70891a8e8bf6c9 /engines/teenagent | |
parent | 6e9390feb8166d5f9d6c6fdfe00a336b4f71de4c (diff) | |
parent | e5f0c42a65f38611272542a144228753e0496493 (diff) | |
download | scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.tar.gz scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.tar.bz2 scummvm-rg350-7f8308e0eb50c4e13ec0684619b5474983a93a66.zip |
Merge pull request #365 from lordhoto/protected-pixels
Make Graphics::Surface::pixels protected.
Diffstat (limited to 'engines/teenagent')
-rw-r--r-- | engines/teenagent/font.cpp | 2 | ||||
-rw-r--r-- | engines/teenagent/resources.cpp | 2 | ||||
-rw-r--r-- | engines/teenagent/scene.cpp | 12 | ||||
-rw-r--r-- | engines/teenagent/teenagent.cpp | 2 |
4 files changed, 8 insertions, 10 deletions
diff --git a/engines/teenagent/font.cpp b/engines/teenagent/font.cpp index 47f52ff90f..9d85328f20 100644 --- a/engines/teenagent/font.cpp +++ b/engines/teenagent/font.cpp @@ -65,7 +65,7 @@ uint Font::render(Graphics::Surface *surface, int x, int y, char c, byte color) byte *glyph = _data + READ_LE_UINT16(_data + idx * 2); int h = glyph[0], w = glyph[1]; - if (surface == NULL || surface->pixels == NULL || y + h <= 0 || y >= kScreenHeight || x + w <= 0 || x >= kScreenWidth) + if (surface == NULL || surface->getPixels() == NULL || y + h <= 0 || y >= kScreenHeight || x + w <= 0 || x >= kScreenWidth) return w - _widthPack; int i0 = 0, j0 = 0; diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp index 399baf469f..cdbdcf9655 100644 --- a/engines/teenagent/resources.cpp +++ b/engines/teenagent/resources.cpp @@ -160,7 +160,7 @@ void Resources::loadOff(Graphics::Surface &surface, byte *palette, int id) { off.read(id, buf, bufferSize); byte *src = buf; - byte *dst = (byte *)surface.pixels; + byte *dst = (byte *)surface.getPixels(); memcpy(dst, src, 64000); memcpy(palette, buf + 64000, 768); diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index bdeb11a841..f36a60932c 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -48,7 +48,6 @@ Scene::Scene(TeenAgentEngine *vm) : _vm(vm), intro(false), _id(0), ons(0), onEnabled = true; memset(palette, 0, sizeof(palette)); - background.pixels = 0; FilePack varia; varia.open("varia.res"); @@ -74,8 +73,7 @@ Scene::Scene(TeenAgentEngine *vm) : _vm(vm), intro(false), _id(0), ons(0), } Scene::~Scene() { - if (background.pixels) - background.free(); + background.free(); delete[] ons; ons = 0; @@ -372,7 +370,7 @@ void Scene::init(int id, const Common::Point &pos) { for (byte i = 0; i < 4; ++i) customAnimation[i].free(); - if (background.pixels == NULL) + if (background.getPixels() == NULL) background.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8()); warp(pos); @@ -416,7 +414,7 @@ void Scene::init(int id, const Common::Point &pos) { if (nowPlaying != _vm->res->dseg.get_byte(dsAddr_currentMusic)) _vm->music->load(_vm->res->dseg.get_byte(dsAddr_currentMusic)); - _vm->_system->copyRectToScreen(background.pixels, background.pitch, 0, 0, background.w, background.h); + _vm->_system->copyRectToScreen(background.getPixels(), background.pitch, 0, 0, background.w, background.h); setPalette(0); } @@ -642,8 +640,8 @@ bool Scene::render(bool tickGame, bool tickMark, uint32 messageDelta) { return true; } - if (background.pixels && debugFeatures.feature[DebugFeatures::kShowBack]) { - _vm->_system->copyRectToScreen(background.pixels, background.pitch, 0, 0, background.w, background.h); + if (background.getPixels() && debugFeatures.feature[DebugFeatures::kShowBack]) { + _vm->_system->copyRectToScreen(background.getPixels(), background.pitch, 0, 0, background.w, background.h); } else _vm->_system->fillScreen(0); diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 0b48a18b26..e73f1100d6 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -399,7 +399,7 @@ bool TeenAgentEngine::showLogo() { return true; } - _system->copyRectToScreen(s.pixels, s.w, s.x, s.y, s.w, s.h); + _system->copyRectToScreen(s.getPixels(), s.w, s.x, s.y, s.w, s.h); _system->updateScreen(); _system->delayMillis(100); |