Added sub-pixel position/vector types.
Updated Sync code to handle new sub-pixel types.
This commit is contained in:
@@ -70,6 +70,16 @@ namespace OpenRA
|
||||
il.EmitCall(OpCodes.Call, ((Func<PVecInt, int>)hash_PVecInt).Method, null);
|
||||
il.Emit(OpCodes.Xor);
|
||||
}
|
||||
else if (type == typeof(PSubPos))
|
||||
{
|
||||
il.EmitCall(OpCodes.Call, ((Func<PSubPos, int>)hash_PSubPos).Method, null);
|
||||
il.Emit(OpCodes.Xor);
|
||||
}
|
||||
else if (type == typeof(PSubVec))
|
||||
{
|
||||
il.EmitCall(OpCodes.Call, ((Func<PSubVec, int>)hash_PSubVec).Method, null);
|
||||
il.Emit(OpCodes.Xor);
|
||||
}
|
||||
else if (type == typeof(TypeDictionary))
|
||||
{
|
||||
il.EmitCall(OpCodes.Call, ((Func<TypeDictionary, int>)hash_tdict).Method, null);
|
||||
@@ -150,6 +160,16 @@ namespace OpenRA
|
||||
return ( ( i2.X * 5) ^ ( i2.Y * 3 ) ) / 4;
|
||||
}
|
||||
|
||||
public static int hash_PSubPos(PSubPos i2)
|
||||
{
|
||||
return ((i2.X * 5) ^ (i2.Y * 3)) / 4;
|
||||
}
|
||||
|
||||
public static int hash_PSubVec(PSubVec i2)
|
||||
{
|
||||
return ((i2.X * 5) ^ (i2.Y * 3)) / 4;
|
||||
}
|
||||
|
||||
public static int hash_tdict( TypeDictionary d )
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
Reference in New Issue
Block a user