Added optimization for the save/load game screens

Edited the description of args for HOOK_TOHIT.
This commit is contained in:
NovaRain
2021-11-23 20:44:00 +08:00
parent 21c85b298b
commit a35a4e034b
4 changed files with 17 additions and 6 deletions
+2 -2
View File
@@ -96,8 +96,8 @@ Critter arg1 - The attacker
Critter arg2 - The target of the attack Critter arg2 - The target of the attack
int arg3 - The targeted bodypart int arg3 - The targeted bodypart
int arg4 - Source tile (may differ from attacker's tile, when AI is considering potential fire position) int arg4 - Source tile (may differ from attacker's tile, when AI is considering potential fire position)
int arg5 - Attack Type (one of ATKTYPE_*) int arg5 - Attack Type (see ATKTYPE_* constants)
int arg6 - Ranged flag. 1 means the hit chance is calculated by taking into account the bonuses/penalties of the distance to the target int arg6 - Ranged flag. 1 if the hit chance calculation takes into account the distance to the target. This does not mean the attack is a ranged attack
int arg7 - The raw hit chance before applying the cap int arg7 - The raw hit chance before applying the cap
int ret0 - the new hit chance int ret0 - the new hit chance
+2 -2
View File
@@ -661,7 +661,7 @@ sfall_funcX metarule functions
---- ----
#### inventory_redraw #### inventory_redraw
`void sfall_func0("inventory_redraw")`<br> `void sfall_func0("inventory_redraw")`\
`void sfall_func1("inventory_redraw", int invSide)` `void sfall_func1("inventory_redraw", int invSide)`
- Redraws inventory list in the inventory/use inventory item on/loot/barter screens - Redraws inventory list in the inventory/use inventory item on/loot/barter screens
- `invSide` specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens), -1 - both sides (same as without argument) - `invSide` specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens), -1 - both sides (same as without argument)
@@ -673,7 +673,7 @@ sfall_funcX metarule functions
---- ----
#### create_win #### create_win
`void sfall_func5("create_win", string winName, int x, int y, int width, int height)`<br> `void sfall_func5("create_win", string winName, int x, int y, int width, int height)`\
`void sfall_func6("create_win", string winName, int x, int y, int width, int height, int flags)` `void sfall_func6("create_win", string winName, int x, int y, int width, int height, int flags)`
- Works just like vanilla `CreateWin` function, but creates a window with `MoveOnTop` flag if the flags argument is not specified, and allows to set additional flags for the created window - Works just like vanilla `CreateWin` function, but creates a window with `MoveOnTop` flag if the flags argument is not specified, and allows to set additional flags for the created window
- `MoveOnTop` flag allows the created window to be placed on top of the game interface - `MoveOnTop` flag allows the created window to be placed on top of the game interface
+11
View File
@@ -855,6 +855,17 @@ static void EngineOptimizationPatches() {
SafeWrite32(0x4D630C, 0x9090C031); // xor eax, eax SafeWrite32(0x4D630C, 0x9090C031); // xor eax, eax
SafeWrite8(0x4D6310, 0x90); SafeWrite8(0x4D6310, 0x90);
BlockCall(0x4D6319); BlockCall(0x4D6319);
// Reduce excessive delays in the save/load game screens
const DWORD lsGameDelayAddr[] = {
0x47D00D, // LoadGame_
0x47C1FD // SaveGame_
};
SafeWriteBatch<BYTE>(16, lsGameDelayAddr); // 41 to 16 ms
// LoadGame_
SafeWrite8(0x47CF0D, 195 + 10); // jz +10
// SaveGame_
SafeWrite8(0x47C135, 140 + 10); // jz +10
} }
void MiscPatches::init() { void MiscPatches::init() {
+2 -2
View File
@@ -120,10 +120,10 @@ void op_get_npc_level(OpcodeContext& ctx) {
} }
if (pid) { if (pid) {
DWORD* pidList = *fo::ptr::partyMemberPidList; DWORD* pidList = *fo::ptr::partyMemberPidList;
DWORD* lvlUpInfo = *fo::ptr::partyMemberLevelUpInfoList; DWORD* levelUpInfoList = *fo::ptr::partyMemberLevelUpInfoList;
for (DWORD j = 0; j < *fo::ptr::partyMemberMaxCount; j++) { for (DWORD j = 0; j < *fo::ptr::partyMemberMaxCount; j++) {
if (pidList[j] == pid) { if (pidList[j] == pid) {
level = lvlUpInfo[j * 3]; level = levelUpInfoList[j * 3];
break; break;
} }
} }