indent
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403247
This commit is contained in:
parent
de690ebe5d
commit
a733eee1b8
10 changed files with 120 additions and 113 deletions
|
@ -1445,7 +1445,8 @@ SDL_CreateYUVOverlay(int w, int h, Uint32 format, SDL_Surface * display)
|
||||||
|
|
||||||
/* Create a supported RGB format texture for display */
|
/* Create a supported RGB format texture for display */
|
||||||
overlay->hwdata->textureID =
|
overlay->hwdata->textureID =
|
||||||
SDL_CreateTexture(SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_STREAMING, w, h);
|
SDL_CreateTexture(SDL_PIXELFORMAT_RGB888,
|
||||||
|
SDL_TEXTUREACCESS_STREAMING, w, h);
|
||||||
}
|
}
|
||||||
if (!overlay->hwdata->textureID) {
|
if (!overlay->hwdata->textureID) {
|
||||||
SDL_FreeYUVOverlay(overlay);
|
SDL_FreeYUVOverlay(overlay);
|
||||||
|
@ -1466,11 +1467,13 @@ SDL_LockYUVOverlay(SDL_Overlay * overlay)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (overlay->hwdata->sw) {
|
if (overlay->hwdata->sw) {
|
||||||
if (SDL_SW_QueryYUVTexturePixels(overlay->hwdata->sw, &pixels, &pitch) < 0) {
|
if (SDL_SW_QueryYUVTexturePixels(overlay->hwdata->sw, &pixels, &pitch)
|
||||||
|
< 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (SDL_LockTexture(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch)
|
if (SDL_LockTexture
|
||||||
|
(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch)
|
||||||
< 0) {
|
< 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1504,14 +1507,17 @@ SDL_UnlockYUVOverlay(SDL_Overlay * overlay)
|
||||||
if (overlay->hwdata->sw) {
|
if (overlay->hwdata->sw) {
|
||||||
void *pixels;
|
void *pixels;
|
||||||
int pitch;
|
int pitch;
|
||||||
if (SDL_LockTexture(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch) == 0) {
|
if (SDL_LockTexture
|
||||||
|
(overlay->hwdata->textureID, NULL, 1, &pixels, &pitch) == 0) {
|
||||||
SDL_Rect srcrect;
|
SDL_Rect srcrect;
|
||||||
|
|
||||||
srcrect.x = 0;
|
srcrect.x = 0;
|
||||||
srcrect.y = 0;
|
srcrect.y = 0;
|
||||||
srcrect.w = overlay->w;
|
srcrect.w = overlay->w;
|
||||||
srcrect.h = overlay->h;
|
srcrect.h = overlay->h;
|
||||||
SDL_SW_CopyYUVToRGB(overlay->hwdata->sw, &srcrect, SDL_PIXELFORMAT_RGB888, overlay->w, overlay->h, pixels, pitch);
|
SDL_SW_CopyYUVToRGB(overlay->hwdata->sw, &srcrect,
|
||||||
|
SDL_PIXELFORMAT_RGB888, overlay->w,
|
||||||
|
overlay->h, pixels, pitch);
|
||||||
SDL_UnlockTexture(overlay->hwdata->textureID);
|
SDL_UnlockTexture(overlay->hwdata->textureID);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -154,7 +154,7 @@ SDL_SYS_HapticInit(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = CoCreateInstance(&CLSID_DirectInput, NULL, CLSCTX_INPROC_SERVER,
|
ret = CoCreateInstance(&CLSID_DirectInput, NULL, CLSCTX_INPROC_SERVER,
|
||||||
&IID_IDirectInput, (LPVOID)&dinput);
|
&IID_IDirectInput, (LPVOID) & dinput);
|
||||||
if (FAILED(ret)) {
|
if (FAILED(ret)) {
|
||||||
DI_SetError("CoCreateInstance", ret);
|
DI_SetError("CoCreateInstance", ret);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -361,7 +361,8 @@ static int
|
||||||
SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
{
|
{
|
||||||
if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
|
if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
|
||||||
texture->driverdata = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
|
texture->driverdata =
|
||||||
|
SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
|
||||||
} else {
|
} else {
|
||||||
int bpp;
|
int bpp;
|
||||||
Uint32 Rmask, Gmask, Bmask, Amask;
|
Uint32 Rmask, Gmask, Bmask, Amask;
|
||||||
|
|
|
@ -271,7 +271,7 @@ SDL_SetColorKey(SDL_Surface * surface, Uint32 flag, Uint32 key)
|
||||||
|
|
||||||
/* This is a fairly slow function to switch from colorkey to alpha */
|
/* This is a fairly slow function to switch from colorkey to alpha */
|
||||||
void
|
void
|
||||||
SDL_ConvertColorkeyToAlpha(SDL_Surface *surface)
|
SDL_ConvertColorkeyToAlpha(SDL_Surface * surface)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
@ -290,13 +290,13 @@ SDL_ConvertColorkeyToAlpha(SDL_Surface *surface)
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
Uint16 *row, *spot;
|
Uint16 *row, *spot;
|
||||||
Uint16 ckey = (Uint16)surface->map->info.colorkey;
|
Uint16 ckey = (Uint16) surface->map->info.colorkey;
|
||||||
Uint16 mask = (Uint16)(~surface->format->Amask);
|
Uint16 mask = (Uint16) (~surface->format->Amask);
|
||||||
|
|
||||||
row = (Uint16 *)surface->pixels;
|
row = (Uint16 *) surface->pixels;
|
||||||
for (y = surface->h; y--; ) {
|
for (y = surface->h; y--;) {
|
||||||
spot = row;
|
spot = row;
|
||||||
for (x = surface->w; x--; ) {
|
for (x = surface->w; x--;) {
|
||||||
if (*spot == ckey) {
|
if (*spot == ckey) {
|
||||||
*spot &= mask;
|
*spot &= mask;
|
||||||
}
|
}
|
||||||
|
@ -315,10 +315,10 @@ SDL_ConvertColorkeyToAlpha(SDL_Surface *surface)
|
||||||
Uint32 ckey = surface->map->info.colorkey;
|
Uint32 ckey = surface->map->info.colorkey;
|
||||||
Uint32 mask = ~surface->format->Amask;
|
Uint32 mask = ~surface->format->Amask;
|
||||||
|
|
||||||
row = (Uint32 *)surface->pixels;
|
row = (Uint32 *) surface->pixels;
|
||||||
for (y = surface->h; y--; ) {
|
for (y = surface->h; y--;) {
|
||||||
spot = row;
|
spot = row;
|
||||||
for (x = surface->w; x--; ) {
|
for (x = surface->w; x--;) {
|
||||||
if (*spot == ckey) {
|
if (*spot == ckey) {
|
||||||
*spot &= mask;
|
*spot &= mask;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
#endif /* SDL_VIDEO_OPENGL */
|
#endif /* SDL_VIDEO_OPENGL */
|
||||||
|
|
||||||
/* From SDL_surface.c */
|
/* From SDL_surface.c */
|
||||||
extern void SDL_ConvertColorkeyToAlpha(SDL_Surface *surface);
|
extern void SDL_ConvertColorkeyToAlpha(SDL_Surface * surface);
|
||||||
|
|
||||||
/* Available video drivers */
|
/* Available video drivers */
|
||||||
static VideoBootStrap *bootstrap[] = {
|
static VideoBootStrap *bootstrap[] = {
|
||||||
|
|
|
@ -1110,10 +1110,8 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
|
||||||
swdata->pitches[1] = swdata->pitches[0] / 2;
|
swdata->pitches[1] = swdata->pitches[0] / 2;
|
||||||
swdata->pitches[2] = swdata->pitches[0] / 2;
|
swdata->pitches[2] = swdata->pitches[0] / 2;
|
||||||
swdata->planes[0] = swdata->pixels;
|
swdata->planes[0] = swdata->pixels;
|
||||||
swdata->planes[1] =
|
swdata->planes[1] = swdata->planes[0] + swdata->pitches[0] * h;
|
||||||
swdata->planes[0] + swdata->pitches[0] * h;
|
swdata->planes[2] = swdata->planes[1] + swdata->pitches[1] * h / 2;
|
||||||
swdata->planes[2] =
|
|
||||||
swdata->planes[1] + swdata->pitches[1] * h / 2;
|
|
||||||
break;
|
break;
|
||||||
case SDL_PIXELFORMAT_YUY2:
|
case SDL_PIXELFORMAT_YUY2:
|
||||||
case SDL_PIXELFORMAT_UYVY:
|
case SDL_PIXELFORMAT_UYVY:
|
||||||
|
|
|
@ -633,7 +633,8 @@ D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||||
d3drect.top = rect->y;
|
d3drect.top = rect->y;
|
||||||
d3drect.bottom = rect->y + rect->h;
|
d3drect.bottom = rect->y + rect->h;
|
||||||
|
|
||||||
result = IDirect3DTexture9_LockRect(data->texture, 0, &locked, &d3drect, 0);
|
result =
|
||||||
|
IDirect3DTexture9_LockRect(data->texture, 0, &locked, &d3drect, 0);
|
||||||
if (FAILED(result)) {
|
if (FAILED(result)) {
|
||||||
D3D_SetError("LockRect()", result);
|
D3D_SetError("LockRect()", result);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -294,7 +294,8 @@ GDI_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
texture->driverdata = data;
|
texture->driverdata = data;
|
||||||
|
|
||||||
if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
|
if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
|
||||||
data->yuv = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
|
data->yuv =
|
||||||
|
SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h);
|
||||||
if (!data->yuv) {
|
if (!data->yuv) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue