diff src/video/SDL_video.c @ 2927:2133d2d300fd

SetDrawColor() and SetDrawBlendMode() are optional
author Sam Lantinga <slouken@libsdl.org>
date Tue, 30 Dec 2008 07:14:11 +0000
parents bd518fc76f28
children e171ce9bdbad
line wrap: on
line diff
--- a/src/video/SDL_video.c	Tue Dec 30 04:38:39 2008 +0000
+++ b/src/video/SDL_video.c	Tue Dec 30 07:14:11 2008 +0000
@@ -1987,16 +1987,15 @@
     if (!renderer) {
         return -1;
     }
-    if (!renderer->SetDrawColor) {
-        SDL_Unsupported();
-        return -1;
-    }
     renderer->r = r;
     renderer->g = g;
     renderer->b = b;
     renderer->a = a;
-    renderer->SetDrawColor(renderer);
-    return 0;
+    if (renderer->SetDrawColor) {
+        return renderer->SetDrawColor(renderer);
+    } else {
+        return 0;
+    }
 }
 
 int
@@ -2012,10 +2011,6 @@
     if (!renderer) {
         return -1;
     }
-    if (!renderer->SetDrawColor) {
-        SDL_Unsupported();
-        return -1;
-    }
     if (r) {
         *r = renderer->r;
     }
@@ -2028,7 +2023,6 @@
     if (a) {
         *a = renderer->a;
     }
-    return 0;
 }
 
 int
@@ -2044,13 +2038,12 @@
     if (!renderer) {
         return -1;
     }
-    if (!renderer->SetDrawBlendMode) {
-        SDL_Unsupported();
-        return -1;
+    renderer->blendMode = blendMode;
+    if (renderer->SetDrawBlendMode) {
+        return renderer->SetDrawBlendMode(renderer);
+    } else {
+        return 0;
     }
-    renderer->blendMode = blendMode;
-    renderer->SetDrawBlendMode(renderer);
-    return 0;
 }
 
 int