diff --git a/src/actions.cc b/src/actions.cc index b94c2a0..1cbd6b6 100644 --- a/src/actions.cc +++ b/src/actions.cc @@ -1454,7 +1454,7 @@ int _pick_fall(Object* obj, int anim) } } } else if (anim == ANIM_FALL_BACK) { - rotation = (obj->rotation + 3) % 6u; + rotation = (obj->rotation + 3) % ROTATION_COUNT; for (i = 1; i < 3; i++) { tile_num = tileGetTileInDirection(obj->tile, rotation, i); if (_obj_blocking_at(obj, tile_num, obj->elevation) != NULL) { diff --git a/src/animation.cc b/src/animation.cc index 6d6209a..bf714d3 100644 --- a/src/animation.cc +++ b/src/animation.cc @@ -1870,12 +1870,12 @@ int animateMoveObjectToObject(Object* from, Object* to, int a3, int anim, int an int v13; STRUCT_530014* ptr; - int hidden = (to->flags & OBJECT_HIDDEN); + bool hidden = (to->flags & OBJECT_HIDDEN); to->flags |= OBJECT_HIDDEN; v10 = _anim_move(from, to->tile, to->elevation, -1, anim, 0, animationSequenceIndex); - if (hidden == 0) { + if (!hidden) { to->flags &= ~OBJECT_HIDDEN; } diff --git a/src/animation.h b/src/animation.h index abc65d0..8003405 100644 --- a/src/animation.h +++ b/src/animation.h @@ -257,15 +257,15 @@ int _idist(int a1, int a2, int a3, int a4); int _tile_idistance(int tile1, int tile2); int _make_straight_path(Object* a1, int from, int to, STRUCT_530014_28* pathNodes, Object** a5, int a6); int _make_straight_path_func(Object* a1, int from, int to, STRUCT_530014_28* a4, Object** a5, int a6, Object* (*a7)(Object*, int, int)); -int animateMoveObjectToObject(Object* from, Object* to, int a3, int a4, int a5); -int animateMoveObjectToTile(Object* obj, int tile_num, int elev, int a4, int a5, int a6); -int _anim_move(Object* obj, int tile, int elev, int a3, int a4, int a5, int animationSequenceIndex); -int _anim_move_straight_to_tile(Object* obj, int a2, int a3, int fid, int a5, int a6); -int _anim_move_on_stairs(Object* obj, int a2, int a3, int fid, int a5); -int _check_for_falling(Object* obj, int a2, int a3); +int animateMoveObjectToObject(Object* from, Object* to, int a3, int anim, int animationSequenceIndex); +int animateMoveObjectToTile(Object* obj, int tile_num, int elev, int a4, int anim, int animationSequenceIndex); +int _anim_move(Object* obj, int tile, int elev, int a3, int anim, int a5, int animationSequenceIndex); +int _anim_move_straight_to_tile(Object* obj, int tile, int elevation, int anim, int animationSequenceIndex, int flags); +int _anim_move_on_stairs(Object* obj, int tile, int elevation, int anim, int animationSequenceIndex); +int _check_for_falling(Object* obj, int anim, int a3); void _object_move(int index); -void _object_straight_move(int a1); -int _anim_animate(Object* obj, int a2, int a3, int a4); +void _object_straight_move(int index); +int _anim_animate(Object* obj, int anim, int animationSequenceIndex, int flags); void _object_animate(); void _object_anim_compact(); int _check_move(int* a1); @@ -274,8 +274,8 @@ int _dude_run(int a1); void _dude_fidget(); void _dude_stand(Object* obj, int rotation, int fid); void _dude_standup(Object* a1); -int actionRotate(Object* obj, int a2, int a3); -int _anim_change_fid(Object* obj, int a2, int fid); +int actionRotate(Object* obj, int delta, int animationSequenceIndex); +int _anim_change_fid(Object* obj, int animationSequenceIndex, int fid); void _anim_stop(); int _check_gravity(int tile, int elevation); unsigned int _compute_tpf(Object* object, int fid); diff --git a/src/main.cc b/src/main.cc index 5f98918..14fb1e4 100644 --- a/src/main.cc +++ b/src/main.cc @@ -646,11 +646,11 @@ int mainMenuWindowInit() // SFALL: Allow to change font color/flags of copyright/version text // It's the last byte ('3C' by default) that picks the colour used. The first byte supplies additional flags for this option - // 0x1 - change the color for version string only - // 0x2 - underline text (only for the version string) - // 0x4 - monospace font (only for the version string) + // 0x010000 - change the color for version string only + // 0x020000 - underline text (only for the version string) + // 0x040000 - monospace font (only for the version string) int fontSettings = _colorTable[21091], fontSettingsSFall = 0; - configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_FONT_COLOR, &fontSettingsSFall); + configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_FONT_COLOR_KEY, &fontSettingsSFall); if (fontSettingsSFall && !(fontSettingsSFall & 0x010000)) fontSettings = fontSettingsSFall & 0xFF; @@ -665,7 +665,7 @@ int mainMenuWindowInit() windowDrawText(gMainMenuWindow, msg.text, 0, offsetX + 15, offsetY + 460, fontSettings | 0x06000000); } - // SFALL: Make sure font settings are applied when using 0x1 flag + // SFALL: Make sure font settings are applied when using 0x010000 flag if (fontSettingsSFall) fontSettings = fontSettingsSFall; @@ -716,7 +716,7 @@ int mainMenuWindowInit() // SFALL: Allow to change font color of buttons fontSettings = _colorTable[21091]; fontSettingsSFall = 0; - configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_BIG_FONT_COLOR, &fontSettingsSFall); + configGetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_BIG_FONT_COLOR_KEY, &fontSettingsSFall); if (fontSettingsSFall) fontSettings = fontSettingsSFall & 0xFF; diff --git a/src/object.cc b/src/object.cc index e10149b..0594ba8 100644 --- a/src/object.cc +++ b/src/object.cc @@ -3438,11 +3438,11 @@ void _obj_light_table_init() { for (int s = 0; s < 2; s++) { int v4 = gCenterTile + s; - for (int i = 0; i < 6; i++) { + for (int i = 0; i < ROTATION_COUNT; i++) { int v15 = 8; int* p = _light_offsets[v4 & 1][i]; for (int j = 0; j < 8; j++) { - int tile = tileGetTileInDirection(v4, (i + 1) % 6, j); + int tile = tileGetTileInDirection(v4, (i + 1) % ROTATION_COUNT, j); for (int m = 0; m < v15; m++) { *p++ = tileGetTileInDirection(tile, i, m + 1) - v4; diff --git a/src/proto_instance.cc b/src/proto_instance.cc index 5fe2060..a246990 100644 --- a/src/proto_instance.cc +++ b/src/proto_instance.cc @@ -2198,7 +2198,7 @@ int _objPMAttemptPlacement(Object* obj, int tile, int elevation) for (int v4 = 1; v4 <= 100; v4++) { // TODO: Check. v7++; - v9 = tileGetTileInDirection(v9, v7 % 6, 1); + v9 = tileGetTileInDirection(v9, v7 % ROTATION_COUNT, 1); if (_wmEvalTileNumForPlacement(v9) != 0) { break; } diff --git a/src/sfall_config.cc b/src/sfall_config.cc index 8975163..660e591 100644 --- a/src/sfall_config.cc +++ b/src/sfall_config.cc @@ -25,10 +25,10 @@ bool sfallConfigInit(int argc, char** argv) configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_DUDE_NATIVE_LOOK_JUMPSUIT_FEMALE_KEY, ""); configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_DUDE_NATIVE_LOOK_TRIBAL_MALE_KEY, ""); configSetString(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_DUDE_NATIVE_LOOK_TRIBAL_FEMALE_KEY, ""); - configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_BIG_FONT_COLOR, 0); + configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_BIG_FONT_COLOR_KEY, 0); configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_CREDITS_OFFSET_X_KEY, 0); configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_CREDITS_OFFSET_Y_KEY, 0); - configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_FONT_COLOR, 0); + configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_FONT_COLOR_KEY, 0); configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_OFFSET_X_KEY, 0); configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_MAIN_MENU_OFFSET_Y_KEY, 0); configSetInt(&gSfallConfig, SFALL_CONFIG_MISC_KEY, SFALL_CONFIG_SKIP_OPENING_MOVIES_KEY, 0); diff --git a/src/sfall_config.h b/src/sfall_config.h index 25a1ffb..9a21c53 100644 --- a/src/sfall_config.h +++ b/src/sfall_config.h @@ -11,10 +11,10 @@ #define SFALL_CONFIG_DUDE_NATIVE_LOOK_JUMPSUIT_FEMALE_KEY "FemaleDefaultModel" #define SFALL_CONFIG_DUDE_NATIVE_LOOK_TRIBAL_MALE_KEY "MaleStartModel" #define SFALL_CONFIG_DUDE_NATIVE_LOOK_TRIBAL_FEMALE_KEY "FemaleStartModel" -#define SFALL_CONFIG_MAIN_MENU_BIG_FONT_COLOR "MainMenuBigFontColour" +#define SFALL_CONFIG_MAIN_MENU_BIG_FONT_COLOR_KEY "MainMenuBigFontColour" #define SFALL_CONFIG_MAIN_MENU_CREDITS_OFFSET_X_KEY "MainMenuCreditsOffsetX" #define SFALL_CONFIG_MAIN_MENU_CREDITS_OFFSET_Y_KEY "MainMenuCreditsOffsetY" -#define SFALL_CONFIG_MAIN_MENU_FONT_COLOR "MainMenuFontColour" +#define SFALL_CONFIG_MAIN_MENU_FONT_COLOR_KEY "MainMenuFontColour" #define SFALL_CONFIG_MAIN_MENU_OFFSET_X_KEY "MainMenuOffsetX" #define SFALL_CONFIG_MAIN_MENU_OFFSET_Y_KEY "MainMenuOffsetY" #define SFALL_CONFIG_SKIP_OPENING_MOVIES_KEY "SkipOpeningMovies"