Modified to allow the rolling index to be seeded
so that the app can optionally set it so the screen shots don't get overwritten every time the app is restarted. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10793 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
05603965fc
commit
87930e7075
@ -63,7 +63,7 @@ public class ScreenshotAppState extends AbstractAppState implements ActionListen
|
||||
private RenderManager rm;
|
||||
private ByteBuffer outBuf;
|
||||
private String appName;
|
||||
private int shotIndex = 0;
|
||||
private long shotIndex = 0;
|
||||
private int width, height;
|
||||
|
||||
/**
|
||||
@ -85,6 +85,21 @@ public class ScreenshotAppState extends AbstractAppState implements ActionListen
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor allows you to specify the output file path of the screenshot and
|
||||
* a base index for the shot index.
|
||||
* Include the seperator at the end of the path.
|
||||
* Use an emptry string to use the application folder. Use NULL to use the system
|
||||
* default storage folder.
|
||||
* @param file The screenshot file path to use. Include the seperator at the end of the path.
|
||||
* @param shotIndex The base index for screen shots. The first screen shot will have
|
||||
* shotIndex + 1 appended, the next shotIndex + 2, and so on.
|
||||
*/
|
||||
public ScreenshotAppState(String filePath, long shotIndex) {
|
||||
this.filePath = filePath;
|
||||
this.shotIndex = shotIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the file path to store the screenshot.
|
||||
* Include the seperator at the end of the path.
|
||||
@ -96,6 +111,13 @@ public class ScreenshotAppState extends AbstractAppState implements ActionListen
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the base index that will used for subsequent screen shots.
|
||||
*/
|
||||
public void setShotIndex(long index) {
|
||||
this.shotIndex = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(AppStateManager stateManager, Application app) {
|
||||
if (!super.isInitialized()){
|
||||
|
Loading…
x
Reference in New Issue
Block a user