diff --git a/nanoWrap.cpp b/nanoWrap.c
similarity index 98%
rename from nanoWrap.cpp
rename to nanoWrap.c
index a30a009de2421771b32292914fa1ae480c96ed7a..c07a9ec70de314285727f88f3a8cc5ede11559e0 100644 (file)
rename from nanoWrap.cpp
rename to nanoWrap.c
index a30a009de2421771b32292914fa1ae480c96ed7a..c07a9ec70de314285727f88f3a8cc5ede11559e0 100644 (file)
--- a/nanoWrap.cpp
+++ b/nanoWrap.c
static struct nanotmuState* activetmuState = &tmuState0;
-extern "C++" GlESInterface* glEsImpl;
+extern GlESInterface* glEsImpl;
static GLenum wrapperPrimitiveMode = GL_QUADS;
GLboolean useTexCoordArray = GL_FALSE;
static GLboolean delayedttmuchange = GL_FALSE;
static GLenum delayedtmutarget = GL_TEXTURE0;
-struct VertexAttrib
+typedef struct VertexAttrib_s
{
float x;
float y;
float s_multi;
float t_multi;
#endif
- };
+ } VertexAttrib;
static VertexAttrib vertexattribs[40000];
memcpy(&nanoglState, &nanoglInitState, sizeof(struct nanoState));
memcpy(&tmuState0,&tmuInitState,sizeof(struct nanotmuState));
memcpy(&tmuState1,&tmuInitState,sizeof(struct nanotmuState));
- memcpy(¤tVertexAttrib,¤tVertexAttribInit,sizeof(struct VertexAttrib));
+ memcpy(¤tVertexAttrib,¤tVertexAttribInit,sizeof(VertexAttrib));
activetmuState = &tmuState0;
wrapperPrimitiveMode = GL_QUADS;
break;
case GL_TRIANGLES:
{
- int vcount = (vertexCount-vertexMark)/3;
- for (int count = 0; count < vcount; count++)
+ int count, vcount = (vertexCount-vertexMark)/3;
+ for (count = 0; count < vcount; count++)
{
*ptrIndexArray++ = indexCount;
*ptrIndexArray++ = indexCount+1;
int vcount = ((vertexCount-vertexMark)-3);
if (vcount && ((long)ptrIndexArray & 0x02))
{
+ unsigned int *longptr;
+ int count;
*ptrIndexArray++ = indexCount-1; // 2
*ptrIndexArray++ = indexCount-2; // 1
*ptrIndexArray++ = indexCount; // 3
vcount-=1;
int odd = vcount&1;
vcount/=2;
- unsigned int* longptr = (unsigned int*) ptrIndexArray;
+ longptr = (unsigned int*) ptrIndexArray;
- for (int count = 0; count < vcount; count++)
+ for (count = 0; count < vcount; count++)
{
*(longptr++) = (indexCount-2) | ((indexCount-1)<<16);
*(longptr++) = (indexCount) | ((indexCount)<<16);
else
{
//already aligned
+ unsigned int *longptr;
+ int count;
int odd = vcount&1;
vcount/=2;
- unsigned int* longptr = (unsigned int*) ptrIndexArray;
+ longptr = (unsigned int*) ptrIndexArray;
- for (int count = 0; count < vcount; count++)
+ for (count = 0; count < vcount; count++)
{
*(longptr++) = (indexCount-1) | ((indexCount-2)<<16);
*(longptr++) = (indexCount) | ((indexCount-1)<<16);
case GL_POLYGON:
case GL_TRIANGLE_FAN:
{
+ int count, vcount = ((vertexCount-vertexMark)-3);
*ptrIndexArray++ = indexCount++;
*ptrIndexArray++ = indexCount++;
*ptrIndexArray++ = indexCount++;
- int vcount = ((vertexCount-vertexMark)-3);
- for (int count = 0; count < vcount; count++)
+
+ for (count = 0; count < vcount; count++)
{
*ptrIndexArray++ = indexbase;
*ptrIndexArray++ = indexCount-1;
@@ -1037,7 +1042,7 @@ void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei wid
glEsImpl->glTexImage2D(target, level, internalformat, width, height,border,format,type,pixels);
}
-void glDrawBuffer(GLenum /*mode*/)
+void glDrawBuffer(GLenum mode)
{
}
@@ -1395,7 +1400,7 @@ void glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum forma
glEsImpl->glReadPixels(x,y,width,height,format,type,pixels);
}
-void glReadBuffer( GLenum /*mode*/ )
+void glReadBuffer( GLenum mode )
{
}
#if defined(__MULTITEXTURE_SUPPORT__)
-extern "C" void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t );
+void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t );
void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t )
{