@@ -1238,6 +1238,8 @@ void labviewer_render_bitmap(float frametime)
12381238
12391239void labviewer_do_render (float frametime)
12401240{
1241+ GR_DEBUG_SCOPE (" Lab Render" );
1242+
12411243 int w, h;
12421244
12431245 if ( (Lab_model_num < 0 ) && (Lab_bitmap_id < 0 ) ) {
@@ -1250,7 +1252,8 @@ void labviewer_do_render(float frametime)
12501252
12511253 // render our particular thing
12521254 if (Lab_model_num >= 0 ) {
1253-
1255+ GR_DEBUG_SCOPE (" Lab Render model" );
1256+
12541257 gr_scene_texture_begin ();
12551258
12561259 labviewer_render_model (frametime);
@@ -1264,6 +1267,8 @@ void labviewer_do_render(float frametime)
12641267 gr_string (gr_screen.center_offset_x + gr_screen.center_w - w, gr_screen.center_offset_y + gr_screen.center_h - h, Lab_model_filename, GR_RESIZE_NONE);
12651268 }
12661269 } else if (Lab_bitmap_id >= 0 ) {
1270+ GR_DEBUG_SCOPE (" Lab Render bitmap" );
1271+
12671272 gr_scene_texture_begin ();
12681273
12691274 labviewer_render_bitmap (frametime);
@@ -1377,13 +1382,13 @@ void labviewer_flags_clear()
13771382 if (Lab_flags_window != NULL ) {
13781383 Lab_flags_window->DeleteChildren ();
13791384 }
1380-
1385+
13811386 Ship_Class_Flags.clear ();
13821387 Weapon_Class_Flags.clear ();
13831388}
13841389
13851390template <class T >
1386- void labviewer_flags_add (int * X, int * Y, const char *flag_name, T flag, SCP_vector<lab_flag<T>>& flag_list)
1391+ void labviewer_flags_add (int * X, int * Y, const char *flag_name, T flag, SCP_vector<lab_flag<T>>& flag_list)
13871392{
13881393 int x = 0 , y = 0 ;
13891394
@@ -1424,12 +1429,12 @@ void labviewer_populate_flags_window()
14241429
14251430 // clear out anything that already exists
14261431 labviewer_flags_clear ();
1427-
1432+
14281433 int y = 0 ;
14291434
14301435 // ship flags ...
14311436 if (Lab_mode == LAB_MODE_SHIP) {
1432- for (size_t i = 0 ; i < Num_ship_flags; ++i)
1437+ for (size_t i = 0 ; i < Num_ship_flags; ++i)
14331438 {
14341439 labviewer_flags_add<Ship::Info_Flags>(nullptr , &y, Ship_flags[i].name , Ship_flags[i].def , Ship_Class_Flags);
14351440 }
@@ -1448,11 +1453,11 @@ void labviewer_update_flags_window()
14481453 if ( (Lab_selected_index < 0 ) || (Lab_mode == LAB_MODE_NONE) ) {
14491454 return ;
14501455 }
1451-
1456+
14521457 if (Lab_mode == LAB_MODE_SHIP) {
14531458 auto sip = &Ship_info[Lab_selected_index];
14541459
1455- for (auto flag_def : Ship_Class_Flags)
1460+ for (auto flag_def : Ship_Class_Flags)
14561461 {
14571462 if (flag_def.flag == Ship::Info_Flags::NUM_VALUES) continue ;
14581463 flag_def.cb ->SetFlag (sip->flags , flag_def.flag , sip);
@@ -1633,20 +1638,20 @@ void labviewer_populate_variables_window()
16331638 labviewer_variables_add (&y, " Lifetime" );
16341639 labviewer_variables_add (&y, " Range" );
16351640 labviewer_variables_add (&y, " Min Range" );
1636-
1641+
16371642 VAR_ADD_HEADER (" Damage" );
16381643 labviewer_variables_add (&y, " Fire wait" );
16391644 labviewer_variables_add (&y, " Damage" );
16401645 labviewer_variables_add (&y, " Armor factor" );
16411646 labviewer_variables_add (&y, " Shield factor" );
16421647 labviewer_variables_add (&y, " Subsys factor" );
1643-
1648+
16441649 VAR_ADD_HEADER (" Armor" );
16451650 labviewer_variables_add (&y, " Damage type" );
1646-
1651+
16471652 VAR_ADD_HEADER (" Shockwave" );
16481653 labviewer_variables_add (&y, " Speed" );
1649-
1654+
16501655 VAR_ADD_HEADER (" Missiles" );
16511656 labviewer_variables_add (&y, " Turn time" );
16521657 labviewer_variables_add (&y, " FOV" );
@@ -1757,17 +1762,17 @@ void labviewer_update_variables_window()
17571762 VAR_SET_VALUE_SAVE (wip->lifetime , 0 );
17581763 VAR_SET_VALUE_SAVE (wip->weapon_range , 0 );
17591764 VAR_SET_VALUE_SAVE (wip->WeaponMinRange , 0 );
1760-
1765+
17611766 VAR_SET_VALUE_SAVE (wip->fire_wait , 0 );
17621767 VAR_SET_VALUE_SAVE (wip->damage , 0 );
17631768 VAR_SET_VALUE_SAVE (wip->armor_factor , 0 );
17641769 VAR_SET_VALUE_SAVE (wip->shield_factor , 0 );
17651770 VAR_SET_VALUE_SAVE (wip->subsystem_factor , 0 );
1766-
1771+
17671772 VAR_SET_VALUE_SAVE (wip->damage_type_idx , 0 );
1768-
1773+
17691774 VAR_SET_VALUE_SAVE (wip->shockwave .speed , 0 );
1770-
1775+
17711776 VAR_SET_VALUE_SAVE (wip->turn_time , 0 );
17721777 VAR_SET_VALUE_SAVE (wip->fov , 0 );
17731778 VAR_SET_VALUE_SAVE (wip->min_lock_time , 0 );
@@ -2276,7 +2281,7 @@ void labviewer_change_ship(Tree *caller)
22762281 if ( !Lab_in_mission ) {
22772282 return ;
22782283 }
2279-
2284+
22802285 Lab_selected_index = (int )(caller->GetSelectedItem ()->GetData ());
22812286
22822287 labviewer_update_desc_window ();
@@ -2370,7 +2375,7 @@ void labviewer_make_weap_window(Button* caller)
23702375
23712376 // populate the weapons window
23722377 Tree *cmp = (Tree*)Lab_class_window->AddChild (new Tree (" Weapon Tree" , 0 , 0 ));
2373-
2378+
23742379 // Unfortunately these are hardcoded
23752380 TreeItem **type_nodes = new TreeItem*[Num_weapon_subtypes];
23762381 int i;
@@ -2388,7 +2393,7 @@ void labviewer_make_weap_window(Button* caller)
23882393 Warning (LOCATION, " Invalid weapon subtype found on weapon %s" , Weapon_info[i].name );
23892394 continue ;
23902395 }
2391-
2396+
23922397 if (Weapon_info[i].wi_flags [Weapon::Info_Flags::Beam]) {
23932398 stip = type_nodes[WP_BEAM];
23942399 } else {
@@ -2520,6 +2525,8 @@ void lab_init()
25202525#include " controlconfig/controlsconfig.h"
25212526void lab_do_frame (float frametime)
25222527{
2528+ GR_DEBUG_SCOPE (" Lab Frame" );
2529+
25232530 gr_reset_clip ();
25242531 gr_clear ();
25252532
0 commit comments