src/video/SDL_blendline.c
author Sam Lantinga <slouken@libsdl.org>
Sat, 20 Dec 2008 13:14:28 +0000
changeset 2888 32e8bbba1e94
child 2896 1ef2f1e75ff7
permissions -rw-r--r--
Added stubs for software implementations of blending fills and line drawing
slouken@2888
     1
/*
slouken@2888
     2
    SDL - Simple DirectMedia Layer
slouken@2888
     3
    Copyright (C) 1997-2009 Sam Lantinga
slouken@2888
     4
slouken@2888
     5
    This library is free software; you can redistribute it and/or
slouken@2888
     6
    modify it under the terms of the GNU Lesser General Public
slouken@2888
     7
    License as published by the Free Software Foundation; either
slouken@2888
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@2888
     9
slouken@2888
    10
    This library is distributed in the hope that it will be useful,
slouken@2888
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@2888
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@2888
    13
    Lesser General Public License for more details.
slouken@2888
    14
slouken@2888
    15
    You should have received a copy of the GNU Lesser General Public
slouken@2888
    16
    License along with this library; if not, write to the Free Software
slouken@2888
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@2888
    18
slouken@2888
    19
    Sam Lantinga
slouken@2888
    20
    slouken@libsdl.org
slouken@2888
    21
*/
slouken@2888
    22
#include "SDL_config.h"
slouken@2888
    23
slouken@2888
    24
#include "SDL_video.h"
slouken@2888
    25
#include "SDL_blit.h"
slouken@2888
    26
slouken@2888
    27
slouken@2888
    28
int
slouken@2888
    29
SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2,
slouken@2888
    30
              int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
slouken@2888
    31
{
slouken@2888
    32
    /* This function doesn't work on surfaces < 8 bpp */
slouken@2888
    33
    if (dst->format->BitsPerPixel < 8) {
slouken@2888
    34
        SDL_SetError("SDL_BlendLine(): Unsupported surface format");
slouken@2888
    35
        return (-1);
slouken@2888
    36
    }
slouken@2888
    37
slouken@2888
    38
    /* Perform clipping */
slouken@2888
    39
    /* FIXME
slouken@2888
    40
       if (!SDL_IntersectRect(dstrect, &dst->clip_rect, dstrect)) {
slouken@2888
    41
       return (0);
slouken@2888
    42
       }
slouken@2888
    43
     */
slouken@2888
    44
slouken@2888
    45
    SDL_Unsupported();
slouken@2888
    46
    return -1;
slouken@2888
    47
}
slouken@2888
    48
slouken@2888
    49
/* vi: set ts=4 sw=4 expandtab: */