Added some engine variables to pointer defines.

Removed redundant PlayAcm() from HeroAppearance.cpp.
This commit is contained in:
NovaRain
2020-01-24 10:03:39 +08:00
parent df1d147a4f
commit 5a638f48ff
4 changed files with 23 additions and 20 deletions
+10 -5
View File
@@ -57,6 +57,7 @@ BYTE* ptr_DarkGreenColor = reinterpret_cast<BYTE*>(_DarkGreenColor)
BYTE* ptr_DarkGreenGreyColor = reinterpret_cast<BYTE*>(_DarkGreenGreyColor);
TGameObj** ptr_dialog_target = reinterpret_cast<TGameObj**>(_dialog_target);
DWORD* ptr_dialog_target_is_party = reinterpret_cast<DWORD*>(_dialog_target_is_party);
DWORD* ptr_dialogueBackWindow = reinterpret_cast<DWORD*>(_dialogueBackWindow);
DWORD* ptr_drugInfoList = reinterpret_cast<DWORD*>(_drugInfoList);
DWORD* ptr_edit_win = reinterpret_cast<DWORD*>(_edit_win);
DWORD* ptr_Educated = reinterpret_cast<DWORD*>(_Educated);
@@ -148,6 +149,7 @@ DWORD* ptr_optionsButtonDownKey = reinterpret_cast<DWORD*>(_optionsButtonD
DWORD* ptr_optionsButtonUp = reinterpret_cast<DWORD*>(_optionsButtonUp);
DWORD* ptr_optionsButtonUp1 = reinterpret_cast<DWORD*>(_optionsButtonUp1);
DWORD* ptr_optionsButtonUpKey = reinterpret_cast<DWORD*>(_optionsButtonUpKey);
DWORD* ptr_optnwin = reinterpret_cast<DWORD*>(_optnwin);
DWORD* ptr_outlined_object = reinterpret_cast<DWORD*>(_outlined_object);
DWORD* ptr_partyMemberAIOptions = reinterpret_cast<DWORD*>(_partyMemberAIOptions);
DWORD* ptr_partyMemberCount = reinterpret_cast<DWORD*>(_partyMemberCount);
@@ -182,6 +184,7 @@ DWORD* ptr_rotation = reinterpret_cast<DWORD*>(_rotation);
BoundRect* ptr_scr_size = reinterpret_cast<BoundRect*>(_scr_size);
DWORD* ptr_scriptListInfo = reinterpret_cast<DWORD*>(_scriptListInfo);
DWORD* ptr_skill_data = reinterpret_cast<DWORD*>(_skill_data);
DWORD* ptr_skldxwin = reinterpret_cast<DWORD*>(_skldxwin);
DWORD* ptr_slot_cursor = reinterpret_cast<DWORD*>(_slot_cursor);
DWORD* ptr_sneak_working = reinterpret_cast<DWORD*>(_sneak_working); // DWORD var
char** ptr_sound_music_path1 = reinterpret_cast<char**>(_sound_music_path1);
@@ -218,6 +221,8 @@ DWORD* ptr_wd_obj = reinterpret_cast<DWORD*>(_wd_obj);
DWORD* ptr_window = reinterpret_cast<DWORD*>(_window); // total 50 WINinfo*
BYTE* ptr_WhiteColor = reinterpret_cast<BYTE*>(_WhiteColor);
DWORD* ptr_wmAreaInfoList = reinterpret_cast<DWORD*>(_wmAreaInfoList);
DWORD* ptr_wmBkWin = reinterpret_cast<DWORD*>(_wmBkWin);
BYTE** ptr_wmBkWinBuf = reinterpret_cast<BYTE**>(_wmBkWinBuf);
DWORD* ptr_wmLastRndTime = reinterpret_cast<DWORD*>(_wmLastRndTime);
long* ptr_wmWorldOffsetX = reinterpret_cast<long*>(_wmWorldOffsetX);
long* ptr_wmWorldOffsetY = reinterpret_cast<long*>(_wmWorldOffsetY);
@@ -852,7 +857,7 @@ long __stdcall GetInputBtn() {
WRAP_WATCOM_CALL0(get_input_)
}
void __stdcall PlaySfx(const char* name) {
void __stdcall GSoundPlaySfxFile(const char* name) {
WRAP_WATCOM_CALL1(gsound_play_sfx_file_, name)
}
@@ -1465,13 +1470,13 @@ WINinfo* GetUIWindow(long winType) {
winID = *ptr_i_wid;
break;
case WINTYPE_Dialog:
winID = *(DWORD*)_dialogueBackWindow;
winID = *ptr_dialogueBackWindow;
break;
case WINTYPE_PipBoy:
winID = *ptr_pip_win;
break;
case WINTYPE_WorldMap:
winID = *(DWORD*)_wmBkWin;
winID = *ptr_wmBkWin;
break;
case WINTYPE_IfaceBar:
winID = *ptr_interfaceWindow;
@@ -1480,10 +1485,10 @@ WINinfo* GetUIWindow(long winType) {
winID = *ptr_edit_win;
break;
case WINTYPE_Skilldex:
winID = *(DWORD*)_skldxwin;
winID = *ptr_skldxwin;
break;
case WINTYPE_EscMenu:
winID = *(DWORD*)_optnwin;
winID = *ptr_optnwin;
break;
default:
return (WINinfo*)-1;
+6 -1
View File
@@ -322,6 +322,7 @@ extern BYTE* ptr_DarkGreenColor;
extern BYTE* ptr_DarkGreenGreyColor;
extern TGameObj** ptr_dialog_target;
extern DWORD* ptr_dialog_target_is_party;
extern DWORD* ptr_dialogueBackWindow;
extern DWORD* ptr_drugInfoList;
extern DWORD* ptr_edit_win;
extern DWORD* ptr_Educated;
@@ -413,6 +414,7 @@ extern DWORD* ptr_optionsButtonDownKey;
extern DWORD* ptr_optionsButtonUp;
extern DWORD* ptr_optionsButtonUp1;
extern DWORD* ptr_optionsButtonUpKey;
extern DWORD* ptr_optnwin;
extern DWORD* ptr_outlined_object;
extern DWORD* ptr_partyMemberAIOptions;
extern DWORD* ptr_partyMemberCount;
@@ -448,6 +450,7 @@ extern DWORD* ptr_sad;
extern BoundRect* ptr_scr_size;
extern DWORD* ptr_scriptListInfo;
extern DWORD* ptr_skill_data;
extern DWORD* ptr_skldxwin;
extern DWORD* ptr_slot_cursor;
extern DWORD* ptr_sneak_working; // DWORD var
extern char** ptr_sound_music_path1;
@@ -484,6 +487,8 @@ extern DWORD* ptr_wd_obj;
extern DWORD* ptr_window; // total 50 WINinfo*
extern BYTE* ptr_WhiteColor;
extern DWORD* ptr_wmAreaInfoList;
extern DWORD* ptr_wmBkWin;
extern BYTE** ptr_wmBkWinBuf;
extern DWORD* ptr_wmLastRndTime;
extern long* ptr_wmWorldOffsetX;
extern long* ptr_wmWorldOffsetY;
@@ -1055,7 +1060,7 @@ void __stdcall DisplayConsoleMessage(const char* msg);
long __stdcall GetInputBtn();
// plays SFX sound with given name
void __stdcall PlaySfx(const char* name);
void __stdcall GSoundPlaySfxFile(const char* name);
// Returns the name of the critter
const char* __stdcall CritterName(TGameObj* critter);
+6 -13
View File
@@ -424,13 +424,6 @@ static void UnloadDat(void *dat) {
/////////////////////////////////////////////////////////////////OTHER FUNCTIONS/////////////////////////////////////////////////////////////////////
static void PlayAcm(char *acmName) {
__asm {
mov eax, acmName;
call gsound_play_sfx_file_;
}
}
void _stdcall RefreshArtCache() {
__asm {
call art_flush_;
@@ -1121,7 +1114,7 @@ void _stdcall HeroSelectWindow(int raceStyleFlag) {
button = GetInputBtn();
if (button == 0x148) { // previous style/race - up arrow button pushed
PlayAcm("ib1p1xx1");
GSoundPlaySfxFile("ib1p1xx1");
if (isStyle) {
if (styleVal == 0) continue;
@@ -1142,7 +1135,7 @@ void _stdcall HeroSelectWindow(int raceStyleFlag) {
drawFlag = true;
}
} else if (button == 0x150) { // Next style/race - down arrow button pushed
PlayAcm("ib1p1xx1");
GSoundPlaySfxFile("ib1p1xx1");
if (isStyle) {
styleVal++;
@@ -1163,7 +1156,7 @@ void _stdcall HeroSelectWindow(int raceStyleFlag) {
}
}
} else if (button == 0x0D) { // save and exit - Enter button pushed
PlayAcm("ib1p1xx1");
GSoundPlaySfxFile("ib1p1xx1");
if (!isStyle && currentRaceVal == raceVal) { // return style to previous value if no race change
styleVal = currentStyleVal;
}
@@ -1349,15 +1342,15 @@ static int _stdcall CheckCharButtons() {
case 1:
*ptr_info_line = 0x501;
play:
PlayAcm("ib3p1xx1");
GSoundPlaySfxFile("ib3p1xx1");
break;
case 2:
style = true;
case 3:
PlayAcm("ISDXXXX1");
GSoundPlaySfxFile("ISDXXXX1");
break;
default:
PlayAcm("IB3LU1X1");
GSoundPlaySfxFile("IB3LU1X1");
return button;
}
FixTextHighLight();
+1 -1
View File
@@ -150,7 +150,7 @@ static void _stdcall SaveGame2() {
errorSave:
dlog_f("ERROR creating: %s\n", DL_MAIN, buf);
DisplayConsoleMessage(SaveSfallDataFailMsg);
PlaySfx("IISXXXX1");
GSoundPlaySfxFile("IISXXXX1");
}
static char SaveFailMsg[128];