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


C++ MAKEHASH函数代码示例

本文整理汇总了C++中MAKEHASH函数的典型用法代码示例。如果您正苦于以下问题:C++ MAKEHASH函数的具体用法?C++ MAKEHASH怎么用?C++ MAKEHASH使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了MAKEHASH函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MAKEHASH

/*virtual*/ void WBActionEldGoToLevel::InitializeFromDefinition( const SimpleString& DefinitionName )
{
	WBAction::InitializeFromDefinition( DefinitionName );

	MAKEHASH( DefinitionName );

	STATICHASH( GoToNextLevel );
	m_GoToNextLevel = ConfigManager::GetBool( sGoToNextLevel, false, sDefinitionName );

	STATICHASH( GoToPrevLevel );
	m_GoToPrevLevel = ConfigManager::GetBool( sGoToPrevLevel, false, sDefinitionName );

	STATICHASH( ReturnToHub );
	m_ReturnToHub = ConfigManager::GetBool( sReturnToHub, false, sDefinitionName );

	STATICHASH( Restart );
	m_Restart = ConfigManager::GetBool( sRestart, false, sDefinitionName );

	STATICHASH( FullRestart );
	m_FullRestart = ConfigManager::GetBool( sFullRestart, false, sDefinitionName );

	STATICHASH( Immediate );
	m_Immediate = ConfigManager::GetBool( sImmediate, false, sDefinitionName );

	STATICHASH( Level );
	m_Level = ConfigManager::GetString( sLevel, "", sDefinitionName );

	MAKEHASH( m_Level );

	STATICHASH( WorldDef );
	m_WorldDef = ConfigManager::GetHash( sWorldDef, HashedString::NullString, sm_Level );
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:32,代码来源:wbactioneldgotolevel.cpp

示例2: MAKEHASH

void UIWidgetText::UpdatePosition()
{
	MAKEHASH( m_Archetype );
	MAKEHASH( m_Name );

	STATICHASH( DisplayWidth );
	const float DisplayWidth	= ConfigManager::GetFloat( sDisplayWidth );
	const float ParentWidth		= m_OriginParent ? m_OriginParent->GetWidth() : DisplayWidth;
	const float ParentX			= m_OriginParent ? Ceiling( m_OriginParent->GetX() ) : 0.0f;

	STATICHASH( DisplayHeight );
	const float DisplayHeight	= ConfigManager::GetFloat( sDisplayHeight );
	const float ParentHeight	= m_OriginParent ? m_OriginParent->GetHeight() : DisplayHeight;
	const float ParentY			= m_OriginParent ? Ceiling( m_OriginParent->GetY() ) : 0.0f;

	STATICHASH( PixelX );
	STATICHASH( PixelOffsetX );
	STATICHASH( ScreenX );
	float X =
		ConfigManager::GetArchetypeFloat( sPixelOffsetX, sm_Archetype, 0.0f, sm_Name ) +
		Pick(
			ConfigManager::GetArchetypeFloat( sPixelX, sm_Archetype, 0.0f, sm_Name ),
			ParentWidth * ConfigManager::GetArchetypeFloat( sScreenX, sm_Archetype, 0.0f, sm_Name ) );
	
	STATICHASH( PixelY );
	STATICHASH( PixelOffsetY );
	STATICHASH( ScreenY );
	float Y =
		ConfigManager::GetArchetypeFloat( sPixelOffsetY, sm_Archetype, 0.0f, sm_Name ) +
		Pick(
			ConfigManager::GetArchetypeFloat( sPixelY, sm_Archetype, 0.0f, sm_Name ),
			ParentHeight * ConfigManager::GetArchetypeFloat( sScreenY, sm_Archetype, 0.0f, sm_Name ) );

	// Get dimensions so we can do different origins
	Array<STypesetGlyph> UnusedTypesetting;
	Vector2 Dimensions;
	Array<unicode_t> CodePoints;
	GetString().UTF8ToUnicode( CodePoints );
	m_Font->Arrange( CodePoints, SRect( 0.0f, 0.0f, m_WrapWidth, 0.0f ), UnusedTypesetting, Dimensions );

	AdjustDimensionsToParent( X, Y, Dimensions.x, Dimensions.y, ParentX, ParentY, ParentWidth, ParentHeight );
	GetPositionFromOrigin( X, Y, Dimensions.x, Dimensions.y );

	STATICHASH( ClampToPixelGrid );
	m_ClampToPixelGrid = ConfigManager::GetArchetypeBool( sClampToPixelGrid, sm_Archetype, true, sm_Name );
	if( m_ClampToPixelGrid )
	{
		// Add 0.5 to compensate for font UVs being on half pixel intervals.
		m_TopLeft.x = Round( m_TopLeft.x ) + 0.5f;
		m_TopLeft.y = Round( m_TopLeft.y ) + 0.5f;
	}

	// Offset to properly align on pixel grid.
	const float PixelGridOffset = GetPixelGridOffset();
	m_TopLeft.x -= PixelGridOffset;
	m_TopLeft.y -= PixelGridOffset;
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:57,代码来源:uiwidget-text.cpp

示例3: STATICHASH

const SimpleString EldritchGame::GetRIPLevel()
{
    STATICHASH( EldritchWorld );
    STATICHASH( DefaultRIPName );
    const SimpleString DefaultRIPName = ConfigManager::GetString( sDefaultRIPName, "", sEldritchWorld );

    MAKEHASH( m_CurrentLevelName );
    STATICHASH( RIPName );
    const SimpleString RIPLevelName = ConfigManager::GetString( sRIPName, DefaultRIPName.CStr(), sm_CurrentLevelName );

    MAKEHASH( RIPLevelName );
    const SimpleString RIPLevel = ConfigManager::GetLocalizedString( sRIPLevelName, "" );

    return RIPLevel;
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:15,代码来源:eldritchgame.cpp

示例4: STATICHASH

void WBPEConstantBool::InitializeFromDefinition( const SimpleString& DefinitionName )
{
	STATICHASH( Value );
	MAKEHASH( DefinitionName );

	m_Value = ConfigManager::GetBool( sValue, false, sDefinitionName );
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:7,代码来源:wbpeconstantbool.cpp

示例5: MAKEHASH

void UIScreenEldBindInputs::CreateLabelWidgetDefinition()
{
	m_LabelWidgetDefinitionName		= SimpleString::PrintF( "_BindLabel%d", m_ExposedInputIndex );
	const SimpleString	LabelString	= SimpleString::PrintF( "Bind%s", m_ExposedInput.CStr() );

	MAKEHASH( m_LabelWidgetDefinitionName );

	STATICHASH( UIWidgetType );
	ConfigManager::SetString( sUIWidgetType, "Text", sm_LabelWidgetDefinitionName );

	STATICHASH( Archetype );
	ConfigManager::SetString( sArchetype, m_ArchetypeName.CStr(), sm_LabelWidgetDefinitionName );

	STATICHASH( Parent );
	ConfigManager::SetString( sParent, m_Parent.CStr(), sm_LabelWidgetDefinitionName );

	STATICHASH( String );
	ConfigManager::SetString( sString, LabelString.CStr(), sm_LabelWidgetDefinitionName );

	STATICHASH( PixelX );
	ConfigManager::SetFloat( sPixelX, m_Column0X, sm_LabelWidgetDefinitionName );

	STATICHASH( PixelY );
	ConfigManager::SetFloat( sPixelY, m_Y, sm_LabelWidgetDefinitionName );
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:25,代码来源:uiscreen-eldbindinputs.cpp

示例6: MAKEHASH

void EldritchGame::RequestGoToPrevLevel()
{
    XTRACE_FUNCTION;

    MAKEHASH( m_CurrentLevelName );

    STATICHASH( PrevLevel );
    const SimpleString PrevLevelName = ConfigManager::GetString( sPrevLevel, "", sm_CurrentLevelName );

    MAKEHASH( PrevLevelName );

    STATICHASH( WorldDef );
    const HashedString PrevWorldDef = ConfigManager::GetHash( sWorldDef, HashedString::NullString, sPrevLevelName );

    RequestGoToLevel( PrevLevelName, PrevWorldDef, false );
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:16,代码来源:eldritchgame.cpp

示例7: ASSERT

void InputContext::Initialize( const SimpleString& DefinitionName, InputSystem* const pInputSystem )
{
	ASSERT( pInputSystem );

	// Use "InputContext_DummyInput" instead of NullString as the default, so that we can validly redirect to a null input.
	STATIC_HASHED_STRING( InputContext_DummyInput );

	MAKEHASH( DefinitionName );

	STATICHASH( Suppress );
	m_SuppressUnredirectedInputs = ConfigManager::GetInheritedBool( sSuppress, false, sDefinitionName );

	const uint NumInputs = pInputSystem->m_Inputs.Size();
	for( uint InputIndex = 0; InputIndex < NumInputs; ++InputIndex )
	{
		const InputSystem::SInput& Input = pInputSystem->m_Inputs[ InputIndex ];
		const HashedString RedirectedInput = ConfigManager::GetInheritedHash( Input.m_String, sInputContext_DummyInput, sDefinitionName );
		if( RedirectedInput != sInputContext_DummyInput )
		{
			m_InputRedirects[ Input.m_Hash ] = RedirectedInput;
		}
	}

	const uint NumAnalogInputs = pInputSystem->m_AnalogInputs.Size();
	for( uint AnalogInputIndex = 0; AnalogInputIndex < NumAnalogInputs; ++AnalogInputIndex )
	{
		const InputSystem::SAnalogInput& AnalogInput = pInputSystem->m_AnalogInputs[ AnalogInputIndex ];
		const HashedString RedirectedInput = ConfigManager::GetInheritedHash( AnalogInput.m_String, sInputContext_DummyInput, sDefinitionName );
		if( RedirectedInput != sInputContext_DummyInput )
		{
			m_InputRedirects[ AnalogInput.m_Hash ] = RedirectedInput;
		}
	}
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:34,代码来源:inputcontext.cpp

示例8: MAKEHASH

/*virtual*/ void WBPEGetState::InitializeFromDefinition( const SimpleString& DefinitionName )
{
	MAKEHASH( DefinitionName );

	STATICHASH( EntityPE );
	m_EntityPE = WBParamEvaluatorFactory::Create( ConfigManager::GetString( sEntityPE, "", sDefinitionName ) );
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:7,代码来源:wbpegetstate.cpp

示例9: STATICHASH

void EldritchFramework::InitializeDLC() {
  STATICHASH(NumDLC);
  const uint NumDLC = ConfigManager::GetInt(sNumDLC);
  for (uint DLCIndex = 0; DLCIndex < NumDLC; ++DLCIndex) {
    const SimpleString DLCName =
        ConfigManager::GetSequenceString("DLC%d", DLCIndex, "");

    MAKEHASH(DLCName);

    STATICHASH(PackageFilename);
    const SimpleString PackageFilename =
        ConfigManager::GetString(sPackageFilename, "", sDLCName);

    // DLC will always preempt base content (so it can be used for patching as
    // well as DLC per se).
    PackStream::StaticAddPackageFile(PackageFilename.CStr(), true);

    // Load config files for DLC, if DLC was successfully loaded.
    // (We can't check a return value from StaticAddPackageFile, because I won't
    // have package
    // files during development but it still needs to load loose DLC files.)
    STATICHASH(NumConfigFiles);
    const uint NumConfigFiles =
        ConfigManager::GetInt(sNumConfigFiles, 0, sDLCName);
    for (uint ConfigFileIndex = 0; ConfigFileIndex < NumConfigFiles;
         ++ConfigFileIndex) {
      const SimpleString ConfigFile = ConfigManager::GetSequenceString(
          "ConfigFile%d", ConfigFileIndex, "", sDLCName);
      if (PackStream::StaticFileExists(ConfigFile.CStr())) {
        ConfigManager::Load(PackStream(ConfigFile.CStr()));
      }
    }
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:34,代码来源:eldritchframework.cpp

示例10: STATICHASH

void WBPEConstantFloat::InitializeFromDefinition( const SimpleString& DefinitionName )
{
	STATICHASH( Value );
	MAKEHASH( DefinitionName );

	m_Value = ConfigManager::GetFloat( sValue, 0.0f, sDefinitionName );
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:7,代码来源:wbpeconstantfloat.cpp

示例11: MAKEHASH

void RodinBTNodeLog::InitializeFromDefinition(
    const SimpleString& DefinitionName) {
  MAKEHASH(DefinitionName);

  STATICHASH(Message);
  m_Message = ConfigManager::GetString(sMessage, "", sDefinitionName);
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:7,代码来源:rodinbtnodelog.cpp

示例12: MAKEHASH

/*virtual*/ void WBCompEldSensorVision::InitializeFromDefinition( const SimpleString& DefinitionName )
{
	Super::InitializeFromDefinition( DefinitionName );

	MAKEHASH( DefinitionName );

	STATICHASH( EyeOffsetZ );
	m_EyeOffsetZ = ConfigManager::GetInheritedFloat( sEyeOffsetZ, 0.0f, sDefinitionName );

	STATICHASH( Radius );
	m_RadiusSq = Square( ConfigManager::GetInheritedFloat( sRadius, 0.0f, sDefinitionName ) );

	STATICHASH( ConeAngle );
	m_ConeCos = Cos( DEGREES_TO_RADIANS( ConfigManager::GetInheritedFloat( sConeAngle, 0.0f, sDefinitionName ) ) );

	STATICHASH( ConeScaleZ );
	const float ConeScaleZ = ConfigManager::GetInheritedFloat( sConeScaleZ, 0.0f, sDefinitionName );
	m_ConeInvZScale = ( ConeScaleZ > 0.0f ) ? ( 1.0f / ConeScaleZ ) : ConeScaleZ;

	STATICHASH( CertaintyFalloffRadius );
	m_CertaintyFalloffRadius = ConfigManager::GetInheritedFloat( sCertaintyFalloffRadius, 0.0f, sDefinitionName );

	STATICHASH( DistanceCertaintyFactor );
	m_DistanceCertaintyFactor = ConfigManager::GetInheritedFloat( sDistanceCertaintyFactor, 0.0f, sDefinitionName );

	STATICHASH( CertaintyVelocity );
	m_CertaintyVelocity = ConfigManager::GetInheritedFloat( sCertaintyVelocity, 0.0f, sDefinitionName );

	STATICHASH( CertaintyDecay );
	m_CertaintyDecay = ConfigManager::GetInheritedFloat( sCertaintyDecay, 0.0f, sDefinitionName );
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:31,代码来源:wbcompeldsensorvision.cpp

示例13: memcpy_s

// Make deep copies so the caller can delete its arrays
// (I chose to do this because it's synonymous with copying
// verts into D3D buffers.)
void BoneArray::Init( HashedString* BoneNames, SBone* Bones, const char* MeshFilename, Animation* Animations, int NumFrames, int NumBones, int NumAnims )
{
	m_NumFrames		= NumFrames;
	m_NumBones		= NumBones;
	m_NumAnimations	= NumAnims;

	int TotalBones	= m_NumFrames * m_NumBones;

	m_BoneNames		= new HashedString[ NumBones ];
	memcpy_s( m_BoneNames, sizeof( HashedString ) * NumBones, BoneNames, sizeof( HashedString ) * NumBones );

	m_Bones			= new SBone[ TotalBones ];
	memcpy_s( m_Bones, sizeof( SBone ) * TotalBones, Bones, sizeof( SBone ) * TotalBones );

	m_Animations	= new Animation[ NumAnims ];
	memcpy_s( m_Animations, sizeof( Animation ) * NumAnims, Animations, sizeof( Animation ) * NumAnims );

	// Set runtime anim properties from config
	STATICHASH( AnimationMap );
	MAKEHASH( MeshFilename );
	SimpleString AnimationMapName = ConfigManager::GetString( sMeshFilename, "", sAnimationMap );
	for( int AnimIndex = 0; AnimIndex < NumAnims; ++AnimIndex )
	{
		Animation& Animation = m_Animations[ AnimIndex ];
		Animation.InitializeFromDefinition( SimpleString::PrintF( "%s:%s", AnimationMapName.CStr(), Animation.m_Name ) );
	}
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:30,代码来源:bonearray.cpp

示例14: STATICHASH

RodinBTNode* RodinBTNodeFactory::Create(
    const SimpleString& DefinitionName,
    WBCompRodinBehaviorTree* const pBehaviorTree) {
  STATICHASH(NodeType);
  MAKEHASH(DefinitionName);
  HashedString NodeType =
      ConfigManager::GetHash(sNodeType, "", sDefinitionName);

  Map<HashedString, RodinBTNodeFactoryFunc>::Iterator FactoryIter =
      sFactoryFuncMap.Search(NodeType);
  if (FactoryIter.IsNull()) {
    PRINTF("Invalid type requested for RodinBTNode %s.\n",
           DefinitionName.CStr());
    WARNDESC("Invalid RodinBTNode type requested.");
    return nullptr;
  }

  RodinBTNodeFactoryFunc pFactory = (*FactoryIter);
  ASSERT(pFactory);

  RodinBTNode* pNewNode = pFactory();
  ASSERT(pNewNode);

  pNewNode->m_DefinitionName = DefinitionName;
  pNewNode->m_BehaviorTree = pBehaviorTree;
  pNewNode->InitializeFromDefinition(DefinitionName);

  return pNewNode;
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:29,代码来源:rodinbtnodefactory.cpp

示例15: MAKEHASH

void WBPERodinBlackboardGet::InitializeFromDefinition( const SimpleString& DefinitionName )
{
	MAKEHASH( DefinitionName );

	STATICHASH( BlackboardKey );
	m_BlackboardKey = ConfigManager::GetHash( sBlackboardKey, HashedString::NullString, sDefinitionName );
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:7,代码来源:wbperodinblackboardget.cpp


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