View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001933 | FSSCP | graphics | public | 2009-06-02 07:58 | 2009-11-10 03:32 |
Reporter | KeldorKatarn | Assigned To | portej05 | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | PC | OS | Windows Vista | OS Version | SP 1 |
Product Version | 3.6.11 | ||||
Fixed in Version | 3.6.11 | ||||
Summary | 0001933: Custom gauges show up in external view | ||||
Description | The title pretty much says it. Custom gauges are not hidden when switching to external view. | ||||
Tags | No tags attached. | ||||
|
Location: hud.cpp, around line 1900. The code that draws the standard gauges has if (!(Viewer_mode & (VM_EXTERNAL | VM_DEAD_VIEW | VM_WARP_CHASE | VM_PADLOCK_ANY ))){ around it. What if a custom gauge is intended to be shown in external view? |
|
Well by default they shouldn't.. I mean it's part of the HUD.. why should HUD show up when looking at a ship from the outside (except 3rd person view of course, in which the entire hud remains visible). If at any point some mod would need such a gauge, then one might want to add an additional option to enable that to hud_gauges.tbl when defining the gauge. But by default it should behave like the rest of the HUD. |
|
Can you provide testing data for this? My gut reaction would be to stick the if statement from my first comment around the code that draws the custom gauges near line 1900 in hud.cpp. It is the same if statement that protects the normal hud elements from being drawn. |
|
Well... what testing data do you need? Just specify a custom gauge with any visible location and some arbitrary .ani and see if it shows up or not. |
2009-06-07 14:05
|
externalcustomgauges.diff (4,357 bytes)
Index: code/hud/hud.cpp =================================================================== --- code/hud/hud.cpp (revision 5327) +++ code/hud/hud.cpp (working copy) @@ -1846,70 +1846,72 @@ return; } - //Custom hud stuff + if (!(Viewer_mode & (VM_EXTERNAL | VM_DEAD_VIEW | VM_WARP_CHASE | VM_PADLOCK_ANY ))) { + //Custom hud stuff #ifdef NEW_HUD - //Player_ship->ship_hud.show(); - // int i; - // gauge_data* cg; -/* for(i = 0; i < current_hud->num_gauges; i++) - { + //Player_ship->ship_hud.show(); + // int i; + // gauge_data* cg; + /* for(i = 0; i < current_hud->num_gauges; i++) + { if(current_hud->gauges[i].type == HG_MAINGAUGE) { - current_hud->gauges[i].update(current_hud->owner); + current_hud->gauges[i].update(current_hud->owner); } - }*/ + }*/ #else - int i; - static bool image_ids_set = false; - static hud_frames image_ids[MAX_CUSTOM_HUD_GAUGES]; - if(!image_ids_set) - { - for(i = 0; i < Num_custom_gauges; i++) + int i; + static bool image_ids_set = false; + static hud_frames image_ids[MAX_CUSTOM_HUD_GAUGES]; + if(!image_ids_set) { - if(strlen(current_hud->custom_gauge_images[i])) + for(i = 0; i < Num_custom_gauges; i++) { - image_ids[i].first_frame = bm_load_animation(current_hud->custom_gauge_images[i], &image_ids[i].num_frames); - if(image_ids[i].first_frame != -1) + if(strlen(current_hud->custom_gauge_images[i])) { - bm_page_in_aabitmap( image_ids[i].first_frame, image_ids[i].num_frames ); + image_ids[i].first_frame = bm_load_animation(current_hud->custom_gauge_images[i], &image_ids[i].num_frames); + if(image_ids[i].first_frame != -1) + { + bm_page_in_aabitmap( image_ids[i].first_frame, image_ids[i].num_frames ); + } + else + { + image_ids[i].first_frame = bm_load(current_hud->custom_gauge_images[i]); + } } else { - image_ids[i].first_frame = bm_load(current_hud->custom_gauge_images[i]); + image_ids[i].first_frame = -1; } } - else - { - image_ids[i].first_frame = -1; - } + image_ids_set = true; } - image_ids_set = true; - } - //Display the gauges - for(i = 0; i < Num_custom_gauges; i++) - { - if(current_hud->custom_gauge_colors[i].red != 0 || current_hud->custom_gauge_colors[i].green != 0 || current_hud->custom_gauge_colors[i].blue != 0) + //Display the gauges + for(i = 0; i < Num_custom_gauges; i++) { - //No custom alpha gauge color... - gr_init_alphacolor(¤t_hud->custom_gauge_colors[i], current_hud->custom_gauge_colors[i].red, current_hud->custom_gauge_colors[i].green, current_hud->custom_gauge_colors[i].blue, (HUD_color_alpha+1)*16); + if(current_hud->custom_gauge_colors[i].red != 0 || current_hud->custom_gauge_colors[i].green != 0 || current_hud->custom_gauge_colors[i].blue != 0) + { + //No custom alpha gauge color... + gr_init_alphacolor(¤t_hud->custom_gauge_colors[i], current_hud->custom_gauge_colors[i].red, current_hud->custom_gauge_colors[i].green, current_hud->custom_gauge_colors[i].blue, (HUD_color_alpha+1)*16); - gr_set_color_fast(¤t_hud->custom_gauge_colors[i]); + gr_set_color_fast(¤t_hud->custom_gauge_colors[i]); + } + if(strlen(current_hud->custom_gauge_text[i])) + { + hud_num_make_mono(current_hud->custom_gauge_text[i]); + gr_string(current_hud->custom_gauge_coords[i][0], current_hud->custom_gauge_coords[i][1], current_hud->custom_gauge_text[i]); + } + if(image_ids[i].first_frame != -1) + { + GR_AABITMAP(image_ids[i].first_frame + current_hud->custom_gauge_frames[i], current_hud->custom_gauge_coords[i][0], current_hud->custom_gauge_coords[i][1]); + } + + //So we're back to normal + hud_set_default_color(); } - if(strlen(current_hud->custom_gauge_text[i])) - { - hud_num_make_mono(current_hud->custom_gauge_text[i]); - gr_string(current_hud->custom_gauge_coords[i][0], current_hud->custom_gauge_coords[i][1], current_hud->custom_gauge_text[i]); - } - if(image_ids[i].first_frame != -1) - { - GR_AABITMAP(image_ids[i].first_frame + current_hud->custom_gauge_frames[i], current_hud->custom_gauge_coords[i][0], current_hud->custom_gauge_coords[i][1]); - } - - //So we're back to normal - hud_set_default_color(); +#endif } -#endif if (!(Viewer_mode & (VM_EXTERNAL | VM_DEAD_VIEW | VM_WARP_CHASE | VM_PADLOCK_ANY ))) { |
|
Patch attached. Debug build will be posted in Recent Builds forum (http://www.hard-light.net/forums/index.php/topic,63662.0.html). Please test - I cannot figure out how to reproduce this issue. |
|
Add this to hud_gauges.tbl right before the #Main gauges entry #Custom Gauges $Name: Central #End #Main Gauges $Default: (1024 768) $Central: (346 219) +Image: central +Color: 175 230 175 #End then add the attached ani to the data/hud folder that should make this testable |
2009-06-07 15:51
|
|
|
I tested the build and it seems to work, but please thoroughly test this further. The diff is very large and I can't judge from here if there are any unwanted side effects. |
|
Patch attached. |
|
Jumped the gun a bit there - patch not accepted yet. |
|
Fix committed |
|
According to the forums, pan view still does not function correctly. Should that be a separate issue or should this be reopened? |
Date Modified | Username | Field | Change |
---|---|---|---|
2009-06-02 07:58 | KeldorKatarn | New Issue | |
2009-06-04 12:19 | portej05 | Note Added: 0010942 | |
2009-06-06 13:06 | KeldorKatarn | Note Added: 0010952 | |
2009-06-07 08:16 | portej05 | Note Added: 0010954 | |
2009-06-07 13:14 | KeldorKatarn | Note Added: 0010955 | |
2009-06-07 14:05 | portej05 | File Added: externalcustomgauges.diff | |
2009-06-07 14:06 | portej05 | Note Added: 0010956 | |
2009-06-07 14:16 | portej05 | Status | new => assigned |
2009-06-07 14:16 | portej05 | Assigned To | => portej05 |
2009-06-07 14:16 | portej05 | Status | assigned => feedback |
2009-06-07 15:50 | KeldorKatarn | Note Added: 0010962 | |
2009-06-07 15:51 | KeldorKatarn | File Added: central.ani | |
2009-06-07 15:56 | portej05 | Note Edited: 0010956 | |
2009-06-07 19:46 | KeldorKatarn | Note Added: 0010964 | |
2009-06-08 06:56 | portej05 | Status | feedback => resolved |
2009-06-08 06:56 | portej05 | Resolution | open => fixed |
2009-06-08 06:56 | portej05 | Note Added: 0010965 | |
2009-06-08 07:11 | portej05 | Note Added: 0010966 | |
2009-06-08 07:11 | portej05 | Status | resolved => acknowledged |
2009-06-20 07:41 | portej05 | Status | acknowledged => resolved |
2009-06-20 07:41 | portej05 | Fixed in Version | => 3.6.11 |
2009-06-20 07:41 | portej05 | Note Added: 0010983 | |
2009-11-10 03:32 | chief1983 | Note Added: 0011232 |