From baf07e470e50905148784eb6008cf69878440dfa Mon Sep 17 00:00:00 2001 From: ntoskrnl Date: Thu, 2 Aug 2012 23:04:35 +0300 Subject: [PATCH] Build fixes for FreeBSD --- SConscript | 2 +- src/game/GameView.cpp | 2 +- src/interface/Platform.h | 37 --------------------- src/localbrowser/LocalBrowserController.cpp | 2 -- src/search/SearchController.cpp | 7 ---- src/simulation/elements/BOMB.cpp | 4 +-- src/tasks/Task.cpp | 3 -- 7 files changed, 4 insertions(+), 53 deletions(-) diff --git a/SConscript b/SConscript index 9f0177367..7b15a24ab 100644 --- a/SConscript +++ b/SConscript @@ -90,7 +90,7 @@ if not conf.CheckLib('fftw3f') and not conf.CheckLib('fftw3f-3'): raise SystemExit(1) #Check for Lua lib -if not conf.CheckLib('lua') and not conf.CheckLib('lua5.1') and not conf.CheckLib('lua51'): +if not conf.CheckLib('lua') and not conf.CheckLib('lua5.1') and not conf.CheckLib('lua51') and not conf.CheckLib('lua-5.1'): print "liblua not found or not installed" raise SystemExit(1) diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index 4bbb811dd..b0736b48e 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -1544,7 +1544,7 @@ ui::Point GameView::lineSnapCoords(ui::Point point1, ui::Point point2) { ui::Point newPoint(0, 0); float snapAngle = floor(atan2(point2.Y-point1.Y, point2.X-point1.X)/(M_PI*0.25)+0.5)*M_PI*0.25; - float lineMag = sqrtf(pow(point2.X-point1.X,2)+pow(point2.Y-point1.Y,2)); + float lineMag = sqrtf(pow((float)(point2.X-point1.X),2)+pow((float)(point2.Y-point1.Y),2)); newPoint.X = (int)(lineMag*cos(snapAngle)+point1.X+0.5f); newPoint.Y = (int)(lineMag*sin(snapAngle)+point1.Y+0.5f); return newPoint; diff --git a/src/interface/Platform.h b/src/interface/Platform.h index f9119f185..594030373 100644 --- a/src/interface/Platform.h +++ b/src/interface/Platform.h @@ -1,43 +1,6 @@ #pragma once typedef unsigned short Uint16; -/* ***** Platform-ness ***** */ - -#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32_LEAN_AND_MEAN) -# define IEF_PLATFORM_WIN32 -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -#elif defined(linux) || defined(_linux) || defined(__linux) -# define IEF_PLATFORM_LINUX - -#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh) -# define IEF_PLATFORM_MACOSX - -//#elif defined(__FreeBSD__) || define(__FreeBSD_kernel__) -//# define IEF_PLATFORM_FREEBSD - -#else -# error Operating System not supported. -#endif - - -/* ***** Endian-ness ***** */ - -#if defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || (defined(__MIPS__) && defined(__MISPEB__)) || defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || defined(__sparc__) || defined(__hppa__) -# define IEF_ENDIAN_BIG - -#else -# define IEF_ENDIAN_LITTLE -#endif - - -/* ***** Debug-ness ***** */ - -#if !defined(NDEBUG) || defined(_DEBUG) -# define IEF_DEBUG -#endif - /* ***** Primitive Types ***** */ diff --git a/src/localbrowser/LocalBrowserController.cpp b/src/localbrowser/LocalBrowserController.cpp index 28a7c648f..9209c25cb 100644 --- a/src/localbrowser/LocalBrowserController.cpp +++ b/src/localbrowser/LocalBrowserController.cpp @@ -5,7 +5,6 @@ * Author: Simon */ #include -#include #include "client/Client.h" #include "LocalBrowserController.h" @@ -76,7 +75,6 @@ void LocalBrowserController::removeSelectedC() saveName << "Deleting save [" << saves[i] << "] ..."; notifyStatus(saveName.str()); Client::Ref().DeleteStamp(saves[i]); - usleep(100*1000); notifyProgress((float(i+1)/float(saves.size())*100)); } return true; diff --git a/src/search/SearchController.cpp b/src/search/SearchController.cpp index 5e592aed6..14d7e726b 100644 --- a/src/search/SearchController.cpp +++ b/src/search/SearchController.cpp @@ -1,6 +1,5 @@ #include #include -#include #include "SearchController.h" #include "SearchModel.h" #include "SearchView.h" @@ -210,9 +209,7 @@ void SearchController::removeSelectedC() std::stringstream saveIDF; saveIDF << "\boFailed to delete [" << saves[i] << "] ..."; notifyStatus(saveIDF.str()); - usleep(500*1000); } - usleep(100*1000); notifyProgress((float(i+1)/float(saves.size())*100)); } return true; @@ -264,9 +261,7 @@ void SearchController::unpublishSelectedC() std::stringstream saveIDF; saveIDF << "\boFailed to hide [" << saves[i] << "] ..."; notifyStatus(saveIDF.str()); - usleep(500*1000); } - usleep(100*1000); notifyProgress((float(i+1)/float(saves.size())*100)); } return true; @@ -298,9 +293,7 @@ void SearchController::FavouriteSelected() std::stringstream saveIDF; saveIDF << "\boFailed to favourite [" << saves[i] << "] ..."; notifyStatus(saveIDF.str()); - usleep(500*1000); } - usleep(100*1000); notifyProgress((float(i+1)/float(saves.size())*100)); } return true; diff --git a/src/simulation/elements/BOMB.cpp b/src/simulation/elements/BOMB.cpp index 5001df684..8aaa72207 100644 --- a/src/simulation/elements/BOMB.cpp +++ b/src/simulation/elements/BOMB.cpp @@ -66,7 +66,7 @@ int Element_BOMB::update(UPDATE_FUNC_ARGS) pmap[y][x] = 0; for (nxj=-rad; nxj<=rad; nxj++) for (nxi=-rad; nxi<=rad; nxi++) - if ((pow(nxi,2))/(pow(rad,2))+(pow(nxj,2))/(pow(rad,2))<=1) + if ((pow((float)nxi,2))/(pow((float)rad,2))+(pow((float)nxj,2))/(pow((float)rad,2))<=1) if ((pmap[y+nxj][x+nxi]&0xFF)!=PT_DMND && (pmap[y+nxj][x+nxi]&0xFF)!=PT_CLNE && (pmap[y+nxj][x+nxi]&0xFF)!=PT_PCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_BCLN) { sim->delete_part(x+nxi, y+nxj, 0); @@ -81,7 +81,7 @@ int Element_BOMB::update(UPDATE_FUNC_ARGS) } for (nxj=-(rad+1); nxj<=(rad+1); nxj++) for (nxi=-(rad+1); nxi<=(rad+1); nxi++) - if ((pow(nxi,2))/(pow((rad+1),2))+(pow(nxj,2))/(pow((rad+1),2))<=1 && !(pmap[y+nxj][x+nxi]&0xFF)) + if ((pow((float)nxi,2))/(pow((float)(rad+1),2))+(pow((float)nxj,2))/(pow((float)(rad+1),2))<=1 && !(pmap[y+nxj][x+nxi]&0xFF)) { nb = sim->create_part(-3, x+nxi, y+nxj, PT_EMBR); if (nb!=-1) diff --git a/src/tasks/Task.cpp b/src/tasks/Task.cpp index a48eab7e7..01acb2c0d 100644 --- a/src/tasks/Task.cpp +++ b/src/tasks/Task.cpp @@ -5,8 +5,6 @@ * Author: Simon */ - -#include #include "Task.h" #include "TaskListener.h" @@ -118,7 +116,6 @@ bool Task::doWork() for(int i = 0; i < 100; i++) { notifyProgress(i); - usleep((100)*1000); } return true; }