From 4aa4460bc12fbdb92447ca28401047bcea580c60 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 5 Nov 2016 07:52:11 -0700 Subject: CRYO: Change some int16 to boolean, use nullptr for pointers --- engines/cryo/clhnm.cpp | 24 ++++++++++++------------ engines/cryo/cryolib.cpp | 6 +++--- engines/cryo/cryolib.h | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'engines') diff --git a/engines/cryo/clhnm.cpp b/engines/cryo/clhnm.cpp index 03f971d79d..51182dba9e 100644 --- a/engines/cryo/clhnm.cpp +++ b/engines/cryo/clhnm.cpp @@ -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) { diff --git a/engines/cryo/cryolib.cpp b/engines/cryo/cryolib.cpp index 8989cba0ca..8b5eaf6252 100644 --- a/engines/cryo/cryolib.cpp +++ b/engines/cryo/cryolib.cpp @@ -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 diff --git a/engines/cryo/cryolib.h b/engines/cryo/cryolib.h index 679be87d27..21c6c8ab5a 100644 --- a/engines/cryo/cryolib.h +++ b/engines/cryo/cryolib.h @@ -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); -- cgit v1.2.3