* 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 "main/glheader.h"
#include "main/colormac.h"
-#include "main/context.h"
#include "main/macros.h"
#include "main/imports.h"
#include "main/mtypes.h"
struct texgen_stage_data;
-typedef void (*texgen_func)( GLcontext *ctx,
+typedef void (*texgen_func)( struct gl_context *ctx,
struct texgen_stage_data *store,
GLuint unit);
fz = f[i][2] = u[2] - norm[2] * two_nu;
m[i] = fx * fx + fy * fy + (fz + 1.0F) * (fz + 1.0F);
if (m[i] != 0.0F) {
- m[i] = 0.5F * _mesa_inv_sqrtf(m[i]);
+ m[i] = 0.5F * INV_SQRTF(m[i]);
}
}
}
fz = f[i][2] = u[2] - norm[2] * two_nu;
m[i] = fx * fx + fy * fy + (fz + 1.0F) * (fz + 1.0F);
if (m[i] != 0.0F) {
- m[i] = 0.5F * _mesa_inv_sqrtf(m[i]);
+ m[i] = 0.5F * INV_SQRTF(m[i]);
}
}
}
/* Special case texgen functions.
*/
-static void texgen_reflection_map_nv( GLcontext *ctx,
+static void texgen_reflection_map_nv( struct gl_context *ctx,
struct texgen_stage_data *store,
GLuint unit )
{
-static void texgen_normal_map_nv( GLcontext *ctx,
+static void texgen_normal_map_nv( struct gl_context *ctx,
struct texgen_stage_data *store,
GLuint unit )
{
}
-static void texgen_sphere_map( GLcontext *ctx,
+static void texgen_sphere_map( struct gl_context *ctx,
struct texgen_stage_data *store,
GLuint unit )
{
-static void texgen( GLcontext *ctx,
+static void texgen( struct gl_context *ctx,
struct texgen_stage_data *store,
GLuint unit )
{
-static GLboolean run_texgen_stage( GLcontext *ctx,
+static GLboolean run_texgen_stage( struct gl_context *ctx,
struct tnl_pipeline_stage *stage )
{
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
}
-static void validate_texgen_stage( GLcontext *ctx,
+static void validate_texgen_stage( struct gl_context *ctx,
struct tnl_pipeline_stage *stage )
{
struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
/* Called the first time stage->run() is invoked.
*/
-static GLboolean alloc_texgen_data( GLcontext *ctx,
+static GLboolean alloc_texgen_data( struct gl_context *ctx,
struct tnl_pipeline_stage *stage )
{
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
struct texgen_stage_data *store;
GLuint i;
- stage->privatePtr = CALLOC(sizeof(*store));
+ stage->privatePtr = calloc(1, sizeof(*store));
store = TEXGEN_STAGE_DATA(stage);
if (!store)
return GL_FALSE;
for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
_mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
- store->tmp_f = (GLfloat (*)[3]) MALLOC(VB->Size * sizeof(GLfloat) * 3);
- store->tmp_m = (GLfloat *) MALLOC(VB->Size * sizeof(GLfloat));
+ store->tmp_f = malloc(VB->Size * sizeof(GLfloat) * 3);
+ store->tmp_m = malloc(VB->Size * sizeof(GLfloat));
return GL_TRUE;
}
_mesa_vector4f_free( &store->texcoord[i] );
- if (store->tmp_f) FREE( store->tmp_f );
- if (store->tmp_m) FREE( store->tmp_m );
- FREE( store );
+ free( store->tmp_f );
+ free( store->tmp_m );
+ free( store );
stage->privatePtr = NULL;
}
}