background plus fix pos des textes
This commit is contained in:
@@ -54,12 +54,15 @@ void screenDisplayGameSDL (char **tab,vect dim_tab, dis *display_user, vect *pla
|
||||
unsigned int i, j, x = 0, y = 0;
|
||||
int start_i = 0, start_j = 0;
|
||||
unsigned int limit_i = display_user->size_box, limit_j = display_user->size_box;
|
||||
|
||||
if (fov >= 0 )
|
||||
{
|
||||
start_i = player_pos->y - fov+1;
|
||||
if(start_i < 0) start_i = 0;
|
||||
start_j = player_pos->x - fov +1 ;
|
||||
if(start_j < 0) start_j = 0;
|
||||
|
||||
|
||||
limit_i = player_pos->y + fov;
|
||||
//if(limit_i > display_user->size_box) limit_i = display_user->size_box;
|
||||
if(limit_i > dim_tab.y) limit_i = dim_tab.y;
|
||||
@@ -246,3 +249,33 @@ void displayTextSDL (dis *display_user, char *text, vect coor, vect size,
|
||||
SDL_DestroyTexture (message);
|
||||
TTF_CloseFont (Sans);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Afficher l'arriere plan.
|
||||
* \param display_user Tout les information du display de l'utilisateur utile.
|
||||
*/
|
||||
void backgroundDisplay(dis *display_user)
|
||||
{
|
||||
SDL_Surface *img;
|
||||
SDL_Texture *texture;
|
||||
|
||||
img = IMG_Load("image/background.png");
|
||||
|
||||
texture = SDL_CreateTextureFromSurface (display_user->renderer, img);
|
||||
|
||||
vect pos = {0, 0};
|
||||
displayImage(display_user->renderer, texture, pos, display_user->size_window);
|
||||
|
||||
|
||||
SDL_RenderPresent (display_user->renderer);
|
||||
|
||||
SDL_Event event;
|
||||
SDL_Delay(100);
|
||||
|
||||
|
||||
|
||||
|
||||
SDL_FreeSurface (img);
|
||||
SDL_DestroyTexture (texture);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user