Please sign in to comment.
Remove Obsolete Proto2ES (#1533)
Well, this is it, the dawn of a new ENIGMA and the final stage of the transition to Google Protocol Buffers. When Josh created the GameData structure (basically converts EnigmaStruct into a proto) in #1448, he made Proto2ES obsolete and no longer necessary. This pull request completes the transition by finally adding a new method to the `compileEGMf` DLL that accepts a protocol buffer and deleting Proto2ES from emake's sources. With this change, emake, RGM, and any new frontend tools should reach peak compiling performance as they are passing a proto directly to the compiler with no intermediate translation to other formats. Other tools, like LGM, will continue to use the outdated EnigmaStruct, subject to binary compatibility-breaking changes, for the foreseeable future until someone decides to migrate such tools to protos too. ### Summary of Changes * Changed the `EnigmaPlugin::BuildGame` overload that accepts a proto game to no longer call `Proto2ES` and instead call the newly loaded `plugin_CompileProto` function. It's worth mentioning that, for some reason, we had this set up to take `Game` instead of `Project` so I didn't have a need to change the signature yet. I also wasn't sure the distinction fundies was making between `Game` and `Project` when he made the latter contain the former. For now, I just made a temporary `Project` and set the passed `Game` on it. * Deleted the `Proto2ES` header and source file from emake's sources. * Changed the CompilerSource makefile to link to zlib and lodepng since it now needs both in order to compile a proto game. * Changed the `GameData` structure to define all of the proto-based copy constructors and flatten the tree. Some resources had specific requirements, such as objects and timelines which needed their drag and drop actions converted to code. The actions to code conversion will probably later be moved into libEGM because RGM is not going to support the old drag and drop actions format. Sounds, Sprites, and Backgrounds also needed the code from Proto2ES in order to load their binary data in for the compiler. * Changed `CompilerSource/compiler/compile.cpp` to export a new `compileProto` DLL function for frontend tools that would like to use ENIGMA's new Protocol Buffers interface. The Protocol Buffers interface, as should be obvious, has several advantages including the ability to serialize and communicate the buffers to a remote client or to make changes without breaking binary compatibility. * Changed the object parsing and linking logic to deal with events that have a subname instead of a subid (collision events in GMX have the other object as a string). From the comments, it appears that Josh was confused and thought that name was the composite name of the main id and subid, when in reality it's just the name of the "other" object for collision events at the moment. Later I'd like to see this changed around to support what I call "templated" events where you could hypothetically have an event for any kind of resource (perhaps an event for when a selected sprite loads). Regardless, this specifically addresses being able to build AI Tutorial project from emake. * Addressed the `"<undefined>"` resource name edge case in the GMX reader using the new resource reference option provided by #1547 to know which string fields to compare. * Tweaked the top-level makefile to have `liblodepng` as a dependency of the default target (which is the compiler). This has to be done because `GameData`, which is part of the compiler backend, now requires lodepng in order to load the binary data for Sprites and Backgrounds. * Changed the emake makefile to no longer link to zlib and lodepng since it no longer has a direct dependency on them. Also removed the dependency in the main makefile too.
- Loading branch information...
Showing with 342 additions and 873 deletions.
- +4 −4 CommandLine/emake/EnigmaPlugin.cpp
- +2 −1 CommandLine/emake/EnigmaPlugin.hpp
- +0 −2 CommandLine/emake/Main.cpp
- +2 −2 CommandLine/emake/Makefile
- +0 −781 CommandLine/emake/Proto2ES.cpp
- +0 −27 CommandLine/emake/Proto2ES.h
- +3 −0 CommandLine/libEGM/gmx.cpp
- +2 −2 CompilerSource/Makefile
- +163 −0 CompilerSource/backend/Actions2Code.h
- +137 −24 CompilerSource/backend/GameData.cpp
- +3 −4 CompilerSource/backend/GameData.h
- +12 −5 CompilerSource/compiler/compile.cpp
- +10 −17 CompilerSource/compiler/components/parse_and_link.cpp
- +2 −2 CompilerSource/compiler/components/write_room_data.cpp
- +2 −2 Makefile
Oops, something went wrong.