src/video/SDL_video.c
changeset 2810 27cb878a278e
parent 2789 985001797115
child 2814 e841aa93e6be
     1.1 --- a/src/video/SDL_video.c	Sat Nov 29 21:48:14 2008 +0000
     1.2 +++ b/src/video/SDL_video.c	Sun Nov 30 21:58:23 2008 +0000
     1.3 @@ -1476,7 +1476,11 @@
     1.4          return 0;
     1.5      }
     1.6      renderer = SDL_CurrentDisplay.current_renderer;
     1.7 -    if (!renderer || !renderer->CreateTexture) {
     1.8 +    if (!renderer) {
     1.9 +        return 0;
    1.10 +    }
    1.11 +    if (!renderer->CreateTexture) {
    1.12 +        SDL_Unsupported();
    1.13          return 0;
    1.14      }
    1.15      texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture));
    1.16 @@ -1669,6 +1673,7 @@
    1.17      }
    1.18      renderer = texture->renderer;
    1.19      if (!renderer->QueryTexturePixels) {
    1.20 +        SDL_Unsupported();
    1.21          return -1;
    1.22      }
    1.23      return renderer->QueryTexturePixels(renderer, texture, pixels, pitch);
    1.24 @@ -1686,6 +1691,7 @@
    1.25      }
    1.26      renderer = texture->renderer;
    1.27      if (!renderer->SetTexturePalette) {
    1.28 +        SDL_Unsupported();
    1.29          return -1;
    1.30      }
    1.31      return renderer->SetTexturePalette(renderer, texture, colors, firstcolor,
    1.32 @@ -1704,6 +1710,7 @@
    1.33      }
    1.34      renderer = texture->renderer;
    1.35      if (!renderer->GetTexturePalette) {
    1.36 +        SDL_Unsupported();
    1.37          return -1;
    1.38      }
    1.39      return renderer->GetTexturePalette(renderer, texture, colors, firstcolor,
    1.40 @@ -1721,6 +1728,7 @@
    1.41      }
    1.42      renderer = texture->renderer;
    1.43      if (!renderer->SetTextureColorMod) {
    1.44 +        SDL_Unsupported();
    1.45          return -1;
    1.46      }
    1.47      if (r < 255 || g < 255 || b < 255) {
    1.48 @@ -1768,6 +1776,7 @@
    1.49      }
    1.50      renderer = texture->renderer;
    1.51      if (!renderer->SetTextureAlphaMod) {
    1.52 +        SDL_Unsupported();
    1.53          return -1;
    1.54      }
    1.55      if (alpha < 255) {
    1.56 @@ -1804,6 +1813,7 @@
    1.57      }
    1.58      renderer = texture->renderer;
    1.59      if (!renderer->SetTextureBlendMode) {
    1.60 +        SDL_Unsupported();
    1.61          return -1;
    1.62      }
    1.63      texture->blendMode = blendMode;
    1.64 @@ -1835,6 +1845,7 @@
    1.65      }
    1.66      renderer = texture->renderer;
    1.67      if (!renderer->SetTextureScaleMode) {
    1.68 +        SDL_Unsupported();
    1.69          return -1;
    1.70      }
    1.71      texture->scaleMode = scaleMode;
    1.72 @@ -1868,6 +1879,7 @@
    1.73      }
    1.74      renderer = texture->renderer;
    1.75      if (!renderer->UpdateTexture) {
    1.76 +        SDL_Unsupported();
    1.77          return -1;
    1.78      }
    1.79      if (!rect) {
    1.80 @@ -1897,6 +1909,7 @@
    1.81      }
    1.82      renderer = texture->renderer;
    1.83      if (!renderer->LockTexture) {
    1.84 +        SDL_Unsupported();
    1.85          return -1;
    1.86      }
    1.87      if (!rect) {
    1.88 @@ -1961,7 +1974,11 @@
    1.89          return -1;
    1.90      }
    1.91      renderer = SDL_CurrentDisplay.current_renderer;
    1.92 -    if (!renderer || !renderer->RenderFill) {
    1.93 +    if (!renderer) {
    1.94 +        return -1;
    1.95 +    }
    1.96 +    if(!renderer->RenderFill) {
    1.97 +        SDL_Unsupported();
    1.98          return -1;
    1.99      }
   1.100      window = SDL_GetWindowFromID(renderer->window);
   1.101 @@ -1991,7 +2008,11 @@
   1.102          return -1;
   1.103      }
   1.104      renderer = SDL_CurrentDisplay.current_renderer;
   1.105 -    if (!renderer || !renderer->RenderCopy) {
   1.106 +    if (!renderer) {
   1.107 +        return -1;
   1.108 +    }
   1.109 +    if (!renderer->RenderCopy) {
   1.110 +        SDL_Unsupported();
   1.111          return -1;
   1.112      }
   1.113      window = SDL_GetWindowFromID(renderer->window);