1
0
Fork 0

Split NasalPositioned in two

File was getting huge, break it in half.
This commit is contained in:
James Turner 2020-05-22 16:36:44 +01:00
parent d66edf42f5
commit 3576f5ab3e
6 changed files with 2122 additions and 1948 deletions

View file

@ -15,6 +15,7 @@ set(SOURCES
NasalModelData.cxx NasalModelData.cxx
NasalSGPath.cxx NasalSGPath.cxx
NasalUnitTesting.cxx NasalUnitTesting.cxx
NasalFlightPlan.cxx
) )
set(HEADERS set(HEADERS
@ -30,6 +31,7 @@ set(HEADERS
NasalString.hxx NasalString.hxx
NasalModelData.hxx NasalModelData.hxx
NasalSGPath.hxx NasalSGPath.hxx
NasalFlightPlan.hxx
) )
if(WIN32) if(WIN32)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,37 @@
// NasalFlightPlan.hxx -- expose FlightPlan classes to Nasal
//
// Written by James Turner, started 2020.
//
// Copyright (C) 2020 James Turner
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#pragma once
#include <simgear/nasal/nasal.h>
#include <Navaids/FlightPlan.hxx>
#include <Navaids/procedure.hxx>
flightgear::Waypt* wayptGhost(naRef r);
flightgear::FlightPlan::Leg* fpLegGhost(naRef r);
flightgear::Procedure* procedureGhost(naRef r);
naRef ghostForWaypt(naContext c, const flightgear::Waypt* wpt);
naRef ghostForLeg(naContext c, const flightgear::FlightPlan::Leg* leg);
naRef ghostForProcedure(naContext c, const flightgear::Procedure* proc);
naRef initNasalFlightPlan(naRef globals, naContext c);
void shutdownNasalFlightPlan();

File diff suppressed because it is too large Load diff

View file

@ -23,11 +23,27 @@
#include <simgear/nasal/nasal.h> #include <simgear/nasal/nasal.h>
#include <Navaids/positioned.hxx>
// forward decls // forward decls
class SGGeod; class SGGeod;
class FGRunway;
class FGAirport;
bool geodFromHash(naRef ref, SGGeod& result); bool geodFromHash(naRef ref, SGGeod& result);
FGAirport* airportGhost(naRef r);
FGRunway* runwayGhost(naRef r);
naRef ghostForPositioned(naContext c, FGPositionedRef pos);
naRef ghostForRunway(naContext c, const FGRunway* r);
naRef ghostForAirport(naContext c, const FGAirport* apt);
FGPositioned* positionedGhost(naRef r);
FGPositionedRef positionedFromArg(naRef ref);
int geodFromArgs(naRef* args, int offset, int argc, SGGeod& result);
naRef initNasalPositioned(naRef globals, naContext c); naRef initNasalPositioned(naRef globals, naContext c);
naRef initNasalPositioned_cppbind(naRef globals, naContext c); naRef initNasalPositioned_cppbind(naRef globals, naContext c);
void postinitNasalPositioned(naRef globals, naContext c); void postinitNasalPositioned(naRef globals, naContext c);

View file

@ -54,17 +54,18 @@
#include <simgear/timing/timestamp.hxx> #include <simgear/timing/timestamp.hxx>
#include "NasalAddons.hxx" #include "NasalAddons.hxx"
#include "NasalSGPath.hxx"
#include "NasalSys.hxx"
#include "NasalSys_private.hxx"
#include "NasalAircraft.hxx" #include "NasalAircraft.hxx"
#include "NasalModelData.hxx"
#include "NasalPositioned.hxx"
#include "NasalCanvas.hxx" #include "NasalCanvas.hxx"
#include "NasalClipboard.hxx" #include "NasalClipboard.hxx"
#include "NasalCondition.hxx" #include "NasalCondition.hxx"
#include "NasalFlightPlan.hxx"
#include "NasalHTTP.hxx" #include "NasalHTTP.hxx"
#include "NasalModelData.hxx"
#include "NasalPositioned.hxx"
#include "NasalSGPath.hxx"
#include "NasalString.hxx" #include "NasalString.hxx"
#include "NasalSys.hxx"
#include "NasalSys_private.hxx"
#include "NasalUnitTesting.hxx" #include "NasalUnitTesting.hxx"
#include <Main/globals.hxx> #include <Main/globals.hxx>
@ -1043,6 +1044,7 @@ void FGNasalSys::init()
if (!global_nasalMinimalInit) { if (!global_nasalMinimalInit) {
initNasalPositioned(_globals, _context); initNasalPositioned(_globals, _context);
initNasalFlightPlan(_globals, _context);
initNasalPositioned_cppbind(_globals, _context); initNasalPositioned_cppbind(_globals, _context);
initNasalAircraft(_globals, _context); initNasalAircraft(_globals, _context);
NasalClipboard::init(this); NasalClipboard::init(this);
@ -1111,6 +1113,7 @@ void FGNasalSys::shutdown()
} }
shutdownNasalPositioned(); shutdownNasalPositioned();
shutdownNasalFlightPlan();
shutdownNasalUnitTestInSim(); shutdownNasalUnitTestInSim();
for (auto l : _listener) for (auto l : _listener)