mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Some code edits and preparation
This commit is contained in:
@@ -523,14 +523,14 @@ DWORD GetTextWidthFM(const char* TextMsg) {
|
||||
|
||||
//---------------------------------------------------------
|
||||
//get width of Char for current font
|
||||
DWORD GetCharWidth(char charVal) {
|
||||
DWORD GetCharWidth(BYTE charVal) {
|
||||
__asm {
|
||||
mov al, charVal;
|
||||
call dword ptr ds:[FO_VAR_text_char_width];
|
||||
}
|
||||
}
|
||||
|
||||
DWORD GetCharWidthFM(char charVal) {
|
||||
DWORD GetCharWidthFM(BYTE charVal) {
|
||||
__asm {
|
||||
mov al, charVal;
|
||||
call fo::funcoffs::FMtext_char_width_;
|
||||
|
||||
@@ -153,8 +153,8 @@ DWORD GetTextWidth(const char* textMsg);
|
||||
DWORD GetTextWidthFM(const char* textMsg);
|
||||
|
||||
// get width of Char for current font
|
||||
DWORD GetCharWidth(char charVal);
|
||||
DWORD GetCharWidthFM(char charVal);
|
||||
DWORD GetCharWidth(BYTE charVal);
|
||||
DWORD GetCharWidthFM(BYTE charVal);
|
||||
|
||||
// get maximum string length for current font - if all characters were maximum width
|
||||
DWORD GetMaxTextWidth(const char* textMsg);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#define FO_VAR_bboxslot 0x5970E0
|
||||
#define FO_VAR_bckgnd 0x5707A4
|
||||
#define FO_VAR_bk_disabled 0x6AC780
|
||||
#define FO_VAR_bk_process_time 0x6AC788
|
||||
#define FO_VAR_black_palette 0x663FD0
|
||||
#define FO_VAR_bottom_line 0x664524
|
||||
#define FO_VAR_btable 0x59E944
|
||||
@@ -67,6 +68,10 @@
|
||||
#define FO_VAR_dialogue_switch_mode 0x518718
|
||||
#define FO_VAR_dialogueBackWindow 0x518740
|
||||
#define FO_VAR_dialogueWindow 0x518744
|
||||
#define FO_VAR_disp_curr 0x56FB48
|
||||
#define FO_VAR_disp_init 0x51850C
|
||||
#define FO_VAR_disp_start 0x56FB54
|
||||
#define FO_VAR_display_string_buf 0x56DBFC
|
||||
#define FO_VAR_display_win 0x631E4C
|
||||
#define FO_VAR_displayMapList 0x41B560
|
||||
#define FO_VAR_doing_refresh_all 0x6ADF38
|
||||
@@ -147,6 +152,7 @@
|
||||
#define FO_VAR_last_level 0x5707B4
|
||||
#define FO_VAR_lastMovieH 0x638E64
|
||||
#define FO_VAR_lastMovieW 0x638E68
|
||||
#define FO_VAR_lastTime 0x56FB58
|
||||
#define FO_VAR_lastWin 0x51DD80
|
||||
#define FO_VAR_Level_ 0x6681B0
|
||||
#define FO_VAR_Lifegiver 0x570854
|
||||
@@ -169,7 +175,8 @@
|
||||
#define FO_VAR_mapEntranceTileNum 0x51955C
|
||||
#define FO_VAR_master_db_handle 0x58E948
|
||||
#define FO_VAR_master_volume 0x518E84
|
||||
#define FO_VAR_max 0x56FB50
|
||||
#define FO_VAR_max 0x56FB50 // always equal 100
|
||||
#define FO_VAR_max_disp 0x56FB40
|
||||
#define FO_VAR_maxScriptNum 0x51C7CC
|
||||
#define FO_VAR_Meet_Frank_Horrigan 0x672E04
|
||||
#define FO_VAR_Move_on_Car 0x672E64
|
||||
|
||||
@@ -81,5 +81,22 @@ struct ArrayWrapper {
|
||||
// TODO: assign appropriate types (arrays, structs, strings, etc.) for all variables
|
||||
#include "Variables_def.h"
|
||||
|
||||
|
||||
__inline long GetInt(DWORD addr) {
|
||||
return *reinterpret_cast<DWORD*>(addr);
|
||||
}
|
||||
|
||||
__inline BYTE GetByte(DWORD addr) {
|
||||
return *reinterpret_cast<BYTE*>(addr);
|
||||
}
|
||||
|
||||
__inline long* SetInt(DWORD addr) {
|
||||
return reinterpret_cast<long*>(addr);
|
||||
}
|
||||
|
||||
__inline BYTE* SetByte(DWORD addr) {
|
||||
return reinterpret_cast<BYTE*>(addr);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -869,15 +869,15 @@ void MiscPatches::init() {
|
||||
}
|
||||
|
||||
if (IniReader::GetConfigInt("Misc", "SingleCore", 1)) {
|
||||
dlog("Applying single core patch.", DL_INIT);
|
||||
SYSTEM_INFO sysInfo;
|
||||
GetSystemInfo(&sysInfo);
|
||||
if (sysInfo.dwNumberOfProcessors > 1) {
|
||||
dlog("Applying single core patch.", DL_INIT);
|
||||
HANDLE process = GetCurrentProcess();
|
||||
SetProcessAffinityMask(process, 2); // use only CPU 1
|
||||
CloseHandle(process);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
|
||||
if (IniReader::GetConfigInt("Misc", "OverrideArtCacheSize", 0)) {
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ __inline long GetIntHRPValue(DWORD addr) {
|
||||
return *reinterpret_cast<DWORD*>(HRPAddress(addr));
|
||||
}
|
||||
|
||||
__inline char GetByteHRPValue(DWORD addr) {
|
||||
__inline BYTE GetByteHRPValue(DWORD addr) {
|
||||
return *reinterpret_cast<BYTE*>(HRPAddress(addr));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user