summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_zoom.c
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-05-20 12:27:39 -0600
committerBrian <brian@yutani.localnet.net>2007-05-20 12:27:39 -0600
commit9e8a961dd7d7b717a9fb4ecdea1c1b60ea355efe (patch)
tree60c87644ec38f4693ceecbf440b120b02e2d07e6 /src/mesa/swrast/s_zoom.c
parentaa133a9dae53bc6aa50b88ee43deb8b34e8d0029 (diff)
Overhaul/simplify SWvertex and SWspan attribute handling.
Instead of separate fog/specular/texcoord/varying code, just treat all of them as generic attributes. Simplifies the point/line/triangle functions.
Diffstat (limited to 'src/mesa/swrast/s_zoom.c')
-rw-r--r--src/mesa/swrast/s_zoom.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c
index 0908265fe9..78fa137d3f 100644
--- a/src/mesa/swrast/s_zoom.c
+++ b/src/mesa/swrast/s_zoom.c
@@ -155,14 +155,11 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
zoomed_arrays.ChanType = span->array->ChanType;
/* XXX temporary */
#if CHAN_TYPE == GL_UNSIGNED_BYTE
- zoomed_arrays.rgba = zoomed_arrays.color.sz1.rgba;
- zoomed_arrays.spec = zoomed_arrays.color.sz1.spec;
+ zoomed_arrays.rgba = zoomed_arrays.rgba8;
#elif CHAN_TYPE == GL_UNSIGNED_SHORT
- zoomed_arrays.rgba = zoomed_arrays.color.sz2.rgba;
- zoomed_arrays.spec = zoomed_arrays.color.sz2.spec;
+ zoomed_arrays.rgba = zoomed_arrays.rgba16;
#else
zoomed_arrays.rgba = zoomed_arrays.attribs[FRAG_ATTRIB_COL0];
- zoomed_arrays.spec = zoomed_arrays.attribs[FRAG_ATTRIB_COL1];
#endif
@@ -219,7 +216,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
ASSERT(j < (GLint) span->end);
- COPY_4UBV(zoomed.array->color.sz1.rgba[i], rgba[j]);
+ COPY_4UBV(zoomed.array->rgba8[i], rgba[j]);
}
}
else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) {
@@ -229,7 +226,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
ASSERT(j < (GLint) span->end);
- COPY_4V(zoomed.array->color.sz2.rgba[i], rgba[j]);
+ COPY_4V(zoomed.array->rgba16[i], rgba[j]);
}
}
else {
@@ -251,10 +248,10 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
ASSERT(j < (GLint) span->end);
- zoomed.array->color.sz1.rgba[i][0] = rgb[j][0];
- zoomed.array->color.sz1.rgba[i][1] = rgb[j][1];
- zoomed.array->color.sz1.rgba[i][2] = rgb[j][2];
- zoomed.array->color.sz1.rgba[i][3] = 0xff;
+ zoomed.array->rgba8[i][0] = rgb[j][0];
+ zoomed.array->rgba8[i][1] = rgb[j][1];
+ zoomed.array->rgba8[i][2] = rgb[j][2];
+ zoomed.array->rgba8[i][3] = 0xff;
}
}
else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) {
@@ -264,10 +261,10 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
ASSERT(j < (GLint) span->end);
- zoomed.array->color.sz2.rgba[i][0] = rgb[j][0];
- zoomed.array->color.sz2.rgba[i][1] = rgb[j][1];
- zoomed.array->color.sz2.rgba[i][2] = rgb[j][2];
- zoomed.array->color.sz2.rgba[i][3] = 0xffff;
+ zoomed.array->rgba16[i][0] = rgb[j][0];
+ zoomed.array->rgba16[i][1] = rgb[j][1];
+ zoomed.array->rgba16[i][2] = rgb[j][2];
+ zoomed.array->rgba16[i][3] = 0xffff;
}
}
else {
@@ -314,8 +311,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
* Also, clipping may change the span end value, so store it as well.
*/
const GLint end = zoomed.end; /* save */
- /* use specular color array for temp storage */
- void *rgbaSave = zoomed.array->spec;
+ GLuint rgbaSave[MAX_WIDTH][4];
const GLint pixelSize =
(zoomed.array->ChanType == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) :
((zoomed.array->ChanType == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort)
@@ -334,7 +330,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
}
else if (format == GL_COLOR_INDEX) {
/* use specular color array for temp storage */
- GLuint *indexSave = (GLuint *) zoomed.array->spec;
+ GLuint *indexSave = (GLuint *) zoomed.array->attribs[FRAG_ATTRIB_FOGC];
const GLint end = zoomed.end; /* save */
if (y1 - y0 > 1) {
MEMCPY(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint));