mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-08-19 09:39:50 +00:00
disable texture caching in some place, due to pointer re-use issue
This commit is contained in:
@@ -684,7 +684,7 @@ public:
|
||||
|
||||
GUIHelperInterface* m_childGuiHelper;
|
||||
|
||||
btHashMap<btHashPtr, int> m_cachedTextureIds;
|
||||
|
||||
int m_uidGenerator;
|
||||
const unsigned char* m_texels;
|
||||
int m_textureWidth;
|
||||
@@ -910,11 +910,7 @@ public:
|
||||
}
|
||||
virtual int registerTexture(const unsigned char* texels, int width, int height)
|
||||
{
|
||||
int* cachedTexture = m_cachedTextureIds[texels];
|
||||
if (cachedTexture)
|
||||
{
|
||||
return *cachedTexture;
|
||||
}
|
||||
|
||||
m_texels = texels;
|
||||
m_textureWidth = width;
|
||||
m_textureHeight = height;
|
||||
@@ -923,7 +919,7 @@ public:
|
||||
m_cs->setSharedParam(1, eGUIHelperRegisterTexture);
|
||||
|
||||
workerThreadWait();
|
||||
m_cachedTextureIds.insert(texels, m_textureId);
|
||||
|
||||
return m_textureId;
|
||||
}
|
||||
virtual int registerGraphicsShape(const float* vertices, int numvertices, const int* indices, int numIndices, int primitiveType, int textureId)
|
||||
@@ -977,7 +973,6 @@ public:
|
||||
|
||||
virtual void removeAllGraphicsInstances()
|
||||
{
|
||||
m_cachedTextureIds.clear();
|
||||
m_cs->lock();
|
||||
m_cs->setSharedParam(1, eGUIHelperRemoveAllGraphicsInstances);
|
||||
workerThreadWait();
|
||||
|
||||
Reference in New Issue
Block a user