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


C++ VString::Format方法代码示例

本文整理汇总了C++中VString::Format方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::Format方法的具体用法?C++ VString::Format怎么用?C++ VString::Format使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VString的用法示例。


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

示例1: OnDragEnd

void VUINodeRotator::OnDragEnd(VWindowBase *pOver)
{
	VString szLog;
	szLog.Format("OnDragEnd");
	Text().SetText( szLog );
	return;
}
开发者ID:hxzpily,项目名称:GUIEditor,代码行数:7,代码来源:VUINodeRotator.cpp

示例2: SetupBaseDataDirectories

void VAppBase::SetupBaseDataDirectories()
{
  VString sRoot;
  sRoot.Format(":%s", m_appConfig.m_sFileSystemRootName.AsChar());

  VFileAccessManager::GetInstance()->ClearSearchPaths();
  VFileAccessManager::GetInstance()->AddSearchPath(sRoot);
  VFileAccessManager::GetInstance()->AddSearchPath(sRoot + "/Data/Vision/Base");
  VFileAccessManager::GetInstance()->AddSearchPath(":app_data", VSearchPathFlags::WRITABLE);
}
开发者ID:Niobij,项目名称:AnarchoidTemplate,代码行数:10,代码来源:VAppBase.cpp

示例3: OnDragBegin

void VUINodeRotator::OnDragBegin(const hkvVec2 &vMousePos, int iButtonMask)
{
	VString szLog;
	szLog.Format("OnDragBegin %d %d", (int)vMousePos.x , (int)vMousePos.y );
	Text().SetText( szLog );

	m_vPivotPoint = vMousePos;
	m_vEndPoint = vMousePos;

	m_fPivotAngle = m_fAngle;
	return;
}
开发者ID:hxzpily,项目名称:GUIEditor,代码行数:12,代码来源:VUINodeRotator.cpp

示例4: VModelPreviewComponent

VScalefromModelPreview::VScalefromModelPreview(VScaleformMovieInstance * pMainMovieInstance,
                                               VisBaseEntity_cl *pPreviewEntity,
                                               const char * szTextureName,
                                               const char * szMoviePathAndName,
                                               int iSizeX, int iSizeY, float fFovH, float fFovV) :
    m_pMainMovieInstance(pMainMovieInstance),
    m_sTextureName(szTextureName),
    m_sMoviePathAndName(szMoviePathAndName)
{
  VASSERT_MSG(pMainMovieInstance!=NULL, "The main movie is required for VScalefromModelPreview!");
  VASSERT_MSG(pPreviewEntity!=NULL, "Specify an entity for the VScalefromModelPreview!");
  VASSERT_MSG(szTextureName!=NULL, "Specify a texture for the VScalefromModelPreview!");

  //Scaleform::StringBuffer buffer2;
  //Scaleform::Memory::pGlobalHeap->MemReport(buffer2, Scaleform::MemoryHeap::MemReportFull);
  //Vision::Error.Warning("\n-----------------\n1st report:\n\n%s\n-----------------\n", buffer2.ToCStr());

  VString sTargetName;
  sTargetName.Format("ScaleformModelPreviewComponent:%p", pPreviewEntity);
  m_spModelPreview = new VModelPreviewComponent(sTargetName.AsChar());

  m_spModelPreview->CreateEmptyLightGrid();

  m_spModelPreview->SetPreviewEntity(pPreviewEntity);

#ifdef _VR_DX11
  //this switch is required for Scaleform DX11, because it cannot handle typeless textures so far!
  bool bTypedRenderTargetsActive = Vision::Renderer.GetUseTypedRenderTargets()!=0;
  if(!bTypedRenderTargetsActive)
    Vision::Renderer.SetUseTypedRenderTargets(true);
#endif

#ifdef HK_DEBUG_SLOW
  bool bSuccess =
#endif
  m_spModelPreview->InitComponent(iSizeX, iSizeY, fFovH, fFovV);
#ifdef HK_DEBUG_SLOW
  VASSERT_MSG(bSuccess, "Failed to initialize internal model preview component!");
#endif

#ifdef _VR_DX11
  if(!bTypedRenderTargetsActive)
    Vision::Renderer.SetUseTypedRenderTargets(false);
#endif

  Reassign();

  //Scaleform::StringBuffer buffer;
  //Scaleform::Memory::pGlobalHeap->MemReport(buffer, Scaleform::MemoryHeap::MemReportFull);
  //Vision::Error.Warning("\n-----------------\n2nd report:\n\n%s\n-----------------\n", buffer.ToCStr());

  Vision::Callbacks.OnEnterForeground += this;
}
开发者ID:cDoru,项目名称:projectanarchy,代码行数:53,代码来源:VScaleformModelPreview.cpp

示例5: DebugPrintLastCharacterEventLogged

void RPG_CharacterStats::DebugPrintLastCharacterEventLogged() const
{
#ifdef _DEBUG
  if (m_recentCharacterEvents.GetSize() > 0)
  {
    VString msg;
    const RPG_CharacterEvent event = m_recentCharacterEvents.GetLast();
    msg.Format("Event Logged: Type: %i, Time: %f, Value: %i, Message: %s\n", event.m_eventType, event.m_eventTime, event.m_eventValue, "<FIXME: NO MESSAGE>");
    hkvLog::Info(msg.AsChar());
  }
#endif
}
开发者ID:guozanhua,项目名称:projectanarchy,代码行数:12,代码来源:CharacterStats.cpp

示例6: CreatePendingEvents

bool Channel::CreatePendingEvents(HANDLE serverMessagesEvent, HANDLE clientMessagesEvent)
{
  VString serverEventname;
  serverEventname.Format("events.webvision.server.%u", m_id);
  VString clientEventname;
  clientEventname.Format("events.webvision.client.%u", m_id); 

  if (m_mode == MODE_SERVER)
  {
    SECURITY_ATTRIBUTES securityAttributes;
    securityAttributes.nLength = sizeof(securityAttributes);
    securityAttributes.lpSecurityDescriptor = NULL;
    securityAttributes.bInheritHandle = TRUE;

    m_pendingServerMessagesEvent = serverMessagesEvent != NULL
      ? serverMessagesEvent
      : CreateEvent(&securityAttributes, TRUE, FALSE, serverEventname);
    m_pendingClientMessagesEvent = clientMessagesEvent != NULL
      ? clientMessagesEvent
      : CreateEvent(&securityAttributes, TRUE, FALSE, clientEventname); 
  }
  else
  {
    m_pendingServerMessagesEvent = serverMessagesEvent != NULL
      ? serverMessagesEvent
      : OpenEvent(EVENT_ALL_ACCESS, FALSE, serverEventname);
    m_pendingClientMessagesEvent = clientMessagesEvent != NULL
      ? clientMessagesEvent
      : OpenEvent(EVENT_ALL_ACCESS, FALSE, clientEventname);
  }

  if (m_pendingServerMessagesEvent == NULL || m_pendingClientMessagesEvent == NULL)
  {
    return false;
  }

  return true;
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:38,代码来源:VChannel.cpp

示例7: DebugPrintCharacterEventLog

void RPG_CharacterStats::DebugPrintCharacterEventLog() const
{
#ifdef _DEBUG
  VString msg;
  for (unsigned int i = 0; i < m_recentCharacterEvents.GetSize(); ++i)
  {
    const RPG_CharacterEvent event = m_recentCharacterEvents[i];
    msg.Format("EventType: %i, Time: %f, Value: %i, Message: %s\n", event.m_eventType, event.m_eventTime, event.m_eventValue, "<FIXME: NO MESSAGE>");
    hkvLog::Info(msg.AsChar());
  }
  msg = "-------------------------------------------------------";
  hkvLog::Info(msg.AsChar());
#endif
}
开发者ID:guozanhua,项目名称:projectanarchy,代码行数:14,代码来源:CharacterStats.cpp

示例8: SetupPlatformRootFileSystem

void VAppAndroid::SetupPlatformRootFileSystem()
{
  VAppMobile::SetupPlatformRootFileSystem();

  VString sDataDirPrefix;
  sDataDirPrefix.Format("%s?assets/", m_sApkDirectory.AsChar());

  const VString& sRoot = m_appConfig.m_sFileSystemRootName;
  if(VFileServeDaemon::IsInitialized())
    VFileAccessManager::GetInstance()->SetRoot(sRoot, VFileServeDaemon::GetInstance()->CreateFileSystem(sRoot, sDataDirPrefix));
  else
    VFileAccessManager::GetInstance()->SetRoot(sRoot, sDataDirPrefix);

  VFileAccessManager::GetInstance()->SetRoot("app_data", GetApplicationDataDirectory(), VFileSystemFlags::WRITABLE);
}
开发者ID:Superdenny,项目名称:peggle,代码行数:15,代码来源:VAppAndroid.cpp

示例9: Create

void RPG_Effect::Create(RPG_EffectDefinition const& effectDefinition, VisBaseEntity_cl* parentEntity)
{
  VASSERT(parentEntity);
  m_parentEntity = parentEntity;

  bool validBone = false;
  if (!effectDefinition.m_vfxBoneName.IsEmpty())
  {
    if (m_parentEntity->GetMesh()->GetSkeleton()->GetBoneIndexByName(effectDefinition.m_vfxBoneName.AsChar()) != -1)
    {
      validBone = true;
    }
    else
    {
      // warn the user if a bad bone name has been supplied.
      VString msg;
      msg.Format("Trying to spawn an RPG_Effect on character %s, at a nonexistent bone: %s.", parentEntity->GetTypeId()->m_lpszClassName, effectDefinition.m_vfxBoneName.AsChar());
      hkvLog::Warning(msg.AsChar());
    }
  }

  // attach this effect object to its parent entity, either at a bone or at its root
  if (validBone)
  {
    // valid bone.
    // create a proxy to attach the particle system to the named bone if none already exists
    if (!m_attachment)
    {
      m_attachment = new RPG_Attachment(m_parentEntity);
    }
    VASSERT(m_attachment);

    // attach the proxy to the parent bone
    m_attachment->Attach(this, effectDefinition.m_vfxBoneName, effectDefinition.m_vfxPositionOffset, effectDefinition.m_vfxOrientationOffset);
  }
  else
  {
    // attach this effect to its owning entity generally
    AttachToParent(m_parentEntity);
    ResetLocalTransformation(); // Set this RPG_Effect's local space position and orientation to (0/0/0)
  }

  UpdateBinding();  // Recompute the world space transformation from the current local space transformation

  // Create the effect. Sound and visual components will attach to this effect object, which is already attached to its parent.
  Create(effectDefinition, GetPosition(), GetOrientation());
}
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:47,代码来源:Effect.cpp

示例10: CacheEntities

void Vehicle::CacheEntities()
{
  m_chassis = Vision::Game.SearchEntity("Cruiser");
  VASSERT(m_chassis);

  m_camera = Vision::Game.SearchEntity("Camera");
  VASSERT(m_camera);

  for (int wi = 0; wi < 4; wi ++)
  {
    VString entityName;
    entityName.Format("CruiserWheel%d", wi);

    m_wheel[wi] = Vision::Game.SearchEntity(entityName);
    VASSERT(m_wheel[wi]);
  }

  m_shadowLight = Vision::Game.SearchLightSource("CruiserShadow");
  VASSERT(m_shadowLight);
  m_shadowLightOffset = m_shadowLight->GetRotationMatrix().transformDirection(hkvVec3(2500.0f, 0.0f, 0.0f));
}
开发者ID:cDoru,项目名称:projectanarchy,代码行数:21,代码来源:Vehicle.cpp

示例11: OnDragging

 void VUINodeRotator::OnDragging(const hkvVec2 &vMouseDelta)
 {
  	const VRectanglef rect = GetClientRect();
  	hkvVec2 vCenter = ( rect.m_vMin + rect.m_vMax ) / 2.0f;	
 
 	hkvVec2 vMousePos = VUINodeMananger_cl::GlobalManager()->GetGUIContext()->GetCurrentMousePos();

	hkvVec2 vDirection = vCenter - vMousePos;

	float fNewAngle = m_fAngle;
	
	if ( vDirection.y > 0 )
	{
		fNewAngle -= vMouseDelta.x ;		
	}
	else
	{
		fNewAngle += vMouseDelta.x;
	}

	if ( vDirection.x > 0 )
	{
		fNewAngle += vMouseDelta.y;		
	}
	else
	{
		fNewAngle -= vMouseDelta.y;
	}

	m_fAngleDelta = fNewAngle - m_fAngle;
	m_fAngle = fNewAngle;
  
 	VString szLog;
 	szLog.Format("OnDragging %.2f %.2f", vMouseDelta.x , vMouseDelta.y ); 
 	Text().SetText( szLog );
 	return;
 }
开发者ID:hxzpily,项目名称:GUIEditor,代码行数:37,代码来源:VUINodeRotator.cpp

示例12: GetSubSymbolsForGlobal

bool VRSDClientLuaImplementation::GetSubSymbolsForGlobal(char* GlobalName, DynArray_cl<VRSDScriptSymbol>& SubSymbols, unsigned int& SubSymbolCount)
{
  VASSERT(m_pLuaState);

  if(!m_pLuaState || !m_pActivationRecord)
    return false;

  SubSymbolCount = 0;

  // we can only get local symbols without a crash if we are really in a Lua code execution path
  if(strcmp(m_pActivationRecord->what, "Lua"))
    return true;

  ScopedBooleanToTrue disableDebugCallback(m_bDebuggerRetrievingValues);
  VLuaStackCleaner stackCleaner(m_pLuaState);

  VMemoryTempBuffer<512> copyBuffer(GlobalName); // operate on a copy string in the tokenizer
  
  VStringTokenizerInPlace Tokenizer(copyBuffer.AsChar(), '.');
  lua_getfield(m_pLuaState, LUA_GLOBALSINDEX, Tokenizer.Next());
  if(LookupPath(Tokenizer) != HKV_SUCCESS)
    return false;

  // now the variable should be at the top of the stack and we can get the subvariables of it
  
  // first key for the iteration
  lua_pushnil(m_pLuaState);
  
  while (lua_next(m_pLuaState, -2) != 0)
  {
    // after this the key is at -2 and the value at -1
    
    // we only want string fields and numeric fields
    // (lua_isstring returns also true for numbers, using
    // tostring later on will cast the number to a string)
    int iKeyType = lua_type(m_pLuaState, -2);
    if (iKeyType==LUA_TNUMBER || iKeyType==LUA_TSTRING)
    {  
      VString sKeyBuffer;

      //this if prevents a conversion of number on the Lua stack
      if(iKeyType==LUA_TNUMBER) sKeyBuffer.Format("%1.0f", lua_tonumber(m_pLuaState, -2));
      else                      sKeyBuffer = lua_tostring(m_pLuaState, -2);

      const char* pSymbolName = sKeyBuffer.AsChar();

      if(pSymbolName)
      {
        // table member variable
        if(lua_istable(m_pLuaState, -1))
        {
          // add a symbol for the table
          AddSymbol(SubSymbols, SubSymbolCount, pSymbolName, "table", VRSDScriptSymbol::SYMBOL_TABLE);
        }
        // numeric member variable
        else if(lua_type(m_pLuaState, -1) == LUA_TNUMBER)
        {
          char buffer[32];
          sprintf(buffer, "%f", lua_tonumber(m_pLuaState, -1));
          AddSymbol(SubSymbols, SubSymbolCount, pSymbolName, buffer, VRSDScriptSymbol::SYMBOL_NUMBER);
        }
        // string member variable
        else if(lua_type(m_pLuaState, -1) == LUA_TSTRING)
        {
          AddSymbol(SubSymbols, SubSymbolCount, pSymbolName, lua_tostring(m_pLuaState, -1), VRSDScriptSymbol::SYMBOL_STRING);
        }
        // function member variable
        else if(lua_isfunction(m_pLuaState, -1))
        {
          AddSymbol(SubSymbols, SubSymbolCount, pSymbolName, "function", VRSDScriptSymbol::SYMBOL_FUNCTION);
        }
        // userdata member variable
        else if(lua_isuserdata(m_pLuaState, -1))
        {
          char buffer[128];
          swig_type_info* type = (swig_type_info *)LUA_GetSwigType(m_pLuaState, -1);
          void * pUserData = lua_touserdata(m_pLuaState, -1);

          if(type)
          {
            vis_snprintf(buffer, 128, "userdata:0x%p [%s: 0x%p]", pUserData, type->str, ((swig_lua_userdata*)pUserData)->ptr);
          }
          else
          {
            vis_snprintf(buffer, 128, "userdata:0x%p", lua_touserdata(m_pLuaState, -1));
          }
          AddSymbol(SubSymbols, SubSymbolCount, pSymbolName, buffer, VRSDScriptSymbol::SYMBOL_USERDATA);
        }
        else if(lua_isboolean(m_pLuaState, -1))
        {
          int iBoolVal = lua_toboolean(m_pLuaState, -1);
          AddSymbol(SubSymbols, SubSymbolCount, pSymbolName, iBoolVal ? "true" : "false", VRSDScriptSymbol::SYMBOL_BOOLEAN);
        }
        else if(lua_isnil(m_pLuaState, -1))
        {
          AddSymbol(SubSymbols, SubSymbolCount, pSymbolName, "nil", VRSDScriptSymbol::SYMBOL_CLASS);
        }

      }
    }
//.........这里部分代码省略.........
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:101,代码来源:VRSDLuaImplementation.cpp

示例13: GetSubSymbolsForLocal

bool VRSDClientLuaImplementation::GetSubSymbolsForLocal(char* LocalName, DynArray_cl<VRSDScriptSymbol>& SubSymbols, unsigned int& SubSymbolCount)
{
  VASSERT(m_pLuaState);

  if(!m_pLuaState || !m_pActivationRecord)
    return false;
  
  SubSymbolCount = 0;

  // we can only get local symbols without a crash if we are really in a Lua code execution path
  if(strcmp(m_pActivationRecord->what, "Lua"))
    return true;

  VLuaStackCleaner stackCleaner(m_pLuaState);
  ScopedBooleanToTrue disableDebugCallback(m_bDebuggerRetrievingValues);

  char* pSymbolName = NULL;
  int iLocalIndex = 1;

  VMemoryTempBuffer<512> copyBuffer(LocalName); // operate on a copy string in the tokenizer
  
  VStringTokenizerInPlace Tokenizer(copyBuffer.AsChar(), '.');
  char* pCurrent = Tokenizer.Next();

  while((pSymbolName = (char*)lua_getlocal(m_pLuaState, m_pActivationRecord, iLocalIndex)) != NULL)
  {                                                       //stack: .., localX, TOP
    // check if this local variable is the one we want
    if(!strcmp(pSymbolName, pCurrent))
    {
      //the local is already on the stack
      if(LookupPath(Tokenizer) != HKV_SUCCESS)
        return false;

      // now we can iterate over the contents of the table
      // first key for the iteration
      lua_pushnil(m_pLuaState);                           //stack: .., localX, {field}, nil, TOP

      //access the last field
      while (lua_next(m_pLuaState, -2) != 0)              //stack: .., localX, {field}, key, value TOP
      {
        // we only want string fields and numeric fields
        // (lua_isstring returns also true for numbers, using
        // tostring later on will cast the number to a string)
        int iKeyType = lua_type(m_pLuaState, -2);
        if (iKeyType==LUA_TNUMBER || iKeyType==LUA_TSTRING)
        {  
          VString sKeyBuffer;

          //this if prevents a conversion of number on the Lua stack
          if(iKeyType==LUA_TNUMBER) sKeyBuffer.Format("%1.0f", lua_tonumber(m_pLuaState, -2));
          else                      sKeyBuffer = lua_tostring(m_pLuaState, -2);

          if(!sKeyBuffer.IsEmpty())
          {
            int iValueType = lua_type(m_pLuaState, -1);
            VString sValueBuffer;

            // table member variable
            switch (iValueType) 
            {
              case LUA_TTABLE:
                // add a symbol for the table
                AddSymbol(SubSymbols, SubSymbolCount, sKeyBuffer.AsChar(), "table", VRSDScriptSymbol::SYMBOL_TABLE);
                break;
            
              case LUA_TNUMBER:
                // numeric member variable
                sValueBuffer.Format("%f", lua_tonumber(m_pLuaState, -1));
                AddSymbol(SubSymbols, SubSymbolCount, sKeyBuffer.AsChar(), sValueBuffer.AsChar(), VRSDScriptSymbol::SYMBOL_NUMBER);
                break;

              case LUA_TSTRING:
                AddSymbol(SubSymbols, SubSymbolCount, sKeyBuffer.AsChar(), lua_tostring(m_pLuaState, -1), VRSDScriptSymbol::SYMBOL_STRING);
                break;

              case LUA_TFUNCTION:
                sValueBuffer.Format("function:0x%p", lua_tocfunction(m_pLuaState, -1));
                AddSymbol(SubSymbols, SubSymbolCount, sKeyBuffer.AsChar(), sValueBuffer.AsChar(), VRSDScriptSymbol::SYMBOL_FUNCTION);
                break;
              
              case LUA_TBOOLEAN:
                AddSymbol(SubSymbols, SubSymbolCount, sKeyBuffer.AsChar(), lua_toboolean(m_pLuaState, -1) ? "true" : "false", VRSDScriptSymbol::SYMBOL_BOOLEAN);
                break;

              case LUA_TNIL:
                AddSymbol(SubSymbols, SubSymbolCount, sKeyBuffer.AsChar(), "nil", VRSDScriptSymbol::SYMBOL_CLASS);
                break;

              case LUA_TTHREAD:
                sValueBuffer.Format("thread:0x%p", lua_tothread(m_pLuaState, -1));
                AddSymbol(SubSymbols, SubSymbolCount, sKeyBuffer.AsChar(), sValueBuffer.AsChar(), VRSDScriptSymbol::SYMBOL_CLASS);
                break;

              case LUA_TUSERDATA:
                sValueBuffer.Format("userdata:0x%p", lua_touserdata(m_pLuaState, -1));
                AddSymbol(SubSymbols, SubSymbolCount, sKeyBuffer.AsChar(), sValueBuffer.AsChar(), VRSDScriptSymbol::SYMBOL_USERDATA);
                break;
            
              default:
                AddSymbol(SubSymbols, SubSymbolCount, sKeyBuffer.AsChar(), "unknown", VRSDScriptSymbol::SYMBOL_STRING);
//.........这里部分代码省略.........
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:101,代码来源:VRSDLuaImplementation.cpp

示例14: CreateVisualEffect

bool RPG_Effect::CreateVisualEffect(RPG_EffectDefinition const& effectDefinition, hkvVec3 const& position /*= hkvVec3(0.f, 0.f, 0.f)*/, hkvVec3 const& orientation /*= hkvVec3(0.f, 0.f, 0.f)*/)
{
  VString vfxFilename = effectDefinition.m_vfxFilename;

  if (m_debugDisplay)
  {
    VString msg;
    if (m_parentEntity)
    {
      msg += m_parentEntity->GetTypeId()->m_lpszClassName;
      msg += " --> ";
    }
    msg += "Creating Particle FX: ";
    msg += vfxFilename.AsChar();
    hkvLog::Info(msg.AsChar());
    Vision::Message.Add(1, msg.AsChar());
  }

  VisParticleEffect_cl* particleEffect = RPG_VisionEffectHelper::CreateParticleEffect(vfxFilename, position, orientation);

  if (!particleEffect)
  {
    hkvLog::Warning("Create Particle Effect failed: %s", vfxFilename.AsChar());
    return false;
  }

  particleEffect->AttachToParent(this);

  // apply position offset, relative to the RPG_Effect object's transform
  if (!effectDefinition.m_vfxPositionOffset.isZero())
  {
    particleEffect->SetLocalPosition(effectDefinition.m_vfxPositionOffset);
  }

  // apply orientation offset
  if (!effectDefinition.m_vfxOrientationOffset.isZero())
  {
    particleEffect->SetLocalOrientation(effectDefinition.m_vfxOrientationOffset);
  }
  // by default, emitters update their position over time. We need to call TeleportSpawnPosition() to force them to update immediately.
  particleEffect->TeleportSpawnPosition();

  // if this is a persistent effect, add it to the character's effect list.
  if (particleEffect && RPG_VisionEffectHelper::IsPersistentEffect(particleEffect))
  {
    if (GetParent())
    {
      particleEffect->SetRemoveWhenFinished(false); // if we're storing an effect here, we want to be responsible for its removal.
      m_persistentParticleEffect = particleEffect;
    }
    else
    {
      // a persistent effect was created, but not attached to a parent entity. Make some noise about this and shut it down.
      VString msg;
      msg.Format("Effect: %s is a looping effect, which must be attached to an entity capable of cleaning it up.", vfxFilename.AsChar());
      hkvLog::Warning(msg.AsChar());
      //VASSERT_MSG(false, "Effects containing looping particle systems MUST be parented to an entity which can manage their shutdown and cleanup.");

      particleEffect->SetFinished();
    }
  }
  
  DebugDisplayParticleInformation(particleEffect);

  return true;
}
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:66,代码来源:Effect.cpp

示例15: GetLastError

VString SceneLoader::GetLastError() const
{
  VSceneLoader& loader = VAppBase::Get()->GetAppImpl()->GetSceneLoader();

  // If the scene wasn't found, attempt to figure out why and display something useful to the user. Do this
  // here (rather than at a lower level) because the vPlayer knows that all search paths _should_ be there - usually
  // search path don't have to exist, so it's difficult to generally find out WHY a file wasn't found.
  if(loader.IsNotFound())
  {
    if(m_sceneListEntry.sSearchPaths.GetLength() == 0)
    {
      return "The list of search paths is empty";
    }

    // Check all search paths - this is the most likely source when the scene wasn't found
    for(int i = 0; i < m_sceneListEntry.sSearchPaths.GetLength(); i++)
    {
      const VString& sSearchPath = m_sceneListEntry.sSearchPaths[i];

      VStaticString<VFileAccessManager::MAX_ROOT_NAME_LENGTH> sSearchPathRoot;
      VFileAccessManager::SplitOffRoot(sSearchPath, sSearchPathRoot);

      if(VFileAccessManager::GetInstance()->GetRoot(sSearchPathRoot) == NULL)
      {
        VString error;
        error.Format("The root named '%s' is not mounted.", sSearchPathRoot.AsChar());
        return error;
      }

      VStaticString<VFileAccessManager::MAX_ROOT_NAME_LENGTH> sSearchPathTopLevelDir;
      sSearchPathTopLevelDir.Format(":%s/", sSearchPathRoot.AsChar());

      if(!VFileAccessManager::GetInstance()->DirectoryExists(sSearchPathTopLevelDir))
      {
        VString error;
        if(VFileServeDaemon::IsInitialized())
        {
          if(VFileServeDaemon::GetInstance()->IsConnected())
          {
            error.Format("The root named '%s' is not accessible. Is this root mapped in vFileServe?", sSearchPathRoot.AsChar());
          }
          else
          {
            error.Format("The root named '%s' is not accessible. The scene does not seem to be in the cache.", sSearchPathRoot.AsChar());
          }
        }
        else
        {
          error.Format("The root named '%s' is not accessible.", sSearchPathRoot.AsChar());
        }
        return error;
      }

      if(!VFileAccessManager::GetInstance()->DirectoryExists(sSearchPath))
      {
        VString error;
        if(VFileServeDaemon::IsInitialized())
        {
          if(VFileServeDaemon::GetInstance()->IsConnected())
          {
            error.Format("The search path '%s' could not be found. Is vFileServe configured correctly?", sSearchPath.AsChar());
          }
          else
          {
            error.Format("The search path '%s' could not be found. The scene does not seem to be in the cache.", sSearchPath.AsChar());
          }
        }
        else
        {
          error.Format("The search path '%s' could not be found.", sSearchPath.AsChar());
        }
        return error;
      }
    }

    // All search paths are okay, but the scene was not in any of them. It should usually be found in the first (= project dir), so display that one
    VString error;
    error.Format("The scene file was not found in '%s' or any other search directory.", m_sceneListEntry.sSearchPaths[0].AsChar());
    return error;
  }
  
  return loader.GetLastError();
}
开发者ID:guozanhua,项目名称:projectanarchy,代码行数:83,代码来源:vLoader.cpp


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