Mail Archives: djgpp/1998/08/12/04:31:05
On 11 Aug 1998, Cephaler wrote:
> still doesn't work, not it's a sigsegv, and rhide is pointing at a
> perfectly legitimate line of code..
>
> blit(tiles[map[x][y]->tile],screen,0,0,x*32,y*32,32,32)
Please always post the traceback printed when it crashes.
The most probable cause of the crash is that either map[x][y]->tile is
garbled, or tiles[] is garbled or a NULL pointer.
Is map[x][y]->tile really an index? You didn't tell, but it could be
that map[x][y]->tile is already a pointer to the tile, so you don't
need to index tiles[] with it.
> so I changed it
>
> blit(tiles[&map[x][y]->tile],screen,0,0,x*32,y*32,32,32)
This will never work. You are using a pointer (an address of
map[x][y]->tile) as an index into an array.
> typedef struct {
> unsigned char tile,tag;
> } _tile;
It is usually a bad idea to use names with leading underscores. ANSI
C says that these names are reserved for the library, so you could get
a conflict.
- Raw text -