Example #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;
}
Example #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);
		}
	}
}
Example #4
0
// 解放
void CPlayer::Fin(void)
{
	SetMesh(NULL);
	ReleaseMesh(&m_mesh);
}