Fix not compiling on desktop due to relying on KOS specific frsqrt
This commit is contained in:
parent
4513b040e2
commit
2b06418fed
@ -509,7 +509,7 @@ static Vertex* draw_line(Vertex* dst, Vertex* v1, Vertex* v2) {
|
|||||||
float dx = ov2.xyz[0] - ov1.xyz[0];
|
float dx = ov2.xyz[0] - ov1.xyz[0];
|
||||||
float dy = ov2.xyz[1] - ov1.xyz[1];
|
float dy = ov2.xyz[1] - ov1.xyz[1];
|
||||||
|
|
||||||
float inverse_mag = frsqrt((dx*dx) + (dy*dy)) * HALF_LINE_WIDTH;
|
float inverse_mag = fast_rsqrt((dx*dx) + (dy*dy)) * HALF_LINE_WIDTH;
|
||||||
float nx = -dy * inverse_mag;
|
float nx = -dy * inverse_mag;
|
||||||
float ny = dx * inverse_mag;
|
float ny = dx * inverse_mag;
|
||||||
|
|
||||||
|
|||||||
@ -260,6 +260,12 @@ do { \
|
|||||||
memcpy_vertex(b, &c); \
|
memcpy_vertex(b, &c); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
#ifdef __DREAMCAST__
|
||||||
|
#define fast_rsqrt(x) frsqrt(x)
|
||||||
|
#else
|
||||||
|
#define fast_rsqrt(x) (1.0f / __builtin_sqrtf(x))
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ClipVertex doesn't have room for these, so we need to parse them
|
/* ClipVertex doesn't have room for these, so we need to parse them
|
||||||
* out separately. Potentially 'w' will be housed here if we support oargb */
|
* out separately. Potentially 'w' will be housed here if we support oargb */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user