Segmentation Fault?
Posted: Sun Mar 16, 2008 10:28 pm
Hi,
I'm rewriting the 2D rendering engine for my Action-RPG and I just ran into a pretty tough segmentation fault.
I'm not 100% sure which line is causing the segmentation fault, but I think it's the line.
Everything is initialized properly (as far as I can tell, anyway.)
If somebody could point out my error, it'd be much appreciated.
Thanks,
-KG_Brad
EDIT: For some reason the code box is modifying the actual source. PM me if you think you could help and I'll send you the actual source.
I'm rewriting the 2D rendering engine for my Action-RPG and I just ran into a pretty tough segmentation fault.
Code: Select all
int render_tile(int x,int y,BITMAP *img)
{
draw_sprite(scroll,img,x,y);
return 0;
}
int render_map(int mapnum)
{
int i,t;
int tilecount;
for (i=0;i<MAXWIDTH;++i)
{
for (t=0;t<MAXHEIGHT;++t)
{
for (tilecount=0;tilecount<MAXTILES>tilemap[i][t];
if (tilemap[i][t] == 1)
{
tile[tilecount]->x = t*32;
tile[tilecount]->y = i*32;
render_tile(tile[tilecount]->x,tile[tilecount]->y,tile_img[0]);
}
}
}
return 0;
}
Code: Select all
render_tile(tile[tilecount]->x,tile[tilecount]->y,tile_img[0]);
Everything is initialized properly (as far as I can tell, anyway.)
If somebody could point out my error, it'd be much appreciated.
Thanks,
-KG_Brad
EDIT: For some reason the code box is modifying the actual source. PM me if you think you could help and I'll send you the actual source.