src/video/SDL_surface.c
branchSDL-1.3
changeset 1735 8dd28c4ef746
parent 1724 6c63fc2bd986
     1.1 --- a/src/video/SDL_surface.c	Sun Jul 09 18:09:16 2006 +0000
     1.2 +++ b/src/video/SDL_surface.c	Mon Jul 10 07:34:50 2006 +0000
     1.3 @@ -41,14 +41,6 @@
     1.4  {
     1.5      SDL_Surface *surface;
     1.6  
     1.7 -    /* FIXME!! */
     1.8 -    /* Make sure the size requested doesn't overflow our datatypes */
     1.9 -    /* Next time I write a library like SDL, I'll use int for size. :) */
    1.10 -    if (width >= 16384 || height >= 65536) {
    1.11 -        SDL_SetError("Width or height is too large");
    1.12 -        return NULL;
    1.13 -    }
    1.14 -
    1.15      /* Allocate the surface */
    1.16      surface = (SDL_Surface *) SDL_malloc(sizeof(*surface));
    1.17      if (surface == NULL) {
    1.18 @@ -211,6 +203,7 @@
    1.19              surface->flags |= SDL_HWSURFACE;
    1.20              surface->w = w;
    1.21              surface->h = h;
    1.22 +            surface->pitch = SDL_CalculatePitch(surface);
    1.23              SDL_SetClipRect(surface, NULL);
    1.24          }
    1.25      }
    1.26 @@ -415,43 +408,6 @@
    1.27  }
    1.28  
    1.29  /*
    1.30 - * A function to calculate the intersection of two rectangles:
    1.31 - * return true if the rectangles intersect, false otherwise
    1.32 - */
    1.33 -SDL_bool
    1.34 -SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B,
    1.35 -                  SDL_Rect * intersection)
    1.36 -{
    1.37 -    int Amin, Amax, Bmin, Bmax;
    1.38 -
    1.39 -    /* Horizontal intersection */
    1.40 -    Amin = A->x;
    1.41 -    Amax = Amin + A->w;
    1.42 -    Bmin = B->x;
    1.43 -    Bmax = Bmin + B->w;
    1.44 -    if (Bmin > Amin)
    1.45 -        Amin = Bmin;
    1.46 -    intersection->x = Amin;
    1.47 -    if (Bmax < Amax)
    1.48 -        Amax = Bmax;
    1.49 -    intersection->w = Amax - Amin > 0 ? Amax - Amin : 0;
    1.50 -
    1.51 -    /* Vertical intersection */
    1.52 -    Amin = A->y;
    1.53 -    Amax = Amin + A->h;
    1.54 -    Bmin = B->y;
    1.55 -    Bmax = Bmin + B->h;
    1.56 -    if (Bmin > Amin)
    1.57 -        Amin = Bmin;
    1.58 -    intersection->y = Amin;
    1.59 -    if (Bmax < Amax)
    1.60 -        Amax = Bmax;
    1.61 -    intersection->h = Amax - Amin > 0 ? Amax - Amin : 0;
    1.62 -
    1.63 -    return (intersection->w && intersection->h);
    1.64 -}
    1.65 -
    1.66 -/*
    1.67   * Set the clipping rectangle for a blittable surface
    1.68   */
    1.69  SDL_bool