diff src/video/SDL_blendline.c @ 2900:3a9636c83849

Make it possible to switch algorithms in the future
author Sam Lantinga <slouken@libsdl.org>
date Sun, 21 Dec 2008 08:59:56 +0000
parents a0c837a16e4c
children 3da0bb421d83
line wrap: on
line diff
--- a/src/video/SDL_blendline.c	Sun Dec 21 08:55:06 2008 +0000
+++ b/src/video/SDL_blendline.c	Sun Dec 21 08:59:56 2008 +0000
@@ -31,16 +31,16 @@
 
     switch (blendMode) {
     case SDL_BLENDMODE_BLEND:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_BLEND_RGB555);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_BLEND_RGB555);
         break;
     case SDL_BLENDMODE_ADD:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_RGB555);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_RGB555);
         break;
     case SDL_BLENDMODE_MOD:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_MOD_RGB555);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_MOD_RGB555);
         break;
     default:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_RGB555);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_RGB555);
         break;
     }
     return 0;
@@ -54,16 +54,16 @@
 
     switch (blendMode) {
     case SDL_BLENDMODE_BLEND:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_BLEND_RGB565);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_BLEND_RGB565);
         break;
     case SDL_BLENDMODE_ADD:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_RGB565);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_RGB565);
         break;
     case SDL_BLENDMODE_MOD:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_MOD_RGB565);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_MOD_RGB565);
         break;
     default:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_RGB565);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_RGB565);
         break;
     }
     return 0;
@@ -77,16 +77,16 @@
 
     switch (blendMode) {
     case SDL_BLENDMODE_BLEND:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_BLEND_RGB888);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_BLEND_RGB888);
         break;
     case SDL_BLENDMODE_ADD:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_RGB888);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_RGB888);
         break;
     case SDL_BLENDMODE_MOD:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_MOD_RGB888);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_MOD_RGB888);
         break;
     default:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_RGB888);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_RGB888);
         break;
     }
     return 0;
@@ -100,16 +100,16 @@
 
     switch (blendMode) {
     case SDL_BLENDMODE_BLEND:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_BLEND_ARGB8888);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_BLEND_ARGB8888);
         break;
     case SDL_BLENDMODE_ADD:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_ARGB8888);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_ARGB8888);
         break;
     case SDL_BLENDMODE_MOD:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_MOD_ARGB8888);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_MOD_ARGB8888);
         break;
     default:
-        BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY_ARGB8888);
+        DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY_ARGB8888);
         break;
     }
     return 0;
@@ -126,32 +126,32 @@
     case 2:
         switch (blendMode) {
         case SDL_BLENDMODE_BLEND:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY2_BLEND_RGB);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY2_BLEND_RGB);
             break;
         case SDL_BLENDMODE_ADD:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY2_ADD_RGB);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY2_ADD_RGB);
             break;
         case SDL_BLENDMODE_MOD:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY2_MOD_RGB);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY2_MOD_RGB);
             break;
         default:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY2_RGB);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY2_RGB);
             break;
         }
         return 0;
     case 4:
         switch (blendMode) {
         case SDL_BLENDMODE_BLEND:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY4_BLEND_RGB);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY4_BLEND_RGB);
             break;
         case SDL_BLENDMODE_ADD:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY4_ADD_RGB);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY4_ADD_RGB);
             break;
         case SDL_BLENDMODE_MOD:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY4_MOD_RGB);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY4_MOD_RGB);
             break;
         default:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY4_RGB);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY4_RGB);
             break;
         }
         return 0;
@@ -172,16 +172,16 @@
     case 4:
         switch (blendMode) {
         case SDL_BLENDMODE_BLEND:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY4_BLEND_RGBA);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY4_BLEND_RGBA);
             break;
         case SDL_BLENDMODE_ADD:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY4_ADD_RGBA);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY4_ADD_RGBA);
             break;
         case SDL_BLENDMODE_MOD:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY4_MOD_RGBA);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY4_MOD_RGBA);
             break;
         default:
-            BRESENHAM(x1, y1, x2, y2, DRAW_SETPIXELXY4_RGBA);
+            DRAWLINE(x1, y1, x2, y2, DRAW_SETPIXELXY4_RGBA);
             break;
         }
         return 0;