summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_zoom.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-06-21 16:06:06 -0600
committerBrian <[email protected]>2007-06-21 16:06:06 -0600
commit578559822e9a19ae4f981b95c7b01906af560507 (patch)
tree4845d5cd838f626318f5ee1c5b9c15b1c8065d8b /src/mesa/swrast/s_zoom.c
parent4d528e54549fb3f12462f9c5ec6e033f1ec91b0f (diff)
parent93becd8a18f6ccf2f86e506ee36fc0bb75787c29 (diff)
Merge branch 'master' of git+ssh://[email protected]/git/mesa/mesa
Diffstat (limited to 'src/mesa/swrast/s_zoom.c')
-rw-r--r--src/mesa/swrast/s_zoom.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c
index 1ab5911f2f1..ab02e3fbb35 100644
--- a/src/mesa/swrast/s_zoom.c
+++ b/src/mesa/swrast/s_zoom.c
@@ -153,16 +153,13 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
zoomed.end = zoomedWidth;
zoomed.array = &zoomed_arrays;
zoomed_arrays.ChanType = span->array->ChanType;
- /* XXX temporary */
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- zoomed_arrays.rgba = zoomed_arrays.rgba8;
-#elif CHAN_TYPE == GL_UNSIGNED_SHORT
- zoomed_arrays.rgba = zoomed_arrays.rgba16;
-#else
- zoomed_arrays.rgba = zoomed_arrays.attribs[FRAG_ATTRIB_COL0];
-#endif
-
- /* copy attribute info (XXX copy all attribs?) */
+ if (zoomed_arrays.ChanType == GL_UNSIGNED_BYTE)
+ zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.rgba8;
+ else if (zoomed_arrays.ChanType == GL_UNSIGNED_SHORT)
+ zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.rgba16;
+ else
+ zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.attribs[FRAG_ATTRIB_COL0];
+
COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]);
COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]);
COPY_4V(zoomed.attrStepY[FRAG_ATTRIB_WPOS], span->attrStepY[FRAG_ATTRIB_WPOS]);