Closed TheJJ closed 9 years ago
Hello! A little progress here: https://github.com/franciscod/openage/commit/6b5ab1dc6b03e7c17c5099f8ebd7cb96f03b04d8
As far as I could tell, there is currently no way of saving to a file in the codebase. So, for now the numbering restarts on each run.
Also, when should we create the ~/.openage and ~/.openage/screenshot directories? Should the engine create them as needed on each screenshot, or fail silently?
edit: maybe a ScreenshotManager is too much? :stuck_out_tongue_closed_eyes:
I lol'd at the screenshot :smile:
I'd say a screenshot manager is just fine!
Next idea: You could check what files are there and chose the next free filename, when having many screenshots, this may fail though.
Better idea: Store the screenshot with the timestamp in the filename, openage_2014-10-30_14:18:20_xx.png
. As people can take n
screenshots per second, we still need a counter :wink:, but the number of existence checks should probably fall down to 0
.
Don't worry about ~/.openage
yet, some other subsystem will create it sooner or later, especially when #28 is finished.
lol, lord gaben is praised :sun_with_face:
Yeah, I thought about the timestamp in the filename since that's what scrot and minecraft do, but since you stated _xxxx I went on that idea.
Should I also move the screenshot taking code (the SDL masking/copying and finally saving the PNG) to the ScreenshotManager?
Yeah, will be a lot more modular that way.
Currently, each screenshot is put to
/tmp/openage_00.png
. This should be updated to~/.openage/screenshots/openage_xxxx.png
, wherexxxx
is incremented automatically (start counting at0
!).For debugging purposes, the game version described in #27 should be included on the screenshots when it's not disabled by the user.