Commit Graph

88 Commits (master)

Author SHA1 Message Date
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
Lukas Werling 9b61ba468d Fix JSON serialization of proplists within arrays 2017-03-18 00:26:58 +01:00
Nicolas Hake 41f4779d74 StdCompiler: Use terms "Serializer" and "Deserializer"
Instead of "Compiler" and "Decompiler", which make me look up what's
even going on each time I see them, use the standard terms "serializer"
and "deserializer".
2017-03-11 15:05:41 +01:00
Lukas Werling ee0b1c2599 Implement JSON serialization for C4Value 2017-02-17 23:29:01 +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
Sven Eberhardt e4b4246500 Fix freezing and assignment of static names to child proplists created in Definition()-callbacks (#1798)
Also adjust editor props for the change:
1. enum needs to create a copy, not a reference for the default value of an option if it is defined inline
2. Always use proper GetName() resolution on property group names even if a static name would be available
2016-08-27 02:04:03 -04:00
Sven Eberhardt 879d501592 Merge remote-tracking branch 'remotes/origin/qteditor' into qteditor
Conflicts:
	src/editor/C4ConsoleQtPropListViewer.cpp
	src/editor/C4ConsoleQtPropListViewer.h
	src/script/C4ValueArray.cpp
2016-04-04 19:34:02 -04:00
Sven Eberhardt 98c36e5955 Qt Editor: Implement setting of properties 2016-04-03 23:46:58 -04:00
Nicolas Hake 9dddf289db Merge branch 'master' into qteditor 2016-04-03 21:06:32 +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 0537df5f23 C4Object: Move C4Def.h dep out of header
C4Def is only ever used as a pointer inside C4Object.h, so we don't need
to include C4Def.h from it.
2016-04-03 13:24:26 +02:00
Sven Eberhardt 771a333e21 Qt Editor: Add effects to object list view + fixes
Also remove cache of C4Values and use callbacks on object and effect deletion instead.
2016-02-21 22:23:42 -05:00
Günther Brammer b08f51372a Add more overloads of the C4Value constructor
This allows one to use the C4Value constructor instead of
C4ValueConv. To avoid unintended implicit conversions like
const char * to bool, add a private template constructor that
catches everything not in the list of intended constructors.
2016-01-25 00:00:57 +01:00
Günther Brammer 507b63a55a Functions store their containing proplist instead of the C4AulScript
The C4AulScript containing the source of the function was already mostly
used to get the relevant proplist or available from context. This will
allow more than one proplist plus the global one per scripthost to contain
functions.
2016-01-24 12:27:23 +01:00
Günther Brammer 130a275dea Correct a comment about GetDataString safety 2014-05-25 22:47:56 +02:00
Sven Eberhardt b8cd437fc9 Fix C4ID parameters to engine functions. 2014-04-20 18:43:29 +02:00
Günther Brammer 22016e075f Replace some usages of C4ID with C4Def*
In particular those that made the c4script shell depend on C4Id.cpp.
2014-04-19 19:02:22 +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
Martin Plicht d164a2d50a C4Value: Implement some crude infinite recursion guard which happens solely inside C4Value::operator== 2013-10-13 11:55:01 +02:00
Günther Brammer a0f328468e Don't change Scenario.Prototype on Game.txt load
C4Value used itself as temporary storage, so when loading Scenario.Prototype
into Scenario.Prototype, bad things happened.
2013-04-01 23:56:22 +02:00
Sven Eberhardt 6250ff1766 Silence a few MSVC warnings 2013-04-01 12:48:02 +02:00
Günther Brammer 2d86e47c04 Fix use-after-free in C4Value::CompileFunc
C4StringTable::RegString modifies the provided StdStrBuf. Use FindString
instead, since GetPropertyByS reliably returns failure for a
freshly-registered string anyway.
2013-03-10 22:47:17 +01:00
Günther Brammer 16f3fe34e1 Use correct exception when unable to compile a static proplist
excNotFound is used to signal that the end of a list is reached. But these
error conditions in C4Value::CompileFunc signal some logic error, not
finding an end-of-list marker instead of a C4Value.
2013-03-10 22:46:32 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer 4b2ea86726 Script: compare proplists by their contents instead of their identity
Objects, effects and definitions each have unique numbers/ids, so are
compared by identity as a shortcut.
2012-06-02 15:56:20 +02:00
Günther Brammer c8907f5204 Shorten C4Value::GetDataString for Objects, Definitions and static proplists
The new output is also more often an expression that returns the value when
evaluated.
2012-05-08 02:24:43 +02:00
Günther Brammer 3a3ed01c89 Savegames: Save readonly proplists by their name
For example, the proplist in Clonk.ActMap.Walk is saved as DClonk.ActMap.Walk.
Should the script defining the proplist change while the savegame is stored,
the proplist will have the new contents instead of the old ones after savegame
load.

Also, save functions as DFlint.Hit instead of fDFlint.Hit. Loading uses the same
code as static proplist loading.

Curiously, this makes g++ 4.4 use the C4RefCntPointer move constructor,
which was broken until now. Fix it to take a mutable rvalue reference.
2012-06-01 17:27:59 +02:00
Julius Michaelis d93384beb6 Add forgotten C4Value::operator== case for C4V_Function 2012-04-15 16:33:39 +02:00
Julius Michaelis 57a07a95ab Add forgotten string for function type values to GetC4VName 2012-04-14 16:53:35 +02:00
Günther Brammer 05ef63bf64 Script: Make 0==nil false again
This was probably broken by the C4V_Any/C4V_Nil separation. Also clean
the function up a bit and add an assert that should catch similar stuff in
the future.
2012-04-11 02:25:24 +02:00
Günther Brammer 406b7c4eca Savegames: (De)serialize functions in c4values 2012-02-13 18:12:08 +01:00
Günther Brammer a684ab4aba Script: Infrastructure for functions as a value type 2011-09-25 01:20:18 +02:00
Günther Brammer 8185d318bf Script: Add a proplist representing the global scope, named "Global" 2011-10-04 22:12:45 +02:00
Günther Brammer a24ebc4936 Script: Add a proplist representing the scenario, named "Scenario"
The proplist is accessible from script via a global constant.
2011-09-25 23:24:29 +02:00
Günther Brammer c63b66e909 Script: Add def and effect parameter types 2011-09-24 18:37:28 +02:00
Günther Brammer dbaa638166 Clean up C4Value::CompileFunc 2011-09-26 21:57:25 +02:00
Günther Brammer 32e7eb2904 Only use C4V_C4Object as typecheck target, tag the values with C4V_Proplist
This simplifies a few places which had to check for both tags before.
2011-09-26 20:22:31 +02:00
Günther Brammer 8758e35255 Remove redundant C4Value::GetTypeInfo 2011-08-21 14:40:29 +02:00
Günther Brammer 4a32e63c46 Savegames: Correctly Denumerate the first enumerated value (#657)
When that value was copied it went from Enum 0 to nil. While this could
be fixed by making C4V_Enum a NullableType, counting from 1 is a tiny bit
less code overall.
2011-09-19 23:02:18 +02:00
Günther Brammer 9bc61db360 copyright notices update 2011 2011-09-01 16:58:52 +02:00
Günther Brammer a533b93f10 Do not print a deleted-object-warning while warning about that object 2011-05-25 20:09:12 +02:00
Günther Brammer 37242503df Read old nil C4Values from player files for compatibility with 5.1 2011-05-21 23:13:49 +02:00
Günther Brammer e0f49b4cca Handle unknown C4Value type tags in player files or save games 2011-05-21 23:12:43 +02:00
Günther Brammer 2d9d0d8596 Reduce verbosity of backtraces with object parameters 2011-05-09 23:19:31 +02:00
Günther Brammer f97cde74c3 Split C4V_Any into C4V_Nil for the data type and C4V_Any for the typecheck 2011-05-09 14:37:28 +02:00
Günther Brammer fed6d6a0de Script: Debug output for proplist contains all properties 2011-05-05 22:27:22 +02:00
Günther Brammer 7eedece257 Replace C4Value typecheck table with switch statements
This has the advantage that the compiler can simplify the check when the
target type is known at compile time.
2011-04-10 03:46:59 +02:00
Günther Brammer b1a76adb62 Fix debug build 2011-04-14 15:36:31 +02:00