Browse Source

windows: fix compilation errors and warnings

tags/7.8-rc1
Karl Schultz 15 years ago
parent
commit
60121c41ce

+ 8
- 19
src/mesa/drivers/windows/gdi/wmesa.c View File

* span writing interface, which is very slow for a clear operation. * span writing interface, which is very slow for a clear operation.
*/ */


/*
* 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. * Set the color used to clear the color buffer.
*/ */
}; };
} BGRA; } BGRA;
BGRA *bgra, c; BGRA *bgra, c;
int i;
GLuint i;


if (n < 16) { // the value 16 is just guessed if (n < 16) { // the value 16 is just guessed
y=FLIP(y); y=FLIP(y);
lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x;
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
pixel = lpdw[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; rgba[i][ACOMP] = 255;
} }
} }
GLint y2 = FLIP(y[i]); GLint y2 = FLIP(y[i]);
lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i]; lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i];
pixel = *lpdw; 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; rgba[i][ACOMP] = 255;
} }
} }
* on if we're drawing to the front or back color buffer. * on if we're drawing to the front or back color buffer.
*/ */
void wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat, void wmesa_set_renderbuffer_funcs(struct gl_renderbuffer *rb, int pixelformat,
BYTE cColorBits, int double_buffer)
int cColorBits, int double_buffer)
{ {
if (double_buffer) { if (double_buffer) {
/* back buffer */ /* back buffer */
functions.GetBufferSize = wmesa_get_buffer_size; functions.GetBufferSize = wmesa_get_buffer_size;
functions.Flush = wmesa_flush; functions.Flush = wmesa_flush;
functions.Clear = clear; functions.Clear = clear;
functions.ClearIndex = clear_index;
functions.ClearColor = clear_color; functions.ClearColor = clear_color;
functions.ResizeBuffers = wmesa_resize_buffers; functions.ResizeBuffers = wmesa_resize_buffers;
functions.Viewport = wmesa_viewport; functions.Viewport = wmesa_viewport;

+ 1
- 1
src/mesa/drivers/windows/gdi/wmesadef.h View File

HDC hDC; HDC hDC;
int pixelformat; int pixelformat;
GLuint ScanWidth; GLuint ScanWidth;
BYTE cColorBits;
int cColorBits;
/* back buffer DIB fields */ /* back buffer DIB fields */
HDC dib_hDC; HDC dib_hDC;
BITMAPINFO bmi; BITMAPINFO bmi;

+ 1
- 1
src/mesa/swrast/s_span.c View File

void void
_swrast_span_default_attribs(GLcontext *ctx, SWspan *span) _swrast_span_default_attribs(GLcontext *ctx, SWspan *span)
{ {
GLchan r, g, b, a;
/* Z*/ /* Z*/
{ {
const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF;
span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0; span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0;


/* primary color, or color index */ /* primary color, or color index */
GLchan r, g, b, a;
UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]); UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]);
UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]); UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]);
UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]); UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]);

+ 30
- 0
windows/VC8/mesa/.gitignore View File

debug/
debug static crt/
release/
release static crt/
gdi/Debug/
gdi/Debug Static CRT/
gdi/Release/
gdi/Release Static CRT/
gdi/*.user
glsl_apps_compile/Debug
glsl_apps_compile/Release
glsl_apps_compile/*.user
glu/Debug/
glu/Debug Static CRT/
glu/Release/
glu/Release Static CRT/
glu/*.user
mesa.ncb
mesa.suo
mesa/Debug/
mesa/Debug Static CRT/
mesa/Release/
mesa/Release Static CRT/
mesa/*.user
osmesa/Debug/
osmesa/Debug Static CRT/
osmesa/Release/
osmesa/Release Static CRT/
osmesa/*.user


+ 17
- 0
windows/VC8/progs/.gitignore View File

debug/
debug static crt/
release/
release static crt/
demos/Debug/
demos/Debug Static CRT/
demos/Release/
demos/Release Static CRT/
demos/*.user
glut/Debug/
glut/Debug Static CRT/
glut/Release/
glut/Release Static CRT/
glut/*.user
progs.ncb
progs.suo


Loading…
Cancel
Save