more vc++ warning fixes as well as disable an unused font renderer in windows

This commit is contained in:
Mark Vejvoda 2013-11-04 20:16:52 +00:00
parent b190968e6b
commit f4cbced3f4
5 changed files with 12 additions and 12 deletions

View File

@ -117,7 +117,7 @@
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/xml/rapidxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/windows_deps/include;../../source/windows_deps/xerces-c-3.1.1/src;../../source/windows_deps/SDL-1.2.15/include;../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/sound/openal;../../source/windows_deps/openal-soft-1.14/include;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common;../../source/windows_deps/curl-7.21.3/include;../../source/shared_lib/include/map;../../source/windows_deps/libircclient/include;../../source/windows_deps/glew-1.7.0/include;../../source/windows_deps/google-breakpad\trunk\src\client\windows\;../../source/windows_deps/google-breakpad\trunk\src\;../../source/shared_lib/include/compression</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;XERCES_STATIC_LIBRARY;GLEW_STATIC;USE_FREETYPEGL;STATICLIB;USE_FTGL;FTGL_LIBRARY_STATIC;ZLIB_WINAPI;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;XERCES_STATIC_LIBRARY;GLEW_STATIC;USE_FREETYPEGL_XXX;STATICLIB;USE_FTGL;FTGL_LIBRARY_STATIC;ZLIB_WINAPI;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>

View File

@ -96,7 +96,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/windows_deps/include;../../source/windows_deps/xerces-c-3.1.1/src;../../source/windows_deps/xerces-c-3.1.1/src/xercesc/xinclude;../../source/windows_deps/lpng1510;../../source/windows_deps/jpeg-8a;../../source/windows_deps/SDL-1.2.15/include;../../source/windows_deps/openal-soft-1.14/include;../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/streflop/libm_flt32_source;../../source/shared_lib/include/platform/common;../../source/windows_deps/curl-7.21.3/include;../../source/shared_lib/include/map;../../source/shared_lib/include/platform/miniupnpc;../../source/shared_lib/include/libircclient/include;../../source/shared_lib/include/feathery_ftp;../../source/windows_deps/ftgl-2.1.3-rc5/src;../../source/windows_deps/freetype-2.4.4/include;../../source/windows_deps/glew-1.7.0/include;../../source/shared_lib/include/graphics/md5;../../source/shared_lib/include/graphics/freetype-gl;../../source/shared_lib/include/streflop/softfloat;../../source/shared_lib/include/xml/rapidxml;../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/platform/win32;../../source/windows_deps/vlc-2.0.1/include;../../source/windows_deps/fribidi-0.19.5/lib;../../source/windows_deps/fribidi-0.19.5/charset;../../source/shared_lib/include/compression;../../source/shared_lib/sources/</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;USE_FTGL;FTGL_LIBRARY_STATIC;TA3D_PLATFORM_MSVC;TA3D_PLATFORM_WINDOWS;STATICLIB;USE_FREETYPEGL;XERCES_STATIC_LIBRARY;GLEW_STATIC;XML_LIBRARY;ZLIB_WINAPI;HAS_LIBVLC;HAVE_FRIBIDI;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;USE_FTGL;FTGL_LIBRARY_STATIC;TA3D_PLATFORM_MSVC;TA3D_PLATFORM_WINDOWS;STATICLIB;USE_FREETYPEGL_XXX;XERCES_STATIC_LIBRARY;GLEW_STATIC;XML_LIBRARY;ZLIB_WINAPI;HAS_LIBVLC;HAVE_FRIBIDI;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>

View File

@ -68,15 +68,15 @@ inline T truncateDecimal(const T &value, int precision=6) {
#endif
static int MAX_INT_VALUE = numeric_limits<int>::max();
if((T)value * (T)precNum <= MAX_INT_VALUE) {
int resultInt = (T)value * (T)precNum;
int resultInt = (int)((T)value * (T)precNum);
T result = (T)resultInt / precNum;
//printf("=======================\nvalue = %.10f\nresultInt: %d\nprecision: %d\nbecame: %.10f\n----------\n",value,resultInt,precision,result);
return result;
}
// Must use an int64 since the result is large
int64 resultInt = (T)value * (T)precNum;
T result = (long double)resultInt / precNum;
int64 resultInt = (int64)((T)value * (T)precNum);
T result = (T)((long double)resultInt / precNum);
return result;
}

View File

@ -45,8 +45,8 @@
#include <stdlib.h>
#include "texture-atlas.h"
#define max(a,b) (a)>(b)?(a):(b)
#define min(a,b) (a)<(b)?(a):(b)
//#define max(a,b) (a)>(b)?(a):(b)
//#define min(a,b) (a)<(b)?(a):(b)
typedef struct { int x, y, width; } Node;
@ -254,7 +254,7 @@ texture_atlas_get_region( TextureAtlas *self,
if( y >= 0 )
{
node = (Node *) vector_get( self->nodes, i );
if( ( y + height < best_height ) ||
if( ( y + (int)height < best_height ) ||
( y + height == best_height && node->width < best_width) )
{
best_height = y + height;

View File

@ -54,8 +54,8 @@ const struct {
} FT_Errors[] =
#include FT_ERRORS_H
#define max(a,b) (a)>(b)?(a):(b)
#define min(a,b) (a)<(b)?(a):(b)
//#define max(a,b) (a)>(b)?(a):(b)
//#define min(a,b) (a)<(b)?(a):(b)
/* ------------------------------------------------------------------------- */
@ -272,9 +272,9 @@ texture_font_cache_glyphs( TextureFont *self,
slot = face->glyph;
/* Gamma correction (sort of) */
for( x=0; x<slot->bitmap.width; ++x )
for( x=0; (int)x < slot->bitmap.width; ++x )
{
for( y=0; y<slot->bitmap.rows; ++y )
for( y=0; (int)y < slot->bitmap.rows; ++y )
{
c = *(unsigned char *)(slot->bitmap.buffer
+ y*slot->bitmap.pitch + x );