ltGraph::~ltGraph() { vsDelete( m_curveName ); vsDelete( m_equationText ); vsDelete( m_font ); vsDelete( m_material ); }
vsScene::~vsScene() { vsDelete( m_queue ); vsDelete( m_defaultCamera3D ); vsDelete( m_defaultCamera ); vsDelete( m_entityList ); }
vsRenderTarget::~vsRenderTarget() { for ( int i = 0; i < m_bufferCount; i++ ) { vsDelete( m_texture[i] ); } vsDeleteArray( m_texture ); vsDelete( m_textureSurface ); vsDelete( m_renderBufferSurface ); }
void ctMode3D::Deinit() { vsSystem::GetScreen()->GetScene(0)->SetCamera3D(NULL); vsDelete( m_player ); vsDelete( m_stage ); vsDelete( m_camera ); Parent::Deinit(); }
void rpModeCredits::Deinit() { vsDelete(m_credits); for ( int i = 0; i < MAX_CREDIT_LINES; i++ ) { if ( m_line[i] ) vsDelete(m_line[i]); } }
sstFireworks::~sstFireworks() { vsDeleteArray( m_vertexArray ); vsDeleteArray( m_colorArray ); vsDeleteArray( m_indexArray ); vsDelete( m_vertexBuffer ); vsDelete( m_colorBuffer ); vsDelete( m_indexBuffer ); vsDelete( m_usedList ); vsDelete( m_unusedList ); vsDeleteArray( m_particle ); m_particle = NULL; }
vsCollisionObject::~vsCollisionObject() { SetCollisionsActive(false); for ( int i = 0; i < m_circleCount; i++ ) { vsDelete( m_circleDef[i].shape ); } for ( int i = 0; i < m_boxCount; i++ ) { vsDelete( m_boxDef[i].shape ); } }
void daModeTitleScreen::Deinit() { m_title->Extract(); m_menu->Extract(); m_transitioningIn = false; m_transitioningOut = false; vsDelete( m_menuThump ); vsDelete( m_background ); vsDelete( m_title ); vsDelete( m_menu ); }
void vsDynamicMaterial::SetTexture( int i, vsTexture *texture, bool linear ) { vsAssert(i >= 0 && i < MAX_TEXTURE_SLOTS, "Out of range texture requested"); vsDelete(GetResource()->m_texture[i]); if ( texture ) { GetResource()->m_texture[i] = new vsTexture(texture); if ( !linear ) GetResource()->m_texture[i]->GetResource()->SetNearestSampling(); } else { vsDelete( GetResource()->m_texture[i] ); } }
vsMeshMaker::~vsMeshMaker() { //vsDeleteArray( m_cell ); vsDelete( m_octree ); vsDeleteArray( m_vertex ); for ( int i = 0; i < MAX_MESH_MAKER_MATERIALS; i++ ) { m_internalData->m_materialTriangle[i].clear(); //vsDeleteArray( m_internalData->m_materialTriangle[i] ); } for ( int i = 0; i < m_internalData->m_materialCount; i++ ) { vsDelete( m_internalData->m_material[i] ); } vsDelete( m_internalData ); }
vsRenderQueueStage::~vsRenderQueueStage() { vsDelete( m_batchMap ); while( m_batchPool ) { Batch *b = m_batchPool; m_batchPool = m_batchPool->next; vsDelete(b); } while( m_batchElementPool ) { BatchElement *e = m_batchElementPool; m_batchElementPool = m_batchElementPool->next; vsDelete(e); } }
vpDrawable::~vpDrawable() { for ( int i = 0; i < m_objectCount; i++ ) vsDelete(m_object[i]); vsDeleteArray(m_object); //vsDelete(m_shader); }
vsPerlin::~vsPerlin() { for ( int i = 0; i < m_octaveCount; i++ ) { vsDelete(m_octave[i]); } vsDeleteArray(m_octave); }
void vsDisplayList::Write_CVec( const vsString &filename ) { vsFile *file = new vsFile(filename + vsString(".cvec"), vsFile::MODE_Write); file->Store(m_fifo); vsDelete( file ); }
void vsDynamicMaterial::SetShader( const vsString &vShader, const vsString &fShader ) { bool hasTextures = GetResource()->HasAnyTextures(); if ( GetResource()->m_shaderIsMine ) { vsDelete( GetResource()->m_shader ); } GetResource()->m_shader = vsShader::Load(vShader, fShader, GetResource()->m_drawMode == DrawMode_Lit, hasTextures); GetResource()->m_shaderIsMine = true; SetupParameters(); }
void ltGraph::SetCurveName( const vsString &curveName ) { vsDelete(m_curveName) vsVector2D top = m_box.TopLeft(); top.y += 20.f; m_curveName = new vsSprite(m_font->CreateString2D(curveName, 35.f, Justification_Left)); AddChild( m_curveName ); m_curveName->SetPosition( top ); }
void ltGraph::SetEquationText( const vsString &equationText ) { vsDelete(m_equationText) vsVector2D bottom = m_box.BottomRight(); bottom.y -= 20.f; m_equationText = new vsSprite(m_font->CreateString2D(equationText, 35.f, Justification_Right)); AddChild( m_equationText ); m_equationText->SetPosition( bottom ); }
void vsDynamicMaterial::SetShader() { if ( GetResource()->m_shaderIsMine ) { vsDelete( GetResource()->m_shader ); } else GetResource()->m_shader = NULL; GetResource()->SetShader(); SetupParameters(); }
vsRenderPipelineStageBloom::~vsRenderPipelineStageBloom() { vsDelete( m_hipassMaterial ); for ( int i = 0; i < m_passCount; i++ ) { vsDelete( m_passes[i].m_horizontalBlurMaterial ); vsDelete( m_passes[i].m_verticalBlurMaterial ); vsDelete( m_passes[i].m_combinePassMaterial ); } vsDeleteArray( m_passes ); vsDelete( m_fromMaterial ); vsDelete( m_vertices ); vsDelete( m_indices ); vsDelete( m_bloomBlurShader ); }
void vsMeshMaker::Clear() { vsDeleteArray( m_vertex ); m_triangleCount = 0; for ( int i = 0; i < m_internalData->m_materialCount; i++ ) { vsDelete( m_internalData->m_material[i] ); } m_internalData->m_materialCount = 0; for ( int i = 0; i < MAX_MESH_MAKER_MATERIALS; i++ ) { m_internalData->m_materialTriangle[i].clear(); } }
vsDisplayList::~vsDisplayList() { vsAssert( m_instanceCount == 0, "Deleted a display list while something was still referencing it!" ); for ( int i = 0; i < m_materialCount; i++ ) { vsDelete( m_material[i] ); } if ( m_fifo ) { delete m_fifo; m_fifo = NULL; } else if ( m_instanceParent ) { m_instanceParent->m_instanceCount--; } }
void rpModeCredits::LoadLine( int i ) { vsString creditString; m_creditsDone = !m_credits->ReadLine(&creditString); m_lineUsed[i] = false; if ( m_line[i] ) vsDelete(m_line[i]); if ( !m_creditsDone ) { if ( creditString[0] == '-' ) m_line[i] = new vsSprite( vsBuiltInFont::CreateString(creditString, 35.0f, 60.0f, Justification_Center) ); else m_line[i] = new vsSprite( vsBuiltInFont::CreateString(creditString, 15.0f, 20.0f, Justification_Center) ); m_line[i]->SetColor( vsColor(vsColor::LightBlue) ); m_line[i]->SetPosition( vsVector2D(0.f, -700.f) ); m_line[i]->RegisterOnScene(1); m_lineUsed[i] = true; m_lineId[i] = m_lineCount++; } }
void vsLocalisationTable::Deinit() { vsDelete( s_localisationTable ); }
vsRenderQueue::~vsRenderQueue() { vsDeleteArray( m_stage ); vsDelete( m_genericList ); }
rpFader::~rpFader() { vsDelete( m_material ); }
vsMesh * vsMeshMaker::Bake() { vsDelete( m_octree ); //for ( int i = 0; i < m_cellCount; i++ ) //{ //m_cell[i].m_vertexIndex.clear(); //} m_cellBounds.Clear(); for ( int matId = 0; matId < m_internalData->m_materialCount; matId++ ) { std::vector<vsMeshMakerTriangle> *triangleList = &m_internalData->m_materialTriangle[matId]; //int triangleCount = m_internalData->m_materialTriangle[matId].size(); std::vector<vsMeshMakerTriangle>::iterator iter; for ( iter = triangleList->begin(); iter != triangleList->end(); iter++ ) { vsMeshMakerTriangle *triangle = &*iter; m_cellBounds.ExpandToInclude( triangle->m_vertex[0].GetPosition() ); m_cellBounds.ExpandToInclude( triangle->m_vertex[1].GetPosition() ); m_cellBounds.ExpandToInclude( triangle->m_vertex[2].GetPosition() ); } } m_cellBounds.Expand( 20.0f ); m_octree = new vsPointOctree<vsMeshMakerTriangleVertex>( m_cellBounds, 16 ); //m_cellDimX = m_cellBounds.Width() / MAKER_CELLS; //m_cellDimY = m_cellBounds.Height() / MAKER_CELLS; //m_cellDimZ = m_cellBounds.Depth() / MAKER_CELLS; // build a list of unique vertices, converting our triangles to refer to indices, instead. int maxVertexCount = m_triangleCount * 3; m_vertexCount = 0; m_vertex = new vsMeshMakerTriangleVertex[maxVertexCount]; for ( int matId = 0; matId < m_internalData->m_materialCount; matId++ ) { std::vector<vsMeshMakerTriangle> *triangleList = &m_internalData->m_materialTriangle[matId]; //int triangleCount = m_internalData->m_materialTriangle[matId].size(); std::vector<vsMeshMakerTriangle>::iterator iter; //vsLog("Baking %d triangles.", triangleList->size()); for ( iter = triangleList->begin(); iter != triangleList->end(); iter++ ) { vsMeshMakerTriangle *triangle = &*iter; triangle->m_vertex[0].m_index = BakeTriangleVertex( triangle->m_vertex[0], triangle->m_faceNormal ); m_vertex[iter->m_vertex[0].m_index].AddTriangle(triangle); triangle->m_vertex[1].m_index = BakeTriangleVertex( triangle->m_vertex[1], triangle->m_faceNormal ); m_vertex[iter->m_vertex[1].m_index].AddTriangle(triangle); triangle->m_vertex[2].m_index = BakeTriangleVertex( triangle->m_vertex[2], triangle->m_faceNormal ); m_vertex[iter->m_vertex[2].m_index].AddTriangle(triangle); } } //vsLog("Ended up with %d vertices.", m_vertexCount); m_internalData->m_mesh = new vsMesh(m_vertexCount, m_internalData->m_materialCount); for ( int i = 0; i < m_vertexCount; i++ ) { if ( m_vertex[i].m_flags & vsMeshMakerTriangleVertex::Flag_Position ) { m_internalData->m_mesh->SetVertex(i, m_vertex[i].GetPosition()); } if ( m_vertex[i].m_flags & vsMeshMakerTriangleVertex::Flag_Normal ) { m_internalData->m_mesh->SetNormal(i, m_vertex[i].GetNormal()); } if ( m_vertex[i].m_flags & vsMeshMakerTriangleVertex::Flag_Color ) { m_internalData->m_mesh->SetColor(i, m_vertex[i].GetColor()); } if ( m_vertex[i].m_flags & vsMeshMakerTriangleVertex::Flag_Texel ) { m_internalData->m_mesh->SetTexel(i, m_vertex[i].GetTexel()); } } // 2 - for each material, build triangle strips using their indices. for ( int matId = 0; matId < m_internalData->m_materialCount; matId++ ) { BuildTriangleStripsForMaterial( matId ); } // 3 - using all of the above data, build a vsMesh containing the vertices, materials, and triangle strips. m_internalData->m_mesh->Bake(); vsMesh *result = m_internalData->m_mesh; m_internalData->m_mesh = NULL; return result; }