Commit Graph

3104 Commits

Author SHA1 Message Date
Sam Lantinga
d7affbbbaa Fixed bug #843
Fixed colorkey comparison for 24 bits-per-pixel modes
2009-12-17 05:57:37 +00:00
Sam Lantinga
be4c0844af Implemented 64-bit version of cpuid code 2009-12-17 04:01:29 +00:00
Sam Lantinga
4a157f0629 Added support for querying the number of CPUs available on Linux. This also happens to work on Mac OS X. 2009-12-17 03:04:04 +00:00
Ryan C. Gordon
61382a9f93 Initial band-aids on SDL_GetMouseState() API breakage. More work to come.
Fixes Bugzilla #758.
2009-12-16 19:50:51 +00:00
Sam Lantinga
c7df2f4089 Fixed cpuid assembly to work on PIC code 2009-12-16 16:42:04 +00:00
Sam Lantinga
438cca0d46 Allocate memory only if we're going to overwrite an environment variable 2009-12-16 16:08:17 +00:00
Ryan C. Gordon
66f3dfdcab Updated svn:ignore. 2009-12-16 11:03:38 +00:00
Ryan C. Gordon
f644ae86a9 Implemented SDL_setenv(), moved SDL_putenv() to compat.
Fixes Bugzilla #779.
2009-12-16 10:59:51 +00:00
Sam Lantinga
76f674f021 Implemented Windows version of SDL_GetCPUCount() 2009-12-16 08:17:05 +00:00
Sam Lantinga
dc1ed9e7ef Added SDL_GetCPUCount() to see how many cores are available. 2009-12-16 06:53:53 +00:00
Sam Lantinga
75e75ae0c3 Fixed bug #741
The thread ID is an unsigned long so it can hold pthread_t so people can do naughty things with it.

I'm going to be adding additional useful thread API functions, but this should prevent crashes in people's existing code on 64-bit architectures.
2009-12-16 04:48:11 +00:00
Sam Lantinga
1a0cbf83f1 Fixed bug #736
Don't use the SSE cache instruction in MMX code if SSE isn't available. :)
2009-12-16 03:02:31 +00:00
Sam Lantinga
b06c70e89d Added testfill to test raw fill performance 2009-12-16 02:08:59 +00:00
Sam Lantinga
e8d7dbce07 Nuffin' 2009-12-16 01:19:58 +00:00
Sam Lantinga
6484431a44 Fixed bug #685
Added missing keysym shortcuts
2009-12-16 01:06:48 +00:00
Sam Lantinga
587ab6b056 Fixed bug #666
Don't let the event queue overflow with resize events
2009-12-16 00:55:33 +00:00
Sam Lantinga
fbcae020cf Fixed bug #642
Gerry JJ      2008-11-09 02:11:49 PST

The SDL_MouseMotionEvent struct has a field named "tilt" (currently marked "for
future use"), for tablet stylus tilt information.  However, one value is not
enough for this, as tilt is two-dimensional.  Reserving only one field for
future use is no good when you're going to need two, so there should be two
fields, tilt_x and tilt_y.
2009-12-16 00:44:53 +00:00
Sam Lantinga
e250d2e0f5 Default to allow either accelerated or not 2009-12-15 20:53:09 +00:00
Sam Lantinga
0493dd19b1 OpenGL hardware acceleration defaults on 2009-12-15 20:36:31 +00:00
Sam Lantinga
a4cb5a9a72 Fixed bug #815
Daniele Forghieri      2009-10-12 02:57:03 PDT

Patch to use stdlib.h with Open Watcom

Open Watcom 1.8 has <stdlib.h> so instead of patch the single part when stdlib
features are used we use directly the include file as with GCC.
2009-12-15 20:14:50 +00:00
Sam Lantinga
d5f47bca6d Fixed bug #818
Daniele Forghieri      2009-10-12 02:52:02 PDT

Updated makefile & Doc for Open Watcom 1.8
2009-12-15 20:11:29 +00:00
Ryan C. Gordon
59ea17f263 Added a warning comment to SDL_putenv().
"Fixes" Bugzilla #779.
2009-12-15 18:00:16 +00:00
Sam Lantinga
fbbac023cd Fixed bug #905
Give the foreign window message proc more control over Windows events.

This may need to be adjusted when we add the capability for the app to specify whether it wants SDL to handle input for the window or not.
2009-12-15 09:20:10 +00:00
Sam Lantinga
1a1477bcc6 Fixed bug #906
Added better error reporting for OpenGL context creation failing.
2009-12-15 08:11:06 +00:00
Sam Lantinga
df50338fda Add a dummy function if SDL doesn't have STDIO support 2009-12-15 05:34:58 +00:00
Sam Lantinga
bb095c6df0 Added notes from e-mail on desktop window implementation 2009-12-15 02:16:01 +00:00
Sam Lantinga
708f44d4d1 Need to test the multi-draw APIs 2009-12-15 00:00:30 +00:00
Sam Lantinga
ceba80cfd0 Added svn checkout install step 2009-12-14 23:43:57 +00:00
Sam Lantinga
2ac49a53bd The SDL 1.3 tests have been cleaned up not to include any 1.2 compatibility code. 2009-12-14 23:29:37 +00:00
Sam Lantinga
1ee0e98c97 Implemented read/write pixels for the X11 renderer 2009-12-14 06:52:17 +00:00
Sam Lantinga
c49568972f Added a test to check the read/write pixels API 2009-12-14 06:35:59 +00:00
Sam Lantinga
ff38dae142 Added support for SDL_PIXELFORMAT_RGB24 and SDL_PIXELFORMAT_BGR24 to SDL_PixelFormatEnumToMasks() 2009-12-14 06:35:27 +00:00
Sam Lantinga
1f4190a259 Added a BLENDMODE_MASK pixel shader so render tests succeed 2009-12-14 04:19:00 +00:00
Sam Lantinga
9bf59c5687 The SDL_PaletteWatch structure is really internal-only. 2009-12-13 08:00:25 +00:00
Sam Lantinga
ed8e1e54ad Name the audio callback for documentation clarity. 2009-12-13 06:21:22 +00:00
Sam Lantinga
5edd3788ef Note that the WritePixels call is unsupported right now. 2009-12-13 06:19:32 +00:00
Sam Lantinga
db0f3081da Fixed windows.h include 2009-12-13 05:37:06 +00:00
Sam Lantinga
cbdba43759 Fixed line drawing for D3D 2009-12-12 20:31:28 +00:00
Sam Lantinga
4f4f40f930 Minor documentation fix 2009-12-12 20:30:25 +00:00
Sam Lantinga
8306adb559 Finished implementing RenderReadPixels() 2009-12-12 04:01:40 +00:00
Sam Lantinga
d423bfa8a8 Removed the obsolete testcdrom target 2009-12-12 01:04:57 +00:00
Sam Lantinga
159e0ed15f Fixed building on iPhone 2009-12-12 00:55:13 +00:00
Sam Lantinga
d3941d1098 Allow points to be outside the window bounds, stress testing the clipping code. 2009-12-12 00:08:45 +00:00
Sam Lantinga
a127883a56 Added mouse position for button handling 2009-12-12 00:08:02 +00:00
Sam Lantinga
1ab0809779 minor notes to self 2009-12-12 00:07:26 +00:00
Sam Lantinga
54af8f9682 Fixed X11 line implementation - clip lines that are going to go outside the window. 2009-12-11 09:59:36 +00:00
Sam Lantinga
c0e3ce55fd Make sure we fully clip the first point before starting to adjust the second point. 2009-12-11 09:57:54 +00:00
Sam Lantinga
0a3768436b Added an automated test for rectangle routines, currently only testing line clipping.
Use the Cohen-Sutherland algorithm for line clipping which uses integer math and preserves ordering of clipped points.

Removed getopt() support in testsdl.c, replaced with simple argv scanning.
2009-12-11 09:22:34 +00:00
Sam Lantinga
862fd5857b Fixed constness in RenderRects() parameter 2009-12-11 09:13:51 +00:00
Sam Lantinga
e053affd71 Fixed bug #896
John Popplewell      2009-12-08 23:05:50 PST

Originally reported by AKFoerster on the mailing list.

Error decoding UTF8 Russian text to UTF-16LE on Windows, but specifically on
platforms without iconv support (the default on Windows).

Valid UTF8 characters are flagged as being overlong and then substituted by the
UNKNOWN_UNICODE character.

After studying the testiconv.c example program, reading the RFCs and putting
some printf statements in SDL_iconv.c the problem is in a test for 'Maximum
overlong sequences', specifically 4.2.1, which is carried out by the following
code:

      } else if ( p[0] >= 0xC0 ) {
        if ( (p[0] & 0xE0) != 0xC0 ) {
          /* Skip illegal sequences
            return SDL_ICONV_EILSEQ;
          */
          ch = UNKNOWN_UNICODE;
        } else {
          if ( (p[0] & 0xCE) == 0xC0 ) {    <<<<<<<< here
            overlong = SDL_TRUE;
          }
          ch = (Uint32)(p[0] & 0x1F);
          left = 1;
        }
      } else {

Here is the 2-byte encoding of a character in range 00000080 - 000007FF
    110xxxxx 10xxxxxx

The line in question is supposed to be checking for an overlong sequence which
would be less than
    11000001 10111111

which should be represented as a single byte.

BUT, the mask value (0xCE) is wrong, it isn't checking the top-most bit:
    11000001     value
    11001110     mask (incorrect)
       ^
and should be (0xDE):
    11000001     value
    11011110     mask (correct)

making the above code:

      } else if ( p[0] >= 0xC0 ) {
        if ( (p[0] & 0xE0) != 0xC0 ) {
          /* Skip illegal sequences
            return SDL_ICONV_EILSEQ;
          */
          ch = UNKNOWN_UNICODE;
        } else {
          if ( (p[0] & 0xDE) == 0xC0 ) {    <<<<<<<< here
            overlong = SDL_TRUE;
          }
          ch = (Uint32)(p[0] & 0x1F);
          left = 1;
        }
      } else {

I can supply a test program and/or a patch if required,

best regards,
John Popplewell
2009-12-11 08:03:43 +00:00