當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。