Страница 1 из 1

Loading from .zip archive

СообщениеДобавлено: Сб апр 09, 2011 7:05 am
us42
Hi everybody!
I am using HGE engine and I need to load .ptc effects files from .zip archive.
In the way of .xml files I do following:
Код: Выделить всё
      DWORD size;
      char *tmpContents;
      char *xmlContents;

      tmpContents = (char *)hge->Resource_Load("my.xml", &size);
      xmlContents = new char[size+1]; // +1 to allow for null-terminator
      strncpy(xmlContents, tmpContents, size);
      xmlContents[size] = '\0'; // null-terminate string
      hge->Resource_Free(tmpContents);

      //xml_document doc;
      doc.load(xmlContents);
      delete xmlContents;


Is it possible to load this GREAT magic particles in the same way?
Please write some code below, thank you! ;)

Re: Loading from .zip archive

СообщениеДобавлено: Сб апр 09, 2011 10:39 am
Odin_KG
Hi,

I do not work with HGE, but if you can dearchive zip-file in memory, you can use Magic_OpenFileInMemory in order to load ptc-file from memory.