@@ -68,18 +68,18 @@ struct TriIndex {
6868
6969struct MapVertHasher {
7070 size_t operator ()( const srfVert_t& vert ) const {
71- size_t hash = ~( *( ( size_t * ) & vert.xyz [0 ] ) << 15 );
72- hash ^= ( *( ( size_t * ) & vert.xyz [0 ] ) >> 10 );
73- hash += ( *( ( size_t * ) & vert.xyz [1 ] ) << 3 );
74- hash ^= ( *( ( size_t * ) & vert.xyz [1 ] ) >> 6 );
75- hash += ~( *( ( size_t * ) & vert.xyz [2 ] ) << 11 );
76- hash ^= ( *( ( size_t * ) & vert.xyz [2 ] ) >> 16 );
77-
78- hash ^ = ( *( ( size_t * ) & vert.st [0 ] ) << 7 );
79- hash + = ( *( ( size_t * ) & vert.st [0 ] ) >> 12 );
80-
81- hash ^ = ( *( ( size_t * ) & vert.st [1 ] ) << 13 );
82- hash + = ( *( ( size_t * ) & vert.st [1 ] ) >> 8 );
71+ uint32_t hash = ~( Util::bit_cast< uint32_t , float >( vert.xyz [0 ] ) << 15 );
72+ hash ^= ( Util::bit_cast< uint32_t , float >( vert.xyz [0 ] ) >> 10 );
73+ hash += ( Util::bit_cast< uint32_t , float >( vert.xyz [1 ] ) << 3 );
74+ hash ^= ( Util::bit_cast< uint32_t , float >( vert.xyz [1 ] ) >> 6 );
75+ hash += ( Util::bit_cast< uint32_t , float >( vert.xyz [2 ] ) << 11 );
76+ hash ^= ( Util::bit_cast< uint32_t , float >( vert.xyz [2 ] ) >> 16 );
77+
78+ hash + = ( Util::bit_cast< uint32_t , float >( vert.st [0 ] ) << 7 );
79+ hash ^ = ( Util::bit_cast< uint32_t , float >( vert.st [0 ] ) >> 12 );
80+
81+ hash + = ( Util::bit_cast< uint32_t , float >( vert.st [1 ] ) << 13 );
82+ hash ^ = ( Util::bit_cast< uint32_t , float >( vert.st [1 ] ) >> 8 );
8383
8484 return hash;
8585 }
0 commit comments