diff options
-rw-r--r-- | queen/graphics.cpp | 16 | ||||
-rw-r--r-- | queen/logic.cpp | 2 | ||||
-rw-r--r-- | queen/resource.cpp | 4 | ||||
-rw-r--r-- | queen/sound.cpp | 2 | ||||
-rw-r--r-- | queen/talk.cpp | 2 | ||||
-rw-r--r-- | sound/mixer.cpp | 7 | ||||
-rw-r--r-- | sound/mixer.h | 3 |
7 files changed, 15 insertions, 21 deletions
diff --git a/queen/graphics.cpp b/queen/graphics.cpp index 24b05a9fb6..5d87bbf65c 100644 --- a/queen/graphics.cpp +++ b/queen/graphics.cpp @@ -126,7 +126,7 @@ void Graphics::bankOverpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { void Graphics::bankErase(uint32 bankslot) { debug(9, "Graphics::bankErase(%d)", bankslot); - delete[] _banks[bankslot].data; + free(_banks[bankslot].data); _banks[bankslot].data = 0; } @@ -135,9 +135,9 @@ void Graphics::bobSetupControl() { bankLoad("control.BBK",17); bankUnpack(1, 1, 17); // Mouse pointer - bankUnpack(3, 3, 17); // Up arrow dialogue - bankUnpack(4, 4, 17); // Down arrow dialogue - bankErase(17); + bankUnpack(3, 3, 17); // Up arrow dialogue + bankUnpack(4, 4, 17); // Down arrow dialogue + bankErase(17); } @@ -722,7 +722,7 @@ void Graphics::loadBackdrop(const char* name, uint16 room) { } uint32 size = _resource->fileSize(name); _display->pcxReadBackdrop(pcxbuf, size, room > 114); - delete[] pcxbuf; + free(pcxbuf); if (room >= 90) { _cameraBob = 0; @@ -738,7 +738,7 @@ void Graphics::loadPanel() { } uint32 size = _resource->fileSize("panel.pcx"); _display->pcxReadPanel(pcxbuf, size); - delete[] pcxbuf; + free(pcxbuf); } @@ -752,7 +752,7 @@ void Graphics::useJournal() { // GameSettings* pgs // load and unpack journal frames frameEraseAll(false); - bankLoad("journal.BBK", 8); + bankLoad("journal.BBK", 8); for(i = 1; i <= 20; ++i) { bankUnpack(i, FRAMES_JOURNAL + i, 8); // set hot spots to zero @@ -761,7 +761,7 @@ void Graphics::useJournal() { // GameSettings* pgs } // adjust info box hot spot to put it on top always _frames[FRAMES_JOURNAL + 20].yhotspot = 200; - bankErase(8); + bankErase(8); // TODO: setup zones diff --git a/queen/logic.cpp b/queen/logic.cpp index 77c6781b29..8dc219ff76 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -156,7 +156,7 @@ Logic::Logic(Resource *resource, Graphics *graphics, Display *theDisplay, Input } Logic::~Logic() { - delete[] _jas; + free(_jas); delete _walk; } diff --git a/queen/resource.cpp b/queen/resource.cpp index cc9535a32a..2b95f9566d 100644 --- a/queen/resource.cpp +++ b/queen/resource.cpp @@ -79,7 +79,7 @@ Resource::~Resource() { _resourceFile->close(); if(_resourceTable != _resourceTablePEM10) delete[] _resourceTable; - delete[] _JAS2Ptr; + free(_JAS2Ptr); } int32 Resource::resourceIndex(const char *filename) { @@ -144,7 +144,7 @@ uint32 Resource::fileOffset(const char *filename) { uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, byte *dstBuf) { uint32 size = fileSize(filename); if (dstBuf == NULL) { - dstBuf = new byte[size]; + dstBuf = (byte *)malloc(size); } // skip 'skipBytes' bytes (useful for headers) _resourceFile->seek(fileOffset(filename) + skipBytes, SEEK_SET); diff --git a/queen/sound.cpp b/queen/sound.cpp index 50768ed804..15a831b89e 100644 --- a/queen/sound.cpp +++ b/queen/sound.cpp @@ -62,7 +62,7 @@ bool Sound::isPlaying() { } int SBSound::playSound(byte *sound, uint32 size) { - byte flags = 0 | SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTODELETE; + byte flags = 0 | SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE; return _mixer->playRaw(&_sfxHandle, sound, size, 11025, flags); } diff --git a/queen/talk.cpp b/queen/talk.cpp index 50b552d564..2ed77b54ed 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -78,7 +78,7 @@ Talk::Talk( } Talk::~Talk() { - delete[] _fileData; + free(_fileData); } diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 21439a648e..a46ad18db7 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -44,7 +44,6 @@ protected: RateConverter *_converter; AudioInputStream *_input; byte _volume; - byte _flags; int8 _pan; bool _paused; @@ -511,7 +510,6 @@ ChannelRaw::ChannelRaw(SoundMixer *mixer, PlayingSoundHandle *handle, void *soun : Channel(mixer, handle) { _id = id; _ptr = (byte *)sound; - _flags = flags; _volume = volume; _pan = pan; @@ -535,10 +533,7 @@ ChannelRaw::ChannelRaw(SoundMixer *mixer, PlayingSoundHandle *handle, void *soun } ChannelRaw::~ChannelRaw() { - if (_flags & SoundMixer::FLAG_AUTOFREE) - free(_ptr); - else if (_flags & SoundMixer::FLAG_AUTODELETE) - delete _ptr; + free(_ptr); } ChannelStream::ChannelStream(SoundMixer *mixer, PlayingSoundHandle *handle, diff --git a/sound/mixer.h b/sound/mixer.h index 12b51b705c..310703445d 100644 --- a/sound/mixer.h +++ b/sound/mixer.h @@ -55,8 +55,7 @@ public: FLAG_16BITS = 1 << 2, // sound is 16 bits wide (default: 8bit) FLAG_AUTOFREE = 1 << 3, // sound buffer is freed automagically at the end of playing FLAG_REVERSE_STEREO = 1 << 4, // reverse the left and right stereo channel - FLAG_LOOP = 1 << 5, // loop the audio - FLAG_AUTODELETE = 1 << 6 // same as AUTOFREE, but uses delete instead of free() + FLAG_LOOP = 1 << 5 // loop the audio }; |