diff options
author | Filippos Karapetis | 2011-01-23 15:01:24 +0000 |
---|---|---|
committer | Filippos Karapetis | 2011-01-23 15:01:24 +0000 |
commit | 125078582262b40dfa53695c5e3e30d48f1ec380 (patch) | |
tree | c0678e6a8a2ef8e68372c71b3d1d66012ce65ddb /engines/sword25/gfx | |
parent | 04af67d736979272e17b0dcd0e3e4371fc0d07cc (diff) | |
download | scummvm-rg350-125078582262b40dfa53695c5e3e30d48f1ec380.tar.gz scummvm-rg350-125078582262b40dfa53695c5e3e30d48f1ec380.tar.bz2 scummvm-rg350-125078582262b40dfa53695c5e3e30d48f1ec380.zip |
SWORD25: Replaced BS_ASSERT() with assert()
svn-id: r55464
Diffstat (limited to 'engines/sword25/gfx')
-rw-r--r-- | engines/sword25/gfx/animation.cpp | 74 | ||||
-rw-r--r-- | engines/sword25/gfx/animationresource.cpp | 4 | ||||
-rw-r--r-- | engines/sword25/gfx/animationresource.h | 2 | ||||
-rw-r--r-- | engines/sword25/gfx/animationtemplate.h | 2 | ||||
-rw-r--r-- | engines/sword25/gfx/bitmapresource.cpp | 4 | ||||
-rw-r--r-- | engines/sword25/gfx/bitmapresource.h | 18 | ||||
-rw-r--r-- | engines/sword25/gfx/dynamicbitmap.cpp | 6 | ||||
-rw-r--r-- | engines/sword25/gfx/fontresource.cpp | 8 | ||||
-rw-r--r-- | engines/sword25/gfx/fontresource.h | 2 | ||||
-rw-r--r-- | engines/sword25/gfx/graphicengine.cpp | 6 | ||||
-rw-r--r-- | engines/sword25/gfx/graphicengine.h | 2 | ||||
-rw-r--r-- | engines/sword25/gfx/graphicengine_script.cpp | 184 | ||||
-rw-r--r-- | engines/sword25/gfx/image/renderedimage.cpp | 2 | ||||
-rw-r--r-- | engines/sword25/gfx/image/swimage.cpp | 6 | ||||
-rw-r--r-- | engines/sword25/gfx/image/vectorimage.cpp | 2 | ||||
-rw-r--r-- | engines/sword25/gfx/image/vectorimage.h | 10 | ||||
-rw-r--r-- | engines/sword25/gfx/panel.cpp | 2 | ||||
-rw-r--r-- | engines/sword25/gfx/staticbitmap.cpp | 18 | ||||
-rw-r--r-- | engines/sword25/gfx/text.cpp | 8 | ||||
-rw-r--r-- | engines/sword25/gfx/timedrenderobject.cpp | 4 |
20 files changed, 182 insertions, 182 deletions
diff --git a/engines/sword25/gfx/animation.cpp b/engines/sword25/gfx/animation.cpp index d2274e9c8e..5b56d708cb 100644 --- a/engines/sword25/gfx/animation.cpp +++ b/engines/sword25/gfx/animation.cpp @@ -159,7 +159,7 @@ void Animation::stop() { void Animation::setFrame(uint nr) { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); if (nr >= animationDescriptionPtr->getFrameCount()) { error("Tried to set animation to illegal frame (%d). Value must be between 0 and %d.", @@ -175,18 +175,18 @@ void Animation::setFrame(uint nr) { bool Animation::doRender() { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); - BS_ASSERT(_currentFrame < animationDescriptionPtr->getFrameCount()); + assert(animationDescriptionPtr); + assert(_currentFrame < animationDescriptionPtr->getFrameCount()); // Bitmap des aktuellen Frames holen Resource *pResource = Kernel::getInstance()->getResourceManager()->requestResource(animationDescriptionPtr->getFrame(_currentFrame).fileName); - BS_ASSERT(pResource); - BS_ASSERT(pResource->getType() == Resource::TYPE_BITMAP); + assert(pResource); + assert(pResource->getType() == Resource::TYPE_BITMAP); BitmapResource *pBitmapResource = static_cast<BitmapResource *>(pResource); // Framebufferobjekt holen GraphicEngine *pGfx = Kernel::getInstance()->getGfx(); - BS_ASSERT(pGfx); + assert(pGfx); // Bitmap zeichnen bool result; @@ -210,8 +210,8 @@ bool Animation::doRender() { void Animation::frameNotification(int timeElapsed) { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); - BS_ASSERT(timeElapsed >= 0); + assert(animationDescriptionPtr); + assert(timeElapsed >= 0); // Nur wenn die Animation läuft wird sie auch weiterbewegt if (_running) { @@ -236,7 +236,7 @@ void Animation::frameNotification(int timeElapsed) { break; default: - BS_ASSERT(0); + assert(0); } // Deal with overflows @@ -246,7 +246,7 @@ void Animation::frameNotification(int timeElapsed) { _loopPointCallback = 0; // An underflow may only occur if the animation type is JOJO. - BS_ASSERT(animationDescriptionPtr->getAnimationType() == AT_JOJO); + assert(animationDescriptionPtr->getAnimationType() == AT_JOJO); tmpCurFrame = - tmpCurFrame; _direction = FORWARD; } else if (static_cast<uint>(tmpCurFrame) >= animationDescriptionPtr->getFrameCount()) { @@ -271,7 +271,7 @@ void Animation::frameNotification(int timeElapsed) { break; default: - BS_ASSERT(0); + assert(0); } } @@ -291,18 +291,18 @@ void Animation::frameNotification(int timeElapsed) { // Größe und Position der Animation anhand des aktuellen Frames bestimmen computeCurrentCharacteristics(); - BS_ASSERT(_currentFrame < animationDescriptionPtr->getFrameCount()); - BS_ASSERT(_currentFrameTime >= 0); + assert(_currentFrame < animationDescriptionPtr->getFrameCount()); + assert(_currentFrameTime >= 0); } void Animation::computeCurrentCharacteristics() { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); const AnimationResource::Frame &curFrame = animationDescriptionPtr->getFrame(_currentFrame); Resource *pResource = Kernel::getInstance()->getResourceManager()->requestResource(curFrame.fileName); - BS_ASSERT(pResource); - BS_ASSERT(pResource->getType() == Resource::TYPE_BITMAP); + assert(pResource); + assert(pResource->getType() == Resource::TYPE_BITMAP); BitmapResource *pBitmap = static_cast<BitmapResource *>(pResource); // Größe des Bitmaps auf die Animation übertragen @@ -321,7 +321,7 @@ void Animation::computeCurrentCharacteristics() { bool Animation::lockAllFrames() { if (!_framesLocked) { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); for (uint i = 0; i < animationDescriptionPtr->getFrameCount(); ++i) { if (!Kernel::getInstance()->getResourceManager()->requestResource(animationDescriptionPtr->getFrame(i).fileName)) { error("Could not lock all animation frames."); @@ -338,7 +338,7 @@ bool Animation::lockAllFrames() { bool Animation::unlockAllFrames() { if (_framesLocked) { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); for (uint i = 0; i < animationDescriptionPtr->getFrameCount(); ++i) { Resource *pResource; if (!(pResource = Kernel::getInstance()->getResourceManager()->requestResource(animationDescriptionPtr->getFrame(i).fileName))) { @@ -360,37 +360,37 @@ bool Animation::unlockAllFrames() { Animation::ANIMATION_TYPES Animation::getAnimationType() const { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); return animationDescriptionPtr->getAnimationType(); } int Animation::getFPS() const { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); return animationDescriptionPtr->getFPS(); } int Animation::getFrameCount() const { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); return animationDescriptionPtr->getFrameCount(); } bool Animation::isScalingAllowed() const { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); return animationDescriptionPtr->isScalingAllowed(); } bool Animation::isAlphaAllowed() const { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); return animationDescriptionPtr->isAlphaAllowed(); } bool Animation::isColorModulationAllowed() const { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); return animationDescriptionPtr->isColorModulationAllowed(); } @@ -415,7 +415,7 @@ void Animation::setY(int relY) { void Animation::setAlpha(int alpha) { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); if (!animationDescriptionPtr->isAlphaAllowed()) { warning("Tried to set alpha value on an animation that does not support alpha. Call was ignored."); return; @@ -430,7 +430,7 @@ void Animation::setAlpha(int alpha) { void Animation::setModulationColor(uint modulationColor) { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); if (!animationDescriptionPtr->isColorModulationAllowed()) { warning("Tried to set modulation color on an animation that does not support color modulation. Call was ignored"); return; @@ -450,7 +450,7 @@ void Animation::setScaleFactor(float scaleFactor) { void Animation::setScaleFactorX(float scaleFactorX) { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); if (!animationDescriptionPtr->isScalingAllowed()) { warning("Tried to set x scale factor on an animation that does not support scaling. Call was ignored"); return; @@ -467,7 +467,7 @@ void Animation::setScaleFactorX(float scaleFactorX) { void Animation::setScaleFactorY(float scaleFactorY) { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); if (!animationDescriptionPtr->isScalingAllowed()) { warning("Tried to set y scale factor on an animation that does not support scaling. Call was ignored"); return; @@ -484,7 +484,7 @@ void Animation::setScaleFactorY(float scaleFactorY) { const Common::String &Animation::getCurrentAction() const { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); return animationDescriptionPtr->getFrame(_currentFrame).action; } @@ -506,12 +506,12 @@ int Animation::getAbsoluteY() const { int Animation::computeXModifier() const { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); const AnimationResource::Frame &curFrame = animationDescriptionPtr->getFrame(_currentFrame); Resource *pResource = Kernel::getInstance()->getResourceManager()->requestResource(curFrame.fileName); - BS_ASSERT(pResource); - BS_ASSERT(pResource->getType() == Resource::TYPE_BITMAP); + assert(pResource); + assert(pResource->getType() == Resource::TYPE_BITMAP); BitmapResource *pBitmap = static_cast<BitmapResource *>(pResource); int result = curFrame.flipV ? - static_cast<int>((pBitmap->getWidth() - 1 - curFrame.hotspotX) * _scaleFactorX) : @@ -524,12 +524,12 @@ int Animation::computeXModifier() const { int Animation::computeYModifier() const { AnimationDescription *animationDescriptionPtr = getAnimationDescription(); - BS_ASSERT(animationDescriptionPtr); + assert(animationDescriptionPtr); const AnimationResource::Frame &curFrame = animationDescriptionPtr->getFrame(_currentFrame); Resource *pResource = Kernel::getInstance()->getResourceManager()->requestResource(curFrame.fileName); - BS_ASSERT(pResource); - BS_ASSERT(pResource->getType() == Resource::TYPE_BITMAP); + assert(pResource); + assert(pResource->getType() == Resource::TYPE_BITMAP); BitmapResource *pBitmap = static_cast<BitmapResource *>(pResource); int result = curFrame.flipH ? - static_cast<int>((pBitmap->getHeight() - 1 - curFrame.hotspotY) * _scaleFactorY) : @@ -566,7 +566,7 @@ bool Animation::persist(OutputPersistenceBlock &writer) { writer.write(marker); writer.write(_animationTemplateHandle); } else { - BS_ASSERT(false); + assert(false); } //writer.write(_AnimationDescriptionPtr); @@ -620,7 +620,7 @@ bool Animation::unpersist(InputPersistenceBlock &reader) { } else if (marker == 1) { reader.read(_animationTemplateHandle); } else { - BS_ASSERT(false); + assert(false); } reader.read(_framesLocked); diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp index 43a42a8e84..f5e1831acc 100644 --- a/engines/sword25/gfx/animationresource.cpp +++ b/engines/sword25/gfx/animationresource.cpp @@ -52,7 +52,7 @@ AnimationResource::AnimationResource(const Common::String &filename) : _valid(false) { // Get a pointer to the package manager _pPackage = Kernel::getInstance()->getPackage(); - BS_ASSERT(_pPackage); + assert(_pPackage); // Switch to the folder the specified Xml fiile is in Common::String oldDirectory = _pPackage->getCurrentDirectory(); @@ -218,7 +218,7 @@ bool AnimationResource::precacheAllFrames() const { } bool AnimationResource::computeFeatures() { - BS_ASSERT(_frames.size()); + assert(_frames.size()); // Alle Features werden als vorhanden angenommen _scalingAllowed = true; diff --git a/engines/sword25/gfx/animationresource.h b/engines/sword25/gfx/animationresource.h index da07b55c3b..0cbaf0a507 100644 --- a/engines/sword25/gfx/animationresource.h +++ b/engines/sword25/gfx/animationresource.h @@ -52,7 +52,7 @@ public: virtual ~AnimationResource(); virtual const Frame &getFrame(uint index) const { - BS_ASSERT(index < _frames.size()); + assert(index < _frames.size()); return _frames[index]; } virtual uint getFrameCount() const { diff --git a/engines/sword25/gfx/animationtemplate.h b/engines/sword25/gfx/animationtemplate.h index 294f249f81..06be94719d 100644 --- a/engines/sword25/gfx/animationtemplate.h +++ b/engines/sword25/gfx/animationtemplate.h @@ -63,7 +63,7 @@ public: ~AnimationTemplate(); virtual const Frame &getFrame(uint index) const { - BS_ASSERT(index < _frames.size()); + assert(index < _frames.size()); return _frames[index]; } virtual uint getFrameCount() const { diff --git a/engines/sword25/gfx/bitmapresource.cpp b/engines/sword25/gfx/bitmapresource.cpp index ac36cd3223..ac76bad4ef 100644 --- a/engines/sword25/gfx/bitmapresource.cpp +++ b/engines/sword25/gfx/bitmapresource.cpp @@ -51,8 +51,8 @@ BitmapResource::~BitmapResource() { } uint BitmapResource::getPixel(int x, int y) const { - BS_ASSERT(x >= 0 && x < _pImage->getWidth()); - BS_ASSERT(y >= 0 && y < _pImage->getHeight()); + assert(x >= 0 && x < _pImage->getWidth()); + assert(y >= 0 && y < _pImage->getHeight()); return _pImage->getPixel(x, y); } diff --git a/engines/sword25/gfx/bitmapresource.h b/engines/sword25/gfx/bitmapresource.h index 37849f918e..5abff58642 100644 --- a/engines/sword25/gfx/bitmapresource.h +++ b/engines/sword25/gfx/bitmapresource.h @@ -73,7 +73,7 @@ public: @brief Gibt die Breite des Bitmaps zurück. */ int getWidth() const { - BS_ASSERT(_pImage); + assert(_pImage); return _pImage->getWidth(); } @@ -81,7 +81,7 @@ public: @brief Gibt die Höhe des Bitmaps zurück. */ int getHeight() const { - BS_ASSERT(_pImage); + assert(_pImage); return _pImage->getHeight(); } @@ -126,7 +126,7 @@ public: Common::Rect *pSrcPartRect = NULL, uint color = BS_ARGB(255, 255, 255, 255), int width = -1, int height = -1) { - BS_ASSERT(_pImage); + assert(_pImage); return _pImage->blit(posX, posY, flipping, pSrcPartRect, color, width, height); } @@ -144,7 +144,7 @@ public: @remark Falls das Rechteck nicht völlig innerhalb des Bildschirms ist, wird es automatisch zurechtgestutzt. */ bool fill(const Common::Rect *pFillRect = 0, uint color = BS_RGB(0, 0, 0)) { - BS_ASSERT(_pImage); + assert(_pImage); return _pImage->fill(pFillRect, color); } @@ -166,7 +166,7 @@ public: @return Gibt false zurück, falls ein Blit-Aufruf mit diesem Objekt als Ziel nicht gestattet ist. */ bool isBlitTarget() { - BS_ASSERT(_pImage); + assert(_pImage); return _pImage->isBlitTarget(); } @@ -174,7 +174,7 @@ public: @brief Gibt true zurück, falls das BS_Image bei einem Aufruf von Blit() skaliert dargestellt werden kann. */ bool isScalingAllowed() { - BS_ASSERT(_pImage); + assert(_pImage); return _pImage->isScalingAllowed(); } @@ -182,7 +182,7 @@ public: @brief Gibt true zurück, wenn das BS_Image mit einem Aufruf von Fill() gefüllt werden kann. */ bool isFillingAllowed() { - BS_ASSERT(_pImage); + assert(_pImage); return _pImage->isFillingAllowed(); } @@ -190,7 +190,7 @@ public: @brief Gibt true zurück, wenn das BS_Image bei einem Aufruf von Blit() mit einem Alphawert dargestellt werden kann. */ bool isAlphaAllowed() { - BS_ASSERT(_pImage); + assert(_pImage); return _pImage->isAlphaAllowed(); } @@ -198,7 +198,7 @@ public: @brief Gibt true zurück, wenn das BS_Image bei einem Aufruf von Blit() mit Farbmodulation dargestellt werden kann. */ bool isColorModulationAllowed() { - BS_ASSERT(_pImage); + assert(_pImage); return _pImage->isColorModulationAllowed(); } diff --git a/engines/sword25/gfx/dynamicbitmap.cpp b/engines/sword25/gfx/dynamicbitmap.cpp index d4e39ed00b..90b2f59612 100644 --- a/engines/sword25/gfx/dynamicbitmap.cpp +++ b/engines/sword25/gfx/dynamicbitmap.cpp @@ -67,8 +67,8 @@ DynamicBitmap::~DynamicBitmap() { } uint DynamicBitmap::getPixel(int x, int y) const { - BS_ASSERT(x >= 0 && x < _width); - BS_ASSERT(y >= 0 && y < _height); + assert(x >= 0 && x < _width); + assert(y >= 0 && y < _height); return _image->getPixel(x, y); } @@ -76,7 +76,7 @@ uint DynamicBitmap::getPixel(int x, int y) const { bool DynamicBitmap::doRender() { // Framebufferobjekt holen GraphicEngine *pGfx = Kernel::getInstance()->getGfx(); - BS_ASSERT(pGfx); + assert(pGfx); // Bitmap zeichnen bool result; diff --git a/engines/sword25/gfx/fontresource.cpp b/engines/sword25/gfx/fontresource.cpp index 6f3e70c3fa..4951d7a9a0 100644 --- a/engines/sword25/gfx/fontresource.cpp +++ b/engines/sword25/gfx/fontresource.cpp @@ -51,9 +51,9 @@ FontResource::FontResource(Kernel *pKernel, const Common::String &fileName) : Common::XMLParser() { // Get a pointer to the package manager - BS_ASSERT(_pKernel); + assert(_pKernel); PackageManager *pPackage = _pKernel->getPackage(); - BS_ASSERT(pPackage); + assert(pPackage); // Load the contents of the file uint fileSize; @@ -89,9 +89,9 @@ bool FontResource::parserCallback_font(ParserNode *node) { } // Get a reference to the package manager - BS_ASSERT(_pKernel); + assert(_pKernel); PackageManager *pPackage = _pKernel->getPackage(); - BS_ASSERT(pPackage); + assert(pPackage); // Get the full path and filename for the bitmap resource _bitmapFileName = pPackage->getAbsolutePath(bitmapFilename); diff --git a/engines/sword25/gfx/fontresource.h b/engines/sword25/gfx/fontresource.h index 19c44d0ade..47aa581a9e 100644 --- a/engines/sword25/gfx/fontresource.h +++ b/engines/sword25/gfx/fontresource.h @@ -88,7 +88,7 @@ public: @return Das Bounding-Rect des übergebenen Zeichens auf der Charactermap. */ const Common::Rect &getCharacterRect(int character) const { - BS_ASSERT(character >= 0 && character < 256); + assert(character >= 0 && character < 256); return _characterRects[character]; } diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp index 49cf1eb7bc..7b930a4e31 100644 --- a/engines/sword25/gfx/graphicengine.cpp +++ b/engines/sword25/gfx/graphicengine.cpp @@ -258,7 +258,7 @@ Graphics::Surface *GraphicEngine::getScreenshot() { // ----------------------------------------------------------------------------- Resource *GraphicEngine::loadResource(const Common::String &filename) { - BS_ASSERT(canLoadResource(filename)); + assert(canLoadResource(filename)); // Load image for "software buffer" (FIXME: Whatever that means?) if (filename.hasSuffix("_s.png")) { @@ -303,7 +303,7 @@ Resource *GraphicEngine::loadResource(const Common::String &filename) { // Pointer auf Package-Manager holen PackageManager *pPackage = Kernel::getInstance()->getPackage(); - BS_ASSERT(pPackage); + assert(pPackage); // Datei laden byte *pFileData; @@ -470,7 +470,7 @@ uint GraphicEngine::luaColorToARGBColor(lua_State *L, int stackIndex) { } #ifdef DEBUG - BS_ASSERT(__startStackDepth == lua_gettop(L)); + assert(__startStackDepth == lua_gettop(L)); #endif return (alpha << 24) | (red << 16) | (green << 8) | blue; diff --git a/engines/sword25/gfx/graphicengine.h b/engines/sword25/gfx/graphicengine.h index ccfa2ed363..3f75e8706a 100644 --- a/engines/sword25/gfx/graphicengine.h +++ b/engines/sword25/gfx/graphicengine.h @@ -313,7 +313,7 @@ public: return width * 4; default: - BS_ASSERT(false); + assert(false); } return -1; diff --git a/engines/sword25/gfx/graphicengine_script.cpp b/engines/sword25/gfx/graphicengine_script.cpp index 357787c9b8..3888529a2a 100644 --- a/engines/sword25/gfx/graphicengine_script.cpp +++ b/engines/sword25/gfx/graphicengine_script.cpp @@ -128,7 +128,7 @@ static int newAnimationTemplate(lua_State *L) { newUintUserData(L, animationTemplateHandle); //luaL_getmetatable(L, ANIMATION_TEMPLATE_CLASS_NAME); LuaBindhelper::getMetatable(L, ANIMATION_TEMPLATE_CLASS_NAME); - BS_ASSERT(!lua_isnil(L, -1)); + assert(!lua_isnil(L, -1)); lua_setmetatable(L, -2); } else { lua_pushnil(L); @@ -198,9 +198,9 @@ static const luaL_reg ANIMATION_TEMPLATE_METHODS[] = { static GraphicEngine *getGE() { Kernel *pKernel = Kernel::getInstance(); - BS_ASSERT(pKernel); + assert(pKernel); GraphicEngine *pGE = pKernel->getGfx(); - BS_ASSERT(pGE); + assert(pGE); return pGE; } @@ -238,17 +238,17 @@ static int init(lua_State *L) { // Main-Panel zum Gfx-Modul hinzufügen RenderObjectPtr<Panel> mainPanelPtr(getGE()->getMainPanel()); - BS_ASSERT(mainPanelPtr.isValid()); + assert(mainPanelPtr.isValid()); lua_pushstring(L, GFX_LIBRARY_NAME); lua_gettable(L, LUA_GLOBALSINDEX); - BS_ASSERT(!lua_isnil(L, -1)); + assert(!lua_isnil(L, -1)); newUintUserData(L, mainPanelPtr->getHandle()); - BS_ASSERT(!lua_isnil(L, -1)); + assert(!lua_isnil(L, -1)); // luaL_getmetatable(L, PANEL_CLASS_NAME); LuaBindhelper::getMetatable(L, PANEL_CLASS_NAME); - BS_ASSERT(!lua_isnil(L, -1)); + assert(!lua_isnil(L, -1)); lua_setmetatable(L, -2); lua_pushstring(L, "MainPanel"); @@ -258,7 +258,7 @@ static int init(lua_State *L) { lua_pop(L, 1); #ifdef DEBUG - BS_ASSERT(__startStackDepth == lua_gettop(L)); + assert(__startStackDepth == lua_gettop(L)); #endif return 1; @@ -445,7 +445,7 @@ static RenderObjectPtr<RenderObject> checkRenderObject(lua_State *L, bool errorI static int ro_setPos(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); Vertex pos; Vertex::luaVertexToVertex(L, 2, pos); roPtr->setPos(pos.x, pos.y); @@ -454,35 +454,35 @@ static int ro_setPos(lua_State *L) { static int ro_setX(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); roPtr->setX(static_cast<int>(luaL_checknumber(L, 2))); return 0; } static int ro_setY(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); roPtr->setY(static_cast<int>(luaL_checknumber(L, 2))); return 0; } static int ro_setZ(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); roPtr->setZ(static_cast<int>(luaL_checknumber(L, 2))); return 0; } static int ro_setVisible(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); roPtr->setVisible(lua_tobooleancpp(L, 2)); return 0; } static int ro_getX(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); lua_pushnumber(L, roPtr->getX()); return 1; @@ -490,7 +490,7 @@ static int ro_getX(lua_State *L) { static int ro_getY(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); lua_pushnumber(L, roPtr->getY()); return 1; @@ -498,7 +498,7 @@ static int ro_getY(lua_State *L) { static int ro_getZ(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); lua_pushnumber(L, roPtr->getZ()); return 1; @@ -506,7 +506,7 @@ static int ro_getZ(lua_State *L) { static int ro_getAbsoluteX(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); lua_pushnumber(L, roPtr->getAbsoluteX()); return 1; @@ -514,7 +514,7 @@ static int ro_getAbsoluteX(lua_State *L) { static int ro_getAbsoluteY(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); lua_pushnumber(L, roPtr->getAbsoluteY()); return 1; @@ -522,7 +522,7 @@ static int ro_getAbsoluteY(lua_State *L) { static int ro_getWidth(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); lua_pushnumber(L, roPtr->getWidth()); return 1; @@ -530,7 +530,7 @@ static int ro_getWidth(lua_State *L) { static int ro_getHeight(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); lua_pushnumber(L, roPtr->getHeight()); return 1; @@ -538,7 +538,7 @@ static int ro_getHeight(lua_State *L) { static int ro_isVisible(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); lua_pushbooleancpp(L, roPtr->isVisible()); return 1; @@ -546,7 +546,7 @@ static int ro_isVisible(lua_State *L) { static int ro_addPanel(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); RenderObjectPtr<Panel> panelPtr = roPtr->addPanel(static_cast<int>(luaL_checknumber(L, 2)), static_cast<int>(luaL_checknumber(L, 3)), GraphicEngine::luaColorToARGBColor(L, 4)); @@ -554,7 +554,7 @@ static int ro_addPanel(lua_State *L) { newUintUserData(L, panelPtr->getHandle()); // luaL_getmetatable(L, PANEL_CLASS_NAME); LuaBindhelper::getMetatable(L, PANEL_CLASS_NAME); - BS_ASSERT(!lua_isnil(L, -1)); + assert(!lua_isnil(L, -1)); lua_setmetatable(L, -2); } else lua_pushnil(L); @@ -564,13 +564,13 @@ static int ro_addPanel(lua_State *L) { static int ro_addBitmap(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); RenderObjectPtr<Bitmap> bitmaPtr = roPtr->addBitmap(luaL_checkstring(L, 2)); if (bitmaPtr.isValid()) { newUintUserData(L, bitmaPtr->getHandle()); // luaL_getmetatable(L, BITMAP_CLASS_NAME); LuaBindhelper::getMetatable(L, BITMAP_CLASS_NAME); - BS_ASSERT(!lua_isnil(L, -1)); + assert(!lua_isnil(L, -1)); lua_setmetatable(L, -2); } else lua_pushnil(L); @@ -580,7 +580,7 @@ static int ro_addBitmap(lua_State *L) { static int ro_addText(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); RenderObjectPtr<Text> textPtr; if (lua_gettop(L) >= 3) @@ -592,7 +592,7 @@ static int ro_addText(lua_State *L) { newUintUserData(L, textPtr->getHandle()); // luaL_getmetatable(L, TEXT_CLASS_NAME); LuaBindhelper::getMetatable(L, TEXT_CLASS_NAME); - BS_ASSERT(!lua_isnil(L, -1)); + assert(!lua_isnil(L, -1)); lua_setmetatable(L, -2); } else lua_pushnil(L); @@ -602,7 +602,7 @@ static int ro_addText(lua_State *L) { static int ro_addAnimation(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); RenderObjectPtr<Animation> animationPtr; if (lua_type(L, 2) == LUA_TUSERDATA) @@ -614,7 +614,7 @@ static int ro_addAnimation(lua_State *L) { newUintUserData(L, animationPtr->getHandle()); // luaL_getmetatable(L, ANIMATION_CLASS_NAME); LuaBindhelper::getMetatable(L, ANIMATION_CLASS_NAME); - BS_ASSERT(!lua_isnil(L, -1)); + assert(!lua_isnil(L, -1)); lua_setmetatable(L, -2); // Alle Animationscallbacks registrieren. @@ -670,7 +670,7 @@ static RenderObjectPtr<Panel> checkPanel(lua_State *L) { static int p_getColor(lua_State *L) { RenderObjectPtr<Panel> PanelPtr = checkPanel(L); - BS_ASSERT(PanelPtr.isValid()); + assert(PanelPtr.isValid()); GraphicEngine::ARGBColorToLuaColor(L, PanelPtr->getColor()); return 1; @@ -678,14 +678,14 @@ static int p_getColor(lua_State *L) { static int p_setColor(lua_State *L) { RenderObjectPtr<Panel> PanelPtr = checkPanel(L); - BS_ASSERT(PanelPtr.isValid()); + assert(PanelPtr.isValid()); PanelPtr->setColor(GraphicEngine::luaColorToARGBColor(L, 2)); return 0; } static int p_remove(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); roPtr.erase(); return 0; } @@ -715,98 +715,98 @@ static RenderObjectPtr<Bitmap> checkBitmap(lua_State *L) { static int b_setAlpha(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); bitmapPtr->setAlpha(static_cast<uint>(luaL_checknumber(L, 2))); return 0; } static int b_setTintColor(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); bitmapPtr->setModulationColor(GraphicEngine::luaColorToARGBColor(L, 2)); return 0; } static int b_setScaleFactor(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); bitmapPtr->setScaleFactor(static_cast<float>(luaL_checknumber(L, 2))); return 0; } static int b_setScaleFactorX(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); bitmapPtr->setScaleFactorX(static_cast<float>(luaL_checknumber(L, 2))); return 0; } static int b_setScaleFactorY(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); bitmapPtr->setScaleFactorY(static_cast<float>(luaL_checknumber(L, 2))); return 0; } static int b_setFlipH(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); bitmapPtr->setFlipH(lua_tobooleancpp(L, 2)); return 0; } static int b_setFlipV(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); bitmapPtr->setFlipV(lua_tobooleancpp(L, 2)); return 0; } static int b_getAlpha(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); lua_pushnumber(L, bitmapPtr->getAlpha()); return 1; } static int b_getTintColor(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); GraphicEngine::ARGBColorToLuaColor(L, bitmapPtr->getModulationColor()); return 1; } static int b_getScaleFactorX(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); lua_pushnumber(L, bitmapPtr->getScaleFactorX()); return 1; } static int b_getScaleFactorY(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); lua_pushnumber(L, bitmapPtr->getScaleFactorY()); return 1; } static int b_isFlipH(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); lua_pushbooleancpp(L, bitmapPtr->isFlipH()); return 1; } static int b_isFlipV(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); lua_pushbooleancpp(L, bitmapPtr->isFlipV()); return 1; } static int b_getPixel(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); Vertex Pos; Vertex::luaVertexToVertex(L, 2, Pos); GraphicEngine::ARGBColorToLuaColor(L, bitmapPtr->getPixel(Pos.x, Pos.y)); @@ -815,28 +815,28 @@ static int b_getPixel(lua_State *L) { static int b_isScalingAllowed(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); lua_pushbooleancpp(L, bitmapPtr->isScalingAllowed()); return 1; } static int b_isAlphaAllowed(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); lua_pushbooleancpp(L, bitmapPtr->isAlphaAllowed()); return 1; } static int b_isTintingAllowed(lua_State *L) { RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - BS_ASSERT(bitmapPtr.isValid()); + assert(bitmapPtr.isValid()); lua_pushbooleancpp(L, bitmapPtr->isColorModulationAllowed()); return 1; } static int b_remove(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); - BS_ASSERT(roPtr.isValid()); + assert(roPtr.isValid()); roPtr.erase(); return 0; } @@ -882,84 +882,84 @@ static RenderObjectPtr<Animation> checkAnimation(lua_State *L) { static int a_play(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); animationPtr->play(); return 0; } static int a_pause(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); animationPtr->pause(); return 0; } static int a_stop(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); animationPtr->stop(); return 0; } static int a_setFrame(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); animationPtr->setFrame(static_cast<uint>(luaL_checknumber(L, 2))); return 0; } static int a_setAlpha(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); animationPtr->setAlpha(static_cast<int>(luaL_checknumber(L, 2))); return 0; } static int a_setTintColor(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); animationPtr->setModulationColor(GraphicEngine::luaColorToARGBColor(L, 2)); return 0; } static int a_setScaleFactor(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); animationPtr->setScaleFactor(static_cast<float>(luaL_checknumber(L, 2))); return 0; } static int a_setScaleFactorX(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); animationPtr->setScaleFactorX(static_cast<float>(luaL_checknumber(L, 2))); return 0; } static int a_setScaleFactorY(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); animationPtr->setScaleFactorY(static_cast<float>(luaL_checknumber(L, 2))); return 0; } static int a_getScaleFactorX(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); lua_pushnumber(L, animationPtr->getScaleFactorX()); return 1; } static int a_getScaleFactorY(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); lua_pushnumber(L, animationPtr->getScaleFactorY()); return 1; } static int a_getAnimationType(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); switch (animationPtr->getAnimationType()) { case Animation::AT_JOJO: lua_pushstring(L, "jojo"); @@ -971,63 +971,63 @@ static int a_getAnimationType(lua_State *L) { lua_pushstring(L, "oneshot"); break; default: - BS_ASSERT(false); + assert(false); } return 1; } static int a_getFPS(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); lua_pushnumber(L, animationPtr->getFPS()); return 1; } static int a_getFrameCount(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); lua_pushnumber(L, animationPtr->getFrameCount()); return 1; } static int a_isScalingAllowed(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); lua_pushbooleancpp(L, animationPtr->isScalingAllowed()); return 1; } static int a_isAlphaAllowed(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); lua_pushbooleancpp(L, animationPtr->isAlphaAllowed()); return 1; } static int a_isTintingAllowed(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); lua_pushbooleancpp(L, animationPtr->isColorModulationAllowed()); return 1; } static int a_getCurrentFrame(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); lua_pushnumber(L, animationPtr->getCurrentFrame()); return 1; } static int a_getCurrentAction(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); lua_pushstring(L, animationPtr->getCurrentAction().c_str()); return 1; } static int a_isPlaying(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); lua_pushbooleancpp(L, animationPtr->isRunning()); return 1; } @@ -1041,7 +1041,7 @@ static bool animationLoopPointCallback(uint handle) { static int a_registerLoopPointCallback(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushvalue(L, 2); @@ -1052,7 +1052,7 @@ static int a_registerLoopPointCallback(lua_State *L) { static int a_unregisterLoopPointCallback(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushvalue(L, 2); @@ -1074,7 +1074,7 @@ static bool animationActionCallback(uint Handle) { static int a_registerActionCallback(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushvalue(L, 2); @@ -1085,7 +1085,7 @@ static int a_registerActionCallback(lua_State *L) { static int a_unregisterActionCallback(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushvalue(L, 2); @@ -1103,7 +1103,7 @@ static bool animationDeleteCallback(uint Handle) { static int a_remove(lua_State *L) { RenderObjectPtr<Animation> animationPtr = checkAnimation(L); - BS_ASSERT(animationPtr.isValid()); + assert(animationPtr.isValid()); animationPtr.erase(); return 0; } @@ -1155,91 +1155,91 @@ static RenderObjectPtr<Text> checkText(lua_State *L) { static int t_setFont(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); textPtr->setFont(luaL_checkstring(L, 2)); return 0; } static int t_setText(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); textPtr->setText(luaL_checkstring(L, 2)); return 0; } static int t_setAlpha(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); textPtr->setAlpha(static_cast<int>(luaL_checknumber(L, 2))); return 0; } static int t_setColor(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); textPtr->setColor(GraphicEngine::luaColorToARGBColor(L, 2)); return 0; } static int t_setAutoWrap(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); textPtr->setAutoWrap(lua_tobooleancpp(L, 2)); return 0; } static int t_setAutoWrapThreshold(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); textPtr->setAutoWrapThreshold(static_cast<uint>(luaL_checknumber(L, 2))); return 0; } static int t_getText(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); lua_pushstring(L, textPtr->getText().c_str()); return 1; } static int t_getFont(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); lua_pushstring(L, textPtr->getFont().c_str()); return 1; } static int t_getAlpha(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); lua_pushnumber(L, textPtr->getAlpha()); return 1; } static int t_getColor(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); lua_pushnumber(L, textPtr->getColor()); return 1; } static int t_isAutoWrap(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); lua_pushbooleancpp(L, textPtr->isAutoWrapActive()); return 1; } static int t_getAutoWrapThreshold(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); lua_pushnumber(L, textPtr->getAutoWrapThreshold()); return 1; } static int t_remove(lua_State *L) { RenderObjectPtr<Text> textPtr = checkText(L); - BS_ASSERT(textPtr.isValid()); + assert(textPtr.isValid()); textPtr.erase(); return 0; } @@ -1263,11 +1263,11 @@ static const luaL_reg TEXT_METHODS[] = { bool GraphicEngine::registerScriptBindings() { Kernel *pKernel = Kernel::getInstance(); - BS_ASSERT(pKernel); + assert(pKernel); ScriptEngine *pScript = pKernel->getScript(); - BS_ASSERT(pScript); + assert(pScript); lua_State *L = static_cast<lua_State *>(pScript->getScriptObject()); - BS_ASSERT(L); + assert(L); if (!LuaBindhelper::addMethodsToClass(L, BITMAP_CLASS_NAME, RENDEROBJECT_METHODS)) return false; if (!LuaBindhelper::addMethodsToClass(L, ANIMATION_CLASS_NAME, RENDEROBJECT_METHODS)) return false; diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index c0eec6570c..d4f493d43c 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -55,7 +55,7 @@ RenderedImage::RenderedImage(const Common::String &filename, bool &result) : result = false; PackageManager *pPackage = Kernel::getInstance()->getPackage(); - BS_ASSERT(pPackage); + assert(pPackage); _backSurface = Kernel::getInstance()->getGfx()->getSurface(); diff --git a/engines/sword25/gfx/image/swimage.cpp b/engines/sword25/gfx/image/swimage.cpp index 143754ce58..ff06491b36 100644 --- a/engines/sword25/gfx/image/swimage.cpp +++ b/engines/sword25/gfx/image/swimage.cpp @@ -45,7 +45,7 @@ SWImage::SWImage(const Common::String &filename, bool &result) : result = false; PackageManager *pPackage = Kernel::getInstance()->getPackage(); - BS_ASSERT(pPackage); + assert(pPackage); // Datei laden byte *pFileData; @@ -104,8 +104,8 @@ bool SWImage::setContent(const byte *pixeldata, uint size, uint offset, uint str } uint SWImage::getPixel(int x, int y) { - BS_ASSERT(x >= 0 && x < _width); - BS_ASSERT(y >= 0 && y < _height); + assert(x >= 0 && x < _width); + assert(y >= 0 && y < _height); return _imageDataPtr[_width * y + x]; } diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp index b2af06105d..094e6a59a8 100644 --- a/engines/sword25/gfx/image/vectorimage.cpp +++ b/engines/sword25/gfx/image/vectorimage.cpp @@ -293,7 +293,7 @@ VectorImage::VectorImage(const byte *pFileData, uint fileSize, bool &success, co // Die Ausführung darf nicht an dieser Stelle ankommen: Entweder es wird ein Shape gefunden, dann wird die Funktion mit vorher verlassen, oder // es wird keines gefunden, dann tritt eine Exception auf sobald über das Ende der Datei hinaus gelesen wird. - BS_ASSERT(false); + assert(false); } VectorImage::~VectorImage() { diff --git a/engines/sword25/gfx/image/vectorimage.h b/engines/sword25/gfx/image/vectorimage.h index 3477463b43..79a7519dda 100644 --- a/engines/sword25/gfx/image/vectorimage.h +++ b/engines/sword25/gfx/image/vectorimage.h @@ -101,12 +101,12 @@ public: return _pathInfos.size(); } const VectorPathInfo &getPathInfo(uint pathNr) const { - BS_ASSERT(pathNr < getPathCount()); + assert(pathNr < getPathCount()); return _pathInfos[pathNr]; } double getLineStyleWidth(uint lineStyle) const { - BS_ASSERT(lineStyle < _lineStyles.size()); + assert(lineStyle < _lineStyles.size()); return _lineStyles[lineStyle].width; } @@ -115,7 +115,7 @@ public: } uint32 getLineStyleColor(uint lineStyle) const { - BS_ASSERT(lineStyle < _lineStyles.size()); + assert(lineStyle < _lineStyles.size()); return _lineStyles[lineStyle].color; } @@ -124,7 +124,7 @@ public: } uint32 getFillStyleColor(uint fillStyle) const { - BS_ASSERT(fillStyle < _fillStyles.size()); + assert(fillStyle < _fillStyles.size()); return _fillStyles[fillStyle]; } @@ -165,7 +165,7 @@ public: return _elements.size(); } const VectorImageElement &getElement(uint elementNr) const { - BS_ASSERT(elementNr < _elements.size()); + assert(elementNr < _elements.size()); return _elements[elementNr]; } const Common::Rect &getBoundingBox() const { diff --git a/engines/sword25/gfx/panel.cpp b/engines/sword25/gfx/panel.cpp index 6bf31d2fc8..955c317399 100644 --- a/engines/sword25/gfx/panel.cpp +++ b/engines/sword25/gfx/panel.cpp @@ -76,7 +76,7 @@ bool Panel::doRender() { return true; GraphicEngine *gfxPtr = Kernel::getInstance()->getGfx(); - BS_ASSERT(gfxPtr); + assert(gfxPtr); return gfxPtr->fill(&_bbox, _color); } diff --git a/engines/sword25/gfx/staticbitmap.cpp b/engines/sword25/gfx/staticbitmap.cpp index c9f3758505..2e8d1ba071 100644 --- a/engines/sword25/gfx/staticbitmap.cpp +++ b/engines/sword25/gfx/staticbitmap.cpp @@ -87,13 +87,13 @@ StaticBitmap::~StaticBitmap() { bool StaticBitmap::doRender() { // Bitmap holen Resource *resourcePtr = Kernel::getInstance()->getResourceManager()->requestResource(_resourceFilename); - BS_ASSERT(resourcePtr); - BS_ASSERT(resourcePtr->getType() == Resource::TYPE_BITMAP); + assert(resourcePtr); + assert(resourcePtr->getType() == Resource::TYPE_BITMAP); BitmapResource *bitmapResourcePtr = static_cast<BitmapResource *>(resourcePtr); // Framebufferobjekt holen GraphicEngine *gfxPtr = Kernel::getInstance()->getGfx(); - BS_ASSERT(gfxPtr); + assert(gfxPtr); // Bitmap zeichnen bool result; @@ -116,11 +116,11 @@ bool StaticBitmap::doRender() { } uint StaticBitmap::getPixel(int x, int y) const { - BS_ASSERT(x >= 0 && x < _width); - BS_ASSERT(y >= 0 && y < _height); + assert(x >= 0 && x < _width); + assert(y >= 0 && y < _height); Resource *pResource = Kernel::getInstance()->getResourceManager()->requestResource(_resourceFilename); - BS_ASSERT(pResource->getType() == Resource::TYPE_BITMAP); + assert(pResource->getType() == Resource::TYPE_BITMAP); BitmapResource *pBitmapResource = static_cast<BitmapResource *>(pResource); uint result = pBitmapResource->getPixel(x, y); pResource->release(); @@ -134,7 +134,7 @@ bool StaticBitmap::setContent(const byte *pixeldata, uint size, uint offset, uin bool StaticBitmap::isAlphaAllowed() const { Resource *pResource = Kernel::getInstance()->getResourceManager()->requestResource(_resourceFilename); - BS_ASSERT(pResource->getType() == Resource::TYPE_BITMAP); + assert(pResource->getType() == Resource::TYPE_BITMAP); bool result = static_cast<BitmapResource *>(pResource)->isAlphaAllowed(); pResource->release(); return result; @@ -142,7 +142,7 @@ bool StaticBitmap::isAlphaAllowed() const { bool StaticBitmap::isColorModulationAllowed() const { Resource *pResource = Kernel::getInstance()->getResourceManager()->requestResource(_resourceFilename); - BS_ASSERT(pResource->getType() == Resource::TYPE_BITMAP); + assert(pResource->getType() == Resource::TYPE_BITMAP); bool result = static_cast<BitmapResource *>(pResource)->isColorModulationAllowed(); pResource->release(); return result; @@ -150,7 +150,7 @@ bool StaticBitmap::isColorModulationAllowed() const { bool StaticBitmap::isScalingAllowed() const { Resource *pResource = Kernel::getInstance()->getResourceManager()->requestResource(_resourceFilename); - BS_ASSERT(pResource->getType() == Resource::TYPE_BITMAP); + assert(pResource->getType() == Resource::TYPE_BITMAP); bool result = static_cast<BitmapResource *>(pResource)->isScalingAllowed(); pResource->release(); return result; diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp index 9609ef810b..5dad89207f 100644 --- a/engines/sword25/gfx/text.cpp +++ b/engines/sword25/gfx/text.cpp @@ -98,7 +98,7 @@ void Text::setColor(uint modulationColor) { } void Text::setAlpha(int alpha) { - BS_ASSERT(alpha >= 0 && alpha < 256); + assert(alpha >= 0 && alpha < 256); uint newModulationColor = (_modulationColor & 0x00ffffff) | alpha << 24; if (newModulationColor != _modulationColor) { _modulationColor = newModulationColor; @@ -147,7 +147,7 @@ bool Text::doRender() { // Framebufferobjekt holen. GraphicEngine *gfxPtr = Kernel::getInstance()->getGfx(); - BS_ASSERT(gfxPtr); + assert(gfxPtr); bool result = true; Common::Array<Line>::iterator iter = _lines.begin(); @@ -212,7 +212,7 @@ FontResource *Text::lockFontResource() { void Text::updateFormat() { FontResource *fontPtr = lockFontResource(); - BS_ASSERT(fontPtr); + assert(fontPtr); updateMetrics(*fontPtr); @@ -263,7 +263,7 @@ void Text::updateFormat() { if (lastSpace < _text.size()) { ++curLine; - BS_ASSERT(curLine == _lines.size()); + assert(curLine == _lines.size()); _lines.resize(curLine + 1); _lines[curLine].text = ""; } diff --git a/engines/sword25/gfx/timedrenderobject.cpp b/engines/sword25/gfx/timedrenderobject.cpp index eaa9b90d26..e3b4d1990c 100644 --- a/engines/sword25/gfx/timedrenderobject.cpp +++ b/engines/sword25/gfx/timedrenderobject.cpp @@ -40,12 +40,12 @@ namespace Sword25 { TimedRenderObject::TimedRenderObject(RenderObjectPtr<RenderObject> pParent, TYPES type, uint handle) : RenderObject(pParent, type, handle) { - BS_ASSERT(getManager()); + assert(getManager()); getManager()->attatchTimedRenderObject(this->getHandle()); } TimedRenderObject::~TimedRenderObject() { - BS_ASSERT(getManager()); + assert(getManager()); getManager()->detatchTimedRenderObject(this->getHandle()); } |