L3DT users' community
Large 3D terrain generator

Plugin API update (v2.5.2)

Correspondence concerning plugins and scripts; development, use, bugs and ideas.

Plugin API update (v2.5.2)

Postby Aaron » Sun Nov 04, 2007 8:32 am

Hi All,

I've released the updated 'Zeolite' plugin API that should be used with the forthcoming L3DT release 2.5b. The main changes are the addition of some functions for creating maps in the project, the addition of several signed/unsigned integer and vector variable types.

You can read the change-long and download the API from here:

http://www.bundysoft.com/docs/doku.php?id=zeolite:changes#v2.5.2

Cheerio,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Broken zeofunc_Execute

Postby carldt » Sun Nov 18, 2007 3:17 am

Why did you do this in the public section of the class declaration?

Code: Select all
   //ZVAR   zeofunc_Execute(ZFUNC hFunc, ZLIST hArgList);
   bool   zeofunc_Execute2(ZFUNC hFunc, ZLIST hArgList, ZVAR* ppRval);


Extensions that rely on CExtAPI::zeofunc_Execute need to be rewritten now.

I couldn't see this marked as deprecated in your ChangeLog.
carldt
Contributing member
 
Posts: 39
Joined: Mon Mar 05, 2007 7:38 am

Postby Aaron » Sun Nov 18, 2007 3:40 am

Hi Carl,

zeofunc_Execute was replaced by zeofunc_Execute2 for Zeolite v2.3, back in March. The reason for the change was that zeofunc_Execute was not thread-safe. The second version requires the user to supply the variable to contain the return value, which is threadsafe, whereas the first version used a shared, internal variable to store the return value, and returned a handle to that. If that function was called simultaneously in two threads, one may incorrectly pick up the return value of the other. Basically, zeofunc_Execute was a mistake, and could not be fixed without changing the prototype (thus zeofunc_Execute2).

The down-side to zeofunc_Execute2 is that users must now manually create and initialise the return value variable before passing it to the function. If this is a problem, I suggest having a look at the CzFunc helper class. It makes using zeofuncs much easier, and I always use it in preference to the CExtAPI::zeofunc_ functions.

By the way, older plugins that used zeofunc_Execute will still work, because zeofunc_Execute is still available in L3DT for plugins that ask for it (i.e. those compiled before Zeolite v2.3.) If this function is still required, you can un-comment the relevant code from the CExtAPI header and source files. However, this is not recommended as a long-term solution.

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia


Return to Plugins and scripts

Who is online

Users browsing this forum: No registered users and 3 guests

cron