public unsafe void StoreVector(int offset, EVal *value) { int offset1; if (this.IsV(offset, out offset1)) { fixed(void *pv = &this.v) { var a = ( EVal * )(( int * )pv + offset1); a->vector[0] = value->vector[0]; a->vector[1] = value->vector[1]; a->vector[2] = value->vector[2]; } } else { fixed(void *pf = this.fields) { var a = ( EVal * )(( int * )pf + offset1); a->vector[0] = value->vector[0]; a->vector[1] = value->vector[1]; a->vector[2] = value->vector[2]; } } }
public unsafe void LoadVector(int offset, EVal *result) { int offset1; if (this.IsV(offset, out offset1)) { fixed(void *pv = &this.v) { var a = ( EVal * )(( int * )pv + offset1); result->vector[0] = a->vector[0]; result->vector[1] = a->vector[1]; result->vector[2] = a->vector[2]; } } else { fixed(void *pf = this.fields) { var a = ( EVal * )(( int * )pf + offset1); result->vector[0] = a->vector[0]; result->vector[1] = a->vector[1]; result->vector[2] = a->vector[2]; } } }
public unsafe void StoreVector(string_t offset, EVal *value) { Int32 offset1; if (IsV(offset, out offset1)) { fixed(void *pv = &v) { var a = ( EVal * )(( Int32 * )pv + offset1); a->vector[0] = value->vector[0]; a->vector[1] = value->vector[1]; a->vector[2] = value->vector[2]; } } else { fixed(void *pf = fields) { var a = ( EVal * )(( Int32 * )pf + offset1); a->vector[0] = value->vector[0]; a->vector[1] = value->vector[1]; a->vector[2] = value->vector[2]; } } }
public unsafe void LoadVector(string_t offset, EVal *result) { Int32 offset1; if (IsV(offset, out offset1)) { fixed(void *pv = &v) { var a = ( EVal * )(( Int32 * )pv + offset1); result->vector[0] = a->vector[0]; result->vector[1] = a->vector[1]; result->vector[2] = a->vector[2]; } } else { fixed(void *pf = fields) { var a = ( EVal * )(( Int32 * )pf + offset1); result->vector[0] = a->vector[0]; result->vector[1] = a->vector[1]; result->vector[2] = a->vector[2]; } } }
/// <summary> /// PR_UglyValueString /// Returns a string describing *data in a type specific manner /// Easier to parse than PR_ValueString /// </summary> private unsafe String UglyValueString(EdictType type, EVal *val) { type &= (EdictType) ~ProgramDef.DEF_SAVEGLOBAL; String result; switch (type) { case EdictType.ev_string: result = GetString(val->_string); break; case EdictType.ev_entity: result = Host.Server.NumForEdict(Host.Server.ProgToEdict(val->edict)).ToString( ); break; case EdictType.ev_function: var f = _Functions[val->function]; result = GetString(f.s_name); break; case EdictType.ev_field: var def = FindField(val->_int); result = GetString(def.s_name); break; case EdictType.ev_void: result = "void"; break; case EdictType.ev_float: result = val->_float.ToString("F6", CultureInfo.InvariantCulture.NumberFormat); break; case EdictType.ev_vector: result = String.Format(CultureInfo.InvariantCulture.NumberFormat, "{0:F6} {1:F6} {2:F6}", val->vector[0], val->vector[1], val->vector[2]); break; default: result = "bad type " + type.ToString( ); break; } return(result); }
public unsafe void StoreInt(int offset, EVal *value) { int offset1; if (this.IsV(offset, out offset1)) { fixed(void *pv = &this.v) { var a = ( EVal * )(( int * )pv + offset1); a->_int = value->_int; } } else { fixed(void *pv = this.fields) { var a = ( EVal * )(( int * )pv + offset1); a->_int = value->_int; } } }
public unsafe void LoadInt(int offset, EVal *result) { int offset1; if (this.IsV(offset, out offset1)) { fixed(void *pv = &this.v) { var a = ( EVal * )(( int * )pv + offset1); result->_int = a->_int; } } else { fixed(void *pv = this.fields) { var a = ( EVal * )(( int * )pv + offset1); result->_int = a->_int; } } }
public unsafe void StoreInt(string_t offset, EVal *value) { Int32 offset1; if (IsV(offset, out offset1)) { fixed(void *pv = &v) { var a = ( EVal * )(( Int32 * )pv + offset1); a->_int = value->_int; } } else { fixed(void *pv = fields) { var a = ( EVal * )(( Int32 * )pv + offset1); a->_int = value->_int; } } }
public unsafe void LoadInt(string_t offset, EVal *result) { Int32 offset1; if (IsV(offset, out offset1)) { fixed(void *pv = &v) { var a = ( EVal * )(( Int32 * )pv + offset1); result->_int = a->_int; } } else { fixed(void *pv = fields) { var a = ( EVal * )(( Int32 * )pv + offset1); result->_int = a->_int; } } }