Merge branch 'next' of D:\Git_New\flightgear into next
This commit is contained in:
commit
8150bca689
4 changed files with 45 additions and 53 deletions
|
@ -4,19 +4,24 @@ require 'ERB'
|
|||
|
||||
$osgLibs = ['osgFX', 'osgParticle', 'osg', 'osgGA', 'osgText', 'osgUtil', 'osgSim', 'osgViewer', 'osgDB']
|
||||
$osgPlugins = ['ac', 'osg', 'freetype', 'qt', 'imageio', 'rgb', 'txf']
|
||||
$osgDylibVersion='63'
|
||||
|
||||
osgVersion = `./run-osgversion --version-number`
|
||||
puts "osgVersion='#{osgVersion}'"
|
||||
$osgSoVersion=`./run-osgversion --so-number`
|
||||
$openThreadsSoVersion=`./run-osgversion --openthreads-soversion-number`
|
||||
|
||||
$alutSourcePath='/Library/Frameworks/ALUT.framework'
|
||||
|
||||
def fix_install_names(object)
|
||||
#puts "fixing install names for #{object}"
|
||||
|
||||
$osgLibs.each do |l|
|
||||
oldName = "lib#{l}.#{$osgDylibVersion}.dylib"
|
||||
oldName = "lib#{l}.#{$osgSoVersion}.dylib"
|
||||
newName = "@executable_path/../Frameworks/#{oldName}"
|
||||
`install_name_tool -change #{oldName} #{newName} #{object}`
|
||||
end
|
||||
|
||||
oldName = "libOpenThreads.12.dylib"
|
||||
oldName = "libOpenThreads.#{openThreadsSoVersion}.dylib"
|
||||
newName= "@executable_path/../Frameworks/#{oldName}"
|
||||
`install_name_tool -change #{oldName} #{newName} #{object}`
|
||||
|
||||
|
@ -38,7 +43,7 @@ contents=bundle + "/Contents"
|
|||
macosDir=contents + "/MacOS"
|
||||
frameworksDir=contents +"/Frameworks"
|
||||
resourcesDir=contents+"/Resources"
|
||||
osgPluginsDir=contents+"/PlugIns/osgPlugins-2.9.7"
|
||||
osgPluginsDir=contents+"/PlugIns/osgPlugins-#{osgVersion}"
|
||||
volName="\"FlightGear Nightly Build\""
|
||||
|
||||
puts "Creating directory structure"
|
||||
|
@ -56,18 +61,18 @@ end
|
|||
|
||||
puts "copying libraries"
|
||||
$osgLibs.each do |l|
|
||||
libFile = "lib#{l}.#{$osgDylibVersion}.dylib"
|
||||
libFile = "lib#{l}.#{$osgSoVersion}.dylib"
|
||||
`cp #{prefixDir}/lib/#{libFile} #{frameworksDir}`
|
||||
fix_install_names("#{frameworksDir}/#{libFile}")
|
||||
end
|
||||
|
||||
# and not forgetting OpenThreads
|
||||
libFile = "libOpenThreads.12.dylib"
|
||||
libFile = "libOpenThreads.#{openThreadsSoVersion}.dylib"
|
||||
`cp #{prefixDir}/lib/#{libFile} #{frameworksDir}`
|
||||
|
||||
$osgPlugins.each do |p|
|
||||
pluginFile = "osgdb_#{p}.so"
|
||||
`cp #{prefixDir}/lib/osgPlugins-2.9.7/#{pluginFile} #{osgPluginsDir}`
|
||||
`cp #{prefixDir}/lib/osgPlugins-#{osgVersion}/#{pluginFile} #{osgPluginsDir}`
|
||||
fix_install_names("#{osgPluginsDir}/#{pluginFile}")
|
||||
end
|
||||
|
||||
|
|
4
package/mac/run-osgversion
Executable file
4
package/mac/run-osgversion
Executable file
|
@ -0,0 +1,4 @@
|
|||
#/bin/bash
|
||||
DYLD_LIBRARY_PATH=$PWD/dist/lib
|
||||
./dist/bin/osgversion $1
|
||||
|
|
@ -1211,23 +1211,15 @@ do_play_audio_sample (const SGPropertyNode * arg)
|
|||
static bool
|
||||
do_presets_commit (const SGPropertyNode * arg)
|
||||
{
|
||||
// unbind the current fdm state so property changes
|
||||
// don't get lost when we subsequently delete this fdm
|
||||
// and create a new one.
|
||||
globals->get_subsystem("flight")->unbind();
|
||||
|
||||
// set position from presets
|
||||
fgInitPosition();
|
||||
|
||||
fgReInitSubsystems();
|
||||
|
||||
#if 0
|
||||
if ( ! fgGetBool("/sim/presets/onground") ) {
|
||||
fgSetBool( "/sim/freeze/master", true );
|
||||
fgSetBool( "/sim/freeze/clock", true );
|
||||
if (fgGetBool("/sim/initialized", false)) {
|
||||
fgReInitSubsystems();
|
||||
} else {
|
||||
// Nasal can trigger this during initial init, which confuses
|
||||
// the logic in ReInitSubsystems, since initial state has not been
|
||||
// saved at that time. Short-circuit everything here.
|
||||
fgInitPosition();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1491,6 +1491,8 @@ bool fgInitSubsystems() {
|
|||
// End of subsystem initialization.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
fgSetBool("/sim/initialized", true);
|
||||
|
||||
SG_LOG( SG_GENERAL, SG_INFO, endl);
|
||||
|
||||
// Save the initial state for future
|
||||
|
@ -1503,25 +1505,32 @@ bool fgInitSubsystems() {
|
|||
|
||||
void fgReInitSubsystems()
|
||||
{
|
||||
// static const SGPropertyNode *longitude
|
||||
// = fgGetNode("/sim/presets/longitude-deg");
|
||||
// static const SGPropertyNode *latitude
|
||||
// = fgGetNode("/sim/presets/latitude-deg");
|
||||
static const SGPropertyNode *altitude
|
||||
= fgGetNode("/sim/presets/altitude-ft");
|
||||
static const SGPropertyNode *master_freeze
|
||||
= fgGetNode("/sim/freeze/master");
|
||||
|
||||
SG_LOG( SG_GENERAL, SG_INFO,
|
||||
"fgReInitSubsystems(): /position/altitude = "
|
||||
<< altitude->getDoubleValue() );
|
||||
SG_LOG( SG_GENERAL, SG_INFO, "fgReInitSubsystems()");
|
||||
|
||||
// setup state to begin re-init
|
||||
bool freeze = master_freeze->getBoolValue();
|
||||
if ( !freeze ) {
|
||||
fgSetBool("/sim/freeze/master", true);
|
||||
}
|
||||
|
||||
fgSetBool("/sim/signals/reinit", true);
|
||||
fgSetBool("/sim/crashed", false);
|
||||
|
||||
// do actual re-init steps
|
||||
globals->get_subsystem("flight")->unbind();
|
||||
|
||||
// reset control state, before restoring initial state; -set or config files
|
||||
// may specify values for flaps, trim tabs, magnetos, etc
|
||||
globals->get_controls()->reset_all();
|
||||
|
||||
globals->restoreInitialState();
|
||||
|
||||
// update our position based on current presets
|
||||
fgInitPosition();
|
||||
|
||||
// Force reupdating the positions of the ai 3d models. They are used for
|
||||
// initializing ground level for the FDM.
|
||||
globals->get_subsystem("ai_model")->reinit();
|
||||
|
@ -1532,11 +1541,11 @@ void fgReInitSubsystems()
|
|||
// reload offsets from config defaults
|
||||
globals->get_viewmgr()->reinit();
|
||||
|
||||
globals->get_controls()->reset_all();
|
||||
|
||||
globals->get_subsystem("time")->reinit();
|
||||
globals->get_subsystem("tile-manager")->reinit();
|
||||
|
||||
// setup state to end re-init
|
||||
fgSetBool("/sim/signals/reinit", false);
|
||||
if ( !freeze ) {
|
||||
fgSetBool("/sim/freeze/master", false);
|
||||
}
|
||||
|
@ -1546,27 +1555,9 @@ void fgReInitSubsystems()
|
|||
|
||||
void doSimulatorReset(void) // from gui_local.cxx -- TODO merge with fgReInitSubsystems()
|
||||
{
|
||||
static SGPropertyNode_ptr master_freeze = fgGetNode("/sim/freeze/master", true);
|
||||
|
||||
bool freeze = master_freeze->getBoolValue();
|
||||
if (!freeze)
|
||||
master_freeze->setBoolValue(true);
|
||||
|
||||
fgSetBool("/sim/signals/reinit", true);
|
||||
|
||||
globals->get_subsystem("flight")->unbind();
|
||||
|
||||
globals->restoreInitialState();
|
||||
|
||||
// update our position based on current presets
|
||||
fgInitPosition();
|
||||
|
||||
|
||||
fgReInitSubsystems();
|
||||
|
||||
fgSetBool("/sim/signals/reinit", false);
|
||||
|
||||
if (!freeze)
|
||||
master_freeze->setBoolValue(false);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Reference in a new issue