Allow mod to handle floats.
This commit is contained in:
parent
54ebea7c43
commit
a541cf1976
|
@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define TURN_SPEED 4
|
||||
#define TURN_THRESHOLD 2
|
||||
|
||||
extern int mod(int n, int x);
|
||||
extern float mod(float n, float x);
|
||||
extern int getDistance(int x1, int y1, int x2, int y2);
|
||||
extern void fireGuns(Entity *owner);
|
||||
extern void fireMissile(Entity *owner);
|
||||
|
|
|
@ -36,7 +36,7 @@ extern long lookup(char *name);
|
|||
extern char *readFile(char *filename);
|
||||
extern float getAngle(int x1, int y1, int x2, int y2);
|
||||
extern void addMissileEngineEffect(Bullet *b);
|
||||
extern int mod(int n, int x);
|
||||
extern float mod(float n, float x);
|
||||
extern void addMissileExplosion(Bullet *b);
|
||||
extern Entity **getAllEntsWithin(int x, int y, int w, int h, Entity *ignore);
|
||||
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
|
||||
|
|
|
@ -29,7 +29,7 @@ extern void applyFighterThrust(void);
|
|||
extern void applyFighterBrakes(void);
|
||||
extern int getDistance(int x1, int y1, int x2, int y2);
|
||||
extern void addHudMessage(SDL_Color c, char *format, ...);
|
||||
extern int mod(int n, int x);
|
||||
extern float mod(float n, float x);
|
||||
extern void playSound(int id);
|
||||
extern void failMission(void);
|
||||
extern float getAngle(int x1, int y1, int x2, int y2);
|
||||
|
|
|
@ -20,9 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "util.h"
|
||||
|
||||
int mod(int n, int x)
|
||||
float mod(float n, float x)
|
||||
{
|
||||
return ((n % x) + x) % x;
|
||||
return fmod(fmod(n, x) + x, x);
|
||||
}
|
||||
|
||||
int rrnd(int low, int high)
|
||||
|
|
|
@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
|
||||
extern char *readFile(char *filename);
|
||||
extern long lookup(char *name);
|
||||
extern int mod(int n, int x);
|
||||
extern float mod(float n, float x);
|
||||
extern void blit(SDL_Texture *texture, int x, int y, int centered);
|
||||
extern SDL_Texture *getTexture(char *filename);
|
||||
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
|
||||
|
|
Loading…
Reference in New Issue