Ticket #491 (assigned enhancement)

Opened 7 years ago

Last modified 5 years ago

Create C++ versions of the map/object loaders/savers

Reported by: prock Owned by: vtchill
Priority: high Milestone: 0.3.5
Component: engine/core/loaders/native Version: trunk
Severity: major Keywords: map loaders
Cc: Blocked By: #504
Blocking: Time planned:
Time remaining: Time spent:

Description (last modified by vtchill) (diff)

This is a major ticket for this milestone. We need to move the loaders/savers from the python extensions to C++. They should also support custom loaders/savers. All extension loaders/savers should be decommissioned.

As part of this bug fix the editor needs to be modified to accept custom loaders/savers as well. These will need to be presented to the user when loading or saving objects and/or maps.

Change History

comment:1 Changed 7 years ago by prock

  • Type changed from defect to enhancement

comment:2 Changed 7 years ago by prock

  • Blocked By 504 added

comment:3 Changed 7 years ago by vtchill

  • Owner changed from FIFE to vtchill

comment:4 Changed 7 years ago by vtchill

  • Status changed from new to assigned

comment:5 Changed 7 years ago by vtchill

(In [3660]) Initial support for c++ map/object/animation loaders. Tested compilation on msvc 9 and mingw on win32. Linux still needs to be tested. Modified the demos to work with the new loaders. Still need to modify the editor. Lights are currently not supported by the loaders, this will need to be added. Added dependency tinyxml for reading xml files. This is stored in engine/core/ext/tinyxml directory. The scons scripts will attempt to use system version of tinyxml if available otherwise the local one will be used. refs #491

comment:6 Changed 7 years ago by vtchill

(In [3661]) Removed the need to add the map file directory to the VFS as a source to search. Instead the loader now prepends the map file directory to any import being loaded from the map file since the map saver stores the filename relative to the map file directory. The saver could be changed in the future to not save relative to map file if needed. The AnimationLoader? constructor no longer takes the map file path as it was not being used at all by the class. refs #491

comment:7 Changed 7 years ago by vtchill

(In [3664]) Fixed an error in the SConstruct file that was introduced as part of the map loader effort. refs #491

comment:8 Changed 7 years ago by vtchill

(In [3702]) The editor should now use the default fife c++ map loader to load all maps. This is not the final solution as we want a more flexible option for users to provide their own loaders in the future, but this is moving in the right direction. refs #491

comment:9 Changed 7 years ago by vtchill

(In [3707]) Split out the object loading from the map loader. Now there is a dedicated objectloader interface so users could override it. A default one is provided as well. The editor File->Load Import File and File->Load Import Directory should now work again using the new resource loaders. Small fix to sharedptr for the operator bool conversion. refs #491

comment:10 Changed 7 years ago by vtchill

(In [3708]) Fixed some warnings with multiply defined typedefs that were introduced in the last commit. refs #491

comment:11 Changed 7 years ago by vtchill

  • Description modified (diff)

comment:12 Changed 7 years ago by prock

(In [3727]) * Fixed a small bug in the object loader refs #491

comment:13 Changed 7 years ago by prock

  • Milestone changed from 0.3.3 to 0.3.4

Moving to 0.3.4

comment:14 Changed 6 years ago by prock

(In [3809]) * Added the map, animation, and object saver interfaces. refs #491

comment:15 Changed 6 years ago by vtchill

(In [3858]) Saving progress on the c++ map saving functionality. It is not tested at this point and does not currently support lighting. Also made a small modification to Map::getCameras so that it now is a const function returning a const reference so that a const Map reference could be used properly. refs #491

comment:16 Changed 6 years ago by vtchill

(In [3859]) quick fix to add in saving of the xml file. refs #491

comment:17 Changed 6 years ago by prock

(In [3862]) * fixed a small problem with the last commit. Added a LM_SAVERS log module. refs #491

comment:18 Changed 6 years ago by vtchill

(In [3866]) Default FIFE map saver is now exported through the python bindings. The way the editor handles file imports for maps has been changed so that the MapController? now keeps a reference count for which imports are used for each map. This will ensure that only imports that are used are saved in the map file. The MapView? has been modified to use the default FIFE c++ saver for map saving functionality. refs #491

comment:19 Changed 6 years ago by vtchill

(In [3868]) small fix in the AtlasLoader? to set the filename of any objects read from the atlas file to the atlas xml file instead of the image file like it was doing previously. This fixes a problem seen in the map loading/saving where the imports would save the image file instead of the xml description file in the map. Also forgot to add the mapsaver.i in the last commit. refs #491

comment:20 Changed 6 years ago by vtchill

(In [3876]) The MapLoader? now allows .zip files (in addition to .xml) files to be loaded. The ZipSource? class now implements a smarter file search so that it can properly load files from a zip archive when the filename's do not exactly match. refs #491

comment:21 Changed 6 years ago by vtchill

(In [3878]) This is a complete overhaul of the backend storage used for zip archives. Now the ZipSource? creates a tree type hierarchy for the zip archive which allows for easier searching and it should be faster access as well. Also fixed the RawData::readString function so that it now returns a valid string that can be compared properly. The MapLoader? should now properly load a zip archive and this has been tested with the rio_de_hola demo. refs #491

comment:22 Changed 6 years ago by vtchill

(In [3879]) Fixed a compile error in ZipTree? due to boost::filesystem V2 vs. V3 differences. Also got rid of a couple of warnings in objectloader.cpp refs #491

comment:23 Changed 6 years ago by vtchill

(In [3883]) Added handling in ZipTree? for paths containing "..". Also slightly modified the MapLoader? so that it ignores any .svn directories without the need to make a copy of the directory list. refs #491

comment:24 Changed 5 years ago by prock

  • Milestone changed from 0.3.4 to 0.3.5

Moving to 0.3.5 as we are preparing to release 0.3.4

Note: See TracTickets for help on using tickets.