Revision: 2568 http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2568&view=rev Author: ulteq Date: 2012-05-14 22:22:24 +0000 (Mon, 14 May 2012) Log Message: ----------- style++
Modified Paths: -------------- trunk/source/main/gfx/camera/CameraBehaviorCharacter.cpp trunk/source/main/network/IRCWrapper.h trunk/source/main/network/NetworkStreamManager.cpp trunk/source/main/network/NetworkStreamManager.h trunk/source/main/network/Streamable.h trunk/source/main/physics/Beam.cpp Modified: trunk/source/main/gfx/camera/CameraBehaviorCharacter.cpp =================================================================== --- trunk/source/main/gfx/camera/CameraBehaviorCharacter.cpp 2012-05-14 20:59:22 UTC (rev 2567) +++ trunk/source/main/gfx/camera/CameraBehaviorCharacter.cpp 2012-05-14 22:22:24 UTC (rev 2568) @@ -65,7 +65,7 @@ camRotY = 0.1f; camDist = 0.1f; camRatio = 0.0f; - camPositionOffset = Vector3(0.0f, 1.82f, 0.0f); + camPositionOffset = Vector3(0.1f, 1.82f, 0.0f); } else if ( camMode == CHARACTER_THIRD_PERSON ) { camRotY = 0.3f; Modified: trunk/source/main/network/IRCWrapper.h =================================================================== --- trunk/source/main/network/IRCWrapper.h 2012-05-14 20:59:22 UTC (rev 2567) +++ trunk/source/main/network/IRCWrapper.h 2012-05-14 22:22:24 UTC (rev 2568) @@ -76,8 +76,8 @@ void process(); // update function virtual void processIRCEvent(message_t &msg) = 0; // single event - int sendMessage(Ogre::String msg, Ogre::String channelOrNick = Ogre::String()); - int sendMeMessage(Ogre::String msg, Ogre::String channelOrNick = Ogre::String()); + int sendMessage(Ogre::String msg, Ogre::String channelOrNick = ""); + int sendMeMessage(Ogre::String msg, Ogre::String channelOrNick = ""); int changeNick(Ogre::String newNick); int joinChannel(Ogre::String channel, Ogre::String channelKey); int leaveChannel(Ogre::String channel); Modified: trunk/source/main/network/NetworkStreamManager.cpp =================================================================== --- trunk/source/main/network/NetworkStreamManager.cpp 2012-05-14 20:59:22 UTC (rev 2567) +++ trunk/source/main/network/NetworkStreamManager.cpp 2012-05-14 22:22:24 UTC (rev 2568) @@ -20,13 +20,11 @@ // created by Thomas Fischer thomas{AT}thomasfischer{DOT}biz, 7th of August 2009 #include "NetworkStreamManager.h" -#include "Streamable.h" -#include "Ogre.h" #include "network.h" -#include "utils.h" -#include "sha1.h" #include "language.h" +#include "Streamable.h" +#include "StreamableFactoryInterface.h" using namespace Ogre; @@ -74,7 +72,7 @@ // increase stream counter streamid++; MUTEX_UNLOCK(&stream_mutex); -#endif //SOCKETW +#endif // USE_SOCKETW } void NetworkStreamManager::addRemoteStream(Streamable *stream, int rsource, int rstreamid) @@ -151,7 +149,7 @@ } MUTEX_UNLOCK(&stream_mutex); } -#endif //SOCKETW +#endif // USE_SOCKETW void NetworkStreamManager::pushReceivedStreamMessage(header_t header, char *buffer) { @@ -232,7 +230,7 @@ void NetworkStreamManager::sendStreams(Network *net, void *socket) { } -#endif //SOCKETW +#endif // USE_SOCKETW #ifdef USE_SOCKETW void NetworkStreamManager::update() @@ -240,7 +238,7 @@ syncRemoteStreams(); receiveStreams(); } -#endif //SOCKETW +#endif // USE_SOCKETW void NetworkStreamManager::syncRemoteStreams() { Modified: trunk/source/main/network/NetworkStreamManager.h =================================================================== --- trunk/source/main/network/NetworkStreamManager.h 2012-05-14 20:59:22 UTC (rev 2567) +++ trunk/source/main/network/NetworkStreamManager.h 2012-05-14 22:22:24 UTC (rev 2568) @@ -26,14 +26,17 @@ #include "RoRPrerequisites.h" #include <pthread.h> + #include "rornet.h" #include "Singleton.h" -#include "StreamableFactoryInterface.h" #ifdef USE_SOCKETW #include "SocketW.h" -#endif //SOCKETW +#endif // USE_SOCKETW +class Streamable; +class StreamableFactoryInterface; + class NetworkStreamManager : public RoRSingleton< NetworkStreamManager > { friend class Network; Modified: trunk/source/main/network/Streamable.h =================================================================== --- trunk/source/main/network/Streamable.h 2012-05-14 20:59:22 UTC (rev 2567) +++ trunk/source/main/network/Streamable.h 2012-05-14 22:22:24 UTC (rev 2568) @@ -20,8 +20,8 @@ // created by Thomas Fischer thomas{AT}thomasfischer{DOT}biz, 7th of August 2009 -#ifndef STREAMABLE_H__ -#define STREAMABLE_H__ +#ifndef __Streamable_H_ +#define __Streamable_H_ #include "RoRPrerequisites.h" @@ -35,13 +35,15 @@ } recvPacket_t; /** - * This class defines a standart interface and a buffer between the actual network code and the class that handles it. - * The buffer must be decoupled from the separatly running network thread. + * This class defines a standard interface and a buffer between the actual network code and the class that handles it. + * The buffer must be decoupled from the separately running network thread. */ class Streamable { friend class NetworkStreamManager; + public: + unsigned int getStreamID() { return this->streamid; }; unsigned int getSourceID() { return this->sourceid; }; void setStreamID(unsigned int id) { this->streamid=id; }; @@ -93,9 +95,9 @@ void unlockReceiveQueue(); private: + std::map < int, stream_register_t > mStreamableResults; bool isOrigin, streamResultsChanged; - }; -#endif //STREAMABLE_H__ +#endif // __Streamable_H_ Modified: trunk/source/main/physics/Beam.cpp =================================================================== --- trunk/source/main/physics/Beam.cpp 2012-05-14 20:59:22 UTC (rev 2567) +++ trunk/source/main/physics/Beam.cpp 2012-05-14 22:22:24 UTC (rev 2568) @@ -324,12 +324,6 @@ beamsRoot=parent->createChildSceneNode(); deletion_sceneNodes.push_back(netLabelNode); - - if (networked) - { - state = NETWORKED; //required for proper loading - } - // skidmark stuff useSkidmarks = BSETTING("Skidmarks", false); @@ -370,7 +364,7 @@ // setup replay mode bool enablereplay = BSETTING("Replay mode", false); - if (enablereplay && state != NETWORKED && !networking) + if (enablereplay && !networked && !networking) { replaylen = ISETTING("Replay length", 10000); replay = new Replay(this, replaylen); @@ -448,7 +442,7 @@ // start network stuff if (networked) { - state=NETWORKED; + state = NETWORKED; // malloc memory oob1=(oob_t*)malloc(sizeof(oob_t)); oob2=(oob_t*)malloc(sizeof(oob_t)); @@ -457,8 +451,8 @@ netb2=(char*)malloc(netbuffersize); netb3=(char*)malloc(netbuffersize); nettimer = new Timer(); - net_toffset=0; - netcounter=0; + net_toffset = 0; + netcounter = 0; // init mutex pthread_mutex_init(&net_mutex, NULL); if (engine) @@ -906,12 +900,15 @@ void Beam::activate() { - if (state!=NETWORKED && state!=RECYCLE) state=ACTIVATED; + if (state < NETWORKED) + { + state=ACTIVATED; + } } void Beam::desactivate() { - if (state!=NETWORKED && state!=RECYCLE) + if (state < NETWORKED) { state=DESACTIVATED; sleepcount=0; @@ -3218,7 +3215,7 @@ //also consider changing the parallel "ifs" inside PointColDetector //see "pointCD" above. //Performance some times forces ugly architectural designs.... - if (!trucks[t] || trucks[t]->state==SLEEPING || trucks[t]->state==RECYCLE || trucks[t]->state==NETWORKED) continue; + if (!trucks[t] || trucks[t]->state >= SLEEPING) continue; trwidth=trucks[t]->collrange; @@ -5267,7 +5264,7 @@ #ifdef USE_SOCKETW if(!net) return; bool remote = (state == NETWORKED); - if(remote) + if (remote) { client_t *c = net->getClientInfo(sourceid); if(!c) return; 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