| 110 | } |
| 111 | |
| 112 | static std::string DefaultDestination(const std::string& sourceFile, CMP_FORMAT destFormat, const std::string& destFileExt, CMP_BOOL suffixDestFormat) |
| 113 | { |
| 114 | std::string destFile = ""; |
| 115 | |
| 116 | std::string sourceName = CMP_GetJustFileName(sourceFile); |
| 117 | std::string sourceExt = CMP_GetJustFileExt(sourceFile); |
| 118 | |
| 119 | destFile.append(sourceName); |
| 120 | |
| 121 | if (suffixDestFormat) |
| 122 | { |
| 123 | destFile.append("_"); |
| 124 | sourceExt.erase(std::remove(sourceExt.begin(), sourceExt.end(), '.'), sourceExt.end()); |
| 125 | destFile.append(sourceExt); |
| 126 | if (destFormat != CMP_FORMAT_BROTLIG && destFormat != CMP_FORMAT_Unknown) |
| 127 | { |
| 128 | destFile.append("_"); |
| 129 | destFile.append(GetFormatDesc(destFormat)); |
| 130 | } |
| 131 | } |
| 132 | else |
| 133 | sourceExt.erase(std::remove(sourceExt.begin(), sourceExt.end(), '.'), sourceExt.end()); |
| 134 | |
| 135 | if (destFileExt.find('.') != std::string::npos) |
| 136 | { |
| 137 | destFile.append(destFileExt); |
| 138 | } |
| 139 | else |
| 140 | { |
| 141 | #if (OPTION_BUILD_ASTC == 1) |
| 142 | if (destFormat == CMP_FORMAT_ASTC) |
| 143 | destFile.append(".astc"); |
| 144 | else |
| 145 | #endif |
| 146 | if (destFormat == CMP_FORMAT_BROTLIG) |
| 147 | destFile.append(".brlg"); |
| 148 | else |
| 149 | { |
| 150 | destFile.append(".dds"); |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | return destFile; |
| 155 | } |
| 156 | |
| 157 | static inline bool IsFileGLTF(const std::string& sourceFile) |
| 158 | { |
no test coverage detected