Revision: 2771
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2771&view=rev
Author:   rorthomas
Date:     2012-06-02 19:06:28 +0000 (Sat, 02 Jun 2012)
Log Message:
-----------
collision debug working again

Modified Paths:
--------------
    trunk/source/main/gameplay/RoRFrameListener.cpp
    trunk/source/main/gameplay/RoRFrameListener.h
    trunk/source/main/physics/collision/Collisions.cpp
    trunk/source/main/terrain/TerrainManager.cpp

Modified: trunk/source/main/gameplay/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.cpp     2012-06-02 18:19:51 UTC 
(rev 2770)
+++ trunk/source/main/gameplay/RoRFrameListener.cpp     2012-06-02 19:06:28 UTC 
(rev 2771)
@@ -668,7 +668,6 @@
 RoRFrameListener::RoRFrameListener(AppState *parentState, String inputhwnd) :
        clutch(0),
        dashboard(0),
-       debugCollisions(false),
        dof(0),
        flaresMode(3), // on by default
        forcefeedback(0),
@@ -811,8 +810,6 @@
        windowResized(gEnv->renderWindow);
        RoRWindowEventUtilities::addWindowEventListener(gEnv->renderWindow, 
this);
 
-       debugCollisions = BSETTING("Debug Collisions", false);
-
        // get lights mode
        String lightsMode = SSETTING("Lights", "Only current vehicle, main 
lights");
        if (lightsMode == "None (fastest)")

Modified: trunk/source/main/gameplay/RoRFrameListener.h
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.h       2012-06-02 18:19:51 UTC 
(rev 2770)
+++ trunk/source/main/gameplay/RoRFrameListener.h       2012-06-02 19:06:28 UTC 
(rev 2771)
@@ -97,7 +97,6 @@
        OverlayWrapper *ow;
        bool benchmarking;
        bool chatlock;
-       bool debugCollisions;
        bool dirvisible;
        bool enablePosStor;
        bool flipflop;

Modified: trunk/source/main/physics/collision/Collisions.cpp
===================================================================
--- trunk/source/main/physics/collision/Collisions.cpp  2012-06-02 18:19:51 UTC 
(rev 2770)
+++ trunk/source/main/physics/collision/Collisions.cpp  2012-06-02 19:06:28 UTC 
(rev 2771)
@@ -124,7 +124,7 @@
 {
        hFinder = gEnv->terrainManager->getHeightFinder();
 
-       debugMode = BSETTING("Collision Debug Mode", false);
+       debugMode = BSETTING("Debug Collisions", false);
        for (int i=0; i < HASH_POWER; i++)
        {
                hashmask = hashmask << 1;
@@ -1769,5 +1769,7 @@
                debugmo->end();
                debugsn->setPosition(Vector3::ZERO);
                debugsn->attachObject(debugmo);
+
+               createCollisionDebugVisualization();
        }
 }

Modified: trunk/source/main/terrain/TerrainManager.cpp
===================================================================
--- trunk/source/main/terrain/TerrainManager.cpp        2012-06-02 18:19:51 UTC 
(rev 2770)
+++ trunk/source/main/terrain/TerrainManager.cpp        2012-06-02 19:06:28 UTC 
(rev 2771)
@@ -134,9 +134,6 @@
 
 
 
-       //if (debugCollisions)
-               //collisions->createCollisionDebugVisualization();
-
        // bake the decals
        //finishTerrainDecal();
 
@@ -157,6 +154,10 @@
        PROGRESS_WINDOW(19, _L("Initializing Collision Subsystem"));
        initCollisions();
 
+       // scripting
+       PROGRESS_WINDOW(19, _L("Initializing Script Subsystem"));
+       initScripting();
+
        // shadows
        PROGRESS_WINDOW(21, _L("Initializing Shadow Subsystem"));
        initShadows();
@@ -517,34 +518,38 @@
 void TerrainManager::initScripting()
 {
 #ifdef USE_ANGELSCRIPT
-       if (!BSETTING("netmode", false))
+       bool loaded = false;
+
+       // only load terrain scripts while not in multiplayer
+       if (!gEnv->network)
        {
-               ConfigFile::SettingsIterator objectsIterator = 
mTerrainConfig.getSettingsIterator("scripts");
-               bool loaded = false;
-               while (objectsIterator.hasMoreElements())
+               try
                {
-                       String sname = objectsIterator.peekNextKey();
-                       StringUtil::trim(sname);
-                       String svalue = objectsIterator.getNext();
-                       StringUtil::trim(svalue);
+                       ConfigFile::SettingsIterator objectsIterator = 
mTerrainConfig.getSettingsIterator("Scripts");
+                       while (objectsIterator.hasMoreElements())
+                       {
+                               String sname = objectsIterator.peekNextKey();
+                               StringUtil::trim(sname);
+                               String svalue = objectsIterator.getNext();
+                               StringUtil::trim(svalue);
 
-                       ScriptEngine::getSingleton().loadScript(sname);
-                       loaded = true;
-               }
-               if (loaded)
+                               ScriptEngine::getSingleton().loadScript(sname);
+                               loaded = true;
+                       }
+               } catch(Exception &e)
                {
-                       // load a default script that does the most basic things
-                       ScriptEngine::getSingleton().loadScript("default.as");
+                       LOG("Exception while trying load script");
                }
-       } else
+       }
+       
+       if (!loaded)
        {
-               // load the default stscriptuff so spawners will work in 
multiplayer
+               // load a default script that does the most basic things
                ScriptEngine::getSingleton().loadScript("default.as");
        }
-
        // finally activate AS logging, so we dont spam the users screen with 
initialization messages
        ScriptEngine::getSingleton().activateLogging();
-#endif
+#endif //USE_ANGELSCRIPT
 }
 
 void TerrainManager::setGravity(float value)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
Rigsofrods-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to