diff --git a/contributors.md b/contributors.md index 302be0ee29..25c4082a91 100644 --- a/contributors.md +++ b/contributors.md @@ -177,6 +177,7 @@ The following people are not part of the development team, but have been contrib * Saad Rehman (SaadRehmanCS) * (ocalhoun6) * Sean Payne (seanmajorpayne) +* Soham Roy (sohamroy19) ## Toolchain * (Balletie) - macOS diff --git a/src/openrct2/core/CircularBuffer.h b/src/openrct2/core/CircularBuffer.h index f8d74fbc79..782e8af68f 100644 --- a/src/openrct2/core/CircularBuffer.h +++ b/src/openrct2/core/CircularBuffer.h @@ -12,14 +12,14 @@ #include #include -template class CircularBuffer +template class CircularBuffer { public: - using value_type = _TType; - using pointer = _TType*; - using const_pointer = const _TType*; - using reference = _TType&; - using const_reference = const _TType&; + using value_type = TType; + using pointer = TType*; + using const_pointer = const TType*; + using reference = TType&; + using const_reference = const TType&; using size_type = size_t; using difference_type = ptrdiff_t; @@ -137,5 +137,5 @@ private: size_t _head = 0; size_t _tail = 0; size_t _size = 0; - std::array<_TType, _TMax> _elements; + std::array _elements; }; diff --git a/src/openrct2/core/Meta.hpp b/src/openrct2/core/Meta.hpp index c1a81ff1f9..8bd635d44b 100644 --- a/src/openrct2/core/Meta.hpp +++ b/src/openrct2/core/Meta.hpp @@ -16,15 +16,15 @@ namespace Meta /** * Meta function for checking that all Conditions are true types. */ - template struct all : std::true_type + template struct all : std::true_type { }; - template - struct all<_TCondition, _TConditions...> : std::conditional<_TCondition::value, all<_TConditions...>, std::false_type>::type + template + struct all : std::conditional, std::false_type>::type { }; - template using all_convertible = all...>; + template using all_convertible = all...>; } // namespace Meta diff --git a/src/openrct2/core/Random.hpp b/src/openrct2/core/Random.hpp index c023fbf4b0..b5f8128988 100644 --- a/src/openrct2/core/Random.hpp +++ b/src/openrct2/core/Random.hpp @@ -27,12 +27,12 @@ namespace Random /** * FixedSeedSequence adheres to the _Named Requirement_ `SeedSequence`. */ - template class FixedSeedSequence + template class FixedSeedSequence { public: using result_type = uint32_t; - static constexpr size_t N = _TNum; + static constexpr size_t N = TNum; static constexpr result_type default_seed = 0x1234567F; explicit FixedSeedSequence() @@ -41,26 +41,26 @@ namespace Random } template< - typename... _TTypes, typename std::enable_if::type = 0, - typename std::enable_if::value, int>::type = 0> - explicit FixedSeedSequence(_TTypes... s) + typename... TTypes, typename std::enable_if::type = 0, + typename std::enable_if::value, int>::type = 0> + explicit FixedSeedSequence(TTypes... s) : v{ static_cast(s)... } { } - template(), ++std::declval<_TIt&>(), void())> - explicit FixedSeedSequence(_TIt begin, _TIt end) + template(), ++std::declval(), void())> + explicit FixedSeedSequence(TIt begin, TIt end) { std::copy(begin, end, v.begin()); } - template - explicit FixedSeedSequence(std::initializer_list<_TType> il) + template + explicit FixedSeedSequence(std::initializer_list il) : FixedSeedSequence(il.begin(), il.end()) { } - template void generate(_TIt begin, _TIt end) const + template void generate(TIt begin, TIt end) const { std::copy_n(v.begin(), std::min(static_cast(end - begin), N), begin); } @@ -70,7 +70,7 @@ namespace Random return N; } - template constexpr void param(_TIt ob) const + template constexpr void param(TIt ob) const { std::copy(v.begin(), v.end(), ob); } @@ -79,9 +79,9 @@ namespace Random std::array v; }; - template struct RotateEngineState + template struct RotateEngineState { - using value_type = _TUIntType; + using value_type = TUIntType; value_type s0; value_type s1; @@ -91,21 +91,21 @@ namespace Random * RotateEngine adheres to the _Named Requirement_ `RandomNumberEngine` * https://en.cppreference.com/w/cpp/named_req/RandomNumberEngine */ - template - class RotateEngine : protected RotateEngineState<_TUIntType> + template + class RotateEngine : protected RotateEngineState { - static_assert(std::is_unsigned<_TUIntType>::value, "Type must be unsigned integral."); + static_assert(std::is_unsigned::value, "Type must be unsigned integral."); - using RotateEngineState<_TUIntType>::s0; - using RotateEngineState<_TUIntType>::s1; + using RotateEngineState::s0; + using RotateEngineState::s1; public: - using result_type = _TUIntType; - using state_type = RotateEngineState<_TUIntType>; + using result_type = TUIntType; + using state_type = RotateEngineState; - static constexpr result_type x = _TX; - static constexpr size_t r1 = _TR1; - static constexpr size_t r2 = _TR2; + static constexpr result_type x = TX; + static constexpr size_t r1 = TR1; + static constexpr size_t r2 = TR2; static constexpr result_type default_seed = 1; static constexpr result_type min() @@ -129,8 +129,8 @@ namespace Random s1 = r.s1; } - template::value>::type> - explicit RotateEngine(_TSseq& seed_seq) + template::value>::type> + explicit RotateEngine(TSseq& seed_seq) { seed(seed_seq); } @@ -141,7 +141,7 @@ namespace Random s1 = s; } - template typename std::enable_if::value, void>::type seed(_TSseq& seed_seq) + template typename std::enable_if::value, void>::type seed(TSseq& seed_seq) { std::array s; seed_seq.generate(s.begin(), s.end()); diff --git a/src/openrct2/drawing/Font.h b/src/openrct2/drawing/Font.h index 0f870d241e..0681240867 100644 --- a/src/openrct2/drawing/Font.h +++ b/src/openrct2/drawing/Font.h @@ -33,8 +33,8 @@ enum class FontSpriteBase : int16_t #ifndef NO_TTF -struct _TTF_Font; -using TTF_Font = _TTF_Font; +struct InternalTTFFont; +using TTF_Font = InternalTTFFont; struct TTFFontDescriptor { const utf8* filename; diff --git a/src/openrct2/drawing/TTFSDLPort.cpp b/src/openrct2/drawing/TTFSDLPort.cpp index 0df6e8697c..f75557ea8c 100644 --- a/src/openrct2/drawing/TTFSDLPort.cpp +++ b/src/openrct2/drawing/TTFSDLPort.cpp @@ -103,7 +103,7 @@ struct c_glyph }; /* The structure used to hold internal font information */ -struct _TTF_Font +struct InternalTTFFont { /* Freetype2 maintains all sorts of useful info itself */ FT_Face face; diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 68276a7d51..2b6543ccc9 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -228,7 +228,7 @@ void window_close(rct_window* w) g_window_list.erase(itWindow); } -template static void window_close_by_condition(_TPred pred, uint32_t flags = WindowCloseFlags::None) +template static void window_close_by_condition(TPred pred, uint32_t flags = WindowCloseFlags::None) { bool listUpdated; do @@ -461,7 +461,7 @@ rct_widgetindex window_find_widget_from_point(rct_window* w, const ScreenCoordsX * * @param window The window to invalidate (esi). */ -template static void window_invalidate_by_condition(_TPred pred) +template static void window_invalidate_by_condition(TPred pred) { window_visit_each([pred](rct_window* w) { if (pred(w)) @@ -521,7 +521,7 @@ void widget_invalidate(rct_window* w, rct_widgetindex widgetIndex) { w->windowPos + ScreenCoordsXY{ widget.right + 1, widget.bottom + 1 } } }); } -template static void widget_invalidate_by_condition(_TPred pred) +template static void widget_invalidate_by_condition(TPred pred) { window_visit_each([pred](rct_window* w) { if (pred(w)) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index be5c3420da..2cf3886736 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -312,7 +312,7 @@ namespace PaintSortFlags static constexpr uint8_t OutsideQuadrant = (1U << 7); } // namespace PaintSortFlags -template +template static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, uint16_t quadrantIndex, uint8_t flag) { paint_struct* ps; @@ -403,7 +403,7 @@ static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, ui const paint_struct_bound_box& currentBBox = ps_next->bounds; - const bool compareResult = CheckBoundingBox<_TRotation>(initialBBox, currentBBox); + const bool compareResult = CheckBoundingBox(initialBBox, currentBBox); if (compareResult) {