Fix incorrect naming of GMISC_INVSQRT_... macros.

remotes/origin_old/ugfx_release_2.6
inmarket 2013-11-09 19:13:01 +10:00
parent 190113b91c
commit 53408e2cb3
5 changed files with 15 additions and 15 deletions

View File

@ -25,7 +25,7 @@
#define GFX_USE_GMISC TRUE #define GFX_USE_GMISC TRUE
#define GMISC_NEED_INVSQRT TRUE #define GMISC_NEED_INVSQRT TRUE
//#define GDISP_INVSQRT_MIXED_ENDIAN TRUE //#define GMISC_INVSQRT_MIXED_ENDIAN TRUE
//#define GDISP_INVSQRT_REAL_SLOW TRUE //#define GMISC_INVSQRT_REAL_SLOW TRUE
#endif /* _GFXCONF_H */ #endif /* _GFXCONF_H */

View File

@ -42,11 +42,11 @@
* your processor. * your processor.
* *
* You can modify the implementation of invsqrt() by firstly defining * 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. * in your gfxconf.h file.
* *
* If it still doesn't work then instead define * 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. * in your gfxconf.h file. This should always work although it will probably be slow.
*/ */
#define BALLCOLOR1 Red #define BALLCOLOR1 Red

View File

@ -181,8 +181,8 @@
#define GWIN_CONSOLE_USE_BASESTREAM FALSE #define GWIN_CONSOLE_USE_BASESTREAM FALSE
#define GWIN_CONSOLE_USE_FLOAT FALSE #define GWIN_CONSOLE_USE_FLOAT FALSE
#define GWIN_NEED_IMAGE_ANIMATION FALSE #define GWIN_NEED_IMAGE_ANIMATION FALSE
#define GDISP_INVSQRT_MIXED_ENDIAN FALSE #define GMISC_INVSQRT_MIXED_ENDIAN FALSE
#define GDISP_INVSQRT_REAL_SLOW FALSE #define GMISC_INVSQRT_REAL_SLOW FALSE
*/ */
/* Optional Low Level Driver Definitions */ /* Optional Low Level Driver Definitions */

View File

@ -53,15 +53,15 @@
* the same endianness. Unfortunately there are some strange * the same endianness. Unfortunately there are some strange
* processors that don't eg. some very early ARM devices. * processors that don't eg. some very early ARM devices.
* For those where the endianness doesn't match you can fix it by * 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. * @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 * If you have a software floating point that uses a non-standard
* floating point format (or very strange hardware) then define * 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 #ifndef GMISC_INVSQRT_MIXED_ENDIAN
#define GDISP_INVSQRT_MIXED_ENDIAN FALSE #define GMISC_INVSQRT_MIXED_ENDIAN FALSE
#endif #endif
/** /**
* @brief Modifies the @p invsqrt() function to do things the long slow way. * @brief Modifies the @p invsqrt() function to do things the long slow way.
@ -69,8 +69,8 @@
* processor floating point format. * processor floating point format.
* @note This makes the @p invsqrt() function very slow. * @note This makes the @p invsqrt() function very slow.
*/ */
#ifndef GDISP_INVSQRT_REAL_SLOW #ifndef GMISC_INVSQRT_REAL_SLOW
#define GDISP_INVSQRT_REAL_SLOW FALSE #define GMISC_INVSQRT_REAL_SLOW FALSE
#endif #endif
/** @} */ /** @} */

View File

@ -144,7 +144,7 @@
#if GMISC_NEED_INVSQRT #if GMISC_NEED_INVSQRT
// Algorithm based on Quake code. // Algorithm based on Quake code.
#if GDISP_INVSQRT_REAL_SLOW #if GMISC_INVSQRT_REAL_SLOW
#include <math.h> #include <math.h>
float invsqrt(float n) { float invsqrt(float n) {
return 1.0/sqrt(n); return 1.0/sqrt(n);
@ -157,7 +157,7 @@
x2 = n * 0.5F; x2 = n * 0.5F;
// Convert into an int32 (no binary format conversion) // 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)[0] = ((char *)&n)[3];
((char *)&i)[1] = ((char *)&n)[2]; ((char *)&i)[1] = ((char *)&n)[2];
((char *)&i)[2] = ((char *)&n)[1]; ((char *)&i)[2] = ((char *)&n)[1];
@ -170,7 +170,7 @@
i = 0x5F375A86 - (i >> 1); // The quake code used 0x5F3759DF but this is better. i = 0x5F375A86 - (i >> 1); // The quake code used 0x5F3759DF but this is better.
// Convert back to a float (no binary format conversion) // 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)[0] = ((char *)&i)[3];
((char *)&n)[1] = ((char *)&i)[2]; ((char *)&n)[1] = ((char *)&i)[2];
((char *)&n)[2] = ((char *)&i)[1]; ((char *)&n)[2] = ((char *)&i)[1];