X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56cfd0d766b3240ef34157eb1669ffd9e2a86b9b..39d85e3caaa8dd8e7b1fa52f54faa33b3a78a32b:/samples/opengl/penguin/lw.cpp diff --git a/samples/opengl/penguin/lw.cpp b/samples/opengl/penguin/lw.cpp index aaa1d889c2..44c2dd32b4 100644 --- a/samples/opengl/penguin/lw.cpp +++ b/samples/opengl/penguin/lw.cpp @@ -16,10 +16,6 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef __WXMSW__ -#include -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -31,23 +27,19 @@ #include "wx/wx.h" #endif +#ifdef __WXMSW__ +#include +#endif + #include "lw.h" #include #include #include -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - #define MK_ID(a,b,c,d) ((((wxUint32)(a))<<24)| \ - (((wxUint32)(b))<<16)| \ - (((wxUint32)(c))<< 8)| \ - (((wxUint32)(d)) )) + (((wxUint32)(b))<<16)| \ + (((wxUint32)(c))<< 8)| \ + (((wxUint32)(d)) )) #define ID_FORM MK_ID('F','O','R','M') #define ID_LWOB MK_ID('L','W','O','B') @@ -128,9 +120,9 @@ static void read_srfs(FILE *f, int nbytes, lwObject *lwo) nbytes -= read_string(f,material->name); /* defaults */ - material->r = 0.7; - material->g = 0.7; - material->b = 0.7; + material->r = 0.7f; + material->g = 0.7f; + material->b = 0.7f; } lwo->material = (lwMaterial*) realloc(lwo->material, sizeof(lwMaterial)*lwo->material_cnt); } @@ -212,9 +204,9 @@ static void read_pols(FILE *f, int nbytes, lwObject *lwo) det_cnt = read_short(f); nbytes -= 2; while (det_cnt-- > 0) { - int cnt = read_short(f); - fseek(f, cnt*2+2, SEEK_CUR); - nbytes -= cnt*2+2; + int cnt = read_short(f); + fseek(f, cnt*2+2, SEEK_CUR); + nbytes -= cnt*2+2; } } face->material -= 1; @@ -380,13 +372,13 @@ void lw_object_show(const lwObject *lw_object) prev_index_cnt = face->index_cnt; switch (face->index_cnt) { case 3: - glBegin(GL_TRIANGLES); - break; + glBegin(GL_TRIANGLES); + break; case 4: - glBegin(GL_QUADS); - break; + glBegin(GL_QUADS); + break; default: - glBegin(GL_POLYGON); + glBegin(GL_POLYGON); } } @@ -394,8 +386,8 @@ void lw_object_show(const lwObject *lw_object) if (prev_material != face->material) { prev_material = face->material; glColor3f(lw_object->material[face->material].r, - lw_object->material[face->material].g, - lw_object->material[face->material].b); + lw_object->material[face->material].g, + lw_object->material[face->material].b); } /* update normal if necessary */