mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Moved all engine variable pointers to separate namespace.
Replaced all usages of variable defines with variable pointers.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
namespace FuncOffs
|
||||
{
|
||||
|
||||
#define FUNC_DEFN extern const unsigned long
|
||||
#define FUNC_DEFN const unsigned long
|
||||
|
||||
FUNC_DEFN AM_ReadEntry_ = 0x41C8CC;
|
||||
FUNC_DEFN AM_ReadMainHeader_ = 0x41CB50;
|
||||
|
||||
@@ -4120,4 +4120,8 @@ FUNC_DECL zero_vid_mem_;
|
||||
FUNC_DECL zlibVersion_;
|
||||
FUNC_DECL zupstr_;
|
||||
|
||||
|
||||
#undef FUNC_DECL
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -166,4 +166,53 @@ struct sMessage
|
||||
char* audio;
|
||||
char* message;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
#pragma pack(pop)
|
||||
|
||||
struct sArt {
|
||||
int flags;
|
||||
char path[16];
|
||||
char* names;
|
||||
int d18;
|
||||
int total;
|
||||
};
|
||||
|
||||
struct CritStruct {
|
||||
union {
|
||||
struct {
|
||||
int DamageMultiplier;
|
||||
int EffectFlags;
|
||||
int StatCheck;
|
||||
int StatMod;
|
||||
int FailureEffect;
|
||||
int Message;
|
||||
int FailMessage;
|
||||
};
|
||||
int values[7];
|
||||
};
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct SkillInfo
|
||||
{
|
||||
int name;
|
||||
int desc;
|
||||
int attr;
|
||||
int image;
|
||||
int base;
|
||||
int statMulti;
|
||||
int statA;
|
||||
int statB;
|
||||
int skillPointMulti;
|
||||
int Exp;
|
||||
int f;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
//fallout2 path node structure
|
||||
struct sPath {
|
||||
char* path;
|
||||
void* pDat;
|
||||
int isDat;
|
||||
sPath* next;
|
||||
};
|
||||
|
||||
|
||||
@@ -36,3 +36,11 @@ char AnimCodeByWeapon(TGameObj* weapon) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* MsgSearch(int msgno, DWORD* file) {
|
||||
if(!file) return 0;
|
||||
sMessage msg = { msgno, 0, 0, 0 };
|
||||
Wrapper::message_search(file, &msg);
|
||||
return msg.message;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,3 +28,5 @@ const char* _stdcall GetMessageStr(DWORD fileAddr, int messageId);
|
||||
|
||||
// returns weapon animation code
|
||||
char AnimCodeByWeapon(TGameObj* weapon);
|
||||
|
||||
const char* MsgSearch(int msgno, DWORD* file);
|
||||
+366
-178
File diff suppressed because it is too large
Load Diff
+188
-358
File diff suppressed because it is too large
Load Diff
@@ -209,4 +209,12 @@ TGameObj* __stdcall inven_right_hand(TGameObj* critter) {
|
||||
__asm call FuncOffs::inven_right_hand_
|
||||
}
|
||||
|
||||
int __stdcall message_search(DWORD* file, sMessage* msg) {
|
||||
__asm {
|
||||
mov edx, msg;
|
||||
mov eax, file;
|
||||
call FuncOffs::message_search_;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -93,4 +93,7 @@ void __declspec() debug_printf(const char* fmt, ...);
|
||||
|
||||
// returns the name of current procedure by program pointer
|
||||
const char* __stdcall findCurrentProc(TProgram* program);
|
||||
|
||||
int __stdcall message_search(DWORD* file, sMessage* msg);
|
||||
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ end:
|
||||
|
||||
static void __declspec(naked) BlockCombatHook2() {
|
||||
__asm {
|
||||
mov eax, dword ptr ds:[_intfaceEnabled];
|
||||
mov eax, dword ptr ds:[VarPtr::intfaceEnabled];
|
||||
test eax, eax;
|
||||
jz end;
|
||||
mov eax, CombatDisabled;
|
||||
|
||||
+10
-10
@@ -513,7 +513,7 @@ static __declspec(naked) void MeleeDmgDispFix() {
|
||||
__asm {
|
||||
call FuncOffs::stat_level_; // Get Melee Damage
|
||||
mov ecx,eax; // Store value
|
||||
mov eax,dword ptr ds:[_obj_dude]; // Get pointer to PC
|
||||
mov eax,dword ptr ds:[VarPtr::obj_dude]; // Get pointer to PC
|
||||
mov edx,PERK_bonus_hth_damage; // perk_level_ argument: PERK_bonus_hth_damage
|
||||
call FuncOffs::perk_level_; // Get rank of Bonus HtH Damage
|
||||
shl eax,0x1; // Multiply by 2
|
||||
@@ -527,7 +527,7 @@ static __declspec(naked) void MeleeDmgPrintFix() {
|
||||
__asm {
|
||||
call FuncOffs::stat_level_; // Get Melee Damage
|
||||
mov ebx,eax; // Store value
|
||||
mov eax,dword ptr ds:[_obj_dude]; // Get pointer to PC
|
||||
mov eax,dword ptr ds:[VarPtr::obj_dude]; // Get pointer to PC
|
||||
mov edx,PERK_bonus_hth_damage; // perk_level_ argument: PERK_bonus_hth_damage
|
||||
call FuncOffs::perk_level_; // Get rank of Bonus HtH Damage
|
||||
shl eax,0x1; // Multiply by 2
|
||||
@@ -542,8 +542,8 @@ static __declspec(naked) void MeleeWeapDmgRngDispFix() {
|
||||
__asm {
|
||||
call FuncOffs::stat_level_; // Get Melee Damage
|
||||
mov ebx,eax; // Store Melee Damage value
|
||||
mov edx,dword ptr ds:[_stack]; // Get pointer to critter
|
||||
mov eax,dword ptr ds:[_obj_dude]; // Get pointer to PC
|
||||
mov edx,dword ptr ds:[VarPtr::stack]; // Get pointer to critter
|
||||
mov eax,dword ptr ds:[VarPtr::obj_dude]; // Get pointer to PC
|
||||
cmp eax,edx; // Is PC == critter?
|
||||
jnz end; // exit if no
|
||||
mov edx,PERK_bonus_hth_damage; // perk_level_ argument: PERK_bonus_hth_damage
|
||||
@@ -558,8 +558,8 @@ end:
|
||||
static __declspec(naked) void UnarmedDmgRngDispFix() {
|
||||
__asm {
|
||||
mov ebx,eax; // Store Melee Damage value
|
||||
mov edx,dword ptr ds:[_stack]; // Get pointer to critter
|
||||
mov eax,dword ptr ds:[_obj_dude]; // Get pointer to PC
|
||||
mov edx,dword ptr ds:[VarPtr::stack]; // Get pointer to critter
|
||||
mov eax,dword ptr ds:[VarPtr::obj_dude]; // Get pointer to PC
|
||||
cmp eax,edx; // Is PC == critter?
|
||||
jnz end; // exit if no
|
||||
mov edx,PERK_bonus_hth_damage; // perk_level_ argument: PERK_bonus_hth_damage
|
||||
@@ -583,7 +583,7 @@ static __declspec(naked) void HtHDamageFix1a() {
|
||||
add eax,2; // Total_Melee_Damage += 2
|
||||
mov dword ptr ss:[esp],eax; // Max_Damage = Total_Melee_Damage
|
||||
xor edx,edx;
|
||||
mov eax,dword ptr ds:[_obj_dude]; // Get pointer to PC
|
||||
mov eax,dword ptr ds:[VarPtr::obj_dude]; // Get pointer to PC
|
||||
cmp ecx,eax; // Is the critter == PC?
|
||||
jnz ajmp; // Skip to ajmp if no
|
||||
mov edx,PERK_bonus_hth_damage; // perk_level_ argument: PERK_bonus_hth_damage
|
||||
@@ -602,7 +602,7 @@ static __declspec(naked) void HtHDamageFix1b() {
|
||||
__asm {
|
||||
call FuncOffs::stat_level_; // Get Total_Melee_Damage
|
||||
mov ebp, eax;
|
||||
mov eax, dword ptr ds:[_obj_dude]; // Get pointer to PC
|
||||
mov eax, dword ptr ds:[VarPtr::obj_dude]; // Get pointer to PC
|
||||
cmp ecx, eax; // Is the critter == PC?
|
||||
jnz end; // Skip to exit if no
|
||||
mov edx, PERK_bonus_hth_damage; // perk_level_ argument: PERK_bonus_hth_damage
|
||||
@@ -618,7 +618,7 @@ end:
|
||||
static void __declspec(naked) DisplayBonusRangedDmg() {
|
||||
__asm {
|
||||
mov edx, PERK_bonus_ranged_damage
|
||||
mov eax, dword ptr ds:[_stack]
|
||||
mov eax, dword ptr ds:[VarPtr::stack]
|
||||
call FuncOffs::perk_level_
|
||||
shl eax, 1
|
||||
add dword ptr [esp+4*4], eax // min_dmg
|
||||
@@ -631,7 +631,7 @@ static void __declspec(naked) DisplayBonusRangedDmg() {
|
||||
static void __declspec(naked) DisplayBonusHtHDmg1() {
|
||||
__asm {
|
||||
mov edx, PERK_bonus_hth_damage
|
||||
mov eax, dword ptr ds:[_stack]
|
||||
mov eax, dword ptr ds:[VarPtr::stack]
|
||||
call FuncOffs::perk_level_
|
||||
shl eax, 1
|
||||
add dword ptr [esp+4*4], eax // min_dmg
|
||||
|
||||
+28
-28
@@ -9,7 +9,7 @@ DWORD WeightOnBody = 0;
|
||||
static void __declspec(naked) SharpShooterFix() {
|
||||
__asm {
|
||||
call FuncOffs::stat_level_ // Perception
|
||||
cmp edi, dword ptr ds:[_obj_dude]
|
||||
cmp edi, dword ptr ds:[VarPtr::obj_dude]
|
||||
jne end
|
||||
xchg ecx, eax
|
||||
mov eax, edi // _obj_dude
|
||||
@@ -26,18 +26,18 @@ static void __declspec(naked) pipboy_hack() {
|
||||
__asm {
|
||||
cmp ebx, 0x210 // Back button?
|
||||
je end
|
||||
cmp byte ptr ds:[_holo_flag], 0
|
||||
cmp byte ptr ds:[VarPtr::holo_flag], 0
|
||||
jne end
|
||||
xor ebx, ebx // No man, no problem (c) :-p
|
||||
end:
|
||||
mov eax, ds:[_crnt_func]
|
||||
mov eax, ds:[VarPtr::crnt_func]
|
||||
retn
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) PipAlarm_hack() {
|
||||
__asm {
|
||||
mov ds:[_crnt_func], eax
|
||||
mov ds:[VarPtr::crnt_func], eax
|
||||
mov eax, 0x400
|
||||
call FuncOffs::PipStatus_
|
||||
mov eax, 0x50CC04 // 'iisxxxx1'
|
||||
@@ -123,7 +123,7 @@ loopQueue:
|
||||
call FuncOffs::queue_find_next_
|
||||
jmp loopQueue
|
||||
skip:
|
||||
mov eax, dword ptr ds:[_obj_dude]
|
||||
mov eax, dword ptr ds:[VarPtr::obj_dude]
|
||||
call FuncOffs::queue_find_first_
|
||||
end:
|
||||
push 0x47A6A1
|
||||
@@ -133,7 +133,7 @@ end:
|
||||
|
||||
static void __declspec(naked) remove_jet_addict() {
|
||||
__asm {
|
||||
cmp eax, dword ptr ds:[_wd_obj]
|
||||
cmp eax, dword ptr ds:[VarPtr::wd_obj]
|
||||
jne end
|
||||
cmp dword ptr [edx+0x4], PID_JET // queue_addict.drug_pid == PID_JET?
|
||||
jne end
|
||||
@@ -154,7 +154,7 @@ static void __declspec(naked) item_d_take_drug_hack() {
|
||||
mov eax, esi
|
||||
call FuncOffs::perform_withdrawal_end_
|
||||
skip:
|
||||
mov dword ptr ds:[_wd_obj], esi
|
||||
mov dword ptr ds:[VarPtr::wd_obj], esi
|
||||
mov eax, 2 // type = addiction
|
||||
mov edx, offset remove_jet_addict
|
||||
call FuncOffs::queue_clear_type_
|
||||
@@ -168,7 +168,7 @@ static void __declspec(naked) item_d_load_hack() {
|
||||
sub esp, 4
|
||||
mov [ebp], edi // edi->queue_drug
|
||||
mov ecx, 7
|
||||
mov esi, _drugInfoList+12
|
||||
mov esi, VarPtr::drugInfoList + 12
|
||||
loopDrug:
|
||||
cmp dword ptr [esi+8], 0 // drugInfoList.numeffects
|
||||
je nextDrug
|
||||
@@ -244,11 +244,11 @@ static void __declspec(naked) partyMemberCopyLevelInfo_hook() {
|
||||
cmp eax, -1
|
||||
je end
|
||||
pushad
|
||||
mov dword ptr ds:[_critterClearObj], ebx
|
||||
mov dword ptr ds:[VarPtr::critterClearObj], ebx
|
||||
mov edx, FuncOffs::critterClearObjDrugs_
|
||||
call FuncOffs::queue_clear_type_
|
||||
mov ecx, 8
|
||||
mov edi, _drugInfoList
|
||||
mov edi, VarPtr::drugInfoList
|
||||
mov esi, ebx
|
||||
loopAddict:
|
||||
mov eax, dword ptr [edi] // eax = drug pid
|
||||
@@ -273,7 +273,7 @@ end:
|
||||
static void __declspec(naked) gdProcessUpdate_hack() {
|
||||
__asm {
|
||||
add eax, esi
|
||||
cmp eax, dword ptr ds:[_optionRect + 0xC] // _optionRect.offy
|
||||
cmp eax, dword ptr ds:[VarPtr::optionRect + 0xC] // _optionRect.offy
|
||||
jge skip
|
||||
add eax, 2
|
||||
push 0x44702D
|
||||
@@ -358,7 +358,7 @@ noArmor:
|
||||
mov eax, [esp+0x1C+0x4]
|
||||
test eax, eax
|
||||
jnz haveWeapon
|
||||
cmp dword ptr ds:[_dialog_target_is_party], eax
|
||||
cmp dword ptr ds:[VarPtr::dialog_target_is_party], eax
|
||||
jne end // This is a party member
|
||||
mov eax, [esp+0x18+0x4]
|
||||
test eax, eax
|
||||
@@ -403,7 +403,7 @@ end:
|
||||
|
||||
static void __declspec(naked) inven_pickup_hack() {
|
||||
__asm {
|
||||
mov edx, ds:[_pud]
|
||||
mov edx, ds:[VarPtr::pud]
|
||||
mov edx, [edx] // itemsCount
|
||||
dec edx
|
||||
sub edx, eax
|
||||
@@ -417,7 +417,7 @@ static void __declspec(naked) inven_pickup_hack2() {
|
||||
__asm {
|
||||
test eax, eax
|
||||
jz end
|
||||
mov eax, ds:[_i_wid]
|
||||
mov eax, ds:[VarPtr::i_wid]
|
||||
call FuncOffs::GNW_find_
|
||||
mov ecx, [eax+0x8+0x4] // ecx = _i_wid.rect.y
|
||||
mov eax, [eax+0x8+0x0] // eax = _i_wid.rect.x
|
||||
@@ -451,7 +451,7 @@ end:
|
||||
found:
|
||||
mov ebx, 0x4711DF
|
||||
add edx, [esp+0x40] // inventory_offset
|
||||
mov eax, ds:[_pud]
|
||||
mov eax, ds:[VarPtr::pud]
|
||||
mov ecx, [eax] // itemsCount
|
||||
jecxz skip
|
||||
dec ecx
|
||||
@@ -509,7 +509,7 @@ static void __declspec(naked) PipStatus_AddHotLines_hook() {
|
||||
__asm {
|
||||
call FuncOffs::AddHotLines_
|
||||
xor eax, eax
|
||||
mov dword ptr ds:[_hot_line_count], eax
|
||||
mov dword ptr ds:[VarPtr::hot_line_count], eax
|
||||
retn
|
||||
}
|
||||
}
|
||||
@@ -677,7 +677,7 @@ static void __declspec(naked) obj_save_hack() {
|
||||
dec eax
|
||||
mov edx, [esp+0x1C] // combat_data
|
||||
mov eax, [eax+0x68] // pobj.who_hit_me.cid
|
||||
test byte ptr ds:[_combat_state], 1 // in combat?
|
||||
test byte ptr ds:[VarPtr::combat_state], 1 // in combat?
|
||||
jz clear // No
|
||||
cmp dword ptr [edx], 0 // in combat?
|
||||
jne skip // Yes
|
||||
@@ -743,7 +743,7 @@ static void __declspec(naked) combat_hack() {
|
||||
push eax
|
||||
mov edx, STAT_max_move_points
|
||||
call FuncOffs::stat_level_
|
||||
mov edx, ds:[_gcsd]
|
||||
mov edx, ds:[VarPtr::gcsd]
|
||||
test edx, edx
|
||||
jz skip
|
||||
add eax, [edx+0x8] // gcsd.free_move
|
||||
@@ -751,13 +751,13 @@ skip:
|
||||
pop edx
|
||||
xchg edx, eax // eax = source, edx = Max action points
|
||||
mov [eax+0x40], edx // pobj.curr_mp
|
||||
test byte ptr ds:[_combat_state], 1 // in combat?
|
||||
test byte ptr ds:[VarPtr::combat_state], 1 // in combat?
|
||||
jz end // No
|
||||
mov edx, [eax+0x68] // pobj.cid
|
||||
cmp edx, -1
|
||||
je end
|
||||
push eax
|
||||
mov eax, ds:[_aiInfoList]
|
||||
mov eax, ds:[VarPtr::aiInfoList]
|
||||
shl edx, 4
|
||||
mov dword ptr [edx+eax+0xC], 0 // aiInfo.lastMove
|
||||
pop eax
|
||||
@@ -769,20 +769,20 @@ end:
|
||||
|
||||
static void __declspec(naked) wmTeleportToArea_hack() {
|
||||
__asm {
|
||||
cmp ebx, ds:[_WorldMapCurrArea]
|
||||
cmp ebx, ds:[VarPtr::WorldMapCurrArea]
|
||||
je end
|
||||
mov ds:[_WorldMapCurrArea], ebx
|
||||
mov ds:[VarPtr::WorldMapCurrArea], ebx
|
||||
sub eax, edx
|
||||
add eax, ds:[_wmAreaInfoList]
|
||||
add eax, ds:[VarPtr::wmAreaInfoList]
|
||||
mov edx, [eax+0x30] // wmAreaInfoList.world_posy
|
||||
mov ds:[_world_ypos], edx
|
||||
mov ds:[VarPtr::world_ypos], edx
|
||||
mov edx, [eax+0x2C] // wmAreaInfoList.world_posx
|
||||
mov ds:[_world_xpos], edx
|
||||
mov ds:[VarPtr::world_xpos], edx
|
||||
end:
|
||||
xor eax, eax
|
||||
mov ds:[_target_xpos], eax
|
||||
mov ds:[_target_ypos], eax
|
||||
mov ds:[_In_WorldMap], eax
|
||||
mov ds:[VarPtr::target_xpos], eax
|
||||
mov ds:[VarPtr::target_ypos], eax
|
||||
mov ds:[VarPtr::In_WorldMap], eax
|
||||
push 0x4C5A77
|
||||
retn
|
||||
}
|
||||
|
||||
@@ -91,15 +91,15 @@ static DWORD _stdcall CreditsNextLine(char* buf, DWORD* font, DWORD* colour) {
|
||||
if (strlen(line)) {
|
||||
if (line[0] == '#') {
|
||||
line++;
|
||||
*font = *(DWORD*)_name_font;
|
||||
*font = *VarPtr::name_font;
|
||||
*colour = *(BYTE*)0x6A7F01;
|
||||
} else if (line[0] == '@') {
|
||||
line++;
|
||||
*font = *(DWORD*)_title_font;
|
||||
*colour = *(DWORD*)_title_color;
|
||||
*font = *VarPtr::title_font;
|
||||
*colour = *VarPtr::title_color;
|
||||
} else {
|
||||
*font = *(DWORD*)_name_font;
|
||||
*colour = *(DWORD*)_name_color;
|
||||
*font = *VarPtr::name_font;
|
||||
*colour = *VarPtr::name_color;
|
||||
}
|
||||
}
|
||||
strcpy_s(buf, 256, line);
|
||||
|
||||
@@ -38,20 +38,6 @@ static const char* CritNames[] = {
|
||||
"FailMessage",
|
||||
};
|
||||
|
||||
struct CritStruct {
|
||||
union {
|
||||
struct {
|
||||
DWORD DamageMultiplier;
|
||||
DWORD EffectFlags;
|
||||
DWORD StatCheck;
|
||||
DWORD StatMod;
|
||||
DWORD FailureEffect;
|
||||
DWORD Message;
|
||||
DWORD FailMessage;
|
||||
};
|
||||
DWORD values[7];
|
||||
};
|
||||
};
|
||||
|
||||
static CritStruct* critTable;
|
||||
static CritStruct* playerCrit;
|
||||
@@ -73,13 +59,13 @@ void _stdcall ResetCriticalTable(DWORD critter, DWORD bodypart, DWORD slot, DWOR
|
||||
//It's been a long time since we worried about win9x compatibility, so just sprintf it for goodness sake...
|
||||
char section[16];
|
||||
sprintf_s(section, "c_%02d_%d_%d", critter, bodypart, slot);
|
||||
CritStruct* defaultTable=(CritStruct*)_crit_succ_eff;
|
||||
critTable[slot].values[element]=critTable[slot].DamageMultiplier=GetPrivateProfileIntA(section, CritNames[element], defaultTable[slot].values[element], ".\\CriticalOverrides.ini");
|
||||
CritStruct* defaultTable = VarPtr::crit_succ_eff;
|
||||
critTable[slot].values[element] = critTable[slot].DamageMultiplier=GetPrivateProfileIntA(section, CritNames[element], defaultTable[slot].values[element], ".\\CriticalOverrides.ini");
|
||||
}
|
||||
|
||||
void CritLoad() {
|
||||
if (!Inited) return;
|
||||
CritStruct* defaultTable=(CritStruct*)_crit_succ_eff;
|
||||
CritStruct* defaultTable = VarPtr::crit_succ_eff;
|
||||
if (mode==1) {
|
||||
char section[16];
|
||||
dlogr("Setting up critical hit table using CriticalOverrides.ini", DL_CRITICALS);
|
||||
@@ -107,7 +93,7 @@ void CritLoad() {
|
||||
dlogr("Setting up critical hit table using RP fixes", DL_CRITICALS);
|
||||
memcpy(critTable, defaultTable, 6*9*19*sizeof(CritStruct));
|
||||
memset(&critTable[6*9*19], 0, 6*9*19*sizeof(CritStruct));
|
||||
memcpy(playerCrit, (void*)_pc_crit_succ_eff, 6*9*sizeof(CritStruct));
|
||||
memcpy(playerCrit, (void*)VarPtr::pc_crit_succ_eff, 6*9*sizeof(CritStruct));
|
||||
|
||||
if (mode==3) {
|
||||
char buf[32], buf2[32], buf3[32];
|
||||
@@ -151,7 +137,7 @@ void CritInit() {
|
||||
dlog(". ", DL_INIT);
|
||||
|
||||
if(mode==2 || mode==3) {
|
||||
CritStruct* defaultTable=(CritStruct*)_crit_succ_eff;
|
||||
CritStruct* defaultTable = VarPtr::crit_succ_eff;
|
||||
|
||||
SetEntry(2,4,1,4,0);
|
||||
SetEntry(2,4,1,5,5216);
|
||||
|
||||
@@ -97,10 +97,10 @@ static void RunEditorInternal(SOCKET &s) {
|
||||
|
||||
int numCritters=vec.size();
|
||||
|
||||
int numGlobals=*(int*)_num_game_global_vars;
|
||||
int numMapVars=*(int*)_num_map_global_vars;
|
||||
int numSGlobals=GetNumGlobals();
|
||||
int numArrays=GetNumArrays();
|
||||
int numGlobals = *VarPtr::num_game_global_vars;
|
||||
int numMapVars = *VarPtr::num_map_global_vars;
|
||||
int numSGlobals = GetNumGlobals();
|
||||
int numArrays = GetNumArrays();
|
||||
InternalSend(s, &numGlobals, 4);
|
||||
InternalSend(s, &numMapVars, 4);
|
||||
InternalSend(s, &numSGlobals, 4);
|
||||
@@ -112,8 +112,8 @@ static void RunEditorInternal(SOCKET &s) {
|
||||
int* arrays=new int[numArrays*3];
|
||||
GetArrays(arrays);
|
||||
|
||||
InternalSend(s, *(void**)_game_global_vars, 4*numGlobals);
|
||||
InternalSend(s, *(void**)_map_global_vars, 4*numMapVars);
|
||||
InternalSend(s, *reinterpret_cast<void**>(VarPtr::game_global_vars), 4*numGlobals);
|
||||
InternalSend(s, *reinterpret_cast<void**>(VarPtr::map_global_vars), 4*numMapVars);
|
||||
InternalSend(s, sglobals, sizeof(sGlobalVar)*numSGlobals);
|
||||
InternalSend(s, arrays, numArrays*3*4);
|
||||
for(int i=0;i<numCritters;i++) InternalSend(s, &vec[i][25], 4);
|
||||
@@ -127,12 +127,12 @@ static void RunEditorInternal(SOCKET &s) {
|
||||
case 0:
|
||||
InternalRecv(s, &id, 4);
|
||||
InternalRecv(s, &val, 4);
|
||||
(*(DWORD**)_game_global_vars)[id]=val;
|
||||
(*VarPtr::game_global_vars)[id] = val;
|
||||
break;
|
||||
case 1:
|
||||
InternalRecv(s, &id, 4);
|
||||
InternalRecv(s, &val, 4);
|
||||
(*(DWORD**)_map_global_vars)[id]=val;
|
||||
(*VarPtr::map_global_vars)[id] = val;
|
||||
break;
|
||||
case 2:
|
||||
InternalRecv(s, &id, 4);
|
||||
|
||||
@@ -86,7 +86,7 @@ static void __declspec(naked) GetNumButtonsHook1() {
|
||||
__asm {
|
||||
lea esi, Menus;
|
||||
mov eax, [esi+edi*4];
|
||||
mov eax, [_btncnt+eax*4];
|
||||
mov eax, [VarPtr::btncnt + eax*4];
|
||||
push 0x43F064;
|
||||
retn;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ static void __declspec(naked) GetNumButtonsHook2() {
|
||||
__asm {
|
||||
lea edx, Menus;
|
||||
mov eax, [edx+edi*4];
|
||||
mov eax, [_btncnt+eax*4];
|
||||
mov eax, [VarPtr::btncnt + eax*4];
|
||||
push 0x43F18B;
|
||||
retn;
|
||||
}
|
||||
@@ -104,14 +104,14 @@ static void __declspec(naked) GetNumButtonsHook3() {
|
||||
__asm {
|
||||
lea eax, Menus;
|
||||
mov eax, [eax+edi*4];
|
||||
mov eax, [_btncnt+eax*4];
|
||||
mov eax, [VarPtr::btncnt+eax*4];
|
||||
push 0x43F1EB;
|
||||
retn;
|
||||
}
|
||||
}
|
||||
|
||||
void ResetElevators() {
|
||||
memcpy(Elevators, (void*)_retvals, sizeof(sElevator)*24);
|
||||
memcpy(Elevators, (void*)VarPtr::retvals, sizeof(sElevator)*24);
|
||||
memset(&Elevators[24], 0, sizeof(sElevator)*(ElevatorCount-24));
|
||||
for(int i=0;i<24;i++) Menus[i]=i;
|
||||
for(int i=24;i<ElevatorCount;i++) Menus[i]=0;
|
||||
|
||||
@@ -174,7 +174,7 @@ void _stdcall SetShaderMode(DWORD d, DWORD mode) {
|
||||
int _stdcall LoadShader(const char* path) {
|
||||
if ((GraphicsMode < 4) || (strstr(path, "..")) || (strstr(path, ":"))) return -1;
|
||||
char buf[MAX_PATH];
|
||||
sprintf(buf, "%s\\shaders\\%s", *(char**)_patches, path);
|
||||
sprintf(buf, "%s\\shaders\\%s", *VarPtr::patches, path);
|
||||
for(DWORD d=0;d<shaders.size();d++) {
|
||||
if(!shaders[d].Effect) {
|
||||
if(FAILED(D3DXCreateEffectFromFile(d3d9Device, buf, 0, 0, 0, 0, &shaders[d].Effect, 0))) return -1;
|
||||
@@ -192,7 +192,7 @@ int _stdcall LoadShader(const char* path) {
|
||||
|
||||
sprintf_s(buf, "texname%d", i);
|
||||
if(FAILED(shader.Effect->GetString(buf, &name))) break;
|
||||
sprintf_s(buf, "%s\\art\\stex\\%s", *(char**)_patches, name);
|
||||
sprintf_s(buf, "%s\\art\\stex\\%s", *VarPtr::patches, name);
|
||||
if(FAILED(D3DXCreateTextureFromFileA(d3d9Device,buf,&tex))) continue;
|
||||
sprintf_s(buf, "tex%d", i);
|
||||
shader.Effect->SetTexture(buf, tex);
|
||||
|
||||
@@ -90,7 +90,7 @@ static void LoadFrm(Frm* frm) {
|
||||
char buf[MAX_PATH];
|
||||
IDirect3DTexture9** textures=new IDirect3DTexture9*[frm->frames];
|
||||
for (int i = 0; i < frm->frames; i++) {
|
||||
sprintf(buf, "%s\\art\\heads\\%s\\%d.png", *(char**)_patches, frm->path, i);
|
||||
sprintf(buf, "%s\\art\\heads\\%s\\%d.png", *VarPtr::patches, frm->path, i);
|
||||
if (FAILED(D3DXCreateTextureFromFileExA(d3d9Device, buf, 0, 0, 1, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, 0, &textures[i]))) {
|
||||
for(int j=0;j<i;j++) textures[j]->Release();
|
||||
delete[] textures;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -523,13 +523,13 @@ static void __declspec(naked) BarterPriceHook() {
|
||||
mov args[0], eax;
|
||||
mov args[4], edx;
|
||||
call FuncOffs::barter_compute_value_
|
||||
mov edx, ds:[_btable]
|
||||
mov edx, ds:[VarPtr::btable]
|
||||
mov args[8], eax;
|
||||
mov args[12], edx;
|
||||
xchg eax, edx;
|
||||
call FuncOffs::item_caps_total_
|
||||
mov args[16], eax;
|
||||
mov eax, ds:[_btable]
|
||||
mov eax, ds:[VarPtr::btable]
|
||||
call FuncOffs::item_total_cost_
|
||||
mov args[20], eax;
|
||||
mov eax, edx;
|
||||
@@ -896,7 +896,7 @@ static void _declspec(naked) UseArmorHack() {
|
||||
mov args[0], 3;
|
||||
mov eax, [esp+24]; // item
|
||||
mov args[4], eax;
|
||||
mov eax, ds:[_i_worn]
|
||||
mov eax, ds:[VarPtr::i_worn]
|
||||
mov args[8], eax;
|
||||
pushad;
|
||||
push HOOK_INVENTORYMOVE;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user