MADE: Cleanup

This commit is contained in:
Eugene Sandulenko 2016-05-02 15:18:43 +02:00
parent 62142e5add
commit 298ea1a76e
6 changed files with 15 additions and 2 deletions

View File

@ -40,6 +40,7 @@ namespace Made {
*/
Object::Object() : _objData(NULL), _freeData(false) {
_objSize = 0;
}
Object::~Object() {

View File

@ -223,7 +223,10 @@ bool PmvPlayer::play(const char *filename) {
//delete _audioStream;
delete _fd;
_surface->free();
if(_surface)
_surface->free();
delete _surface;
return !_aborted;

View File

@ -102,7 +102,7 @@ int LzhDecompressor::decompress(Common::SeekableReadStream &source, byte *dest,
int bufsize;
byte* buffer;
buffer = (byte *) malloc(DICSIZ);
buffer = (byte *)calloc(DICSIZ, 1);
_source = &source;
_compSize = sourceLen;

View File

@ -43,6 +43,7 @@ Resource::~Resource() {
PictureResource::PictureResource() : _picture(NULL), _picturePalette(NULL) {
_hasPalette = false;
_paletteColorCount = 0;
}
PictureResource::~PictureResource() {
@ -182,6 +183,9 @@ void PictureResource::loadChunked(byte *source, int size) {
/* AnimationResource */
AnimationResource::AnimationResource() {
_flags = 0;
_width = 0;
_height = 0;
}
AnimationResource::~AnimationResource() {

View File

@ -91,6 +91,8 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) {
_currentFontNum = 0;
_fontDrawCtx.clipRect = Common::Rect(320, 200);
_fontDrawCtx.destSurface = _backgroundScreen;
_outlineColor = 0;
_dropShadowColor = 0;
clearChannels();
}

View File

@ -248,6 +248,9 @@ void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCou
// soundBuffer.
soundBuffer[workChunkSize] = soundBuffer[workChunkSize - 1];
for (i = 0; i < chunkSize; i++)
soundBuffer[i] = 0;
if (deltaType == 1) {
for (i = 0; i < chunkSize - 1; i += 2) {
l = i / 2;