Fix incorrect naming of GMISC_INVSQRT_... macros.
This commit is contained in:
parent
190113b91c
commit
53408e2cb3
@ -25,7 +25,7 @@
|
||||
|
||||
#define GFX_USE_GMISC TRUE
|
||||
#define GMISC_NEED_INVSQRT TRUE
|
||||
//#define GDISP_INVSQRT_MIXED_ENDIAN TRUE
|
||||
//#define GDISP_INVSQRT_REAL_SLOW TRUE
|
||||
//#define GMISC_INVSQRT_MIXED_ENDIAN TRUE
|
||||
//#define GMISC_INVSQRT_REAL_SLOW TRUE
|
||||
|
||||
#endif /* _GFXCONF_H */
|
||||
|
@ -42,11 +42,11 @@
|
||||
* your processor.
|
||||
*
|
||||
* You can modify the implementation of invsqrt() by firstly defining
|
||||
* #define GDISP_INVSQRT_MIXED_ENDIAN TRUE
|
||||
* #define GMISC_INVSQRT_MIXED_ENDIAN TRUE
|
||||
* in your gfxconf.h file.
|
||||
*
|
||||
* If it still doesn't work then instead define
|
||||
* #define GDISP_INVSQRT_REAL_SLOW TRUE
|
||||
* #define GMISC_INVSQRT_REAL_SLOW TRUE
|
||||
* in your gfxconf.h file. This should always work although it will probably be slow.
|
||||
*/
|
||||
#define BALLCOLOR1 Red
|
||||
|
@ -181,8 +181,8 @@
|
||||
#define GWIN_CONSOLE_USE_BASESTREAM FALSE
|
||||
#define GWIN_CONSOLE_USE_FLOAT FALSE
|
||||
#define GWIN_NEED_IMAGE_ANIMATION FALSE
|
||||
#define GDISP_INVSQRT_MIXED_ENDIAN FALSE
|
||||
#define GDISP_INVSQRT_REAL_SLOW FALSE
|
||||
#define GMISC_INVSQRT_MIXED_ENDIAN FALSE
|
||||
#define GMISC_INVSQRT_REAL_SLOW FALSE
|
||||
*/
|
||||
|
||||
/* Optional Low Level Driver Definitions */
|
||||
|
@ -53,15 +53,15 @@
|
||||
* the same endianness. Unfortunately there are some strange
|
||||
* processors that don't eg. some very early ARM devices.
|
||||
* For those where the endianness doesn't match you can fix it by
|
||||
* defining GDISP_INVSQRT_MIXED_ENDIAN.
|
||||
* defining GMISC_INVSQRT_MIXED_ENDIAN.
|
||||
* @note This still assumes the processor is using an ieee floating point format.
|
||||
*
|
||||
* If you have a software floating point that uses a non-standard
|
||||
* floating point format (or very strange hardware) then define
|
||||
* GDISP_INVSQRT_REAL_SLOW and it will do it the hard way.
|
||||
* GMISC_INVSQRT_REAL_SLOW and it will do it the hard way.
|
||||
*/
|
||||
#ifndef GDISP_INVSQRT_MIXED_ENDIAN
|
||||
#define GDISP_INVSQRT_MIXED_ENDIAN FALSE
|
||||
#ifndef GMISC_INVSQRT_MIXED_ENDIAN
|
||||
#define GMISC_INVSQRT_MIXED_ENDIAN FALSE
|
||||
#endif
|
||||
/**
|
||||
* @brief Modifies the @p invsqrt() function to do things the long slow way.
|
||||
@ -69,8 +69,8 @@
|
||||
* processor floating point format.
|
||||
* @note This makes the @p invsqrt() function very slow.
|
||||
*/
|
||||
#ifndef GDISP_INVSQRT_REAL_SLOW
|
||||
#define GDISP_INVSQRT_REAL_SLOW FALSE
|
||||
#ifndef GMISC_INVSQRT_REAL_SLOW
|
||||
#define GMISC_INVSQRT_REAL_SLOW FALSE
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
|
@ -144,7 +144,7 @@
|
||||
|
||||
#if GMISC_NEED_INVSQRT
|
||||
// Algorithm based on Quake code.
|
||||
#if GDISP_INVSQRT_REAL_SLOW
|
||||
#if GMISC_INVSQRT_REAL_SLOW
|
||||
#include <math.h>
|
||||
float invsqrt(float n) {
|
||||
return 1.0/sqrt(n);
|
||||
@ -157,7 +157,7 @@
|
||||
x2 = n * 0.5F;
|
||||
|
||||
// Convert into an int32 (no binary format conversion)
|
||||
#if GDISP_INVSQRT_MIXED_ENDIAN
|
||||
#if GMISC_INVSQRT_MIXED_ENDIAN
|
||||
((char *)&i)[0] = ((char *)&n)[3];
|
||||
((char *)&i)[1] = ((char *)&n)[2];
|
||||
((char *)&i)[2] = ((char *)&n)[1];
|
||||
@ -170,7 +170,7 @@
|
||||
i = 0x5F375A86 - (i >> 1); // The quake code used 0x5F3759DF but this is better.
|
||||
|
||||
// Convert back to a float (no binary format conversion)
|
||||
#if GDISP_INVSQRT_MIXED_ENDIAN
|
||||
#if GMISC_INVSQRT_MIXED_ENDIAN
|
||||
((char *)&n)[0] = ((char *)&i)[3];
|
||||
((char *)&n)[1] = ((char *)&i)[2];
|
||||
((char *)&n)[2] = ((char *)&i)[1];
|
||||
|
Loading…
Reference in New Issue
Block a user