Commit graph

58 commits

Author SHA1 Message Date
Sam Lantinga
ea4fb3a1a4 Added a utility function to convert blocks of pixels
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404172
2009-11-15 09:21:46 +00:00
Sam Lantinga
107632a278 Added SDL_GetColorKey()
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403573
2009-04-03 13:27:33 +00:00
Sam Lantinga
d123950aa3 Reverted Bob's indent checkin
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403475
2009-01-10 21:50:26 +00:00
Bob Pendleton
44fa7675c8 I ran a global "make indent" it modified the following files.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403473
2009-01-09 20:43:30 +00:00
Sam Lantinga
9ba7210778 Date: Fri, 19 Dec 2008 20:17:35 +0100
From: Couriersud
Subject: Re: Aw: Experience using SDL1.3 in sdlmame/Proposal for api additions

> For consistency you'd probably want:
> SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
> SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode);
> SDL_RenderLine(int x1, int y1, int x2, int y2);
> SDL_RenderFill(SDL_Rect *rect);
>
> You probably also want to add API functions query the current state.
>

I have implemented the above api for the opengl, x11, directfb and
software renderers. I have also renamed *TEXTUREBLENDMODE* constants to
BLENDMODE*. The unix build compiles. The windows renderer still needs to
be updated, but I have no windows development machine at hand. Have a
look at the x11 renderer for a sample.

Vector games now run at 90% both on opengl and directfb in comparison to
sdlmame's own opengl renderer. The same applies to raster games.

The diff also includes

a) Changed XDrawRect to XFillRect in x11 renderer
b) A number of changes to fix blending and modulation issues in the
directfb renderer.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403346
2008-12-20 12:00:00 +00:00
Sam Lantinga
0c30a927ed Updated copyright date
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403321
2008-12-08 00:27:32 +00:00
Sam Lantinga
cc01f2a867 Fixed picking blit function when RLE fails
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403314
2008-12-07 22:37:40 +00:00
Sam Lantinga
4a696cc335 Added slow but complete blit fallback
Don't try to RLE encode surfaces that have alpha channel and alpha modulation
Don't turn on blending when converting an RGB surface to RGBA format
Do turn on blending when converting colorkey to alpha channel

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403285
2008-12-02 17:14:04 +00:00
Sam Lantinga
fb253660b5 The SDL_RLEACCEL flag is respected in SDL_ConvertSurface(), per the docs.
Fixed saving BMP files of surfaces with an alpha channel.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403268
2008-11-29 11:26:01 +00:00
Sam Lantinga
228035d0f3 It turns out both the software and the OpenGL renderer had the same problem.
According to the spec, when SDL_SRCALPHA is set, the colorkey is ignored, so
we just need to convert the colorkey into the alpha channel.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403248
2008-11-25 05:29:14 +00:00
Sam Lantinga
a733eee1b8 indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403247
2008-11-25 02:21:53 +00:00
Sam Lantinga
de690ebe5d Fixed bug with converting colorkey surface to texture
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403246
2008-11-25 02:12:19 +00:00
Sam Lantinga
ede44c4b85 Final merge of Google Summer of Code 2008 work...
Port SDL 1.3 to the Nintendo DS
by Darren Alton, mentored by Sam Lantinga

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403188
2008-08-27 15:10:03 +00:00
Bob Pendleton
e27a71b3a7 ran make indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402747
2008-03-14 20:43:44 +00:00
Bob Pendleton
71656d10c7 re: bug#563. checking in some commented out trace code and a fix so that the in testalpha.c the background only flashes when alpha == 255. The problem that is being
fixed is caused by clearing SDL_COPY_RLE_COLORKEY without setting SDL_COPY_RLE_DESIRED in SDL_UnRELSurface.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402746
2008-03-14 18:17:49 +00:00
Sam Lantinga
cf548d0a6b Okay, still some bugs, but everything builds again...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402629
2007-08-18 05:39:09 +00:00
Sam Lantinga
2e91636dda More work in progress integrating SDL_Surface and the new SDL_Texture API
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402628
2007-08-18 01:44:21 +00:00
Sam Lantinga
4d9ae37508 indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402622
2007-08-17 02:55:21 +00:00
Sam Lantinga
79f25b0b9e Moved the colorkey and per-surface alpha into the blit info,
in preparation for support for general color channel modulation.

Removed and consolidated some data in the blit info.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402619
2007-08-17 00:54:53 +00:00
Sam Lantinga
5ac6d00012 Added notes on the next steps for SDL 1.3
Moved fill and copy routines to their own files.

--HG--
rename : src/video/SDL_blit_copy.c => src/video/SDL_copy.c
rename : src/video/SDL_blit_copy.h => src/video/SDL_copy.h
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402615
2007-08-16 21:43:19 +00:00
Sam Lantinga
743406caf2 SSE and MMX intrinsics work with Visual Studio now...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402613
2007-08-16 06:37:22 +00:00
Sam Lantinga
5d8720fd18 Added SSE and MMX optimization for SDL_FillRect()
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402611
2007-08-16 05:56:24 +00:00
Sam Lantinga
dc8a201235 Added SSE version of SDL_FillRect() for 32-bit ARGB surfaces
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402601
2007-08-13 06:24:56 +00:00
Sam Lantinga
e7a82e9f88 indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402597
2007-08-12 18:44:49 +00:00
Sam Lantinga
b88bb33e97 Gained 5 FPS in testsprite because Mac OS X memset is highly optimized
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402596
2007-08-12 18:27:44 +00:00
Sam Lantinga
6b348f07c7 Emphasized the separation between SDL_Surface and SDL_Texture
- SDL_Surface is a system memory representation of pixel data
 - SDL_Texture is a video memory representation of pixel data

The concept of SDL_Surface with SDL_HWSURFACE is no longer used.

Separated SDL_Texture types by usage rather than memory type
 - SDL_TEXTUREACCESS_STATIC is for rarely changed pixel data,
   can be placed in video memory.
 - SDL_TEXTUREACCESS_STREAMING is for frequently changing pixel
   data, usually placed in system memory or AGP memory.

Optimized the SDL_compat usage of the OpenGL renderer by only
using one copy of the framebuffer instead of two.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402584
2007-08-11 20:54:31 +00:00
Sam Lantinga
2fe561616a Convert SDL_malloc to SDL_calloc if appropriate, slightly faster on operating systems which map the zero page for memory allocations.
OpenGL renderer in progress

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401965
2006-07-22 08:33:18 +00:00
Sam Lantinga
0f030a1802 SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401938
2006-07-10 21:04:37 +00:00
Sam Lantinga
a9ee23bb9f Fixed a bunch of 64-bit compatibility problems
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401460
2006-03-01 09:43:47 +00:00
Sam Lantinga
bb11c757f7 Update for Visual C++ 6.0
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401432
2006-02-24 18:24:57 +00:00
Sam Lantinga
c36118165e Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401406
2006-02-21 08:46:50 +00:00
Sam Lantinga
684909fae2 More header massaging... works great on Windows. ;-)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401362
2006-02-10 06:48:43 +00:00
Sam Lantinga
09cd73f1b5 Removed uses of stdlib.h and string.h
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401342
2006-02-07 09:29:18 +00:00
Sam Lantinga
5d53175e4d Use SDL_ prefixed versions of C library functions.
FIXME:
Change #include <stdlib.h> to #include "SDL_stdlib.h"
Change #include <string.h> to #include "SDL_string.h"
Make sure nothing else broke because of this...

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401340
2006-02-07 06:59:48 +00:00
Sam Lantinga
6c3f928cd8 It's now possible to build SDL without any C runtime at all on Windows,
using Visual C++ 2005

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401334
2006-02-06 08:28:51 +00:00
Sam Lantinga
eea4857268 Updated copyright information and removed rcs id lines (problematic in branch merges)
I batch edited these files, so please let me know if I've accidentally removed anybody's
credit here.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401315
2006-02-01 06:32:25 +00:00
Ryan C. Gordon
f2d9ddec98 Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
updated project files, VS2005 support, VGA mode, more device support, etc,
 etc, etc.

Fixes Bugzilla #47 and #28.

--ryan.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401254
2006-01-19 08:43:00 +00:00
Ryan C. Gordon
7ad062e148 Fixed some compiler warnings about "unreachable code" on Watcom C.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401158
2005-10-03 08:38:28 +00:00
Ryan C. Gordon
8907a054cf Some work on using accelerated alpha blits with hardware surfaces.
From Stephane Marchesin's fork, don't know who originally wrote it.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401053
2005-04-17 10:40:41 +00:00
Sam Lantinga
de09729488 *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401018
2004-12-19 22:04:44 +00:00
Sam Lantinga
cebd45ab2d Date: Sat, 10 Jul 2004 21:02:33 +0200
From: "Philippe Plantier (ayin)"
Subject: [SDL] Problems allocating large surfaces

There are problems when allocating large surfaces using SDL_CreateRGBSurface.

When, for example, we try to allocate a surface wider than 16384 pixels,
the calculation of the pitch overflows; this leads to a surface that
has the w and h flags correctly set, but whose "pixels" buffer is too
small. That may lead to heap corruption.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40941
2004-08-21 05:29:45 +00:00
Sam Lantinga
ee92972637 You can't free locked surfaces!
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40916
2004-07-25 18:43:07 +00:00
Sam Lantinga
54478fc8ca Fixed a bug in detecting surface mapping changes
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40846
2004-02-19 21:13:24 +00:00
Sam Lantinga
cb9c2efd17 Updated copyright information for 2004 (Happy New Year!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40770
2004-01-04 16:49:27 +00:00
Sam Lantinga
9e98e499b1 Return an error with color fills on less than 8 bpp surfaces.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40533
2002-10-15 05:22:50 +00:00
Sam Lantinga
b749b25a06 Fixed a crash blitting RLE surfaces to RLE surfaces
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40527
2002-10-11 07:56:36 +00:00
Sam Lantinga
e9ed754e4c *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40520
2002-10-07 15:36:32 +00:00
Sam Lantinga
5310d6d97f Fixed offset bug in hardware accelerated fills and blits
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40463
2002-08-20 16:58:49 +00:00
Sam Lantinga
16a3c5faef Zeroed out SDL_Surface::unused1 so glSDL will work on stock SDL
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40442
2002-08-17 19:17:01 +00:00
Sam Lantinga
a9c0bef803 Fixed SDL_DisplayFormatAlpha() on RGB surfaces with alpha
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40432
2002-08-01 23:06:39 +00:00