Original Post
In my dungeon editor I have a bunch of floor plate. When a new floor plate are created, either a new texture list are being made or a already created list get another floor plate...
//
// Create a new texture list if...
//
if(CRenderScene::TextureExist(p_pTexName)==false)
{
CTexture l_tNewTex(p_pTexName);
m_Textures.push_back(l_tNewTex);
}
//
// Get texture list from mesh...
//
CTextureList* l_pTextureList = &m_Meshes[wMeshNr].m_TextureList;
//
// Get a pointer to current start index from wallpart...
//
WORD *l_pwCurrStartIndex;
switch(m_Meshes[wMeshNr].GetID())
{
case MESHID_FLOOR:
l_pwCurrStartIndex = &CApp::m_wCurrentFloorStartPoly;
break;
case MESHID_ROOF:
l_pwCurrStartIndex = &CApp::m_wCurrentRoofStartPoly;
break;
case MESHID_WALL:
l_pwCurrStartIndex = &CApp::m_wCurrentWallStartPoly;
break;
}
//
// Add new data to texture list...
//
l_pTextureList->Insert(l_iTextureArrayNr, p_iStartVertex, p_iNumFaces, l_pwCurrStartIndex);
This works fine, this is not the problem. The problem is to remove dungeon squares and rebuild texture lists. I can´t figure out how to solve this problem.
When the user use the eraser tool to remove squares inside a selection rectangle I remove those squares from a vector list, but then I must update my texture list also. The texture list holds information about how many faces to render with a texture and a offsetvalue into that vertexbuffer.
I dont know... Maybe it´s better to have a big offset vector with integer numbers that represent every face connected to a texture and use DrawPrimitveIndexed?
Zeblar Nagrim, Lord of Chaos