Commit Graph

2219 Commits

Author SHA1 Message Date
Sam Lantinga
05b3cdda94 Fixed compile error on Mac OS X 10.4 2010-01-18 14:12:29 +00:00
Sam Lantinga
c9cdb827a2 Fixed bug #932
Added the Fill operation for Direct3D
2010-01-18 06:34:04 +00:00
Ryan C. Gordon
4d8cce19f4 Minor cleanups in PulseAudio code, to keep this 80-column-friendly. 2010-01-17 06:51:31 +00:00
Ryan C. Gordon
3ffe4d25a3 Attempt to clean up PulseAudio dynamic loading support. 2010-01-17 06:43:28 +00:00
Ryan C. Gordon
938953423e Merged r4210:5510 from branches/SDL-1.2/src/audio/pulse: PulseAudio updates.
This pulls all the PulseAudio reworking that was done for 1.2.14 into 1.3.

  Fixes Bugzilla #801.
2010-01-17 06:14:04 +00:00
Sam Lantinga
cb028e3357 Fixed building under Visual Studio 2010-01-15 20:05:49 +00:00
Ryan C. Gordon
62b6ab68d0 Clean up assertion API for public use. 2010-01-13 19:29:33 +00:00
Ryan C. Gordon
f48b26ea6a Whoops, that should be vfprintf(), not fprintf(). :) 2010-01-13 16:58:24 +00:00
Ryan C. Gordon
41337892d2 Fixed compiler warning. 2010-01-13 16:18:36 +00:00
Ryan C. Gordon
6a3cbf3b30 Handle assert init/quit better.
Don't create a mutex unles we need to, only clean it up if we made it.
2010-01-13 16:08:03 +00:00
Sam Lantinga
993462b7ce Moved the assertion tests to testplatform 2010-01-13 09:48:42 +00:00
Ryan C. Gordon
9c333b1152 Handle assertion failures when SDL_Init() isn't called. 2010-01-13 09:44:17 +00:00
Ryan C. Gordon
91168bd712 Handle assertion failures during assertion handler. 2010-01-13 09:13:37 +00:00
Ryan C. Gordon
55906b2938 Fixed Mac OS X assertion code. 2010-01-13 09:10:17 +00:00
Sam Lantinga
5676823dcf Leave fullscreen mode to pop an assertion dialog 2010-01-13 08:44:46 +00:00
Sam Lantinga
efb81e6b8c Assume _exit() is available. It may be, even if unix isn't defined.
If we really have to, we can add a configure check for it.
2010-01-13 08:30:34 +00:00
Sam Lantinga
056bd9865b Moved SDL_FUNCTION out so it's always available, and added SDL_FILE and SDL_LINE 2010-01-13 08:25:16 +00:00
Sam Lantinga
cbe33ba29a Fixed include ordering 2010-01-13 07:33:33 +00:00
Ryan C. Gordon
bb12640ed4 Fixed build problems with gcc __attribute__. 2010-01-13 07:00:20 +00:00
Sam Lantinga
5f76c6b2d5 First pass at Ryan's assertion code, minor tweaks to come. 2010-01-13 06:47:17 +00:00
Sam Lantinga
f6aea4b37a Fixed compiler warning (missing prototype for SDL_Quit()) 2010-01-13 05:24:03 +00:00
Sam Lantinga
75c85ba27e Fixed function prototype 2010-01-13 05:21:30 +00:00
Sam Lantinga
572b6f9b25 Fixed iPhone build 2010-01-13 04:58:31 +00:00
Couriersud
f4c6c92486 DirectFB driver compiles again
- moved to new drawing api
2010-01-11 21:49:09 +00:00
Ryan C. Gordon
be72893582 Since we're not using the CoreAudio HAL now, we don't need to use EnableIO.
I think that's how it works.

Fixes failure to open audio device on Mac OS X.
2010-01-11 07:45:34 +00:00
Ryan C. Gordon
629a33f24d Patched to compile. 2010-01-11 07:33:56 +00:00
Ryan C. Gordon
7b51107391 Merged r3576:3577 from branches/SDL-1.2: X11 Xlibint.h include fixes. 2010-01-10 18:19:35 +00:00
Ryan C. Gordon
513a51438f Revert r5463: Alpha blend "correctness" patch.
Sam says:
"We should revert this. I applied it in 1.3 and then fixed it for correctness."
2010-01-10 08:59:25 +00:00
Ryan C. Gordon
0a3afaa588 Merged r5194:5195 from branches/SDL-1.2: coldfire cpu arch support. 2010-01-10 08:21:19 +00:00
Ryan C. Gordon
7d6532fb7a Merged r5070:5071 from branches/SDL-1.2: forcibly disable buggy MMX mixers. 2010-01-10 07:48:14 +00:00
Ryan C. Gordon
fe2f3cf720 Merged r4991:5154 from branches/SDL-1.2/src/audio/alsa: many 1.2.14 ALSA fixes. 2010-01-10 07:40:12 +00:00
Ryan C. Gordon
2c3d75ad93 Merged r5016:5017 from branches/SDL-1.2: PS2 DMA mapping fix.
I assume this video target is slated for removal in 1.3, but I merged this,
just in case.
2010-01-10 06:32:41 +00:00
Ryan C. Gordon
23a7f67e85 Merged r4992:4993 from branches/SDL-1.2: increased alpha blend accuracy. 2010-01-10 06:18:39 +00:00
Ryan C. Gordon
d3fddfb2b4 Merged r4866:4867 from branches/SDL-1.2: 64-bit Mac OS X 10.5 SDK fix. 2010-01-10 05:39:46 +00:00
Ryan C. Gordon
8d46b44026 Merged r4713:4714 from branches/SDL-1.2: CoreAudio 64-bit & Snow Leopard fixes. 2010-01-06 20:31:21 +00:00
Ryan C. Gordon
4b5c236a0d Merged r4710:4711 from branches/SDL-1.2: Mac OS X SDL_stdlib qsort build fixes. 2010-01-06 20:17:35 +00:00
Ryan C. Gordon
b4ed725c0b Merged r4433:4434 from branches/SDL-1.2: fbcon fgets() return value test fix. 2010-01-06 07:45:58 +00:00
Sam Lantinga
4e5f91ec7c Removed the obsolete SDL 1.2 GAPI driver 2010-01-06 07:39:09 +00:00
Sam Lantinga
6d445389ca I can't compile this, but it should be updated for the new rendering API now. 2010-01-06 07:37:15 +00:00
Ryan C. Gordon
af25176933 Merged r4121:4122 from branches/SDL-1.2: more double-free fixes. 2010-01-06 07:34:20 +00:00
Ryan C. Gordon
67bd8e2549 Merged r4121:4122 from branches/SDL-1.2: win32 joystick double-free fix. 2010-01-06 07:26:49 +00:00
Ryan C. Gordon
f498df4891 Merged r3787:3788 from branches/SDL-1.2: better failures for joystick opening. 2010-01-06 06:40:16 +00:00
Sam Lantinga
2ce50c80a2 Fixed GL_RenderWritePixels() - thanks Ryan! 2010-01-06 06:12:01 +00:00
Sam Lantinga
8eaf7c78b9 Fixed bug #924
Only use sysconf if _SC_NPROCESSORS_ONLN is available.  Fortunately the case for this was Mac OS X 10.4, which has sysctlbyname()
2010-01-06 04:33:31 +00:00
Sam Lantinga
4386417754 We're using GNU recursive mutexes 2009-12-30 19:48:23 +00:00
Sam Lantinga
25ddd3c390 Removed in the interest of actually finishing 1.3. :)
They can be done later, either by me or by someone else.
2009-12-30 19:10:41 +00:00
Ryan C. Gordon
d3cffb3167 Fixed buffer overflows in resamplers.
I'm not confident this is a complete fix, but I'm not confident the current
 resamplers are really worth keeping at all, either.
2009-12-28 08:28:24 +00:00
Sam Lantinga
a29c410b7e Updated to compile on Windows 2009-12-24 19:18:05 +00:00
Sam Lantinga
d3a2d0d8b7 Fixed bug #912
SDL_MasksToPixelFormatEnum() wasn't correctly returning RGB24 formats
2009-12-23 06:39:18 +00:00
Sam Lantinga
c3629ff44a Added SDL_RenderClear() as a fast method of clearing the screen to the drawing color.
Renamed SDL_RenderPoint() and SDL_RenderLine() to SDL_RenderDrawPoint() and SDL_RenderDrawLine().
Added API for rectangle drawing (as opposed to filling)
Added placeholder API functions for circles and ellipses ... I'm not sure whether these will stay.
Optimized software line drawing quite a bit.
Added support for Wu's anti-aliased line drawing, currently disabled by default.
2009-12-23 01:55:00 +00:00
Sam Lantinga
1d00894214 Added SDL_DrawRect(), SDL_DrawRects(), SDL_BlendRect() and SDL_BlendRects()
Fixed line drawing so when blending a sequence of lines there are no overlapping pixels drawn.
2009-12-18 07:41:59 +00:00
Sam Lantinga
786e01f737 In the process of adding rectangle drawing 2009-12-18 07:03:09 +00:00
Sam Lantinga
5ba602a897 Fixed compile error on Windows. 2009-12-17 07:47:03 +00:00
Sam Lantinga
ab09986ef7 Updated test code to use SDL_setenv() 2009-12-17 07:46:13 +00:00
Sam Lantinga
3fc0e26901 Fixed crash in joystick handling code. Newer 2.6 kernels add an additional 'resolution' field to input_absinfo. Note that we don't use that structure since we want to have enough space for the values even when building with an older kernel. 2009-12-17 07:22:48 +00:00
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
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
e8d7dbce07 Nuffin' 2009-12-16 01:19:58 +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
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
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
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
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
8306adb559 Finished implementing RenderReadPixels() 2009-12-12 04:01:40 +00:00
Sam Lantinga
159e0ed15f Fixed building on iPhone 2009-12-12 00:55:13 +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
Sam Lantinga
bd7e5fd72b X11 driver compiles again, lines are not yet implemented 2009-12-10 09:27:23 +00:00
Sam Lantinga
dd8238d718 Switch to mixed case for consistency with other enumerations 2009-12-10 08:28:26 +00:00
Sam Lantinga
70a40d51b2 Added interfaces for batch drawing of points, lines and rects:
SDL_DrawPoints()
    SDL_BlendPoints()
    SDL_BlendLines()
    SDL_DrawLines()
    SDL_FillRects()
    SDL_BlendRects()
    SDL_RenderPoints()
    SDL_RenderLines()
    SDL_RenderRects()
Renamed SDL_RenderFill() to SDL_RenderRect()
2009-12-09 15:56:56 +00:00
Sam Lantinga
fd2629214e Hey, those automated tests are coming in handy! Fixed GDI rendering semantics 2009-12-07 10:08:24 +00:00
Sam Lantinga
cf1e120bcb Implemented RenderReadPixels() and RenderWritePixels() for GDI renderer. 2009-12-07 09:44:55 +00:00
Sam Lantinga
22a1cf4b25 This fixes the OpenGL rendering test, at least with my ATI card... 2009-12-07 08:02:20 +00:00
Sam Lantinga
8d70d2a2b2 Fixed crash initializing the dummy driver 2009-12-07 08:01:58 +00:00
Sam Lantinga
3e60082b3f The window position is display relative, at least for now... 2009-12-06 08:39:01 +00:00
Sam Lantinga
2f755299d8 Fixed crash 2009-12-06 08:16:23 +00:00
Sam Lantinga
586f3e0dda Added an API function to query geometry of multiple monitors:
SDL_GetDisplayBounds()

Implemented multi-monitor window positions on Windows
2009-12-06 08:03:38 +00:00
Sam Lantinga
973e6e31d8 Fixed to use the correct display adapter 2009-12-06 06:21:39 +00:00