View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002982 | FSSCP | HUD | public | 2013-12-18 09:35 | 2014-06-16 15:36 |
Reporter | m_m | Assigned To | m_m | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.7.1 | ||||
Target Version | 3.7.2 | ||||
Summary | 0002982: ASSERTION: "x >= 0 && y >= 0" at hud.cpp:403 when using the training messages HUD gauge | ||||
Description | This HUD gauge uses a negative offset to position itself so moving it to a place close to the screen borders where those offsets make the screen coordinates negative will cause the mentioned assertion. That assertion is presumably not needed anymore and should be removed, see attached patch. | ||||
Steps To Reproduce | Place the attached hud_gauges.tbl inside your tables folder and start FSO. | ||||
Tags | No tags attached. | ||||
|
|
|
hud.cpp.patch (310 bytes)
Index: code/hud/hud.cpp =================================================================== --- code/hud/hud.cpp (revision 10248) +++ code/hud/hud.cpp (working copy) @@ -400,8 +400,6 @@ void HudGauge::initPosition(int x, int y) { - Assert(x >= 0 && y >= 0); - position[0] = x; position[1] = y; } |
|
Interesting... I'm thinking that the hud gauges should default to setting the offsets to {0, 0} if the Origin is set and the Offsets are not set in the table. Alternatively, if the Origin is set then the Offsets become mandatory instead of optional, but that seems like it's making modders lives harder than they need to be. Either way, I think the current behaviour is a little bit non-intuitive and needs to be changed somehow. The Assertion is supposed to pick up on gauges that are specified to appear offscreen (fully or partially) so I think it should probably remain, although the wording of the Assertion could be improved to make this clearer. |
|
What do you think of this as a solution? https://github.com/niffiwan/fs2open.github.com/commit/74a5e2c53e142c00e9bf27a62ba086df0a0a466a Oops - check the 2nd commit as well, I forgot to make the changes to the two non-common gauges. ------------------ Actually - forget this, it's a bad idea as layouts using just the origin will probably have alignment issues |
|
Is this still an issue? I remember a discussion about it but I can't remember if a solution was found. |
|
Fix committed to trunk@10820. |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-12-18 09:35 | m_m | New Issue | |
2013-12-18 09:35 | m_m | Status | new => assigned |
2013-12-18 09:35 | m_m | Assigned To | => m_m |
2013-12-18 09:35 | m_m | File Added: hud_gauges.tbl | |
2013-12-18 09:35 | m_m | File Added: hud.cpp.patch | |
2013-12-18 09:35 | m_m | Status | assigned => code review |
2013-12-18 11:15 | niffiwan | Note Added: 0015521 | |
2013-12-19 02:18 | niffiwan | Note Added: 0015523 | |
2013-12-19 03:21 | niffiwan | Note Edited: 0015523 | |
2013-12-20 08:13 | niffiwan | Note Edited: 0015523 | |
2014-03-01 12:38 | m_m | Note Added: 0015632 | |
2014-06-16 15:36 | The_E | Changeset attached | => fs2open trunk r10820 |
2014-06-16 15:36 | The_E | Note Added: 0015882 | |
2014-06-16 15:36 | The_E | Status | code review => resolved |
2014-06-16 15:36 | The_E | Resolution | open => fixed |