summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/glwrapper-ogl.cc
diff options
context:
space:
mode:
authorEnne Walker <ennewalker@users.sourceforge.net>2010-04-23 16:00:41 -0400
committerEnne Walker <ennewalker@users.sourceforge.net>2010-04-24 11:41:02 -0400
commita22caea21579cd15007a2c2167d233789a1e01fa (patch)
tree96a415826979769b7a00a75966df91b785b98b02 /crawl-ref/source/glwrapper-ogl.cc
parent0f928518b4f7497c0108c1fcab0096c6c369cffb (diff)
downloadcrawl-ref-a22caea21579cd15007a2c2167d233789a1e01fa.tar.gz
crawl-ref-a22caea21579cd15007a2c2167d233789a1e01fa.zip
General coding standards update.
No spaces on parens. Line up function params. Sort includes more rationally. Put curly braces on their own line. Don't C-style typedef enum and structs. Put if-clauses on their own line.
Diffstat (limited to 'crawl-ref/source/glwrapper-ogl.cc')
-rw-r--r--crawl-ref/source/glwrapper-ogl.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/crawl-ref/source/glwrapper-ogl.cc b/crawl-ref/source/glwrapper-ogl.cc
index 5a0f1b3964..875cf9f8f6 100644
--- a/crawl-ref/source/glwrapper-ogl.cc
+++ b/crawl-ref/source/glwrapper-ogl.cc
@@ -1,8 +1,9 @@
#include "AppHdr.h"
-#include "debug.h"
-
#ifdef USE_TILE
+#ifdef USE_GL
+
+#include "glwrapper-ogl.h"
// How do we get access to the GL calls?
// If other UI types use the -ogl wrapper they should
@@ -11,8 +12,7 @@
#include <SDL_opengl.h>
#endif
-#ifdef USE_GL
-#include "glwrapper-ogl.h"
+#include "debug.h"
/////////////////////////////////////////////////////////////////////////////
// OGLStateManager
@@ -107,33 +107,33 @@ void OGLStateManager::pixelstore_unpack_alignment(unsigned int bpp)
void OGLStateManager::draw_primitive(const GLPrimitive &prim)
{
// Handle errors
- if ( !prim.vert_pointer || prim.count < 1 || prim.size < 1 )
+ if (!prim.vert_pointer || prim.count < 1 || prim.size < 1)
return;
- //ASSERT(GLStateManager::_valid(prim.count, prim.mode));
+ ASSERT(GLStateManager::_valid(prim.count, prim.mode));
// Set pointers
glVertexPointer(prim.vert_size, GL_FLOAT, prim.size, prim.vert_pointer);
- if ( prim.texture_pointer )
+ if (prim.texture_pointer)
glTexCoordPointer(2, GL_FLOAT, prim.size, prim.texture_pointer);
- if ( prim.colour_pointer )
+ if (prim.colour_pointer)
glColorPointer(4, GL_UNSIGNED_BYTE, prim.size, prim.colour_pointer);
// Handle pre-render matrix manipulations
- if ( prim.pretranslate || prim.prescale )
+ if (prim.pretranslate || prim.prescale)
{
glPushMatrix();
- if ( prim.pretranslate )
+ if (prim.pretranslate)
{
- glTranslatef( prim.pretranslate->x,
- prim.pretranslate->y,
- prim.pretranslate->z);
+ glTranslatef(prim.pretranslate->x,
+ prim.pretranslate->y,
+ prim.pretranslate->z);
}
- if ( prim.prescale )
+ if (prim.prescale)
glScalef(prim.prescale->x, prim.prescale->y, prim.prescale->z);
}
// Draw!
- switch( prim.mode )
+ switch (prim.mode)
{
case GLW_QUADS:
glDrawArrays(GL_QUADS, 0, prim.count);
@@ -146,7 +146,7 @@ void OGLStateManager::draw_primitive(const GLPrimitive &prim)
}
// Clean up
- if ( prim.pretranslate || prim.prescale )
+ if (prim.pretranslate || prim.prescale)
{
glPopMatrix();
}
@@ -157,7 +157,7 @@ void OGLStateManager::delete_textures(size_t count, unsigned int *textures)
glDeleteTextures(count, (GLuint*)textures);
}
-void OGLStateManager::generate_textures( size_t count, unsigned int *textures)
+void OGLStateManager::generate_textures(size_t count, unsigned int *textures)
{
glGenTextures(count, (GLuint*)textures);
}
@@ -168,7 +168,7 @@ void OGLStateManager::bind_texture(unsigned int texture)
}
void OGLStateManager::load_texture(unsigned char *pixels, unsigned int width,
- unsigned int height, MipMapOptions mip_opt)
+ unsigned int height, MipMapOptions mip_opt)
{
// Assumptions...
const unsigned int bpp = 4;