mirror of
https://github.com/nzp-team/glquake.git
synced 2024-11-10 06:31:35 +00:00
Stop pretending we support big endian
This commit is contained in:
parent
fcc75883c2
commit
5b95417db8
2 changed files with 9 additions and 42 deletions
|
@ -462,11 +462,8 @@ float Q_atof (char *str)
|
|||
qboolean bigendien;
|
||||
|
||||
short (*BigShort) (short l);
|
||||
short (*LittleShort) (short l);
|
||||
int (*BigLong) (int l);
|
||||
int (*LittleLong) (int l);
|
||||
float (*BigFloat) (float l);
|
||||
float (*LittleFloat) (float l);
|
||||
|
||||
short ShortSwap (short l)
|
||||
{
|
||||
|
@ -478,11 +475,6 @@ short ShortSwap (short l)
|
|||
return (b1<<8) + b2;
|
||||
}
|
||||
|
||||
short ShortNoSwap (short l)
|
||||
{
|
||||
return l;
|
||||
}
|
||||
|
||||
int LongSwap (int l)
|
||||
{
|
||||
byte b1,b2,b3,b4;
|
||||
|
@ -495,11 +487,6 @@ int LongSwap (int l)
|
|||
return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4;
|
||||
}
|
||||
|
||||
int LongNoSwap (int l)
|
||||
{
|
||||
return l;
|
||||
}
|
||||
|
||||
float FloatSwap (float f)
|
||||
{
|
||||
union
|
||||
|
@ -517,11 +504,6 @@ float FloatSwap (float f)
|
|||
return dat2.f;
|
||||
}
|
||||
|
||||
float FloatNoSwap (float f)
|
||||
{
|
||||
return f;
|
||||
}
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
|
@ -1113,27 +1095,11 @@ void COM_Init (char *basedir)
|
|||
{
|
||||
byte swaptest[2] = {1,0};
|
||||
|
||||
// set the byte swapping variables in a portable manner
|
||||
if ( *(short *)swaptest == 1)
|
||||
{
|
||||
bigendien = false;
|
||||
BigShort = ShortSwap;
|
||||
LittleShort = ShortNoSwap;
|
||||
BigLong = LongSwap;
|
||||
LittleLong = LongNoSwap;
|
||||
BigFloat = FloatSwap;
|
||||
LittleFloat = FloatNoSwap;
|
||||
}
|
||||
else
|
||||
{
|
||||
bigendien = true;
|
||||
BigShort = ShortNoSwap;
|
||||
LittleShort = ShortSwap;
|
||||
BigLong = LongNoSwap;
|
||||
LittleLong = LongSwap;
|
||||
BigFloat = FloatNoSwap;
|
||||
LittleFloat = FloatSwap;
|
||||
}
|
||||
// force set little endian to be cool and fast
|
||||
bigendien = false;
|
||||
BigShort = ShortSwap;
|
||||
BigLong = LongSwap;
|
||||
BigFloat = FloatSwap;
|
||||
|
||||
Cvar_RegisterVariable (&cmdline);
|
||||
Cmd_AddCommand ("path", COM_Path_f);
|
||||
|
|
|
@ -110,9 +110,10 @@ extern qboolean bigendien;
|
|||
extern short (*BigShort) (short l);
|
||||
extern short (*LittleShort) (short l);
|
||||
extern int (*BigLong) (int l);
|
||||
extern int (*LittleLong) (int l);
|
||||
extern float (*BigFloat) (float l);
|
||||
extern float (*LittleFloat) (float l);
|
||||
|
||||
#define LittleLong(l) l
|
||||
#define LittleShort(l) l
|
||||
#define LittleFloat(l) l
|
||||
|
||||
//============================================================================
|
||||
|
||||
|
|
Loading…
Reference in a new issue