Commit Graph

71 Commits

Author SHA1 Message Date
Michał Janiszewski 1b4875e528 Extract math-related functions from common.h to Math.hpp
Saves wide inclusion of <stdexcept> header, which pulls in <string>
2021-10-09 21:43:06 +02:00
ζeh Matt b733e97bfa
Remove numerics from common.h and use it as needed 2021-09-11 20:21:08 +03:00
Hielke Morsink 15d3a4a9da
Update more include guards (#15254) 2021-08-21 12:55:28 +02:00
Gymnasiast 114eff46f0
Remove static attribute from ToMoney64/32/16 2021-08-01 15:14:43 +02:00
Gymnasiast 2b78ee7b26
Create other variants of ToMoney# 2021-08-01 15:14:43 +02:00
Ted John 70d9c1438e
Change most things and formatting to money64 2021-08-01 15:14:42 +02:00
Michał Janiszewski ac6e4fc0d6 Move SPRITE_INDEX_NULL, MAX_SPRITES to their new homes 2021-02-25 10:56:27 +01:00
Gymnasiast 9a3d9c512e
Move register definition to TestPaint 2021-01-17 22:14:55 +01:00
Mathias Gibbens b1e5a11bf3
Several more spelling fixes (#13752)
Signed-off-by: Mathias Gibbens <mathias@calenhad.com>

Co-authored-by: Mathias Gibbens <mathias@calenhad.com>
2021-01-10 18:23:35 +00:00
Matt 0dc43d66e4 Remove the use of INTERFACE macro and macro its self 2020-08-05 16:30:44 +02:00
Matt 30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Michael Steenbeek d7637cd70f
Replace many C-style casts (#11720) 2020-05-11 14:32:56 +02:00
Tulio Leao c17127f65b
Use named casts on openrct2 root folder (#11139) 2020-04-17 21:36:25 +02:00
Gymnasiast 1e6efa6eb4
Extend BannerIndex to 16 bits 2020-02-15 10:37:34 +01:00
Michał Janiszewski 2340206b34
Place constexpr functions in anonymous namespace (#10651) 2020-02-06 08:50:10 +01:00
Tulio Leao aa02a8c7ce Throw exception if floor2 and ceil2 are misused 2019-12-03 23:13:12 -03:00
Tulio Leao c4089acd63 Removed parentheses for improved readability 2019-12-01 22:45:16 -03:00
Tulio Leao 1e67c3bff8 Make floor2 and ceil2 constexpr functions 2019-11-30 08:41:45 -03:00
Ted John a1d9e52046 Rename ToUtf16 to ToWideChar
This is more correct as wchar_t size can differ, for example Linux typically uses 32 bits for wchar_t where as Windows uses 16 bits.
2019-07-22 23:44:03 +01:00
Ted John 15cb3e1889 Remove unnecessary new line characters from log calls (#9237) 2019-05-12 13:48:56 +02:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Tom Lankhorst 4c015edaf6 Templatise `rorN` and `rolN` with `N` in {8, 16, 32, 64} 2019-01-28 10:55:24 +01:00
Bart Ribbers 8e6eb08275 Fix compilation on musl (#8067) 2018-10-09 20:42:02 +02:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format c57bbca827 clang-format root 2018-07-23 16:00:14 +02:00
Michael Steenbeek 16f5c92bde Fix copy-paste error 2018-06-20 17:55:34 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Hielke Morsink aad1e69d7e
Add parentheses to macro arguments (#7686)
This adds parentheses around macro arguments that are either negative or used for calculations inside the macro itself. Doing this avoids getting errors in code that may look right.
2018-06-15 10:54:05 +02:00
Hielke Morsink 6b22a9d38b
Merge pull request #7586 from Broxzier/refactor/banner-ride-index
Banner code cleanups
2018-06-13 21:48:04 +02:00
pkubaj fae367ccf9 Fix compilation with FreeBSD (#7668) 2018-06-12 20:46:34 +01:00
Hielke Morsink 7355b497a1 Use new banner index type
BannerIndex is defined in common.h (like some other types such as money32 and rct_string_id), so that banner.h wouldn't have to be includede everywhere. Later on, it may be nicer to have a custom types file instead of putting them all in common.h.
2018-06-11 13:29:41 +02:00
Hielke Morsink 30063984e6
Delete unused function arguments or mark them so (#7426)
This aims to make future refactoring easier. The arguments are removed where possible, but kept and marked with C++17's [[maybe_unused]] where they could not be removed (e.g. when they are used as a callback, rather than called directly).

I've skipped the rides/<category>/* and peep/* source files, because the rides source files are mostly generated and have a ton of unused variables, and the peep source files are being refactored.
I've also skipped most of window/* source files, because most of the functions are used as callbacks and will be bulk-renamed at some point.
2018-04-20 13:56:37 +02:00
Michał Janiszewski 2545d01db4 Use libc++-provided strndup on Android 2018-03-21 16:05:00 +01:00
LRFLEW d4cfad8ab2 Fix 'different language linkage' error with Xcode 2018-03-18 23:29:13 +01:00
Michał Janiszewski 4dd0995efb Move cmath out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 5c6e28284b Move cstddef out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 28391eaf5d Move cstring out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 54cc1ebcdf Reduce includes in common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 9e1dfffee8 Remove unnecessary checks for __cplusplus 2018-03-14 22:11:30 +01:00
Michał Janiszewski c27307820e Remove more C-only code from common header 2018-03-14 22:11:30 +01:00
Michał Janiszewski 789c176517 Update common header 2018-03-14 22:11:30 +01:00
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
Gymnasiast 778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Richard Jenkins 9a10218275 Update official domain 2018-02-05 13:32:53 +01:00
Gymnasiast 5cc21fd21b Replace NULL with nullptr in C++ files 2018-01-29 21:33:21 +00:00
Michał Janiszewski 1fdc8ef49e Move definition of OPENRCT2_X86 macro 2018-01-01 23:49:09 +01:00
Hielke Morsink 3770b46e46 Replace 1 and 0 constants with bool where applicable 2017-12-21 23:47:30 +01:00
Michael Steenbeek 6dc49d643a Compile files in base dir as C++ 2017-12-13 08:03:48 +01:00