diff options
author | Eugene Sandulenko | 2006-01-29 02:27:10 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-01-29 02:27:10 +0000 |
commit | 4780ab9223293243fdeadbda490eeea25aba2072 (patch) | |
tree | 9cbf33b790e67b8ca89cd59195f183075e7767cd /gob/map.cpp | |
parent | bdac3715992d457e30eb3874ac47a60e4632acb7 (diff) | |
download | scummvm-rg350-4780ab9223293243fdeadbda490eeea25aba2072.tar.gz scummvm-rg350-4780ab9223293243fdeadbda490eeea25aba2072.tar.bz2 scummvm-rg350-4780ab9223293243fdeadbda490eeea25aba2072.zip |
Patch #1417631: "gobliiins cleanup". Thanks, wjp.
svn-id: r20283
Diffstat (limited to 'gob/map.cpp')
-rw-r--r-- | gob/map.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gob/map.cpp b/gob/map.cpp index d564c0fab9..9c6668ad9d 100644 --- a/gob/map.cpp +++ b/gob/map.cpp @@ -512,7 +512,7 @@ void Map::loadMapObjects(char *avjFile) { _vm->_goblin->_gobsCount = loadFromAvo_LE_UINT16(); for (i = 0; i < _vm->_goblin->_gobsCount; i++) { - _vm->_goblin->_goblins[i] = (Goblin::Gob_Object *)malloc(sizeof(Goblin::Gob_Object)); + _vm->_goblin->_goblins[i] = new Goblin::Gob_Object; _vm->_goblin->_goblins[i]->xPos = READ_LE_UINT16(savedPtr2); savedPtr2 += 2; @@ -620,8 +620,7 @@ void Map::loadMapObjects(char *avjFile) { _vm->_goblin->_objCount = loadFromAvo_LE_UINT16(); for (i = 0; i < _vm->_goblin->_objCount; i++) { - _vm->_goblin->_objects[i] = - (Goblin::Gob_Object *) malloc(sizeof(Goblin::Gob_Object)); + _vm->_goblin->_objects[i] = new Goblin::Gob_Object; _vm->_goblin->_objects[i]->xPos = READ_LE_UINT16(savedPtr3); savedPtr3 += 2; @@ -681,7 +680,7 @@ void Map::loadMapObjects(char *avjFile) { delete[] tempstatedata; } - _vm->_goblin->_objects[10] = (Goblin::Gob_Object *)malloc(sizeof(Goblin::Gob_Object)); + _vm->_goblin->_objects[10] = new Goblin::Gob_Object; memset(_vm->_goblin->_objects[10], 0, sizeof(Goblin::Gob_Object)); _vm->_goblin->_objects[10]->stateMach = new Goblin::Gob_StateLine[40]; @@ -728,7 +727,7 @@ void Map::loadMapObjects(char *avjFile) { strcpy(sndNames[i], buf); } - free(dataBuf); + delete[] dataBuf; _vm->_goblin->_soundData[14] = _vm->_snd->loadSoundData("diamant1.snd"); |