SDL 1.2.9: last call

Ok, we’re getting ready to package up an official SDL 1.2.9, based on
CVS. The hope is to do this in about a week…so if you have an
outstanding patch that hasn’t made it into CVS, or some code you want to
evangelize, please email me directly.

Even if you think that I definitely have your patch, please email it to
me again, just to make sure I’ve got the latest.

If you are making commits to CVS (like, say, our really prolific Atari
maintainers!), please don’t commit anything big before 1.2.9 is
shipped…just bug fixes this week, or the official release may go out
mangled.

If you have a big patch that SHOULD be in CVS but isn’t, don’t be
offended if it doesn’t go into 1.2.9…we all saw that I screwed up the
10 line Win95 patch on the first shot, so the less we change CVS in the
next week, the better. Please make me aware of the patch anyhow, though,
so Sam and I can see if it’s reasonable to squeeze in there.

Thanks,
–ryan.

Le Tue, 16 Aug 2005 00:42:06 -0400
"Ryan C. Gordon" a ?crit:

If you are making commits to CVS (like, say, our really prolific Atari
maintainers!), please don’t commit anything big before 1.2.9 is
shipped…just bug fixes this week, or the official release may go out
mangled.

OK, I just made a very small commit this morning, it should be the last.
I will now wait after 1.2.9 release…

If you have a big patch that SHOULD be in CVS but isn’t, don’t be
offended if it doesn’t go into 1.2.9…we all saw that I screwed up the
10 line Win95 patch on the first shot, so the less we change CVS in the
next week, the better. Please make me aware of the patch anyhow, though,
so Sam and I can see if it’s reasonable to squeeze in there.

Now, what will be out first, sdl 1.2.9 or q3a sources ?–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

Duke Nukem Forever.On Tuesday 16 August 2005 06:00 am, Patrice Mandin wrote:

Now, what will be out first, sdl 1.2.9 or q3a sources ?


Patrick “Diablo-D3” McFarland || pmcfarland at downeast.net
"Computer games don’t affect kids; I mean if Pac-Man affected us as kids, we’d
all be running around in darkened rooms, munching magic pills and listening to
repetitive electronic music." – Kristian Wilson, Nintendo, Inc, 1989
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050816/e6198082/attachment.pgp

Hi,

Here is a patch to support WinCE.
It allows smooth compilation of SDL on all WinCE compiler,
plus added hardware keys catching on Pocket PC.

http://www.activekitten.com/pbc_download/diff_wince_0.8.zip

It does not include GAPI driver and need some testing on other
platforms (for example gcc/linux).

So please consider inclusion of this patch in SDL 1.2.10.–
Best regards,
Dmitry Yakimov, ISDEF member
ActiveKitten.com

This fixes font handling to be thread-safe.

////////////////////////////////////////////////////////////////////////
diff -Naurd old/SDL_ttf.c new/SDL_ttf.c
— old/SDL_ttf.c 2005-01-24 16:11:26.000000000 -0500
+++ new/SDL_ttf.c 2005-01-24 16:28:21.000000000 -0500
@@ -90,6 +90,7 @@
struct _TTF_Font {
/* Freetype2 maintains all sorts of useful info itself */
FT_Face face;

  •   FT_Library library;
    
      /* We'll cache these ourselves */
      int height;
    

@@ -122,10 +123,7 @@
int font_size_family;
};

-/* The FreeType font engine/library */
-static FT_Library library;
-static int TTF_initialized = 0;
-static int TTF_byteswapped = 0;
+static int TTF_byteswapped;

/* UNICODE string utilities */
static inline int UNICODE_strlen(const Uint16 text)
@@ -205,21 +203,10 @@
#endif /
USE_FREETYPE_ERRORS */
}

+/* this exists only to maintain the ABI */
int TTF_Init( void )
{

  •   int status = 0;-
    
  •   if ( ! TTF_initialized ) {
    
  •           FT_Error error = FT_Init_FreeType( &library );
    
  •           if ( error ) {
    
  •                   TTF_SetFTError("Couldn't init FreeType engine", error);
    
  •                   status = -1;
    
  •           }
    
  •   }
    
  •   if ( status == 0 ) {
    
  •           ++TTF_initialized;
    
  •   }
    
  •   return status;
    
  •   return 0;
    

}

static unsigned long RWread(
@@ -245,11 +232,6 @@
FT_Stream stream;
int position;

  •   if ( ! TTF_initialized ) {
    
  •           TTF_SetError( "Library not initialized" );
    
  •           return NULL;
    
  •   }
    
  •   /* Check to make sure we can seek in this stream */
      position = SDL_RWtell(src);
      if ( position < 0 ) {
    

@@ -267,6 +249,13 @@
font->src = src;
font->freesrc = freesrc;

  •   FT_Error error = FT_Init_FreeType( &font->library );
    
  •   if ( error ) {
    
  •           TTF_SetFTError("Couldn't init FreeType engine", error);
    
  •           free( font );
    
  •           return NULL;
    
  •   }
    
  •   stream = (FT_Stream)malloc(sizeof(*stream));
      if ( stream == NULL ) {
              TTF_SetError( "Out of memory" );
    

@@ -275,7 +264,7 @@
}
memset(stream, 0, sizeof(*stream));

  •   stream->memory = library->memory;
    
  •   stream->memory = font->library->memory;
      stream->read = RWread;
      stream->descriptor.pointer = src;
      stream->pos = (unsigned long)position;
    

@@ -286,7 +275,7 @@
font->args.flags = FT_OPEN_STREAM;
font->args.stream = stream;

  •   error = FT_Open_Face( library, &font->args, index, &font->face );
    
  •   error = FT_Open_Face( font->library, &font->args, index, &font->face );
      if( error ) {
              TTF_SetFTError( "Couldn't load font file", error );
              TTF_CloseFont( font );
    

@@ -668,6 +657,7 @@
if ( font->freesrc ) {
SDL_RWclose( font->src );
}

  •   FT_Done_FreeType( font->library );
      free( font );
    

}

@@ -849,10 +839,6 @@
FT_UInt prev_index = 0;

    /* Initialize everything to 0 */
  •   if ( ! TTF_initialized ) {
    
  •           TTF_SetError( "Library not initialized" );
    
  •           return -1;
    
  •   }
      status = 0;
      minx = maxx = 0;
      miny = maxy = 0;
    

@@ -1735,14 +1721,10 @@

void TTF_Quit( void )
{

  •   if ( TTF_initialized ) {
    
  •           if ( --TTF_initialized == 0 ) {
    
  •                   FT_Done_FreeType( library );
    
  •           }
    
  •   }
    
  •   return;
    

}

int TTF_WasInit( void )
{

  •   return TTF_initialized;
    
  •   return 1;  // this is a don't-care value to satisfy the ABI
    

}

////////////////////////////////////////////////////////////////////////

Le Tue, 16 Aug 2005 00:42:06 -0400
"Ryan C. Gordon" a ?crit:

Ok, we’re getting ready to package up an official SDL 1.2.9, based on
CVS. The hope is to do this in about a week…so if you have an
outstanding patch that hasn’t made it into CVS, or some code you want
to evangelize, please email me directly.

Just a request about test subdirectory: the autotools files
(config.guess, config.sub, etc…) are a bit outdated, and I have to
update them for my cross-compilation party. So it would be nice to have
these updated.–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

Just a request about test subdirectory: the autotools files
(config.guess, config.sub, etc…) are a bit outdated, and I have to
update them for my cross-compilation party. So it would be nice to have
these updated.

Feel free to do so if it won’t break everything.

–ryan.

Le Thu, 18 Aug 2005 22:08:33 -0400
"Ryan C. Gordon" a ?crit:

Just a request about test subdirectory: the autotools files
(config.guess, config.sub, etc…) are a bit outdated, and I have to
update them for my cross-compilation party. So it would be nice to
have these updated.

Feel free to do so if it won’t break everything.

Well, just removing these files works, because then configure will use
those of SDL’s topdir. Could someone else check this, just to be sure?
i.e. remove config.guess, config.sub, install-sh and mkinstalldirs from
test subdir.–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

Well, just removing these files works, because then configure will use
those of SDL’s topdir. Could someone else check this, just to be sure?
i.e. remove config.guess, config.sub, install-sh and mkinstalldirs from
test subdir.

I removed them from CVS (and thus, for 1.2.9).

–ryan.

Here is a patch to support WinCE.
It allows smooth compilation of SDL on all WinCE compiler,
plus added hardware keys catching on Pocket PC.

http://www.activekitten.com/pbc_download/diff_wince_0.8.zip

Is there any chance that we can do this without adding SDLCALL to each
function definition? Is it not enough to have it in the headers? It
touches a lot of files and makes everything a little uglier, and will
probably keep going out of date as functions are added, so I’d rather
avoid it if at all possible. Other people have used SDL on PocketPC
without that, so is it really necessary? Let me know so I can get this
into CVS.

Thanks,
–ryan.

Albert Cahalan wrote:

This fixes font handling to be thread-safe.

Does this make it thread safe for two threads accessing the same font?
It looks like it just makes a seperate freetype library handle for each
font, which would possibly make it thread safe for two seperate fonts in
two threads.

Also, is freetype itself threadsafe, so long as you keep seperate
library handles for each thread? How expensive is it to initialize a
seperate library handle for each font? Is this valid use of the freetype
API, or just asking for trouble since they generally expected
applications to only initialize it once?

Sorry to ask so many questions, but I’m a little nervous about this
patch…I’m wondering if it might be better to just create a mutex in
TTF_Init() and serialize access where appropriate…

–ryan.

Sorry to ask so many questions, but I’m a little nervous about this
patch…I’m wondering if it might be better to just create a mutex in
TTF_Init() and serialize access where appropriate…

I agree here. Font code is not (shouldn’t be) loop critical, so a mutex
is probably a much better way to make this thread-safe.

Note that you still can’t generally make graphics calls from multiple threads,
so I’m curious why this even came up…

-Sam Lantinga, Software Engineer, Blizzard Entertainment