mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 04:53:06 +01:00
Merge pull request #49 from dariomanesku/master
Added isValid(_handle).
This commit is contained in:
@@ -66,6 +66,14 @@ namespace bx
|
||||
return invalid;
|
||||
}
|
||||
|
||||
bool isValid(uint16_t _handle)
|
||||
{
|
||||
uint16_t* sparse = &m_handles[MaxHandlesT];
|
||||
uint16_t index = sparse[_handle];
|
||||
|
||||
return (index < m_numHandles && m_handles[index] == _handle);
|
||||
}
|
||||
|
||||
void free(uint16_t _handle)
|
||||
{
|
||||
BX_CHECK(0 < m_numHandles, "Freeing invalid handle %d.", _handle);
|
||||
@@ -139,6 +147,14 @@ namespace bx
|
||||
return invalid;
|
||||
}
|
||||
|
||||
bool isValid(uint16_t _handle)
|
||||
{
|
||||
uint16_t* sparse = &m_handles[m_maxHandles];
|
||||
uint16_t index = sparse[_handle];
|
||||
|
||||
return (index < m_numHandles && m_handles[index] == _handle);
|
||||
}
|
||||
|
||||
void free(uint16_t _handle)
|
||||
{
|
||||
uint16_t* sparse = &m_handles[m_maxHandles];
|
||||
|
||||
Reference in New Issue
Block a user