mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Removed UseCommandLine from ddraw.ini (always enabled)
Updated version number.
This commit is contained in:
+1
-4
@@ -1,10 +1,7 @@
|
|||||||
;sfall configuration settings
|
;sfall configuration settings
|
||||||
;v4.3.2
|
;v4.3.3
|
||||||
|
|
||||||
[Main]
|
[Main]
|
||||||
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
|
|
||||||
UseCommandLine=0
|
|
||||||
|
|
||||||
;Uncomment and point to a file to get alternate translations for some sfall messages
|
;Uncomment and point to a file to get alternate translations for some sfall messages
|
||||||
;This file can be placed in text\<language>\ for sfall to get the translations depending on the game language
|
;This file can be placed in text\<language>\ for sfall to get the translations depending on the game language
|
||||||
;TranslationsINI=sfall\Translations.ini
|
;TranslationsINI=sfall\Translations.ini
|
||||||
|
|||||||
@@ -859,9 +859,9 @@ static void EngineOptimizationPatches() {
|
|||||||
0x47C1FD // SaveGame_
|
0x47C1FD // SaveGame_
|
||||||
});
|
});
|
||||||
// LoadGame_
|
// LoadGame_
|
||||||
SafeWrite8(0x47CF0D, 195 + 10); // jz +10
|
SafeWrite8(0x47CF0D, 195 + 10); // jz 0x47CFDE
|
||||||
// SaveGame_
|
// SaveGame_
|
||||||
SafeWrite8(0x47C135, 140 + 10); // jz +10
|
SafeWrite8(0x47C135, 140 + 10); // jz 0x47C1CF
|
||||||
}
|
}
|
||||||
|
|
||||||
void MiscPatches::init() {
|
void MiscPatches::init() {
|
||||||
|
|||||||
+16
-24
@@ -83,6 +83,7 @@
|
|||||||
#include "Logging.h"
|
#include "Logging.h"
|
||||||
#include "ReplacementFuncs.h"
|
#include "ReplacementFuncs.h"
|
||||||
#include "Translate.h"
|
#include "Translate.h"
|
||||||
|
#include "Utils.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
ddrawDll ddraw;
|
ddrawDll ddraw;
|
||||||
@@ -244,37 +245,28 @@ static void SfallInit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ini file override
|
// ini file override
|
||||||
bool cmdlineexists = false;
|
std::string overrideIni;
|
||||||
char* cmdline = GetCommandLineA();
|
|
||||||
if (IniReader::GetIntDefaultConfig("Main", "UseCommandLine", 0)) {
|
|
||||||
while (cmdline[0] == ' ') cmdline++;
|
|
||||||
bool InQuote = false;
|
|
||||||
int count = -1;
|
|
||||||
|
|
||||||
while (true) {
|
std::string cmdline(GetCommandLineA());
|
||||||
count++;
|
ToLowerCase(cmdline);
|
||||||
if (cmdline[count] == 0) break;;
|
|
||||||
if (cmdline[count] == ' ' && !InQuote) break;
|
size_t n = cmdline.find(".ini");
|
||||||
if (cmdline[count] == '"') {
|
if (n != std::string::npos && (n + 4) < cmdline.length() && cmdline[n + 4] != ' ') {
|
||||||
InQuote = !InQuote;
|
n = cmdline.find(".ini", n + 4);
|
||||||
if (!InQuote) break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (cmdline[count] != 0) {
|
|
||||||
count++;
|
|
||||||
while (cmdline[count] == ' ') count++;
|
|
||||||
cmdline = &cmdline[count];
|
|
||||||
cmdlineexists = true;
|
|
||||||
}
|
}
|
||||||
|
if (n != std::string::npos) {
|
||||||
|
size_t m = n + 3;
|
||||||
|
while (n > 0 && cmdline[n] != ' ') n--;
|
||||||
|
if (n > 0) overrideIni = cmdline.substr(n + 1, m - n);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmdlineexists && *cmdline != 0) {
|
if (!overrideIni.empty()) {
|
||||||
HANDLE h = CreateFileA(cmdline, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
|
HANDLE h = CreateFileA(overrideIni.c_str(), GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
|
||||||
if (h != INVALID_HANDLE_VALUE) {
|
if (h != INVALID_HANDLE_VALUE) {
|
||||||
CloseHandle(h);
|
CloseHandle(h);
|
||||||
IniReader::SetConfigFile(cmdline);
|
IniReader::SetConfigFile(overrideIni.c_str());
|
||||||
} else {
|
} else {
|
||||||
MessageBoxA(0, "You gave a command line argument to Fallout, but it couldn't be matched to a file.\n" \
|
MessageBoxA(0, "You gave a command line argument to Fallout, but the configuration ini file was not found.\n"
|
||||||
"Using default ddraw.ini instead.", "Warning", MB_TASKMODAL | MB_ICONWARNING);
|
"Using default ddraw.ini instead.", "Warning", MB_TASKMODAL | MB_ICONWARNING);
|
||||||
goto defaultIni;
|
goto defaultIni;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#define VERSION_MAJOR 4
|
#define VERSION_MAJOR 4
|
||||||
#define VERSION_MINOR 3
|
#define VERSION_MINOR 3
|
||||||
#define VERSION_BUILD 2
|
#define VERSION_BUILD 3
|
||||||
#define VERSION_REV 0
|
#define VERSION_REV 0
|
||||||
|
|
||||||
#define VERSION_STRING "4.3.2"
|
#define VERSION_STRING "4.3.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user