Skip to content
Snippets Groups Projects
Commit 6b26a83b authored by Jin Zijun's avatar Jin Zijun
Browse files

debug menu

parent 16c9a133
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -5,7 +5,6 @@
int menu_principal(SDL_Rect positionFond,SDL_Surface *ecran)
{
int i;
int test;
SDL_Event event;
Menu menu;
......@@ -19,7 +18,6 @@ int menu_principal(SDL_Rect positionFond,SDL_Surface *ecran)
if( SDL_Button_IsClicked( menu.buttons[playmenu] ) == true )
{
fprintf(stdout,"%d ",test);
for( i = 0 ; i < NB_Images_MENU ; i++ )
SDL_FreeSurface( menu.surf[ i ] );
return 1;
......@@ -28,7 +26,6 @@ int menu_principal(SDL_Rect positionFond,SDL_Surface *ecran)
if( SDL_Button_IsClicked( menu.buttons[explain] ) == true )
{
fprintf(stdout,"%d ",test);
for( i = 0 ; i < NB_Images_MENU ; i++ )
SDL_FreeSurface( menu.surf[ i ] );
return 2;
......@@ -65,7 +62,7 @@ void update_menu(Menu* menu, SDL_Event* event)
{
int i;
SDL_PollEvent( event );
for(i=0;i<NB_BUTTONS_;i++)
for(i=0;i<NB_BUTTONS_MENU;i++)
SDL_Button_Update( &(menu->buttons[i]), *event );
}
......@@ -77,7 +74,7 @@ void display_menu(Menu* menu,SDL_Surface *ecran)
SDL_Button_Display( menu->buttons[explain], ecran );
SDL_Flip( ecran );
SDL_RenderPresent( ecran );
}
......@@ -4,10 +4,10 @@
#include <stdlib.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include "SDL_Button.h"
#include "Button.h"
#include "common.h"
#include "SDL_InputBox.h"
#include "InputBox.h"
#define NB_BUTTONS_MENU 3
......
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