diff --git a/cmake-build-debug/CMakeFiles/nhf.dir/C.includecache b/cmake-build-debug/CMakeFiles/nhf.dir/C.includecache index a26b0809e856f4dfb66fffe5cc659443406daf36..47d5276989acd1c823f69fa66934e7629c736e20 100644 --- a/cmake-build-debug/CMakeFiles/nhf.dir/C.includecache +++ b/cmake-build-debug/CMakeFiles/nhf.dir/C.includecache @@ -14,15 +14,13 @@ stdlib.h stdio.h - -/home/blint/projects/nhf/main.c -view.h -/home/blint/projects/nhf/view.h +/home/blint/projects/nhf/move.c move.h /home/blint/projects/nhf/move.h +view.h +/home/blint/projects/nhf/view.h files.h /home/blint/projects/nhf/files.h -time.h -- /home/blint/projects/nhf/move.h view.h diff --git a/cmake-build-debug/CMakeFiles/nhf.dir/main.c.o b/cmake-build-debug/CMakeFiles/nhf.dir/main.c.o index 3b404324aeea4f85438016b38cd6367d453a710d..1aa761cbdc30fadc679322f6caa3dcd42707fc85 100644 Binary files a/cmake-build-debug/CMakeFiles/nhf.dir/main.c.o and b/cmake-build-debug/CMakeFiles/nhf.dir/main.c.o differ diff --git a/cmake-build-debug/CMakeFiles/nhf.dir/view.c.o b/cmake-build-debug/CMakeFiles/nhf.dir/view.c.o index ce0837d5fe668148964903402079b1b5e68c15f9..ac8cc1dbd6d244d7e22953c70ae03048cbe6826d 100644 Binary files a/cmake-build-debug/CMakeFiles/nhf.dir/view.c.o and b/cmake-build-debug/CMakeFiles/nhf.dir/view.c.o differ diff --git a/cmake-build-debug/asd.txt b/cmake-build-debug/asd.txt index 1ae16a18d440c606396c353d90aa43df072bd7f9..81918c2a24483d3aa8aa7fe64422091a284d4676 100644 --- a/cmake-build-debug/asd.txt +++ b/cmake-build-debug/asd.txt @@ -3,11 +3,14 @@ Mike was here | 8888 fapapucs | 8289 Jani :D | 7777 unknown Player | 6666 -egy rakás szar vagyok | 4444 +random string| 2387 fuck that shit | 192 +a| 190 +asd| 189 próba elemér | 141 +alma| 136 ődflksdfb | 130 hello world | 129 Player1 a | 12 Blint Mester | 2 -random string| 2387 +asdasd| 154 diff --git a/cmake-build-debug/nhf b/cmake-build-debug/nhf index 595fdab9d4c31fae052d3ed4ee9cbec1a1cf256a..829e2020f955c3191c92285bbcab9fcfbc78040e 100755 Binary files a/cmake-build-debug/nhf and b/cmake-build-debug/nhf differ diff --git a/main.c b/main.c index 5e7096ae6914f7de1c962db3e4b1af7c30186cf0..fefc340b69c41df7f1268354defa8b419c04af40 100644 --- a/main.c +++ b/main.c @@ -88,6 +88,14 @@ int main(int argc, char *argv[]) { close.over = false; close.click = false; + Button back; + strcpy(back.title, "Visszamegyek, mert ez uncsi"); + back.x = W/6; + back.w = W - (2*W/6); + back.y = H/9 * 5 + (H/18 * (5-1)); + back.h = H/9; + back.click = false; + Button scoretitle; scoretitle.x = 0; scoretitle.y = 0; @@ -134,7 +142,7 @@ int main(int argc, char *argv[]) { { SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_RenderClear(renderer); - draw_score_board(players, ev, &scoring); + draw_score_board(players, ev, &scoring, &back); } if (!moving && starting) //ask for username diff --git a/move.c b/move.c index aa9993fda6e35b993ea20f3ebd559f8b2ac0905d..4f6283f1ab90abc3a499507d87a8ab9f95308c0b 100644 --- a/move.c +++ b/move.c @@ -339,7 +339,8 @@ void menu(SDL_Event ev, Button *start, Button *load, Button *scoreboard, Button if (start->click) *moving = true; else - *moving = false; + //*moving = false; + {} if (load->click) *loading = true; diff --git a/view.c b/view.c index 2f4e1c8919ec8b1766cfcee288b85b7242b227cf..3e0859cf1ad118df61c1caa2ce3517b593641bfa 100644 --- a/view.c +++ b/view.c @@ -264,7 +264,7 @@ int last_stand(Palyaelem *elem) return mozgo->x; } -void draw_score_board(Player *players, SDL_Event ev, bool *scoring) +void draw_score_board(Player *players, SDL_Event ev, bool *scoring, Button *back) { int i = 1; Player *mozgo = players; @@ -293,23 +293,16 @@ void draw_score_board(Player *players, SDL_Event ev, bool *scoring) mozgo = mozgo->kov; } - strcpy(button.title, "Visszamegyek, mert ez uncsi"); - button.x = W/6; - button.w = W - (2*W/6); - button.y = last_y * i + (H/18 * (i-1)); - button.h = H/9; - button.click = false; + //draw_button(*back, red, white); - draw_button(button, red, white); + *back = clickwatcher(ev, *back); - button = clickwatcher(ev, button); - - /*if (button.over) - draw_button(button, green, white); + if (back->over) + draw_button(*back, green, white); else - draw_button(button, red, white);*/ + draw_button(*back, red, white); - if (button.click) + if (back->click) *scoring = false; else *scoring = true; diff --git a/view.h b/view.h index eb404d153b9481e09c2a099edc19cfbb5cc71910..ecfbe69031fd3ac5bc27b706d5dd904de5aa56f9 100644 --- a/view.h +++ b/view.h @@ -71,7 +71,7 @@ Palyaelem *gen_item(Palyaelem *platforms, Type type); int last_stand(Palyaelem *elem); -void draw_score_board(Player *players, SDL_Event ev, bool *scoring); +void draw_score_board(Player *players, SDL_Event ev, bool *scoring, Button *back); bool input_text(char *dest, size_t hossz, SDL_Rect teglalap, SDL_Color hatter, SDL_Color szoveg);