Peter Nelson
ab535c0a86
Codechange: Add base() method to StrongType to allow access to the base type without casting. ( #11445 )
...
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
2023-11-06 20:29:35 +00:00
Patric Stout
299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed ( #10761 )
2023-08-12 18:14:21 +00:00
Rubidium
eaae0bb5e7
Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
...
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Patric Stout
ab19882e94
Codechange: hint in all branches of ClampTo to resolve compile-time ( #11130 )
2023-07-12 13:54:44 +00:00
Patric Stout
0f3dd9c796
Fix: crash when window can't be placed on low resolution screens. ( #10932 )
...
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2023-06-04 15:39:57 +00:00
Rubidium
68ff3fd062
Change: include fmt.h C++ headers in stdafx.h
...
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02:00
Rubidium
19ec4e8beb
Codechange: replace ClampToI32/U16 with ClampTo<int32_t/uint16_t>
2023-05-06 21:26:13 +02:00
Rubidium
969a3dc0f3
Codechange: introduce generic ClampTo function to clamp to the range of a type
2023-05-06 21:26:13 +02:00
Michael Lutz
6fe445e6c0
Codechange: Un-bitstuff station/depot/waypoint commands.
2021-12-16 22:28:32 +01:00
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
2021-01-08 11:16:18 +01:00
Charles Pigott
860c270c73
Codechange: Replace assert_compile macro with static_assert
2020-12-27 10:55:42 +00:00
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
2019-11-10 17:59:20 +00:00
Nikolas Nyby
28e11623bd
Codechange: math functions - use cpp-style casts
2019-08-31 20:27:56 +01:00
glx22
66dd7c3879
Fix: MSVC warnings ( #7423 )
2019-03-28 00:09:33 +01:00
btzy
9d75600ac0
Fix: Round up deltas for smooth scrolling, so target will be reached
2019-01-20 19:43:56 +00:00
rubidium
ab964a6cee
(svn r26651) -Fix: make sure an abs is used that supports int64 when using abs on those variables
2014-06-17 19:01:45 +00:00
fonsinchen
dfad8317aa
(svn r25347) -Add: function for deterministic approximate division
2013-06-09 12:50:33 +00:00
truebrain
1c9bec1999
(svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC)
2011-12-20 17:57:56 +00:00
rubidium
6153dc57f5
(svn r23466) -Fix [FS#4871, FS#4874]: assertion triggered when resizing a window during ReInit by an amount that's not a multiple of the resize interval
2011-12-09 22:07:00 +00:00
michi_cc
d3b7b89493
(svn r23415) -Feature: Infrastructure maintenance costs.
2011-12-03 23:40:46 +00:00
frosch
af7051178d
(svn r19671) -Fix (r19670): RoundDiv() needs to deal with signed numerators.
2010-04-18 17:13:01 +00:00
frosch
2e90f7f8b9
(svn r19670) -Codechange: Add CeilDiv() and RoundDiv() to simplify integer divisions with rounding.
2010-04-18 14:56:05 +00:00
smatz
0ef33548c2
(svn r19614) -Codechange: "it's" => "its" where appropriate
2010-04-12 14:12:47 +00:00
rubidium
7c2a61e210
(svn r18508) -Fix [FS#3372]: if a rail station class had less data than capacity it would try to set a negative position
2009-12-15 01:38:55 +00:00
rubidium
a70f2244e8
(svn r18443) -Fix (r18438): MSVC thinks, in it's infinite wisdom, that int min(int, int) is a better match for min(uint64, uint) than uint64 min(uint64, uint64). As such we need to cast the UINT16_MAX to prevent MSVC from displaying it's infinite wisdom with loads of warnings.
2009-12-09 09:28:47 +00:00
rubidium
b0eacbf350
(svn r18438) -Codechange [FS#3337]: introduce a template for Clamp (fonsinchen) and reuse template functions in their non-template counterparts.
2009-12-09 00:41:18 +00:00
rubidium
e8ddf001c8
(svn r17570) -Fix: a number of Doxygen warnings about missing parameters, which were sometimes missing and sometimes just typos
2009-09-19 09:51:14 +00:00
smatz
100ae8efcc
(svn r17292) -Codechange: use unified ToPercent() function to convert fract numbers to percents
2009-08-27 13:31:26 +00:00
rubidium
7fbc33dae1
(svn r17248) -Fix: add GPL license notice where appropriate
2009-08-21 20:21:05 +00:00
smatz
93c5300fc5
(svn r16715) -Codechange: add attribute to assert_compile(), so it doesn't warn when used inside function
2009-07-01 21:29:03 +00:00
rubidium
3ef8a09e20
(svn r15777) -Add: helper functions to get the least common multiple and the greatest common divisor (Alberth)
2009-03-21 01:34:31 +00:00
smatz
114c820c56
(svn r13639) -Codechange: rewrite 32bpp-anim and 32bpp-optimized drawing and encoding so it uses similiar scheme as 8bpp-optimized
...
All zoom levels are stored and a kind of RLE is used. Together with further changes and reducing number of variables, drawing is ~50% faster in average.
2008-06-26 15:46:19 +00:00
skidd13
b4ef380c49
(svn r13607) -Fix (r13606): some coding style issues got fixed but some got/stayed broken
2008-06-22 15:41:38 +00:00
skidd13
640e547886
(svn r13606) -Codechange: use "static FORCEINLINE" where possible as default for core functions (big functions use just inline instead)
2008-06-22 15:21:51 +00:00
smatz
fb379b522d
(svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp
2008-04-04 20:34:09 +00:00
smatz
a7d885e4c6
(svn r12572) -Fix (r12192): min() has 32bit arguments, clamping of 64bit values didn't work
2008-04-04 20:03:49 +00:00
rubidium
67c1e00aea
(svn r12438) -Fix-ish: typo spotted by Biblo.
2008-03-27 13:59:35 +00:00
smatz
db9d5a909f
(svn r12204) -Fix (r12192): using UINT16_MAX broke compilation on many targets
2008-02-20 19:42:06 +00:00
smatz
ca46154068
(svn r12192) -Fix: clamp various town variables to 16bit prior to returning the value
2008-02-20 14:30:53 +00:00
rubidium
bf98e25e43
(svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
2007-12-25 09:48:53 +00:00
rubidium
a773d45885
(svn r11684) -Codechange: split gfx.h in a type and functional header.
2007-12-23 10:56:02 +00:00
rubidium
01e20c9140
(svn r11674) -Codechange: refactor some functions out of macros.h into more logical locations.
2007-12-21 19:21:21 +00:00
smatz
93c3e0d6ad
(svn r11652) -Codechange: add the svn $ header for several files
2007-12-17 01:35:45 +00:00
skidd13
734b22e070
(svn r11526) -Codechange: Rename the function delta fitting to the naming style
2007-11-26 16:01:29 +00:00
skidd13
bf959f926f
(svn r11510) -Codechange: merge the IS_*INSIDE* functions and rename them fitting to the naming style
2007-11-24 10:38:43 +00:00
skidd13
737aec4db6
(svn r11490) -Codechange: Split the math functions to their own header
...
-Codechange: Replace the rest of the math macros with functions
2007-11-22 18:01:51 +00:00