|
|
@@ -12,13 +12,15 @@
|
|
|
#include "StdinListener.h"
|
|
|
#include "Input.h"
|
|
|
#include "Logger.h"
|
|
|
-#include "Globals.h"
|
|
|
+#include "Core/Globals.h"
|
|
|
#include "JobManager.h"
|
|
|
+#include "PhyDbgDrawer.h"
|
|
|
+#include "Scene.h"
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// handleMessageHanlderMsgs =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// handleMessageHanlderMsgs =
|
|
|
+//==============================================================================
|
|
|
void App::handleMessageHanlderMsgs(const char* file, int line, const char* func, const char* msg)
|
|
|
{
|
|
|
if(boost::find_first(msg, "Warning") || boost::find_first(msg, "Error"))
|
|
|
@@ -32,9 +34,9 @@ void App::handleMessageHanlderMsgs(const char* file, int line, const char* func,
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// parseCommandLineArgs =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// parseCommandLineArgs =
|
|
|
+//==============================================================================
|
|
|
void App::parseCommandLineArgs(int argc, char* argv[])
|
|
|
{
|
|
|
for(int i = 1; i < argc; i++)
|
|
|
@@ -57,9 +59,9 @@ void App::parseCommandLineArgs(int argc, char* argv[])
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// init =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// init =
|
|
|
+//==============================================================================
|
|
|
void App::init(int argc, char* argv[])
|
|
|
{
|
|
|
windowW = 1280;
|
|
|
@@ -109,6 +111,7 @@ void App::init(int argc, char* argv[])
|
|
|
initWindow();
|
|
|
initRenderer();
|
|
|
JobManagerSingleton::getInstance().init(4);
|
|
|
+ SceneSingleton::getInstance().getPhysMasterContainer().setDebugDrawer(new PhyDbgDrawer);
|
|
|
|
|
|
// other
|
|
|
activeCam = NULL;
|
|
|
@@ -118,9 +121,9 @@ void App::init(int argc, char* argv[])
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// initWindow =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// initWindow =
|
|
|
+//==============================================================================
|
|
|
void App::initWindow()
|
|
|
{
|
|
|
INFO("SDL window initializing...");
|
|
|
@@ -173,9 +176,9 @@ void App::initWindow()
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// initDirs =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// initDirs =
|
|
|
+//==============================================================================
|
|
|
void App::initDirs()
|
|
|
{
|
|
|
settingsPath = boost::filesystem::path(getenv("HOME")) / ".anki";
|
|
|
@@ -197,9 +200,9 @@ void App::initDirs()
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// initRenderer =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// initRenderer =
|
|
|
+//==============================================================================
|
|
|
void App::initRenderer()
|
|
|
{
|
|
|
RendererInitializer initializer;
|
|
|
@@ -227,9 +230,9 @@ void App::initRenderer()
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// togleFullScreen =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// togleFullScreen =
|
|
|
+//==============================================================================
|
|
|
void App::togleFullScreen()
|
|
|
{
|
|
|
//SDL_WM_ToggleFullScreen(mainSurf);
|
|
|
@@ -238,9 +241,9 @@ void App::togleFullScreen()
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// swapBuffers =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// swapBuffers =
|
|
|
+//==============================================================================
|
|
|
void App::swapBuffers()
|
|
|
{
|
|
|
//SDL_GL_SwapBuffers();
|
|
|
@@ -248,9 +251,9 @@ void App::swapBuffers()
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// quit =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// quit =
|
|
|
+//==============================================================================
|
|
|
void App::quit(int code)
|
|
|
{
|
|
|
SDL_FreeSurface(iconImage);
|
|
|
@@ -261,9 +264,9 @@ void App::quit(int code)
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// printAppInfo =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// printAppInfo =
|
|
|
+//==============================================================================
|
|
|
#if !defined(REVISION)
|
|
|
#define REVISION "unknown"
|
|
|
#endif
|
|
|
@@ -295,9 +298,9 @@ void App::printAppInfo()
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// getDesktopWidth =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// getDesktopWidth =
|
|
|
+//==============================================================================
|
|
|
uint App::getDesktopWidth() const
|
|
|
{
|
|
|
SDL_DisplayMode mode;
|
|
|
@@ -307,9 +310,9 @@ uint App::getDesktopWidth() const
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// getDesktopHeight =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// getDesktopHeight =
|
|
|
+//==============================================================================
|
|
|
uint App::getDesktopHeight() const
|
|
|
{
|
|
|
SDL_DisplayMode mode;
|
|
|
@@ -319,9 +322,9 @@ uint App::getDesktopHeight() const
|
|
|
}
|
|
|
|
|
|
|
|
|
-//======================================================================================================================
|
|
|
-// execStdinScpripts =
|
|
|
-//======================================================================================================================
|
|
|
+//==============================================================================
|
|
|
+// execStdinScpripts =
|
|
|
+//==============================================================================
|
|
|
void App::execStdinScpripts()
|
|
|
{
|
|
|
while(1)
|