| 86 | } |
| 87 | |
| 88 | bool CVisRegTest::LoadConfig(const char* configFile) |
| 89 | { |
| 90 | XmlNodeRef rootNode = GetISystem()->LoadXmlFromFile(PathUtil::GetGameFolder() + "/" + configFile); |
| 91 | if (!rootNode || !rootNode->isTag("VisRegTest")) return false; |
| 92 | |
| 93 | m_cmdBuf.push_back(SCmd(eCMDStart, "")); |
| 94 | |
| 95 | for (int i = 0; i < rootNode->getChildCount(); ++i) |
| 96 | { |
| 97 | XmlNodeRef node = rootNode->getChild(i); |
| 98 | |
| 99 | if (node->isTag("Config")) |
| 100 | { |
| 101 | SCmd cmd; |
| 102 | for (int j = 0; j < node->getChildCount(); ++j) |
| 103 | { |
| 104 | XmlNodeRef node2 = node->getChild(j); |
| 105 | |
| 106 | if (node2->isTag("ConsoleCmd")) |
| 107 | { |
| 108 | m_cmdBuf.push_back(SCmd(eCMDConsoleCmd, node2->getAttr("cmd"))); |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | else if (node->isTag("Map")) |
| 113 | { |
| 114 | const char* mapName = node->getAttr("name"); |
| 115 | int imageIndex = 0; |
| 116 | |
| 117 | m_cmdBuf.push_back(SCmd(eCMDLoadMap, mapName)); |
| 118 | m_cmdBuf.push_back(SCmd(eCMDOnMapLoaded, "")); |
| 119 | |
| 120 | for (int j = 0; j < node->getChildCount(); ++j) |
| 121 | { |
| 122 | XmlNodeRef node2 = node->getChild(j); |
| 123 | |
| 124 | if (node2->isTag("ConsoleCmd")) |
| 125 | { |
| 126 | m_cmdBuf.push_back(SCmd(eCMDConsoleCmd, node2->getAttr("cmd"))); |
| 127 | } |
| 128 | else if (node2->isTag("Sample")) |
| 129 | { |
| 130 | m_cmdBuf.push_back(SCmd(eCMDGoto, node2->getAttr("location"))); |
| 131 | m_cmdBuf.push_back(SCmd(eCMDWaitStreaming, "")); |
| 132 | |
| 133 | char strbuf[256]; |
| 134 | #if CRY_PLATFORM_WINDOWS |
| 135 | cry_sprintf(strbuf, "%s_%i.bmp", mapName, imageIndex++); |
| 136 | #else |
| 137 | cry_sprintf(strbuf, "%s_%i.tga", mapName, imageIndex++); |
| 138 | #endif |
| 139 | m_cmdBuf.push_back(SCmd(eCMDCaptureSample, strbuf, SampleCount)); |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | m_cmdBuf.push_back(SCmd(eCMDFinish, "")); |
no test coverage detected