Exports a default cuboid brush with its texture fitted 1x1 to a temporary path using the format for the given game type. Returns the exported map text.
| 79 | // Exports a default cuboid brush with its texture fitted 1x1 to a temporary path |
| 80 | // using the format for the given game type. Returns the exported map text. |
| 81 | std::string exportDefaultBrushUsingFormat(const std::string& gameType, const std::string& exportPath) |
| 82 | { |
| 83 | auto brush = algorithm::createCuboidBrush(GlobalMapModule().findOrInsertWorldspawn(), |
| 84 | AABB(Vector3(0, 0, 0), Vector3(64, 128, 256)), "textures/darkmod/numbers/1"); |
| 85 | |
| 86 | for (auto i = 0; i < Node_getIBrush(brush)->getNumFaces(); ++i) |
| 87 | { |
| 88 | Node_getIBrush(brush)->getFace(i).fitTexture(1, 1);; |
| 89 | } |
| 90 | |
| 91 | auto format = GlobalMapFormatManager().getMapFormatForGameType(gameType, os::getExtension(exportPath)); |
| 92 | |
| 93 | EXPECT_FALSE(fs::exists(exportPath)) << "File already exists"; |
| 94 | |
| 95 | FileSelectionHelper helper(exportPath, format); |
| 96 | GlobalCommandSystem().executeCommand("ExportMap"); |
| 97 | |
| 98 | EXPECT_TRUE(fs::exists(exportPath)) << "File still doesn't exist"; |
| 99 | |
| 100 | return algorithm::loadFileToString(exportPath); |
| 101 | } |
| 102 | |
| 103 | TEST_F(MapExportTest, exportDoom3Brush) |
| 104 | { |
no test coverage detected