Well I had to struggle a bit with that as well. What you have to do is to download the required SDKs if some includes are missing. But then you will finally run into some linking errors.
That's because the BGMLIB.dll seems to be somehow a wrong version. Thus unpack the BGMLIB.rar, recompile the lib and replace every occurrence of it by the newly compiled one. Now the plugin should compile.
Furthermore, from the short glance I had on the source code, there already seems to be something like a caching for the texture names.
In theory you just have to add your caching algorithm for the actual texture to the load function.
1. check if the name is already cached
2a. If yes, load it from memory instead from hd
2b. If no, load it from hd & cache, allocate the appropiate memory, write it to memory
To do so, you should extend the struct that is holding the texture meta data (name, loading timestamp, etc.)
One strange thing is, when I'm compiling the plugin it shows graphic glitches at runtime, which Mudlord's one didtn't show. Thus either it's an elder version or it's because I'm using VS2005... for compiling.
All I'm writing here is from memory, thus it might not be 100% correct.