Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mangle.h
Go to the documentation of this file.
1 /*
2  * Vega Strike
3  * Copyright (C) 2002 David Jeffery
4  *
5  * http://vegastrike.sourceforge.net/
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21 
22 #define BITMASK( bits ) ( (1<<bits)-1 )
23 #define SIGN_MASK 0x80000000
24 #define EXP_MASK 0x7f800000
25 #define SIGNIF_MASK 0x007fffff
26 #define EXP_BITS 8
27 #define SIGNIF_BITS 23
28 
29 //encode a float into a smaller form
30 unsigned int float_to_uint32( float value, char exponent, char significand, char denorm );
31 //decode a shrunk float back to its natural form
32 float uint32_to_float( unsigned int value, char exponent, char significand, char denorm );
33