diff options
author | Strangerke | 2014-08-03 01:49:59 +0200 |
---|---|---|
committer | Strangerke | 2014-08-03 01:51:33 +0200 |
commit | 9dc06870e79edd637280ef9a81391adca1eafabc (patch) | |
tree | b4d5286a18214b5dc67a27721f235812a7c63819 /engines/cge2/vga13h.cpp | |
parent | d44ff5491281fb9bcd4cc8f4534988b0b2bcb052 (diff) | |
download | scummvm-rg350-9dc06870e79edd637280ef9a81391adca1eafabc.tar.gz scummvm-rg350-9dc06870e79edd637280ef9a81391adca1eafabc.tar.bz2 scummvm-rg350-9dc06870e79edd637280ef9a81391adca1eafabc.zip |
CGE2: Start removing the checks on the return value of new
Diffstat (limited to 'engines/cge2/vga13h.cpp')
-rw-r--r-- | engines/cge2/vga13h.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp index 33d5ba1335..03e6b3fe93 100644 --- a/engines/cge2/vga13h.cpp +++ b/engines/cge2/vga13h.cpp @@ -224,7 +224,6 @@ void Sprite::setName(char *newName) { } if (newName) { _ext->_name = new char[strlen(newName) + 1]; - assert(_ext->_name != nullptr); strcpy(_ext->_name, newName); } } @@ -308,8 +307,6 @@ Sprite *Sprite::expand() { if (_ext != nullptr) delete _ext; _ext = new SprExt(_vm); - if (_ext == nullptr) - error("No core %s", fname); if (!*_file) return this; @@ -327,21 +324,15 @@ Sprite *Sprite::expand() { for (int i = 0; i < kActions; i++){ byte n = _actionCtrl[i]._cnt; - if (n) { + if (n) _ext->_actions[i] = new CommandHandler::Command[n]; - if (_ext->_actions[i] == nullptr) - error("No core %s", fname); - } else + else _ext->_actions[i] = nullptr; } - Seq *curSeq; - if (_seqCnt) { + Seq *curSeq = nullptr; + if (_seqCnt) curSeq = new Seq[_seqCnt]; - if (curSeq == nullptr) - error("No core %s", fname); - } else - curSeq = nullptr; if (_vm->_resman->exist(fname)) { // sprite description file exist EncryptedStream sprf(_vm, fname); @@ -698,11 +689,9 @@ BitmapPtr Sprite::ghost() { return nullptr; BitmapPtr bmp = new Bitmap(_vm, 0, 0, (uint8 *)nullptr); - assert(bmp != nullptr); bmp->_w = e->_b1->_w; bmp->_h = e->_b1->_h; bmp->_b = new HideDesc[bmp->_h]; - assert(bmp->_b != nullptr); memcpy(bmp->_b, e->_b1->_b, sizeof(HideDesc)* bmp->_h); uint8 *v = new uint8; *v = (e->_p1.y << 16) + e->_p1.x; |