* Reduce the amount of copy-pasting of filenames..

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3342 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-01-04 15:55:55 +00:00
parent 4d8da13cb4
commit 9e790e79ab
1 changed files with 8 additions and 8 deletions

View File

@ -11406,25 +11406,26 @@ BOOL writeStructLimitsFile(char *pFileName)
return FALSE; return FALSE;
} }
static const char FireSupport_tag_definition[] = "testdata/tagfile_savegame_firesupport.def";
static const char FireSupport_file_identifier[] = "FIRESUPPORT";
/*! /*!
* Load the current fire-support designated commanders (the one who has fire-support enabled) * Load the current fire-support designated commanders (the one who has fire-support enabled)
*/ */
BOOL readFiresupportDesignators(char *pFileName) BOOL readFiresupportDesignators(char *pFileName)
{ {
const char *definition = "testdata/tagfile_savegame_firesupport.def";
unsigned int numPlayers, player; unsigned int numPlayers, player;
char formatIdentifier[12] = ""; char formatIdentifier[12] = "";
if (!tagOpenRead(definition, pFileName)) if (!tagOpenRead(FireSupport_tag_definition, pFileName))
{ {
debug(LOG_ERROR, "readFiresupportDesignators: Failed to open savegame %s", pFileName); debug(LOG_ERROR, "readFiresupportDesignators: Failed to open savegame %s", pFileName);
return FALSE; return FALSE;
} }
debug(LOG_MAP, "Reading tagged savegame %s with definition %s:", pFileName, definition); debug(LOG_MAP, "Reading tagged savegame %s with definition %s:", pFileName, FireSupport_tag_definition);
tagReadString(0x01, 12, formatIdentifier); tagReadString(0x01, 12, formatIdentifier);
if (strcmp(formatIdentifier, "FIRESUPPORT") != 0) if (strcmp(formatIdentifier, FireSupport_file_identifier) != 0)
{ {
debug(LOG_ERROR, "readFiresupportDesignators: Incompatble %s, 'FIRESUPPORT' expected", pFileName); debug(LOG_ERROR, "readFiresupportDesignators: Incompatble %s, 'FIRESUPPORT' expected", pFileName);
return FALSE; return FALSE;
@ -11453,17 +11454,16 @@ BOOL readFiresupportDesignators(char *pFileName)
*/ */
BOOL writeFiresupportDesignators(char *pFileName) BOOL writeFiresupportDesignators(char *pFileName)
{ {
const char *definition = "testdata/tagfile_savegame_firesupport.def";
unsigned int player; unsigned int player;
if (!tagOpenWrite(definition, pFileName)) if (!tagOpenWrite(FireSupport_tag_definition, pFileName))
{ {
debug(LOG_ERROR, "writeFiresupportDesignators: Failed to create savegame %s", pFileName); debug(LOG_ERROR, "writeFiresupportDesignators: Failed to create savegame %s", pFileName);
return FALSE; return FALSE;
} }
debug(LOG_MAP, "Creating tagged savegame %s with definition %s:", pFileName, definition); debug(LOG_MAP, "Creating tagged savegame %s with definition %s:", pFileName, FireSupport_tag_definition);
tagWriteString(0x01, "FIRESUPPORT"); tagWriteString(0x01, FireSupport_file_identifier);
tagWriteEnter(0x02, MAX_PLAYERS); tagWriteEnter(0x02, MAX_PLAYERS);
for (player = 0; player < MAX_PLAYERS; player++) for (player = 0; player < MAX_PLAYERS; player++)
{ {