mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Removes bits of code and includes that are based on old 360, xbox and PS3 flags that are no longer needed.
This commit is contained in:
parent
513789c2c7
commit
26fd24fbab
43 changed files with 35 additions and 356 deletions
|
|
@ -382,7 +382,7 @@ CodeMapping gVirtualMap[] =
|
|||
{ "lpov2", SI_POV, SI_LPOV2 },
|
||||
{ "rpov2", SI_POV, SI_RPOV2 },
|
||||
|
||||
#if defined( TORQUE_OS_WIN ) || defined( TORQUE_OS_XENON )
|
||||
#if defined( TORQUE_OS_WIN )
|
||||
//-------------------------------------- XINPUT EVENTS
|
||||
// Controller connect / disconnect:
|
||||
{ "connect", SI_BUTTON, XI_CONNECT },
|
||||
|
|
|
|||
|
|
@ -30,24 +30,7 @@
|
|||
#include "platform/platform.h"
|
||||
#include "platform/platformCPUCount.h"
|
||||
|
||||
#if defined(TORQUE_OS_LINUX) || defined(TORQUE_OS_OSX) || defined(TORQUE_OS_XENON) || defined(TORQUE_OS_PS3)
|
||||
|
||||
// Consoles don't need this
|
||||
#if defined(TORQUE_OS_XENON) || defined(TORQUE_OS_PS3)
|
||||
namespace CPUInfo
|
||||
{
|
||||
|
||||
EConfig CPUCount(U32& TotAvailLogical, U32& TotAvailCore, U32& PhysicalNum)
|
||||
{
|
||||
TotAvailLogical = 6;
|
||||
TotAvailCore = 6;
|
||||
PhysicalNum = 3;
|
||||
|
||||
return CONFIG_MultiCoreAndHTEnabled;
|
||||
}
|
||||
|
||||
}; // namespace
|
||||
#else
|
||||
#if defined(TORQUE_OS_LINUX) || defined(TORQUE_OS_MAC)
|
||||
|
||||
#ifdef TORQUE_OS_LINUX
|
||||
// The Linux source code listing can be compiled using Linux kernel verison 2.6
|
||||
|
|
|
|||
|
|
@ -122,10 +122,6 @@ public:
|
|||
static void log( const char* format, ... );
|
||||
#endif
|
||||
|
||||
#ifdef TORQUE_OS_XENON
|
||||
static S32 getLockedController();
|
||||
#endif
|
||||
|
||||
/// Global input routing JournaledSignal; post input events here for
|
||||
/// processing.
|
||||
static InputEvent smInputEvent;
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
#ifdef TORQUE_OS_MAC
|
||||
#include <libkern/OSAtomic.h>
|
||||
#elif defined(TORQUE_OS_PS3)
|
||||
#include <cell/atomic.h>
|
||||
#endif
|
||||
|
||||
// Fetch-And-Add
|
||||
|
|
@ -39,9 +37,7 @@
|
|||
//
|
||||
inline void dFetchAndAdd( volatile U32& ref, U32 val )
|
||||
{
|
||||
#if defined(TORQUE_OS_PS3)
|
||||
cellAtomicAdd32( (std::uint32_t *)&ref, val );
|
||||
#elif !defined(TORQUE_OS_MAC)
|
||||
#if !defined(TORQUE_OS_MAC)
|
||||
__sync_fetch_and_add(&ref, val );
|
||||
#else
|
||||
OSAtomicAdd32( val, (int32_t* ) &ref);
|
||||
|
|
@ -50,9 +46,7 @@ inline void dFetchAndAdd( volatile U32& ref, U32 val )
|
|||
|
||||
inline void dFetchAndAdd( volatile S32& ref, S32 val )
|
||||
{
|
||||
#if defined(TORQUE_OS_PS3)
|
||||
cellAtomicAdd32( (std::uint32_t *)&ref, val );
|
||||
#elif !defined(TORQUE_OS_MAC)
|
||||
#if !defined(TORQUE_OS_MAC)
|
||||
__sync_fetch_and_add( &ref, val );
|
||||
#else
|
||||
OSAtomicAdd32( val, (int32_t* ) &ref);
|
||||
|
|
@ -65,9 +59,7 @@ inline bool dCompareAndSwap( volatile U32& ref, U32 oldVal, U32 newVal )
|
|||
{
|
||||
// bool
|
||||
//OSAtomicCompareAndSwap32(int32_t oldValue, int32_t newValue, volatile int32_t *theValue);
|
||||
#if defined(TORQUE_OS_PS3)
|
||||
return ( cellAtomicCompareAndSwap32( (std::uint32_t *)&ref, newVal, oldVal ) == oldVal );
|
||||
#elif !defined(TORQUE_OS_MAC)
|
||||
#if !defined(TORQUE_OS_MAC)
|
||||
return ( __sync_val_compare_and_swap( &ref, oldVal, newVal ) == oldVal );
|
||||
#else
|
||||
return OSAtomicCompareAndSwap32(oldVal, newVal, (int32_t *) &ref);
|
||||
|
|
@ -76,22 +68,17 @@ inline bool dCompareAndSwap( volatile U32& ref, U32 oldVal, U32 newVal )
|
|||
|
||||
inline bool dCompareAndSwap( volatile U64& ref, U64 oldVal, U64 newVal )
|
||||
{
|
||||
#if defined(TORQUE_OS_PS3)
|
||||
return ( cellAtomicCompareAndSwap32( (std::uint32_t *)&ref, newVal, oldVal ) == oldVal );
|
||||
#elif !defined(TORQUE_OS_MAC)
|
||||
#if !defined(TORQUE_OS_MAC)
|
||||
return ( __sync_val_compare_and_swap( &ref, oldVal, newVal ) == oldVal );
|
||||
#else
|
||||
return OSAtomicCompareAndSwap64(oldVal, newVal, (int64_t *) &ref);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/// Performs an atomic read operation.
|
||||
inline U32 dAtomicRead( volatile U32 &ref )
|
||||
{
|
||||
#if defined(TORQUE_OS_PS3)
|
||||
return cellAtomicAdd32( (std::uint32_t *)&ref, 0 );
|
||||
#elif !defined(TORQUE_OS_MAC)
|
||||
#if !defined(TORQUE_OS_MAC)
|
||||
return __sync_fetch_and_add( ( volatile long* ) &ref, 0 );
|
||||
#else
|
||||
return OSAtomicAdd32( 0, (int32_t* ) &ref);
|
||||
|
|
|
|||
|
|
@ -26,13 +26,7 @@
|
|||
/// @file
|
||||
/// Compiler intrinsics for Visual C++.
|
||||
|
||||
#if defined(TORQUE_OS_XENON)
|
||||
# include <Xtl.h>
|
||||
# define _InterlockedExchangeAdd InterlockedExchangeAdd
|
||||
# define _InterlockedExchangeAdd64 InterlockedExchangeAdd64
|
||||
#else
|
||||
# include <intrin.h>
|
||||
#endif
|
||||
#include <intrin.h>
|
||||
|
||||
// Fetch-And-Add
|
||||
//
|
||||
|
|
@ -48,16 +42,7 @@ inline void dFetchAndAdd( volatile S32& ref, S32 val )
|
|||
_InterlockedExchangeAdd( ( volatile long* ) &ref, val );
|
||||
}
|
||||
|
||||
#if defined(TORQUE_OS_XENON)
|
||||
// Not available on x86
|
||||
inline void dFetchAndAdd( volatile U64& ref, U64 val )
|
||||
{
|
||||
_InterlockedExchangeAdd64( ( volatile __int64* ) &ref, val );
|
||||
}
|
||||
#endif
|
||||
|
||||
// Compare-And-Swap
|
||||
|
||||
inline bool dCompareAndSwap( volatile U32& ref, U32 oldVal, U32 newVal )
|
||||
{
|
||||
return ( _InterlockedCompareExchange( ( volatile long* ) &ref, newVal, oldVal ) == oldVal );
|
||||
|
|
|
|||
|
|
@ -93,26 +93,6 @@ typedef int SOCKET;
|
|||
|
||||
#define closesocket close
|
||||
|
||||
#elif defined( TORQUE_OS_XENON )
|
||||
|
||||
#include <Xtl.h>
|
||||
#include <string>
|
||||
|
||||
#define TORQUE_USE_WINSOCK
|
||||
#define EINPROGRESS WSAEINPROGRESS
|
||||
#define ioctl ioctlsocket
|
||||
typedef S32 socklen_t;
|
||||
|
||||
DWORD _getLastErrorAndClear()
|
||||
{
|
||||
DWORD err = WSAGetLastError();
|
||||
WSASetLastError( 0 );
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(TORQUE_USE_WINSOCK)
|
||||
|
|
@ -596,20 +576,6 @@ bool Net::init()
|
|||
#if defined(TORQUE_USE_WINSOCK)
|
||||
if(!PlatformNetState::initCount)
|
||||
{
|
||||
#ifdef TORQUE_OS_XENON
|
||||
// Configure startup parameters
|
||||
XNetStartupParams xnsp;
|
||||
memset( &xnsp, 0, sizeof( xnsp ) );
|
||||
xnsp.cfgSizeOfStruct = sizeof( XNetStartupParams );
|
||||
|
||||
#ifndef TORQUE_DISABLE_PC_CONNECTIVITY
|
||||
xnsp.cfgFlags = XNET_STARTUP_BYPASS_SECURITY;
|
||||
Con::warnf("XNET_STARTUP_BYPASS_SECURITY enabled! This build can talk to PCs!");
|
||||
#endif
|
||||
|
||||
AssertISV( !XNetStartup( &xnsp ), "Net::init - failed to init XNet" );
|
||||
#endif
|
||||
|
||||
WSADATA stWSAData;
|
||||
AssertISV( !WSAStartup( 0x0101, &stWSAData ), "Net::init - failed to init WinSock!" );
|
||||
|
||||
|
|
@ -654,10 +620,6 @@ void Net::shutdown()
|
|||
if(!PlatformNetState::initCount)
|
||||
{
|
||||
WSACleanup();
|
||||
|
||||
#ifdef TORQUE_OS_XENON
|
||||
XNetCleanup();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1196,14 +1158,8 @@ void Net::process()
|
|||
break;
|
||||
case PolledSocket::ConnectionPending:
|
||||
// see if it is now connected
|
||||
#ifdef TORQUE_OS_XENON
|
||||
// WSASetLastError has no return value, however part of the SO_ERROR behavior
|
||||
// is to clear the last error, so this needs to be done here.
|
||||
if( ( optval = _getLastErrorAndClear() ) == -1 )
|
||||
#else
|
||||
if (getsockopt(currentSock->fd, SOL_SOCKET, SO_ERROR,
|
||||
(char*)&optval, &optlen) == -1)
|
||||
#endif
|
||||
{
|
||||
Con::errorf("Error getting socket options: %s", strerror(errno));
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@
|
|||
|
||||
#if defined(TORQUE_OS_WIN)
|
||||
# include <winsock.h>
|
||||
#elif defined(TORQUE_OS_XENON)
|
||||
# include <Xtl.h>
|
||||
#else
|
||||
# include <netdb.h>
|
||||
# include <unistd.h>
|
||||
|
|
@ -80,8 +78,6 @@ struct NetAsync::NameLookupWorkItem : public ThreadPool::WorkItem
|
|||
protected:
|
||||
virtual void execute()
|
||||
{
|
||||
#ifndef TORQUE_OS_XENON
|
||||
|
||||
NetAddress address;
|
||||
Net::Error error = Net::stringToAddress(mRequest.remoteAddr, &address, true);
|
||||
|
||||
|
|
@ -102,28 +98,6 @@ protected:
|
|||
mRequest.out_h_length = sizeof(address);
|
||||
mRequest.complete = true;
|
||||
}
|
||||
#else
|
||||
XNDNS *pxndns = NULL;
|
||||
HANDLE hEvent = CreateEvent(NULL, false, false, NULL);
|
||||
XNetDnsLookup(mRequest.remoteAddr, hEvent, &pxndns);
|
||||
|
||||
while(pxndns->iStatus == WSAEINPROGRESS)
|
||||
WaitForSingleObject(hEvent, INFINITE);
|
||||
|
||||
if(pxndns->iStatus == 0 && pxndns->cina > 0)
|
||||
{
|
||||
dMemset(mRequest.out_h_addr, 0, sizeof(mRequest.out_h_addr));
|
||||
|
||||
// This is a suspect section. I need to revisit. [2/22/2010 Pat]
|
||||
dMemcpy(mRequest.out_h_addr, pxndns->aina, sizeof(IN_ADDR));
|
||||
mRequest.out_h_length = sizeof(IN_ADDR);
|
||||
}
|
||||
|
||||
mRequest.complete = true;
|
||||
|
||||
XNetDnsRelease(pxndns);
|
||||
CloseHandle(hEvent);
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "platform/platform.h"
|
||||
|
||||
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
|
||||
#if defined(TORQUE_OS_WIN)
|
||||
#include <sys/utime.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
|
|
@ -84,7 +84,7 @@ bool MountZips(const String &root)
|
|||
|
||||
bool Touch( const Path &path )
|
||||
{
|
||||
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
|
||||
#if defined(TORQUE_OS_WIN)
|
||||
return( utime( path.getFullPath(), 0 ) != -1 );
|
||||
#else
|
||||
return( utimes( path.getFullPath(), NULL) == 0 ); // utimes returns 0 on success.
|
||||
|
|
|
|||
|
|
@ -240,17 +240,6 @@ void ThreadPool::WorkerThread::run( void* arg )
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(TORQUE_OS_XENON)
|
||||
// On Xbox 360 you must explicitly assign software threads to hardware threads.
|
||||
|
||||
// This will distribute job threads across the secondary CPUs leaving both
|
||||
// primary CPU cores available to the "main" thread. This will help prevent
|
||||
// more L2 thrashing of the main thread/core.
|
||||
static U32 sCoreAssignment = 2;
|
||||
XSetThreadProcessor( GetCurrentThread(), sCoreAssignment );
|
||||
sCoreAssignment = sCoreAssignment < 6 ? sCoreAssignment + 1 : 2;
|
||||
#endif
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
if( checkForStop() )
|
||||
|
|
|
|||
|
|
@ -73,11 +73,6 @@ typedef unsigned long U64;
|
|||
# define TORQUE_SUPPORTS_GCC_INLINE_X86_ASM
|
||||
# include "platform/types.win.h"
|
||||
|
||||
#elif defined(SN_TARGET_PS3)
|
||||
# define TORQUE_OS_STRING "PS3"
|
||||
# define TORQUE_OS_PS3
|
||||
# include "platform/types.posix.h"
|
||||
|
||||
#elif defined(linux) || defined(LINUX)
|
||||
# define TORQUE_OS_STRING "Linux"
|
||||
# define TORQUE_OS_LINUX
|
||||
|
|
|
|||
|
|
@ -59,17 +59,7 @@ typedef unsigned _int64 U64;
|
|||
|
||||
//--------------------------------------
|
||||
// Identify the Operating System
|
||||
#if _XBOX_VER >= 200
|
||||
# define TORQUE_OS_STRING "Xenon"
|
||||
# ifndef TORQUE_OS_XENON
|
||||
# define TORQUE_OS_XENON
|
||||
# endif
|
||||
# include "platform/types.xenon.h"
|
||||
#elif defined( _XBOX_VER )
|
||||
# define TORQUE_OS_STRING "Xbox"
|
||||
# define TORQUE_OS_XBOX
|
||||
# include "platform/types.win.h"
|
||||
#elif defined( _WIN32 ) && !defined ( _WIN64 )
|
||||
#if defined( _WIN32 ) && !defined ( _WIN64 )
|
||||
# define TORQUE_OS_STRING "Win32"
|
||||
# define TORQUE_OS_WIN
|
||||
# define TORQUE_OS_WIN32
|
||||
|
|
@ -98,10 +88,6 @@ typedef unsigned _int64 U64;
|
|||
# define TORQUE_SUPPORTS_NASM
|
||||
# define TORQUE_SUPPORTS_VC_INLINE_X86_ASM
|
||||
#endif
|
||||
#elif defined( TORQUE_OS_XENON )
|
||||
# define TORQUE_CPU_STRING "ppc"
|
||||
# define TORQUE_CPU_PPC
|
||||
# define TORQUE_BIG_ENDIAN
|
||||
#else
|
||||
# error "VC: Unsupported Target CPU"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue