mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added script functions get/set_cursor_mode #108
Removed "beta" from version string.
This commit is contained in:
@@ -208,6 +208,7 @@
|
||||
#define car_gas_amount sfall_func0("car_gas_amount")
|
||||
#define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type)
|
||||
#define exec_map_update_scripts sfall_func0("exec_map_update_scripts")
|
||||
#define get_cursor_mode sfall_func0("get_cursor_mode")
|
||||
#define get_flags(obj) sfall_func1("get_flags", obj)
|
||||
#define get_ini_section(file, sect) sfall_func2("get_ini_section", file, sect)
|
||||
#define get_ini_sections(file) sfall_func1("get_ini_sections", file)
|
||||
@@ -220,6 +221,7 @@
|
||||
#define outlined_object sfall_func0("outlined_object")
|
||||
#define real_dude_obj sfall_func0("real_dude_obj")
|
||||
#define set_car_intface_art(artIndex) sfall_func1("set_car_intface_art", artIndex)
|
||||
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
|
||||
#define set_dude_obj(critter) sfall_func1("set_dude_obj", critter)
|
||||
#define set_flags(obj, flags) sfall_func2("set_flags", obj, flags)
|
||||
#define set_outline(obj, color) sfall_func2("set_outline", obj, color)
|
||||
|
||||
@@ -35,6 +35,7 @@ WRAP_WATCOM_FUNC2(long, combat_turn, GameObject*, critter, long, isDudeTurn)
|
||||
WRAP_WATCOM_FUNC1(long, critter_is_dead, GameObject*, critter)
|
||||
WRAP_WATCOM_FUNC1(void, EndLoad, DbFile*, file)
|
||||
WRAP_WATCOM_FUNC1(long, game_get_global_var, long, globalVar)
|
||||
WRAP_WATCOM_FUNC1(long, gmouse_3d_set_mode, long, mode)
|
||||
WRAP_WATCOM_FUNC1(long, gmouse_set_cursor, long, picNum)
|
||||
WRAP_WATCOM_FUNC1(Window*, GNW_find, long, winRef)
|
||||
WRAP_WATCOM_FUNC0(long, intface_is_item_right_hand)
|
||||
|
||||
@@ -65,7 +65,7 @@ static void __declspec(naked) Combat_p_procFix() {
|
||||
__asm {
|
||||
push eax;
|
||||
|
||||
mov eax, dword ptr ds : [FO_VAR_combat_state];
|
||||
mov eax, dword ptr ds:[FO_VAR_combat_state];
|
||||
cmp eax, 3;
|
||||
jnz end_cppf;
|
||||
|
||||
@@ -81,10 +81,10 @@ static void __declspec(naked) Combat_p_procFix() {
|
||||
call fo::funcoffs::scr_set_objs_;
|
||||
mov eax, [esi];
|
||||
|
||||
cmp dword ptr ds : [esi + 0x2c], +0x0;
|
||||
cmp dword ptr ds:[esi + 0x2c], +0x0;
|
||||
jng jmp1;
|
||||
|
||||
test byte ptr ds : [esi + 0x15], 0x1;
|
||||
test byte ptr ds:[esi + 0x15], 0x1;
|
||||
jz jmp1;
|
||||
mov edx, 0x2;
|
||||
jmp jmp2;
|
||||
|
||||
@@ -436,5 +436,18 @@ void sf_tile_refresh_display(OpcodeContext& ctx) {
|
||||
fo::func::tile_refresh_display();
|
||||
}
|
||||
|
||||
void sf_get_cursor_mode(OpcodeContext& ctx) {
|
||||
int cursorMode;
|
||||
__asm {
|
||||
call fo::funcoffs::gmouse_3d_get_mode_
|
||||
mov cursorMode, eax;
|
||||
}
|
||||
ctx.setReturn(cursorMode);
|
||||
}
|
||||
|
||||
void sf_set_cursor_mode(OpcodeContext& ctx) {
|
||||
fo::func::gmouse_3d_set_mode(ctx.arg(0).asInt());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,5 +83,9 @@ void sf_intface_is_hidden(OpcodeContext&);
|
||||
|
||||
void sf_tile_refresh_display(OpcodeContext&);
|
||||
|
||||
void sf_get_cursor_mode(OpcodeContext&);
|
||||
|
||||
void sf_set_cursor_mode(OpcodeContext&);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ struct SfallMetarule {
|
||||
|
||||
// maximum number of arguments
|
||||
int maxArgs;
|
||||
|
||||
|
||||
// argument validation settings
|
||||
OpcodeArgumentType argValidation[OP_MAX_ARGUMENTS];
|
||||
};
|
||||
@@ -79,6 +79,7 @@ static const SfallMetarule metarules[] = {
|
||||
{"car_gas_amount", sf_car_gas_amount, 0, 0},
|
||||
{"critter_inven_obj2", sf_critter_inven_obj2, 2, 2, {ARG_OBJECT, ARG_INT}},
|
||||
{"exec_map_update_scripts", sf_exec_map_update_scripts, 0, 0},
|
||||
{"get_cursor_mode", sf_get_cursor_mode, 0, 0},
|
||||
{"get_flags", sf_get_flags, 1, 1, {ARG_OBJECT}},
|
||||
{"get_ini_section", sf_get_ini_section, 2, 2, {ARG_STRING, ARG_STRING}},
|
||||
{"get_ini_sections", sf_get_ini_sections, 1, 1, {ARG_STRING}},
|
||||
@@ -92,6 +93,7 @@ static const SfallMetarule metarules[] = {
|
||||
{"outlined_object", sf_outlined_object, 0, 0},
|
||||
{"real_dude_obj", sf_real_dude_obj, 0, 0},
|
||||
{"set_car_intface_art", sf_set_car_intface_art, 1, 1, {ARG_INT}},
|
||||
{"set_cursor_mode", sf_set_cursor_mode, 1, 1, {ARG_INT}},
|
||||
{"set_dude_obj", sf_set_dude_obj, 1, 1, {ARG_OBJECT}},
|
||||
{"set_flags", sf_set_flags, 2, 2, {ARG_OBJECT, ARG_INT}},
|
||||
{"set_outline", sf_set_outline, 2, 2, {ARG_OBJECT, ARG_INT}},
|
||||
@@ -124,7 +126,7 @@ void sf_test(OpcodeContext& ctx) {
|
||||
}
|
||||
}
|
||||
sstream << ")";
|
||||
|
||||
|
||||
sf_test_stringBuf = sstream.str();
|
||||
ctx.setReturn(sf_test_stringBuf.c_str());
|
||||
}
|
||||
@@ -152,8 +154,8 @@ static bool ValidateMetaruleArguments(OpcodeContext& ctx, const SfallMetarule* m
|
||||
int argCount = ctx.numArgs();
|
||||
if (argCount < metaruleInfo->minArgs || argCount > metaruleInfo->maxArgs) {
|
||||
ctx.printOpcodeError(
|
||||
"sfall_funcX(\"%s\", ...) - invalid number of arguments (%d), must be from %d to %d.",
|
||||
metaruleInfo->name,
|
||||
"sfall_funcX(\"%s\", ...) - invalid number of arguments (%d), must be from %d to %d.",
|
||||
metaruleInfo->name,
|
||||
argCount,
|
||||
metaruleInfo->minArgs,
|
||||
metaruleInfo->maxArgs);
|
||||
|
||||
+2
-2
@@ -28,9 +28,9 @@
|
||||
#define VERSION_REV 0
|
||||
|
||||
#ifdef WIN2K
|
||||
#define VERSION_STRING "4.0 beta1 win2k"
|
||||
#define VERSION_STRING "4.0 win2k"
|
||||
#else
|
||||
#define VERSION_STRING "4.0 beta1"
|
||||
#define VERSION_STRING "4.0"
|
||||
#endif
|
||||
|
||||
#define CHECK_VAL (4)
|
||||
|
||||
Reference in New Issue
Block a user