Explorar el Código

Merge branch 'development' into fix467_exportCollada

Areloch hace 8 años
padre
commit
06f32342ab
Se han modificado 50 ficheros con 1335 adiciones y 400 borrados
  1. 7 0
      Engine/source/app/game.cpp
  2. 1 5
      Engine/source/app/mainLoop.cpp
  3. 140 9
      Engine/source/app/net/serverQuery.cpp
  4. 16 16
      Engine/source/app/net/tcpObject.cpp
  5. 1 1
      Engine/source/app/version.h
  6. 18 13
      Engine/source/console/telnetConsole.cpp
  7. 22 17
      Engine/source/console/telnetDebugger.cpp
  8. 15 20
      Engine/source/core/stream/stream.cpp
  9. 6 0
      Engine/source/core/stream/stream.h
  10. 27 0
      Engine/source/gui/editor/guiInspectorTypes.cpp
  11. 9 6
      Engine/source/lighting/shadowMap/lightShadowMap.cpp
  12. 1 1
      Engine/source/lighting/shadowMap/lightShadowMap.h
  13. 10 0
      Engine/source/lighting/shadowMap/shadowMapManager.cpp
  14. 31 8
      Engine/source/lighting/shadowMap/shadowMapPass.cpp
  15. 7 4
      Engine/source/lighting/shadowMap/shadowMapPass.h
  16. 32 0
      Engine/source/math/mConsoleFunctions.cpp
  17. 19 0
      Engine/source/math/mRotation.cpp
  18. 1 0
      Engine/source/math/mRotation.h
  19. 12 0
      Engine/source/math/mathTypes.cpp
  20. 10 0
      Engine/source/math/mathUtils.cpp
  21. 7 0
      Engine/source/math/mathUtils.h
  22. 1 1
      Engine/source/navigation/navMesh.cpp
  23. 713 194
      Engine/source/platform/platformNet.cpp
  24. 148 23
      Engine/source/platform/platformNet.h
  25. 9 6
      Engine/source/platform/platformNetAsync.cpp
  26. 1 1
      Engine/source/platform/platformNetAsync.h
  27. 5 5
      Engine/source/platform/test/netTest.cpp
  28. 7 6
      Engine/source/scene/simPath.cpp
  29. 0 8
      Engine/source/shaderGen/GLSL/bumpGLSL.cpp
  30. 0 2
      Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp
  31. 0 8
      Engine/source/shaderGen/HLSL/bumpHLSL.cpp
  32. 0 2
      Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp
  33. 2 2
      Engine/source/sim/netConnection.cpp
  34. 3 6
      Engine/source/sim/netInterface.cpp
  35. 4 1
      Engine/source/sim/netInterface.h
  36. 14 4
      Engine/source/terrain/terrCellMaterial.cpp
  37. 1 0
      Engine/source/terrain/terrCellMaterial.h
  38. 9 6
      Engine/source/windowManager/sdl/sdlSplashScreen.cpp
  39. 1 1
      Engine/source/windowManager/sdl/sdlWindow.cpp
  40. 1 1
      Templates/Empty/buildFiles/config/torque3D_dedicated.conf
  41. 1 1
      Templates/Full/buildFiles/config/torque3D_dedicated.conf
  42. 0 1
      Templates/Full/game/art/environment/precipitation/rain.dml
  43. 8 8
      Templates/Full/game/shaders/common/gl/torque.glsl
  44. 8 8
      Templates/Full/game/shaders/common/torque.hlsl
  45. 2 0
      Templates/Full/source/torqueConfig.h
  46. 1 1
      Tools/CMake/basics.cmake
  47. 1 1
      Tools/CMake/torque3d.cmake
  48. 1 1
      Tools/projectGenerator/classes/NPWebPlugin.php
  49. 1 1
      Tools/projectGenerator/classes/Torque3D.php
  50. 1 1
      Tools/projectGenerator/libs/Torque3D.conf

+ 7 - 0
Engine/source/app/game.cpp

@@ -162,6 +162,13 @@ DefineConsoleFunction( setNetPort, bool, (int port, bool bind), (true), "(int po
    return Net::openPort((S32)port, bind);
 }
 
+DefineConsoleFunction(isAddressTypeAvailable, bool, (int addressType), , "(protocol id)"
+	"@brief Determines if a specified address type can be reached.\n\n"
+	"@ingroup Networking")
+{
+	return Net::isAddressTypeAvailable((NetAddress::Type)addressType);
+}
+
 DefineConsoleFunction( closeNetPort, void, (), , "()" 
    "@brief Closes the current network port\n\n"
    "@ingroup Networking")

+ 1 - 5
Engine/source/app/mainLoop.cpp

@@ -320,7 +320,7 @@ void StandardMainLoop::init()
    Sampler::init();
 
    // Hook in for UDP notification
-   Net::smPacketReceive.notify(GNet, &NetInterface::processPacketReceiveEvent);
+   Net::getPacketReceiveEvent().notify(GNet, &NetInterface::processPacketReceiveEvent);
 
    #ifdef TORQUE_DEBUG_GUARD
       Memory::flagCurrentAllocs( Memory::FLAG_Static );
@@ -604,15 +604,11 @@ bool StandardMainLoop::doMainLoop()
             lastFocus = newFocus;
          }
          
-#ifndef TORQUE_OS_MAC         
          // under the web plugin do not sleep the process when the child window loses focus as this will cripple the browser perfomance
          if (!Platform::getWebDeployment())
             tm->setBackground(!newFocus);
          else
             tm->setBackground(false);
-#else
-         tm->setBackground(false);
-#endif
       }
       else
       {

+ 140 - 9
Engine/source/app/net/serverQuery.cpp

@@ -177,7 +177,7 @@ static Vector<Ping> gQueryList(__FILE__, __LINE__);
 
 struct PacketStatus
 {
-   U8  index;
+   U16  index;
    S32 key;
    U32 time;
    U32 tryCount;
@@ -191,6 +191,9 @@ struct PacketStatus
       time = _time;
       tryCount = gPacketRetryCount;
    }
+
+   inline U8 getOldIndex() { return (U8)index; }
+   inline U16 getIndex() { return index; }
 };
 
 static Vector<PacketStatus> gPacketStatusList(__FILE__, __LINE__);
@@ -212,6 +215,7 @@ struct ServerFilter
       OnlineQuery       = 0,        // Authenticated with master
       OfflineQuery      = BIT(0),   // On our own
       NoStringCompress  = BIT(1),
+      NewStyleResponse  = BIT(2),  // Include IPV6 servers
    };
 
    enum // Filter flags:
@@ -222,6 +226,14 @@ struct ServerFilter
       CurrentVersion    = BIT(7),
       NotXenon          = BIT(6)
    };
+
+   enum // Region mask flags
+   {
+      RegionIsIPV4Address = BIT(30),
+      RegionIsIPV6Address = BIT(31),
+
+      RegionAddressMask = RegionIsIPV4Address | RegionIsIPV6Address
+   };
    
    //Rearranging the fields according to their sizes
    char* gameType;
@@ -241,7 +253,7 @@ struct ServerFilter
    ServerFilter()
    {
       type = Normal;
-      queryFlags = 0;
+      queryFlags = NewStyleResponse;
       gameType = NULL;
       missionType = NULL;
       minPlayers = 0;
@@ -401,10 +413,17 @@ void queryLanServers(U32 port, U8 flags, const char* gameType, const char* missi
 
    NetAddress addr;
    char addrText[256];
+
+   // IPV4
    dSprintf( addrText, sizeof( addrText ), "IP:BROADCAST:%d", port );
    Net::stringToAddress( addrText, &addr );
    pushPingBroadcast( &addr );
 
+   // IPV6
+   dSprintf(addrText, sizeof(addrText), "IP6:MULTICAST:%d", port);
+   Net::stringToAddress(addrText, &addr);
+   pushPingBroadcast(&addr);
+
    Con::executef("onServerQueryStatus", "start", "Querying LAN servers", "0");
    processPingsAndQueries( gPingSession );
 }
@@ -502,7 +521,7 @@ void queryMasterServer(U8 flags, const char* gameType, const char* missionType,
          dStrcpy( sActiveFilter.missionType, missionType );
       }
 
-      sActiveFilter.queryFlags   = flags;
+      sActiveFilter.queryFlags   = flags | ServerFilter::NewStyleResponse;
       sActiveFilter.minPlayers   = minPlayers;
       sActiveFilter.maxPlayers   = maxPlayers;
       sActiveFilter.maxBots      = maxBots;
@@ -519,6 +538,7 @@ void queryMasterServer(U8 flags, const char* gameType, const char* missionType,
       sActiveFilter.type = ServerFilter::Buddy;
       sActiveFilter.buddyCount = buddyCount;
       sActiveFilter.buddyList = (U32*) dRealloc( sActiveFilter.buddyList, buddyCount * 4 );
+      sActiveFilter.queryFlags = ServerFilter::NewStyleResponse;
       dMemcpy( sActiveFilter.buddyList, buddyList, buddyCount * 4 );
       clearServerList();
    }
@@ -775,7 +795,7 @@ Vector<MasterInfo>* getMasterServerList()
          U32 region = 1; // needs to default to something > 0
          dSscanf(master,"%d:",&region);
          const char* madd = dStrchr(master,':') + 1;
-         if (region && Net::stringToAddress(madd,&address)) {
+         if (region && Net::stringToAddress(madd,&address) == Net::NoError) {
             masterList.increment();
             MasterInfo& info = masterList.last();
             info.address = address;
@@ -1171,10 +1191,13 @@ static void processMasterServerQuery( U32 session )
             // Send a request to the master server for the server list:
             BitStream *out = BitStream::getPacketStream();
             out->clearStringBuffer();
+
             out->write( U8( NetInterface::MasterServerListRequest ) );
+            
             out->write( U8( sActiveFilter.queryFlags) );
             out->write( ( gMasterServerPing.session << 16 ) | ( gMasterServerPing.key & 0xFFFF ) );
             out->write( U8( 255 ) );
+
             writeCString( out, sActiveFilter.gameType );
             writeCString( out, sActiveFilter.missionType );
             out->write( sActiveFilter.minPlayers );
@@ -1359,23 +1382,35 @@ static void processServerListPackets( U32 session )
          if ( !p.tryCount )
          {
             // Packet timed out :(
-            Con::printf( "Server list packet #%d timed out.", p.index + 1 );
+            Con::printf( "Server list packet #%d timed out.", p.getIndex() + 1 );
             gPacketStatusList.erase( i );
          }
          else
          {
             // Try again...
-            Con::printf( "Rerequesting server list packet #%d...", p.index + 1 );
+            Con::printf( "Rerequesting server list packet #%d...", p.getIndex() + 1 );
             p.tryCount--;
             p.time = currentTime;
             p.key = gKey++;
 
             BitStream *out = BitStream::getPacketStream();
+            bool extendedPacket = (sActiveFilter.queryFlags & ServerFilter::NewStyleResponse) != 0;
+
             out->clearStringBuffer();
-            out->write( U8( NetInterface::MasterServerListRequest ) );
+
+            if ( extendedPacket )
+               out->write( U8( NetInterface::MasterServerExtendedListRequest ) );
+            else
+               out->write( U8( NetInterface::MasterServerListRequest ) );
+
             out->write( U8( sActiveFilter.queryFlags ) );   // flags
             out->write( ( session << 16) | ( p.key & 0xFFFF ) );
-            out->write( p.index );  // packet index
+            
+            if ( extendedPacket )
+               out->write( p.getOldIndex() );  // packet index
+            else
+               out->write( p.getIndex() );  // packet index
+
             out->write( U8( 0 ) );  // game type
             out->write( U8( 0 ) );  // mission type
             out->write( U8( 0 ) );  // minPlayers
@@ -1569,6 +1604,98 @@ static void handleMasterServerListResponse( BitStream* stream, U32 key, U8 /*fla
 
 //-----------------------------------------------------------------------------
 
+static void handleExtendedMasterServerListResponse(BitStream* stream, U32 key, U8 /*flags*/)
+{
+   U16 packetIndex, packetTotal;
+   U32 i;
+   U16 serverCount, port;
+   U8 netNum[16];
+   char addressBuffer[256];
+   NetAddress addr;
+
+   stream->read(&packetIndex);
+   // Validate the packet key:
+   U32 packetKey = gMasterServerPing.key;
+   if (gGotFirstListPacket)
+   {
+      for (i = 0; i < gPacketStatusList.size(); i++)
+      {
+         if (gPacketStatusList[i].index == packetIndex)
+         {
+            packetKey = gPacketStatusList[i].key;
+            break;
+         }
+      }
+   }
+
+   U32 testKey = (gPingSession << 16) | (packetKey & 0xFFFF);
+   if (testKey != key)
+      return;
+
+   stream->read(&packetTotal);
+   stream->read(&serverCount);
+
+   Con::printf("Received server list packet %d of %d from the master server (%d servers).", (packetIndex + 1), packetTotal, serverCount);
+
+   // Enter all of the servers in this packet into the ping list:
+   for (i = 0; i < serverCount; i++)
+   {
+      U8 type;
+      stream->read(&type);
+      dMemset(&addr, '\0', sizeof(NetAddress));
+
+      if (type == 0)
+      {
+         // IPV4
+         addr.type = NetAddress::IPAddress;
+         stream->read(4, &addr.address.ipv4.netNum[0]);
+         stream->read(&addr.port);
+      }
+      else
+      {
+         // IPV6
+         addr.type = NetAddress::IPV6Address;
+         stream->read(16, &addr.address.ipv6.netNum[0]);
+         stream->read(&addr.port);
+      }
+
+      pushPingRequest(&addr);
+   }
+
+   // If this is the first list packet we have received, fill the packet status list
+   // and start processing:
+   if (!gGotFirstListPacket)
+   {
+      gGotFirstListPacket = true;
+      gMasterServerQueryAddress = gMasterServerPing.address;
+      U32 currentTime = Platform::getVirtualMilliseconds();
+      for (i = 0; i < packetTotal; i++)
+      {
+         if (i != packetIndex)
+         {
+            PacketStatus* p = new PacketStatus(i, gMasterServerPing.key, currentTime);
+            gPacketStatusList.push_back(*p);
+         }
+      }
+
+      processServerListPackets(gPingSession);
+   }
+   else
+   {
+      // Remove the packet we just received from the status list:
+      for (i = 0; i < gPacketStatusList.size(); i++)
+      {
+         if (gPacketStatusList[i].index == packetIndex)
+         {
+            gPacketStatusList.erase(i);
+            break;
+         }
+      }
+   }
+}
+
+//-----------------------------------------------------------------------------
+
 static void handleGameMasterInfoRequest( const NetAddress* address, U32 key, U8 flags )
 {
    if ( GNet->doesAllowConnections() )
@@ -1585,7 +1712,7 @@ static void handleGameMasterInfoRequest( const NetAddress* address, U32 key, U8
       for(U32 i = 0; i < masterList->size(); i++)
       {
          masterAddr = &(*masterList)[i].address;
-         if (*(U32*)(masterAddr->netNum) == *(U32*)(address->netNum))
+         if (masterAddr->isSameAddress(*address))
          {
             fromMaster = true;
             break;
@@ -2098,6 +2225,10 @@ void DemoNetInterface::handleInfoPacket( const NetAddress* address, U8 packetTyp
       case GameMasterInfoRequest:
          handleGameMasterInfoRequest( address, key, flags );
          break;
+
+      case MasterServerExtendedListResponse:
+         handleExtendedMasterServerListResponse(stream, key, flags);
+         break;
    }
 }
 

+ 16 - 16
Engine/source/app/net/tcpObject.cpp

@@ -170,8 +170,8 @@ IMPLEMENT_CALLBACK(TCPObject, onDisconnect, void, (),(),
 
 TCPObject *TCPObject::find(NetSocket tag)
 {
-   for(TCPObject *walk = table[U32(tag) & TableMask]; walk; walk = walk->mNext)
-      if(walk->mTag == tag)
+   for(TCPObject *walk = table[tag.getHash() & TableMask]; walk; walk = walk->mNext)
+      if(walk->mTag.getHash() == tag.getHash())
          return walk;
    return NULL;
 }
@@ -180,13 +180,13 @@ void TCPObject::addToTable(NetSocket newTag)
 {
    removeFromTable();
    mTag = newTag;
-   mNext = table[U32(mTag) & TableMask];
-   table[U32(mTag) & TableMask] = this;
+   mNext = table[mTag.getHash() & TableMask];
+   table[mTag.getHash() & TableMask] = this;
 }
 
 void TCPObject::removeFromTable()
 {
-   for(TCPObject **walk = &table[U32(mTag) & TableMask]; *walk; walk = &((*walk)->mNext))
+   for(TCPObject **walk = &table[mTag.getHash() & TableMask]; *walk; walk = &((*walk)->mNext))
    {
       if(*walk == this)
       {
@@ -207,7 +207,7 @@ TCPObject::TCPObject()
    mBuffer = NULL;
    mBufferSize = 0;
    mPort = 0;
-   mTag = InvalidSocket;
+   mTag = NetSocket::INVALID;
    mNext = NULL;
    mState = Disconnected;
 
@@ -215,9 +215,9 @@ TCPObject::TCPObject()
 
    if(gTCPCount == 1)
    {
-      Net::smConnectionAccept.notify(processConnectedAcceptEvent);
-      Net::smConnectionReceive.notify(processConnectedReceiveEvent);
-      Net::smConnectionNotify.notify(processConnectedNotifyEvent);
+      Net::getConnectionAcceptedEvent().notify(processConnectedAcceptEvent);
+      Net::getConnectionReceiveEvent().notify(processConnectedReceiveEvent);
+      Net::getConnectionNotifyEvent().notify(processConnectedNotifyEvent);
    }
 }
 
@@ -230,9 +230,9 @@ TCPObject::~TCPObject()
 
    if(gTCPCount == 0)
    {
-      Net::smConnectionAccept.remove(processConnectedAcceptEvent);
-      Net::smConnectionReceive.remove(processConnectedReceiveEvent);
-      Net::smConnectionNotify.remove(processConnectedNotifyEvent);
+      Net::getConnectionAcceptedEvent().remove(processConnectedAcceptEvent);
+      Net::getConnectionReceiveEvent().remove(processConnectedReceiveEvent);
+      Net::getConnectionNotifyEvent().remove(processConnectedNotifyEvent);
    }
 }
 
@@ -242,7 +242,7 @@ bool TCPObject::processArguments(S32 argc, ConsoleValueRef *argv)
       return true;
    else if(argc == 1)
    {
-      addToTable(U32(dAtoi(argv[0])));
+      addToTable(NetSocket::fromHandle(dAtoi(argv[0])));
       return true;
    }
    return false;
@@ -406,7 +406,7 @@ void TCPObject::onDisconnect()
 void TCPObject::listen(U16 port)
 {
    mState = Listening;
-   U32 newTag = Net::openListenPort(port);
+   NetSocket newTag = Net::openListenPort(port);
    addToTable(newTag);
 }
 
@@ -418,7 +418,7 @@ void TCPObject::connect(const char *address)
 
 void TCPObject::disconnect()
 {
-   if( mTag != InvalidSocket ) {
+   if( mTag != NetSocket::INVALID ) {
       Net::closeConnectTo(mTag);
    }
    removeFromTable();
@@ -592,7 +592,7 @@ void processConnectedAcceptEvent(NetSocket listeningPort, NetSocket newConnectio
    if(!tcpo)
       return;
 
-   tcpo->onConnectionRequest(&originatingAddress, newConnection);
+   tcpo->onConnectionRequest(&originatingAddress, (U32)newConnection.getHandle());
 }
 
 void processConnectedNotifyEvent( NetSocket sock, U32 state )

+ 1 - 1
Engine/source/app/version.h

@@ -44,7 +44,7 @@
 #define TORQUE_GAME_ENGINE          3900
 
 /// Human readable engine version string.
-#define TORQUE_GAME_ENGINE_VERSION_STRING  "3.10.0"
+#define TORQUE_GAME_ENGINE_VERSION_STRING  "3.9.0"
 
 /// Gets the engine version number.  The version number is specified as a global in version.cc
 U32 getVersionNumber();

+ 18 - 13
Engine/source/console/telnetConsole.cpp

@@ -84,7 +84,7 @@ TelnetConsole::TelnetConsole()
 {
    Con::addConsumer(telnetCallback);
 
-   mAcceptSocket = InvalidSocket;
+   mAcceptSocket = NetSocket::INVALID;
    mAcceptPort = -1;
    mClientList = NULL;
    mRemoteEchoEnabled = false;
@@ -93,13 +93,13 @@ TelnetConsole::TelnetConsole()
 TelnetConsole::~TelnetConsole()
 {
    Con::removeConsumer(telnetCallback);
-   if(mAcceptSocket != InvalidSocket)
+   if(mAcceptSocket != NetSocket::INVALID)
       Net::closeSocket(mAcceptSocket);
    TelnetClient *walk = mClientList, *temp;
    while(walk)
    {
       temp = walk->nextClient;
-      if(walk->socket != InvalidSocket)
+      if(walk->socket != NetSocket::INVALID)
          Net::closeSocket(walk->socket);
       delete walk;
       walk = temp;
@@ -113,16 +113,20 @@ void TelnetConsole::setTelnetParameters(S32 port, const char *telnetPassword, co
 
    mRemoteEchoEnabled = remoteEcho;
 
-   if(mAcceptSocket != InvalidSocket)
+   if(mAcceptSocket != NetSocket::INVALID)
    {
       Net::closeSocket(mAcceptSocket);
-      mAcceptSocket = InvalidSocket;
+      mAcceptSocket = NetSocket::INVALID;
    }
    mAcceptPort = port;
    if(mAcceptPort != -1 && mAcceptPort != 0)
    {
+	  NetAddress address;
+	  Net::getIdealListenAddress(&address);
+	  address.port = mAcceptPort;
+
       mAcceptSocket = Net::openSocket();
-      Net::bind(mAcceptSocket, mAcceptPort);
+      Net::bindAddress(address, mAcceptSocket);
       Net::listen(mAcceptSocket, 4);
 
       Net::setBlocking(mAcceptSocket, false);
@@ -151,16 +155,17 @@ void TelnetConsole::process()
 {
    NetAddress address;
 
-   if(mAcceptSocket != InvalidSocket)
+   if(mAcceptSocket != NetSocket::INVALID)
    {
       // ok, see if we have any new connections:
       NetSocket newConnection;
       newConnection = Net::accept(mAcceptSocket, &address);
 
-      if(newConnection != InvalidSocket)
+      if(newConnection != NetSocket::INVALID)
       {
-   		Con::printf ("Telnet connection from %i.%i.%i.%i",
-   				address.netNum[0], address.netNum[1], address.netNum[2], address.netNum[3]);
+         char buffer[256];
+         Net::addressToString(&address, buffer);
+         Con::printf("Telnet connection from %s", buffer);
 
          TelnetClient *cl = new TelnetClient;
          cl->socket = newConnection;
@@ -201,7 +206,7 @@ void TelnetConsole::process()
       if((err != Net::NoError && err != Net::WouldBlock) || numBytes == 0)
       {
          Net::closeSocket(client->socket);
-         client->socket = InvalidSocket;
+         client->socket = NetSocket::INVALID;
          continue;
       }
 
@@ -274,7 +279,7 @@ void TelnetConsole::process()
                   if(client->state == DisconnectThisDude)
                   {
                      Net::closeSocket(client->socket);
-                     client->socket = InvalidSocket;
+                     client->socket = NetSocket::INVALID;
                   }
                }
             }
@@ -312,7 +317,7 @@ void TelnetConsole::process()
    TelnetClient *cl;
    while((cl = *walk) != NULL)
    {
-      if(cl->socket == InvalidSocket)
+      if(cl->socket == NetSocket::INVALID)
       {
          *walk = cl->nextClient;
          delete cl;

+ 22 - 17
Engine/source/console/telnetDebugger.cpp

@@ -151,8 +151,8 @@ TelnetDebugger::TelnetDebugger()
    Con::addConsumer(debuggerConsumer);
 
    mAcceptPort = -1;
-   mAcceptSocket = InvalidSocket;
-   mDebugSocket = InvalidSocket;
+   mAcceptSocket = NetSocket::INVALID;
+   mDebugSocket = NetSocket::INVALID;
 
    mState = NotConnected;
    mCurPos = 0;
@@ -189,9 +189,9 @@ TelnetDebugger::~TelnetDebugger()
 {
    Con::removeConsumer(debuggerConsumer);
 
-   if(mAcceptSocket != InvalidSocket)
+   if(mAcceptSocket != NetSocket::INVALID)
       Net::closeSocket(mAcceptSocket);
-   if(mDebugSocket != InvalidSocket)
+   if(mDebugSocket != NetSocket::INVALID)
       Net::closeSocket(mDebugSocket);
 }
 
@@ -217,10 +217,10 @@ void TelnetDebugger::send(const char *str)
 
 void TelnetDebugger::disconnect()
 {
-   if ( mDebugSocket != InvalidSocket )
+   if ( mDebugSocket != NetSocket::INVALID )
    {
       Net::closeSocket(mDebugSocket);
-      mDebugSocket = InvalidSocket;
+      mDebugSocket = NetSocket::INVALID;
    }
 
    removeAllBreakpoints();
@@ -236,16 +236,20 @@ void TelnetDebugger::setDebugParameters(S32 port, const char *password, bool wai
 //   if(port == mAcceptPort)
 //      return;
 
-   if(mAcceptSocket != InvalidSocket)
+   if(mAcceptSocket != NetSocket::INVALID)
    {
       Net::closeSocket(mAcceptSocket);
-      mAcceptSocket = InvalidSocket;
+      mAcceptSocket = NetSocket::INVALID;
    }
    mAcceptPort = port;
    if(mAcceptPort != -1 && mAcceptPort != 0)
    {
+	  NetAddress address;
+	  Net::getIdealListenAddress(&address);
+	  address.port = mAcceptPort;
+
       mAcceptSocket = Net::openSocket();
-      Net::bind(mAcceptSocket, mAcceptPort);
+      Net::bindAddress(address, mAcceptSocket);
       Net::listen(mAcceptSocket, 4);
 
       Net::setBlocking(mAcceptSocket, false);
@@ -279,32 +283,33 @@ void TelnetDebugger::process()
 {
    NetAddress address;
 
-   if(mAcceptSocket != InvalidSocket)
+   if(mAcceptSocket != NetSocket::INVALID)
    {
       // ok, see if we have any new connections:
       NetSocket newConnection;
       newConnection = Net::accept(mAcceptSocket, &address);
 
-      if(newConnection != InvalidSocket && mDebugSocket == InvalidSocket)
+      if(newConnection != NetSocket::INVALID && mDebugSocket == NetSocket::INVALID)
       {
-   		Con::printf ("Debugger connection from %i.%i.%i.%i",
-   				address.netNum[0], address.netNum[1], address.netNum[2], address.netNum[3]);
+         char buffer[256];
+         Net::addressToString(&address, buffer);
+         Con::printf("Debugger connection from %s", buffer);
 
          mState = PasswordTry;
          mDebugSocket = newConnection;
 
          Net::setBlocking(newConnection, false);
       }
-      else if(newConnection != InvalidSocket)
+      else if(newConnection != NetSocket::INVALID)
          Net::closeSocket(newConnection);
    }
    // see if we have any input to process...
 
-   if(mDebugSocket == InvalidSocket)
+   if(mDebugSocket == NetSocket::INVALID)
       return;
 
    checkDebugRecv();
-   if(mDebugSocket == InvalidSocket)
+   if(mDebugSocket == NetSocket::INVALID)
       removeAllBreakpoints();
 }
 
@@ -434,7 +439,7 @@ void TelnetDebugger::breakProcess()
    {
       Platform::sleep(10);
       checkDebugRecv();
-      if(mDebugSocket == InvalidSocket)
+      if(mDebugSocket == NetSocket::INVALID)
       {
          mProgramPaused = false;
          removeAllBreakpoints();

+ 15 - 20
Engine/source/core/stream/stream.cpp

@@ -300,16 +300,7 @@ bool Stream::write(const NetAddress &na)
 {
    bool success = write(na.type);
    success &= write(na.port);
-   success &= write(na.netNum[0]);
-   success &= write(na.netNum[1]);
-   success &= write(na.netNum[2]);
-   success &= write(na.netNum[3]);
-   success &= write(na.nodeNum[0]);
-   success &= write(na.nodeNum[1]);
-   success &= write(na.nodeNum[2]);
-   success &= write(na.nodeNum[3]);
-   success &= write(na.nodeNum[4]);
-   success &= write(na.nodeNum[5]);
+   success &= write(sizeof(na.address), &na.address);
    return success;
 }
 
@@ -317,16 +308,20 @@ bool Stream::read(NetAddress *na)
 {
    bool success = read(&na->type);
    success &= read(&na->port);
-   success &= read(&na->netNum[0]);
-   success &= read(&na->netNum[1]);
-   success &= read(&na->netNum[2]);
-   success &= read(&na->netNum[3]);
-   success &= read(&na->nodeNum[0]);
-   success &= read(&na->nodeNum[1]);
-   success &= read(&na->nodeNum[2]);
-   success &= read(&na->nodeNum[3]);
-   success &= read(&na->nodeNum[4]);
-   success &= read(&na->nodeNum[5]);
+   success &= read(sizeof(na->address), &na->address);
+   return success;
+}
+
+bool Stream::write(const NetSocket &so)
+{
+   return write(so.getHandle());
+}
+
+bool Stream::read(NetSocket* so)
+{
+   S32 handle = -1;
+   bool success = read(&handle);
+   *so = NetSocket::fromHandle(handle);
    return success;
 }
 

+ 6 - 0
Engine/source/core/stream/stream.h

@@ -45,6 +45,7 @@ class ColorF;
 struct NetAddress;
 class RawData;
 class String;
+class NetSocket;
 
 namespace Torque {
    class ByteBuffer;
@@ -165,6 +166,11 @@ public:
    /// Read a network address from the stream.
    bool read(NetAddress*);
 
+   /// Write a network socket to the stream.
+   bool write(const NetSocket &);
+   /// Read a network socket from the stream.
+   bool read(NetSocket*);
+
    /// Write some raw data onto the stream.
    bool write(const RawData &);
    /// Read some raw data from the stream.

+ 27 - 0
Engine/source/gui/editor/guiInspectorTypes.cpp

@@ -400,6 +400,32 @@ ConsoleDocClass( GuiInspectorTypeCheckBox,
 
 GuiControl* GuiInspectorTypeCheckBox::constructEditControl()
 {
+   if ( mField->flag.test(AbstractClassRep::FieldFlags::FIELD_ComponentInspectors) )
+   {
+      // This checkbox (bool field) is meant to be treated as a button.
+      GuiControl* retCtrl = new GuiButtonCtrl();
+
+      // If we couldn't construct the control, bail!
+      if( retCtrl == NULL )
+         return retCtrl;
+
+      GuiButtonCtrl *button = dynamic_cast<GuiButtonCtrl*>(retCtrl);
+
+      // Let's make it look pretty.
+      retCtrl->setDataField( StringTable->insert("profile"), NULL, "InspectorTypeButtonProfile" );
+      retCtrl->setField( "text", "Click Here" );
+
+      retCtrl->setScriptValue( getData() );
+
+      _registerEditControl( retCtrl );
+
+      // Configure it to update our value when the popup is closed
+      char szBuffer[512];
+      dSprintf( szBuffer, 512, "%d.apply(%d.getValue());",getId(), button->getId() );
+      button->setField("Command", szBuffer );
+
+      return retCtrl;
+   } else {
    GuiControl* retCtrl = new GuiCheckBoxCtrl();
 
    GuiCheckBoxCtrl *check = dynamic_cast<GuiCheckBoxCtrl*>(retCtrl);
@@ -420,6 +446,7 @@ GuiControl* GuiInspectorTypeCheckBox::constructEditControl()
    check->setField("Command", szBuffer );
 
    return retCtrl;
+   }
 }
 
 

+ 9 - 6
Engine/source/lighting/shadowMap/lightShadowMap.cpp

@@ -304,13 +304,16 @@ bool LightShadowMap::setTextureStage( U32 currTexFlag, LightingShaderConstants*
    return false;
 }
 
-void LightShadowMap::render(  RenderPassManager* renderPass,
-                              const SceneRenderState *diffuseState,
-                              bool _dynamic)
+void LightShadowMap::render(RenderPassManager* renderPass,
+   const SceneRenderState *diffuseState,
+   bool _dynamic, bool _forceUpdate)
 {
-    //  control how often shadow maps are refreshed
-    if (!_dynamic && (mStaticRefreshTimer->getElapsedMs() < getLightInfo()->getStaticRefreshFreq()))
-        return;
+   if (!_forceUpdate)
+   {
+      //  control how often shadow maps are refreshed
+      if (!_dynamic && (mStaticRefreshTimer->getElapsedMs() < getLightInfo()->getStaticRefreshFreq()))
+         return;
+   }
     mStaticRefreshTimer->reset();
 
     /* TODO: find out why this is causing issue with translucent objects

+ 1 - 1
Engine/source/lighting/shadowMap/lightShadowMap.h

@@ -163,7 +163,7 @@ public:
 
    void render(   RenderPassManager* renderPass,
                   const SceneRenderState *diffuseState,
-                  bool _dynamic);
+                  bool _dynamic, bool _forceUpdate);
 
    U32 getLastUpdate() const { return mLastUpdate; }
 

+ 10 - 0
Engine/source/lighting/shadowMap/shadowMapManager.cpp

@@ -78,6 +78,16 @@ AFTER_MODULE_INIT( Sim )
    Con::NotifyDelegate shadowCallback( &ShadowMapManager::updateShadowDisable );
    Con::addVariableNotify( "$pref::Shadows::disable", shadowCallback );
    Con::addVariableNotify( "$Shadows::disable", shadowCallback );
+
+   Con::addVariable("$pref::Shadows::teleportDist",
+      TypeF32, &ShadowMapPass::smShadowsTeleportDist,
+      "Minimum distance moved per frame to determine that we are teleporting.\n");
+   Con::addVariableNotify("$pref::Shadows::teleportDist", shadowCallback);
+
+   Con::addVariable("$pref::Shadows::turnRate",
+      TypeF32, &ShadowMapPass::smShadowsTurnRate,
+      "Minimum angle moved per frame to determine that we are turning quickly.\n");
+   Con::addVariableNotify("$pref::Shadows::turnRate", shadowCallback);
 }
 
 Signal<void(void)> ShadowMapManager::smShadowDeactivateSignal;

+ 31 - 8
Engine/source/lighting/shadowMap/shadowMapPass.cpp

@@ -39,6 +39,7 @@
 #include "gfx/gfxDebugEvent.h"
 #include "platform/platformTimer.h"
 
+#include "T3D/gameBase/gameConnection.h"
 
 const String ShadowMapPass::PassTypeName("ShadowMap");
 
@@ -55,11 +56,10 @@ bool ShadowMapPass::smDisableShadows = false;
 bool ShadowMapPass::smDisableShadowsEditor = false;
 bool ShadowMapPass::smDisableShadowsPref = false;
 
-/// milliseconds before static redraw
-S32 ShadowMapPass::smStaticShadowUpdateFreq = 32;
-/// milliseconds before dynamic redraw
-S32 ShadowMapPass::smDynamicShadowUpdateFreq = 16;
-
+/// distance moved per frame before forcing a shadow update
+F32 ShadowMapPass::smShadowsTeleportDist = 4;
+/// angle turned per frame before forcing a shadow update
+F32 ShadowMapPass::smShadowsTurnRate = 1;
 /// We have a default 8ms render budget for shadow rendering.
 U32 ShadowMapPass::smRenderBudgetMs = 8;
 
@@ -89,7 +89,8 @@ ShadowMapPass::ShadowMapPass(LightManager* lightManager, ShadowMapManager* shado
    mDynamicShadowRPM->addManager( new RenderImposterMgr( 0.6f, 0.6f )  );
 
    mActiveLights = 0;
-
+   mPrevCamPos = Point3F::Zero;
+   mPrevCamRot = Point3F::Zero;
    mTimer = PlatformTimer::create();
 
    Con::addVariable( "$ShadowStats::activeMaps", TypeS32, &smActiveShadowMaps,
@@ -214,6 +215,28 @@ void ShadowMapPass::render(   SceneManager *sceneManager,
    mTimer->getElapsedMs();
    mTimer->reset();
 
+   // Must have a connection and control object
+   GameConnection* conn = GameConnection::getConnectionToServer();
+   if (!conn)
+      return;
+
+   GameBase * control = dynamic_cast<GameBase*>(conn->getControlObject());
+   if (!control)
+      return;
+
+   bool forceUpdate = false;
+
+   //force an update if we're jumping around (respawning, ect)
+   MatrixF curCamMatrix = control->getTransform();
+   if (((curCamMatrix.getPosition() - mPrevCamPos).lenSquared() > mPow(smShadowsTeleportDist, 2)) || //update if we're teleporting
+       ((curCamMatrix.getForwardVector() - mPrevCamRot).lenSquared() > mPow(smShadowsTurnRate*M_PI_F / 180, 2)) || //update if we're turning too fast
+       (control->getCameraFov()) != mPrevCamFov) //update if we're zooming or unzooming
+      forceUpdate = true;
+
+   mPrevCamRot = curCamMatrix.getForwardVector();
+   mPrevCamPos = curCamMatrix.getPosition();
+   mPrevCamFov = control->getCameraFov();
+
    // 2 Shadow Maps per Light. This may fail.
    for ( U32 i = 0; i < shadowMaps.size(); i += 2 )
    {
@@ -226,8 +249,8 @@ void ShadowMapPass::render(   SceneManager *sceneManager,
 		 mShadowManager->setLightShadowMap(lsm);
          mShadowManager->setLightDynamicShadowMap( dlsm );
 
-		 lsm->render(mShadowRPM, diffuseState, false);
-		 dlsm->render(mDynamicShadowRPM, diffuseState, true);
+         lsm->render(mShadowRPM, diffuseState, false, forceUpdate);
+         dlsm->render(mDynamicShadowRPM, diffuseState, true, forceUpdate);
 
          ++smUpdatedShadowMaps;
       }

+ 7 - 4
Engine/source/lighting/shadowMap/shadowMapPass.h

@@ -84,10 +84,10 @@ public:
    static bool smDisableShadowsEditor;
    static bool smDisableShadowsPref;
 
-   /// milliseconds before static redraw
-   static S32 smStaticShadowUpdateFreq;
-   /// milliseconds before dynamic redraw
-   static S32 smDynamicShadowUpdateFreq;
+   /// distance moved per frame before forcing a shadow update
+   static F32 smShadowsTeleportDist;
+   /// angle turned per frame before forcing a shadow update
+   static F32 smShadowsTurnRate;
 
 private:
 
@@ -112,6 +112,9 @@ private:
    SimObjectPtr<DynamicShadowRenderPassManager> mDynamicShadowRPM;
    LightManager* mLightManager;
    ShadowMapManager* mShadowManager;
+   Point3F mPrevCamPos;
+   Point3F mPrevCamRot;
+   F32 mPrevCamFov;
 };
 
 class ShadowRenderPassManager : public RenderPassManager

+ 32 - 0
Engine/source/math/mConsoleFunctions.cpp

@@ -25,6 +25,8 @@
 #include "console/console.h"
 #include "math/mMathFn.h"
 #include "math/mRandom.h"
+#include "math/mMath.h"
+#include "math/mathUtils.h"
 
 #include "console/engineAPI.h"
 
@@ -341,3 +343,33 @@ DefineConsoleFunction( mIsPow2, bool, ( S32 v ),,
 {
    return isPow2( v );
 }
+
+DefineConsoleFunction( mRandomDir, Point3F, (Point3F axis, F32 angleMin, F32 angleMax),,
+   "Returns a randomized direction based on a starting axis and the min/max angles.\n"
+   "@param axis Main axis to deviate the direction from."
+   "@param angleMin minimum amount of deviation from the axis."
+   "@param angleMax maximum amount of deviation from the axis."
+   "@returns Randomized direction vector."
+   "@ingroup Math")
+{
+   return MathUtils::randomDir(axis, angleMin, angleMax);
+}
+
+DefineConsoleFunction( mRandomPointInSphere, Point3F, (F32 radius), ,
+   "Returns a randomized point inside a sphere of a given radius.\n"
+   "@param radius The radius of the sphere to find a point in."
+   "@returns Randomized point inside a sphere."
+   "@ingroup Math")
+{
+   return MathUtils::randomPointInSphere(radius);
+}
+
+DefineConsoleFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB), ,
+   "Returns angle between two vectors.\n"
+   "@param vecA First input vector."
+   "@param vecB Second input vector."
+   "@returns Angle between both vectors in radians."
+   "@ingroup Math")
+{
+   return MathUtils::getAngleBetweenVectors(vecA, vecB);
+}

+ 19 - 0
Engine/source/math/mRotation.cpp

@@ -22,6 +22,7 @@
 #include "math/mRotation.h"
 #include "console/console.h"
 #include "console/engineAPI.h"
+#include "math/mathUtils.h"
 
 #ifdef TORQUE_TESTS_ENABLED
 #include "testing/unitTesting.h"
@@ -187,6 +188,15 @@ void RotationF::lookAt(const Point3F& _origin, const Point3F& _target, const Poi
    set(mat);
 }
 
+VectorF RotationF::getDirection()
+{
+   VectorF dir;
+   EulerF angles = asEulerF();
+   MathUtils::getVectorFromAngles(dir, angles.z, angles.x);
+
+   return dir;
+}
+
 //========================================================
 EulerF RotationF::asEulerF(UnitFormat _format) const
 {
@@ -346,3 +356,12 @@ DefineConsoleStaticMethod(rotation, LookAt, RotationF, (Point3F origin, Point3F
    result.lookAt(origin, target, up);
    return result;
 }
+
+DefineConsoleStaticMethod(rotation, getDirection, Point3F, (RotationF rot),,
+"Takes the angles of the provided rotation and returns a direction vector.\n"
+"@param rot Our rotation."
+"@returns v Direction vector result."
+"@ingroup Math")
+{
+   return rot.getDirection();
+}

+ 1 - 0
Engine/source/math/mRotation.h

@@ -132,6 +132,7 @@ public:
    //
    void interpolate(const RotationF& _pt1, const RotationF& _pt2, F32 _factor);
    void lookAt(const Point3F& _origin, const Point3F& _target, const Point3F& _up = Point3F(0, 0, 1));
+   VectorF getDirection();
 
    F32 len() const;
 

+ 12 - 0
Engine/source/math/mathTypes.cpp

@@ -1032,6 +1032,18 @@ DefineConsoleFunction( VectorLerp, VectorF, ( VectorF a, VectorF b, F32 t ),,
    return c;
 }
 
+DefineConsoleFunction(VectorReflect, VectorF, (VectorF vec, VectorF normal), ,
+   "Compute the reflection of a vector based on a normal.\n"
+   "@param a The vector.\n"
+   "@param b The normal.\n"
+   "@return The reflected vector.\n\n"
+   "@ingroup Vectors")
+{
+   normal.normalize();
+
+   return MathUtils::reflect(vec, normal);
+}
+
 //-----------------------------------------------------------------------------
 
 DefineConsoleFunction( MatrixCreate, TransformF, ( VectorF position, AngAxisF orientation ),,

+ 10 - 0
Engine/source/math/mathUtils.cpp

@@ -361,6 +361,16 @@ void getVectorFromAngles( VectorF &vec, F32 yawAng, F32 pitchAng )
    vec = pnt;
 }
 
+F32 getAngleBetweenVectors(VectorF vecA, VectorF vecB)
+{
+   F32 dot = mDot(vecA, vecB);
+   F32 lenSq1 = vecA.lenSquared();
+   F32 lenSq2 = vecB.lenSquared();
+   F32 angle = mAcos(dot / mSqrt(lenSq1 * lenSq2));
+
+   return angle;
+}
+
 //-----------------------------------------------------------------------------
 
 void transformBoundingBox(const Box3F &sbox, const MatrixF &mat, const Point3F scale, Box3F &dbox)

+ 7 - 0
Engine/source/math/mathUtils.h

@@ -155,6 +155,13 @@ namespace MathUtils
    /// <b>ASSUMES Z AXIS IS UP</b>
    void getVectorFromAngles( VectorF &vec, F32 yawAng, F32 pitchAng );
 
+   /// Returns the angle between two given vectors
+   /// 
+   /// Angles is in RADIANS
+   ///
+   F32 getAngleBetweenVectors(VectorF vecA, VectorF vecB);
+
+
    /// Simple reflection equation - pass in a vector and a normal to reflect off of
    inline Point3F reflect( Point3F &inVec, Point3F &norm )
    {

+ 1 - 1
Engine/source/navigation/navMesh.cpp

@@ -838,7 +838,7 @@ void NavMesh::buildNextTile()
          ctx->stopTimer(RC_TIMER_TOTAL);
          if(getEventManager())
          {
-            String str = String::ToString("%d %.3f", getId(), ctx->getAccumulatedTime(RC_TIMER_TOTAL) / 1000.0f);
+            String str = String::ToString("%d", getId());
             getEventManager()->postEvent("NavMeshUpdate", str.c_str());
             setMaskBits(LoadFlag);
          }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 713 - 194
Engine/source/platform/platformNet.cpp


+ 148 - 23
Engine/source/platform/platformNet.h

@@ -31,6 +31,8 @@
 #define MAXPACKETSIZE 1500
 #endif
 
+#define TORQUE_NET_DEFAULT_MULTICAST_ADDRESS "ff04::7467::656E::6574::776B"
+
 typedef S32 NetConnectionId;
 
 /// Generic network address
@@ -41,18 +43,130 @@ struct NetAddress
    S32 type;        ///< Type of address (IPAddress currently)
 
    /// Acceptable NetAddress types.
-   enum 
+   enum Type
    {
       IPAddress,
+      IPV6Address,
+
+      IPBroadcastAddress,
+      IPV6MulticastAddress
    };
 
-   U8 netNum[4];    ///< For IP:  sin_addr<br>
-   U8 nodeNum[6];   ///< For IP:  Not used.<br>
-   U16  port;       ///< For IP:  sin_port<br>
+   union
+   {
+      struct {
+         U8 netNum[4];
+      } ipv4;
+
+      struct {
+         U8 netNum[16];
+         U32 netFlow;
+         U32 netScope;
+      } ipv6;
+
+      struct {
+         U8 netNum[16];
+         U8 netFlow[4];
+         U8 netScope[4];
+      } ipv6_raw;
+
+   } address;
+
+   U16 port;
+
+   bool isSameAddress(const NetAddress &other) const
+   {
+	   if (type != other.type)
+		   return false;
+
+      switch (type)
+      {
+      case NetAddress::IPAddress:
+         return (dMemcmp(other.address.ipv4.netNum, address.ipv4.netNum, 4) == 0);
+         break;
+      case NetAddress::IPV6Address:
+         return (dMemcmp(other.address.ipv6.netNum, address.ipv6.netNum, 16) == 0);
+         break;
+      case NetAddress::IPBroadcastAddress:
+         return true;
+         break;
+      case NetAddress::IPV6MulticastAddress:
+         return true;
+         break;
+      }
+
+      return false;
+   }
+
+   bool isSameAddressAndPort(const NetAddress &other) const
+   {
+	   if (type != other.type)
+		   return false;
+
+	   switch (type)
+	   {
+	   case NetAddress::IPAddress:
+		   return (dMemcmp(other.address.ipv4.netNum, address.ipv4.netNum, 4) == 0) && other.port == port;
+		   break;
+	   case NetAddress::IPV6Address:
+		   return (dMemcmp(other.address.ipv6.netNum, address.ipv6.netNum, 16) == 0) && other.port == port;
+		   break;
+	   case NetAddress::IPBroadcastAddress:
+		   return true;
+		   break;
+	   case NetAddress::IPV6MulticastAddress:
+		   return true;
+		   break;
+	   }
+
+	   return false;
+   }
+
+   bool isEqual(const NetAddress &other) const
+   {
+	   if (type != other.type)
+		   return false;
+
+      switch (type)
+      {
+      case NetAddress::IPAddress:
+         return other.port == port && (dMemcmp(other.address.ipv4.netNum, address.ipv4.netNum, 4) == 0);
+         break;
+      case NetAddress::IPV6Address:
+         return other.port == port && other.address.ipv6.netFlow == address.ipv6.netFlow && other.address.ipv6.netScope == address.ipv6.netScope && (dMemcmp(other.address.ipv6.netNum, address.ipv6.netNum, 16) == 0);
+         break;
+      case NetAddress::IPBroadcastAddress:
+         return other.port == port;
+         break;
+      case NetAddress::IPV6MulticastAddress:
+         return other.port == port;
+         break;
+      }
+
+      return false;
+   }
+
+   U32 getHash() const;
 };
 
-typedef S32 NetSocket;
-const NetSocket InvalidSocket = -1;
+class NetSocket
+{
+protected:
+   S32 mHandle;
+
+public:
+   NetSocket() : mHandle(-1) { ; }
+
+   inline void setHandle(S32 handleId) { mHandle = handleId; }
+   inline S32 getHandle() const { return mHandle;  }
+   inline U32 getHash() const { return mHandle; }
+
+   bool operator==(const NetSocket &other) const { return mHandle == other.mHandle; }
+   bool operator!=(const NetSocket &other) const { return mHandle != other.mHandle; }
+
+   static NetSocket fromHandle(S32 handleId) { NetSocket ret; ret.mHandle = handleId; return ret; }
+   static NetSocket INVALID;
+};
 
 /// void event(NetSocket sock, U32 state) 
 typedef JournaledSignal<void(NetSocket,U32)> ConnectionNotifyEvent;
@@ -76,7 +190,8 @@ struct Net
       InvalidPacketProtocol,
       WouldBlock,
       NotASocket,
-      UnknownError
+      UnknownError,
+	  NeedHostLookup
    };
 
    enum ConnectionState {
@@ -87,18 +202,16 @@ struct Net
       Disconnected
    };
 
-   enum Protocol
-   {
-      UDPProtocol,
-      TCPProtocol
-   };
-
    static const S32 MaxPacketDataSize = MAXPACKETSIZE;
 
-   static ConnectionNotifyEvent   smConnectionNotify;
-   static ConnectionAcceptedEvent smConnectionAccept;
-   static ConnectionReceiveEvent  smConnectionReceive;
-   static PacketReceiveEvent      smPacketReceive;
+   static ConnectionNotifyEvent&   getConnectionNotifyEvent();
+   static ConnectionAcceptedEvent& getConnectionAcceptedEvent();
+   static ConnectionReceiveEvent&  getConnectionReceiveEvent();
+   static PacketReceiveEvent&      getPacketReceiveEvent();
+
+   static bool smMulticastEnabled;
+   static bool smIpv4Enabled;
+   static bool smIpv6Enabled;
 
    static bool init();
    static void shutdown();
@@ -116,35 +229,47 @@ struct Net
 
    // Reliable net functions (TCP)
    // all incoming messages come in on the Connected* events
-   static NetSocket openListenPort(U16 port);
+   static NetSocket openListenPort(U16 port, NetAddress::Type = NetAddress::IPAddress);
    static NetSocket openConnectTo(const char *stringAddress); // does the DNS resolve etc.
    static void closeConnectTo(NetSocket socket);
-   static Error sendtoSocket(NetSocket socket, const U8 *buffer, S32 bufferSize);
+   static Error sendtoSocket(NetSocket socket, const U8 *buffer, S32 bufferSize, S32 *bytesWritten=NULL);
 
    static bool compareAddresses(const NetAddress *a1, const NetAddress *a2);
-   static bool stringToAddress(const char *addressString, NetAddress *address);
+   static Net::Error stringToAddress(const char *addressString, NetAddress *address, bool hostLookup=true, int family=0);
    static void addressToString(const NetAddress *address, char addressString[256]);
 
    // lower level socked based network functions
    static NetSocket openSocket();
    static Error closeSocket(NetSocket socket);
 
-   static Error send(NetSocket socket, const U8 *buffer, S32 bufferSize);
+   static Error send(NetSocket socket, const U8 *buffer, S32 bufferSize, S32 *outBytesWritten=NULL);
    static Error recv(NetSocket socket, U8 *buffer, S32 bufferSize, S32 *bytesRead);
 
    static Error connect(NetSocket socket, const NetAddress *address);
    static Error listen(NetSocket socket, S32 maxConcurrentListens);
    static NetSocket accept(NetSocket acceptSocket, NetAddress *remoteAddress);
 
-   static Error bind(NetSocket socket, U16 port);
+   static Error bindAddress(const NetAddress &address, NetSocket socket, bool useUDP=false);
    static Error setBufferSize(NetSocket socket, S32 bufferSize);
    static Error setBroadcast(NetSocket socket, bool broadcastEnable);
    static Error setBlocking(NetSocket socket, bool blockingIO);
 
+   /// Gets the desired default listen address for a specified address type
+   static Net::Error getListenAddress(const NetAddress::Type type, NetAddress *address, bool forceDefaults=false);
+   static void getIdealListenAddress(NetAddress *address);
+
+   // Multicast for ipv6 local net browsing
+   static void enableMulticast();
+   static void disableMulticast();
+   static bool isMulticastEnabled();
+
+   // Protocol state
+   static bool isAddressTypeAvailable(NetAddress::Type addressType);
 
 private:
    static void process();
+   static void processListenSocket(NetSocket socket);
 
 };
 
-#endif
+#endif

+ 9 - 6
Engine/source/platform/platformNetAsync.cpp

@@ -53,7 +53,7 @@ struct NetAsync::NameLookupRequest
 
       NameLookupRequest()
       {
-         sock = InvalidSocket;
+         sock = NetSocket::INVALID;
          remoteAddr[0] = 0;
          out_h_addr[0] = 0;
          out_h_length = -1;
@@ -81,9 +81,12 @@ protected:
    virtual void execute()
    {
 #ifndef TORQUE_OS_XENON
+
+	  NetAddress address;
+	  Net::Error error = Net::stringToAddress(mRequest.remoteAddr, &address, true);
+
       // do it
-      struct hostent* hostent = gethostbyname(mRequest.remoteAddr);
-      if (hostent == NULL)
+      if (error != Net::NoError)
       {
          // oh well!  leave the lookup data unmodified (h_length) should
          // still be -1 from initialization
@@ -94,9 +97,9 @@ protected:
          // copy the stuff we need from the hostent 
          dMemset(mRequest.out_h_addr, 0, 
             sizeof(mRequest.out_h_addr));
-         dMemcpy(mRequest.out_h_addr, hostent->h_addr, hostent->h_length);
+         dMemcpy(mRequest.out_h_addr, &address, sizeof(address));
 
-         mRequest.out_h_length = hostent->h_length;
+		 mRequest.out_h_length = sizeof(address);
          mRequest.complete = true;
       }
 #else
@@ -159,7 +162,7 @@ void NetAsync::queueLookup(const char* remoteAddr, NetSocket socket)
    ThreadPool::GLOBAL().queueWorkItem( workItem );
 }
 
-bool NetAsync::checkLookup(NetSocket socket, char* out_h_addr, 
+bool NetAsync::checkLookup(NetSocket socket, void* out_h_addr, 
                            S32* out_h_length, S32 out_h_addr_size)
 {
    bool found = false;

+ 1 - 1
Engine/source/platform/platformNetAsync.h

@@ -54,7 +54,7 @@ class NetAsync
       // out_h_length will be set appropriately.  if out_h_length is -1, then
       // name could not be resolved.  otherwise, it provides the number of
       // address bytes copied into out_h_addr.
-      bool checkLookup(NetSocket socket, char* out_h_addr, int* out_h_length, S32 out_h_addr_size);
+      bool checkLookup(NetSocket socket, void* out_h_addr, int* out_h_length, S32 out_h_addr_size);
 };
 
 // the global net async object

+ 5 - 5
Engine/source/platform/test/netTest.cpp

@@ -52,7 +52,7 @@ struct TcpHandle
       else
       {
          Process::requestShutdown();
-         mSocket = NULL;
+         mSocket = NetSocket::INVALID;
          ASSERT_EQ(Net::Disconnected, state)
             << "Ended with a network error!";
       }
@@ -72,7 +72,7 @@ TEST(Net, TCPRequest)
 {
    TcpHandle handler;
 
-   handler.mSocket = InvalidSocket;
+   handler.mSocket = NetSocket::INVALID;
    handler.mDataReceived = 0;
 
    // Hook into the signals.
@@ -119,7 +119,7 @@ struct JournalHandle
       else
       {
          Process::requestShutdown();
-         mSocket = NULL;
+         mSocket = NetSocket::INVALID;
          ASSERT_EQ(Net::Disconnected, state)
             << "Ended with a network error!";
       }
@@ -135,7 +135,7 @@ struct JournalHandle
 
    void makeRequest()
    {
-      mSocket = InvalidSocket;
+      mSocket = NetSocket::INVALID;
       mDataReceived = 0;
 
       // Hook into the signals.
@@ -175,4 +175,4 @@ TEST(Net, JournalTCPRequest)
       << "Didn't get same data back from journal playback.";
 }
 
-#endif
+#endif

+ 7 - 6
Engine/source/scene/simPath.cpp

@@ -296,11 +296,12 @@ void Marker::initGFXResources()
    
    smVertexBuffer.set(GFX, 4, GFXBufferTypeStatic);
    GFXVertexPCT* verts = smVertexBuffer.lock();
-   verts[0].point = wedgePoints[0] * 0.25f;
-   verts[1].point = wedgePoints[1] * 0.25f;
-   verts[2].point = wedgePoints[2] * 0.25f;
-   verts[3].point = wedgePoints[3] * 0.25f;
-   verts[0].color = verts[1].color = verts[2].color = verts[3].color = GFXVertexColor(ColorI(0, 255, 0, 255));
+   verts[0].point = wedgePoints[0] * 1.25f;
+   verts[1].point = wedgePoints[1] * 1.25f;
+   verts[2].point = wedgePoints[2] * 1.25f;
+   verts[3].point = wedgePoints[3] * 1.25f;
+   verts[1].color = GFXVertexColor(ColorI(255, 0, 0, 255));
+   verts[0].color = verts[2].color = verts[3].color = GFXVertexColor(ColorI(0, 0, 255, 255));
    smVertexBuffer.unlock();
    
    smPrimitiveBuffer.set(GFX, 24, 12, GFXBufferTypeStatic);
@@ -417,7 +418,7 @@ bool Marker::onAdd()
    if(!Parent::onAdd())
       return false;
 
-   mObjBox = Box3F(Point3F(-.25, -.25, -.25), Point3F(.25, .25, .25));
+   mObjBox = Box3F(Point3F(-1.25, -1.25, -1.25), Point3F(1.25, 1.25, 1.25));
    resetWorldBox();
 
    if(gEditingMission)

+ 0 - 8
Engine/source/shaderGen/GLSL/bumpGLSL.cpp

@@ -291,14 +291,6 @@ void ParallaxFeatGLSL::processVert( Vector<ShaderComponent*> &componentList,
    meta->addStatement( new GenOp( "   @ = tMul( @, float3( @.xyz - @ ) );\r\n", 
       outNegViewTS, objToTangentSpace, inPos, eyePos ) );
 
-   // TODO: I'm at a loss at why i need to flip the binormal/y coord
-   // to get a good view vector for parallax. Lighting works properly
-   // with the TS matrix as is... but parallax does not.
-   //
-   // Someone figure this out!
-   //
-   meta->addStatement( new GenOp( "   @.y = [email protected];\r\n", outNegViewTS, outNegViewTS ) );  
-
    // If we have texture anim matrix the tangent
    // space view vector may need to be rotated.
    Var *texMat = (Var*)LangElement::find( "texMat" );

+ 0 - 2
Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp

@@ -67,8 +67,6 @@ LangElement * ShaderFeatureGLSL::setupTexSpaceMat( Vector<ShaderComponent*> &, /
    {
       if(dStricmp((char*)T->type, "vec4") == 0)
          meta->addStatement( new GenOp( "   tSetMatrixRow(@, 1, cross( @, normalize(@) ) * @.w);\r\n", *texSpaceMat, T, N, T ) );
-      else if(tangentW)
-         meta->addStatement( new GenOp( "   tSetMatrixRow(@, 1, cross( @, normalize(@) ) * @);\r\n", *texSpaceMat, T, N, tangentW ) );
       else
          meta->addStatement( new GenOp( "   tSetMatrixRow(@, 1, cross( @, normalize(@) ));\r\n", *texSpaceMat, T, N ) );
    }

+ 0 - 8
Engine/source/shaderGen/HLSL/bumpHLSL.cpp

@@ -323,14 +323,6 @@ void ParallaxFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
    meta->addStatement( new GenOp( "   @ = mul( @, float3( @.xyz - @ ) );\r\n", 
       outNegViewTS, objToTangentSpace, inPos, eyePos ) );
 
-   // TODO: I'm at a loss at why i need to flip the binormal/y coord
-   // to get a good view vector for parallax. Lighting works properly
-   // with the TS matrix as is... but parallax does not.
-   //
-   // Someone figure this out!
-   //
-   meta->addStatement( new GenOp( "   @.y = [email protected];\r\n", outNegViewTS, outNegViewTS ) );  
-
    // If we have texture anim matrix the tangent
    // space view vector may need to be rotated.
    Var *texMat = (Var*)LangElement::find( "texMat" );

+ 0 - 2
Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp

@@ -67,8 +67,6 @@ LangElement * ShaderFeatureHLSL::setupTexSpaceMat( Vector<ShaderComponent*> &, /
    {
       if(dStricmp((char*)T->type, "float4") == 0)
          meta->addStatement( new GenOp( "   @[1] = cross( @, normalize(@) ) * @.w;\r\n", *texSpaceMat, T, N, T ) );
-      else if(tangentW)
-         meta->addStatement( new GenOp( "   @[1] = cross( @, normalize(@) ) * @;\r\n", *texSpaceMat, T, N, tangentW ) );
       else
          meta->addStatement( new GenOp( "   @[1] = cross( @, normalize(@) );\r\n", *texSpaceMat, T, N ) );
    }

+ 2 - 2
Engine/source/sim/netConnection.cpp

@@ -157,7 +157,7 @@ bool NetConnection::mFilesWereDownloaded = false;
 
 static inline U32 HashNetAddress(const NetAddress *addr)
 {
-   return *((U32 *)addr->netNum) % NetConnection::HashTableSize;
+   return addr->getHash() % NetConnection::HashTableSize;
 }
 
 NetConnection *NetConnection::lookup(const NetAddress *addr)
@@ -1421,7 +1421,7 @@ DefineEngineMethod( NetConnection, connect, void, (const char* remoteAddress),,
    )
 {
    NetAddress addr;
-   if(!Net::stringToAddress(remoteAddress, &addr))
+   if (Net::stringToAddress(remoteAddress, &addr) != Net::NoError)
    {
       Con::errorf("NetConnection::connect: invalid address - %s", remoteAddress);
       return;

+ 3 - 6
Engine/source/sim/netInterface.cpp

@@ -41,7 +41,7 @@ NetInterface::NetInterface()
    GNet = this;
 
    mLastTimeoutCheckTime = 0;
-   mAllowConnections = true;
+   mAllowConnections = false;
 
 }
 
@@ -109,7 +109,7 @@ void NetInterface::processPacketReceiveEvent(NetAddress srcAddress, RawData pack
       pStream.read(&packetType);
       NetAddress *addr = &srcAddress;
 
-      if(packetType <= GameHeartbeat)
+      if(packetType <= GameHeartbeat || packetType == MasterServerExtendedListResponse)
          handleInfoPacket(addr, packetType, &pStream);
 #ifdef GGC_PLUGIN
       else if (packetType == GGCPacket)
@@ -556,10 +556,7 @@ void NetInterface::computeNetMD5(const NetAddress *address, U32 connectSequence,
 
    U32 in[16];
    in[0] = address->type;
-   in[1] = (U32(address->netNum[0]) << 24) |
-           (U32(address->netNum[1]) << 16) |
-           (U32(address->netNum[2]) << 8)  |
-           (U32(address->netNum[3]));
+   in[1] = address->getHash();
    in[2] = address->port;
    in[3] = connectSequence;
    for(U32 i = 0; i < 12; i++)

+ 4 - 1
Engine/source/sim/netInterface.h

@@ -46,7 +46,7 @@ public:
       GameInfoRequest               = 18,
       GameInfoResponse              = 20,
       GameHeartbeat                 = 22,
-	  GGCPacket                     = 24,
+      GGCPacket                     = 24,
       ConnectChallengeRequest       = 26,
       ConnectChallengeReject        = 28,
       ConnectChallengeResponse      = 30,
@@ -54,6 +54,9 @@ public:
       ConnectReject                 = 34,
       ConnectAccept                 = 36,
       Disconnect                    = 38,
+      MasterServerExtendedListResponse = 40,
+      MasterServerChallenge            = 42,
+      MasterServerExtendedListRequest  = 44,
    };
 protected:
 

+ 14 - 4
Engine/source/terrain/terrCellMaterial.cpp

@@ -152,11 +152,17 @@ void TerrainCellMaterial::_updateDefaultAnisotropy()
          } // for ( U32 m=0; m < pass.materials.size(); m++ )
 
          // Set the updated stateblock.
+         desc.setCullMode( GFXCullCCW );
          pass.stateBlock = GFX->createStateBlock( desc );
 
+         //reflection
+         desc.setCullMode( GFXCullCW );
+         pass.reflectionStateBlock = GFX->createStateBlock(desc);
+
          // Create the wireframe state blocks.
          GFXStateBlockDesc wireframe( desc );
          wireframe.fillMode = GFXFillWireframe;
+         wireframe.setCullMode( GFXCullCCW );
          pass.wireframeStateBlock = GFX->createStateBlock( wireframe );
 
       } // for ( U32 p=0; i < (*iter)->mPasses.size(); p++ )
@@ -668,15 +674,17 @@ bool TerrainCellMaterial::_createPass( Vector<MaterialInfo*> *materials,
    if ( prePassMat )
       desc.addDesc( RenderPrePassMgr::getOpaqueStenciWriteDesc( false ) );
 
-   // Shut off culling for prepass materials (reflection support).
-   if ( prePassMat )
-      desc.setCullMode( GFXCullNone );
+   desc.setCullMode( GFXCullCCW );
+   pass->stateBlock = GFX->createStateBlock(desc);
 
-   pass->stateBlock = GFX->createStateBlock( desc );
+   //reflection stateblock
+   desc.setCullMode( GFXCullCW );
+   pass->reflectionStateBlock = GFX->createStateBlock(desc);
 
    // Create the wireframe state blocks.
    GFXStateBlockDesc wireframe( desc );
    wireframe.fillMode = GFXFillWireframe;
+   wireframe.setCullMode( GFXCullCCW );
    pass->wireframeStateBlock = GFX->createStateBlock( wireframe );
 
    return true;
@@ -776,6 +784,8 @@ bool TerrainCellMaterial::setupPass(   const SceneRenderState *state,
 
    if ( sceneData.wireframe )
       GFX->setStateBlock( pass.wireframeStateBlock );
+   else if ( state->isReflectPass( ))
+      GFX->setStateBlock( pass.reflectionStateBlock );
    else
       GFX->setStateBlock( pass.stateBlock );
 

+ 1 - 0
Engine/source/terrain/terrCellMaterial.h

@@ -108,6 +108,7 @@ protected:
 
       GFXStateBlockRef stateBlock;
       GFXStateBlockRef wireframeStateBlock;
+      GFXStateBlockRef reflectionStateBlock;
 
       GFXShaderConstHandle *modelViewProjConst;
       GFXShaderConstHandle *worldViewOnly;

+ 9 - 6
Engine/source/windowManager/sdl/sdlSplashScreen.cpp

@@ -39,16 +39,19 @@ bool Platform::displaySplashWindow( String path )
    gSplashImage = SDL_LoadBMP(path);
 
    //now the pop-up window
-   gSplashWindow = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 
-      gSplashImage->w, gSplashImage->h, SDL_WINDOW_BORDERLESS | SDL_WINDOW_SHOWN);
+   if (gSplashImage)
+   {
+      gSplashWindow = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
+         gSplashImage->w, gSplashImage->h, SDL_WINDOW_BORDERLESS | SDL_WINDOW_SHOWN);
 
-   gSplashRenderer = SDL_CreateRenderer(gSplashWindow, -1, SDL_RENDERER_ACCELERATED);
+      gSplashRenderer = SDL_CreateRenderer(gSplashWindow, -1, SDL_RENDERER_ACCELERATED);
 
-   gSplashTexture = SDL_CreateTextureFromSurface(gSplashRenderer, gSplashImage);
+      gSplashTexture = SDL_CreateTextureFromSurface(gSplashRenderer, gSplashImage);
 
-   SDL_RenderCopy(gSplashRenderer, gSplashTexture, NULL, NULL);
+      SDL_RenderCopy(gSplashRenderer, gSplashTexture, NULL, NULL);
 
-   SDL_RenderPresent(gSplashRenderer);
+      SDL_RenderPresent(gSplashRenderer);
+   }
 
 	return true;
 }

+ 1 - 1
Engine/source/windowManager/sdl/sdlWindow.cpp

@@ -342,7 +342,7 @@ bool PlatformWindowSDL::isFocused()
    if( flags & SDL_WINDOW_INPUT_FOCUS || flags & SDL_WINDOW_INPUT_GRABBED || flags & SDL_WINDOW_MOUSE_FOCUS )
       return true;
 
-	return true;
+   return false;
 }
 
 bool PlatformWindowSDL::isMinimized()

+ 1 - 1
Templates/Empty/buildFiles/config/torque3D_dedicated.conf

@@ -81,7 +81,7 @@
         addProjectLibInput('ADVAPI32.LIB');
         addProjectLibInput('GDI32.LIB');
         addProjectLibInput('WINMM.LIB');
-        addProjectLibInput('WSOCK32.LIB');
+        addProjectLibInput('WS2_32.LIB.LIB');
         addProjectLibInput('vfw32.lib');
         addProjectLibInput('Imm32.lib');
         addProjectLibInput('d3d9.lib');

+ 1 - 1
Templates/Full/buildFiles/config/torque3D_dedicated.conf

@@ -81,7 +81,7 @@
         addProjectLibInput('ADVAPI32.LIB');
         addProjectLibInput('GDI32.LIB');
         addProjectLibInput('WINMM.LIB');
-        addProjectLibInput('WSOCK32.LIB');
+        addProjectLibInput('WS2_32.LIB');
         addProjectLibInput('vfw32.lib');
         addProjectLibInput('Imm32.lib');
         addProjectLibInput('d3d9.lib');

+ 0 - 1
Templates/Full/game/art/environment/precipitation/rain.dml

@@ -1 +0,0 @@
-rain

+ 8 - 8
Templates/Full/game/shaders/common/gl/torque.glsl

@@ -138,13 +138,13 @@ mat3x3 quatToMat( vec4 quat )
 ///
 vec2 parallaxOffset( sampler2D texMap, vec2 texCoord, vec3 negViewTS, float depthScale )
 {
-   float depth = texture( texMap, texCoord ).a;
-   vec2 offset = negViewTS.xy * vec2( depth * depthScale );
+   float depth = texture( texMap, texCoord ).a/(PARALLAX_REFINE_STEPS*2);
+   vec2 offset = negViewTS.xy * vec2( depth * depthScale )/vec2(PARALLAX_REFINE_STEPS*2);
 
    for ( int i=0; i < PARALLAX_REFINE_STEPS; i++ )
    {
-      depth = ( depth + texture( texMap, texCoord + offset ).a ) * 0.5;
-      offset = negViewTS.xy * vec2( depth * depthScale );
+      depth = ( depth + texture( texMap, texCoord + offset ).a )/(PARALLAX_REFINE_STEPS*2);
+      offset = negViewTS.xy * vec2( depth * depthScale )/vec2(PARALLAX_REFINE_STEPS*2);
    }
 
    return offset;
@@ -153,13 +153,13 @@ vec2 parallaxOffset( sampler2D texMap, vec2 texCoord, vec3 negViewTS, float dept
 /// Same as parallaxOffset but for dxtnm where depth is stored in the red channel instead of the alpha
 vec2 parallaxOffsetDxtnm(sampler2D texMap, vec2 texCoord, vec3 negViewTS, float depthScale)
 {
-   float depth = texture(texMap, texCoord).r;
-   vec2 offset = negViewTS.xy * vec2(depth * depthScale);
+   float depth = texture(texMap, texCoord).r/(PARALLAX_REFINE_STEPS*2);
+   vec2 offset = negViewTS.xy * vec2(depth * depthScale)/vec2(PARALLAX_REFINE_STEPS*2);
 
    for (int i = 0; i < PARALLAX_REFINE_STEPS; i++)
    {
-      depth = (depth + texture(texMap, texCoord + offset).r) * 0.5;
-      offset = negViewTS.xy * vec2(depth * depthScale);
+      depth = (depth + texture(texMap, texCoord + offset).r)/(PARALLAX_REFINE_STEPS*2);
+      offset = negViewTS.xy * vec2(depth * depthScale)/vec2(PARALLAX_REFINE_STEPS*2);
    }
 
    return offset;

+ 8 - 8
Templates/Full/game/shaders/common/torque.hlsl

@@ -140,13 +140,13 @@ float3x3 quatToMat( float4 quat )
 ///
 float2 parallaxOffset(TORQUE_SAMPLER2D(texMap), float2 texCoord, float3 negViewTS, float depthScale)
 {
-   float depth = TORQUE_TEX2D(texMap, texCoord).a;
-   float2 offset = negViewTS.xy * (depth * depthScale);
+   float depth = TORQUE_TEX2D(texMap, texCoord).a/(PARALLAX_REFINE_STEPS*2);
+   float2 offset = negViewTS.xy * (depth * depthScale)/(PARALLAX_REFINE_STEPS);
 
    for (int i = 0; i < PARALLAX_REFINE_STEPS; i++)
    {
-      depth = (depth + TORQUE_TEX2D(texMap, texCoord + offset).a) * 0.5;
-      offset = negViewTS.xy * (depth * depthScale);
+      depth = (depth + TORQUE_TEX2D(texMap, texCoord + offset).a)/(PARALLAX_REFINE_STEPS*2);
+      offset = negViewTS.xy * (depth * depthScale)/(PARALLAX_REFINE_STEPS);
    }
 
    return offset;
@@ -155,13 +155,13 @@ float2 parallaxOffset(TORQUE_SAMPLER2D(texMap), float2 texCoord, float3 negViewT
 /// Same as parallaxOffset but for dxtnm where depth is stored in the red channel instead of the alpha
 float2 parallaxOffsetDxtnm(TORQUE_SAMPLER2D(texMap), float2 texCoord, float3 negViewTS, float depthScale)
 {
-   float depth = TORQUE_TEX2D(texMap, texCoord).r;
-   float2 offset = negViewTS.xy * (depth * depthScale);
+   float depth = TORQUE_TEX2D(texMap, texCoord).r/(PARALLAX_REFINE_STEPS*2);
+   float2 offset = negViewTS.xy * (depth * depthScale)/(PARALLAX_REFINE_STEPS*2);
 
    for (int i = 0; i < PARALLAX_REFINE_STEPS; i++)
    {
-      depth = (depth + TORQUE_TEX2D(texMap, texCoord + offset).r) * 0.5;
-      offset = negViewTS.xy * (depth * depthScale);
+      depth = (depth + TORQUE_TEX2D(texMap, texCoord + offset).r)/(PARALLAX_REFINE_STEPS*2);
+      offset = negViewTS.xy * (depth * depthScale)/(PARALLAX_REFINE_STEPS*2);
    }
 
    return offset;

+ 2 - 0
Templates/Full/source/torqueConfig.h

@@ -34,6 +34,8 @@
 /// What's the name of your application? Used in a variety of places.
 #define TORQUE_APP_NAME            "Full"
 
+#define TORQUE_NET_DEFAULT_MULTICAST_ADDRESS "ff04::7467:656E:6574:776B"
+
 /// What version of the application specific source code is this?
 ///
 /// Version number is major * 1000 + minor * 100 + revision * 10.

+ 1 - 1
Tools/CMake/basics.cmake

@@ -365,7 +365,7 @@ if(WIN32)
     set(TORQUE_CXX_FLAGS_LIBS "/W0" CACHE TYPE STRING)
     mark_as_advanced(TORQUE_CXX_FLAGS_LIBS)
 
-    set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS /MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /fp:fast /fp:except- /GR /Zc:wchar_t-" )
+    set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS /MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /fp:precise /fp:except- /GR /Zc:wchar_t-" )
     if( TORQUE_CPU_X32 )
        set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "${TORQUE_CXX_FLAGS_COMMON_DEFAULT} /arch:SSE2")
     endif()

+ 1 - 1
Tools/CMake/torque3d.cmake

@@ -616,7 +616,7 @@ endif()
 
 if(WIN32)
     # copy pasted from T3D build system, some might not be needed
-    set(TORQUE_EXTERNAL_LIBS "COMCTL32.LIB;COMDLG32.LIB;USER32.LIB;ADVAPI32.LIB;GDI32.LIB;WINMM.LIB;WSOCK32.LIB;vfw32.lib;Imm32.lib;d3d9.lib;d3dx9.lib;DxErr.lib;ole32.lib;shell32.lib;oleaut32.lib;version.lib" CACHE STRING "external libs to link against")
+    set(TORQUE_EXTERNAL_LIBS "COMCTL32.LIB;COMDLG32.LIB;USER32.LIB;ADVAPI32.LIB;GDI32.LIB;WINMM.LIB;WS2_32.LIB;vfw32.lib;Imm32.lib;d3d9.lib;d3dx9.lib;DxErr.lib;ole32.lib;shell32.lib;oleaut32.lib;version.lib" CACHE STRING "external libs to link against")
     mark_as_advanced(TORQUE_EXTERNAL_LIBS)
     addLib("${TORQUE_EXTERNAL_LIBS}")
 

+ 1 - 1
Tools/projectGenerator/classes/NPWebPlugin.php

@@ -118,7 +118,7 @@ class NPWebPlugin
       addProjectLibInput('ADVAPI32.LIB');
       addProjectLibInput('GDI32.LIB');
       addProjectLibInput('WINMM.LIB');
-      addProjectLibInput('WSOCK32.LIB');
+      addProjectLibInput('WS2_32.LIB');
       addProjectLibInput('vfw32.lib');
       addProjectLibInput('Imm32.lib');
       addProjectLibInput('UnicoWS.lib');

+ 1 - 1
Tools/projectGenerator/classes/Torque3D.php

@@ -173,7 +173,7 @@ class Torque3D
             addProjectLibInput('ADVAPI32.LIB');
             addProjectLibInput('GDI32.LIB');
             addProjectLibInput('WINMM.LIB');
-            addProjectLibInput('WSOCK32.LIB');
+            addProjectLibInput('WS2_32.LIB');
             addProjectLibInput('vfw32.lib');
             addProjectLibInput('Imm32.lib');
             addProjectLibInput('d3d9.lib');

+ 1 - 1
Tools/projectGenerator/libs/Torque3D.conf

@@ -183,7 +183,7 @@ else
         addProjectLibInput('ADVAPI32.LIB');
         addProjectLibInput('GDI32.LIB');
         addProjectLibInput('WINMM.LIB');
-        addProjectLibInput('WSOCK32.LIB');
+        addProjectLibInput('WS2_32.LIB');
         addProjectLibInput('vfw32.lib');
         addProjectLibInput('Imm32.lib');
         addProjectLibInput('d3d9.lib');

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio