1
0
Fork 0

Merge branch 'next' of gitorious.org:fg/flightgear into next

This commit is contained in:
Curtis L. Olson 2012-07-05 11:24:40 -05:00
commit b14ddd4011
10 changed files with 135 additions and 19 deletions

View file

@ -6,17 +6,17 @@ Summary: The FlightGear Flight Simulator
Name: %{name} Name: %{name}
Version: %{version} Version: %{version}
Release: %{release} Release: %{release}
License: GPL License: GPL-2.0
URL: http://www.flightgear.org URL: http://www.flightgear.org
Group: Games/Other Group: Games/Other
BuildRoot: %{_tmppath}/%{name}-buildroot BuildRoot: %{_tmppath}/%{name}-buildroot
Source: http://mirrors.ibiblio.org/pub/mirrors/flightgear/ftp/Source/flightgear-%{version}.tar.bz2 Source: http://mirrors.ibiblio.org/pub/mirrors/flightgear/ftp/Source/flightgear-%{version}.tar.bz2
Source1: http://mirrors.ibiblio.org/pub/mirrors/flightgear/ftp/Shared/FlightGear-data-%{version}.tar.bz2 Source1: http://mirrors.ibiblio.org/pub/mirrors/flightgear/ftp/Shared/FlightGear-data-%{version}.tar.bz2
Source3: flightgear.desktop Source3: flightgear.desktop
BuildRequires: gcc, gcc-c++, cmake
BuildRequires: plib >= 1.8.0, SimGear = %{version} BuildRequires: plib >= 1.8.0, SimGear = %{version}
BuildRequires: XFree86-devel, XFree86-Mesa-libGL, XFree86-Mesa-libGLU, gcc, zlib-devel BuildRequires: XFree86-devel, XFree86-Mesa-libGL, XFree86-Mesa-libGLU, zlib-devel
BuildRequires: OpenSceneGraph >= 3.0.0 BuildRequires: OpenSceneGraph >= 3.0.0
Requires: XFree86-devel, XFree86-Mesa-libGL, XFree86-Mesa-libGLU, gcc, zlib-devel
Obsoletes: FlightGear Obsoletes: FlightGear
Provides: FlightGear = %{version}-%{release} Provides: FlightGear = %{version}-%{release}

View file

@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Name=FlightGear
Comment=FlightGear Flight Simulator
Exec=fgfs
Icon=FlightGear
Categories=Game;Simulation;

View file

@ -0,0 +1,78 @@
Summary: The FlightGear Flight Simulator
Name: FlightGear
Version: 2.8.0
Release: 1
License: GPL-2.0
URL: http://www.flightgear.org
Group: Amusements/Games/3D/Simulation
BuildRoot: %{_tmppath}/%{name}-buildroot
Source0: http://mirrors.ibiblio.org/pub/mirrors/flightgear/ftp/Source/flightgear-%{version}.tar.bz2
Source1: %{name}.desktop
BuildRequires: gcc, gcc-c++, cmake
BuildRequires: update-desktop-files
BuildRequires: SimGear = %{version}, SimGear-devel = %{version}
BuildRequires: libOpenSceneGraph-devel >= 3.0
BuildRequires: subversion-devel, libapr1-devel
BuildRequires: freealut, freealut-devel
BuildRequires: libopenal1-soft, openal-soft
BuildRequires: zlib, zlib-devel
BuildRequires: libfreetype6
BuildRequires: libjpeg62, libjpeg62-devel
BuildRequires: libudev-devel
BuildRequires: boost-devel >= 1.37
Requires: OpenSceneGraph-plugins >= 3.0
Requires: FlightGear-data = %{version}
Requires: SimGear = %{version}
%description
The FlightGear project is working to create a sophisticated flight simulator
framework for the development and pursuit of interesting flight simulator
ideas. We are developing a solid basic sim that can be expanded and improved
upon by anyone interested in contributing.
%prep
%setup -q -n flightgear-%{version} -T -b 0
rm -f docs-mini/*
# remove unnecessary DATE/TIME dependency
sed -i 's/__DATE__" "__TIME__//' src/FDM/JSBSim/FGJSBBase.cpp
%build
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
export BUILD_ID=OpenSuSE
export BUILD_NUMBER=0
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DSIMGEAR_SHARED:BOOL=ON -DENABLE_TESTS:BOOL=OFF -DFG_DATA_DIR:STRING="/usr/share/flightgear" -DJPEG_FACTORY:BOOL=ON
make %{?_smp_mflags}
%install
make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT
# install desktop link
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications/
cp %{SOURCE1} $RPM_BUILD_ROOT/%{_datadir}/applications/
%suse_update_desktop_file -i %{name}
# move docs into doc/packages subfolder
mkdir -p $RPM_BUILD_ROOT/usr/share/doc/packages/FlightGear
cp README $RPM_BUILD_ROOT/usr/share/doc/packages/FlightGear/.
cp COPYING $RPM_BUILD_ROOT/usr/share/doc/packages/FlightGear/.
cp AUTHORS $RPM_BUILD_ROOT/usr/share/doc/packages/FlightGear/.
# install icon
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
cp icons/fg-128.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/FlightGear.png
# remove obsolete/test utilities
cd $RPM_BUILD_ROOT/usr/bin && rm -f GPSsmooth MIDGsmooth UGsmooth metar
%files
%defattr(-, root, root, -)
%dir /usr/share/doc/packages/FlightGear
/usr/share/doc/packages/FlightGear/*
%{_bindir}/*
%_mandir/man1/*
%{_datadir}/pixmaps/FlightGear.png
%{_datadir}/applications/%{name}.desktop
%changelog
* Thu Jun 30 2012 thorstenb@flightgear.org
- Initial version

28
package/openSUSE/README Normal file
View file

@ -0,0 +1,28 @@
Building a FlightGear RPM package for openSUSE
(Last tested with openSUSE 11.4+12.1)
This directory contains the files which, along with
the source code tar files, can be used to build
an RPM package targeted at an openSUSE Linux system.
To build FlightGear from source do the following:
1. obtain flightgear-2.8.0.tar.bz2 (adapt version if
necessary) and copy it into ~/rpmbuild/SOURCES
2. copy FlightGear.desktop to ~/rpmbuild/SOURCES
3. obtain (or build) and install SimGear (exact
match with FlightGear's version required).
4. look in the BuildRequires section of FlightGear.spec
and check that all the packages referred to are
installed (note, some of these packages may be part
of openSUSE's "games" repository).
5. run 'rpmbuild -ba FlightGear.spec' and find the RPM
build result in ~/rpmbuild/RPMS
That's all!

View file

@ -159,6 +159,7 @@ SHfloat getMaxFloat();
#if defined(VG_API_LINUX) #if defined(VG_API_LINUX)
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h> #include <GL/glu.h>
#include <GL/glx.h>
#elif defined(VG_API_MACOSX) #elif defined(VG_API_MACOSX)
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#include <OpenGL/glu.h> #include <OpenGL/glu.h>

View file

@ -347,7 +347,7 @@ static void shSubdivideSegment(SHPath *p, VGPathSegment segment,
void shFlattenPath(SHPath *p, SHint surfaceSpace) void shFlattenPath(SHPath *p, SHint surfaceSpace)
{ {
SHint contourStart = -1; SHint contourStart = -1;
SHint surfSpace = surfaceSpace; // SHint surfSpace = surfaceSpace;
SHint *userData[2]; SHint *userData[2];
SHint processFlags = SHint processFlags =
SH_PROCESS_SIMPLIFY_LINES | SH_PROCESS_SIMPLIFY_LINES |

View file

@ -405,7 +405,7 @@ int shDrawLinearGradientMesh(SHPaint *p, SHVector2 *min, SHVector2 *max,
SHVector2 c, ux, uy; SHVector2 c, ux, uy;
SHVector2 cc, uux, uuy; SHVector2 cc, uux, uuy;
SHMatrix3x3 *m; SHMatrix3x3 *m = 0;
SHMatrix3x3 mi; SHMatrix3x3 mi;
SHint invertible; SHint invertible;
SHVector2 corners[4]; SHVector2 corners[4];
@ -521,7 +521,7 @@ int shDrawRadialGradientMesh(SHPaint *p, SHVector2 *min, SHVector2 *max,
SHVector2 c, f; SHVector2 c, f;
SHVector2 cf; SHVector2 cf;
SHMatrix3x3 *m; SHMatrix3x3 *m = 0;
SHMatrix3x3 mi; SHMatrix3x3 mi;
SHint invertible; SHint invertible;
SHVector2 corners[4]; SHVector2 corners[4];
@ -722,7 +722,7 @@ int shDrawRadialGradientMesh(SHPaint *p, SHVector2 *min, SHVector2 *max,
int shDrawPatternMesh(SHPaint *p, SHVector2 *min, SHVector2 *max, int shDrawPatternMesh(SHPaint *p, SHVector2 *min, SHVector2 *max,
VGPaintMode mode, GLenum texUnit) VGPaintMode mode, GLenum texUnit)
{ {
SHMatrix3x3 *m; SHMatrix3x3 *m = 0;
SHMatrix3x3 mi; SHMatrix3x3 mi;
SHfloat migl[16]; SHfloat migl[16];
SHint invertible; SHint invertible;

View file

@ -839,9 +839,9 @@ static void shSetParameter(VGContext *context, VGHandle object,
SHResourceType rtype, VGint ptype, SHResourceType rtype, VGint ptype,
SHint count, const void *values, SHint floats) SHint count, const void *values, SHint floats)
{ {
SHfloat fvalue = 0.0f; // SHfloat fvalue = 0.0f;
SHint ivalue = 0; SHint ivalue = 0;
VGboolean bvalue = VG_FALSE; // VGboolean bvalue = VG_FALSE;
int i; int i;
/* Check for negative count */ /* Check for negative count */
@ -852,9 +852,9 @@ static void shSetParameter(VGContext *context, VGHandle object,
/* Pre-convert first value for non-vector params */ /* Pre-convert first value for non-vector params */
if (count == 1) { if (count == 1) {
fvalue = shParamToFloat(values, floats, 0); // fvalue = shParamToFloat(values, floats, 0);
ivalue = shParamToInt(values, floats, 0); ivalue = shParamToInt(values, floats, 0);
bvalue = (ivalue ? VG_TRUE : VG_FALSE); // bvalue = (ivalue ? VG_TRUE : VG_FALSE);
} }
switch (rtype) switch (rtype)

View file

@ -148,7 +148,7 @@ static void shDrawBoundBox(VGContext *c, SHPath *p, VGPaintMode mode)
static void shDrawPaintMesh(VGContext *c, SHVector2 *min, SHVector2 *max, static void shDrawPaintMesh(VGContext *c, SHVector2 *min, SHVector2 *max,
VGPaintMode mode, GLenum texUnit) VGPaintMode mode, GLenum texUnit)
{ {
SHPaint *p; SHPaint *p = 0;
SHVector2 pmin, pmax; SHVector2 pmin, pmax;
SHfloat K = 1.0f; SHfloat K = 1.0f;
@ -199,7 +199,7 @@ VGboolean shIsTessCacheValid (VGContext *c, SHPath *p)
{ {
SHfloat nX, nY; SHfloat nX, nY;
SHVector2 X, Y; SHVector2 X, Y;
SHMatrix3x3 mi, mchange; SHMatrix3x3 mi;//, mchange;
VGboolean valid = VG_TRUE; VGboolean valid = VG_TRUE;
if (p->cacheDataValid == VG_FALSE) { if (p->cacheDataValid == VG_FALSE) {
@ -214,7 +214,7 @@ VGboolean shIsTessCacheValid (VGContext *c, SHPath *p)
else else
{ {
/* TODO: Compare change matrix for any scale or shear */ /* TODO: Compare change matrix for any scale or shear */
MULMATMAT( c->pathTransform, mi, mchange ); // MULMATMAT( c->pathTransform, mi, mchange );
SET2( X, mi.m[0][0], mi.m[1][0] ); SET2( X, mi.m[0][0], mi.m[1][0] );
SET2( Y, mi.m[0][1], mi.m[1][1] ); SET2( Y, mi.m[0][1], mi.m[1][1] );
nX = NORM2( X ); nY = NORM2( Y ); nX = NORM2( X ); nY = NORM2( Y );

View file

@ -434,15 +434,17 @@ void Canvas::clearPlacements(int index)
osg::ref_ptr<osg::Group> group = placements.back(); osg::ref_ptr<osg::Group> group = placements.back();
placements.pop_back(); placements.pop_back();
assert( group->getNumParents() == 1 );
assert( group->getNumChildren() == 1 ); assert( group->getNumChildren() == 1 );
osg::Group *parent = group->getParent(0);
osg::Node *child = group->getChild(0); osg::Node *child = group->getChild(0);
parent->addChild(child); if( group->getNumParents() )
{
osg::Group *parent = group->getParent(0);
parent->addChild(child);
parent->removeChild(group);
}
group->removeChild(child); group->removeChild(child);
parent->removeChild(group);
} }
} }