mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Cosmetic edits: unified the placement of __declspec keyword
* it's recommended to place __declspec before the return type. (ref: https://stackoverflow.com/q/13613864 )
This commit is contained in:
@@ -121,7 +121,7 @@ static void __fastcall WriteGameLog(const char* a) {
|
||||
ConsoleWindow::instance().write(a, ConsoleWindow::Source::GAME);
|
||||
}
|
||||
|
||||
static void __declspec(naked) debug_printf_hook() {
|
||||
static __declspec(naked) void debug_printf_hook() {
|
||||
__asm {
|
||||
call fo::funcoffs::vsprintf_;
|
||||
pushadc;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace func
|
||||
|
||||
// Prints debug message to game debug.log file for develop build
|
||||
#ifndef NDEBUG
|
||||
void __declspec(naked) dev_printf(const char* fmt, ...) {
|
||||
__declspec(naked) void dev_printf(const char* fmt, ...) {
|
||||
__asm jmp fo::funcoffs::debug_printf_;
|
||||
}
|
||||
#else
|
||||
@@ -117,7 +117,7 @@ void dev_printf(...) {}
|
||||
|
||||
|
||||
// prints message to debug.log file
|
||||
void __declspec(naked) debug_printf(const char* fmt, ...) {
|
||||
__declspec(naked) void debug_printf(const char* fmt, ...) {
|
||||
__asm jmp fo::funcoffs::debug_printf_;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ isNotStr:
|
||||
|
||||
// prints scripting error in debug.log and stops current script execution by performing longjmp
|
||||
// USE WITH CAUTION
|
||||
void __declspec(naked) interpretError(const char* fmt, ...) {
|
||||
__declspec(naked) void interpretError(const char* fmt, ...) {
|
||||
__asm jmp fo::funcoffs::interpretError_;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ void dev_printf(...);
|
||||
*/
|
||||
|
||||
// prints message to debug.log file
|
||||
void __declspec() debug_printf(const char* fmt, ...);
|
||||
void debug_printf(const char* fmt, ...);
|
||||
|
||||
void interpretReturnValue(Program* scriptPtr, DWORD val, DWORD valType);
|
||||
|
||||
@@ -50,7 +50,7 @@ DWORD __fastcall interpretGetValue(Program* scriptPtr, DWORD &outType);
|
||||
|
||||
// prints scripting error in debug.log and stops current script execution by performing longjmp
|
||||
// USE WITH CAUTION
|
||||
void __declspec() interpretError(const char* fmt, ...);
|
||||
void interpretError(const char* fmt, ...);
|
||||
|
||||
long __fastcall db_init(const char* path_dat, const char* path_patches);
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ static void __fastcall DisplayPrint(const char* message, bool lineBreak) {
|
||||
__asm call fo::funcoffs::display_redraw_;
|
||||
}
|
||||
|
||||
static void __declspec(naked) display_print_hack_replacemet() {
|
||||
static __declspec(naked) void display_print_hack_replacemet() {
|
||||
__asm {
|
||||
push ecx;
|
||||
push edx;
|
||||
@@ -129,7 +129,7 @@ static void __declspec(naked) display_print_hack_replacemet() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) display_print_line_break() {
|
||||
static __declspec(naked) void display_print_line_break() {
|
||||
__asm {
|
||||
push ecx;
|
||||
mov dl, 1; // with line break
|
||||
@@ -163,7 +163,7 @@ static void __stdcall SplitPrintMessage(char* message, void* printFunc) {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) inven_display_msg_line_break() {
|
||||
static __declspec(naked) void inven_display_msg_line_break() {
|
||||
__asm {
|
||||
push ecx;
|
||||
push fo::funcoffs::inven_display_msg_;
|
||||
@@ -174,7 +174,7 @@ static void __declspec(naked) inven_display_msg_line_break() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) display_print_line_break_extHRP() {
|
||||
static __declspec(naked) void display_print_line_break_extHRP() {
|
||||
__asm {
|
||||
push ecx;
|
||||
push fo::funcoffs::display_print_; // func replaced by Mash's HRP
|
||||
|
||||
@@ -172,7 +172,7 @@ void __stdcall CombatAI::ai_check_drugs(fo::GameObject* source) {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) ai_check_drugs_replacement() {
|
||||
static __declspec(naked) void ai_check_drugs_replacement() {
|
||||
__asm {
|
||||
push ecx;
|
||||
push eax; // source
|
||||
@@ -183,7 +183,7 @@ static void __declspec(naked) ai_check_drugs_replacement() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) ai_can_use_drug_hack() {
|
||||
static __declspec(naked) void ai_can_use_drug_hack() {
|
||||
__asm {
|
||||
push ecx; // item
|
||||
call Items::IsHealingItem;
|
||||
|
||||
@@ -97,7 +97,7 @@ DWORD __stdcall Inventory::adjust_fid() {
|
||||
return fo::var::i_fid;
|
||||
}
|
||||
|
||||
static void __declspec(naked) adjust_fid_replacement() {
|
||||
static __declspec(naked) void adjust_fid_replacement() {
|
||||
__asm {
|
||||
push ecx;
|
||||
push edx;
|
||||
|
||||
@@ -183,7 +183,7 @@ endReload:
|
||||
return sf::CalcApCostHook_Invoke(source, hitMode, isCalled, cost, weapon); // return cost
|
||||
}
|
||||
|
||||
static void __declspec(naked) ai_search_inven_weap_hook() {
|
||||
static __declspec(naked) void ai_search_inven_weap_hook() {
|
||||
using namespace fo;
|
||||
__asm {
|
||||
push 0; // no called
|
||||
@@ -233,7 +233,7 @@ long __fastcall Items::item_w_mp_cost(fo::GameObject* source, fo::AttackType hit
|
||||
);
|
||||
}
|
||||
|
||||
static void __declspec(naked) item_w_mp_cost_replacement() {
|
||||
static __declspec(naked) void item_w_mp_cost_replacement() {
|
||||
__asm {
|
||||
push ebx; // isCalled
|
||||
mov ecx, eax; // source
|
||||
@@ -250,7 +250,7 @@ long __fastcall Items::item_w_curr_ammo(fo::GameObject* item) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __declspec(naked) item_w_curr_ammo_replacement() {
|
||||
static __declspec(naked) void item_w_curr_ammo_replacement() {
|
||||
__asm {
|
||||
push ecx;
|
||||
push edx;
|
||||
|
||||
@@ -37,7 +37,7 @@ int __stdcall Skills::trait_adjust_skill(DWORD skillID) {
|
||||
return result;
|
||||
}
|
||||
|
||||
static void __declspec(naked) trait_adjust_skill_replacement() {
|
||||
static __declspec(naked) void trait_adjust_skill_replacement() {
|
||||
__asm {
|
||||
push edx;
|
||||
push ecx;
|
||||
|
||||
@@ -107,7 +107,7 @@ int __stdcall Stats::trait_adjust_stat(DWORD statID) {
|
||||
return result;
|
||||
}
|
||||
|
||||
static void __declspec(naked) trait_adjust_stat_replacement() {
|
||||
static __declspec(naked) void trait_adjust_stat_replacement() {
|
||||
__asm {
|
||||
push edx;
|
||||
push ecx;
|
||||
|
||||
@@ -58,7 +58,7 @@ static fo::GameObject* __fastcall obj_path_blocking_at(fo::GameObject* source, l
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void __declspec(naked) Tilemap::obj_path_blocking_at_() {
|
||||
__declspec(naked) void Tilemap::obj_path_blocking_at_() {
|
||||
__asm {
|
||||
push ecx;
|
||||
push ebx;
|
||||
@@ -177,7 +177,7 @@ long __fastcall Tilemap::tile_num_beyond(long sourceTile, long targetTile, long
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) tile_num_beyond_replacement() {
|
||||
static __declspec(naked) void tile_num_beyond_replacement() {
|
||||
__asm { // push ecx;
|
||||
push ebx;
|
||||
mov ecx, eax;
|
||||
@@ -378,7 +378,7 @@ long __fastcall Tilemap::make_path_func(fo::GameObject* srcObject, long sourceTi
|
||||
return pathLen;
|
||||
}
|
||||
|
||||
static void __declspec(naked) make_path_func_hack_replacement() {
|
||||
static __declspec(naked) void make_path_func_hack_replacement() {
|
||||
__asm {
|
||||
xchg [esp], ecx; // ret addr <> array
|
||||
push maxPathNodes; // (sfall addition)
|
||||
|
||||
@@ -32,7 +32,7 @@ static long __fastcall CharacterWinAdd(long height, long yPos, long xPos, long w
|
||||
return fo::func::win_add(xPos, yPos, width, height, color, flags);
|
||||
}
|
||||
|
||||
static void __declspec(naked) CharacterWinAddHook() {
|
||||
static __declspec(naked) void CharacterWinAddHook() {
|
||||
__asm {
|
||||
xchg ebx, [esp]; // width
|
||||
push eax; // xPos
|
||||
@@ -41,7 +41,7 @@ static void __declspec(naked) CharacterWinAddHook() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) CharacterInputWinAddHook() {
|
||||
static __declspec(naked) void CharacterInputWinAddHook() {
|
||||
__asm {
|
||||
add edx, yPosition;
|
||||
add eax, xPosition;
|
||||
@@ -50,7 +50,7 @@ static void __declspec(naked) CharacterInputWinAddHook() {
|
||||
}
|
||||
|
||||
// Implementation from HRP by Mash
|
||||
static void __declspec(naked) CharacterSubmenuHook() {
|
||||
static __declspec(naked) void CharacterSubmenuHook() {
|
||||
__asm {
|
||||
mov eax, ds:[FO_VAR_edit_win];
|
||||
call fo::funcoffs::GNW_find_;
|
||||
@@ -74,7 +74,7 @@ static long __fastcall DialogBoxWinAdd(long height, long yPos, long xPos, long w
|
||||
return fo::func::win_add(xPos, yPos, width, height, color, flags);
|
||||
}
|
||||
|
||||
static void __declspec(naked) dialog_out_hook_win_add() {
|
||||
static __declspec(naked) void dialog_out_hook_win_add() {
|
||||
__asm {
|
||||
xchg ebx, [esp]; // width
|
||||
push eax; // xPos
|
||||
@@ -83,7 +83,7 @@ static void __declspec(naked) dialog_out_hook_win_add() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) CharacterMouseGetPositionHook() {
|
||||
static __declspec(naked) void CharacterMouseGetPositionHook() {
|
||||
__asm {
|
||||
push eax;
|
||||
push edx;
|
||||
|
||||
@@ -21,7 +21,7 @@ static void __cdecl credits_hook_buf_to_buf_art(BYTE* src, long w, long h, long
|
||||
fo::func::buf_to_buf(src, w, h, srcW, dst, Setting::ScreenWidth());
|
||||
}
|
||||
|
||||
static void __declspec(naked) credits_hack() {
|
||||
static __declspec(naked) void credits_hack() {
|
||||
__asm { // edx: H
|
||||
call Setting::ScreenWidth;
|
||||
imul eax, edx; // ScreenWidth * H
|
||||
|
||||
@@ -79,7 +79,7 @@ static BYTE* __fastcall DarkRectangle(long totalLines, long w) { // w:564
|
||||
return winSurface + x + yOffset; // text print offset
|
||||
}
|
||||
|
||||
static void __declspec(naked) main_death_scene_hook_buf_fill() {
|
||||
static __declspec(naked) void main_death_scene_hook_buf_fill() {
|
||||
__asm {
|
||||
mov ecx, [esp + 0x2B4 - 0x1C + 4]; // totalLines
|
||||
call DarkRectangle;
|
||||
|
||||
@@ -61,7 +61,7 @@ static long __fastcall CreateWinDialog(long height, long yPos, long xPos, long c
|
||||
return fo::func::win_add(xPos, yPos, width, height, color, flags);
|
||||
}
|
||||
|
||||
static void __declspec(naked) gdCreateHeadWindow_hook_win_add() {
|
||||
static __declspec(naked) void gdCreateHeadWindow_hook_win_add() {
|
||||
__asm {
|
||||
pop ebx; // ret addr
|
||||
push eax; // xPos
|
||||
@@ -76,14 +76,14 @@ static void ShowMapWindow() {
|
||||
IFaceBar::Show();
|
||||
}
|
||||
|
||||
static void __declspec(naked) gdDestroyHeadWindow_hook_win_delete() {
|
||||
static __declspec(naked) void gdDestroyHeadWindow_hook_win_delete() {
|
||||
__asm {
|
||||
call fo::funcoffs::win_delete_;
|
||||
jmp ShowMapWindow;
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) GeneralDialogWinAdd() {
|
||||
static __declspec(naked) void GeneralDialogWinAdd() {
|
||||
__asm {
|
||||
add eax, xPosition;
|
||||
add edx, yPosition;
|
||||
@@ -92,7 +92,7 @@ static void __declspec(naked) GeneralDialogWinAdd() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) gdProcess_hook_win_add() {
|
||||
static __declspec(naked) void gdProcess_hook_win_add() {
|
||||
__asm {
|
||||
add edx, yPosition;
|
||||
add eax, xPosition;
|
||||
@@ -100,7 +100,7 @@ static void __declspec(naked) gdProcess_hook_win_add() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) setup_inventory_hook_win_add() {
|
||||
static __declspec(naked) void setup_inventory_hook_win_add() {
|
||||
__asm {
|
||||
add eax, xPosition;
|
||||
add edx, yPosition;
|
||||
@@ -108,7 +108,7 @@ static void __declspec(naked) setup_inventory_hook_win_add() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) setup_inventory_hack() {
|
||||
static __declspec(naked) void setup_inventory_hack() {
|
||||
__asm {
|
||||
mov dword ptr ds:[FO_VAR_i_wid], eax;
|
||||
add ebx, xPosition;
|
||||
@@ -117,7 +117,7 @@ static void __declspec(naked) setup_inventory_hack() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) barter_move_hook_mouse_click_in() {
|
||||
static __declspec(naked) void barter_move_hook_mouse_click_in() {
|
||||
__asm {
|
||||
add eax, xPosition; // left
|
||||
add ebx, xPosition; // right
|
||||
@@ -127,7 +127,7 @@ static void __declspec(naked) barter_move_hook_mouse_click_in() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) hook_buf_to_buf() {
|
||||
static __declspec(naked) void hook_buf_to_buf() {
|
||||
__asm {
|
||||
imul eax, yPosition, 640;
|
||||
add [esp + 4], eax;
|
||||
|
||||
+19
-19
@@ -102,7 +102,7 @@ static long __fastcall IntfaceWinCreate(long height, long yPos, long xPos, long
|
||||
return fo::func::win_add(xPos, yPos, width, height, color, flags);
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_init_hook_win_add() {
|
||||
static __declspec(naked) void intface_init_hook_win_add() {
|
||||
__asm {
|
||||
xchg ebx, [esp]; // width
|
||||
push eax; // xPos
|
||||
@@ -116,7 +116,7 @@ static void __fastcall InterfaceShow(long winID) {
|
||||
if (panels) panels->Show();
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_show_hook_win_show() {
|
||||
static __declspec(naked) void intface_show_hook_win_show() {
|
||||
__asm {
|
||||
push ecx;
|
||||
push edx;
|
||||
@@ -133,7 +133,7 @@ static void __fastcall InterfaceHide(long winID) {
|
||||
if (panels) panels->Hide();
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_win_hide() {
|
||||
static __declspec(naked) void intface_win_hide() {
|
||||
__asm {
|
||||
push ecx;
|
||||
push edx;
|
||||
@@ -145,7 +145,7 @@ static void __declspec(naked) intface_win_hide() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) refresh_box_bar_win_hook_win_add() {
|
||||
static __declspec(naked) void refresh_box_bar_win_hook_win_add() {
|
||||
__asm {
|
||||
lea edx, [edx - 358 - 21];
|
||||
add eax, xPosition;
|
||||
@@ -154,7 +154,7 @@ static void __declspec(naked) refresh_box_bar_win_hook_win_add() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) skilldex_start_hook_win_add() {
|
||||
static __declspec(naked) void skilldex_start_hook_win_add() {
|
||||
__asm {
|
||||
lea eax, [eax - 640];
|
||||
add eax, xPosition;
|
||||
@@ -225,7 +225,7 @@ static long __cdecl InterfaceArt(BYTE* scr, long w, long h, long srcWidth, BYTE*
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_init_hook_buf_to_buf_ART() {
|
||||
static __declspec(naked) void intface_init_hook_buf_to_buf_ART() {
|
||||
__asm {
|
||||
pop ebx;
|
||||
call InterfaceArt;
|
||||
@@ -238,7 +238,7 @@ default:
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_init_hook_buf_to_buf() {
|
||||
static __declspec(naked) void intface_init_hook_buf_to_buf() {
|
||||
__asm {
|
||||
mov eax, IFaceBar::IFACE_BAR_WIDTH;
|
||||
mov [esp + 0xC + 4], eax; // from width
|
||||
@@ -248,7 +248,7 @@ static void __declspec(naked) intface_init_hook_buf_to_buf() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_update_move_points_hook_buf_to_buf() {
|
||||
static __declspec(naked) void intface_update_move_points_hook_buf_to_buf() {
|
||||
__asm {
|
||||
mov eax, IFaceBar::IFACE_BAR_WIDTH;
|
||||
mov [esp + 0x14 + 4], eax; // to width
|
||||
@@ -258,7 +258,7 @@ static void __declspec(naked) intface_update_move_points_hook_buf_to_buf() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) combat_buttons_buf_to_buf() {
|
||||
static __declspec(naked) void combat_buttons_buf_to_buf() {
|
||||
__asm {
|
||||
mov eax, IFaceBar::IFACE_BAR_WIDTH;
|
||||
mov [esp + 0x14 + 4], eax; // to width
|
||||
@@ -268,7 +268,7 @@ static void __declspec(naked) combat_buttons_buf_to_buf() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) combat_buttons_trans_buf_to_buf() {
|
||||
static __declspec(naked) void combat_buttons_trans_buf_to_buf() {
|
||||
__asm {
|
||||
mov eax, IFaceBar::IFACE_BAR_WIDTH;
|
||||
mov [esp + 0x14 + 4], eax; // to width
|
||||
@@ -278,7 +278,7 @@ static void __declspec(naked) combat_buttons_trans_buf_to_buf() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_win_register_button() {
|
||||
static __declspec(naked) void intface_win_register_button() {
|
||||
__asm {
|
||||
add edx, xOffset;
|
||||
jmp fo::funcoffs::win_register_button_;
|
||||
@@ -287,7 +287,7 @@ static void __declspec(naked) intface_win_register_button() {
|
||||
|
||||
//////////////////// Message Display Hacks ////////////////////
|
||||
|
||||
static void __declspec(naked) display_init_hack() {
|
||||
static __declspec(naked) void display_init_hack() {
|
||||
__asm {
|
||||
mov eax, IFaceBar::display_width;
|
||||
imul eax, 60; // height
|
||||
@@ -305,14 +305,14 @@ static void __cdecl display_init_hook_buf_to_buf(BYTE* scr, long w, long h, long
|
||||
fo::func::buf_to_buf(ifaceWin->surface + 23 + (24 * IFaceBar::IFACE_BAR_WIDTH), IFaceBar::display_width, h, IFaceBar::IFACE_BAR_WIDTH, dispBuff, IFaceBar::display_width);
|
||||
}
|
||||
|
||||
static void __declspec(naked) display_init_hook_win_register_button() {
|
||||
static __declspec(naked) void display_init_hook_win_register_button() {
|
||||
__asm {
|
||||
mov ecx, IFaceBar::display_width;
|
||||
jmp fo::funcoffs::win_register_button_;
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) display_redraw_hack() {
|
||||
static __declspec(naked) void display_redraw_hack() {
|
||||
__asm {
|
||||
idiv ebx;
|
||||
imul edx, 256; // was 80
|
||||
@@ -320,7 +320,7 @@ static void __declspec(naked) display_redraw_hack() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) DisplayReset() {
|
||||
static __declspec(naked) void DisplayReset() {
|
||||
__asm { // ebx: 100, ecx: 0
|
||||
mov eax, IFaceBar::display_string_buf;
|
||||
jloop:
|
||||
@@ -332,7 +332,7 @@ jloop:
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_rotate_numbers_hack() {
|
||||
static __declspec(naked) void intface_rotate_numbers_hack() {
|
||||
__asm {
|
||||
imul edx, IFaceBar::IFACE_BAR_WIDTH; // y * width
|
||||
mov eax, xOffset;
|
||||
@@ -342,7 +342,7 @@ static void __declspec(naked) intface_rotate_numbers_hack() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_rotate_numbers_hook_buf_to_buf() {
|
||||
static __declspec(naked) void intface_rotate_numbers_hook_buf_to_buf() {
|
||||
__asm {
|
||||
mov eax, IFaceBar::IFACE_BAR_WIDTH;
|
||||
mov [esp + 0x14 + 4], eax; // to width
|
||||
@@ -350,7 +350,7 @@ static void __declspec(naked) intface_rotate_numbers_hook_buf_to_buf() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_draw_ammo_lights_hack() {
|
||||
static __declspec(naked) void intface_draw_ammo_lights_hack() {
|
||||
__asm {
|
||||
add eax, xOffset;
|
||||
mov esi, eax;
|
||||
@@ -451,7 +451,7 @@ static void __fastcall DrawAlternateAmmoMetre(long x, long y) {
|
||||
fo::func::win_draw_rect(fo::var::interfaceWindow, (RECT*)&rect);
|
||||
}
|
||||
|
||||
static void __declspec(naked) intface_update_ammo_lights_hook() {
|
||||
static __declspec(naked) void intface_update_ammo_lights_hook() {
|
||||
__asm {
|
||||
push ecx;
|
||||
mov ecx, eax;
|
||||
|
||||
@@ -45,7 +45,7 @@ static long __fastcall CreateWin(long height, long yPos, long xPos, long width,
|
||||
return fo::func::win_add(xPos, yPos, width, height, color, flags);
|
||||
}
|
||||
|
||||
static void __declspec(naked) setup_inventory_hook_win_add() {
|
||||
static __declspec(naked) void setup_inventory_hook_win_add() {
|
||||
__asm {
|
||||
pop ebp; // ret addr
|
||||
push edi; // mode
|
||||
@@ -56,7 +56,7 @@ static void __declspec(naked) setup_inventory_hook_win_add() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) inventory_hook_mouse_click_in() {
|
||||
static __declspec(naked) void inventory_hook_mouse_click_in() {
|
||||
__asm {
|
||||
add eax, xPosition; // left
|
||||
add ebx, xPosition; // right
|
||||
|
||||
@@ -32,7 +32,7 @@ static long __fastcall LoadSaveWinAdd(long height, long yPos, long xPos, long wi
|
||||
return fo::func::win_add(xPos, yPos, width, height, color, flags);
|
||||
}
|
||||
|
||||
static void __declspec(naked) LSGameStart_hook_win_add() {
|
||||
static __declspec(naked) void LSGameStart_hook_win_add() {
|
||||
__asm {
|
||||
xchg ebx, [esp]; // width
|
||||
push eax; // xPos
|
||||
@@ -41,7 +41,7 @@ static void __declspec(naked) LSGameStart_hook_win_add() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) GetComment_hook_win_add() {
|
||||
static __declspec(naked) void GetComment_hook_win_add() {
|
||||
__asm {
|
||||
add edx, yPosition;
|
||||
add eax, xPosition;
|
||||
@@ -49,7 +49,7 @@ static void __declspec(naked) GetComment_hook_win_add() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) LoadSaveMouseGetPositionHook() {
|
||||
static __declspec(naked) void LoadSaveMouseGetPositionHook() {
|
||||
__asm {
|
||||
push eax;
|
||||
push edx;
|
||||
@@ -64,7 +64,7 @@ static void __declspec(naked) LoadSaveMouseGetPositionHook() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) QuickSnapShotHook() {
|
||||
static __declspec(naked) void QuickSnapShotHook() {
|
||||
__asm {
|
||||
mov ebx, ds:[FO_VAR_buf_length_2];
|
||||
mov ecx, ds:[FO_VAR_buf_width_2];
|
||||
|
||||
@@ -175,7 +175,7 @@ static long __fastcall GetHeightOffset(long &y) {
|
||||
}
|
||||
|
||||
// credit text print
|
||||
static void __declspec(naked) main_menu_create_hook_win_print() {
|
||||
static __declspec(naked) void main_menu_create_hook_win_print() {
|
||||
__asm {
|
||||
mov ebx, ecx; // x offset
|
||||
lea ecx, [esp + 4]; // y offset
|
||||
@@ -198,7 +198,7 @@ static void __fastcall TextScale(long xPos, const char* text, long yPos, long co
|
||||
}
|
||||
|
||||
// buttons text print
|
||||
static void __declspec(naked) main_menu_create_hook_text_to_buf() {
|
||||
static __declspec(naked) void main_menu_create_hook_text_to_buf() {
|
||||
__asm { // eax:xOffset (0), ebp:yPos, edx:text, ebx:txtWidth (640-txtWidth)-1
|
||||
cmp scaleFactor, 0x3F800000; // 1.0f
|
||||
jne scale;
|
||||
@@ -253,7 +253,7 @@ static long __fastcall ButtonPosition(long &width, long xPos, BYTE* &upImageData
|
||||
return (xPos >= mainmenuWidth) ? mainmenuWidth - width : xPos;
|
||||
}
|
||||
|
||||
static void __declspec(naked) main_menu_create_hook_register_button() {
|
||||
static __declspec(naked) void main_menu_create_hook_register_button() {
|
||||
__asm { // eax:_main_window, edx:Xpos (30), ebx:Ypos (+19), ecx:Width (26)
|
||||
push ecx; // width
|
||||
mov ecx, esp; // width ref
|
||||
|
||||
@@ -29,14 +29,14 @@ static long __fastcall CommonWinAdd(long height, long width, long color, long fl
|
||||
return fo::func::win_add(xPosition, yPosition, width, height, color, flags);
|
||||
}
|
||||
|
||||
static void __declspec(naked) CommonWinAddHook() {
|
||||
static __declspec(naked) void CommonWinAddHook() {
|
||||
__asm {
|
||||
mov edx, ebx; // width
|
||||
jmp CommonWinAdd;
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) MouseGetPositionHook() {
|
||||
static __declspec(naked) void MouseGetPositionHook() {
|
||||
__asm {
|
||||
push eax; // outX ref
|
||||
push edx; // outY ref
|
||||
|
||||
@@ -61,7 +61,7 @@ static void __fastcall SetMovieSize() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) nfConfig_hack() {
|
||||
static __declspec(naked) void nfConfig_hack() {
|
||||
__asm {
|
||||
call SetMovieSize;
|
||||
xor eax, eax;
|
||||
@@ -135,7 +135,7 @@ static long __fastcall SubtitleAdjustPosition(long yTop, long yBottom) {
|
||||
return (y < yMax) ? y : yMax;
|
||||
}
|
||||
|
||||
static void __declspec(naked) doSubtitle_hook() {
|
||||
static __declspec(naked) void doSubtitle_hook() {
|
||||
__asm {
|
||||
mov ecx, esi;
|
||||
call SubtitleAdjustPosition;
|
||||
@@ -144,7 +144,7 @@ static void __declspec(naked) doSubtitle_hook() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) gmovie_play_hack_begin() {
|
||||
static __declspec(naked) void gmovie_play_hack_begin() {
|
||||
__asm {
|
||||
cmp ds:[FO_VAR_wmInterfaceWasInitialized], 1;
|
||||
jne skip;
|
||||
@@ -156,7 +156,7 @@ skip:
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) gmovie_play_hack_end() {
|
||||
static __declspec(naked) void gmovie_play_hack_end() {
|
||||
__asm {
|
||||
cmp ds:[FO_VAR_wmInterfaceWasInitialized], 1;
|
||||
jne skip;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user