1
0
Fork 0
Commit graph

164 commits

Author SHA1 Message Date
Tim Moore
5b29cd4cc0 fix warnings in Multiplayer, Scripting, and Time 2009-08-24 18:07:19 +02:00
Tim Moore
7d6c567fde Refer to property types using props:: namespace
BOOL, FLOAT etc. conflict with typedefs in windows.h.
2009-07-17 14:54:12 +02:00
timoore
5cf18d30c6 Support for VEC3D and VEC4D properties.
Tiny update to property_list for extended properties.

New property types in nasal.
2009-07-16 12:10:47 +02:00
timoore
4cc3084256 SGPropertyNode::Type moves to simgear::props namespace 2009-07-16 12:10:47 +02:00
frohlich
ee9dc0c93a No need to zero the _props variable.
This reference is released by the SGSharedPtr destructor anyway.

Modified Files:
	src/Scripting/NasalSys.cxx
2009-06-11 16:05:20 +02:00
mfranz
3930967645 FGNasalModelData: use model XML path as module source 2009-04-01 09:23:54 +02:00
mfranz
de35bbe4ed assign a unique module name to ai/mp embedded nasal (again): __model%u 2009-04-01 09:23:54 +02:00
mfranz
b07eec93f1 don't keep 'nasal-dir-initialized' node after removing 2009-04-01 09:23:54 +02:00
fredb
9ff286ea01 Support old compilers 2009-04-01 09:23:54 +02:00
mfranz
27389e0742 geodinfo: make vector origin altitude configurable 2009-04-01 09:23:54 +02:00
frohlich
7e73a87882 Improove FGTileMgr::scenery_available for small ranges.
Use SGGeod in FGTileMgr, FGScenery apis.

Modified Files:
	src/AIModel/AIBallistic.cxx src/Main/main.cxx
	src/Scenery/scenery.cxx src/Scenery/scenery.hxx
	src/Scenery/tilemgr.cxx src/Scenery/tilemgr.hxx
	src/Scripting/NasalSys.cxx
2009-03-18 08:00:07 +01:00
mfranz
92510697f3 restore consistent coding-style; remove obsolete code; fix typo 2009-03-18 08:00:07 +01:00
mfranz
b57f623520 don't call change-only listeners at first trigger event 2009-03-11 23:14:34 +01:00
mfranz
f3ba7a3bd4 - pass return values in set{,Bool,Int,Double}Value() and setprop()
- make some char* "const" to silence warnings

This removes the warning that (rarely) occurred if one wrote to a
write protected property with setprop(). While this was a useful
hint, it needlessly floods the terminal if one protected a property
intentionally. (Consider to add an SG_DEBUG warning instead.) It's
now the caller's job to check for the result if it actually cares.
2009-02-10 00:22:16 +01:00
jmt
c9e8112a81 Add various helper filters, to make use of type-ranges, and reduce the need
to down-cast in filter implementations.
2009-01-10 00:07:01 +01:00
jmt
660d59a098 Another clean-up iteration: FGAirportList::search is gone, replaced by two
static FGAirport helpers. As a result, another global index goes away. Use
the helpers to avoid ugly FGPositioned down-casts in various places.

Also converts the environment/METAR code to deal with FGAirport pointers,
instead of string identifiers, and contains work-in-progress code to implement
the AirportList dialog using FGPositioned. This isn't enabled yet for various
reasons, but is the final piece to allow FGAirportList to be removed.
2008-12-26 15:26:42 +00:00
jmt
82bfb6a08d Clean out FGAirportList - not quite obsolete yet, but the spatial queries are
gone. This is good news, since the old query was implemented as a linear
search, sorted by Manhattan distance, and with a warning not to use the logic
at runtime. Various systems (such as the Mk-VIII) do query such data often,
eg every second.

Also gets Point3D out of Airports/simple.hxx, as a precursor to removing it
completely.
2008-12-26 11:15:00 +00:00
jmt
02d1b14c1a Finish conversion of FGRunway to a real class - all public members are gone. 2008-12-24 15:45:35 +00:00
mfranz
98b3701655 add _getAliasTarget(): this dereferences an alias, allowing to refer
to the target node's children and attributes etc., which aren't
inherited by an alias.
2008-11-26 11:34:35 +00:00
mfranz
845196800b f_alias: catch SGPropertyNode exceptions and generate runtime error 2008-11-13 23:47:45 +00:00
mfranz
b4d6485cfc add alias() and unalias() functions 2008-11-12 14:39:08 +00:00
andy
78d3763b41 Fix refcounting bug in f_removeChild(). Use a smart pointer to handle
the case where the removed child has no other referants, otherwise it
will be deleted on function exit.  Also give the ghost type a name for
cleaner debugging.
2008-11-03 23:50:33 +00:00
mfranz
1a292c9ed2 - createModule: add optional arg[] vector arguments
- make propNodeGhost() public, so that it can be used by non-friends
- SGNasalModelData: create module with arg[] containing two prop ghosts
2008-10-18 19:52:18 +00:00
mfranz
e1d72f8253 - fix regression: classes derived from SGModelData get the props root
via modelLoaded, not a possible Nasal node.
- rename SGNasalModelData::_props to ::_root to avoid confusion
2008-10-18 18:47:28 +00:00
mfranz
e8738eca19 listeners: do no longer set cmdarg() to avoid interference with embedded Nasal 2008-10-12 21:08:44 +00:00
mfranz
f2398fd983 - airportinfo(): remove superfluous indices of threshold/stopway
- restore consistent coding style: no 2-space spaghetti code
  indentation, remove trailing spaces, no spaces after ( and before )
2008-09-23 20:06:40 +00:00
ehofman
aa78341698 James Turner:
Convert FGRunway to be heap-based, and inherit FGPositioned. This is a large, ugly change, since FGRunway was essentially a plain struct, with no accessors or abstraction. This change adds various helpers and accessors to FGRunway, but doesn't change many places to use them - that will be a follow up series of patches. It's still a large patch, but outside of FGAirport and FGRunway, mostly mechanical search-and-replace.

An interesting part of this change is that reciprocal runways now exist as independent objects, rather than being created on the fly by the search methods. This simplifies some pieces of code that search for and iterate runways. For users who only want one 'end' of a runway, the new 'isReciprocal' predicate allows them to ignore the 'other' end. Current the only user of this is the 'ground-radar' ATC feature. If we had data on which runways are truly 'single-ended', it would now be trivial to use this in the airport loader to *not* create the reciprocal.
2008-09-11 08:38:09 +00:00
ehofman
a1426a812a James Turner:
Switches the MkVIII code to use the same 'closest airport' logic as everything
else, instead of its own special version.
2008-08-15 18:48:11 +00:00
durk
301054204e James Turner: Improved runway management code:
- Runways are now part of an airport, instead of a separate list
 - Runways are no longer represented as a boring struct, but as a class
   of their own.
 -Improved runway access to unify various runway access methods.
2008-08-14 18:13:39 +00:00
ehofman
14885374de header cleanups 2008-07-31 12:04:32 +00:00
ehofman
667e64e1eb - remove the SG_GLxxxx_H #defines, since OSG provides its own versions
- this exposed a bizarre issue on Mac where dragging in <AGL/agl.h> in
   extensions.hxx was pulling in all of Carbon to the global namespace
   - very scary. As a result, I now need to explicitly include CoreFoundation
   in fg_init.cxx.
 - change SG_USING_STD(x) to using std::x
2008-07-27 16:25:13 +00:00
mfranz
a4c23008f4 let removeChild() return the detached node (like the c++ version) 2008-07-24 11:25:13 +00:00
mfranz
5033779192 - use path validation for parsexml() nasal command
- util.cxx: add comment
2008-07-22 20:26:17 +00:00
mfranz
c9dccf4841 return attribute mask as unsigned 2008-07-10 11:36:10 +00:00
mfranz
f08d1bf5b4 let n.getAttribute("last") return SGPropertyNode::LAST_USED_ATTRIBUTE
(this is the same constant value for all properties)
2008-07-10 10:58:06 +00:00
mfranz
de527e3891 rename attributes write/read to writable/readable (The original names
where chosen to match the SGPropertyNode::WRITE/READ symbol names and
should make it more consistent, but this isn't really something that
should be exposed to the Nasal developer.)
2008-07-07 10:23:24 +00:00
mfranz
dec96cfa45 while abort() is really only useful for listeners (in all other cases
we know the stack trace), it's better to use a separate function for
it, as this can be used conditionally, as in:

  setlistener("/the/property", func(n) {
      if (n.getValue() < 0) # who's writing negative numbers to /the/property?!
          abort();          # let's check the backtrace ...
  });
2008-06-19 17:18:42 +00:00
mfranz
37559fee21 make fgfs abort() after a listener with runtime arg == -1 was triggered
and its function called. This is useful for debugging purposes, to get
a core dump which unveils which C++ code was writing to the property.
This isn't any more of a security problem as other Nasal code that
makes fgfs crash, such as:  var x = func call(x); x();  The difference
is that the listener doesn't use up all memory before and is much quicker.
2008-06-19 10:39:12 +00:00
mfranz
1454c1e4cc cleanup after last commit 2008-04-29 15:35:09 +00:00
timoore
fd492a297a model paging patch from Till Busch
From Till:
i started the project at the end of february with a simple idea: move all
3d-model loading to the DatabasePager-thread. my first attempts looked
promising, though they were a little too optimistic (or naive?). the patch
has evolved a lot since.

currently it does the following things:
1. revive SGModelLib, move functions for xml-model-loading there

2. replace all calls to sgLoad3dModel with calls to either
SGModelLib::loadModel() or SGModelLib::loadPagedModel()
almost all models will be loaded by the DatabasePager. the few exceptions are:
your own plane, shared models in scenery, random objects, AIBallistic models.

3. simplify mode-loading functions (avoid passing around fg_root)

4. avoid supurious MatrixTransform nodes in loaded models

5. fix some memory leaks
2008-03-22 09:31:06 +00:00
andy
ae66636ac5 Fix leak in interpolate(). Also give property nodes a name so they
look better in debug output
2008-01-22 20:09:02 +00:00
mfranz
98afaf4450 add runway number as "id" to the runway hash within an airport hash
(It's already available as runway hash key, but the runway hash shouldn't
depend on it and be self-contained.)
2007-12-05 10:57:51 +00:00
andy
6432d714cc Fix memory leak introduced when we stopped using _context for script
invocations, but left it in place for miscellaneous allocation work.
Contexts cache allocated objects in a temps vector and only clear it
out when they are used.

Also, fix a type warning while I'm in there.
2007-10-24 18:07:02 +00:00
mfranz
dd964fef6e getAttribute(): s/refcount/references/ 2007-10-21 20:19:12 +00:00
mfranz
2a70b87493 make node.getAttribute("refcount") return the SGSharedPtr's refcount
(meant for debugging purposes)
2007-10-20 17:16:43 +00:00
mfranz
6d3ff7b125 - airportinfo(): don't bark when no airport was found (K. HOERCHER)
- simplify listener purging and fix removelistener() return value for
  one-shot listeners
- listener: inherit virtualness
- s/handler/code/ in listener code to be consistent with NasalSys::call
2007-10-18 11:43:38 +00:00
mfranz
200abfef2d - listener: re-order and change callback function args; simplify code
- make code look like Andy wrote it (so people know whom to blame :-)
- nasal-props.cxx: warning--
2007-10-16 15:15:41 +00:00
mfranz
fa44895b5f (depreciated) cmdarg() should return _node, not parent 2007-10-15 19:12:03 +00:00
mfranz
3a03671566 - add argc/argv arguments to FGNasalSys::call
- add support for childAdded/childRemoved listeners
- use regular function arguments for property ghosts
- warning--
2007-10-15 16:28:40 +00:00
mfranz
02a813abde revert meaning of third, optional argument, and add an optional fourth
argument:

  setlistener(<property>, <func> [, <initial=0> [, <persistent=1>]])

This definition defaults to the old behavior. The fourth argument can
be set to zero, in which case the function is only called when the
node value has actually changed. It should really default to zero, but
then all callers would have to be reviewed, which is a bit too dangerous
"shortly" before a release.
2007-10-14 18:01:26 +00:00