| 74 | } |
| 75 | |
| 76 | bool MD5AnimParser::Parse() |
| 77 | { |
| 78 | while (Advance(false)) |
| 79 | { |
| 80 | switch (m_currentLine[0]) |
| 81 | { |
| 82 | #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING |
| 83 | case 'M': // MD5Version |
| 84 | if (m_currentLine.GetWord(0) != "MD5Version") |
| 85 | UnrecognizedLine(); |
| 86 | break; |
| 87 | #endif |
| 88 | |
| 89 | case 'b': // baseframe/bounds |
| 90 | if (m_currentLine.StartsWith("baseframe {")) |
| 91 | { |
| 92 | if (!ParseBaseframe()) |
| 93 | { |
| 94 | Error("Failed to parse baseframe"); |
| 95 | return false; |
| 96 | } |
| 97 | } |
| 98 | else if (m_currentLine.StartsWith("bounds {")) |
| 99 | { |
| 100 | if (!ParseBounds()) |
| 101 | { |
| 102 | Error("Failed to parse bounds"); |
| 103 | return false; |
| 104 | } |
| 105 | } |
| 106 | #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING |
| 107 | else |
| 108 | UnrecognizedLine(); |
| 109 | #endif |
| 110 | break; |
| 111 | |
| 112 | #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING |
| 113 | case 'c': // commandline |
| 114 | if (m_currentLine.GetWord(0) != "commandline") |
| 115 | UnrecognizedLine(); |
| 116 | break; |
| 117 | #endif |
| 118 | |
| 119 | case 'f': |
| 120 | { |
| 121 | unsigned int index; |
| 122 | if (std::sscanf(&m_currentLine[0], "frame %u {", &index) == 1) |
| 123 | { |
| 124 | if (m_frameIndex != index) |
| 125 | { |
| 126 | Error("Unexpected frame index (expected " + String::Number(m_frameIndex) + ", got " + String::Number(index) + ')'); |
| 127 | return false; |
| 128 | } |
| 129 | |
| 130 | if (!ParseFrame()) |
| 131 | { |
| 132 | Error("Failed to parse frame"); |
| 133 | return false; |
nothing calls this directly
no test coverage detected