| |
| Posted by Dario | PermalinkReply |
|
Dario
| The following code causes this compiler output:
Internal error: ..\ztc\cgcod.c 1402
void subdivide()
{
ColorVertex[] newdata;
newdata.length = data.length * 4;
for(uint i; i < data.length; i += 3)
{
newdata[i*4 + 0].mean ( data[i + 0] , data[i + 0] );
newdata[i*4 + 1].mean ( data[i + 0] , data[i + 1] );
newdata[i*4 + 2].mean ( data[i + 0] , data[i + 2] );
newdata[i*4 + 3].mean ( data[i + 1] , data[i + 0] );
newdata[i*4 + 4].mean ( data[i + 1] , data[i + 1] );
newdata[i*4 + 5].mean ( data[i + 1] , data[i + 2] );
newdata[i*4 + 6].mean ( data[i + 2] , data[i + 0] );
newdata[i*4 + 7].mean ( data[i + 2] , data[i + 1] );
newdata[i*4 + 8].mean ( data[i + 2] , data[i + 2] );
newdata[i*4 + 9].mean ( data[i + 1] , data[i + 0] );
newdata[i*4 +10].mean ( data[i + 2] , data[i + 1] );
newdata[i*4 +11].mean ( data[i + 0] , data[i + 2] );
}
data = newdata; // olddata is now garbage
glInterleavedArrays(GL_C3F_V3F, 0, data);
}
This is a rudimental function that subdivides some triangles (in a external
array) into smaller triangles (four for each one).
void ColorVertex.mean(ColorVertex, ColorVertex) is a method that computes
the color and the coords of the vertex which is between two two arguments.
I've appended the whole source. (GLFW is a OpenGL framework like GLUT).
I apologize if this error had been discussed already. ='(
Dario
|