aboutsummaryrefslogtreecommitdiff
path: root/engines/cryo
diff options
context:
space:
mode:
authorStrangerke2016-11-16 14:42:19 -0800
committerEugene Sandulenko2017-01-25 22:42:07 +0100
commitc62b719118c215c0198a2dda46746d922c6a37e1 (patch)
tree2574ec9639135c6fa7c8efae00955d30d81264ee /engines/cryo
parent1b34a02db7c17131a6f6d0004df1dec00c0ed8d9 (diff)
downloadscummvm-rg350-c62b719118c215c0198a2dda46746d922c6a37e1.tar.gz
scummvm-rg350-c62b719118c215c0198a2dda46746d922c6a37e1.tar.bz2
scummvm-rg350-c62b719118c215c0198a2dda46746d922c6a37e1.zip
CRYO: Some more renaming and reducing of scope
Diffstat (limited to 'engines/cryo')
-rw-r--r--engines/cryo/clsoundgroup.cpp12
-rw-r--r--engines/cryo/clsoundraw.cpp7
-rw-r--r--engines/cryo/cryolib.cpp5
-rw-r--r--engines/cryo/cryolib.h8
-rw-r--r--engines/cryo/defs.h10
-rw-r--r--engines/cryo/eden.cpp16
-rw-r--r--engines/cryo/staticdata.cpp10
7 files changed, 30 insertions, 38 deletions
diff --git a/engines/cryo/clsoundgroup.cpp b/engines/cryo/clsoundgroup.cpp
index c4735fd320..0d54b7d171 100644
--- a/engines/cryo/clsoundgroup.cpp
+++ b/engines/cryo/clsoundgroup.cpp
@@ -38,7 +38,7 @@ soundgroup_t *CLSoundGroup_New(int16 numSounds, int16 length, int16 sampleSize,
}
sg->_soundIndex = 0;
sg->_playIndex = 0;
- sg->ff_106 = 1;
+ sg->_forceWait = true;
return sg;
}
@@ -56,14 +56,14 @@ void CLSoundGroup_Reverse16All(soundgroup_t *sg) {
void *CLSoundGroup_GetNextBuffer(soundgroup_t *sg) {
sound_t *sound = sg->_sound[sg->_soundIndex];
- if (sg->ff_106)
+ if (sg->_forceWait)
while (sound->_locked) ;
return sound->sndHandle + sound->_headerLen;
}
bool CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, bool isSigned) {
sound_t *sound = sg->_sound[sg->_soundIndex];
- if (sg->ff_106)
+ if (sg->_forceWait)
while (sound->_locked) ;
else if (sound->_locked)
return false;
@@ -83,17 +83,16 @@ bool CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, bool i
}
bool CLSoundGroup_SetDatas(soundgroup_t *sg, void *data, int length, bool isSigned) {
- void *buffer;
sound_t *sound = sg->_sound[sg->_soundIndex];
if (length >= sound->_maxLength)
error("CLSoundGroup_SetDatas - Unexpected length");
- if (sg->ff_106)
+ if (sg->_forceWait)
while (sound->_locked) ;
else if (sound->_locked)
return false;
- buffer = sound->sndHandle + sound->_headerLen;
+ void *buffer = sound->sndHandle + sound->_headerLen;
sound->_buffer = (char *)buffer;
memcpy(buffer, data, length);
CLSound_SetLength(sound, length);
@@ -116,7 +115,6 @@ void CLSoundGroup_PlayNextSample(soundgroup_t *sg, soundchannel_t *ch) {
sg->_playIndex = 0;
else
sg->_playIndex++;
-
}
} // End of namespace Cryo
diff --git a/engines/cryo/clsoundraw.cpp b/engines/cryo/clsoundraw.cpp
index a1c27d1981..1355d7d2f2 100644
--- a/engines/cryo/clsoundraw.cpp
+++ b/engines/cryo/clsoundraw.cpp
@@ -25,9 +25,7 @@
namespace Cryo {
sound_t *CLSoundRaw_New(int16 length, float rate, int16 sampleSize, int16 mode) {
- sound_t *sound;
-
- sound = (sound_t *)malloc(sizeof(*sound));
+ sound_t *sound = (sound_t *)malloc(sizeof(*sound));
if (sound) {
sound->_maxLength = length;
sound->_rate = rate;
@@ -51,10 +49,9 @@ void CLSoundRaw_Free(sound_t *sound) {
}
void CLSoundRaw_AssignBuffer(sound_t *sound, void *buffer, int bufferOffs, int length) {
- char *buf;
CLSound_SetLength(sound, length);
sound->_length = length;
- buf = bufferOffs + (char *)buffer;
+ char *buf = bufferOffs + (char *)buffer;
// if(CLSound_GetWantsDesigned())
// CLSound_Signed2NonSigned(buf, length);
sound->_buffer = buf;
diff --git a/engines/cryo/cryolib.cpp b/engines/cryo/cryolib.cpp
index 5216cd1308..ff4a603bc4 100644
--- a/engines/cryo/cryolib.cpp
+++ b/engines/cryo/cryolib.cpp
@@ -380,15 +380,14 @@ void CLSound_SetLength(sound_t *sound, int length) {
///// CLSoundChannel
/// sound output device that plays queue of sounds
soundchannel_t *CLSoundChannel_New(int arg1) {
- int16 i;
soundchannel_t *ch = (soundchannel_t *)malloc(sizeof(*ch));
if (!ch)
- return 0;
+ return nullptr;
ch->_volumeLeft = ch->_volumeRight = 255;
ch->_numSounds = 0;
- for (i = 0; i < kCryoMaxChSounds; i++)
+ for (int16 i = 0; i < kCryoMaxChSounds; i++)
ch->_sounds[i] = 0;
return ch;
diff --git a/engines/cryo/cryolib.h b/engines/cryo/cryolib.h
index e14b798989..3bb4186fd7 100644
--- a/engines/cryo/cryolib.h
+++ b/engines/cryo/cryolib.h
@@ -150,10 +150,10 @@ typedef struct sound_t sound_t;
struct soundgroup_t {
sound_t *_sound[kCryoMaxClSounds];
- int16 _numSounds;
- int16 _soundIndex;
- int16 _playIndex;
- int16 ff_106;
+ int16 _numSounds;
+ int16 _soundIndex;
+ int16 _playIndex;
+ bool _forceWait;
};
typedef struct soundgroup_t soundgroup_t;
diff --git a/engines/cryo/defs.h b/engines/cryo/defs.h
index b57b46627b..8ff50763ce 100644
--- a/engines/cryo/defs.h
+++ b/engines/cryo/defs.h
@@ -813,11 +813,11 @@ extern char kPersoRoomBankTable[];
// area transition descriptors
extern goto_t gotos[];
-extern int16 tab_2D24C[];
-extern int16 tab_2D28E[];
-extern int16 tab_2D298[];
-extern int16 tab_2D2AA[];
-extern int16 tab_2D2C4[];
+extern int16 kFramesVid170[];
+extern int16 kFramesVid83[];
+extern int16 kFramesVid88[];
+extern int16 kFramesVid89[];
+extern int16 kFramesVid94[];
extern object_t objects[];
extern int16 kObjectLocations[100];
extern perso_t kPersons[];
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index d384bd1b61..0362f0f80c 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -6329,23 +6329,23 @@ void EdenGame::displayHNMSubtitles() {
perso_t *perso;
switch (p_global->curVideoNum) {
case 170:
- frames = tab_2D24C;
+ frames = kFramesVid170;
perso = &kPersons[PER_UNKN_156];
break;
case 83:
- frames = tab_2D28E;
+ frames = kFramesVid83;
perso = &kPersons[PER_MORKUS];
break;
case 88:
- frames = tab_2D298;
+ frames = kFramesVid88;
perso = &kPersons[PER_MORKUS];
break;
case 89:
- frames = tab_2D2AA;
+ frames = kFramesVid89;
perso = &kPersons[PER_MORKUS];
break;
case 94:
- frames = tab_2D2C4;
+ frames = kFramesVid94;
perso = &kPersons[PER_MORKUS];
break;
default:
@@ -8532,10 +8532,8 @@ void EdenGame::selectmap(int16 num) {
int16 y = (num & 0x18) * 4;
for (int i = 0; i < 6 * 2; i++) {
for (int j = 0; j < 3; j++) {
- cube.faces[i]->uv[j * 2 ] = x + cube_texcoords[mode][k];
- k++;
- cube.faces[i]->uv[j * 2 + 1] = y + cube_texcoords[mode][k];
- k++;
+ cube.faces[i]->uv[j * 2 ] = x + cube_texcoords[mode][k++];
+ cube.faces[i]->uv[j * 2 + 1] = y + cube_texcoords[mode][k++];
}
}
}
diff --git a/engines/cryo/staticdata.cpp b/engines/cryo/staticdata.cpp
index eab6fa67fc..cb05556aa2 100644
--- a/engines/cryo/staticdata.cpp
+++ b/engines/cryo/staticdata.cpp
@@ -239,7 +239,7 @@ goto_t gotos[] = {
#define SUB_LINE(start, end) \
(start), (end) | 0x8000
-int16 tab_2D24C[] = {
+int16 kFramesVid170[] = {
SUB_LINE( 68, 120),
SUB_LINE( 123, 196),
SUB_LINE( 199, 274),
@@ -259,13 +259,13 @@ int16 tab_2D24C[] = {
-1
};
-int16 tab_2D28E[] = {
+int16 kFramesVid83[] = {
SUB_LINE(99, 155),
SUB_LINE(157, 256),
-1
};
-int16 tab_2D298[] = {
+int16 kFramesVid88[] = {
SUB_LINE(106, 173),
SUB_LINE(175, 244),
SUB_LINE(246, 350),
@@ -273,7 +273,7 @@ int16 tab_2D298[] = {
-1
};
-int16 tab_2D2AA[] = {
+int16 kFramesVid89[] = {
SUB_LINE(126, 176),
SUB_LINE(178, 267),
SUB_LINE(269, 342),
@@ -283,7 +283,7 @@ int16 tab_2D2AA[] = {
-1
};
-int16 tab_2D2C4[] = {
+int16 kFramesVid94[] = {
SUB_LINE(101, 213),
SUB_LINE(215, 353),
SUB_LINE(355, 455),