TX2D 3.1.5 Beta - ObjectType from 33 to 64 assigned to 1 to 32 again - RESOLVED
by Giuseppe De Francesco · in Torque X 2D · 06/09/2010 (1:22 am) · 4 replies
Build: 3.1.5 Beta
Platform: Any
Target: Engine Core (Core/TorqueObjectDatabase.cs)
Issues: The Torque Object Types are managed using 64 bits of an UInt64 variable but the line computing its bits value works on 32 bits only messing up the Types from 33 to 64 simply assigning them the same values of the Types 1 to 32.
Steps to Repeat:
1. Create a TX project
2. Create more than 32 object type
3. Assign a specific and different behaviours to the 1st and the 33rd object types
4. Run the game: the 33rd behaviour is ignored and played just as if it were the 1st one
Suggested Fix:
in Core/TorqueObjectDatabase.cs (line 731) change this
objType._bits = (ulong)(1 << _objectTypes.Count);
to this:
objType._bits = 1ul << _objectTypes.Count;
Platform: Any
Target: Engine Core (Core/TorqueObjectDatabase.cs)
Issues: The Torque Object Types are managed using 64 bits of an UInt64 variable but the line computing its bits value works on 32 bits only messing up the Types from 33 to 64 simply assigning them the same values of the Types 1 to 32.
Steps to Repeat:
1. Create a TX project
2. Create more than 32 object type
3. Assign a specific and different behaviours to the 1st and the 33rd object types
4. Run the game: the 33rd behaviour is ignored and played just as if it were the 1st one
Suggested Fix:
in Core/TorqueObjectDatabase.cs (line 731) change this
objType._bits = (ulong)(1 << _objectTypes.Count);
to this:
objType._bits = 1ul << _objectTypes.Count;
About the author
In the software eng. field since 1981, in charge of R&D during last 10 years. IEEE Senior Member (and volunteer).
Associate Giuseppe De Francesco
DFT Games Ltd