Fix typo
[mesa.git] / src / mesa / swrast / s_bitmap.c
index 646081b83e1a1abf7ccaad39975ce4b3e489d440..3a77004520c51fbf031233c2bac9e515c6599157 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: s_bitmap.c,v 1.1 2000/10/31 18:00:04 keithw Exp $ */
+/* $Id: s_bitmap.c,v 1.5 2001/03/03 20:33:30 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  3.3
+ * Version:  3.5
  * 
- * Copyright (C) 1999  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -30,6 +30,7 @@
 #include "macros.h"
 #include "pixel.h"
 
+#include "s_context.h"
 #include "s_fog.h"
 #include "s_pb.h"
 
@@ -44,7 +45,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
                const struct gl_pixelstore_attrib *unpack,
                const GLubyte *bitmap )
 {
-   struct pixel_buffer *PB = ctx->PB;
+   struct pixel_buffer *PB = SWRAST_CONTEXT(ctx)->PB;
    GLint row, col;
    GLdepth fragZ;
    GLfixed fogCoord;
@@ -52,13 +53,11 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
    ASSERT(ctx->RenderMode == GL_RENDER);
    ASSERT(bitmap);
 
-   if (ctx->PB->primitive != GL_BITMAP) {
-      gl_flush_pb( ctx );
-      ctx->PB->primitive = GL_BITMAP;
-   }
+   if (SWRAST_CONTEXT(ctx)->NewState)
+      _swrast_validate_derived( ctx );
 
    /* Set bitmap drawing color */
-   if (ctx->Visual.RGBAflag) {
+   if (ctx->Visual.rgbMode) {
       GLint r, g, b, a;
       r = (GLint) (ctx->Current.RasterColor[0] * CHAN_MAXF);
       g = (GLint) (ctx->Current.RasterColor[1] * CHAN_MAXF);
@@ -70,7 +69,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
       PB_SET_INDEX( PB, ctx->Current.RasterIndex );
    }
 
-   fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
+   fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->DepthMaxF);
     
    _mesa_win_fog_coords_from_z( ctx, 1, &fragZ, &fogCoord );
 
@@ -124,7 +123,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
       }
    }
 
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }