aboutsummaryrefslogtreecommitdiff
path: root/tools/create_lure
diff options
context:
space:
mode:
authorMax Horn2007-09-20 09:28:52 +0000
committerMax Horn2007-09-20 09:28:52 +0000
commit9593ff3e486a750b1deb5e43fe95ff8a20155d4c (patch)
tree95efb0ad4bcfa4a2e8655bf9b00a21cde4e21133 /tools/create_lure
parent3cbf4ad98f83c8bd456ece03d626be8776857148 (diff)
downloadscummvm-rg350-9593ff3e486a750b1deb5e43fe95ff8a20155d4c.tar.gz
scummvm-rg350-9593ff3e486a750b1deb5e43fe95ff8a20155d4c.tar.bz2
scummvm-rg350-9593ff3e486a750b1deb5e43fe95ff8a20155d4c.zip
FIxed some warnings, cleanup
svn-id: r28982
Diffstat (limited to 'tools/create_lure')
-rw-r--r--tools/create_lure/create_lure_dat.cpp14
-rw-r--r--tools/create_lure/create_lure_dat.h13
-rw-r--r--tools/create_lure/process_actions.cpp4
3 files changed, 16 insertions, 15 deletions
diff --git a/tools/create_lure/create_lure_dat.cpp b/tools/create_lure/create_lure_dat.cpp
index dbcd03faab..cc53c751f4 100644
--- a/tools/create_lure/create_lure_dat.cpp
+++ b/tools/create_lure/create_lure_dat.cpp
@@ -110,7 +110,6 @@ void read_room_data(byte *&data, uint16 &totalSize)
uint16 offset = (ROOM_NUM_ENTRIES + 1) * sizeof(uint16);
uint16 pixelOffset;
RoomResource buffer;
- int outputIndex = 0;
RoomHeaderEntry headerEntry;
RoomRectIn bounds;
@@ -737,7 +736,7 @@ void read_talk_headers(byte *&data, uint16 &totalSize) {
TalkEntry *entry = (TalkEntry *) data;
uint16 offset = TALK_NUM_ENTRIES * sizeof(TalkEntry) + sizeof(uint16);
- for (int entryCtr = 0; entryCtr < TALK_NUM_ENTRIES; ++entryCtr) {
+ for (entryCtr = 0; entryCtr < TALK_NUM_ENTRIES; ++entryCtr) {
entry->hotspotId = entries[entryCtr].hotspotId;
entry->offset = TO_LE_16(offset);
++entry;
@@ -1248,20 +1247,17 @@ void validate_executable() {
}
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
+ // FIXME: This is not portable
const char *inFilename = (argc >= 2) ? argv[1] : "c:\\games\\lure\\lure.exe";
const char *outFilename = (argc == 3) ? argv[2] : "c:\\games\\lure\\lure.dat";
- if (!lure_exe.open(inFilename))
- {
+ if (!lure_exe.open(inFilename)) {
if (argc == 1)
printf("Format: %s input_exe_filename output_filename\n", argv[0]);
else
printf("Could not open file: %s\n", inFilename);
- }
- else
- {
+ } else {
validate_executable();
createFile(outFilename);
lure_exe.close();
diff --git a/tools/create_lure/create_lure_dat.h b/tools/create_lure/create_lure_dat.h
index 1c8e6ff2d0..20b67000d7 100644
--- a/tools/create_lure/create_lure_dat.h
+++ b/tools/create_lure/create_lure_dat.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef __createlure_dat__
-#define __createlure_dat__
+#ifndef __CREATELURE_DAT__
+#define __CREATELURE_DAT__
#include "common/endian.h"
@@ -90,7 +90,10 @@
#define SOUND_1_OFFSET 0x5671
#define SOUND_1_SIZE 265
-#pragma pack(1)
+#include "common/pack-start.h" // START STRUCT PACKING
+
+// FIXME: Add PACKED_STRUCT to all structs which actually need packing,
+// for increased portability
// Rect currently copied from common/rect.h - if I try directly including it,
// the link complains about an unresolved external token Common.String.__dtor
@@ -368,6 +371,10 @@ extern void read_action_sequence(byte *&data, uint16 &totalSize);
extern uint16 get_sequence_index(uint16 offset, int supportIndex = -1);
+#include "common/pack-end.h" // END STRUCT PACKING
+
+
+
enum AccessMode {
kFileReadMode = 1,
kFileWriteMode = 2
diff --git a/tools/create_lure/process_actions.cpp b/tools/create_lure/process_actions.cpp
index 2ebe1feafb..a4de8c8fe3 100644
--- a/tools/create_lure/process_actions.cpp
+++ b/tools/create_lure/process_actions.cpp
@@ -83,7 +83,7 @@ uint16 get_sequence_index(uint16 offset, int supportIndex) {
}
}
- for (int index = 0; index <= numSupportEntries; ++index) {
+ for (index = 0; index <= numSupportEntries; ++index) {
SupportStructure &rec = supportList[index];
if ((rec.numInstructions > 0) &&
@@ -294,7 +294,6 @@ struct RoomRandomActionSet {
void read_action_sequence(byte *&data, uint16 &totalSize)
{
const uint16 hsOffset = 0x5d98;
- const uint16 hsStartId = 0x3e8;
uint16 hotspotIndex;
HotspotHeaderEntry entryHeader;
CurrentActionInput action;
@@ -335,7 +334,6 @@ void read_action_sequence(byte *&data, uint16 &totalSize)
randomActions[roomIndex].entries = new RoomRandomActionEntry[randomActions[roomIndex].numEntries];
// Loop through the entries
- uint16 sequenceVal;
uint16 offset = randomActions[roomIndex].offset + 1;
for (uint8 entryCtr = 0; entryCtr < randomActions[roomIndex].numEntries; ++entryCtr)
{