View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0003108 | FSSCP | tables | public | 2014-09-25 05:28 | 2014-09-26 08:11 |
| Reporter | Yarn | Assigned To | Yarn | ||
| Priority | normal | Severity | major | Reproducibility | N/A |
| Status | resolved | Resolution | fixed | ||
| Platform | x64 | OS | Windows 7 | ||
| Product Version | 3.7.1 | ||||
| Summary | 0003108: Parsing tweaks necessary for custom gauges and the DRADIS radar [patch included] | ||||
| Description | I noticed two issues with custom gauges and the DRADIS radar in hudgauges.tbl: 1: The code that parses the position information for these gauges is outdated; it should be updated to match gauge_load_custom, where Origin and Offset must be used together. 2: The DRADIS radar requires Scale Gauge and Font to start with dollar signs. This differs from the wiki documentation and how all the other gauges are parsed. | ||||
| Additional Information | I have attached a patch that fixes both issues. | ||||
| Tags | No tags attached. | ||||
|
|
mantis3108.patch (2,344 bytes)
Index: code/hud/hudparse.cpp
===================================================================
--- code/hud/hudparse.cpp (revision 11084)
+++ code/hud/hudparse.cpp (working copy)
@@ -1270,17 +1270,26 @@
}
adjust_base_res(base_res, scale_gauge);
+
+ // If no positioning information is specified, use the default position
+ bool use_default_pos = true;
if(optional_string("Origin:")) {
stuff_float_list(origin, 2);
+ use_default_pos = false;
+
+ required_string("Offset:");
+ stuff_int_list(offset, 2);
}
if(optional_string("Offset:")) {
- stuff_int_list(offset, 2);
+ Error(LOCATION, "HUD gauges table: Offset must also have Origin defined");
}
- coords[0] = (int)(base_res[0] * origin[0]) + offset[0];
- coords[1] = (int)(base_res[1] * origin[1]) + offset[1];
+ if (!use_default_pos) {
+ coords[0] = (int)(base_res[0] * origin[0]) + offset[0];
+ coords[1] = (int)(base_res[1] * origin[1]) + offset[1];
+ }
}
if ( optional_string("Cockpit Target:") && ship_idx->at(0) >= 0 ) {
@@ -2904,22 +2913,31 @@
if(optional_string("Position:")) {
stuff_int_list(coords, 2);
} else {
- if (optional_string("$Scale Gauge:")) {
+ if (optional_string("Scale Gauge:")) {
stuff_boolean(&scale_gauge);
}
adjust_base_res(base_res, scale_gauge);
+
+ // If no positioning information is specified, use the default position
+ bool use_default_pos = true;
if(optional_string("Origin:")) {
stuff_float_list(origin, 2);
+ use_default_pos = false;
+
+ required_string("Offset:");
+ stuff_int_list(offset, 2);
}
if(optional_string("Offset:")) {
- stuff_int_list(offset, 2);
+ Error(LOCATION, "HUD gauges table: Offset must also have Origin defined");
}
- coords[0] = (int)(base_res[0] * origin[0]) + offset[0];
- coords[1] = (int)(base_res[1] * origin[1]) + offset[1];
+ if (!use_default_pos) {
+ coords[0] = (int)(base_res[0] * origin[0]) + offset[0];
+ coords[1] = (int)(base_res[1] * origin[1]) + offset[1];
+ }
}
} else {
adjust_base_res(base_res, scale_gauge);
@@ -2928,7 +2946,7 @@
coords[1] = (int)(base_res[1] * origin[1]) + offset[1];
}
- if(optional_string("$Font:")) {
+ if(optional_string("Font:")) {
stuff_int(&font_num);
} else {
if ( hud_font >=0 ) {
|
|
|
Fix committed to trunk@11087. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2014-09-25 05:28 | Yarn | New Issue | |
| 2014-09-25 05:28 | Yarn | Status | new => assigned |
| 2014-09-25 05:28 | Yarn | Assigned To | => Yarn |
| 2014-09-25 05:28 | Yarn | File Added: mantis3108.patch | |
| 2014-09-25 05:29 | Yarn | Status | assigned => code review |
| 2014-09-26 08:11 | niffiwan | Changeset attached | => fs2open trunk r11087 |
| 2014-09-26 08:11 | niffiwan | Note Added: 0016303 | |
| 2014-09-26 08:11 | niffiwan | Status | code review => resolved |
| 2014-09-26 08:11 | niffiwan | Resolution | open => fixed |