From 37e2685cc6ee74267e4a7b348ca57e822aa30a0e Mon Sep 17 00:00:00 2001 From: hybrid Date: Wed, 5 Dec 2007 17:15:18 +0000 Subject: [PATCH] Add return values. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1097 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/CNullDriver.h | 2 +- source/Irrlicht/COpenGLDriver.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/Irrlicht/CNullDriver.h b/source/Irrlicht/CNullDriver.h index bb0c87d4..151e55bd 100644 --- a/source/Irrlicht/CNullDriver.h +++ b/source/Irrlicht/CNullDriver.h @@ -316,7 +316,7 @@ namespace video virtual SHWBufferLink *getBufferLink(const scene::IMeshBuffer* mb); //! updates hardware buffer if needed (only some drivers can) - virtual bool updateHardwareBuffer(SHWBufferLink *HWBuffer) {} + virtual bool updateHardwareBuffer(SHWBufferLink *HWBuffer) {return true;} //! Create hardware buffer from mesh (only some drivers can) virtual SHWBufferLink *createHardwareBuffer(const scene::IMeshBuffer* mb) {return 0;} diff --git a/source/Irrlicht/COpenGLDriver.cpp b/source/Irrlicht/COpenGLDriver.cpp index 2d2694c1..1a70aa4e 100644 --- a/source/Irrlicht/COpenGLDriver.cpp +++ b/source/Irrlicht/COpenGLDriver.cpp @@ -639,7 +639,8 @@ bool COpenGLDriver::updateIndexHardwareBuffer(SHWBufferLink_opengl *HWBuffer) //! updates hardware buffer if needed bool COpenGLDriver::updateHardwareBuffer(SHWBufferLink *HWBuffer) { - if (!HWBuffer) return false; + if (!HWBuffer) + return false; if (HWBuffer->ChangedID != HWBuffer->MeshBuffer->getChangedID() || !((SHWBufferLink_opengl*)HWBuffer)->vbo_indicesID @@ -647,9 +648,12 @@ bool COpenGLDriver::updateHardwareBuffer(SHWBufferLink *HWBuffer) { HWBuffer->ChangedID = HWBuffer->MeshBuffer->getChangedID(); - if (!updateVertexHardwareBuffer((SHWBufferLink_opengl*)HWBuffer)) return false; - if (!updateIndexHardwareBuffer((SHWBufferLink_opengl*)HWBuffer)) return false; + if (!updateVertexHardwareBuffer((SHWBufferLink_opengl*)HWBuffer)) + return false; + if (!updateIndexHardwareBuffer((SHWBufferLink_opengl*)HWBuffer)) + return false; } + return true; } //! Create hardware buffer from mesh