Skip to content

Commit caaaf32

Browse files
authored
Merge pull request #1313 from asarium/fix/1307
Fix OpenGL distortion map update
2 parents 09524fb + e119be5 commit caaaf32

File tree

3 files changed

+35
-22
lines changed

3 files changed

+35
-22
lines changed

code/graphics/opengl/gropengldraw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,7 @@ void gr_opengl_update_distortion()
23382338
distortion_verts[i].b = 255;
23392339
distortion_verts[i].a = 255;
23402340

2341-
distortion_verts[i].screen.xyw.x = 0.04f;
2341+
distortion_verts[i].screen.xyw.x = 1.f;
23422342
distortion_verts[i].screen.xyw.y = (float)gr_screen.max_h*0.03125f*i;
23432343
}
23442344

code/lab/lab.cpp

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,8 @@ void labviewer_render_bitmap(float frametime)
12381238

12391239
void 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

13851390
template <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"
25212526
void lab_do_frame(float frametime)
25222527
{
2528+
GR_DEBUG_SCOPE("Lab Frame");
2529+
25232530
gr_reset_clip();
25242531
gr_clear();
25252532

code/lab/wmcgui.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,8 @@ void GUIScreen::DeleteObject(GUIObject* dgp)
472472

473473
int GUIScreen::OnFrame(float frametime, bool doevents)
474474
{
475+
GR_DEBUG_SCOPE("GUIScreen Frame");
476+
475477
GUIObject* cgp;
476478
GUIObject* cgp_prev;
477479
bool SomethingPressed = false;
@@ -608,6 +610,8 @@ ScreenClassInfoEntry *GUISystem::GetScreenClassInfo(const SCP_string & screen_na
608610

609611
int GUISystem::OnFrame(float frametime, bool doevents, bool clearandflip)
610612
{
613+
GR_DEBUG_SCOPE("GUISystem Frame");
614+
611615
//Set the global status variables for this frame
612616
LastStatus = Status;
613617
Status = GST_MOUSE_OVER;
@@ -748,7 +752,7 @@ GUIObject::GUIObject(const SCP_string &in_Name, int x_coord, int y_coord, int x_
748752
if (x_width == 0 || y_height == 0) {
749753
return;
750754
}
751-
755+
752756
//No! Bad!
753757
if (in_Name.length() < 1) {
754758
return;
@@ -831,7 +835,7 @@ GUIObject* GUIObject::AddChildInternal(GUIObject *cgp)
831835
cgp->GetOIECoords(&cgp->Coords[0], &cgp->Coords[1], &cgp->Coords[2], &cgp->Coords[3]);
832836
//In case we need to resize
833837
cgp->OnRefreshSize();
834-
838+
835839
return cgp;
836840
}
837841

@@ -840,7 +844,7 @@ GUIObject* GUIObject::AddChild(GUIObject* cgp)
840844
if (cgp == NULL) {
841845
return NULL;
842846
}
843-
847+
844848
//AddInternalChild must be used
845849
if (cgp->Style & GS_INTERNALCHILD) {
846850
return NULL;
@@ -892,6 +896,8 @@ void GUIObject::OnDraw(float frametime)
892896

893897
int GUIObject::OnFrame(float frametime, int *unused_queue)
894898
{
899+
GR_DEBUG_SCOPE("GUIObject Frame");
900+
895901
int rval = OF_TRUE;
896902

897903
GUIObject *cgp_prev; //Elements will move themselves to the end of the list if they become active

0 commit comments

Comments
 (0)