Commit Graph

50 Commits

Author SHA1 Message Date
Florian Rival 09bedc6ce5 Ensure events generated code is stable across code generation.
This is done by given unique identifiers to "Trigger Once" conditions (stable given the same object in memory) and events list function names (stable given events with same content).

This avoids useless hot-reloading and re-triggering Trigger Once conditions after a hot-reloading.

Don't show in changelog
2020-07-25 14:23:01 +01:00
Arthur Pacaud 693b64cddf Fix documentation typo (#1882)
Don't show in changelog
2020-07-20 16:53:55 +01:00
Florian Rival 5f1a7bd72d Fix behaviors not working in an extension function when named differently than in the object
Fix #1796
2020-06-11 22:04:24 +01:00
Florian Rival ac90b982ac Hide verbose extension loading logs in tests 2020-02-23 14:49:35 +00:00
Florian Rival ca6f11b55a Support for describing completions to display for an expression (#1447) 2020-02-22 14:27:43 +00:00
Florian Rival 7b30f63cb1 Remove unused variables 2020-01-27 23:15:27 +00:00
Florian Rival bff43ee771 Remove dead code related to old ExpressionParser 2020-01-27 22:08:48 +00:00
Florian Rival 6108088979 Fix compilation of EffectMetadata for GDCpp 2019-12-17 09:04:00 +00:00
Florian Rival 8891c91d61 Add EffectMetadata and AddEffect to extensions
* Allow extensions to store EffectMetadata.
* Rework gdjs.PixiFiltersTools to allow new effects to be dynamically registered.
* Update EffectsList to read effects from extensions.
* Update GDJS ExporterHelper to export include files for effects
* Rename effectName to effectType to avoid confusions in gd::Effect
2019-12-17 09:04:00 +00:00
Florian Rival 52489c3cc9 Add generation of action/conditions/expressions to use properties of events based behavior 2019-06-16 17:08:55 +01:00
Florian Rival d7bee58182 Improve support for JS code events by exposing the context of the events function, if any 2019-05-23 22:02:32 +01:00
Florian Rival 049483dbbd Fix support for calling behavior methods from other behavior methods 2019-05-20 23:36:13 +01:00
Florian Rival 73121d5d53 [WIP] Add code generation for EventsBasedBehavior (2) 2019-04-29 21:48:28 +01:00
Florian Rival 7b69d41857 Remove useless GetCustomCodeInMain and related methods 2019-04-29 11:56:02 +01:00
Florian Rival 90c3f4f72b Avoid useless copy of arrays in ForEach event generated code
Lists of objects were wrongly initialized, creating a useless performance hit. All the objects of the "for each" were copied into arrays, before being emptied. And this, for every single object in the for each loop. This was particularly bad when a lot of objects were picked by the for each (if we have N objects, complexity was N*N copies of the array).
2019-04-24 21:23:16 +01:00
Florian Rival c3794950ab Rename methods to declare list of objects without picking from scene, for consistency 2019-04-24 21:23:16 +01:00
Florian Rival 42cbe3534f Add support for behaviors in EventsFunctionExtractor 2019-04-13 10:09:43 +02:00
Florian Rival fc4107107b Make parameters like objectvar use the last object (not necessarily the parameter just before) 2019-02-06 23:17:13 +00:00
Florian Rival 9c6c8564fa Fix handling of object parameters in expressions 2019-01-28 23:16:20 +00:00
Florian Rival 4b33373296 Fix ConvertToString and code generation for strings with backlash/escaped characters 2019-01-28 23:16:20 +00:00
Florian Rival 4c789967c3 Fix code generation of invalid variable expressions 2019-01-28 23:16:19 +00:00
Florian Rival df68978adc Add edge cases fixes and fuzzy tests for ExpressionParser2 2019-01-28 23:16:19 +00:00
Florian Rival 7a87fd9924 Add support for unary operator in ExpressionParser2 2019-01-28 23:16:19 +00:00
Florian Rival 34b5038bd5 Refactor to use the new ExpressionCodeGenerator (or old one with a flag) 2019-01-28 23:16:19 +00:00
Florian Rival a9e1120f00 Add gd::ExpressionCodeGenerator::GenerateExpressionCode 2019-01-28 23:16:19 +00:00
Florian Rival 4fd88072e9 Improve ExpressionParser2 and use it for GenericExpressionField and EventsRefactorer 2019-01-28 23:16:19 +00:00
Florian Rival 66029c62ed Add Variable code generation for ExpressionParser2 2019-01-28 23:16:18 +00:00
Florian Rival 43d78a74bd Enhance ExpressionParser2 and add ExpressionCodeGenerator 2019-01-28 23:16:18 +00:00
Florian Rival 0ec6ebad07 Add ExpressionParser2 and tests 2019-01-28 23:16:18 +00:00
Florian Rival 53a5dc1742 Add action to set function return value and expressions to get arguments
Also fix unselection of an event function in IDE
2018-10-08 22:21:37 +01:00
Florian Rival dc27d5f962 Rename gd::ClassWithObjects to gd::ObjectsContainer 2018-09-09 21:28:26 +01:00
Florian Rival 2f0d01e577 Fix compilation errors 2018-09-09 21:26:07 +01:00
Florian Rival b79ab3c829 Refactor some part of code generation into specific functions 2018-09-09 16:21:35 +01:00
Florian Rival 326ec9cac0 Abstract gd::Project/gd::Layout out of code generation 2018-09-09 16:21:35 +01:00
Florian Rival 4ce2ba08ef Add EventsContextAnalyzer and EventsContextAnalyzerDialog to use it in newIDE 2018-06-25 21:15:12 +01:00
Florian Rival 561ef0434f Refactor parameters type testing into ParameterMetadata::IsExpression 2018-06-24 19:13:37 +01:00
Florian Rival 731356b791 Move Profiler section code generation to EventsCodeGenerator 2018-06-23 11:43:33 +01:00
Florian Rival a8559bfbbc Add clang-format to format (C++) source files automatically (#491)
* Update all CMakeLists of extensions to use clang-format
* Run clang-format on all Extensions
* Update GDCore CMakeLists.txt to add clang-format
* Run clang-format on GDCore files
* Update GDJS and GDCpp CMakeLists.txt to add clang-format
* Run clang-format on GDCpp and GDJS files
2018-05-09 15:57:38 -07:00
Florian Rival db1b1eadf1 Refactor ExpressionParser and ParserCallbacks with getters for errors 2017-11-11 15:40:22 +01:00
Florian Rival b426212496 Add ObjectGroupsContainer in GDCore and improve groups edition in newIDE 2017-09-23 21:28:29 +02:00
Florian Rival 18f9b66615 [WIP] Improve PIXI export and preview in newIDE 2017-05-25 13:45:48 +02:00
Florian Rival 883129f379 Refactor arguments code generation using GenerateArgumentsList (#335) 2017-01-04 23:56:10 +01:00
Florian Rival e5631383dd Avoid unnecessary copy or declarations of objects lists
* Declare objects lists used by actions only when actions are launched
for standard events (both GDCpp and GDJS)
* Enable the object list reuse optimisation in GDCpp as done in GDJS.
2016-12-31 18:38:45 +01:00
Florian Rival ee9a3d181d Prevent long lags/freezes in code generated for GDJS games (especially on Android)
This is done by generating every events list code in separate functions, reducing
the stress on garbage collectors of JS engines.
2016-12-31 18:38:45 +01:00
Florian Rival a81170d934 Avoid unncessary copy of objects lists for last event of events lists 2016-12-31 18:38:45 +01:00
Florian Rival 78ec0fd201 Optimize code generation for object variables actions with mutators functions 2016-12-24 17:00:20 +01:00
Victor Levasseur 82684041ff Use std::copy instead of loops in EventsCodeGenerationContext
Add test cases for EventsCodeGenerationContext
2016-09-13 01:12:26 +02:00
Florian Rival be3ae5802d Add support for adding multiple include files for instructions 2016-08-07 22:26:41 +02:00
Florian Rival e444e80493 Update copyrights year 2016-01-14 19:46:56 +01:00
Florian Rival 63cb853d72 Change file organization (Events, Extensions + more folders) 2015-11-01 11:26:40 +01:00