x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
daeArray.cpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\DarkPuzzle\libs\bullet_sdk\Extras\COLLADA_DOM\src\dae\daeArray.cpp
Girar
Efecto
Propiedad
Historial
/* * Copyright 2006 Sony Computer Entertainment Inc. * * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at: * http://research.scea.com/scea_shared_source_license.html * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing permissions and limitations under the * License. */ #include
#include
daeArray::daeArray():_count(0),_capacity(0),_data(NULL),_elementSize(4),_type(NULL) { } daeArray::~daeArray() { clear(); } void daeArray::clear() { if (_data) { daeMemorySystem::free("array",_data); _capacity = 0; _data = NULL; _count = 0; } } daeInt daeArray::removeIndex(size_t index) { if ((index >= _count)||(_count < 1)||(_data == NULL)) return(DAE_ERR_INVALID_CALL); if (_count-1-index) memmove(_data+index*_elementSize, _data+(index+1)*_elementSize, _elementSize*(_count-1-index)); memset(_data+(_count-1)*_elementSize,0,_elementSize); _count--; return(DAE_OK); } void daeArray::grow(size_t sz) { if (sz < _capacity) return; size_t newSize = 4*_elementSize; size_t neccesarySize = (sz+1)*_elementSize; while(newSize < neccesarySize) { if (newSize < 16384) newSize *= 2; else newSize += 16384; } size_t newCapacity = newSize/_elementSize; daeChar* newData = (daeChar*)daeMemorySystem::malloc("array", newCapacity*_elementSize); if (_data != NULL) memcpy(newData,_data,_capacity*_elementSize); //else // memset(newData,0,_capacity*_elementSize); memset(newData+_capacity*_elementSize,0, (newCapacity-_capacity)*_elementSize); if (_data != NULL) daeMemorySystem::free("array",_data); _data = newData; _capacity = newCapacity; }
daeArray.cpp
Dirección de la página
Dirección del archivo
Anterior
3/24
Siguiente
Descargar
( 2 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.