From 517c2e682539ca143b3055dee73237a530601340 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sat, 8 Feb 2020 08:48:02 +0800 Subject: [PATCH] Updated stdafx.h and other code/doc files --- artifacts/ddraw.ini | 2 +- artifacts/scripting/headers/define_extra.h | 2 +- artifacts/scripting/sfall function notes.txt | 2 +- sfall/Define.h | 2 +- sfall/FalloutEngine.cpp | 2 +- sfall/Graphics.cpp | 6 +++--- sfall/main.h | 6 +----- sfall/stdafx.h | 14 ++++++++++---- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 642fb2f3..2b785c23 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -569,7 +569,7 @@ StartGDialogFix=0 AttackComplexFix=0 ;Set to 1 to fix the issue with the division operator treating negative integers as unsigned -;If you still want to perform the unsigned integer division, use the new 'div' operator +;Note: To perform the unsigned integer division, use the new 'div' operator DivisionOperatorFix=1 ;Set to 1 to enable the balanced bullet distribution formula for burst attacks diff --git a/artifacts/scripting/headers/define_extra.h b/artifacts/scripting/headers/define_extra.h index 66836912..34f4909f 100644 --- a/artifacts/scripting/headers/define_extra.h +++ b/artifacts/scripting/headers/define_extra.h @@ -99,7 +99,7 @@ #define CFLG_SPECIAL 4096 // 0x00001000 - Special (has a special type of death) #define CFLG_RANGED 8192 // 0x00002000 - Range (has extra hand-to-hand range) #define CFLG_NOKNOCKBACK 16384 // 0x00004000 - Knock (cannot be knocked back) -#define CFLG_NOKNOCKDOWN CFLG_NOKNOCKBACK // for old scripts +#define CFLG_NOKNOCKDOWN CFLG_NOKNOCKBACK // obsolete /* Window flags */ #define WIN_FLAG_MOVEONTOP (0x4) diff --git a/artifacts/scripting/sfall function notes.txt b/artifacts/scripting/sfall function notes.txt index c952a993..665bbff8 100644 --- a/artifacts/scripting/sfall function notes.txt +++ b/artifacts/scripting/sfall function notes.txt @@ -620,7 +620,7 @@ optional arguments: > int sfall_func2("get_window_attribute", int winType, int attrType) - returns the attribute of the specified interface window by the attrType argument - winType: the type number of the interface window (see WINTYPE_* constants in sfall.h) -- attrType: 0 - returns a value of 1 if the specified interface window is created by the game (same as without the argument) +- attrType: 0 - checks and returns a value of 1 if the specified interface window is created by the game (same as without the argument) 1 - X position, 2 - Y position (relative to the top-left corner of the game screen) - returns -1 if the specified attribute cannot be obtained diff --git a/sfall/Define.h b/sfall/Define.h index f4e39987..06f1cc33 100644 --- a/sfall/Define.h +++ b/sfall/Define.h @@ -301,7 +301,7 @@ enum CritterFlags : long CFLG_Invulnerable = 0x400, // Is Invulnerable (cannot be hurt) CFLG_NoFlatten = 0x800, // Doesn't flatten on death (leaves no dead body) CFLG_SpecialDeath = 0x1000, // Has a special type of death - CFLG_RangeHth = 0x2000, // Has extra hand-to-hand range + CFLG_RangeHtH = 0x2000, // Has extra hand-to-hand range CFLG_NoKnockBack = 0x4000, // Can't be knocked back }; diff --git a/sfall/FalloutEngine.cpp b/sfall/FalloutEngine.cpp index 217a8bdf..cef1441a 100644 --- a/sfall/FalloutEngine.cpp +++ b/sfall/FalloutEngine.cpp @@ -1615,7 +1615,7 @@ enum WinNameType { WINTYPE_Character = 5, WINTYPE_Skilldex = 6, WINTYPE_EscMenu = 7, // escape menu -// WINTYPE_Automap = 8 // for this window there is no global variable + //WINTYPE_Automap = 8 // for this window there is no global variable }; WINinfo* GetUIWindow(long winType) { diff --git a/sfall/Graphics.cpp b/sfall/Graphics.cpp index fbd02572..c42ffdef 100644 --- a/sfall/Graphics.cpp +++ b/sfall/Graphics.cpp @@ -42,7 +42,7 @@ typedef IDirect3D9* (_stdcall *D3DCreateProc)(UINT version); #define UNUSEDFUNCTION { DEBUGMESS("\n[SFALL] Unused function called: %s", __FUNCTION__); return DDERR_GENERIC; } -IDirectDrawSurface* primaryDDSurface = nullptr; +static IDirectDrawSurface* primaryDDSurface = nullptr; static DWORD ResWidth; static DWORD ResHeight; @@ -655,7 +655,7 @@ void Gfx_SetHeadTex(IDirect3DTexture9* tex, int width, int height, int xoff, int // adjust head texture position for HRP 4.1.8 int h = Gfx_GetGameHeightRes(); - if (h > 480) yoff += ((h - 480) / 2) - 47; + if (h > 480) yoff += ((h - 480) / 2) - 47; // TODO: get dialog interface position xoff += ((Gfx_GetGameWidthRes() - 640) / 2); size[0] = (126.0f + xoff + ((388 - width) / 2)) * rcpres[0]; @@ -727,7 +727,7 @@ public: } } else { // X8B8G8R8 format - for (DWORD i = b; i < b + c; i++) { // swap color R <> B + for (DWORD i = b; i < b + c; i++) { // swap color B <> R BYTE clr = *(BYTE*)((DWORD)&palette[i]); // B *(BYTE*)((DWORD)&palette[i]) = *(BYTE*)((DWORD)&palette[i] + 2); // R *(BYTE*)((DWORD)&palette[i] + 2) = clr; diff --git a/sfall/main.h b/sfall/main.h index 27b04479..669bc222 100644 --- a/sfall/main.h +++ b/sfall/main.h @@ -17,16 +17,12 @@ */ #pragma once - #pragma warning(disable:4996) - #ifdef NDEBUG #pragma warning(disable:4414) #endif -#include -//#define WIN32_LEAN_AND_MEAN -#include +#include #include #include #include diff --git a/sfall/stdafx.h b/sfall/stdafx.h index 0fdb4e7e..ab476549 100644 --- a/sfall/stdafx.h +++ b/sfall/stdafx.h @@ -2,11 +2,11 @@ #pragma message("Compiling precompiled headers.\n") #ifdef WIN2K -#define WINVER 0x0500 -#define _WIN32_WINNT 0x0500 +#define WINVER _WIN32_WINNT_WIN2K +#define _WIN32_WINNT _WIN32_WINNT_WIN2K #else -#define WINVER 0x0501 -#define _WIN32_WINNT 0x0501 +#define WINVER _WIN32_WINNT_WINXP +#define _WIN32_WINNT _WIN32_WINNT_WINXP #endif #include @@ -14,4 +14,10 @@ #include #include #include + +//#define WIN32_LEAN_AND_MEAN +#define NOCRYPT +#define NOSERVICE +#define NOMCX +#define NOIME #include