Revision: 2700
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2700&view=rev
Author:   rorthomas
Date:     2012-05-26 04:48:03 +0000 (Sat, 26 May 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/source/main/gameplay/ChatSystem.cpp
    trunk/source/main/gameplay/ChatSystem.h
    trunk/source/main/gameplay/RoRFrameListener.cpp

Modified: trunk/source/main/gameplay/ChatSystem.cpp
===================================================================
--- trunk/source/main/gameplay/ChatSystem.cpp   2012-05-26 04:40:49 UTC (rev 
2699)
+++ trunk/source/main/gameplay/ChatSystem.cpp   2012-05-26 04:48:03 UTC (rev 
2700)
@@ -38,7 +38,7 @@
 
 template<> ChatSystemFactory *StreamableFactory < ChatSystemFactory, 
ChatSystem >::_instance = 0;
 
-ChatSystemFactory::ChatSystemFactory(Network *net) : net(net)
+ChatSystemFactory::ChatSystemFactory()
 {
 }
 
@@ -50,7 +50,7 @@
 {
        lockStreams();
        std::map < int, std::map < unsigned int, ChatSystem *> > &streamables = 
getStreams();
-       ChatSystem *ch = new ChatSystem(net, -1, 0, playerColour, false);
+       ChatSystem *ch = new ChatSystem(-1, 0, playerColour, false);
        streamables[-1][0] = ch;
        unlockStreams();
        return ch;
@@ -61,7 +61,7 @@
        // NO LOCKS IN HERE, already locked
 
        LOG(" new chat system for " + TOSTRING(reg->sourceid) + ":" + 
TOSTRING(reg->streamid) + ", colour: " + TOSTRING(reg->colour));
-       ChatSystem *ch = new ChatSystem(net, reg->sourceid, reg->streamid, 
reg->colour, true);
+       ChatSystem *ch = new ChatSystem(reg->sourceid, reg->streamid, 
reg->colour, true);
 
        // already locked
        //lockStreams();
@@ -106,8 +106,7 @@
 
 
 
-ChatSystem::ChatSystem(Network *net, int source, unsigned int streamid, int 
colourNumber, bool remote) :
-       net(net),
+ChatSystem::ChatSystem(int source, unsigned int streamid, int colourNumber, 
bool remote) :
        source(source),
        streamid(streamid),
        colourNumber(colourNumber),
@@ -119,7 +118,7 @@
 #ifdef USE_SOCKETW
        if(remote)
        {
-               client_t *c = net->getClientInfo(source);
+               client_t *c = gEnv->network->getClientInfo(source);
                if(c)
                {
                        username = getColouredName(*c);
@@ -175,10 +174,10 @@
                {
                        UTFString msg = username + normalColour + ": " + 
tryConvertUTF(buffer);
                        
Console::getSingleton().putMessage(Console::CONSOLE_MSGTYPE_NETWORK, 
Console::CONSOLE_CHAT, msg, "user_comment.png");
-               } else if(source == (int)net->getUID())
+               } else if(source == (int)gEnv->network->getUID())
                {
                        // our message bounced back :D
-                       UTFString msg = net->getNickname(true) + normalColour + 
": " + tryConvertUTF(buffer);
+                       UTFString msg = gEnv->network->getNickname(true) + 
normalColour + ": " + tryConvertUTF(buffer);
                        
Console::getSingleton().putMessage(Console::CONSOLE_MSGTYPE_NETWORK, 
Console::CONSOLE_CHAT, msg, "user_comment.png");
                }
        }
@@ -209,7 +208,7 @@
 {
 #ifdef USE_SOCKETW
        client_t c[MAX_PEERS];
-       if(net->getClientInfos(c)) return 0;
+       if(gEnv->network->getClientInfos(c)) return 0;
 
        for(int i = 0; i < MAX_PEERS; i++)
        {
@@ -226,7 +225,7 @@
 #ifdef USE_SOCKETW
        // first: find id to username:
        client_t c[MAX_PEERS];
-       if(net->getClientInfos(c))
+       if(gEnv->network->getClientInfos(c))
                return;
        int target_uid = -1, target_index = -1;
        for(int i = 0; i < MAX_PEERS; i++)
@@ -272,13 +271,13 @@
 
        if(username.empty())
        {
-               client_t *c = net->getClientInfo(target_uid);
+               client_t *c = gEnv->network->getClientInfo(target_uid);
                if(c) username = getColouredName(*c);
        }
 
        // add local visual
 #ifdef USE_MYGUI
-       UTFString nmsg = net->getNickname(true) + normalColour + whisperColour 
+ _L(" [whispered to ") + normalColour + username + whisperColour + "]" + 
normalColour + ": " + chatline;
+       UTFString nmsg = gEnv->network->getNickname(true) + normalColour + 
whisperColour + _L(" [whispered to ") + normalColour + username + whisperColour 
+ "]" + normalColour + ": " + chatline;
        Console::getSingleton().putMessage(Console::CONSOLE_MSGTYPE_NETWORK, 
Console::CONSOLE_LOCAL_CHAT, nmsg, "script_key.png");
 #endif // USE_MYGUI
 #endif // USE_SOCKETW

Modified: trunk/source/main/gameplay/ChatSystem.h
===================================================================
--- trunk/source/main/gameplay/ChatSystem.h     2012-05-26 04:40:49 UTC (rev 
2699)
+++ trunk/source/main/gameplay/ChatSystem.h     2012-05-26 04:48:03 UTC (rev 
2700)
@@ -32,7 +32,7 @@
 
 public:
 
-       ChatSystem(Network *net, int source=-1, unsigned int streamid=0, int 
colourNumber=0, bool remote=true);
+       ChatSystem(int source=-1, unsigned int streamid=0, int colourNumber=0, 
bool remote=true);
        ~ChatSystem();
 
        void sendChat(Ogre::UTFString chatline);
@@ -48,8 +48,6 @@
        static const Ogre::UTFString commandColour, normalColour, 
whisperColour, scriptCommandColour;
 
 protected:
-
-       Network *net;
        int source;
        int streamid;
        int colourNumber;
@@ -67,18 +65,15 @@
 
 public:
 
-       ChatSystemFactory(Network *net);
+       ChatSystemFactory();
        ~ChatSystemFactory();
 
        ChatSystem *createLocal(int playerColour);
        ChatSystem *createRemoteInstance(stream_reg_t *reg);
 
-       void setNetwork(Network *net) { this->net = net; };
        ChatSystem *getFirstChatSystem();
 
 protected:
-
-       Network *net;
        // functions used by friends
        void netUserAttributesChanged(int source, int streamid) {};
        void localUserAttributesChanged(int newid) {};

Modified: trunk/source/main/gameplay/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.cpp     2012-05-26 04:40:49 UTC 
(rev 2699)
+++ trunk/source/main/gameplay/RoRFrameListener.cpp     2012-05-26 04:48:03 UTC 
(rev 2700)
@@ -548,7 +548,8 @@
                        
ow->hsibugtexture->setTextureRotate(Radian(dirangle)-Degree(curr_truck->autopilot->heading));
                        float vdev=0;
                        float hdev=0;
-                       curr_truck->autopilot->getRadioFix(localizers, 
free_localizer, &vdev, &hdev);
+                       // TODO: FIXME
+                       //curr_truck->autopilot->getRadioFix(localizers, 
free_localizer, &vdev, &hdev);
                        if (hdev>15) hdev=15;
                        if (hdev<-15) hdev=-15;
                        ow->hsivtexture->setTextureUScroll(-hdev*0.02);
@@ -667,7 +668,7 @@
                if (curr_truck->getLowestNode() != -1)
                {
                        Vector3 pos = 
curr_truck->nodes[curr_truck->getLowestNode()].AbsPosition;
-                       float height =  pos.y - hfinder->getHeightAt(pos.x, 
pos.z);
+                       float height =  pos.y - 
gEnv->heightFinder->getHeightAt(pos.x, pos.z);
                        if (height>0.1 && height < 99.9)
                        {
                                sprintf(tmp, "%2.1f", height);
@@ -692,35 +693,27 @@
 // Constructor takes a RenderWindow because it uses that to determine input 
context
 RoRFrameListener::RoRFrameListener(AppState *parentState, RenderWindow* win, 
Camera* cam, SceneManager* scm, Root* root, bool isEmbedded, Ogre::String 
inputhwnd) :
        clutch(0),
-       collisions(0),
        dashboard(0),
        debugCollisions(false),
        dof(0),
-       envmap(0),
        flaresMode(3), // on by default
        forcefeedback(0),
        freeTruckPosition(false),
        free_localizer(0),
-       hdrListener(0),
        heathaze(0),
        hidegui(false),
        initialized(false),
        inputhwnd(inputhwnd),
        isEmbedded(isEmbedded),
        joyshiftlock(0),
-       loadedTerrain("none"),
        loading_state(NONE_LOADED),
        mCamera(cam),
-       mCollisionTools(0),
        mRoot(root),
        mSceneMgr(scm),
        mStatsOn(0),
        mTimeUntilNextToggle(0),
        mTruckInfoOn(false),
        mWindow(win),
-       mapsizex(3000),
-       mapsizey(1000),
-       mapsizez(3000),
        mtc(0),
        net(0),
        netChat(0),
@@ -737,24 +730,14 @@
        pressure_pressed(false),
        raceStartTime(-1),
        reload_box(0),
-       reload_pos(Vector3::ZERO),
-       road(0),
        rtime(0),
        shaderSchemeMode(1),
        surveyMap(0),
        surveyMapMode(SURVEY_MAP_NONE),
-       terrainFileHash(""),
-       terrainFileName(""),
-       terrainHasTruckShop(false),
-       terrainModHash(""),
-       terrainName(""),
        terrainUID(""),
        truck_preload_num(0),
-       w(0),
        terrainManager(0)
 {
-       RoRFrameListener::eflsingleton = this;
-
        pthread_mutex_init(&mutex_data, NULL);
 
        // we don't use overlays in embedded mode
@@ -993,7 +976,7 @@
        NetworkStreamManager::getSingleton();
 
        // new factory for characters, net is INVALID, will be set later
-       new CharacterFactory(cam, 0, collisions, hfinder, w, surveyMap, 
mSceneMgr);
+       new CharacterFactory();
        new ChatSystemFactory(0);
 
        // notice: all factories must be available before starting the network!

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