Skip to content

Commit ec3f5cc

Browse files
author
Mike Nelson
authored
QtFred viewport code cleanup (scp-fs2open#7361)
1 parent 076d384 commit ec3f5cc

File tree

7 files changed

+81
-380
lines changed

7 files changed

+81
-380
lines changed

qtfred/src/mission/Editor.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@
1515
#include <memory>
1616
#include <stdexcept>
1717

18-
namespace fso {
19-
namespace fred {
18+
namespace fso::fred {
19+
20+
struct subsys_to_render {
21+
bool do_render = false;
22+
object* ship_obj = nullptr;
23+
ship_subsys* cur_subsys = nullptr;
24+
};
2025

2126
enum class WingNameError {
2227
None,
@@ -363,8 +368,7 @@ class Editor : public QObject {
363368
void updateStartingWingLoadoutUseCounts();
364369
};
365370

366-
} // namespace fred
367-
} // namespace fso
371+
} // namespace fso::fred
368372

369373
extern char Fred_callsigns[MAX_SHIPS][NAME_LENGTH + 1];
370374
extern char Fred_alt_names[MAX_SHIPS][NAME_LENGTH + 1];

qtfred/src/mission/EditorViewport.cpp

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//
2-
//
3-
41
#include <globalincs/linklist.h>
52
#include <object/object.h>
63
#include <render/3d.h>
@@ -111,8 +108,7 @@ void verticalize_object(matrix* orient) {
111108

112109
}
113110

114-
namespace fso {
115-
namespace fred {
111+
namespace fso::fred {
116112

117113
const char* EditorViewport::DefaultLayerName = "Default";
118114

@@ -800,21 +796,6 @@ int EditorViewport::select_object(int cx, int cy) {
800796
vec3d p0, p1, v, hitpos;
801797
vertex vt;
802798

803-
///! \fixme Briefing!
804-
#if 0
805-
if (Briefing_dialog) {
806-
best = Briefing_dialog->check_mouse_hit(cx, cy);
807-
if (best >= 0)
808-
{
809-
if ((Selection_lock && !Objects[best].flags[Object::Object_Flags::Marked])) || Objects[best].flags[Object::Object_Flags::Locked_from_editing])
810-
{
811-
return -1;
812-
}
813-
return best;
814-
}
815-
}
816-
#endif
817-
818799
/* gr_reset_clip();
819800
g3_start_frame(0); ////////////////
820801
g3_set_view_matrix(&eye_pos, &eye_orient, 0.5f);*/
@@ -1724,5 +1705,4 @@ void EditorViewport::view_object(int obj_num) {
17241705
needsUpdate();
17251706
}
17261707

1727-
}
1728-
}
1708+
} // namespace fso::fred

qtfred/src/mission/EditorViewport.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@
77

88
#include <object/object.h>
99

10-
namespace fso {
11-
namespace fred {
10+
namespace fso::fred {
11+
12+
struct Marking_box {
13+
int x1 = 0;
14+
int y1 = 0;
15+
int x2 = 0;
16+
int y2 = 0;
17+
};
1218

1319
struct ViewSettings {
1420
bool Universal_heading = false;
@@ -182,8 +188,6 @@ class EditorViewport {
182188
int cur_model_index = 0;
183189
int cur_prop_index = -1;
184190

185-
bool Bg_bitmap_dialog = false;
186-
187191
object_orient_pos rotation_backup[MAX_OBJECTS];
188192

189193
vec3d saved_cam_pos = vmd_zero_vector;
@@ -220,5 +224,4 @@ class EditorViewport {
220224
void loadSettings();
221225
};
222226

223-
}
224-
}
227+
} // namespace fso::fred

0 commit comments

Comments
 (0)