From 067838dfd89df5829515819b67654f18f694f96f Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 11 Apr 2012 23:32:38 +0000 Subject: [PATCH] Linux fixes. --- common/camera.cpp | 4 ++-- common/lc_colors.cpp | 2 +- common/lc_colors.h | 2 ++ common/module.mk | 2 +- common/pieceinf.cpp | 12 ++++++------ common/texfont.cpp | 1 + common/texfont.h | 2 ++ 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/common/camera.cpp b/common/camera.cpp index 591748fb..b5a80fd2 100644 --- a/common/camera.cpp +++ b/common/camera.cpp @@ -317,8 +317,8 @@ bool Camera::FileLoad(lcFile& file) ChangeKey (step, false, true, f, LC_CK_UP); ChangeKey (step, true, true, f, LC_CK_UP); - lcint32 snapshot = file.ReadS32(); - lcint32 cam = file.ReadS32(); + file.ReadS32(); // snapshot + file.ReadS32(); // cam } } diff --git a/common/lc_colors.cpp b/common/lc_colors.cpp index 0cf262a7..22aec3f5 100644 --- a/common/lc_colors.cpp +++ b/common/lc_colors.cpp @@ -288,7 +288,7 @@ void LoadColorFile(lcFile& File) } // Check if the new color is valid. - if (Color.Code == -1 || Color.Value[0] == FLT_MAX) + if (Color.Code == (lcuint32)-1 || Color.Value[0] == FLT_MAX) continue; if (Color.Edge[0] == FLT_MAX) diff --git a/common/lc_colors.h b/common/lc_colors.h index 2f7f60dc..6849d970 100644 --- a/common/lc_colors.h +++ b/common/lc_colors.h @@ -1,6 +1,8 @@ #ifndef _LC_COLORS_H_ #define _LC_COLORS_H_ +#include "opengl.h" + #define LC_MAX_COLOR_NAME 64 struct lcColor diff --git a/common/module.mk b/common/module.mk index 31ad8606..37427e25 100644 --- a/common/module.mk +++ b/common/module.mk @@ -1,4 +1,4 @@ -SRC += common/algebra.cpp common/camera.cpp common/console.cpp common/curve.cpp common/lc_file.cpp \ +SRC += common/algebra.cpp common/camera.cpp common/console.cpp common/curve.cpp common/lc_colors.cpp common/lc_file.cpp \ common/globals.cpp common/group.cpp common/image.cpp common/im_bmp.cpp common/im_gif.cpp \ common/lc_application.cpp common/library.cpp common/light.cpp common/mainwnd.cpp \ common/matrix.cpp common/message.cpp common/minifig.cpp common/object.cpp common/opengl.cpp \ diff --git a/common/pieceinf.cpp b/common/pieceinf.cpp index 56550990..76291b90 100644 --- a/common/pieceinf.cpp +++ b/common/pieceinf.cpp @@ -1925,9 +1925,9 @@ void PieceInfo::WriteWavefront(FILE* file, unsigned char color, unsigned long* s for (count = *info, info++; count; count -= 3) { - int idx1 = info[0] + *start; - int idx2 = info[1] + *start; - int idx3 = info[2] + *start; + long int idx1 = info[0] + *start; + long int idx2 = info[1] + *start; + long int idx3 = info[2] + *start; if (idx1 != idx2 && idx1 != idx3 && idx2 != idx3) fprintf(file, "f %ld %ld %ld\n", idx1, idx2, idx3); @@ -1979,9 +1979,9 @@ void PieceInfo::WriteWavefront(FILE* file, unsigned char color, unsigned long* s for (count = *info, info++; count; count -= 3) { - int idx1 = info[0] + *start; - int idx2 = info[1] + *start; - int idx3 = info[2] + *start; + long int idx1 = info[0] + *start; + long int idx2 = info[1] + *start; + long int idx3 = info[2] + *start; if (idx1 != idx2 && idx1 != idx3 && idx2 != idx3) fprintf(file, "f %ld %ld %ld\n", idx1, idx2, idx3); diff --git a/common/texfont.cpp b/common/texfont.cpp index 7a88e0a3..7e0fa6b0 100644 --- a/common/texfont.cpp +++ b/common/texfont.cpp @@ -1,4 +1,5 @@ #include "lc_global.h" +#include #include "texfont.h" static const unsigned char TextureData[2048] = diff --git a/common/texfont.h b/common/texfont.h index 37aec49d..ab03e942 100644 --- a/common/texfont.h +++ b/common/texfont.h @@ -1,6 +1,8 @@ #ifndef _TEXFONT_H_ #define _TEXFONT_H_ +#include "opengl.h" + class TexFont { public: