summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2017-06-29 08:47:13 +0700
committerOxore <oxore@protonmail.com>2017-06-29 08:47:13 +0700
commited7d33b1b712b7c83903e268aff608b38244b0ce (patch)
tree95f5107723740b34f86504170759c0fc0dd2c415 /src/main.c
parent07b648f53d3d0dfd92d124df0f9967ffafc641a9 (diff)
Nest shape depiction added
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/main.c b/src/main.c
index 6f7a738..0d838a6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -16,9 +16,12 @@ sfVector2f textScore_pos;
char *scoreDisp;
int scoreCurrent = 0;
+sfRectangleShape* ns[4][4]; // Array of next shape image rectangles
sfRectangleShape* fld[25][10]; // Array of fld rectangles
sfVector2f fldCPos[25][10]; // Array of absolute coordinates of fld
// rectangles
+sfRectangleShape* ns[4][4]; // Array of next shape image rectangles
+sfVector2f nsCSize; // Next shape rectangles size variable x/y
int fldCOutThick = 1; // Field rectangles outline thickness
sfVector2f fldCSize; // Field rectangles size variable x/y
sfVector2i fldSize;
@@ -78,31 +81,14 @@ int main()
scoreDisplay(scoreCurrent, textScore);
colorizeFld();
colorizeActiSh();
+ drawFld(window);
+ drawNextShape(window);
- /*
- * Draw all fld cells
- *
- */
- for (int j = 0; j < fldSize.y; j++){
- for(int i = 0; i < fldSize.x; i++){
- sfRenderWindow_drawRectangleShape(
- window,
- fld[j][i],
- NULL);
- }
- }
sfRenderWindow_drawText(window, textScore, NULL);
} else {
menuTick();
/* Draw all fld cells */
- for (int j=0; j < fldSize.y; j++){
- for(int i = 0; i < fldSize.x; i++){
- sfRenderWindow_drawRectangleShape(
- window,
- fld[j][i],
- NULL);
- }
- }
+ drawFld(window);
sfRenderWindow_drawText(window, textMenu1, NULL);
if (sfKeyboard_isKeyPressed(sfKeyS) == 1) {