Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_OpenGLRasterizer')
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp24
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp36
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp88
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp62
4 files changed, 105 insertions, 105 deletions
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
index e1fff5fe077..665053984e6 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
@@ -40,29 +40,29 @@ namespace bgl
{
static bool firsttime = true;
- if(firsttime) {
+ if (firsttime) {
firsttime = false;
- if(debug) {
- if(GLEW_ATI_pn_triangles)
+ if (debug) {
+ if (GLEW_ATI_pn_triangles)
std::cout << "Enabled GL_ATI_pn_triangles" << std::endl;
- if(GLEW_ARB_texture_env_combine)
+ if (GLEW_ARB_texture_env_combine)
std::cout << "Detected GL_ARB_texture_env_combine" << std::endl;
- if(GLEW_ARB_texture_cube_map)
+ if (GLEW_ARB_texture_cube_map)
std::cout << "Detected GL_ARB_texture_cube_map" << std::endl;
- if(GLEW_ARB_multitexture)
+ if (GLEW_ARB_multitexture)
std::cout << "Detected GL_ARB_multitexture" << std::endl;
- if(GLEW_ARB_shader_objects)
+ if (GLEW_ARB_shader_objects)
std::cout << "Detected GL_ARB_shader_objects" << std::endl;
- if(GLEW_ARB_vertex_shader)
+ if (GLEW_ARB_vertex_shader)
std::cout << "Detected GL_ARB_vertex_shader" << std::endl;
- if(GLEW_ARB_fragment_shader)
+ if (GLEW_ARB_fragment_shader)
std::cout << "Detected GL_ARB_fragment_shader" << std::endl;
- if(GLEW_ARB_vertex_program)
+ if (GLEW_ARB_vertex_program)
std::cout << "Detected GL_ARB_vertex_program" << std::endl;
- if(GLEW_ARB_depth_texture)
+ if (GLEW_ARB_depth_texture)
std::cout << "Detected GL_ARB_depth_texture" << std::endl;
- if(GLEW_EXT_separate_specular_color)
+ if (GLEW_EXT_separate_specular_color)
std::cout << "Detected GL_EXT_separate_specular_color" << std::endl;
}
}
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
index 4e4d70fac31..1f411a09586 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
@@ -50,7 +50,7 @@ RAS_ListSlot::~RAS_ListSlot()
void RAS_ListSlot::RemoveList()
{
- if(m_list != 0) {
+ if (m_list != 0) {
spit("Releasing display list (" << m_list << ")");
glDeleteLists((GLuint)m_list, 1);
m_list =0;
@@ -59,19 +59,19 @@ void RAS_ListSlot::RemoveList()
void RAS_ListSlot::DrawList()
{
- if(m_flag &LIST_STREAM || m_flag& LIST_NOCREATE) {
+ if (m_flag &LIST_STREAM || m_flag& LIST_NOCREATE) {
RemoveList();
return;
}
- if(m_flag &LIST_MODIFY) {
- if(m_flag &LIST_CREATE) {
- if(m_list == 0) {
+ if (m_flag &LIST_MODIFY) {
+ if (m_flag &LIST_CREATE) {
+ if (m_list == 0) {
m_list = (unsigned int)glGenLists(1);
m_flag = m_flag &~ LIST_CREATE;
spit("Created display list (" << m_list << ")");
}
}
- if(m_list != 0)
+ if (m_list != 0)
glNewList((GLuint)m_list, GL_COMPILE);
m_flag |= LIST_BEGIN;
@@ -82,7 +82,7 @@ void RAS_ListSlot::DrawList()
void RAS_ListSlot::EndList()
{
- if(m_flag & LIST_BEGIN) {
+ if (m_flag & LIST_BEGIN) {
glEndList();
m_flag = m_flag &~(LIST_BEGIN|LIST_MODIFY);
m_flag |= LIST_END;
@@ -92,7 +92,7 @@ void RAS_ListSlot::EndList()
void RAS_ListSlot::SetModified(bool mod)
{
- if(mod && !(m_flag & LIST_MODIFY)) {
+ if (mod && !(m_flag & LIST_MODIFY)) {
spit("Modifying list (" << m_list << ")");
m_flag = m_flag &~ LIST_END;
m_flag |= LIST_STREAM;
@@ -164,7 +164,7 @@ RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms)
* :: sorted by mesh slot
*/
RAS_ListSlot* localSlot = (RAS_ListSlot*)ms.m_DisplayList;
- if(!localSlot) {
+ if (!localSlot) {
if (ms.m_pDerivedMesh) {
// that means that we draw based on derived mesh, a display list is possible
// Note that we come here only for static derived mesh
@@ -172,7 +172,7 @@ RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms)
RAS_ListSlot* nullSlot = NULL;
RAS_ListSlots *listVector;
RAS_DerivedMeshLists::iterator it = mDerivedMeshLists.find(ms.m_pDerivedMesh);
- if(it == mDerivedMeshLists.end()) {
+ if (it == mDerivedMeshLists.end()) {
listVector = new RAS_ListSlots(matnr+4, nullSlot);
localSlot = new RAS_ListSlot(this);
localSlot->m_flag |= LIST_DERIVEDMESH;
@@ -194,7 +194,7 @@ RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms)
}
} else {
RAS_ArrayLists::iterator it = mArrayLists.find(ms.m_displayArrays);
- if(it == mArrayLists.end()) {
+ if (it == mArrayLists.end()) {
localSlot = new RAS_ListSlot(this);
mArrayLists.insert(std::pair<RAS_DisplayArrayList, RAS_ListSlot*>(ms.m_displayArrays, localSlot));
} else {
@@ -208,7 +208,7 @@ RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms)
void RAS_ListRasterizer::ReleaseAlloc()
{
- for(RAS_ArrayLists::iterator it = mArrayLists.begin();it != mArrayLists.end();++it)
+ for (RAS_ArrayLists::iterator it = mArrayLists.begin();it != mArrayLists.end();++it)
delete it->second;
mArrayLists.clear();
for (RAS_DerivedMeshLists::iterator it = mDerivedMeshLists.begin();it != mDerivedMeshLists.end();++it) {
@@ -228,10 +228,10 @@ void RAS_ListRasterizer::IndexPrimitives(RAS_MeshSlot& ms)
{
RAS_ListSlot* localSlot =0;
- if(ms.m_bDisplayList) {
+ if (ms.m_bDisplayList) {
localSlot = FindOrAdd(ms);
localSlot->DrawList();
- if(localSlot->End()) {
+ if (localSlot->End()) {
// save slot here too, needed for replicas and object using same mesh
// => they have the same vertexarray but different mesh slot
ms.m_DisplayList = localSlot;
@@ -244,7 +244,7 @@ void RAS_ListRasterizer::IndexPrimitives(RAS_MeshSlot& ms)
else
RAS_OpenGLRasterizer::IndexPrimitives(ms);
- if(ms.m_bDisplayList) {
+ if (ms.m_bDisplayList) {
localSlot->EndList();
ms.m_DisplayList = localSlot;
}
@@ -255,11 +255,11 @@ void RAS_ListRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms)
{
RAS_ListSlot* localSlot =0;
- if(ms.m_bDisplayList) {
+ if (ms.m_bDisplayList) {
localSlot = FindOrAdd(ms);
localSlot->DrawList();
- if(localSlot->End()) {
+ if (localSlot->End()) {
// save slot here too, needed for replicas and object using same mesh
// => they have the same vertexarray but different mesh slot
ms.m_DisplayList = localSlot;
@@ -275,7 +275,7 @@ void RAS_ListRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms)
else
RAS_OpenGLRasterizer::IndexPrimitivesMulti(ms);
- if(ms.m_bDisplayList) {
+ if (ms.m_bDisplayList) {
localSlot->EndList();
ms.m_DisplayList = localSlot;
}
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index 7e9e3d9156c..b0c7b643f47 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -323,7 +323,7 @@ void RAS_OpenGLRasterizer::SetDrawingMode(int drawingmode)
{
m_drawingmode = drawingmode;
- if(m_drawingmode == KX_WIREFRAME)
+ if (m_drawingmode == KX_WIREFRAME)
glDisable(GL_CULL_FACE);
}
@@ -359,7 +359,7 @@ void RAS_OpenGLRasterizer::ClearCachingInfo(void)
void RAS_OpenGLRasterizer::FlushDebugShapes()
{
- if(!m_debugShapes.size())
+ if (!m_debugShapes.size())
return;
// DrawDebugLines
@@ -368,8 +368,8 @@ void RAS_OpenGLRasterizer::FlushDebugShapes()
light= glIsEnabled(GL_LIGHTING);
tex= glIsEnabled(GL_TEXTURE_2D);
- if(light) glDisable(GL_LIGHTING);
- if(tex) glDisable(GL_TEXTURE_2D);
+ if (light) glDisable(GL_LIGHTING);
+ if (tex) glDisable(GL_TEXTURE_2D);
//draw lines
glBegin(GL_LINES);
@@ -423,8 +423,8 @@ void RAS_OpenGLRasterizer::FlushDebugShapes()
glEnd();
}
- if(light) glEnable(GL_LIGHTING);
- if(tex) glEnable(GL_TEXTURE_2D);
+ if (light) glEnable(GL_LIGHTING);
+ if (tex) glEnable(GL_TEXTURE_2D);
m_debugShapes.clear();
}
@@ -513,7 +513,7 @@ RAS_IRasterizer::StereoMode RAS_OpenGLRasterizer::GetStereoMode()
bool RAS_OpenGLRasterizer::Stereo()
{
- if(m_stereomode > RAS_STEREO_NOSTEREO) // > 0
+ if (m_stereomode > RAS_STEREO_NOSTEREO) // > 0
return true;
else
return false;
@@ -624,17 +624,17 @@ void RAS_OpenGLRasterizer::IndexPrimitives_3DText(RAS_MeshSlot& ms,
else
glEnableClientState(GL_COLOR_ARRAY);
- for(ms.begin(it); !ms.end(it); ms.next(it)) {
+ for (ms.begin(it); !ms.end(it); ms.next(it)) {
RAS_TexVert *vertex;
size_t i, j, numvert;
numvert = it.array->m_type;
- if(it.array->m_type == RAS_DisplayArray::LINE) {
+ if (it.array->m_type == RAS_DisplayArray::LINE) {
// line drawing, no text
glBegin(GL_LINES);
- for(i=0; i<it.totindex; i+=2)
+ for (i=0; i<it.totindex; i+=2)
{
vertex = &it.vertex[it.index[i]];
glVertex3fv(vertex->getXYZ());
@@ -647,12 +647,12 @@ void RAS_OpenGLRasterizer::IndexPrimitives_3DText(RAS_MeshSlot& ms,
}
else {
// triangle and quad text drawing
- for(i=0; i<it.totindex; i+=numvert)
+ for (i=0; i<it.totindex; i+=numvert)
{
float v[4][3];
int glattrib, unit;
- for(j=0; j<numvert; j++) {
+ for (j=0; j<numvert; j++) {
vertex = &it.vertex[it.index[i+j]];
v[j][0] = vertex->getXYZ()[0];
@@ -662,9 +662,9 @@ void RAS_OpenGLRasterizer::IndexPrimitives_3DText(RAS_MeshSlot& ms,
// find the right opengl attribute
glattrib = -1;
- if(GLEW_ARB_vertex_program)
- for(unit=0; unit<m_attrib_num; unit++)
- if(m_attrib[unit] == RAS_TEXCO_UV1)
+ if (GLEW_ARB_vertex_program)
+ for (unit=0; unit<m_attrib_num; unit++)
+ if (m_attrib[unit] == RAS_TEXCO_UV1)
glattrib = unit;
rendertools->RenderText(polymat->GetDrawingMode(), polymat,
@@ -681,28 +681,28 @@ void RAS_OpenGLRasterizer::IndexPrimitives_3DText(RAS_MeshSlot& ms,
void RAS_OpenGLRasterizer::SetTexCoordNum(int num)
{
m_texco_num = num;
- if(m_texco_num > RAS_MAX_TEXCO)
+ if (m_texco_num > RAS_MAX_TEXCO)
m_texco_num = RAS_MAX_TEXCO;
}
void RAS_OpenGLRasterizer::SetAttribNum(int num)
{
m_attrib_num = num;
- if(m_attrib_num > RAS_MAX_ATTRIB)
+ if (m_attrib_num > RAS_MAX_ATTRIB)
m_attrib_num = RAS_MAX_ATTRIB;
}
void RAS_OpenGLRasterizer::SetTexCoord(TexCoGen coords, int unit)
{
// this changes from material to material
- if(unit < RAS_MAX_TEXCO)
+ if (unit < RAS_MAX_TEXCO)
m_texco[unit] = coords;
}
void RAS_OpenGLRasterizer::SetAttrib(TexCoGen coords, int unit)
{
// this changes from material to material
- if(unit < RAS_MAX_ATTRIB)
+ if (unit < RAS_MAX_ATTRIB)
m_attrib[unit] = coords;
}
@@ -710,9 +710,9 @@ void RAS_OpenGLRasterizer::TexCoord(const RAS_TexVert &tv)
{
int unit;
- if(GLEW_ARB_multitexture) {
- for(unit=0; unit<m_texco_num; unit++) {
- if(tv.getFlag() & RAS_TexVert::SECOND_UV && (int)tv.getUnit() == unit) {
+ if (GLEW_ARB_multitexture) {
+ for (unit=0; unit<m_texco_num; unit++) {
+ if (tv.getFlag() & RAS_TexVert::SECOND_UV && (int)tv.getUnit() == unit) {
glMultiTexCoord2fvARB(GL_TEXTURE0_ARB+unit, tv.getUV2());
continue;
}
@@ -739,8 +739,8 @@ void RAS_OpenGLRasterizer::TexCoord(const RAS_TexVert &tv)
}
}
- if(GLEW_ARB_vertex_program) {
- for(unit=0; unit<m_attrib_num; unit++) {
+ if (GLEW_ARB_vertex_program) {
+ for (unit=0; unit<m_attrib_num; unit++) {
switch(m_attrib[unit]) {
case RAS_TEXCO_ORCO:
case RAS_TEXCO_GLOB:
@@ -901,17 +901,17 @@ void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi)
return;
}
// iterate over display arrays, each containing an index + vertex array
- for(ms.begin(it); !ms.end(it); ms.next(it)) {
+ for (ms.begin(it); !ms.end(it); ms.next(it)) {
RAS_TexVert *vertex;
size_t i, j, numvert;
numvert = it.array->m_type;
- if(it.array->m_type == RAS_DisplayArray::LINE) {
+ if (it.array->m_type == RAS_DisplayArray::LINE) {
// line drawing
glBegin(GL_LINES);
- for(i=0; i<it.totindex; i+=2)
+ for (i=0; i<it.totindex; i+=2)
{
vertex = &it.vertex[it.index[i]];
glVertex3fv(vertex->getXYZ());
@@ -924,26 +924,26 @@ void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi)
}
else {
// triangle and quad drawing
- if(it.array->m_type == RAS_DisplayArray::TRIANGLE)
+ if (it.array->m_type == RAS_DisplayArray::TRIANGLE)
glBegin(GL_TRIANGLES);
else
glBegin(GL_QUADS);
- for(i=0; i<it.totindex; i+=numvert)
+ for (i=0; i<it.totindex; i+=numvert)
{
- if(obcolor)
+ if (obcolor)
glColor4d(rgba[0], rgba[1], rgba[2], rgba[3]);
- for(j=0; j<numvert; j++) {
+ for (j=0; j<numvert; j++) {
vertex = &it.vertex[it.index[i+j]];
- if(!wireframe) {
- if(!obcolor)
+ if (!wireframe) {
+ if (!obcolor)
glColor4ubv((const GLubyte *)(vertex->getRGBA()));
glNormal3fv(vertex->getNormal());
- if(multi)
+ if (multi)
TexCoord(*vertex);
else
glTexCoord2fv(vertex->getUV1());
@@ -993,7 +993,7 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix(
double mat[16];
// correction for stereo
- if(Stereo())
+ if (Stereo())
{
float near_div_focallength;
float offset;
@@ -1062,7 +1062,7 @@ void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat,
m_viewmatrix = mat;
// correction for stereo
- if(Stereo() && perspective)
+ if (Stereo() && perspective)
{
MT_Vector3 unitViewDir(0.0, -1.0, 0.0); // minus y direction, Blender convention
MT_Vector3 unitViewupVec(0.0, 0.0, 1.0);
@@ -1192,7 +1192,7 @@ void RAS_OpenGLRasterizer::EnableMotionBlur(float motionblurvalue)
{
/* don't just set m_motionblur to 1, but check if it is 0 so
* we don't reset a motion blur that is already enabled */
- if(m_motionblur == 0)
+ if (m_motionblur == 0)
m_motionblur = 1;
m_motionblurvalue = motionblurvalue;
}
@@ -1207,26 +1207,26 @@ void RAS_OpenGLRasterizer::SetAlphaBlend(int alphablend)
{
GPU_set_material_alpha_blend(alphablend);
/*
- if(alphablend == m_last_alphablend)
+ if (alphablend == m_last_alphablend)
return;
- if(alphablend == GPU_BLEND_SOLID) {
+ if (alphablend == GPU_BLEND_SOLID) {
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
- else if(alphablend == GPU_BLEND_ADD) {
+ else if (alphablend == GPU_BLEND_ADD) {
glBlendFunc(GL_ONE, GL_ONE);
glEnable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
}
- else if(alphablend == GPU_BLEND_ALPHA) {
+ else if (alphablend == GPU_BLEND_ALPHA) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.0f);
}
- else if(alphablend == GPU_BLEND_CLIP) {
+ else if (alphablend == GPU_BLEND_CLIP) {
glDisable(GL_BLEND);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5f);
@@ -1238,10 +1238,10 @@ void RAS_OpenGLRasterizer::SetAlphaBlend(int alphablend)
void RAS_OpenGLRasterizer::SetFrontFace(bool ccw)
{
- if(m_last_frontface == ccw)
+ if (m_last_frontface == ccw)
return;
- if(ccw)
+ if (ccw)
glFrontFace(GL_CCW);
else
glFrontFace(GL_CW);
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
index 06f3d129e7a..ff24bd639ba 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
@@ -116,18 +116,18 @@ void RAS_VAOpenGLRasterizer::IndexPrimitives(RAS_MeshSlot& ms)
return;
}
- if(!wireframe)
+ if (!wireframe)
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
// use glDrawElements to draw each vertexarray
- for(ms.begin(it); !ms.end(it); ms.next(it)) {
- if(it.totindex == 0)
+ for (ms.begin(it); !ms.end(it); ms.next(it)) {
+ if (it.totindex == 0)
continue;
// drawing mode
- if(it.array->m_type == RAS_DisplayArray::TRIANGLE)
+ if (it.array->m_type == RAS_DisplayArray::TRIANGLE)
drawmode = GL_TRIANGLES;
- else if(it.array->m_type == RAS_DisplayArray::QUAD)
+ else if (it.array->m_type == RAS_DisplayArray::QUAD)
drawmode = GL_QUADS;
else
drawmode = GL_LINES;
@@ -150,9 +150,9 @@ void RAS_VAOpenGLRasterizer::IndexPrimitives(RAS_MeshSlot& ms)
glVertexPointer(3, GL_FLOAT, stride, it.vertex->getXYZ());
glNormalPointer(GL_FLOAT, stride, it.vertex->getNormal());
- if(!wireframe) {
+ if (!wireframe) {
glTexCoordPointer(2, GL_FLOAT, stride, it.vertex->getUV1());
- if(glIsEnabled(GL_COLOR_ARRAY))
+ if (glIsEnabled(GL_COLOR_ARRAY))
glColorPointer(4, GL_UNSIGNED_BYTE, stride, it.vertex->getRGBA());
}
@@ -160,7 +160,7 @@ void RAS_VAOpenGLRasterizer::IndexPrimitives(RAS_MeshSlot& ms)
glDrawElements(drawmode, it.totindex, GL_UNSIGNED_SHORT, it.index);
}
- if(!wireframe) {
+ if (!wireframe) {
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
}
@@ -179,18 +179,18 @@ void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms)
return;
}
- if(!wireframe)
+ if (!wireframe)
EnableTextures(true);
// use glDrawElements to draw each vertexarray
- for(ms.begin(it); !ms.end(it); ms.next(it)) {
- if(it.totindex == 0)
+ for (ms.begin(it); !ms.end(it); ms.next(it)) {
+ if (it.totindex == 0)
continue;
// drawing mode
- if(it.array->m_type == RAS_DisplayArray::TRIANGLE)
+ if (it.array->m_type == RAS_DisplayArray::TRIANGLE)
drawmode = GL_TRIANGLES;
- else if(it.array->m_type == RAS_DisplayArray::QUAD)
+ else if (it.array->m_type == RAS_DisplayArray::QUAD)
drawmode = GL_QUADS;
else
drawmode = GL_LINES;
@@ -213,9 +213,9 @@ void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms)
glVertexPointer(3, GL_FLOAT, stride, it.vertex->getXYZ());
glNormalPointer(GL_FLOAT, stride, it.vertex->getNormal());
- if(!wireframe) {
+ if (!wireframe) {
TexCoordPtr(it.vertex);
- if(glIsEnabled(GL_COLOR_ARRAY))
+ if (glIsEnabled(GL_COLOR_ARRAY))
glColorPointer(4, GL_UNSIGNED_BYTE, stride, it.vertex->getRGBA());
}
@@ -223,7 +223,7 @@ void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms)
glDrawElements(drawmode, it.totindex, GL_UNSIGNED_SHORT, it.index);
}
- if(!wireframe) {
+ if (!wireframe) {
glDisableClientState(GL_COLOR_ARRAY);
EnableTextures(false);
}
@@ -236,12 +236,12 @@ void RAS_VAOpenGLRasterizer::TexCoordPtr(const RAS_TexVert *tv)
* materials can still be used and cause crashes */
int unit;
- if(GLEW_ARB_multitexture)
+ if (GLEW_ARB_multitexture)
{
- for(unit=0; unit<m_texco_num; unit++)
+ for (unit=0; unit<m_texco_num; unit++)
{
glClientActiveTextureARB(GL_TEXTURE0_ARB+unit);
- if(tv->getFlag() & RAS_TexVert::SECOND_UV && (int)tv->getUnit() == unit) {
+ if (tv->getFlag() & RAS_TexVert::SECOND_UV && (int)tv->getUnit() == unit) {
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, sizeof(RAS_TexVert), tv->getUV2());
continue;
@@ -272,8 +272,8 @@ void RAS_VAOpenGLRasterizer::TexCoordPtr(const RAS_TexVert *tv)
glClientActiveTextureARB(GL_TEXTURE0_ARB);
}
- if(GLEW_ARB_vertex_program) {
- for(unit=0; unit<m_attrib_num; unit++) {
+ if (GLEW_ARB_vertex_program) {
+ for (unit=0; unit<m_attrib_num; unit++) {
switch(m_attrib[unit]) {
case RAS_TEXCO_ORCO:
case RAS_TEXCO_GLOB:
@@ -308,7 +308,7 @@ void RAS_VAOpenGLRasterizer::EnableTextures(bool enable)
/* we cache last texcoords and attribs to ensure we disable the ones that
* were actually last set */
- if(enable) {
+ if (enable) {
texco = m_texco;
texco_num = m_texco_num;
attrib = m_attrib;
@@ -326,8 +326,8 @@ void RAS_VAOpenGLRasterizer::EnableTextures(bool enable)
attrib_num = m_last_attrib_num;
}
- if(GLEW_ARB_multitexture) {
- for(unit=0; unit<texco_num; unit++) {
+ if (GLEW_ARB_multitexture) {
+ for (unit=0; unit<texco_num; unit++) {
glClientActiveTextureARB(GL_TEXTURE0_ARB+unit);
switch(texco[unit])
@@ -338,7 +338,7 @@ void RAS_VAOpenGLRasterizer::EnableTextures(bool enable)
case RAS_TEXCO_NORM:
case RAS_TEXTANGENT:
case RAS_TEXCO_UV2:
- if(enable) glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ if (enable) glEnableClientState(GL_TEXTURE_COORD_ARRAY);
else glDisableClientState(GL_TEXTURE_COORD_ARRAY);
break;
default:
@@ -350,14 +350,14 @@ void RAS_VAOpenGLRasterizer::EnableTextures(bool enable)
glClientActiveTextureARB(GL_TEXTURE0_ARB);
}
else {
- if(texco_num) {
- if(enable) glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ if (texco_num) {
+ if (enable) glEnableClientState(GL_TEXTURE_COORD_ARRAY);
else glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
}
- if(GLEW_ARB_vertex_program) {
- for(unit=0; unit<attrib_num; unit++) {
+ if (GLEW_ARB_vertex_program) {
+ for (unit=0; unit<attrib_num; unit++) {
switch(attrib[unit]) {
case RAS_TEXCO_ORCO:
case RAS_TEXCO_GLOB:
@@ -366,7 +366,7 @@ void RAS_VAOpenGLRasterizer::EnableTextures(bool enable)
case RAS_TEXTANGENT:
case RAS_TEXCO_UV2:
case RAS_TEXCO_VCOL:
- if(enable) glEnableVertexAttribArrayARB(unit);
+ if (enable) glEnableVertexAttribArrayARB(unit);
else glDisableVertexAttribArrayARB(unit);
break;
default:
@@ -376,7 +376,7 @@ void RAS_VAOpenGLRasterizer::EnableTextures(bool enable)
}
}
- if(!enable) {
+ if (!enable) {
m_last_texco_num = 0;
m_last_attrib_num = 0;
}