| 1102 | ////////////////////////////////////////////////////////////////////////// |
| 1103 | |
| 1104 | bool 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 | |
| 1133 | bool CUIXmlInit::InitTexture(CUIXml& xml_doc, const char* path, int index, IUIMultiTextureOwner* pWnd) |
| 1134 | { |
no test coverage detected