Skip to content

Commit

Permalink
patch warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-brl committed Apr 21, 2023
1 parent eaec21f commit 77e4d6d
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 75 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ SRC = src/main.c \
OBJ = $(SRC:.c=.o)

CC = gcc
CFLAGS = -Wall -fsanitize=address
CFLAGS = -Wall -Wextra
LIB = -L./lib -lmy_string -lmy_printf -lmy_stdlib -lm
LDFLAGS = -lcsfml-graphics -lcsfml-system -lcsfml-window -lcsfml-audio $(LIB)

Expand All @@ -167,7 +167,7 @@ all: $(EXE)

$(EXE): $(OBJ)
@make -C ./lib
$(CC) -o $(EXE) $(SRC) $(LDFLAGS) -fsanitize=address
$(CC) -o $(EXE) $(SRC) $(LDFLAGS)

clean:
@rm -rf $(OBJ)
Expand Down
18 changes: 8 additions & 10 deletions include/prototype.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

int button_event(app_t *app, button_t **button, sfEvent event);

int update_buttons_texture(app_t *app, button_t **button);
int update_buttons_texture(button_t **button);

int is_button_hover(button_t *button, sfMouseMoveEvent mouse);
int is_button_released(button_t *button, sfMouseButtonEvent mouse);
Expand All @@ -58,17 +58,16 @@

/* event */
int main_event(app_t *app);
int move_top(app_t *app, maps_t *maps, entity_t *player, sfView *view);
int move_bot(app_t *app, maps_t *maps, entity_t *player, sfView *view);
int move_left(app_t *app, maps_t *maps, entity_t *player, sfView *view);
int move_right(app_t *app, maps_t *maps, entity_t *player, sfView *view);
int move_top(app_t *app, entity_t *player);
int move_bot(app_t *app, entity_t *player);
int move_left(app_t *app, entity_t *player);
int move_right(app_t *app, entity_t *player);
int detect_collision(app_t *app, entity_t *entity);

int menu_event(app_t *app, sfEvent event);

/* map*/
tile_t *create_tile(int id, map_object_t **map_object, sfVector2i position,
sfVector2i size);
tile_t *create_tile(int id, map_object_t **map_object, sfVector2i position);
int destroy_tile(tile_t *tile);
layer_t *load_map_from_file(const char *pathfile, int id,
map_object_t **map_object, entity_t *player);
Expand Down Expand Up @@ -148,9 +147,8 @@
int center_view(sfView *view, entity_t *player);

/* Conversion */
int set_isometric_pos(entity_t *entity, sfVector2f position,
sfVector2f size);
sfVector2f get_isometric_pos(sfVector2f position, sfVector2f size);
int set_isometric_pos(entity_t *entity, sfVector2f position);
sfVector2f get_isometric_pos(sfVector2f position);

/* Background */
void change_background(sprite_t *background, char *filepath);
Expand Down
58 changes: 29 additions & 29 deletions maps/Maze/map_2.csv
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20
20,67,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,-1,-1,-1,-1,20
20,20,20,-1,20,20,20,20,20,20,20,-1,20,20,20,-1,20,-1,20,-1,20,20,20,-1,20,-1,20,20,20,20,20
20,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,20,-1,20
20,20,20,-1,20,-1,20,-1,20,20,20,-1,20,-1,20,-1,20,-1,20,20,20,20,20,20,20,-1,20,-1,20,-1,20
20,-1,-1,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,20
20,20,20,20,20,-1,20,-1,20,20,20,-1,20,-1,20,20,20,-1,20,-1,20,-1,20,20,20,20,20,-1,20,20,20
20,-1,-1,-1,20,-1,20,-1,20,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,20,-1,20
20,-1,20,-1,20,20,20,-1,20,-1,20,-1,20,20,20,20,20,-1,20,20,20,-1,20,-1,20,-1,20,-1,20,-1,20
20,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,20,-1,-1,-1,20,-1,20,-1,-1,-1,-1,-1,-1,-1,20,-1,-1,-1,20
20,20,20,-1,20,-1,20,20,20,-1,20,20,20,20,20,-1,20,20,20,-1,20,20,20,-1,20,-1,20,20,20,20,20
20,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,-1,-1,-1,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,20
20,-1,20,-1,20,-1,20,20,20,-1,20,-1,20,-1,20,-1,20,20,20,-1,20,20,20,-1,20,-1,20,20,20,-1,20
20,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,20,-1,-1,-1,-1,-1,20
20,20,20,20,20,20,20,20,20,20,20,-1,20,20,20,-1,20,-1,20,-1,20,-1,20,20,20,20,20,-1,20,20,20
20,-1,-1,-1,-1,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,20,-1,20,-1,20,-1,20,-1,20,-1,-1,-1,20,-1,20
20,-1,20,20,20,20,20,-1,20,20,20,-1,20,-1,20,-1,20,20,20,-1,20,20,20,-1,20,-1,20,-1,20,-1,20
20,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,20
20,-1,20,-1,20,20,20,20,20,-1,20,20,20,-1,20,20,20,20,20,-1,20,20,20,20,20,20,20,20,20,-1,20
20,-1,20,-1,-1,-1,-1,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,20
20,20,20,20,20,20,20,20,20,20,20,-1,20,-1,20,20,20,-1,20,20,20,-1,20,-1,20,-1,20,20,20,-1,20
20,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,20,-1,-1,-1,20,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,20
20,-1,20,20,20,-1,20,-1,20,-1,20,20,20,-1,20,20,20,-1,20,20,20,-1,20,-1,20,20,20,-1,20,20,20
20,-1,20,-1,-1,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,20
20,-1,20,20,20,-1,20,-1,20,-1,20,-1,20,20,20,20,20,20,20,20,20,-1,20,-1,20,-1,20,-1,20,20,20
20,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,20,-1,20
20,-1,20,-1,20,-1,20,-1,20,20,20,-1,20,20,20,-1,20,-1,20,20,20,-1,20,20,20,20,20,20,20,-1,20
20,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,-1,-1,20
20,-1,20,20,20,-1,20,20,20,-1,20,20,20,20,20,20,20,-1,20,-1,20,-1,20,20,20,-1,20,-1,20,20,20
20,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,20
20,67,20,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,-1,-1,20
20,-1,20,20,20,-1,20,20,20,-1,20,-1,20,20,20,-1,20,-1,20,20,20,-1,20,20,20,20,20,20,20,-1,20
20,-1,-1,-1,20,-1,20,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,20,-1,20
20,20,20,-1,20,-1,20,-1,20,-1,20,20,20,-1,20,20,20,20,20,-1,20,-1,20,-1,20,-1,20,-1,20,20,20
20,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,20,-1,20,-1,20,-1,20,-1,20
20,-1,20,20,20,-1,20,-1,20,-1,20,20,20,20,20,-1,20,-1,20,-1,20,20,20,-1,20,20,20,-1,20,-1,20
20,-1,20,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,-1,-1,20
20,-1,20,20,20,-1,20,-1,20,20,20,-1,20,-1,20,-1,20,-1,20,-1,20,-1,20,-1,20,-1,20,20,20,20,20
20,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,-1,-1,20,-1,20,-1,-1,-1,20
20,-1,20,20,20,20,20,20,20,20,20,20,20,-1,20,20,20,-1,20,-1,20,20,20,-1,20,-1,20,-1,20,20,20
20,-1,20,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,-1,-1,-1,-1,20
20,-1,20,-1,20,-1,20,20,20,-1,20,20,20,20,20,-1,20,-1,20,20,20,20,20,20,20,20,20,-1,20,20,20
20,-1,-1,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,20,-1,20,-1,20,-1,20,-1,-1,-1,20
20,-1,20,-1,20,20,20,20,20,20,20,-1,20,-1,20,-1,20,20,20,20,20,-1,20,-1,20,-1,20,-1,20,20,20
20,-1,20,-1,-1,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,-1,-1,20
20,-1,20,-1,20,-1,20,-1,20,20,20,-1,20,-1,20,-1,20,20,20,20,20,-1,20,20,20,20,20,-1,20,20,20
20,-1,20,-1,20,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,20,-1,20,-1,20,-1,-1,-1,20
20,20,20,20,20,-1,20,-1,20,-1,20,-1,20,20,20,-1,20,-1,20,-1,20,-1,20,-1,20,-1,20,20,20,20,20
20,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,20,-1,-1,-1,20
20,20,20,20,20,20,20,20,20,-1,20,20,20,-1,20,20,20,20,20,20,20,-1,20,20,20,20,20,20,20,-1,20
20,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,-1,-1,20
20,20,20,-1,20,20,20,-1,20,20,20,-1,20,20,20,-1,20,20,20,20,20,20,20,-1,20,20,20,-1,20,20,20
20,-1,-1,-1,20,-1,20,-1,20,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,20,-1,-1,-1,20,-1,-1,-1,-1,-1,20
20,-1,20,20,20,-1,20,20,20,-1,20,20,20,-1,20,-1,20,20,20,-1,20,20,20,-1,20,-1,20,20,20,-1,20
20,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,-1,-1,20,-1,-1,-1,20
20,-1,20,20,20,-1,20,20,20,-1,20,20,20,-1,20,-1,20,-1,20,20,20,20,20,20,20,-1,20,20,20,20,20
20,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,20,-1,-1,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,20
20,-1,20,-1,20,-1,20,20,20,-1,20,20,20,20,20,20,20,-1,20,-1,20,-1,20,20,20,20,20,20,20,-1,20
20,-1,20,-1,20,-1,-1,-1,20,-1,-1,-1,20,-1,-1,-1,-1,-1,20,-1,20,-1,20,-1,-1,-1,-1,-1,-1,-1,20
20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,-1,66
2 changes: 1 addition & 1 deletion src/app/create_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ app_t *create_app(sfVideoMode videomode)
{
app_t *app = malloc(sizeof(app_t));
create_weapons_list(app);
app->videomode = (sfVideoMode){1920, 1080, 32};
app->videomode = videomode;
app->window = create_window(app->videomode, "my_rpg");
sfRenderWindow_setFramerateLimit(app->window, 120);
app->fps = create_fps_counter();
Expand Down
2 changes: 1 addition & 1 deletion src/button/button_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ int button_event(app_t *app, button_t **button, sfEvent event)
}
i += 1;
}
update_buttons_texture(app, button);
update_buttons_texture(button);
return 0;
}
2 changes: 1 addition & 1 deletion src/button/update_button.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int update_button_textures(button_t *button)
return 0;
}

int update_buttons_texture(app_t *app, button_t **button)
int update_buttons_texture(button_t **button)
{
int i = 0;
while (button[i] != NULL) {
Expand Down
4 changes: 2 additions & 2 deletions src/conversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "../include/prototype.h"

int set_isometric_pos(entity_t *entity, sfVector2f position, sfVector2f size)
int set_isometric_pos(entity_t *entity, sfVector2f position)
{
entity->position = position;
sfVector2f real_position = {((position.x - position.y) * 32 / 2),
Expand All @@ -16,7 +16,7 @@ int set_isometric_pos(entity_t *entity, sfVector2f position, sfVector2f size)
return 0;
}

sfVector2f get_isometric_pos(sfVector2f position, sfVector2f size)
sfVector2f get_isometric_pos(sfVector2f position)
{
sfVector2f real_position = {((position.x - position.y) * 32 / 2),
((position.x + position.y) * 32 / 4)};
Expand Down
16 changes: 8 additions & 8 deletions src/entity/player_direction.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "../../include/prototype.h"

int move_top(app_t *app, maps_t *maps, entity_t *player, sfView *view)
int move_top(app_t *app, entity_t *player)
{
player->texture_rect.left = 64;
sfSprite_setTextureRect(player->sprite->sprite, player->texture_rect);
Expand All @@ -25,11 +25,11 @@ int move_top(app_t *app, maps_t *maps, entity_t *player, sfView *view)
player->position.x += 1;
break;
}
set_isometric_pos(player, player->position, maps->selected_map->size);
set_isometric_pos(player, player->position);
return 0;
}

int move_bot(app_t *app, maps_t *maps, entity_t *player, sfView *view)
int move_bot(app_t *app, entity_t *player)
{
player->texture_rect.left = 32;
sfSprite_setTextureRect(player->sprite->sprite, player->texture_rect);
Expand All @@ -47,11 +47,11 @@ int move_bot(app_t *app, maps_t *maps, entity_t *player, sfView *view)
player->position.y += 2;
break;
}
set_isometric_pos(player, player->position, maps->selected_map->size);
set_isometric_pos(player, player->position);
return 0;
}

int move_left(app_t *app, maps_t *maps, entity_t *player, sfView *view)
int move_left(app_t *app, entity_t *player)
{
player->texture_rect.left = 96;
sfSprite_setTextureRect(player->sprite->sprite, player->texture_rect);
Expand All @@ -69,11 +69,11 @@ int move_left(app_t *app, maps_t *maps, entity_t *player, sfView *view)
player->position.y += 1;
break;
}
set_isometric_pos(player, player->position, maps->selected_map->size);
set_isometric_pos(player, player->position);
return 0;
}

int move_right(app_t *app, maps_t *maps, entity_t *player, sfView *view)
int move_right(app_t *app, entity_t *player)
{
player->texture_rect.left = 0;
sfSprite_setTextureRect(player->sprite->sprite, player->texture_rect);
Expand All @@ -90,6 +90,6 @@ int move_right(app_t *app, maps_t *maps, entity_t *player, sfView *view)
player->position.y += 1;
player->position.x += 2;
}
set_isometric_pos(player, player->position, maps->selected_map->size);
set_isometric_pos(player, player->position);
return 0;
}
8 changes: 4 additions & 4 deletions src/entity/player_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ int move_player(app_t *app, sfEvent event)
int code = event.key.code;
switch (code) {
case 25:
move_top(app, app->maps, app->player, app->view);
move_top(app, app->player);
break;
case 18:
move_bot(app, app->maps, app->player, app->view);
move_bot(app, app->player);
break;
case 16:
move_left(app, app->maps, app->player, app->view);
move_left(app, app->player);
break;
case 3:
move_right(app, app->maps, app->player, app->view);
move_right(app, app->player);
break;
default:
break;
Expand Down
4 changes: 2 additions & 2 deletions src/generator/algo/kruskal/kruskal.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int propagate_value(maze_t *maze, vector_t position, vector_t origin,
return 0;
}

static int create_connection(maze_t *maze, node_t **node, node_t *tmp_node)
static int create_connection(maze_t *maze, node_t *tmp_node)
{
if (tmp_node->status == V_EDGE)
return create_vert(maze, tmp_node);
Expand All @@ -52,7 +52,7 @@ static int iteral_kruskal(maze_t *maze, node_t **node)
while (len_list(node) > 1) {
int index = generate_random(0, len_list(node) - 1);
node_t *tmp_node = node[index];
if (create_connection(maze, node, tmp_node) == 1)
if (create_connection(maze, tmp_node) == 1)
shift_list(node, index);
i += 1;
}
Expand Down
3 changes: 1 addition & 2 deletions src/map/change_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ int change_map(app_t *app, maps_t *maps, entity_t *player, int id)
maps->selected_map = maps->map[id];
player->layer = 1;
player->position = maps->selected_map->spawn;
sfVector2f size = maps->selected_map->layer[1]->size;
set_isometric_pos(player, maps->selected_map->spawn, size);
set_isometric_pos(player, maps->selected_map->spawn);
if (app->menu->state == game) {
sfRenderWindow_setView(app->window, app->default_view);
launch_cinematic(app, Portal);
Expand Down
3 changes: 1 addition & 2 deletions src/map/create_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
#include "../../include/prototype.h"
#include <stdio.h>

tile_t *create_tile(int id, map_object_t **map_object, sfVector2i position,
sfVector2i size)
tile_t *create_tile(int id, map_object_t **map_object, sfVector2i position)
{
tile_t *tile = malloc(sizeof(tile_t));
tile->id = id;
Expand Down
6 changes: 3 additions & 3 deletions src/map/get_manifest_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int count_manifest_map(const char *filepath)
char *line = NULL;
size_t count = 0;
size_t len = 0;
size_t read_size = 0;
int read_size = 0;
while ((read_size = getline(&line, &len, fp)) != -1) {
if (my_strncmp(line, "maps", 4) == 0)
count += 1;
Expand All @@ -30,7 +30,7 @@ int count_manifest_object(const char *filepath)
char *line = NULL;
size_t count = 0;
size_t len = 0;
size_t read_size = 0;
int read_size = 0;
while ((read_size = getline(&line, &len, fp)) != -1) {
if (my_strncmp(line, "maps", 4) == 0)
continue;
Expand All @@ -47,7 +47,7 @@ int count_map_layer(const char *filepath)
char *line = NULL;
size_t count = 0;
size_t len = 0;
size_t read_size = 0;
int read_size = 0;
while ((read_size = getline(&line, &len, fp)) != -1) {
if (my_strncmp(line, "layer", 5) == 0)
count += 1;
Expand Down
2 changes: 1 addition & 1 deletion src/map/load_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ layer_t **load_layer(const char *pathfile, map_object_t **map_object)
char *line = NULL;
size_t len = 0;
int index = 0;
size_t read_size = 0;
int read_size = 0;
while ((read_size = getline(&line, &len, fp)) != -1) {
line[read_size - 1] = '\0';
if (my_strncmp(line, "layer", 5) == 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/map/load_manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ map_object_t **load_object(const char *pathfile)
FILE *fp = fopen(pathfile, "r");
char *line = NULL;
size_t len = 0;
size_t read_size = 0;
int read_size = 0;
while ((read_size = getline(&line, &len, fp)) != -1) {
line[read_size - 1] = '\0';
if (my_strncmp(line, "maps", 4) == 0)
Expand All @@ -40,7 +40,7 @@ map_t **load_map(const char *pathfile, map_object_t **map_object)
char *line = NULL;
size_t len = 0;
int index = 0;
size_t read_size = 0;
int read_size = 0;
while ((read_size = getline(&line, &len, fp)) != -1) {
line[read_size - 1] = '\0';
if (my_strncmp(line, "maps", 4) == 0) {
Expand Down
7 changes: 3 additions & 4 deletions src/map/load_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ static int get_map_size(const char *pathfile)
return no;
}

static tile_t **load_tile_line(map_object_t **map_object, char *line, int index,
int size)
static tile_t **load_tile_line(map_object_t **map_object, char *line, int index)
{
char **array = split(line, ',');
tile_t **tile = malloc(sizeof(tile_t *) * (len_array(array) + 1));
int i = 0;
while (array[i] != NULL) {
tile[i] = create_tile(my_atoi(array[i]), map_object,
(sfVector2i){i, index}, (sfVector2i){len_array(array), size});
(sfVector2i){i, index});
i += 1;
}
tile[i] = NULL;
Expand Down Expand Up @@ -58,7 +57,7 @@ int load_tile(layer_t *layer, const char *pathfile, map_object_t **map_object)
int read_size = 0;
while ((read_size = getline(&line, &len, fp)) != -1) {
line[read_size - 1] = '\0';
layer->layer[index] = load_tile_line(map_object, line, index, size);
layer->layer[index] = load_tile_line(map_object, line, index);
index += 1;
}
layer->layer[index] = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/particle_engine/add_particle.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static particle_t *init_particle(sfVector2f position, sfVector2f size,
if (isometric == sfFalse)
particle->position = position;
else
particle->position = get_isometric_pos(position, size);
particle->position = get_isometric_pos(position);
return (particle);
}

Expand Down

0 comments on commit 77e4d6d

Please sign in to comment.