delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/26/12:42:43

From: Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help again. Heh dont you just hate newbies? <grin>
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <bnaeqssvltcjcj66c8pk6plpgb1pdnavjv@4ax.com>
References: <20000825225449 DOT 19275 DOT qmail AT web514 DOT mail DOT yahoo DOT com>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 23
X-Trace: /Kp2lrp4Gm5ZBQQIVf7NZqPAXxAZFTPhznsoZMQZEGq8uDaemOWWj8Kr+6770pwHZdPlWXO6NaZZ!tENqir1j8wMs+EbpDC0BSIdoxwZ8LAg0x5skHkVI3UiS9GqeFZ5W65gdFPVxSe2EGG8LelLPNUwX!8E8B
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Sat, 26 Aug 2000 02:29:04 GMT
Distribution: world
Date: Sat, 26 Aug 2000 02:29:04 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Fri, 25 Aug 2000 15:54:49 -0700 (PDT), Chris Amos
<homie_dont_play_dat AT yahoo DOT com> wrote:

>YES! Thats what I want to do. Dynamic allocation! But how do I
>Dynamicly allocate a 2 dimensional array. It would be preferable to do
>so because I could aviod the x*y+x math. If you know what I mean.

Here's what Allegro does for bitmaps:  malloc() enough space for your
control structure, pointers to each row, and the data itself.  Then,
after you fill the control structures and row pointers, you can access
tilemap->row[][] as if it were a simple 2D array which would be
compiled as (tilemap->row[y])[x].  Look at create_bitmap() in Allegro
source for more info on this technique.

Some developers simply use their libraries' bitmaps for their tilemaps
(each pixel is one tile).

-- 
tiddly-day interj. (used to express agreement.)
  [American cellphone lingo]

This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses.  http://www.mcafee.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019