Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRYO: Remove dead code #1921

Merged
merged 1 commit into from Jan 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions engines/cryo/cryo.h
Expand Up @@ -89,13 +89,6 @@ class CryoEngine : public Engine {

extern CryoEngine *g_ed;

// Example console class
class Console : public GUI::Debugger {
public:
Console(CryoEngine *vm) {}
virtual ~Console(void) {}
};

} // End of namespace Cryo

#endif
90 changes: 0 additions & 90 deletions engines/cryo/cryolib.cpp
Expand Up @@ -313,96 +313,6 @@ bool CryoEngine::isMouseButtonDown() {
return _mouseButton != 0;
}

///// CLSound
// base sound

Sound::Sound(int16 length, float rate, int16 sampleSize, int16 mode) {
_sndHandle = nullptr;
_headerLen = 0;
_headerOffset = 0;

_length = 0;
_mode = 0;
_volume = 0;

_maxLength = length;
_rate = rate;
_sampleSize = sampleSize;
_buffer = nullptr;
// sndHandle = CLMemory_AllocHandle(arg1 + 100);
// if(!sndHandle)
// error("CLSoundRaw_New - Not enough memory");
// else
prepareSample(mode);
}

Sound::~Sound() {
}

void CLSoundRaw_AssignBuffer(Sound *sound, void *buffer, int bufferOffs, int length) {
sound->_length = length;
char *buf = bufferOffs + (char *)buffer;
// if(CLSound_GetWantsDesigned())
// CLSound_Signed2NonSigned(buf, length);
sound->_buffer = buf;
// if(sound->reversed && sound->sampleSize == 16)
// ReverseBlock16(buf, length);
}

void Sound::prepareSample(int16 mode) {
_mode = mode;
_volume = 255;
}

void Sound::setWantsDesigned(int16 designed) {
}

///// CLSoundChannel
/// sound output device that plays queue of sounds
SoundChannel::SoundChannel(int arg1) {
_volumeLeft = _volumeRight = 255;
_numSounds = 0;

for (int16 i = 0; i < kCryoMaxChSounds; i++)
_sounds[i] = nullptr;
}

SoundChannel::~SoundChannel() {
}

void SoundChannel::stop() {
// _vm->_mixer->stopHandle(this);
}

void SoundChannel::play(Sound *sound) {
}

int16 SoundChannel::getVolume() {
return (_volumeLeft + _volumeRight) / 2;
}

void SoundChannel::setVolume(int16 volume) {
if (volume < 0 || volume > 255)
return;

_volumeLeft = volume;
_volumeRight = volume;
}

void SoundChannel::setVolumeRight(int16 volume) {
if (volume < 0 || volume > 255)
return;

_volumeRight = volume;
}

void SoundChannel::setVolumeLeft(int16 volume) {
if (volume < 0 || volume > 255)
return;

_volumeLeft = volume;
}

///// CLTimer
void CLTimer_Action(void *arg) {
// long& counter = *((long*)arg);
Expand Down
48 changes: 0 additions & 48 deletions engines/cryo/cryolib.h
Expand Up @@ -95,54 +95,6 @@ struct HNMHeader {
int32 _bufferSize;
};

class Sound {
private:
int32 _headerOffset;
int16 _mode;
int16 _volume;

public:
Sound(int16 length, float rate, int16 sampleSize, int16 mode);
~Sound();

void assignBuffer(void *buffer, int bufferOffs, int length);
void prepareSample(int16 mode);
void setWantsDesigned(int16 designed);

char *_sndHandle;
char *_buffer;

float _rate;

int16 _maxLength;
int16 _headerLen;
int16 _sampleSize;

int _length;
};

#define kCryoMaxChSounds 10

class SoundChannel {
private:
int16 _volumeLeft;
int16 _volumeRight;
int16 _numSounds;

Sound *_sounds[kCryoMaxChSounds];

public:
SoundChannel(int arg1);
~SoundChannel();

void stop();
void play(Sound *sound);
int16 getVolume();
void setVolume(int16 volume);
void setVolumeRight(int16 volume);
void setVolumeLeft(int16 volume);
};

void SysBeep(int x);
void FlushEvents(int16 arg1, int16 arg2);

Expand Down
3 changes: 0 additions & 3 deletions engines/cryo/eden.cpp
Expand Up @@ -113,7 +113,6 @@ EdenGame::EdenGame(CryoEngine *vm) : _vm(vm), kMaxMusicSize(2200000) {
_soundAllocated = false;
_musicChannel = _voiceChannel = nullptr;
_hnmSoundChannel = nullptr;
_voiceSound = nullptr;
_cirsorPanX = 0;
_inventoryScrollDelay = 0;
_cursorPosY = _cursorPosX = 0;
Expand Down Expand Up @@ -4084,9 +4083,7 @@ void EdenGame::run() {
_vm->_video->setupSound(11025, false, false);
_vm->_video->setForceZero2Black(true);
_vm->_video->setupTimer(12.5);
_voiceSound = new Sound(0, 11025 * 65536.0, 8, 0);
_hnmSoundChannel = _vm->_video->getSoundChannel();
_voiceSound->setWantsDesigned(1); // CHECKME: Used?

_musicChannel = new CSoundChannel(_vm->_mixer, 11025, false);
_voiceChannel = new CSoundChannel(_vm->_mixer, 11025, false);
Expand Down
1 change: 0 additions & 1 deletion engines/cryo/eden.h
Expand Up @@ -649,7 +649,6 @@ class EdenGame {
CSoundChannel *_musicChannel;
CSoundChannel *_voiceChannel;
CSoundChannel *_hnmSoundChannel;
Sound *_voiceSound;

int _demoCurrentTicks;
int _demoStartTicks;
Expand Down