diff --git a/GL/draw.c b/GL/draw.c index 91ded0f..2935407 100644 --- a/GL/draw.c +++ b/GL/draw.c @@ -421,7 +421,7 @@ static void divide(AlignedVector* vertices) { } typedef struct { - PolyList* list; + unsigned int list_type; pvr_poly_hdr_t hdr; } ListToHeader; @@ -461,7 +461,7 @@ static void push(const AlignedVector* vertices, PolyList* activePolyList) { GLboolean listFound = GL_FALSE; for(c = 0; c < LIST_COUNTER; ++c) { - if(LAST_HEADERS[c].list == activePolyList) { + if(LAST_HEADERS[c].list_type == activePolyList->list_type) { /* Send the header if this was the first submission to this list, or the header has changed since * the last sent */ sendHeader = listWasEmpty || memcmp(&LAST_HEADERS[c].hdr, &hdr, sizeof(pvr_poly_hdr_t)) != 0; @@ -475,8 +475,11 @@ static void push(const AlignedVector* vertices, PolyList* activePolyList) { fprintf(stderr, "Ran out of space!\n"); } /* First time we've seen this list, add it to the array */ - LAST_HEADERS[LIST_COUNTER].list = activePolyList; + LAST_HEADERS[LIST_COUNTER].list_type = activePolyList->list_type; LAST_HEADERS[LIST_COUNTER++].hdr = *hdr; + + /* Send the header the first time */ + sendHeader = GL_TRUE; } if(sendHeader) { diff --git a/samples/lerabot01/main.c b/samples/lerabot01/main.c index 3bfc648..263a11c 100644 --- a/samples/lerabot01/main.c +++ b/samples/lerabot01/main.c @@ -232,7 +232,7 @@ void DrawTexturedQuad(int tex, float x, float y, float z) glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); + //glEnableClientState(GL_COLOR_ARRAY); glVertexPointer(3, GL_FLOAT, 0, vertex_data); glTexCoordPointer(2, GL_FLOAT, 0, uv_data); @@ -249,7 +249,7 @@ void DrawTexturedQuad(int tex, float x, float y, float z) glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); + //glDisableClientState(GL_COLOR_ARRAY); }