Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
4 changes: 0 additions & 4 deletions AudioEncode/aencode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@
0.0012475221f, -0.0024950907f, -0.0087309526f, 0.019957958f, 0.050528999f, -0.12055097f, -0.29304558f, 0.70617616f,
};

const float T911 = -32767.0f;
const float T913 = 32767.0f;
const float T1266 = 0.0f;

void WriteBand_Fmt0(Encoder &enc, int32_t colIndex, uint32_t formatId) {}

void WriteBand_Fmt3_16(Encoder &enc, int32_t colIndex, uint32_t formatId) {
Expand Down Expand Up @@ -956,7 +952,7 @@
int32_t sample = 0;
if (enc.m_finishedReading == 0) {
sample = (*enc.m_reader)(enc.m_pReaderData);
if (sample == ReadSampleEof) {

Check warning on line 955 in AudioEncode/aencode.cpp

View workflow job for this annotation

GitHub Actions / Build for PR / Linux-x64, Debug

comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘AudioError’ [-Wsign-compare]

Check warning on line 955 in AudioEncode/aencode.cpp

View workflow job for this annotation

GitHub Actions / Build for PR / Linux-x64, Release

comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘AudioError’ [-Wsign-compare]

Check warning on line 955 in AudioEncode/aencode.cpp

View workflow job for this annotation

GitHub Actions / Build for PR / Linux-cross-arm64, Release

comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘AudioError’ [-Wsign-compare]

Check warning on line 955 in AudioEncode/aencode.cpp

View workflow job for this annotation

GitHub Actions / Build for PR / Linux-cross-arm64, Debug

comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘AudioError’ [-Wsign-compare]
enc.m_finishedReading = 1;
return;
}
Expand Down
4 changes: 2 additions & 2 deletions Descent3/AImain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4606,7 +4606,7 @@ void ai_move(object *obj) {
} else {
// Determine movement stuff
if (obj->movement_type == MT_PHYSICS || obj->movement_type == MT_WALKING) {
if (targetptr && IsTargetLocal(obj, targetptr) || (ai_info->awareness >= AWARE_BARELY) ||
if ((targetptr && IsTargetLocal(obj, targetptr)) || (ai_info->awareness >= AWARE_BARELY) ||
(ai_info->flags & AIF_PERSISTANT)) {
for (i = NUM_ACTIVATION_LEVELS; i < MAX_GOALS; i++) {
if (ai_info->goals[i].used) {
Expand Down Expand Up @@ -4900,7 +4900,7 @@ void ai_move(object *obj) {
int subtype = cur_goal->subtype;
int vec_id = (subtype & 0xFFFFFFFE);
bool f_toward = (subtype & 0x00000001);
vector *vec;
vector *vec = nullptr;

// mprintf(0, "Moving relative a type %d\n", obj->type);

Expand Down
37 changes: 12 additions & 25 deletions Descent3/BOA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ bool BOA_PassablePortal(int room, int portal_index, bool f_for_sound, bool f_mak
return false;
}

if ((Rooms[room].portals[portal_index].flags & PF_RENDER_FACES) &&
!(Rooms[room].portals[portal_index].flags & PF_RENDERED_FLYTHROUGH) ||
if (((Rooms[room].portals[portal_index].flags & PF_RENDER_FACES) &&
!(Rooms[room].portals[portal_index].flags & PF_RENDERED_FLYTHROUGH)) ||
(Rooms[room].portals[portal_index].flags & PF_BLOCK)) {
return false;
}
Expand Down Expand Up @@ -702,7 +702,6 @@ void add_terrain_cell(int cell, int t_region, char *checked) {
void compute_terrain_region_info() {
int i;
bool done = false;
bool f_warning = false;
char checked[TERRAIN_WIDTH * TERRAIN_DEPTH];

for (i = 0; i < TERRAIN_WIDTH * TERRAIN_DEPTH; i++) {
Expand Down Expand Up @@ -776,10 +775,14 @@ void compute_terrain_region_info() {

int region = TERRAIN_REGION(cell);

if (!(BOA_num_connect[region] < MAX_PATH_PORTALS)) {
f_warning = true;
break;
}
#ifdef EDITOR
if (!(BOA_num_connect[region] < MAX_PATH_PORTALS)) {
OutrageMessageBox(
"This terrain has too many fly through\nterrain-mine connections!\n\nAI will not work correctly outside!\nIf "
"you really cannot fly outside\nignore this message.\n\nSee Chris for specific instructions!");
}
break;
#endif

// if(region != 0)
// {
Expand All @@ -798,14 +801,6 @@ void compute_terrain_region_info() {
}
}
}

#ifdef EDITOR
if (f_warning) {
OutrageMessageBox(
"This terrain has too many fly through\nterrain-mine connections!\n\nAI will not work correctly outside!\nIf "
"you really cannot fly outside\nignore this message.\n\nSee Chris for specific instructions!");
}
#endif
}

#define MAX_SOUND_PROP_DIST 400.0f
Expand Down Expand Up @@ -995,7 +990,7 @@ void FindPath(int i, int j) {
ASSERT(next_room <= Highest_room_index + BOA_num_terrain_regions);
}

int next_portal;
int next_portal = 0;
if (BOA_INDEX(next_room) != BOA_INDEX(cur_node->roomnum)) {
next_portal = BOA_DetermineStartRoomPortal(next_room, NULL, cur_node->roomnum, NULL);
}
Expand Down Expand Up @@ -1053,7 +1048,7 @@ void FindPath(int i, int j) {
next_room = Highest_room_index + TERRAIN_REGION(cell) + 1;
}

int next_portal;
int next_portal = 0;
if (BOA_INDEX(next_room) != BOA_INDEX(cur_node->roomnum)) {
next_portal = BOA_DetermineStartRoomPortal(next_room, NULL, cur_node->roomnum, NULL);
}
Expand Down Expand Up @@ -1194,9 +1189,6 @@ void compute_blockage_info() {

// Goes through all the valid points in the indoor engine and returns a unique
// checksum

#pragma optimize("", off)

int BOAGetMineChecksum() {
int i, t, k;
int total = 0;
Expand Down Expand Up @@ -1283,8 +1275,6 @@ int BOAGetRoomChecksum(int i) {
return (int)total;
}

#pragma optimize("", on)

bool IsPathPointValid(int room, vector *pos) {
// vector c_pnt = Rooms[room].path_pnt;
int i;
Expand Down Expand Up @@ -2395,7 +2385,6 @@ void ComputeAABB(bool f_full) {
vector min_xyz;
vector max_xyz;
int pamount[6];
int nonpart = 0;

if (rp->num_bbf_regions != 0) {
for (x = 0; x < rp->num_bbf_regions; x++) {
Expand Down Expand Up @@ -2516,8 +2505,6 @@ void ComputeAABB(bool f_full) {

rp->bbf_list[27 + r_struct_list[i][count] - 1][rp->num_bbf[27 + r_struct_list[i][count] - 1]++] = count;
}

nonpart++;
} else {
// bool f_found = false;
// int best;
Expand Down
10 changes: 2 additions & 8 deletions Descent3/BriefingParse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ int CBriefParse::ParseBriefing(const char *filename) {
title_buf[0] = 0;

// Read & parse lines
int bytes_read;
const char *p;

linebuf = NULL;
Expand All @@ -327,7 +326,7 @@ int CBriefParse::ParseBriefing(const char *filename) {
}

// Read the line
bytes_read = ReadFullLine(&linebuf, ifile);
ReadFullLine(&linebuf, ifile);
linenum++;

if (!linebuf) {
Expand Down Expand Up @@ -424,19 +423,16 @@ int CBriefParse::ParseBriefing(const char *filename) {

char buffer[_MAX_PATH];
char token[30];
int vflags = 0;
bool bitdepthset = false;
while (!play) {
PARSE_TOKEN(token);
if (!stricmp(token, "play"))
play = true;
else if (!stricmp(token, "8bit")) {
vflags |= VF_8BIT;
bitdepthset = true;
// LGT: Values unused
} else if (!stricmp(token, "compressed")) {
vflags |= VF_COMPRESSED;
} else if (!stricmp(token, "stereo")) {
vflags |= VF_STEREO;
} else if (!stricmp(buffer, "isset")) {
int value, bit = 0x01;
PARSE_INT(value);
Expand All @@ -456,8 +452,6 @@ int CBriefParse::ParseBriefing(const char *filename) {
} else
ParseError("Illegal parameter in $VOICE");
}
if (!bitdepthset)
vflags |= VF_16BIT | VF_INTERUPT | VF_FORCE;

PARSE_STRING(buffer);

Expand Down
146 changes: 73 additions & 73 deletions Descent3/Controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,80 +473,80 @@ static void ToggleHeadlightControlState();

// LIST OF NEEDS
ct_function Controller_needs[NUM_CONTROLLER_FUNCTIONS] = {
{ctfFORWARD_THRUSTAXIS, ctAnalog, ctAxis, ctAxis, 0, 0, 0, 0},
{ctfFORWARD_THRUSTKEY, ctTime, ctKey, ctKey, KEY_A, 0, 0, 0},
{ctfREVERSE_THRUSTKEY, ctTime, ctKey, ctKey, KEY_Z, 0, 0, 0},
{ctfFORWARD_BUTTON, ctTime, ctButton, ctButton, 0, 0, 0, 0},
{ctfREVERSE_BUTTON, ctTime, ctButton, ctButton, 0, 0, 0, 0},
{ctfUP_THRUSTAXIS, ctAnalog, ctAxis, ctAxis, CT_V_AXIS, 0, 0, 0},
{ctfUP_BUTTON, ctDigital, ctPOV, ctButton, JOYPOV_UP, 0, 0, 0},
{ctfUP_THRUSTKEY, ctTime, ctKey, ctKey, KEY_PADMINUS, 0, 0, 0},
{ctfDOWN_BUTTON, ctDigital, ctPOV, ctButton, JOYPOV_DOWN, 0, 0, 0},
{ctfDOWN_THRUSTKEY, ctTime, ctKey, ctKey, KEY_PADPLUS, 0, 0, 0},
{ctfRIGHT_THRUSTAXIS, ctAnalog, ctAxis, ctAxis, CT_U_AXIS, 0, 0, 0},
{ctfRIGHT_BUTTON, ctDigital, ctPOV, ctButton, JOYPOV_RIGHT, 0, 0, 0},
{ctfRIGHT_THRUSTKEY, ctTime, ctKey, ctKey, KEY_PAD3, 0, 0, 0},
{ctfLEFT_BUTTON, ctDigital, ctPOV, ctButton, JOYPOV_LEFT, 0, 0, 0},
{ctfLEFT_THRUSTKEY, ctTime, ctKey, ctKey, KEY_PAD1, 0, 0, 0},
{ctfPITCH_DOWNAXIS, ctAnalog, ctAxis, ctMouseAxis, CT_Y_AXIS, CT_Y_AXIS, 0, 0},
{ctfPITCH_DOWNKEY, ctTime, ctKey, ctKey, KEY_UP, KEY_PAD8, 0, 0},
{ctfPITCH_DOWNBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfPITCH_UPKEY, ctTime, ctKey, ctKey, KEY_DOWN, KEY_PAD2, 0, 0},
{ctfPITCH_UPBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfBANK_RIGHTAXIS, ctAnalog, ctAxis, ctAxis, CT_R_AXIS, 0, 0, 0},
{ctfBANK_RIGHTKEY, ctTime, ctKey, ctKey, KEY_E, KEY_PAD9, 0, 0},
{ctfBANK_RIGHTBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfBANK_LEFTKEY, ctTime, ctKey, ctKey, KEY_Q, KEY_PAD7, 0, 0},
{ctfBANK_LEFTBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfHEADING_RIGHTAXIS, ctAnalog, ctAxis, ctMouseAxis, CT_X_AXIS, CT_X_AXIS, 0, 0},
{ctfHEADING_RIGHTKEY, ctTime, ctKey, ctKey, KEY_RIGHT, KEY_PAD6, 0, 0},
{ctfHEADING_RIGHTBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfHEADING_LEFTKEY, ctTime, ctKey, ctKey, KEY_LEFT, KEY_PAD4, 0, 0},
{ctfHEADING_LEFTBUTTON, ctDigital, ctButton, ctButton, 0, 0, 0, 0},
{ctfFIREPRIMARY_BUTTON, ctTime, ctButton, ctMouseButton, 1, 1, 0, 0},
{ctfFIREPRIMARY_KEY, ctTime, ctKey, ctKey, KEY_LCTRL, KEY_RCTRL, 0, 0},
{ctfFIREPRIMARY_KEY2, ctTime, ctKey, ctKey, 0, 0, 0, 0},
{ctfFIRESECONDARY_BUTTON, ctTime, ctButton, ctMouseButton, 2, 2, 0, 0},
{ctfFIRESECONDARY_KEY, ctTime, ctKey, ctKey, KEY_SPACEBAR, 0, 0, 0},
{ctfTOGGLE_SLIDEBUTTON, ctTime, ctButton, ctButton, 0, 0, 0, 0},
{ctfTOGGLE_SLIDEKEY, ctTime, ctKey, ctKey, KEY_LALT, 0, 0, 0},
{ctfTOGGLE_BANKBUTTON, ctTime, ctButton, ctButton, 0, 0, 0, 0},
{ctfTOGGLE_BANKKEY, ctTime, ctKey, ctKey, 0, 0, 0, 0},
{ctfFIREFLARE_BUTTON, ctTime, ctButton, ctMouseButton, 3, 3, 0, 0},
{ctfFIREFLARE_KEY, ctDownCount, ctKey, ctKey, KEY_F, 0, 0, 0},
{ctfAFTERBURN_BUTTON, ctTime, ctButton, ctButton, 0, 0, 0, 0},
{ctfAFTERBURN_KEY, ctTime, ctKey, ctKey, KEY_S, 0, 0, 0},
{ctfAUTOMAP_KEY, ctDownCount, ctKey, ctKey, KEY_TAB, 0, 0, 0},
{ctfPREV_INVKEY, ctDownCount, ctKey, ctKey, KEY_LBRACKET, 0, 0, 0},
{ctfNEXT_INVKEY, ctDownCount, ctKey, ctKey, KEY_RBRACKET, 0, 0, 0},
{ctfINV_USEKEY, ctDownCount, ctKey, ctKey, KEY_BACKSLASH, 0, 0, 0},
{ctfPREV_CNTMSKEY, ctDownCount, ctKey, ctKey, KEY_SEMICOL, 0, 0, 0},
{ctfNEXT_CNTMSKEY, ctDownCount, ctKey, ctKey, KEY_RAPOSTRO, 0, 0, 0},
{ctfCNTMS_USEKEY, ctDownCount, ctKey, ctKey, KEY_ENTER, 0, 0, 0},
{ctfHEADLIGHT_KEY, ctDownCount, ctKey, ctKey, KEY_H, 0, 0, 0},
{ctfHEADLIGHT_BUTTON, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUTOMAP_BUTTON, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfPREV_INVBTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfNEXT_INVBTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfINV_USEBTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfPREV_CNTMSBTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfNEXT_CNTMSBTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfCNTMS_USEBTN, ctDownCount, ctButton, ctMouseButton, 4, 4, 0, 0},
{ctfWPNSEL_PCYCLEKEY, ctDownCount, ctKey, ctKey, KEY_COMMA, 0, 0, 0},
{ctfWPNSEL_PCYCLEBTN, ctDownCount, ctButton, ctMouseButton, 0, 5, 0, 0},
{ctfWPNSEL_SCYCLEKEY, ctDownCount, ctKey, ctKey, KEY_PERIOD, 0, 0, 0},
{ctfWPNSEL_SCYCLEBTN, ctDownCount, ctButton, ctMouseButton, 0, 6, 0, 0},
{ctfREARVIEW_KEY, ctDownCount, ctKey, ctKey, KEY_R, 0, 0, 0},
{ctfREARVIEW_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUDIOTAUNT1_KEY, ctDownCount, ctKey, ctKey, 0, 0, 0, 0},
{ctfAUDIOTAUNT1_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUDIOTAUNT2_KEY, ctDownCount, ctKey, ctKey, 0, 0, 0, 0},
{ctfAUDIOTAUNT2_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUDIOTAUNT3_KEY, ctDownCount, ctKey, ctKey, 0, 0, 0, 0},
{ctfAUDIOTAUNT3_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0},
{ctfAUDIOTAUNT4_KEY, ctDownCount, ctKey, ctKey, 0, 0, 0, 0},
{ctfAUDIOTAUNT4_BTN, ctDownCount, ctButton, ctButton, 0, 0, 0, 0}};

{ctfFORWARD_THRUSTAXIS, ctAnalog, {ctAxis, ctAxis}, {0, 0}, {0, 0}},
{ctfFORWARD_THRUSTKEY, ctTime, {ctKey, ctKey}, {KEY_A, 0}, {0, 0}},
{ctfREVERSE_THRUSTKEY, ctTime, {ctKey, ctKey}, {KEY_Z, 0}, {0, 0}},
{ctfFORWARD_BUTTON, ctTime, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfREVERSE_BUTTON, ctTime, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfUP_THRUSTAXIS, ctAnalog, {ctAxis, ctAxis}, {0, 0}, {0, 0}},
{ctfUP_BUTTON, ctDigital, {ctPOV, ctButton}, {JOYPOV_UP, 0}, {0, 0}},
{ctfUP_THRUSTKEY, ctTime, {ctKey, ctKey}, {KEY_PADMINUS, 0}, {0, 0}},
{ctfDOWN_BUTTON, ctDigital, {ctPOV, ctButton}, {JOYPOV_DOWN, 0}, {0, 0}},
{ctfDOWN_THRUSTKEY, ctTime, {ctKey, ctKey}, {KEY_PADPLUS, 0}, {0, 0}},
{ctfRIGHT_THRUSTAXIS, ctAnalog, {ctAxis, ctAxis}, {0, 0}, {0, 0}},
{ctfRIGHT_BUTTON, ctDigital, {ctPOV, ctButton}, {JOYPOV_RIGHT, 0}, {0, 0}},
{ctfRIGHT_THRUSTKEY, ctTime, {ctKey, ctKey}, {KEY_PAD3, 0}, {0, 0}},
{ctfLEFT_BUTTON, ctDigital, {ctPOV, ctButton}, {JOYPOV_LEFT, 0}, {0, 0}},
{ctfLEFT_THRUSTKEY, ctTime, {ctKey, ctKey}, {KEY_PAD1, 0}, {0, 0}},
{ctfPITCH_DOWNAXIS, ctAnalog, {ctAxis, ctMouseAxis}, {0, CT_Y_AXIS}, {0, 0}},
{ctfPITCH_DOWNKEY, ctTime, {ctKey, ctKey}, {KEY_UP, KEY_PAD8}, {0, 0}},
{ctfPITCH_DOWNBUTTON, ctDigital, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfPITCH_UPKEY, ctTime, {ctKey, ctKey}, {KEY_DOWN, KEY_PAD2}, {0, 0}},
{ctfPITCH_UPBUTTON, ctDigital, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfBANK_RIGHTAXIS, ctAnalog, {ctAxis, ctAxis}, {0, 0}, {0, 0}},
{ctfBANK_RIGHTKEY, ctTime, {ctKey, ctKey}, {KEY_E, KEY_PAD9}, {0, 0}},
{ctfBANK_RIGHTBUTTON, ctDigital, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfBANK_LEFTKEY, ctTime, {ctKey, ctKey}, {KEY_Q, KEY_PAD7}, {0, 0}},
{ctfBANK_LEFTBUTTON, ctDigital, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfHEADING_RIGHTAXIS, ctAnalog, {ctAxis, ctMouseAxis}, {0, CT_X_AXIS}, {0, 0}},
{ctfHEADING_RIGHTKEY, ctTime, {ctKey, ctKey}, {KEY_RIGHT, KEY_PAD6}, {0, 0}},
{ctfHEADING_RIGHTBUTTON, ctDigital, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfHEADING_LEFTKEY, ctTime, {ctKey, ctKey}, {KEY_LEFT, KEY_PAD4}, {0, 0}},
{ctfHEADING_LEFTBUTTON, ctDigital, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfFIREPRIMARY_BUTTON, ctTime, {ctButton, ctMouseButton}, {1, 1}, {0, 0}},
{ctfFIREPRIMARY_KEY, ctTime, {ctKey, ctKey}, {KEY_LCTRL, KEY_RCTRL}, {0, 0}},
{ctfFIREPRIMARY_KEY2, ctTime, {ctKey, ctKey}, {0, 0}, {0, 0}},
{ctfFIRESECONDARY_BUTTON, ctTime, {ctButton, ctMouseButton}, {2, 2}, {0, 0}},
{ctfFIRESECONDARY_KEY, ctTime, {ctKey, ctKey}, {KEY_SPACEBAR, 0}, {0, 0}},
{ctfTOGGLE_SLIDEBUTTON, ctTime, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfTOGGLE_SLIDEKEY, ctTime, {ctKey, ctKey}, {KEY_LALT, 0}, {0, 0}},
{ctfTOGGLE_BANKBUTTON, ctTime, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfTOGGLE_BANKKEY, ctTime, {ctKey, ctKey}, {0, 0}, {0, 0}},
{ctfFIREFLARE_BUTTON, ctTime, {ctButton, ctMouseButton}, {3, 3}, {0, 0}},
{ctfFIREFLARE_KEY, ctDownCount, {ctKey, ctKey}, {KEY_F, 0}, {0, 0}},
{ctfAFTERBURN_BUTTON, ctTime, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfAFTERBURN_KEY, ctTime, {ctKey, ctKey}, {KEY_S, 0}, {0, 0}},
{ctfAUTOMAP_KEY, ctDownCount, {ctKey, ctKey}, {KEY_TAB, 0}, {0, 0}},
{ctfPREV_INVKEY, ctDownCount, {ctKey, ctKey}, {KEY_LBRACKET, 0}, {0, 0}},
{ctfNEXT_INVKEY, ctDownCount, {ctKey, ctKey}, {KEY_RBRACKET, 0}, {0, 0}},
{ctfINV_USEKEY, ctDownCount, {ctKey, ctKey}, {KEY_BACKSLASH, 0}, {0, 0}},
{ctfPREV_CNTMSKEY, ctDownCount, {ctKey, ctKey}, {KEY_SEMICOL, 0}, {0, 0}},
{ctfNEXT_CNTMSKEY, ctDownCount, {ctKey, ctKey}, {KEY_RAPOSTRO, 0}, {0, 0}},
{ctfCNTMS_USEKEY, ctDownCount, {ctKey, ctKey}, {KEY_ENTER, 0}, {0, 0}},
{ctfHEADLIGHT_KEY, ctDownCount, {ctKey, ctKey}, {KEY_H, 0}, {0, 0}},
{ctfHEADLIGHT_BUTTON, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfAUTOMAP_BUTTON, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfPREV_INVBTN, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfNEXT_INVBTN, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfINV_USEBTN, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfPREV_CNTMSBTN, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfNEXT_CNTMSBTN, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfCNTMS_USEBTN, ctDownCount, {ctButton, ctMouseButton}, {4, 4}, {0, 0}},
{ctfWPNSEL_PCYCLEKEY, ctDownCount, {ctKey, ctKey}, {KEY_COMMA, 0}, {0, 0}},
{ctfWPNSEL_PCYCLEBTN, ctDownCount, {ctButton, ctMouseButton}, {0, 5}, {0, 0}},
{ctfWPNSEL_SCYCLEKEY, ctDownCount, {ctKey, ctKey}, {KEY_PERIOD, 0}, {0, 0}},
{ctfWPNSEL_SCYCLEBTN, ctDownCount, {ctButton, ctMouseButton}, {0, 6}, {0, 0}},
{ctfREARVIEW_KEY, ctDownCount, {ctKey, ctKey}, {KEY_R, 0}, {0, 0}},
{ctfREARVIEW_BTN, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfAUDIOTAUNT1_KEY, ctDownCount, {ctKey, ctKey}, {0, 0}, {0, 0}},
{ctfAUDIOTAUNT1_BTN, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfAUDIOTAUNT2_KEY, ctDownCount, {ctKey, ctKey}, {0, 0}, {0, 0}},
{ctfAUDIOTAUNT2_BTN, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfAUDIOTAUNT3_KEY, ctDownCount, {ctKey, ctKey}, {0, 0}, {0, 0}},
{ctfAUDIOTAUNT3_BTN, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}},
{ctfAUDIOTAUNT4_KEY, ctDownCount, {ctKey, ctKey}, {0, 0}, {0, 0}},
{ctfAUDIOTAUNT4_BTN, ctDownCount, {ctButton, ctButton}, {0, 0}, {0, 0}}};
// ramping macros
static inline float ramp_control_value(float val, float limit, float &ramp_state, float &old_ramp_delta) {
float sign = val / fabs(val), old_sign = old_ramp_delta / fabs(old_ramp_delta);
Expand Down
1 change: 0 additions & 1 deletion Descent3/CtlCfgElem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ const char *cfg_binding_text(ct_type ctype, uint8_t ctrl, uint8_t binding) {

switch (ctype) {
case ctKey: {
ASSERT(binding < NUM_KEYBINDSTRINGS);
str = Ctltext_KeyBindings[binding];
break;
}
Expand Down
2 changes: 1 addition & 1 deletion Descent3/GameCheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ void DemoCheats(int key) {

int i;
for (i = 0; i < MAX_PLAYER_WEAPONS; i++) {
if (HAS_FLAG(i)) {
if (HAS_FLAG(i) != 0) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at it again this test makes no sense, may as well remove it

Players[Player_num].weapon_ammo[i] = Ships[Players[Player_num].ship_index].max_ammo[i];
}
}
Expand Down
1 change: 0 additions & 1 deletion Descent3/GameLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,6 @@ extern bool Cinematics_enabled;

// Deal with keys that only work for testing & debugging (eg., slew)
void ProcessTestKeys(int key) {
static int ffret = -1;
int i;

// Debug break
Expand Down
4 changes: 1 addition & 3 deletions Descent3/LoadLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1455,8 +1455,6 @@ const tConvertObject object_convert[] = {
{OBJ_POWERUP, -2, "ProxMinepowerup", CONV_MULTI},
{OBJ_POWERUP, -2, "energy", 0}};

static constexpr int object_convert_size = std::size(object_convert);

uint32_t chunk_start, chunk_size, filelen;

int CountDataToPageIn();
Expand Down Expand Up @@ -1512,7 +1510,7 @@ void ConvertObject(int *type, int *id) {

// look at even numbered items, they are the object to convert
// odd number items are destination
for (int i = 0; i < object_convert_size; i += 2) {
for (int i = 0; i < std::size(object_convert); i += 2) {
if (*type == object_convert[i].type) {
// type match, check id's
if (object_convert[i].id == -2) {
Expand Down
2 changes: 1 addition & 1 deletion Descent3/ObjInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ int ObjInitGeneric(object *objp, bool reinit) {
// Deal with deleted type
if (obj_info->type == OBJ_NONE) {
int i;
for (i = 0, obj_info = Object_info; i < MAX_OBJECT_IDS; i++, obj_info) { // find other object of same type
for (i = 0, obj_info = Object_info; i < MAX_OBJECT_IDS; i++) { // find other object of same type
if (Object_info[i].type == objp->type)
break;
}
Expand Down
Loading
Loading