mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'tmj-dev' into nogfx
This commit is contained in:
64
Model3d.cpp
64
Model3d.cpp
@@ -639,70 +639,6 @@ basic_vertex *TSubModel::TrianglePtr(int tex, int pos, glm::vec3 const &Ambient,
|
||||
return s->Vertices + pos; // wskaźnik na wolne miejsce w tabeli wierzchołków
|
||||
};
|
||||
*/
|
||||
#ifdef EU07_USE_OLD_RENDERCODE
|
||||
void TSubModel::DisplayLists()
|
||||
{ // utworznie po jednej skompilowanej liście dla
|
||||
// każdego submodelu
|
||||
if (eType < TP_ROTATOR)
|
||||
{
|
||||
if (iNumVerts > 0)
|
||||
{
|
||||
uiDisplayList = glGenLists(1);
|
||||
glNewList(uiDisplayList, GL_COMPILE);
|
||||
#ifdef USE_VERTEX_ARRAYS
|
||||
// ShaXbee-121209: przekazywanie wierzcholkow hurtem
|
||||
glVertexPointer(3, GL_DOUBLE, sizeof(GLVERTEX), &Vertices[0].Point.x);
|
||||
glNormalPointer(GL_DOUBLE, sizeof(GLVERTEX), &Vertices[0].Normal.x);
|
||||
glTexCoordPointer(2, GL_FLOAT, sizeof(GLVERTEX), &Vertices[0].tu);
|
||||
glDrawArrays(eType, 0, iNumVerts);
|
||||
#else
|
||||
glBegin(eType);
|
||||
for (int i = 0; i < iNumVerts; i++)
|
||||
{
|
||||
/*
|
||||
glNormal3dv(&Vertices[i].Normal.x);
|
||||
glTexCoord2f(Vertices[i].tu,Vertices[i].tv);
|
||||
glVertex3dv(&Vertices[i].Point.x);
|
||||
*/
|
||||
glNormal3fv(glm::value_ptr(Vertices[i].normal));
|
||||
glTexCoord2fv(glm::value_ptr(Vertices[i].material));
|
||||
glVertex3fv(glm::value_ptr(Vertices[i].position));
|
||||
};
|
||||
glEnd();
|
||||
#endif
|
||||
glEndList();
|
||||
}
|
||||
}
|
||||
else if (eType == TP_FREESPOTLIGHT)
|
||||
{
|
||||
uiDisplayList = glGenLists(1);
|
||||
glNewList(uiDisplayList, GL_COMPILE);
|
||||
glBegin(GL_POINTS);
|
||||
glVertex3f( 0.0f, 0.0f, -0.05f ); // shift point towards the viewer, to avoid z-fighting with the light polygons
|
||||
glEnd();
|
||||
glEndList();
|
||||
}
|
||||
else if (eType == TP_STARS)
|
||||
{ // punkty świecące dookólnie
|
||||
uiDisplayList = glGenLists(1);
|
||||
glNewList(uiDisplayList, GL_COMPILE);
|
||||
glBegin(GL_POINTS);
|
||||
for (int i = 0; i < iNumVerts; ++i)
|
||||
{
|
||||
glColor3fv(glm::value_ptr(Vertices[i].normal));
|
||||
glVertex3fv(glm::value_ptr(Vertices[i].position));
|
||||
};
|
||||
glEnd();
|
||||
glEndList();
|
||||
}
|
||||
// SafeDeleteArray(Vertices); //przy VBO muszą zostać do załadowania całego
|
||||
// modelu
|
||||
if (Child)
|
||||
Child->DisplayLists();
|
||||
if (Next)
|
||||
Next->DisplayLists();
|
||||
};
|
||||
#endif
|
||||
|
||||
void TSubModel::InitialRotate(bool doit)
|
||||
{ // konwersja układu współrzędnych na zgodny ze scenerią
|
||||
|
||||
Reference in New Issue
Block a user