Commit Graph

302 Commits

Author SHA1 Message Date
Luke Street e38a7f97bd Runtime/GuiSys: Replace bitfield unions with constructor initializers 2020-04-10 15:11:10 -04:00
Lioncash 1e6b6622fe CGuiFrame: Remove unnecessary mutable specifiers
We can just drop the const qualifier on ProcessMouseInput() to make the
mutable specifier unnecessary.
2020-04-10 02:17:50 -04:00
Lioncash 2fadaf544d CCompoundTargetReticle: Remove mutable specifier on x28_noDrawTicks
This is no longer needed at all.
2020-04-09 21:35:16 -04:00
Lioncash b72d217a68 CCompoundTargetingReticle: Remove mutable specifier on m_scanRetRenderer
This can be trivially resolved by dropping const qualifiers on the
necessary member functions.
2020-04-09 21:31:22 -04:00
Lioncash 35ca901784 CHudRadarInterface: Remove mutable specifiers from class members
We can just drop the const qualifiers on the relevant member functions
to make these unnecessary.
2020-04-09 21:23:50 -04:00
Lioncash db0091e9cd CWordBreakTables: Make use of std::array where applicable
Same behavior, but allows directly querying iterators. We can also make
these arrays constexpr.
2020-04-07 13:24:23 -04:00
Lioncash f7962cb3f7 CRasterFont: Extend CFontInfo buffer to 64 characters
GM8E v0 seems to be using at least a buffer 64 characters in size, not
40.
2020-04-06 06:59:22 -04:00
Lioncash 94264f6fe6 CRasterFont: Collapse loop into a std::find_if in InternalGetGlyph()
Same behavior, less code.
2020-04-05 06:01:29 -04:00
Lioncash 67f6666ea1 Runtime: Add more usages of explicit
Prevents error-prone implicit conversions where applicable.

This targets the regular RuntimeCommon target this time around.
2020-03-31 03:53:49 -04:00
Lioncash 6dce70895c CIOWin: Make Draw() non-const
Allows removing several const_cast usages within the codebase.
2020-03-29 21:56:49 -04:00
Lioncash 0d3bab4c14 CScanDisplay: Remove use of const_cast
The draw function is essentially not fully const in behavior, so we can
remove the const qualifiers where necessary.
2020-03-29 21:44:10 -04:00
Lioncash 2d8e94911a CGuiTextSupport: Eliminate the use of const_cast
We can supply a const and non-const variant to eliminate the need to
const_cast here.
2020-03-29 21:37:11 -04:00
Lioncash f3afcf7299 CGuiTextPane: Remove stray unnecessary const_cast in Draw()
Draw() isn't const qualified, so there's no need to cast away const
here.
2020-03-29 21:25:47 -04:00
Lioncash 603942daaf CTextRenderBuffer: Remove use of const_cast in Render()
Makes for much less casting.
2020-03-29 20:27:04 -04:00
Lioncash 04a42980ab Revert "Revert "CTextRenderBuffer: Forward declare structs where applicable""
This reverts commit 16745f3a7b.

We can simply default the move constructor and move assignment operator
to make this work.
2020-03-29 20:09:16 -04:00
Phillip Stephens 16745f3a7b
Revert "CTextRenderBuffer: Forward declare structs where applicable" 2020-03-29 16:35:02 -07:00
Phillip Stephens f3721844b9
Merge pull request #282 from lioncash/struct
CTextRenderBuffer: Forward declare structs where applicable
2020-03-29 16:04:32 -07:00
Lioncash 232ae12802 CGuiTextPane: Make use of std::array where applicable
Same behavior, but with stronger typing and allows removing of a
hardcoded array size.
2020-03-29 08:00:40 -04:00
Lioncash 0aff4dc21e CTextRenderBuffer: Remove use of const_cast within Render()
Same behavior but way less casting.
2020-03-29 04:42:58 -04:00
Lioncash 20b74c4818 CTextRenderBuffer: Forward declare structs where applicable
These are only used internally, so we can completely hide these structs
from external view.

This allows their implementation to be changed without needing to
recompile all the headers that include it.
2020-03-29 03:54:29 -04:00
Lioncash fda08db9b1 CHudVisorBeamMenu: Dehardcode array sizes
Same behavior, but queries the container for the size rather than
hardcoding it in loop bounds.
2020-03-29 03:08:41 -04:00
Lioncash 413483a996 CHudFreeLookInterfaceXRay: Assign free look and control held flags in SetFreeLookState()
GM8Ev0 does this.
2020-03-29 02:08:51 -04:00
Lioncash ad07b993c8 CHudFreeLookInterface: Collapse conditional within SetFreeLookState()
Same behavior, less code.
2020-03-29 02:03:20 -04:00
Lioncash 59fbefbd58 CGuiWidget: Provide names for all function prototypes
Makes parameter introspection nicer with IDEs and also renames ambiguous
"v" names to something more self-descriptive.
2020-03-29 01:52:23 -04:00
Lioncash 194cdf145f Runtime: Use nullptr where applicable
Same behavior, but no magic 0 value.

While we're in the same area, we can do minor cosmetic changes.
2020-03-27 20:18:54 -04:00
Phillip Stephens e0fe365dfd
Merge pull request #278 from lioncash/explicit
General: Make use of explicit constructors where applicable
2020-03-27 14:10:19 -07:00
Lioncash 241a66dc0a General: Make use of explicit constructors where applicable
Gets rid of potential error prone implicitly constructing constructors.
2020-03-27 06:00:17 -04:00
Lioncash fcf70aeb2a CGuiWidgetIdDB: Remove redundant std::make_pair funcs
Same behavior, less code.
2020-03-26 03:55:28 -04:00
Lioncash f4b3fb947e CScanDisplay: Make constructor explicit
Prevents error-prone implicit construction from occurring.
2020-03-25 20:46:08 -04:00
Luke Street 8314d5b6ef Merge branch 'pr-255' 2020-03-25 02:09:02 -04:00
Luke Street 3734a09ed3 CGuiWidget: Make GetIsFinishedLoading non-const 2020-03-25 02:01:47 -04:00
Lioncash 40fc3f9dd8 CModelBoo: Remove usages of const_cast
Many functions are modifying internals of CBooModel and const-casting
is performed in order to work around functions being const when they
really shouldn't be.

This amends the function signatures in order to allow these functions to
exist without const_cast, making code much nicer to read.
2020-03-25 02:01:46 -04:00
Lioncash fc4df76afc General: Make use of emplace_back where applicable
Allows for in-place construction. Also results in less code to read in
certain usages.
2020-03-21 00:30:12 -04:00
Luke Street 44325a5ad4
Merge pull request #248 from lioncash/slider
CGuiSliderGroup: Make use of std::array where applicable
2020-03-18 01:05:30 -04:00
Luke Street b13a6b491b
Merge pull request #245 from lioncash/drawstring
CDrawStringOptions: Resize vector within constructor
2020-03-18 01:04:08 -04:00
Luke Street 7c8de88fd7
Merge pull request #244 from lioncash/pane
CAui*: Make use of std::array where applicable
2020-03-18 01:03:50 -04:00
Lioncash 9d5857e139 CGuiSliderGroup: Make use of std::array where applicable
Same behavior, stronger typing.
2020-03-17 22:22:06 -04:00
Lioncash 1d6354ba26 CDrawStringOptions: Resize vector within constructor
Same behavior, but constructs the vector with the necessary size, rather
than constructing and resizing after the fact.
2020-03-17 21:35:08 -04:00
Lioncash fa6006003d CAuiEnergyBarT01: Make use of std::array where applicable
Same behavior, but allows dehardcoding array sizes.
2020-03-17 21:26:57 -04:00
Lioncash e534f00706 CAuiEnergyBarT01: Convert typedef into using alias
Same behavior, but nicer to read.
2020-03-17 21:24:01 -04:00
Lioncash 15e4d4aa01 CAuiImagePane: Make use of std::array where applicable
Same behavior, stronger typing.
2020-03-17 21:22:17 -04:00
Luke Street eeb09f512d
Merge pull request #220 from lioncash/array
CHud*: Make use of std::array where applicable
2020-03-15 19:56:33 -04:00
Luke Street e1d622d47b
Merge pull request #221 from lioncash/emplace
CFontImageDef: Make use of emplace_back where applicable
2020-03-15 19:44:23 -04:00
Lioncash e64dfe76b2 CFontImageDef: Make use of emplace_back where applicable
Same behavior, but constructs the instances directly within the
container.
2020-03-14 18:45:37 -04:00
Lioncash e0392d69c4 CHudEnergyInterface: Make use of std::array where applicable 2020-03-14 17:59:39 -04:00
Lioncash c4796ed090 CHudMissileInterface: Make use of std::array where applicable 2020-03-14 17:57:05 -04:00
Lioncash 9fafb24fb9 CHudVisorBeamMenu: Make use of std::array where applicable 2020-03-14 17:52:30 -04:00
Lioncash 07542ff335 CHudThreatInterface: Make use of std::array where applicable
Same behavior, but with stronger typing.
2020-03-14 17:38:57 -04:00
Lioncash 097d4a4422 Runtime: Collapse emplace_back() calls where applicable
Same behavior, but with less code.
2020-03-13 17:14:44 -04:00
Phillip Stephens b492c91ccf
Merge pull request #197 from lioncash/cond
CFontRenderState: Collapse common switch cases in RefreshColor()
2020-03-08 18:03:17 -07:00