Posted: Sun Jun 21, 2020 9:27 am Post subject:
Code for reading the .MEG files of the remaster
Here is some code for reading the .MEG files of the C&C remaster. It is licensed under GPLv3 (same license as the remaster codebase) and requires RawFileClass/FileClass from the remaster codebase.
MegFileManager constructor takes the path to the remaster folder (so the one with the exe files in it, not the data folder where the .MEG files are)
MegFileManager::Load takes the path (full path) to a .MEG File and loads that file.
MegFileManager::Exists takes the path to a game file and will tell you if that file exists in any of the loaded .MEG files,.
MegFileManager::Open takes the path to a game file and returns a FileClass which you can then use to read the file contents etc.
MegFileManager::Close takes the FileClass instance and closes/destroys it.
LoadMegs takes the path to the remaster folder (so the one with the exe files in it, not the data folder where the .MEG files are) and loads the same .MEG files (in the same order) as the remaster map editor does and lets you access them through TheMegFileManager.
CloseMegs is called to free TheMegFileManager.
I am hoping this code will be useful to people working with the remaster.
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum