Path: chuka.playstation.co.uk!news From: "Rad" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Filling the screen with boxes Date: Wed, 30 Dec 1998 20:49:32 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 128 Message-ID: <76e75b$qsh7@chuka.playstation.co.uk> References: <762se1$2296@chuka.playstation.co.uk> <368741BC.84356107@hinge.mistral.co.uk> NNTP-Posting-Host: modem-108.ketamine.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_004B_01BE3435.E6FE7760" X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 This is a multi-part message in MIME format. ------=_NextPart_000_004B_01BE3435.E6FE7760 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Craig Graham wrote in message <368741BC.84356107@hinge.mistral.co.uk>... > where it belongs ;-) >// Shiney New Code Segment does it the right way..... Shiney New Code Segment does it another way - though there is no one = right way! >#define BOX_WH 4 =20 why restrict the box to having the same size width and height? >void boxes(void) >{ > GsBOXF box; // One box & re-use it (make it local as well to = save more >memory) > > // setup bit's that are constant outside the loop > box.r =3D box.g =3D .b =3D 255; // colour =3D white > box.w =3D box.h =3D BOX_WH; // size of BOX_WH x BOX_WH > > // Generate the display by re-using the single GsBOXF structure > for (box.y =3D 0; box.y< 240; box.y+=3DBOX_WH) > { > for (box.x =3D 0; box.x < 320; box.x+=3DBOX_WH) > GsSortBoxFill(&box, &WorldOT[acvtiveBuffer],0); > } >} > >> >> Rad. > >Craig. > =20 Nice loops though! =20 Happy New Year, Rad. rad@cyberdude.com http://www.netyaroze-europe.com/~radpsx ------=_NextPart_000_004B_01BE3435.E6FE7760 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Craig Graham wrote in message <368741BC.84356107@h= inge.mistral.co.uk>...
><SNIP - dodgy code segment hit's the trash can>
 
where it belongs ;-)

>// Shiney New Code Segment does it = the=20 right way.....
 
Shiney New Code Segment does it another way - = though there=20 is no one right way!

>#define BOX_WH    4
 
why restrict the box to having = the same=20 size width and height?

>void = boxes(void)
>{
>    GsBOXF=20 box;    // One box & re-use it (make it local as well = to save=20 more
>memory)
>
>    // setup bit's = that are=20 constant outside the loop
>    box.r =3D box.g =3D = .b =3D=20 255;    // colour =3D white
>    = box.w =3D box.h=20 =3D BOX_WH;    // size of BOX_WH x=20 BOX_WH
>
>    // Generate the display by = re-using the=20 single GsBOXF structure
>    for (box.y =3D 0; = box.y< 240;=20 box.y+=3DBOX_WH)
>    = {
>     =20 for (box.x =3D 0; box.x < 320;=20 box.x+=3DBOX_WH)
>       =20 GsSortBoxFill(&box,=20 &WorldOT[acvtiveBuffer],0);
>   =20 }
>}
>
>>
>>=20 Rad.
>
>Craig.
>
 
Nice loops = though!
 
Happy New = Year,
 
Rad.
rad@cyberdude.com
http://www.netyaroze-eur= ope.com/~radpsx
------=_NextPart_000_004B_01BE3435.E6FE7760--