Prep work for implementation of #6. Permits passing in nullptr from the JS side when calling bound functions.
StormLib has several functions with optional arguments. These arguments can either be, for example, uint32_t* or nullptr. If you want to get the value placed in an optional argument, you'd pass in a valid pointer. If you don't care, you'd pass in a nullptr (and skip a stack allocation).
Embind doesn't really deal with pointers at all, which is why we have the EmPtr classes. With this refactor, in the example above, you'd pass in either an instance of StormLib.Uint32Ptr or the constant StormLib.NULLPTR.
Prep work for implementation of #6. Permits passing in
nullptr
from the JS side when calling bound functions.StormLib
has several functions with optional arguments. These arguments can either be, for example,uint32_t*
ornullptr
. If you want to get the value placed in an optional argument, you'd pass in a valid pointer. If you don't care, you'd pass in anullptr
(and skip a stack allocation).Embind doesn't really deal with pointers at all, which is why we have the
EmPtr
classes. With this refactor, in the example above, you'd pass in either an instance ofStormLib.Uint32Ptr
or the constantStormLib.NULLPTR
.Closes #21