higher resolution for entity attributes

Interpret the values for entity yaw angles and clip entity sizes as
fifths or tenths of cubes or degree.

This makes some entity attributes appear as float values to the user.
The map file still only keeps integer values - but now they are
interpreted differently - for example, a health pack elevation value of 6
now means 0.6 cubes instead of 6.

Note: the scaling factors are hardcoded - use ENTSCALE5 or ENTSCALE10
whereever possible. For generic entity editing, the scaling values are
also stored in entscale[] - but that table can not be changed without
breaking the map format! This scaling is similar to the treatment of the
vdelta values of map cubes.
This commit is contained in:
ac-stef
2015-05-27 15:47:04 +02:00
parent ea480a7b0c
commit f774e4d841
9 changed files with 115 additions and 46 deletions
+2 -2
View File
@@ -297,8 +297,8 @@ entity *newentity(int index, int x, int y, int z, char *what, int v1, int v2, in
case PLAYERSTART:
case CTF_FLAG:
e.attr2 = v1;
e.attr1 = (int)camera1->yaw;
if(type != PLAYERSTART) e.attr1 = (e.attr1 + 7 - (e.attr1 + 7) % 15) * 4;
e.attr1 = int(camera1->yaw * ENTSCALE10);
if(type != PLAYERSTART) e.attr1 = e.attr1 + 70 - (e.attr1 + 70) % 150;
break;
}
syncentchanges(true);