Changeset 3598 for trunk/src/opengl/mesa/vector.c
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/vector.c
r2938 r3598 1 /* $Id: vector.c,v 1. 1 2000-02-29 00:50:15 sandervlExp $ */1 /* $Id: vector.c,v 1.2 2000-05-23 20:41:03 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 30 30 31 31 32 #ifndef XFree86Server 33 #include <stdlib.h> 34 #include <stdio.h> 35 #else 36 #include "GL/xf86glx.h" 37 #endif 32 #include "glheader.h" 38 33 #include "config.h" 39 34 #include "macros.h" 40 35 #include "vector.h" 36 #include "mem.h" 41 37 42 38 static const GLubyte elem_bits[4] = { … … 116 112 117 113 118 #define ALIGN_MALLOC(vec, type, bytes, alignment) 119 do { 120 vec->storage = MALLOC( bytes + alignment - 1 ); 121 vec->start = type (((unsigned long)vec->storage + alignment - 1) 122 & ~(unsigned long)(alignment - 1));\114 #define ALIGN_MALLOC(vec, type, bytes, alignment) \ 115 do { \ 116 vec->storage = MALLOC( bytes + alignment - 1 ); \ 117 vec->start = type (((unsigned long)vec->storage + alignment - 1) \ 118 & ~(unsigned long)(alignment - 1)); \ 123 119 } while (0) 124 120 125 121 126 122 void gl_vector4f_alloc( GLvector4f *v, GLuint sz, GLuint flags, GLuint count, 127 123 GLuint alignment ) 128 124 { 129 125 (void) sz; … … 138 134 139 135 void gl_vector3f_alloc( GLvector3f *v, GLuint flags, GLuint count, 140 136 GLuint alignment ) 141 137 { 142 138 v->stride = 3*sizeof(GLfloat); … … 148 144 149 145 void gl_vector4ub_alloc( GLvector4ub *v, GLuint flags, GLuint count, 150 146 GLuint alignment ) 151 147 { 152 148 v->stride = 4*sizeof(GLubyte); … … 158 154 159 155 void gl_vector1ub_alloc( GLvector1ub *v, GLuint flags, GLuint count, 160 156 GLuint alignment ) 161 157 { 162 158 v->stride = 1*sizeof(GLubyte); … … 168 164 169 165 void gl_vector1ui_alloc( GLvector1ui *v, GLuint flags, GLuint count, 170 166 GLuint alignment ) 171 167 { 172 168 v->stride = 1*sizeof(GLuint); … … 258 254 if (culling) { 259 255 for ( ; i < count ; STRIDE_F(d, v->stride), i++) 260 261 256 if (cullmask[i]) 257 printf( t, i, d[0], d[1], d[2], d[3]); 262 258 } else { 263 259 for ( ; i < count ; STRIDE_F(d, v->stride), i++) 264 260 printf( t, i, d[0], d[1], d[2], d[3]); 265 261 } 266 262 … … 268 264 if ((v->flags & (1<<j)) == 0) { 269 265 270 271 272 273 274 275 276 277 278 279 266 printf("checking col %u is clean as advertised ", j); 267 268 for (i = 0, d = (GLfloat *) v->data ; 269 i < count && d[j] == c[j] ; 270 i++, STRIDE_F(d, v->stride)) {}; 271 272 if (i == count) 273 printf(" --> ok\n"); 274 else 275 printf(" --> Failed at %u ******\n", i); 280 276 } 281 277 } … … 297 293 if (culling) { 298 294 for ( ; i < count ; STRIDE_F(d,v->stride), i++) 299 300 295 if (cullmask[i]) 296 printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]); 301 297 } else { 302 298 for ( ; i < count ; STRIDE_F(d,v->stride), i++) 303 304 } 305 } 299 printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]); 300 } 301 }
Note:
See TracChangeset
for help on using the changeset viewer.