#include <windows.h>
#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 <stdlib.h>
#include <stdio.h>
#include <math.h>
-#define wxInt32 int
-#define wxUint32 unsigned int
-
#ifndef FALSE
#define FALSE 0
#endif
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)
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);
}