[Flightgear-devel] Replace SGThread classes with OpenThreads (complete)

2008-05-31 Thread Benoît Laniel
Hello,

My patches for SGThread are now complete. I use them on Linux with no
problems and some people use them on Windows since a few weeks with no
problems either.

Patch for simgear:

- Replace SGMutex with OpenThreads::Mutex.
- Replace SGGuard with OpenThreads::ScopedLock (which acts exactly like
SGGuard, see include/OpenThreads/ScopedLock).
- Use global variables for mutex where needed to be thread safe (as
pointed by Tim).

Patch for flightgear:

- Replace SGThread with OpenThreads::Thread.
- Replace SGGuard with OpenThreads::ScopedLock.
- Replace SGMutex with OpenThreads::Mutex.
- Replace SGPthreadCond by OpenThreads::Condition.

I did not touch configuration files, so to enable threads pthread still
needs to be detected (but will not be used). With these patches, only
SGQueue.hxx is used in simgear/threads (which is cross-platform since it
only uses OpenThreads).

Best regards,
Benoît

Index: src/Environment/environment_ctrl.cxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/Environment/environment_ctrl.cxx,v
retrieving revision 1.50
diff -u -r1.50 environment_ctrl.cxx
--- src/Environment/environment_ctrl.cxx	11 Oct 2007 07:53:17 -	1.50
+++ src/Environment/environment_ctrl.cxx	11 May 2008 10:48:59 -
@@ -356,7 +356,8 @@
 {
 #if defined(ENABLE_THREADS)
 thread = new MetarThread(this);
-thread-start( 1 );
+thread-setProcessorAffinity(1);
+thread-start();
 #endif // ENABLE_THREADS
 }
 
Index: src/Environment/environment_ctrl.hxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/Environment/environment_ctrl.hxx,v
retrieving revision 1.27
diff -u -r1.27 environment_ctrl.hxx
--- src/Environment/environment_ctrl.hxx	15 Aug 2007 15:22:44 -	1.27
+++ src/Environment/environment_ctrl.hxx	11 May 2008 10:48:59 -
@@ -32,7 +32,7 @@
 #include simgear/environment/metar.hxx
 
 #if defined(ENABLE_THREADS)
-# include simgear/threads/SGThread.hxx
+# include OpenThreads/Thread
 # include simgear/threads/SGQueue.hxx
 #endif
 
@@ -233,7 +233,7 @@
  * This class represents the thread of execution responsible for
  * fetching the metar data.
  */
-class MetarThread : public SGThread
+class MetarThread : public OpenThreads::Thread
 {
 public:
 MetarThread( FGMetarEnvironmentCtrl* f ) : fetcher(f) {}
Index: src/Sound/voice.cxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/Sound/voice.cxx,v
retrieving revision 1.8
diff -u -r1.8 voice.cxx
--- src/Sound/voice.cxx	23 Mar 2007 15:53:58 -	1.8
+++ src/Sound/voice.cxx	11 May 2008 10:48:59 -
@@ -71,7 +71,8 @@
 	}
 
 #if defined(ENABLE_THREADS)
-	_thread-start(1);
+	_thread-setProcessorAffinity(1);
+	_thread-start();
 #endif
 }
 
Index: src/Sound/voice.hxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/Sound/voice.hxx,v
retrieving revision 1.3
diff -u -r1.3 voice.hxx
--- src/Sound/voice.hxx	31 Mar 2006 10:12:00 -	1.3
+++ src/Sound/voice.hxx	11 May 2008 10:48:59 -
@@ -37,7 +37,10 @@
 #include Main/fg_props.hxx
 
 #if defined(ENABLE_THREADS)
-#  include simgear/threads/SGThread.hxx
+#  include OpenThreads/Thread
+#  include OpenThreads/Mutex
+#  include OpenThreads/ScopedLock
+#  include OpenThreads/Condition
 #  include simgear/threads/SGQueue.hxx
 #else
 #  include queue
@@ -74,16 +77,16 @@
 
 
 #if defined(ENABLE_THREADS)
-class FGVoiceMgr::FGVoiceThread : public SGThread {
+class FGVoiceMgr::FGVoiceThread : public OpenThreads::Thread {
 public:
 	FGVoiceThread(FGVoiceMgr *mgr) : _mgr(mgr) {}
 	void run();
 	void wake_up() { _jobs.signal(); }
 
 private:
-	void wait_for_jobs() { SGGuardSGMutex g(_mutex); _jobs.wait(_mutex); }
-	SGPthreadCond _jobs;
-	SGMutex _mutex;
+	void wait_for_jobs() { OpenThreads::ScopedLockOpenThreads::Mutex g(_mutex); _jobs.wait(_mutex); }
+	OpenThreads::Condition _jobs;
+	OpenThreads::Mutex _mutex;
 	FGVoiceMgr *_mgr;
 };
 #endif
Index: simgear/scene/model/shadanim.cxx
===
RCS file: /var/cvs/SimGear-0.3/source/simgear/scene/model/shadanim.cxx,v
retrieving revision 1.13
diff -u -r1.13 shadanim.cxx
--- simgear/scene/model/shadanim.cxx	4 Dec 2007 22:38:41 -	1.13
+++ simgear/scene/model/shadanim.cxx	11 May 2008 10:52:53 -
@@ -36,9 +36,10 @@
 #include osg/Texture1D
 #include osgUtil/HighlightMapGenerator
 
+#include OpenThreads/Mutex
+#include OpenThreads/ScopedLock
+
 #include simgear/scene/util/SGUpdateVisitor.hxx
-#include simgear/threads/SGThread.hxx
-#include simgear/threads/SGGuard.hxx
 
 #include simgear/props/condition.hxx
 #include simgear/props/props.hxx
@@ -125,6 +126,8 @@
   SGVec4f _lastLightColor;
 };
 
+static OpenThreads::Mutex cubeMutex;
+
 static osg::TextureCubeMap*
 getOrCreateTextureCubeMap()
 {
@@ -132,8 +135,7 @@
   if 

Re: [Flightgear-devel] FG menu bar small and no text?

2008-05-31 Thread Csaba Halász
On Sat, May 31, 2008 at 3:35 PM, Holger Wirtz [EMAIL PROTECTED] wrote:

 This does not help for my installation. Anyone around who has an idea
 why this may happen on some systems? I have an IBM Thinkpad with ATI
 X140, a Thinpad with an Intel ICH9 Chipset and an installation on a
 desktop with an Nvidia accelerator. All have the same problems...

I'd try strace to see if it fails to find some font-related file,
possibly the font loader plugin.

-- 
Csaba/Jester

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] FG menu bar small and no text?

2008-05-31 Thread Curtis Olson
I received an email from a user that indicated they only saw this missing
text problem with the default font (which uses transparency.)  The alternate
font (Shift-F10 to toggle) seems to work fine.  So this may be a
transparency problem that has been recently introduced?

Curt.


On Sat, May 31, 2008 at 9:03 AM, Csaba Halász wrote:

 On Sat, May 31, 2008 at 3:35 PM, Holger Wirtz wrote:
 
  This does not help for my installation. Anyone around who has an idea
  why this may happen on some systems? I have an IBM Thinkpad with ATI
  X140, a Thinpad with an Intel ICH9 Chipset and an installation on a
  desktop with an Nvidia accelerator. All have the same problems...

 I'd try strace to see if it fails to find some font-related file,
 possibly the font loader plugin.



-- 
Curtis Olson: http://baron.flightgear.org/~curt/
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Issue with texture-path tags.

2008-05-31 Thread Melchior FRANZ
* alexis bory -- Tuesday 27 May 2008:
 there is an issue with texture-path tags which can not be assigned
 on the fly.
[...]
 The best would be to make the existing and very efficient 
 aircraft.livery() able to work with a texture-path tag OR with with 
 the currently available texture tag.

texture-path has the disadvantage that you have to have complete
texture sets. You don't just duplicate the livery, but also textures
that look the same in all variants, which is a waste of space IMHO.

What's wrong with using a material animation for all textures that
you want to switch? They are really simple:

animation
typematerial/type
object-namefuselage/object-name
texture-propfoo/textures/fuselage/texture-prop
/animation

Then writing a texture name to that property switches the texture:

  setprop(foo/textures/fuselage, ../../../Models/Fauna/cow.rgb);

You can do that for as many/few objects as you like. And aircraft.livery()
helps with doing that automatically from livery *.xml files and via MP.
But that's just an offer -- you can do your own livery handling.

The bo105, for example, only switches rotor textures for now. Later
it will also switch the fuselage texture. (Actually, it does already on
my disk. :-) That way I can not only switch textures, but other details
as well, such as weapons, wire cutter, helmet colors etc. And that over MP.

I don't really see a need for runtime switchable texture-paths. 

m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] FG menu bar small and no text?

2008-05-31 Thread Holger Wirtz
Curt,


Curtis Olson wrote:
 I received an email from a user that indicated they only saw this missing
 text problem with the default font (which uses transparency.)  The alternate
 font (Shift-F10 to toggle) seems to work fine.  So this may be a
 transparency problem that has been recently introduced?

Yes, it seems so. Shift-F10 helps. I will have a look at the transpareny 
fonts. Perhaps such a font is simply missing...

Thanks, Holger

 
 Curt.
 
 
 On Sat, May 31, 2008 at 9:03 AM, Csaba Halász wrote:
 
 On Sat, May 31, 2008 at 3:35 PM, Holger Wirtz wrote:
 This does not help for my installation. Anyone around who has an idea
 why this may happen on some systems? I have an IBM Thinkpad with ATI
 X140, a Thinpad with an Intel ICH9 Chipset and an installation on a
 desktop with an Nvidia accelerator. All have the same problems...
 I'd try strace to see if it fails to find some font-related file,
 possibly the font loader plugin.

 
 
 
 
 
 -
 This SF.net email is sponsored by: Microsoft
 Defy all challenges. Microsoft(R) Visual Studio 2008.
 http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
 
 
 
 
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] FG menu bar small and no text?

2008-05-31 Thread Melchior FRANZ
* Holger Wirtz -- Saturday 31 May 2008:
 I will have a look at the transpareny 
 fonts. Perhaps such a font is simply missing...

It doesn't have anything to do with transparency as such, but only
with texture fonts (*.txf) versus (built-in) bitmap fonts. The former
are now apparently broken since recently, which affects text on
the HUD and the classic GUI style, whereas the dark GUI style,
the frame rate counter and the ATC messages use a bitmap font
and, therefore, still work. I assume that Tim knows more about
that problem.  ;-)

m.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] Patch to perform airport searches case-insensitively

2008-05-31 Thread Stuart Buchanan
Hi All,

Someone on the Forum (or was it here?) mentioned a problem where they couldn't 
use the Airport Search dialog easily because some airports in apt.dat are named 
in mixed case while some are in all-caps.

Rather than attempt to fix apt.dat (I'm not completely mad ;) ), I've created a 
small patch to our airport search function so that this search is done 
case-insensitively. I've done some minimal testing, and it at least appears to 
be functionally correct.

However:
a) As I'm sure many people are already aware, I'm not a very good C programmer, 
so there may be a better way to do this that I'm missing
b) This uses the strcasestr() function, which is part of the GNU C library in 
string.h. What is the best way to check that such a function is available on 
all our platforms?

-Stuart

Index: AirportList.cxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/GUI/AirportList.cxx,v
retrieving revision 1.18
diff -u -p -r1.18 AirportList.cxx
--- AirportList.cxx 11 Mar 2008 15:58:57 -  1.18
+++ AirportList.cxx 31 May 2008 21:12:34 -
@@ -30,7 +30,8 @@ AirportList::create_list ()
 const FGAirport *apt = _airports-getAirport(i);
 STD::string entry(apt-getName() +( + apt-getId() + ')');
 
-if (!_filter.empty()  entry.find(_filter) == STD::string::npos)
+// Perform filter check case-insensitively
+if (!_filter.empty()  (strcasestr(entry.c_str(), _filter.c_str()) == 
NULL))
 continue;
 
 content[n] = new char[entry.size() + 1];



  __
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] Olegs Adventures News Update new none profit partnership.

2008-05-31 Thread Forums Virgin Net
Dear all,
I recently told Curt about a new partnership I have made with a 
Composer and media artist, who is willing to work in a none profit manner, Bith 
Curt and myself are optimistic and we both have hopes of Hollywood :o) well 
wishful thinking perhaps!

For web security I have thinned this letter down:

Cheers Michelle,

Thanks for your in depth message.

I would be glad to give a cooperative non-profit/no money changing hands 
venture a try.

A track featured on the Shark site Man Alone was something similar in 
conjunction with the Singer/DJ xxx Robinson who contributed a vocal and edited 
the video at no cost.

I will give your movie clips a look but from the description I am sure your 
work will be of interest.

If you have read the blurb on the site I am sure you will have twigged that 
Dave Dark and the Sharks is a ficticious pseudonym but it was too good a name 
to waste (I am good at thinking up band names).

Cheers

Rich

It all started when I contacted a friend a few days ago, who knows someone else 
a professional musician, he in turn knows someone in Television and I am now 
keeping my fingers crossed that Richard is the next step in breaking out into a 
wider means of media coverage, I am not short of idea's I have tons of idea's 
for these movies, it is application and development which is uncertain, the 
most important thing now is a deeper concentration in quality for the main 
movie releases, and not quantity at this stage.

The good news is Richard is now writing a specialy composed theme tune for 
Oleg, I am not sure at this early stage if we are going to have lyrics but it 
is a very positive step and hope this will be a new positive turning point in 
the movie productions.

All the Best Michelle (Aerotro)

Richards Website is 
http://www.myspace.com/davedarkandthesharks  



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] Olegs Adventures News Update new none profit partnership.

2008-05-31 Thread Forums Virgin Net
Dear all,
I recently told Curt about a new partnership I have made with a 
Composer and media artist, who is willing to work in a voluntary none profit 
manner, Both Curt and myself are optimistic and we both have hopes of Hollywood 
:o) well wishful thinking perhaps! But still we can hope for some mutual 
benefits to this little arrangement in so far that as with any body of people 
working together this will generate more inspiration and a new avenue of 
productivity in media relations at the very least, this is beneficial to all 
concerned I would hope.

For web security I have thinned this letter down a little.

Richards response:

Cheers Michelle,

Thanks for your in depth message.

I would be glad to give a cooperative non-profit/no money changing hands 
venture a try.

A track featured on the Shark site Man Alone was something similar in 
conjunction with the Singer/DJ xxx Robinson who contributed a vocal and edited 
the video at no cost.

I will give your movie clips a look but from the description I am sure your 
work will be of interest.

If you have read the blurb on the site I am sure you will have twigged that 
Dave Dark and the Sharks is a ficticious pseudonym but it was too good a name 
to waste (I am good at thinking up band names).

Cheers

Rich


This all started when I re-contacted a friend a few days ago, after she had 
initially made me aware of Richards work with the Man Alone Music Video 
http://cockerel.net/video/manalone.mov 

Richard knows a number of professional people in the Radio and TV Industry 
which if viable at sometime in the future COULD be developed into a more 
focused plan, of coarse breaking out into a wider means of media coverage would 
require more commitment and could be very rewarding but that is speculative and 
for future consideration if need should arise.

I am not short of idea's I have tons of idea's for these movies, it is 
application and development which is uncertain, the most important thing now is 
a deeper concentration in quality for the main movie releases, and not quantity 
at this stage.

The good news is Richard is now writing a specialy composed theme tune for 
Oleg, I am not sure at this early stage if we are going to have lyrics but it 
is a very positive step, we owe a great deal of gratitude to him for his kind 
support, let us hope this will be a new positive turning point in the movie 
productions.

All the Best Michelle (Aerotro)

Richards Website is 
http://www.myspace.com/davedarkandthesharks  



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] Joystick Driver for Saitek Pro Flight Quadrant

2008-05-31 Thread Ron Jensen
I got a new joystick, so I wrote a config for it...

Only tested on linux

Axis Left to Right:  Throttle, Prop Pitch, Mixture

Buttons Left to Right: Flaps, Trim, Gear (up is up, down is down)

Ron



Pro-Flight-Quadrant.xml
Description: XML document
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel