mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #1159 from GarageGames/navigation-default-on
Include navigation and testing modules by default
This commit is contained in:
commit
47626684ce
10 changed files with 146 additions and 138 deletions
|
|
@ -28,6 +28,8 @@
|
||||||
#include "T3D/gameBase/moveManager.h"
|
#include "T3D/gameBase/moveManager.h"
|
||||||
#include "console/engineAPI.h"
|
#include "console/engineAPI.h"
|
||||||
|
|
||||||
|
#include <cfloat>
|
||||||
|
|
||||||
static U32 sAIPlayerLoSMask = TerrainObjectType | StaticShapeObjectType | StaticObjectType;
|
static U32 sAIPlayerLoSMask = TerrainObjectType | StaticShapeObjectType | StaticObjectType;
|
||||||
|
|
||||||
IMPLEMENT_CO_NETOBJECT_V1(AIPlayer);
|
IMPLEMENT_CO_NETOBJECT_V1(AIPlayer);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ extern void default_matF_x_matF_C(const F32 *a, const F32 *b, F32 *mresult);
|
||||||
extern void mInstallLibrary_ASM();
|
extern void mInstallLibrary_ASM();
|
||||||
|
|
||||||
// If we're x86 and not Mac, then include these. There's probably a better way to do this.
|
// If we're x86 and not Mac, then include these. There's probably a better way to do this.
|
||||||
#if defined(TORQUE_CPU_X86) && !defined(TORQUE_OS_MAC)
|
#if defined(WIN32) && defined(TORQUE_CPU_X86)
|
||||||
extern "C" void Athlon_MatrixF_x_MatrixF(const F32 *matA, const F32 *matB, F32 *result);
|
extern "C" void Athlon_MatrixF_x_MatrixF(const F32 *matA, const F32 *matB, F32 *result);
|
||||||
extern "C" void SSE_MatrixF_x_MatrixF(const F32 *matA, const F32 *matB, F32 *result);
|
extern "C" void SSE_MatrixF_x_MatrixF(const F32 *matA, const F32 *matB, F32 *result);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -55,7 +55,7 @@ TEST(MatrixF, MultiplyImplmentations)
|
||||||
// C will be the baseline
|
// C will be the baseline
|
||||||
default_matF_x_matF_C(m1, m2, mrC);
|
default_matF_x_matF_C(m1, m2, mrC);
|
||||||
|
|
||||||
#if defined(TORQUE_CPU_X86) && !defined(TORQUE_OS_MAC)
|
#if defined(WIN32) && defined(TORQUE_CPU_X86)
|
||||||
// Check the CPU info
|
// Check the CPU info
|
||||||
U32 cpuProperties = Platform::SystemInfo.processor.properties;
|
U32 cpuProperties = Platform::SystemInfo.processor.properties;
|
||||||
bool same;
|
bool same;
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
#include "math/mathIO.h"
|
#include "math/mathIO.h"
|
||||||
|
|
||||||
#include <DetourDebugDraw.h>
|
#include <DetourDebugDraw.h>
|
||||||
|
#include <climits>
|
||||||
|
|
||||||
extern bool gEditingMission;
|
extern bool gEditingMission;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,57 +25,59 @@
|
||||||
#include "platform/platformNet.h"
|
#include "platform/platformNet.h"
|
||||||
#include "core/util/journal/process.h"
|
#include "core/util/journal/process.h"
|
||||||
|
|
||||||
|
struct TcpHandle
|
||||||
|
{
|
||||||
|
NetSocket mSocket;
|
||||||
|
S32 mDataReceived;
|
||||||
|
|
||||||
|
void notify(NetSocket sock, U32 state)
|
||||||
|
{
|
||||||
|
// Only consider our own socket.
|
||||||
|
if(mSocket != sock)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Ok - what's the state? We do some dumb responses to given states
|
||||||
|
// in order to fulfill the request.
|
||||||
|
if(state == Net::Connected)
|
||||||
|
{
|
||||||
|
U8 reqBuffer[] = {
|
||||||
|
"GET / HTTP/1.0\nUser-Agent: Torque/1.0\n\n"
|
||||||
|
};
|
||||||
|
|
||||||
|
Net::Error e = Net::sendtoSocket(mSocket, reqBuffer, sizeof(reqBuffer));
|
||||||
|
|
||||||
|
ASSERT_EQ(Net::NoError, e)
|
||||||
|
<< "Got an error sending our HTTP request!";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Process::requestShutdown();
|
||||||
|
mSocket = NULL;
|
||||||
|
ASSERT_EQ(Net::Disconnected, state)
|
||||||
|
<< "Ended with a network error!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void receive(NetSocket sock, RawData incomingData)
|
||||||
|
{
|
||||||
|
// Only consider our own socket.
|
||||||
|
if(mSocket != sock)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mDataReceived += incomingData.size;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
TEST(Net, TCPRequest)
|
TEST(Net, TCPRequest)
|
||||||
{
|
{
|
||||||
struct handle
|
TcpHandle handler;
|
||||||
{
|
|
||||||
NetSocket mSocket;
|
|
||||||
S32 mDataReceived;
|
|
||||||
|
|
||||||
void notify(NetSocket sock, U32 state)
|
|
||||||
{
|
|
||||||
// Only consider our own socket.
|
|
||||||
if(mSocket != sock)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Ok - what's the state? We do some dumb responses to given states
|
|
||||||
// in order to fulfill the request.
|
|
||||||
if(state == Net::Connected)
|
|
||||||
{
|
|
||||||
U8 reqBuffer[] = {
|
|
||||||
"GET / HTTP/1.0\nUser-Agent: Torque/1.0\n\n"
|
|
||||||
};
|
|
||||||
|
|
||||||
Net::Error e = Net::sendtoSocket(mSocket, reqBuffer, sizeof(reqBuffer));
|
|
||||||
|
|
||||||
ASSERT_EQ(Net::NoError, e)
|
|
||||||
<< "Got an error sending our HTTP request!";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Process::requestShutdown();
|
|
||||||
mSocket = NULL;
|
|
||||||
ASSERT_EQ(Net::Disconnected, state)
|
|
||||||
<< "Ended with a network error!";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void receive(NetSocket sock, RawData incomingData)
|
|
||||||
{
|
|
||||||
// Only consider our own socket.
|
|
||||||
if(mSocket != sock)
|
|
||||||
return;
|
|
||||||
|
|
||||||
mDataReceived += incomingData.size;
|
|
||||||
}
|
|
||||||
} handler;
|
|
||||||
|
|
||||||
handler.mSocket = InvalidSocket;
|
handler.mSocket = InvalidSocket;
|
||||||
handler.mDataReceived = 0;
|
handler.mDataReceived = 0;
|
||||||
|
|
||||||
// Hook into the signals.
|
// Hook into the signals.
|
||||||
Net::smConnectionNotify. notify(&handler, &handle::notify);
|
Net::smConnectionNotify .notify(&handler, &TcpHandle::notify);
|
||||||
Net::smConnectionReceive.notify(&handler, &handle::receive);
|
Net::smConnectionReceive.notify(&handler, &TcpHandle::receive);
|
||||||
|
|
||||||
// Open a TCP connection to garagegames.com
|
// Open a TCP connection to garagegames.com
|
||||||
handler.mSocket = Net::openConnectTo("72.246.107.193:80");
|
handler.mSocket = Net::openConnectTo("72.246.107.193:80");
|
||||||
|
|
@ -83,79 +85,81 @@ TEST(Net, TCPRequest)
|
||||||
while(Process::processEvents() && (Platform::getRealMilliseconds() < limit) ) {}
|
while(Process::processEvents() && (Platform::getRealMilliseconds() < limit) ) {}
|
||||||
|
|
||||||
// Unhook from the signals.
|
// Unhook from the signals.
|
||||||
Net::smConnectionNotify. remove(&handler, &handle::notify);
|
Net::smConnectionNotify .remove(&handler, &TcpHandle::notify);
|
||||||
Net::smConnectionReceive.remove(&handler, &handle::receive);
|
Net::smConnectionReceive.remove(&handler, &TcpHandle::receive);
|
||||||
|
|
||||||
EXPECT_GT(handler.mDataReceived, 0)
|
EXPECT_GT(handler.mDataReceived, 0)
|
||||||
<< "Didn't get any data back!";
|
<< "Didn't get any data back!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct JournalHandle
|
||||||
|
{
|
||||||
|
NetSocket mSocket;
|
||||||
|
S32 mDataReceived;
|
||||||
|
|
||||||
|
void notify(NetSocket sock, U32 state)
|
||||||
|
{
|
||||||
|
// Only consider our own socket.
|
||||||
|
if(mSocket != sock)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Ok - what's the state? We do some dumb responses to given states
|
||||||
|
// in order to fulfill the request.
|
||||||
|
if(state == Net::Connected)
|
||||||
|
{
|
||||||
|
U8 reqBuffer[] = {
|
||||||
|
"GET / HTTP/1.0\nUser-Agent: Torque/1.0\n\n"
|
||||||
|
};
|
||||||
|
|
||||||
|
Net::Error e = Net::sendtoSocket(mSocket, reqBuffer, sizeof(reqBuffer));
|
||||||
|
|
||||||
|
ASSERT_EQ(Net::NoError, e)
|
||||||
|
<< "Got an error sending our HTTP request!";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Process::requestShutdown();
|
||||||
|
mSocket = NULL;
|
||||||
|
ASSERT_EQ(Net::Disconnected, state)
|
||||||
|
<< "Ended with a network error!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void receive(NetSocket sock, RawData incomingData)
|
||||||
|
{
|
||||||
|
// Only consider our own socket.
|
||||||
|
if(mSocket != sock)
|
||||||
|
return;
|
||||||
|
mDataReceived += incomingData.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void makeRequest()
|
||||||
|
{
|
||||||
|
mSocket = InvalidSocket;
|
||||||
|
mDataReceived = 0;
|
||||||
|
|
||||||
|
// Hook into the signals.
|
||||||
|
Net::smConnectionNotify .notify(this, &JournalHandle::notify);
|
||||||
|
Net::smConnectionReceive.notify(this, &JournalHandle::receive);
|
||||||
|
|
||||||
|
// Open a TCP connection to garagegames.com
|
||||||
|
mSocket = Net::openConnectTo("72.246.107.193:80");
|
||||||
|
|
||||||
|
// Let the callbacks enable things to process.
|
||||||
|
while(Process::processEvents()) {}
|
||||||
|
|
||||||
|
// Unhook from the signals.
|
||||||
|
Net::smConnectionNotify .remove(this, &JournalHandle::notify);
|
||||||
|
Net::smConnectionReceive.remove(this, &JournalHandle::receive);
|
||||||
|
|
||||||
|
EXPECT_GT(mDataReceived, 0)
|
||||||
|
<< "Didn't get any data back!";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
TEST(Net, JournalTCPRequest)
|
TEST(Net, JournalTCPRequest)
|
||||||
{
|
{
|
||||||
struct handle
|
JournalHandle handler;
|
||||||
{
|
|
||||||
NetSocket mSocket;
|
|
||||||
S32 mDataReceived;
|
|
||||||
|
|
||||||
void notify(NetSocket sock, U32 state)
|
|
||||||
{
|
|
||||||
// Only consider our own socket.
|
|
||||||
if(mSocket != sock)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Ok - what's the state? We do some dumb responses to given states
|
|
||||||
// in order to fulfill the request.
|
|
||||||
if(state == Net::Connected)
|
|
||||||
{
|
|
||||||
U8 reqBuffer[] = {
|
|
||||||
"GET / HTTP/1.0\nUser-Agent: Torque/1.0\n\n"
|
|
||||||
};
|
|
||||||
|
|
||||||
Net::Error e = Net::sendtoSocket(mSocket, reqBuffer, sizeof(reqBuffer));
|
|
||||||
|
|
||||||
ASSERT_EQ(Net::NoError, e)
|
|
||||||
<< "Got an error sending our HTTP request!";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Process::requestShutdown();
|
|
||||||
mSocket = NULL;
|
|
||||||
ASSERT_EQ(Net::Disconnected, state)
|
|
||||||
<< "Ended with a network error!";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void receive(NetSocket sock, RawData incomingData)
|
|
||||||
{
|
|
||||||
// Only consider our own socket.
|
|
||||||
if(mSocket != sock)
|
|
||||||
return;
|
|
||||||
mDataReceived += incomingData.size;
|
|
||||||
}
|
|
||||||
|
|
||||||
void makeRequest()
|
|
||||||
{
|
|
||||||
mSocket = InvalidSocket;
|
|
||||||
mDataReceived = 0;
|
|
||||||
|
|
||||||
// Hook into the signals.
|
|
||||||
Net::smConnectionNotify. notify(this, &handle::notify);
|
|
||||||
Net::smConnectionReceive.notify(this, &handle::receive);
|
|
||||||
|
|
||||||
// Open a TCP connection to garagegames.com
|
|
||||||
mSocket = Net::openConnectTo("72.246.107.193:80");
|
|
||||||
|
|
||||||
// Let the callbacks enable things to process.
|
|
||||||
while(Process::processEvents()) {}
|
|
||||||
|
|
||||||
// Unhook from the signals.
|
|
||||||
Net::smConnectionNotify. remove(this, &handle::notify);
|
|
||||||
Net::smConnectionReceive.remove(this, &handle::receive);
|
|
||||||
|
|
||||||
EXPECT_GT(mDataReceived, 0)
|
|
||||||
<< "Didn't get any data back!";
|
|
||||||
}
|
|
||||||
} handler;
|
|
||||||
|
|
||||||
Journal::Record("journalTCP.jrn");
|
Journal::Record("journalTCP.jrn");
|
||||||
ASSERT_TRUE(Journal::IsRecording());
|
ASSERT_TRUE(Journal::IsRecording());
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,8 @@ TEST(File, TouchAndTime)
|
||||||
<< "Somehow failed to delete our test file.";
|
<< "Somehow failed to delete our test file.";
|
||||||
};
|
};
|
||||||
|
|
||||||
// Mac has no implementations for these functions, so we 'def it out for now.
|
// Mac/Linux have no implementations for these functions, so we 'def it out for now.
|
||||||
#ifndef __MACOSX__
|
#ifdef WIN32
|
||||||
TEST(Platform, Volumes)
|
TEST(Platform, Volumes)
|
||||||
{
|
{
|
||||||
Vector<const char*> names;
|
Vector<const char*> names;
|
||||||
|
|
|
||||||
|
|
@ -44,24 +44,26 @@ TEST(Platform, Sleep)
|
||||||
<< "We didn't sleep at least as long as we requested!";
|
<< "We didn't sleep at least as long as we requested!";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct handle
|
||||||
|
{
|
||||||
|
S32 mElapsedTime;
|
||||||
|
S32 mNumberCalls;
|
||||||
|
|
||||||
|
handle() : mElapsedTime(0), mNumberCalls(0) {}
|
||||||
|
|
||||||
|
void timeEvent(S32 timeDelta)
|
||||||
|
{
|
||||||
|
mElapsedTime += timeDelta;
|
||||||
|
mNumberCalls++;
|
||||||
|
|
||||||
|
if(mElapsedTime >= 1000)
|
||||||
|
Process::requestShutdown();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
TEST(TimeManager, BasicAPI)
|
TEST(TimeManager, BasicAPI)
|
||||||
{
|
{
|
||||||
struct handle
|
handle handler;
|
||||||
{
|
|
||||||
S32 mElapsedTime;
|
|
||||||
S32 mNumberCalls;
|
|
||||||
|
|
||||||
void timeEvent(S32 timeDelta)
|
|
||||||
{
|
|
||||||
mElapsedTime += timeDelta;
|
|
||||||
mNumberCalls++;
|
|
||||||
|
|
||||||
if(mElapsedTime >= 1000)
|
|
||||||
Process::requestShutdown();
|
|
||||||
}
|
|
||||||
} handler;
|
|
||||||
|
|
||||||
handler.mElapsedTime = handler.mNumberCalls = 0;
|
|
||||||
|
|
||||||
// Initialize the time manager...
|
// Initialize the time manager...
|
||||||
TimeManager time;
|
TimeManager time;
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,10 @@ TEST(Profiler, ProfileStartEnd)
|
||||||
// Do work.
|
// Do work.
|
||||||
if(true)
|
if(true)
|
||||||
{
|
{
|
||||||
PROFILE_END(ProfileStartEndTest);
|
PROFILE_END();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PROFILE_END(ProfileStartEndTest);
|
PROFILE_END();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Profiler, ProfileScope)
|
TEST(Profiler, ProfileScope)
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,7 @@
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
# Navigation module
|
# Navigation module
|
||||||
option(TORQUE_NAVIGATION "Enable Navigation module" OFF)
|
option(TORQUE_NAVIGATION "Enable Navigation module" ON)
|
||||||
#mark_as_advanced(TORQUE_NAVIGATION)
|
|
||||||
|
|
||||||
if(TORQUE_NAVIGATION)
|
if(TORQUE_NAVIGATION)
|
||||||
addDef( "TORQUE_NAVIGATION_ENABLED" )
|
addDef( "TORQUE_NAVIGATION_ENABLED" )
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
# IN THE SOFTWARE.
|
# IN THE SOFTWARE.
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
option(TORQUE_TESTING "Enable unit test module" OFF)
|
option(TORQUE_TESTING "Enable unit test module" ON)
|
||||||
mark_as_advanced(TORQUE_TESTING)
|
mark_as_advanced(TORQUE_TESTING)
|
||||||
|
|
||||||
if(TORQUE_TESTING)
|
if(TORQUE_TESTING)
|
||||||
|
|
@ -35,4 +35,4 @@ if(TORQUE_TESTING)
|
||||||
# Add include paths
|
# Add include paths
|
||||||
addInclude( "${libDir}/gtest/fused-src/" )
|
addInclude( "${libDir}/gtest/fused-src/" )
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@ Here are some examples:
|
||||||
<module name="razerHydra" path="$RAZERHYDRA_SDK_PATH">Razer Hydra Controller</module>
|
<module name="razerHydra" path="$RAZERHYDRA_SDK_PATH">Razer Hydra Controller</module>
|
||||||
<module name="oculusVR" path="$OCULUSVR_SDK_PATH">Oculus VR Devices</module>
|
<module name="oculusVR" path="$OCULUSVR_SDK_PATH">Oculus VR Devices</module>
|
||||||
<module name="webDeploy">Web Deployment</module>
|
<module name="webDeploy">Web Deployment</module>
|
||||||
<module name="navigation">Recast Navigation</module>
|
<module name="navigation" default="1">Recast Navigation</module>
|
||||||
<module name="testing">Unit testing</module>
|
<module name="testing" default="1">Unit testing</module>
|
||||||
<moduleGroup description="Physics Library">
|
<moduleGroup description="Physics Library">
|
||||||
<module name="" donotwrite="1" default="1">Torque Physics</module>
|
<module name="" donotwrite="1" default="1">Torque Physics</module>
|
||||||
<module name="physX">PhysX 2.8 Physics Library</module>
|
<module name="physX">PhysX 2.8 Physics Library</module>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue