/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 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"),
if (transferOps) {
/* make copy of incoming data */
- DEFMARRAY(GLfloat, rgbaCopy, MAX_WIDTH, 4); /* mac 32k limitation */
- CHECKARRAY(rgbaCopy, return); /* mac 32k limitation */
-
+ GLfloat rgbaCopy[MAX_WIDTH][4];
_mesa_memcpy(rgbaCopy, rgbaIn, n * 4 * sizeof(GLfloat));
_mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgbaCopy);
rgba = (const GLfloat (*)[4]) rgbaCopy;
if ((transferOps & IMAGE_MIN_MAX_BIT) && ctx->MinMax.Sink) {
- UNDEFARRAY(rgbaCopy); /* mac 32k limitation */
return;
}
- UNDEFARRAY(rgbaCopy); /* mac 32k limitation */
}
else {
/* use incoming data, not a copy */
else {
/* general solution */
GLuint i;
- DEFMARRAY(GLfloat, rgba, MAX_WIDTH, 4); /* mac 32k limitation */
- CHECKARRAY(rgba, return); /* mac 32k limitation */
-
+ GLfloat rgba[MAX_WIDTH][4];
assert(n <= MAX_WIDTH);
/* convert color components to floating point */
for (i = 0; i < n; i++) {
_mesa_pack_rgba_span_float(ctx, n, (const GLfloat (*)[4]) rgba,
dstFormat, dstType, dstAddr,
dstPacking, transferOps);
- UNDEFARRAY(rgba); /* mac 32k limitation */
}
}
GLint dstComponents;
GLint dstRedIndex, dstGreenIndex, dstBlueIndex, dstAlphaIndex;
GLint dstLuminanceIndex, dstIntensityIndex;
- DEFMARRAY(GLfloat, rgba, MAX_WIDTH, 4); /* mac 32k limitation */
- CHECKARRAY(rgba, return); /* mac 32k limitation */
+ GLfloat rgba[MAX_WIDTH][4];
dstComponents = _mesa_components_in_format( dstFormat );
/* source & dest image formats should have been error checked by now */
for (i = 0; i < n; i++) {
dest[i] = (GLchan) (indexes[i] & 0xff);
}
- UNDEFARRAY(rgba); /* mac 32k limitation */
return;
}
else {
break;
default:
_mesa_problem(ctx, "bad dstFormat in _mesa_unpack_chan_span()");
- UNDEFARRAY(rgba); /* mac 32k limitation */
return;
}
dst += dstComponents;
}
}
- UNDEFARRAY(rgba); /* mac 32k limitation */
}
}
GLint dstComponents;
GLint dstRedIndex, dstGreenIndex, dstBlueIndex, dstAlphaIndex;
GLint dstLuminanceIndex, dstIntensityIndex;
- DEFMARRAY(GLfloat, rgba, MAX_WIDTH, 4); /* mac 32k limitation */
- CHECKARRAY(rgba, return); /* mac 32k limitation */
+ GLfloat rgba[MAX_WIDTH][4];
dstComponents = _mesa_components_in_format( dstFormat );
/* source & dest image formats should have been error checked by now */
for (i = 0; i < n; i++) {
dest[i] = (GLchan) (indexes[i] & 0xff);
}
- UNDEFARRAY(rgba); /* mac 32k limitation */
return;
}
else {
break;
default:
_mesa_problem(ctx, "bad dstFormat in _mesa_unpack_color_span_float()");
- UNDEFARRAY(rgba); /* mac 32k limitation */
return;
}
dst += dstComponents;
}
}
- UNDEFARRAY(rgba); /* mac 32k limitation */
}
}
#define ADD_POINTERS(A, B) ( (GLubyte *) (A) + (uintptr_t) (B) )
-/**********************************************************************/
-/** \name [Pseudo] static array declaration.
- *
- * MACs and BeOS don't support static larger than 32kb, so ...
- */
-/*@{*/
-
-/**
- * \def DEFARRAY
- * Define a [static] unidimensional array
- */
-
-/**
- * \def DEFMARRAY
- * Define a [static] bi-dimensional array
- */
-
-/**
- * \def DEFMNARRAY
- * Define a [static] tri-dimensional array
- */
-
-/**
- * \def CHECKARRAY
- * Verifies a [static] array was properly allocated.
- */
-
-/**
- * \def UNDEFARRAY
- * Undefine (free) a [static] array.
- */
-
-#if defined(macintosh) && !defined(__MRC__)
-/*extern char *AGLAlloc(int size);*/
-/*extern void AGLFree(char* ptr);*/
-# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)_mesa_alloc(sizeof(TYPE)*(SIZE))
-# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])_mesa_alloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
-# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])_mesa_alloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3))
-# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
-# define UNDEFARRAY(NAME) do {if ((NAME)) {_mesa_free((char*)NAME);} }while (0)
-#elif defined(__BEOS__)
-# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)_mesa_malloc(sizeof(TYPE)*(SIZE))
-# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])_mesa_malloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
-# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])_mesa_malloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3))
-# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
-# define UNDEFARRAY(NAME) do {if ((NAME)) {_mesa_free((char*)NAME);} }while (0)
-#else
-# define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE]
-# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2]
-# define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE NAME[SIZE1][SIZE2][SIZE3]
-# define CHECKARRAY(NAME,CMD) do {} while(0)
-# define UNDEFARRAY(NAME)
-#endif
-
-/*@}*/
-
-
/**
* Sometimes we treat GLfloats as GLints. On x86 systems, moving a float
* as a int (thereby using integer registers instead of FP registers) is