本文整理汇总了C++中Align函数的典型用法代码示例。如果您正苦于以下问题:C++ Align函数的具体用法?C++ Align怎么用?C++ Align使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Align函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Rotate
void moQuaternion<Real>::DecomposeTwistTimesSwing (
const moVector3<Real>& rkV1, moQuaternion& rkTwist, moQuaternion& rkSwing)
{
moVector3<Real> kV2 = Rotate(rkV1);
rkSwing = Align(rkV1,kV2);
rkTwist = (*this)*rkSwing.Conjugate();
}
示例2: PadByteStream
void PadByteStream(TArray<uint8>& CompressedByteStream, const int32 Alignment, uint8 sentinel)
{
int32 Pad = Align( CompressedByteStream.Num(), 4 ) - CompressedByteStream.Num();
for ( int32 i = 0 ; i < Pad ; ++i )
{
CompressedByteStream.Add(sentinel);
}
}
示例3: Align
void UTexAligner::Align( UWorld* InWorld, ETexAlign InTexAlignType )
{
for( int32 LevelIndex = 0; LevelIndex < InWorld->GetNumLevels(); ++LevelIndex )
{
ULevel* Level = InWorld->GetLevel(LevelIndex);
Align( InWorld, InTexAlignType, Level->Model );
}
}
示例4: Align
void SeeDif::InsertDialog(Interactor* dialog)
{
World *world=GetWorld();
Coord x,y;
Align(Center, 0, 0, x , y);
world->InsertTransient(dialog, this, x, y, Center);
}
示例5: m_alignedPerDrawConstantBufferSize
DynamicConstantBuffer::DynamicConstantBuffer(UINT constantSize, UINT maxDrawsPerFrame, UINT frameCount) :
m_alignedPerDrawConstantBufferSize(Align(constantSize)), // Constant buffers must be aligned for hardware requirements.
m_maxDrawsPerFrame(maxDrawsPerFrame),
m_frameCount(frameCount),
m_constantBuffer(nullptr)
{
m_perFrameConstantBufferSize = m_alignedPerDrawConstantBufferSize * m_maxDrawsPerFrame;
}
示例6: Compact
/**
* Compact the list down to the smallest block size boundary.
*/
FORCEINLINE void Compact()
{
uint capacity = Align(this->items, S);
if (capacity >= this->capacity) return;
this->capacity = capacity;
this->data = ReallocT(this->data, this->capacity);
}
示例7: CROSSNET_ASSERT
// As you can see, we can free a single block of memory at any time without being inside a GC
void GCAllocator::Free(void * ptr, int size)
{
CROSSNET_ASSERT(IsAligned(ptr), "");
AllocStructure * freedPtr = static_cast<AllocStructure *>(ptr);
int alignedSize = Align(size);
InternalFree(freedPtr, alignedSize);
}
示例8:
namespace D3D12RHI
{
/** Sizes of constant buffers defined in ED3D11ShaderOffsetBuffer. */
const uint32 GConstantBufferSizes[MAX_CONSTANT_BUFFER_SLOTS] =
{
// CBs must be a multiple of 16
(uint32)Align(MAX_GLOBAL_CONSTANT_BUFFER_SIZE, 16),
};
}
示例9: s3c_mfc_get_data_buf_phys_addr
unsigned int s3c_mfc_get_data_buf_phys_addr()
{
unsigned int phys_addr;
s3c_mfc_phys_data_buf = s3c_mfc_get_risc_buf_phys_addr(MFC_MAX_INSTANCE_NUM);
phys_addr = Align(s3c_mfc_phys_data_buf, 4*BUF_L_UNIT);
return phys_addr;
}
示例10: DefineGlobal
void DefineGlobal(Symbol p)
{
Align(p);
if (p->sclass != TK_STATIC)
{
Export(p);
}
Print("%s:\t", GetAccessName(p));
}
示例11: GetWorld
void Sted::InsertDialog (Interactor* dialog) {
World* world = GetWorld();
Coord x, y;
Align(Center, 0, 0, x, y);
GetRelative(x, y, world);
world->InsertTransient(dialog, this, x, y, Center);
}
示例12: tag
bool TextStyleData::readProperties(XmlReader& e)
{
const QStringRef& tag(e.name());
if (tag == "name")
name = e.readElementText();
else if (tag == "family")
family = e.readElementText();
else if (tag == "size")
size = e.readDouble();
else if (tag == "bold")
bold = e.readInt();
else if (tag == "italic")
italic = e.readInt();
else if (tag == "underline")
underline = e.readInt();
else if (tag == "align")
setAlign(Align(e.readInt()));
else if (tag == "anchor") // obsolete
e.skipCurrentElement();
else if (ElementLayout::readProperties(e))
;
else if (tag == "sizeIsSpatiumDependent" || tag == "spatiumSizeDependent")
sizeIsSpatiumDependent = e.readInt();
else if (tag == "frameWidth") { // obsolete
hasFrame = true;
frameWidthMM = e.readDouble();
}
else if (tag == "frameWidthS") {
hasFrame = true;
frameWidth = Spatium(e.readDouble());
}
else if (tag == "frame")
hasFrame = e.readInt();
else if (tag == "square")
_square = e.readInt();
else if (tag == "paddingWidth") // obsolete
paddingWidthMM = e.readDouble();
else if (tag == "paddingWidthS")
paddingWidth = Spatium(e.readDouble());
else if (tag == "frameRound")
frameRound = e.readInt();
else if (tag == "frameColor")
frameColor = e.readColor();
else if (tag == "foregroundColor")
foregroundColor = e.readColor();
else if (tag == "backgroundColor")
backgroundColor = e.readColor();
else if (tag == "circle")
circle = e.readInt();
else if (tag == "systemFlag")
systemFlag = e.readInt();
else
return false;
return true;
}
示例13: Align
void LibFiles::WriteFiles(FILE *stream, ObjInt align)
{
int i =0;
for (FileIterator it = FileBegin(); it != FileEnd(); ++it)
{
Align(stream, align);
(*it)->offset = ftell(stream);
WriteData(stream, (*it)->data, (*it)->name);
}
}
示例14: DefineFloatConstant
void DefineFloatConstant(Symbol p)
{
int align = p->ty->align;
p->aname = FormatName(".flt%d", FloatNum++);
Align(p);
Print("%s:\t", p->aname);
DefineValue(p->ty, p->val);
}
示例15: guard
// This method will grow array's MaxCount. No items will be allocated.
// The allocated memory is not initialized because items could be inserted
// and removed at any time - so initialization should be performed in
// upper level functions like Insert()
void FArray::GrowArray(int count, int elementSize)
{
guard(FArray::GrowArray);
assert(count > 0);
int prevCount = MaxCount;
// check for available space
int newCount = DataCount + count;
if (newCount > MaxCount)
{
// Not enough space, resize ...
// Allow small initial size of array
const int minCount = 4;
if (newCount > minCount)
{
MaxCount = Align(DataCount + count, 16) + 16;
}
else
{
MaxCount = minCount;
}
// Align memory block to reduce fragmentation
int dataSize = Align(MaxCount * elementSize, 16);
// Recompute MaxCount in a case if alignment increases its capacity
MaxCount = dataSize / elementSize;
// Reallocate memory
if (!IsStatic())
{
DataPtr = appRealloc(DataPtr, dataSize);
}
else
{
// "static" array becomes non-static
void* oldData = DataPtr; // this is a static pointer
DataPtr = appMalloc(dataSize);
memcpy(DataPtr, oldData, prevCount * elementSize);
}
}
unguardf("%d x %d", count, elementSize);
}