Commit Graph

2811 Commits (e3bcd14db06e0fed46c18f3e8bd58a89fd61728c)
 

Author SHA1 Message Date
Günther Brammer e3bcd14db0 Simplify Parse_FuncHead 2011-04-18 01:50:33 +02:00
Günther Brammer baeffbc67f Let script functions have less than 10 parameters
Script functions using ... or Par() still take all 10
parameters, but those are the exceptions now. This makes
calling functions with few parameters faster.
2011-04-18 01:48:37 +02:00
Günther Brammer 63a3b546d5 Use bytecode to push variables onto the stack 2011-04-17 23:52:55 +02:00
Günther Brammer 50b6fcf47a Use AB_DUP instead of AB_PARN 2011-05-02 21:39:52 +02:00
Günther Brammer 0b8c2bba37 Use AB_DUP instead of AB_VARN 2011-05-02 21:53:58 +02:00
Günther Brammer 76376ee7bb Remove unused C4AulFunc::GetLocalSFunc
ResortObjects was the only user, and that's gone now.
2011-05-03 00:56:49 +02:00
Günther Brammer 177b085271 Script: SetPlrExtraData and SetCrewExtraData can store strings 2011-05-02 23:01:19 +02:00
Günther Brammer 1583ad603b Scenario.txt: Definition1 defaults to Objects.ocd
Every scenario in the repository uses that, so it should be the default.
2011-05-03 00:16:20 +02:00
Günther Brammer bbaf1c2c06 Empty Scenario.txt produce a more helpful error message 2011-05-03 00:57:35 +02:00
Nicolas Hake a6429bad54 c4group: Remove timestamps from groups, use checksums only 2011-05-01 13:37:36 +02:00
Günther Brammer 17265be0aa Remove some dead savegame code 2011-05-01 13:50:37 +02:00
Günther Brammer e2c495e274 Do not append a \0 to the Scenario.txt 2011-04-29 18:16:48 +02:00
Günther Brammer fadacd3bb4 Move StrToI32 to lib/ 2011-05-01 18:55:02 +02:00
Günther Brammer 117cbe2b81 Script: Add warnings against wrong operator parameter types 2011-05-01 18:53:50 +02:00
Günther Brammer 90a8fa356c Remove some unused script callback names 2011-04-28 20:27:36 +02:00
Günther Brammer 5a64272e3b Optimize multiple Find_AtRect criteria
Find_Or(Find_InRect(), Find_AtRect()) still needs to search the whole
object list, and Find_And(Find_InRect(), Find_AtRect()) simply uses one
of the two bounds to limit the search, though.
2011-04-28 20:24:21 +02:00
Günther Brammer 7b640daedb Script: Add "\t" escape for tabulator 2011-04-13 23:51:35 +02:00
Günther Brammer 82f6b180e1 Split C4Value typecheck into two variants, one not permitting nil
Previously, the typecheck callers often separately checked for
null pointers. This is superfluous since C4Value already checks
for null pointers.
2011-04-11 23:33:11 +02:00
Günther Brammer 51d75e891b Move script operator parameter types from a table into the code
This makes the target type visible to the compiler.
2011-05-01 17:16:02 +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
MimmoO 2a770e37da Marker: Can now also use alternative graphic files from objects as icon 2011-04-29 22:17:04 +02:00
MimmoO b9be4d06ab Added 2 Alternative graphics for the Decoration 2011-04-29 20:14:49 +02:00
MimmoO fb91c5061e Fixed Backpack-bug, adjusted tutorial 1 2011-04-29 17:02:54 +02:00
MimmoO 7d247a7333 Added missing graphics files 2011-04-29 15:30:28 +02:00
MimmoO 608759de44 Objects.ocd: Added new HuD 2011-04-29 15:01:20 +02:00
Charles Spurrill 3f9a4bde15 Removed clouds blocking the view in Shiver Peak 2011-04-28 20:18:42 -07:00
Maikel de Vries 7fe24131c7 Objects: Cable network producers now request other producers for objects
Foundry does not produce automatically anymore.
2011-04-22 16:48:35 +02:00
Maikel de Vries 40f2950baa Objects: Fixed 4 warnings in cablestation library
Libraries should in principle not depend on objects outside the libraries.
2011-04-19 18:18:02 +02:00
Maikel de Vries b98b5acecc Objects: Cable cars only access stations inside their own network and vice versa 2011-04-18 19:01:45 +02:00
Maikel de Vries ca2ea1be98 Objects: Tool products return true instead of 1
This is just plain ugly, |a> Are you a tool? |b> 1. DynamiteBox is also a tool for now, mainly for testing.
2011-04-17 14:00:59 +02:00
Maikel de Vries 09cc74e91c CableLorries: Changed scenario to provide for a good test environment
Should be extended in the future whenever production lines and buildings become available.
2011-04-17 13:58:50 +02:00
Günther Brammer 426f8b0816 Add a Test scenario demonstrating the engine defaults 2011-04-14 16:23:26 +02:00
Günther Brammer c21248d322 Decrease the initial size of hash tables
At the moment, the majority of hash tables has at most one element, so
allocating more is wasteful. There needs to be at least one unused bucket
in the table, so the initial size is 2.

Also, increase the maximum load factor to 3/4.
2011-04-14 16:16:59 +02:00
Günther Brammer b1a76adb62 Fix debug build 2011-04-14 15:36:31 +02:00
David Dormagen 55db5fa98a helper object for floating messages added 2011-04-14 18:36:20 +02:00
David Dormagen a9b5fc9c95 fix 2011-04-14 18:23:09 +02:00
Günther Brammer 1e28504cde Optimize the script interpreter a bit
Integer and boolean constants aren't wrapped in a temporary C4Value. The
overflow check is reduced to one subtractions and comparison to a compile
time constant. C4Value::Set(const C4Value&) doesn't duplicate the check for
the setting to the same value in C4Value::Set(C4V_Data, C4V_Type).
2011-04-10 02:00:27 +02:00
Günther Brammer 5596a57d83 Do not check for stack underflow in release builds
Unlike overflows, underflows can only occur when the parser is faulty. In
release builds they just slow the interpreter down.
2011-04-10 17:52:20 +02:00
Günther Brammer dbe7c37db0 Script: Only debug if the debugger was present before compilation
This saves a lot of AB_DEBUG bytecodes in the normal case.
2011-04-10 03:40:55 +02:00
Günther Brammer 435ed78cd9 Script: Remove unimplemented Par(n)=foo 2011-04-10 02:05:11 +02:00
Günther Brammer a3fab0234e Create PropLists with one bytecode instead of one per property 2011-04-09 21:35:16 +02:00
Günther Brammer 71f42d7d8f Correct assert checking that the bytecodepointer is still in the function
Previously, if the first byte code of the function was an AB_FUNC, the
assert would erroneously fail.
2011-04-12 00:10:51 +02:00
Günther Brammer 4575f28605 Log call stack when using a deleted object 2011-04-13 15:38:49 +02:00
Günther Brammer 4ae204e2fb Remove unnecessary includes pulling C4GUI into the script engine 2011-04-13 15:37:12 +02:00
Felix Wagner 989f1925f1 Forgot to remove the foo, bar crap 2011-04-11 22:31:48 +02:00
Maikel de Vries d515df6055 Objects: Some fixes to cable network
Removed some erroring code from the libraries.
2011-04-11 18:08:57 +02:00
Maikel de Vries 5da93528c6 Objects: Introduced delivery system for the cable network
Based on the concept of automatic production in buildings, and the current network capacities. Cable cars receive requests from producers and try to fulfill these request by transporting objects in the network.
2011-04-07 16:04:29 +02:00
Maikel de Vries 1ce2c16c36 Objects: Enhanced Producer library and adapted tool workshop 2011-04-07 16:02:35 +02:00
Maikel de Vries ad15a6ed4f Objects: Library for object production
Adapted foundry to library, should ultimately interact with cable network.
2011-04-02 18:17:24 +02:00
Felix Wagner b425cf71da Reworked the pathfinding data assembly, various name changings in the variables
I did not made some benchmarks...old system still exists
Removing of cables missing but working on that
2011-04-11 13:43:46 +02:00