Commit Graph

40 Commits (9691c1e41ae0de5ac70d911320a9a3c96e6fcbd1)

Author SHA1 Message Date
Maikel de Vries 0d58380dbf unify two implementations of Angle in the engine
There seems to be no reason to have two different implementation and the one in FnAngle seemed the most sane and complete one.
2017-07-19 22:04:43 +02:00
Tushar Maheshwari 3a4f49ad90 Revisit #includes
Consolidate the include statements scattered across the code in accordance
with the comment in C4Include.h. The advantages are listed in the same
comment.
Furthermore, it follows llvm-include-order which is the logical
extrapolation of the project's style guideline wherever possible
(C4Include.h being the most-frequent exception).
2017-05-15 13:24:59 +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 b87f8e3f47 C4Script: Add ParseInt function
ParseInt() will take a string parameter and try to convert it into an
integer. If the conversion fails, it returns nil.
2017-04-11 14:21:25 +02:00
Nicolas Hake c56bc4193e Replace InterlockedFoo by std::atomic
Atomic increments/decrements are part of C++11, so we don't need to use
or implement InterlockedWhatever anymore.
2017-03-23 17:03:16 +01:00
Nicolas Hake c5ed6e7dc8 Move strprintf to Standard
strprintf works like asprintf, except it returns a std::string.
2017-03-16 18:51:16 +01:00
Sven Eberhardt ebda8193ef Replace NULL by nullptr in C++ sources
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Nicolas Hake 0067a6dbfe Drop several unused string manipulation functions
To wit: SCompare, SCopyPrecedingIdentifier, SCopyNamedSegment,
SSearchIdentifier, SSearchFunction and SRemoveComments.
2015-11-15 16:16:36 +01:00
Nicolas Hake 24b54211c5 Drop Min, Max, Swap for std::min, std::max, std::swap
The C++ standard library comes with perfectly fine implementations of
these functions, so there's no point in reimplementing them just for the
hell of it.
2015-11-15 13:53:01 +01:00
Nicolas Hake 5562b09dc4 Remove a lot of disabled legacy code, round 2
Maybe at some point we'll be rid of all the commented-out code that
nobody has looked at in years.
2015-03-25 20:02:53 +01:00
Nicolas Hake a2f06c6ac5 Move ForLine function into C4Landscape.cpp
C4Landscape is the sole consumer of this function, so there's no reason
to make it available outside.
2015-02-23 13:39:51 +01:00
Günther Brammer 5bcedb5bbf Remove some redundant #includes 2015-01-25 18:53:48 +01:00
Kevin Zheng 6a1a551d01 Clean up deprecated headers and functions
"gdk_pixbuf_unref has been deprecated since version 2.0 and should not be
used in newly-written code. Use g_object_unref()."

sys/timeb.h isn't used anymore since 2005.
2014-05-27 00:30:20 +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
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer 15b07ca717 Start counting lines and columns in text files with 1
I checked two text editors, and they did that, too.
Also implement the special rules for tab stops, assuming a tab width of 8.
2012-05-16 23:21:14 +02:00
Nicolas Hake 1711b72baf Return U+FFFD REPLACEMENT CHARACTER instead of question mark for invalid utf8
Since U+003F QUESTION MARK is a potentially valid character in a unicode string,
have the text iterator return U+FFFD if it can't decode its input instead. This
way the caller can be certain that the input isn't a proper question mark and
doesn't accidentally use it, e.g. as a wildcard.
2012-05-04 18:12:35 +02:00
Günther Brammer 9bc61db360 copyright notices update 2011 2011-09-01 16:58:52 +02:00
Nicolas Hake 02416caec5 IsValidUtf8: Obey string length parameter when checking continuation bytes
This fixes a bug where sequences were incorrectly accepted when they ended with
a multibyte sequence, the end of which was beyond the passed string length.
2011-05-17 17:55:27 +02:00
Nicolas Hake 1ba02a610b IsValidUtf8: Correctly mask start byte before calculating code point value
This fixes a bug where valid sequences were incorrectly rejected as having
a value beyond the valid Unicode codepoint range.
2011-05-17 17:53:21 +02:00
Günther Brammer fadacd3bb4 Move StrToI32 to lib/ 2011-05-01 18:55:02 +02:00
Günther Brammer 21e28a4689 Script: Use Unicode instead of Byte strings
Internally, strings are UTF-8 as before, but GetChar returns an
Unicode code point instead of a byte from the UTF-8 encoded string,
and Format("%c") takes an Unicode code point as well.
2011-03-10 00:26:31 +01:00
Nicolas Hake c4276e84c4 Split UTF-8 validation out of StdStrBuf 2011-04-05 20:58:40 +02:00
Günther Brammer 6c2a89eaf8 Replace timeGetTime with a platformneutral GetTime wrapper 2011-03-13 17:25:35 +01:00
Günther Brammer e80a39dd09 Remove some dead code 2011-03-09 23:30:23 +01:00
Günther Brammer be342d4a51 copyright notices update 2010
This time with more manual checking and using git blame -M -C, so that
a few cases of copied code get a copyright notice corresponding to
their initial introduction.
2010-12-23 01:01:24 +01:00
Günther Brammer 3342509880 Fix a potential infinite loop in the landscape.txt interpreter 2010-04-25 14:27:06 +02:00
Nicolas Hake 46ece7030e Use <cmath> M_PI instead of own "pi" constant
This solves a conflict with a definition with the same name within Apple SDK
headers (thanks, Mortimer)
2010-04-24 17:40:41 +02:00
Nicolas Hake 5dc0d3b4cb Reduce value truncation warnings 2010-04-20 18:20:24 +02:00
Armin Burgmeier c2924041c9 Fix seperate->separate everywhere 2010-04-01 23:08:06 +02:00
Benjamin Herr 4378de147c Rerun astyle with missing \ added 2010-03-28 20:58:01 +02:00
Günther Brammer b4e37b070b Change all indentation with spaces to use tabs instead
This is a whitespace-only patch. Hopefully, it'll only affect rarely-changed
parts of the engine, since all regularly maintained pieces should already
use tabs.
2010-03-27 17:05:02 +01:00
Günther Brammer e30ff99d6a Remove all superflous #include <Standard.h>
Standard.h is included by C4Include.h, and every file includes that.
2010-03-04 22:11:12 +01:00
Günther Brammer ff8d950e85 Remove C4ENGINE define
Most files using it weren't used by c4group-the-application anymore, and
the remaining stuff can be dealt with by using stubs or the same code in
both cases.
2010-02-17 22:59:46 +01:00
Günther Brammer a16df97a95 Various cleanups in the platform code 2010-02-16 02:54:02 +01:00
Benjamin Herr f3b35227ea avoid lots of gcc warnings 2010-01-25 05:00:59 +01:00
Nicolas Hake f0fdf5e992 Prepare for precompiled headers 2009-10-20 05:39:24 +02:00
Günther Brammer 9a8b5dd739 Replace BOOL by bool, TRUE by true, FALSE by false 2009-08-15 20:50:32 +02:00
Günther Brammer 572d00c32e Move all source files
This might make stuff easier to find.
2009-08-10 17:59:18 +02:00