MacOS compile fixed and project builder project added (from Ben Hines).

This commit is contained in:
johns 2002-05-28 00:04:03 +00:00
parent b17d5a4e72
commit 5478400061
7 changed files with 31 additions and 23 deletions

View file

@ -824,6 +824,7 @@
<UL>
<LI>Fixed bug: Wrapper script looses all command line options
(from Josef Spillner).
<LI>MacOS compile fixed and project builder project added (from Ben Hines).
</UL>
</UL>

View file

@ -826,6 +826,7 @@ Without any order:
<LI>Flavio Silvestrow
<LI>Daniel Burrows
<LI>Dave Turner
<LI>Ben Hines
</UL>
<P><EM>And to all I have forgot to write up!</EM><BR>
Please drop me an email, if I forgot you.

View file

@ -885,9 +885,10 @@ local int AiHarvest(Unit * unit)
static const int xoffset[]={ 0,-1,+1, 0, -1,+1,-1,+1 };
static const int yoffset[]={ -1, 0, 0,+1, -1,-1,+1,+1 };
struct {
unsigned short X;
unsigned short Y;
} points[MaxMapWidth*MaxMapHeight/4];
unsigned short X;
unsigned short Y;
} * points;
int size;
int x;
int y;
int rx;
@ -910,7 +911,9 @@ local int AiHarvest(Unit * unit)
x=unit->X;
y=unit->Y;
points=alloca(TheMap.Width*TheMap.Height/4);
size=TheMap.Width*TheMap.Height/sizeof(*points);
//
// Find the nearest wood depot
//
@ -974,17 +977,17 @@ local int AiHarvest(Unit * unit)
*m=1;
points[wp].X=x; // push the point
points[wp].Y=y;
if( ++wp>=sizeof(points)/sizeof(*points) ) {// round about
wp=0;
}
if( ++wp>=size ) { // round about
wp=0;
}
} else { // unreachable
*m=99;
}
}
if( ++rp>=sizeof(points)/sizeof(*points) ) { // round about
rp=0;
}
if( ++rp>=size ) { // round about
rp=0;
}
}
//

View file

@ -509,7 +509,7 @@ extern char* strdcat3(const char* l, const char *m, const char* r);
#if !defined(BSD) || defined(__APPLE__)
/// case insensitive strstr
extern char* strcasestr(char* str, const char* substr);
#endif // BSD
#endif // !BSD || APPLE
/*============================================================================
== Misc

View file

@ -32,7 +32,7 @@
** This combination didn't likes if main is in the freecraft lib.
*/
#if defined(_MSC_VER) && !defined(_WIN32_WCE) && defined(USE_SDL)
#if defined(USE_SDL)
#include "SDL.h"
#endif

View file

@ -1133,7 +1133,7 @@ map is relative to FreeCraftLibPath=datapath, use ./map for relative to cwd\n\
** @param argc Number of arguments.
** @param argv Vector of arguments.
*/
#if defined(__MINGW32__) || defined(__CYGWIN__) || (defined(_MSC_VER) && !defined(_WIN32_WCE))
#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__APPLE__) || (defined(_MSC_VER) && !defined(_WIN32_WCE))
global int mymain(int argc,char** argv)
#else
global int main(int argc,char** argv)

View file

@ -2627,9 +2627,10 @@ global int FindWoodInSight(const Unit* unit,int* px,int* py)
static const int xoffset[]={ 0,-1,+1, 0, -1,+1,-1,+1 };
static const int yoffset[]={ -1, 0, 0,+1, -1,-1,+1,+1 };
struct {
unsigned short X;
unsigned short Y;
} points[MaxMapWidth*MaxMapHeight/4];
unsigned short X;
unsigned short Y;
} * points;
int size;
int x;
int y;
int rx;
@ -2652,6 +2653,9 @@ global int FindWoodInSight(const Unit* unit,int* px,int* py)
destx=x=unit->X;
desty=y=unit->Y;
points=alloca(TheMap.Width*TheMap.Height/4);
size=TheMap.Width*TheMap.Height/sizeof(*points);
//
// Find the nearest wood depot
@ -2728,17 +2732,16 @@ global int FindWoodInSight(const Unit* unit,int* px,int* py)
*m=1;
points[wp].X=x; // push the point
points[wp].Y=y;
if( ++wp>=sizeof(points)/sizeof(*points) ) {// round about
wp=0;
}
if( ++wp>=size ) { // round about
wp=0;
}
} else { // unreachable
*m=99;
}
}
if( ++rp>=sizeof(points)/sizeof(*points) ) { // round about
rp=0;
}
if( ++rp>=size ) { // round about
rp=0;
}
}
//