Skip to content

Commit 1acf108

Browse files
committed
address feedback
1 parent 27a65e3 commit 1acf108

File tree

10 files changed

+16
-20
lines changed

10 files changed

+16
-20
lines changed

code/lab/dialogs/lab_ui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ void LabUi::show_object_options() const
15421542

15431543
with_CollapsingHeader("Object actions")
15441544
{
1545-
if (getLabManager()->isSafeForAsteroids()) {
1545+
if (getLabManager()->isSafeForProps()) {
15461546
// No actions yet
15471547
}
15481548
}

code/lab/manager/lab_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ void LabManager::changeDisplayedObject(LabMode mode, int info_index, int subtype
752752
break;
753753
case LabMode::Prop:
754754
CurrentObject = prop_create(&CurrentOrientation, &CurrentPosition, CurrentClass);
755-
if (isSafeForShips()) {
755+
if (isSafeForProps()) {
756756
ModelFilename = Prop_info[CurrentClass].pof_file;
757757
}
758758
break;

code/mission/missionparse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5284,7 +5284,7 @@ void post_process_path_stuff()
52845284
// MjnMixael
52855285
void post_process_mission_props()
52865286
{
5287-
for (auto& propp : Parse_props) {
5287+
for (const auto& propp : Parse_props) {
52885288
int objnum = prop_create(&propp.orientation, &propp.position, propp.prop_info_index, propp.name);
52895289

52905290
if (objnum >= 0) {

code/model/modelrender.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2933,7 +2933,7 @@ void model_render_only_glowpoint_lights(const model_render_params* interp, int m
29332933
objp = &Objects[objnum];
29342934
int tentative_num = -1;
29352935

2936-
// ADD PROP HERE
2936+
// TODO: Add Prop support here
29372937
if (objp->type == OBJ_SHIP) {
29382938
shipp = &Ships[objp->instance];
29392939
tentative_num = shipp->model_instance_num;

code/object/collideshipweapon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ int collide_prop_weapon(obj_pair* pair)
901901
// Note: culling ships with auto spread shields seems to waste more performance than it saves,
902902
// so we're not doing that here
903903
if (vm_vec_dist_squared(&prop_obj->pos, &weapon_obj->pos) < (1.2f * prop_obj->radius * prop_obj->radius)) {
904-
auto [do_postproc, never_hits, collision_data] =
904+
const auto& [do_postproc, never_hits, collision_data] =
905905
check_inside_radius_for_big_ships(prop_obj, weapon_obj, pair);
906906

907907
if (do_postproc) {

code/prop/prop.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void parse_prop_table(const char* filename)
112112

113113
required_string("+Color:");
114114
int rgb[3];
115-
stuff_int_list(rgb, 3, RAW_INTEGER_TYPE);
115+
stuff_int_list(rgb, 3, ParseLookupType::RAW_INTEGER_TYPE);
116116
gr_init_color(&pc.list_color, rgb[0], rgb[1], rgb[2]);
117117

118118
Prop_categories.push_back(pc);
@@ -271,7 +271,7 @@ void parse_prop_table(const char* filename)
271271
}
272272

273273
if(optional_string("$Detail distance:")) {
274-
pip->num_detail_levels = (int)stuff_int_list(pip->detail_distance, MAX_PROP_DETAIL_LEVELS, RAW_INTEGER_TYPE);
274+
pip->num_detail_levels = (int)stuff_int_list(pip->detail_distance, MAX_PROP_DETAIL_LEVELS, ParseLookupType::RAW_INTEGER_TYPE);
275275
}
276276

277277
if (optional_string("$Category:")) {
@@ -423,7 +423,7 @@ void prop_init()
423423
* Returns object index of prop.
424424
* @return -1 means failed.
425425
*/
426-
int prop_create(matrix* orient, vec3d* pos, int prop_type, const char* name)
426+
int prop_create(const matrix* orient, const vec3d* pos, int prop_type, const char* name)
427427
{
428428
prop_info* pip;
429429
prop* propp;
@@ -454,7 +454,7 @@ int prop_create(matrix* orient, vec3d* pos, int prop_type, const char* name)
454454
char base_name[NAME_LENGTH];
455455
char suffix[NAME_LENGTH];
456456
strcpy_s(base_name, Prop_info[prop_type].name.c_str());
457-
sprintf(suffix, NOX(" %d"), static_cast<int>(Props.size()));
457+
sprintf(suffix, NOX(" %d"), new_id);
458458

459459
// start building name
460460
strcpy_s(propp->prop_name, base_name);

code/prop/prop.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ typedef struct prop {
3434
fix time_created;
3535
float alpha_mult;
3636
// glow points
37-
std::deque<bool> glow_point_bank_active;
37+
SCP_deque<bool> glow_point_bank_active;
3838
flagset<Prop::Prop_Flags> flags;
3939
} prop;
4040

@@ -74,7 +74,7 @@ inline int prop_info_size()
7474
void prop_init();
7575

7676
// Object management
77-
int prop_create(matrix* orient, vec3d* pos, int prop_type, const char* name = nullptr);
77+
int prop_create(const matrix* orient, const vec3d* pos, int prop_type, const char* name = nullptr);
7878
void prop_delete(object* obj);
7979
void prop_render(object* obj, model_draw_list* scene);
8080

code/scripting/api/libs/mission.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,12 +1427,12 @@ ADE_FUNC(createProp,
14271427
"Prop handle, or invalid prop handle if prop couldn't be created")
14281428
{
14291429
const char* name = nullptr;
1430-
int pclass = -1;
1430+
int pclass = 0;
14311431
matrix_h* orient = nullptr;
14321432
vec3d pos = vmd_zero_vector;
14331433
ade_get_args(L, "|sooo", &name, l_Propclass.Get(&pclass), l_Matrix.GetPtr(&orient), l_Vector.Get(&pos));
14341434

1435-
if (Prop_info.empty()) {
1435+
if (!SCP_vector_inbounds(Prop_info, pclass)) {
14361436
return ade_set_error(L, "o", l_Prop.Set(object_h()));
14371437
}
14381438

@@ -1442,10 +1442,6 @@ ADE_FUNC(createProp,
14421442
real_orient = orient->GetMatrix();
14431443
}
14441444

1445-
if (pclass == -1) {
1446-
return ade_set_error(L, "o", l_Prop.Set(object_h()));
1447-
}
1448-
14491445
int obj_idx = prop_create(real_orient, &pos, pclass, name);
14501446

14511447
if(obj_idx >= 0) {

code/scripting/api/objs/object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ ADE_FUNC(__tostring, l_Object, NULL, "Returns name of object (if any)", "string"
107107
sprintf(buf, "%s beam", Weapon_info[Beams[objh->objp()->instance].weapon_info_index].name);
108108
break;
109109
case OBJ_PROP:
110-
sprintf(buf, "%s prop", "TEMP");
110+
sprintf(buf, "%s prop", Props[Objects[objh->objnum].instance]->prop_name);
111111
break;
112112
default:
113113
sprintf(buf, "object num=%d sig=%d type=%d instance=%d", objh->objnum, objh->sig, objh->objp()->type, objh->objp()->instance);

qtfred/src/mission/management.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ initialize(const std::string& cfilepath, int argc, char* argv[], Editor* editor,
219219
listener(SubSystem::Ships);
220220
ship_init();
221221

222-
//listener(subsystem::Props);
223-
//prop_init();
222+
//listener(Subsystem::Props);
223+
prop_init();
224224

225225
listener(SubSystem::TechroomIntel);
226226
techroom_intel_init();

0 commit comments

Comments
 (0)