RecvProp RecvPropQuaternion( char *pVarName, int offset, int sizeofVar, // Handled by RECVINFO macro, but set to SIZEOF_IGNORE if you don't want to bother. int flags, RecvVarProxyFn varProxy ) { RecvProp ret; #ifdef _DEBUG if ( varProxy == RecvProxy_QuaternionToQuaternion ) { Assert( sizeofVar == sizeof( Quaternion ) ); } #endif ret.m_pVarName = pVarName; ret.SetOffset( offset ); ret.m_RecvType = DPT_Quaternion; ret.m_Flags = flags; ret.SetProxyFn( varProxy ); return ret; }
RecvProp RecvPropVector( char *pVarName, int offset, int sizeofVar, int flags, RecvVarProxyFn varProxy ) { RecvProp ret; #ifdef _DEBUG if ( varProxy == RecvProxy_VectorToVector ) { Assert( sizeofVar == sizeof( Vector ) ); } #endif ret.m_pVarName = pVarName; ret.SetOffset( offset ); ret.m_RecvType = DPT_Vector; ret.m_Flags = flags; ret.SetProxyFn( varProxy ); return ret; }
RecvProp RecvPropFloat( char *pVarName, int offset, int sizeofVar, int flags, RecvVarProxyFn varProxy ) { RecvProp ret; #ifdef _DEBUG if ( varProxy == RecvProxy_FloatToFloat ) { Assert( sizeofVar == 0 || sizeofVar == 4 ); } #endif ret.m_pVarName = pVarName; ret.SetOffset( offset ); ret.m_RecvType = DPT_Float; ret.m_Flags = flags; ret.SetProxyFn( varProxy ); return ret; }
RecvProp RecvPropString( char *pVarName, int offset, int bufferSize, int flags, RecvVarProxyFn varProxy ) { RecvProp ret; ret.m_pVarName = pVarName; ret.SetOffset( offset ); ret.m_RecvType = DPT_String; ret.m_Flags = flags; ret.m_StringBufferSize = bufferSize; ret.SetProxyFn( varProxy ); return ret; }
RecvProp RecvPropInt( char *pVarName, int offset, int sizeofVar, int flags, RecvVarProxyFn varProxy ) { RecvProp ret; // If they didn't specify a proxy, then figure out what type we're writing to. if (varProxy == NULL) { if (sizeofVar == 1) { varProxy = RecvProxy_Int32ToInt8; } else if (sizeofVar == 2) { varProxy = RecvProxy_Int32ToInt16; } else if (sizeofVar == 4) { varProxy = RecvProxy_Int32ToInt32; } else { Assert(!"RecvPropInt var has invalid size"); varProxy = RecvProxy_Int32ToInt8; // safest one... } } ret.m_pVarName = pVarName; ret.SetOffset( offset ); ret.m_RecvType = DPT_Int; ret.m_Flags = flags; ret.SetProxyFn( varProxy ); return ret; }
RecvProp RecvPropFloat( char *pVarName, int offset, int sizeofVar, int flags, RecvVarProxyFn varProxy ) { RecvProp ret; // Debug type checks. if ( varProxy == RecvProxy_FloatToFloat ) { Assert( sizeofVar == 0 || sizeofVar == 4 ); } ret.m_pVarName = pVarName; ret.SetOffset( offset ); ret.m_RecvType = DPT_Float; ret.m_Flags = flags; ret.SetProxyFn( varProxy ); return ret; }