diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2002-11-13 16:51:01 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2002-11-13 16:51:01 +0000 |
commit | cdf2da368d180205df3573697b51b8764048ad6e (patch) | |
tree | fb8cdd07a95617ff37a7aec3981a00fe4e84c3a0 /src/mesa/drivers/dos | |
parent | 36723b6538f1b9b59981cb6402a2dd807debee27 (diff) |
moved function declaration into the template, define the NAME to specify the function names
Diffstat (limited to 'src/mesa/drivers/dos')
-rw-r--r-- | src/mesa/drivers/dos/dmesa.c | 70 |
1 files changed, 24 insertions, 46 deletions
diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 77c9a3a1b8..2034fb1cff 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -274,43 +274,34 @@ static void read_rgba_pixels (const GLcontext *ctx, /*
* flat, NON-depth-buffered, triangle.
*/
-static void tri_rgb_flat (GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2)
-{
- const DMesaContext c = (DMesaContext)ctx->DriverCtx;
- void *b = c->Buffer->the_window;
+#define NAME tri_rgb_flat
+#define SETUP_CODE \
+ GLuint rgb = vl_mixrgb(v2->color); \
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx; \
+ void *b = c->Buffer->the_window; \
GLuint w = c->Buffer->width, h = c->Buffer->height;
-#define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color);
-
#define RENDER_SPAN(span) \
GLuint i, offset = FLIP2(span.y)*w + span.x; \
for (i = 0; i < span.end; i++, offset++) { \
vl_putpixel(b, offset, rgb); \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* flat, depth-buffered, triangle.
*/
-static void tri_rgb_flat_z (GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2)
-{
- const DMesaContext c = (DMesaContext)ctx->DriverCtx;
- void *b = c->Buffer->the_window;
- GLuint w = c->Buffer->width, h = c->Buffer->height;
-
+#define NAME tri_rgb_flat_z
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color);
+#define SETUP_CODE \
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx; \
+ void *b = c->Buffer->the_window; \
+ GLuint w = c->Buffer->width, h = c->Buffer->height; \
+ GLuint rgb = vl_mixrgb(v2->color);
#define RENDER_SPAN(span) \
GLuint i, offset = FLIP2(span.y)*w + span.x; \
@@ -322,25 +313,20 @@ static void tri_rgb_flat_z (GLcontext *ctx, } \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* smooth, NON-depth-buffered, triangle.
*/
-static void tri_rgb_smooth (GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2)
-{
- const DMesaContext c = (DMesaContext)ctx->DriverCtx;
- void *b = c->Buffer->the_window;
- GLuint w = c->Buffer->width, h = c->Buffer->height;
-
+#define NAME tri_rgb_smooth
#define INTERP_RGB 1
+#define SETUP_CODE \
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx; \
+ void *b = c->Buffer->the_window; \
+ GLuint w = c->Buffer->width, h = c->Buffer->height;
#define RENDER_SPAN(span) \
GLuint i, offset = FLIP2(span.y)*w + span.x; \
for (i = 0; i < span.end; i++, offset++) { \
@@ -353,28 +339,21 @@ static void tri_rgb_smooth (GLcontext *ctx, span.green += span.greenStep; \
span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
/*
* smooth, depth-buffered, triangle.
*/
-static void tri_rgb_smooth_z (GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2)
-{
- const DMesaContext c = (DMesaContext)ctx->DriverCtx;
- void *b = c->Buffer->the_window;
- GLuint w = c->Buffer->width, h = c->Buffer->height;
-
+#define NAME tri_rgb_smooth_z
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
-
+#define SETUP_CODE \
+ const DMesaContext c = (DMesaContext)ctx->DriverCtx; \
+ void *b = c->Buffer->the_window; \
+ GLuint w = c->Buffer->width, h = c->Buffer->height;
#define RENDER_SPAN(span) \
GLuint i, offset = FLIP2(span.y)*w + span.x; \
for (i = 0; i < span.end; i++, offset++) { \
@@ -392,9 +371,8 @@ static void tri_rgb_smooth_z (GLcontext *ctx, span.blue += span.blueStep; \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
|