mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b185a2022 | ||
|
|
83a44f27b9 | ||
|
|
74cfcaed77 | ||
|
|
b3a91c673a | ||
|
|
8a226b3139 | ||
|
|
34367efc62 | ||
|
|
7bf106751f | ||
|
|
6885fcc2c0 |
@@ -5,7 +5,7 @@ KarmaLoss=
|
||||
HighlightFail1=Сенсор движения недоступен.
|
||||
HighlightFail2=Сенсор движения разряжен.
|
||||
SuperStimExploitMsg=Вы не можете использовать суперстимулятор на здоровом персонаже!
|
||||
BlockedCombat=Вы не можете сейчас начать бой.
|
||||
BlockedCombat=Начать бой в данный момент невозможно.
|
||||
SaveSfallDataFail=ОШИБКА записи расширенной информации! Убедитесь что другие программы не обращаются к файлам/каталогам сохраняемой игры и попробуйте еще раз.
|
||||
PartyLvlMsg=Ур.:
|
||||
PartyACMsg=КБ:
|
||||
|
||||
+31
-4
@@ -517,12 +517,12 @@ fix:
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static long __fastcall RollFriendlyFire(TGameObj* target, TGameObj* attacker) {
|
||||
static bool __fastcall RollFriendlyFire(TGameObj* target, TGameObj* attacker) {
|
||||
if (AI_CheckFriendlyFire(target, attacker)) {
|
||||
long dice = fo_roll_random(1, 10);
|
||||
return (fo_stat_level(attacker, STAT_iq) >= dice); // 1 - is friendly
|
||||
return (fo_stat_level(attacker, STAT_iq) >= dice); // true - is friendly
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void __declspec(naked) combat_safety_invalidate_weapon_func_hook_check() {
|
||||
@@ -531,7 +531,7 @@ static void __declspec(naked) combat_safety_invalidate_weapon_func_hook_check()
|
||||
pushadc;
|
||||
mov ecx, esi; // target
|
||||
call RollFriendlyFire;
|
||||
test eax, eax;
|
||||
test al, al;
|
||||
jnz friendly;
|
||||
popadc;
|
||||
jmp combat_ctd_init_;
|
||||
@@ -541,6 +541,31 @@ friendly:
|
||||
}
|
||||
}
|
||||
|
||||
static long __fastcall CheckFireBurst(TGameObj* attacker, TGameObj* target, TGameObj* weapon) {
|
||||
if (fo_item_w_anim_weap(weapon, ATKTYPE_RWEAPON_SECONDARY) == ANIM_fire_burst) {
|
||||
return !fo_combat_safety_invalidate_weapon_func(attacker, weapon, ATKTYPE_RWEAPON_SECONDARY, target, 0, 0);
|
||||
}
|
||||
return 1; // allow
|
||||
}
|
||||
|
||||
static void __declspec(naked) ai_pick_hit_mode_hack() {
|
||||
__asm {
|
||||
cmp eax, 1;
|
||||
je isAllowed;
|
||||
xor eax, eax;
|
||||
retn;
|
||||
isAllowed:
|
||||
cmp ecx, 3; // source IQ (no check for low IQ)
|
||||
jl skip;
|
||||
push ebp; // item
|
||||
mov edx, edi; // target
|
||||
mov ecx, esi; // source
|
||||
call CheckFireBurst;
|
||||
skip:
|
||||
retn;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void __declspec(naked) ai_try_attack_hack_check_safe_weapon() {
|
||||
@@ -617,6 +642,8 @@ void AI_Init() {
|
||||
// Fix to reduce friendly fire in burst attacks
|
||||
// Adds a check/roll for friendly critters in the line of fire when AI uses burst attacks
|
||||
HookCall(0x421666, combat_safety_invalidate_weapon_func_hook_check);
|
||||
// for unset (random) value of 'area_attack_mode'
|
||||
MakeCall(0x429F56, ai_pick_hit_mode_hack);
|
||||
|
||||
// Fix for duplicate critters being added to the list of potential targets for AI
|
||||
MakeCall(0x428E75, ai_find_attackers_hack_target2, 2);
|
||||
|
||||
+34
-30
@@ -89,7 +89,7 @@ static const DWORD anim_set_C_shift[] = { // flags
|
||||
|
||||
static const DWORD anim_set_10[] = { // anim_0
|
||||
0x413C7E, 0x413F17, 0x415C24, 0x415D16, 0x415D44,
|
||||
/*0x413E8A, - conflict with 0x413E88*/
|
||||
0x413E8A, /*- conflict with 0x413E88*/
|
||||
};
|
||||
|
||||
static const DWORD anim_set_14[] = { // anim_0.source
|
||||
@@ -263,29 +263,6 @@ static void __declspec(naked) anim_cleanup_hack() {
|
||||
}
|
||||
}
|
||||
|
||||
static long __fastcall LockAnimSlot(long slot) {
|
||||
if (animSet[slot].counter != animSet[slot].totalAnimCount) {
|
||||
lockAnimSet[slot] = 8;
|
||||
}
|
||||
return slot;
|
||||
}
|
||||
|
||||
static long __fastcall UnlockAnimSlot() {
|
||||
long lockCount = 0;
|
||||
for (std::vector<int8_t>::iterator it = lockAnimSet.begin(); it != lockAnimSet.end(); ++it) {
|
||||
if (*it > 0) {
|
||||
(*it)--;
|
||||
lockCount++;
|
||||
}
|
||||
}
|
||||
if (lockCount >= lockLimit) fo_debug_printf("\n[SFALL] Warning: The number of animated slots in the lock is too large, locked %d of %d", lockCount, animationLimit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static BYTE __fastcall CheckLockAnimSlot(long, long slot) {
|
||||
return lockAnimSet[slot];
|
||||
}
|
||||
|
||||
static void __fastcall CheckAppendReg(long, long totalAnims) {
|
||||
long slot = appendSlot;
|
||||
appendSlot = -2;
|
||||
@@ -345,13 +322,38 @@ isAppend:
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static BYTE __fastcall CheckLockAnimSlot(long, long slot) {
|
||||
return lockAnimSet[slot];
|
||||
}
|
||||
|
||||
static long __fastcall LockAnimSlot(long slot) {
|
||||
if (animSet[slot].counter != animSet[slot].totalAnimCount) {
|
||||
lockAnimSet[slot] = 8;
|
||||
}
|
||||
return slot;
|
||||
}
|
||||
|
||||
static long __fastcall UnlockAnimSlot() {
|
||||
long lockCount = 0;
|
||||
for (std::vector<int8_t>::iterator it = lockAnimSet.begin(); it != lockAnimSet.end(); ++it) {
|
||||
if (*it > 0) {
|
||||
(*it)--;
|
||||
lockCount++;
|
||||
}
|
||||
}
|
||||
if (lockCount >= lockLimit) fo_debug_printf("\n[SFALL] Warning: The number of animated slots in the lock is too large, locked %d of %d", lockCount, animationLimit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __declspec(naked) register_end_hack_end() {
|
||||
__asm {
|
||||
mov eax, animSet;
|
||||
test word ptr [eax][esi][0xC], e_Append; // slot with added animation?
|
||||
jz skip;
|
||||
and word ptr [eax][esi][0xC], ~(e_Append | e_Suspend); // animSet[].flags (unset flags)
|
||||
skip:
|
||||
// mov eax, animSet;
|
||||
// test word ptr [eax][esi][0xC], e_Append; // slot with added animation?
|
||||
// jz skip;
|
||||
// and word ptr [eax][esi][0xC], ~(e_Append | e_Suspend); // animSet[].flags (unset flags)
|
||||
//skip:
|
||||
call UnlockAnimSlot;
|
||||
pop esi;
|
||||
pop edx;
|
||||
@@ -544,16 +546,18 @@ void Animations_Init() {
|
||||
}
|
||||
|
||||
// Improved implementation of animation registration
|
||||
#ifndef NDEBUG
|
||||
MakeCall(0x413E88, check_registry_hack, 2);
|
||||
MakeCall(0x413DCE, anim_cleanup_hack, 1);
|
||||
SafeWrite16(0x413DD4, 0x4478); // js 0x413E1A
|
||||
MakeCall(0x413CE8, register_end_hack_begin, 1);
|
||||
MakeJump(0x413D64, register_end_hack_end);
|
||||
SafeWrite16(0x413D0B, 0xC689); // and dl, not 8 > mov esi, eax (keep offset to anim_set slot)
|
||||
SafeWrite8(0x413D0D, CODETYPE_Nop);
|
||||
#endif
|
||||
|
||||
// Implement a temporary lock on an animation slot after it is cleared by the register_clear_ function
|
||||
// to prevent it from being used as a free slot when registering a nested animation
|
||||
MakeJump(0x413D64, register_end_hack_end);
|
||||
HookCall(0x413C97, register_clear_hook);
|
||||
MakeCall(0x413BB7, anim_free_slot_hack);
|
||||
MakeCall(0x4186CF, anim_stop_hack);
|
||||
|
||||
+37
-8
@@ -76,6 +76,22 @@ void BugFixes_Initialization() {
|
||||
SafeWriteBytes(0x4CA9DC, (BYTE*)&data, 5); // mouse_get_position_
|
||||
}
|
||||
|
||||
static std::vector<AIcap> aiCapsBackup;
|
||||
|
||||
void combat_ai_init_backup() {
|
||||
long num_caps = *ptr_num_caps;
|
||||
AIcap* caps = *ptr_cap;
|
||||
|
||||
aiCapsBackup.resize(num_caps);
|
||||
std::memcpy(&aiCapsBackup[0], caps, num_caps * sizeof(AIcap));
|
||||
}
|
||||
|
||||
static void combat_ai_reset() {
|
||||
long num_caps = *ptr_num_caps;
|
||||
AIcap* caps = *ptr_cap;
|
||||
std::memcpy(caps, &aiCapsBackup[0], num_caps * sizeof(AIcap));
|
||||
}
|
||||
|
||||
// fix for vanilla negate operator not working on floats
|
||||
static void __declspec(naked) NegateFixHack() {
|
||||
static const DWORD NegateFixHack_Back = 0x46AB77;
|
||||
@@ -1998,35 +2014,36 @@ skip:
|
||||
|
||||
static DWORD firstItemDrug = -1;
|
||||
|
||||
// when there are no more items in the inventory
|
||||
static void __declspec(naked) ai_check_drugs_hack_break() {
|
||||
static const DWORD ai_check_drugs_hack_Ret = 0x42878B;
|
||||
__asm {
|
||||
mov eax, -1;
|
||||
cmp firstItemDrug, eax;
|
||||
jne firstDrugs; // pid != -1
|
||||
jne useDrugs; // pid != -1
|
||||
add esp, 4;
|
||||
jmp ai_check_drugs_hack_Ret; // break loop
|
||||
firstDrugs:
|
||||
useDrugs: // use the first found item
|
||||
mov dword ptr [esp + 4], eax; // slot set -1
|
||||
mov edi, firstItemDrug;
|
||||
mov ebx, edi;
|
||||
mov firstItemDrug, eax; // set -1
|
||||
retn; // use drug
|
||||
retn; // goto check (use drug)
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) ai_check_drugs_hack_check() {
|
||||
__asm {
|
||||
test [esp + 0x34 - 0x30 + 4], 0; // check NoInvenItem != 0
|
||||
jnz skip;
|
||||
test [esp + 0x34 - 0x30 + 4], 1; // check NoInvenItem != 0
|
||||
jnz skip; // there are no more drugs in inventory
|
||||
cmp dword ptr [edx + 0xAC], -1; // cap.chem_primary_desire (Chemical Preference Number)
|
||||
jnz checkDrugs;
|
||||
skip:
|
||||
xor ebx, ebx; // set ZF for skipping preference list check
|
||||
retn;
|
||||
checkDrugs:
|
||||
cmp ebx, [edx + 0xAC]; // check item.pid against cap.chem_primary_desire
|
||||
retn;
|
||||
cmp ebx, [edx + 0xAC]; // item.pid == cap.chem_primary_desire?
|
||||
retn; // if yes, use it (jz 0x4286C7); otherwise, check the other values of chem_primary_desire
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2046,6 +2063,14 @@ skip:
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) cai_cap_save_hook() {
|
||||
__asm {
|
||||
add esi, 4;
|
||||
mov edx, [edx];
|
||||
jmp db_fwriteInt_;
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) config_get_values_hack() {
|
||||
static const DWORD config_get_values_hack_Get = 0x42C13F;
|
||||
static const DWORD config_get_values_hack_OK = 0x42C14D;
|
||||
@@ -3089,6 +3114,7 @@ noObject:
|
||||
|
||||
void BugFixes_OnGameLoad() {
|
||||
dudeIsAnimDeath = false;
|
||||
combat_ai_reset();
|
||||
}
|
||||
|
||||
void BugFixes_Init()
|
||||
@@ -3480,7 +3506,7 @@ void BugFixes_Init()
|
||||
MakeCall(0x48A704, obj_move_to_tile_hack);
|
||||
|
||||
// Fix for critters killed in combat by scripting still being able to move in their combat turn if the distance parameter
|
||||
// in their AI packages is set to stay_close/charge, or NPCsTryToSpendExtraAP is enabled
|
||||
// in their AI packets is set to stay_close/charge, or NPCsTryToSpendExtraAP is enabled
|
||||
const DWORD aiCombatTurnRunAddr[] = {
|
||||
0x42A1A8, // ai_move_steps_closer_ (old 0x42B24D)
|
||||
0x42898D, // ai_run_away_ (potential fix)
|
||||
@@ -3617,6 +3643,9 @@ void BugFixes_Init()
|
||||
dlogr(" Done", DL_FIX);
|
||||
}
|
||||
|
||||
// Fix for chem_primary_desire values in party member AI packets not being saved correctly
|
||||
HookCall(0x42803E, cai_cap_save_hook);
|
||||
|
||||
// Fix for config_get_values_ engine function not getting the last value in a list if the list has less than the requested
|
||||
// number of values (for chem_primary_desire)
|
||||
MakeJump(0x42C12C, config_get_values_hack);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
void BugFixes_Init();
|
||||
void BugFixes_OnGameLoad();
|
||||
void BugFixes_Initialization();
|
||||
void combat_ai_init_backup();
|
||||
|
||||
void BugFixes_DrugsSaveFix(HANDLE file);
|
||||
bool BugFixes_DrugsLoadFix(HANDLE file);
|
||||
|
||||
@@ -304,6 +304,8 @@ enum ProtoID : unsigned long
|
||||
PID_Player = 0x01000000,
|
||||
|
||||
// scenery
|
||||
PID_RAD_GOO_1 = 0x020003D9,
|
||||
PID_RAD_GOO_4 = 0x020003DC,
|
||||
PID_DRIVABLE_CAR = 0x020003F1, // index 1009
|
||||
|
||||
// misc type
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#define FO_VAR_bottom_line 0x664524
|
||||
#define FO_VAR_btable 0x59E944
|
||||
#define FO_VAR_btncnt 0x43EA1C
|
||||
#define FO_VAR_cap 0x518064
|
||||
#define FO_VAR_carCurrentArea 0x672E68
|
||||
#define FO_VAR_carGasAmount 0x672E6C
|
||||
#define FO_VAR_card_old_fid1 0x5709EC
|
||||
@@ -203,6 +204,7 @@
|
||||
#define FO_VAR_name_color 0x56D744
|
||||
#define FO_VAR_name_font 0x56D74C
|
||||
#define FO_VAR_name_sort_list 0x56FCB0
|
||||
#define FO_VAR_num_caps 0x518060
|
||||
#define FO_VAR_num_game_global_vars 0x5186C4
|
||||
#define FO_VAR_num_map_global_vars 0x519574
|
||||
#define FO_VAR_num_windows 0x6ADF24
|
||||
|
||||
@@ -97,6 +97,8 @@ FUNC(combat_check_bad_shot_, 0x426614)
|
||||
FUNC(combat_ctd_init_, 0x422EC4)
|
||||
FUNC(combat_delete_critter_, 0x426DDC)
|
||||
FUNC(combat_input_, 0x4227F4)
|
||||
FUNC(combat_safety_invalidate_weapon_, 0x4213E8)
|
||||
FUNC(combat_safety_invalidate_weapon_func_, 0x4213FC)
|
||||
FUNC(combat_should_end_, 0x422C60)
|
||||
FUNC(combat_turn_, 0x42299C)
|
||||
FUNC(combat_turn_run_, 0x4227DC)
|
||||
@@ -573,6 +575,7 @@ FUNC(text_object_create_, 0x4B036C)
|
||||
FUNC(tile_coord_, 0x4B1674) // eax - tilenum, edx (int*) - x, ebx (int*) - y
|
||||
FUNC(tile_dir_, 0x4B1ABC)
|
||||
FUNC(tile_dist_, 0x4B185C)
|
||||
FUNC(tile_idistance_, 0x416360) // EST
|
||||
FUNC(tile_num_, 0x4B1754)
|
||||
FUNC(tile_num_beyond_, 0x4B1B84)
|
||||
FUNC(tile_num_in_direction_, 0x4B1A6C)
|
||||
|
||||
@@ -25,6 +25,7 @@ WRAP_WATCOM_FFUNC3(long, ai_have_ammo, TGameObj*, critter, TGameObj*, item, TGam
|
||||
WRAP_WATCOM_FFUNC3(long, ai_pick_hit_mode, TGameObj*, source, TGameObj*, item, TGameObj*, target)
|
||||
WRAP_WATCOM_FFUNC3(TGameObj*, ai_search_inven_weap, TGameObj*, source, long, apCheck, TGameObj*, target)
|
||||
WRAP_WATCOM_FFUNC3(void, check_for_death, TGameObj*, critter, long, amountDamage, long*, flags)
|
||||
WRAP_WATCOM_FFUNC6(long, combat_safety_invalidate_weapon_func, TGameObj*, source, TGameObj*, weapon, long, hitMode, TGameObj*, targetA, DWORD*, outSafeRange, TGameObj*, targetB)
|
||||
WRAP_WATCOM_FFUNC3(void, correctFidForRemovedItem, TGameObj*, critter, TGameObj*, item, long, slotFlag)
|
||||
WRAP_WATCOM_FFUNC7(long, createWindow, const char*, winName, DWORD, x, DWORD, y, DWORD, width, DWORD, height, long, color, long, flags)
|
||||
WRAP_WATCOM_FFUNC4(long, determine_to_hit, TGameObj*, source, TGameObj*, target, long, bodyPart, long, hitMode)
|
||||
@@ -64,6 +65,7 @@ WRAP_WATCOM_FFUNC4(void, wmInterfaceDrawSubTileRectFogged, BYTE*, surface, long,
|
||||
WRAP_WATCOM_FFUNC3(const char*, interpretGetString, TProgram*, scriptPtr, DWORD, dataType, DWORD, strId)
|
||||
|
||||
/* stdcall */
|
||||
WRAP_WATCOM_FUNC2(long, anim_can_use_door, TGameObj*, source, TGameObj*, object)
|
||||
WRAP_WATCOM_FUNC1(bool, art_exists, long, artFid)
|
||||
WRAP_WATCOM_FUNC0(void, art_flush)
|
||||
WRAP_WATCOM_FUNC1(const char*, art_get_name, long, artFID)
|
||||
@@ -84,6 +86,7 @@ WRAP_WATCOM_FUNC1(void, critter_pc_set_name, const char*, newName) // Change the
|
||||
WRAP_WATCOM_FUNC1(long, critterIsOverloaded, TGameObj*, critter)
|
||||
WRAP_WATCOM_FUNC1(void, display_print, const char*, msg) // Displays message in main UI console window
|
||||
WRAP_WATCOM_FUNC0(void, display_stats)
|
||||
WRAP_WATCOM_FUNC1(long, critter_kill_count_type, TGameObj*, critter)
|
||||
// Execute script proc by internal proc number (from script's proc table, basically a sequential number of a procedure as defined in code, starting from 1)
|
||||
WRAP_WATCOM_FUNC2(void, executeProcedure, TProgram*, sptr, long, procPosition)
|
||||
WRAP_WATCOM_FUNC1(long, folder_print_line, const char*, text)
|
||||
@@ -202,6 +205,7 @@ WRAP_WATCOM_FUNC2(long, stat_level, TGameObj*, critter, long, statId)
|
||||
WRAP_WATCOM_FUNC1(long, text_font, long, fontNum)
|
||||
WRAP_WATCOM_FUNC2(long, tile_dist, long, scrTile, long, dstTile)
|
||||
WRAP_WATCOM_FUNC2(long, tile_dir, long, scrTile, long, dstTile)
|
||||
WRAP_WATCOM_FUNC2(long, tile_idistance, long, sourceTile, long, targetTile)
|
||||
WRAP_WATCOM_FUNC1(long, tile_on_edge, long, tile)
|
||||
WRAP_WATCOM_FUNC0(void, tile_refresh_display) // Redraws the whole screen
|
||||
WRAP_WATCOM_FUNC2(void, tile_refresh_rect, BoundRect*, boundRect, long, elevation) // Redraws the given rectangle on screen
|
||||
|
||||
@@ -917,19 +917,19 @@ struct LSData {
|
||||
};
|
||||
|
||||
struct AIcap {
|
||||
long name;
|
||||
const char* name;
|
||||
long packet_num;
|
||||
long max_dist;
|
||||
long min_to_hit;
|
||||
long min_hp;
|
||||
long aggression;
|
||||
long aggression; // unused
|
||||
long hurt_too_much;
|
||||
long secondary_freq;
|
||||
long called_freq;
|
||||
long font;
|
||||
long color;
|
||||
long outline_color;
|
||||
long chance;
|
||||
long chance_message;
|
||||
long combat_message_data[24];
|
||||
long area_attack_mode;
|
||||
long run_away_mode;
|
||||
@@ -937,12 +937,10 @@ struct AIcap {
|
||||
long distance;
|
||||
long attack_who;
|
||||
long chem_use;
|
||||
long chem_primary_desire;
|
||||
long chem_primary_desire1;
|
||||
long chem_primary_desire2;
|
||||
long chem_primary_desire[3];
|
||||
long disposition;
|
||||
long body_type;
|
||||
long general_type;
|
||||
const char* body_type; // unused
|
||||
const char* general_type; // unused
|
||||
|
||||
inline AIpref::distance getDistance() {
|
||||
return (AIpref::distance)distance;
|
||||
|
||||
@@ -14,6 +14,7 @@ PTR_(BlueColor, BYTE)
|
||||
PTR_(bottom_line, DWORD)
|
||||
PTR_(btable, DWORD)
|
||||
PTR_(btncnt, DWORD)
|
||||
PTR_(cap, AIcap*) // dynamic array
|
||||
PTR_(carCurrentArea, DWORD)
|
||||
PTR_(carGasAmount, long) // from 0 to 80000
|
||||
PTR_(cmap, DWORD)
|
||||
@@ -129,6 +130,7 @@ PTR_(Mutate_, DWORD)
|
||||
PTR_(name_color, DWORD)
|
||||
PTR_(name_font, DWORD)
|
||||
PTR_(name_sort_list, DWORD)
|
||||
PTR_(num_caps, DWORD)
|
||||
PTR_(num_game_global_vars, DWORD)
|
||||
PTR_(num_map_global_vars, DWORD)
|
||||
PTR_(num_windows, DWORD)
|
||||
|
||||
@@ -1449,11 +1449,7 @@ void Graphics_Init() {
|
||||
|
||||
if (GraphicsMode) {
|
||||
dlog("Applying DX9 graphics patch.", DL_INIT);
|
||||
#ifdef WIN2K
|
||||
#define _DLL_NAME "d3dx9_42.dll"
|
||||
#else
|
||||
#define _DLL_NAME "d3dx9_43.dll"
|
||||
#endif
|
||||
HMODULE h = LoadLibraryEx(_DLL_NAME, 0, LOAD_LIBRARY_AS_DATAFILE);
|
||||
if (!h) {
|
||||
MessageBoxA(0, "You have selected DirectX graphics mode, but " _DLL_NAME " is missing.\n"
|
||||
|
||||
+1
-1
@@ -180,7 +180,7 @@ enum TerrainHoverImage {
|
||||
HVRIMG_x_shift = (HVRIMG_width / 4) + 25 // adjust x position
|
||||
};
|
||||
|
||||
static std::array<unsigned char, HVRIMG_size> wmTmpBuffer;
|
||||
static std::tr1::array<unsigned char, HVRIMG_size> wmTmpBuffer;
|
||||
static bool isHoveringHotspot = false;
|
||||
static bool backImageIsCopy = false;
|
||||
|
||||
|
||||
@@ -371,6 +371,7 @@ static void __stdcall GameInitialized(int initResult) { // OnAfterGameInit
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
combat_ai_init_backup(); // BugFixes
|
||||
RemoveSavFiles();
|
||||
Sound_OnAfterGameInit();
|
||||
BarBoxes_SetMaxSlots();
|
||||
|
||||
@@ -595,12 +595,12 @@ long __fastcall sfgame_tile_num_beyond(long sourceTile, long targetTile, long ma
|
||||
long diffY_x2 = 2 * std::abs(diffY);
|
||||
|
||||
const int step = 4;
|
||||
long stepCounter = step - 1;
|
||||
long stepCounter = 1;
|
||||
|
||||
if (diffX_x2 > diffY_x2) {
|
||||
long stepY = diffY_x2 - (diffX_x2 >> 1);
|
||||
while (true) {
|
||||
if (++stepCounter == step) {
|
||||
if (!--stepCounter) {
|
||||
long tile = fo_tile_num(target_X, target_Y);
|
||||
//fo_debug_printf("\ntile_num: %d [x:%d y:%d]", tile, target_X, target_Y);
|
||||
if (tile != lastTile) {
|
||||
@@ -611,7 +611,7 @@ long __fastcall sfgame_tile_num_beyond(long sourceTile, long targetTile, long ma
|
||||
//}
|
||||
lastTile = tile;
|
||||
}
|
||||
stepCounter = 0;
|
||||
stepCounter = step;
|
||||
}
|
||||
if (stepY >= 0) {
|
||||
stepY -= diffX_x2;
|
||||
@@ -634,7 +634,7 @@ long __fastcall sfgame_tile_num_beyond(long sourceTile, long targetTile, long ma
|
||||
} else {
|
||||
long stepX = diffX_x2 - (diffY_x2 >> 1);
|
||||
while (true) {
|
||||
if (++stepCounter == step) {
|
||||
if (!--stepCounter) {
|
||||
long tile = fo_tile_num(target_X, target_Y);
|
||||
//fo_debug_printf("\ntile_num: %d [x:%d y:%d]", tile, target_X, target_Y);
|
||||
if (tile != lastTile) {
|
||||
@@ -645,7 +645,7 @@ long __fastcall sfgame_tile_num_beyond(long sourceTile, long targetTile, long ma
|
||||
//}
|
||||
lastTile = tile;
|
||||
}
|
||||
stepCounter = 0;
|
||||
stepCounter = step;
|
||||
}
|
||||
if (stepX >= 0) {
|
||||
stepX -= diffY_x2;
|
||||
|
||||
+1
-4
@@ -1,6 +1,6 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
# Visual C++ Express 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ddraw", "ddraw.vcxproj", "{FB9023DA-CA5E-4704-B601-407810963EF0}"
|
||||
EndProject
|
||||
Global
|
||||
@@ -8,7 +8,6 @@ Global
|
||||
Debug|Win32 = Debug|Win32
|
||||
DevXP|Win32 = DevXP|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
Win2K|Win32 = Win2K|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{FB9023DA-CA5E-4704-B601-407810963EF0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
@@ -17,8 +16,6 @@ Global
|
||||
{FB9023DA-CA5E-4704-B601-407810963EF0}.DevXP|Win32.Build.0 = DevXP|Win32
|
||||
{FB9023DA-CA5E-4704-B601-407810963EF0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FB9023DA-CA5E-4704-B601-407810963EF0}.Release|Win32.Build.0 = Release|Win32
|
||||
{FB9023DA-CA5E-4704-B601-407810963EF0}.Win2K|Win32.ActiveCfg = Win2K|Win32
|
||||
{FB9023DA-CA5E-4704-B601-407810963EF0}.Win2K|Win32.Build.0 = Win2K|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
+4
-75
@@ -13,10 +13,6 @@
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Win2K|Win32">
|
||||
<Configuration>Win2K</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{FB9023DA-CA5E-4704-B601-407810963EF0}</ProjectGuid>
|
||||
@@ -36,12 +32,6 @@
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win2K|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
@@ -57,9 +47,6 @@
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DevXP|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Win2K|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
@@ -71,16 +58,12 @@
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='DevXP|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Win2K|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='DevXP|Win32'">$(Configuration)\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Win2K|Win32'">$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='DevXP|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Win2K|Win32'">false</LinkIncremental>
|
||||
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
|
||||
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='DevXP|Win32'">false</GenerateManifest>
|
||||
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Win2K|Win32'">false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
@@ -99,7 +82,7 @@
|
||||
<Link>
|
||||
<AdditionalDependencies>d3d9.lib;d3dx9.lib;dinput.lib;Strmiids.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||
<DelayLoadDLLs>ws2_32.dll;d3d9.dll;d3dx9d_43.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<DelayLoadDLLs>ws2_32.dll;d3d9.dll;d3dx9d_42.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>false</OptimizeReferences>
|
||||
@@ -151,7 +134,7 @@
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||
<DelayLoadDLLs>ws2_32.dll;d3d9.dll;d3dx9_43.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<DelayLoadDLLs>ws2_32.dll;d3d9.dll;d3dx9_42.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
@@ -165,6 +148,7 @@
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<AdditionalLibraryDirectories>$(DXSDK_DIR)lib\x86\</AdditionalLibraryDirectories>
|
||||
<MinimumRequiredVersion>5.00</MinimumRequiredVersion>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>"$(ProjectDir)postbuild.cmd" release "$(TargetPath)"</Command>
|
||||
@@ -201,7 +185,7 @@
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||
<DelayLoadDLLs>ws2_32.dll;d3d9.dll;d3dx9_43.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<DelayLoadDLLs>ws2_32.dll;d3d9.dll;d3dx9_42.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
@@ -220,59 +204,6 @@
|
||||
<Command>"$(ProjectDir)postbuild.cmd" devxp "$(TargetPath)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win2K|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Full</Optimization>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<OmitFramePointers>true</OmitFramePointers>
|
||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
||||
<PreprocessorDefinitions>INITGUID;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;WIN2K;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CallingConvention>Cdecl</CallingConvention>
|
||||
<ForcedIncludeFiles>stdafx.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<AdditionalIncludeDirectories>C:\DXSDK_Feb2010\Include\</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>d3d9.lib;d3dx9.lib;dinput.lib;Strmiids.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
|
||||
<DelayLoadDLLs>ws2_32.dll;d3d9.dll;d3dx9_42.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<EntryPointSymbol>
|
||||
</EntryPointSymbol>
|
||||
<NoEntryPoint>false</NoEntryPoint>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
|
||||
<AdditionalLibraryDirectories>C:\DXSDK_Feb2010\Lib\x86\</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>"$(ProjectDir)postbuild.cmd" win2k "$(TargetPath)"</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>WIN2K;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="AI.h" />
|
||||
<ClInclude Include="DamageMod.h" />
|
||||
@@ -415,7 +346,6 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DevXP|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Win2K|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Tiles.cpp" />
|
||||
<ClCompile Include="SpeedPatch.cpp" />
|
||||
@@ -435,7 +365,6 @@
|
||||
<MASM Include="win2kcompat.asm">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DevXP|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
</MASM>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
#pragma once
|
||||
#pragma message("Compiling precompiled headers.\n")
|
||||
|
||||
#ifdef WIN2K
|
||||
#define WINVER _WIN32_WINNT_WIN2K
|
||||
#define _WIN32_WINNT _WIN32_WINNT_WIN2K
|
||||
#else
|
||||
#define WINVER _WIN32_WINNT_WINXP
|
||||
#define _WIN32_WINNT _WIN32_WINNT_WINXP
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
+2
-6
@@ -25,10 +25,6 @@
|
||||
#define VERSION_MAJOR 3
|
||||
#define VERSION_MINOR 8
|
||||
#define VERSION_BUILD 30
|
||||
#define VERSION_REV 0
|
||||
#define VERSION_REV 1
|
||||
|
||||
#ifdef WIN2K
|
||||
#define VERSION_STRING "3.8.30 win2k"
|
||||
#else
|
||||
#define VERSION_STRING "3.8.30"
|
||||
#endif
|
||||
#define VERSION_STRING "3.8.30.1"
|
||||
|
||||
Reference in New Issue
Block a user