[Scummvm-cvs-logs] SF.net SVN: scummvm: [28982] scummvm/trunk/tools/create_lure
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Thu Sep 20 11:28:52 CEST 2007
Revision: 28982
http://scummvm.svn.sourceforge.net/scummvm/?rev=28982&view=rev
Author: fingolfin
Date: 2007-09-20 02:28:52 -0700 (Thu, 20 Sep 2007)
Log Message:
-----------
FIxed some warnings, cleanup
Modified Paths:
--------------
scummvm/trunk/tools/create_lure/create_lure_dat.cpp
scummvm/trunk/tools/create_lure/create_lure_dat.h
scummvm/trunk/tools/create_lure/process_actions.cpp
Modified: scummvm/trunk/tools/create_lure/create_lure_dat.cpp
===================================================================
--- scummvm/trunk/tools/create_lure/create_lure_dat.cpp 2007-09-20 08:50:46 UTC (rev 28981)
+++ scummvm/trunk/tools/create_lure/create_lure_dat.cpp 2007-09-20 09:28:52 UTC (rev 28982)
@@ -110,7 +110,6 @@
uint16 offset = (ROOM_NUM_ENTRIES + 1) * sizeof(uint16);
uint16 pixelOffset;
RoomResource buffer;
- int outputIndex = 0;
RoomHeaderEntry headerEntry;
RoomRectIn bounds;
@@ -737,7 +736,7 @@
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 @@
}
-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();
Modified: scummvm/trunk/tools/create_lure/create_lure_dat.h
===================================================================
--- scummvm/trunk/tools/create_lure/create_lure_dat.h 2007-09-20 08:50:46 UTC (rev 28981)
+++ scummvm/trunk/tools/create_lure/create_lure_dat.h 2007-09-20 09:28:52 UTC (rev 28982)
@@ -23,8 +23,8 @@
*
*/
-#ifndef __createlure_dat__
-#define __createlure_dat__
+#ifndef __CREATELURE_DAT__
+#define __CREATELURE_DAT__
#include "common/endian.h"
@@ -90,8 +90,11 @@
#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 uint16 get_sequence_index(uint16 offset, int supportIndex = -1);
+#include "common/pack-end.h" // END STRUCT PACKING
+
+
+
enum AccessMode {
kFileReadMode = 1,
kFileWriteMode = 2
Modified: scummvm/trunk/tools/create_lure/process_actions.cpp
===================================================================
--- scummvm/trunk/tools/create_lure/process_actions.cpp 2007-09-20 08:50:46 UTC (rev 28981)
+++ scummvm/trunk/tools/create_lure/process_actions.cpp 2007-09-20 09:28:52 UTC (rev 28982)
@@ -83,7 +83,7 @@
}
}
- 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 @@
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 @@
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)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list