summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2010-03-11 12:14:05 +0100
committerMichel Dänzer <[email protected]>2010-03-11 12:14:05 +0100
commitfc1dd5ce1de8b9c0a02b9fb08aaeac0c38372e65 (patch)
tree65719e70a7ff5d37a9626c63fbe8f505370e4b27 /src/mesa
parentaa311ae61680f0fc300e33e8955c6c58cafd5fb4 (diff)
parent54af54277a7a469ed2b9821ef6ed7ed464381f91 (diff)
Merge remote branch 'origin/7.8'
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/windows/gdi/wmesa.c27
-rw-r--r--src/mesa/drivers/windows/gdi/wmesadef.h2
-rw-r--r--src/mesa/swrast/s_span.c2
3 files changed, 10 insertions, 21 deletions
diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c
index 91ddc3615a1..22b0c46b4f7 100644
--- a/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/src/mesa/drivers/windows/gdi/wmesa.c
@@ -248,16 +248,6 @@ static void wmesa_flush(GLcontext *ctx)
*/
/*
- * Set the color index used to clear the color buffer.
- */
-static void clear_index(GLcontext *ctx, GLuint index)
-{
- WMesaContext pwc = wmesa_context(ctx);
- /* Note that indexed mode is not supported yet */
- pwc->clearColorRef = RGB(0,0,0);
-}
-
-/*
* Set the color used to clear the color buffer.
*/
static void clear_color(GLcontext *ctx, const GLfloat color[4])
@@ -482,7 +472,7 @@ static void write_rgba_span_front(const GLcontext *ctx,
};
} BGRA;
BGRA *bgra, c;
- int i;
+ GLuint i;
if (n < 16) { // the value 16 is just guessed
y=FLIP(y);
@@ -827,9 +817,9 @@ static void read_rgba_span_32(const GLcontext *ctx,
lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
for (i=0; i<n; i++) {
pixel = lpdw[i];
- rgba[i][RCOMP] = (pixel & 0x00ff0000) >> 16;
- rgba[i][GCOMP] = (pixel & 0x0000ff00) >> 8;
- rgba[i][BCOMP] = (pixel & 0x000000ff);
+ rgba[i][RCOMP] = (GLubyte)((pixel & 0x00ff0000) >> 16);
+ rgba[i][GCOMP] = (GLubyte)((pixel & 0x0000ff00) >> 8);
+ rgba[i][BCOMP] = (GLubyte)(pixel & 0x000000ff);
rgba[i][ACOMP] = 255;
}
}
@@ -851,9 +841,9 @@ static void read_rgba_pixels_32(const GLcontext *ctx,
GLint y2 = FLIP(y[i]);
lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i];
pixel = *lpdw;
- rgba[i][RCOMP] = (pixel & 0x00ff0000) >> 16;
- rgba[i][GCOMP] = (pixel & 0x0000ff00) >> 8;
- rgba[i][BCOMP] = (pixel & 0x000000ff);
+ rgba[i][RCOMP] = (GLubyte)((pixel & 0x00ff0000) >> 16);
+ rgba[i][GCOMP] = (GLubyte)((pixel & 0x0000ff00) >> 8);
+ rgba[i][BCOMP] = (GLubyte)(pixel & 0x000000ff);
rgba[i][ACOMP] = 255;
}
}
@@ -1271,7 +1261,7 @@ wmesa_renderbuffer_storage(GLcontext *ctx,
* on if we're drawing to the front or back color buffer.
*/
void wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat,
- BYTE cColorBits, int double_buffer)
+ int cColorBits, int double_buffer)
{
if (double_buffer) {
/* back buffer */
@@ -1483,7 +1473,6 @@ WMesaContext WMesaCreateContext(HDC hDC,
functions.GetBufferSize = wmesa_get_buffer_size;
functions.Flush = wmesa_flush;
functions.Clear = clear;
- functions.ClearIndex = clear_index;
functions.ClearColor = clear_color;
functions.ResizeBuffers = wmesa_resize_buffers;
functions.Viewport = wmesa_viewport;
diff --git a/src/mesa/drivers/windows/gdi/wmesadef.h b/src/mesa/drivers/windows/gdi/wmesadef.h
index 83a42e60824..1c0e2451114 100644
--- a/src/mesa/drivers/windows/gdi/wmesadef.h
+++ b/src/mesa/drivers/windows/gdi/wmesadef.h
@@ -27,7 +27,7 @@ struct wmesa_framebuffer
HDC hDC;
int pixelformat;
GLuint ScanWidth;
- BYTE cColorBits;
+ int cColorBits;
/* back buffer DIB fields */
HDC dib_hDC;
BITMAPINFO bmi;
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 29f070686fe..687c8eb0bf8 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -60,6 +60,7 @@
void
_swrast_span_default_attribs(GLcontext *ctx, SWspan *span)
{
+ GLchan r, g, b, a;
/* Z*/
{
const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF;
@@ -80,7 +81,6 @@ _swrast_span_default_attribs(GLcontext *ctx, SWspan *span)
span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0;
/* primary color, or color index */
- GLchan r, g, b, a;
UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]);
UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]);
UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]);