CHEWY: Remove unused defines and add brackets to empty loops

This commit is contained in:
Filippos Karapetis 2022-03-21 01:32:08 +02:00
parent 917fb1a3d3
commit a971cda7f5
6 changed files with 12 additions and 24 deletions

View File

@ -26,13 +26,12 @@
#include "chewy/events.h"
#include "chewy/globals.h"
#include "chewy/main.h"
#include "chewy/ngsdefs.h"
#include "chewy/sound.h"
#include "chewy/text.h"
namespace Chewy {
#define MAX_DIALOG_DATA_SIZE 6 * 3 * 6
bool AtsTxtHeader::load(Common::SeekableReadStream *src) {
_txtNr = src->readUint16LE();
_aMov = src->readSint16LE();
@ -1004,7 +1003,7 @@ void Atdsys::print_aad(int16 scrX, int16 scrY) {
} else {
if (_ssr->_next == false) {
++_aadv._strNr;
while (*_aadv._ptr++ != ATDS_END_TEXT);
while (*_aadv._ptr++ != ATDS_END_TEXT) {}
int16 tmp_person = _aadv._strHeader->_akPerson;
int16 tmp_str_nr = _aadv._strNr;
@ -1243,7 +1242,7 @@ void Atdsys::ads_search_block(int16 blockNr, char **ptr) {
*ptr = start_ptr;
} else {
start_ptr += 2 + sizeof(AadStrHeader);
while (*start_ptr++ != ATDS_END_BLOCK);
while (*start_ptr++ != ATDS_END_BLOCK) {}
if (start_ptr[0] == ATDS_END &&
start_ptr[1] == ATDS_END) {
ende = true;
@ -1262,7 +1261,7 @@ void Atdsys::ads_search_item(int16 itemNr, char **blkAdr) {
*blkAdr = start_ptr + 1;
} else {
start_ptr += 1 + sizeof(AadStrHeader);
while (*start_ptr++ != ATDS_END_ENTRY);
while (*start_ptr++ != ATDS_END_ENTRY) {}
if (*start_ptr == ATDS_END_BLOCK) {
ende = true;
*blkAdr = nullptr;

View File

@ -324,7 +324,6 @@ private:
int16 _atdsPoolOff[MAX_HANDLE] = { 0 };
char *_atsMem = nullptr;
uint8 *_ats_sheader = nullptr;
char *_atds_id_ptr = nullptr;
AadVar _aadv;
AtsVar _atsv;
AdsVar _adsv;

View File

@ -190,7 +190,7 @@ void load_room_music(int16 room_nr) {
_G(sndPlayer)->setLoopMode(lp_mode);
if (ttp_index != _G(currentSong)) {
_G(sndPlayer)->stopMod();
while (_G(sndPlayer)->musicPlaying());
while (_G(sndPlayer)->musicPlaying()) {}
memset(_G(Ci).MusicSlot, 0, MUSIC_SLOT_SIZE);
_G(mem)->file->selectPoolItem(_G(music_handle), _G(EndOfPool) - ttp_index);
_G(mem)->file->load_tmf(_G(music_handle), (TmfHeader *)_G(Ci).MusicSlot);

View File

@ -31,7 +31,6 @@
namespace Chewy {
#define AUSGANG_CHECK_PIX 8
#define SCROLL_LEFT 120
#define SCROLL_RIGHT SCREEN_WIDTH-SCROLL_LEFT
#define SCROLL_UP 80

View File

@ -33,11 +33,6 @@
namespace Chewy {
//#define NEW_VIDEO_CODE 1
#define STERNE_ANI 17
#define TUER_ZU_ANI 3
void play_scene_ani(int16 nr, int16 mode) {
#define ROOM_1_1 101
#define ROOM_1_2 102
@ -859,7 +854,7 @@ void flic_cut(int16 nr) {
_G(sndPlayer)->fadeOut(0);
_G(out)->ausblenden(1);
_G(out)->cls();
while (_G(sndPlayer)->musicPlaying());
while (_G(sndPlayer)->musicPlaying()) {}
_G(sndPlayer)->setLoopMode(_G(gameState).soundLoopMode);
break;
@ -879,7 +874,7 @@ void flic_cut(int16 nr) {
_G(sndPlayer)->fadeOut(0);
_G(out)->ausblenden(1);
_G(out)->cls();
while (_G(sndPlayer)->musicPlaying() && !SHOULD_QUIT);
while (_G(sndPlayer)->musicPlaying() && !SHOULD_QUIT) {}
break;
case FCUT_065:

View File

@ -20,11 +20,10 @@
*/
#include "audio/audiostream.h"
#include "audio/decoders/raw.h"
#include "chewy/chewy.h"
#include "chewy/sound_player.h"
#include "chewy/globals.h"
#include "chewy/ngshext.h"
#include "chewy/ngsdefs.h"
#include "chewy/sound_player.h"
#include "chewy/sound.h"
namespace Chewy {
@ -183,12 +182,10 @@ void SoundPlayer::initMixMode() {
}
void SoundPlayer::playMod(TmfHeader *th) {
char *tmp;
int16 i;
ActiveSong = th;
tmp = (char *)ActiveSong;
char *tmp = (char *)ActiveSong;
tmp += sizeof(TmfHeader);
for (i = 0; i < 128; i++) {
for (int16 i = 0; i < 128; i++) {
Patterns[i] = tmp;
tmp += 1024;
}
@ -275,8 +272,7 @@ int16 SoundPlayer::musicPlaying() {
}
void SoundPlayer::initNoteTable(uint16 sfreq) {
float TimerFreq;
TimerFreq = 7093789.2f;
float TimerFreq = 7093789.2f;
for (int j = 0; j < 16; j++) {
for (int i = 0; i < 48; i++)
RealFreq[(j * 48) + i] = (uint16)(TimerFreq / (float)(FreqTable[(j * 48) + i] << 1));