Page 1 of 1

[HGE] Using DDS textures causes wrapper to crash

PostPosted: Thu Mar 11, 2010 8:20 am
by sonictk
Hello again. I have another technical issue with Magic Particles.

For reasons of convenience, I have been designing all my special effects using PNG as my texture format. However, as we need to optimize the effects, I am planning to switch to converting all textures to DDS format. However, it seems that while Magic Particles appears to read DDS fine and the effect plays nicely in the scene editor, when it is placed in the HGE wrapper, it causes it to crash.

I have tried looking through the documentation for the wrapper but have found nothing about DDS format. HGE does support DDS, as we are bringing in sprites in DDS format as well. Is there anything that we can do to modify the Magic Particles HGE wrapper to enable it to support DDS textures? This could prove critical to helping improve the performance of the effects.

Re: [HGE] Using DDS textures causes wrapper to crash

PostPosted: Thu Mar 11, 2010 2:27 pm
by Odin_KG
Magic Particles API does not load the textures. This is the task of HGE:

Code: Select all
// eng: Loads texture frame
void MP_Atlas_WRAP::LoadFrame(MAGIC_TEXTURE* magic_texture, const char* texture_folder)
{
   HTEXTURE texture_from;
   if (magic_texture->data)
      texture_from=hge->Texture_Load(magic_texture->data,magic_texture->length,false);
   else
   {
      MP_String path=texture_folder;
      path+=magic_texture->file;
      texture_from=hge->Texture_Load(path.c_str(),0,false);
   }
...
...
...

Re: [HGE] Using DDS textures causes wrapper to crash

PostPosted: Fri Mar 12, 2010 6:15 am
by sonictk
We are currently using DDS textures for our map sprites and they seem to load fine. Would you happen to know why it seems to crash the HGE engine whenever I introduce DDS textures into the ptc files? I understand that how HGE deals with loading textures is not under your purview but it would help a great deal if we could get any advice on this matter.

Re: [HGE] Using DDS textures causes wrapper to crash

PostPosted: Fri Mar 12, 2010 8:11 am
by Odin_KG
Hello!

Error happens in this line of HGE-wrapper:
texture_from=hge->Texture_Load(magic_texture->data,magic_texture->length,false);

If you use HGE then you may not use DDS for particles or you have to load DDS in HGE yourself.