Ejemplo n.º 1
0
void FreeMeshChunk( MeshChunk* chunk )
{
    for(int i = 0; i < chunk->materialCount; i++)
        ReleaseMesh(chunk->materialMeshes[i]);
    delete[] chunk->materialMeshes;
    delete[] chunk->materialIds;
    delete chunk;
}
Ejemplo n.º 2
0
void Unload() {
 /* Reset gl states */
 glDisable(GL_DEPTH_TEST);
 
 ReleaseShader(&g_Shader);
 for (int i = 0; i < 2; ++i) {
  ReleaseMesh(&g_Mesh[i]);
 }
}
osg::Node *VsMeshMgr::LoadMesh(std::string strFilename)
{
	std::pair<std::string, osg::ref_ptr<osg::Node>> MeshPair;
	
	//If not found then load it.
	if(!FindMesh(strFilename, MeshPair, false))
		return AddMesh(strFilename);
	else
	{
		std::string strCreateDate = FileCreateTime(strFilename);

		//If the create dates match then use this one.
		//If they do not then lets reload it.
		if(strCreateDate == MeshPair.first)
			return MeshPair.second.get();
		else
		{
			ReleaseMesh(strFilename);
			return AddMesh(strFilename);
		}
	}
}
Ejemplo n.º 4
0
// 解放
void CPlayer::Fin(void)
{
	SetMesh(NULL);
	ReleaseMesh(&m_mesh);
}