From ed7d33b1b712b7c83903e268aff608b38244b0ce Mon Sep 17 00:00:00 2001 From: Oxore Date: Thu, 29 Jun 2017 08:47:13 +0700 Subject: Nest shape depiction added --- src/main.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'src/main.c') 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) { -- cgit v1.2.3