THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/06/2012 at 08:33, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13.058
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;
---------
Howdy,
After upgrading to the latest version of R13 (13.058), there was a change in the BaseSelect::GetRange() member function.
The previous function was:
Bool GetRange(LONG seg, LONG *a, LONG *b) const;
... and the new changed function is:
Bool GetRange(LONG seg, LONG maxElements, LONG *a, LONG *b) const; // pass
maxElements to make sure the returned values for a and b are < maxElements
or MAXLONGl for no additional checks
Is there any reason why the updated function could not have been written like this:
Bool GetRange(LONG seg, LONG *a, LONG *b, LONG maxElements=MAXLONGl) const;
... so that those of us plugin developers who are still supporting earlier versions of Cinema 4D would still have our plugin code working without needing to rewrite it?
Of course rewriting the code isn't all that difficult, because I can simply create a wrapper function for it:
Bool CDGetRange(BaseSelect *bs, LONG seg, LONG *a, LONG *b, LONG maxElem=CDMAXLONG);
Bool CDGetRange(BaseSelect *bs, LONG seg, LONG *a, LONG *b, LONG maxElem)
{
#if API_VERSION < 13000
return bs->GetRange(seg,a,b);
#else
return bs->GetRange(seg,maxElem,a,b);
#endif
}
But I'm still curious why the new parameter wasn't added to the end with a default value?
Adios,
Cactus Dan