예제 #1
0
///////////////////////////////////////////////
//  CONSTRUCTOR / DECONSTRUCT / OP OVERLOADS
///////////////////////////////////////////////
CAnimation::CAnimation(int nImageID,int nImageWidth,int nImageHeight, int nFrameWidth,
				int nFrameHeight,int nFrames,int nCurrent,float fTimePerFrame,bool bLooping,bool bStatic)
{
	SetImageID(nImageID);
	SetImageWidth(nImageWidth);
	SetImageHeight(nImageHeight);
	SetFrameWidth(nFrameWidth);
	SetFrameHeight(nFrameHeight);
	// Because framecount starts at 0
	SetFrameCount(nFrames - 1);
	SetCurrentFrame(nCurrent);
	SetLooping(bLooping);
	SetStatic(bStatic);
	SetTimePerFrame(fTimePerFrame);
	SetTimeWaited(0.0f);
}
void
ViewerClientAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("ViewerClientAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("renderingType")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetRenderingType(RenderType(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            RenderType value;
            if(RenderType_FromString(node->AsString(), value))
                SetRenderingType(value);
        }
    }
    if((node = searchNode->GetNode("id")) != 0)
        SetId(node->AsInt());
    if((node = searchNode->GetNode("title")) != 0)
        SetTitle(node->AsString());
    if((node = searchNode->GetNode("windowIds")) != 0)
        SetWindowIds(node->AsIntVector());
    if((node = searchNode->GetNode("imageWidth")) != 0)
        SetImageWidth(node->AsInt());
    if((node = searchNode->GetNode("imageHeight")) != 0)
        SetImageHeight(node->AsInt());
    if((node = searchNode->GetNode("imageResolutionPcnt")) != 0)
        SetImageResolutionPcnt(node->AsDouble());
    if((node = searchNode->GetNode("externalClient")) != 0)
        SetExternalClient(node->AsBool());
    if((node = searchNode->GetNode("renderingTypes")) != 0)
        SetRenderingTypes(node->AsIntVector());
}