Since Hooman and I spent some time in the OP2Editor code recently, I wanted to record some thoughts I had on the project.
While this is the backend of the map editor, it could be (is?) a lot bigger in scope. It provides reading and writing of vol files, decoding OP2 specific BMP files, loading and saving map files, loading tile sets into memory, etc.
I made the OP2Utility project to be a utility library for handling the various parts of Outpost 2 related to maps, tilesets, archives, etc. The reality is, this already existed in better form in the OP2Editor. In the long run, I would be happy if OP2Utility was removed and OP2Editor was referenced by OP2MapImager and OP2Archive.
However, some improvements exist in OP2Utility that would need to be folded into OP2Editor. In particular, there is some better error handling for vol and clm files that Hooman and I wrote and the ability to read and extract from LZH compressed vol files (which Hooman wrote I think). I don't think it would be difficult to fold these changes into OP2Editor.
OP2Editor currently fully supports COM. VS2017 has no problem out of the box compiling the COM related code. So while I don't think COM is really in active development by Microsoft, they seem intent on continuing support of it. So currently, OP2Editor could be used in any language that can leverage COM, like C#, Visual Basic, F# (I think?), etc.
There are other ways to support cross language code calling. In particular, we could create buffer .h/.cpp files that expose the object oriented OP2Editor code in a way that could be called procedurally by C. There seems to be a lot of support in many languages for calling C code. Like CTypes in Python. So this might facilitate future ease of cross language support by exposing an external C compatible API. But the code is already fully COM compatible, so this would be a lot of work to change when there are already ways to call it outside of C++.
Of all our projects, OP2Editor would probably be the best candidate for setting up legitimate unit tests. It is a backend library only, so no user interface to deal with when unit testing. Also, OP2Editor could handle the backend work for OP2MapImager, OP2Archive, the mapper, etc. This would facilitate unit testing large portions of all these applications.
While it would be nice to see OP2Editor cross platform, there are a lot of hurdles. All the file system code is written Windows specific. CLM reading and writing relies heavily on Windows specific libraries for music file manipulation. The custom bitmap code uses windows specific code for image manipulation. Plus the COM interface would need to be ripped out. That would amount to a lot of work, and specialized code replacement for the music and bitmap manipulation.
I'm still a fan of using C++17 filesystem, just wish it would leave experimental status sooner. :/
Anyways, I'm not in a spot to work any of this right now. Perhaps in months to come some of these ideas could be implemented? If we ever get around to making a new mapper, any work put into OP2Editor would pay off well.
-Brett