Screenshot save path update.
This commit is contained in:
parent
922b39c0ea
commit
c14b687209
|
@ -14,4 +14,4 @@ to access some (rather crude) debugging and development stuff, activated by pres
|
|||
* [6] - Immediately complete the current mission
|
||||
|
||||
* [9] - Show the current frames per second
|
||||
* [0] - Take a screenshot once per second. Assumes the existance of dev/screenshots/tmp relative to the game's binary
|
||||
* [0] - Take a screenshot once per second, saving to /tmp/tbftss on Linux.
|
||||
|
|
|
@ -189,7 +189,7 @@ void saveScreenshot(void)
|
|||
char filename[MAX_NAME_LENGTH];
|
||||
SDL_Surface *sshot;
|
||||
|
||||
sprintf(filename, "dev/screenshots/tmp/%d.bmp", ++i);
|
||||
sprintf(filename, "/tmp/tbftss/%d.bmp", ++i);
|
||||
|
||||
sshot = SDL_CreateRGBSurface(0, SCREEN_WIDTH, SCREEN_HEIGHT, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
|
||||
SDL_RenderReadPixels(app.renderer, NULL, SDL_PIXELFORMAT_ARGB8888, sshot->pixels, sshot->pitch);
|
||||
|
|
|
@ -167,6 +167,8 @@ static void handleArguments(int argc, char *argv[])
|
|||
if (strcmp(argv[i], "-debug") == 0)
|
||||
{
|
||||
dev.debug = 1;
|
||||
|
||||
createScreenshotFolder();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ extern void initLookups(void);
|
|||
extern void initGame(void);
|
||||
extern void doKeyDown(SDL_KeyboardEvent *event);
|
||||
extern void doKeyUp(SDL_KeyboardEvent *event);
|
||||
extern void createScreenshotFolder(void);
|
||||
|
||||
App app;
|
||||
Colors colors;
|
||||
|
|
|
@ -44,3 +44,10 @@ void createSaveFolder(void)
|
|||
|
||||
STRNCPY(app.saveDir, dir, MAX_FILENAME_LENGTH);
|
||||
}
|
||||
|
||||
void createScreenshotFolder(void)
|
||||
{
|
||||
mkdir("/tmp/tbftss", S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH);
|
||||
|
||||
dev.screenshotFolder = "/tmp/tbftss";
|
||||
}
|
||||
|
|
|
@ -26,3 +26,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "../../common.h"
|
||||
|
||||
extern App app;
|
||||
extern Dev dev;
|
||||
|
|
|
@ -44,3 +44,8 @@ void createSaveFolder(void)
|
|||
|
||||
STRNCPY(app.saveDir, dir, MAX_FILENAME_LENGTH);
|
||||
}
|
||||
|
||||
void createScreenshotFolder(void)
|
||||
{
|
||||
dev.screenshotFolder = "./";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue