Removed UseCommandLine from ddraw.ini (always enabled)

Updated version number.
This commit is contained in:
NovaRain
2021-11-27 06:44:06 +08:00
parent 44411309f8
commit 8e3e49b281
4 changed files with 22 additions and 33 deletions
+1 -4
View File
@@ -1,10 +1,7 @@
;sfall configuration settings
;v3.8.32
;v3.8.33
[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
@@ -863,9 +863,9 @@ static void EngineOptimizationPatches() {
};
SafeWriteBatch<BYTE>(16, lsGameDelayAddr); // 41 to 16 ms
// 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
@@ -78,6 +78,7 @@
#include "Logging.h"
#include "ReplacementFuncs.h"
#include "Translate.h"
#include "Utils.h"
#include "version.h"
ddrawDll ddraw;
@@ -359,37 +360,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 3
#define VERSION_MINOR 8
#define VERSION_BUILD 32
#define VERSION_BUILD 33
#define VERSION_REV 0
#define VERSION_STRING "3.8.32"
#define VERSION_STRING "3.8.33"