本文整理汇总了C++中C4PropList::GetPropertyStr方法的典型用法代码示例。如果您正苦于以下问题:C++ C4PropList::GetPropertyStr方法的具体用法?C++ C4PropList::GetPropertyStr怎么用?C++ C4PropList::GetPropertyStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C4PropList
的用法示例。
在下文中一共展示了C4PropList::GetPropertyStr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void C4GraphicsOverlay::UpdateFacet()
{
// special: Nothing to update for object and pSourceGfx may be NULL
// If there will ever be something to init here, UpdateFacet() will also need to be called when objects have been loaded
if (eMode == MODE_Object) return;
// otherwise, source graphics must be specified
if (!pSourceGfx) return;
C4Def *pDef = pSourceGfx->pDef;
assert(pDef);
fZoomToShape = false;
// Clear old mesh instance, if any
delete pMeshInstance; pMeshInstance = NULL;
// update by mode
switch (eMode)
{
case MODE_None:
break;
case MODE_Base: // def base graphics
if (pSourceGfx->Type == C4DefGraphics::TYPE_Bitmap)
fctBlit.Set(pSourceGfx->GetBitmap(), 0, 0, pDef->Shape.Wdt, pDef->Shape.Hgt, pDef->Shape.x+pDef->Shape.Wdt/2, pDef->Shape.y+pDef->Shape.Hgt/2);
else if (pSourceGfx->Type == C4DefGraphics::TYPE_Mesh)
pMeshInstance = new StdMeshInstance(*pSourceGfx->Mesh, 1.0f);
break;
case MODE_Action: // graphics of specified action
{
// Clear old facet
fctBlit.Default();
// Ensure there is actually an action set
if (!Action[0])
return;
C4Value v;
pDef->GetProperty(P_ActMap, &v);
C4PropList *actmap = v.getPropList();
if (!actmap)
return;
actmap->GetPropertyByS(::Strings.RegString(Action), &v);
C4PropList *action = v.getPropList();
if (!action)
return;
if (pSourceGfx->Type == C4DefGraphics::TYPE_Bitmap)
{
fctBlit.Set(pSourceGfx->GetBitmap(),
action->GetPropertyInt(P_X), action->GetPropertyInt(P_Y),
action->GetPropertyInt(P_Wdt), action->GetPropertyInt(P_Hgt));
// FIXME: fctBlit.TargetX has to be set here
}
else if (pSourceGfx->Type == C4DefGraphics::TYPE_Mesh)
{
C4String* AnimationName = action->GetPropertyStr(P_Animation);
if (!AnimationName) return;
pMeshInstance = new StdMeshInstance(*pSourceGfx->Mesh, 1.0f);
const StdMeshAnimation* Animation = pSourceGfx->Mesh->GetSkeleton().GetAnimationByName(AnimationName->GetData());
if (!Animation) return;
pMeshInstance->PlayAnimation(*Animation, 0, NULL, new C4ValueProviderRef<int32_t>(iPhase, ftofix(Animation->Length / action->GetPropertyInt(P_Length))), new C4ValueProviderConst(itofix(1)), true);
}
break;
}
case MODE_ObjectPicture: // ingame picture of object
// calculated at runtime
break;
case MODE_IngamePicture:
case MODE_Picture: // def picture
fZoomToShape = true;
// drawn at runtime
break;
case MODE_ExtraGraphics: // like ColorByOwner-sfc
// calculated at runtime
break;
case MODE_Rank:
// drawn at runtime
break;
case MODE_Object:
// TODO
break;
}
}