diff options
author | Oxore <oxore@protonmail.com> | 2017-06-29 08:47:13 +0700 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2017-06-29 08:47:13 +0700 |
commit | ed7d33b1b712b7c83903e268aff608b38244b0ce (patch) | |
tree | 95f5107723740b34f86504170759c0fc0dd2c415 /src/main.c | |
parent | 07b648f53d3d0dfd92d124df0f9967ffafc641a9 (diff) |
Nest shape depiction added
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 26 |
1 files changed, 6 insertions, 20 deletions
@@ -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) { |