本文整理汇总了C++中KeyedArchive::GetInt32方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyedArchive::GetInt32方法的具体用法?C++ KeyedArchive::GetInt32怎么用?C++ KeyedArchive::GetInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyedArchive
的用法示例。
在下文中一共展示了KeyedArchive::GetInt32方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Deserialize
void LodComponent::Deserialize(KeyedArchive *archive, SceneFileV2 *sceneFile)
{
if(NULL != archive)
{
if(archive->IsKeyExists("lc.flags")) flags = archive->GetUInt32("lc.flags");
if(archive->IsKeyExists("lc.forceDistance")) forceDistance = archive->GetFloat("lc.forceDistance");
if(archive->IsKeyExists("lc.forceDistanceSq")) forceDistanceSq = archive->GetFloat("lc.forceDistanceSq");
if(archive->IsKeyExists("lc.forceLodLayer")) forceLodLayer = archive->GetInt32("lc.forceLodLayer");
KeyedArchive *lodDistArch = archive->GetArchive("lc.loddist");
if(NULL != lodDistArch)
{
for(uint32 i = 0; i < MAX_LOD_LAYERS; ++i)
{
KeyedArchive *lodDistValuesArch = lodDistArch->GetArchive(KeyedArchive::GenKeyFromIndex(i));
if(NULL != lodDistValuesArch)
{
lodLayersArray[i].distance = lodDistValuesArch->GetFloat("ld.distance");
lodLayersArray[i].nearDistance = lodDistValuesArch->GetFloat("ld.neardist");
lodLayersArray[i].farDistance = lodDistValuesArch->GetFloat("ld.fardist");
lodLayersArray[i].nearDistanceSq = lodDistValuesArch->GetFloat("ld.neardistsq");
lodLayersArray[i].farDistanceSq = lodDistValuesArch->GetFloat("ld.fardistsq");
}
}
}
KeyedArchive *lodDataArch = archive->GetArchive("lc.loddata");
if(NULL != lodDataArch)
{
for(uint32 i = 0; i < archive->GetUInt32("lc.loddatacount"); ++i)
{
KeyedArchive *lodDataValuesArch = lodDataArch->GetArchive(KeyedArchive::GenKeyFromIndex(i));
if(NULL != lodDataValuesArch)
{
LodData data;
if(lodDataValuesArch->IsKeyExists("layer")) data.layer = lodDataValuesArch->GetInt32("layer");
if(lodDataValuesArch->IsKeyExists("isdummy")) data.isDummy = lodDataValuesArch->GetBool("isdummy");
KeyedArchive *lodDataIndexesArch = lodDataValuesArch->GetArchive("indexes");
if(NULL != lodDataIndexesArch)
{
for(uint32 j = 0; j < lodDataValuesArch->GetUInt32("indexescount"); ++j)
{
data.indexes.push_back(lodDataIndexesArch->GetInt32(KeyedArchive::GenKeyFromIndex(j)));
}
}
lodLayers.push_back(data);
}
}
}
}
flags |= NEED_UPDATE_AFTER_LOAD;
Component::Deserialize(archive, sceneFile);
}
示例2: SetUpConnectionToDB
// Read DB parameters from config file and set connection to it
void AutotestingSystem::SetUpConnectionToDB()
{
KeyedArchive *option = new KeyedArchive();
bool res = option->LoadFromYamlFile("~res:/Autotesting/dbConfig.yaml");
if (!res)
{
ForceQuit("Couldn't open file ~res:/Autotesting/dbConfig.yaml");
}
String dbName = option->GetString("name");
String dbAddress = option->GetString("hostname");
String collection = option->GetString("collection");
int32 dbPort = option->GetInt32("port");
Logger::Debug("AutotestingSystem::SetUpConnectionToDB %s -> %s[%s:%d]", collection.c_str(), dbName.c_str(), dbAddress.c_str(), dbPort);
if(! AutotestingDB::Instance()->ConnectToDB(collection, dbName, dbAddress, dbPort))
{
ForceQuit("Couldn't connect to Test DB");
}
else
{
isDB = true;
}
SafeRelease(option);
}
示例3: RestoreState
void VisibilityToolPanel::RestoreState()
{
SceneEditor2* sceneEditor = GetActiveScene();
bool enabled = sceneEditor->visibilityToolSystem->IsLandscapeEditingEnabled();
int32 brushSize = AreaSizeSystemToUI(sceneEditor->visibilityToolSystem->GetBrushSize());
VisibilityToolSystem::eVisibilityToolState state = sceneEditor->visibilityToolSystem->GetState();
int32 areaSizeMin = DEF_AREA_MIN_SIZE;
int32 areaSizeMax = DEF_AREA_MAX_SIZE;
KeyedArchive* customProperties = GetCustomPropertiesArchieve(sceneEditor);
if (customProperties)
{
areaSizeMin = customProperties->GetInt32(ResourceEditor::VISIBILITY_TOOL_AREA_SIZE_MIN, DEF_AREA_MIN_SIZE);
areaSizeMax = customProperties->GetInt32(ResourceEditor::VISIBILITY_TOOL_AREA_SIZE_MAX, DEF_AREA_MAX_SIZE);
}
SetWidgetsState(enabled);
BlockAllSignals(true);
sliderWidgetAreaSize->SetRangeMin(areaSizeMin);
sliderWidgetAreaSize->SetRangeMax(areaSizeMax);
sliderWidgetAreaSize->SetValue(brushSize);
buttonSetVisibilityPoint->setChecked(state == VisibilityToolSystem::VT_STATE_SET_POINT);
buttonSetVisibilityArea->setChecked(state == VisibilityToolSystem::VT_STATE_SET_AREA);
BlockAllSignals(!enabled);
}
示例4: ConvertLightmapSizeFromProperty
void SceneValidator::ConvertLightmapSizeFromProperty(Entity *ownerNode, InstanceMaterialState *materialState)
{
KeyedArchive * props = ownerNode->GetCustomProperties();
Map<String, VariantType*> map = props->GetArchieveData();
for(Map<String, VariantType*>::iterator it = map.begin(); it != map.end(); it++)
{
String key = it->first;
if(key.find("lightmap.size") != String::npos && ((RenderComponent*)ownerNode->GetComponent(Component::RENDER_COMPONENT))->GetRenderObject()->GetType() != RenderObject::TYPE_LANDSCAPE)
{
materialState->SetLightmapSize(props->GetInt32(key, 128));
props->DeleteKey(key);
break;
}
}
}
示例5: DisplayMode
void QtLayerWin32::Resize(int32 width, int32 height)
{
DisplayMode currentMode = DisplayMode(width, height, 16, 0);
KeyedArchive * options = Core::Instance()->GetOptions();
if (options)
{
currentMode.bpp = options->GetInt32("bpp");
}
RenderManager::Instance()->ChangeDisplayMode(currentMode, false);
RenderManager::Instance()->Init(currentMode.width, currentMode.height);
UIControlSystem::Instance()->SetInputScreenAreaSize(currentMode.width, currentMode.height);
Core::Instance()->SetPhysicalScreenSize(currentMode.width, currentMode.height);
}
示例6: ChangeCollisionModeShow
void ModificationsPanel::ChangeCollisionModeShow(Entity * node)
{
if (!node)
return;
if (modeCollision)
{
KeyedArchive * customProperties = node->GetCustomProperties();
if(customProperties && customProperties->IsKeyExists("CollisionType") && customProperties->GetInt32("CollisionType", 0) == modeCollision)
{
node->SetDebugFlags(node->GetDebugFlags() | (DebugRenderComponent::DEBUG_DRAW_RED_AABBOX));
return;
}
}
else
{
node->SetDebugFlags(node->GetDebugFlags() & (~DebugRenderComponent::DEBUG_DRAW_RED_AABBOX));
}
int size = node->GetChildrenCount();
for (int i = 0; i < size; i++)
ChangeCollisionModeShow(node->GetChild(i));
}
示例7: MergeSwitch
bool SwitchToRenerObjectConverter::MergeSwitch(Entity * entity)
{
Vector<Entity*> entitiesToRemove;
SwitchComponent * sw = GetSwitchComponent(entity);
if(sw)
{
RenderComponent * rc = GetRenderComponent(entity);
RenderObject * ro = 0;
if(!rc)
{
ro = new Mesh();
rc = new RenderComponent(ro);
ro->Release();
ro->SetAABBox(AABBox3(Vector3(0, 0, 0), Vector3(0, 0, 0)));
entity->AddComponent(rc);
}
else
{
ro = rc->GetRenderObject();
}
DVASSERT(ro);
int32 size = entity->GetChildrenCount();
for(int32 i = 0; i < size; ++i)
{
Entity * sourceEntity = entity->GetChild(i);
RenderObject * sourceRenderObject = GetRenderObject(sourceEntity);
//workaround for custom properties for crashed model
if(1 == i) // crash model
{
KeyedArchive *childProps = GetCustomPropertiesArchieve(sourceEntity);
if(childProps && childProps->IsKeyExists("CollisionType"))
{
KeyedArchive *entityProps = GetOrCreateCustomProperties(entity)->GetArchive();
entityProps->SetInt32("CollisionTypeCrashed", childProps->GetInt32("CollisionType", 0));
}
}
//end of custom properties
Vector<std::pair<Entity*, RenderObject*> > renderPairs;
if(sourceRenderObject)
{
renderPairs.push_back(std::make_pair(sourceEntity, sourceRenderObject));
}
else
{
FindRenderObjectsRecursive(sourceEntity, renderPairs);
DVASSERT(renderPairs.size() == 1);
sourceRenderObject = renderPairs[0].second;
}
if(sourceRenderObject)
{
TransformComponent * sourceTransform = GetTransformComponent(sourceEntity);
if (sourceTransform->GetLocalTransform() != Matrix4::IDENTITY)
{
PolygonGroup * pg = sourceRenderObject->GetRenderBatchCount() > 0 ? sourceRenderObject->GetRenderBatch(0)->GetPolygonGroup() : 0;
if(pg && bakedPolygonGroups.end() == bakedPolygonGroups.find(pg))
{
sourceRenderObject->BakeGeometry(sourceTransform->GetLocalTransform());
bakedPolygonGroups.insert(pg);
}
}
uint32 sourceSize = sourceRenderObject->GetRenderBatchCount();
while(sourceSize)
{
int32 lodIndex, switchIndex;
RenderBatch * sourceRenderBatch = sourceRenderObject->GetRenderBatch(0, lodIndex, switchIndex);
sourceRenderBatch->Retain();
sourceRenderObject->RemoveRenderBatch(sourceRenderBatch);
ro->AddRenderBatch(sourceRenderBatch, lodIndex, i);
sourceRenderBatch->Release();
sourceSize--;
}
}
renderPairs[0].first->RemoveComponent(Component::RENDER_COMPONENT);
LodComponent * lc = GetLodComponent(sourceEntity);
if((0 != lc) && (0 == GetLodComponent(entity)))
{
LodComponent * newLod = (LodComponent*)lc->Clone(entity);
entity->AddComponent(newLod);
}
renderPairs[0].first->RemoveComponent(Component::LOD_COMPONENT);
if(sourceEntity->GetChildrenCount() == 0)
{
entitiesToRemove.push_back(sourceEntity);
}
}
}
uint32 entitiesToRemoveCount = entitiesToRemove.size();
//.........这里部分代码省略.........
示例8: CreateMutex
//.........这里部分代码省略.........
// Create the rendering window
if (isFullscreen)
{
style = WS_VISIBLE | WS_POPUP;
} // End if Fullscreen
AdjustWindowRect(&clientSize, style, FALSE);
int32 realWidth = clientSize.right - clientSize.left;
int32 realHeight = clientSize.bottom - clientSize.top;
int32 windowLeft = -10000;//(GetSystemMetrics(SM_CXSCREEN) - realWidth) / 2;
int32 windowTop = -10000;//(GetSystemMetrics(SM_CYSCREEN) - realHeight) / 2;
if (isFullscreen)
{
windowLeft = 0;
windowTop = 0;
}
// create window
hWindow = CreateWindow( className, L"", style, windowLeft, windowTop,
realWidth, realHeight, NULL, NULL, hInstance, NULL);
ShowWindow(hWindow, SW_SHOW);
UpdateWindow(hWindow);
// fix ugly ATI driver bugs. Thanks to ariaci (Taken from Irrlight).
MoveWindow(hWindow, windowLeft, windowTop, realWidth, realHeight, TRUE);
#if defined(__DAVAENGINE_DIRECTX9__)
RenderManager::Create(Core::RENDERER_DIRECTX9);
#elif defined(__DAVAENGINE_OPENGL__)
RenderManager::Create(Core::RENDERER_OPENGL);
#endif
RenderManager::Instance()->Create(hInstance, hWindow);
FrameworkDidLaunched();
KeyedArchive * options = Core::GetOptions();
//fullscreenMode = GetCurrentDisplayMode();
fullscreenMode = GetCurrentDisplayMode();//FindBestMode(fullscreenMode);
if (options)
{
windowedMode.width = options->GetInt32("width");
windowedMode.height = options->GetInt32("height");
windowedMode.bpp = options->GetInt32("bpp");
// get values from config in case if they are available
fullscreenMode.width = options->GetInt32("fullscreen.width", fullscreenMode.width);
fullscreenMode.height = options->GetInt32("fullscreen.height", fullscreenMode.height);
fullscreenMode.bpp = windowedMode.bpp;
fullscreenMode = FindBestMode(fullscreenMode);
isFullscreen = (0 != options->GetInt32("fullscreen"));
String title = options->GetString("title", "[set application title using core options property 'title']");
WideString titleW = StringToWString(title);
SetWindowText(hWindow, titleW.c_str());
}
Logger::FrameworkDebug("[PlatformWin32] best display fullscreen mode matched: %d x %d x %d refreshRate: %d", fullscreenMode.width, fullscreenMode.height, fullscreenMode.bpp, fullscreenMode.refreshRate);
currentMode = windowedMode;
if (isFullscreen)
{
currentMode = fullscreenMode;
}
clientSize.top = 0;
clientSize.left = 0;
clientSize.right = currentMode.width;
clientSize.bottom = currentMode.height;
AdjustWindowRect(&clientSize, style, FALSE);
realWidth = clientSize.right - clientSize.left;
realHeight = clientSize.bottom - clientSize.top;
windowLeft = (GetSystemMetrics(SM_CXSCREEN) - realWidth) / 2;
windowTop = (GetSystemMetrics(SM_CYSCREEN) - realHeight) / 2;
MoveWindow(hWindow, windowLeft, windowTop, realWidth, realHeight, TRUE);
RAWINPUTDEVICE Rid;
Rid.usUsagePage = 0x01;
Rid.usUsage = 0x02;
Rid.dwFlags = 0;
Rid.hwndTarget = 0;
RegisterRawInputDevices(&Rid, 1, sizeof(Rid));
RenderManager::Instance()->ChangeDisplayMode(currentMode, isFullscreen);
RenderManager::Instance()->Init(currentMode.width, currentMode.height);
UIControlSystem::Instance()->SetInputScreenAreaSize(currentMode.width, currentMode.height);
Core::Instance()->SetPhysicalScreenSize(currentMode.width, currentMode.height);
return true;
}