- Applied a modified version of Karate Chris's screenshot naming patch.
- Sbarinfo optimization: Creating and destroying bar textures every frame is a relatively expensive operation. We can skip the custom texture entirely and just draw the bars directly to the screen, using the clipping parameters for DrawTexture(). This also means bars are no longer limited to the game palette, and the bar itself has the same resolution as the screen. SVN r731 (trunk)
This commit is contained in:
parent
9a785239f2
commit
d1e27e533f
9 changed files with 219 additions and 194 deletions
|
|
@ -30,6 +30,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <malloc.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "version.h"
|
||||
|
|
@ -595,7 +596,42 @@ static bool FindFreeName (FString &fullname, const char *extension)
|
|||
|
||||
for (i = 0; i <= 9999; i++)
|
||||
{
|
||||
lbmname.Format ("%sDOOM%04d.%s", fullname.GetChars(), i, extension);
|
||||
const char *gamename;
|
||||
|
||||
switch (gameinfo.gametype)
|
||||
{
|
||||
case GAME_Doom: gamename = "Doom"; break;
|
||||
case GAME_Heretic: gamename = "Heretic"; break;
|
||||
case GAME_Hexen: gamename = "Hexen"; break;
|
||||
case GAME_Strife: gamename = "Strife"; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
time_t now;
|
||||
tm *tm;
|
||||
|
||||
time(&now);
|
||||
tm = localtime(&now);
|
||||
|
||||
if (tm == NULL)
|
||||
{
|
||||
lbmname.Format ("%sScreenshot_%s_%04d.%s", fullname.GetChars(), gamename, i, extension);
|
||||
}
|
||||
else if (i == 0)
|
||||
{
|
||||
lbmname.Format ("%sScreenshot_%s_%04d%02d%02d_%02d%02d%02d.%s", fullname.GetChars(), gamename,
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec,
|
||||
extension);
|
||||
}
|
||||
else
|
||||
{
|
||||
lbmname.Format ("%sScreenshot_%s_%04d%02d%02d_%02d%02d%02d_%02d.%s", fullname.GetChars(), gamename,
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec,
|
||||
i, extension);
|
||||
}
|
||||
|
||||
if (!FileExists (lbmname.GetChars()))
|
||||
{
|
||||
fullname = lbmname;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue