* Returns a pointer because in GCC < 5 ofstream itself is not moveable due to a bug. */
| 99 | * Returns a pointer because in GCC < 5 ofstream itself is not moveable due to a bug. |
| 100 | */ |
| 101 | static std::ofstream *CaptureFile(char *dst_path) |
| 102 | { |
| 103 | char path[MAX_PATH]; |
| 104 | |
| 105 | GetPrefPath(path, MAX_PATH); |
| 106 | |
| 107 | for (int i = 0; i <= 99; i++) { |
| 108 | snprintf(dst_path, MAX_PATH, "%sscreen%02d.PCX", path, i); |
| 109 | if (!FileExists(dst_path)) |
| 110 | return new std::ofstream(dst_path, std::ios::binary | std::ios::trunc); |
| 111 | } |
| 112 | |
| 113 | return nullptr; |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * @brief remove green and blue from the current palette |
no test coverage detected