1
0
Fork 0

Work around a strange link failure on Mac

- Xcode 7 seems to dislike this code as was, adjusted version
links fine. Very odd.
This commit is contained in:
James Turner 2015-09-20 09:13:49 -05:00
parent 53b41d0284
commit c2cbb36d16

View file

@ -437,7 +437,24 @@ namespace
{
using namespace flightgear;
class GUISnapShotOperation :
SGPath nextScreenshotPath(const std::string& screenshotDir)
{
char filename[32];
static int count = 1;
while (count < 1000) {
snprintf(filename, 32, "fgfs-screen-%03d.png", count++);
SGPath p(screenshotDir);
p.append(filename);
if (!p.exists()) {
return p;
}
}
return SGPath();
}
class GUISnapShotOperation :
public GraphicsContextOperation
{
public:
@ -489,19 +506,7 @@ namespace
dir = globals->get_fg_home();
}
char filename[24];
static int count = 1;
while (count < 1000) {
snprintf(filename, 24, "fgfs-screen-%03d.png", count++);
SGPath p(dir);
p.append(filename);
if (!p.exists()) {
_path.set(p.str());
break;
}
}
_path = nextScreenshotPath(dir);
_xsize = fgGetInt("/sim/startup/xsize");
_ysize = fgGetInt("/sim/startup/ysize");