aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorNicola Mettifogo2007-03-04 08:58:23 +0000
committerNicola Mettifogo2007-03-04 08:58:23 +0000
commitc727205dae3df732413ce09339ab218c90ccd9ad (patch)
tree08c8eeddcef4745e98db54a45fee3382135a9b65 /engines/parallaction
parent8da557fbd55cd48a3420e36a2fc1626dfe0b80b0 (diff)
downloadscummvm-rg350-c727205dae3df732413ce09339ab218c90ccd9ad.tar.gz
scummvm-rg350-c727205dae3df732413ce09339ab218c90ccd9ad.tar.bz2
scummvm-rg350-c727205dae3df732413ce09339ab218c90ccd9ad.zip
replaced memAlloc/memFree with standard malloc/free
svn-id: r25962
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/animation.cpp18
-rw-r--r--engines/parallaction/commands.cpp8
-rw-r--r--engines/parallaction/debug.cpp10
-rw-r--r--engines/parallaction/defs.h2
-rw-r--r--engines/parallaction/dialogue.cpp16
-rw-r--r--engines/parallaction/graphics.cpp60
-rw-r--r--engines/parallaction/location.cpp12
-rw-r--r--engines/parallaction/menu.cpp4
-rw-r--r--engines/parallaction/parallaction.cpp10
-rw-r--r--engines/parallaction/parser.cpp2
-rw-r--r--engines/parallaction/walk.cpp14
-rw-r--r--engines/parallaction/zone.cpp48
12 files changed, 96 insertions, 108 deletions
diff --git a/engines/parallaction/animation.cpp b/engines/parallaction/animation.cpp
index 9bcacefc7a..45c479bcbf 100644
--- a/engines/parallaction/animation.cpp
+++ b/engines/parallaction/animation.cpp
@@ -77,10 +77,10 @@ Animation *findAnimation(const char *name) {
Animation *Parallaction::parseAnimation(Script& script, Node *list, char *name) {
// printf("parseAnimation(%s)\n", name);
- Animation *vD0 = (Animation*)memAlloc(sizeof(Animation));
+ Animation *vD0 = (Animation*)malloc(sizeof(Animation));
memset(vD0, 0, sizeof(Animation));
- vD0->_zone._label._text = (char*)memAlloc(strlen(name)+1);
+ vD0->_zone._label._text = (char*)malloc(strlen(name)+1);
strcpy(vD0->_zone._label._text, name);
addNode(list, &vD0->_zone._node);
@@ -159,7 +159,7 @@ void freeScript(Program *program) {
if (!program) return;
- memFree(program->_locals);
+ free(program->_locals);
freeNodeList(&program->_node);
return;
@@ -252,7 +252,7 @@ void Parallaction::loadProgram(Animation *a, char *filename) {
// printf("loadProgram(%s)\n", filename);
// the largest script in Nippon Safes is 3,668 bytes, so 4 kb is well enough
- char* src = (char*)memAlloc(0x1000);
+ char* src = (char*)malloc(0x1000);
loadScript(filename, src);
_numLocals = 0;
@@ -261,12 +261,12 @@ void Parallaction::loadProgram(Animation *a, char *filename) {
fillBuffers(*script);
- a->_program = (Program*)memAlloc(sizeof(Program));
+ a->_program = (Program*)malloc(sizeof(Program));
memset(a->_program, 0, sizeof(Program));
- a->_program->_locals = (LocalVariable*)memAlloc(sizeof(LocalVariable)*10);
+ a->_program->_locals = (LocalVariable*)malloc(sizeof(LocalVariable)*10);
Node *vD0 = &a->_program->_node;
- Instruction *vCC = (Instruction*)memAlloc(sizeof(Instruction));
+ Instruction *vCC = (Instruction*)malloc(sizeof(Instruction));
memset(vCC, 0, sizeof(Instruction));
while (scumm_stricmp(_tokens[0], "endscript")) {
@@ -275,7 +275,7 @@ void Parallaction::loadProgram(Animation *a, char *filename) {
addNode(vD0, &vCC->_node);
vD0 = &vCC->_node;
- vCC = (Instruction*)memAlloc(sizeof(Instruction));
+ vCC = (Instruction*)malloc(sizeof(Instruction));
memset(vCC, 0, sizeof(Instruction));
fillBuffers(*script);
}
@@ -284,7 +284,7 @@ void Parallaction::loadProgram(Animation *a, char *filename) {
addNode(vD0, &vCC->_node);
delete script;
- delete src;
+ free(src);
a->_program->_ip = (Instruction*)a->_program->_node._next;
diff --git a/engines/parallaction/commands.cpp b/engines/parallaction/commands.cpp
index 79c8fe586c..fd55034f0b 100644
--- a/engines/parallaction/commands.cpp
+++ b/engines/parallaction/commands.cpp
@@ -56,7 +56,7 @@ Command *parseCommands(Script &script) {
while (scumm_stricmp(_tokens[0], "ENDCOMMANDS") && scumm_stricmp(_tokens[0], "ENDZONE")) {
// printf("token[0] = %s", _tokens[0]);
- Command *cmd = (Command*)memAlloc(sizeof(Command));
+ Command *cmd = (Command*)malloc(sizeof(Command));
memset(cmd, 0, sizeof(Command));
cmd->_id = _vm->searchTable(_tokens[0], commands_names);
@@ -108,7 +108,7 @@ Command *parseCommands(Script &script) {
break;
case CMD_LOCATION: // location
- cmd->u._string = (char*)memAlloc(strlen(_tokens[_si])+1);
+ cmd->u._string = (char*)malloc(strlen(_tokens[_si])+1);
strcpy(cmd->u._string, _tokens[_si]);
_si++;
break;
@@ -200,8 +200,8 @@ void freeCommands(Command *list) {
while (cmd) {
Command *v4 = (Command*)cmd->_node._next;
- if (cmd->_id == 6) memFree(cmd->u._zone); // open
- memFree(cmd);
+ if (cmd->_id == 6) free(cmd->u._zone); // open
+ free(cmd);
cmd = v4;
}
diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp
index 02837b3bf9..0fe2c23c30 100644
--- a/engines/parallaction/debug.cpp
+++ b/engines/parallaction/debug.cpp
@@ -54,16 +54,6 @@ const char *_jobDescriptions[] = {
"21 - erase mouse"
};
-void *memAlloc(uint32 size) {
- return malloc(size);
-}
-
-void memFree(void *m) {
- free(m);
- return;
-}
-
-
void beep() {
// sound(1500);
// delay(100);
diff --git a/engines/parallaction/defs.h b/engines/parallaction/defs.h
index b475e3b170..f7ab9af1a4 100644
--- a/engines/parallaction/defs.h
+++ b/engines/parallaction/defs.h
@@ -92,8 +92,6 @@ struct Credit {
const char *_name;
};
-void *memAlloc(uint32 size);
-void memFree(void *m);
void errorFileNotFound(const char*);
void beep();
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index 276327a79c..6f506d947b 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -74,11 +74,11 @@ Dialogue *Parallaction::parseDialogue(Script &script) {
while (scumm_stricmp(_tokens[0], "enddialogue")) {
if (scumm_stricmp(_tokens[0], "Question")) continue;
- _questions[num_questions] = (Dialogue*)memAlloc(sizeof(Dialogue));
+ _questions[num_questions] = (Dialogue*)malloc(sizeof(Dialogue));
Dialogue *vB4 = _questions[num_questions];
memset(_questions[num_questions], 0, sizeof(Dialogue));
- _questions_names[num_questions] = (char*)memAlloc(strlen(_tokens[1])+1);
+ _questions_names[num_questions] = (char*)malloc(strlen(_tokens[1])+1);
strcpy(_questions_names[num_questions], _tokens[1]);
vB4->_text = parseDialogueString(script);
@@ -149,7 +149,7 @@ Dialogue *Parallaction::parseDialogue(Script &script) {
if (_questions[_si]->_answers[v5A] == 0) continue;
int16 v58 = _vm->searchTable(_questions[_si]->_following._names[v5A], const_cast<const char **>(_questions_names));
- memFree(_questions[_si]->_following._names[v5A]);
+ free(_questions[_si]->_following._names[v5A]);
if (v58 == -1) {
_questions[_si]->_following._questions[v5A] = 0;
@@ -166,7 +166,7 @@ Dialogue *Parallaction::parseDialogue(Script &script) {
}
for (uint16 _si = 0; _si < num_questions; _si++)
- memFree(_questions_names[_si]);
+ free(_questions_names[_si]);
return _questions[0];
}
@@ -188,7 +188,7 @@ char *Parallaction::parseDialogueString(Script &script) {
vD0[strlen(vD0)-1] = '\0'; // deletes the trailing '0xA' inserted by parseNextLine
// this is critical for Graphics::displayBalloonString to work properly
- char *vCC = (char*)memAlloc(strlen(vD0)+1);
+ char *vCC = (char*)malloc(strlen(vD0)+1);
strcpy(vCC, vD0);
return vCC;
@@ -207,11 +207,11 @@ void freeDialogue(Dialogue *d) {
for (_si = 0; _si < 5; _si++) {
freeCommands(d->_commands[_si]);
- memFree(d->_answers[_si]);
+ free(d->_answers[_si]);
}
- memFree(d->_text);
- memFree(d);
+ free(d->_text);
+ free(d);
return;
}
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index bbd92b9a0a..ef737779b3 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -919,7 +919,7 @@ void Graphics::makeCnvFromString(StaticCnv *cnv, char *text) {
// printf("%i x %i\n", cnv->_width, cnv->_height);
- cnv->_data0 = (byte*)memAlloc(cnv->_width * cnv->_height);
+ cnv->_data0 = (byte*)malloc(cnv->_width * cnv->_height);
for (uint16 i = 0; i < len; i++) {
byte c = mapChar(text[i]);
@@ -971,11 +971,11 @@ void Graphics::loadExternalCnv(const char *filename, Cnv *cnv) {
cnv->_width = stream.readByte();
cnv->_height = stream.readByte();
- cnv->_array = (byte**)memAlloc(cnv->_count * sizeof(byte*));
+ cnv->_array = (byte**)malloc(cnv->_count * sizeof(byte*));
uint16 size = cnv->_width*cnv->_height;
for (uint16 i = 0; i < cnv->_count; i++) {
- cnv->_array[i] = (byte*)memAlloc(size);
+ cnv->_array[i] = (byte*)malloc(size);
stream.read(cnv->_array[i], size);
}
@@ -1009,7 +1009,7 @@ void Graphics::loadExternalStaticCnv(const char *filename, StaticCnv *cnv) {
uint16 size = cnv->_width*cnv->_height;
- cnv->_data0 = (byte*)memAlloc(size);
+ cnv->_data0 = (byte*)malloc(size);
stream.read(cnv->_data0, size);
stream.close();
@@ -1038,16 +1038,16 @@ void Graphics::loadStaticCnv(const char *filename, StaticCnv *cnv) {
cnv->_height = _vm->_archive.readByte();
uint16 compressedsize = _vm->_archive.size() - 3;
- byte *compressed = (byte*)memAlloc(compressedsize);
+ byte *compressed = (byte*)malloc(compressedsize);
uint16 size = cnv->_width*cnv->_height;
- cnv->_data0 = (byte*)memAlloc(size);
+ cnv->_data0 = (byte*)malloc(size);
_vm->_archive.read(compressed, compressedsize);
_vm->_archive.closeArchivedFile();
decompressChunk(compressed, cnv->_data0, size);
- memFree(compressed);
+ free(compressed);
return;
}
@@ -1073,17 +1073,17 @@ void Graphics::loadCnv(const char *filename, Cnv *cnv) {
uint16 framesize = cnv->_width*cnv->_height;
- cnv->_array = (byte**)memAlloc(cnv->_count * sizeof(byte*));
+ cnv->_array = (byte**)malloc(cnv->_count * sizeof(byte*));
uint32 size = _vm->_archive.size() - 3;
- byte *buf = (byte*)memAlloc(size);
+ byte *buf = (byte*)malloc(size);
_vm->_archive.read(buf, size);
byte *s = buf;
for (uint16 i = 0; i < cnv->_count; i++) {
- cnv->_array[i] = (byte*)memAlloc(framesize);
+ cnv->_array[i] = (byte*)malloc(framesize);
uint16 read = decompressChunk(s, cnv->_array[i], framesize);
// printf("frame %i decompressed: %i --> %i\n", i, read, framesize);
@@ -1093,7 +1093,7 @@ void Graphics::loadCnv(const char *filename, Cnv *cnv) {
_vm->_archive.closeArchivedFile();
- memFree(buf);
+ free(buf);
return;
}
@@ -1110,9 +1110,9 @@ void Graphics::freeCnv(Cnv *cnv) {
if (!cnv) return;
for (uint16 _si = 0; _si < cnv->_count; _si++) {
- memFree(cnv->_array[_si]);
+ free(cnv->_array[_si]);
}
- memFree(cnv->_array);
+ free(cnv->_array);
cnv->_array = NULL;
return;
@@ -1126,7 +1126,7 @@ void Graphics::freeStaticCnv(StaticCnv *cnv) {
if (!cnv) return;
if (!cnv || !cnv->_data0) return;
- memFree(cnv->_data0);
+ free(cnv->_data0);
cnv->_data0 = NULL;
return;
@@ -1215,7 +1215,7 @@ void Graphics::loadBackground(const char *filename, Graphics::Buffers buffer) {
memset(_buffers[kPath0], 0, SCREENPATH_WIDTH*SCREEN_HEIGHT);
memset(_buffers[kMask0], 0, SCREENMASK_WIDTH*SCREEN_HEIGHT);
- byte *v4 = (byte*)memAlloc(SCREEN_SIZE);
+ byte *v4 = (byte*)malloc(SCREEN_SIZE);
_vm->_archive.read(v4, SCREEN_SIZE);
byte v144[SCREEN_WIDTH];
@@ -1226,7 +1226,7 @@ void Graphics::loadBackground(const char *filename, Graphics::Buffers buffer) {
unpackBackgroundScanline(v144, _buffers[buffer]+SCREEN_WIDTH*i, _buffers[kMask0]+SCREENMASK_WIDTH*i, _buffers[kPath0]+SCREENPATH_WIDTH*i);
}
- memFree(v4);
+ free(v4);
_vm->_archive.closeArchivedFile();
return;
@@ -1357,16 +1357,16 @@ int16 Graphics::queryMask(int16 v) {
void Graphics::initBuffers() {
- _buffers[kBitFront] = (byte*)memAlloc(SCREEN_SIZE);
- _buffers[kBitBack] = (byte*)memAlloc(SCREEN_SIZE);
- _buffers[kBit2] = (byte*)memAlloc(SCREEN_SIZE);
- _buffers[kBit3] = (byte*)memAlloc(SCREEN_SIZE); // this buffer is also used by menu so it must stay this size
+ _buffers[kBitFront] = (byte*)malloc(SCREEN_SIZE);
+ _buffers[kBitBack] = (byte*)malloc(SCREEN_SIZE);
+ _buffers[kBit2] = (byte*)malloc(SCREEN_SIZE);
+ _buffers[kBit3] = (byte*)malloc(SCREEN_SIZE); // this buffer is also used by menu so it must stay this size
- _buffers[kMask0] = (byte*)memAlloc(SCREENMASK_WIDTH * SCREEN_HEIGHT);
- _buffers[kPath0] = (byte*)memAlloc(SCREENPATH_WIDTH * SCREEN_HEIGHT);
+ _buffers[kMask0] = (byte*)malloc(SCREENMASK_WIDTH * SCREEN_HEIGHT);
+ _buffers[kPath0] = (byte*)malloc(SCREENPATH_WIDTH * SCREEN_HEIGHT);
- _maskBackup = (byte*)memAlloc(SCREENMASK_WIDTH * SCREEN_HEIGHT);
- _pathBackup = (byte*)memAlloc(SCREENPATH_WIDTH * SCREEN_HEIGHT);
+ _maskBackup = (byte*)malloc(SCREENMASK_WIDTH * SCREEN_HEIGHT);
+ _pathBackup = (byte*)malloc(SCREENPATH_WIDTH * SCREEN_HEIGHT);
return;
}
@@ -1396,13 +1396,13 @@ Graphics::Graphics(Parallaction* vm) :
Graphics::~Graphics() {
- memFree(_buffers[kMask0]);
- memFree(_buffers[kPath0]);
+ free(_buffers[kMask0]);
+ free(_buffers[kPath0]);
- memFree(_buffers[kBitFront]);
- memFree(_buffers[kBitBack]);
- memFree(_buffers[kBit2]);
- memFree(_buffers[kBit3]);
+ free(_buffers[kBitFront]);
+ free(_buffers[kBitBack]);
+ free(_buffers[kBit2]);
+ free(_buffers[kBit3]);
freeCnv(&_font);
diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp
index 597cd0cff0..4994b4424f 100644
--- a/engines/parallaction/location.cpp
+++ b/engines/parallaction/location.cpp
@@ -47,7 +47,7 @@ void Parallaction::parseLocation(const char *filename) {
_vm->_graphics->_proportionalFont = false;
_vm->_graphics->setFont("topaz");
- location_src = (char*)memAlloc(0x4000);
+ location_src = (char*)malloc(0x4000);
loadLocation(filename, location_src);
_locationScript = new Script(location_src);
@@ -112,7 +112,7 @@ void Parallaction::parseLocation(const char *filename) {
if (!scumm_stricmp(_tokens[0], "LOCALFLAGS")) {
_si = 1; // _localFlagNames[0] = 'visited'
while (_tokens[_si][0] != '\0') {
- _localFlagNames[_si] = (char*)memAlloc(strlen(_tokens[_si])+1);
+ _localFlagNames[_si] = (char*)malloc(strlen(_tokens[_si])+1);
strcpy(_localFlagNames[_si], _tokens[_si]);
_si++;
}
@@ -166,7 +166,7 @@ void Parallaction::parseLocation(const char *filename) {
delete _locationScript;
_locationScript = NULL;
- memFree(location_src);
+ free(location_src);
return;
}
@@ -190,7 +190,7 @@ void freeLocation() {
uint16 _si = 1;
while (_localFlagNames[_si] != 0) {
- memFree(_localFlagNames[_si]);
+ free(_localFlagNames[_si]);
_localFlagNames[_si] = NULL;
_si++;
}
@@ -215,7 +215,7 @@ void freeLocation() {
debugC(7, kDebugLocation, "freeLocation: animations freed");
if (_locationComment) {
- memFree(_locationComment);
+ free(_locationComment);
}
_locationComment = NULL;
debugC(7, kDebugLocation, "freeLocation: comments freed");
@@ -244,7 +244,7 @@ void parseWalkNodes(Script& script, Node *list) {
if (!scumm_stricmp(_tokens[0], "COORD")) {
- WalkNode *v4 = (WalkNode*)memAlloc(sizeof(WalkNode));
+ WalkNode *v4 = (WalkNode*)malloc(sizeof(WalkNode));
v4->_x = atoi(_tokens[1]) - _yourself._cnv._width/2;
v4->_y = atoi(_tokens[2]) - _yourself._cnv._height;
diff --git a/engines/parallaction/menu.cpp b/engines/parallaction/menu.cpp
index 65818ed681..e3b72f915d 100644
--- a/engines/parallaction/menu.cpp
+++ b/engines/parallaction/menu.cpp
@@ -305,7 +305,7 @@ void Menu::selectCharacter() {
StaticCnv v14;
- v14._data0 = (byte*)memAlloc(33);
+ v14._data0 = (byte*)malloc(33);
v14._data2 = v14._data0;
v14._width = BLOCK_WIDTH;
v14._height = BLOCK_HEIGHT;
@@ -413,7 +413,7 @@ void Menu::selectCharacter() {
_engineFlags |= kEngineChangeLocation;
_vm->_archive.close();
- memFree(v14._data0);
+ free(v14._data0);
refreshInventory(_vm->_characterName);
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index ed48a04221..b7048f15e7 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -897,7 +897,7 @@ void freeNodeList(Node *list) {
while (list) {
Node *v4 = list->_next;
- memFree(list);
+ free(list);
list = v4;
}
@@ -936,7 +936,7 @@ void removeNode(Node *n) {
Job *addJob(JobFn fn, void *parm, uint16 tag) {
// printf("addJob(%i)\n", tag);
- Job *v8 = (Job*)memAlloc(sizeof(Job));
+ Job *v8 = (Job*)malloc(sizeof(Job));
v8->_parm = parm;
v8->_fn = fn;
@@ -958,7 +958,7 @@ void removeJob(Job *j) {
// printf("removeJob(%x, %i)\n", j, j->_tag);
removeNode(&j->_node);
- memFree(j);
+ free(j);
return;
}
@@ -1030,7 +1030,7 @@ void Parallaction::initTable(const char *path, char** table) {
while (scumm_stricmp(_tokens[0], "ENDTABLE")) {
- table[count] = (char*)memAlloc(strlen(_tokens[0])+1);
+ table[count] = (char*)malloc(strlen(_tokens[0])+1);
strcpy(table[count], _tokens[0]);
count++;
@@ -1051,7 +1051,7 @@ void Parallaction::freeTable(char** table) {
while (table[count]) {
- memFree(table[count]);
+ free(table[count]);
table[count] = NULL;
count++;
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp
index f8c9d3293a..c41452481a 100644
--- a/engines/parallaction/parser.cpp
+++ b/engines/parallaction/parser.cpp
@@ -95,7 +95,7 @@ char *Parallaction::parseComment(Script &script) {
strcat(_tmp_comment, " ");
} while (true);
- v194 = (char*)memAlloc(strlen(_tmp_comment)+1);
+ v194 = (char*)malloc(strlen(_tmp_comment)+1);
strcpy(v194, _tmp_comment);
_tmp_comment[0] = '\0';
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp
index 00e61dd9d2..ca313c3a20 100644
--- a/engines/parallaction/walk.cpp
+++ b/engines/parallaction/walk.cpp
@@ -109,8 +109,8 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) {
}
debugC(1, kDebugWalk, "found closest path point at (%i, %i)", to_x, to_y);
- WalkNode *v48 = (WalkNode*)memAlloc(sizeof(WalkNode));
- WalkNode *v44 = (WalkNode*)memAlloc(sizeof(WalkNode));
+ WalkNode *v48 = (WalkNode*)malloc(sizeof(WalkNode));
+ WalkNode *v44 = (WalkNode*)malloc(sizeof(WalkNode));
v48->_x = to_x - _yourself._cnv._width / 2; // target top left coordinates
v48->_y = to_y - _yourself._cnv._height;
@@ -121,7 +121,7 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) {
if (v38 == 1) {
// destination directly reachable
debugC(1, kDebugWalk, "direct move to (%i, %i)", to_x, to_y);
- memFree(v44);
+ free(v44);
return v48;
}
@@ -184,7 +184,7 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) {
if (_closest_node_found == 0) break;
- WalkNode *_newnode = (WalkNode*)memAlloc(sizeof(WalkNode));
+ WalkNode *_newnode = (WalkNode*)malloc(sizeof(WalkNode));
memcpy( _newnode, _closest_node, sizeof(WalkNode));
v20._x = _newnode->_x;
v20._y = _newnode->_y;
@@ -225,7 +225,7 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) {
}
- memFree(v44);
+ free(v44);
return (WalkNode*)v58._node._next;
}
@@ -333,14 +333,14 @@ void jobWalk(void *parm, Job *j) {
j->_finished = 1;
checkDoor();
- memFree(node);
+ free(node);
return;
}
WalkNode *tmp = (WalkNode*)node->_node._next;
j->_parm = node->_node._next;
- memFree(node);
+ free(node);
debugC(1, kDebugWalk, "jobWalk moving to next node (%i, %i)", tmp->_x, tmp->_y);
diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp
index 3d07c83c0d..50c59e22b5 100644
--- a/engines/parallaction/zone.cpp
+++ b/engines/parallaction/zone.cpp
@@ -64,10 +64,10 @@ void Parallaction::parseZone(Script &script, Node *list, char *name) {
return;
}
- Zone *z = (Zone*)memAlloc(sizeof(Zone));
+ Zone *z = (Zone*)malloc(sizeof(Zone));
memset(z, 0, sizeof(Zone));
- z->_label._text = (char*)memAlloc(strlen(name)+1);
+ z->_label._text = (char*)malloc(strlen(name)+1);
strcpy(z->_label._text, name);
addNode(list, &z->_node);
@@ -150,42 +150,42 @@ void freeZones(Node *list) {
switch (z->_type & 0xFFFF) {
case kZoneExamine:
- memFree(z->u.examine->_filename);
- memFree(z->u.examine->_description);
- memFree(z->u.examine);
+ free(z->u.examine->_filename);
+ free(z->u.examine->_description);
+ free(z->u.examine);
break;
case kZoneDoor:
- memFree(z->u.door->_location);
- memFree(z->u.door->_background);
+ free(z->u.door->_location);
+ free(z->u.door->_background);
_vm->_graphics->freeCnv(&z->u.door->_cnv);
- memFree(z->u.door);
+ free(z->u.door);
break;
case kZoneSpeak:
freeDialogue(z->u.speak->_dialogue);
- memFree(z->u.speak);
+ free(z->u.speak);
break;
case kZoneGet:
- memFree(z->u.get->_cnv._data2);
+ free(z->u.get->_cnv._data2);
_vm->_graphics->freeStaticCnv(&z->u.get->_cnv);
- memFree(z->u.get);
+ free(z->u.get);
break;
case kZoneHear:
- memFree(z->u.hear);
+ free(z->u.hear);
break;
case kZoneMerge:
- memFree(z->u.merge);
+ free(z->u.merge);
break;
default:
break;
}
- memFree(z->_label._text);
+ free(z->_label._text);
z->_label._text = NULL;
_vm->_graphics->freeStaticCnv(&z->_label._cnv);
freeCommands(z->_commands);
@@ -212,32 +212,32 @@ void Parallaction::parseZoneTypeBlock(Script &script, Zone *z) {
switch (z->_type & 0xFFFF) {
case kZoneExamine: // examine Zone alloc
- u->examine = (ExamineData*)memAlloc(sizeof(ExamineData));
+ u->examine = (ExamineData*)malloc(sizeof(ExamineData));
memset(u->examine, 0, sizeof(ExamineData));
break;
case kZoneDoor: // door Zone alloc
- u->door = (DoorData*)memAlloc(sizeof(DoorData));
+ u->door = (DoorData*)malloc(sizeof(DoorData));
memset(u->door, 0, sizeof(DoorData));
break;
case kZoneGet: // get Zone alloc
- u->get = (GetData*)memAlloc(sizeof(GetData));
+ u->get = (GetData*)malloc(sizeof(GetData));
memset(u->get, 0, sizeof(GetData));
break;
case kZoneMerge: // merge Zone alloc
- u->merge = (MergeData*)memAlloc(sizeof(MergeData));
+ u->merge = (MergeData*)malloc(sizeof(MergeData));
memset(u->merge, 0, sizeof(MergeData));
break;
case kZoneHear: // hear Zone alloc
- u->hear = (HearData*)memAlloc(sizeof(HearData));
+ u->hear = (HearData*)malloc(sizeof(HearData));
memset(u->hear, 0, sizeof(HearData));
break;
case kZoneSpeak: // speak Zone alloc
- u->speak = (SpeakData*)memAlloc(sizeof(SpeakData));
+ u->speak = (SpeakData*)malloc(sizeof(SpeakData));
memset(u->speak, 0, sizeof(SpeakData));
break;
@@ -252,7 +252,7 @@ void Parallaction::parseZoneTypeBlock(Script &script, Zone *z) {
switch (z->_type & 0xFFFF) {
case kZoneExamine: // examine Zone init
if (!scumm_stricmp(_tokens[0], "file")) {
- u->examine->_filename = (char*)memAlloc(strlen(_tokens[1])+1);
+ u->examine->_filename = (char*)malloc(strlen(_tokens[1])+1);
strcpy(u->examine->_filename, _tokens[1]);
}
if (!scumm_stricmp(_tokens[0], "desc")) {
@@ -268,7 +268,7 @@ void Parallaction::parseZoneTypeBlock(Script &script, Zone *z) {
}
if (!scumm_stricmp(_tokens[0], "location")) {
- u->door->_location = (char*)memAlloc(strlen(_tokens[1])+1);
+ u->door->_location = (char*)malloc(strlen(_tokens[1])+1);
strcpy(u->door->_location, _tokens[1]);
}
@@ -292,7 +292,7 @@ void Parallaction::parseZoneTypeBlock(Script &script, Zone *z) {
// _ax = (z->_flags & kFlagsClosed ? 0 : 1);
// vE0._data1 = doorcnv->field_8[_ax];
- vE0._data2 = u->door->_background = (byte*)memAlloc(vE0._width*vE0._height);
+ vE0._data2 = u->door->_background = (byte*)malloc(vE0._width*vE0._height);
_vm->_graphics->backupCnvBackground(&vE0, z->_limits._left, z->_limits._top);
_vm->_graphics->flatBlitCnv(&vE0, z->_limits._left, z->_limits._top, Graphics::kBitBack, vE0._data1);
@@ -310,7 +310,7 @@ void Parallaction::parseZoneTypeBlock(Script &script, Zone *z) {
StaticCnv *vE4 = &u->get->_cnv;
strcpy(vC8, _tokens[1]);
loadStatic(vC8, vE4);
- vE4->_data2 = (byte*)memAlloc(vE4->_width*vE4->_height);
+ vE4->_data2 = (byte*)malloc(vE4->_width*vE4->_height);
if ((z->_flags & kFlagsRemove) == 0) {
_vm->_graphics->backupCnvBackgroundTransparent(vE4, z->_limits._left, z->_limits._top);