182 lines
No EOL
5.5 KiB
C#
182 lines
No EOL
5.5 KiB
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace TeaBox.Code
|
|
{
|
|
/// <summary>
|
|
/// Contains the naming convention of the engine executable.
|
|
/// </summary>
|
|
public class EngineExecutable
|
|
{
|
|
public static readonly Dictionary<DevEnvBuildVariant, string> BuildExeSuffix = new Dictionary<DevEnvBuildVariant, string>
|
|
{
|
|
{ DevEnvBuildVariant.Debug, "d" },
|
|
{ DevEnvBuildVariant.Release, "r" },
|
|
{ DevEnvBuildVariant.Final, "f" }
|
|
};
|
|
|
|
private static readonly Dictionary<Platform, string> BuildExePrefix = new Dictionary<Platform, string>
|
|
{
|
|
{ Platform.Cafe, "wiiu_" },
|
|
{ Platform.Durango, "durango_" },
|
|
{ Platform.Scarlett, "scarlett_" },
|
|
{ Platform.Orbis, "orbis_" },
|
|
{ Platform.Prospero, "prospero_" },
|
|
{ Platform.PS3, "ps3_" },
|
|
{ Platform.wii, "wii_" },
|
|
{ Platform.x360, "x360_" },
|
|
{ Platform.win32, "" },
|
|
{ Platform.win64, "" },
|
|
{ Platform.PC, "" },
|
|
{ Platform.GGP, "_reserved9_" }
|
|
};
|
|
|
|
private readonly Platform _platform;
|
|
private readonly DevEnvBuildVariant _variant;
|
|
|
|
public EngineExecutable(Platform platform, DevEnvBuildVariant variant)
|
|
{
|
|
_platform = platform;
|
|
_variant = variant;
|
|
}
|
|
|
|
public string OutputDirectory
|
|
{
|
|
get
|
|
{
|
|
switch (_platform)
|
|
{
|
|
case Platform.win32:
|
|
return UAFConstants.GetBinFolder(_variant);
|
|
|
|
case Platform.win64:
|
|
return UAFConstants.GetBinFolder(_variant);
|
|
|
|
case Platform.Cafe:
|
|
return Path.Combine(UAFConstants.GetBinFolder(_variant), @"platforms\" + "wiiu");
|
|
|
|
default:
|
|
return Path.Combine(UAFConstants.GetBinFolder(_variant), @"platforms\" + _platform.ToString().ToLower());
|
|
}
|
|
}
|
|
}
|
|
|
|
public string DeliveredPlatformName
|
|
{
|
|
get
|
|
{
|
|
switch (_platform)
|
|
{
|
|
case Platform.Cafe:
|
|
return "wiiu";
|
|
|
|
case Platform.Durango:
|
|
return "xboxone";
|
|
|
|
case Platform.Orbis:
|
|
return "ps4";
|
|
|
|
case Platform.win32:
|
|
return "win32";
|
|
|
|
case Platform.win64:
|
|
return "win64";
|
|
|
|
case Platform.PC:
|
|
return "pc";
|
|
|
|
case Platform.GGP:
|
|
return "ggp";
|
|
|
|
case Platform.Scarlett:
|
|
return "xboxsx";
|
|
|
|
case Platform.Prospero:
|
|
return "ps5";
|
|
|
|
default:
|
|
return _platform.ToString();
|
|
}
|
|
}
|
|
}
|
|
|
|
public string DeliveredDirectory
|
|
{
|
|
get
|
|
{
|
|
switch (_platform)
|
|
{
|
|
case Platform.win32:
|
|
case Platform.win64:
|
|
return Path.Combine(UAFConstants.EngineRootDir);
|
|
|
|
case Platform.Cafe:
|
|
case Platform.Orbis:
|
|
case Platform.Prospero:
|
|
case Platform.Durango:
|
|
case Platform.Scarlett:
|
|
return Path.Combine(Path.Combine(UAFConstants.EngineRootDir),
|
|
$@"platforms\{DeliveredPlatformName}");
|
|
|
|
default:
|
|
return Path.Combine(Path.Combine(UAFConstants.EngineRootDir), @"platforms\" + _platform.ToString().ToLower());
|
|
}
|
|
}
|
|
}
|
|
|
|
public string OutputFileName
|
|
{
|
|
get
|
|
{
|
|
return Path.Combine(OutputDirectory, ExecutableName);
|
|
}
|
|
}
|
|
|
|
public string DeliveredFileName
|
|
{
|
|
get
|
|
{
|
|
return Path.Combine(DeliveredDirectory, ExecutableName);
|
|
}
|
|
}
|
|
|
|
public string ExecutableName
|
|
{
|
|
get
|
|
{
|
|
switch (_platform)
|
|
{
|
|
case Platform.win32:
|
|
return $"{BuildExePrefix[_platform]}ua_engine.{_platform.ExecutableExtension()}";
|
|
|
|
case Platform.win64:
|
|
return $"{BuildExePrefix[_platform]}ua_engine.{_platform.ExecutableExtension()}";
|
|
|
|
case Platform.PC:
|
|
return $"{UAFConstants.GameName}.{_platform.ExecutableExtension()}";
|
|
|
|
default:
|
|
return
|
|
$"{BuildExePrefix[_platform]}ua_engine_{BuildExeSuffix[_variant]}.{_platform.ExecutableExtension()}";
|
|
}
|
|
}
|
|
}
|
|
|
|
public string DiscExecutableName
|
|
{
|
|
get
|
|
{
|
|
switch (_platform)
|
|
{
|
|
case Platform.Orbis:
|
|
case Platform.Prospero:
|
|
return "eboot.bin";
|
|
|
|
default:
|
|
return
|
|
$"{BuildExePrefix[_platform]}ua_engine_{BuildExeSuffix[_variant]}.{_platform.ExecutableExtension()}";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |