Forums

Full Version: Problem saving screenshots
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
There is a problem with saving screenshots. Start a race, make some screenshots, exit from the game, start again vdriftstart a race, make some screenshots, the old screenshots are overwrites.Gianni
Here's the way screenshots currently work: each time you take a screenshot, it makes shotXXX.bmp, where XXX is how many screenshots you've taken since starting vdrift. How would you propose it should work? Maybe put a timestamp in the filename so they're all unique?
You could do something like if(FileExists(file+counter+".bmp")) { counter++; }But this could be a problem if there are a lot of screenshots.timestamp is also a goog idea.
My idea for this was to just save the number of screenshots in the config file, and then just keep adding to it. Actually I meant to put this in the last version but forgot about it.
I dunno, I like the timestamp idea better... otherwise, the sequence is meaningless and you have no way to reset it...but whatever. Doesn't matter to me.
yeah that is a limitation, if the files at the beginning are deleted it won't reuse those numbers. a timestamp is probably best. what's the easiest way to come up with one in c++? should we use unix time or some kinda date/time combo?
oh god, not more system() calls... we should just use the normal C time functions