I have no idea what is going on. Im getting this error that i've spent DAYS on. I know its lame to post a million lines of code on the message board and say "whats my error", but im not sure what else to do.
What this loops is doing is building the index buffer for a brute-force terrain algorythm. The vertex buffer has already been built.
You will notice:
IdcGrid[whatever] = 0
all over. I have other code in there (instead of the 0) but it doesn't change the problem if i set it to another number, so i left it as 0.
The error im getting is when the function quits. Its happens in dbgheap.c
Looks like an de-initialization error. The error is centered around the IdcGrid linked list. This is probably an easy answer, but im the worlds worst debugger and can't figure it out.
Additional Info:
NumIndices is 8064
NumVertices is 4096
BlockCount is 64
bool Virtual3DGrid::BuildIndexList() {
short x, y, i;
short CurrentVtx = 0;
bool EvenRow = true;
vector<WORD> IdcGrid(NumIndices);
for (y = 0; y <= NumVertices; y += BlockCount) {
for (x = y; x <= y + BlockCount * 2 - 1; x += 2) {
if (EvenRow) {
IdcGrid[y + x] = 0;
IdcGrid[y + x + 1] = 0;
}
else {
IdcGrid[y + x] = 0;
IdcGrid[y + x + 1] = 0;
}
CurrentVtx++;
}
EvenRow = !EvenRow;
}
return true;
}
thanks guys
hope somebody can figure this out.
ps. - if anybody else has code that will generate an index list for similar terrain algorythm, i would be happy to see it.
Edited by - Psionic on November 17, 2001 6:22:29 PM
"This is stupid. I can't believe this! Ok, this time, there really IS a bug in the compiler."... 20 mins pass ..."I'M AN IDIOT!!!"