Skip to content
Snippets Groups Projects
Commit 8761c2d9 authored by llebasca's avatar llebasca
Browse files

button & window correction

parent 311b224f
No related branches found
No related tags found
4 merge requests!9Modele,!8Modele,!7Modele,!6Modele
...@@ -33,6 +33,5 @@ typedef struct { ...@@ -33,6 +33,5 @@ typedef struct {
void init_button(Button * button, int x, int y, int length, int width, char * path); void init_button(Button * button, int x, int y, int length, int width, char * path);
int click(int x, int y, Button * button); int click(int x, int y, Button * button);
void unclick(Button * button);
#endif /*INSAGAME_BUTTON_H*/ #endif /*INSAGAME_BUTTON_H*/
...@@ -24,10 +24,14 @@ ...@@ -24,10 +24,14 @@
typedef enum { typedef enum {
LOADING_PAGE, /*!< 0 */ LOADING_PAGE, /*!< 0 */
INTRO_PAGE, /*!< 1 */ INTRO_PAGE, /*!< 1 */
LEVEL_PRESENTATION, /*!< 2 */ LEVEL_PRESENTATION_1, /*!< 2 */
LEVEL, /*!< 3 */ LEVEL_PRESENTATION_2, /*!< 3 */
WIN_PAGE, /*!< 4 */ LEVEL_PRESENTATION_3, /*!< 4 */
FAIL_PAGE /*!< 5 */ LEVEL_PRESENTATION_4, /*!< 5 */
LEVEL_PRESENTATION_5, /*!< 6 */
LEVEL, /*!< 7 */
WIN_PAGE, /*!< 8 */
FAIL_PAGE /*!< 9 */
} Window_number; } Window_number;
...@@ -37,9 +41,9 @@ typedef enum { ...@@ -37,9 +41,9 @@ typedef enum {
*/ */
typedef struct { typedef struct {
int level; /**< */ int level; /**< Level integer */
int time; /**< */ int time; /**< Level's time */
Window_number nb_window; /**< */ Window_number nb_window; /**< Window's number */
} Window; } Window;
......
...@@ -54,17 +54,8 @@ int click(int x, int y, Button * button) { ...@@ -54,17 +54,8 @@ int click(int x, int y, Button * button) {
if (button->x_button < x && x < (button->x_button + button->long_button) if (button->x_button < x && x < (button->x_button + button->long_button)
&& button->y_button < y && y < (button->y_button + button->larg_button)) { && button->y_button < y && y < (button->y_button + button->larg_button)) {
button->state=1; button->state=1;
} else {
button->state=0;
} }
return button->state; return button->state;
} }
/*!
* \fn void unclick(Button * button)
* \brief Sets the button's state on OFF.
*
* \param [in] button a pointer on a button
*/
void unclick(Button * button){
button->state=0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment