remove typedefs

This commit is contained in:
KikooDX 2021-12-16 12:16:16 +01:00
parent 0135212279
commit c4ea9e75fa
4 changed files with 17 additions and 17 deletions

View File

@ -1,11 +1,11 @@
#pragma once
#include "vec.h"
typedef struct Player {
Vec pos;
VecF spd, rem;
} Player;
struct Player {
struct Vec pos;
struct VecF spd, rem;
};
void player_init(Player *);
void player_update(Player *);
void player_draw(Player *);
void player_init(struct Player *);
void player_update(struct Player *);
void player_draw(struct Player *);

View File

@ -1,9 +1,9 @@
#pragma once
typedef struct Vec {
struct Vec {
int x, y;
} Vec;
};
typedef struct VecF {
struct VecF {
float x, y;
} VecF;
};

View File

@ -2,7 +2,7 @@
#include "player.h"
#include <gint/display.h>
static Player player;
static struct Player player;
static void init(void);
static void deinit(void);

View File

@ -1,10 +1,10 @@
#include "player.h"
#include "draw.h"
static void player_reset_speed(Player *);
static void player_reset_speed(struct Player *);
void
player_init(Player *p)
player_init(struct Player *p)
{
p->pos.x = 0;
p->pos.y = 0;
@ -12,19 +12,19 @@ player_init(Player *p)
}
void
player_update(Player *p)
player_update(struct Player *p)
{
p->pos.x++;
}
void
player_draw(Player *p)
player_draw(struct Player *p)
{
draw_rectangle(C_WHITE, p->pos.x, p->pos.y, 16, 16);
}
static void
player_reset_speed(Player *p)
player_reset_speed(struct Player *p)
{
p->spd.x = 0.0f;
p->spd.y = 0.0f;