本文整理汇总了C++中STATICHASH函数的典型用法代码示例。如果您正苦于以下问题:C++ STATICHASH函数的具体用法?C++ STATICHASH怎么用?C++ STATICHASH使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了STATICHASH函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: STATICHASH
void EldritchGame::Initialize()
{
if( GetSaveLoad()->TryLoadMaster() )
{
// We're good! Don't flush the master file; if the game crashes, we still want it around!
}
else
{
// There was no master file, or the master file didn't have a world state (was saved
// when the player was dead, etc.). Create a new world, but don't mess with persistence.
STATICHASH( EldritchWorld );
STATICHASH( InitialLevel );
SetCurrentLevelName( ConfigManager::GetString( sInitialLevel, "", sEldritchWorld ) );
MAKEHASH( m_CurrentLevelName );
STATICHASH( WorldDef );
const HashedString InitialWorldDef = ConfigManager::GetHash( sWorldDef, HashedString::NullString, sm_CurrentLevelName );
EldritchFramework* const pFramework = EldritchFramework::GetInstance();
EldritchWorld* const pWorld = pFramework->GetWorld();
pWorld->SetCurrentWorld( InitialWorldDef );
pWorld->Create();
pFramework->InitializeTools();
RefreshUIReturnToHubEnabled();
}
}
示例2: STATICHASH
void Framework3D::ConditionalRefreshDisplay()
{
XTRACE_FUNCTION;
// We shouldn't mess with this during initialization!
if( m_IsInitializing || m_IsShuttingDown )
{
return;
}
// Resync display after changing config vars out from under it.
STATICHASH( Fullscreen );
const bool Fullscreen = ConfigManager::GetBool( sFullscreen );
STATICHASH( DisplayWidth );
const uint DisplayWidth = ConfigManager::GetInt( sDisplayWidth );
STATICHASH( DisplayHeight );
const uint DisplayHeight = ConfigManager::GetInt( sDisplayHeight );
ASSERT( m_Display );
if( m_Display->NeedsUpdate() ||
m_Display->m_Fullscreen != Fullscreen ||
m_Display->m_Width != DisplayWidth ||
m_Display->m_Height != DisplayHeight )
{
RefreshDisplay( Fullscreen, DisplayWidth, DisplayHeight );
}
}
示例3: Min
void WBCompEldWallet::AddMoney(const uint Money, const bool ShowPickupScreen) {
m_Money = Min(m_Money + Money, m_Limit);
PublishToHUD();
if (ShowPickupScreen) {
// Show the money pickup screen and hide it after some time
STATICHASH(MoneyPickup);
STATICHASH(Money);
ConfigManager::SetInt(sMoney, Money, sMoneyPickup);
STATIC_HASHED_STRING(MoneyPickupScreen);
{
WB_MAKE_EVENT(PushUIScreen, NULL);
WB_SET_AUTO(PushUIScreen, Hash, Screen, sMoneyPickupScreen);
WB_DISPATCH_EVENT(GetEventManager(), PushUIScreen, NULL);
}
{
// Remove previously queued hide event if any
GetEventManager()->UnqueueEvent(m_HidePickupScreenUID);
WB_MAKE_EVENT(RemoveUIScreen, NULL);
WB_SET_AUTO(RemoveUIScreen, Hash, Screen, sMoneyPickupScreen);
m_HidePickupScreenUID = WB_QUEUE_EVENT_DELAY(
GetEventManager(), RemoveUIScreen, NULL, m_HidePickupScreenDelay);
}
}
}
示例4: 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()));
}
}
}
}
示例5: MAKEHASH
void RodinBTNodeSendEvent::InitializeFromDefinition( const SimpleString& DefinitionName )
{
MAKEHASH( DefinitionName );
STATICHASH( EventName );
m_EventName = ConfigManager::GetHash( sEventName, "", sDefinitionName );
STATICHASH( QueueEvent );
m_QueueEvent = ConfigManager::GetBool( sQueueEvent, false, sDefinitionName );
STATICHASH( DispatchDelay );
m_DispatchDelay = ConfigManager::GetFloat( sDispatchDelay, 0.0f, sDefinitionName );
STATICHASH( Recipient );
const SimpleString RecipientDef = ConfigManager::GetString( sRecipient, "", sDefinitionName );
m_RecipientPE.InitializeFromDefinition( RecipientDef );
STATICHASH( NumParameters );
const uint NumParameters = ConfigManager::GetInt( sNumParameters, 0, sDefinitionName );
for( uint ParameterIndex = 0; ParameterIndex < NumParameters; ++ParameterIndex )
{
const HashedString Name = ConfigManager::GetSequenceHash( "Parameter%dName", ParameterIndex, HashedString::NullString, sDefinitionName );
const SimpleString ValuePEDef = ConfigManager::GetSequenceString( "Parameter%dValue", ParameterIndex, "", sDefinitionName );
SNamedParameter& Parameter = m_Parameters.PushBack();
Parameter.m_Name = Name;
Parameter.m_ValuePE.InitializeFromDefinition( ValuePEDef );
}
}
示例6: CheckForRelaunch
bool CheckForRelaunch()
{
STATICHASH( ContentSyncer );
STATICHASH( Self );
STATICHASH( TempSelf );
STATICHASH( RelaunchArg );
SimpleString RelaunchArg = ConfigManager::GetString( sRelaunchArg, "", sContentSyncer );
SimpleString SelfExe = ConfigManager::GetString( sSelf, "", sContentSyncer );
SimpleString TempSelfExe = ConfigManager::GetString( sTempSelf, "", sContentSyncer );
if( HasCommandLineArgument( RelaunchArg ) )
{
if( FileUtil::Copy( TempSelfExe.CStr(), SelfExe.CStr(), false ) )
{
if( RelaunchTrueSelf() )
{
return true;
}
}
}
else
{
// Clean up the relauncher if needed
if( FileUtil::Exists( TempSelfExe.CStr() ) )
{
FileUtil::RemoveFile( TempSelfExe.CStr() );
}
}
return false;
}
示例7: STATICHASH
void WBCompEldEndgameCounter::PublishToHUD() const {
STATICHASH(HUD);
STATICHASH(EndgameCount);
ConfigManager::SetInt(sEndgameCount, m_Count, sHUD);
SetHUDHidden(false);
}
示例8: STATIC_HASHED_STRING
/*virtual*/ void EldritchFramework::HandleEvent(const WBEvent& Event) {
XTRACE_FUNCTION;
Framework3D::HandleEvent(Event);
STATIC_HASHED_STRING(ToggleInvertY);
STATIC_HASHED_STRING(ToggleFullscreen);
STATIC_HASHED_STRING(OnSliderChanged);
STATIC_HASHED_STRING(WritePrefsConfig);
STATIC_HASHED_STRING(CheckForUpdates);
const HashedString EventName = Event.GetEventName();
if (EventName == sToggleInvertY) {
XTRACE_NAMED(ToggleInvertY);
// TODO: Also invert controller? Or on a separate button?
STATIC_HASHED_STRING(TurnY);
const bool InvertY = !m_InputSystem->GetMouseInvert(sTurnY);
m_InputSystem->SetMouseInvert(sTurnY, InvertY);
m_InputSystem->SetControllerInvert(sTurnY, InvertY);
// Publish config var so UI can reflect the change.
// I could make input system publish config vars for each adjustment, but
// that seems wasteful since most inputs currently have no adjustment.
STATICHASH(InvertY);
ConfigManager::SetBool(sInvertY, InvertY);
} else if (EventName == sToggleFullscreen) {
XTRACE_NAMED(ToggleFullscreen);
ToggleFullscreen();
} else if (EventName == sOnSliderChanged) {
XTRACE_NAMED(OnSliderChanged);
STATIC_HASHED_STRING(SliderName);
const HashedString SliderName = Event.GetHash(sSliderName);
STATIC_HASHED_STRING(SliderValue);
const float SliderValue = Event.GetFloat(sSliderValue);
HandleUISliderEvent(SliderName, SliderValue);
} else if (EventName == sWritePrefsConfig) {
XTRACE_NAMED(WritePrefsConfig);
WritePrefsConfig();
} else if (EventName == sCheckForUpdates) {
#if BUILD_WINDOWS && !BUILD_STEAM
XTRACE_NAMED(CheckForUpdates);
// So I can compile updating out of certain builds.
STATICHASH(Framework);
STATICHASH(CheckForUpdates);
const bool CheckForUpdates =
ConfigManager::GetBool(sCheckForUpdates, true, sFramework);
if (CheckForUpdates) {
m_CheckForUpdates->Check(false, true);
}
#endif
}
}
示例9: STATICHASH
void Framework3D::CreateSplashWindow(const uint WindowIcon,
const char* const Title) {
XTRACE_FUNCTION;
STATICHASH(Framework);
STATICHASH(SplashImage);
const char* const pSplashImage =
ConfigManager::GetString(sSplashImage, nullptr, sFramework);
if (!pSplashImage) {
return;
}
const Surface SplashSurface =
Surface(PackStream(pSplashImage), Surface::ESFT_BMP);
const int SplashWindowWidth = SplashSurface.GetWidth();
const int SplashWindowHeight = SplashSurface.GetHeight();
ASSERT(!m_SplashWindow);
m_SplashWindow = new Window;
#if BUILD_WINDOWS_NO_SDL
const DWORD WindowStyle = WS_POPUP;
const DWORD WindowExStyle =
WS_EX_TOOLWINDOW; // Prevents this window appearing in the taskbar
const int ScreenWidth =
m_Display->m_Fullscreen ? m_Display->m_Width : m_Display->m_ScreenWidth;
const int ScreenHeight =
m_Display->m_Fullscreen ? m_Display->m_Height : m_Display->m_ScreenHeight;
m_SplashWindow->Init(Title, "SplashWindowClass", WindowStyle, WindowExStyle,
SplashWindowWidth, SplashWindowHeight, m_hInstance, NULL,
WindowIcon, ScreenWidth, ScreenHeight);
// The window needs to be shown before we can blit to it.
m_SplashWindow->Show(m_CmdShow);
#endif
#if BUILD_SDL
// TODO SDL: Unify interface?
const uint Flags = SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS;
m_SplashWindow->Init(Title, Flags, SplashWindowWidth, SplashWindowHeight);
// Load icon from package file instead of compiled resource.
Unused(WindowIcon);
STATICHASH(IconImage);
const char* const pIconImage =
ConfigManager::GetString(sIconImage, nullptr, sFramework);
if(pIconImage) {
ASSERT(pIconImage);
const Surface IconSurface =
Surface(PackStream(pIconImage), Surface::ESFT_BMP);
SDL_SetWindowIcon(m_SplashWindow->GetSDLWindow(),
IconSurface.GetSDLSurface());
}
#endif
SplashSurface.BlitToWindow(m_SplashWindow);
}
示例10: STATICHASH
void WBCompEldWallet::PublishToHUD() const {
STATICHASH(HUD);
STATICHASH(Money);
ConfigManager::SetInt(sMoney, m_Money, sHUD);
STATICHASH(Bank);
STATICHASH(WalletMoney);
ConfigManager::SetInt(sWalletMoney, m_Money, sBank);
}
示例11: RelaunchTrueSelf
bool RelaunchTrueSelf()
{
STATICHASH( ContentSyncer );
STATICHASH( Self );
SimpleString CommandLine = ConfigManager::GetString( sSelf, "", sContentSyncer );
return Launch( CommandLine );
}
示例12: STATICHASH
Clock::MultiplierRequest* Clock::AddMultiplierRequest( const SimpleString& DefinitionName )
{
STATICHASH( Duration );
STATICHASH( Multiplier );
MAKEHASH( DefinitionName );
return AddMultiplierRequest(
ConfigManager::GetFloat( sDuration, 0.0f, sDefinitionName ),
ConfigManager::GetFloat( sMultiplier, 0.0f, sDefinitionName ) );
}
示例13: STATICHASH
void EldritchSound3DListener::Initialize()
{
STATICHASH( AudioSystem );
STATICHASH( VerticalScalar );
m_VerticalScalar = ConfigManager::GetFloat( sVerticalScalar, 1.0f, sAudioSystem );
STATICHASH( OccludedFalloffRadius );
m_OccludedFalloffRadius = ConfigManager::GetFloat( sOccludedFalloffRadius, 0.0f, sAudioSystem );
}
示例14: MAKEHASH
/*virtual*/ void WBPEEldGetItem::InitializeFromDefinition( const SimpleString& DefinitionName )
{
MAKEHASH( DefinitionName );
STATICHASH( EntityPE );
m_EntityPE = WBParamEvaluatorFactory::Create( ConfigManager::GetString( sEntityPE, "", sDefinitionName ) );
STATICHASH( SlotPE );
m_SlotPE = WBParamEvaluatorFactory::Create( ConfigManager::GetString( sSlotPE, "", sDefinitionName ) );
}
示例15: MAKEHASH
void UIScreenEldBindInputs::CreateCompositeWidgetDefinition()
{
m_CompositeWidgetDefinitionName = SimpleString::PrintF( "_BindComposite%d", m_ExposedInputIndex );
MAKEHASH( m_CompositeWidgetDefinitionName );
STATICHASH( UIWidgetType );
ConfigManager::SetString( sUIWidgetType, "Composite", sm_CompositeWidgetDefinitionName );
STATICHASH( Focus );
ConfigManager::SetBool( sFocus, true, sm_CompositeWidgetDefinitionName );
STATICHASH( NumChildren );
ConfigManager::SetInt( sNumChildren, 4, sm_CompositeWidgetDefinitionName );
STATICHASH( Child0 );
ConfigManager::SetString( sChild0, m_LabelWidgetDefinitionName.CStr(), sm_CompositeWidgetDefinitionName );
STATICHASH( Child1 );
ConfigManager::SetString( sChild1, m_KeyboardWidgetDefinitionName.CStr(), sm_CompositeWidgetDefinitionName );
STATICHASH( Child2 );
ConfigManager::SetString( sChild2, m_MouseWidgetDefinitionName.CStr(), sm_CompositeWidgetDefinitionName );
STATICHASH( Child3 );
ConfigManager::SetString( sChild3, m_ControllerWidgetDefinitionName.CStr(), sm_CompositeWidgetDefinitionName );
STATICHASH( NumActions );
ConfigManager::SetInt( sNumActions, 1, sm_CompositeWidgetDefinitionName );
STATICHASH( Action0 );
ConfigManager::SetString( sAction0, m_BindActionDefinitionName.CStr(), sm_CompositeWidgetDefinitionName );
}