gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > bsp help?

#175471 - iainprice - Mon Nov 29, 2010 9:13 pm

Hi,

I have source for a simple quake 3 bsp viewer and walk around with jumping for win32. I have been trying to port for a while but with no real joy. Has anyone already done this and willing to share? If anyone wants to go over the mess that is my code they are welcome. I read in the file, sort the tree... I think... but it is not displaying correctly. I am not sure which part has the error.....

#175474 - elhobbs - Tue Nov 30, 2010 2:08 am

source code?

#175476 - iainprice - Tue Nov 30, 2010 5:46 pm

sent to email.

my main issue is replacing this code:

glDrawElements(GL_TRIANGLES, pFace->numOfIndices, GL_UNSIGNED_INT, &(m_pIndices[pFace->startIndex]) );

#175490 - relminator - Fri Dec 03, 2010 9:10 am

Looks like it uses VBA or VBO. Doesn't really concern BSP per se.

You could emulate that by using a loop of GL_TRIANGLES.
_________________
http://rel.betterwebber.com

#175492 - iainprice - Fri Dec 03, 2010 5:00 pm

elhobbs was really helpful... I was missing an index....

for my code a loop of:

for(int i=0;i<pFace->numOfIndices;i++) {
glVertex3v16(
floattov16(m_pVerts[pFace->startVertIndex + m_pIndices[pFace->startIndex + i]].vPosition.x),
floattov16(m_pVerts[pFace->startVertIndex + m_pIndices[pFace->startIndex + i]].vPosition.y),
floattov16(m_pVerts[pFace->startVertIndex + m_pIndices[pFace->startIndex + i]].vPosition.z));

worked like a treat