Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions TheForceEngine/TFE_DarkForces/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,11 @@ namespace TFE_DarkForces
TFE_FrontEndUI::toggleEnhancements();
}

if (inputMapping_getActionState(IADF_ROTATE_PLAYER) == STATE_PRESSED)
{
rotate180();
}

if (inputMapping_getActionState(IADF_AUTOMOUNT_TOGGLE) == STATE_PRESSED)
{
s_config.wpnAutoMount = ~s_config.wpnAutoMount;
Expand Down
5 changes: 5 additions & 0 deletions TheForceEngine/TFE_DarkForces/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3036,6 +3036,11 @@ namespace TFE_DarkForces
}
}

void rotate180()
{
s_playerYaw = (s_playerYaw + ANGLE_HALF) & ANGLE_MASK;
}

void player_sector(const ConsoleArgList& args)
{
RSector* sector = s_playerObject->sector;
Expand Down
1 change: 1 addition & 0 deletions TheForceEngine/TFE_DarkForces/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ namespace TFE_DarkForces
fixed16_16 player_getSquaredDistance(SecObject* obj);
void player_setupCamera();
void player_applyDamage(fixed16_16 healthDmg, fixed16_16 shieldDmg, JBool playHitSound);
void rotate180();

JBool player_hasWeapon(s32 weaponIndex);
JBool player_hasItem(s32 itemIndex);
Expand Down
1 change: 1 addition & 0 deletions TheForceEngine/TFE_FrontEndUI/frontEndUi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2219,6 +2219,7 @@ namespace TFE_FrontEndUI
inputMapping("Look Up", IADF_LOOK_UP);
inputMapping("Look Down", IADF_LOOK_DN);
inputMapping("Center View", IADF_CENTER_VIEW);
inputMapping("Rotate 180", IADF_ROTATE_PLAYER);
inputMapping("Run", IADF_RUN);
inputMapping("Walk Slowly", IADF_SLOW);
inputMapping("Crouch", IADF_CROUCH);
Expand Down
4 changes: 4 additions & 0 deletions TheForceEngine/TFE_Input/inputMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ namespace TFE_Input
{ IADF_SCREENSHOT, ITYPE_KEYBOARD, KEY_PRINTSCREEN },
{ IADF_GIF_RECORD, ITYPE_KEYBOARD, KEY_F2, KEYMOD_ALT},
{ IADF_GIF_RECORD_NO_COUNTDOWN, ITYPE_KEYBOARD, KEY_F2, KEYMOD_CTRL},

//Player Rotation
{ IADF_ROTATE_PLAYER, ITYPE_KEYBOARD, KEY_K }
};

static InputBinding s_defaultControllerBinds[] =
Expand Down Expand Up @@ -271,6 +274,7 @@ namespace TFE_Input
inputMapping_addBinding(&s_defaultKeyboardBinds[IADF_SCREENSHOT]);
inputMapping_addBinding(&s_defaultKeyboardBinds[IADF_GIF_RECORD]);
inputMapping_addBinding(&s_defaultKeyboardBinds[IADF_GIF_RECORD_NO_COUNTDOWN]);
inputMapping_addBinding(&s_defaultKeyboardBinds[IADF_ROTATE_PLAYER]);
}

return true;
Expand Down
3 changes: 3 additions & 0 deletions TheForceEngine/TFE_Input/inputMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ namespace TFE_Input
IADF_GIF_RECORD,
IADF_GIF_RECORD_NO_COUNTDOWN,

// 180 Rotation
IADF_ROTATE_PLAYER,

IA_COUNT,
IAS_COUNT = IAS_SYSTEM_MENU + 1,
};
Expand Down
1 change: 1 addition & 0 deletions TheForceEngine/TFE_Jedi/Math/fixedPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace TFE_Jedi
#define HALF_16 0x8000
#define ONE_16 0x10000
#define ANGLE_MASK 0x3fff
#define ANGLE_HALF 0x1fff
#define ANGLE_MAX 0x4000

#define FRAC_BITS_16 16ll
Expand Down