Renamed some static vars to make it clear they're 1.2 versions of structs.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 13 Feb 2019 20:50:48 -0500
changeset 56a8a08936f60f
parent 55 852e5d3808f2
child 57 9bc9f6285f0b
Renamed some static vars to make it clear they're 1.2 versions of structs.
src/SDL12_compat.c
     1.1 --- a/src/SDL12_compat.c	Wed Feb 13 17:48:31 2019 -0500
     1.2 +++ b/src/SDL12_compat.c	Wed Feb 13 20:50:48 2019 -0500
     1.3 @@ -420,23 +420,21 @@
     1.4  // !!! FIXME: go through all of these.
     1.5  static VideoModeList *VideoModes = NULL;
     1.6  static int VideoModesCount = 0;
     1.7 -static SDL12_VideoInfo VideoInfo;
     1.8 +static SDL12_VideoInfo VideoInfo12;
     1.9  static SDL_Window *VideoWindow20 = NULL;
    1.10 -static SDL12_Surface *WindowSurface = NULL;
    1.11 -static SDL12_Surface *VideoSurface = NULL;
    1.12 -static SDL12_Surface *ShadowSurface = NULL;
    1.13 -static SDL12_Surface *PublicSurface = NULL;
    1.14 -static SDL_GLContext *VideoContext = NULL;
    1.15 -static Uint32 VideoFlags = 0;
    1.16 -static SDL_Rect VideoViewport;
    1.17 +static SDL_Renderer *VideoRenderer20 = NULL;
    1.18 +static SDL_Texture *VideoTexture20 = NULL;
    1.19 +static SDL12_Surface *VideoSurface12 = NULL;
    1.20 +static SDL_Surface *VideoConvertSurface20 = NULL;
    1.21 +static SDL_GLContext *VideoGLContext20 = NULL;
    1.22  static char *WindowTitle = NULL;
    1.23  static char *WindowIconTitle = NULL;
    1.24 -static SDL_Surface *VideoIcon;
    1.25 +static SDL12_Surface *VideoIcon12;
    1.26  static int EnabledUnicode = 0;
    1.27  static int VideoDisplayIndex = 0;
    1.28  static int CDRomInit = 0;
    1.29  static SDL12_EventFilter EventFilter12 = NULL;
    1.30 -static SDL12_Cursor *CurrentCursor = NULL;
    1.31 +static SDL12_Cursor *CurrentCursor12 = NULL;
    1.32  static Uint8 EventStates[SDL12_NUMEVENTS];
    1.33  static int SwapInterval = 0;
    1.34  
    1.35 @@ -757,12 +755,12 @@
    1.36      }
    1.37      SDL20_free(VideoModes);
    1.38  
    1.39 -    SDL20_FreeFormat(VideoInfo.vfmt);
    1.40 -    SDL20_zero(VideoInfo);
    1.41 +    SDL20_FreeFormat(VideoInfo12.vfmt);
    1.42 +    SDL20_zero(VideoInfo12);
    1.43  
    1.44      EventFilter12 = NULL;
    1.45      EventQueueAvailable = EventQueueHead = EventQueueTail = NULL;
    1.46 -    CurrentCursor = NULL;
    1.47 +    CurrentCursor12 = NULL;
    1.48      VideoModes = NULL;
    1.49      VideoModesCount = 0;
    1.50  }
    1.51 @@ -1424,17 +1422,17 @@
    1.52  {
    1.53      SDL_DisplayMode mode;
    1.54  
    1.55 -    // !!! FIXME: calculate this in Init12Video(), then this just does: return VideoInfo.vfmt ? &VideoInfo : NULL;
    1.56 +    FIXME("calculate this in Init12Video(), then this just does: return VideoInfo.vfmt ? &VideoInfo : NULL;");
    1.57  
    1.58 -    if (!VideoInfo.vfmt && SDL20_GetDesktopDisplayMode(VideoDisplayIndex, &mode) == 0) {
    1.59 -        VideoInfo.vfmt = SDL20_AllocFormat(mode.format);
    1.60 -        VideoInfo.current_w = mode.w;
    1.61 -        VideoInfo.current_h = mode.h;
    1.62 -        // !!! FIXME
    1.63 -        //VideoInfo.wm_available = 1;
    1.64 -        //VideoInfo.video_mem = 1024 * 256;
    1.65 +    if (!VideoInfo12.vfmt && SDL20_GetDesktopDisplayMode(VideoDisplayIndex, &mode) == 0) {
    1.66 +        VideoInfo12.vfmt = SDL20_AllocFormat(mode.format);
    1.67 +        VideoInfo12.current_w = mode.w;
    1.68 +        VideoInfo12.current_h = mode.h;
    1.69 +        FIXME("vidinfo details commented out");
    1.70 +        //VideoInfo12.wm_available = 1;
    1.71 +        //VideoInfo12.video_mem = 1024 * 256;
    1.72      }
    1.73 -    return &VideoInfo;
    1.74 +    return &VideoInfo12;
    1.75  }
    1.76  
    1.77  DECLSPEC int SDLCALL
    1.78 @@ -1478,7 +1476,7 @@
    1.79          return NULL;
    1.80      }
    1.81  
    1.82 -    if ((!format12) && (!VideoInfo.vfmt)) {
    1.83 +    if ((!format12) && (!VideoInfo12.vfmt)) {
    1.84          SDL20_SetError("No pixel format specified");
    1.85          return NULL;
    1.86      }
    1.87 @@ -1490,7 +1488,7 @@
    1.88      if (format12) {
    1.89          fmt = SDL20_MasksToPixelFormatEnum(format12->BitsPerPixel, format12->Rmask, format12->Gmask, format12->Bmask, format12->Amask);
    1.90      } else {
    1.91 -        fmt = VideoInfo.vfmt->format;
    1.92 +        fmt = VideoInfo12.vfmt->format;
    1.93      }
    1.94  
    1.95      for (i = 0; i < VideoModesCount; i++) {
    1.96 @@ -1564,14 +1562,14 @@
    1.97  DECLSPEC void SDLCALL
    1.98  SDL_SetCursor(SDL12_Cursor *cursor)
    1.99  {
   1.100 -    CurrentCursor = cursor;
   1.101 +    CurrentCursor12 = cursor;
   1.102      SDL20_SetCursor(cursor ? cursor->wm_cursor : NULL);
   1.103  }
   1.104  
   1.105  DECLSPEC SDL12_Cursor * SDLCALL
   1.106  SDL_GetCursor(void)
   1.107  {
   1.108 -    return CurrentCursor;
   1.109 +    return CurrentCursor12;
   1.110  }
   1.111  
   1.112  static void
   1.113 @@ -1626,7 +1624,7 @@
   1.114  DECLSPEC SDL12_Surface * SDLCALL
   1.115  SDL_GetVideoSurface(void)
   1.116  {
   1.117 -#error write me
   1.118 +    return VideoSurface12;
   1.119  }
   1.120  
   1.121  DECLSPEC int SDLCALL