I spent some more time on op2ext today.
I implemented the macro for switching between dllimport and dllexport within op2ext.h.
#ifdef OP2EXT_INTERNAL_BUILD // Defined in op2ext project settings
#define OP2EXT_API extern "C" __declspec(dllexport)
#else
#define OP2EXT_API extern "C" __declspec(dllimport)
#endif
I implemented a new testModule subproject within op2ext. It reports info to the IDE output window to prove the op2ext public interface is working. Shell is in place, but more work will be required to get everything testing.
I noticed that we call different functions for console loaded versions of the modules and .ini versions of modules.
Console module vs .ini module
mod_init InitMod
mod_run ?? No equivalent
mod_destroy DestroyModI'm thinking that we should unify the names by switching the conosole mod names over to the .ini module names. I don't think anyone is currently using a mod that calls any of the functions from console loading, so this should be an okay breaking change.
I'd also like to create a new class that handles the actual loading of mods. The current ConsoleModuleLoader and IniModuleLoader classes will become classes that simply list the locations of modules defined either by a console switch or in the .ini file. They will then pass these modules to the new class for loading.
This will prevent the naming and use of the public module functions from diverging again.
Recent CommitsHooman will be pleased to learn that I made my first partial commit of a file today using TortoiseGit. Doesn't get much nerdier than that. Sigh.
* Remove bug from ConsoleModuleLoader that prevented loading proper directory
* Remove outdated Visual Studio workspace and project file
* Update comment on StubExt to be more specific
* Add macro to change external interface from dllexport to dllimport
- When op2ext.h is compiled/linked to within op2ext project, external functions are declared for export.
- When op2ext.h is compiled/linked to by an extension module, external functions are declared for import.
* Create TestModule project
- Designed to test the public interface of op2ext.
- Serves as another template for how to link a module to Outpost 2 using op2ext.