[Scummvm-git-logs] scummvm master -> b84814cd3433b50a4342adaa21e4754e6513d080
SupSuper
supsuper at gmail.com
Wed Jun 30 08:36:40 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b84814cd34 TRECISION: Clean up warnings
Commit: b84814cd3433b50a4342adaa21e4754e6513d080
https://github.com/scummvm/scummvm/commit/b84814cd3433b50a4342adaa21e4754e6513d080
Author: SupSuper (supsuper at gmail.com)
Date: 2021-06-30T09:36:17+01:00
Commit Message:
TRECISION: Clean up warnings
Changed paths:
engines/trecision/actor.cpp
engines/trecision/anim.h
engines/trecision/defines.h
engines/trecision/inventory.cpp
engines/trecision/pathfinding3d.cpp
engines/trecision/renderer3d.cpp
engines/trecision/scheduler.cpp
engines/trecision/sound.cpp
engines/trecision/struct.h
engines/trecision/trecision.cpp
engines/trecision/trecision.h
diff --git a/engines/trecision/actor.cpp b/engines/trecision/actor.cpp
index 04cdd1a813..bd7b7cf845 100644
--- a/engines/trecision/actor.cpp
+++ b/engines/trecision/actor.cpp
@@ -384,7 +384,7 @@ void Actor::actorDoAction(int action) {
int cur = 0;
while (cur < action)
- cfp += _vm->_defActionLen[cur++];
+ cfp += defActionLen[cur++];
v = &_characterArea[cfp * _vertexNum];
if (action == hWALKOUT)
@@ -392,7 +392,7 @@ void Actor::actorDoAction(int action) {
else if (action == hLAST)
v = _characterArea;
- int len = _vm->_defActionLen[action];
+ int len = defActionLen[action];
int stepIdx;
for (stepIdx = _vm->_pathFind->_curStep; stepIdx < len + _vm->_pathFind->_curStep; ++stepIdx) {
diff --git a/engines/trecision/anim.h b/engines/trecision/anim.h
index 4162796b76..bed905f5e6 100644
--- a/engines/trecision/anim.h
+++ b/engines/trecision/anim.h
@@ -42,7 +42,7 @@ private:
void executeAtFrameDoit(ATFHandle *h, int doit, uint16 obj);
void processAtFrame(ATFHandle *h, int type, int atf);
- ATFHandle _animType[3]{};
+ ATFHandle _animType[3];
int _oneSpeakDialogCount;
public:
diff --git a/engines/trecision/defines.h b/engines/trecision/defines.h
index 3c468c7bab..970014172a 100644
--- a/engines/trecision/defines.h
+++ b/engines/trecision/defines.h
@@ -44,7 +44,7 @@ enum ObjectFlags {
kObjFlagTake = 16,
kObjFlagUseWith = 32,
kObjFlagExtra = 64,
- kObjFlagDone = 128,
+ kObjFlagDone = 128
};
enum SoundFlags {
@@ -1617,7 +1617,7 @@ enum SentenceId {
enum AnimationId {
kAnim113UseVial = 77,
kAnim121TryOpenLetterboxes = 82,
- kAnim122OpenLetterbox17 = 83,
+ kAnim122OpenLetterbox17 = 83
};
diff --git a/engines/trecision/inventory.cpp b/engines/trecision/inventory.cpp
index def12b21ec..b00e276313 100644
--- a/engines/trecision/inventory.cpp
+++ b/engines/trecision/inventory.cpp
@@ -37,10 +37,11 @@ void TrecisionEngine::refreshInventory(uint8 startIcon, uint8 startLine) {
_graphicsMgr->clearScreenBufferInventory();
- for (byte iconSlot = 0; iconSlot < ICONSHOWN; iconSlot++) {
- if (iconSlot + startIcon >= _inventory.size())
+ for (uint8 iconSlot = 0; iconSlot < ICONSHOWN; iconSlot++) {
+ uint8 i = iconSlot + startIcon;
+ if (i >= _inventory.size())
break;
- const byte iconIndex = _inventory[iconSlot + startIcon];
+ const byte iconIndex = _inventory[i];
if (iconIndex == _lightIcon)
continue;
diff --git a/engines/trecision/pathfinding3d.cpp b/engines/trecision/pathfinding3d.cpp
index 030f05f598..e9ce5c483d 100644
--- a/engines/trecision/pathfinding3d.cpp
+++ b/engines/trecision/pathfinding3d.cpp
@@ -848,14 +848,14 @@ void PathFinding3D::buildFramelist() {
int curAction, curFrame, cfp;
if (_vm->_actor->_curAction == hWALK) {
// compute current frame
- cfp = _vm->_defActionLen[hSTART] + 1 + _vm->_actor->_curFrame;
+ cfp = defActionLen[hSTART] + 1 + _vm->_actor->_curFrame;
v += cfp * _vm->_actor->_vertexNum;
curAction = hWALK;
curFrame = _vm->_actor->_curFrame;
// if it wasn't the last frame, take the next step
- if (_vm->_actor->_curFrame < _vm->_defActionLen[hWALK] - 1) {
+ if (_vm->_actor->_curFrame < defActionLen[hWALK] - 1) {
++cfp;
++curFrame;
v += _vm->_actor->_vertexNum;
@@ -867,7 +867,7 @@ void PathFinding3D::buildFramelist() {
curAction = hWALK;
curFrame = _vm->_actor->_curAction - hSTOP0;
- cfp = _vm->_defActionLen[hSTART] + 1 + curFrame;
+ cfp = defActionLen[hSTART] + 1 + curFrame;
v += cfp * _vm->_actor->_vertexNum;
} else {
// if he was standing, start working or turn
@@ -898,17 +898,17 @@ void PathFinding3D::buildFramelist() {
++curFrame;
++cfp;
- if (curFrame >= _vm->_defActionLen[curAction]) {
+ if (curFrame >= defActionLen[curAction]) {
if (curAction == hSTART) {
curAction = hWALK;
curFrame = 0;
- cfp = _vm->_defActionLen[hSTART] + 1;
+ cfp = defActionLen[hSTART] + 1;
ox = 0.0f;
} else if (curAction == hWALK) {
curAction = hWALK;
curFrame = 0;
- cfp = _vm->_defActionLen[hSTART] + 1;
+ cfp = defActionLen[hSTART] + 1;
// end walk frame
ox = _vm->_actor->frameCenter(v) - firstFrame;
@@ -943,11 +943,11 @@ void PathFinding3D::buildFramelist() {
int index = 0;
cfp = 0;
while (index != curAction)
- cfp += _vm->_defActionLen[index++];
+ cfp += defActionLen[index++];
v = &_vm->_actor->_characterArea[cfp * _vm->_actor->_vertexNum];
- for (index = 0; index < _vm->_defActionLen[curAction]; ++index) {
+ for (index = 0; index < defActionLen[curAction]; ++index) {
curLen = oz + _vm->_actor->frameCenter(v) - firstFrame;
_step[i]._pz = oz - firstFrame; // where to render
_step[i]._dz = curLen; // where it is
diff --git a/engines/trecision/renderer3d.cpp b/engines/trecision/renderer3d.cpp
index 7b5c1b9c8f..79195e8a15 100644
--- a/engines/trecision/renderer3d.cpp
+++ b/engines/trecision/renderer3d.cpp
@@ -463,7 +463,7 @@ void Renderer3D::calcCharacterPoints() {
int cfp = 0;
int cur = 0;
while (cur < actor->_curAction)
- cfp += _vm->_defActionLen[cur++];
+ cfp += defActionLen[cur++];
if (actor->_curAction == hWALKOUT)
cfp = 1;
@@ -702,7 +702,7 @@ void Renderer3D::calcCharacterPoints() {
}
if (actor->_curAction == hLAST) // exit displacer
- actor->_lim[2] = actor->_lim[3] - (((actor->_lim[3] - actor->_lim[2]) * actor->_curFrame) / _vm->_defActionLen[hLAST]);
+ actor->_lim[2] = actor->_lim[3] - (((actor->_lim[3] - actor->_lim[2]) * actor->_curFrame) / defActionLen[hLAST]);
// set zbuffer vars
setZBufferRegion(actor->_lim[0], actor->_lim[2], actor->_lim[1] - actor->_lim[0]);
diff --git a/engines/trecision/scheduler.cpp b/engines/trecision/scheduler.cpp
index 6474d7febc..7ae0fcccf4 100644
--- a/engines/trecision/scheduler.cpp
+++ b/engines/trecision/scheduler.cpp
@@ -29,8 +29,8 @@ Scheduler::Scheduler(TrecisionEngine *vm) : _vm(vm) {
_token = CLASS_CHAR;
_counter = 0;
- _idleMsg = { MC_IDLE, 0, MP_DEFAULT, 0, 0, 0, 0 };
- _msg = {MC_IDLE, 0, MP_DEFAULT, 0, 0, 0, 0};
+ Message msg = { MC_IDLE, 0, MP_DEFAULT, 0, 0, 0, 0 };
+ _idleMsg = _msg = msg;
}
Scheduler::~Scheduler() {
diff --git a/engines/trecision/sound.cpp b/engines/trecision/sound.cpp
index ea6690936c..7ddbe74aa1 100644
--- a/engines/trecision/sound.cpp
+++ b/engines/trecision/sound.cpp
@@ -168,7 +168,7 @@ void SoundManager::soundStep(int midx, int midz, int act, int frame) {
case hSTOP2:
case hSTOP3:
case hSTOP9:
- if (frame >= _vm->_defActionLen[act] - 1)
+ if (frame >= defActionLen[act] - 1)
stepLeft = true;
break;
case hSTOP4:
@@ -176,7 +176,7 @@ void SoundManager::soundStep(int midx, int midz, int act, int frame) {
case hSTOP6:
case hSTOP7:
case hSTOP8:
- if (frame >= _vm->_defActionLen[act] - 1)
+ if (frame >= defActionLen[act] - 1)
stepRight = true;
break;
default:
@@ -280,8 +280,7 @@ void SoundManager::loadRoomSounds() {
void SoundManager::loadSamples(Common::SeekableReadStreamEndian *stream) {
for (int i = 0; i < NUMSAMPLES; ++i) {
- for (int j = 0; j < 14; j++)
- _gSample[i]._name += stream->readByte();
+ _gSample[i]._name = stream->readString(0, 14);
_gSample[i]._volume = stream->readByte();
_gSample[i]._flag = stream->readByte();
_gSample[i]._panning = stream->readSByte();
diff --git a/engines/trecision/struct.h b/engines/trecision/struct.h
index abfeba7073..59b17a5e0a 100644
--- a/engines/trecision/struct.h
+++ b/engines/trecision/struct.h
@@ -48,7 +48,7 @@ struct SRoom {
void loadRoom(Common::SeekableReadStreamEndian *stream);
private:
- uint8 _flag = 0; // Room visited or not, extra or not
+ uint8 _flag; // Room visited or not, extra or not
};
struct SObject {
@@ -97,8 +97,8 @@ struct SObject {
void loadObj(Common::SeekableReadStreamEndian *stream);
private:
- uint8 _flag = 0;
- uint8 _mode = 0;
+ uint8 _flag;
+ uint8 _mode;
};
struct SInvObject {
@@ -116,7 +116,7 @@ struct SInvObject {
void loadObj(Common::SeekableReadStreamEndian *stream);
private:
- uint8 _flag = 0;
+ uint8 _flag;
};
struct SAtFrame {
@@ -184,7 +184,7 @@ struct STexture {
bool isActive() { return _active; };
private:
- bool _active = false;
+ bool _active;
};
struct SVertex {
diff --git a/engines/trecision/trecision.cpp b/engines/trecision/trecision.cpp
index c54e5eebe0..84ba17ef7c 100644
--- a/engines/trecision/trecision.cpp
+++ b/engines/trecision/trecision.cpp
@@ -151,7 +151,8 @@ TrecisionEngine::TrecisionEngine(OSystem *syst, const ADGameDescription *desc) :
_cx = _cy = 0;
_textArea = nullptr;
- _snake52 = {MC_IDLE, 0, MP_DEFAULT, 0, 0, 0, 0};
+ Message msg = { MC_IDLE, 0, MP_DEFAULT, 0, 0, 0, 0 };
+ _snake52 = msg;
for (int i = 0; i < 50; ++i)
_scriptFrame[i].clear();
diff --git a/engines/trecision/trecision.h b/engines/trecision/trecision.h
index a71e7850c1..6b4279fcb8 100644
--- a/engines/trecision/trecision.h
+++ b/engines/trecision/trecision.h
@@ -328,29 +328,29 @@ public:
uint8 _textStatus;
uint32 _pauseStartTime;
+};
- uint8 const _defActionLen[hLAST + 1] = {
- /* STAND */ 1,
- /* PARTE */ 1,
- /* WALK */ 10,
- /* END */ 1,
- /* STOP0 */ 3,
- /* STOP1 */ 4,
- /* STOP2 */ 3,
- /* STOP3 */ 2,
- /* STOP4 */ 3,
- /* STOP5 */ 4,
- /* STOP6 */ 3,
- /* STOP7 */ 3,
- /* STOP8 */ 2,
- /* STOP9 */ 3,
- /* WALKI */ 12,
- /* BOH */ 9,
- /* UGG */ 41,
- /* UTT */ 35,
- /* WALKO */ 12,
- /* LAST */ 15
- };
+uint8 static const defActionLen[hLAST + 1] = {
+ /* STAND */ 1,
+ /* PARTE */ 1,
+ /* WALK */ 10,
+ /* END */ 1,
+ /* STOP0 */ 3,
+ /* STOP1 */ 4,
+ /* STOP2 */ 3,
+ /* STOP3 */ 2,
+ /* STOP4 */ 3,
+ /* STOP5 */ 4,
+ /* STOP6 */ 3,
+ /* STOP7 */ 3,
+ /* STOP8 */ 2,
+ /* STOP9 */ 3,
+ /* WALKI */ 12,
+ /* BOH */ 9,
+ /* UGG */ 41,
+ /* UTT */ 35,
+ /* WALKO */ 12,
+ /* LAST */ 15
};
} // End of namespace Trecision
More information about the Scummvm-git-logs
mailing list