Mercurial > pygame
comparison src/draw.c @ 457:c7745825439b
trunc fix
| author | pygame |
|---|---|
| date | Mon, 12 May 2003 14:54:13 +0000 |
| parents | ad9e57cfa846 |
| children | 4c398dd9d49b |
comparison
equal
deleted
inserted
replaced
| 456:6546a6b9cef2 | 457:c7745825439b |
|---|---|
| 23 /* | 23 /* |
| 24 * drawing module for pygame | 24 * drawing module for pygame |
| 25 */ | 25 */ |
| 26 #include "pygame.h" | 26 #include "pygame.h" |
| 27 #include <math.h> | 27 #include <math.h> |
| 28 | |
| 29 #ifdef _MSC_VER | |
| 30 #pragma warning (disable:4244) | |
| 31 | |
| 32 float trunc(float d) | |
| 33 { | |
| 34 if (d >= 0) | |
| 35 return floor(d); | |
| 36 return ceil(d); | |
| 37 } | |
| 38 | |
| 39 #endif | |
| 28 | 40 |
| 29 #define FRAC(z) (z-trunc(z)) | 41 #define FRAC(z) (z-trunc(z)) |
| 30 #define INVFRAC(z) (1-(z-trunc(z))) | 42 #define INVFRAC(z) (1-(z-trunc(z))) |
| 31 | 43 |
| 32 static int clip_and_draw_line(SDL_Surface* surf, SDL_Rect* rect, Uint32 color, int* pts); | 44 static int clip_and_draw_line(SDL_Surface* surf, SDL_Rect* rect, Uint32 color, int* pts); |
