MCPcopy Create free account
hub / github.com/diasurgical/devilution / CaptureFile

Function CaptureFile

Source/capture.cpp:101–114  ·  view source on GitHub ↗

* Returns a pointer because in GCC < 5 ofstream itself is not moveable due to a bug. */

Source from the content-addressed store, hash-verified

99 * Returns a pointer because in GCC < 5 ofstream itself is not moveable due to a bug.
100 */
101static 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

Callers 1

CaptureScreenFunction · 0.85

Calls 2

GetPrefPathFunction · 0.85
FileExistsFunction · 0.85

Tested by

no test coverage detected