summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/matrix.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-02-03 12:26:02 -0700
committerBrian Paul <[email protected]>2010-02-03 15:48:42 -0700
commita06575aed66b818253bc79dcca3d6e19c92e4bba (patch)
tree222797c99d53f868006166dc44696aaf4669c42d /src/mesa/main/matrix.c
parent376ae23c3a226399f9f33be716f3990ff4442580 (diff)
mesa: use Elements() as limit in loops over texture/program matrix stacks
Diffstat (limited to 'src/mesa/main/matrix.c')
-rw-r--r--src/mesa/main/matrix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index ebc3cbd59c3..5c863f6f32a 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -726,10 +726,10 @@ void _mesa_init_matrix( GLcontext * ctx )
_NEW_PROJECTION);
init_matrix_stack(&ctx->ColorMatrixStack, MAX_COLOR_STACK_DEPTH,
_NEW_COLOR_MATRIX);
- for (i = 0; i < MAX_TEXTURE_UNITS; i++)
+ for (i = 0; i < Elements(ctx->TextureMatrixStack); i++)
init_matrix_stack(&ctx->TextureMatrixStack[i], MAX_TEXTURE_STACK_DEPTH,
_NEW_TEXTURE_MATRIX);
- for (i = 0; i < MAX_PROGRAM_MATRICES; i++)
+ for (i = 0; i < Elements(ctx->ProgramMatrixStack); i++)
init_matrix_stack(&ctx->ProgramMatrixStack[i],
MAX_PROGRAM_MATRIX_STACK_DEPTH, _NEW_TRACK_MATRIX);
ctx->CurrentStack = &ctx->ModelviewMatrixStack;
@@ -754,9 +754,9 @@ void _mesa_free_matrix_data( GLcontext *ctx )
free_matrix_stack(&ctx->ModelviewMatrixStack);
free_matrix_stack(&ctx->ProjectionMatrixStack);
free_matrix_stack(&ctx->ColorMatrixStack);
- for (i = 0; i < MAX_TEXTURE_UNITS; i++)
+ for (i = 0; i < Elements(ctx->TextureMatrixStack); i++)
free_matrix_stack(&ctx->TextureMatrixStack[i]);
- for (i = 0; i < MAX_PROGRAM_MATRICES; i++)
+ for (i = 0; i < Elements(ctx->ProgramMatrixStack); i++)
free_matrix_stack(&ctx->ProgramMatrixStack[i]);
/* combined Modelview*Projection matrix */
_math_matrix_dtr( &ctx->_ModelProjectMatrix );