|
From: <axl...@us...> - 2009-12-24 17:58:18
|
Revision: 635
http://hgengine.svn.sourceforge.net/hgengine/?rev=635&view=rev
Author: axlecrusher
Date: 2009-12-24 17:58:11 +0000 (Thu, 24 Dec 2009)
Log Message:
-----------
ability to specify different UV offset
Modified Paths:
--------------
Mercury2/src/MercuryVBO.cpp
Mercury2/src/Texture.cpp
Mercury2/src/Texture.h
Modified: Mercury2/src/MercuryVBO.cpp
===================================================================
--- Mercury2/src/MercuryVBO.cpp 2009-12-23 21:24:26 UTC (rev 634)
+++ Mercury2/src/MercuryVBO.cpp 2009-12-24 17:58:11 UTC (rev 635)
@@ -49,11 +49,12 @@
++m_vboBinds;
}
+ GLCALL( glPushAttrib(GL_CURRENT_BIT) );
GLCALL( glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT) );
if (m_useVertexColor) { GLCALL( glEnableClientState( GL_COLOR_ARRAY ) ); }
- Texture::ApplyActiveTextures(STRIDE*sizeof(float));
+ Texture::ApplyActiveTextures(STRIDE*sizeof(float), 0);
GLCALL( glEnableClientState( GL_NORMAL_ARRAY ) );
GLCALL( glNormalPointer(GL_FLOAT, STRIDE*sizeof(float), BUFFER_OFFSET(sizeof(float)*2)) );
@@ -64,6 +65,7 @@
if (m_boundingVolume && SHOWBOUNDINGVOLUME) m_boundingVolume->Render();
GLCALL( glPopClientAttrib() );
+ GLCALL( glPopAttrib() );
if ( SHOWAXISES ) DrawAxes();
}
@@ -118,8 +120,8 @@
}
void* MercuryVBO::m_lastVBOrendered = NULL;
-uint32_t MercuryVBO::m_vboBatches;
-uint32_t MercuryVBO::m_vboBinds;
+uint32_t MercuryVBO::m_vboBatches = 0;
+uint32_t MercuryVBO::m_vboBinds = 0;
/****************************************************************************
* Copyright (C) 2008 by Joshua Allen *
Modified: Mercury2/src/Texture.cpp
===================================================================
--- Mercury2/src/Texture.cpp 2009-12-23 21:24:26 UTC (rev 634)
+++ Mercury2/src/Texture.cpp 2009-12-24 17:58:11 UTC (rev 635)
@@ -217,13 +217,13 @@
GLERRORCHECK;
}
-void Texture::ApplyActiveTextures(uint16_t stride)
+void Texture::ApplyActiveTextures(uint16_t stride, uint8_t uvByteOffset)
{
for (uint8_t i = 0; i < m_numActiveTextures; ++i)
{
GLCALL( glActiveTexture( GL_TEXTURE0+i ) );
GLCALL( glClientActiveTextureARB(GL_TEXTURE0+i) );
- GLCALL( glTexCoordPointer(2, GL_FLOAT, stride, BUFFER_OFFSET(sizeof(float)*0)) );
+ GLCALL( glTexCoordPointer(2, GL_FLOAT, stride, BUFFER_OFFSET(uvByteOffset)) );
}
Texture::DisableUnusedTextures();
Modified: Mercury2/src/Texture.h
===================================================================
--- Mercury2/src/Texture.h 2009-12-23 21:24:26 UTC (rev 634)
+++ Mercury2/src/Texture.h 2009-12-24 17:58:11 UTC (rev 635)
@@ -43,7 +43,7 @@
void SetRawData(RawImageData* raw);
- static void ApplyActiveTextures(uint16_t stride);
+ static void ApplyActiveTextures(uint16_t stride, uint8_t uvByteOffset);
static void DisableUnusedTextures();
void SetFilter( TextureFilterMode t ) { m_tFilterMode = t; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|