Compare commits

..

21 Commits

Author SHA1 Message Date
durk
f529ec3018 Update version number. 2010-02-05 11:13:56 +01:00
Tim Moore
ad667be0d7 Merge branch 'fredb/winfix' 2010-02-05 00:23:51 +01:00
fredb
133fa09261 Update version numbers 2010-02-05 00:23:26 +01:00
Tim Moore
5dfa4c0840 Merge branch 'timoore/mat-effect' 2010-01-28 10:31:52 +01:00
Tim Moore
f918602f58 Merge branch 'freb/mingw' 2010-01-28 10:31:40 +01:00
Tim Moore
2cf2dd24a4 Merge branch 'fredb/winfix' 2010-01-28 10:31:11 +01:00
Tim Moore
eefb069d08 Create a different default effect for objects that have material animations 2010-01-27 18:42:48 +01:00
fredb
3dcffc7df8 MINGW patch from Benot Laniel 2010-01-25 14:35:45 +01:00
fredb
b121277142 Update MSVC 9 projects 2010-01-25 14:35:26 +01:00
fredb
d283fcf7b4 Update SimGear version 2010-01-25 14:35:24 +01:00
Tim Moore
e7f151ad02 Merge branch 'ehofman/sound' 2010-01-25 14:02:02 +01:00
Tim Moore
0710b781d3 Merge branch 'torsten/geoequal' 2010-01-25 14:01:52 +01:00
Tim Moore
7c01ad6917 Merge branch 'durk/version' 2010-01-25 14:00:42 +01:00
ehofman
56d2f06631 Silently ignore previous errors to prevent halting the program on silly errors 2010-01-21 11:07:58 +01:00
ehofman
9e47911b19 define _device so testForALCError can use it initialized.. 2010-01-21 11:07:58 +01:00
durk
ef80497fbe Let the version number reflect the current state of the release process. 2010-01-21 06:15:18 +01:00
fredb
e22cf106c2 Change version in comment 2010-01-21 06:13:06 +01:00
fredb
5ffb270ec1 Update simgear config.h version 2010-01-21 06:12:55 +01:00
fredb
f85f3b0f25 Update MSVC 9 project 2010-01-21 06:12:40 +01:00
fredb
e7ec83d626 Win32 fixes 2010-01-21 06:12:30 +01:00
torsten
6c14e7127d add "operator == ()" to SGGeod and SGGeoc 2010-01-03 10:10:32 +01:00
43 changed files with 12588 additions and 140 deletions

12243
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ dnl Require at least automake 2.52
AC_PREREQ(2.52)
dnl Initialize the automake stuff
AM_INIT_AUTOMAKE(SimGear, 1.9.1)
AM_INIT_AUTOMAKE(SimGear, 2.0.0)
dnl Specify KAI C++ compiler and flags.
dnl Borrowed with slight modification from blitz distribution.
@@ -34,6 +34,7 @@ AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
@@ -301,7 +302,7 @@ case "${host}" in
dnl CygWin under Windoze.
INCLUDES="$INCLUDES -I/usr/local/include/"
LIBS="$LIBS -L/usr/local/lib"
AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal ] )
AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal 'openal -ldsound -lwinmm' ] )
AC_SEARCH_LIBS(alutInit, [ openal32 ALut alut ] )
LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
openal_LIBS="$LIBS"

View File

@@ -1003,7 +1003,6 @@
RelativePath="..\..\simgear\props\ExtendedPropertyAdapter.hxx"
>
</File>
<File
RelativePath="..\..\simgear\props\props.cxx"
>
@@ -1156,6 +1155,14 @@
RelativePath="..\..\simgear\scene\model\SGScaleTransform.hxx"
>
</File>
<File
RelativePath="..\..\simgear\scene\model\SGText.cxx"
>
</File>
<File
RelativePath="..\..\simgear\scene\model\SGText.hxx"
>
</File>
<File
RelativePath="..\..\simgear\scene\model\SGTranslateTransform.cxx"
>
@@ -1168,18 +1175,18 @@
RelativePath="..\..\simgear\scene\model\shadanim.cxx"
>
</File>
<File
RelativePath="..\..\simgear\scene\model\SGText.cxx"
>
</File>
<File
RelativePath="..\..\simgear\scene\model\SGText.hxx"
>
</File>
</Filter>
<Filter
Name="Lib_sgsound"
>
<File
RelativePath="..\..\simgear\sound\sample_group.cxx"
>
</File>
<File
RelativePath="..\..\simgear\sound\sample_group.hxx"
>
</File>
<File
RelativePath="..\..\simgear\sound\sample_openal.cxx"
>
@@ -1952,7 +1959,11 @@
</File>
</Filter>
<File
RelativePath="..\..\simgear\simgear_config.h-msvc71"
RelativePath="..\..\simgear\compiler.h"
>
</File>
<File
RelativePath="..\..\simgear\simgear_config.h-msvc90"
>
<FileConfiguration
Name="Release|Win32"
@@ -1995,6 +2006,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\simgear\version.h"
>
</File>
</Files>
<Globals>
</Globals>

View File

@@ -1,9 +1,3 @@
if HAVE_THREADS
SGTHREAD_DIR = threads
else
SGTHREAD_DIR =
endif
# METAR_DIRS =
METAR_DIRS = environment
@@ -31,7 +25,7 @@ SUBDIRS = \
screen \
serial \
sound \
$(SGTHREAD_DIR) \
threads \
timing
DIST_SUBDIRS = $(SUBDIRS) compatibility

View File

@@ -63,6 +63,9 @@
# if _MSC_VER >= 1200 // msvc++ 6.0 or greater
# define isnan _isnan
# define snprintf _snprintf
# if _MSC_VER < 1500
# define vsnprintf _vsnprintf
# endif
# define copysign _copysign
# pragma warning(disable: 4786) // identifier was truncated to '255' characters
@@ -158,10 +161,6 @@ inline int (isnan)(double r) { return !(r <= 0 || r >= 0); }
# include <ieeefp.h> // isnan
#endif
#if defined(__MINGW32__)
# define isnan(x) _isnan(x)
#endif
//
// No user modifiable definitions beyond here.

View File

@@ -27,7 +27,7 @@
logstream *logstream::global_logstream = 0;
bool logbuf::logging_enabled = true;
#ifdef _MSC_VER
#ifdef _WIN32
bool logbuf::has_console = true;
#endif
sgDebugClass logbuf::logClass = SG_NONE;

View File

@@ -27,7 +27,7 @@
#include <simgear/compiler.h>
#ifdef _MSC_VER
#ifdef _WIN32
# include <windows.h>
#endif
@@ -123,7 +123,7 @@ public:
*/
void set_sb( std::streambuf* sb );
#ifdef _MSC_VER
#ifdef _WIN32
static void has_no_console() { has_console = false; }
#endif
@@ -142,7 +142,7 @@ private:
static std::streambuf* sbuf;
static bool logging_enabled;
#ifdef _MSC_VER
#ifdef _WIN32
static bool has_console;
#endif
static sgDebugClass logClass;
@@ -176,7 +176,7 @@ logbuf::would_log( sgDebugClass c, sgDebugPriority p ) const
inline logbuf::int_type
logbuf::overflow( int c )
{
#ifdef _MSC_VER
#ifdef _WIN32
if ( logging_enabled ) {
if ( !has_console ) {
AllocConsole();

View File

@@ -159,7 +159,7 @@ void SGMetar::useCurrentDate()
{
struct tm now;
time_t now_sec = time(0);
#if defined( _MSC_VER ) || defined ( __MINGW32__ )
#ifdef _WIN32
now = *gmtime(&now_sec);
#else
gmtime_r(&now_sec, &now);

View File

@@ -71,7 +71,7 @@ socktest_LDADD = \
$(top_builddir)/simgear/debug/libsgdebug.a \
$(top_builddir)/simgear/bucket/libsgbucket.a \
$(top_builddir)/simgear/misc/libsgmisc.a \
$(socktest_PLIB_LIBS) -lz
$(socktest_PLIB_LIBS) -lz \
$(network_LIBS) \
$(base_LIBS)

View File

@@ -25,7 +25,7 @@
#include <string>
#if defined(_MSC_VER) || defined(__MINGW32__)
#ifdef _WIN32
# include <io.h>
#endif
@@ -55,7 +55,7 @@ bool SGFile::open( const SGProtocolDir d ) {
set_dir( d );
if ( get_dir() == SG_IO_OUT ) {
#if defined(_MSC_VER) || defined(__MINGW32__)
#ifdef _WIN32
int mode = 00666;
#else
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;

View File

@@ -4,7 +4,12 @@
#include <simgear/compiler.h>
#ifdef _WIN32
#include <windows.h>
#define sleep(x) Sleep(x*1000)
#else
#include <unistd.h>
#endif
#include <iostream>
#include "sg_socket.hxx"
@@ -44,10 +49,6 @@ int main() {
if ( s.readline( buf, 256 ) > 0 ) {
cout << "result = " << buf;
}
#ifdef __MINGW32__
Sleep(100);
#else
sleep(1);
#endif
}
}

View File

@@ -79,6 +79,8 @@ public:
static double courseDeg(const SGGeoc& from, const SGGeoc& to);
static double distanceM(const SGGeoc& from, const SGGeoc& to);
// Compare two geocentric positions for equality
bool operator == ( const SGGeoc & other ) const;
private:
/// This one is private since construction is not unique if you do
/// not know the units of the arguments, use the factory methods for
@@ -323,6 +325,15 @@ SGGeoc::distanceM(const SGGeoc& from, const SGGeoc& to)
return SGGeodesy::distanceM(from, to);
}
inline
bool
SGGeoc::operator == ( const SGGeoc & other ) const
{
return _lon == other._lon &&
_lat == other._lat &&
_radius == other._radius;
}
/// Output to an ostream
template<typename char_type, typename traits_type>
inline

View File

@@ -86,6 +86,9 @@ public:
/// Set the geodetic elevation from the argument given in feet
void setElevationFt(double elevation);
// Compare two geodetic positions for equality
bool operator == ( const SGGeod & other ) const;
#ifndef NO_OPENSCENEGRAPH_INTERFACE
// Create a local coordinate frame in the earth-centered frame of
// reference. X points north, Z points down.
@@ -350,6 +353,15 @@ SGGeod::setElevationFt(double elevation)
_elevation = elevation*SG_FEET_TO_METER;
}
inline
bool
SGGeod::operator == ( const SGGeod & other ) const
{
return _lon == other._lon &&
_lat == other._lat &&
_elevation == other._elevation;
}
/// Output to an ostream
template<typename char_type, typename traits_type>
inline

View File

@@ -18,10 +18,6 @@
#ifndef SGVec2_H
#define SGVec2_H
#if defined ( __CYGWIN__ )
#include <ieeefp.h>
#endif
#ifndef NO_OPENSCENEGRAPH_INTERFACE
#include <osg/Vec2f>
#include <osg/Vec2d>

View File

@@ -29,7 +29,7 @@
#include <stdio.h>
#include <sys/stat.h>
#include <sys/stat.h>
#if defined( _MSC_VER) || defined(__MINGW32__)
#ifdef _WIN32
# include <direct.h>
#endif
#include "sg_path.hxx"
@@ -42,7 +42,7 @@
static const char sgDirPathSep = '/';
static const char sgDirPathSepBad = '\\';
#if defined( WIN32 ) && !defined(__CYGWIN__)
#ifdef _WIN32
static const char sgSearchPathSep = ';';
#else
static const char sgSearchPathSep = ':';
@@ -181,7 +181,7 @@ bool SGPath::exists() const {
return true;
}
#if defined( _MSC_VER) || defined(__MINGW32__)
#ifdef _WIN32
# define sgMkDir(d,m) _mkdir(d)
#else
# define sgMkDir(d,m) mkdir(d,m)
@@ -199,7 +199,7 @@ int SGPath::create_dir( mode_t mode ) {
unsigned int i = 1;
SGPath dir = absolute ? string( 1, sgDirPathSep ) : "";
dir.concat( path_elements[0] );
#if defined( _MSC_VER) || defined(__MINGW32__)
#ifdef _WIN32
if ( dir.str().find(':') != string::npos && path_elements.size() >= 2 ) {
dir.append( path_elements[1] );
i = 2;

View File

@@ -20,10 +20,6 @@ void printOpDEBUG(int ip, int op);
void printStackDEBUG(naContext ctx);
////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER
#define vsnprintf _vsnprintf
#endif
struct Globals* globals = 0;
static naRef bindFunction(naContext ctx, struct Frame* f, naRef code);

View File

@@ -195,14 +195,16 @@ static naRef f_readln(naContext ctx, naRef me, int argc, naRef* args)
return result;
}
#ifdef _WIN32
#define S_ISLNK(m) 0
#define S_ISSOCK(m) 0
#endif
#ifdef _MSC_VER
#define S_ISREG(m) (((m)&_S_IFMT)==_S_IFREG)
#define S_ISDIR(m) (((m)&_S_IFMT)==_S_IFDIR)
#define S_ISCHR(m) (((m)&_S_IFMT)==_S_IFCHR)
#define S_ISFIFO(m) (((m)&_S_IFMT)==_S_IFIFO)
#define S_ISBLK(m) 0
#define S_ISLNK(m) 0
#define S_ISSOCK(m) 0
typedef unsigned short mode_t;
#endif
static naRef ftype(naContext ctx, mode_t m)

View File

@@ -1,3 +1,8 @@
#ifdef HAVE_CONFIG_H
# include <simgear_config.h>
#endif
#include "AtomicChangeListener.hxx"
#include <algorithm>

View File

@@ -266,7 +266,7 @@ public:
else
return itr->second.ptr();
}
template<typename T> friend class InstallAttributeBuilder;
template<typename T> friend struct InstallAttributeBuilder;
};
template<typename T>

View File

@@ -25,10 +25,6 @@
# include <simgear_config.h>
#endif
#if defined ( __CYGWIN__ )
#include <ieeefp.h>
#endif
#include <simgear/compiler.h>
#include <simgear/constants.h>
#include <simgear/structure/exception.hxx>

View File

@@ -29,6 +29,7 @@
#include <simgear/scene/model/model.hxx>
using namespace std;
using namespace simgear;
namespace {
/**
@@ -485,6 +486,8 @@ SGMaterialAnimation::createAnimationGroup(osg::Group& parent)
mat->setDataVariance(osg::Object::DYNAMIC);
unsigned defaultColorModeMask = 0;
mat->setUpdateCallback(0); // Just to make sure.
// XXX This should probably go away, as ac3d models always have a
// DIFFUSE color mode.
switch (mat->getColorMode()) {
case osg::Material::OFF:
defaultColorModeMask = 0;
@@ -576,3 +579,32 @@ SGMaterialAnimation::install(osg::Node& node)
}
defaultAmbientDiffuse = defaultsVisitor.ambientDiffuse;
}
const char* colorNames[] =
{
"ambient",
"diffuse",
"specular",
"emission"
};
// Build an effect which mimics the material color mode in a
// shader. The OpenGL material values will be overridden by the
// material animation's material.
//
// This is a hack to get the effect to respect the values set in the
// material, set up by the animation, which overrides the values in
// the effect's material attributes. Things will be different when
// material animations are implemented purely by manipulating effects.
SGPropertyNode_ptr
SGMaterialAnimation::makeEffectProperties(const SGPropertyNode* animProp)
{
SGPropertyNode_ptr eRoot = new SGPropertyNode;
SGPropertyNode* inherit = makeNode(eRoot, "inherits-from");
if (animProp->hasChild("diffuse") || animProp->hasChild("transparency"))
inherit->setStringValue("Effects/material-off");
else
inherit->setStringValue("Effects/material-diffuse");
return eRoot;
}

View File

@@ -26,6 +26,7 @@ public:
const osgDB::ReaderWriter::Options* options);
virtual osg::Group* createAnimationGroup(osg::Group& parent);
virtual void install(osg::Node& node);
static SGPropertyNode_ptr makeEffectProperties(const SGPropertyNode* animProp);
private:
osg::ref_ptr<osg::Material> defaultMaterial;
osg::Vec4 defaultAmbientDiffuse;

View File

@@ -49,6 +49,7 @@
#include "particles.hxx"
#include "model.hxx"
#include "SGText.hxx"
#include "SGMaterialAnimation.hxx"
using namespace std;
using namespace simgear;
@@ -145,31 +146,42 @@ void makeEffectAnimations(PropertyList& animation_nodes,
for (PropertyList::iterator itr = animation_nodes.begin();
itr != animation_nodes.end();
++itr) {
SGPropertyNode_ptr effectProp;
SGPropertyNode* animProp = itr->ptr();
SGPropertyNode* typeProp = animProp->getChild("type");
if (!typeProp || strcmp(typeProp->getStringValue(), "shader"))
if (!typeProp)
continue;
SGPropertyNode* shaderProp = animProp->getChild("shader");
if (!shaderProp || strcmp(shaderProp->getStringValue(), "chrome"))
continue;
*itr = 0;
SGPropertyNode* textureProp = animProp->getChild("texture");
if (!textureProp)
continue;
SGPropertyNode_ptr effectProp = new SGPropertyNode();
makeChild(effectProp.ptr(), "inherits-from")
->setValue("Effects/chrome");
SGPropertyNode* paramsProp = makeChild(effectProp.get(), "parameters");
makeChild(paramsProp, "chrome-texture")
->setValue(textureProp->getStringValue());
PropertyList objectNameNodes = animProp->getChildren("object-name");
for (PropertyList::iterator objItr = objectNameNodes.begin(),
end = objectNameNodes.end();
objItr != end;
++objItr)
effectProp->addChild("object-name")
->setStringValue((*objItr)->getStringValue());
effect_nodes.push_back(effectProp);
const char* typeString = typeProp->getStringValue();
if (!strcmp(typeString, "material")) {
effectProp
= SGMaterialAnimation::makeEffectProperties(animProp);
} else if (!strcmp(typeString, "shader")) {
SGPropertyNode* shaderProp = animProp->getChild("shader");
if (!shaderProp || strcmp(shaderProp->getStringValue(), "chrome"))
continue;
*itr = 0; // effect replaces animation
SGPropertyNode* textureProp = animProp->getChild("texture");
if (!textureProp)
continue;
effectProp = new SGPropertyNode();
makeChild(effectProp.ptr(), "inherits-from")
->setValue("Effects/chrome");
SGPropertyNode* paramsProp = makeChild(effectProp.get(), "parameters");
makeChild(paramsProp, "chrome-texture")
->setValue(textureProp->getStringValue());
}
if (effectProp.valid()) {
PropertyList objectNameNodes = animProp->getChildren("object-name");
for (PropertyList::iterator objItr = objectNameNodes.begin(),
end = objectNameNodes.end();
objItr != end;
++objItr)
effectProp->addChild("object-name")
->setStringValue((*objItr)->getStringValue());
effect_nodes.push_back(effectProp);
}
}
animation_nodes.erase(remove_if(animation_nodes.begin(),
animation_nodes.end(),

View File

@@ -75,10 +75,6 @@ using namespace osg;
// # endif
// #endif
#if defined (__CYGWIN__)
#include <ieeefp.h>
#endif
static osg::ref_ptr<osg::StateSet> layer_states[SGCloudLayer::SG_MAX_CLOUD_COVERAGES];
static osg::ref_ptr<osg::StateSet> layer_states2[SGCloudLayer::SG_MAX_CLOUD_COVERAGES];
static osg::ref_ptr<osg::TextureCubeMap> cubeMap;

View File

@@ -63,10 +63,6 @@ using std::vector;
using namespace simgear;
#if defined (__CYGWIN__)
#include <ieeefp.h>
#endif
float SGCloudField::fieldSize = 50000.0f;
double SGCloudField::timer_dt = 0.0;
float SGCloudField::view_distance = 20000.0f;

View File

@@ -20,10 +20,6 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// $Id$
#ifdef __CYGWIN__
#include <ieeefp.h>
#endif
#include <simgear/compiler.h>
#include <simgear/constants.h>

View File

@@ -27,10 +27,6 @@
# include <simgear_config.h>
#endif
#ifdef __CYGWIN__
#include <ieeefp.h>
#endif
#include <simgear/compiler.h>
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>

View File

@@ -19,6 +19,10 @@
*
*/
#ifdef HAVE_CONFIG_H
# include <simgear_config.h>
#endif
#include <algorithm>
#include <vector>
#include <string>

View File

@@ -17,6 +17,10 @@
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
#ifdef HAVE_CONFIG_H
# include <simgear_config.h>
#endif
#include "CopyOp.hxx"
#include <simgear/scene/material/Effect.hxx>

View File

@@ -2,11 +2,7 @@
# include <simgear_config.h>
#endif
#if defined(__CYGWIN__) /* && !defined(USING_X) */
#define WIN32
#endif
#if defined(WIN32) /* MINGW and MSC predefine WIN32 */
#ifdef WIN32
# include <windows.h>
#endif

View File

@@ -39,9 +39,6 @@
* Implementation of class RenderTexture. A multi-format render to
* texture wrapper.
*/
#ifdef _MSC_VER
#pragma warning(disable:4786)
#endif
/*
* Changelog:
@@ -339,11 +336,7 @@ void PrintExtensionError( const char* strMsg, ... )
char strBuffer[512];
va_list args;
va_start(args, strMsg);
#if defined _WIN32 && !defined __CYGWIN__
_vsnprintf( strBuffer, 512, strMsg, args );
#else
vsnprintf( strBuffer, 512, strMsg, args );
#endif
va_end(args);
SG_LOG(SG_GL, SG_ALERT, strMsg);
@@ -1055,11 +1048,7 @@ bool RenderTexture::Reset(const char *strMode, ...)
va_list args;
char strBuffer[256];
va_start(args,strMode);
#if defined _WIN32 && !defined __CYGWIN__
_vsnprintf( strBuffer, 256, strMode, args );
#else
vsnprintf( strBuffer, 256, strMode, args );
#endif
va_end(args);
_ParseModeString(strBuffer, _pixelFormatAttribs, _pbufferAttribs);

View File

@@ -24,11 +24,7 @@
#ifndef __SG_EXTENSIONS_HXX
#define __SG_EXTENSIONS_HXX 1
#if defined(__CYGWIN__) && !defined(WIN32) /* && !defined(USING_X) */
#define WIN32
#endif
#if defined(WIN32) /* MINGW and MSC predefine WIN32 */
#ifdef WIN32
# include <windows.h>
#endif

View File

@@ -23,11 +23,7 @@
# include <simgear_config.h>
#endif
#if defined(__CYGWIN__) /* && !defined(USING_X) */
#define WIN32
#endif
#if defined(WIN32) /* MINGW and MSC predefine WIN32 */
#ifdef WIN32
# include <windows.h>
#endif

View File

@@ -26,7 +26,7 @@
#include <iostream>
#include <cerrno>
#if !defined( WIN32 ) || defined( __CYGWIN__) || defined( __CYGWIN32__ )
#ifndef _WIN32
# include <termios.h>
# include <sys/types.h>
# include <sys/stat.h>
@@ -60,7 +60,7 @@ SGSerialPort::~SGSerialPort() {
bool SGSerialPort::open_port(const string& device) {
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
#ifdef _WIN32
fd = CreateFile( device.c_str(),
GENERIC_READ | GENERIC_WRITE,
@@ -147,7 +147,7 @@ bool SGSerialPort::open_port(const string& device) {
bool SGSerialPort::close_port() {
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
#ifdef _WIN32
CloseHandle( fd );
#else
close(fd);
@@ -161,7 +161,7 @@ bool SGSerialPort::close_port() {
bool SGSerialPort::set_baud(int baud) {
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
#ifdef _WIN32
DCB dcb;
if ( GetCommState( fd, &dcb ) ) {
@@ -274,7 +274,7 @@ string SGSerialPort::read_port() {
char buffer[max_count+1];
string result;
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
#ifdef _WIN32
DWORD count;
if ( ReadFile( fd, buffer, max_count, &count, 0 ) ) {
@@ -326,7 +326,7 @@ string SGSerialPort::read_port() {
int SGSerialPort::read_port(char *buf, int len) {
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
#ifdef _WIN32
DWORD count;
if ( ReadFile( fd, buf, len, &count, 0 ) ) {
@@ -383,7 +383,7 @@ int SGSerialPort::read_port(char *buf, int len) {
int SGSerialPort::write_port(const string& value) {
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
#ifdef _WIN32
LPCVOID lpBuffer = value.data();
DWORD nNumberOfBytesToWrite = value.length();
@@ -457,7 +457,7 @@ int SGSerialPort::write_port(const string& value) {
int SGSerialPort::write_port(const char* buf, int len) {
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
#ifdef _WIN32
LPCVOID lpBuffer = buf;
DWORD nNumberOfBytesToWrite = len;

View File

@@ -32,7 +32,7 @@
# error This library requires C++
#endif
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
#ifdef _WIN32
# include <windows.h>
#endif
@@ -49,7 +49,7 @@ using std::string;
*/
class SGSerialPort
{
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined( __CYGWIN32__ )
#ifdef _WIN32
typedef HANDLE fd_type;
#else
typedef int fd_type;

View File

@@ -31,7 +31,7 @@
/* #define TM_IN_SYS_TIME 1 */
/* Define to version number */
#define VERSION "1.99.4"
#define VERSION "2.0.0"
/* Define if compiling on a Winbloze (95, NT, etc.) platform */
#define WIN32 1

View File

@@ -0,0 +1,157 @@
/* simgear_config.h. Generated for MSCV++ 9.0 */
/* Define if the X Window System is missing or not being used. */
#define X_DISPLAY_MISSING 1
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define if you don't have vprintf but do have _doprnt. */
/* #undef HAVE_DOPRNT */
/* Define if you have the vprintf function. */
#define HAVE_VPRINTF 1
/* Define to package name */
#define PACKAGE "FlightGear"
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you can safely include both <sys/time.h> and <time.h>. */
/* #undef TIME_WITH_SYS_TIME */
/* Define if your <sys/time.h> declares struct tm. */
/* #define TM_IN_SYS_TIME 1 */
/* Define to version number */
#define VERSION "2.0.0"
/* Define if compiling on a Winbloze (95, NT, etc.) platform */
#define WIN32 1
/* Define if you have the GetLocalTime function. */
#define HAVE_GETLOCALTIME 1
/* Define if you have the ftime function. */
/* #define HAVE_FTIME 1 */
/* Define if you have the getitimer function. */
/* #define HAVE_GETITIMER 1 */
/* Define if you have the getrusage function. */
/* #define HAVE_GETRUSAGE 1 */
/* Define if you have the gettimeofday function. */
/* #define HAVE_GETTIMEOFDAY 1 */
/* Define if you have the mktime function. */
#define HAVE_MKTIME 1
/* Define if you have the rand function. */
#define HAVE_RAND 1
/* Define if you have the random function. */
#define HAVE_RANDOM 1
/* Define if you have the rint function. */
/* #define HAVE_RINT 1 */
/* Define if you have the setitimer function. */
/* #define HAVE_SETITIMER 1 */
/* Define if you have the signal function. */
#define HAVE_SIGNAL 1
/* Define if you have the strstr function. */
#define HAVE_STRSTR 1
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define if you have the <getopt.h> header file. */
/* #define HAVE_GETOPT_H 1 */
/* Define if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <sys/time.h> header file. */
/* #define HAVE_SYS_TIME_H 1 */
/* Define if you have the <sys/timeb.h> header file. */
#define HAVE_SYS_TIMEB_H 1
/* Define if you have the <unistd.h> header file. */
/* #define HAVE_UNISTD_H 1 */
/* Define if you have the <values.h> header file. */
/* #define HAVE_VALUES_H 1 */
/* Define if you have the <winbase.h> header file. */
#define HAVE_WINBASE_H 1
/* Define if you have the <windows.h> header file. */
#define HAVE_WINDOWS_H 1
/* Define if you have the GL library (-lGL). */
#define HAVE_LIBGL 1
/* Define if you have the GLU library (-lGLU). */
#define HAVE_LIBGLU 1
/* Define if you have the GLcore library (-lGLcore). */
/* #undef HAVE_LIBGLCORE */
/* Define if you have the ICE library (-lICE). */
/* #define HAVE_LIBICE 1 */
/* Define if you have the MesaGL library (-lMesaGL). */
/* #undef HAVE_LIBMESAGL */
/* Define if you have the MesaGLU library (-lMesaGLU). */
/* #undef HAVE_LIBMESAGLU */
/* Define if you have the SM library (-lSM). */
/* #define HAVE_LIBSM 1 */
/* Define if you have the X11 library (-lX11). */
/* #define HAVE_LIBX11 1 */
/* Define if you have the Xext library (-lXext). */
/* #define HAVE_LIBXEXT 1 */
/* Define if you have the Xi library (-lXi). */
/* #define HAVE_LIBXI 1 */
/* Define if you have the Xmu library (-lXmu). */
/* #define HAVE_LIBXMU 1 */
/* Define if you have the Xt library (-lXt). */
/* #define HAVE_LIBXT 1 */
/* Define if you have the glut library (-lglut). */
#define HAVE_LIBGLUT 1
/* Define if you have the m library (-lm). */
#define HAVE_LIBM 1
/* Define if you have the socket library (-lsocket). */
/* #undef HAVE_LIBSOCKET */
/* Define if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
#define HAVE_MEMCPY 1
#define GLUT_H <GL/glut.h>
#define NOMINMAX 1

View File

@@ -31,7 +31,7 @@
/* #define TM_IN_SYS_TIME 1 */
/* Define to version number */
#define VERSION "0.0.8"
#define VERSION "2.0.0"
/* Define if compiling on a Winbloze (95, NT, etc.) platform */
#define WIN32 1

View File

@@ -1,9 +1,8 @@
#include <stdio.h>
#ifdef __MINGW32__
// This is broken, but allows the file to compile without a POSIX
// environment.
static unsigned int sleep(unsigned int secs) { return 0; }
#ifdef _WIN32
#include <windows.h>
#define sleep(x) Sleep(x*1000)
#else
#include <unistd.h> // sleep()
#endif

View File

@@ -110,7 +110,9 @@ void SGSoundMgr::init(const char *devname) {
}
}
_device = device;
ALCcontext *context = alcCreateContext(device, NULL);
testForALCError("context creation.");
if ( testForError(context, "Unable to create a valid context.") ) {
alcCloseDevice (device);
return;
@@ -162,7 +164,7 @@ void SGSoundMgr::init(const char *devname) {
_vendor = (const char *)alGetString(AL_VENDOR);
_renderer = (const char *)alGetString(AL_RENDERER);
if ( _vendor != "OpenAL Community" ||
if ( (_vendor != "OpenAL Community" && _vendor != "Apple Computer Inc.") ||
(_renderer != "Software" && _renderer != "OpenAL Sample Implementation")
)
{
@@ -552,8 +554,9 @@ bool SGSoundMgr::load(string &samplepath, void **dbuf, int *fmt,
#if defined(ALUT_API_MAJOR_VERSION) && ALUT_API_MAJOR_VERSION >= 1
ALfloat freqf;
testForALError("load file");
testForALCError("load file");
// ignore previous errors to prevent the system from halting on silly errors
alGetError();
alcGetError(_device);
data = alutLoadMemoryFromFile(samplepath.c_str(), &format, &size, &freqf );
freq = (ALsizei)freqf;
int error = alutGetError();

View File

@@ -28,7 +28,7 @@
#elif defined(__sgi) && defined(_COMPILER_VERSION) && (_COMPILER_VERSION>=730)
// No need to include something. Is a Compiler API ...
# define SGATOMIC_USE_MIPSPRO_BUILTINS
#elif defined(WIN32) && !defined ( __CYGWIN__ )
#elif defined(_WIN32)
# include <windows.h>
# define SGATOMIC_USE_WIN32_INTERLOCKED
#else

View File

@@ -1,5 +1,6 @@
includedir = @includedir@/threads
if HAVE_THREADS
lib_LIBRARIES = libsgthreads.a
include_HEADERS = \
@@ -11,3 +12,6 @@ libsgthreads_a_SOURCES = \
SGThread.cxx
INCLUDES = -I$(top_srcdir)
else
include_HEADERS = SGQueue.hxx
endif

View File

@@ -59,7 +59,7 @@
#include "timestamp.hxx"
void SGTimeStamp::stamp() {
#if defined( WIN32 ) && !defined(__CYGWIN__)
#ifdef _WIN32
unsigned int t;
t = timeGetTime();
_sec = t / 1000;