diff options
author | Einar Johan Trøan Sømåen | 2012-05-12 07:36:24 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-06-02 13:02:35 +0200 |
commit | e13929b7f13a9f5de4e35fad6ce0029f340ede6d (patch) | |
tree | d44f1b161f6dc3a81420abd9b9463a620d87d19c /engines/wintermute | |
parent | c97705cedf2a3b7a74219d2e668bd3a80233dbbe (diff) | |
download | scummvm-rg350-e13929b7f13a9f5de4e35fad6ce0029f340ede6d.tar.gz scummvm-rg350-e13929b7f13a9f5de4e35fad6ce0029f340ede6d.tar.bz2 scummvm-rg350-e13929b7f13a9f5de4e35fad6ce0029f340ede6d.zip |
WINTERMUTE: Fix another bunch of warnings
Mostly SAFE_DELETE-macro removal
Diffstat (limited to 'engines/wintermute')
-rw-r--r-- | engines/wintermute/AdEntity.cpp | 44 | ||||
-rw-r--r-- | engines/wintermute/AdGame.cpp | 6 | ||||
-rw-r--r-- | engines/wintermute/AdInventoryBox.cpp | 10 | ||||
-rw-r--r-- | engines/wintermute/AdItem.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/AdObject.cpp | 42 | ||||
-rw-r--r-- | engines/wintermute/AdResponseBox.cpp | 22 | ||||
-rw-r--r-- | engines/wintermute/AdSceneState.cpp | 5 | ||||
-rw-r--r-- | engines/wintermute/BDiskFile.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/BFontBitmap.cpp | 5 | ||||
-rw-r--r-- | engines/wintermute/BFontTT.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/BFrame.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/BGame.cpp | 4 | ||||
-rw-r--r-- | engines/wintermute/BPkgFile.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/BRegistry.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/BRegistry.h | 2 | ||||
-rw-r--r-- | engines/wintermute/BResourceFile.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/BSprite.cpp | 5 | ||||
-rw-r--r-- | engines/wintermute/PartEmitter.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/PlatformSDL.cpp | 2 |
19 files changed, 110 insertions, 62 deletions
diff --git a/engines/wintermute/AdEntity.cpp b/engines/wintermute/AdEntity.cpp index 0a78cfab98..a472107c90 100644 --- a/engines/wintermute/AdEntity.cpp +++ b/engines/wintermute/AdEntity.cpp @@ -220,7 +220,8 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_SPRITE: {
- SAFE_DELETE(_sprite);
+ delete _sprite;
+ _sprite = NULL;
spr = new CBSprite(Game, this);
if (!spr || FAILED(spr->LoadFile((char *)params))) cmd = PARSERR_GENERIC;
else _sprite = spr;
@@ -297,10 +298,11 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_CURSOR:
- SAFE_DELETE(_cursor);
+ delete _cursor;
_cursor = new CBSprite(Game);
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
- SAFE_DELETE(_cursor);
+ delete _cursor;
+ _cursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
@@ -322,13 +324,17 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_BLOCKED_REGION: {
- SAFE_DELETE(_blockRegion);
- SAFE_DELETE(_currentBlockRegion);
+ delete _blockRegion;
+ _blockRegion = NULL;
+ delete _currentBlockRegion;
+ _currentBlockRegion = NULL;
CBRegion *rgn = new CBRegion(Game);
CBRegion *crgn = new CBRegion(Game);
if (!rgn || !crgn || FAILED(rgn->LoadBuffer(params, false))) {
- SAFE_DELETE(_blockRegion);
- SAFE_DELETE(_currentBlockRegion);
+ delete _blockRegion;
+ _blockRegion = NULL;
+ delete _currentBlockRegion;
+ _currentBlockRegion = NULL;
cmd = PARSERR_GENERIC;
} else {
_blockRegion = rgn;
@@ -339,13 +345,17 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_WAYPOINTS: {
- SAFE_DELETE(_wptGroup);
- SAFE_DELETE(_currentWptGroup);
+ delete _wptGroup;
+ _wptGroup = NULL;
+ delete _currentWptGroup;
+ _currentWptGroup = NULL;
CAdWaypointGroup *wpt = new CAdWaypointGroup(Game);
CAdWaypointGroup *cwpt = new CAdWaypointGroup(Game);
if (!wpt || !cwpt || FAILED(wpt->LoadBuffer(params, false))) {
- SAFE_DELETE(_wptGroup);
- SAFE_DELETE(_currentWptGroup);
+ delete _wptGroup;
+ _wptGroup = NULL;
+ delete _currentWptGroup;
+ _currentWptGroup = NULL;
cmd = PARSERR_GENERIC;
} else {
_wptGroup = wpt;
@@ -361,7 +371,8 @@ HRESULT CAdEntity::LoadBuffer(byte *Buffer, bool Complete) { case TOKEN_SUBTYPE: {
if (scumm_stricmp((char *)params, "sound") == 0) {
- SAFE_DELETE(_sprite);
+ delete _sprite;
+ _sprite = NULL;
if (Game->_editorMode) {
spr = new CBSprite(Game, this);
if (!spr || FAILED(spr->LoadFile("entity_sound.sprite"))) cmd = PARSERR_GENERIC;
@@ -514,7 +525,8 @@ HRESULT CAdEntity::Update() { _currentSprite = NULL;
if (_state == STATE_READY && _animSprite) {
- SAFE_DELETE(_animSprite);
+ delete _animSprite;
+ _animSprite = NULL;
}
// finished playing animation?
@@ -946,10 +958,12 @@ HRESULT CAdEntity::SetSprite(const char *Filename) { SetCurrent = true;
}
- SAFE_DELETE(_sprite);
+ delete _sprite;
+ _sprite = NULL;
CBSprite *spr = new CBSprite(Game, this);
if (!spr || FAILED(spr->LoadFile(Filename))) {
- SAFE_DELETE(_sprite);
+ delete _sprite;
+ _sprite = NULL;
return E_FAIL;
} else {
_sprite = spr;
diff --git a/engines/wintermute/AdGame.cpp b/engines/wintermute/AdGame.cpp index fc1435d1cb..e2d790e87e 100644 --- a/engines/wintermute/AdGame.cpp +++ b/engines/wintermute/AdGame.cpp @@ -196,7 +196,8 @@ HRESULT CAdGame::Cleanup() { HRESULT CAdGame::InitLoop() {
if (_scheduledScene && _transMgr->IsReady()) {
ChangeScene(_scheduledScene, _scheduledFadeIn);
- SAFE_DELETE_ARRAY(_scheduledScene);
+ delete[] _scheduledScene;
+ _scheduledScene = NULL;
Game->_activeObject = NULL;
}
@@ -705,7 +706,8 @@ HRESULT CAdGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This RegisterObject(_responseBox);
Stack->PushBool(true);
} else {
- SAFE_DELETE(_responseBox);
+ delete _responseBox;
+ _responseBox = NULL;
Stack->PushBool(false);
}
return S_OK;
diff --git a/engines/wintermute/AdInventoryBox.cpp b/engines/wintermute/AdInventoryBox.cpp index c89fd5215f..a5d1b117c6 100644 --- a/engines/wintermute/AdInventoryBox.cpp +++ b/engines/wintermute/AdInventoryBox.cpp @@ -69,7 +69,8 @@ CAdInventoryBox::~CAdInventoryBox() { Game->UnregisterObject(_window);
_window = NULL;
- SAFE_DELETE(_closeButton);
+ delete _closeButton;
+ _closeButton = NULL;
}
@@ -237,10 +238,11 @@ HRESULT CAdInventoryBox::LoadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_WINDOW:
- SAFE_DELETE(_window);
+ delete _window;
_window = new CUIWindow(Game);
if (!_window || FAILED(_window->LoadBuffer(params, false))) {
- SAFE_DELETE(_window);
+ delete _window;
+ _window = NULL;
cmd = PARSERR_GENERIC;
} else Game->RegisterObject(_window);
break;
@@ -292,7 +294,7 @@ HRESULT CAdInventoryBox::LoadBuffer(byte *Buffer, bool Complete) { }
if (_exclusive) {
- SAFE_DELETE(_closeButton);
+ delete _closeButton;
_closeButton = new CUIButton(Game);
if (_closeButton) {
_closeButton->SetName("close");
diff --git a/engines/wintermute/AdItem.cpp b/engines/wintermute/AdItem.cpp index b360f97e1d..3b78fa5507 100644 --- a/engines/wintermute/AdItem.cpp +++ b/engines/wintermute/AdItem.cpp @@ -700,8 +700,12 @@ HRESULT CAdItem::ScSetProperty(const char *Name, CScValue *Value) { // AmountString
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "AmountString") == 0) {
- if (Value->IsNULL()) SAFE_DELETE_ARRAY(_amountString);
- else CBUtils::SetString(&_amountString, Value->GetString());
+ if (Value->IsNULL()) {
+ delete[] _amountString;
+ _amountString = NULL;
+ } else {
+ CBUtils::SetString(&_amountString, Value->GetString());
+ }
return S_OK;
}
diff --git a/engines/wintermute/AdObject.cpp b/engines/wintermute/AdObject.cpp index 4351e0953c..122a4bdbb6 100644 --- a/engines/wintermute/AdObject.cpp +++ b/engines/wintermute/AdObject.cpp @@ -107,16 +107,22 @@ CAdObject::CAdObject(CBGame *inGame): CBObject(inGame) { //////////////////////////////////////////////////////////////////////////
CAdObject::~CAdObject() {
_currentSprite = NULL; // reference only, don't delete
- SAFE_DELETE(_animSprite);
- SAFE_DELETE(_sentence);
- SAFE_DELETE_ARRAY(_forcedTalkAnimName);
-
- SAFE_DELETE(_blockRegion);
- SAFE_DELETE(_wptGroup);
+ delete _animSprite;
+ _animSprite = NULL;
+ delete _sentence;
+ _sentence = NULL;
+ delete[] _forcedTalkAnimName;
+ _forcedTalkAnimName = NULL;
- SAFE_DELETE(_currentBlockRegion);
- SAFE_DELETE(_currentWptGroup);
+ delete _blockRegion;
+ _blockRegion = NULL;
+ delete _wptGroup;
+ _wptGroup = NULL;
+ delete _currentBlockRegion;
+ _currentBlockRegion = NULL;
+ delete _currentWptGroup;
+ _currentWptGroup = NULL;
_tempSprite2 = NULL; // reference only
_stickRegion = NULL;
@@ -146,7 +152,8 @@ CAdObject::~CAdObject() { //////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::PlayAnim(const char *Filename) {
- SAFE_DELETE(_animSprite);
+ delete _animSprite;
+ _animSprite = NULL;
_animSprite = new CBSprite(Game, this);
if (!_animSprite) {
Game->LOG(0, "CAdObject::PlayAnim: error creating temp sprite (object:\"%s\" sprite:\"%s\")", _name, Filename);
@@ -155,7 +162,8 @@ HRESULT CAdObject::PlayAnim(const char *Filename) { HRESULT res = _animSprite->LoadFile(Filename);
if (FAILED(res)) {
Game->LOG(res, "CAdObject::PlayAnim: error loading temp sprite (object:\"%s\" sprite:\"%s\")", _name, Filename);
- SAFE_DELETE(_animSprite);
+ delete _animSprite;
+ _animSprite = NULL;
return res;
}
_state = STATE_PLAYING_ANIM;
@@ -233,7 +241,7 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th else if (strcmp(Name, "ForceTalkAnim") == 0) {
Stack->CorrectParams(1);
const char *AnimName = Stack->Pop()->GetString();
- SAFE_DELETE_ARRAY(_forcedTalkAnimName);
+ delete[] _forcedTalkAnimName;
_forcedTalkAnimName = new char[strlen(AnimName) + 1];
strcpy(_forcedTalkAnimName, AnimName);
_forcedTalkAnimUsed = false;
@@ -483,7 +491,8 @@ HRESULT CAdObject::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th HRESULT res;
CAdEntity *Ent = new CAdEntity(Game);
if (FAILED(res = Ent->LoadFile(Filename))) {
- SAFE_DELETE(Ent);
+ delete Ent;
+ Ent = NULL;
Script->RuntimeError("AddAttachment() failed loading entity '%s'", Filename);
Stack->PushBool(false);
} else {
@@ -820,11 +829,13 @@ void CAdObject::Talk(const char *Text, const char *Sound, uint32 Duration, const if (!_sentence) return;
if (_forcedTalkAnimName && _forcedTalkAnimUsed) {
- SAFE_DELETE_ARRAY(_forcedTalkAnimName);
+ delete[] _forcedTalkAnimName;
+ _forcedTalkAnimName = NULL;
_forcedTalkAnimUsed = false;
}
- SAFE_DELETE(_sentence->_sound);
+ delete (_sentence->_sound);
+ _sentence->_sound = NULL;
_sentence->SetText(Text);
Game->_stringTable->Expand(&_sentence->_text);
@@ -927,7 +938,8 @@ void CAdObject::Talk(const char *Text, const char *Sound, uint32 Duration, const //////////////////////////////////////////////////////////////////////////
HRESULT CAdObject::Reset() {
if (_state == STATE_PLAYING_ANIM && _animSprite != NULL) {
- SAFE_DELETE(_animSprite);
+ delete _animSprite;
+ _animSprite = NULL;
} else if (_state == STATE_TALKING && _sentence) {
_sentence->Finish();
}
diff --git a/engines/wintermute/AdResponseBox.cpp b/engines/wintermute/AdResponseBox.cpp index cd8f950393..2ded9d3fa7 100644 --- a/engines/wintermute/AdResponseBox.cpp +++ b/engines/wintermute/AdResponseBox.cpp @@ -73,10 +73,14 @@ CAdResponseBox::CAdResponseBox(CBGame *inGame): CBObject(inGame) { //////////////////////////////////////////////////////////////////////////
CAdResponseBox::~CAdResponseBox() {
- SAFE_DELETE(_window);
- SAFE_DELETE(_shieldWindow);
- SAFE_DELETE_ARRAY(_lastResponseText);
- SAFE_DELETE_ARRAY(_lastResponseTextOrig);
+ delete _window;
+ _window = NULL;
+ delete _shieldWindow;
+ _shieldWindow = NULL;
+ delete[] _lastResponseText;
+ _lastResponseText = NULL;
+ delete[] _lastResponseTextOrig;
+ _lastResponseTextOrig = NULL;
if (_font) Game->_fontStorage->RemoveFont(_font);
if (_fontHover) Game->_fontStorage->RemoveFont(_fontHover);
@@ -255,10 +259,11 @@ HRESULT CAdResponseBox::LoadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_WINDOW:
- SAFE_DELETE(_window);
+ delete _window;
_window = new CUIWindow(Game);
if (!_window || FAILED(_window->LoadBuffer(params, false))) {
- SAFE_DELETE(_window);
+ delete _window;
+ _window = NULL;
cmd = PARSERR_GENERIC;
} else if (_shieldWindow) _shieldWindow->_parent = _window;
break;
@@ -304,10 +309,11 @@ HRESULT CAdResponseBox::LoadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_CURSOR:
- SAFE_DELETE(_cursor);
+ delete _cursor;
_cursor = new CBSprite(Game);
if (!_cursor || FAILED(_cursor->LoadFile((char *)params))) {
- SAFE_DELETE(_cursor);
+ delete _cursor;
+ _cursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
diff --git a/engines/wintermute/AdSceneState.cpp b/engines/wintermute/AdSceneState.cpp index 00fd826d6a..2404178b09 100644 --- a/engines/wintermute/AdSceneState.cpp +++ b/engines/wintermute/AdSceneState.cpp @@ -45,7 +45,8 @@ CAdSceneState::CAdSceneState(CBGame *inGame): CBBase(inGame) { //////////////////////////////////////////////////////////////////////////
CAdSceneState::~CAdSceneState() {
- SAFE_DELETE_ARRAY(_filename);
+ delete[] _filename;
+ _filename = NULL;
for (int i = 0; i < _nodeStates.GetSize(); i++) delete _nodeStates[i];
_nodeStates.RemoveAll();
@@ -63,7 +64,7 @@ HRESULT CAdSceneState::Persist(CBPersistMgr *PersistMgr) { //////////////////////////////////////////////////////////////////////////
void CAdSceneState::SetFilename(const char *Filename) {
- SAFE_DELETE_ARRAY(_filename);
+ delete[] _filename;
_filename = new char [strlen(Filename) + 1];
if (_filename) strcpy(_filename, Filename);
}
diff --git a/engines/wintermute/BDiskFile.cpp b/engines/wintermute/BDiskFile.cpp index b456083058..a2ec38a57e 100644 --- a/engines/wintermute/BDiskFile.cpp +++ b/engines/wintermute/BDiskFile.cpp @@ -180,7 +180,7 @@ HRESULT CBDiskFile::Read(void *Buffer, uint32 Size) { //////////////////////////////////////////////////////////////////////////
HRESULT CBDiskFile::Seek(uint32 Pos, TSeek Origin) {
if (_compressed) {
- uint32 NewPos = 0;
+ int32 NewPos = 0;
switch (Origin) {
case SEEK_TO_BEGIN:
diff --git a/engines/wintermute/BFontBitmap.cpp b/engines/wintermute/BFontBitmap.cpp index 46e66ae84c..94edf9292a 100644 --- a/engines/wintermute/BFontBitmap.cpp +++ b/engines/wintermute/BFontBitmap.cpp @@ -401,7 +401,10 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) { if (sprite_file != NULL) {
delete _sprite;
_sprite = new CBSprite(Game, this);
- if (!_sprite || FAILED(_sprite->LoadFile(sprite_file))) SAFE_DELETE(_sprite);
+ if (!_sprite || FAILED(_sprite->LoadFile(sprite_file))) {
+ delete _sprite;
+ _sprite = NULL;
+ }
}
if (surface_file != NULL && !_sprite) {
diff --git a/engines/wintermute/BFontTT.cpp b/engines/wintermute/BFontTT.cpp index d27985a62e..94fdd81d0a 100644 --- a/engines/wintermute/BFontTT.cpp +++ b/engines/wintermute/BFontTT.cpp @@ -813,7 +813,8 @@ void CBFontTT::MeasureText(const WideString &text, int maxWidth, int maxHeight, for (it = lines.begin(); it != lines.end(); ++it) {
TextLine *line = (*it);
textWidth = MAX(textWidth, line->GetWidth());
- SAFE_DELETE(line);
+ delete line;
+ line = NULL;
}
}
diff --git a/engines/wintermute/BFrame.cpp b/engines/wintermute/BFrame.cpp index 8f52f90dc3..7d0fe61fd4 100644 --- a/engines/wintermute/BFrame.cpp +++ b/engines/wintermute/BFrame.cpp @@ -68,7 +68,8 @@ CBFrame::~CBFrame() { _subframes.RemoveAll();
for (i = 0; i < _applyEvent.GetSize(); i++) {
- SAFE_DELETE_ARRAY(_applyEvent[i]);
+ delete[] _applyEvent[i];
+ _applyEvent[i] = NULL;
}
_applyEvent.RemoveAll();
}
diff --git a/engines/wintermute/BGame.cpp b/engines/wintermute/BGame.cpp index a447b7a0f8..6758d2e71e 100644 --- a/engines/wintermute/BGame.cpp +++ b/engines/wintermute/BGame.cpp @@ -3458,7 +3458,7 @@ HRESULT CBGame::LoadSettings(const char *Filename) { while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)¶ms)) > 0) {
switch (cmd) {
case TOKEN_GAME:
- SAFE_DELETE_ARRAY(_settingsGameFile);
+ delete[] _settingsGameFile;
_settingsGameFile = new char[strlen((char *)params) + 1];
if (_settingsGameFile) strcpy(_settingsGameFile, (char *)params);
break;
@@ -4012,7 +4012,7 @@ HRESULT CBGame::DisplayIndicator() { else _saveLoadImage->DisplayTrans(_saveImageX, _saveImageY, rc);
}
- if (!_indicatorDisplay && _indicatorWidth <= 0 || _indicatorHeight <= 0) return S_OK;
+ if ((!_indicatorDisplay && _indicatorWidth <= 0) || _indicatorHeight <= 0) return S_OK;
_renderer->SetupLines();
for (int i = 0; i < _indicatorHeight; i++)
_renderer->DrawLine(_indicatorX, _indicatorY + i, _indicatorX + (int)(_indicatorWidth * (float)((float)_indicatorProgress / 100.0f)), _indicatorY + i, _indicatorColor);
diff --git a/engines/wintermute/BPkgFile.cpp b/engines/wintermute/BPkgFile.cpp index f336574c0c..055748b520 100644 --- a/engines/wintermute/BPkgFile.cpp +++ b/engines/wintermute/BPkgFile.cpp @@ -128,7 +128,7 @@ HRESULT CBPkgFile::Read(void *Buffer, uint32 Size) { HRESULT CBPkgFile::Seek(uint32 Pos, TSeek Origin) {
if (!_fileEntry) return E_FAIL;
- uint32 NewPos = 0;
+ int32 NewPos = 0;
switch (Origin) {
case SEEK_TO_BEGIN:
diff --git a/engines/wintermute/BRegistry.cpp b/engines/wintermute/BRegistry.cpp index 0e9592ce56..74d524189a 100644 --- a/engines/wintermute/BRegistry.cpp +++ b/engines/wintermute/BRegistry.cpp @@ -116,7 +116,7 @@ bool CBRegistry::WriteBool(const AnsiString &subKey, const AnsiString &key, bool //////////////////////////////////////////////////////////////////////////
-void CBRegistry::SetIniName(char *Name) {
+void CBRegistry::SetIniName(const char *Name) {
delete[] _iniName;
_iniName = NULL;
diff --git a/engines/wintermute/BRegistry.h b/engines/wintermute/BRegistry.h index 99d25e88c3..bd4466989e 100644 --- a/engines/wintermute/BRegistry.h +++ b/engines/wintermute/BRegistry.h @@ -35,7 +35,7 @@ namespace WinterMute { class CBRegistry : public CBBase {
public:
- void SetIniName(char *Name);
+ void SetIniName(const char *Name);
char *GetIniName();
bool WriteBool(const AnsiString &subKey, const AnsiString &key, bool Value);
bool ReadBool(const AnsiString &subKey, const AnsiString &key, bool init = false);
diff --git a/engines/wintermute/BResourceFile.cpp b/engines/wintermute/BResourceFile.cpp index c6de083d9c..d7eb470ca2 100644 --- a/engines/wintermute/BResourceFile.cpp +++ b/engines/wintermute/BResourceFile.cpp @@ -80,7 +80,7 @@ HRESULT CBResourceFile::Read(void *Buffer, uint32 Size) { HRESULT CBResourceFile::Seek(uint32 Pos, TSeek Origin) {
if (!_data) return E_FAIL;
- uint32 NewPos = 0;
+ int32 NewPos = 0;
switch (Origin) {
case SEEK_TO_BEGIN:
diff --git a/engines/wintermute/BSprite.cpp b/engines/wintermute/BSprite.cpp index 06bf9a4d6a..2ecaf1831c 100644 --- a/engines/wintermute/BSprite.cpp +++ b/engines/wintermute/BSprite.cpp @@ -94,7 +94,8 @@ void CBSprite::Cleanup() { delete _frames[i];
_frames.RemoveAll();
- SAFE_DELETE_ARRAY(_editorBgFile);
+ delete[] _editorBgFile;
+ _editorBgFile = NULL;
SetDefaults();
}
@@ -262,7 +263,7 @@ HRESULT CBSprite::LoadBuffer(byte *Buffer, bool Complete, int LifeTime, TSprite case TOKEN_EDITOR_BG_FILE:
if (Game->_editorMode) {
- SAFE_DELETE_ARRAY(_editorBgFile);
+ delete[] _editorBgFile;
_editorBgFile = new char[strlen((char *)params) + 1];
if (_editorBgFile) strcpy(_editorBgFile, (char *)params);
}
diff --git a/engines/wintermute/PartEmitter.cpp b/engines/wintermute/PartEmitter.cpp index efd167a137..c0e03c25d0 100644 --- a/engines/wintermute/PartEmitter.cpp +++ b/engines/wintermute/PartEmitter.cpp @@ -1078,7 +1078,8 @@ HRESULT CPartEmitter::ScSetProperty(const char *Name, CScValue *Value) { // EmitEvent
//////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "EmitEvent") == 0) {
- SAFE_DELETE_ARRAY(_emitEvent);
+ delete[] _emitEvent;
+ _emitEvent = NULL;
if (!Value->IsNULL()) CBUtils::SetString(&_emitEvent, Value->GetString());
return S_OK;
}
diff --git a/engines/wintermute/PlatformSDL.cpp b/engines/wintermute/PlatformSDL.cpp index 3335bd3155..2446cb210f 100644 --- a/engines/wintermute/PlatformSDL.cpp +++ b/engines/wintermute/PlatformSDL.cpp @@ -92,7 +92,7 @@ int CBPlatform::Initialize(CBGame *inGame, int argc, char *argv[]) { Game->_smartCache = false;
}
- bool AllowDirectDraw = Game->_registry->ReadBool("Debug", "AllowDirectDraw", false);
+/* bool AllowDirectDraw = Game->_registry->ReadBool("Debug", "AllowDirectDraw", false);*/
// load general game settings
Game->Initialize1();
|