diff options
author | Strangerke | 2014-06-03 22:34:39 +0200 |
---|---|---|
committer | Strangerke | 2014-06-03 22:34:39 +0200 |
commit | aabe883dc2b82c2ab4cca062c1192b74dd8b321f (patch) | |
tree | aa9aecd400f7bae16257af1f868d86ff711a44e0 /engines | |
parent | 160edae77aa07f520c5331876d91a713eab5cee8 (diff) | |
download | scummvm-rg350-aabe883dc2b82c2ab4cca062c1192b74dd8b321f.tar.gz scummvm-rg350-aabe883dc2b82c2ab4cca062c1192b74dd8b321f.tar.bz2 scummvm-rg350-aabe883dc2b82c2ab4cca062c1192b74dd8b321f.zip |
CGE2: Fix some more GCC warnings
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/cge2_main.cpp | 2 | ||||
-rw-r--r-- | engines/cge2/vga13h.cpp | 32 | ||||
-rw-r--r-- | engines/cge2/vga13h.h | 2 |
3 files changed, 19 insertions, 17 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 9d47397721..9ab9eb0c0b 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -194,6 +194,8 @@ void CGE2Engine::loadSprite(const char *fname, int ref, int scene, V3D &pos) { badLab(fname); ++seqcnt; break; + default: + break; } break; } diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp index ded90aeaef..644c75395d 100644 --- a/engines/cge2/vga13h.cpp +++ b/engines/cge2/vga13h.cpp @@ -40,8 +40,8 @@ namespace CGE2 { Seq *getConstantSeq(bool seqFlag) { - const Seq seq1[] = { { 0, 0, 0, 0, 0 } }; - const Seq seq2[] = { { 0, 1, 0, 0, 0 }, { 1, 0, 0, 0, 0 } }; + const Seq seq1[] = { { 0, 0, 0, 0, 0, 0 } }; + const Seq seq2[] = { { 0, 1, 0, 0, 0, 0 }, { 1, 0, 0, 0, 0, 0 } }; Seq *seq; if (seqFlag) { @@ -215,13 +215,13 @@ Sprite *Sprite::expand() { char fname[kPathMax]; _vm->mergeExt(fname, _file, kSprExt); - Seq *seq; + Seq *curSeq; if (_seqCnt) { - seq = new Seq[_seqCnt]; - if (seq == NULL) + curSeq = new Seq[_seqCnt]; + if (curSeq == nullptr) error("No core %s", fname); } else - seq = nullptr; + curSeq = nullptr; for (int i = 0; i < kActions; i++) cnt[i] = 0; @@ -297,7 +297,7 @@ Sprite *Sprite::expand() { } break; case kIdSeq: - s = &seq[seqcnt++]; + s = &curSeq[seqcnt++]; s->_now = atoi(p); if (s->_now > maxnow) maxnow = s->_now; @@ -348,12 +348,12 @@ Sprite *Sprite::expand() { } else // no sprite description: try to read immediately from .BMP shplist[shpcnt++] = new Bitmap (_vm, _file); - if (seq) { + if (curSeq) { if (maxnow >= shpcnt) error("Bad PHASE in SEQ %s", fname); if (maxnxt && maxnxt >= seqcnt) error("Bad JUMP in SEQ %s", fname); - setSeq(seq); + setSeq(curSeq); } else { setSeq(_stdSeq8); _seqCnt = (shpcnt < ARRAYSIZE(_stdSeq8)) ? shpcnt : ARRAYSIZE(_stdSeq8); @@ -367,13 +367,13 @@ Sprite *Sprite::expand() { setShapeList(shapeList, shpcnt); if (_file[2] == '~') { // FLY-type sprite - Seq *seq = _ext->_seq; - int x = (seq + 1)->_dx, y = (seq + 1)->_dy, z = (seq + 1)->_dz; + Seq *curSeq = _ext->_seq; + int x = (curSeq + 1)->_dx, y = (curSeq + 1)->_dy, z = (curSeq + 1)->_dz; // random position - seq->_dx = _vm->newRandom(x + x) - x; - seq->_dy = _vm->newRandom(y + y) - y; - seq->_dz = _vm->newRandom(z + z) - z; - gotoxyz(_pos3D + V3D(seq->_dx, seq->_dy, seq->_dz)); + curSeq->_dx = _vm->newRandom(x + x) - x; + curSeq->_dy = _vm->newRandom(y + y) - y; + curSeq->_dz = _vm->newRandom(z + z) - z; + gotoxyz(_pos3D + V3D(curSeq->_dx, curSeq->_dy, curSeq->_dz)); } return this; @@ -418,7 +418,7 @@ Sprite *Sprite::contract() { for (int i = 0; i < kActions; i++) { if (e->_actions[i]) { delete[] e->_actions[i]; - e->_actions[i]; + e->_actions[i] = nullptr; } } diff --git a/engines/cge2/vga13h.h b/engines/cge2/vga13h.h index 574a60711d..391c56c9c1 100644 --- a/engines/cge2/vga13h.h +++ b/engines/cge2/vga13h.h @@ -79,7 +79,7 @@ public: } V2D(CGE2Engine *vm) : _vm(vm) { } V2D(CGE2Engine *vm, const V3D &p3) : _vm(vm) { *this = p3; } - V2D(CGE2Engine *vm, int x, int y) : _vm(vm), Common::Point(x, y) { } + V2D(CGE2Engine *vm, int posx, int posy) : _vm(vm), Common::Point(posx, posy) { } bool operator<(const V2D &p) const { return (x < p.x) && (y < p.y); } bool operator<=(const V2D &p) const { return (x <= p.x) && (y <= p.y); } bool operator>(const V2D &p) const { return (x > p.x) && (y > p.y); } |