Removed UseCommandLine from ddraw.ini (always enabled)

Updated version number.
This commit is contained in:
NovaRain
2021-11-27 06:42:19 +08:00
parent 81912b47ed
commit 6f08a50f9a
4 changed files with 22 additions and 33 deletions
+1 -4
View File
@@ -1,10 +1,7 @@
;sfall configuration settings
;v4.3.2
;v4.3.3
[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
;This file can be placed in text\<language>\ for sfall to get the translations depending on the game language
;TranslationsINI=sfall\Translations.ini
+2 -2
View File
@@ -859,9 +859,9 @@ static void EngineOptimizationPatches() {
0x47C1FD // SaveGame_
});
// LoadGame_
SafeWrite8(0x47CF0D, 195 + 10); // jz +10
SafeWrite8(0x47CF0D, 195 + 10); // jz 0x47CFDE
// SaveGame_
SafeWrite8(0x47C135, 140 + 10); // jz +10
SafeWrite8(0x47C135, 140 + 10); // jz 0x47C1CF
}
void MiscPatches::init() {
+17 -25
View File
@@ -83,6 +83,7 @@
#include "Logging.h"
#include "ReplacementFuncs.h"
#include "Translate.h"
#include "Utils.h"
#include "version.h"
ddrawDll ddraw;
@@ -244,37 +245,28 @@ static void SfallInit() {
}
// ini file override
bool cmdlineexists = false;
char* cmdline = GetCommandLineA();
if (IniReader::GetIntDefaultConfig("Main", "UseCommandLine", 0)) {
while (cmdline[0] == ' ') cmdline++;
bool InQuote = false;
int count = -1;
std::string overrideIni;
while (true) {
count++;
if (cmdline[count] == 0) break;;
if (cmdline[count] == ' ' && !InQuote) break;
if (cmdline[count] == '"') {
InQuote = !InQuote;
if (!InQuote) break;
}
}
if (cmdline[count] != 0) {
count++;
while (cmdline[count] == ' ') count++;
cmdline = &cmdline[count];
cmdlineexists = true;
}
std::string cmdline(GetCommandLineA());
ToLowerCase(cmdline);
size_t n = cmdline.find(".ini");
if (n != std::string::npos && (n + 4) < cmdline.length() && cmdline[n + 4] != ' ') {
n = cmdline.find(".ini", n + 4);
}
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) {
HANDLE h = CreateFileA(cmdline, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
if (!overrideIni.empty()) {
HANDLE h = CreateFileA(overrideIni.c_str(), GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
if (h != INVALID_HANDLE_VALUE) {
CloseHandle(h);
IniReader::SetConfigFile(cmdline);
IniReader::SetConfigFile(overrideIni.c_str());
} 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);
goto defaultIni;
}
+2 -2
View File
@@ -24,7 +24,7 @@
#define VERSION_MAJOR 4
#define VERSION_MINOR 3
#define VERSION_BUILD 2
#define VERSION_BUILD 3
#define VERSION_REV 0
#define VERSION_STRING "4.3.2"
#define VERSION_STRING "4.3.3"