Changes to fix compiles on Mac OS X
This commit is contained in:
parent
78d95b2414
commit
03a0b4f5de
@ -416,7 +416,7 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
float radius = 1.0f;
|
float radius = 1.0f;
|
||||||
float height = 2*radius*tanf(fovy*0.5f);
|
float height = 2*radius*tan(fovy*0.5f);
|
||||||
float length = osg::PI*radius; // half a cylinder.
|
float length = osg::PI*radius; // half a cylinder.
|
||||||
|
|
||||||
// creat the scene from the file list.
|
// creat the scene from the file list.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
TOPDIR = ../..
|
TOPDIR = ../..
|
||||||
include $(TOPDIR)/Make/makedirdefs
|
|
||||||
include $(TOPDIR)/Make/makedefs
|
include $(TOPDIR)/Make/makedefs
|
||||||
|
include $(TOPDIR)/Make/makedirdefs
|
||||||
|
|
||||||
DIRS = $(PLUGIN_DIRS)
|
DIRS = $(PLUGIN_DIRS)
|
||||||
|
|
||||||
|
@ -6,7 +6,11 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#ifdef __DARWIN_OSX__
|
||||||
|
#include <sys/malloc.h>
|
||||||
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <osg/CullFace>
|
#include <osg/CullFace>
|
||||||
|
@ -52,8 +52,12 @@ typedef struct ACObject_t
|
|||||||
#define Prototype
|
#define Prototype
|
||||||
#define Private static
|
#define Private static
|
||||||
#define Boolean int
|
#define Boolean int
|
||||||
|
#ifndef FALSE
|
||||||
#define FALSE (0)
|
#define FALSE (0)
|
||||||
|
#endif
|
||||||
|
#ifndef TRUE
|
||||||
#define TRUE (!FALSE)
|
#define TRUE (!FALSE)
|
||||||
|
#endif
|
||||||
#define STRING(s) (char *)(strcpy((char *)myalloc(strlen(s)+1), s))
|
#define STRING(s) (char *)(strcpy((char *)myalloc(strlen(s)+1), s))
|
||||||
#define streq(a,b) (!strcmp(a,b))
|
#define streq(a,b) (!strcmp(a,b))
|
||||||
#define myalloc malloc
|
#define myalloc malloc
|
||||||
|
@ -128,12 +128,13 @@
|
|||||||
#include "AreaGeoSetTriangulator.h"
|
#include "AreaGeoSetTriangulator.h"
|
||||||
#include "StateSetStr.h"
|
#include "StateSetStr.h"
|
||||||
|
|
||||||
|
|
||||||
#if defined(__sgi) || defined(__FreeBSD__)
|
#if defined(__sgi) || defined(__FreeBSD__)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ieeefp.h>
|
#include <ieeefp.h>
|
||||||
#else
|
#else
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#if (defined(WIN32) || defined (macintosh)) && !defined(__CYGWIN__)
|
#if (defined(WIN32) || defined (__DARWIN_OSX__)) && !defined(__CYGWIN__)
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -601,8 +602,10 @@ inline int IsNaNorInf( float f )
|
|||||||
case FP_PINF : return 1;
|
case FP_PINF : return 1;
|
||||||
default : return 0;
|
default : return 0;
|
||||||
}
|
}
|
||||||
#elif defined(__FreeBSD__) || defined(__linux) || defined(__CYGWIN__) || defined(__DARWIN_OSX__)
|
#elif defined(__FreeBSD__) || defined(__linux) || defined(__CYGWIN__)
|
||||||
return isnanf(f) || isinf(f);
|
return isnanf(f) || isinf(f);
|
||||||
|
#elif defined(__DARWIN_OSX__)
|
||||||
|
return __isnanf(f) || __isinf(f);
|
||||||
#elif defined(__sun)
|
#elif defined(__sun)
|
||||||
return isnan(f); // KLUDGE - hack to get this to compile w/g++.
|
return isnan(f); // KLUDGE - hack to get this to compile w/g++.
|
||||||
#elif defined(WIN32)
|
#elif defined(WIN32)
|
||||||
|
@ -2,10 +2,12 @@ TOPDIR = ../../..
|
|||||||
include $(TOPDIR)/Make/makedefs
|
include $(TOPDIR)/Make/makedefs
|
||||||
|
|
||||||
CXXFILES =\
|
CXXFILES =\
|
||||||
geoActions.cpp\
|
geoActions.cpp\
|
||||||
ReaderWriterGEO.cpp
|
ReaderWriterGEO.cpp
|
||||||
|
|
||||||
LIBS += -losgText -losgSim $(OSG_LIBS) $(OTHER_LIBS)
|
|
||||||
|
##LIBS += -losgText -losgSim $(OSG_LIBS) $(OTHER_LIBS)
|
||||||
|
LIBS =
|
||||||
|
|
||||||
TARGET_BASENAME = geo
|
TARGET_BASENAME = geo
|
||||||
include $(TOPDIR)/Make/cygwin_plugin_def
|
include $(TOPDIR)/Make/cygwin_plugin_def
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
// 2- animation (see geoActions.cpp).
|
// 2- animation (see geoActions.cpp).
|
||||||
// ver 1.1 GWM Dec 2002
|
// ver 1.1 GWM Dec 2002
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <osg/Image>
|
#include <osg/Image>
|
||||||
#include <osg/Group>
|
#include <osg/Group>
|
||||||
#include <osg/LOD>
|
#include <osg/LOD>
|
||||||
@ -702,7 +704,8 @@ class ReaderWriterGEO : public ReaderWriter
|
|||||||
osg::MatrixTransform *makeText(georecord *gr) { // make transform, geode & text
|
osg::MatrixTransform *makeText(georecord *gr) { // make transform, geode & text
|
||||||
osg::MatrixTransform *numt=NULL;
|
osg::MatrixTransform *numt=NULL;
|
||||||
std::string ttfPath("fonts/times.ttf");
|
std::string ttfPath("fonts/times.ttf");
|
||||||
int gFontSize1=2;
|
// unused
|
||||||
|
//int gFontSize1=2;
|
||||||
osgText::Text *text= new osgText::Text;
|
osgText::Text *text= new osgText::Text;
|
||||||
text->setFont(ttfPath);
|
text->setFont(ttfPath);
|
||||||
const geoField *gfd=gr->getField(GEO_DB_TEXT_NAME);
|
const geoField *gfd=gr->getField(GEO_DB_TEXT_NAME);
|
||||||
@ -1927,7 +1930,8 @@ void internalVars::update(const osg::FrameStamp *_frameStamp) {
|
|||||||
|
|
||||||
void geoField::parseExt(std::ifstream &fin) const { // Feb 2003 parse onme extension fields
|
void geoField::parseExt(std::ifstream &fin) const { // Feb 2003 parse onme extension fields
|
||||||
static int nread=0; // debug only
|
static int nread=0; // debug only
|
||||||
geoExtensionDefRec *geoExt=(geoExtensionDefRec *)storage;
|
// unused
|
||||||
|
//geoExtensionDefRec *geoExt=(geoExtensionDefRec *)storage;
|
||||||
for (uint i=0; i<numItems; i++) {
|
for (uint i=0; i<numItems; i++) {
|
||||||
geoExtensionDefRec rec;
|
geoExtensionDefRec rec;
|
||||||
fin.read((char *)&rec,sizeof(rec));
|
fin.read((char *)&rec,sizeof(rec));
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
// 2002
|
// 2002
|
||||||
// actions & behaviours for Geo loader in OSG
|
// actions & behaviours for Geo loader in OSG
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <osg/Image>
|
#include <osg/Image>
|
||||||
|
@ -228,10 +228,12 @@ const unsigned char SIZEOF_BITFLAGS = (SIZEOF_INT);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const unsigned short MIN_CHAR_VAL = -128;
|
// Is this really meant to be unsigned????
|
||||||
|
const unsigned short MIN_CHAR_VAL = (unsigned short)(-128);
|
||||||
const unsigned short MAX_CHAR_VAL = 127;
|
const unsigned short MAX_CHAR_VAL = 127;
|
||||||
const unsigned short MAX_UCHAR_VAL = 255;
|
const unsigned short MAX_UCHAR_VAL = 255;
|
||||||
const unsigned short MIN_SHORT_VAL = -32768;
|
// Is this really meant to be unsigned????
|
||||||
|
const unsigned short MIN_SHORT_VAL = (unsigned short)(-32768);
|
||||||
const unsigned short MAX_SHORT_VAL = 32767;
|
const unsigned short MAX_SHORT_VAL = 32767;
|
||||||
const unsigned short MAX_USHORT_VAL = 65535;
|
const unsigned short MAX_USHORT_VAL = 65535;
|
||||||
|
|
||||||
|
@ -56,7 +56,12 @@
|
|||||||
# pragma warning (disable:4541)
|
# pragma warning (disable:4541)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __DARWIN_OSX__
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/malloc.h>
|
||||||
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
#include "mynode.h"
|
#include "mynode.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "geometry.h"
|
#include "geometry.h"
|
||||||
|
@ -23,7 +23,11 @@
|
|||||||
# pragma warning (disable:4541)
|
# pragma warning (disable:4541)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __DARWIN_OSX__
|
||||||
|
#include <sys/malloc.h>
|
||||||
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
#include "mynode.h"
|
#include "mynode.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "geometry.h"
|
#include "geometry.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user