mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Removed CreditsAtBottom from ddraw.ini
* sfall built-in credits will be shown at the beginning when from the main menu and at the end during the ending.
This commit is contained in:
@@ -707,9 +707,6 @@ SkipLoadingGameSettings=0
|
||||
;The formula for the duration in ticks is: 10 * (value - 3 * EN)
|
||||
KnockoutTime=35
|
||||
|
||||
;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top
|
||||
CreditsAtBottom=0
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
; Critical modding options - the following options should be changed with caution
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
@@ -943,7 +943,7 @@ sfall_funcX metarule functions
|
||||
`int sfall_func2("get_stat_min", int stat, bool who)`\
|
||||
`int sfall_func2("get_stat_max", int stat, bool who)`
|
||||
- Returns the maximum or minimum set value of the specified stat (see `set_stat_min` and `set_stat_max` functions)
|
||||
- `who`: 0 (false) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters
|
||||
- `who`: 0 (False) or omitting the argument - returns the value of the player, 1 (True) - returns the value set for other critters
|
||||
|
||||
----
|
||||
#### interface_art_draw
|
||||
@@ -1021,7 +1021,7 @@ sfall_funcX metarule functions
|
||||
----
|
||||
#### obj_is_openable
|
||||
`bool sfall_func1("obj_is_openable", object obj)`
|
||||
- Returns True if the object is openable (i.e. has an opening/closing animation)
|
||||
- Returns True if the object is openable (i.e. has an opening/closing animation), False otherwise
|
||||
|
||||
|
||||
****
|
||||
|
||||
+31
-16
@@ -27,7 +27,7 @@
|
||||
namespace sfall
|
||||
{
|
||||
|
||||
static DWORD InCredits = 0;
|
||||
static bool InCredits = false;
|
||||
static DWORD CreditsLine = 0;
|
||||
|
||||
static const char* ExtraLines[] = {
|
||||
@@ -84,15 +84,6 @@ static const char* ExtraLines[] = {
|
||||
static DWORD ExtraLineCount = sizeof(ExtraLines) / 4;
|
||||
//static const char* creditsFile = "credits.txt";
|
||||
|
||||
static void __declspec(naked) ShowCreditsHook() {
|
||||
InCredits = 1;
|
||||
CreditsLine = 0;
|
||||
//__asm mov eax, creditsFile;
|
||||
__asm call fo::funcoffs::credits_;
|
||||
InCredits = 0;
|
||||
__asm retn;
|
||||
}
|
||||
|
||||
static DWORD __fastcall CreditsNextLine(char* buf, DWORD* font, DWORD* colour) {
|
||||
if (!InCredits || CreditsLine >= ExtraLineCount) return 0;
|
||||
const char* line = ExtraLines[CreditsLine++];
|
||||
@@ -159,14 +150,38 @@ morelines:
|
||||
}
|
||||
}
|
||||
|
||||
void Credits::init() {
|
||||
const DWORD showCreditsAddr[] = {0x480C49, 0x43F881};
|
||||
HookCalls(ShowCreditsHook, showCreditsAddr);
|
||||
if (IniReader::GetConfigInt("Misc", "CreditsAtBottom", 0)) {
|
||||
HookCall(0x42CB49, CreditsNextLineHook_Bottom);
|
||||
static void __stdcall SetCreditsPosition(DWORD addr) {
|
||||
void* func;
|
||||
if (addr == (0x43F881 + 5)) { // called from endgame_movie_
|
||||
func = CreditsNextLineHook_Bottom;
|
||||
} else {
|
||||
HookCall(0x42CB49, CreditsNextLineHook_Top);
|
||||
func = CreditsNextLineHook_Top;
|
||||
}
|
||||
HookCall(0x42CB49, func);
|
||||
}
|
||||
|
||||
static void __declspec(naked) ShowCreditsHook() {
|
||||
__asm {
|
||||
push eax;
|
||||
push edx;
|
||||
push ebx;
|
||||
push [esp + 12]; // return address
|
||||
call SetCreditsPosition;
|
||||
pop ebx;
|
||||
pop edx;
|
||||
pop eax;
|
||||
mov InCredits, 1;
|
||||
mov CreditsLine, 0;
|
||||
//mov eax, creditsFile;
|
||||
call fo::funcoffs::credits_;
|
||||
mov InCredits, 0;
|
||||
retn;
|
||||
}
|
||||
}
|
||||
|
||||
void Credits::init() {
|
||||
const DWORD showCreditsAddr[] = {0x480C49, 0x43F881};
|
||||
HookCalls(ShowCreditsHook, showCreditsAddr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user