- backend update from GZDoom.

mainly TAngle overhaul and needed code adjustments.
This commit is contained in:
Christoph Oelckers 2022-08-26 18:28:22 +02:00
parent ca1171187f
commit 111dbd7a7d
26 changed files with 322 additions and 240 deletions

View file

@ -410,6 +410,23 @@ FString I_GetFromClipboard (bool use_primary_selection)
return "";
}
FString I_GetCWD()
{
char* curdir = get_current_dir_name();
if (!curdir)
{
return "";
}
FString ret(curdir);
free(curdir);
return ret;
}
bool I_ChDir(const char* path)
{
return chdir(path) == 0;
}
// Return a random seed, preferably one with lots of entropy.
unsigned int I_MakeRNGSeed()
{
@ -431,3 +448,21 @@ unsigned int I_MakeRNGSeed()
}
return seed;
}
void I_OpenShellFolder(const char* infolder)
{
char* curdir = get_current_dir_name();
if (!chdir(infolder))
{
Printf("Opening folder: %s\n", infolder);
std::system("xdg-open .");
chdir(curdir);
}
else
{
Printf("Unable to open directory '%s\n", infolder);
}
free(curdir);
}