Long time no post . I have been consideirng for some time writing my own version of something like TGF/MMF in C++.
This is what i have thought of so far (UML/C++ knowledge is handy ):
You have a file that contaons a series of instructions that are to be carried out by respective classes. Each cammand is seperated by a '\n' or a newline inside the file.
A class of Core shall inherit from the the classes of graphics,sound, filemanip etc. Allowing access to any member function needed i.e. display a sprite.
The instructions will be read one after the other and call the appropiate class member functions, this will have be done with a counter that points to the next command to be read from the file, this must be an inifinite loop that can be broke out of, resetting the intruction counter when all instructions have been performed.
Of course the instruction will be passed to something like a "switch" to decide which case and member function call should be carried out.
The only thing i can not figure out is how to have all the data needed (sprites, music and all that sort of stuff)including the runtime file (a little exe proggie that is a cut down version of my software that just runs files) bunged all together in one exe.
I have writ a basic compression algorithm in C using file pointers and buffers and all manner of stuff but that does not help me, how can i append everything a game or app needs into one file or the maximum of two files? Could i append say a .bmp on the end and use the file pointer to extract what i need?
Also please comment the theory of what i have said .
Making a scripting language is hard, but I think if you stick a couple of kb of nulls at the end of a normal EXE, then paste in all your data, the EXE will still run normally. The EXE would have to be coded to open itself and extract the data from the end.
Else you can just keep all the files external or packed in to one external file.
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G