当前位置: 首页>>代码示例>>C++>>正文


C++ Align函数代码示例

本文整理汇总了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();
}
开发者ID:inaes-tic,项目名称:tv-libmoldeo,代码行数:7,代码来源:moMathQuaternion.cpp

示例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);
	}
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:8,代码来源:AnimCompress.cpp

示例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 );
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:8,代码来源:TexAlignTools.cpp

示例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);
}
开发者ID:JohnDMcMaster,项目名称:ocean,代码行数:8,代码来源:SeeDif.c

示例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;
}
开发者ID:fdyjfd,项目名称:DirectX-Graphics-Samples,代码行数:8,代码来源:DynamicConstantBuffer.cpp

示例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);
	}
开发者ID:dolly22,项目名称:openttd-sai,代码行数:11,代码来源:smallvec_type.hpp

示例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);
}
开发者ID:KonajuGames,项目名称:CrossNet,代码行数:9,代码来源:GCAllocator.cpp

示例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),
	};
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:9,代码来源:D3D12ConstantBuffer.cpp

示例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;
}
开发者ID:rubensollie,项目名称:Eclair-Kernel,代码行数:9,代码来源:s3c_mfc_memory.c

示例10: DefineGlobal

void DefineGlobal(Symbol p)
{
	Align(p);
	if (p->sclass != TK_STATIC)
	{
		Export(p);
	}
	Print("%s:\t", GetAccessName(p));
}
开发者ID:descent,项目名称:ucc-code,代码行数:9,代码来源:x86linux.c

示例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);
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:9,代码来源:Sted.c

示例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;
      }
开发者ID:AntonioBL,项目名称:MuseScore,代码行数:56,代码来源:textstyle.cpp

示例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);
    }
}
开发者ID:doniexun,项目名称:OrangeC,代码行数:10,代码来源:LibFilesLibrarian.cpp

示例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);
}
开发者ID:descent,项目名称:ucc-code,代码行数:10,代码来源:x86linux.c

示例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);
}
开发者ID:gildor2,项目名称:UModel,代码行数:46,代码来源:UnCore.cpp


注:本文中的Align函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。