diff options
author | Strangerke | 2014-08-03 10:32:28 +0200 |
---|---|---|
committer | Strangerke | 2014-08-03 10:33:37 +0200 |
commit | 6558581d68c740d380e695cb9c150c81fc082bb8 (patch) | |
tree | 3f1aa29c0793ebc5a83456fa2732a9c839c206e5 /engines/cge2 | |
parent | 2b60bb9cc376f9e8e7866f07cb2012a6bf748914 (diff) | |
download | scummvm-rg350-6558581d68c740d380e695cb9c150c81fc082bb8.tar.gz scummvm-rg350-6558581d68c740d380e695cb9c150c81fc082bb8.tar.bz2 scummvm-rg350-6558581d68c740d380e695cb9c150c81fc082bb8.zip |
CGE2: Remove more checks on the return value of new
Diffstat (limited to 'engines/cge2')
-rw-r--r-- | engines/cge2/talk.cpp | 3 | ||||
-rw-r--r-- | engines/cge2/text.cpp | 12 | ||||
-rw-r--r-- | engines/cge2/vmenu.cpp | 15 |
3 files changed, 11 insertions, 19 deletions
diff --git a/engines/cge2/talk.cpp b/engines/cge2/talk.cpp index f6321d3e59..dbdfc0d7ca 100644 --- a/engines/cge2/talk.cpp +++ b/engines/cge2/talk.cpp @@ -48,7 +48,6 @@ Font::Font(CGE2Engine *vm) : _vm(vm) { _pos = new uint16[kPosSize]; _widthArr = new uint8[kWidSize]; - assert((_map != nullptr) && (_pos != nullptr) && (_widthArr != nullptr)); load(); } @@ -136,8 +135,6 @@ uint8 *Talk::box(V2D siz) { if (siz.y < 8) siz.y = 8; uint8 *b = new uint8[n = siz.area()]; - if (!b) - error("No core!"); memset(b, bg, n); if (_mode) { diff --git a/engines/cge2/text.cpp b/engines/cge2/text.cpp index 9989dabbf4..ca4c33625e 100644 --- a/engines/cge2/text.cpp +++ b/engines/cge2/text.cpp @@ -140,8 +140,6 @@ void Text::say(const char *text, Sprite *spr) { _vm->killText(); _vm->_talk = new Talk(_vm, text, kTBRound, kCBSay); - if (!_vm->_talk) - return; Speaker *speaker = new Speaker(_vm); @@ -186,12 +184,10 @@ void Text::say(const char *text, Sprite *spr) { void CGE2Engine::inf(const char *text, ColorBank col) { killText(); _talk = new Talk(this, text, kTBRect, col, true); - if (_talk) { - _talk->_flags._kill = true; - _talk->setName(_text->getText(kInfName)); - _talk->center(); - _vga->_showQ->append(_talk); - } + _talk->_flags._kill = true; + _talk->setName(_text->getText(kInfName)); + _talk->center(); + _vga->_showQ->append(_talk); } void Text::sayTime(Sprite *spr) { diff --git a/engines/cge2/vmenu.cpp b/engines/cge2/vmenu.cpp index fa4c29c1d7..a84078f7a6 100644 --- a/engines/cge2/vmenu.cpp +++ b/engines/cge2/vmenu.cpp @@ -100,15 +100,14 @@ char *VMenu::vmGather(Common::Array<Choice *> list) { ++h; } _vmgt = new char[len + h]; - if (_vmgt) { - *_vmgt = '\0'; - for (uint i = 0; i < list.size(); i++) { - if (*_vmgt) - strcat(_vmgt, "|"); - strcat(_vmgt, list[i]->_text); - ++h; - } + *_vmgt = '\0'; + for (uint i = 0; i < list.size(); i++) { + if (*_vmgt) + strcat(_vmgt, "|"); + strcat(_vmgt, list[i]->_text); + ++h; } + return _vmgt; } |