mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-06-03 10:41:12 +00:00
Update to ZDoom r1418:
- Fixed parsing for MustConfirm key in skill parser. - Converted internal MAPINFOs to new syntax. - Added a range parameter to SNDINFO's $limit. - Restored Dehacked music name replacement. - Added GUICapture mouse events for Win32. - Changed I_GetFromClipboard() to return an FString. - Added GTK+-based clipboard support for Linux. - Fixed: Most Linux filesystems do not fill in d_type for scandir(), so we cannot rely on it to detect directories. - Added NicePath() function to perform shell-style ~ substitution on path names. - Changed the default screenshot directory on Unix to ~/.zdoom/screenshots/. - Added -shotdir command line option to temporarily override the screenshot_dir cvar. - Fixed: G_SerializeLevel must use the TEXMAN_ReturnFirst flag for getting the sky textures so that it still works when the first texture in a TEXTURE1 lump is used as sky. - Restored the old drawseg/sprite distance check from 2.0.63. The code that replaced it did the check at the center of the area intersected by the sprite and the drawseg, whereas 2.0.63 only did the check at the location of the sprite on the map. - Commented out the CALL_ACTION(A_Look, actor) for targetless friendly monsters in A_DoChase(). They can still find new targets without this, and with it, they got stuck on the first frame of their see state. - Fixed: Keys bound in a custom key section would unbind the key in the main game section. - Fixed scrolling of the automap background on a rotated automap. - Changed singleplayer allowrespawn to act like a co-op game when you change levels while dead by immediately respawning you before the switch so that you get to keep all your inventory. - Fixed: G_InitLevelLocals() did not set flags2. - fixed: The compatibility parser applied the last map's settings to all maps in the compatibility list. - Added compatibility settings for a few more levels in some classic WADs. - Added spechit overflow workaround for Strain MAP07. This is highly map specific because the original behavior cannot be restored. - Added a check for Doom's IWAD levels that forces COMPAT_SHORTTEX for them. MD5 cannot be used well here because there's many different IWADs with slightly different levels. This is only done for Doom format levels to ensure that custom IWADs for ZDoom are not affected. - fixed: level.flags2 was not reset at level start. - Fixed: Morph powerups can change the actor picking up the item so AInventory::CallTryPickup must be able to return the new actor. - Fixed: ACS's GiveInventory may not assume that a PlayerPawn is still attached to the player data after an item has been given. - Added a missing NULL pointer check to DBaseStatusBar::Blendview. - Added a compatibility lump because I think it's a shame that Void doesn't work properly on new ZDooms after all the collaboration I had with Cyb on that map. (Works with other maps, too.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@298 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
ad59f4da77
commit
5e8c5c3305
70 changed files with 4299 additions and 2368 deletions
102
src/cmdlib.cpp
102
src/cmdlib.cpp
|
@ -2,6 +2,10 @@
|
|||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
#include "doomtype.h"
|
||||
#include "cmdlib.h"
|
||||
|
@ -345,25 +349,20 @@ const char *myasctime ()
|
|||
/* CreatePath: creates a directory including all levels necessary */
|
||||
/* */
|
||||
/************************************************************************/
|
||||
#ifdef _WIN32
|
||||
void DoCreatePath(const char * fn)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
char drive[_MAX_DRIVE];
|
||||
#endif
|
||||
char path[PATH_MAX];
|
||||
char p[PATH_MAX];
|
||||
int i;
|
||||
char drive[_MAX_DRIVE];
|
||||
char path[PATH_MAX];
|
||||
char p[PATH_MAX];
|
||||
int i;
|
||||
|
||||
#ifdef _WIN32
|
||||
_splitpath(fn,drive,path,NULL,NULL);
|
||||
_makepath(p,drive,path,NULL,NULL);
|
||||
i=(int)strlen(p);
|
||||
if (p[i-1]=='/' || p[i-1]=='\\') p[i-1]=0;
|
||||
if (*path) DoCreatePath(p);
|
||||
_mkdir(p);
|
||||
#else
|
||||
// FIXME: write me
|
||||
#endif
|
||||
}
|
||||
|
||||
void CreatePath(const char * fn)
|
||||
|
@ -378,6 +377,36 @@ void CreatePath(const char * fn)
|
|||
}
|
||||
else DoCreatePath(fn);
|
||||
}
|
||||
#else
|
||||
void CreatePath(const char *fn)
|
||||
{
|
||||
char *copy, *p;
|
||||
|
||||
if (fn[0] == '/' && fn[1] == '\0')
|
||||
{
|
||||
return;
|
||||
}
|
||||
p = copy = strdup(fn);
|
||||
do
|
||||
{
|
||||
p = strchr(p + 1, '/');
|
||||
if (p != NULL)
|
||||
{
|
||||
*p = '\0';
|
||||
}
|
||||
printf("%s\n", copy);
|
||||
if (mkdir(copy, 0755) == -1)
|
||||
{ // failed
|
||||
return;
|
||||
}
|
||||
if (p != NULL)
|
||||
{
|
||||
*p = '/';
|
||||
}
|
||||
} while (p);
|
||||
free(copy);
|
||||
}
|
||||
#endif
|
||||
|
||||
// [RH] Replaces the escape sequences in a string with actual escaped characters.
|
||||
// This operation is done in-place. The result is the new length of the string.
|
||||
|
@ -626,3 +655,56 @@ FString ExpandEnvVars(const char *searchpathstring)
|
|||
return out;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// NicePath
|
||||
//
|
||||
// Handles paths with leading ~ characters on Unix as well as environment
|
||||
// variable substitution. On Windows, this is identical to ExpandEnvVars.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FString NicePath(const char *path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return ExpandEnvVars(path);
|
||||
#else
|
||||
if (path == NULL || *path == '\0')
|
||||
{
|
||||
return FString("");
|
||||
}
|
||||
if (*path != '~')
|
||||
{
|
||||
return ExpandEnvVars(path);
|
||||
}
|
||||
|
||||
passwd *pwstruct;
|
||||
const char *slash;
|
||||
|
||||
if (path[1] == '/' || path[1] == '\0')
|
||||
{ // Get my home directory
|
||||
pwstruct = getpwuid(getuid());
|
||||
slash = path + 1;
|
||||
}
|
||||
else
|
||||
{ // Get somebody else's home directory
|
||||
slash = strchr(path, '/');
|
||||
if (slash == NULL)
|
||||
{
|
||||
slash = path + strlen(path);
|
||||
}
|
||||
FString who(path, slash - path);
|
||||
pwstruct = getpwnam(who);
|
||||
}
|
||||
if (pwstruct == NULL)
|
||||
{
|
||||
return ExpandEnvVars(path);
|
||||
}
|
||||
FString where(pwstruct->pw_dir);
|
||||
if (*slash != '\0')
|
||||
{
|
||||
where += ExpandEnvVars(slash);
|
||||
}
|
||||
return where;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue