From: "Andrei 'old boy' Ellman" Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro BITMAP Date: Wed, 22 Oct 1997 03:02:56 +0100 Organization: Heslington Toast Parlour, Yorkshire Message-ID: <344D5ED0.5F04B683@xs4all.nl> References: <62dp2e$72b AT bgtnsc02 DOT worldnet DOT att DOT net> <344AC0B5 DOT 7CC8 AT cam DOT org> NNTP-Posting-Host: asd17-12.dial.xs4all.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 38 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Vic wrote: > > JASON MEEHAN wrote: > > > > Ok, heres what I'm trying to do. I need to convert a different type of > > bitmap to allegros type so that I can use allegros graphic routines. > > > > unsigned char *oldbitmap; /*this points to graphic data in 8x8tiles*/ > > BITMAP *newbitmap; /**** allegro bitmap type ******/ > > .... > > ...... > > newbitmap =create_bitmap(8,8); > > > > newbitmap.*dat=*oldbitmap; > the bitmap structure contains the data as > unsigned char line[x][y]; > so you say > > newbitmap->line[0]=oldbitmap; This only sets the first line of your BITMAP to the first line of thr oldbitmap. You need to set the other lines as well as the data pointer. newbitmap->line[0]=oldbitmap; newbitmap->line[1]=oldbitmap+8; [...] newbitmap->line[6]=oldbitmap+48; newbitmap->line[7]=oldbitmap+56; newbitmap->dat=oldbitmap; AE. -- Andrei Ellman - URL: http://www.xs4all.nl/~ellman/ae-a - ae1 AT york DOT ac DOT uk "All I wanna do is have some fun :-) || ae-a AT minster DOT york DOT ac DOT uk I've got the feeling I'm not the only one" || mailto:ellman AT xs4all DOT nl -- Sheryl Crow :-) || It's what you make of it.