From 87c4dd34f13f9352f1be0bf8b1152ce5a9e0c3cf Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sat, 8 Feb 2020 08:41:04 +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/FalloutEngine/EngineUtils.cpp | 6 +++--- sfall/FalloutEngine/Enums.h | 2 +- sfall/Modules/Graphics.cpp | 6 +++--- sfall/SafeWrite.h | 1 - sfall/main.h | 6 +----- sfall/stdafx.h | 10 ++++++++-- 9 files changed, 19 insertions(+), 18 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 945c1a83..80011929 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -585,7 +585,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 8d84d964..c14720b0 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 23ea88fa..dadc403a 100644 --- a/artifacts/scripting/sfall function notes.txt +++ b/artifacts/scripting/sfall function notes.txt @@ -714,7 +714,7 @@ optional argument: > 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/FalloutEngine/EngineUtils.cpp b/sfall/FalloutEngine/EngineUtils.cpp index f51cf063..31c6cbee 100644 --- a/sfall/FalloutEngine/EngineUtils.cpp +++ b/sfall/FalloutEngine/EngineUtils.cpp @@ -117,11 +117,11 @@ long GetCurrentAttackMode() { long activeHand = fo::var::itemCurrentItem; // 0 - left, 1 - right switch (fo::var::itemButtonItems[activeHand].mode) { case 1: - case 2: // 2 - called shot + case 2: // called shot hitMode = fo::var::itemButtonItems[activeHand].primaryAttack; break; case 3: - case 4: // 4 - called shot + case 4: // called shot hitMode = fo::var::itemButtonItems[activeHand].secondaryAttack; break; case 5: // reload mode @@ -204,7 +204,7 @@ enum WinNameType { Character = 5, Skilldex = 6, EscMenu = 7, // escape menu -// Automap = 8 // for this window there is no global variable + //Automap = 8 // for this window there is no global variable }; fo::Window* GetWindow(long winType) { diff --git a/sfall/FalloutEngine/Enums.h b/sfall/FalloutEngine/Enums.h index fe25ad64..5f4c25ff 100644 --- a/sfall/FalloutEngine/Enums.h +++ b/sfall/FalloutEngine/Enums.h @@ -104,7 +104,7 @@ enum CritterFlags : long Invulnerable = 0x400, // Is Invulnerable (cannot be hurt) NoFlatten = 0x800, // Doesn't flatten on death (leaves no dead body) SpecialDeath = 0x1000, // Has a special type of death - RangeHth = 0x2000, // Has extra hand-to-hand range + RangeHtH = 0x2000, // Has extra hand-to-hand range NoKnockBack = 0x4000, // Can't be knocked back }; diff --git a/sfall/Modules/Graphics.cpp b/sfall/Modules/Graphics.cpp index 08c8c70c..e8f379a6 100644 --- a/sfall/Modules/Graphics.cpp +++ b/sfall/Modules/Graphics.cpp @@ -45,7 +45,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; @@ -552,7 +552,7 @@ void Graphics::SetHeadTex(IDirect3DTexture9* tex, int width, int height, int xof // adjust head texture position for HRP 4.1.8 int h = GetGameHeightRes(); - if (h > 480) yoff += ((h - 480) / 2) - 47; + if (h > 480) yoff += ((h - 480) / 2) - 47; // TODO: get dialog interface position xoff += ((GetGameWidthRes() - 640) / 2); size[0] = (126.0f + xoff + ((388 - width) / 2)) * rcpres[0]; @@ -617,7 +617,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/SafeWrite.h b/sfall/SafeWrite.h index 79274948..7214a564 100644 --- a/sfall/SafeWrite.h +++ b/sfall/SafeWrite.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include "CheckAddress.h" diff --git a/sfall/main.h b/sfall/main.h index 10a3b01c..f02719f3 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 f54e35bf..ca51f8e6 100644 --- a/sfall/stdafx.h +++ b/sfall/stdafx.h @@ -1,8 +1,8 @@ #pragma once #pragma message("Compiling precompiled headers.\n") -#define WINVER 0x0501 -#define _WIN32_WINNT 0x0501 +#define WINVER _WIN32_WINNT_WINXP +#define _WIN32_WINNT _WIN32_WINNT_WINXP #include #include @@ -12,4 +12,10 @@ #include #include #include + +//#define WIN32_LEAN_AND_MEAN +#define NOCRYPT +#define NOSERVICE +#define NOMCX +#define NOIME #include