summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/engine.h6
-rw-r--r--include/field.h33
2 files changed, 21 insertions, 18 deletions
diff --git a/include/engine.h b/include/engine.h
index 655eb01..7a4ce32 100644
--- a/include/engine.h
+++ b/include/engine.h
@@ -9,11 +9,7 @@ void tKeyCtrl();
void tTick();
void checkLevelUp(struct game *game);
int getMoveLatencyOfLevel(int level);
-int rmLines();
void valueAfterTextDisplay(int value, List *texts, char *type);
-void colorizeActive();
void drawFld(sfRenderWindow *window);
void gameover(struct game *game);
-void genNextShape();
-void drawNextShape();
-void freeFld();
+void drawNextShape(sfRenderWindow *window);
diff --git a/include/field.h b/include/field.h
index 410e609..6e1c928 100644
--- a/include/field.h
+++ b/include/field.h
@@ -2,10 +2,6 @@
#define FLD_SIZE_X 10
#define FLD_BOUND_Y FLD_SIZE_Y + 3
#define FLD_BOUND_X FLD_SIZE_X
-/*
- * Types
- *
- * */
struct cell {
char a; // active/empty state of cell
@@ -14,13 +10,19 @@ struct cell {
/*
- * shape coords
+ * field + shape coord system
* y
- * ^. . . .
- * |. . . .
- * |. . . .
- * |. . . .
- * 0------->x
+ * ^. . . . . . .
+ * |. . . . . . .
+ * |. . . . . . .
+ * |. . y . . . .
+ * |. . ^ . . . .
+ * |. . | . . . .
+ * |. . | . . . .
+ * |. . 0------>x
+ * |. . . . . . .
+ * |. . . . . . .
+ * 0------------->x
*
*/
@@ -49,10 +51,15 @@ struct field {
void init_field(struct field *fld);
void colorize_field(struct field *fld);
void colorize_field_random(struct field *fld);
-void init_next_shape_field(struct shape *next);
+void colorize_active_shape(struct field *fld, struct shape *shape);
+void init_next_shape(struct shape *next);
void putShape(struct field *fld, struct shape *active);
-int out_of_field(struct field *fld, struct shape *active);
+int out_of_field(struct field *fld, struct shape *active);
void load_shape(struct shape *shape);
void rotate_shape(struct field *fld, struct shape *shape);
-int collide(struct field *fld, struct shape *active);
+int collide(struct field *fld, struct shape *active);
void resetActiveShape(struct field *fld, struct shape *active);
+void gen_shape(struct shape *shape);
+int rm_lines(struct field *fld);
+void free_field(struct field *fld);
+void free_shape(struct shape *shape);