MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / InitAnimatedStatic

Method InitAnimatedStatic

ogsr_engine/xrGame/ui/UIXmlInit.cpp:1104–1131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1102//////////////////////////////////////////////////////////////////////////
1103
1104bool CUIXmlInit::InitAnimatedStatic(CUIXml& xml_doc, const char* path, int index, CUIAnimatedStatic* pWnd)
1105{
1106 R_ASSERT3(xml_doc.NavigateToNode(path, index), "XML node not found", path);
1107
1108 InitStatic(xml_doc, path, index, pWnd);
1109
1110 float x = xml_doc.ReadAttribFlt(path, index, "x_offset", 0);
1111 float y = xml_doc.ReadAttribFlt(path, index, "y_offset", 0);
1112 u32 framesCount = static_cast<u32>(xml_doc.ReadAttribInt(path, index, "frames", 0));
1113 u32 animDuration = static_cast<u32>(xml_doc.ReadAttribInt(path, index, "duration", 0));
1114 u32 animCols = static_cast<u32>(xml_doc.ReadAttribInt(path, index, "columns", 0));
1115 u32 frameWidth = static_cast<u32>(xml_doc.ReadAttribInt(path, index, "frame_width", 0));
1116 u32 frameHeight = static_cast<u32>(xml_doc.ReadAttribInt(path, index, "frame_height", 0));
1117 bool cyclic = !!xml_doc.ReadAttribInt(path, index, "cyclic", 0);
1118 bool play = !!xml_doc.ReadAttribInt(path, index, "autoplay", 0);
1119
1120 pWnd->SetFrameDimentions(frameWidth, frameHeight);
1121 pWnd->SetFramesCount(framesCount);
1122 pWnd->m_bCyclic = cyclic;
1123 pWnd->SetAnimCols(animCols);
1124 pWnd->SetAnimationDuration(animDuration);
1125 pWnd->SetOffset(x, y);
1126 pWnd->SetAnimPos(0.0f);
1127 if (play)
1128 pWnd->Play();
1129
1130 return true;
1131}
1132
1133bool CUIXmlInit::InitTexture(CUIXml& xml_doc, const char* path, int index, IUIMultiTextureOwner* pWnd)
1134{

Callers 6

InitMethod · 0.80
InitMethod · 0.80
InitMethod · 0.80
InitMethod · 0.80
InitMethod · 0.80
InitMethod · 0.80

Calls 10

NavigateToNodeMethod · 0.80
ReadAttribFltMethod · 0.80
ReadAttribIntMethod · 0.80
SetFrameDimentionsMethod · 0.80
SetFramesCountMethod · 0.80
SetAnimColsMethod · 0.80
SetAnimationDurationMethod · 0.80
SetOffsetMethod · 0.80
SetAnimPosMethod · 0.80
PlayMethod · 0.45

Tested by

no test coverage detected