Adjustments to the plugin SDK

Started by ., Aug 19, 2016, 06:00 PM

Previous topic - Next topic

.

I'm reserving this topic for future requests and probably suggestions to the plugin SKD that could be of use. Please do not post in this topic if you're not a developer or you have no idea what you're talking about.



Bulk retrieval of entity positions:
/*
Returns:
    Number of remaining entities if GetLastError() is equal to vcmpErrorBufferTooSmall
    Number of found entities that were saved in the buffer.

GetLastError:
vcmpErrorNoSuchEntity - Wrong entity pool? Does not have a position?
vcmpErrorBufferTooSmall - One of the specified buffers were too small
*/
int32_t (*GetAllEntityPositions) (vcmpEntityPool entityPool, int32_t* idBuffer, uint32_t idBufferSize, float * posBuffer, uint32_t posBufferSize);

/* Possible checks to be done internally:
    posBufferSize /= 3; // (x,y,z)
    if (posBufferSize < idBufferSize) generate vcmpErrorBufferTooSmall;
*/

Rather than validating each entity and requesting it's size all the time. Should save some time. To be able to create efficient functions for situations like in this topic. And probably a few others.

The identifiers of the active entities are put into idBuffer and their position is put into posBuffer.



More to be suggested as I recall them. I used to have plenty of requests but I seem to have forgot them for now.
.