Extended functionality of xptr (?)

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 771
Joined: Wed May 05, 2010 12:16 pm

Extended functionality of xptr (?)

Post by Rado1 » Tue Sep 11, 2012 8:20 pm

I'm trying to call the libmodplug library from ZGE, and the following improvements could maybe help me to avoid writing a dll wrapper in C++:

- xptr for File component (used for embedded file)
- xptr used as type of global variables

I'm not really sure with these changes, but my idea is to translate the following C++ API code:

Code: Select all

struct _ModPlugFile;
typedef struct _ModPlugFile ModPlugFile; 

ModPlugFile* ModPlug_Load(const void* data, int size);
to the corresponding ZGE's external function looking like this:

Code: Select all

xptr ModPlug_Load(xptr data, int size) {}
and then call from expression:

Code: Select all

ModPlug_Load(ModFile, ModFile.Size);
ModFile is a File component. Should it work in this or similar way? Any ideas?

darkhog
Posts: 58
Joined: Sun Sep 09, 2012 7:59 pm

Post by darkhog » Tue Sep 11, 2012 8:55 pm

How about passing path to file and wrapper would detect size by itself? True, you'll have to store music as separate file, but it would be okay until proper solution is being made.

BTW. I think your idea of xptr is good and should be implemented, I just posted workaround for a time being.

User avatar
Rado1
Posts: 771
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Tue Sep 11, 2012 9:59 pm

darkhog wrote:How about passing path to file and wrapper would detect size by itself? True, you'll have to store music as separate file, but it would be okay until proper solution is being made.
Of course the library wrapper would provide such a functionality, but the point is, that I would like to avoid creating such a wrapper because it brings more overhead to development; even if in the case of libmodplug the wrapper will be relatively trivial.

darkhog
Posts: 58
Joined: Sun Sep 09, 2012 7:59 pm

Post by darkhog » Tue Sep 11, 2012 10:02 pm

I know. As I said, your solution is more clear, but for the time being, before it is implemented, this is my idea how it could work.

Post Reply