Path: chuka.playstation.co.uk!news From: "Derek da Silva" Newsgroups: scee.yaroze.freetalk.english Subject: Re: BG Maps Date: Mon, 12 Mar 2001 11:56:16 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 145 Message-ID: <98idjo$eo92@www.netyaroze-europe.com> References: <98h41o$7i11@www.netyaroze-europe.com> NNTP-Posting-Host: usr830-haw.cableinet.co.uk Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0088_01C0AAEB.71C13DA0" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 This is a multi-part message in MIME format. ------=_NextPart_000_0088_01C0AAEB.71C13DA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi These might be useful - both progs use the BG functions. www.netyaroze-europe.com/~shaughnj/ftp/bgedit.zip www.netyaroze-europe.com/~shaughnj/ftp/bgview.zip Or, you can avoid using the lib function and use something similar to = this : u_long scrolly, scrollx; // map scroll offsets u_char bg_data[NTILEH][NTILEW]; tile.w =3D 16; tile.h =3D 16; void draw_bg(void) { u_long x, y, mx, my, ox, oy; =20 ox =3D scrollx & 15; oy =3D scrolly & 15; =20 =20 for (y=3D0, my=3Dscrolly>>4; y<=3D8; y++, my++)=20 { tile.y =3D (y<<4)-oy; for (x=3D0, mx=3Dscrollx>>4; x<=3D20; x++, mx++) { tile.x =3D (x<<4)-ox; tile.u =3D (bgdata[my][mx]%16)<<4; tile.v =3D (bgdata[my][mx]/16)<<4; =20 GsSortFastSprite(&tile,&WorldOT,0); } } } cheers Derek ------=_NextPart_000_0088_01C0AAEB.71C13DA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi
 
These might be useful - both progs use the BG functions.
 
www.net= yaroze-europe.com/~shaughnj/ftp/bgedit.zip
www.net= yaroze-europe.com/~shaughnj/ftp/bgview.zip
 
Or, you can avoid using the lib function and use = something similar=20 to this :
 
 
u_long scrolly, scrollx; // map = scroll=20 offsets
u_char = bg_data[NTILEH][NTILEW];
 
tile.w =3D 16;
tile.h =3D 16;
 
void draw_bg(void)
{
    u_long x, y, mx, = my, ox,=20 oy;  
 
    ox =3D scrollx = &=20 15;
    oy =3D scrolly = &=20 15;       
    =   
   =20 for (y=3D0, my=3Dscrolly>>4; y<=3D8; y++, = my++) 
   =20 {
        = tile.y =3D=20 (y<<4)-oy;
 
        for=20 (x=3D0, mx=3Dscrollx>>4; x<=3D20; x++, mx++)
        = {
          &nbs= p; tile.x=20 =3D (x<<4)-ox;
 
          &nbs= p; tile.u=20 =3D (bgdata[my][mx]%16)<<4;
        =     tile.v =3D (bgdata[my][mx]/16)<<4;  =
 
        =     = GsSortFastSprite(&tile,&WorldOT,0);
 
        = }
    }
}
 
cheers
Derek
------=_NextPart_000_0088_01C0AAEB.71C13DA0--