Update of /cvsroot/opentnl/tnl/tnl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14491/tnl
Modified Files:
eventConnection.cpp netConnection.cpp tnlJournal.h
tnlMethodDispatch.cpp tnlMethodDispatch.h tnlNetConnection.h
tnlNetObject.h tnlNetStringTable.h tnlPlatform.h tnlRPC.h
tnlTypes.h
Log Message:
Integrated Norbert's patch for Win32 CodeWarrior support
Changed instructions screen to display help for current controls configuration
Index: tnlJournal.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/tnlJournal.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** tnlJournal.h 28 Jun 2004 20:47:54 -0000 1.8
--- tnlJournal.h 28 Sep 2004 18:45:25 -0000 1.9
***************
*** 108,111 ****
--- 108,112 ----
m.v1 = *((U32 *) &fptr); \
if(sizeof(fptr) > sizeof(U32)) m.v2 = *(((U32 *) &fptr) + 1); \
+ if(sizeof(fptr) > 2*sizeof(U32)) m.v3 = *(((U32 *) &fptr) + 2); \
}; \
Journal_##className##_##func##_er(const char *name, MethodArgList *methodArgList) : JournalEntryRecord(name, methodArgList) {} \
Index: tnlNetConnection.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetConnection.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** tnlNetConnection.h 20 Aug 2004 18:26:58 -0000 1.7
--- tnlNetConnection.h 28 Sep 2004 18:45:25 -0000 1.8
***************
*** 164,175 ****
MessageSignatureBytes = 5, ///< Special data bytes written into the end of the packet to guarantee data consistency
};
- /// Constants controlling the behavior of pings and timeouts
- enum PingConstants {
- AdaptiveInitialPingTimeout = 60000,
- AdaptivePingRetryCount = 4,
- PingTimeout = 5000, ///< Milliseconds to wait before sending a ping packet.
- PingRetryCount = 10, ///< Number of unacknowledged pings to send before timing out.
- };
-
U32 mLastPacketRecvTime; ///< Time of the receipt of the last data packet.
U32 mLastSeqRecvdAtSend[MaxPacketWindowSize]; ///< The sequence number of the last packet received from the remote host when we sent the packet with sequence X & PacketWindowMask.
--- 164,167 ----
***************
*** 193,196 ****
--- 185,197 ----
InvalidPacketType,
};
+ /// Constants controlling the behavior of pings and timeouts
+ enum DefaultPingConstants {
+ AdaptiveInitialPingTimeout = 60000,
+ AdaptivePingRetryCount = 4,
+ DefaultPingTimeout = 5000, ///< Default milliseconds to wait before sending a ping packet.
+ DefaultPingRetryCount = 10, ///< Default number of unacknowledged pings to send before timing out.
+ };
+ U32 mPingTimeout; ///< Milliseconds to wait before sending a ping packet.
+ U32 mPingRetryCount; ///< Number of unacknowledged pings to send before timing out.
public:
struct PacketNotify;
***************
*** 436,439 ****
--- 437,444 ----
virtual NetClassGroup getNetClassGroup() const { return NetClassGroupInvalid; }
+ /// Sets the ping/timeout characteristics for a fixed-rate connection. Total timeout is msPerPing * pingRetryCount.
+ void setPingTimeouts(U32 msPerPing, U32 pingRetryCount)
+ { mPingRetryCount = pingRetryCount; mPingTimeout = msPerPing; }
+
/// Simulates a network situation with a percentage random packet loss and a connection one way latency as specified.
void setSimulatedNetParams(F32 packetLoss, U32 latency)
Index: tnlNetStringTable.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetStringTable.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** tnlNetStringTable.h 2 Aug 2004 20:36:01 -0000 1.2
--- tnlNetStringTable.h 28 Sep 2004 18:45:25 -0000 1.3
***************
*** 28,31 ****
--- 28,35 ----
#define _TNL_NETSTRINGTABLE_H_
+ #ifndef _TNL_TYPES_H_
+ #include "tnlTypes.h"
+ #endif
+
namespace TNL {
Index: tnlRPC.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/tnlRPC.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** tnlRPC.h 19 Aug 2004 21:20:15 -0000 1.9
--- tnlRPC.h 28 Sep 2004 18:45:25 -0000 1.10
***************
*** 198,202 ****
TNL_DECLARE_CLASS( RPC_##className##_##name ); \
bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } \
! void getFuncPtr(TNL::MethodPointer &m) { m.v1=*((TNL::U32 *) &mFuncPtr); m.v2 = *(((TNL::U32 *) &mFuncPtr) + 1); } }; \
TNL_IMPLEMENT_NETEVENT( RPC_##className##_##name, groupMask, rpcVersion ); \
TNL::MethodArgList RPC##className##name (#className, #args); \
--- 198,204 ----
TNL_DECLARE_CLASS( RPC_##className##_##name ); \
bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } \
! void getFuncPtr(TNL::MethodPointer &m) { m.v1=*((TNL::U32 *) &mFuncPtr); \
! if(sizeof(mFuncPtr) > sizeof(TNL::U32)) m.v2 = *(((TNL::U32 *) &mFuncPtr) + 1); \
! if(sizeof(mFuncPtr) > 2*sizeof(TNL::U32)) m.v3 = *(((TNL::U32 *) &mFuncPtr) + 2); } }; \
TNL_IMPLEMENT_NETEVENT( RPC_##className##_##name, groupMask, rpcVersion ); \
TNL::MethodArgList RPC##className##name (#className, #args); \
Index: eventConnection.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/eventConnection.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** eventConnection.cpp 3 Jul 2004 20:01:46 -0000 1.4
--- eventConnection.cpp 28 Sep 2004 18:45:24 -0000 1.5
***************
*** 460,464 ****
{
S32 classId = theEvent->getClassId(getNetClassGroup());
! if(classId >= mEventClassCount)
return false;
--- 460,464 ----
{
S32 classId = theEvent->getClassId(getNetClassGroup());
! if(U32(classId) >= mEventClassCount)
return false;
Index: tnlMethodDispatch.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/tnlMethodDispatch.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** tnlMethodDispatch.cpp 21 Aug 2004 03:40:28 -0000 1.15
--- tnlMethodDispatch.cpp 28 Sep 2004 18:45:25 -0000 1.16
***************
*** 615,618 ****
--- 615,619 ----
func = method->v1;
funcOffset = method->v2;
+ void *mptr = &method->v1;
void *args = unmarshalledData.getBuffer();
***************
*** 650,653 ****
--- 651,704 ----
pop esi
}
+
+ #elif defined(TNL_SUPPORTS_MWERKS_INLINE_X86_ASM)
+ _asm
+ {
+ push esi
+ push edi
+ push ecx
+ push edx
+ push ebx
+ mov saveESP, esp
+
+ mov ecx, sz // get size of buffer
+ mov esi, args // get buffer
+ sub esp, ecx // allocate stack space
+ mov edi, esp // start of destination stack frame
+ shr ecx, 2 // make it dwords
+ rep movsd // copy it
+ mov ecx, thisPtr // set "this"
+ push ecx
+ mov eax, mptr
+ push eax
+ call jmp_method
+ mov esp, saveESP
+
+ pop ebx
+ pop edx
+ pop ecx
+ pop edi
+ pop esi
+ jmp jmp_continue
+
+ jmp_method:
+ pop eax
+ pop edx
+ mov ecx,dword ptr [esp]
+ push eax
+ add ecx,dword ptr [edx]
+ mov dword ptr [esp+0x4],ecx
+ cmp dword ptr [edx+0x4],0xffffffff
+ je jmp_now
+ mov eax,dword ptr [edx+0x8]
+ mov eax,dword ptr [ecx+eax]
+ add eax,dword ptr [edx+0x4]
+ jmp dword ptr [eax]
+ lea eax,dword ptr [eax+0x0]
+ jmp_now:
+ jmp dword ptr [edx+0x8]
+
+ jmp_continue:
+ }
#elif defined(TNL_SUPPORTS_GCC_INLINE_X86_ASM)
Index: tnlNetObject.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetObject.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** tnlNetObject.h 19 Aug 2004 21:20:15 -0000 1.8
--- tnlNetObject.h 28 Sep 2004 18:45:25 -0000 1.9
***************
*** 415,419 ****
TNL_DECLARE_CLASS( RPCEV_##className##_##name ); \
bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } \
! void getFuncPtr(TNL::MethodPointer &p) { p.v1=*((TNL::U32 *) &mFuncPtr); p.v2 = *(((TNL::U32 *) &mFuncPtr) + 1); } }; \
TNL_IMPLEMENT_NETEVENT( RPCEV_##className##_##name, groupMask, rpcVersion ); \
TNL::MethodArgList RPC##className##name (#className, #args); \
--- 415,421 ----
TNL_DECLARE_CLASS( RPCEV_##className##_##name ); \
bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } \
! void getFuncPtr(TNL::MethodPointer &p) { p.v1=*((TNL::U32 *) &mFuncPtr); \
! if(sizeof(mFuncPtr) > sizeof(TNL::U32)) p.v2 = *(((TNL::U32 *) &mFuncPtr) + 1); \
! if(sizeof(mFuncPtr) > 2*sizeof(TNL::U32)) p.v3 = *(((TNL::U32 *) &mFuncPtr) + 2); } }; \
TNL_IMPLEMENT_NETEVENT( RPCEV_##className##_##name, groupMask, rpcVersion ); \
TNL::MethodArgList RPC##className##name (#className, #args); \
Index: tnlTypes.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/tnlTypes.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** tnlTypes.h 23 Jul 2004 23:08:45 -0000 1.9
--- tnlTypes.h 28 Sep 2004 18:45:25 -0000 1.10
***************
*** 210,213 ****
--- 210,220 ----
#pragma warning(disable: 4800)
+ #elif defined(__MWERKS__) && defined(_WIN32)
+
+ typedef signed long long S64; ///< Compiler independent signed 64-bit integer
+ typedef unsigned long long U64; ///< Compiler independent unsigned 64-bit integer
+
+ #define TNL_COMPILER_STRING "Metrowerks CW Win32"
+
#elif defined(__GNUC__)
***************
*** 293,296 ****
--- 300,305 ----
# endif
# define TNL_SUPPORTS_GCC_INLINE_X86_ASM
+ # elif defined (__MWERKS__)
+ # define TNL_SUPPORTS_MWERKS_INLINE_X86_ASM
# else
# define TNL_SUPPORTS_VC_INLINE_X86_ASM
Index: tnlPlatform.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/tnlPlatform.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** tnlPlatform.h 20 Apr 2004 04:27:19 -0000 1.1
--- tnlPlatform.h 28 Sep 2004 18:45:25 -0000 1.2
***************
*** 85,89 ****
#define TIME_BLOCK(name,block) { S64 st = Platform::getHighPrecisionTimerValue(); {block} S64 delta = Platform::getHighPrecisionTimerValue() - st; F64 ms = Platform::getHighPrecisionMilliseconds(delta); logprintf("Timer: %s Elapsed: %g ms", #name, ms); }
! #if defined (TNL_SUPPORTS_VC_INLINE_X86_ASM)
#define TNL_DEBUGBREAK() { __asm { int 3 }; }
#elif defined(TNL_SUPPORTS_GCC_INLINE_X86_ASM)
--- 85,89 ----
#define TIME_BLOCK(name,block) { S64 st = Platform::getHighPrecisionTimerValue(); {block} S64 delta = Platform::getHighPrecisionTimerValue() - st; F64 ms = Platform::getHighPrecisionMilliseconds(delta); logprintf("Timer: %s Elapsed: %g ms", #name, ms); }
! #if defined (TNL_SUPPORTS_VC_INLINE_X86_ASM) || defined (TNL_SUPPORTS_MWERKS_INLINE_X86_ASM)
#define TNL_DEBUGBREAK() { __asm { int 3 }; }
#elif defined(TNL_SUPPORTS_GCC_INLINE_X86_ASM)
Index: netConnection.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/netConnection.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** netConnection.cpp 19 Aug 2004 20:24:51 -0000 1.10
--- netConnection.cpp 28 Sep 2004 18:45:25 -0000 1.11
***************
*** 106,109 ****
--- 106,112 ----
ssthresh = 30;
mLastSeqRecvdAck = 0;
+
+ mPingTimeout = DefaultPingTimeout;
+ mPingRetryCount = DefaultPingRetryCount;
}
***************
*** 151,156 ****
mLastPingSendTime = time;
! U32 timeout = PingTimeout;
! U32 timeoutCount = PingRetryCount;
if(isAdaptive())
--- 154,159 ----
mLastPingSendTime = time;
! U32 timeout = mPingTimeout;
! U32 timeoutCount = mPingRetryCount;
if(isAdaptive())
Index: tnlMethodDispatch.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/tnl/tnlMethodDispatch.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** tnlMethodDispatch.h 21 Aug 2004 03:40:28 -0000 1.6
--- tnlMethodDispatch.h 28 Sep 2004 18:45:25 -0000 1.7
***************
*** 114,117 ****
--- 114,118 ----
U32 v1;
U32 v2;
+ U32 v3;
};
***************
*** 145,153 ****
};
! #if defined(TNL_SUPPORTS_VC_INLINE_X86_ASM)
};
! // VC 6.0 has problems with the usage of a namespace reference inside an inline assembly block
! // so we close the namespace and add this as a global global.
extern void *TNL_gBasePtr;
--- 146,154 ----
};
! #if defined(TNL_SUPPORTS_VC_INLINE_X86_ASM) || defined(TNL_SUPPORTS_MWERKS_INLINE_X86_ASM)
};
! // VC 6.0 and Codewarrior have problems with the usage of a namespace reference inside an
! // inline assembly block, so we close the namespace and add this as a global global.
extern void *TNL_gBasePtr;
|