CVS Update (24 bpp YUV support)

The latest CVS snapshot is now available:
http://www.libsdl.org/cvs.html

Improvements for the SDL 1.2 release:

  • 1.2.0: Added 24 bpp support to software YUV display functions
  • 1.2.0: Incorporated Darrell’s latest CodeWarrior projects
  • 1.2.0: Cooperate with the Mac SIOUX console (thanks Hans)
  • 1.2.0: Fixed double-buffering DGA with offset video modes
  • 1.2.0: Clear entire video memory when setting video mode
  • 1.2.0: Fix optimization related crash with assembly blitters
  • 1.2.0: Don’t generate an event for initial X11 key state
  • 1.2.0: Fix problems building with newer versions of nasm
  • 1.2.0: Don’t bomb trying to get DGA mouse on XFree86 4.0
  • 1.2.0: Fix building framebuffer console driver with -O0

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

This is a multi-part message in MIME format.
--------------E3EF674E0BD8B2D0C4D58A5D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Sam Lantinga wrote:

Improvements for the SDL 1.2 release:

  • 1.2.0: Fix optimization related crash with assembly blitters

Hmm, FillRect doesn’t crash anymore, but FillRect or BlitSurface doesn
draw anymore 1 pixel surfaces it seems …

The attached routine draws nothing when I call it to draw pixels
onto the screen (i.e. ‘dst’ is ‘screen’). This used to work fine with
ver 1.1.7.
(Setup: CVS SDL, Mandrake72, 16bpp/Xfree402/MatroxG450)

The test programs that use FillRect seem to work fine. Any ideas?

Ciao
Andreas–
| Andreas Schiffler aschiffler at home.com |
| Senior Systems Engineer - Deskplayer Inc., Buffalo |
| 4707 Eastwood Cres., Niagara Falls, Ont L2E 1B4, Canada |
| +1-905-371-3652 (private) - +1-905-371-8834 (work/fax) |

--------------E3EF674E0BD8B2D0C4D58A5D
Content-Type: text/plain; charset=us-ascii;
name="pixel.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename=“pixel.c”

/* ----- Pixel - using single pixel blit with blending enabled. */

static SDL_Surface *gfxPrimitivesSinglePixel=NULL;

int pixelColor (SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color)
{
SDL_Rect srect;
SDL_Rect drect;
int result;

/* Setup source rectangle for pixel */
srect.x=0;
srect.y=0;
srect.w=1;
srect.h=1;

/* Setup destination rectangle for pixel */
drect.x=x;
drect.y=y;
drect.w=1;
drect.h=1;

/* Create single pixel from destination surface format and add alpha channel to it */
if (gfxPrimitivesSinglePixel==NULL) {
gfxPrimitivesSinglePixel=SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_HWSURFACE | SDL_SRCALPHA, 1, 1, 32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);
SDL_SetAlpha (gfxPrimitivesSinglePixel, SDL_SRCALPHA, 255);
}

/* Draw color into pixel*/
SDL_FillRect (gfxPrimitivesSinglePixel, &srect, color);

/* Draw pixel onto destination surface */
result=SDL_BlitSurface (gfxPrimitivesSinglePixel, &srect, dst, &drect);

return(result);
}

/* Alpha weight the colors for AA-drawing */

int pixelColorWeight (SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color, Uint32 weight)
{
Sint32 r,g,b,a;

r=((color >> 24) & 255);
g=((color >> 16) & 255);
b=((color >> 8) & 255);
a=(color & 255);

/* Modify Alpha by weight */
a -= weight;
if (a<0) a=0;

pixelColor (dst,x,y,((Uint32)r << 24) | ((Uint32)g << 16) | ((Uint32)b << 8) | (Uint32)a);
}

int pixelRGBA (SDL_Surface dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
{
/
Draw */
return(pixelColor (dst, x, y, ((Uint32)r << 24) | ((Uint32)g << 16) | ((Uint32)b << 8) | (Uint32)a ));
}

--------------E3EF674E0BD8B2D0C4D58A5D–

Hmm, FillRect doesn’t crash anymore, but FillRect or BlitSurface doesn
draw anymore 1 pixel surfaces it seems …

Argh… Why did you “fix” things, Yorick?
I’m thinking about reverting the FillRect code to 1.1.7 unless you have
a good reason not to.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Argh… Why did you “fix” things, Yorick?
I’m thinking about reverting the FillRect code to 1.1.7 unless you have
a good reason not to.

the code is cleaner and faster now, and if this is a bug then reverting is
not the answer. Andreas Schiffler, can you put together a complete program?

btw, I’m unabled to reproduce any 1x1 FillRect bug even on an x86.
a test program is at ftp://ptah.lnf.kth.se/pub/misc/rect.c; if you
can modify it to get erroneously behaviour then tell me how

On Thu Feb 22, 2001 at 08:20:23PM +0100, the boisterous
Mattias Engdeg?rd
wrote to me:

btw, I’m unabled to reproduce any 1x1 FillRect bug even on an x86.
a test program is at ftp://ptah.lnf.kth.se/pub/misc/rect.c; if you
can modify it to get erroneously behaviour then tell me how

I needed no modification %-(

gdb:
Program received signal SIGSEGV, Segmentation fault.
0x4003db63 in SDL_FillRect () at SDL_surface.c:618
618 }

latest cvs sdl
nvidia tnt drivers
linux 2.2.16
glibc 2.1.3
xfree86 4.0
p-2–


/\ Obviously we do not want to leave zombies around.
( ^ > - W. Richard Stevens
/ \
(
/)

oh, i forgot the segfault line:
if(!s)
sdlerr(“CreateRGBSurface”);
SDL_SetAlpha(s, SDL_SRCALPHA, 255); <--------
if(SDL_FillRect(s, NULL, 0xff000080) < 0)
sdlerr(“FillRect”);

for(i = 0; i < 16; i++) {-- 

/\ Obviously we do not want to leave zombies around.
( ^ > - W. Richard Stevens
/ \
(
/)

I needed no modification %-(

Are you using today’s CVS snapshot?
http://www.libsdl.org/cvs.html

Make sure you remove any old versions of SDL you may have around
before you install this, just to make sure you aren’t running into
a bug that has already been fixed.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

On Thu Feb 22, 2001 at 04:52:03PM -0800, the boisterous
Sam Lantinga
wrote to me:

I needed no modification %-(

Are you using today’s CVS snapshot?
http://www.libsdl.org/cvs.html

I’m sure I had the latest snapshot (I’m a frequently “cvs -z3 up -d” - guy :wink:
But I rm the SDL dir and checkouted a new repository, and voila, it works %-).

But how could this be?

Make sure you remove any old versions of SDL you may have around
before you install this, just to make sure you aren’t running into
a bug that has already been fixed.

There is no bug, only my SDL cvs version was wrong :frowning:

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

So long
Thomas–


/\ Obviously we do not want to leave zombies around.
( ^ > - W. Richard Stevens
/ \
(
/)

There is no bug, only my SDL cvs version was wrong :frowning:

sorry, please disregard my previous mail then

oh, i forgot the segfault line:
if(!s)
sdlerr(“CreateRGBSurface”);
SDL_SetAlpha(s, SDL_SRCALPHA, 255); <--------
if(SDL_FillRect(s, NULL, 0xff000080) < 0)
sdlerr(“FillRect”);

for(i = 0; i < 16; i++) {

your previous mail claimed the segfault was in SDL_FillRect. Please give
the exact crash location inside SDL_FillRect (make sure SDL is compiled
with debug info), include a stack trace and please give some asm context
and register data

this was with the latest CVS SDL and the fix in SDL_memops.h, right?