Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
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;
}
Exemplo n.º 3
0
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;
}
Exemplo n.º 4
0
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;
}
Exemplo n.º 5
0
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;
}
Exemplo n.º 6
0
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;
}