94 Commits
Author SHA1 Message Date
Goober5000 067c65773a coverity: possible use of invalid iterator (especially with jump nodes) 2025-05-10 01:15:46 -04:00
Mike Nelson 5b736b1ddc Hud config framework (#6495)
* Add scaling for vfnts and scale multipler to gr_string

* nullptr

* Add scaling to a couple other string operations

* Add scaling features to additional bitmap drawing methods

* Implement framework for rendering hud gauges in config mode

* fix merge error

* address feedback
2025-02-03 07:01:47 -05:00
Mike Nelson 7f20b9cf64 Unlimited Asteroid/Debris Field Types & Subtypes (#6021)
* base working version of unlimited debris types

* Proper FRED support

* make qtFRED handle asteroids properly

* fix qtFRED assertion

* further clean out MAX_RETAIL_DEBRIS_TYPES

* These should be sizes not POFs

* Move this to it's own method

* convert asteroid subtypes to a vector

* unlimit asteroid subtypes

* fix some global shadowing

* signed/unsigned mismatch

* Address feedback
2024-06-10 22:06:10 +02:00
Goober5000 f4669db41c constify some turret code
Apply `const` to a whole bunch of functions.  Also change a bunch of ints to bools.
2023-12-30 00:00:31 -05:00
Goober5000 6e9b31cb5a replace pointers with indexes in ship registry and oswpt
This refactors the ship registry and the OSWPT struct to store data as indexes rather than pointers.  This is a prerequisite for making these collections dynamic in the future.  See also #5800.
2023-12-08 19:45:58 -05:00
BMagnu 02e84f212a Fix HUD slewing (#5656)
* Fixup HUD for slewing

* Fix Training Message box

* Lead indicator slew

* Fix HUD Message Head

* Correctly render messages

* Fix HUD offset handling

* HUD offset never makes any sense

* Cleanup offset code

* Remove unused parameter

* Fix Talking Head in RTT mode
2023-10-16 01:44:17 +09:00
Goober5000 3ae178e125 refinements of jump node features
1. Deprecate the old set-jumpnode-name sexp now that there is a set-jumpnode-display-name
2. Make the display name design consistent with ships and weapons; in particular add a `HasDisplayName()` function and automatically generate the display name for hash-truncated names
3. Keep the display name in sync when the name is changed in the FRED dialog
4. Fix the overriding of hash-truncated names with display names on the HUD
5. Fix the incorrect setting of the alphacolor flag when using FRED
6. Fix array out-of-bounds access when no object is selected

Follow-up to #5401.
2023-06-05 00:41:38 -04:00
mjn-mixael 78b957982b enhance jump node handling 2023-05-12 15:30:41 -05:00
MjnMixael 0a6729b03d enable target info in hud_gauges.tbl (#4778)
* enable target info in hud_gauges.tbl

* Comment
2022-10-18 17:08:44 +09:00
John Fernandez 4250aab601 Hud Bracket fixes
1) A comprehensive fix for the is_target_dying variable

2) Also do distance correctly for non-player target brackets by adding a check that we're dealing with the target before using the current target distance.  Then also calc distance if it is not the player target.

3) Update comments and checks to be consistent

Many of these did not reflect how the variable was actually used, so update the comments.
2022-06-29 11:40:12 -04:00
Asteroth 3e00b94a89 Early return instead of assert on 0 or less sized hud brackets (#4215)
* early return on 0 size brackets

* add comment
2022-04-26 18:10:31 -04:00
Goober5000 4d33ed6c92 make HUD target distance consistent
Several careful tweaks to improve handling of distance as measured on the HUD.

1) Use `Player_ai->current_target_distance` for rendered HUD gauges which display the distance, because the distance is calculated in `hud_update_frame` (which is called from `game_simulation_frame`) and is used for a couple of these gauges already.  This change makes it all consistent.
1b) Some gauges which depend on distance but do not actually display it (e.g. the lead indicator) still calculate their distance immediately before using it.  I didn't change these because a) the calculation is still correct, even if redundant, and b) there is a small possibility of `hud_update_frame` changing the target after the distance is calculated, so these gauges are guaranteed to have the correct calculation.

2) On discovering that the `evaluate_ship_as_closest_target` specifically switched from bbox-distance to center-distance, I changed all "target closest X" functions to consistently evaluate center-distance.  I believe Volition did this to prioritize small fighters when dogfighting next to large ships.

3) Moved `hud_target_change_check` below the computation of `Player_ai->current_target_distance` because it uses the computed distance to determine the acceleration trend.  This way it will use the distance of the current frame, not the previous one.

4) Minor move of a `Target_static_looping` check into `hud_target_change_check` because it made sense.
2022-04-03 13:46:44 -04:00
Goober5000 e27ed05127 spelling fixes 2021-10-20 15:31:23 -04:00
Jenna Trassa 9385206e0e Feedback & lowercase debris code 2021-03-03 20:56:24 +01:00
Jenna Trassa 34649c7543 Translated Asteroid Name in Asteroid Fields 2021-03-03 17:25:37 +01:00
Baezon 7b6488aba2 array safety 2020-10-21 23:23:23 -04:00
Baezon 6808101e4a much cleaner this way 2020-10-21 23:10:35 -04:00
Baezon eae514a269 v1 2020-10-21 22:57:08 -04:00
Goober5000 3b2af702f7 refactor display_name for ships, ship classes, and weapon classes
Several things going on here:
1) refactor `get_display_string()` to `get_display_name()` to be more precise
2) likewise, refactor `alt_name` to `display_name`
3) automatically generate display names when parsing the ship, ship class, and weapon class for the first time
4) remove the on-the-fly truncation of names with hash symbols

Basically this subsumes the `end_string_at_first_hash_symbol` logic into the display name.  Rather than truncate the name every time it's displayed, truncate it once when it's parsed.  This takes advantage of the previous display name infrastructure, since display names are a superset of the case of truncating the hash symbol.

This also has the benefit of now allowing hash symbols within display names.  When updating Destiny of Peace, I noticed that "Lockheed Shuttle #4" would no longer display properly; and it was not previously possible to fix this even with display names.

I could pull out the `get_display_string()` and `alt_name` renaming into a separate PR if desired.
2020-08-21 00:15:38 -04:00
CasparKielwein 0692286bba Remove dead code in hud directory.
Removed a lot of unused functions.
This is mostly a cleanup of a prior refactoring.
There where a lot of unimplemented functions remaining from renaming.
Removed several outcommented parts of code.
2018-12-26 20:40:20 +01:00
asarium 120750ebd2 Adress code review feedback 2018-06-04 11:56:45 +02:00
asarium ae149b6061 Add convencience function for retrieving weapon alt name
I also fixed a few issues where the internal char array was used as a
mutable string which changed the string after it was parsed which is not
good(TM).

This also replaces all user-facing occurences of usages of name to use
the new function so that the correct, possibly translated, name is displayed
to the user.
2018-06-04 11:56:44 +02:00
asarium bd3632d1bf Enable remaining misc- checks and fix detected issues 2018-04-25 11:57:55 +02:00
asarium eeed22b91a Enable misc-unused-parameters
clang-tidy was used for fixing the warnings. It is not clear if this is
actually an improvement so this may still be disabled later.
2018-04-25 11:57:55 +02:00
asarium 2e0253e301 Add a mechanism for batching line draw calls
The previous version used NanoVG which caused quite a serious FPS drop.
This adds a buffer batching class which groups line drawing operations
together and submits them to the GPU with a single draw call.
2018-02-25 19:55:41 +01:00
asarium e795327a3f Add simple NanoVG draw buffer for better performance
This improves the rendering performance of the target hotkey brackets a
bit which caused a significant slowdown previously.
2018-01-20 18:32:39 +01:00
Yarn366 69f9d9f090 Make the target bracket gauge account for the sizes of the font and the attacker blip 2015-11-19 15:35:31 -05:00
asarium b76bccb9ef Actually set the bounds of the drawn subsystem 2015-08-22 17:16:42 +02:00
Goober5000 bd3cd7eb18 Merge pull request #195 from Echelon9/fix/sort-uniq-includes
Review and refactor #include's
2015-08-19 00:05:02 -04:00
Echelon9 29fa74fd63 Remove redundant parameter to draw_brackets_diamond_quick(). 2015-07-01 23:07:17 +10:00
Echelon9 47af1ff851 Simplify duplicative hud/ includes. 2015-06-22 20:24:30 +10:00
Echelon9 c5493bb480 Scripted sort and uniq on (internal) project includes. Improves search time and as a by product removed a number of duplicative includes. 2015-06-22 20:24:30 +10:00
The_E 6e91857745 From Yarn: Fixes interface graphics scaling issues. If, for some reason, you want to have the interface graphics stretched, use the -stretch_menu commandline flag.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10544 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan 797ffdf0f4 Fix mantis 2883
update hud_num_make_mono (& callers) to handle the font number
add partial support for specifying special char indexes for individual fonts

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9985 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan 5f5d13f2b6 Remove 2 unused hudbrackets functions (only with "#if 0" for now)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9971 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
Goober5000 4bd10888ff make localization more robust with additional checks on string length, more consting, and stronger typing and make XSTR const, since we don't want to modify the strings it translates and then CONST ALL THE THINGS
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9809 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
chief1983 4e5d3e2e57 Fix all the 'no newline at end of file' warnings I saw thrown by gcc on FreeBSD. 2012-11-02 17:30:17 +00:00
m_m e2e3eeafed Adding a few new scripting functions, including support for dockingpoint access for scripting and a function to draw HUD-like brackets around an arbitrary subsystem. 2012-10-12 16:14:47 +00:00
Echelon9 e20a418c94 PVS-Studio fix: The 'false' value is implicitly casted to the integer type. 2012-05-28 13:35:39 +00:00
Echelon9 13ca0a1c67 Remove redundant #includes to fs2open's internal linked list implementation 2012-04-08 01:39:34 +00:00
Echelon9 a0e59defd6 CJumpNode class code convention; convert to UpperCamelCase for class and function name; ensure all private variables adopt m_ prefix 2012-04-07 11:07:30 +00:00
Swifty 3affb86b52 Removed configOverride from HudGauge class since we don't even use it. 2012-02-05 03:41:31 +00:00
Echelon9 5bf63e8c8d Third part of fixing jump_nodes refactor, remove the union approach to linking Jump_nodes into Objects[]. First go at clearing the FRED errors. 2011-11-19 04:07:30 +00:00
Echelon9 9f711bf53e Documentation: General code cleanup for 64bit 2011-11-05 08:12:04 +00:00
IssMneur 0717ad3d13 PVS-Studio fix: V512 A call of the 'memcpy' function will lead to overflow of the buffer '& x'. (pstypes.h:131) 2011-09-08 05:39:53 +00:00
Goober5000 f3349119b8 end string at hash symbol for jump nodes too 2011-09-06 08:59:29 +00:00
Zacam 09fad95070 Antipodes 7 Merge: HUD Overhaul, by Swifty. 2010-12-12 20:34:15 +00:00
portej05 98f337f701 safe_strings - from Antipodes build #1 2009-07-27 16:06:24 +00:00
portej05 719825f80d The big CVS comment removal. This chops approx. 3.5mb off a full checkout.
I've tested this through compiling and through hand checking. 
Normalises line endings in ALL files to \n.
2009-06-20 08:08:20 +00:00
karajorma a4e623db23 Portej05's preFAST warning fixes. 2009-05-17 11:50:48 +00:00