Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2943 for code/branches/netp2


Ignore:
Timestamp:
Apr 30, 2009, 2:54:44 PM (16 years ago)
Author:
scheusso
Message:

fixed a problem with copying function pointers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/netp2/src/network/NetworkFunction.h

    r2941 r2943  
    6767
    6868
    69 class NetworkFunctionBase: virtual public OrxonoxClass {
     69class _NetworkExport NetworkFunctionBase: virtual public OrxonoxClass {
    7070  public:
    7171    NetworkFunctionBase(std::string name);
     
    156156template<class T> inline void copyPtr( T ptr, NetworkFunctionPointer& destptr)
    157157{
    158   memset(&destptr, 0, sizeof(ptr));
     158  memset((uint8_t*)&destptr + sizeof(T), 0, sizeof(NetworkFunctionPointer)-sizeof(T));
    159159  T p2 = ptr;
    160160  memcpy( &destptr, &p2, sizeof(T) );
     
    167167  NetworkFunctionPointer destptr;
    168168  copyPtr( ptr, destptr );
     169  COUT(0) << "-==================== destptr: " << destptr.pointer[0] << ", " << destptr.pointer[1] << endl;
    169170  new NetworkFunctionStatic( createFunctor(ptr), name, destptr );
    170171  return 0;
     
    187188    NetworkFunctionPointer p1; \
    188189    copyPtr( functionPointer, p1 ); \
    189     FunctionCallManager::addCallStatic(NetworkMemberFunctionBase::getFunction(p1)->getNetworkID(), __VA_ARGS__); \
     190    FunctionCallManager::addCallStatic(NetworkFunctionStatic::getFunction(p1)->getNetworkID(), __VA_ARGS__); \
    190191  }
    191192#define callMemberNetworkFunction( functionPointer, objectID, ...) \
Note: See TracChangeset for help on using the changeset viewer.