CRYO: Change some int16 to boolean, use nullptr for pointers

This commit is contained in:
Strangerke 2016-11-05 07:52:11 -07:00 committed by Eugene Sandulenko
parent acff7309a2
commit 4aa4460bc1
3 changed files with 16 additions and 16 deletions

View File

@ -39,11 +39,11 @@ static bool use_sound_sync = false;
static int16 pending_sounds = 0;
static bool sound_started = false;
static bool preserve_color0 = false;
static soundchannel_t *soundChannel_adpcm = 0;
static soundgroup_t *soundGroup_adpcm = 0;
static soundchannel_t *soundChannel = 0;
static soundchannel_t *soundChannel_adpcm = nullptr;
static soundgroup_t *soundGroup_adpcm = nullptr;
static soundchannel_t *soundChannel = nullptr;
static soundgroup_t *soundGroup = 0;
static void (*custom_chunk_handler)(byte *buffer, int size, int16 id, char h6, char h7) = 0;
static void (*custom_chunk_handler)(byte *buffer, int size, int16 id, char h6, char h7) = nullptr;
static int16 decomp_table[256];
void CLHNM_Desentrelace320(byte *frame_buffer, byte *final_buffer, uint16 height);
@ -190,7 +190,7 @@ void CLHNM_DecompUBA(byte *output, byte *curr_buffer, byte *prev_buffer,
}
void CLHNM_Init() {
custom_chunk_handler = 0;
custom_chunk_handler = nullptr;
preserve_color0 = false;
}
@ -226,20 +226,20 @@ void CLHNM_CloseSound() {
if (soundChannel) {
CLSoundChannel_Stop(soundChannel);
CLSoundChannel_Free(soundChannel);
soundChannel = 0;
soundChannel = nullptr;
}
if (soundGroup) {
CLSoundGroup_Free(soundGroup);
soundGroup = 0;
soundGroup = nullptr;
}
if (soundChannel_adpcm) {
CLSoundChannel_Stop(soundChannel_adpcm);
CLSoundChannel_Free(soundChannel_adpcm);
soundChannel = 0;
soundChannel = nullptr;
}
if (soundGroup_adpcm) {
CLSoundGroup_Free(soundGroup_adpcm);
soundGroup = 0;
soundGroup = nullptr;
}
}
@ -438,14 +438,14 @@ void CLHNM_Reset(hnm_t *hnm) {
CLHNM_ResetInternalTimer();
}
int16 CLHNM_LoadFrame(hnm_t *hnm) {
bool CLHNM_LoadFrame(hnm_t *hnm) {
int chunk;
CLHNM_TryRead(hnm, 4);
chunk = *(int *)hnm->_readBuffer;
chunk = LE32(chunk);
chunk &= 0xFFFFFF; // upper bit - keyframe mark?
if (!chunk)
return 0;
return false;
if (chunk - 4 > hnm->_header._bufferSize)
error("CLHNM_LoadFrame - Chunk size");
@ -453,7 +453,7 @@ int16 CLHNM_LoadFrame(hnm_t *hnm) {
CLHNM_TryRead(hnm, chunk - 4);
hnm->_dataPtr = hnm->_readBuffer;
hnm->_totalRead += chunk;
return 1;
return true;
}
void CLHNM_WantsSound(bool sound) {

View File

@ -203,7 +203,7 @@ void CLPalette_BeSystem() {
///// CLBlitter
static uint16 newPaletteCount, newPaletteFirst;
static color_t *pNewPalette;
static uint16 useNewPalette;
static bool useNewPalette;
void CLBlitter_CopyViewRect(View *view1, View *view2, Common::Rect *rect1, Common::Rect *rect2) {
int dy = rect2->top;
@ -223,7 +223,7 @@ void CLBlitter_CopyViewRect(View *view1, View *view2, Common::Rect *rect1, Commo
void CLBlitter_Send2ScreenNextCopy(color_t *palette, uint16 first, uint16 count) {
pNewPalette = palette;
useNewPalette = 1;
useNewPalette = true;
newPaletteFirst = first;
newPaletteCount = count;
}
@ -262,7 +262,7 @@ void CLBlitter_CopyView2Screen(View *view) {
color_t palette[256];
CLPalette_GetLastPalette(palette);
CLPalette_Send2Screen(pNewPalette, newPaletteFirst, newPaletteCount);
useNewPalette = 0;
useNewPalette = false;
}
//TODO: quick hack to force screen update

View File

@ -290,7 +290,7 @@ soundchannel_t *CLHNM_GetSoundChannel();
void CLHNM_TryRead(hnm_t *hnm, int size);
void CLHNM_ResetInternalTimer();
void CLHNM_Reset(hnm_t *hnm);
int16 CLHNM_LoadFrame(hnm_t *hnm);
bool CLHNM_LoadFrame(hnm_t *hnm);
void CLHNM_WantsSound(int16 sound);
void CLHNM_LoadDecompTable(int16 *buffer);
void CLHNM_DecompADPCM(byte *buffer, int16 *output, int size);