Hi, it’s me again,
I try to build SDL_mixer with CodeWarrior on Mac.
I’ve resolved several #include problems but there are 3 more left
and I don’t know what is the best way to get rid of them.
These are;
Error : function has no prototype
mdriver.c line 222 if (!(strcasecmp(alias,cruise->Alias))) break;
2)
Error : undefined identifier 'ENOENT’
common.c line 129 if (noise_mode && (errno != ENOENT))
3)
Error : undefined identifier 'ENOENT’
common.c line 151 if (noise_mode && (errno != ENOENT))
thanks in advance !
Masahiro Minami
@Masahiro_Minami
------------------------------------ sent by Cyberdog
PowerMac G3/233/DT
MacOS 9
LinuxPPC
exception handling : www2.age.ne.jp/~except
Received: from [63.80.144.66] (helo=mail.lokigames.com)
by roboto.devolution.com with esmtp (Exim 3.01 #1)
id 13fb7i-0004UD-00
for slouken at devolution.com; Sat, 30 Sep 2000 21:53:14 -0700
Received: (from majordom at localhost)
by mail.lokigames.com (8.9.3/8.9.3) id VAA18999
for sdl-outgoing; Sat, 30 Sep 2000 21:41:16 -0700
X-Authentication-Warning: mail.lokigames.com: majordom set sender to owner-sdl at lokigames.com using -f
Received: from polgara.xwing.org (HSE-Kitchener-ppp84700.sympatico.ca [216.209.97.15])
by mail.lokigames.com (8.9.3/8.9.3) with ESMTP id VAA18996
for ; Sat, 30 Sep 2000 21:41:09 -0700
Received: from matt by polgara.xwing.org with local (Exim 3.16 #1 (Debian))
id 13fbsm-0004aX-00
for ; Sun, 01 Oct 2000 00:41:52 -0500Date: Sun, 1 Oct 2000 00:41:52 -0500
From: mbusigin@amber.org.uk (Matt Busigin)
To: sdl at lokigames.com
Subject: Re: [SDL] Game scrolling summary
Message-ID: <20001001004152.A13762 at polgara.xwing.org>
References: <20001001030527.10251.qmail at web106.yahoomail.com>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
protocol=“application/pgp-signature”; boundary="cNdxnHkX5QqsyA0e"
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <20001001030527.10251.qmail at web106.yahoomail.com>; from gemcomps at yahoo.com on Sat, Sep 30, 2000 at 08:05:27PM -0700
Sender: owner-sdl at lokigames.com
Precedence: bulk
Reply-To: sdl at lokigames.com
Status: R
–cNdxnHkX5QqsyA0e
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Sat, Sep 30, 2000 at 08:05:27PM -0700, GEM Products wrote:
I’ve seen a few posts with different ways of scrolling
in a game. I was just wondering if someone had some
SDL source code, that they had gotten to work. Thanks.
Also, any chance of a SDL_Scroll Library?
What exactly do you need to scroll? What is so difficult about scrolling?=
=20
Do you want to tile a surface onto your screen over and over, and give an
illusion of movement by having the tiles ‘scroll’?
Hypothetic variables: ‘background’ is your background surface that you want
to tile onto the screen. ‘player.x’ and ‘player.y’ are your virtual game
co-ordinates.
for ( y =3D -(background->h); y < screen->h + background->h; y +=3D backgro=
und->h )
{
for ( x =3D 0; x < screen->w + background->w; x +=3D background->w )
{
SDL_Rect src, dst;
src.x =3D player.x % background->w;
src.y =3D player.y % background->h;
src.w =3D background->w;
src.h =3D background->h;
dst.x =3D player.x % background->w;
dst.y =3D player.h % background->h;
dst.w =3D background->w;
dst.h =3D background->h;
=09
SDL_BlitSurface( background, &src, screen, &dst );
}
}
Do you want your sprites to ‘scroll’ along? Convert game co-ordinates into
real (relational) co-ordinates from the player to the sprite, and display.
for ( scan =3D sprites; scan; scan =3D scan->next )
{
int rx, ry;
SDL_Rect src, dst;
rx =3D player.x - scan->x;
ry =3D player.y - scan->y;
src.x =3D 0;
src.y =3D 0;
src.w =3D scan->surface->w;
src.h =3D scan->surface->h;
=09
dst.x =3D rx;
dst.y =3D ry;
dst.w =3D src.w;
dst.h =3D src.h;
SDL_BlitSurface( scan->surface, &src, screen, &dst );
}
You probably want to add your own ‘see if it actually is going to be
displayed’ code, too, instead of relying on clipping.
The way you perform scrolling is so game architecture dependent, I can’t see
how a SDL_Scroll library could be created.
Cheers,
Matt
–cNdxnHkX5QqsyA0e
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE51s6gWMzNAStvkcwRAgYGAKCQ5Na/xC/IaD/8vuyxQPcKNC6yzQCfUQr/
gqVLLk2+ijpzX37bUs19kaI=
=Fc4J
-----END PGP SIGNATURE-----
–cNdxnHkX5QqsyA0e–