X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8b089c5e8c8a2140258d150ca1ce42afd3b79e1b..d15040492413b54a530b5a291b26750f3d265d23:/samples/opengl/penguin/lw.cpp diff --git a/samples/opengl/penguin/lw.cpp b/samples/opengl/penguin/lw.cpp index e7bfe17843..487359bbba 100644 --- a/samples/opengl/penguin/lw.cpp +++ b/samples/opengl/penguin/lw.cpp @@ -20,14 +20,22 @@ #include #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + #include "lw.h" #include #include #include -#define wxInt32 int -#define wxUint32 unsigned int - #ifndef FALSE #define FALSE 0 #endif @@ -57,12 +65,23 @@ static wxInt32 read_char(FILE *f) static wxInt32 read_short(FILE *f) { - return (read_char(f)<<8) | read_char(f); + // the execution path was not always correct + // when using the direct evaluation in the return statement + wxInt32 first = read_char(f) ; + wxInt32 second = read_char(f) ; + + return (first<<8) | second ; } static wxInt32 read_long(FILE *f) { - return (read_char(f)<<24) | (read_char(f)<<16) | (read_char(f)<<8) | read_char(f); + // the execution path was not always correct + // when using the direct evaluation in the return statement + wxInt32 first = read_char(f) ; + wxInt32 second = read_char(f) ; + wxInt32 third = read_char(f) ; + wxInt32 fourth = read_char(f) ; + return (first<<24) | (second<<16) | (third<<8) | fourth ; } static GLfloat read_float(FILE *f) @@ -109,9 +128,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); }