Update render.c
This commit is contained in:
+7
-8
@@ -15,7 +15,8 @@ extern SDL_Texture * texture;
|
|||||||
extern int tile_pos;
|
extern int tile_pos;
|
||||||
extern bool next_p; // next piece flag
|
extern bool next_p; // next piece flag
|
||||||
|
|
||||||
int tile_shp, tilesrc_x, tilesrc_y, tiledst_x, tiledst_y;
|
int tile_shp = 1;
|
||||||
|
int tilesrc_x, tilesrc_y, tiledst_x, tiledst_y;
|
||||||
int row = 0, col = 0;
|
int row = 0, col = 0;
|
||||||
int tile_c;
|
int tile_c;
|
||||||
int last_time, current_time, deltatime, score;
|
int last_time, current_time, deltatime, score;
|
||||||
@@ -87,7 +88,6 @@ return 0;
|
|||||||
|
|
||||||
///////////////// DISPLAY NEXT PIECE /////////////////
|
///////////////// DISPLAY NEXT PIECE /////////////////
|
||||||
int Ren_next(void) {
|
int Ren_next(void) {
|
||||||
tile_shp = 1; // tile shape
|
|
||||||
if (next_p == 0) {
|
if (next_p == 0) {
|
||||||
} else {
|
} else {
|
||||||
SDL_SetRenderDrawColor(sr, 0x00 , 0x00 , 0x00, 0xff);
|
SDL_SetRenderDrawColor(sr, 0x00 , 0x00 , 0x00, 0xff);
|
||||||
@@ -198,7 +198,7 @@ int Ren_pause(void) {
|
|||||||
int Ren_menu(void) {
|
int Ren_menu(void) {
|
||||||
backdrop(colour);
|
backdrop(colour);
|
||||||
Ren_logo(); // logo
|
Ren_logo(); // logo
|
||||||
Ren_level(); // render current level/score
|
Ren_level(); // render current level/score
|
||||||
Ren_next(); // render next brick/block/piece
|
Ren_next(); // render next brick/block/piece
|
||||||
Ren_high(); // render high scores
|
Ren_high(); // render high scores
|
||||||
SDL_SetRenderDrawColor(sr, 0x0 , 0x0 , 0x0, 0xff);
|
SDL_SetRenderDrawColor(sr, 0x0 , 0x0 , 0x0, 0xff);
|
||||||
@@ -217,7 +217,6 @@ int display_grid() {
|
|||||||
for (int i = 0; i < 18; i++) {
|
for (int i = 0; i < 18; i++) {
|
||||||
for (int j = 0; j < 8; j++) {
|
for (int j = 0; j < 8; j++) {
|
||||||
int k = grid[0][i][j];
|
int k = grid[0][i][j];
|
||||||
tile_shp = 1; // tile shape
|
|
||||||
tilesrc_y = 0;
|
tilesrc_y = 0;
|
||||||
if (k > 0) {
|
if (k > 0) {
|
||||||
k--;
|
k--;
|
||||||
@@ -245,10 +244,10 @@ int Ren_game(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
backdrop(colour);
|
backdrop(colour);
|
||||||
Ren_logo(); // logo
|
Ren_logo(); // logo
|
||||||
Ren_level(); // render current level/score
|
Ren_level(); // render current level/score
|
||||||
Ren_next(); // render next brick/block/piece
|
Ren_next(); // render next brick/block/piece
|
||||||
Ren_high(); // render high scores
|
Ren_high(); // render high scores
|
||||||
SDL_SetRenderDrawColor(sr, 0x0 , 0x0 , 0x0, 0xff);
|
SDL_SetRenderDrawColor(sr, 0x0 , 0x0 , 0x0, 0xff);
|
||||||
SDL_RenderFillRect(sr, &main_back); // background
|
SDL_RenderFillRect(sr, &main_back); // background
|
||||||
SDL_SetRenderDrawColor (sr, 0xff, 0xff, 0xff, 255);
|
SDL_SetRenderDrawColor (sr, 0xff, 0xff, 0xff, 255);
|
||||||
|
|||||||
Reference in New Issue
Block a user