Merge branch 'next-2' into multiplayer-dev
# Conflicts: # utils/fgqcanvas/CMakeLists.txt
This commit is contained in:
commit
41ecfd1972
30 changed files with 123 additions and 62 deletions
CMakeLists.txt
src
ATC
Aircraft
Airports
Cockpit
GUI
Input
Instrumentation
Main
Navaids
Radio
Scripting
Traffic
utils
|
@ -178,7 +178,6 @@ option(SYSTEM_FLITE "Set to ON to build Flightgear with the system's Flite
|
|||
option(SYSTEM_HTS_ENGINE "Set to ON to build Flightgear with the system's HTS Engine library" ${SYSTEM_HTS_ENGINE_DEFAULT})
|
||||
option(FG_NIGHTLY "Set to ON to mark this as a nightly build" OFF)
|
||||
option(ENABLE_DEV_WARNINGS "Set to ON to include developer-warnings" OFF)
|
||||
option(ENABLE_SIMD "Enable SSE/SSE2 support for x86 compilers" ON)
|
||||
|
||||
# additional utilities
|
||||
option(ENABLE_FGELEV "Set to ON to build the fgelev application (default)" ON)
|
||||
|
@ -358,6 +357,12 @@ else()
|
|||
message(STATUS "RTI: DISABLED")
|
||||
endif(ENABLE_RTI)
|
||||
|
||||
if (ENABLE_SIMD)
|
||||
message(STATUS "SSE/SSE2 support: ENABLED")
|
||||
else()
|
||||
message(STATUS "SSE/SSE2 support: DISABLED")
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(WARNING_FLAGS_CXX "-Wall")
|
||||
set(WARNING_FLAGS_C "-Wall")
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <simgear/compiler.h>
|
||||
#include <simgear/props/props.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/math/sg_geodesy.hxx>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/structure/SGSharedPtr.hxx>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <simgear/constants.h>
|
||||
#include <simgear/structure/exception.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
#include <simgear/misc/gzcontainerfile.hxx>
|
||||
#include <simgear/io/iostreams/gzcontainerfile.hxx>
|
||||
#include <simgear/misc/sg_dir.hxx>
|
||||
#include <simgear/misc/stdint.hxx>
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include <simgear/constants.h>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
#include <simgear/structure/exception.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
|
|
|
@ -66,6 +66,16 @@ FGODGauge::~FGODGauge()
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
* Used to remember the located groups that require modification
|
||||
*/
|
||||
typedef struct {
|
||||
typedef osg::ref_ptr<osg::Group> GroupPtr;
|
||||
GroupPtr parent;
|
||||
GroupPtr node;
|
||||
int unit;
|
||||
}GroupListItem;
|
||||
|
||||
/**
|
||||
* Replace a texture in the airplane model with the gauge texture.
|
||||
*/
|
||||
|
@ -182,6 +192,28 @@ class ReplaceStaticTextureVisitor:
|
|||
if( !osgDB::equalCaseInsensitive(_tex_name, tex_name_simple) )
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* remember this group for modification once the scenegraph has been traversed
|
||||
*/
|
||||
GroupListItem gli;
|
||||
gli.node = eg;
|
||||
gli.parent = parent;
|
||||
gli.unit = unit;
|
||||
groups_to_modify.push_back(gli);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* this section of code used to be in the apply method above, however to work this requires modification of the scenegraph nodes
|
||||
* that are currently iterating, so instead the apply method will locate the groups to be modified and when finished then the
|
||||
* nodes can actually be modified safely. Initially found thanks to the debug RTL in MSVC2015 throwing an exception.
|
||||
*/
|
||||
void modify_groups()
|
||||
{
|
||||
for (GroupList::iterator group_iterator = groups_to_modify.begin(); group_iterator != groups_to_modify.end(); group_iterator++) {
|
||||
GroupPtr eg = group_iterator->node;
|
||||
GroupPtr parent = group_iterator->parent;
|
||||
int unit = group_iterator->unit;
|
||||
|
||||
// insert a new group between the geode an it's parent which overrides
|
||||
// the texture
|
||||
|
@ -191,16 +223,16 @@ class ReplaceStaticTextureVisitor:
|
|||
parent->removeChild(eg);
|
||||
parent->addChild(group);
|
||||
|
||||
if( _cull_callback )
|
||||
if (_cull_callback)
|
||||
group->setCullCallback(_cull_callback);
|
||||
|
||||
osg::StateSet* stateSet = group->getOrCreateStateSet();
|
||||
stateSet->setTextureAttribute( unit, _new_texture,
|
||||
osg::StateAttribute::OVERRIDE );
|
||||
stateSet->setTextureMode( unit, GL_TEXTURE_2D,
|
||||
osg::StateAttribute::ON );
|
||||
stateSet->setTextureAttribute(unit, _new_texture,
|
||||
osg::StateAttribute::OVERRIDE);
|
||||
stateSet->setTextureMode(unit, GL_TEXTURE_2D,
|
||||
osg::StateAttribute::ON);
|
||||
|
||||
_placements.push_back( simgear::canvas::PlacementPtr(
|
||||
_placements.push_back(simgear::canvas::PlacementPtr(
|
||||
new simgear::canvas::ObjectPlacement(_node, group, _canvas)
|
||||
));
|
||||
|
||||
|
@ -213,8 +245,8 @@ class ReplaceStaticTextureVisitor:
|
|||
<< (!_parent_name.empty() ? " with parent '" + _parent_name + "'"
|
||||
: "")
|
||||
);
|
||||
return;
|
||||
}
|
||||
groups_to_modify.clear();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -227,7 +259,8 @@ class ReplaceStaticTextureVisitor:
|
|||
SGPropertyNode_ptr _node;
|
||||
osg::Texture2D *_new_texture;
|
||||
osg::NodeCallback *_cull_callback;
|
||||
|
||||
typedef std::vector<GroupListItem> GroupList;
|
||||
GroupList groups_to_modify;
|
||||
simgear::canvas::CanvasWeakPtr _canvas;
|
||||
simgear::canvas::Placements _placements;
|
||||
|
||||
|
@ -255,6 +288,7 @@ FGODGauge::set_texture( osg::Node* branch,
|
|||
{
|
||||
ReplaceStaticTextureVisitor visitor(name, new_texture);
|
||||
branch->accept(visitor);
|
||||
visitor.modify_groups();
|
||||
return visitor.getPlacements();
|
||||
}
|
||||
|
||||
|
@ -284,6 +318,7 @@ FGODGauge::set_texture( osg::Node* branch,
|
|||
cull_callback,
|
||||
canvas );
|
||||
branch->accept(visitor);
|
||||
visitor.modify_groups();
|
||||
return visitor.getPlacements();
|
||||
}
|
||||
|
||||
|
|
|
@ -102,6 +102,25 @@ void AddOnsPage::onAddSceneryPath()
|
|||
{
|
||||
QString path = QFileDialog::getExistingDirectory(this, tr("Choose scenery folder"));
|
||||
if (!path.isEmpty()) {
|
||||
// validation
|
||||
|
||||
SGPath p(path.toStdString());
|
||||
SGPath objectsPath = p / "Objects";
|
||||
SGPath terrainPath = p / "Terrain";
|
||||
|
||||
if (!objectsPath.exists() && !terrainPath.exists()) {
|
||||
QMessageBox mb;
|
||||
mb.setText(QString("The folder '%1' doesn't appear to contain scenery - add anyway?").arg(path));
|
||||
mb.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
mb.setDefaultButton(QMessageBox::No);
|
||||
mb.setInformativeText("Added scenery should contain folders called 'Objects' and / or 'Terrain'");
|
||||
mb.exec();
|
||||
|
||||
if (mb.result() == QMessageBox::No) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->sceneryPathsList->addItem(path);
|
||||
saveSceneryPaths();
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ using std::string;
|
|||
#include <simgear/constants.h>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/structure/exception.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include <simgear/constants.h>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
#include <osg/GLU>
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include <simgear/sg_inlines.h>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
#include <simgear/magvar/magvar.hxx>
|
||||
#include <simgear/structure/exception.hxx>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <fstream>
|
||||
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/structure/exception.hxx>
|
||||
|
||||
#include <Main/fg_init.hxx>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <simgear/sg_inlines.h>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/math/sg_random.h>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/scene/material/mat.hxx>
|
||||
#include <simgear/scene/material/matlib.hxx>
|
||||
#include <simgear/structure/exception.hxx>
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
#include <simgear/structure/SGPerfMon.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sg_dir.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
#include <simgear/scene/tsync/terrasync.hxx>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
#include <simgear/math/sg_random.h>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sg_dir.hxx>
|
||||
#include <simgear/scene/material/mat.hxx>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/magvar/magvar.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
#include <simgear/xml/easyxml.hxx>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include <simgear/sg_inlines.h>
|
||||
#include <simgear/structure/exception.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <simgear/compiler.h>
|
||||
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/route/waypoint.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
|
||||
|
||||
//#include "parking.hxx"
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/strutils.hxx> // simgear::strutils::split()
|
||||
#include <simgear/math/sg_geodesy.hxx>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include <simgear/misc/strutils.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/structure/exception.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
#include <simgear/sg_inlines.h>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <istream>
|
||||
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/structure/exception.hxx>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <simgear/math/sg_geodesy.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/structure/exception.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
|
||||
#include <Navaids/NavDataCache.hxx>
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/magvar/magvar.hxx>
|
||||
#include <simgear/timing/sg_time.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <fstream>
|
||||
#include <Scenery/scenery.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
|
||||
#include "antenna.hxx"
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <simgear/props/props.hxx>
|
||||
#include <simgear/math/sg_random.h>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/sg_dir.hxx>
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
#include <simgear/misc/SimpleMarkdown.hxx>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
|
||||
#include <simgear/compiler.h>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/sg_dir.hxx>
|
||||
#include <simgear/props/props.hxx>
|
||||
#include <simgear/structure/subsystem_mgr.hxx>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <iostream>
|
||||
|
||||
#include <simgear/constants.h>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <simgear/constants.h>
|
||||
#include <simgear/io/sg_file.hxx>
|
||||
#include <simgear/math/sg_geodesy.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
#include <simgear/misc/stdint.hxx>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <simgear/io/sg_file.hxx>
|
||||
#include <simgear/math/sg_geodesy.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
#include <simgear/misc/stdint.hxx>
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0)
|
|||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
project(FGQCanvas)
|
||||
|
||||
find_package(Qt5 5.4 COMPONENTS Widgets WebSockets)
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/math/SGGeodesy.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/io/iostreams/sgstream.hxx>
|
||||
#include <simgear/misc/ResourceManager.hxx>
|
||||
#include <simgear/props/props.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
|
|
Loading…
Add table
Reference in a new issue