andy [Fri, 22 Apr 2005 21:54:16 +0000 (21:54 +0000)]
Support for a "forindex(idx; list) {...}" construct analagous to
foreach, except that the variable gets the index instead of the list
element. Should be useful, and took almost no code to implement.
Support for operator/assignment syntax: +=, -=, *=, /= and ~= now do
what you think they should.
Library support for a bind() function (see the docs Andy is still
writing), allowing runtime modifications to function lexical
environments.
andy [Tue, 19 Apr 2005 14:19:46 +0000 (14:19 +0000)]
Fix clamping of the minimum hash size, because the Melchior discovered
that the column math goes wacky when lgalloced is allowed to be
zero.
Augment the find() function to take a starting index.
Fix strc() to use a default index of zero.
Fix parser precedence of TOK_MINUS, so that "a-b-1" means (a-b)-1 and
not a-(b-1).
ehofman [Mon, 28 Mar 2005 09:13:45 +0000 (09:13 +0000)]
Melchior FRANZ:
Re-organisation: <diffuse>, <ambient>, <emission>, <specular> are
now groups with members <red>, <green>, <blue>, <factor>, <offset>,
and their <*-prop> forms. Additionally, there's an option <property-base>
that can be used to set a path that is prepended to all <*-prop> paths.
It defaults to an empty string. Rationale: see model-howto.html.
ehofman [Tue, 22 Mar 2005 13:12:51 +0000 (13:12 +0000)]
Melchior FRANZ:
here is the promised material animation. It looks a bit longish, but that
wasn't avoidable -- there are simply too many parameters to consider. I tried
hard, though, to make the animation fast by only doing the necessary stuff.
It doesn't affect the frame rate here with my test model. The animation is
heavily based on Jim's "material-emission" animation.
* implementation of the "material" animation (this required to make the
texture path available) + documentation update ($FG_ROOT/Docs/)
* fix some more return values (texture animations, and select) for the
shadow problem (and some in anticipation of other problems :-)
* fix compiler warning
ehofman [Sat, 19 Mar 2005 10:19:30 +0000 (10:19 +0000)]
Melchior FRANZ:
the cause for the disappearing shadows is, that SimGear doesn't tell plib
to call the pre-traversal-callback function on culled objects. These calls,
however, are necessary to execute the transform animation that does, for
example, translate a shadow back into the frustum! Curretnly, the callback
is only executed, and the shadow only magically pops up again, when the object
enters the frustum because the view has changed significantly.
The plib documentation does only talk about TRUE and FALSE for possible
return values from the pre-traversal-callback. But src/ssgEntity.cxx reads
like this:
int ssgEntity::preTravTests ( int *test_needed, int which )
...
int result = (*preTravCB)(this,which) ;
if ( result == 0 ) return FALSE ;
if ( result == 2 ) *test_needed = 0 ;
...
So the return value needs to be 2 to bypass the cull test for pretraversal,
and get the pretraversal in any case. I only changed the return values in
four animations: scale, rotate, translate, and range, because these are
the most likely to move an object out of the frustum. It's not necessary
for blend/alpha/texture manipulation etc. Of course, this is a bit more work
for plib, but the performance will probably not be affected, because:
* these four animations are mainly used for the aircraft model (the spin
and billboard (trees!) animations are not affected)
* the number of extra nodes to process is quite low
* a part of the time spent for the extra nodes to be processed, was before
used for workarounds that are now not necessary any more
andy [Fri, 11 Mar 2005 20:39:07 +0000 (20:39 +0000)]
Fix the fixes. Note that "." had the same problem as "+" and "-", and
that we can still match non-identical constants if they are both
strings with the same numerical value.
andy [Fri, 11 Mar 2005 19:07:06 +0000 (19:07 +0000)]
Don't parse the strings "+" and "-" as numerical zeros. Also fix the
code generation of constant objects to use real identity and not Nasal
equality, so (e.g.) the constants 1 (number) and "1.0" (string) do not
get turned into the same object in the generated code.
ehofman [Thu, 10 Mar 2005 08:58:48 +0000 (08:58 +0000)]
Ima Sudonim:
I have (hopefully) generated a patch for a previously mentioned simgear problem for a hang condition in mac os x. Mentioned in <http://baron.flightgear.org/pipermail/flightgear-devel/2005-February/ 035004.html>
Note the color entries are the emissive colors when the "property" value is
1.0. They are useful for tinting the light. The "property" itself must be
float or double and is clamped to values between 0 ~ 1.0 inclusively. The
"property" value is multiplied against the colors to get the actual material
properties. Thus property value 0.0 = darkest, and 1.0 = brightest.
ehofman [Thu, 27 Jan 2005 10:47:09 +0000 (10:47 +0000)]
Melchior FRANZ:
If alcOpenDevice( NULL ) is NULL, then context is never assigned a
value, and it's pointless to ask for it in the next "if". But as the
ALCcontext that context points to doesn't seem to be fully defined
(OpenAL bug), valgrind still complains ...
Erik Hofman:
Extend this some further and define context=0 otherwise and check for
context != 0 before using it.
ehofman [Thu, 27 Jan 2005 10:42:31 +0000 (10:42 +0000)]
Melchior FRANZ:
Trying to find the bug in tower.cxx (that crashes fgfs quite frequently
for me!), I'm playing with valgrind again. Until I'm in the ATC subsystem
there will be some other bugs and nitpicking along the way.
valgrind doesn't like that imgage->tmp is once allocated with new and
once with new[], sometimes with malloc() (via map), and sometimes freed
with delete (not delete[]!) and sometimes with free(). With simple types
such as GLubyte this shouldn't really make a difference, but anyway.
Also, I promised that I'd send patches for "if (foo) delete foo;" as
I'm making other changes to concerned files. texture.cxx is one with a
few occurrences thereof. (Remember: C++ explicitly allows to delete
null-pointers, so this check is redundant, and hence not tolerated in
other projects, such as KDE. Doesn't have to impress us, of course. :-)
andy [Tue, 25 Jan 2005 22:37:22 +0000 (22:37 +0000)]
Move error handling in setupFuncall above the stack frame creation.
The error properly belongs to the enclosing scope, not the called
(non-)function. This bug was fixed a few months back in my private
tree, but Melchior just discovered that the new Concorde scripts
tickle it. I really need to re-synchronize SimGear with my own Nasal
tree...
ehofman [Mon, 24 Jan 2005 15:51:37 +0000 (15:51 +0000)]
Erik Hofman
1. Remove the dependency on alut which (on certein platforms) might pose
some restrictuons on commercial use.
2. Create a sound source just prior to playing the sound and destroy it
again when the sound has stopped. This should greatly reduce the
error reports from Windows users.
ehofman [Thu, 20 Jan 2005 09:28:04 +0000 (09:28 +0000)]
Melchior FRANZ:
The following patches to SimGear & FlightGear ...
- create an FGMetar abstraction layer, whose purpose is:
* provide defaults for unset values
* interpolate/randomize data (GREATER_THAN)
* derive additional values (time, age, snow cover)
* consider minimum identifier (CAVOK, mil. color codes)
- add rain/hail/snow/snowcover support on the METAR side
- add max age of METAR data handling (currently set to
- add support for an external METAR cache proxy server
- add CAVOK handling
- set missing year/month in regular METAR messages
- fix a small bug in metar.cxx (wrong return value)
ehofman [Fri, 14 Jan 2005 13:36:38 +0000 (13:36 +0000)]
Add a make_grayscale function and call it from make_normalmap automatically, removing the need to do it make_grayscale prior to calling make_normalmap.
curt [Tue, 11 Jan 2005 16:02:39 +0000 (16:02 +0000)]
- Fix a couple oops's in cloud.cxx
- In sky.cxx blend low density cloud layers (few/scattered) into nothing (but
don't touch visibility distance) as we approach them so we can fly through
clean.
- For high density cloud layers (broken/overcast) we do not fade the layers
out, but we fade visibility to nearly nothing as we approach the layer.
curt [Tue, 11 Jan 2005 15:21:58 +0000 (15:21 +0000)]
Add a method to SGCloudLayer to set overall cloud alpha. This gives us the
capability to slowly fade a cloud layer in or out.
We use this effect in combination with lowering visibility as we approach
a cloud layer to hide the fact that it is simply a 2d textured polygon being
drawn across the sky.
david [Mon, 10 Jan 2005 23:34:52 +0000 (23:34 +0000)]
Do not reduce visibility when passing through a 'few' or 'scattered'
cloud layer (i.e. <50% coverage). This is a quick hack rather than a
proper fix, but it will at least make it possible to get above a
scattered layer VFR.
ehofman [Sat, 8 Jan 2005 11:47:19 +0000 (11:47 +0000)]
Frederic Bouvier:
It comes to me that the bulk of all problem reports, especially from Windows users, have it's cause in an obsolete sound driver. These messages should direct them to the right solution before complaining.
ehofman [Thu, 23 Dec 2004 13:32:01 +0000 (13:32 +0000)]
Melchior FRANZ:
My recent fix for the load/save fgfs.sav feature was a bit too ambitious.
While aliases lead to abortion before, I tried to copy them properly,
although this wasn't a requirement. Unfortunately, this seems to have
worked for absolute aliases only, not for relative ones, and hence broke
several panel instruments. The attached patch backs most of the previous
patch out again, and goes a simpler route: just ignore aliases.
ehofman [Sun, 19 Dec 2004 10:19:14 +0000 (10:19 +0000)]
Melchior FRANZ:
fgLoadFlight() loads a property file ("fgfs.sav") to a new property tree,
and then copies that over to the main tree. copyProperties() didn't know
how to handle type SGPropertyNode::ALIAS and hence threw an exception that
made fgfs abort.
The attached patch adds support for ALIAS to copyProperties(): aliased
nodes are created in the target tree if necessary, and then linked like in
the source tree. It seemed useful to add an optional argument to
props.[ch]xx/getType() that would indeed return the property type "ALIAS"
for aliased nodes, and not the type of the node that it refers to. The patch
also fixes a bug in writeNode() that caused extra lines after alias entries.
If there's resistance to the change to getType() (David?) I can easily use
isAlias(). This just makes copyProperties() a tad uglier, but I can live with
it. It's useful for scanning a tree, though, if an alias node can be treated
exactly like all other nodes, without automatic redirection.
ehofman [Sun, 21 Nov 2004 17:05:42 +0000 (17:05 +0000)]
Melchior FRANZ:
At last I've found the reason why fgfs crashed routinely for me. When I still
used KDE's artsdsp (preloads lib with OSS replacement functions) I saw
this crash only occasionally. After letting OpenAl communicate with artsd
directly (by means of ~/.openalrc setting), I got the crash always when
I left fgfs.
This bug may also have crashed fgfs when running with sound daemons other than
aRts.
curt [Sun, 21 Nov 2004 03:13:54 +0000 (03:13 +0000)]
I don't understand why FreeBSD doesn't see isnan() after including math.h
but it doesn't. Trying the apple approach to fixing isnan results in an
infinite loop (making me wonder what happens on OSX?) This is an alternative
approach to checking isnan() on freebsd ...
curt [Thu, 18 Nov 2004 19:10:34 +0000 (19:10 +0000)]
Abstract out location of gl.h, glut.h, and glu.h includes so that we can
make the Mac platform happy since they put these in a different place compared
to the rest of the world.
andy [Wed, 17 Nov 2004 19:37:45 +0000 (19:37 +0000)]
Make sure that timer delay values are positive-definite, otherwise
user code that wants to use zero delay to mean "next frame" will get
stuck in an infinite loop.
ehofman [Sun, 24 Oct 2004 09:29:56 +0000 (09:29 +0000)]
Roy Vegard Ovesen:
I've added two new debug log types for the instrumentation and systems. They
used to use the autopilot debug log, because I couldn't figure out how to
make new log types. Well, now I have figured it out. ;-)
ehofman [Sun, 17 Oct 2004 17:06:50 +0000 (17:06 +0000)]
Frederic Bouvier:
This is a patch to make display list usage optional. They are on by default.
Use --prop:/sim/rendering/use-display-list=false to use immediate mode.
There is also a change in exception handling in main.cxx and bootstrap.cxx
ehofman [Sat, 16 Oct 2004 12:23:53 +0000 (12:23 +0000)]
Roy Vegard Ovesen:
I'm working on a route manager in the GPS module. So I've added a name
parameter to the waypoint class in Simgear. I use the existing ID parameter
to store the ID, for example KLAX, and the name parameter to store the name,
San Francisco Intl.