aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/cryo/cryolib.cpp13
-rw-r--r--engines/cryo/cryolib.h13
-rw-r--r--engines/cryo/defs.h8
-rw-r--r--engines/cryo/sound.cpp6
-rw-r--r--engines/cryo/sound.h1
-rw-r--r--engines/cryo/video.cpp61
-rw-r--r--engines/cryo/video.h12
7 files changed, 10 insertions, 104 deletions
diff --git a/engines/cryo/cryolib.cpp b/engines/cryo/cryolib.cpp
index 6b0ff64518..7db9dfa17c 100644
--- a/engines/cryo/cryolib.cpp
+++ b/engines/cryo/cryolib.cpp
@@ -43,15 +43,14 @@ void FlushEvents(int16 arg1, int16 arg2) {
View::View(CryoEngine *vm, int w, int h) : _vm(vm) {
void *buffer = (byte *)malloc(w * h);
- if (buffer) {
- _allocated = true;
+ if (buffer)
initDatas(w, h, buffer);
- } else
+ else
error("Unable to allocate view buffer");
}
View::~View() {
- if (_bufferPtr && _allocated)
+ if (_bufferPtr)
free(_bufferPtr);
}
@@ -335,9 +334,6 @@ Sound::Sound(int16 length, float rate, int16 sampleSize, int16 mode) {
_length = 0;
_mode = 0;
- _loopStart = 0;
- _loopTimes = 0;
- _reversed = false;
_volume = 0;
_maxLength = length;
@@ -367,9 +363,6 @@ void CLSoundRaw_AssignBuffer(Sound *sound, void *buffer, int bufferOffs, int len
void Sound::prepareSample(int16 mode) {
_mode = mode;
- _loopTimes = 0;
- _reversed = false;
- _unused32 = 0;
_volume = 255;
}
diff --git a/engines/cryo/cryolib.h b/engines/cryo/cryolib.h
index f28749d448..5670d75b74 100644
--- a/engines/cryo/cryolib.h
+++ b/engines/cryo/cryolib.h
@@ -65,8 +65,6 @@ class View {
private:
CryoEngine *_vm;
- bool _allocated;
-
public:
View(CryoEngine *vm, int w, int h);
~View();
@@ -88,12 +86,10 @@ public:
struct color3_t {
int16 r, g, b;
};
-typedef struct color3_t color3_t;
struct color_t {
int16 a, r, g, b;
};
-typedef struct color_t color_t;
#pragma pack(push, 1)
struct HNMHeader {
@@ -114,19 +110,12 @@ struct HNMHeader {
char _unusedReserved2[14];
char _unusedCopyright[16];
};
-typedef struct HNMHeader HNMHeader;
#pragma pack(pop)
class Sound {
private:
int32 _headerOffset;
- int16 _unused0A;
-
- int _unused16;
int16 _mode;
- int32 _loopStart;
- int16 _loopTimes;
- int16 _unused32;
int16 _volume;
public:
@@ -148,8 +137,6 @@ public:
int16 _sampleSize;
int _length;
-
- bool _reversed;
};
#define kCryoMaxChSounds 10
diff --git a/engines/cryo/defs.h b/engines/cryo/defs.h
index 3c973a61bc..8b736beacf 100644
--- a/engines/cryo/defs.h
+++ b/engines/cryo/defs.h
@@ -332,7 +332,6 @@ struct perso_t {
byte _speed; // num ticks per step
byte _steps; // current ticks
};
-typedef struct perso_t perso_t;
class EdenGame;
@@ -340,7 +339,6 @@ struct phase_t {
int16 _id;
void (EdenGame::*disp)();
};
-typedef struct phase_t phase_t;
namespace ObjectFlags {
enum ObjectFlags {
@@ -358,7 +356,6 @@ struct object_t {
uint16 _powerMask; // object of power bitmask
int16 _count;
};
-typedef struct object_t object_t;
namespace DialogFlags {
enum DialogFlags {
@@ -386,7 +383,6 @@ struct dial_t {
char _textCondHiMask; // 0-1 text index hi bits, 2-5 - perso mask num, 6-7 condition index hi bits
char _textNumLow; // text line index low bits
};
-typedef struct dial_t dial_t;
struct tape_t {
int16 _textNum;
@@ -396,7 +392,6 @@ struct tape_t {
int16 _backgroundBankNum;
dial_t *_dialog;
};
-typedef struct tape_t tape_t;
struct Follower { // Characters on Mirror screen
char _id; // character
@@ -409,7 +404,6 @@ struct Follower { // Characters on Mirror screen
int16 ff_C;
int16 ff_E;
};
-typedef struct Follower Follower;
struct Icon {
int16 sx;
@@ -763,7 +757,6 @@ struct PakHeaderItem {
int32 _offs;
char _flag;
};
-typedef struct PakHeaderItem PakHeaderItem;
class PakHeaderNode {
public:
@@ -825,7 +818,6 @@ extern uint8 tab_2CB1E[8][4];
struct prect_t {
int16 left, top, right, bottom;
};
-typedef struct prect_t prect_t;
extern prect_t perso_rects[];
extern byte tab_persxx[][5];
diff --git a/engines/cryo/sound.cpp b/engines/cryo/sound.cpp
index bb2816870d..f9b1044da6 100644
--- a/engines/cryo/sound.cpp
+++ b/engines/cryo/sound.cpp
@@ -90,12 +90,6 @@ SoundGroup::~SoundGroup() {
delete(_sounds[i]);
}
-// Original name: CLSoundGroup_Reverse16All
-void SoundGroup::reverse16All() {
- for (int16 i = 0; i < _numSounds; i++)
- _sounds[i]->_reversed = true;
-}
-
// Original name: CLSoundGroup_GetNextBuffer
void *SoundGroup::getNextBuffer() {
Sound *sound = _sounds[_soundIndex];
diff --git a/engines/cryo/sound.h b/engines/cryo/sound.h
index b993ff01ab..3e03115c81 100644
--- a/engines/cryo/sound.h
+++ b/engines/cryo/sound.h
@@ -58,7 +58,6 @@ public:
bool assignDatas(void *buffer, int length, bool isSigned);
void playNextSample(SoundChannel *ch);
- void reverse16All();
bool setDatas(void *data, int length, bool isSigned);
void *getNextBuffer();
};
diff --git a/engines/cryo/video.cpp b/engines/cryo/video.cpp
index 7d783e96c1..4f92a0e5f2 100644
--- a/engines/cryo/video.cpp
+++ b/engines/cryo/video.cpp
@@ -36,11 +36,8 @@ HnmPlayer::HnmPlayer(CryoEngine *vm) : _vm(vm) {
_useSound = false;
_soundChannel = nullptr;
_soundGroup = nullptr;
- _soundChannelAdpcm = nullptr;
- _soundGroupAdpcm = nullptr;
_prevRight = _prevLeft = 0;
_useAdpcm = false;
- _useMono = false;
_customChunkHandler = nullptr;
_preserveColor0 = false;
_safePalette = false;
@@ -57,7 +54,6 @@ void HnmPlayer::resetInternals() {
_tmpBuffer[1] = nullptr;
_finalBuffer = nullptr;
_readBuffer = nullptr;
- _totalRead = 0;
for (int i = 0; i < 256; i++) {
_palette[i].a = 0;
_palette[i].r = 0;
@@ -85,7 +81,6 @@ void HnmPlayer::resetInternalTimer() {
// Original name: CLHNM_Reset
void HnmPlayer::reset() {
_frameNum = 0;
- _totalRead = 0;
_soundStarted = false;
_pendingSounds = 0;
resetInternalTimer();
@@ -121,14 +116,6 @@ void HnmPlayer::wantsSound(bool sound) {
void HnmPlayer::setupSound(int16 numSounds, int16 length, int16 sampleSize, float rate, int16 mode) {
_soundChannel = new SoundChannel(mode);
_soundGroup = new SoundGroup(_vm, numSounds, length, sampleSize, rate, mode);
- if (sampleSize == 16)
- _soundGroup->reverse16All();
-}
-
-// Original name: CLHNM_SetupSoundADPCM
-void HnmPlayer::setupSoundADPCM(int16 numSounds, int16 length, int16 sampleSize, float rate, int16 mode) {
- _soundChannelAdpcm = new SoundChannel(mode);
- _soundGroupAdpcm = new SoundGroup(_vm, numSounds, length, sampleSize, rate, mode);
}
// Original name: CLHNM_CloseSound
@@ -138,19 +125,11 @@ void HnmPlayer::closeSound() {
delete(_soundChannel);
_soundChannel = nullptr;
}
+
if (_soundGroup) {
delete(_soundGroup);
_soundGroup = nullptr;
}
- if (_soundChannelAdpcm) {
- _soundChannelAdpcm->stop();
- delete(_soundChannelAdpcm);
- _soundChannelAdpcm = nullptr;
- }
- if (_soundGroupAdpcm) {
- delete(_soundGroupAdpcm);
- _soundGroupAdpcm = nullptr;
- }
}
// Original name: CLHNM_LoadDecompTable
@@ -272,7 +251,6 @@ bool HnmPlayer::loadFrame() {
tryRead(chunk - 4);
_dataPtr = _readBuffer;
- _totalRead += chunk;
return true;
}
@@ -480,7 +458,6 @@ bool HnmPlayer::nextElement() {
_dataPtr += 1;
char h7 = *_dataPtr;
_dataPtr += 1;
- _chunkId = id;
switch (id) {
case MKTAG16('L', 'P'):
changePalette();
@@ -515,13 +492,8 @@ bool HnmPlayer::nextElement() {
// else
memcpy(_finalBuffer, _newFrameBuffer, _header._height); //TODO: wrong size?
}
- if (_useAdpcm) {
- if (!_soundStarted) {
- for (int16 i = 0; i < _pendingSounds; i++)
- _soundGroupAdpcm->playNextSample(_soundChannel);
- _soundStarted = true;
- }
- } else if (!_soundStarted) {
+
+ if (!_soundStarted) {
for (int16 i = 0; i < _pendingSounds; i++)
_soundGroup->playNextSample(_soundChannel);
_soundStarted = true;
@@ -554,19 +526,19 @@ bool HnmPlayer::nextElement() {
else
_pendingSounds++;
} else {
- int16 *sound_buffer = (int16 *)_soundGroupAdpcm->getNextBuffer();
+ int16 *sound_buffer = (int16 *)_soundGroup->getNextBuffer();
if (!_pendingSounds) {
const int kDecompTableSize = 256 * sizeof(int16);
loadDecompTable((int16 *)_dataPtr);
decompADPCM(_dataPtr + kDecompTableSize, sound_buffer, sound_size - kDecompTableSize);
- _soundGroupAdpcm->assignDatas(sound_buffer, (sound_size - kDecompTableSize) * 2, false);
+ _soundGroup->assignDatas(sound_buffer, (sound_size - kDecompTableSize) * 2, false);
} else {
decompADPCM(_dataPtr, sound_buffer, sound_size);
- _soundGroupAdpcm->assignDatas(sound_buffer, sound_size * 2, false);
+ _soundGroup->assignDatas(sound_buffer, sound_size * 2, false);
}
_pendingSounds++;
if (_soundStarted)
- _soundGroupAdpcm->playNextSample(_soundChannel);
+ _soundGroup->playNextSample(_soundChannel);
}
} else
error("nextElement - unexpected flag");
@@ -658,24 +630,5 @@ void HnmPlayer::selectBuffers() {
}
}
-// Original name: CLHNM_Done
-void HnmPlayer::done() {
-}
-
-// Original name: CLHNM_CanLoop
-void HnmPlayer::canLoop(bool canLoop) {
- _canLoop = canLoop;
-}
-
-// Original name: CLHNM_SoundInADPCM
-void HnmPlayer::soundInADPCM(bool isAdpcm) {
- _useAdpcm = isAdpcm;
-}
-
-// Original name: CLHNM_SoundMono
-void HnmPlayer::soundMono(bool isMono) {
- _useMono = isMono;
-}
-
} // namespace Cryo
diff --git a/engines/cryo/video.h b/engines/cryo/video.h
index 2c55baa5d9..35977f01a1 100644
--- a/engines/cryo/video.h
+++ b/engines/cryo/video.h
@@ -50,13 +50,6 @@ private:
void setupSoundADPCM(int16 numSounds, int16 length, int16 sampleSize, float rate, int16 mode);
void init();
- // Unused
- void done();
- void canLoop(bool canLoop);
- void soundInADPCM(bool is_adpcm);
- void soundMono(bool is_mono);
- //
-
bool _soundStarted;
int16 _pendingSounds;
float _timeDrift;
@@ -68,7 +61,6 @@ private:
int16 _prevRight;
int16 _prevLeft;
bool _useAdpcm;
- bool _useMono;
bool _preserveColor0;
int16 decompTable[256];
bool _safePalette;
@@ -80,16 +72,12 @@ private:
byte *_readBuffer;
byte *_dataPtr;
color_t _palette[256];
- bool _canLoop;
- int16 _chunkId;
int _totalRead;
void (*_customChunkHandler)(byte *buffer, int size, int16 id, char h6, char h7);
SoundChannel *_soundChannel;
SoundGroup *_soundGroup;
- SoundChannel *_soundChannelAdpcm;
- SoundGroup *_soundGroupAdpcm;
public:
uint16 _curVideoNum;