From 5a1383343fb645b5fbd80060da81253b2443bf28 Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 9 Jul 2014 11:33:02 +0200 Subject: CGE2: Rework number(). --- engines/cge2/hero.cpp | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'engines/cge2/hero.cpp') diff --git a/engines/cge2/hero.cpp b/engines/cge2/hero.cpp index 65138cd791..6281e4dd5e 100644 --- a/engines/cge2/hero.cpp +++ b/engines/cge2/hero.cpp @@ -134,12 +134,8 @@ Sprite *Hero::expand() { // It's very similar to Sprite's expand, but doesn't bo if (_actionCtrl[section]._cnt) { CommandHandler::Command *c = &_ext->_actions[section][cnt[section]++]; c->_commandType = CommandType(id); - if ((p = _vm->token(nullptr)) == nullptr) - error("Unexpected end of file! %s", fname); - c->_ref = _vm->number(p); - if ((p = _vm->token(nullptr)) == nullptr) - error("Unexpected end of file! %s", fname); - c->_val = _vm->number(p); + c->_ref = _vm->number(nullptr); + c->_val = _vm->number(nullptr); c->_spritePtr = nullptr; } break; @@ -148,9 +144,7 @@ Sprite *Hero::expand() { // It's very similar to Sprite's expand, but doesn't bo s->_now = atoi(p); if (s->_now > maxnow) maxnow = s->_now; - if ((p = _vm->token(nullptr)) == nullptr) - break; - s->_next = _vm->number(p); + s->_next = _vm->number(nullptr); switch (s->_next) { case 0xFF: s->_next = seqcnt; @@ -161,18 +155,10 @@ Sprite *Hero::expand() { // It's very similar to Sprite's expand, but doesn't bo } if (s->_next > maxnxt) maxnxt = s->_next; - if ((p = _vm->token(nullptr)) == nullptr) - error("Unexpected end of file! %s", fname); - s->_dx = _vm->number(p); - if ((p = _vm->token(nullptr)) == nullptr) - error("Unexpected end of file! %s", fname); - s->_dy = _vm->number(p); - if ((p = _vm->token(nullptr)) == nullptr) - error("Unexpected end of file! %s", fname); - s->_dz = _vm->number(p); - if ((p = _vm->token(nullptr)) == nullptr) - error("Unexpected end of file! %s", fname); - s->_dly = _vm->number(p); + s->_dx = _vm->number(nullptr); + s->_dy = _vm->number(nullptr); + s->_dz = _vm->number(nullptr); + s->_dly = _vm->number(nullptr); break; case kIdPhase: for (int i = 0; i < kDimMax; i++) { -- cgit v1.2.3