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
Günther Brammer
b403fc61c1
Reduce code duplication a bit
2011-04-01 00:03:02 +02:00
Günther Brammer
f3365ab73b
Arrays with multiple references are stored just once
...
This is done with the new C4ValueNumbers class. Every array and proplist
with the exception of objects, definitions and effects gets a number
when the game is saved and is restored via that number on load.
2011-03-27 18:14:41 +02:00
Günther Brammer
f582a97998
Add C4ValueNumbers helper class and pass it through to C4Value::CompileFunc
...
In preparation of using that class to enumerate and denumerate various
pointers.
2011-03-26 23:59:35 +01:00
Günther Brammer
75dc49e746
Replace Objects.ObjectNumber with C4PropListNumbered::CheckPropList
...
There's no need to go through the entire object list to get an object
number, so convert most usages of ObjectNumber(obj) with obj->Number. Add a
new method to check proplist pointers for debugging purposes to
C4PropListNumbered.
2011-02-06 01:59:49 +01:00
Günther Brammer
a7615ddced
Make C4PropListNumbered global data static members of the class
...
Previously, this was in ::Game and ::Objects. Both classes still work on
that data, but not as much as before.
2011-03-05 03:32:51 +01:00
Günther Brammer
8749395a18
Use Nillable<void>() instead of C4VNull as the always-nil return value
2011-03-03 00:57:38 +01:00
Günther Brammer
bdbe3beabf
Optimize the template engine script function wrappers slightly
2011-03-02 23:42:34 +01:00
Günther Brammer
e250312c26
Move C4DefList class into from C4Def.cpp/h to new C4DefList.cpp/h
2011-03-03 17:10:22 +01:00
Günther Brammer
ed86af5f29
Script: Proplists with Object prototypes are also Objects
2011-03-02 14:12:06 +01:00
Günther Brammer
e4ef7e3d98
Replace C4VID with C4VPropList
...
Most callsites use C4Id2Def instead, but for some a def->id->def
indirection could be removed.
2011-02-05 23:09:09 +01:00
Günther Brammer
5e156a07d1
Script: == works when one side is an object with proplist type label
...
I don't actually know how to get to that situation in script, but when it
happens, everything else expecting an object would correctly accept it
despite the proplist label.
2011-01-15 23:03:01 +01:00
Günther Brammer
a89667f3d7
Merge C4ValueList and C4ValueArray into one class
...
Now that the last usage of numbered variables in effects is gone,
C4ValueList wasn't used except as a base class. If the array and
refcounting aspect should be separated at all, the reference count
should be in the base class.
2010-12-27 17:05:35 +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
8bd9179606
Script: Inline C4Value::Set and the C4Value functions it calls
...
Apart from these functions just being small enough to reasonably
inline, the compiler might be able to optimize parts of them away based on
knowledge of the type of the new or old content of the C4Value.
On at least one artificial benchmark, this does help significantly.
2010-10-26 03:05:20 +02:00
Günther Brammer
7d3811fc76
Script: Arrays do not autoextend when accessed
...
Done by constifying the C4ValueList interface. To avoid rewriting some code that
uses that interface, also constify some C4Value functions. While at it,
replace the dynamic function call for C4Value conversion with a switch.
This makes C4Value conversion not actually convert anything, but the only
case left is conversion to bool, which already occurs when the value is
read.
2010-09-20 19:49:00 +02:00
Günther Brammer
cf92ceae2d
Merge branch 'norefs'
...
Conflicts:
planet/Melees.c4f/Ruins.c4s/ObjectFade.c4d/Script.c
planet/Objects.c4d/Goals.c4d/KingOfTheHill.c4d/Script.c
planet/Objects.c4d/Goals.c4d/LastManStanding.c4d/Relaunch.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/BlackPowder.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Coal.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Earth.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Firestone.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Gold.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Ice.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Loam.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Metal.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Ore.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Rock.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Snow.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Sulphur.c4d/Script.c
planet/Objects.c4d/Items.c4d/Resources.c4d/Wood.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Axe.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Balloon.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Barrel.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Boompack.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/PowerLine.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Dynamite.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Fuse.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Igniter.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/GrappleBow.c4d/Hook.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/GrappleBow.c4d/Rope.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/GrappleBow.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Hammer.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/JarOfWinds.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/OrbOfTelekinesis.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Pickaxe.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/PowderKeg.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Ropeladder.c4d/LadderGrabber.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Ropeladder.c4d/LadderSegment.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Ropeladder.c4d/Script.c
planet/Objects.c4d/Items.c4d/Tools.c4d/Shovel.c4d/Script.c
planet/Objects.c4d/Items.c4d/Weapons.c4d/Bow.c4d/Arrow.c4d/Script.c
planet/Objects.c4d/Items.c4d/Weapons.c4d/Bow.c4d/Script.c
planet/Objects.c4d/Items.c4d/Weapons.c4d/Club.c4d/Script.c
planet/Objects.c4d/Items.c4d/Weapons.c4d/Javelin.c4d/Script.c
planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Ammo.c4d/Script.c
planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Script.c
planet/Objects.c4d/Items.c4d/Weapons.c4d/Shield.c4d/Script.c
planet/Objects.c4d/Vehicles.c4d/Cannon.c4d/Script.c
planet/Objects.c4d/Vehicles.c4d/Lorry.c4d/Script.c
planet/Tutorial.c4f/Tutorial.c4d/FlagGoal.c4d/Flag.c4d/Script.c
planet/Tutorial.c4f/Tutorial.c4d/FlagGoal.c4d/Script.c
planet/Tutorial.c4f/Tutorial.c4d/MenuDeco.c4d/Script.c
planet/Tutorial.c4f/Tutorial.c4d/ObjectRestorer.c4d/Script.c
planet/Tutorial.c4f/Tutorial.c4d/TutGuide.c4d/Script.c
planet/Tutorial.c4f/Tutorial.c4d/TutorialGoal.c4d/Script.c
planet/Tutorial.c4f/Tutorial03.c4s/ShootTheTargets.c4d/Script.c
src/game/object/C4Def.h
2010-09-11 19:30:45 +02:00
Günther Brammer
efad172ec6
Script: Compare readonly proplists by their contents
...
This way, breaking the identity relationship on savegame load will not be
noticable by script.
2010-09-10 23:01:30 +02:00
Günther Brammer
ef76b26c4a
Script: Save readonly proplists inline so that they do not need a number
2010-09-08 20:09:27 +02:00
Günther Brammer
6d3fc6032b
Remove the last traces of the Strings.txt
2010-09-08 20:08:13 +02:00
Peter Wortmann
cf4e83c151
Merge with default, including some small Script cleanups
2010-08-01 16:23:36 +01:00
Armin Burgmeier
9f65838ae8
Fix a couple of compiler warnings
2010-04-28 23:43:25 +02:00
Peter Wortmann
edb4a4a0b2
Completely removed references from the engine, changed array semantics to not copy automatically, implemented postfix ++/-- correctly
2010-04-08 02:47:45 +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
2e379712fb
Add C4PropList::GetPropertyVal to get a property directly
...
This should theoretically be more efficient than first creating a reference
and then dereferencing that. But mostly it's for more interface clarity.
2010-03-27 19:16:48 +01:00
Benjamin Herr
6cb483bc4b
C4Value::DenumeratePointer(): Print int with %d
...
not intptr_t
2010-03-22 22:27:00 +01:00
Günther Brammer
32ec6abace
Script: Add a new reference type to C4Value storing proplist and key
...
This way, a mere reference does not need to add an entry to a proplist. This
can be deferred to the point when the reference is used to change the value.
2010-03-23 23:56:59 +01:00
Günther Brammer
1446f585d7
Rename C4V_pC4Value to C4V_Ref
2010-03-22 22:16:46 +01:00
Günther Brammer
79e78e3a10
Script: Prepare for C4Value::GetRefVal to create a new entry in a proplist
2010-03-22 19:32:10 +01:00