set/unset on map

This commit is contained in:
Kolomiets Yaroslav 2016-12-14 13:33:54 +02:00
parent 858b0ea8bb
commit 1f4a66128f

View file

@ -63,3 +63,40 @@ t_map *map_initialization(char **tetramino_table)
clear_map(map);
return (map);
}
void insert_tetramino(t_map *map, int index)
{
int i;
int k;
t_tetraminos *temp;
temp = map->figure[index];
i = temp->offset_y;
k = i + 4;
while (i < k)
{
map->line[i] |= temp->line[i];
i++;
}
}
void erase_tetramino(t_map *map, int index)
{
int i;
int k;
t_tetraminos *temp;
temp = map->figure[index];
i = temp->offset_y;
k = 0;
while (k < 4)
{
map->line[i + k] ^= temp->line[i + k];
k++;
}
}
void algorithm(t_map *map)
{
}