mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added description of HOOK_GAMEMODECHANGE to hookscripts.txt.
Fixed the line break for debug.log message of GameReset. Minor edits to Tiles.cpp code format.
This commit is contained in:
@@ -498,3 +498,11 @@ int arg3 - the hour part of the length of resting time
|
||||
int arg4 - the minute part of the length of resting time
|
||||
|
||||
int ret1 - pass 1 to interrupt the resting
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
HOOK_GAMEMODECHANGE (hs_gamemodechange.int)
|
||||
|
||||
Runs once every time when the game mode was changed, like opening/closing the inventory, character screen, pipboy, etc.
|
||||
|
||||
int arg1 - event type: 1 - when the player exits the game, 0 - otherwise
|
||||
|
||||
@@ -37,8 +37,16 @@
|
||||
namespace sfall
|
||||
{
|
||||
|
||||
#define _InLoop(type, flag) _asm pushad _asm push flag _asm push type _asm call SetInLoop _asm popad
|
||||
#define _InLoop2(type, flag) _asm push flag _asm push type _asm call SetInLoop
|
||||
#define _InLoop(type, flag) __asm { \
|
||||
_asm pushad \
|
||||
_asm push flag \
|
||||
_asm push type \
|
||||
_asm call SetInLoop \
|
||||
_asm popad }
|
||||
#define _InLoop2(type, flag) __asm { \
|
||||
_asm push flag \
|
||||
_asm push type \
|
||||
_asm call SetInLoop }
|
||||
|
||||
static Delegate<> onGameInit;
|
||||
static Delegate<> onGameReset;
|
||||
@@ -206,7 +214,7 @@ static void _stdcall GameReset(DWORD isGameLoad) {
|
||||
|
||||
if (isDebug) {
|
||||
char* str = (isGameLoad) ? "on Load" : "on Exit";
|
||||
fo::func::debug_printf("n\[SFALL: State reset %s]", str);
|
||||
fo::func::debug_printf("\n[SFALL: State reset %s]\n", str);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,4 +572,5 @@ Delegate<>& LoadGameHook::OnAfterNewGame() {
|
||||
Delegate<DWORD>& LoadGameHook::OnGameModeChange() {
|
||||
return onGameModeChange;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ static int ProcessTile(fo::Art* tiles, int tile, int listpos) {
|
||||
for (int y2 = 0; y2 < 36; y2++) {
|
||||
for (int x2 = 0; x2 < 80; x2++) {
|
||||
if (mask[y2 * 80 + x2]) {
|
||||
frame.pixels[y2 * 80 + x2] = pixeldata[(yoffset + y2)*width + xoffset + x2];
|
||||
frame.pixels[y2 * 80 + x2] = pixeldata[(yoffset + y2) * width + xoffset + x2];
|
||||
} else {
|
||||
frame.pixels[y2 * 80 + x2] = 0;
|
||||
}
|
||||
@@ -211,7 +211,7 @@ static void _stdcall SquareLoadCheck(tilestruct* data) {
|
||||
for (DWORD x = 0; x < 100; x++) {
|
||||
for (DWORD z = 0; z < 2; z++) {
|
||||
DWORD tile = data[y * 100 + x].tile[z];
|
||||
if (tile > 1 && tile < origTileCount&&overrides[tile]) {
|
||||
if (tile > 1 && tile < origTileCount && overrides[tile]) {
|
||||
DWORD newtile = overrides[tile]->replacementid - 1;
|
||||
for (DWORD y2 = 0; y2 < overrides[tile]->ytiles; y2++) {
|
||||
for (DWORD x2 = 0; x2 < overrides[tile]->xtiles; x2++) {
|
||||
|
||||
Reference in New Issue
Block a user