Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » allegro 4.4.2 draw_sprite not working properly

This thread is locked; no one can reply to it. rss feed Print
allegro 4.4.2 draw_sprite not working properly
douglas yamasaki
Member #16,871
July 2018

I`m trying to print a array in allegro with this code:

for (i=0;i<LINES;i++){
for (j=0;j<COLUMS;j++){
if (maze[i][j] == '*')
draw_sprite(labirinto,parede,j*20,i*20);
else if (maze[i][j] == 's')
draw_sprite (labirinto,saida,j*20,i*20);
else if (maze [i][j] == ' ')
draw_sprite(labirinto,chao,j*20,i*20);
}
}

draw_sprite (buffer,labirinto,0,0);
draw_sprite (screen,buffer,0,0);

it was working for lines = 30 , colums = 30 , but when i changed to 30 lines and 40 colums it only render a 30x30.

if this helps :
BITMAP *buffer = create_bitmap(LINES*20,COLUMS*20);
BITMAP *labirinto = create_bitmap(LINES*20,COLUMS*20);

each bitmap "saida" "chao" "parede" have 20 x 20 px

https://prnt.sc/k1dn5r -> print of the image result. (theres no interference with next drawnings , only that doesnt work

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: