diff --git a/GAME/include/button.h b/GAME/include/button.h index 357ee98bdbcbc26bd00e709f7de1544494ee7dff..cb631e9e78700d719c24bd6357fd6411553a7531 100644 --- a/GAME/include/button.h +++ b/GAME/include/button.h @@ -27,7 +27,6 @@ typedef struct { int y_button; /**< Position : ordinate */ int long_button; /**< Size : length */ int larg_button; /**< Size : width */ - char * image_button; /**< Source image of the button. */ int state; /**< Button's state : 1 if on, 0 if off */ } Button; diff --git a/GAME/ressource/lose.png b/GAME/ressource/lose.png index a77421277da17b37c5e8453d9ebad03510c1557f..5a22db7cd0130a11f123ccb057e47c42cc1636ec 100644 Binary files a/GAME/ressource/lose.png and b/GAME/ressource/lose.png differ diff --git a/GAME/src/window.c b/GAME/src/window.c index 851d69168c24bedbbf0225cf65a3dc438629f6d6..8b13ef468121f1cf7b0c0a01bc0ecfca8834e030 100644 --- a/GAME/src/window.c +++ b/GAME/src/window.c @@ -29,7 +29,11 @@ void init_window(Window * window, int level, int time, int id_window) { window->id_window=id_window; - window->level = level; - window->time = time; - + if(id_window==LEVEL){ + window->level=level; + window->time=time; + } else { + window->level=-1; + window->time=-1; + } } \ No newline at end of file diff --git a/GAME/test/test_button.h b/GAME/test/test_button.h index 7edd4df59353d8994dde28554bd3a8be5c4183ce..3906aae047acba54a27dd0c5608a560ad6075378 100644 --- a/GAME/test/test_button.h +++ b/GAME/test/test_button.h @@ -13,12 +13,11 @@ extern "C"{ TEST(test_init_button,values_3_4_5_6_testimage) { int times = 500000000; Button button; - init_button(&button, 3, 4, 5, 6, "test_image"); + init_button(&button, 3, 4, 5, 6); EXPECT_EQ(3,button.x_button); EXPECT_EQ(4,button.y_button); EXPECT_EQ(5,button.long_button); EXPECT_EQ(6,button.larg_button); - EXPECT_STREQ("test_image",button.image_button); EXPECT_EQ(0, button.state); while (times > 0) times--; } @@ -27,8 +26,8 @@ TEST(test_click, values_in_button){ int times = 500000000; Button button; int res; - init_button(&button, 2, 3, 4, 4, "image"); - res=click(3, 4, &button); + init_button(&button, 2, 3, 4, 4); + res=clicked(3, 4, &button); EXPECT_EQ(1,button.state); EXPECT_EQ(1, res); while (times > 0) times--; @@ -38,8 +37,8 @@ TEST(test_click, values_out_button){ int times = 500000000; Button button; int res; - init_button(&button, 2, 2, 1, 1, "image"); - res=click(34, 4, &button); + init_button(&button, 2, 2, 1, 1); + res=clicked(34, 4, &button); EXPECT_EQ(0,button.state); EXPECT_EQ(0, res); while (times > 0) times--; diff --git a/GAME/test/test_map.h b/GAME/test/test_map.h index 857e3ff3928dca1fd7bef5a9530b04fa5a5526b7..7562344e22eadcc02f927f96216b16b1385dda66 100644 --- a/GAME/test/test_map.h +++ b/GAME/test/test_map.h @@ -14,9 +14,9 @@ extern "C"{ TEST(test_init_map,with_real_path){ int times=500000000; MAP map; - init_map(&map, "ressource/colored.bmp", "ressoure/mapvis.bmp"); + init_map(&map, "ressource/colored.bmp", "ressource/mapvis.bmp"); EXPECT_STREQ("ressource/colored.bmp",map.functional_path); - EXPECT_STREQ("ressoure/mapvis.bmp",map.visual_path); + EXPECT_STREQ("ressource/mapvis.bmp",map.visual_path); EXPECT_TRUE(map.functional); while(times>0) times--; //this do nothing but it looks cool ^^ }