mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.
[mesa.git] / src / mesa / main / accum.c
index df6f219bf301ff365f48a2589a90312e7df2e628..c03a5afcb1b4a64d114ae6431c85b05aae99c8c8 100644 (file)
@@ -17,7 +17,7 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "format_pack.h"
 #include "imports.h"
 #include "macros.h"
-#include "mfeatures.h"
 #include "state.h"
 #include "mtypes.h"
 #include "main/dispatch.h"
 
 
-#if FEATURE_accum
-
-
 void GLAPIENTRY
 _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
 {
    GLfloat tmp[4];
    GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    tmp[0] = CLAMP( red,   -1.0F, 1.0F );
    tmp[1] = CLAMP( green, -1.0F, 1.0F );
@@ -58,11 +53,11 @@ _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
 }
 
 
-static void GLAPIENTRY
+void GLAPIENTRY
 _mesa_Accum( GLenum op, GLfloat value )
 {
    GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+   FLUSH_VERTICES(ctx, 0);
 
    switch (op) {
    case GL_ADD:
@@ -109,14 +104,6 @@ _mesa_Accum( GLenum op, GLfloat value )
 }
 
 
-void
-_mesa_init_accum_dispatch(struct _glapi_table *disp)
-{
-   SET_Accum(disp, _mesa_Accum);
-   SET_ClearAccum(disp, _mesa_ClearAccum);
-}
-
-
 /**
  * Clear the accumulation buffer by mapping the renderbuffer and
  * writing the clear color to it.  Called by the driver's implementation
@@ -208,7 +195,7 @@ accum_scale_or_bias(struct gl_context *ctx, GLfloat value,
 
    if (accRb->Format == MESA_FORMAT_SIGNED_RGBA_16) {
       const GLshort incr = (GLshort) (value * 32767.0f);
-      GLuint i, j;
+      GLint i, j;
       if (bias) {
          for (j = 0; j < height; j++) {
             GLshort *acc = (GLshort *) accMap;
@@ -286,10 +273,10 @@ accum_or_load(struct gl_context *ctx, GLfloat value,
 
    if (accRb->Format == MESA_FORMAT_SIGNED_RGBA_16) {
       const GLfloat scale = value * 32767.0f;
-      GLuint i, j;
+      GLint i, j;
       GLfloat (*rgba)[4];
 
-      rgba = (GLfloat (*)[4]) malloc(width * 4 * sizeof(GLfloat));
+      rgba = malloc(width * 4 * sizeof(GLfloat));
       if (rgba) {
          for (j = 0; j < height; j++) {
             GLshort *acc = (GLshort *) accMap;
@@ -381,8 +368,8 @@ accum_return(struct gl_context *ctx, GLfloat value,
          GLint i, j;
          GLfloat (*rgba)[4], (*dest)[4];
 
-         rgba = (GLfloat (*)[4]) malloc(width * 4 * sizeof(GLfloat));
-         dest = (GLfloat (*)[4]) malloc(width * 4 * sizeof(GLfloat));
+         rgba = malloc(width * 4 * sizeof(GLfloat));
+         dest = malloc(width * 4 * sizeof(GLfloat));
 
          if (rgba && dest) {
             for (j = 0; j < height; j++) {
@@ -496,9 +483,6 @@ _mesa_accum(struct gl_context *ctx, GLenum op, GLfloat value)
 }
 
 
-#endif /* FEATURE_accum */
-
-
 void 
 _mesa_init_accum( struct gl_context *ctx )
 {