SDL_Rect now uses int for position and size. SDL-1.3
authorSam Lantinga
Mon, 10 Jul 2006 07:34:50 +0000
branchSDL-1.3
changeset 17358dd28c4ef746
parent 1734 f7c667ded87d
child 4416 06be4b33029d
SDL_Rect now uses int for position and size.
Added a few more rectangle functions.
Added a dirty rectangle list implementation.
include/SDL_video.h
src/SDL_compat.c
src/video/SDL_rect.c
src/video/SDL_rect_c.h
src/video/SDL_renderer_sw.c
src/video/SDL_surface.c
src/video/SDL_video.c
src/video/win32/SDL_win32modes.c
     1.1 --- a/include/SDL_video.h	Sun Jul 09 18:09:16 2006 +0000
     1.2 +++ b/include/SDL_video.h	Mon Jul 10 07:34:50 2006 +0000
     1.3 @@ -53,8 +53,8 @@
     1.4   */
     1.5  typedef struct SDL_Rect
     1.6  {
     1.7 -    Sint16 x, y;
     1.8 -    Uint16 w, h;
     1.9 +    int x, y;
    1.10 +    int w, h;
    1.11  } SDL_Rect;
    1.12  
    1.13  /**
    1.14 @@ -177,7 +177,8 @@
    1.15      SDL_Renderer_PresentVSync = 0x00000010,     /**< Present is synchronized with the refresh rate */
    1.16      SDL_Renderer_RenderTarget = 0x00000020,     /**< The renderer can create texture render targets */
    1.17      SDL_Renderer_Accelerated = 0x00000040,      /**< The renderer uses hardware acceleration */
    1.18 -    SDL_Renderer_Minimal = 0x00000080,          /**< The renderer only supports the read/write pixel and present functions */
    1.19 +    SDL_Renderer_ = 0x00000080,      /**< The renderer uses hardware acceleration */
    1.20 +    SDL_Renderer_Minimal = 0x00000100,          /**< The renderer only supports the read/write pixel and present functions */
    1.21  } SDL_RendererFlags;
    1.22  
    1.23  /**
    1.24 @@ -1525,12 +1526,50 @@
    1.25   */
    1.26  extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
    1.27  
    1.28 -/*
    1.29 - * Calculate the intersection of two rectangles
    1.30 +/**
    1.31 + * \def SDL_RectEmpty()
    1.32 + *
    1.33 + * \brief Returns true if the rectangle has no area.
    1.34 + */
    1.35 +#define SDL_RectEmpty(X)    (((X)->w <= 0) || ((X)->h <= 0))
    1.36 +
    1.37 +/**
    1.38 + * \def SDL_RectEquals()
    1.39 + *
    1.40 + * \brief Returns true if the two rectangles are equal.
    1.41 + */
    1.42 +#define SDL_RectEquals(A, B)   (((A)->x == (B)->x) && ((A)->y == (B)->y) && \
    1.43 +                                ((A)->w == (B)->w) && ((A)->h == (B)->h))
    1.44 +
    1.45 +/**
    1.46 + * \fn SDL_bool SDL_HasIntersection(const SDL_Rect * A, const SDL_Rect * B);
    1.47 + *
    1.48 + * \brief Determine whether two rectangles intersect.
    1.49 + *
    1.50 + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
    1.51 + */
    1.52 +extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
    1.53 +                                                     const SDL_Rect * B);
    1.54 +
    1.55 +/**
    1.56 + * \fn SDL_bool SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
    1.57 + *
    1.58 + * \brief Calculate the intersection of two rectangles.
    1.59 + *
    1.60 + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
    1.61   */
    1.62  extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
    1.63                                                     const SDL_Rect * B,
    1.64 -                                                   SDL_Rect * intersection);
    1.65 +                                                   SDL_Rect * result);
    1.66 +
    1.67 +/**
    1.68 + * \fn void SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
    1.69 + *
    1.70 + * \brief Calculate the union of two rectangles
    1.71 + */
    1.72 +extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
    1.73 +                                           const SDL_Rect * B,
    1.74 +                                           SDL_Rect * result);
    1.75  
    1.76  /* Ends C function definitions when using C++ */
    1.77  #ifdef __cplusplus
     2.1 --- a/src/SDL_compat.c	Sun Jul 09 18:09:16 2006 +0000
     2.2 +++ b/src/SDL_compat.c	Mon Jul 10 07:34:50 2006 +0000
     2.3 @@ -307,8 +307,6 @@
     2.4  SDL_Surface *
     2.5  SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
     2.6  {
     2.7 -    SDL_EventFilter filter;
     2.8 -    void *filterparam;
     2.9      const SDL_DisplayMode *desktop_mode;
    2.10      SDL_DisplayMode mode;
    2.11      int window_x = SDL_WINDOWPOS_UNDEFINED;
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/video/SDL_rect.c	Mon Jul 10 07:34:50 2006 +0000
     3.3 @@ -0,0 +1,189 @@
     3.4 +/*
     3.5 +    SDL - Simple DirectMedia Layer
     3.6 +    Copyright (C) 1997-2006 Sam Lantinga
     3.7 +
     3.8 +    This library is free software; you can redistribute it and/or
     3.9 +    modify it under the terms of the GNU Lesser General Public
    3.10 +    License as published by the Free Software Foundation; either
    3.11 +    version 2.1 of the License, or (at your option) any later version.
    3.12 +
    3.13 +    This library is distributed in the hope that it will be useful,
    3.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    3.16 +    Lesser General Public License for more details.
    3.17 +
    3.18 +    You should have received a copy of the GNU Lesser General Public
    3.19 +    License along with this library; if not, write to the Free Software
    3.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    3.21 +
    3.22 +    Sam Lantinga
    3.23 +    slouken@libsdl.org
    3.24 +*/
    3.25 +#include "SDL_config.h"
    3.26 +
    3.27 +#include "SDL_video.h"
    3.28 +#include "SDL_rect_c.h"
    3.29 +
    3.30 +SDL_bool
    3.31 +SDL_HasIntersection(const SDL_Rect * A, const SDL_Rect * B)
    3.32 +{
    3.33 +    int Amin, Amax, Bmin, Bmax;
    3.34 +
    3.35 +    /* Horizontal intersection */
    3.36 +    Amin = A->x;
    3.37 +    Amax = Amin + A->w;
    3.38 +    Bmin = B->x;
    3.39 +    Bmax = Bmin + B->w;
    3.40 +    if (Bmin > Amin)
    3.41 +        Amin = Bmin;
    3.42 +    if (Bmax < Amax)
    3.43 +        Amax = Bmax;
    3.44 +    if (Amax <= Amin)
    3.45 +        return SDL_FALSE;
    3.46 +
    3.47 +    /* Vertical intersection */
    3.48 +    Amin = A->y;
    3.49 +    Amax = Amin + A->h;
    3.50 +    Bmin = B->y;
    3.51 +    Bmax = Bmin + B->h;
    3.52 +    if (Bmin > Amin)
    3.53 +        Amin = Bmin;
    3.54 +    if (Bmax < Amax)
    3.55 +        Amax = Bmax;
    3.56 +    if (Amax <= Amin)
    3.57 +        return SDL_FALSE;
    3.58 +
    3.59 +    return SDL_TRUE;
    3.60 +}
    3.61 +
    3.62 +SDL_bool
    3.63 +SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
    3.64 +{
    3.65 +    int Amin, Amax, Bmin, Bmax;
    3.66 +
    3.67 +    /* Horizontal intersection */
    3.68 +    Amin = A->x;
    3.69 +    Amax = Amin + A->w;
    3.70 +    Bmin = B->x;
    3.71 +    Bmax = Bmin + B->w;
    3.72 +    if (Bmin > Amin)
    3.73 +        Amin = Bmin;
    3.74 +    result->x = Amin;
    3.75 +    if (Bmax < Amax)
    3.76 +        Amax = Bmax;
    3.77 +    result->w = Amax - Amin;
    3.78 +
    3.79 +    /* Vertical intersection */
    3.80 +    Amin = A->y;
    3.81 +    Amax = Amin + A->h;
    3.82 +    Bmin = B->y;
    3.83 +    Bmax = Bmin + B->h;
    3.84 +    if (Bmin > Amin)
    3.85 +        Amin = Bmin;
    3.86 +    result->y = Amin;
    3.87 +    if (Bmax < Amax)
    3.88 +        Amax = Bmax;
    3.89 +    result->h = Amax - Amin;
    3.90 +
    3.91 +    return !SDL_RectEmpty(result);
    3.92 +}
    3.93 +
    3.94 +void
    3.95 +SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
    3.96 +{
    3.97 +    int Amin, Amax, Bmin, Bmax;
    3.98 +
    3.99 +    /* Horizontal union */
   3.100 +    Amin = A->x;
   3.101 +    Amax = Amin + A->w;
   3.102 +    Bmin = B->x;
   3.103 +    Bmax = Bmin + B->w;
   3.104 +    if (Bmin < Amin)
   3.105 +        Amin = Bmin;
   3.106 +    result->x = Amin;
   3.107 +    if (Bmax > Amax)
   3.108 +        Amax = Bmax;
   3.109 +    result->w = Amax - Amin;
   3.110 +
   3.111 +    /* Vertical intersection */
   3.112 +    Amin = A->y;
   3.113 +    Amax = Amin + A->h;
   3.114 +    Bmin = B->y;
   3.115 +    Bmax = Bmin + B->h;
   3.116 +    if (Bmin < Amin)
   3.117 +        Amin = Bmin;
   3.118 +    result->y = Amin;
   3.119 +    if (Bmax > Amax)
   3.120 +        Amax = Bmax;
   3.121 +    result->h = Amax - Amin;
   3.122 +}
   3.123 +
   3.124 +void
   3.125 +SDL_AddDirtyRect(SDL_DirtyRectList * list, const SDL_Rect * rect)
   3.126 +{
   3.127 +    SDL_DirtyRect *dirty;
   3.128 +    SDL_DirtyRect *check, *prev, *next;
   3.129 +
   3.130 +    if (list->free) {
   3.131 +        dirty = list->free;
   3.132 +        list->free = dirty->next;
   3.133 +    } else {
   3.134 +        dirty = (SDL_DirtyRect *) SDL_malloc(sizeof(*dirty));
   3.135 +        if (!dirty) {
   3.136 +            return;
   3.137 +        }
   3.138 +    }
   3.139 +    dirty->rect = *rect;
   3.140 +
   3.141 +    /* FIXME: At what point is this optimization too expensive? */
   3.142 +    for (prev = NULL, check = list->list; check; check = next) {
   3.143 +        next = check->next;
   3.144 +
   3.145 +        if (SDL_HasIntersection(&dirty->rect, &check->rect)) {
   3.146 +            SDL_UnionRect(&dirty->rect, &check->rect, &dirty->rect);
   3.147 +            if (prev) {
   3.148 +                prev->next = next;
   3.149 +            } else {
   3.150 +                list->list = next;
   3.151 +            }
   3.152 +            check->next = list->free;
   3.153 +            list->free = check;
   3.154 +            --list->count;
   3.155 +        } else {
   3.156 +            prev = check;
   3.157 +        }
   3.158 +    }
   3.159 +
   3.160 +    dirty->next = list->list;
   3.161 +    list->list = dirty;
   3.162 +    ++list->count;
   3.163 +}
   3.164 +
   3.165 +void
   3.166 +SDL_ClearDirtyRects(SDL_DirtyRectList * list)
   3.167 +{
   3.168 +    while (list->list) {
   3.169 +        SDL_DirtyRect *elem = list->list;
   3.170 +        list->list = elem->next;
   3.171 +        elem->next = list->free;
   3.172 +        list->free = elem;
   3.173 +    }
   3.174 +    list->count = 0;
   3.175 +}
   3.176 +
   3.177 +void
   3.178 +SDL_FreeDirtyRects(SDL_DirtyRectList * list)
   3.179 +{
   3.180 +    while (list->list) {
   3.181 +        SDL_DirtyRect *elem = list->list;
   3.182 +        list->list = elem->next;
   3.183 +        SDL_free(elem);
   3.184 +    }
   3.185 +    while (list->free) {
   3.186 +        SDL_DirtyRect *elem = list->free;
   3.187 +        list->free = elem->next;
   3.188 +        SDL_free(elem);
   3.189 +    }
   3.190 +}
   3.191 +
   3.192 +/* vi: set ts=4 sw=4 expandtab: */
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/video/SDL_rect_c.h	Mon Jul 10 07:34:50 2006 +0000
     4.3 @@ -0,0 +1,41 @@
     4.4 +/*
     4.5 +    SDL - Simple DirectMedia Layer
     4.6 +    Copyright (C) 1997-2006 Sam Lantinga
     4.7 +
     4.8 +    This library is free software; you can redistribute it and/or
     4.9 +    modify it under the terms of the GNU Lesser General Public
    4.10 +    License as published by the Free Software Foundation; either
    4.11 +    version 2.1 of the License, or (at your option) any later version.
    4.12 +
    4.13 +    This library is distributed in the hope that it will be useful,
    4.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    4.16 +    Lesser General Public License for more details.
    4.17 +
    4.18 +    You should have received a copy of the GNU Lesser General Public
    4.19 +    License along with this library; if not, write to the Free Software
    4.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    4.21 +
    4.22 +    Sam Lantinga
    4.23 +    slouken@libsdl.org
    4.24 +*/
    4.25 +#include "SDL_config.h"
    4.26 +
    4.27 +typedef struct SDL_DirtyRect
    4.28 +{
    4.29 +    SDL_Rect rect;
    4.30 +    struct SDL_DirtyRect *next;
    4.31 +} SDL_DirtyRect;
    4.32 +
    4.33 +typedef struct SDL_DirtyRectList
    4.34 +{
    4.35 +    int count;
    4.36 +    SDL_DirtyRect *list;
    4.37 +    SDL_DirtyRect *free;
    4.38 +} SDL_DirtyRectList;
    4.39 +
    4.40 +extern void SDL_AddDirtyRect(SDL_DirtyRectList * list, const SDL_Rect * rect);
    4.41 +extern void SDL_ClearDirtyRects(SDL_DirtyRectList * list);
    4.42 +extern void SDL_FreeDirtyRects(SDL_DirtyRectList * list);
    4.43 +
    4.44 +/* vi: set ts=4 sw=4 expandtab: */
     5.1 --- a/src/video/SDL_renderer_sw.c	Sun Jul 09 18:09:16 2006 +0000
     5.2 +++ b/src/video/SDL_renderer_sw.c	Mon Jul 10 07:34:50 2006 +0000
     5.3 @@ -23,6 +23,7 @@
     5.4  
     5.5  #include "SDL_video.h"
     5.6  #include "SDL_sysvideo.h"
     5.7 +#include "SDL_rect_c.h"
     5.8  #include "SDL_yuv_sw_c.h"
     5.9  
    5.10  
    5.11 @@ -96,8 +97,8 @@
    5.12        SDL_PixelFormat_BGRA8888,
    5.13        SDL_PixelFormat_YUY2,
    5.14        SDL_PixelFormat_UYVY},
    5.15 -     32768,
    5.16 -     32768}
    5.17 +     0,
    5.18 +     0}
    5.19  };
    5.20  
    5.21  typedef struct
    5.22 @@ -106,6 +107,7 @@
    5.23      SDL_Surface *screens[3];
    5.24      SDL_Surface *target;
    5.25      SDL_Renderer *renderer;
    5.26 +    SDL_DirtyRectList dirty;
    5.27  } SDL_SW_RenderData;
    5.28  
    5.29  SDL_Renderer *
    5.30 @@ -125,12 +127,11 @@
    5.31          return NULL;
    5.32      }
    5.33  
    5.34 -    renderer = (SDL_Renderer *) SDL_malloc(sizeof(*renderer));
    5.35 +    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
    5.36      if (!renderer) {
    5.37          SDL_OutOfMemory();
    5.38          return NULL;
    5.39      }
    5.40 -    SDL_zerop(renderer);
    5.41  
    5.42      data = (SDL_SW_RenderData *) SDL_malloc(sizeof(*data));
    5.43      if (!data) {
    5.44 @@ -363,6 +364,8 @@
    5.45      SDL_Rect real_rect = *rect;
    5.46      Uint8 r, g, b, a;
    5.47  
    5.48 +    SDL_AddDirtyRect(&data->dirty, rect);
    5.49 +
    5.50      a = (Uint8) ((color >> 24) & 0xFF);
    5.51      r = (Uint8) ((color >> 16) & 0xFF);
    5.52      g = (Uint8) ((color >> 8) & 0xFF);
    5.53 @@ -381,6 +384,8 @@
    5.54      SDL_Window *window = SDL_GetWindowFromID(renderer->window);
    5.55      SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
    5.56  
    5.57 +    SDL_AddDirtyRect(&data->dirty, dstrect);
    5.58 +
    5.59      if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
    5.60          SDL_Surface *target = data->target;
    5.61          void *pixels =
    5.62 @@ -445,6 +450,8 @@
    5.63      int row;
    5.64      size_t length;
    5.65  
    5.66 +    SDL_AddDirtyRect(&data->dirty, rect);
    5.67 +
    5.68      src = (Uint8 *) pixels;
    5.69      dst =
    5.70          (Uint8 *) surface->pixels + rect->y * surface->pitch +
    5.71 @@ -463,19 +470,22 @@
    5.72  {
    5.73      SDL_SW_RenderData *data = (SDL_SW_RenderData *) renderer->driverdata;
    5.74      SDL_Surface *surface = data->screens[data->current_screen];
    5.75 -    SDL_Rect rect;
    5.76 +    SDL_DirtyRect *dirty;
    5.77      int new_screen;
    5.78  
    5.79      /* Send the data to the display */
    5.80 -    /* FIXME: implement dirty rect updates */
    5.81 -    rect.x = 0;
    5.82 -    rect.y = 0;
    5.83 -    rect.w = surface->w;
    5.84 -    rect.h = surface->h;
    5.85 -    data->renderer->RenderWritePixels(data->renderer, &rect, surface->pixels,
    5.86 -                                      surface->pitch);
    5.87 +    for (dirty = data->dirty.list; dirty; dirty = dirty->next) {
    5.88 +        void *pixels =
    5.89 +            (void *) ((Uint8 *) surface->pixels +
    5.90 +                      dirty->rect.y * surface->pitch +
    5.91 +                      dirty->rect.x * surface->format->BytesPerPixel);
    5.92 +        data->renderer->RenderWritePixels(data->renderer, &dirty->rect,
    5.93 +                                          pixels, surface->pitch);
    5.94 +    }
    5.95 +    SDL_ClearDirtyRects(&data->dirty);
    5.96      data->renderer->RenderPresent(data->renderer);
    5.97  
    5.98 +
    5.99      /* Update the flipping chain, if any */
   5.100      if (renderer->info.flags & SDL_Renderer_PresentFlip2) {
   5.101          new_screen = (data->current_screen + 1) % 2;
   5.102 @@ -514,6 +524,7 @@
   5.103                  SDL_FreeSurface(data->screens[i]);
   5.104              }
   5.105          }
   5.106 +        SDL_FreeDirtyRects(&data->dirty);
   5.107          SDL_free(data);
   5.108      }
   5.109      SDL_free(renderer);
     6.1 --- a/src/video/SDL_surface.c	Sun Jul 09 18:09:16 2006 +0000
     6.2 +++ b/src/video/SDL_surface.c	Mon Jul 10 07:34:50 2006 +0000
     6.3 @@ -41,14 +41,6 @@
     6.4  {
     6.5      SDL_Surface *surface;
     6.6  
     6.7 -    /* FIXME!! */
     6.8 -    /* Make sure the size requested doesn't overflow our datatypes */
     6.9 -    /* Next time I write a library like SDL, I'll use int for size. :) */
    6.10 -    if (width >= 16384 || height >= 65536) {
    6.11 -        SDL_SetError("Width or height is too large");
    6.12 -        return NULL;
    6.13 -    }
    6.14 -
    6.15      /* Allocate the surface */
    6.16      surface = (SDL_Surface *) SDL_malloc(sizeof(*surface));
    6.17      if (surface == NULL) {
    6.18 @@ -211,6 +203,7 @@
    6.19              surface->flags |= SDL_HWSURFACE;
    6.20              surface->w = w;
    6.21              surface->h = h;
    6.22 +            surface->pitch = SDL_CalculatePitch(surface);
    6.23              SDL_SetClipRect(surface, NULL);
    6.24          }
    6.25      }
    6.26 @@ -415,43 +408,6 @@
    6.27  }
    6.28  
    6.29  /*
    6.30 - * A function to calculate the intersection of two rectangles:
    6.31 - * return true if the rectangles intersect, false otherwise
    6.32 - */
    6.33 -SDL_bool
    6.34 -SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B,
    6.35 -                  SDL_Rect * intersection)
    6.36 -{
    6.37 -    int Amin, Amax, Bmin, Bmax;
    6.38 -
    6.39 -    /* Horizontal intersection */
    6.40 -    Amin = A->x;
    6.41 -    Amax = Amin + A->w;
    6.42 -    Bmin = B->x;
    6.43 -    Bmax = Bmin + B->w;
    6.44 -    if (Bmin > Amin)
    6.45 -        Amin = Bmin;
    6.46 -    intersection->x = Amin;
    6.47 -    if (Bmax < Amax)
    6.48 -        Amax = Bmax;
    6.49 -    intersection->w = Amax - Amin > 0 ? Amax - Amin : 0;
    6.50 -
    6.51 -    /* Vertical intersection */
    6.52 -    Amin = A->y;
    6.53 -    Amax = Amin + A->h;
    6.54 -    Bmin = B->y;
    6.55 -    Bmax = Bmin + B->h;
    6.56 -    if (Bmin > Amin)
    6.57 -        Amin = Bmin;
    6.58 -    intersection->y = Amin;
    6.59 -    if (Bmax < Amax)
    6.60 -        Amax = Bmax;
    6.61 -    intersection->h = Amax - Amin > 0 ? Amax - Amin : 0;
    6.62 -
    6.63 -    return (intersection->w && intersection->h);
    6.64 -}
    6.65 -
    6.66 -/*
    6.67   * Set the clipping rectangle for a blittable surface
    6.68   */
    6.69  SDL_bool
     7.1 --- a/src/video/SDL_video.c	Sun Jul 09 18:09:16 2006 +0000
     7.2 +++ b/src/video/SDL_video.c	Mon Jul 10 07:34:50 2006 +0000
     7.3 @@ -1110,6 +1110,7 @@
     7.4              SDL_SetDisplayMode(NULL);
     7.5          }
     7.6      }
     7.7 +    return 0;
     7.8  }
     7.9  
    7.10  void
     8.1 --- a/src/video/win32/SDL_win32modes.c	Sun Jul 09 18:09:16 2006 +0000
     8.2 +++ b/src/video/win32/SDL_win32modes.c	Mon Jul 10 07:34:50 2006 +0000
     8.3 @@ -135,7 +135,6 @@
     8.4          printf("Device: %s\n", WIN_StringToUTF8(DeviceName));
     8.5  #endif
     8.6          for (j = 0;; ++j) {
     8.7 -            int index;
     8.8              SDL_VideoDisplay display;
     8.9              SDL_DisplayData *displaydata;
    8.10              SDL_DisplayMode mode;