Code-style consistency improvement:

Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files.
make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type.
This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
erwincoumans
2018-09-23 14:17:31 -07:00
parent b73b05e9fb
commit ab8f16961e
1773 changed files with 1081087 additions and 474249 deletions

View File

@@ -3,9 +3,9 @@
#include <assert.h>
GraphingTexture::GraphingTexture()
:m_textureId(0),
m_width(0),
m_height(0)
: m_textureId(0),
m_width(0),
m_height(0)
{
}
@@ -18,10 +18,9 @@ void GraphingTexture::destroy()
{
//TODO(erwincoumans) release memory etc...
m_width = 0;
m_height=0;
glDeleteTextures(1,(GLuint*)&m_textureId);
m_textureId=0;
m_height = 0;
glDeleteTextures(1, (GLuint*)&m_textureId);
m_textureId = 0;
}
bool GraphingTexture::create(int texWidth, int texHeight)
@@ -29,50 +28,46 @@ bool GraphingTexture::create(int texWidth, int texHeight)
m_width = texWidth;
m_height = texHeight;
glActiveTexture(GL_TEXTURE0);
m_imageData.resize(texWidth*texHeight*4);
for(int y=0;y<texHeight;++y)
m_imageData.resize(texWidth * texHeight * 4);
for (int y = 0; y < texHeight; ++y)
{
// const int t=y>>5;
GLubyte* pi=&m_imageData[y*texWidth*4];
for(int x=0;x<texWidth;++x)
GLubyte* pi = &m_imageData[y * texWidth * 4];
for (int x = 0; x < texWidth; ++x)
{
if (x>=y)//x<2||y<2||x>253||y>253)
if (x >= y) //x<2||y<2||x>253||y>253)
{
pi[0]=0;
pi[1]=0;
pi[2]=255;
pi[3]=255;
} else
{
pi[0]=255;
pi[1]=0;
pi[2]=0;
pi[3]=255;
pi[0] = 0;
pi[1] = 0;
pi[2] = 255;
pi[3] = 255;
}
pi+=4;
else
{
pi[0] = 255;
pi[1] = 0;
pi[2] = 0;
pi[3] = 255;
}
pi += 4;
}
}
glGenTextures(1,(GLuint*)&m_textureId);
glGenTextures(1, (GLuint*)&m_textureId);
uploadImageData();
return true;
}
void GraphingTexture::uploadImageData()
{
glBindTexture(GL_TEXTURE_2D,m_textureId);
assert(glGetError()==GL_NO_ERROR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width,m_height,0,GL_RGBA,GL_UNSIGNED_BYTE,&m_imageData[0]);
glBindTexture(GL_TEXTURE_2D, m_textureId);
assert(glGetError() == GL_NO_ERROR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, &m_imageData[0]);
glGenerateMipmap(GL_TEXTURE_2D);
assert(glGetError()==GL_NO_ERROR);
assert(glGetError() == GL_NO_ERROR);
}