1
0
Fork 0
tetris-c/include/shape.h
2026-05-10 00:20:28 +02:00

31 lines
474 B
C

#ifndef __SHAPE_H
#define __SHAPE_H
#include "render/tile.h"
#include <stdint.h>
#include <sys/types.h>
#define NUM_SHAPES 7
typedef enum {
SHAPE_O,
SHAPE_L,
SHAPE_J,
SHAPE_T,
SHAPE_Z,
SHAPE_S,
SHAPE_I,
} SHAPETYPE;
typedef struct _shape {
uint8_t type;
int8_t coordinates[6];
} shape_t;
void shape_create(shape_t* shape, SHAPETYPE type);
void shape_copy(shape_t* dest, const shape_t* src);
tile_t shape_color(const shape_t* shape);
#endif /* __SHAPE_H */