diff options
author | Einar Johan Trøan Sømåen | 2013-01-26 18:06:42 +0100 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2013-01-26 18:07:07 +0100 |
commit | 980dc4a456f55a8b6526d2bc6f7694a0b2d666b3 (patch) | |
tree | bef13619df90984b731795e72721da7d39089041 /engines/wintermute/base/gfx | |
parent | 6ae97cdfbe88fa34363aabc46847b0c9a32eefe5 (diff) | |
download | scummvm-rg350-980dc4a456f55a8b6526d2bc6f7694a0b2d666b3.tar.gz scummvm-rg350-980dc4a456f55a8b6526d2bc6f7694a0b2d666b3.tar.bz2 scummvm-rg350-980dc4a456f55a8b6526d2bc6f7694a0b2d666b3.zip |
WINTERMUTE: Replace all NULLs with nullptr.
Diffstat (limited to 'engines/wintermute/base/gfx')
8 files changed, 34 insertions, 34 deletions
diff --git a/engines/wintermute/base/gfx/base_image.cpp b/engines/wintermute/base/gfx/base_image.cpp index 4b15d563ed..05037cd177 100644 --- a/engines/wintermute/base/gfx/base_image.cpp +++ b/engines/wintermute/base/gfx/base_image.cpp @@ -43,10 +43,10 @@ namespace Wintermute { ////////////////////////////////////////////////////////////////////// BaseImage::BaseImage() { _fileManager = BaseFileManager::getEngineInstance(); - _palette = NULL; - _surface = NULL; - _decoder = NULL; - _deletableSurface = NULL; + _palette = nullptr; + _surface = nullptr; + _decoder = nullptr; + _deletableSurface = nullptr; } @@ -118,7 +118,7 @@ bool BaseImage::resize(int newWidth, int newHeight) { if (_deletableSurface) { _deletableSurface->free(); delete _deletableSurface; - _deletableSurface = NULL; + _deletableSurface = nullptr; } _surface = _deletableSurface = temp.scale((uint16)newWidth, (uint16)newHeight); temp.free(); @@ -222,7 +222,7 @@ bool BaseImage::copyFrom(BaseImage *origImage, int newWidth, int newHeight) { if (_deletableSurface) { _deletableSurface->free(); delete _deletableSurface; - _deletableSurface = NULL; + _deletableSurface = nullptr; } _surface = _deletableSurface = temp.scale((uint16)newWidth, (uint16)newHeight); return true; diff --git a/engines/wintermute/base/gfx/base_renderer.cpp b/engines/wintermute/base/gfx/base_renderer.cpp index e7ffc14c25..6c230d2411 100644 --- a/engines/wintermute/base/gfx/base_renderer.cpp +++ b/engines/wintermute/base/gfx/base_renderer.cpp @@ -56,7 +56,7 @@ BaseRenderer::BaseRenderer(BaseGame *inGame) : BaseClass(inGame) { _loadImageName = ""; _saveImageName = ""; - _saveLoadImage = NULL; + _saveLoadImage = nullptr; _loadInProgress = false; _hasDrawnSaveLoadImage = false; @@ -132,24 +132,24 @@ void BaseRenderer::initSaveLoad(bool isSaving, bool quickSave) { if (isSaving && !quickSave) { delete _saveLoadImage; - _saveLoadImage = NULL; + _saveLoadImage = nullptr; if (_saveImageName.size()) { _saveLoadImage = createSurface(); if (!_saveLoadImage || DID_FAIL(_saveLoadImage->create(_saveImageName, true, 0, 0, 0))) { delete _saveLoadImage; - _saveLoadImage = NULL; + _saveLoadImage = nullptr; } } } else { delete _saveLoadImage; - _saveLoadImage = NULL; + _saveLoadImage = nullptr; if (_loadImageName.size()) { _saveLoadImage = createSurface(); if (!_saveLoadImage || DID_FAIL(_saveLoadImage->create(_loadImageName, true, 0, 0, 0))) { delete _saveLoadImage; - _saveLoadImage = NULL; + _saveLoadImage = nullptr; } } _loadInProgress = true; @@ -162,7 +162,7 @@ void BaseRenderer::endSaveLoad() { _indicatorWidthDrawn = 0; delete _saveLoadImage; - _saveLoadImage = NULL; + _saveLoadImage = nullptr; } void BaseRenderer::persistSaveLoadImages(BasePersistenceManager *persistMgr) { @@ -214,7 +214,7 @@ BaseObject *BaseRenderer::getObjectAt(int x, int y) { } } - return (BaseObject *)NULL; + return (BaseObject *)nullptr; } @@ -317,7 +317,7 @@ bool BaseRenderer::clipCursor() { ////////////////////////////////////////////////////////////////////////// bool BaseRenderer::unclipCursor() { /* - if (!_windowed) ::ClipCursor(NULL); + if (!_windowed) ::ClipCursor(nullptr); */ return STATUS_OK; } diff --git a/engines/wintermute/base/gfx/base_renderer.h b/engines/wintermute/base/gfx/base_renderer.h index 796dee8cd1..9bc195f1e1 100644 --- a/engines/wintermute/base/gfx/base_renderer.h +++ b/engines/wintermute/base/gfx/base_renderer.h @@ -81,13 +81,13 @@ public: * @param g the green component to fade too. * @param b the blue component to fade too. * @param a the alpha component to fade too. - * @param rect the portion of the screen to fade (if NULL, the entire screen will be faded). + * @param rect the portion of the screen to fade (if nullptr, the entire screen will be faded). */ - virtual void fadeToColor(byte r, byte g, byte b, byte a, Common::Rect *rect = NULL) = 0; + virtual void fadeToColor(byte r, byte g, byte b, byte a, Common::Rect *rect = nullptr) = 0; virtual bool drawLine(int x1, int y1, int x2, int y2, uint32 color); // Unused outside indicator-display virtual bool drawRect(int x1, int y1, int x2, int y2, uint32 color, int width = 1); // Unused outside indicator-display - BaseRenderer(BaseGame *inGame = NULL); + BaseRenderer(BaseGame *inGame = nullptr); virtual ~BaseRenderer(); virtual bool setProjection() { return STATUS_OK; @@ -101,7 +101,7 @@ public: * @param g the green component to fill with. * @param b the blue component to fill with. */ - virtual bool fill(byte r, byte g, byte b, Common::Rect *rect = NULL) = 0; + virtual bool fill(byte r, byte g, byte b, Common::Rect *rect = nullptr) = 0; virtual void onWindowChange(); virtual bool initRenderer(int width, int height, bool windowed); /** diff --git a/engines/wintermute/base/gfx/base_surface.h b/engines/wintermute/base/gfx/base_surface.h index 012be95aac..1ada900161 100644 --- a/engines/wintermute/base/gfx/base_surface.h +++ b/engines/wintermute/base/gfx/base_surface.h @@ -63,7 +63,7 @@ public: return STATUS_FAILED; } virtual bool putPixel(int x, int y, byte r, byte g, byte b, int a = -1); - virtual bool getPixel(int x, int y, byte *r, byte *g, byte *b, byte *a = NULL); + virtual bool getPixel(int x, int y, byte *r, byte *g, byte *b, byte *a = nullptr); virtual bool comparePixel(int x, int y, byte r, byte g, byte b, int a = -1); virtual bool startPixelOp(); virtual bool endPixelOp(); diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp index 748affa13f..cec594535f 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp @@ -54,13 +54,13 @@ BaseRenderOSystem::BaseRenderOSystem(BaseGame *inGame) : BaseRenderer(inGame) { _spriteBatch = false; _batchNum = 0; _skipThisFrame = false; - _previousTicket = NULL; + _previousTicket = nullptr; _borderLeft = _borderRight = _borderTop = _borderBottom = 0; _ratioX = _ratioY = 1.0f; setAlphaMod(255); setColorMod(255, 255, 255); - _dirtyRect = NULL; + _dirtyRect = nullptr; _disableDirtyRects = false; if (ConfMan.hasKey("dirty_rects")) { _disableDirtyRects = !ConfMan.getBool("dirty_rects"); @@ -169,7 +169,7 @@ bool BaseRenderOSystem::flip() { if (_skipThisFrame) { _skipThisFrame = false; delete _dirtyRect; - _dirtyRect = NULL; + _dirtyRect = nullptr; g_system->updateScreen(); _needsFlip = false; return true; @@ -196,7 +196,7 @@ bool BaseRenderOSystem::flip() { } // g_system->copyRectToScreen((byte *)_renderSurface->pixels, _renderSurface->pitch, _dirtyRect->left, _dirtyRect->top, _dirtyRect->width(), _dirtyRect->height()); delete _dirtyRect; - _dirtyRect = NULL; + _dirtyRect = nullptr; g_system->updateScreen(); _needsFlip = false; } @@ -297,7 +297,7 @@ void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::S // Avoid calling end() and operator* every time, when potentially going through // LOTS of tickets. RenderQueueIterator endIterator = _renderQueue.end(); - RenderTicket *compareTicket = NULL; + RenderTicket *compareTicket = nullptr; for (it = _lastAddedTicket; it != endIterator; ++it) { compareTicket = *it; if (*(compareTicket) == compare && compareTicket->_isValid) { diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.h b/engines/wintermute/base/gfx/osystem/base_render_osystem.h index 5917551c64..cc2ed57f9b 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.h +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.h @@ -47,10 +47,10 @@ public: bool initRenderer(int width, int height, bool windowed) override; bool flip() override; virtual bool indicatorFlip(); - bool fill(byte r, byte g, byte b, Common::Rect *rect = NULL) override; + bool fill(byte r, byte g, byte b, Common::Rect *rect = nullptr) override; Graphics::PixelFormat getPixelFormat() const override; void fade(uint16 alpha) override; - void fadeToColor(byte r, byte g, byte b, byte a, Common::Rect *rect = NULL) override; + void fadeToColor(byte r, byte g, byte b, byte a, Common::Rect *rect = nullptr) override; bool drawLine(int x1, int y1, int x2, int y2, uint32 color) override; diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp index e2bc3967e2..e00b347ecc 100644 --- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp @@ -47,9 +47,9 @@ namespace Wintermute { ////////////////////////////////////////////////////////////////////////// BaseSurfaceOSystem::BaseSurfaceOSystem(BaseGame *inGame) : BaseSurface(inGame) { _surface = new Graphics::Surface(); - _alphaMask = NULL; + _alphaMask = nullptr; _hasAlpha = true; - _lockPixels = NULL; + _lockPixels = nullptr; _lockPitch = 0; _loaded = false; } @@ -59,11 +59,11 @@ BaseSurfaceOSystem::~BaseSurfaceOSystem() { if (_surface) { _surface->free(); delete _surface; - _surface = NULL; + _surface = nullptr; } delete[] _alphaMask; - _alphaMask = NULL; + _alphaMask = nullptr; _gameRef->addMem(-_width * _height * 4); BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer); @@ -177,7 +177,7 @@ void BaseSurfaceOSystem::genAlphaMask(Graphics::Surface *surface) { return; // TODO: Reimplement this delete[] _alphaMask; - _alphaMask = NULL; + _alphaMask = nullptr; if (!surface) { return; } @@ -214,7 +214,7 @@ void BaseSurfaceOSystem::genAlphaMask(Graphics::Surface *surface) { if (!hasTransparency) { delete[] _alphaMask; - _alphaMask = NULL; + _alphaMask = nullptr; } } @@ -293,7 +293,7 @@ bool BaseSurfaceOSystem::isTransparentAtLite(int x, int y) { ////////////////////////////////////////////////////////////////////////// bool BaseSurfaceOSystem::startPixelOp() { - //SDL_LockTexture(_texture, NULL, &_lockPixels, &_lockPitch); + //SDL_LockTexture(_texture, nullptr, &_lockPixels, &_lockPitch); // Any pixel-op makes the caching useless: BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer); renderer->invalidateTicketsFromSurface(this); diff --git a/engines/wintermute/base/gfx/osystem/render_ticket.cpp b/engines/wintermute/base/gfx/osystem/render_ticket.cpp index 174f54e315..d253ddca4b 100644 --- a/engines/wintermute/base/gfx/osystem/render_ticket.cpp +++ b/engines/wintermute/base/gfx/osystem/render_ticket.cpp @@ -59,7 +59,7 @@ _srcRect(*srcRect), _dstRect(*dstRect), _drawNum(0), _isValid(true), _wantsDraw( _surface = temp; } } else { - _surface = NULL; + _surface = nullptr; } } |