diff --git a/CMakeLists.txt b/CMakeLists.txt index c913260d..d4a2a493 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) IF(WIN32) ADD_DEFINITIONS("-D_WINDOWS -D_WIN32 -D_STDCALL_SUPPORTED -D_M_IX86 -DXML_LIBRARY -D_LIB -DUSE_STREFLOP -DSTREFLOP_SSE -DSTREFLOP_RANDOM_GEN_SIZE=32 -DLIBM_COMPILING_FLT32 -DCURL_STATICLIB") ELSE() - ADD_DEFINITIONS("-DCURL_STATICLIB") + ADD_DEFINITIONS("-DUSE_STREFLOP -DSTREFLOP_SSE -DSTREFLOP_RANDOM_GEN_SIZE=32 -DLIBM_COMPILING_FLT32 -DCURL_STATICLIB") ENDIF() ENDIF() diff --git a/source/glest_game/world/map.cpp b/source/glest_game/world/map.cpp index dee6fa5d..318165b3 100644 --- a/source/glest_game/world/map.cpp +++ b/source/glest_game/world/map.cpp @@ -1109,11 +1109,12 @@ void Map::smoothSurface(Tileset *tileset) { float numUsedToSmooth = 0.f; for (int k = -1; k <= 1; ++k) { for (int l = -1; l <= 1; ++l) { - if (cliffLevel<=0.1f || cliffLevel > abs(oldHeights[(j) * surfaceW + (i)] + if (cliffLevel<=0.1f || cliffLevel > fabs(oldHeights[(j) * surfaceW + (i)] - oldHeights[(j + k) * surfaceW + (i + l)])) { height += oldHeights[(j + k) * surfaceW + (i + l)]; numUsedToSmooth++; - } else { + } + else { // we have something which should not be smoothed! // This is a cliff and must be textured -> set cliff texture getSurfaceCell(i, j)->setSurfaceType(5); diff --git a/source/shared_lib/sources/map/map_preview.cpp b/source/shared_lib/sources/map/map_preview.cpp index 76fe1b67..4e8831ea 100644 --- a/source/shared_lib/sources/map/map_preview.cpp +++ b/source/shared_lib/sources/map/map_preview.cpp @@ -71,7 +71,7 @@ bool MapPreview::isCliff(int x, int y){ if(xToCheck < 0 || yToCheck < 0 || xToCheck >= w || yToCheck >= h){ //ignore } - else if(cliffLevel <= abs(getHeight(x, y) - getHeight(xToCheck, yToCheck))){ + else if(cliffLevel <= abs((int)(getHeight(x, y) - getHeight(xToCheck, yToCheck)))) { return true; } }