mirror of
https://github.com/HomeworldSDL/HomeworldSDL.git
synced 2025-10-29 19:45:21 +00:00
Compare commits
2 Commits
56ee4dc544
...
01ec87daa9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01ec87daa9 | ||
|
|
56110e5177 |
@ -649,6 +649,8 @@ color versionColor = colWhite;
|
||||
|
||||
// some crude formatting within the .cfg's scriptEntry context
|
||||
char filecfgblankspace = '\0';
|
||||
//array of options to skip writing out, add dynamically in code
|
||||
char optionsNotToWrite[200][50];
|
||||
|
||||
scriptEntry utyOptionsList[] =
|
||||
{
|
||||
@ -911,6 +913,40 @@ void utyOptionsFileRead(void)
|
||||
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
Name : addOptionsNotToWrite
|
||||
Description : Adds an option to exclude writing to the Homeworld.ini file
|
||||
Inputs : option name string
|
||||
Outputs : Adds option to optionsNotToWrite
|
||||
Return : void
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
void addOptionsNotToWrite(char option[]){
|
||||
for (int i=0;i<sizeof(optionsNotToWrite)/sizeof(optionsNotToWrite[0]);i++) {
|
||||
if (optionsNotToWrite[i][0]=='\0') {
|
||||
strcpy(optionsNotToWrite[i],option);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
Name : checkOptionsNotToWrite
|
||||
Description : check if option is is contained in optionsNotToWrite
|
||||
Inputs : option name string
|
||||
Outputs :
|
||||
Return : True if optionsNotToWrite contain inputed option, false otherwise
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
bool checkOptionsNotToWrite(char optionName[]){
|
||||
for(int i=0;i<sizeof(optionsNotToWrite)/sizeof(optionsNotToWrite[0]);i++) {
|
||||
if (strcmp(optionsNotToWrite[i],optionName) == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
Name : utyOptionsFileWrite
|
||||
Description : Write a set of options from the Homeworld.ini file
|
||||
@ -944,6 +980,7 @@ void utyOptionsFileWrite(void)
|
||||
|
||||
for (index = 0; utyOptionsList[index].name != NULL; index++)
|
||||
{
|
||||
if (checkOptionsNotToWrite(utyOptionsList[index].name)) continue;
|
||||
if (utyOptionsList[index].setVarCB == scriptSetUbyteCB) {
|
||||
fprintf(f, "%s %u\n", utyOptionsList[index].name,
|
||||
*((ubyte *)utyOptionsList[index].dataPtr));
|
||||
@ -3583,6 +3620,8 @@ char* utyGameSystemsPreInit(void)
|
||||
// Check to see if fileHomeworldDataPath is set
|
||||
if (fileHomeworldDataPath[0] == '\0')
|
||||
{
|
||||
//do not write this option out if it was not set in the config
|
||||
addOptionsNotToWrite("HomeworldDataPath");
|
||||
getcwd(filePathTempBuffer, PATH_MAX);
|
||||
dataPath = filePathTempBuffer;
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
/usr/bin/gcc \
|
||||
-D _MACOSX \
|
||||
-I /Library/Frameworks/SDL2.framework/Headers \
|
||||
-I ../../Mac/SDL2.framework/Headers \
|
||||
-I ../../src/SDL \
|
||||
-I ../../src/ThirdParty/CRC \
|
||||
-I ../../src/ThirdParty/LZSS \
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
/usr/bin/gcc \
|
||||
-D_MACOSX \
|
||||
-I /Library/Frameworks/SDL2.framework/Headers \
|
||||
-I ../../Mac/SDL2.framework/Headers \
|
||||
*.c \
|
||||
-o kas2c
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user