本文整理汇总了C++中ToolEnvironment::GetCoreDataDir方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolEnvironment::GetCoreDataDir方法的具体用法?C++ ToolEnvironment::GetCoreDataDir怎么用?C++ ToolEnvironment::GetCoreDataDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolEnvironment
的用法示例。
在下文中一共展示了ToolEnvironment::GetCoreDataDir方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Run
void PlayCmd::Run()
{
LOGINFOF("Playing project");
ToolSystem* tsystem = GetSubsystem<ToolSystem>();
ToolEnvironment* env = GetSubsystem<ToolCore::ToolEnvironment>();
Project* project = tsystem->GetProject();
const String& editorBinary = env->GetEditorBinary();
Vector<String> paths;
paths.Push(env->GetCoreDataDir());
paths.Push(env->GetPlayerDataDir());
paths.Push(project->GetResourcePath());
// fixme: this is for loading from cache
paths.Push(project->GetProjectPath());
paths.Push(project->GetProjectPath() + "Cache");
String resourcePaths;
resourcePaths.Join(paths, "!");
Vector<String> vargs;
String args = ToString("--player --project \"%s\"", AddTrailingSlash(project->GetProjectPath()).CString());
vargs = args.Split(' ');
//vargs.Insert(0, "--player");
// TODO: use IPC (maybe before this set log location/access the log and output it, we need access to errors)
LaunchPlayerProcess(editorBinary, vargs, "");
Finished();
}
示例2: GetDefaultResourcePaths
void BuildBase::GetDefaultResourcePaths(Vector<String>& paths)
{
paths.Clear();
ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
paths.Push(AddTrailingSlash(tenv->GetCoreDataDir()));
paths.Push(AddTrailingSlash(tenv->GetPlayerDataDir()));
}
示例3: Setup
void AEEditorApp::Setup()
{
context_->SetEditorContext(true);
ToolEnvironment* env = new ToolEnvironment(context_);
context_->RegisterSubsystem(env);
ToolSystem* system = new ToolSystem(context_);
context_->RegisterSubsystem(system);
#ifdef ATOMIC_DEV_BUILD
if (!env->InitFromJSON())
{
ErrorExit(ToString("Unable to initialize tool environment from %s", env->GetDevConfigFilename().CString()));
return;
}
#else
env->InitFromPackage();
#endif
engineParameters_["WindowTitle"] = "AtomicEditor";
engineParameters_["WindowResizable"] = true;
engineParameters_["FullScreen"] = false;
engineParameters_["LogLevel"] = LOG_DEBUG;
FileSystem* filesystem = GetSubsystem<FileSystem>();
engineParameters_["LogName"] = filesystem->GetAppPreferencesDir("AtomicEditor", "Logs") + "AtomicEditor.log";
#ifdef ATOMIC_PLATFORM_OSX
engineParameters_["WindowIcon"] = "Images/AtomicLogo32.png";
#endif
#ifdef ATOMIC_DEV_BUILD
engineParameters_["ResourcePrefixPath"] = "";
String ScriptPath = env->GetRootSourceDir() + "Script";
String resourcePaths = env->GetCoreDataDir() + ";" + env->GetEditorDataDir() + ";" + ScriptPath;
engineParameters_["ResourcePaths"] = resourcePaths;
#else
#ifdef ATOMIC_PLATFORM_OSX
engineParameters_["ResourcePrefixPath"] = "../Resources";
#else
engineParameters_["ResourcePrefixPath"] = filesystem->GetProgramDir() + "Resources";
#endif
engineParameters_["ResourcePaths"] = "CoreData;EditorData;Script";
#endif // ATOMIC_DEV_BUILD
}
示例4: PlayProject
bool EditorMode::PlayProject(String addArgs, bool debug)
{
ToolEnvironment* env = GetSubsystem<ToolEnvironment>();
ToolSystem* tsystem = GetSubsystem<ToolSystem>();
const String& editorBinary = env->GetEditorBinary();
Project* project = tsystem->GetProject();
if (!project)
return false;
Vector<String> paths;
paths.Push(env->GetCoreDataDir());
paths.Push(env->GetPlayerDataDir());
paths.Push(project->GetResourcePath());
// fixme: this is for loading from cache
paths.Push(project->GetProjectPath());
paths.Push(project->GetProjectPath() + "Cache");
String resourcePaths;
resourcePaths.Join(paths, "!");
Vector<String> vargs;
String args = ToString("--player --project \"%s\"", AddTrailingSlash(project->GetProjectPath()).CString());
vargs = args.Split(' ');
if (debug)
vargs.Insert(0, "--debug");
if (addArgs.Length() > 0)
vargs.Insert(0, addArgs.Split(' '));
String dump;
dump.Join(vargs, " ");
LOGINFOF("Launching Broker %s %s", editorBinary.CString(), dump.CString());
IPC* ipc = GetSubsystem<IPC>();
playerBroker_ = ipc->SpawnWorker(editorBinary, vargs);
if (playerBroker_)
{
SubscribeToEvent(playerBroker_, E_IPCJSERROR, HANDLER(EditorMode, HandleIPCJSError));
SubscribeToEvent(playerBroker_, E_IPCWORKEREXIT, HANDLER(EditorMode, HandleIPCWorkerExit));
SubscribeToEvent(playerBroker_, E_IPCWORKERLOG, HANDLER(EditorMode, HandleIPCWorkerLog));
}
return playerBroker_.NotNull();
}
示例5: Setup
void AEEditorApp::Setup()
{
context_->SetEditorContext(true);
AEEditorCommon::Setup();
ToolEnvironment* env = GetSubsystem<ToolEnvironment>();
engineParameters_["WindowTitle"] = "AtomicEditor";
engineParameters_["WindowResizable"] = true;
engineParameters_["FullScreen"] = false;
engineParameters_["LogLevel"] = LOG_DEBUG;
FileSystem* filesystem = GetSubsystem<FileSystem>();
engineParameters_["LogName"] = filesystem->GetAppPreferencesDir("AtomicEditor", "Logs") + "AtomicEditor.log";
#ifdef ATOMIC_PLATFORM_OSX
engineParameters_["WindowIcon"] = "Images/AtomicLogo32.png";
#endif
#ifdef ATOMIC_DEV_BUILD
engineParameters_["ResourcePrefixPath"] = "";
String resourcePaths = env->GetCoreDataDir() + ";" + env->GetEditorDataDir();
// for dev builds, add the compile editor scripts from artifacts
resourcePaths += ";" + env->GetRootSourceDir() + "Artifacts/Build/Resources/EditorData/";
engineParameters_["ResourcePaths"] = resourcePaths;
#else
#ifdef ATOMIC_PLATFORM_OSX
engineParameters_["ResourcePrefixPath"] = "../Resources";
#else
engineParameters_["ResourcePrefixPath"] = filesystem->GetProgramDir() + "Resources";
#endif
engineParameters_["ResourcePaths"] = "CoreData;EditorData";
#endif // ATOMIC_DEV_BUILD
ReadPreferences();
}
示例6: PlayProject
bool EditorMode::PlayProject(String addArgs, bool debug)
{
FileSystem* fileSystem = GetSubsystem<FileSystem>();
ToolSystem* tsystem = GetSubsystem<ToolSystem>();
Project* project = tsystem->GetProject();
if (!project)
return false;
ToolEnvironment* env = GetSubsystem<ToolEnvironment>();
String playerBinary = env->GetEditorBinary();
// TODO: We need to configure project as managed
bool managed = false;
if (fileSystem->FileExists(project->GetResourcePath() + "AtomicProject.dll"))
{
managed = true;
playerBinary = env->GetAtomicNETManagedIPCPlayerBinary();
}
Vector<String> paths;
paths.Push(env->GetCoreDataDir());
paths.Push(env->GetPlayerDataDir());
paths.Push(project->GetResourcePath());
// fixme: this is for loading from cache
paths.Push(project->GetProjectPath());
paths.Push(project->GetProjectPath() + "Cache");
String resourcePaths;
resourcePaths.Join(paths, "!");
Vector<String> vargs;
String args = ToString("--player --project \"%s\"", AddTrailingSlash(project->GetProjectPath()).CString());
vargs = args.Split(' ');
if (managed)
{
vargs.Insert(0, ToString("\"%s\"", (fileSystem->GetProgramDir() + "Resources/").CString()));
vargs.Insert(0, "--resourcePrefix");
}
if (debug)
vargs.Insert(0, "--debug");
if (addArgs.Length() > 0)
vargs.Insert(0, addArgs.Split(' '));
String dump;
dump.Join(vargs, " ");
ATOMIC_LOGINFOF("Launching Broker %s %s", playerBinary.CString(), dump.CString());
IPC* ipc = GetSubsystem<IPC>();
playerBroker_ = ipc->SpawnWorker(playerBinary, vargs);
if (playerBroker_)
{
SubscribeToEvent(playerBroker_, E_IPCWORKERSTART, ATOMIC_HANDLER(EditorMode, HandleIPCWorkerStarted));
SubscribeToEvent(E_IPCPLAYERPAUSERESUMEREQUEST, ATOMIC_HANDLER(EditorMode, HandleIPCPlayerPauseResumeRequest));
SubscribeToEvent(E_IPCPLAYERUPDATESPAUSEDRESUMED, ATOMIC_HANDLER(EditorMode, HandleIPCPlayerUpdatesPausedResumed));
SubscribeToEvent(E_IPCPLAYERPAUSESTEPREQUEST, ATOMIC_HANDLER(EditorMode, HandleIPCPlayerPauseStepRequest));
SubscribeToEvent(E_IPCPLAYEREXITREQUEST, ATOMIC_HANDLER(EditorMode, HandleIPCPlayerExitRequest));
SubscribeToEvent(playerBroker_, E_IPCJSERROR, ATOMIC_HANDLER(EditorMode, HandleIPCJSError));
SubscribeToEvent(playerBroker_, E_IPCWORKEREXIT, ATOMIC_HANDLER(EditorMode, HandleIPCWorkerExit));
SubscribeToEvent(playerBroker_, E_IPCWORKERLOG, ATOMIC_HANDLER(EditorMode, HandleIPCWorkerLog));
}
return playerBroker_.NotNull();
}