Commit Graph

11 Commits (master)

Author SHA1 Message Date
David Dormagen 6fa13d8717 C4TimeMilliseconds: fixed comparison & stopped reloading shaders every frame
Imagine lhs being 0 and rhs being more than int32_t can handle. And then imagine subtracting them and casting them to int32_t.
That's what happened e.g. in void C4ShaderCall::Start() when ScriptShader.LastUpdate was 0. This caused the shaders to reload every frame;
at least when in the main menu. This lead to serious lagging (of the cursor) for me.

Note that the subtraction operator in C4TimeMilliseconds.cpp has a similar issue. This might need a fix or at least high awareness by users. Maybe an assert or something.

PS: Who thought that doing the comparison with a subtraction was a good idea? This is not assembler :I
2017-08-15 10:04:54 +02:00
Tushar Maheshwari e58a7884e4 Automatic fixes using clang-tidy
See http://forum.openclonk.org/topic_show.pl?tid=3376 for discussion.

Close GH-41
2017-05-03 20:30:45 +02:00
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Nicolas Hake 493c276126 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-03 20:24:42 +02:00
Nicolas Hake e0dc30c59a Update copyright notices
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.

For the updated source files, the timeline has been split into three
parts:
 1. Pre-RWD code (before 2001)
 2. RWD code (2001 through 2009)
 3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
2013-12-23 13:03:19 +01:00
Tobias Zwick 5bcd762206 C4TimeMilliseconds returns a StdCopyStrBuf to avoid memory errors 2013-12-09 00:49:58 +07:00
Nicolas Hake 71dbd5bcfb Use std::numeric_limits<> instead of INT32_MIN/INT32_MAX
We're implementing parts of <stdint.h> ourselves for old compilers, and
these macros aren't part of our compatibility interface.

Additionally, [C99 §7.18.2] (unfortunately, MSVC ignores this):
"226) C++ implementations should define these macros only when
__STDC_LIMIT_MACROS is defined before <stdint.h> is included.", which it
wasn't, so it wasn't portable in the first place.
2013-12-08 14:13:15 +01:00
Tobias Zwick b73eabd4fd add infinity-field to C4TimeMilliseconds, add linker error (*cough*) 2013-12-08 19:11:28 +07:00
Tobias Zwick bdc895655d add AsString method to C4TimeMilliseconds 2013-12-08 16:28:58 +07:00
Tobias Zwick f5592a49e6 build fix 2013-12-08 04:05:56 +07:00
Tobias Zwick fe2a400c02 replace global function GetTime() with class function C4TimeMilliseconds::Now() 2013-12-07 21:27:01 +07:00