drawBullets() bug fix.

This commit is contained in:
Steve 2015-12-11 19:06:16 +00:00
parent 1fa033bc7e
commit fb524386fa
3 changed files with 10 additions and 0 deletions

View File

@ -50,6 +50,8 @@ void initBattle(void)
app.delegate.draw = &draw; app.delegate.draw = &draw;
memset(&app.keyboard, 0, sizeof(int) * MAX_KEYBOARD_KEYS); memset(&app.keyboard, 0, sizeof(int) * MAX_KEYBOARD_KEYS);
initBullets();
initEntities(); initEntities();
initStars(); initStars();

View File

@ -74,6 +74,7 @@ extern void initMessageBox(void);
extern void doMessageBox(void); extern void doMessageBox(void);
extern void drawMessageBox(void); extern void drawMessageBox(void);
extern void resetMessageBox(void); extern void resetMessageBox(void);
extern void initBullets(void);
extern App app; extern App app;
extern Battle battle; extern Battle battle;

View File

@ -27,6 +27,13 @@ static Bullet bulletDef[BT_MAX];
static Bullet *bulletsToDraw[MAX_BULLETS_TO_DRAW]; static Bullet *bulletsToDraw[MAX_BULLETS_TO_DRAW];
static int incomingMissile; static int incomingMissile;
void initBullets(void)
{
incomingMissile = 0;
memset(bulletsToDraw, 0, sizeof(Bullet*) * MAX_BULLETS_TO_DRAW);
}
void initBulletDefs(void) void initBulletDefs(void)
{ {
cJSON *root, *node; cJSON *root, *node;