x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
daeArray.cpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\DarkPuzzle\libs\bullet_sdk\Extras\COLLADA_DOM\src\dae\daeArray.cpp
旋转
特效
属性
历史版本
/* * 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
网页地址
文件地址
上一页
3/24
下一页
下载
( 2 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.