clarify that line_stipple_factor is in [0,255] corresponding to GL's range of [1...
authorBrian <brian.paul@tungstengraphics.com>
Tue, 3 Jul 2007 16:58:03 +0000 (10:58 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Tue, 3 Jul 2007 16:58:03 +0000 (10:58 -0600)
src/mesa/pipe/p_state.h
src/mesa/state_tracker/st_atom_setup.c

index 7f9a6d12de77c1f014ebee7bcc271c9ac49a89ed..9b4b3366540ec06c418c8104b0caa617b065058f 100644 (file)
@@ -87,7 +87,7 @@ struct pipe_setup_state
 
    GLuint point_smooth:1;
 
-   GLubyte line_stipple_factor;  /**< [1..255] only */
+   GLubyte line_stipple_factor;  /**< [1..256] actually */
    GLushort line_stipple_pattern;
    GLfloat line_width;
    GLfloat point_size;           /**< used when no per-vertex size */
index 23adf0b7c86cff464c4fd0a3ee7ff9808bc48499..457bfaa9ba84b9f81cec12d0170f3b96d6213f79 100644 (file)
@@ -184,7 +184,8 @@ static void update_setup_state( struct st_context *st )
    setup.line_smooth = ctx->Line.SmoothFlag;
    setup.line_stipple_enable = ctx->Line.StippleFlag;
    setup.line_stipple_pattern = ctx->Line.StipplePattern;
-   setup.line_stipple_factor = ctx->Line.StippleFactor;
+   /* GL stipple factor is in [1,256], remap to [0, 255] here */
+   setup.line_stipple_factor = ctx->Line.StippleFactor - 1;
 
 
    if (memcmp(&setup, &st->state.setup, sizeof(setup)) != 0) {