本文整理汇总了C++中dMemcpy函数的典型用法代码示例。如果您正苦于以下问题:C++ dMemcpy函数的具体用法?C++ dMemcpy怎么用?C++ dMemcpy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dMemcpy函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GameBaseData
DebrisData::DebrisData(const DebrisData& other, bool temp_clone) : GameBaseData(other, temp_clone)
{
#ifdef TRACK_DEBRIS_DATA_CLONES
debris_data_clones++;
if (debris_data_clones == 1)
Con::errorf("DebrisData -- Clones are on the loose!");
#endif
velocity = other.velocity;
velocityVariance = other.velocityVariance;
friction = other.friction;
elasticity = other.elasticity;
lifetime = other.lifetime;
lifetimeVariance = other.lifetimeVariance;
numBounces = other.numBounces;
bounceVariance = other.bounceVariance;
minSpinSpeed = other.minSpinSpeed;
maxSpinSpeed = other.maxSpinSpeed;
explodeOnMaxBounce = other.explodeOnMaxBounce;
staticOnMaxBounce = other.staticOnMaxBounce;
snapOnMaxBounce = other.snapOnMaxBounce;
fade = other.fade;
useRadiusMass = other.useRadiusMass;
baseRadius = other.baseRadius;
gravModifier = other.gravModifier;
terminalVelocity = other.terminalVelocity;
ignoreWater = other.ignoreWater;
shapeName = other.shapeName;
shape = other.shape; // -- TSShape loaded using shapeName
textureName = other.textureName;
explosionId = other.explosionId; // -- for pack/unpack of explosion ptr
explosion = other.explosion;
dMemcpy( emitterList, other.emitterList, sizeof( emitterList ) );
dMemcpy( emitterIDList, other.emitterIDList, sizeof( emitterIDList ) ); // -- for pack/unpack of emitterList ptrs
}
开发者ID:wwhitehead,项目名称:Torque3D-plus-AFX,代码行数:34,代码来源:debris.cpp
示例2: getMin
void TheoraTexture::FrameReadItem::execute()
{
// Read Theora frame data.
OggTheoraFrame* frame;
if( mFrameStream->getSourceStream()->read( &frame, 1 ) != 1 )
return;
// Copy the data into the texture.
OggTheoraDecoder* decoder = mAsyncState->getTheora();
const U32 height = decoder->getFrameHeight();
const U32 framePitch = decoder->getFrameWidth() * 4;
GFXLockedRect* rect = mFrame->mLockedRect;
if( rect )
{
const U32 usePitch = getMin(framePitch, mFrame->mTexture->getWidth() * 4);
const U32 maxHeight = getMin(height, mFrame->mTexture->getHeight());
if( (framePitch == rect->pitch) && (height == maxHeight) )
dMemcpy( rect->bits, frame->data, rect->pitch * height );
else
{
// Scanline length does not match. Copy line by line.
U8* dst = rect->bits;
U8* src = ( U8* ) frame->data;
// Center the video if it is too big for the texture mode
if ( height > maxHeight )
src += framePitch * ((height - maxHeight) / 2);
if ( framePitch > usePitch )
src += (framePitch - usePitch) / 2;
for( U32 i = 0; i < maxHeight; ++ i )
{
dMemcpy( dst, src, usePitch );
dst += rect->pitch;
src += framePitch;
}
}
}
#ifdef TORQUE_DEBUG
else
Platform::outputDebugString( "[TheoraTexture] texture not locked on frame %i", frame->mFrameNumber );
#endif
// Copy frame metrics.
mFrame->mFrameNumber = frame->mFrameNumber;
mFrame->mFrameTime = frame->mFrameTime;
mFrame->mFrameDuration = frame->mFrameDuration;
// Yield the frame packet back to the Theora decoder.
decoder->reusePacket( frame );
// Buffer the frame.
mFrameStream->_onArrival( mFrame );
}
开发者ID:03050903,项目名称:Torque3D,代码行数:60,代码来源:theoraTexture.cpp
示例3: dFSRotationCreate
/** Set rotation for certain nodes in a function space
*
* @param fs the function space
* @param is index set of nodes to rotate, sequential, with respect blocks of local vector
* @param rot Rotation matrices at all nodes in \a is. Should have length \c bs*bs*size(is).
* @param ns number of dofs to enforce strongly at each node (every entry must have 0<=ns[i]<=bs)
* @param v Vector of values for strongly enforced dofs
*
* @example Consider 2D flow over a bed with known melt rates. Suppose the local velocity vector is
*
* [u0x,u0y; u1x,u1y; u2x,u2y; u3x,u3y | u4x,u4y]
*
* (4 owned blocks, one ghosted block) and nodes 1,4 are on the slip boundary with normal and tangent vectors n1,t1,n4,t4
* and melt rates r1,r4. To enforce the melt rate strongly, use
*
* \a is = [1,4]
* \a rot = [n10,n11,t10,t11, n40,n41,t40,t41]
* \a ns = [1,1]
* \a v = [r1,r4]
*
* The rotated vector will become (. = \cdot)
*
* [u0x,u0y; u1.n1,u1.t1; u2x,u2y; u3x,u3y | u4.n4,u4.t4]
*
* and strongly enforcing melt rate produces the global vector
*
* [u0x,u0y; r1,u1.t1; u2x,u2y; u3x,u3y | r4,u4.t4] .
*
* This is what the solver sees, the Jacobian will always have rows and columns of the identity corresponding to the
* strongly enforced components (2,8 of the local vector) and the residual will always be 0 in these components. Hence
* the Newton step v will always be of the form
*
* [v0x,v0y; 0,v1y; v2x,v2y; v3x,v3y | 0,v4y] .
**/
dErr dFSRotationCreate(dFS fs,IS is,dReal rmat[],dInt ns[],Vec v,dFSRotation *inrot)
{
dFSRotation rot;
dInt bs,n;
dErr err;
dFunctionBegin;
dValidHeader(fs,DM_CLASSID,1);
dValidHeader(is,IS_CLASSID,2);
dValidRealPointer(rmat,3);
dValidIntPointer(ns,4);
dValidHeader(v,VEC_CLASSID,5);
dValidPointer(inrot,6);
*inrot = 0;
err = PetscHeaderCreate(rot,_p_dFSRotation,struct _dFSRotationOps,dFSROT_CLASSID,"dFSRotation","Local function space rotation","FS",PETSC_COMM_SELF,dFSRotationDestroy,dFSRotationView);dCHK(err);
err = dFSGetBlockSize(fs,&bs);dCHK(err);
rot->bs = bs;
err = ISGetSize(is,&n);dCHK(err);
rot->n = n;
err = PetscObjectReference((PetscObject)is);dCHK(err);
rot->is = is;
err = PetscObjectReference((PetscObject)v);dCHK(err);
rot->strong = v;
for (dInt i=0; i<n; i++) {
if (ns[i] < 0 || bs < ns[i]) dERROR(PETSC_COMM_SELF,1,"Number of strong dofs must be between 0 and bs=%d (inclusive)",bs);
/* \todo Check that every rmat is orthogonal */
}
err = dMallocA2(n*bs*bs,&rot->rmat,n,&rot->nstrong);dCHK(err);
err = dMemcpy(rot->rmat,rmat,n*bs*bs*sizeof rmat[0]);dCHK(err);
err = dMemcpy(rot->nstrong,ns,n*sizeof ns[0]);dCHK(err);
*inrot = rot;
dFunctionReturn(0);
}
开发者ID:jedbrown,项目名称:dohp,代码行数:68,代码来源:fsrot.c
示例4: Parent
//**************************************************************************
// General operation
//**************************************************************************
GenOp::GenOp( const char * statement, ... ) : Parent( NULL, NULL )
{
VECTOR_SET_ASSOCIATION( mElemList );
va_list args;
va_start(args, statement);
char* lastEntry = (char*)statement;
while( 1 )
{
// search 'statement' for @ symbol
char * str = dStrstr( lastEntry, (char *)"@" );
if( !str )
{
// not found, handle end of line
str = (char*)&statement[ dStrlen( (char*)statement ) ];
U64 diff = str - lastEntry + 1;
if( diff == 1 ) break;
char * newStr = new char[diff];
dMemcpy( (void*)newStr, lastEntry, diff );
mElemList.push_back( new EchoOp( newStr ) );
break;
}
// create and store statement fragment
U64 diff = str - lastEntry + 1;
if( diff == 1 )
{
// store langElement
LangElement *elem = va_arg(args, LangElement* );
AssertFatal( elem, "NULL arguement." );
mElemList.push_back( elem );
lastEntry++;
continue;
}
char * newStr = new char[diff];
dMemcpy( (void*)newStr, lastEntry, diff );
newStr[diff-1] = '\0';
lastEntry = str + 1;
mElemList.push_back( new EchoOp( newStr ) );
// store langElement
LangElement *elem = va_arg(args, LangElement* );
AssertFatal( elem, "NULL argument." );
mElemList.push_back( elem );
}
开发者ID:Dwarf-King,项目名称:OmniEngine.Net,代码行数:61,代码来源:shaderOp.cpp
示例5: PROFILE_SCOPE
bool GFXD3D9ShaderBufferLayout::setMatrix(const ParamDesc& pd, const GFXShaderConstType constType, const U32 size, const void* data, U8* basePointer)
{
PROFILE_SCOPE(GFXD3D9ShaderBufferLayout_setMatrix);
if (pd.constType == GFXSCT_Float4x4)
{
// Special case, we can just blast this guy.
AssertFatal(pd.size >= size, "Not enough room in the buffer for this data!");
if (dMemcmp(basePointer+pd.offset, data, size) != 0)
{
dMemcpy(basePointer+pd.offset, data, size);
return true;
}
return false;
}
else
{
PROFILE_SCOPE(GFXD3D9ShaderBufferLayout_setMatrix_not4x4);
// Figure out how big of a chunk we are copying. We're going to copy 4 columns by N rows of data
U32 csize;
switch (pd.constType)
{
case GFXSCT_Float2x2 :
csize = 32;
break;
case GFXSCT_Float3x3 :
csize = 48;
break;
default:
AssertFatal(false, "Unhandled case!");
return false;
break;
}
// Loop through and copy
bool ret = false;
U8* currDestPointer = basePointer+pd.offset;
const U8* currSourcePointer = static_cast<const U8*>(data);
const U8* endData = currSourcePointer + size;
while (currSourcePointer < endData)
{
if (dMemcmp(currDestPointer, currSourcePointer, csize) != 0)
{
dMemcpy(currDestPointer, currSourcePointer, csize);
ret = true;
}
currDestPointer += csize;
currSourcePointer += sizeof(MatrixF);
}
return ret;
}
}
开发者ID:Adrellias,项目名称:Torque3D-DaveWork,代码行数:56,代码来源:gfxD3D9Shader.cpp
示例6: switch
//-----------------------------------------------------------------------------
// This function should ONLY be called from GFXDevice::updateStates() !!!
//-----------------------------------------------------------------------------
void GFXD3D9Device::setLightInternal(U32 lightStage, const GFXLightInfo light, bool lightEnable)
{
#ifndef TORQUE_OS_XENON
if(!lightEnable)
{
mD3DDevice->LightEnable(lightStage, false);
return;
}
D3DLIGHT9 d3dLight;
switch (light.mType)
{
case GFXLightInfo::Ambient:
AssertFatal(false, "Instead of setting an ambient light you should set the global ambient color.");
return;
case GFXLightInfo::Vector:
d3dLight.Type = D3DLIGHT_DIRECTIONAL;
break;
case GFXLightInfo::Point:
d3dLight.Type = D3DLIGHT_POINT;
break;
case GFXLightInfo::Spot:
d3dLight.Type = D3DLIGHT_SPOT;
break;
default :
AssertFatal(false, "Unknown light type!");
};
dMemcpy(&d3dLight.Diffuse, &light.mColor, sizeof(light.mColor));
dMemcpy(&d3dLight.Ambient, &light.mAmbient, sizeof(light.mAmbient));
dMemcpy(&d3dLight.Specular, &light.mColor, sizeof(light.mColor));
dMemcpy(&d3dLight.Position, &light.mPos, sizeof(light.mPos));
dMemcpy(&d3dLight.Direction, &light.mDirection, sizeof(light.mDirection));
d3dLight.Range = light.mRadius;
d3dLight.Falloff = 1.0;
d3dLight.Attenuation0 = 1.0f;
d3dLight.Attenuation1 = 0.1f;
d3dLight.Attenuation2 = 0.0f;
d3dLight.Theta = light.mInnerConeAngle;
d3dLight.Phi = light.mOuterConeAngle;
mD3DDevice->SetLight(lightStage, &d3dLight);
mD3DDevice->LightEnable(lightStage, true);
#endif
}
开发者ID:adhistac,项目名称:ee-client-2-0,代码行数:54,代码来源:gfxD3D9Device.cpp
示例7: vertexBufferCopy
void vertexBufferCopy(vertexType vtype)
{
PROFILE_SCOPE(Terrain_vbufferCopy);
// Do vertexes
if (vtype == vertexTypeFullClipMapping)
{
GVertexBufferHandle<GAtlasVert2> v(GRAPHIC, mCurVertex, GBufferTypeVolatile);
PROFILE_START(Terrain_bufferCopy_lockV);
v.lock();
PROFILE_END();
dMemcpy(&v[0], &mVertexStore[0], sizeof(GAtlasVert2) * mCurVertex);
PROFILE_START(Terrain_bufferCopy_unlockV);
v.unlock();
PROFILE_END();
GRAPHIC->setVertexBuffer(v);
}
else if (vtype == vertexTypeDLight)
{
GVertexBufferHandle<GVertexPCNTT> vPCNTT(GRAPHIC, mCurVertex, GBufferTypeVolatile);
PROFILE_START(Terrain_bufferCopy_lockVPCNTT);
vPCNTT.lock();
PROFILE_END();
dMemcpy(&vPCNTT[0], &mVertexStorePCNTT[0], sizeof(GVertexPCNTT) * mCurVertex);
PROFILE_START(Terrain_bufferCopy_unlockVPCNTT);
vPCNTT.unlock();
PROFILE_END();
GRAPHIC->setVertexBuffer(vPCNTT);
}
else
{
GVertexBufferHandle<GVertexPCNT> vPCNT(GRAPHIC, mCurVertex, GBufferTypeVolatile);
PROFILE_START(Terrain_bufferCopy_lockVPCNT);
vPCNT.lock();
PROFILE_END();
dMemcpy(&vPCNT[0], &mVertexStorePCNT[0], sizeof(GVertexPCNT) * mCurVertex);
PROFILE_START(Terrain_bufferCopy_unlockVPCNT);
vPCNT.unlock();
PROFILE_END();
GRAPHIC->setVertexBuffer(vPCNT);
}
}
开发者ID:dodong471520,项目名称:pap,代码行数:48,代码来源:terrBatch.cpp
示例8: dMemcpy
void LightFlareData::_makePrimBuffer( GFXPrimitiveBufferHandle *pb, U32 count )
{
// create index buffer based on that size
U32 indexListSize = count * 6; // 6 indices per particle
U16 *indices = new U16[ indexListSize ];
for ( U32 i = 0; i < count; i++ )
{
// this index ordering should be optimal (hopefully) for the vertex cache
U16 *idx = &indices[i*6];
volatile U32 offset = i * 4; // set to volatile to fix VC6 Release mode compiler bug
idx[0] = 0 + offset;
idx[1] = 1 + offset;
idx[2] = 3 + offset;
idx[3] = 1 + offset;
idx[4] = 3 + offset;
idx[5] = 2 + offset;
}
U16 *ibIndices;
GFXBufferType bufferType = GFXBufferTypeStatic;
#ifdef TORQUE_OS_XENON
// Because of the way the volatile buffers work on Xenon this is the only
// way to do this.
bufferType = GFXBufferTypeVolatile;
#endif
pb->set( GFX, indexListSize, 0, bufferType );
pb->lock( &ibIndices );
dMemcpy( ibIndices, indices, indexListSize * sizeof(U16) );
pb->unlock();
delete [] indices;
}
开发者ID:AlkexGas,项目名称:Torque3D,代码行数:34,代码来源:lightFlareData.cpp
示例9: while
U32 MemFile::write(const void* src, U32 size)
{
if ((mStatus != Open && mStatus != EndOfFile) || !size)
return 0;
if (mFileData->mFileSize + size > mFileData->mBufferSize)
{
// Keep doubling our buffer size until we're big enough.
while (mFileData->mFileSize + size > mFileData->mBufferSize)
mFileData->mBufferSize *= 2;
mFileData->mBuffer = dRealloc(mFileData->mBuffer, mFileData->mBufferSize);
if (!mFileData->mBuffer)
{
mStatus = FileSystemFull;
return 0;
}
}
dMemcpy((U8*)mFileData->mBuffer + mCurrentPos, src, size);
mCurrentPos += size;
mFileData->mFileSize = getMax(mFileData->mFileSize, mCurrentPos);
mFileData->mLastAccess = Time::getCurrentTime();
mFileData->mModified = mFileData->mLastAccess;
return size;
}
开发者ID:Adhdcrazzy,项目名称:Torque3D,代码行数:26,代码来源:memVolume.cpp
示例10: dMemcpy
GBitmap::GBitmap(const GBitmap& rCopy)
{
mInternalFormat = rCopy.mInternalFormat;
mByteSize = rCopy.mByteSize;
mBits = new U8[mByteSize];
dMemcpy(mBits, rCopy.mBits, mByteSize);
mWidth = rCopy.mWidth;
mHeight = rCopy.mHeight;
mBytesPerPixel = rCopy.mBytesPerPixel;
mNumMipLevels = rCopy.mNumMipLevels;
dMemcpy(mMipLevelOffsets, rCopy.mMipLevelOffsets, sizeof(mMipLevelOffsets));
mHasTransparency = rCopy.mHasTransparency;
}
开发者ID:fr1tz,项目名称:alux3d,代码行数:16,代码来源:gBitmap.cpp
示例11: dMemcpy
bool NetAsync::checkLookup(NetSocket socket, char* out_h_addr,
int* out_h_length, int out_h_addr_size)
{
bool found = false;
// search for the socket
RequestIterator iter;
for (iter = mLookupRequests.begin();
iter != mLookupRequests.end();
++iter)
// if we found it and it is complete...
if (socket == iter->sock && iter->complete)
{
// copy the lookup data to the callers parameters
dMemcpy(out_h_addr, iter->out_h_addr, out_h_addr_size);
*out_h_length = iter->out_h_length;
found = true;
break;
}
// we found the socket, so we are done with it. erase.
if (found)
mLookupRequests.erase(iter);
return found;
}
开发者ID:Dwarf-King,项目名称:OmniEngine.Net,代码行数:26,代码来源:platformNetAsync.cpp
示例12: AssertFatal
void GFXD3D9ShaderConstBuffer::set(GFXShaderConstHandle* handle, const MatrixF& mat, const GFXShaderConstType matrixType)
{
AssertFatal(handle, "Handle is NULL!" );
AssertFatal(handle->isValid(), "Handle is not valid!" );
AssertFatal(dynamic_cast<const GFXD3D9ShaderConstHandle*>(handle), "Incorrect const buffer type!");
const GFXD3D9ShaderConstHandle* h = static_cast<const GFXD3D9ShaderConstHandle*>(handle);
AssertFatal(!h->isSampler(), "Handle is sampler constant!" );
AssertFatal(h->mShader == mShader, "Mismatched shaders!");
MatrixF transposed;
mat.transposeTo(transposed);
if (h->mInstancingConstant)
{
if ( matrixType == GFXSCT_Float4x4 )
dMemcpy( mInstPtr+h->mPixelHandle.offset, mat, sizeof( mat ) );
// TODO: Support 3x3 and 2x2 matricies?
return;
}
if (h->mVertexConstant)
mVertexConstBufferF->set(h->mVertexHandle, transposed, matrixType);
if (h->mPixelConstant)
mPixelConstBufferF->set(h->mPixelHandle, transposed, matrixType);
}
开发者ID:Adrellias,项目名称:Torque3D-DaveWork,代码行数:27,代码来源:gfxD3D9Shader.cpp
示例13: calcByteSize
void BitVector::_resize( U32 sizeInBits, bool copyBits )
{
if ( sizeInBits != 0 )
{
U32 newSize = calcByteSize( sizeInBits );
if ( mByteSize < newSize )
{
U8 *newBits = new U8[newSize];
if( copyBits )
dMemcpy( newBits, mBits, mByteSize );
delete [] mBits;
mBits = newBits;
mByteSize = newSize;
}
}
else
{
delete [] mBits;
mBits = NULL;
mByteSize = 0;
}
mSize = sizeInBits;
}
开发者ID:campadrenalin,项目名称:terminal-overload,代码行数:25,代码来源:bitVector.cpp
示例14: pathbuf
//--------------------------------------
bool Platform::createPath(const char *file)
{
TempAlloc< TCHAR > pathbuf( dStrlen( file ) + 1 );
#ifdef UNICODE
TempAlloc< WCHAR > fileBuf( pathbuf.size );
convertUTF8toUTF16( file, fileBuf, fileBuf.size );
const WCHAR* fileName = fileBuf;
const WCHAR* dir;
#else
const char* fileName = file;
const char* dir;
#endif
pathbuf[ 0 ] = 0;
U32 pathLen = 0;
while((dir = dStrchr(fileName, '/')) != NULL)
{
TCHAR* pathptr = pathbuf;
dMemcpy( pathptr + pathLen, fileName, ( dir - fileName ) * sizeof( TCHAR ) );
pathbuf[pathLen + dir-fileName] = 0;
// ignore return value because we are fine with already existing directory
CreateDirectory(pathbuf, NULL);
pathLen += dir - fileName;
pathbuf[pathLen++] = '\\';
fileName = dir + 1;
}
return true;
}
开发者ID:Adrellias,项目名称:Torque3D-DaveWork,代码行数:33,代码来源:winFileio.cpp
示例15: AssertFatal
void GFXGLShaderConstBuffer::set(GFXShaderConstHandle* handle, const MatrixF& mat, const GFXShaderConstType matType)
{
AssertFatal(handle, "GFXGLShaderConstBuffer::set - Handle is NULL!" );
AssertFatal(handle->isValid(), "GFXGLShaderConstBuffer::set - Handle is not valid!" );
AssertFatal(dynamic_cast<GFXGLShaderConstHandle*>(handle), "GFXGLShaderConstBuffer::set - Incorrect const buffer type");
GFXGLShaderConstHandle* _glHandle = static_cast<GFXGLShaderConstHandle*>(handle);
AssertFatal(mShader == _glHandle->mShader, "GFXGLShaderConstBuffer::set - Should only set handles which are owned by our shader");
AssertFatal(!_glHandle->mInstancingConstant || matType == GFXSCT_Float4x4, "GFXGLShaderConstBuffer::set - Only support GFXSCT_Float4x4 for instancing");
switch(matType)
{
case GFXSCT_Float2x2:
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[0] = mat[0];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[1] = mat[1];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[2] = mat[4];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[3] = mat[5];
break;
case GFXSCT_Float3x3:
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[0] = mat[0];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[1] = mat[1];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[2] = mat[2];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[3] = mat[4];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[4] = mat[5];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[5] = mat[6];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[6] = mat[8];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[7] = mat[9];
reinterpret_cast<F32*>(mBuffer + _glHandle->mOffset)[8] = mat[10];
break;
case GFXSCT_Float4x4:
{
if(_glHandle->mInstancingConstant)
{
MatrixF transposed;
mat.transposeTo(transposed);
dMemcpy( mInstPtr + _glHandle->mOffset, (const F32*)transposed, sizeof(MatrixF) );
return;
}
dMemcpy(mBuffer + _glHandle->mOffset, (const F32*)mat, sizeof(MatrixF));
break;
}
default:
AssertFatal(false, "GFXGLShaderConstBuffer::set - Invalid matrix type");
break;
}
}
开发者ID:03050903,项目名称:Torque3D,代码行数:47,代码来源:gfxGLShader.cpp
示例16: AssertFatal
void TerrainFile::setHeightMap( const Vector<U16> &heightmap, bool updateCollision )
{
AssertFatal( mHeightMap.size() == heightmap.size(), "TerrainFile::setHeightMap - Incorrect heightmap size!" );
dMemcpy( mHeightMap.address(), heightmap.address(), mHeightMap.size() );
if ( updateCollision )
_buildGridMap();
}
开发者ID:campadrenalin,项目名称:terminal-overload,代码行数:8,代码来源:terrFile.cpp
示例17: dMemcpy
void operator =(const UTF16Cache &other)
{
delete [] mString;
mLength = other.mLength;
mString = new UTF16[mLength];
dMemcpy(mString, other.mString, mLength * sizeof(UTF16));
}
开发者ID:fr1tz,项目名称:alux3d,代码行数:8,代码来源:unicode.cpp
示例18: copyToBuffer
void copyToBuffer(UTF16 *outBuffer, U32 lenToCopy, bool nullTerminate = true) const
{
U32 copy = getMin(mLength, lenToCopy);
if(mString && copy > 0)
dMemcpy(outBuffer, mString, copy * sizeof(UTF16));
if(nullTerminate)
outBuffer[copy] = 0;
}
开发者ID:fr1tz,项目名称:alux3d,代码行数:9,代码来源:unicode.cpp
示例19: execute
virtual void execute()
{
#ifndef TORQUE_OS_XENON
// do it
struct hostent* hostent = gethostbyname(mRequest.remoteAddr);
if (hostent == NULL)
{
// oh well! leave the lookup data unmodified (h_length) should
// still be -1 from initialization
mRequest.complete = true;
}
else
{
// copy the stuff we need from the hostent
dMemset(mRequest.out_h_addr, 0,
sizeof(mRequest.out_h_addr));
dMemcpy(mRequest.out_h_addr, hostent->h_addr, hostent->h_length);
mRequest.out_h_length = hostent->h_length;
mRequest.complete = true;
}
#else
XNDNS *pxndns = NULL;
HANDLE hEvent = CreateEvent(NULL, false, false, NULL);
XNetDnsLookup(mRequest.remoteAddr, hEvent, &pxndns);
while(pxndns->iStatus == WSAEINPROGRESS)
WaitForSingleObject(hEvent, INFINITE);
if(pxndns->iStatus == 0 && pxndns->cina > 0)
{
dMemset(mRequest.out_h_addr, 0, sizeof(mRequest.out_h_addr));
// This is a suspect section. I need to revisit. [2/22/2010 Pat]
dMemcpy(mRequest.out_h_addr, pxndns->aina, sizeof(IN_ADDR));
mRequest.out_h_length = sizeof(IN_ADDR);
}
mRequest.complete = true;
XNetDnsRelease(pxndns);
CloseHandle(hEvent);
#endif
}
开发者ID:Dwarf-King,项目名称:OmniEngine.Net,代码行数:44,代码来源:platformNetAsync.cpp
示例20: PROFILE_SCOPE
void PxCloth::_updateVBIB()
{
PROFILE_SCOPE( PxCloth_UpdateVBIB );
mIsVBDirty = false;
// Don't set the VB if the vertex count is the same!
if ( mVB.isNull() || mVB->mNumVerts < mNumVertices )
mVB.set( GFX, mNumVertices, GFXBufferTypeDynamic );
GFXVertexPNTT *vert = mVertexRenderBuffer;
GFXVertexPNTT *secondVert = NULL;
for ( U32 i = 0; i < mNumVertices; i++ )
{
if ( i % (U32)mPatchSize.x == 0 && i != 0 )
{
secondVert = vert;
secondVert--;
vert->tangent = -(vert->point - secondVert->point);
}
else
{
secondVert = vert;
secondVert++;
vert->tangent = vert->point - secondVert->point;
}
vert->tangent.normalize();
vert++;
}
GFXVertexPNTT *vpPtr = mVB.lock();
dMemcpy( vpPtr, mVertexRenderBuffer, sizeof( GFXVertexPNTT ) * mNumVertices );
mVB.unlock();
if ( mPrimBuffer.isNull() || mPrimBuffer->mIndexCount < mNumIndices )
mPrimBuffer.set( GFX, mNumIndices, 0, GFXBufferTypeDynamic );
U16 *pbPtr;
mPrimBuffer.lock( &pbPtr );
dMemcpy( pbPtr, mIndexRenderBuffer, sizeof( U16 ) * mNumIndices );
mPrimBuffer.unlock();
}
开发者ID:campadrenalin,项目名称:terminal-overload,代码行数:44,代码来源:pxCloth.cpp
注:本文中的dMemcpy函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论