aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2016-11-09 22:36:06 -0800
committerEugene Sandulenko2017-01-25 22:42:05 +0100
commit38b676bc0070333d15c420f21a139aae0a0a8da2 (patch)
tree9d3e39dea5e2e1a2a1d40de2e4425a7f12f183f1 /engines
parent4e8490fdb296466fb0711af894cc55ecf544f2de (diff)
downloadscummvm-rg350-38b676bc0070333d15c420f21a139aae0a0a8da2.tar.gz
scummvm-rg350-38b676bc0070333d15c420f21a139aae0a0a8da2.tar.bz2
scummvm-rg350-38b676bc0070333d15c420f21a139aae0a0a8da2.zip
CRYO: Enforce the use of boolean values for _animateTalking
Also, remove a useless #if
Diffstat (limited to 'engines')
-rw-r--r--engines/cryo/eden.cpp49
-rw-r--r--engines/cryo/eden.h6
2 files changed, 27 insertions, 28 deletions
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index 211fb99542..9cadb07a12 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -128,7 +128,7 @@ EdenGame::EdenGame(CryoEngine *vm) : _vm(vm) {
showVideoSubtitle = 0;
specialTextMode = false;
voiceSamplesSize = 0;
- animateTalking = 0;
+ _animateTalking = false;
_personTalking = false;
_musicFadeFlag = 0;
musicPlaying = 0;
@@ -2251,7 +2251,7 @@ void EdenGame::anim_perso() {
}
cur_anim_frame_num = (TimerTicks - _lastAnimTicks) >> 2; // TODO: check me!!!
if (cur_anim_frame_num > num_anim_frames) // TODO: bug?
- animateTalking = 0;
+ _animateTalking = false;
if (p_global->curPersoAnimPtr && !p_global->animationFlags && cur_anim_frame_num != last_anim_frame_num) {
last_anim_frame_num = cur_anim_frame_num;
if (*p_global->curPersoAnimPtr == 0xFF)
@@ -2276,7 +2276,7 @@ void EdenGame::anim_perso() {
getanimrnd();
//TODO: no reload?
}
- if (animateTalking) {
+ if (_animateTalking) {
if (!animationTable) {
animationTable = gameLipsync + 7262; //TODO: fix me
if (!fond_saved)
@@ -2286,7 +2286,7 @@ void EdenGame::anim_perso() {
cur_anim_frame_num = num_anim_frames - 1;
animationIndex = animationTable[cur_anim_frame_num];
if (animationIndex == 0xFF)
- animateTalking = 0;
+ _animateTalking = false;
else if (animationIndex != lastAnimationIndex) {
bank_data_ptr = perso_img_bank_data_ptr;
restaurefondbouche();
@@ -2766,8 +2766,8 @@ void EdenGame::getdatasync() {
num += 707;
if (num == 144)
num = 142;
- animateTalking = ReadDataSync(num - 1);
- if (animateTalking)
+ _animateTalking = ReadDataSync(num - 1);
+ if (_animateTalking)
num_anim_frames = ReadNombreFrames();
else
num_anim_frames = 0;
@@ -4753,7 +4753,6 @@ int EdenGame::ssndfl(uint16 num) {
return size;
}
-#if 1
void EdenGame::ConvertIcons(icon_t *icon, int count) {
for (int i = 0; i < count; i++, icon++) {
icon->sx = BE16(icon->sx);
@@ -4782,7 +4781,6 @@ void EdenGame::ConvertMacToPC() {
for (int i = 0; i < 7240 / 4; i++)
p[i] = BE32(p[i]);
}
-#endif
void EdenGame::loadpermfiles() {
switch (_vm->getPlatform()) {
@@ -4819,36 +4817,37 @@ void EdenGame::loadpermfiles() {
loadFile(403, gameConditions);
}
-char EdenGame::ReadDataSyncVOC(unsigned int num) {
+bool EdenGame::ReadDataSyncVOC(unsigned int num) {
unsigned int resNum = num - 1 + ((_vm->getPlatform() == Common::kPlatformDOS && _vm->isDemo()) ? 656 : 661);
unsigned char vocHeader[0x1A];
- loadpartoffile(resNum, vocHeader, 0, sizeof(vocHeader));
+ int filePos = 0;
+ loadpartoffile(resNum, vocHeader, filePos, sizeof(vocHeader));
+ filePos += sizeof(vocHeader);
unsigned char chunkType = 0;
loadpartoffile(resNum, &chunkType, sizeof(vocHeader), 1);
+ filePos++;
if (chunkType == 5) {
unsigned int chunkLen = 0;
- loadpartoffile(resNum, &chunkLen, sizeof(vocHeader) + 1, 3);
+ loadpartoffile(resNum, &chunkLen, filePos, 3);
+ filePos += 3;
chunkLen = LE32(chunkLen);
- loadpartoffile(resNum, gameLipsync + 7260, sizeof(vocHeader) + 1 + 3, chunkLen);
- return 1;
+ loadpartoffile(resNum, gameLipsync + 7260, filePos, chunkLen);
+ return true;
}
- return 0;
+ return false;
}
-char EdenGame::ReadDataSync(uint16 num) {
- long pos, len;
-
+bool EdenGame::ReadDataSync(uint16 num) {
if (_vm->getPlatform() == Common::kPlatformMacintosh) {
- pos = PLE32(gameLipsync + num * 4);
- len = 1024;
+ long pos = PLE32(gameLipsync + num * 4);
+ long len = 1024;
if (pos != -1) {
loadpartoffile(1936, gameLipsync + 7260, pos, len);
- return 1;
+ return true;
}
- }
- else
+ } else
return ReadDataSyncVOC(num + 1); //TODO: remove -1 in caller
- return 0;
+ return false;
}
void EdenGame::loadpartoffile(uint16 num, void *buffer, int32 pos, int32 len) {
@@ -7012,7 +7011,7 @@ void EdenGame::initafterload() {
kPersoRoomBankTable[30] = 27;
if (p_global->phaseNum >= 352)
kPersoRoomBankTable[30] = 26;
- animateTalking = 0;
+ _animateTalking = false;
animationActive = false;
p_global->ff_100 = 0;
p_global->eventType = EventType::etEventC;
@@ -7070,7 +7069,7 @@ void EdenGame::panelrestart() {
kPersoRoomBankTable[30] = 27;
if (p_global->phaseNum >= 352)
kPersoRoomBankTable[30] = 26;
- animateTalking = 0;
+ _animateTalking = false;
animationActive = false;
p_global->ff_100 = 0;
p_global->eventType = 0;
diff --git a/engines/cryo/eden.h b/engines/cryo/eden.h
index d377bddb08..9bede6b6d0 100644
--- a/engines/cryo/eden.h
+++ b/engines/cryo/eden.h
@@ -287,8 +287,8 @@ private:
void ConvertLinks(room_t *room, int count);
void ConvertMacToPC();
void loadpermfiles();
- char ReadDataSyncVOC(unsigned int num);
- char ReadDataSync(uint16 num);
+ bool ReadDataSyncVOC(unsigned int num);
+ bool ReadDataSync(uint16 num);
void loadpartoffile(uint16 num, void *buffer, int32 pos, int32 len);
void Expand_hsq(void *input, void *output);
void ajouinfo(byte info);
@@ -688,7 +688,7 @@ private:
int16 mus_vol_left;
- byte animateTalking;
+ bool _animateTalking;
bool _personTalking;
byte _musicFadeFlag;