aboutsummaryrefslogtreecommitdiff
path: root/engines/cge/bitmap.cpp
diff options
context:
space:
mode:
authorStrangerke2011-07-25 16:04:45 +0200
committerStrangerke2011-07-25 16:04:45 +0200
commitcf619196484d7edc11dc6908ab81ebafcb65405f (patch)
treec2225e8cc01d80f7dad7706ebecb0c0a01a00b73 /engines/cge/bitmap.cpp
parent82adc025ea451f1fce2c0e0eed03d6e48a51e152 (diff)
downloadscummvm-rg350-cf619196484d7edc11dc6908ab81ebafcb65405f.tar.gz
scummvm-rg350-cf619196484d7edc11dc6908ab81ebafcb65405f.tar.bz2
scummvm-rg350-cf619196484d7edc11dc6908ab81ebafcb65405f.zip
CGE: Replace 'no core' checks by asserts
Diffstat (limited to 'engines/cge/bitmap.cpp')
-rw-r--r--engines/cge/bitmap.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp
index 023e95a8f1..c02c66df8b 100644
--- a/engines/cge/bitmap.cpp
+++ b/engines/cge/bitmap.cpp
@@ -104,8 +104,7 @@ Bitmap::Bitmap(uint16 w, uint16 h, uint8 fill)
uint16 psiz = _h * lsiz; // - last gape, but + plane trailer
uint8 *v = new uint8[4 * psiz + _h * sizeof(*_b)];// the same for 4 planes
// + room for wash table
- if (v == NULL)
- error("No core");
+ assert(v != NULL);
*(uint16 *) v = kBmpCPY | dsiz; // data chunk hader
memset(v + 2, fill, dsiz); // data bytes
@@ -143,8 +142,7 @@ Bitmap::Bitmap(const Bitmap &bmp) : _w(bmp._w), _h(bmp._h), _m(NULL), _v(NULL),
uint16 vsiz = (uint8 *)(bmp._b) - (uint8 *)(v0);
uint16 siz = vsiz + _h * sizeof(HideDesc);
uint8 *v1 = (uint8 *) malloc(sizeof(uint8) * siz);
- if (v1 == NULL)
- error("No core");
+ assert(v1 != NULL);
memcpy(v1, v0, siz);
_b = (HideDesc *)((_v = v1) + vsiz);
}
@@ -174,8 +172,7 @@ Bitmap &Bitmap::operator = (const Bitmap &bmp) {
uint16 vsiz = (uint8 *)bmp._b - (uint8 *)v0;
uint16 siz = vsiz + _h * sizeof(HideDesc);
uint8 *v1 = (uint8 *) malloc(sizeof(uint8) * siz);
- if (v1 == NULL)
- error("No core");
+ assert(v1 != NULL);
memcpy(v1, v0, siz);
_b = (HideDesc *)((_v = v1) + vsiz);
}
@@ -252,9 +249,9 @@ BMP_PTR Bitmap::code() {
if (! skip) {
if (_v)
*im = pix;
- ++ im;
+ im++;
}
- ++ cnt;
+ cnt++;
}
bm += _w;
@@ -291,8 +288,7 @@ BMP_PTR Bitmap::code() {
uint16 sizV = (uint16)(im - 2 - _v);
_v = new uint8[sizV + _h * sizeof(*_b)];
- if (!_v)
- error("No core");
+ assert(_v != NULL);
_b = (HideDesc *)(_v + sizV);
}