Included Define.h in FalloutEngine.h

* it removes the need to include Define.h separately across the code.
(similar to Fallout2.h in 4.x code)

Added StrNormalizePath() to Utils.cpp.
This commit is contained in:
NovaRain
2019-12-25 09:25:36 +08:00
parent a1968f7f86
commit 35d9b9439c
27 changed files with 63 additions and 75 deletions
-1
View File
@@ -21,7 +21,6 @@
#include "main.h"
#include "AI.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "SafeWrite.h"
-2
View File
@@ -1,6 +1,4 @@
#include "main.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "BugFixes.h"
#include "HookScripts.h"
-1
View File
@@ -18,7 +18,6 @@
#include "main.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "Logging.h"
+1 -2
View File
@@ -19,10 +19,9 @@
#include <vector>
#include "main.h"
#include "FalloutEngine.h"
#include "Arrays.h"
#include "DebugEditor.h"
#include "FalloutEngine.h"
#include "ScriptExtender.h"
enum DECode {
+20
View File
@@ -1,5 +1,25 @@
#pragma once
enum ObjType : char
{
OBJ_TYPE_ITEM = 0,
OBJ_TYPE_CRITTER = 1,
OBJ_TYPE_SCENERY = 2,
OBJ_TYPE_WALL = 3,
OBJ_TYPE_TILE = 4,
OBJ_TYPE_MISC = 5,
OBJ_TYPE_SPATIAL = 6
};
enum ArtType : char
{
OBJ_TYPE_INTRFACE = 6,
OBJ_TYPE_INVEN = 7,
OBJ_TYPE_HEAD = 8,
OBJ_TYPE_BACKGROUND = 9,
OBJ_TYPE_SKILLDEX = 10
};
// Some FO2 PIDs possibly used by engine
enum ProtoId : long
{
-1
View File
@@ -18,7 +18,6 @@
#include "main.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "Logging.h"
+1
View File
@@ -24,6 +24,7 @@
*
*/
#include "Define.h"
#include "FalloutStructs.h"
// Global variable offsets
+1 -22
View File
@@ -36,7 +36,7 @@ struct TInvenRec {
};
#pragma pack(pop)
/* 15 */
/* 15 */
#pragma pack(push, 1)
struct TGameObj {
long ID;
@@ -128,27 +128,6 @@ struct TScript {
};
#pragma pack(pop)
enum ScriptTypes : long
{
SCRIPT_SYSTEM = 0,
SCRIPT_SPATIAL = 1,
SCRIPT_TIME = 2,
SCRIPT_ITEM = 3,
SCRIPT_CRITTER = 4,
};
/* 24 */
enum ObjType : char
{
OBJ_TYPE_ITEM = 0,
OBJ_TYPE_CRITTER = 1,
OBJ_TYPE_SCENERY = 2,
OBJ_TYPE_WALL = 3,
OBJ_TYPE_TILE = 4,
OBJ_TYPE_MISC = 5,
OBJ_TYPE_SPATIAL = 6,
};
/* 25 */
#pragma pack(push, 1)
struct TProgram {
+8 -9
View File
@@ -19,7 +19,6 @@
#include <stdio.h>
#include "main.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "HeroAppearance.h"
#include "LoadGameHook.h"
@@ -418,7 +417,7 @@ static bool LoadFrmFrame(UNLSTDframe *frame, void* frmStream) {
}
UNLSTDfrm *LoadUnlistedFrm(char *frmName, unsigned int folderRef) {
if (folderRef > 10) return nullptr;
if (folderRef > OBJ_TYPE_SKILLDEX) return nullptr;
char *artfolder = (char*)(0x51073C + folderRef * 32); // address of art type name
char FrmPath[MAX_PATH];
@@ -1189,7 +1188,7 @@ static void DrawCharNote(bool style, int winRef, DWORD xPosWin, DWORD yPosWin, B
BYTE *PadSurface = new BYTE [280 * 168];
sub_draw(280, 168, widthBG, heightBG, xPosBG, yPosBG, BGSurface, 280, 168, 0, 0, PadSurface, 0);
UNLSTDfrm *frm = LoadUnlistedFrm((style) ? "AppStyle.frm" : "AppRace.frm", 10);
UNLSTDfrm *frm = LoadUnlistedFrm((style) ? "AppStyle.frm" : "AppRace.frm", OBJ_TYPE_SKILLDEX);
if (frm) {
sub_draw(frm->frames[0].width, frm->frames[0].height, frm->frames[0].width, frm->frames[0].height, 0, 0, frm->frames[0].indexBuff, 280, 168, 136, 37, PadSurface, 0); // cover buttons pics bottom
delete frm;
@@ -1260,7 +1259,7 @@ static void _stdcall DrawCharNoteNewChar(bool type) {
void _stdcall HeroSelectWindow(int raceStyleFlag) {
if (!appModEnabled) return;
UNLSTDfrm *frm = LoadUnlistedFrm("AppHeroWin.frm", 6);
UNLSTDfrm *frm = LoadUnlistedFrm("AppHeroWin.frm", OBJ_TYPE_INTRFACE);
if (frm == nullptr) {
DebugPrintf("\nApperanceMod: art\\intrface\\AppHeroWin.frm file not found.");
return;
@@ -1756,7 +1755,7 @@ static void __declspec(naked) FixCharScrnBack() {
if (charScrnBackSurface == nullptr) {
charScrnBackSurface = new BYTE [640 * 480];
UNLSTDfrm *frm = LoadUnlistedFrm((*ptr_glblmode) ? "AppChCrt.frm" : "AppChEdt.frm", 6);
UNLSTDfrm *frm = LoadUnlistedFrm((*ptr_glblmode) ? "AppChCrt.frm" : "AppChEdt.frm", OBJ_TYPE_INTRFACE);
if (frm != nullptr) {
sub_draw(640, 480, 640, 480, 0, 0, frm->frames[0].indexBuff, 640, 480, 0, 0, charScrnBackSurface, 0);
@@ -1779,16 +1778,16 @@ static void __declspec(naked) FixCharScrnBack() {
DWORD FrmObj, FrmMaskObj; // frm objects for char screen Appearance button
BYTE *FrmSurface, *FrmMaskSurface;
FrmSurface = GetFrmSurface(BuildFrmId(6, 113), 0, 0, &FrmObj); // "Use Item On" window
FrmSurface = GetFrmSurface(BuildFrmId(OBJ_TYPE_INTRFACE, 113), 0, 0, &FrmObj); // "Use Item On" window
sub_draw(81, 132, 292, 376, 163, 20, FrmSurface, 640, 480, 331, 63, charScrnBackSurface, 0); // char view win
sub_draw(79, 31, 292, 376, 154, 228, FrmSurface, 640, 480, 331, 32, charScrnBackSurface, 0); // upper char view win
sub_draw(79, 30, 292, 376, 158, 236, FrmSurface, 640, 480, 331, 195, charScrnBackSurface, 0); // lower char view win
UnloadFrm(FrmObj);
// Sexoff Frm
FrmSurface = GetFrmSurface(BuildFrmId(6, 188), 0, 0, &FrmObj);
FrmSurface = GetFrmSurface(BuildFrmId(OBJ_TYPE_INTRFACE, 188), 0, 0, &FrmObj);
// Sex button mask frm
FrmMaskSurface = GetFrmSurface(BuildFrmId(6, 187), 0, 0, &FrmMaskObj);
FrmMaskSurface = GetFrmSurface(BuildFrmId(OBJ_TYPE_INTRFACE, 187), 0, 0, &FrmMaskObj);
sub_draw(80, 28, 80, 32, 0, 0, FrmMaskSurface, 80, 32, 0, 0, FrmSurface, 0x39); // mask for style and race buttons
UnloadFrm(FrmMaskObj);
@@ -1816,7 +1815,7 @@ static void __declspec(naked) FixCharScrnBack() {
// frm background for char screen Appearance button
if (*ptr_glblmode && (styleButtons || raceButtons)) {
FrmSurface = GetFrmSurface(BuildFrmId(6, 174), 0, 0, &FrmObj); // Pickchar frm
FrmSurface = GetFrmSurface(BuildFrmId(OBJ_TYPE_INTRFACE, 174), 0, 0, &FrmObj); // Pickchar frm
if (raceButtons) sub_draw(69, 20, 640, 480, 281, 319, FrmSurface, 640, 480, 337, 36, charScrnBackSurface, 0); // button backround top
if (styleButtons) sub_draw(69, 20, 640, 480, 281, 319, FrmSurface, 640, 480, 337, 198, charScrnBackSurface, 0); // button backround bottom
UnloadFrm(FrmObj);
+1 -4
View File
@@ -16,12 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "main.h"
#include <string>
#include <vector>
#include "Define.h"
#include "main.h"
#include "FalloutEngine.h"
#include "HookScripts.h"
#include "Inventory.h"
@@ -30,7 +28,6 @@
#include "PartyControl.h"
#include "ScriptExtender.h"
static const int maxArgs = 16;
static const int maxRets = 8;
static const int maxDepth = 8;
-1
View File
@@ -17,7 +17,6 @@
*/
#include "main.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "HeroAppearance.h"
+1 -3
View File
@@ -16,11 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "main.h"
#include <stdio.h>
#include "Define.h"
#include "main.h"
#include "FalloutEngine.h"
#include "input.h"
#include "Inventory.h"
-2
View File
@@ -17,8 +17,6 @@
*/
#include "main.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "AI.h"
#include "Arrays.h"
-2
View File
@@ -17,8 +17,6 @@
*/
#include "main.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "Objects.h"
-1
View File
@@ -25,7 +25,6 @@
#include <vector>
#include "main.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "HeroAppearance.h"
#include "PartyControl.h"
+1 -2
View File
@@ -19,9 +19,8 @@
#include <vector>
#include "main.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "Perks.h"
long PerkLevelMod = 0;
+1 -3
View File
@@ -17,9 +17,7 @@
*/
#include "main.h"
#include "FalloutEngine.h"
#include "QuestList.h"
#define EXITCODE_BREAK (-1)
#define EXITCODE_NORMAL (0)
@@ -354,7 +352,7 @@ static void __stdcall ArtButtonFunc(DWORD buttonKey, DWORD buttonMem, DWORD inde
xor ecx, ecx;
xor ebx, ebx;
mov edx, indexArt; // index from intrface.lst
mov eax, 6; // OBJ_TYPE_INTRFACE
mov eax, OBJ_TYPE_INTRFACE;
push ecx;
call art_id_;
//
+2 -4
View File
@@ -16,17 +16,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "main.h"
#include <hash_map>
//#include <set>
#include "main.h"
#include "FalloutEngine.h"
#include "Arrays.h"
#include "BarBoxes.h"
#include "Console.h"
#include "Define.h"
#include "Explosions.h"
#include "FalloutEngine.h"
#include "HookScripts.h"
#include "input.h"
#include "LoadGameHook.h"
+9
View File
@@ -137,3 +137,12 @@ enum ScriptProc : long
combat_is_starting_p_proc = 26,
combat_is_over_p_proc = 27
};
enum ScriptTypes : long
{
SCRIPT_SYSTEM = 0,
SCRIPT_SPATIAL = 1,
SCRIPT_TIME = 2,
SCRIPT_ITEM = 3,
SCRIPT_CRITTER = 4,
};
-1
View File
@@ -22,7 +22,6 @@
#include "main.h"
#include "Define.h"
#include "FalloutEngine.h"
#include "Combat.h"
#include "Objects.h"

Some files were not shown because too many files have changed in this diff Show More