Remove force_dump_ai_objects_all

It rotted because it is only ever used when PARALLAX is defined.  No one
has reported it broken, so remove it.
This commit is contained in:
Kp 2022-06-05 17:44:53 +00:00
parent 0faa33d3df
commit 3d7cb4abc7
3 changed files with 0 additions and 131 deletions

View file

@ -207,15 +207,6 @@ void do_thief_frame(vmobjptridx_t objp, const robot_info &robptr, fix dist_to_pl
#endif
}
#if PARALLAX
extern void force_dump_ai_objects_all(const char *msg);
#else
static inline void force_dump_ai_objects_all(const char *msg)
{
(void)msg;
}
#endif
namespace dsx {
void start_boss_death_sequence(d_level_unique_boss_state &BossUniqueState, const d_level_shared_robot_info_state::d_robot_info_array &Robot_info, object &objp);
extern void ai_init_boss_for_ship(void);

View file

@ -329,34 +329,6 @@ static void move_toward_vector_component_add(fix vms_vector::*const p, const vms
#define AIS_MAX 8
#define AIE_MAX 4
#ifndef NDEBUG
#if PARALLAX
#if defined(DXX_BUILD_DESCENT_I)
// Index into this array with ailp->mode
constexpr char mode_text[][16] = {
"STILL",
"WANDER",
"FOL_PATH",
"CHASE_OBJ",
"RUN_FROM",
"HIDE",
"FOL_PATH2",
"OPEN_DOOR",
};
// Index into this array with aip->behavior
constexpr std::array<char[9], 6> behavior_text{
"STILL ",
"NORMAL ",
"HIDE ",
"RUN_FROM",
"FOLPATH ",
"STATION "
};
#endif
#endif
#endif
// Current state indicates where the robot current is, or has just done.
// Transition table between states for an AI object.
// First dimension is trigger event.
@ -4588,87 +4560,6 @@ static void set_player_awareness_all(fvmobjptr &vmobjptr, fvcsegptridx &vcsegptr
}
}
#ifndef NDEBUG
#if PARALLAX
int Ai_dump_enable = 0;
FILE *Ai_dump_file = NULL;
char Ai_error_message[128] = "";
// ----------------------------------------------------------------------------------
namespace dsx {
namespace {
static void dump_ai_objects_all()
{
#if defined(DXX_BUILD_DESCENT_I)
int total=0;
time_t time_of_day;
time_of_day = time(NULL);
if (!Ai_dump_enable)
return;
if (Ai_dump_file == NULL)
Ai_dump_file = fopen("ai.out","a+t");
fprintf(Ai_dump_file, "\nnum: seg distance __mode__ behav. [velx vely velz] (Tick = %i)\n", d_tick_count);
fprintf(Ai_dump_file, "Date & Time = %s\n", ctime(&time_of_day));
if (Ai_error_message[0])
fprintf(Ai_dump_file, "Error message: %s\n", Ai_error_message);
range_for (const auto &&objp, vcobjptridx)
{
ai_static *aip = &objp->ctype.ai_info;
ai_local *ailp = &objp->ctype.ai_info.ail;
fix dist_to_player;
dist_to_player = vm_vec_dist(objp->pos, ConsoleObject->pos);
if (objp->control_source == object::control_type::ai)
{
fprintf(Ai_dump_file, "%3i: %3i %8.3f %8s %8s [%3i %4i]\n",
static_cast<uint16_t>(objp), objp->segnum, f2fl(dist_to_player), mode_text[ailp->mode], behavior_text[aip->behavior-0x80], aip->hide_index, aip->path_length);
if (aip->path_length)
total += aip->path_length;
}
}
fprintf(Ai_dump_file, "Total path length = %4i\n", total);
#endif
}
}
}
void force_dump_ai_objects_all(const char *msg)
{
int tsave;
tsave = Ai_dump_enable;
Ai_dump_enable = 1;
sprintf(Ai_error_message, "%s\n", msg);
dump_ai_objects_all();
Ai_error_message[0] = 0;
Ai_dump_enable = tsave;
}
// ----------------------------------------------------------------------------------
#else
static inline void dump_ai_objects_all()
{
}
#endif
#endif
namespace dsx {
// ----------------------------------------------------------------------------------
// Do things which need to get done for all AI objects each frame.
// This includes:
@ -4677,9 +4568,6 @@ void do_ai_frame_all(void)
{
auto &Objects = LevelUniqueObjectState.Objects;
auto &vmobjptr = Objects.vmptr;
#ifndef NDEBUG
dump_ai_objects_all();
#endif
set_player_awareness_all(vmobjptr, vcsegptridx, LevelUniqueRobotAwarenessState);

View file

@ -634,7 +634,6 @@ void validate_all_paths(void)
{
Int3(); // This path is bogus! Who corrupted it! Danger! Danger!
// Contact Mike, he caused this mess.
//force_dump_ai_objects_all("Error in validate_all_paths");
aip.path_length=0; // This allows people to resume without harm...
}
}
@ -682,7 +681,6 @@ void create_path_to_segment(const vmobjptridx_t objp, const robot_info &robptr,
Point_segs_free_ptr += aip->path_length;
if (Point_segs_free_ptr - Point_segs + MAX_PATH_LENGTH*2 > MAX_POINT_SEGS) {
//Int3(); // Contact Mike: This is stupid. Should call maybe_ai_garbage_collect before the add.
//force_dump_ai_objects_all("Error in create_path_to_player");
ai_reset_all_paths();
return;
}
@ -794,7 +792,6 @@ void create_path_to_station(const vmobjptridx_t objp, const robot_info &robptr,
Point_segs_free_ptr += aip->path_length;
if (Point_segs_free_ptr - Point_segs + MAX_PATH_LENGTH*2 > MAX_POINT_SEGS) {
//Int3(); // Contact Mike: Stupid.
//force_dump_ai_objects_all("Error in create_path_to_station");
ai_reset_all_paths();
return;
}
@ -842,7 +839,6 @@ void create_n_segment_path(const vmobjptridx_t objp, const robot_info &robptr, u
Point_segs_free_ptr += aip->path_length;
if (Point_segs_free_ptr - Point_segs + MAX_PATH_LENGTH*2 > MAX_POINT_SEGS) {
//Int3(); // Contact Mike: This is curious, though not deadly. /eip++;g
//force_dump_ai_objects_all("Error in crete_n_segment_path 2");
ai_reset_all_paths();
}
@ -939,7 +935,6 @@ static void create_path(const vmobjptridx_t objp, const robot_info &robptr)
Point_segs_free_ptr += aip->path_length;
if (Point_segs_free_ptr - Point_segs + MAX_PATH_LENGTH*2 > MAX_POINT_SEGS) {
//Int3(); // Contact Mike: This is curious, though not deadly. /eip++;g
//force_dump_ai_objects_all("Error in create_path");
ai_reset_all_paths();
}
aip->PATH_DIR = 1; // Initialize to moving forward.
@ -1374,9 +1369,6 @@ void ai_path_garbage_collect()
auto &Objects = LevelUniqueObjectState.Objects;
auto &vcobjptridx = Objects.vcptridx;
auto &vmobjptridx = Objects.vmptridx;
#ifndef NDEBUG
force_dump_ai_objects_all("***** Start ai_path_garbage_collect *****");
#endif
Last_tick_garbage_collected = d_tick_count;
@ -1421,8 +1413,6 @@ void ai_path_garbage_collect()
#ifndef NDEBUG
{
force_dump_ai_objects_all("***** Finish ai_path_garbage_collect *****");
auto &vcobjptr = Objects.vcptr;
range_for (const auto &&objp, vcobjptr)
{