diff options
author | Max Horn | 2009-10-02 14:42:24 +0000 |
---|---|---|
committer | Max Horn | 2009-10-02 14:42:24 +0000 |
commit | f54e82e4880767f6e71c83840bff1ae8e0feda3d (patch) | |
tree | 30f39e823d322bae805faac95fd2e65023d29a0c /tools/create_lure | |
parent | 01176782ead27701b4700f458fbad3f8a84514af (diff) | |
download | scummvm-rg350-f54e82e4880767f6e71c83840bff1ae8e0feda3d.tar.gz scummvm-rg350-f54e82e4880767f6e71c83840bff1ae8e0feda3d.tar.bz2 scummvm-rg350-f54e82e4880767f6e71c83840bff1ae8e0feda3d.zip |
Fix more cppcheck warnings/errors; some code formatting; and fixes to our tools
svn-id: r44539
Diffstat (limited to 'tools/create_lure')
-rw-r--r-- | tools/create_lure/create_lure_dat.cpp | 4 | ||||
-rw-r--r-- | tools/create_lure/process_actions.cpp | 28 |
2 files changed, 12 insertions, 20 deletions
diff --git a/tools/create_lure/create_lure_dat.cpp b/tools/create_lure/create_lure_dat.cpp index 9377506c9b..f1d4e39011 100644 --- a/tools/create_lure/create_lure_dat.cpp +++ b/tools/create_lure/create_lure_dat.cpp @@ -778,7 +778,7 @@ void read_anim_data(byte *&data, uint16 &totalSize) { uint16 startOffset; int ctr, dirCtr; int movementSize = 0; - bool *includeAnim = (bool *) malloc(animIndex); + bool *includeAnim = (bool *)malloc(animIndex); // Loop to figure out the total number of movement records there are for (ctr = 0; ctr < animIndex; ++ctr) { @@ -886,7 +886,7 @@ void read_anim_data(byte *&data, uint16 &totalSize) { } rec->animRecordId = TO_LE_16(0xffff); - delete includeAnim; + free(includeAnim); } void read_script_data(byte *&data, uint16 &totalSize) { diff --git a/tools/create_lure/process_actions.cpp b/tools/create_lure/process_actions.cpp index 7ea45d8681..9779315ddd 100644 --- a/tools/create_lure/process_actions.cpp +++ b/tools/create_lure/process_actions.cpp @@ -344,8 +344,7 @@ struct RoomRandomActionSet { RoomRandomActionEntry *entries; }; -void read_action_sequence(byte *&data, uint16 &totalSize) -{ +void read_action_sequence(byte *&data, uint16 &totalSize) { uint16 hotspotIndex; HotspotHeaderEntry entryHeader; CurrentActionInput action; @@ -381,8 +380,7 @@ void read_action_sequence(byte *&data, uint16 &totalSize) } // Next get the set of offsetes for the start of each sequence - for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex) - { + for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex) { if (randomActions[roomIndex].offset == 0) continue; @@ -393,8 +391,7 @@ void read_action_sequence(byte *&data, uint16 &totalSize) // Loop through the entries uint16 offset = randomActions[roomIndex].offset + 1; - for (uint8 entryCtr = 0; entryCtr < randomActions[roomIndex].numEntries; ++entryCtr) - { + for (uint8 entryCtr = 0; entryCtr < randomActions[roomIndex].numEntries; ++entryCtr) { randomActions[roomIndex].entries[entryCtr].repeatable = lureExe.readWord() == 1; offset += 2; @@ -485,12 +482,9 @@ void read_action_sequence(byte *&data, uint16 &totalSize) // Finally process each of the random room actions - for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex) - { - for (index = 0; index < randomActions[roomIndex].numEntries; ++index) - { - if (randomActions[roomIndex].entries[index].offset != 0xfffe) - { + for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex) { + for (index = 0; index < randomActions[roomIndex].numEntries; ++index) { + if (randomActions[roomIndex].entries[index].offset != 0xfffe) { //printf("room=%d entry=%xh\n", roomIndex+1, randomActions[roomIndex].entries[index].offset); process_entry(randomActions[roomIndex].entries[index].offset, data, totalSize); } @@ -509,8 +503,7 @@ void read_action_sequence(byte *&data, uint16 &totalSize) // Output the data for the random room actions - for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex) - { + for (roomIndex = 0; roomIndex < RANDOM_ROOM_NUM_ENTRIES; ++roomIndex) { if (randomActions[roomIndex].numEntries == 0) continue; @@ -540,10 +533,9 @@ void read_action_sequence(byte *&data, uint16 &totalSize) *pHeader++ = TO_LE_16(0xffff); // Free up the random room action array - for (roomIndex = 0; roomIndex < 1; ++roomIndex) - { + for (roomIndex = 0; roomIndex < 1; ++roomIndex) { if (randomActions[roomIndex].entries != NULL) - delete randomActions[roomIndex].entries; + delete[] randomActions[roomIndex].entries; } - delete randomActions; + delete[] randomActions; } |