From 288bd3a2875c78e44dfba514d49b4c5e5717c6c9 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 1 Jun 2010 01:56:14 +0000 Subject: [PATCH] - Updates to get the map editor compiling --- source/glest_map_editor/main.cpp | 9 +++++++++ source/glest_map_editor/main.h | 1 - source/glest_map_editor/map.cpp | 8 +++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp index a1a39a823..c939fadae 100755 --- a/source/glest_map_editor/main.cpp +++ b/source/glest_map_editor/main.cpp @@ -15,6 +15,7 @@ #include "icons.h" #include "platform_common.h" #include +#include "math_wrapper.h" using namespace Shared::Util; using namespace Shared::PlatformCommon; @@ -966,6 +967,14 @@ void SimpleDialog::show() { // =============================================== bool App::OnInit() { +#ifdef USE_STREFLOP + + streflop_init(); + printf("STREFLOP enabled.\n"); +#else + printf("STREFLOP NOT enabled.\n"); +#endif + string fileparam; if(argc==2){ fileparam = wxFNCONV(argv[1]); diff --git a/source/glest_map_editor/main.h b/source/glest_map_editor/main.h index 83cf51b0b..b3f66289d 100644 --- a/source/glest_map_editor/main.h +++ b/source/glest_map_editor/main.h @@ -19,7 +19,6 @@ #include #include "program.h" - #include "util.h" using std::string; diff --git a/source/glest_map_editor/map.cpp b/source/glest_map_editor/map.cpp index dbf228723..004bc9b3a 100644 --- a/source/glest_map_editor/map.cpp +++ b/source/glest_map_editor/map.cpp @@ -12,7 +12,8 @@ #include "map.h" -#include +//#include +#include "math_wrapper.h" #include using namespace Shared::Util; @@ -75,7 +76,12 @@ int Map::getStartLocationY(int index) const { static int get_dist(int delta_x, int delta_y) { float dx = delta_x; float dy = delta_y; + +#ifdef USE_STREFLOP + return static_cast(streflop::sqrtf(dx * dx + dy * dy)); +#else return static_cast(sqrtf(dx * dx + dy * dy)); +#endif } void Map::glestChangeHeight(int x, int y, int height, int radius) {