Commit Graph

2009 Commits

Author SHA1 Message Date
Sam Lantinga
e024bcf596 Thank you automated tests (and bobbens!), fixed alpha blending for accuracy 2009-11-16 09:47:34 +00:00
Sam Lantinga
0b1a37f8ba Fixed memory corruption in SW_RenderReadPixels() 2009-11-16 07:39:08 +00:00
Sam Lantinga
7a40c23469 You can specify the format for pixel data in SDL_RenderReadPixels() and SDL_RenderWritePixels()
This code still doesn't quite work yet. :)
2009-11-16 07:13:07 +00:00
Sam Lantinga
c12a32c64b Added a utility function to convert blocks of pixels 2009-11-15 09:21:46 +00:00
Sam Lantinga
08efca1a63 Hmm, this isn't going to work, is it? 2009-11-15 08:01:34 +00:00
Sam Lantinga
06a7514a17 Work in progress on OpenGL ReadPixels/WritePixels interface 2009-11-15 04:58:03 +00:00
Sam Lantinga
b6a95db8fa Updated for the new pixel format structure 2009-11-11 06:34:33 +00:00
Sam Lantinga
cb3902eb6c Work in progress on implementation of SDL_RenderReadPixels() and SDL_RenderWritePixels(), code untested. 2009-11-09 05:20:11 +00:00
Sam Lantinga
30a9c47830 Fixed compile warning 2009-11-08 04:21:59 +00:00
Sam Lantinga
bc71d2180a Skip renderers that fail to initialize 2009-11-08 04:16:42 +00:00
Sam Lantinga
151ef99620 Fixed bug #847
Roger Willcocks      2009-10-25 08:45:37 PDT

appDidFinishLaunching is triggered before all the setup's complete. The easiest
fix is to arrange for another event to be sent when it's really ready, and run
SDL_main from there. Ref.
http://blog.rightsprite.com/2008/11/iphone-applicationdidfinishlaunching.html

SDL-1.3.0-4563/src/video/uikit/SDL_uikitappdelegate.m:



- (void)postFinishLaunch {

    /* run the user's application, passing argc and argv */
    int exit_status = SDL_main(forward_argc, forward_argv);

    /* free the memory we used to hold copies of argc and argv */
    int i;
    for (i=0; i<forward_argc; i++) {
        free(forward_argv[i]);
    }
    free(forward_argv);

    /* exit, passing the return status from the user's application */
    exit(exit_status);

}

- (void)applicationDidFinishLaunching:(UIApplication *)application {

    /* Set working directory to resource path */
    [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle
mainBundle] resourcePath]];

    [self performSelector:@selector(postFinishLaunch) withObject:nil
afterDelay:0.0];
2009-11-02 07:55:42 +00:00
Sam Lantinga
481ee1bb45 cpuid doesn't actually change the flags register 2009-10-30 05:02:47 +00:00
Sam Lantinga
57ae4fced1 Fixed bug #734
Save and restore the PIC register %ebx/%rbx using push/pop instead of %edi/%rdi
2009-10-30 04:45:01 +00:00
Mike Gorchak
c39891d34a Cursor hotspot fixes. 2009-10-29 09:20:50 +00:00
Sam Lantinga
bce225654d Automatically initialize the video system and create a renderer to simplify use. 2009-10-28 06:04:07 +00:00
Sam Lantinga
6c68a855a6 Adam Strzelecki to SDL
I think something is wrong (look at the fix patch below):
(1) NSRect rect shouldn't be initialized with contentRectForFrameRect: at the top of the function, contentRectForFrameRect is called in non-fullscreen case anyway (1st @@)
(2) I think you've left two lines that should be removed completely (2nd @@)
2009-10-23 04:08:32 +00:00
Sam Lantinga
b9c67c1d25 Adam Strzelecki to SDL
When using deployment in Xcode we use 10.4 SDK for PPC & i386 and 10.6 SDK for x86_64 unfortunately MAC_OS_X_VERSION_10_6 is defined only in 10.6 SDK, in older SDKs it is undefined which makes >= comparison return always TRUTH, so the GCC complains about undefined <NSWindowDelegate>, even if the original intention was to omit <NSWindowDelegate> on older SDKs.

Solution, don't relay on MAC_OS_X_VERSION_10_6 but use OSX revision number 1060 directly as SDL does in many other places.
2009-10-23 03:58:23 +00:00
Mike Gorchak
a53104f750 Fixes in GLES configuration selection. 2009-10-22 06:09:03 +00:00
Mike Gorchak
abdd5571be Fixes in GLES configuration selection. Support for an old QNX 6.3.2. 2009-10-22 06:08:36 +00:00
Sam Lantinga
b5ca42e880 Adam Strzelecki to SDL
Sending a patch for fullscreen Mac OS X SDL 1.3 (SVN) Cocoa mouse position handling. In fullscreen mouse coordinates should be relative to SCREEN not to the window, which doesn't really occupy fullscreen.
Without this patch mouse position (especially Y) was totally incorrect (shifted) in fullscreen.
2009-10-22 04:46:11 +00:00
Sam Lantinga
8ea99c7b4e There's a bug with gcc 4.4.1 and -O2 where srcp doesn't get the correct value after the first scanline. Ugh. 2009-10-18 23:21:15 +00:00
Sam Lantinga
890a3b9f25 Merged improvements to SDL_SoftStretch() from SDL 1.2 2009-10-18 17:49:40 +00:00
Sam Lantinga
baf302ec39 Fixed bug #853
Ludwig Nussel      2009-10-18 05:34:18 PDT

src/joystick/linux/SDL_sysjoystick.c has some problems:

- test_bit() might break with strict aliasing
- test_bit() assumes array is Uint32 but its actually "unsigned long"
  on 64bit systems sizeof(long) != sizeof(Uint32).
- the keybit array is too small
- the arrays are unitialized so the number of
  detected buttons is quite random
2009-10-18 16:14:35 +00:00
Sam Lantinga
0874c3ae84 iPhone interruption patch / SDL 1.3
Eric Wing to Sam

I've been sitting on this too long. I need to push.
It's untested because of the unrelated crashing bug I've been experiencing.
Also have a fix for SIZEOF_VOIDP in the config for both iPhone and Mac.
2009-10-17 07:36:45 +00:00
Mike Gorchak
5d837d169e Working on fullscreen video modes support 2009-10-13 20:17:11 +00:00
Mike Gorchak
b098c35b96 All 2D operations in Photon driver have been finished. The driver is ready to use. There fullscreen modes and YUV textures are rest only. 2009-10-13 11:26:40 +00:00
Mike Gorchak
8d81134bc6 Fixed SDL_BLENDMODE_MASK for GL and GLES renderers, now blending works like in software renderer. 2009-10-13 06:51:20 +00:00
Mike Gorchak
04dc33353c Fixed OpenGL ES primitive alpha blending. 2009-10-13 06:28:31 +00:00
Mike Gorchak
8554a00051 Initial support for fullscreen application modes. 2009-10-12 19:47:01 +00:00
Mike Gorchak
6bf136c551 Photon SDL renderer almost finished, the double/tripple buffering is left only. 2009-10-12 11:45:01 +00:00
Sam Lantinga
46d753c1c0 Joystick patch from FreeBSD ports system 2009-10-12 09:42:50 +00:00
Mike Gorchak
efaf0e3ff1 Continue working on 2D support in Photon. 2009-10-12 08:21:43 +00:00
Mike Gorchak
db200ea8ad Continue working on 2D support in Photon 2009-10-11 18:45:39 +00:00
Mike Gorchak
45dab6140e Continue working on 2D support for Photon/QNX. 2009-10-10 20:15:20 +00:00
Sam Lantinga
44e7c1bd41 Debian patch: 218_joystick_memmove.diff 2009-10-10 10:02:17 +00:00
Sam Lantinga
f694f1de5e Whoops, FreeBSD 6.2 doesn't define __FreeBSD_kernel_version 2009-10-10 09:44:04 +00:00
Sam Lantinga
73b823bca8 Adapted from Debian patch: 215_kfreebsd_gnu.diff 2009-10-10 09:36:12 +00:00
Mike Gorchak
61a236b4a6 Support for the atomic operations for ARM, PPC, MIPS, SH, X86 platforms has been added. 2009-10-10 08:06:18 +00:00
Sam Lantinga
447cbc2563 Fixed bug #627
Increased accuracy of alpha blend calculation
2009-10-10 07:48:57 +00:00
Ryan C. Gordon
3842b74b75 Merged r4990:4991 from branches/SDL-1.2: ALSA 1.0 API and dlvsym() removal. 2009-10-10 07:34:15 +00:00
Sam Lantinga
f81eec596a typo 2009-10-10 06:51:42 +00:00
Sam Lantinga
a12027a028 Fixed bug #814
Daniele Forghieri      2009-09-30 15:40:53 PDT

To compile the source in libm the variable huge must be renamed, I choose
huge_val

The patch attached change it so it compiles
2009-10-04 09:51:04 +00:00
Sam Lantinga
c75e149ac8 Fixed a bug where when the audio starts paused all the DirectSound buffers
will end up getting locked and never unlocked and sound will never play.

Added a FIXME for Ryan to look at, too. :)
2009-10-04 09:18:48 +00:00
Sam Lantinga
f272e1dd85 Adam Strzelecki to SDL
Since current DirectFB implementation is incomplete for YUV surfaces (actually causes segmentation faults when trying Lock and use YUV planar textures) I decided to fix it a bit.
Here's a patch that should make DirectFB properly support YUV both packed and planar (3 planes).

(1) Removed SDL_BYTESPERPIXEL at all in favor of DFB_BYTES_PER_PIXEL(SDLToDFBPixelFormat(fmt)) which does return always proper BPP for YUVs too, coz SDL_BYTESPERPIXEL returns incorrect values for FOURCCs
(2) Fixed data->pixels allocation for planar YUVs in CreateTexture, it should allocate 150% more space
(3) Copy other planes for planar YUVs in UpdateTexture
(4) Moved checking if format is supported at all with DirectFB on CreateTexture at the beginning of the code

Waiting for comments,
--
Adam Strzelecki | nanoant.com
2009-10-04 04:03:37 +00:00
Sam Lantinga
63382d1cee [SDL] Bad math in SDL_RenderCopy
Mason Wheeler to sdl

When I tried to render an image using something other than NULL for srcrect, it got horribly distorted.  I traced it down to the fact that the math in the rectangle adjustments performed just before the call to renderer->RenderCopy is written inside out.  It should look like this:

       if (dstrect->w != real_dstrect.w) {
           int deltax = (dstrect->x - real_dstrect.x);
           int deltaw = (dstrect->w - real_dstrect.w);
           real_srcrect.x += (deltax * real_srcrect.w) / dstrect->w;
           real_srcrect.w += (deltaw * real_srcrect.w) / dstrect->w;
       }
       if (dstrect->h != real_dstrect.h) {
           int deltay = (dstrect->y - real_dstrect.y);
           int deltah = (dstrect->h - real_dstrect.h);
           real_srcrect.y += (deltay * real_srcrect.h) / dstrect->h;
           real_srcrect.h += (deltah * real_srcrect.h) / dstrect->h;
2009-10-03 16:23:16 +00:00
Sam Lantinga
676f56294f Temporary band-aid for bug #575
It looks like newer kernels do the logical device mapping in the driver,
so this code crashes.  I don't have one of these nor do I have remote
access to debug this, so I'm disabling the logical mapping for now.
2009-09-29 00:42:21 +00:00
Sam Lantinga
8532c67014 -0.5 is causing trouble according to comments in bug #783 2009-09-28 15:32:58 +00:00
Sam Lantinga
2415433b1c Fixed bug #716
Armin Burgmeier      2009-03-15 04:35:45 PDT

When I hold a mouse button down on another (non-SDL) window, then move the
mouse over an SDL window and releasing the mouse button there, then the
application does not receive an SDL_ACTIVEEVENT with state SDL_APPMOUSEFOCUS
and gain 1.

Furthermore, SDL_GetAppState() reports the application not having mouse focus
until moving the mouse out of the window and back in again.
2009-09-27 23:24:58 +00:00
Sam Lantinga
f8c7e7df22 Fixed 32-bit build 2009-09-26 21:39:56 +00:00
Sam Lantinga
9134eb02ab Fixed bug #797
Ryan C. Gordon      2009-09-19 08:25:21 PDT

This line in SDL_iconv_string (src/stdlib/SDL_iconv.c) ...

        if (!fromcode || !*fromcode) {
            tocode = "UTF-8";
        }

Is probably supposed to assign to "fromcode" and not "tocode".
2009-09-26 10:36:55 +00:00