aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword25/fmv/movieplayer_script.cpp24
-rw-r--r--engines/sword25/fmv/yuvtorgba.cpp16
-rw-r--r--engines/sword25/gfx/animation.cpp74
-rw-r--r--engines/sword25/gfx/animationresource.cpp4
-rw-r--r--engines/sword25/gfx/animationresource.h2
-rw-r--r--engines/sword25/gfx/animationtemplate.h2
-rw-r--r--engines/sword25/gfx/bitmapresource.cpp4
-rw-r--r--engines/sword25/gfx/bitmapresource.h18
-rw-r--r--engines/sword25/gfx/dynamicbitmap.cpp6
-rw-r--r--engines/sword25/gfx/fontresource.cpp8
-rw-r--r--engines/sword25/gfx/fontresource.h2
-rw-r--r--engines/sword25/gfx/graphicengine.cpp6
-rw-r--r--engines/sword25/gfx/graphicengine.h2
-rw-r--r--engines/sword25/gfx/graphicengine_script.cpp184
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp2
-rw-r--r--engines/sword25/gfx/image/swimage.cpp6
-rw-r--r--engines/sword25/gfx/image/vectorimage.cpp2
-rw-r--r--engines/sword25/gfx/image/vectorimage.h10
-rw-r--r--engines/sword25/gfx/panel.cpp2
-rw-r--r--engines/sword25/gfx/staticbitmap.cpp18
-rw-r--r--engines/sword25/gfx/text.cpp8
-rw-r--r--engines/sword25/gfx/timedrenderobject.cpp4
-rw-r--r--engines/sword25/input/inputengine_script.cpp10
-rw-r--r--engines/sword25/kernel/common.h2
-rw-r--r--engines/sword25/kernel/kernel.cpp2
-rw-r--r--engines/sword25/kernel/kernel_script.cpp48
-rw-r--r--engines/sword25/kernel/resource.cpp2
-rw-r--r--engines/sword25/math/geometry_script.cpp50
-rw-r--r--engines/sword25/math/region.cpp8
-rw-r--r--engines/sword25/math/region.h2
-rw-r--r--engines/sword25/math/vertex.cpp2
-rw-r--r--engines/sword25/math/walkregion.cpp6
-rw-r--r--engines/sword25/package/packagemanager_script.cpp10
-rw-r--r--engines/sword25/script/lua_extensions.cpp4
-rw-r--r--engines/sword25/script/luabindhelper.cpp8
-rw-r--r--engines/sword25/script/luacallback.cpp4
-rw-r--r--engines/sword25/script/luascript.cpp8
-rw-r--r--engines/sword25/sfx/soundengine_script.cpp82
-rw-r--r--engines/sword25/sword25.cpp4
39 files changed, 327 insertions, 329 deletions
diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp
index aa854448ff..dce9048438 100644
--- a/engines/sword25/fmv/movieplayer_script.cpp
+++ b/engines/sword25/fmv/movieplayer_script.cpp
@@ -45,7 +45,7 @@ namespace Sword25 {
int loadMovie(lua_State *L) {
MoviePlayer *FMVPtr = Kernel::getInstance()->getFMV();
- BS_ASSERT(FMVPtr);
+ assert(FMVPtr);
lua_pushbooleancpp(L, FMVPtr->loadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast<uint>(luaL_checknumber(L, 2)) : 10));
@@ -54,7 +54,7 @@ int loadMovie(lua_State *L) {
int unloadMovie(lua_State *L) {
MoviePlayer *FMVPtr = Kernel::getInstance()->getFMV();
- BS_ASSERT(FMVPtr);
+ assert(FMVPtr);
lua_pushbooleancpp(L, FMVPtr->unloadMovie());
@@ -63,7 +63,7 @@ int unloadMovie(lua_State *L) {
int play(lua_State *L) {
MoviePlayer *FMVPtr = Kernel::getInstance()->getFMV();
- BS_ASSERT(FMVPtr);
+ assert(FMVPtr);
lua_pushbooleancpp(L, FMVPtr->play());
@@ -72,7 +72,7 @@ int play(lua_State *L) {
int pause(lua_State *L) {
MoviePlayer *FMVPtr = Kernel::getInstance()->getFMV();
- BS_ASSERT(FMVPtr);
+ assert(FMVPtr);
lua_pushbooleancpp(L, FMVPtr->pause());
@@ -81,7 +81,7 @@ int pause(lua_State *L) {
int update(lua_State *L) {
MoviePlayer *FMVPtr = Kernel::getInstance()->getFMV();
- BS_ASSERT(FMVPtr);
+ assert(FMVPtr);
FMVPtr->update();
@@ -90,7 +90,7 @@ int update(lua_State *L) {
int isMovieLoaded(lua_State *L) {
MoviePlayer *FMVPtr = Kernel::getInstance()->getFMV();
- BS_ASSERT(FMVPtr);
+ assert(FMVPtr);
lua_pushbooleancpp(L, FMVPtr->isMovieLoaded());
@@ -99,7 +99,7 @@ int isMovieLoaded(lua_State *L) {
int isPaused(lua_State *L) {
MoviePlayer *FMVPtr = Kernel::getInstance()->getFMV();
- BS_ASSERT(FMVPtr);
+ assert(FMVPtr);
lua_pushbooleancpp(L, FMVPtr->isPaused());
@@ -108,7 +108,7 @@ int isPaused(lua_State *L) {
int getScaleFactor(lua_State *L) {
MoviePlayer *FMVPtr = Kernel::getInstance()->getFMV();
- BS_ASSERT(FMVPtr);
+ assert(FMVPtr);
lua_pushnumber(L, FMVPtr->getScaleFactor());
@@ -117,7 +117,7 @@ int getScaleFactor(lua_State *L) {
int setScaleFactor(lua_State *L) {
MoviePlayer *FMVPtr = Kernel::getInstance()->getFMV();
- BS_ASSERT(FMVPtr);
+ assert(FMVPtr);
FMVPtr->setScaleFactor(static_cast<float>(luaL_checknumber(L, 1)));
@@ -126,7 +126,7 @@ int setScaleFactor(lua_State *L) {
int getTime(lua_State *L) {
MoviePlayer *FMVPtr = Kernel::getInstance()->getFMV();
- BS_ASSERT(FMVPtr);
+ assert(FMVPtr);
lua_pushnumber(L, FMVPtr->getTime());
@@ -151,9 +151,9 @@ const luaL_reg LIBRARY_FUNCTIONS[] = {
bool MoviePlayer::registerScriptBindings() {
ScriptEngine *pScript = Kernel::getInstance()->getScript();
- BS_ASSERT(pScript);
+ assert(pScript);
lua_State *L = static_cast<lua_State *>(pScript->getScriptObject());
- BS_ASSERT(L);
+ assert(L);
if (!LuaBindhelper::addFunctionsToLib(L, LIBRARY_NAME, LIBRARY_FUNCTIONS)) return false;
diff --git a/engines/sword25/fmv/yuvtorgba.cpp b/engines/sword25/fmv/yuvtorgba.cpp
index e9d0189265..80add1d3e0 100644
--- a/engines/sword25/fmv/yuvtorgba.cpp
+++ b/engines/sword25/fmv/yuvtorgba.cpp
@@ -167,16 +167,16 @@ static const int CLAMP_TAB[1024] = {
void YUVtoBGRA::translate(th_ycbcr_buffer &YUVBuffer, const th_info &theoraInfo, byte *pixelData, int pixelsSize) {
// Width and height of all buffers have to be divisible by 2.
- BS_ASSERT((YUVBuffer[0].width & 1) == 0);
- BS_ASSERT((YUVBuffer[0].height & 1) == 0);
- BS_ASSERT((YUVBuffer[1].width & 1) == 0);
- BS_ASSERT((YUVBuffer[2].width & 1) == 0);
+ assert((YUVBuffer[0].width & 1) == 0);
+ assert((YUVBuffer[0].height & 1) == 0);
+ assert((YUVBuffer[1].width & 1) == 0);
+ assert((YUVBuffer[2].width & 1) == 0);
// UV images have to have a quarter of the Y image resolution
- BS_ASSERT(YUVBuffer[1].width == YUVBuffer[0].width >> 1);
- BS_ASSERT(YUVBuffer[2].width == YUVBuffer[0].width >> 1);
- BS_ASSERT(YUVBuffer[1].height == YUVBuffer[0].height >> 1);
- BS_ASSERT(YUVBuffer[2].height == YUVBuffer[0].height >> 1);
+ assert(YUVBuffer[1].width == YUVBuffer[0].width >> 1);
+ assert(YUVBuffer[2].width == YUVBuffer[0].width >> 1);
+ assert(YUVBuffer[1].height == YUVBuffer[0].height >> 1);
+ assert(YUVBuffer[2].height == YUVBuffer[0].height >> 1);
const int *cl = &CLAMP_TAB[320];
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());
}
diff --git a/engines/sword25/input/inputengine_script.cpp b/engines/sword25/input/inputengine_script.cpp
index 5ce93bab82..f742f56a5a 100644
--- a/engines/sword25/input/inputengine_script.cpp
+++ b/engines/sword25/input/inputengine_script.cpp
@@ -84,9 +84,9 @@ static CommandCallbackClass *commandCallbackPtr = 0; // FIXME: should be turned
static InputEngine *getIE() {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
InputEngine *pIE = pKernel->getInput();
- BS_ASSERT(pIE);
+ assert(pIE);
return pIE;
}
@@ -263,11 +263,11 @@ static const lua_constant_reg PACKAGE_CONSTANTS[] = {
bool InputEngine::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::addFunctionsToLib(L, PACKAGE_LIBRARY_NAME, PACKAGE_FUNCTIONS)) return false;
if (!LuaBindhelper::addConstantsToLib(L, PACKAGE_LIBRARY_NAME, PACKAGE_CONSTANTS)) return false;
diff --git a/engines/sword25/kernel/common.h b/engines/sword25/kernel/common.h
index 4372bf2dc5..487bfc5c78 100644
--- a/engines/sword25/kernel/common.h
+++ b/engines/sword25/kernel/common.h
@@ -54,6 +54,4 @@
#include "sword25/kernel/common.h"
#include "common/debug.h"
-#define BS_ASSERT(EXP) assert(EXP)
-
#endif
diff --git a/engines/sword25/kernel/kernel.cpp b/engines/sword25/kernel/kernel.cpp
index c328cfdc68..7c6a683907 100644
--- a/engines/sword25/kernel/kernel.cpp
+++ b/engines/sword25/kernel/kernel.cpp
@@ -139,7 +139,7 @@ Kernel::~Kernel() {
* @param Max The maximum allowed value
*/
int Kernel::getRandomNumber(int min, int max) {
- BS_ASSERT(min <= max);
+ assert(min <= max);
return min + _rnd.getRandomNumber(max - min + 1);
}
diff --git a/engines/sword25/kernel/kernel_script.cpp b/engines/sword25/kernel/kernel_script.cpp
index d4b9a56d8e..49ad678a00 100644
--- a/engines/sword25/kernel/kernel_script.cpp
+++ b/engines/sword25/kernel/kernel_script.cpp
@@ -86,7 +86,7 @@ static int getServiceIdentifier(lua_State *L) {
static int getMilliTicks(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
lua_pushnumber(L, pKernel->getMilliTicks());
@@ -95,7 +95,7 @@ static int getMilliTicks(lua_State *L) {
static int getTimer(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
lua_pushnumber(L, static_cast<lua_Number>(pKernel->getMilliTicks()) / 1000.0);
@@ -112,23 +112,23 @@ static int startService(lua_State *L) {
static int sleep(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
pKernel->sleep(static_cast<uint>(luaL_checknumber(L, 1) * 1000));
return 0;
}
static int crash(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
pKernel->crash();
return 0;
}
static int executeFile(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
ScriptEngine *pSE = pKernel->getScript();
- BS_ASSERT(pSE);
+ assert(pSE);
lua_pushbooleancpp(L, pSE->executeFile(luaL_checkstring(L, 1)));
@@ -370,9 +370,9 @@ static const luaL_reg WINDOW_FUNCTIONS[] = {
static int precacheResource(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
ResourceManager *pResource = pKernel->getResourceManager();
- BS_ASSERT(pResource);
+ assert(pResource);
lua_pushbooleancpp(L, pResource->precacheResource(luaL_checkstring(L, 1)));
@@ -381,9 +381,9 @@ static int precacheResource(lua_State *L) {
static int forcePrecacheResource(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
ResourceManager *pResource = pKernel->getResourceManager();
- BS_ASSERT(pResource);
+ assert(pResource);
lua_pushbooleancpp(L, pResource->precacheResource(luaL_checkstring(L, 1), true));
@@ -392,9 +392,9 @@ static int forcePrecacheResource(lua_State *L) {
static int getMaxMemoryUsage(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
ResourceManager *pResource = pKernel->getResourceManager();
- BS_ASSERT(pResource);
+ assert(pResource);
lua_pushnumber(L, pResource->getMaxMemoryUsage());
@@ -403,9 +403,9 @@ static int getMaxMemoryUsage(lua_State *L) {
static int setMaxMemoryUsage(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
ResourceManager *pResource = pKernel->getResourceManager();
- BS_ASSERT(pResource);
+ assert(pResource);
pResource->setMaxMemoryUsage(static_cast<uint>(lua_tonumber(L, 1)));
@@ -414,9 +414,9 @@ static int setMaxMemoryUsage(lua_State *L) {
static int emptyCache(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
ResourceManager *pResource = pKernel->getResourceManager();
- BS_ASSERT(pResource);
+ assert(pResource);
pResource->emptyCache();
@@ -425,9 +425,9 @@ static int emptyCache(lua_State *L) {
static int isLogCacheMiss(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
ResourceManager *pResource = pKernel->getResourceManager();
- BS_ASSERT(pResource);
+ assert(pResource);
lua_pushbooleancpp(L, pResource->isLogCacheMiss());
@@ -436,9 +436,9 @@ static int isLogCacheMiss(lua_State *L) {
static int setLogCacheMiss(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
ResourceManager *pResource = pKernel->getResourceManager();
- BS_ASSERT(pResource);
+ assert(pResource);
pResource->setLogCacheMiss(lua_tobooleancpp(L, 1));
@@ -447,9 +447,9 @@ static int setLogCacheMiss(lua_State *L) {
static int dumpLockedResources(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
ResourceManager *pResource = pKernel->getResourceManager();
- BS_ASSERT(pResource);
+ assert(pResource);
pResource->dumpLockedResources();
@@ -535,9 +535,9 @@ static const luaL_reg PERSISTENCE_FUNCTIONS[] = {
bool Kernel::registerScriptBindings() {
ScriptEngine *pScript = getScript();
- BS_ASSERT(pScript);
+ assert(pScript);
lua_State *L = static_cast<lua_State *>(pScript->getScriptObject());
- BS_ASSERT(L);
+ assert(L);
if (!LuaBindhelper::addFunctionsToLib(L, KERNEL_LIBRARY_NAME, KERNEL_FUNCTIONS)) return false;
if (!LuaBindhelper::addFunctionsToLib(L, WINDOW_LIBRARY_NAME, WINDOW_FUNCTIONS)) return false;
diff --git a/engines/sword25/kernel/resource.cpp b/engines/sword25/kernel/resource.cpp
index 2ec7c6736a..f16cb3aaf2 100644
--- a/engines/sword25/kernel/resource.cpp
+++ b/engines/sword25/kernel/resource.cpp
@@ -42,7 +42,7 @@ Resource::Resource(const Common::String &fileName, RESOURCE_TYPES type) :
_type(type),
_refCount(0) {
PackageManager *pPM = Kernel::getInstance()->getPackage();
- BS_ASSERT(pPM);
+ assert(pPM);
_fileName = pPM->getAbsolutePath(fileName);
}
diff --git a/engines/sword25/math/geometry_script.cpp b/engines/sword25/math/geometry_script.cpp
index 8882d5e588..15b1aadac1 100644
--- a/engines/sword25/math/geometry_script.cpp
+++ b/engines/sword25/math/geometry_script.cpp
@@ -114,7 +114,7 @@ static bool isValidPolygonDefinition(lua_State *L) {
}
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(L));
+ assert(__startStackDepth == lua_gettop(L));
#endif
return true;
@@ -151,10 +151,10 @@ static void tablePolygonToPolygon(lua_State *L, Polygon &polygon) {
// Vertex
vertices.push_back(Vertex(X, Y));
}
- BS_ASSERT((int)vertices.size() == vertexCount);
+ assert((int)vertices.size() == vertexCount);
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(L));
+ assert(__startStackDepth == lua_gettop(L));
#endif
// Create polygon
@@ -185,10 +185,10 @@ static uint tableRegionToRegion(lua_State *L, const char *className) {
} else if (!strcmp(className, WALKREGION_CLASS_NAME)) {
regionHandle = WalkRegion::create(Region::RT_WALKREGION);
} else {
- BS_ASSERT(false);
+ assert(false);
}
- BS_ASSERT(regionHandle);
+ assert(regionHandle);
// If the first element of the parameter is a number, then case 1 is accepted
// If the first element of the parameter is a table, then case 2 is accepted
@@ -224,7 +224,7 @@ static uint tableRegionToRegion(lua_State *L, const char *className) {
tablePolygonToPolygon(L, holes.back());
lua_pop(L, 1);
}
- BS_ASSERT((int)holes.size() == polygonCount - 1);
+ assert((int)holes.size() == polygonCount - 1);
RegionRegistry::instance().resolveHandle(regionHandle)->init(polygon, &holes);
}
@@ -237,7 +237,7 @@ static uint tableRegionToRegion(lua_State *L, const char *className) {
}
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(L));
+ assert(__startStackDepth == lua_gettop(L));
#endif
return regionHandle;
@@ -247,12 +247,12 @@ static void newUserdataRegion(lua_State *L, const char *className) {
// Region due to the Lua code to create
// Any errors that occur will be intercepted to the luaL_error
uint regionHandle = tableRegionToRegion(L, className);
- BS_ASSERT(regionHandle);
+ assert(regionHandle);
newUintUserData(L, regionHandle);
// luaL_getmetatable(L, className);
LuaBindhelper::getMetatable(L, className);
- BS_ASSERT(!lua_isnil(L, -1));
+ assert(!lua_isnil(L, -1));
lua_setmetatable(L, -2);
}
@@ -290,7 +290,7 @@ static Region *checkRegion(lua_State *L) {
static int r_isValid(lua_State *L) {
Region *pR = checkRegion(L);
- BS_ASSERT(pR);
+ assert(pR);
lua_pushbooleancpp(L, pR->isValid());
return 1;
@@ -298,7 +298,7 @@ static int r_isValid(lua_State *L) {
static int r_getX(lua_State *L) {
Region *pR = checkRegion(L);
- BS_ASSERT(pR);
+ assert(pR);
lua_pushnumber(L, pR->getPosX());
return 1;
@@ -306,7 +306,7 @@ static int r_getX(lua_State *L) {
static int r_getY(lua_State *L) {
Region *pR = checkRegion(L);
- BS_ASSERT(pR);
+ assert(pR);
lua_pushnumber(L, pR->getPosY());
return 1;
@@ -314,7 +314,7 @@ static int r_getY(lua_State *L) {
static int r_getPos(lua_State *L) {
Region *pR = checkRegion(L);
- BS_ASSERT(pR);
+ assert(pR);
Vertex::vertexToLuaVertex(L, pR->getPosition());
return 1;
@@ -322,7 +322,7 @@ static int r_getPos(lua_State *L) {
static int r_isPointInRegion(lua_State *L) {
Region *pR = checkRegion(L);
- BS_ASSERT(pR);
+ assert(pR);
Vertex vertex;
Vertex::luaVertexToVertex(L, 2, vertex);
@@ -332,7 +332,7 @@ static int r_isPointInRegion(lua_State *L) {
static int r_setPos(lua_State *L) {
Region *pR = checkRegion(L);
- BS_ASSERT(pR);
+ assert(pR);
Vertex vertex;
Vertex::luaVertexToVertex(L, 2, vertex);
@@ -343,7 +343,7 @@ static int r_setPos(lua_State *L) {
static int r_setX(lua_State *L) {
Region *pR = checkRegion(L);
- BS_ASSERT(pR);
+ assert(pR);
pR->setPosX(static_cast<int>(luaL_checknumber(L, 2)));
@@ -352,7 +352,7 @@ static int r_setX(lua_State *L) {
static int r_setY(lua_State *L) {
Region *pR = checkRegion(L);
- BS_ASSERT(pR);
+ assert(pR);
pR->setPosY(static_cast<int>(luaL_checknumber(L, 2)));
@@ -361,7 +361,7 @@ static int r_setY(lua_State *L) {
static void drawPolygon(const Polygon &polygon, uint color, const Vertex &offset) {
GraphicEngine *pGE = Kernel::getInstance()->getGfx();
- BS_ASSERT(pGE);
+ assert(pGE);
for (int i = 0; i < polygon.vertexCount - 1; i++)
pGE->drawDebugLine(polygon.vertices[i] + offset, polygon.vertices[i + 1] + offset, color);
@@ -377,7 +377,7 @@ static void drawRegion(const Region &region, uint color, const Vertex &offset) {
static int r_draw(lua_State *L) {
Region *pR = checkRegion(L);
- BS_ASSERT(pR);
+ assert(pR);
switch (lua_gettop(L)) {
case 3: {
@@ -400,7 +400,7 @@ static int r_draw(lua_State *L) {
static int r_getCentroid(lua_State *L) {
Region *RPtr = checkRegion(L);
- BS_ASSERT(RPtr);
+ assert(RPtr);
Vertex::vertexToLuaVertex(L, RPtr->getCentroid());
@@ -409,7 +409,7 @@ static int r_getCentroid(lua_State *L) {
static int r_delete(lua_State *L) {
Region *pR = checkRegion(L);
- BS_ASSERT(pR);
+ assert(pR);
delete pR;
return 0;
}
@@ -443,7 +443,7 @@ static WalkRegion *checkWalkRegion(lua_State *L) {
static int wr_getPath(lua_State *L) {
WalkRegion *pWR = checkWalkRegion(L);
- BS_ASSERT(pWR);
+ assert(pWR);
Vertex start;
Vertex::luaVertexToVertex(L, 2, start);
@@ -471,11 +471,11 @@ static const luaL_reg WALKREGION_METHODS[] = {
bool Geometry::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, REGION_CLASS_NAME, REGION_METHODS)) return false;
if (!LuaBindhelper::addMethodsToClass(L, WALKREGION_CLASS_NAME, REGION_METHODS)) return false;
diff --git a/engines/sword25/math/region.cpp b/engines/sword25/math/region.cpp
index ae729c4de3..d0d0859906 100644
--- a/engines/sword25/math/region.cpp
+++ b/engines/sword25/math/region.cpp
@@ -62,7 +62,7 @@ uint Region::create(REGION_TYPE type) {
break;
default:
- BS_ASSERT(true);
+ assert(true);
}
return RegionRegistry::instance().resolvePtr(regionPtr);
@@ -80,7 +80,7 @@ uint Region::create(InputPersistenceBlock &reader, uint handle) {
} else if (type == RT_WALKREGION) {
regionPtr = new WalkRegion(reader, handle);
} else {
- BS_ASSERT(false);
+ assert(false);
}
return RegionRegistry::instance().resolvePtr(regionPtr);
@@ -206,7 +206,7 @@ Vertex Region::findClosestRegionPoint(const Vertex &point) const {
const Polygon &polygon = _polygons[polygonIdx];
- BS_ASSERT(polygon.vertexCount > 1);
+ assert(polygon.vertexCount > 1);
// For each line of the polygon, calculate the point that is cloest to the given point
// The point of this set with the smallest distance to the given point is the result.
@@ -287,7 +287,7 @@ Vertex Region::findClosestPointOnLine(const Vertex &lineStart, const Vertex &lin
// Line of Sight
bool Region::isLineOfSight(const Vertex &a, const Vertex &b) const {
- BS_ASSERT(_polygons.size());
+ assert(_polygons.size());
// The line must be within the contour polygon, and outside of any hole polygons
Common::Array<Polygon>::const_iterator iter = _polygons.begin();
diff --git a/engines/sword25/math/region.h b/engines/sword25/math/region.h
index fac9f98bb6..fa65b4b7ad 100644
--- a/engines/sword25/math/region.h
+++ b/engines/sword25/math/region.h
@@ -232,7 +232,7 @@ protected:
};
inline const Polygon &Region::getHole(uint i) const {
- BS_ASSERT(i < _polygons.size() - 1);
+ assert(i < _polygons.size() - 1);
return _polygons[i + 1];
}
diff --git a/engines/sword25/math/vertex.cpp b/engines/sword25/math/vertex.cpp
index d9a709ab49..3746ec9410 100644
--- a/engines/sword25/math/vertex.cpp
+++ b/engines/sword25/math/vertex.cpp
@@ -62,7 +62,7 @@ Vertex &Vertex::luaVertexToVertex(lua_State *L, int stackIndex, Vertex &vertex)
lua_pop(L, 1);
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(L));
+ assert(__startStackDepth == lua_gettop(L));
#endif
return vertex;
diff --git a/engines/sword25/math/walkregion.cpp b/engines/sword25/math/walkregion.cpp
index 23f0e4e2ca..8306553f7b 100644
--- a/engines/sword25/math/walkregion.cpp
+++ b/engines/sword25/math/walkregion.cpp
@@ -68,7 +68,7 @@ bool WalkRegion::init(const Polygon &contour, const Common::Array<Polygon> *pHol
}
bool WalkRegion::queryPath(Vertex startPoint, Vertex endPoint, BS_Path &path) {
- BS_ASSERT(path.empty());
+ assert(path.empty());
// If the start and finish are identical, no path can be found trivially
if (startPoint == endPoint)
@@ -111,7 +111,7 @@ static void initDijkstraNodes(DijkstraNode::Container &dijkstraNodes, const Regi
(*dijkstraIter).parentIter = dijkstraNodes.end();
if (region.isLineOfSight(*nodesIter, start))(*dijkstraIter).cost = (*nodesIter).distance(start);
}
- BS_ASSERT(dijkstraIter == dijkstraNodes.end());
+ assert(dijkstraIter == dijkstraNodes.end());
}
static DijkstraNode::Iter chooseClosestNode(DijkstraNode::Container &nodes) {
@@ -204,7 +204,7 @@ bool WalkRegion::findPath(const Vertex &start, const Vertex &end, BS_Path &path)
// The list is done in reverse order and inserted into the path
DijkstraNode::ConstIter curNode = endPoint.parentIter;
while (curNode != dijkstraNodes.end()) {
- BS_ASSERT((*curNode).chosen);
+ assert((*curNode).chosen);
path.push_back(_nodes[curNode - dijkstraNodes.begin()]);
curNode = (*curNode).parentIter;
}
diff --git a/engines/sword25/package/packagemanager_script.cpp b/engines/sword25/package/packagemanager_script.cpp
index 9367ae3071..1c9c973d45 100644
--- a/engines/sword25/package/packagemanager_script.cpp
+++ b/engines/sword25/package/packagemanager_script.cpp
@@ -43,9 +43,9 @@ namespace Sword25 {
static PackageManager *getPM() {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
PackageManager *pPM = pKernel->getPackage();
- BS_ASSERT(pPM);
+ assert(pPM);
return pPM;
}
@@ -196,11 +196,11 @@ static const luaL_reg PACKAGE_FUNCTIONS[] = {
bool PackageManager::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::addFunctionsToLib(L, PACKAGE_LIBRARY_NAME, PACKAGE_FUNCTIONS))
return false;
diff --git a/engines/sword25/script/lua_extensions.cpp b/engines/sword25/script/lua_extensions.cpp
index 50d7acc52e..5ba38afc36 100644
--- a/engines/sword25/script/lua_extensions.cpp
+++ b/engines/sword25/script/lua_extensions.cpp
@@ -50,7 +50,7 @@ static int warning(lua_State *L) {
lua_pop(L, 1);
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(L));
+ assert(__startStackDepth == lua_gettop(L));
#endif
return 0;
@@ -63,7 +63,7 @@ static const luaL_reg GLOBAL_FUNCTIONS[] = {
bool LuaScriptEngine::registerStandardLibExtensions() {
lua_State *L = _state;
- BS_ASSERT(_state);
+ assert(_state);
if (!LuaBindhelper::addFunctionsToLib(L, "", GLOBAL_FUNCTIONS))
return false;
diff --git a/engines/sword25/script/luabindhelper.cpp b/engines/sword25/script/luabindhelper.cpp
index b227754489..5ff9708b95 100644
--- a/engines/sword25/script/luabindhelper.cpp
+++ b/engines/sword25/script/luabindhelper.cpp
@@ -123,7 +123,7 @@ bool LuaBindhelper::addFunctionsToLib(lua_State *L, const Common::String &libNam
}
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(L));
+ assert(__startStackDepth == lua_gettop(L));
#endif
return true;
@@ -168,7 +168,7 @@ bool LuaBindhelper::addConstantsToLib(lua_State *L, const Common::String &libNam
}
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(L));
+ assert(__startStackDepth == lua_gettop(L));
#endif
return true;
@@ -207,7 +207,7 @@ bool LuaBindhelper::addMethodsToClass(lua_State *L, const Common::String &classN
lua_pop(L, 1);
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(L));
+ assert(__startStackDepth == lua_gettop(L));
#endif
return true;
@@ -243,7 +243,7 @@ bool LuaBindhelper::setClassGCHandler(lua_State *L, const Common::String &classN
lua_pop(L, 1);
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(L));
+ assert(__startStackDepth == lua_gettop(L));
#endif
return true;
diff --git a/engines/sword25/script/luacallback.cpp b/engines/sword25/script/luacallback.cpp
index 39ce29ea77..137e37bf8d 100644
--- a/engines/sword25/script/luacallback.cpp
+++ b/engines/sword25/script/luacallback.cpp
@@ -52,7 +52,7 @@ LuaCallback::~LuaCallback() {
}
void LuaCallback::registerCallbackFunction(lua_State *L, uint objectHandle) {
- BS_ASSERT(lua_isfunction(L, -1));
+ assert(lua_isfunction(L, -1));
ensureObjectCallbackTableExists(L, objectHandle);
// Store function in the callback object table store
@@ -64,7 +64,7 @@ void LuaCallback::registerCallbackFunction(lua_State *L, uint objectHandle) {
}
void LuaCallback::unregisterCallbackFunction(lua_State *L, uint objectHandle) {
- BS_ASSERT(lua_isfunction(L, -1));
+ assert(lua_isfunction(L, -1));
ensureObjectCallbackTableExists(L, objectHandle);
// Iterate over all elements of the object callback table and remove the function from it
diff --git a/engines/sword25/script/luascript.cpp b/engines/sword25/script/luascript.cpp
index 140c09041b..cce01d58c7 100644
--- a/engines/sword25/script/luascript.cpp
+++ b/engines/sword25/script/luascript.cpp
@@ -146,7 +146,7 @@ bool LuaScriptEngine::executeFile(const Common::String &fileName) {
// Get a pointer to the package manager
PackageManager *pPackage = Kernel::getInstance()->getPackage();
- BS_ASSERT(pPackage);
+ assert(pPackage);
// File read
uint fileSize;
@@ -154,7 +154,7 @@ bool LuaScriptEngine::executeFile(const Common::String &fileName) {
if (!fileData) {
error("Couldn't read \"%s\".", fileName.c_str());
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(_state));
+ assert(__startStackDepth == lua_gettop(_state));
#endif
return false;
}
@@ -164,7 +164,7 @@ bool LuaScriptEngine::executeFile(const Common::String &fileName) {
// Release file buffer
delete[] fileData;
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(_state));
+ assert(__startStackDepth == lua_gettop(_state));
#endif
return false;
}
@@ -173,7 +173,7 @@ bool LuaScriptEngine::executeFile(const Common::String &fileName) {
delete[] fileData;
#ifdef DEBUG
- BS_ASSERT(__startStackDepth == lua_gettop(_state));
+ assert(__startStackDepth == lua_gettop(_state));
#endif
return true;
diff --git a/engines/sword25/sfx/soundengine_script.cpp b/engines/sword25/sfx/soundengine_script.cpp
index eabbef6e5e..d347cf5eb4 100644
--- a/engines/sword25/sfx/soundengine_script.cpp
+++ b/engines/sword25/sfx/soundengine_script.cpp
@@ -47,9 +47,9 @@ namespace Sword25 {
static int init(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
if (lua_gettop(L) == 0)
lua_pushbooleancpp(L, pSfx->init(44100, 32));
@@ -63,9 +63,9 @@ static int init(lua_State *L) {
static int update(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->update();
@@ -74,9 +74,9 @@ static int update(lua_State *L) {
static int setVolume(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->setVolume(static_cast<float>(luaL_checknumber(L, 1)),
static_cast<SoundEngine::SOUND_TYPES>(static_cast<uint>(luaL_checknumber(L, 2))));
@@ -86,9 +86,9 @@ static int setVolume(lua_State *L) {
static int getVolume(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
lua_pushnumber(L, pSfx->getVolume(static_cast<SoundEngine::SOUND_TYPES>(static_cast<uint>(luaL_checknumber(L, 1)))));
@@ -97,9 +97,9 @@ static int getVolume(lua_State *L) {
static int pauseAll(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->pauseAll();
@@ -108,9 +108,9 @@ static int pauseAll(lua_State *L) {
static int resumeAll(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->resumeAll();
@@ -119,9 +119,9 @@ static int resumeAll(lua_State *L) {
static int pauseLayer(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->pauseLayer(static_cast<int>(luaL_checknumber(L, 1)));
@@ -130,9 +130,9 @@ static int pauseLayer(lua_State *L) {
static int resumeLayer(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->resumeLayer(static_cast<int>(luaL_checknumber(L, 1)));
@@ -177,9 +177,9 @@ static void processPlayParams(lua_State *L, Common::String &fileName, SoundEngin
static int playSound(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
Common::String fileName;
SoundEngine::SOUND_TYPES type;
@@ -198,9 +198,9 @@ static int playSound(lua_State *L) {
static int playSoundEx(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
Common::String fileName;
SoundEngine::SOUND_TYPES type;
@@ -219,9 +219,9 @@ static int playSoundEx(lua_State *L) {
static int setSoundVolume(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->setSoundVolume(static_cast<uint>(luaL_checknumber(L, 1)), static_cast<float>(luaL_checknumber(L, 2)));
@@ -230,9 +230,9 @@ static int setSoundVolume(lua_State *L) {
static int setSoundPanning(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->setSoundPanning(static_cast<uint>(luaL_checknumber(L, 1)), static_cast<float>(luaL_checknumber(L, 2)));
@@ -241,9 +241,9 @@ static int setSoundPanning(lua_State *L) {
static int pauseSound(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->pauseSound(static_cast<uint>(luaL_checknumber(L, 1)));
@@ -252,9 +252,9 @@ static int pauseSound(lua_State *L) {
static int resumeSound(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->resumeSound(static_cast<uint>(luaL_checknumber(L, 1)));
@@ -263,9 +263,9 @@ static int resumeSound(lua_State *L) {
static int stopSound(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
pSfx->stopSound(static_cast<uint>(luaL_checknumber(L, 1)));
@@ -274,9 +274,9 @@ static int stopSound(lua_State *L) {
static int isSoundPaused(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
lua_pushbooleancpp(L, pSfx->isSoundPaused(static_cast<uint>(luaL_checknumber(L, 1))));
@@ -285,9 +285,9 @@ static int isSoundPaused(lua_State *L) {
static int isSoundPlaying(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
lua_pushbooleancpp(L, pSfx->isSoundPlaying(static_cast<uint>(luaL_checknumber(L, 1))));
@@ -296,9 +296,9 @@ static int isSoundPlaying(lua_State *L) {
static int getSoundVolume(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
lua_pushnumber(L, pSfx->getSoundVolume(static_cast<uint>(luaL_checknumber(L, 1))));
@@ -307,9 +307,9 @@ static int getSoundVolume(lua_State *L) {
static int getSoundPanning(lua_State *L) {
Kernel *pKernel = Kernel::getInstance();
- BS_ASSERT(pKernel);
+ assert(pKernel);
SoundEngine *pSfx = pKernel->getSfx();
- BS_ASSERT(pSfx);
+ assert(pSfx);
lua_pushnumber(L, pSfx->getSoundPanning(static_cast<uint>(luaL_checknumber(L, 1))));
@@ -350,11 +350,11 @@ static const lua_constant_reg SFX_CONSTANTS[] = {
bool SoundEngine::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::addFunctionsToLib(L, SFX_LIBRARY_NAME, SFX_FUNCTIONS)) return false;
if (!LuaBindhelper::addConstantsToLib(L, SFX_LIBRARY_NAME, SFX_CONSTANTS)) return false;
diff --git a/engines/sword25/sword25.cpp b/engines/sword25/sword25.cpp
index b76de784b9..f7be658654 100644
--- a/engines/sword25/sword25.cpp
+++ b/engines/sword25/sword25.cpp
@@ -127,7 +127,7 @@ Common::Error Sword25Engine::appStart() {
bool Sword25Engine::appMain() {
// The main script start. This script loads all the other scripts and starts the actual game.
ScriptEngine *scriptPtr = Kernel::getInstance()->getScript();
- BS_ASSERT(scriptPtr);
+ assert(scriptPtr);
scriptPtr->executeFile(DEFAULT_SCRIPT_FILE);
return true;
@@ -146,7 +146,7 @@ bool Sword25Engine::appEnd() {
bool Sword25Engine::loadPackages() {
PackageManager *packageManagerPtr = Kernel::getInstance()->getPackage();
- BS_ASSERT(packageManagerPtr);
+ assert(packageManagerPtr);
// Load the main package
if (!packageManagerPtr->loadPackage("data.b25c", "/"))