CRYO: Fix conditional compilation related to endianness, some renaming

This commit is contained in:
Strangerke 2017-01-01 22:18:09 -08:00 committed by Eugene Sandulenko
parent ff1f320980
commit 448fe6303b
4 changed files with 28 additions and 36 deletions

View File

@ -346,7 +346,7 @@ void CLSound_PrepareSample(sound_t *sound, int16 mode) {
sound->_locked = 0;
sound->_loopTimes = 0;
sound->_reversed = false;
sound->ff_32 = 0;
sound->_unused32 = 0;
sound->_volume = 255;
}

View File

@ -34,7 +34,7 @@ class CryoEngine;
#define SW16(n) ( (((n) & 0xFF) << 8) | (((n) >> 8) & 0xFF) )
#define SW32(n) ( (((n) & 0xFF) << 24) | (((n) >> 24) & 0xFF) | (((n) & 0xFF00) << 8) | (((n) >> 8) & 0xFF00))
#if 0
#ifdef SCUMM_BIG_ENDIAN
//big-endian host
#define LE16(n) SW16(n)
#define LE32(n) SW32(n)
@ -118,8 +118,8 @@ typedef struct HNMHeader HNMHeader;
#pragma pack(pop)
struct hnm_t {
int _frameNum;
int ff_4;
int _frameNum;
int _unused04;
Common::File *_file;
HNMHeader _header;
byte *tmpBuffer[2];
@ -128,52 +128,44 @@ struct hnm_t {
byte *_oldFrameBuffer;
byte *_readBuffer;
byte *_dataPtr;
color_t _palette[256];
bool _canLoop;
int16 ff_896;
int16 _chunkId;
int _totalRead;
color_t _palette[256];
bool _canLoop;
int16 _unused896;
int16 _chunkId;
int _totalRead;
};
typedef struct hnm_t hnm_t;
struct sound_t {
char *sndHandle;
int16 _headerLen;
char *_sndHandle;
int16 _headerLen;
int32 _headerOffset;
int16 ff_A;
int16 _unused0A;
char *_buffer;
int ff_16;
int16 _maxLength;
float _rate;
int16 _sampleSize;
int _length;
int16 _mode;
char *_buffer;
int _unused16;
int16 _maxLength;
float _rate;
int16 _sampleSize;
int _length;
int16 _mode;
volatile int16 _locked;
int32 _loopStart;
int16 _loopTimes;
int32 _loopStart;
int16 _loopTimes;
bool _reversed;
int16 ff_32;
int16 _volume;
int16 _unused32;
int16 _volume;
};
typedef struct sound_t sound_t;
#define kCryoMaxChSounds 10
struct soundchannel_t {
Audio::SoundHandle ch;
int xx;
int16 _volumeLeft;
int16 _volumeRight;
int16 _numSounds;
sound_t *_sounds[kCryoMaxChSounds];
int16 ff_536;
};
typedef struct soundchannel_t soundchannel_t;
sound_t *CLSoundRaw_New(int16 length, float rate, int16 sampleSize, int16 mode);
void CLSoundRaw_Free(sound_t *sound);

View File

@ -102,7 +102,7 @@ void *SoundGroup::getNextBuffer() {
sound_t *sound = _sounds[_soundIndex];
if (_forceWait)
while (sound->_locked) ;
return sound->sndHandle + sound->_headerLen;
return sound->_sndHandle + sound->_headerLen;
}
// Original name: CLSoundGroup_AssignDatas
@ -140,7 +140,7 @@ bool SoundGroup::setDatas(void *data, int length, bool isSigned) {
else if (sound->_locked)
return false;
void *buffer = sound->sndHandle + sound->_headerLen;
void *buffer = sound->_sndHandle + sound->_headerLen;
sound->_buffer = (char *)buffer;
memcpy(buffer, data, length);
CLSound_SetLength(sound, length);

View File

@ -55,13 +55,13 @@ hnm_t *HnmPlayer::resetInternals() {
hnm_t *hnm = (hnm_t *)malloc(sizeof(*hnm));
hnm->_frameNum = 0;
hnm->ff_4 = 0;
hnm->_unused04 = 0;
hnm->_file = nullptr;
hnm->tmpBuffer[0] = nullptr;
hnm->tmpBuffer[1] = nullptr;
hnm->finalBuffer = nullptr;
hnm->_readBuffer = nullptr;
hnm->ff_896 = 0;
hnm->_unused896 = 0;
hnm->_totalRead = 0;
for (int i = 0; i < 256; i++) {
hnm->_palette[i].a = 0;
@ -92,7 +92,7 @@ void HnmPlayer::resetInternalTimer() {
// Original name: CLHNM_Reset
void HnmPlayer::reset(hnm_t *hnm) {
hnm->_frameNum = 0;
hnm->ff_4 = 0;
hnm->_unused04 = 0;
hnm->_totalRead = 0;
_soundStarted = false;
_pendingSounds = 0;