Build fixes for FreeBSD

This commit is contained in:
ntoskrnl
2012-08-02 23:04:35 +03:00
committed by Simon Robertshaw
parent d6e384e1ec
commit baf07e470e
7 changed files with 4 additions and 53 deletions

View File

@@ -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)

View File

@@ -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;

View File

@@ -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 ***** */

View File

@@ -5,7 +5,6 @@
* Author: Simon
*/
#include <sstream>
#include <unistd.h>
#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;

View File

@@ -1,6 +1,5 @@
#include <string>
#include <sstream>
#include <unistd.h>
#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;

View File

@@ -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)

View File

@@ -5,8 +5,6 @@
* Author: Simon
*/
#include <unistd.h>
#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;
}