Skip to content

Commit 3641163

Browse files
authored
Merge branch 'master' into ktx-etc2
2 parents f426b2e + 57eec4d commit 3641163

440 files changed

Lines changed: 19696 additions & 13122 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ IF(RESET_INSTALL_PREFIX)
6666
IF(NOT IS_DIRECTORY $ENV{FS2PATH})
6767
MESSAGE(WARNING "The path '$ENV{FS2PATH}' of the environment variable FS2PATH does not point to a directory! Install prefix wasn't set.")
6868
ELSE(NOT IS_DIRECTORY $ENV{FS2PATH})
69-
SET(CMAKE_INSTALL_PREFIX "$ENV{FS2PATH}" CACHE FILEPATH "Install path" FORCE)
69+
SET(CMAKE_INSTALL_PREFIX "$ENV{FS2PATH}" CACHE PATH "Install path" FORCE)
7070
FILE(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX} CMAKE_INSTALL_PREFIX)
7171
ENDIF(NOT IS_DIRECTORY $ENV{FS2PATH})
7272
ELSE(NOT $ENV{FS2PATH} STREQUAL "")
@@ -109,7 +109,7 @@ OPTION(FSO_USE_OPENALSOFT "Download and build OpenAL Soft instead of using the s
109109

110110
OPTION(FSO_FATAL_WARNINGS "Determines if warnings in the build are considered fatal errors, primarily used for CI" OFF)
111111

112-
SET(FSO_FREESPACE_PATH "${CMAKE_INSTALL_PREFIX}" CACHE FILEPATH "The path of the FreeSpace directory you want to use. Please note that you will have to change CMAKE_INSTALL_PREFIX if you change this at some point.")
112+
SET(FSO_FREESPACE_PATH "${CMAKE_INSTALL_PREFIX}" CACHE PATH "The path of the FreeSpace directory you want to use. Please note that you will have to change CMAKE_INSTALL_PREFIX if you change this at some point.")
113113

114114
SET(FSO_RUN_ARGUMENTS "" CACHE STRING "Additional arguments passed to a generated executable when run with the generated build files.")
115115

@@ -170,7 +170,8 @@ SET(GENERATED_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated_source)
170170
include(generateHeaders)
171171

172172
if(FSO_BUILD_APPIMAGE)
173-
include(appimage)
173+
SET(BINARY_DESTINATION "bin")
174+
SET(LIBRAY_DESTINATION "lib")
174175
endif()
175176

176177
include(clang-tidy)

ci/linux/configure_cmake.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export CXXFLAGS
4242
export CFLAGS
4343
export LD_LIBRARY_PATH
4444

45-
if [ "$RUNNER_OS" = "macOS" ]; then
45+
if [ "$RUNNER_OS" = "macOS" ] && [ ! -x "$(which ninja)" ]; then
4646
brew install ninja
4747
fi
4848

ci/linux/generate_appimage.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,23 @@
33
INSTALL_FOLDER=$1
44

55
# Install Freespace2 targets
6-
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER -DCOMPONENT=Unspecified -P cmake_install.cmake
7-
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER -DCOMPONENT=Freespace2 -P cmake_install.cmake
6+
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER/Freespace2 -DCOMPONENT=Unspecified -P cmake_install.cmake
7+
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER/Freespace2 -DCOMPONENT=Freespace2 -P cmake_install.cmake
88

99
# We need to be a bit creative for determining the AppImage name since we don't want to hard-code the name
10-
FILENAME="$(find $INSTALL_FOLDER/bin -name 'fs2_open_*' -type f -printf "%f\n").AppImage"
11-
appimagetool -n $INSTALL_FOLDER "$INSTALL_FOLDER/$FILENAME"
10+
FILENAME="$(find $INSTALL_FOLDER/Freespace2/bin -name 'fs2_open_*' -type f -printf "%f\n").AppImage"
11+
appimagetool -n "$INSTALL_FOLDER/Freespace2" "$INSTALL_FOLDER/$FILENAME"
1212
chmod +x "$INSTALL_FOLDER/$FILENAME"
1313

14+
# Maybe install qtFRED targets
15+
if [ -f qtfred/cmake_install.cmake ]; then
16+
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER/qtFRED -DCOMPONENT=Unspecified -P cmake_install.cmake
17+
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER/qtFRED -DCOMPONENT=qtFRED -P cmake_install.cmake
18+
19+
# We need to be a bit creative for determining the AppImage name since we don't want to hard-code the name
20+
FILENAME="$(find $INSTALL_FOLDER/qtFRED/bin -iname 'qtfred_*' -type f -printf "%f\n").AppImage"
21+
appimagetool -n "$INSTALL_FOLDER/qtFRED" "$INSTALL_FOLDER/$FILENAME"
22+
chmod +x "$INSTALL_FOLDER/$FILENAME"
23+
fi
24+
1425
ls -al $INSTALL_FOLDER

cmake/appimage.cmake

Lines changed: 0 additions & 21 deletions
This file was deleted.

cmake/toolchain-apple-clang.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
1515

1616
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wno-unused-variable -Wno-unused-parameter")
1717

18-
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -Wshadow")
18+
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wshadow")

cmake/version.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ if (EXISTS "${PROJECT_SOURCE_DIR}/version_override.cmake")
66
include("${PROJECT_SOURCE_DIR}/version_override.cmake")
77
endif()
88

9-
set_if_not_defined(FSO_VERSION_MAJOR 24)
10-
set_if_not_defined(FSO_VERSION_MINOR 3)
9+
set_if_not_defined(FSO_VERSION_MAJOR 25)
10+
set_if_not_defined(FSO_VERSION_MINOR 1)
1111
set_if_not_defined(FSO_VERSION_BUILD 0)
1212

1313
# A numeric revision e.g. the CI build number

code/ai/ai_flags.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,15 @@ namespace AI {
4444
Goal_on_hold, // when set, this goal cannot currently be satisfied, although it could be in the future
4545
Subsys_needs_fixup, // when set, the subsystem index (for a destroy subsystem goal) is invalid and must be gotten from the subsys name stored in docker.name field!!
4646
Goal_override, // paired with ai_goal_type::DYNAMIC to mean this goal overrides any other goal
47+
Want_override, // a goal should set this flag if Goal_override should be assigned when the goal is achievable
4748
Purge, // purge this goal next time we process
48-
Goals_purged, // this goal has already caused other goals to get purged
49+
Purge_when_new_goal_added, // this goal is perpetual until any other goal is added, at which time it sets its own Purge flag
50+
Goals_purged, // this goal has already caused other goals to get purged (because it is something like ai-disarm that renders other goals invalid)
4951
Depart_sound_played,// Goober5000 - replacement for AL's hack ;)
5052
Target_own_team, // this attack goal is allowed to target friendlies
5153
Afterburn_hard, // afterburn as hard as possible to the goal
5254
Waypoints_in_reverse, // decrement instead of increment
55+
Clear_all_goals_first, // this goal wipes all goals (including itself) before it runs (handled separately, and in a different place, from purging invalid goals)
5356

5457
NUM_VALUES
5558
};
@@ -181,6 +184,11 @@ namespace AI {
181184
ETS_uses_power_output,
182185
ETS_energy_same_regardless_of_system_presence,
183186
Dont_form_on_wing_at_mission_start,
187+
Do_not_clear_goals_when_running_form_on_wing,
188+
Do_not_clear_goals_when_running_stay_still,
189+
Do_not_set_override_when_assigning_form_on_wing,
190+
Purge_player_issued_form_on_wing_after_subsequent_order,
191+
Cancel_future_waves_of_any_wing_launched_from_an_exited_ship,
184192

185193
NUM_VALUES
186194
};

code/ai/ai_profiles.cpp

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ void parse_ai_profiles_tbl(const char *filename)
477477

478478
set_flag(profile, "$support don't add primaries:", AI::Profile_Flags::Support_dont_add_primaries);
479479

480+
if (optional_string("$max allies rearming threshold:"))
481+
stuff_int(&profile->max_allies_rearming_threshold);
482+
480483
set_flag(profile, "$firing requires exact los:", AI::Profile_Flags::Require_exact_los);
481484

482485
if (optional_string("$exact los minimum detection radius:")) {
@@ -721,6 +724,26 @@ void parse_ai_profiles_tbl(const char *filename)
721724

722725
set_flag(profile, "$don't issue form-on-wing goals at mission start:", AI::Profile_Flags::Dont_form_on_wing_at_mission_start);
723726

727+
if (optional_string("$default form-on-wing priority:")) {
728+
int priority;
729+
stuff_int(&priority);
730+
if (priority > 0) {
731+
profile->default_form_on_wing_priority = priority;
732+
} else {
733+
mprintf(("Warning: $default form-on-wing priority: should be > 0 (read %d). Value will not be used.\n", priority));
734+
}
735+
}
736+
737+
set_flag(profile, "$do not clear goals when running form-on-wing:", AI::Profile_Flags::Do_not_clear_goals_when_running_form_on_wing);
738+
739+
set_flag(profile, "$do not clear goals when running stay-still:", AI::Profile_Flags::Do_not_clear_goals_when_running_stay_still);
740+
741+
set_flag(profile, "$do not set override when assigning form-on-wing:", AI::Profile_Flags::Do_not_set_override_when_assigning_form_on_wing);
742+
743+
set_flag(profile, "$purge player-issued form-on-wing after subsequent order:", AI::Profile_Flags::Purge_player_issued_form_on_wing_after_subsequent_order);
744+
745+
set_flag(profile, "$cancel future waves of any wing launched from an exited ship:", AI::Profile_Flags::Cancel_future_waves_of_any_wing_launched_from_an_exited_ship);
746+
724747

725748
// end of options ----------------------------------------
726749

@@ -789,7 +812,7 @@ void ai_profiles_init()
789812
Ai_profiles_initted = 1;
790813
}
791814

792-
int ai_profile_lookup(char *name)
815+
int ai_profile_lookup(const char *name)
793816
{
794817
for (int i = 0; i < Num_ai_profiles; i++)
795818
if (!stricmp(name, Ai_profiles[i].profile_name))
@@ -813,6 +836,7 @@ void ai_profile_t::reset()
813836
ai_range_aware_secondary_select_mode = AI_RANGE_AWARE_SEC_SEL_MODE_RETAIL;
814837
turret_target_recheck_time = 2000.0f;
815838
rot_fac_multiplier_ply_collisions = 0.0f;
839+
max_allies_rearming_threshold = 2;
816840

817841
better_collision_avoid_aggression_combat = 3.5f;
818842
better_collision_avoid_aggression_guard = 3.5f;
@@ -825,6 +849,8 @@ void ai_profile_t::reset()
825849
guard_big_orbit_max_speed_percent = 1.0f;
826850
attack_any_idle_circle_distance = 100.0f;
827851

852+
default_form_on_wing_priority = 99; // as originally assigned in ai_add_goal_sub_sexp()
853+
828854
for (int i = 0; i < NUM_SKILL_LEVELS; ++i) {
829855
max_incoming_asteroids[i] = 0;
830856
max_allowed_player_homers[i] = 0;
@@ -938,5 +964,7 @@ void ai_profile_t::reset()
938964
}
939965
if (mod_supports_version(25, 0, 0)) {
940966
flags.set(AI::Profile_Flags::Fix_avoid_shockwave_bugs);
967+
flags.set(AI::Profile_Flags::Purge_player_issued_form_on_wing_after_subsequent_order);
968+
flags.set(AI::Profile_Flags::Cancel_future_waves_of_any_wing_launched_from_an_exited_ship);
941969
}
942970
}

code/ai/ai_profiles.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ class ai_profile_t {
101101

102102
float detail_distance_mult[MAX_DETAIL_VALUE + 1]; //MAX_DETAIL_VALUE really needs to be 4
103103

104+
// max number of allies allowed to be rearming at the same time
105+
int max_allies_rearming_threshold;
106+
104107
// minimum radius for the line-of-sight (los) detection --wookieejedi
105108
float los_min_detection_radius;
106109

@@ -147,6 +150,8 @@ class ai_profile_t {
147150
// AI attack any option --wookieejedi
148151
float attack_any_idle_circle_distance; // Radius that AI circles around a point while waiting for new enemies in attack-any mode
149152

153+
int default_form_on_wing_priority; // the priority used if not specified in the sexp
154+
150155
void reset();
151156
};
152157

@@ -159,6 +164,6 @@ extern ai_profile_t Ai_profiles[MAX_AI_PROFILES];
159164

160165
void ai_profiles_init();
161166

162-
int ai_profile_lookup(char *name);
167+
int ai_profile_lookup(const char *name);
163168

164169
#endif

code/ai/aicode.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3677,6 +3677,14 @@ void ai_form_on_wing(object *objp, object *goal_objp)
36773677
aip->ai_flags.remove(AI::AI_Flags::Formation_wing);
36783678
aip->ai_flags.set(AI::AI_Flags::Formation_object);
36793679

3680+
// if this goal is going to stick around for a while, change the mode
3681+
if (The_mission.ai_profile->flags[AI::Profile_Flags::Do_not_clear_goals_when_running_form_on_wing])
3682+
{
3683+
aip->mode = AIM_NONE;
3684+
aip->submode = -1;
3685+
aip->submode_start_time = Missiontime;
3686+
}
3687+
36803688
aip->goal_objnum = OBJ_INDEX(goal_objp);
36813689

36823690
ai_formation_object_recalculate_slotnums(aip->goal_objnum);
@@ -13697,7 +13705,7 @@ int ai_acquire_emerge_path(object *pl_objp, int parent_objnum, int allowed_path_
1369713705
ship_info* parent_sip = &Ship_info[parent_shipp->ship_info_index];
1369813706

1369913707
polymodel *pm = model_get( parent_sip->model_num );
13700-
ship_bay *bay = pm->ship_bay;
13708+
const auto& bay = pm->ship_bay;
1370113709

1370213710
if ( bay == nullptr ) {
1370313711
Warning(LOCATION, "Ship %s was set to arrive from fighter bay on object %s, but no fighter bay exists on that ships' model (%s).\n", shipp->ship_name, parent_shipp->ship_name, pm->filename);
@@ -13912,9 +13920,8 @@ int ai_find_closest_depart_path(ai_info *aip, polymodel *pm, int allowed_path_ma
1391213920
float dist, min_dist, min_free_dist;
1391313921
vec3d *source;
1391413922
model_path *mp;
13915-
ship_bay *bay;
1391613923

13917-
bay = pm->ship_bay;
13924+
const auto& bay = pm->ship_bay;
1391813925

1391913926
best_free_path = best_path = -1;
1392013927
min_free_dist = min_dist = 1e20f;
@@ -13991,9 +13998,9 @@ int ai_acquire_depart_path(object *pl_objp, int parent_objnum, int allowed_path_
1399113998

1399213999
object *parent_objp = &Objects[parent_objnum];
1399314000
polymodel *pm = model_get(Ship_info[Ships[parent_objp->instance].ship_info_index].model_num );
13994-
ship_bay *bay = pm->ship_bay;
14001+
const auto& bay = pm->ship_bay;
1399514002

13996-
if ( bay == NULL )
14003+
if ( bay == nullptr )
1399714004
return -1;
1399814005
if ( bay->num_paths <= 0 )
1399914006
return -1;
@@ -14052,7 +14059,7 @@ void ai_bay_depart()
1405214059

1405314060
// check if parent ship valid; if not, abort depart
1405414061
if (gameseq_get_state() != GS_STATE_LAB) {
14055-
auto anchor_ship_entry = ship_registry_get(Parse_names[Ships[Pl_objp->instance].departure_anchor]);
14062+
auto anchor_ship_entry = ship_registry_get(Ships[Pl_objp->instance].departure_anchor);
1405614063
if (!anchor_ship_entry ||
1405714064
!ship_useful_for_departure(anchor_ship_entry->shipnum, Ships[Pl_objp->instance].departure_path_mask)) {
1405814065
mprintf(("Aborting bay departure!\n"));
@@ -14084,11 +14091,10 @@ void ai_bay_depart()
1408414091

1408514092
// Volition bay code
1408614093
polymodel *pm;
14087-
ship_bay *bay;
1408814094

1408914095
pm = model_get(Ship_info[Ships[Objects[aip->goal_objnum].instance].ship_info_index].model_num);
14090-
bay = pm->ship_bay;
14091-
if ( bay != NULL ) {
14096+
const auto& bay = pm->ship_bay;
14097+
if ( bay != nullptr ) {
1409214098
bay->depart_flags &= ~(1<<aip->submode_parm0);
1409314099
}
1409414100

@@ -14377,7 +14383,7 @@ int maybe_request_support(object *objp)
1437714383
try_to_rearm = true;
1437814384
} else if (ai_bad_time_to_rearm(objp)) {
1437914385
try_to_rearm = false;
14380-
} else if (num_allies_rearming(objp) < 2) {
14386+
} else if (num_allies_rearming(objp) < The_mission.ai_profile->max_allies_rearming_threshold) {
1438114387
if (desire >= 8) { // guarantees disabled will cause repair request
1438214388
try_to_rearm = true;
1438314389
} else if (desire >= 3) { // >= 3 means having a single subsystem fully blown will cause repair.

0 commit comments

Comments
 (0)