eme version 0.2a - seme version 0.2
You need to re-compile your plugin[s], not just re-link it/them. There are several types of changes:
Incompatible changes that can't be caught by the compiler
LayerUtils::SelectCircle last parameter is no more the square of the radius, but the radius itself. Example:
/* Replace: SelectedTiles *sel = LayerUtils::SelectCircle(tiles, i, j, r2) By: */ SelectedTiles *sel = LayerUtils::SelectCircle(tiles, i, j, (int)sqrt((double)r2))
The parameters of the class Tiles resize function, have changed.
/* Replace tiles->resize(x, y, x+w, y+h); By: */ tiles->resize(x, y, w, h);
The non-const Wrapper functions will no more work on a const map. (anyway, calling a non-const wrapper method on a const map is semantically a bug).
By default, no feature in the GUI is enabled. To enable one or more features, use GUI.AllowFeature in plugin_init. Example:
#include "emeftr.h" int plugin_init(int argc, char **argv) { /* Allows everything */ GUI.AllowFeature(true, Features::Group::Everything); /* Disallow some features */ GUI.AllowFeature(false, Features::Group::VariableLayerCount); return LS_NO_ERROR; }
Incompatible changes that will be caught by the compiler
Parameters and return value for load and save brush functions have changed. You no more need to access the brushlist yourself. There is no backward compatibility helper.
The return value for the create layer callback has changed. The callback has to insert the layer itself. The is no backward compatibility helper.
The TilesStack constructor no more has a reserve parameter.
You should no more access the Map object directly, but thru a Wrapper object. (Also note that some map methods names have changed).
Wrapper iterators no more supports ++ and --.
Changes with backward compatibility helpers
SelectedTiles::RawAdd is deprecated, you can use it if the library and your plugin are compiled with compatibility on.
LayerUtils::InsertColumn renamed in LayerUtils::InsertColumns, LayerUtils::InsertRow renamed in LayerUtils::InsertRows, LayerUtils::DeleteColumn renamed in LayerUtils::DeleteColumns, LayerUtils::DeleteRow renamed in LayerUtils::DeleteRows. You can still use the previous ones if the library and your plugin are compiled with compatibility on.
SelectedTiles::Intersection replaced by LayerUtils::Intersection. You can still use the SelectedTiles version if the library and your plugin are both compiled with compatibility on.
Using Type::Cast to cast from a BaseProperty or BaseCreator to a
Type::Property or Type::Creator is replaced by Cast
Number::Property *pn = Number::Cast(p); // Must be replaced by Number::Property *pn = Cast<Number>(p);
You can keep the old syntax if you compile both eme and your plugin[s] with compatibility on.
You can specify which features will be enabled, see The API : 4.1 - Configuration.
Userdata allows you to add a data to the map that isn't understood by eme itself, see The API : 4.3 - User data.
Several new commands : CommandResize, CommandMoveLayer, CommandReplaceLayer, CommandMergeLayer, CommandSwapLayers.
Several new selection helpers : LayerUtils::ShrinkSelection, LayerUtils::GrowSelection, LayerUtils::InvertSelection
GUI.IsInteractive allows you to know if the program was invoked with the --save option.
SelectedTiles::Empty returns true if there's no position in the object.
The Map class shouldn't be directly accessed from the plugin. So there are some new functions in the wrapper :
Version 0.2a Update: You no more need to define yourself EME__COMPATIBILITY in version greater or equal to 0.2a, you should use emetool.
You need to re-compile your plugin(s), not just re-link them.
The classes Layer, FullLayer, SparseLayer are deprecated. Use Tiles, FullTiles, SparseTiles instead. Some Layer member functions are now non-member and defined in the namespace LayerUtils.
The class TileGroup is deprecated. Use SparseTiles instead.
If you want to still use them, define EME__COMPATIBILITY before including the files layer.h, lfull.h, lsparse.h or tilegrp.h. Example:
#define EME__COMPATIBILITY #include "tilegrp.h"
Alternatively, if you include eme makefile.def in your makefile (as suggested in the plugin tutorial), EME__COMPATIBILITY should be automatically defined.
IMPORTANT: Even with EME__COMPATIBILITY defined, you will need nevertheless to clone creators given to TileGroup constructors. This is important because the TileGroup (SparseTiles, in fact) will destroy the creator when deleted. The memory will be corrupted if the creator wasn't cloned. For example:
// Replace //TileGroup *group = new TileGroup(creator); // by TileGroup *group = new TileGroup(creator->Clone());
The commands CommandAppendRow and CommandAppendColumn have disappeared. Replace:
Command *cmd = new CommandAppendRow(map, count);by
Command *cmd = new CommandStack<CommandInsertRow>( map, map->GetLayers()->endi(), map->GetLayers()->endj(), count );
The constructors for almost all commands has changed, see The API : 2.3 - Existing commands for the documentation on commands.
The two globals commands_manager and selected_tiles have been supressed. They now belongs to the current map. You can access them with:
Commands *Map::GetCommandManager() SelectedTiles *Map::GetSelectedTiles()
Version 0.2a Update: You should not access the map directly, use the Wrapper.
There is a new Wrapper constructor, which allows to not specify the number of layers or properties, and a function to specify the number of properties (the number of layers is automatically computed if needed).
Wrapper::SetLayer has now two forms: with and without layer size and position.
Out of order iterators in the Wrapper are probably slower than before.
There exists a new TilesStack class used as an implementation for both Map and Brush.
Two new commands: CommandInsertLayer and CommandRemoveLayer.