diff options
author | Strangerke | 2014-06-03 17:39:10 +0200 |
---|---|---|
committer | Strangerke | 2014-06-03 17:39:10 +0200 |
commit | de8affdec579542767cfd827f2dd19a035319d65 (patch) | |
tree | b0df99654136d25068370dafb8cc63bdab9485f8 /engines/cge2 | |
parent | 7ef509608e957cb62cda7265e173f1a30a69b659 (diff) | |
download | scummvm-rg350-de8affdec579542767cfd827f2dd19a035319d65.tar.gz scummvm-rg350-de8affdec579542767cfd827f2dd19a035319d65.tar.bz2 scummvm-rg350-de8affdec579542767cfd827f2dd19a035319d65.zip |
CGE2: Silence some gcc warnings
Diffstat (limited to 'engines/cge2')
-rw-r--r-- | engines/cge2/cge2_main.cpp | 4 | ||||
-rw-r--r-- | engines/cge2/hero.cpp | 2 | ||||
-rw-r--r-- | engines/cge2/snail.cpp | 2 | ||||
-rw-r--r-- | engines/cge2/snail.h | 2 | ||||
-rw-r--r-- | engines/cge2/vga13h.cpp | 19 | ||||
-rw-r--r-- | engines/cge2/vga13h.h | 6 |
6 files changed, 19 insertions, 16 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index e379977d6c..4fb0b2981e 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -179,7 +179,7 @@ void CGE2Engine::loadSprite(const char *fname, int ref, int scene, V3D &pos) { case kIdNear: case kIdMTake: case kIdFTake: - if (_commandHandler->com(p) >= 0) + if (_commandHandler->getComId(p) >= 0) ++cnt[section]; else error("Bad line %d [%s]", sprf.getLineCount(), tmpStr); @@ -818,7 +818,7 @@ Sprite *CGE2Engine::spriteAt(int x, int y) { if (tail) { for (spr = tail->_prev; spr; spr = spr->_prev) { if (!spr->_flags._hide && !spr->_flags._tran) { - if (spr->shp()->solidAt(x - spr->_pos2D.x, y - spr->_pos2D.y)) + if (spr->getShp()->solidAt(x - spr->_pos2D.x, y - spr->_pos2D.y)) break; } } diff --git a/engines/cge2/hero.cpp b/engines/cge2/hero.cpp index 151b3da475..a6c1849d60 100644 --- a/engines/cge2/hero.cpp +++ b/engines/cge2/hero.cpp @@ -120,7 +120,7 @@ Sprite *Hero::expand() { // It's very similar to Sprite's expand, but doesn't bo case kIdNear: case kIdMTake: case kIdFTake: - id = (ID)_vm->_commandHandler->com(p); + id = (ID)_vm->_commandHandler->getComId(p); if (_actionCtrl[section]._cnt) { CommandHandler::Command *c = &_ext->_actions[section][cnt[section]++]; c->_commandType = CommandType(id); diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp index f00b02c7bd..e355c44348 100644 --- a/engines/cge2/snail.cpp +++ b/engines/cge2/snail.cpp @@ -569,7 +569,7 @@ void CommandHandler::clear() { _timerExpiry = 0; } -int CommandHandler::com(const char *com) { +int CommandHandler::getComId(const char *com) { int i = _vm->takeEnum(_commandText, com); return (i < 0) ? i : i + kCmdCom0 + 1; } diff --git a/engines/cge2/snail.h b/engines/cge2/snail.h index afd52dfd45..6b0bdea546 100644 --- a/engines/cge2/snail.h +++ b/engines/cge2/snail.h @@ -136,7 +136,7 @@ public: bool idle(); void reset(); void clear(); - int com(const char *com); + int getComId(const char *com); private: CGE2Engine *_vm; bool _turbo; diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp index ff58ccd25d..bc2e07c0eb 100644 --- a/engines/cge2/vga13h.cpp +++ b/engines/cge2/vga13h.cpp @@ -111,7 +111,7 @@ Sprite::~Sprite() { contract(); } -BitmapPtr Sprite::shp() { +BitmapPtr Sprite::getShp() { SprExt *e = _ext; if (!e || !e->_seq) return NULL; @@ -282,7 +282,7 @@ Sprite *Sprite::expand() { case kIdNear: case kIdMTake: case kIdFTake: - id = (ID)_vm->_commandHandler->com(p); + id = (ID)_vm->_commandHandler->getComId(p); if (_actionCtrl[section]._cnt) { CommandHandler::Command *c = &_ext->_actions[section][cnt[section]++]; c->_commandType = CommandType(id); @@ -327,7 +327,7 @@ Sprite *Sprite::expand() { error("Unexpected end of file! %s", fname); s->_dly = _vm->number(p); break; - case kIdPhase: + case kIdPhase: { BitmapPtr bmp = new Bitmap(_vm, p); shplist[shpcnt] = bmp; if (!shplist[shpcnt]->moveHi()) @@ -335,6 +335,9 @@ Sprite *Sprite::expand() { shpcnt++; break; } + default: + break; + } break; } label = kNoByte; @@ -382,10 +385,10 @@ Sprite *Sprite::contract() { return this; if (_file[2] == '~') { // FLY-type sprite - Seq *seq = _ext->_seq; + Seq *curSeq = _ext->_seq; // return to middle - gotoxyz(_pos3D - V3D(seq->_dx, seq->_dy, seq->_dz)); - seq->_dx = seq->_dy = seq->_dz = 0; + gotoxyz(_pos3D - V3D(curSeq->_dx, curSeq->_dy, curSeq->_dz)); + curSeq->_dx = curSeq->_dy = curSeq->_dz = 0; } if (notify) @@ -564,7 +567,7 @@ void Sprite::show() { e->_p0 = e->_p1; e->_b0 = e->_b1; e->_p1 = _pos2D; - e->_b1 = shp(); + e->_b1 = getShp(); } if (!_flags._hide) e->_b1->show(e->_p1.x, e->_p1.y); @@ -573,7 +576,7 @@ void Sprite::show() { void Sprite::show(uint16 pg) { Graphics::Surface *a = _vm->_vga->_page[1]; _vm->_vga->_page[1] = _vm->_vga->_page[pg]; - shp()->show(_pos2D.x, _pos2D.y); + getShp()->show(_pos2D.x, _pos2D.y); _vm->_vga->_page[1] = a; } diff --git a/engines/cge2/vga13h.h b/engines/cge2/vga13h.h index a4829b6947..574a60711d 100644 --- a/engines/cge2/vga13h.h +++ b/engines/cge2/vga13h.h @@ -73,8 +73,8 @@ class V2D : public Common::Point { public: V2D& operator=(const V3D &p3) { double m = _vm->_eye->_z / (p3._z - _vm->_eye->_z); - x = round((_vm->_eye->_x + (_vm->_eye->_x - p3._x) * m)); - y = round((_vm->_eye->_y + (_vm->_eye->_y - p3._y) * m)); + x = round(_vm->_eye->_x + (_vm->_eye->_x - p3._x) * m); + y = round(_vm->_eye->_y + (_vm->_eye->_y - p3._y) * m); return *this; } V2D(CGE2Engine *vm) : _vm(vm) { } @@ -170,7 +170,7 @@ public: Sprite(CGE2Engine *vm); Sprite(CGE2Engine *vm, BitmapPtr *shp, int cnt); virtual ~Sprite(); - BitmapPtr shp(); + BitmapPtr getShp(); void setShapeList(BitmapPtr *shp, int cnt); void moveShapesHi(void); void moveShapesLo(void); |