/*
* Mesa 3-D graphics library
- * Version: 5.1
*
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
*
* 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
- * 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.
+ * THE AUTHORS OR COPYRIGHT HOLDERS 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 "glheader.h"
-#include "imports.h"
-#include "colormac.h"
#include "context.h"
#include "eval.h"
#include "macros.h"
GLfloat *pnts;
struct gl_1d_map *map = NULL;
- ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
+ assert(type == GL_FLOAT || type == GL_DOUBLE);
if (u1 == u2) {
_mesa_error( ctx, GL_INVALID_VALUE, "glMap1(u1,u2)" );
pnts = _mesa_copy_map_points1d(target, ustride, uorder, (GLdouble*) points);
- FLUSH_VERTICES(ctx, _NEW_EVAL);
+ FLUSH_VERTICES(ctx, 0);
+ vbo_exec_update_eval_maps(ctx);
map->Order = uorder;
map->u1 = u1;
map->u2 = u2;
GLfloat *pnts;
struct gl_2d_map *map = NULL;
- ASSERT(type == GL_FLOAT || type == GL_DOUBLE);
+ assert(type == GL_FLOAT || type == GL_DOUBLE);
if (u1==u2) {
_mesa_error( ctx, GL_INVALID_VALUE, "glMap2(u1,u2)" );
vstride, vorder, (GLdouble*) points);
- FLUSH_VERTICES(ctx, _NEW_EVAL);
+ FLUSH_VERTICES(ctx, 0);
+ vbo_exec_update_eval_maps(ctx);
map->Uorder = uorder;
map->u1 = u1;
map->u2 = u2;
GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
const GLdouble *points )
{
- map2(target, (GLfloat) u1, (GLfloat) u2, ustride, uorder,
+ map2(target, (GLfloat) u1, (GLfloat) u2, ustride, uorder,
(GLfloat) v1, (GLfloat) v2, vstride, vorder, points, GL_DOUBLE);
}
map1d = get_1d_map(ctx, target);
map2d = get_2d_map(ctx, target);
- ASSERT(map1d || map2d);
+ assert(map1d || map2d);
switch (query) {
case GL_COEFF:
map1d = get_1d_map(ctx, target);
map2d = get_2d_map(ctx, target);
- ASSERT(map1d || map2d);
+ assert(map1d || map2d);
switch (query) {
case GL_COEFF:
map1d = get_1d_map(ctx, target);
map2d = get_2d_map(ctx, target);
- ASSERT(map1d || map2d);
+ assert(map1d || map2d);
switch (query) {
case GL_COEFF:
if (bufSize < numBytes)
goto overflow;
for (i=0;i<n;i++) {
- v[i] = IROUND(data[i]);
+ v[i] = lroundf(data[i]);
}
}
break;
numBytes = 2 * sizeof *v;
if (bufSize < numBytes)
goto overflow;
- v[0] = IROUND(map1d->u1);
- v[1] = IROUND(map1d->u2);
+ v[0] = lroundf(map1d->u1);
+ v[1] = lroundf(map1d->u2);
}
else {
numBytes = 4 * sizeof *v;
if (bufSize < numBytes)
goto overflow;
- v[0] = IROUND(map2d->u1);
- v[1] = IROUND(map2d->u2);
- v[2] = IROUND(map2d->v1);
- v[3] = IROUND(map2d->v2);
+ v[0] = lroundf(map2d->u1);
+ v[1] = lroundf(map2d->u2);
+ v[2] = lroundf(map2d->v1);
+ v[3] = lroundf(map2d->v2);
}
break;
default:
_mesa_error( ctx, GL_INVALID_VALUE, "glMapGrid1f" );
return;
}
- FLUSH_VERTICES(ctx, _NEW_EVAL);
+ FLUSH_VERTICES(ctx, 0);
+ vbo_exec_update_eval_maps(ctx);
ctx->Eval.MapGrid1un = un;
ctx->Eval.MapGrid1u1 = u1;
ctx->Eval.MapGrid1u2 = u2;
return;
}
- FLUSH_VERTICES(ctx, _NEW_EVAL);
+ FLUSH_VERTICES(ctx, 0);
+ vbo_exec_update_eval_maps(ctx);
ctx->Eval.MapGrid2un = un;
ctx->Eval.MapGrid2u1 = u1;
ctx->Eval.MapGrid2u2 = u2;
_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2,
GLint vn, GLdouble v1, GLdouble v2 )
{
- _mesa_MapGrid2f( un, (GLfloat) u1, (GLfloat) u2,
+ _mesa_MapGrid2f( un, (GLfloat) u1, (GLfloat) u2,
vn, (GLfloat) v1, (GLfloat) v2 );
}
void
_mesa_install_eval_vtxfmt(struct _glapi_table *disp,
- const GLvertexformat *vfmt,
- bool beginend)
+ const GLvertexformat *vfmt)
{
SET_EvalCoord1f(disp, vfmt->EvalCoord1f);
SET_EvalCoord1fv(disp, vfmt->EvalCoord1fv);
SET_EvalCoord2fv(disp, vfmt->EvalCoord2fv);
SET_EvalPoint1(disp, vfmt->EvalPoint1);
SET_EvalPoint2(disp, vfmt->EvalPoint2);
-
- /* glEvalMesh1 and glEvalMesh2 are not allowed between glBegin and glEnd.
- */
- if (!beginend) {
- SET_EvalMesh1(disp, vfmt->EvalMesh1);
- SET_EvalMesh2(disp, vfmt->EvalMesh2);
- }
}
/**
- * Initialize a 2-D evaluator map
+ * Initialize a 2-D evaluator map
*/
static void
init_2d_map( struct gl_2d_map *map, int n, const float *initial )