#include "lw.h"
#include <stdlib.h>
#include <stdio.h>
-#include <math.h>
#if wxUSE_GLCANVAS
// when using the direct evaluation in the return statement
wxInt32 first = read_char(f) ;
wxInt32 second = read_char(f) ;
-
+
return (first<<8) | second ;
}
do {
c = read_char(f);
if (cnt < LW_MAX_NAME_LEN)
- s[cnt] = c;
+ s[cnt] = (char)c;
else
s[LW_MAX_NAME_LEN-1] = 0;
cnt++;
static void read_pols(FILE *f, int nbytes, lwObject *lwo)
{
int guess_cnt = lwo->face_cnt;
-
+
while (nbytes > 0) {
lwFace *face;
int i;
/* allocate space for points */
face->index = (int*) calloc(sizeof(int)*face->index_cnt,1);
-
+
/* read points in */
for (i=0; i<face->index_cnt; i++) {
face->index[i] = read_short(f);
nbytes -= 2;
}
-
+
/* read surface material */
face->material = read_short(f);
nbytes -= 2;
-
+
/* skip over detail polygons */
if (face->material < 0) {
int det_cnt;