Loading from .zip archive

Обсуждение программы Magic Particles.

Loading from .zip archive

Сообщение us42 » Сб апр 09, 2011 7:05 am

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! ;)
us42
 
Сообщения: 1
Зарегистрирован: Сб апр 09, 2011 6:57 am

Re: Loading from .zip archive

Сообщение Odin_KG » Сб апр 09, 2011 10:39 am

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.
Аватара пользователя
Odin_KG
Administrator
Administrator
 
Сообщения: 841
Зарегистрирован: Чт янв 15, 2009 2:57 pm


Вернуться в Magic Particles

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 18

cron