Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skr/the real continue UI #605

Merged
merged 15 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from 13 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
52 changes: 32 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ endif()
# Set platform-dependent compiler & linker flags
if( NOT WIN32 )
if(PANDORA)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -ffast-math -funroll-loops -fstrict-aliasing -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -g -fuse-ld=gold -fuse-linker-plugin")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall ")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ffast-math -funroll-loops -fstrict-aliasing -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -g -fuse-ld=gold -fuse-linker-plugin")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${OPTIMIZATION_LEVEL} -ffast-math -funroll-loops -fstrict-aliasing -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -g -fuse-ld=gold -fuse-linker-plugin -fsingle-precision-constant")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OPTIMIZATION_LEVEL} -ffast-math -funroll-loops -fstrict-aliasing -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -g -fuse-ld=gold -fuse-linker-plugin -fsingle-precision-constant")
else()
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pedantic -Wall -pg -ffast-math -funroll-loops -fstrict-aliasing")
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -pg -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover -Wreturn-type -Werror=return-type")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pedantic -Wall -pg")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pedantic -pg -ffast-math -funroll-loops -fstrict-aliasing")
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover -Wreturn-type -Werror=return-type")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pedantic -pg")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -pedantic ${OPTIMIZATION_LEVEL} -ffast-math -funroll-loops -fstrict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pedantic ${OPTIMIZATION_LEVEL}")
endif()
Expand Down Expand Up @@ -207,7 +207,7 @@ if( NOT WIN32 )
endif()
else( NOT WIN32 )
# These look like mingw to me?
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -pg ${OPTIMIZATION_LEVEL} -ffast-math -funroll-loops -malign-double -fstrict-aliasing -mwindows")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pg ${OPTIMIZATION_LEVEL} -ffast-math -funroll-loops -malign-double -fstrict-aliasing -mwindows")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${OPTIMIZATION_LEVEL} -ffast-math -funroll-loops -malign-double -fstrict-aliasing -mwindows")
# We should be using Visual Studio flags...or better yet, providing an option to select which you'd prefer.
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MP")
Expand Down Expand Up @@ -347,11 +347,11 @@ message("***************************")
message("Debug flags: ")
message("${CMAKE_C_FLAGS_DEBUG}")
message("${CMAKE_CXX_FLAGS_DEBUG}")
#-g -Wall -pg -ffast-math -funroll-loops -fstrict-aliasing
#-g -pg -ffast-math -funroll-loops -fstrict-aliasing
message("Release flags: ")
message("${CMAKE_C_FLAGS_RELEASE}")
message("${CMAKE_CXX_FLAGS_RELEASE}")
#-O3 -DNDEBUG -Wall -pg -ffast-math -funroll-loops -fstrict-aliasing
#-O3 -DNDEBUG -pg -ffast-math -funroll-loops -fstrict-aliasing
message("***************************")


Expand Down Expand Up @@ -488,13 +488,13 @@ set(BASE_DATA_DIR "./" CACHE INTERNAL "Base data dir")
if (NOT APPLE AND UNIX)
include(GNUInstallDirs)
if (DATA_DIR)
set(BASE_DATA_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/barony")
set(BASE_DATA_DIR "${CMAKE_INSTALL_PREFIX}")
endif()
message(STATUS "Base data directory ${BASE_DATA_DIR}")

if (GAME_ENABLED)
install(TARGETS barony
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime
)
endif(GAME_ENABLED)
Expand Down Expand Up @@ -593,19 +593,31 @@ endif(EDITOR_ENABLED)
if (NOT APPLE AND UNIX)
if (EDITOR_ENABLED)
install(TARGETS ${EDITOR_EXE_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime
)
endif()

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lang DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/barony)

if (EXISTS books)
install(DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/books ${CMAKE_CURRENT_BINARY_DIR}/images ${CMAKE_CURRENT_BINARY_DIR}/items
${CMAKE_CURRENT_BINARY_DIR}/maps ${CMAKE_CURRENT_BINARY_DIR}/models ${CMAKE_CURRENT_BINARY_DIR}/music
${CMAKE_CURRENT_BINARY_DIR}/sound DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/barony
)
endif()
install(DIRECTORY
${CMAKE_SOURCE_DIR}/books
${CMAKE_SOURCE_DIR}/config
${CMAKE_SOURCE_DIR}/data
${CMAKE_SOURCE_DIR}/fonts
${CMAKE_SOURCE_DIR}/images
${CMAKE_SOURCE_DIR}/items
${CMAKE_SOURCE_DIR}/lang
${CMAKE_SOURCE_DIR}/maps
${CMAKE_SOURCE_DIR}/models
${CMAKE_SOURCE_DIR}/music
${CMAKE_SOURCE_DIR}/sound
DESTINATION "${CMAKE_INSTALL_PREFIX}"
)

install(FILES
${CMAKE_SOURCE_DIR}/gamecontrollerdb.txt
${CMAKE_SOURCE_DIR}/playernames-female.txt
${CMAKE_SOURCE_DIR}/playernames-male.txt
DESTINATION "${CMAKE_INSTALL_PREFIX}"
)
endif()
# 2) Windows install targets
if (WIN32)
Expand Down
Binary file modified fonts/pixel_maz.ttf
Binary file not shown.
Binary file added fonts/pixel_maz_large.ttf
Binary file not shown.
Binary file added fonts/pixel_maz_multiline.ttf
Binary file not shown.
Binary file modified fonts/pixelmix.ttf
Binary file not shown.
38 changes: 15 additions & 23 deletions src/actgeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,17 +696,13 @@ void actFloorDecoration(Entity* my)
impulseStr = impulseStr + output.at(inputTagStrIndex);
++inputTagStrIndex;
}
for ( int i = 0; i < NUMIMPULSES; ++i )
{
if ( impulseStrings[i].compare(impulseStr) == 0 )
{
output.erase(output.find(impulseStr), impulseStr.length());
std::string inputFormatted = "[";
inputFormatted.append(getInputName(impulses[i])).append("]");
output.insert(foundInputTag, inputFormatted.c_str());
break;
}
}
output.erase(output.find(impulseStr), impulseStr.length());
std::string inputFormatted;
inputFormatted.append("[");
const char* binding = Input::inputs[0].binding(impulseStr.c_str());
inputFormatted.append(binding[0] == '\0' ? impulseStr : binding);
inputFormatted.append("]");
output.insert(foundInputTag, inputFormatted.c_str());
foundInputTag = output.find("@in=");
}

Expand Down Expand Up @@ -2447,17 +2443,13 @@ void Entity::actTextSource()
impulseStr = impulseStr + output.at(inputTagStrIndex);
++inputTagStrIndex;
}
for ( int i = 0; i < NUMIMPULSES; ++i )
{
if ( impulseStrings[i].compare(impulseStr) == 0 )
{
output.erase(output.find(impulseStr), impulseStr.length());
std::string inputFormatted = "[";
inputFormatted.append(getInputName(impulses[i])).append("]");
output.insert(foundInputTag, inputFormatted.c_str());
break;
}
}
output.erase(output.find(impulseStr), impulseStr.length());
std::string inputFormatted;
inputFormatted.append("[");
const char* binding = Input::inputs[0].binding(impulseStr.c_str());
inputFormatted.append(binding[0] == '\0' ? impulseStr : binding);
inputFormatted.append("]");
output.insert(foundInputTag, inputFormatted.c_str());
foundInputTag = output.find("@in=");
}

Expand Down Expand Up @@ -2719,4 +2711,4 @@ void TextSourceScript::parseScriptInMapGeneration(Entity& src)
}
}
}
}
}
38 changes: 13 additions & 25 deletions src/acthudweapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ void actHudWeapon(Entity* my)

Player::HUD_t& playerHud = players[HUDWEAPON_PLAYERNUM]->hud;

Input& input = Input::inputs[HUDWEAPON_PLAYERNUM];

Entity* entity;
Entity* parent = playerHud.arm;

Expand Down Expand Up @@ -682,24 +684,22 @@ void actHudWeapon(Entity* my)

bool swingweapon = false;
if ( players[HUDWEAPON_PLAYERNUM]->entity
&& (*inputPressedForPlayer(HUDWEAPON_PLAYERNUM, impulses[IN_ATTACK]) || (shootmode && inputs.bControllerInputPressed(HUDWEAPON_PLAYERNUM, INJOY_GAME_ATTACK)))
&& input.binaryToggle("Attack")
&& shootmode
&& !gamePaused
&& players[HUDWEAPON_PLAYERNUM]->entity->isMobile()
&& !(*inputPressedForPlayer(HUDWEAPON_PLAYERNUM, impulses[IN_DEFEND]) && stats[HUDWEAPON_PLAYERNUM]->defending || (shootmode && inputs.bControllerInputPressed(HUDWEAPON_PLAYERNUM, INJOY_GAME_DEFEND) && stats[HUDWEAPON_PLAYERNUM]->defending))
&& !(input.binaryToggle("Block") && stats[HUDWEAPON_PLAYERNUM]->defending)
&& HUDWEAPON_OVERCHARGE < MAXCHARGE )
{
swingweapon = true;
}
else if ( (*inputPressedForPlayer(HUDWEAPON_PLAYERNUM, impulses[IN_ATTACK]) || (shootmode && inputs.bControllerInputPressed(HUDWEAPON_PLAYERNUM, INJOY_GAME_ATTACK))) &&
(*inputPressedForPlayer(HUDWEAPON_PLAYERNUM, impulses[IN_DEFEND]) && stats[HUDWEAPON_PLAYERNUM]->defending || (shootmode && inputs.bControllerInputPressed(HUDWEAPON_PLAYERNUM, INJOY_GAME_DEFEND) && stats[HUDWEAPON_PLAYERNUM]->defending)) )
else if (shootmode && input.binaryToggle("Attack") && input.binaryToggle("Block") && stats[HUDWEAPON_PLAYERNUM]->defending)
{
if ( stats[HUDWEAPON_PLAYERNUM]->shield && stats[HUDWEAPON_PLAYERNUM]->shield->type == TOOL_TINKERING_KIT )
{
if ( !GenericGUI[HUDWEAPON_PLAYERNUM].isGUIOpen() )
{
*inputPressedForPlayer(HUDWEAPON_PLAYERNUM, impulses[IN_ATTACK]) = 0;
inputs.controllerClearInput(HUDWEAPON_PLAYERNUM, INJOY_GAME_ATTACK);
input.consumeBinaryToggle("Attack");
GenericGUI[HUDWEAPON_PLAYERNUM].openGUI(GUI_TYPE_TINKERING, stats[HUDWEAPON_PLAYERNUM]->shield);
swapWeaponGimpTimer = 20;
return;
Expand Down Expand Up @@ -3011,6 +3011,8 @@ void actHudShield(Entity* my)
{
my->flags[UNCLICKABLE] = true;

Input& input = Input::inputs[HUDSHIELD_PLAYERNUM];

auto& camera_shakex = cameravars[HUDSHIELD_PLAYERNUM].shakex;
auto& camera_shakey = cameravars[HUDSHIELD_PLAYERNUM].shakey;
auto& camera_shakex2 = cameravars[HUDSHIELD_PLAYERNUM].shakex2;
Expand Down Expand Up @@ -3192,11 +3194,12 @@ void actHudShield(Entity* my)

bool defending = false;
bool sneaking = false;
if (!command && !swimming)
const bool shootmode = players[HUDSHIELD_PLAYERNUM]->shootmode;
if (!command && !swimming && shootmode)
{
if ( players[HUDSHIELD_PLAYERNUM] && players[HUDSHIELD_PLAYERNUM]->entity
&& (*inputPressedForPlayer(HUDSHIELD_PLAYERNUM, impulses[IN_DEFEND])
|| (players[HUDSHIELD_PLAYERNUM]->shootmode && inputs.bControllerInputPressed(HUDSHIELD_PLAYERNUM, INJOY_GAME_DEFEND)))
&& input.binaryToggle("Block")
SheridanR marked this conversation as resolved.
Show resolved Hide resolved
&& shootmode
&& players[HUDSHIELD_PLAYERNUM]->entity->isMobile()
&& !gamePaused
&& !cast_animation[HUDSHIELD_PLAYERNUM].active
Expand Down Expand Up @@ -3825,21 +3828,6 @@ void actHudAdditional(Entity* my)

bool defending = false;
bool sneaking = false;
/*if ( !command )
{
if ( players[HUDSHIELD_PLAYERNUM] && players[HUDSHIELD_PLAYERNUM]->entity
&& (*inputPressedForPlayer(HUDSHIELD_PLAYERNUM, impulses[IN_DEFEND]) || (shootmode && *inputPressed(joyimpulses[INJOY_GAME_DEFEND])))
&& players[HUDSHIELD_PLAYERNUM]->entity->isMobile()
&& !gamePaused
&& !cast_animation.active )
{
if ( stats[HUDSHIELD_PLAYERNUM]->shield && (hudweapon->skill[0] % 3 == 0) )
{
defending = true;
}
sneaking = true;
}
}*/

// shield switching animation
if ( players[HUDWEAPON_PLAYERNUM]->hud.shieldSwitch )
Expand Down Expand Up @@ -4139,4 +4127,4 @@ void actHudArrowModel(Entity* my)
my->scalex = hudweapon->scalex;
my->scaley = hudweapon->scaley;
my->scalez = hudweapon->scalez;
}
}
Loading