Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
vor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add missing "extern" (fixes FTBFS on gcc-10)
[vor.git]
/
sprite.h
diff --git
a/sprite.h
b/sprite.h
index
2e7ad3b
..
d67b655
100644
(file)
--- a/
sprite.h
+++ b/
sprite.h
@@
-26,14
+26,14
@@
struct sprite {
uint32_t area;
};
uint32_t area;
};
-#define MOVE_FLAG 1
-#define DRAW_FLAG 2
-#define COLLIDE_FLAG 4
-#define ALL_FLAGS (~0)
+// flags
+#define MOVE 1
+#define DRAW 2
+#define COLLIDE 4
-#define COLLIDES(sprite) ((sprite)->flags & COLLIDE_FLAG)
+#define COLLIDES(sprite) ((sprite)->flags & COLLIDE)
-Sprite *free_sprites[N_TYPES]; // lists of free sprites, by type.
+extern Sprite *free_sprites[N_TYPES]; // lists of free sprites, by type.
void do_collision(Sprite *a, Sprite *b);
void collisions(void);
void do_collision(Sprite *a, Sprite *b);
void collisions(void);
@@
-44,10
+44,10
@@
void add_sprite(Sprite *s);
void move_sprite(Sprite *s);
void move_sprites(void);
void move_sprite(Sprite *s);
void move_sprites(void);
-Sprite *collides(Sprite *s);
-int pixel_collides(float x, float y);
+Sprite * pixel_collides(float x, float y);
void load_sprite(Sprite *sprite, char *filename);
void load_sprite(Sprite *sprite, char *filename);
+float sprite_mass(Sprite *s);
void bounce(Sprite *a, Sprite *b);
void bounce(Sprite *a, Sprite *b);
@@
-84,6
+84,7
@@
struct rock {
uint32_t area;
// ROCK extras
int type;
uint32_t area;
// ROCK extras
int type;
+ int life;
};
};
@@
-109,7
+110,7
@@
static inline void
draw_sprite(Sprite *s)
{
SDL_Rect dest;
draw_sprite(Sprite *s)
{
SDL_Rect dest;
- if(s->flags & DRAW_FLAG) {
+ if(s->flags & DRAW) {
dest.x = s->x; dest.y = s->y;
SDL_BlitSurface(s->image, NULL, surf_screen, &dest);
}
dest.x = s->x; dest.y = s->y;
SDL_BlitSurface(s->image, NULL, surf_screen, &dest);
}