bool ProjectManager::openProject(wxString projectPath)
{
   // Load Torque 6 DLL
   if ( mTorque6Library == NULL )
   {
#ifdef TORQUE_DEBUG
      mTorque6Library = openLibrary("Torque6_DEBUG");
#else
      mTorque6Library = openLibrary("Torque6");
#endif

      // Load Nessicary Functions
      mTorque6Init      = (initFunc)getLibraryFunc(mTorque6Library, "winInit");
      mTorque6Shutdown  = (shutdownFunc)getLibraryFunc(mTorque6Library, "winDestroy");
   }

   // If successful, initialize.
   if ( mTorque6Library && mTorque6Init && mTorque6Shutdown )
   {
      const char* argv[3];
      argv[0] = "Torque6Editor.exe";
      argv[1] = "-project";
      argv[2] = projectPath;

      mTorque6Init(3, argv, (HWND)mWindow->GetHWND());

      mProjectLoaded = true;
      mProjectPath = projectPath;
      wxDir projectDir(mProjectPath);
      mProjectName = projectDir.GetName();

      // Run a frame.
      Torque::Engine.mainLoop();

      // Editor Overlay
      Torque::Scene.pause();
      Torque::Debug.registerDebugMode("Editor", this);
      Torque::Debug.setDebugMode("Editor", true);

      // Editor Camera
      mEditorCamera.initialize(this);
      mRenderLayer4View = Torque::Graphics.getView("DeferredFinal", 1750, mEditorCamera.getRenderCamera());
      mEditorOverlayView = Torque::Graphics.getView("EditorOverlay", 6100, mEditorCamera.getRenderCamera());

      onProjectLoaded(mProjectName, projectPath);
      return true;
   }

   return false;
}
Beispiel #2
0
int main(int argc, const char **argv)
{

#ifdef TORQUE_DEBUG
   LIBRARY_HANDLE hGame = openLibrary("Torque6_DEBUG", "./");
#else
   LIBRARY_HANDLE hGame = openLibrary("Torque6", "./");
#endif

   if(hGame == NULL)
   {
      //printf("%s\n", dlerror());
      std::cout << "Failed to load libTorque6.so";
      return 0;
   }

   mainFunc enter = (mainFunc)getLibraryFunc(hGame, "unixmain");
   if(enter == NULL)
   {
      //printf("%s\n", dlerror());
      std::cout << "Failed to find unixmain.";
      return 0;
   } else {
      return enter(argc, argv);
   }

   return 0;
}
Beispiel #3
0
int main(int argc, const char **argv)
{
#ifdef TORQUE_DEBUG
   LIBRARY_HANDLE hGame = openLibrary("Torque6_DEBUG");
#else
   LIBRARY_HANDLE hGame = openLibrary("Torque6");
#endif

   mainFunc enter = (mainFunc)getLibraryFunc(hGame, "winmain");
   if ( enter != 0 )
      return enter(0, NULL);
   return 0;
}