2024-05-14 04:20:20 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "fumocommon.h"
|
|
|
|
#include "terminal.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct Tetra {
|
|
|
|
u8 *blks;
|
|
|
|
|
|
|
|
u16 wid;
|
|
|
|
u16 hgt;
|
|
|
|
|
|
|
|
i16 x;
|
|
|
|
i16 y;
|
|
|
|
|
|
|
|
u8f rot;
|
|
|
|
};
|
|
|
|
|
2024-05-15 05:44:13 +00:00
|
|
|
struct TetraTemplate {
|
|
|
|
u8 *blks;
|
|
|
|
|
|
|
|
u16 wid;
|
|
|
|
u16 hgt;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2024-05-14 04:20:20 +00:00
|
|
|
bool CreateTetra(struct Tetra *map, u16 wid, u16 hgt);
|
|
|
|
|
|
|
|
void FreeTetra(struct Tetra *map);
|
|
|
|
|
2024-05-15 05:44:13 +00:00
|
|
|
void SetTetra(struct Tetra *map, struct TetraTemplate *t, i16 x, i16 y);
|
2024-05-14 04:20:20 +00:00
|
|
|
|
|
|
|
void TetraTerminalClear(struct Tetra *board, struct Terminal *term);
|
|
|
|
|
|
|
|
void TetraTerminalDraw(struct Tetra *map, struct Terminal *term);
|
|
|
|
|
|
|
|
bool TetraMove(struct Tetra *piece, struct Tetra *board, i16 dx, i16 dy);
|
|
|
|
|
|
|
|
bool TetraIsCollision(struct Tetra *piece, struct Tetra *board, i16 dx, i16 dy);
|
|
|
|
|
|
|
|
void TetraOverlay(struct Tetra *piece, struct Tetra *board);
|