Jump to content
Sign in to follow this  
Guest grb

Can someone help me with a Borland compilation problem for Gauges?

Recommended Posts

Guest grb

Arne,I copied the gps_export.dll program from the FS2K2 Panel_Aircraft SKD sample dir to my FS2K2modules directory. Then I loaded a plane with the FlightMap gauge in it's panel into sim. Created a flight plan.Loaded FlightPlan. Bingo! I see a white vector line (waypoint) shown in the gauge screen, animating from the center (with a little dot enclosing the little cursor shape). The white line starts in center and goes off screen in the directlion that the end airport would be located. So that part works. Now I noticed that if I LEFT CLICK THE MOUSE WHILE IN THE GAUGE ....another waypoint is created with a little dot at it's end. And if I click once again, another waypoint vector gets added to the screen.So after two clicks.........I have three white lines connected by little hollow white dot shapes.Not sure what this means................just reporting how the gauge is functioning.Is this about what I should expect? Not to want to complicate things, but as you would see in this thread where I showed a succesful compile...........you will notice that there where some warning messages concerning the FlightMap.C file.Perhaps there are some small errors in how the C code is being used for that gauge withing the FlightMap.c file. At any rate, looks as if the gauge is somewhat functional. Noticed it has no power on/off or other type buttons showing up within it's framework. I assume at the moment that it is strictly a black background box, with the inner white lined box shown inside and that all one sees is a waypoint. Perhaps this gauge was designed as a skeleton type function so that one could build more functionality into it? Have not even looked at the bmp files yet on this issue.take care,George

Share this post


Link to post
Share on other sites
Guest bartels

You don't need to look after the bitmaps, there aren't much. The flightmap gauge is a very basic example to draw anything "on the fly" with the GDI mechanism. And secondly it shows a way to display full GPS data and as you found out even modifying it, which isn't possibble with the "standard" gauge programming (menaing with the data provided by gauges.h only).Speaking of the warnings, the original flightmap.c is (how should I put it, sloppy pogramming?) compilable in VC++ without modifications. E.g. for GCC you need the reworked version from sd2gau15.zip to get it to work at all. In BCC you are lucky only to get warnings. On the other hand warnings about inefficient code ("Condition is always true","Code has no effect") are almost offending in my opinion, maybe it's true, but often programming like this might be intentionally. I ignore those kinds of warnings. "Comparing signed and unsigned " warnings are probably something different and might demand a closer look, you can even get rid of them with some typecasts, but for this specific gauge it's save and easier to ignore all three types of warnings.Arne Bartels

Share this post


Link to post
Share on other sites
Guest JeanLuc_

Yes, the archive I've setup includes the modification for the gauge to be compiled with BCC. No need specificaly for the SD2GAU15.zip (although it is a very good effort from its authors for a global understanding of gauge programming and I recommend it. Byt the way, when will Dai decide to ALSO upload this guide at avsim... more people would be able to enjoy it I guess because there, it is often hard to get a node...)Anyhow, the only thing which needed to be changed was the assignement to the POINT structure. You'll find the original line commented out in my archive (re: flightmap.c)Unsigned / signed is probably in the for...loop. Testing the index (signed) to a maximum value (unsigned). Just cast it out or declare the index loop counter as an unsigned.Code has no effect is only related to some of the SIF48_ ...to something.... and the other similar functions. BCC guesses that some of the computations needed to convert a type like this (64bits) to another one (double) are not necessary. This is not true in fact from a machine code compiled code point of view, when looking at how BCC (as compared to VC) compiles these function. Just ignore these warnings, you have to leave with them with BCC!Arnes, I share you view about the "sloppy" but these are just SDK samples to get you started! and don't forget, VC++ is not 100% compliant to ANSI while BCC is... This sometimes creates bad coding habits....Hope this helps!a

Share this post


Link to post
Share on other sites
Guest grb

Arne and JeanLuc,I think I got a better idea as to what the gauge is intended to do.As JeanLuc indicated, it is in the SDK as an example. So between what both you guys had to say, it appears to be an experimental gauge to allow people to explore how they can make a more advance interactive gauge based on that code. Interestingly, since my plans are to try to create CFS2 stuff. I downloaded and installed all the stuff "sd2gau15.zip" and the Arne/Dragonfly stuff from an earlier time (last year?). And with a bit of hacking.......created a SDK.H, SDK.C, SDK.rc file to go along with the FlightMap.c file and it's associated bitmap files.Using a modified Makefile and the FS2K2Gauges.H file from that distribution..............I got the gauge to compile .....As Arne indicated above. Looks to me like it is the same thing as the onefound in JeanLuc's distribution for all practical purposes. At any rate, thanks once more both, for responding with INTELLEGENT ANSWERS. Rather refreshing to say the least! Perhaps the day will come when I am almost on par with you guys. Been years since I did any C programming. Was mostly to build GUI interfaces for SQL engines and just generic stuff one gets out of the books, as well as a little bit of at the time fancy windows for UNIX based machines using the NCURSERS packages. But I am not much of a C programmer at this point!UNIX shells where so powerful I usually could relie on them to do the job.Now for the catch-twenty two! Takers..........Please!Any suggestions as to where I might find a reliable gauge.h file that will allow me to compile the various examples in the sd2gau15 distribution? I assume that zip is primarily for FS2000/CFS2.For the past five hours or so I have with no success been able to compile any of those SUPPOSEDLY CFS2 COMPATIBLE gauge files.Always get tons of warnings, and errors! Sure looks again like it is due to a non-compatible gauges.h file. I am using the Borland 5.2.I was under the impression that the gauge.h header file(s) found in sd2gau15.zip AS WELL AS THE source files where for FS2000/CFS2.But I cannot get any of them to work with the included gauge.h files.The only one that worked was as stated above, the FlightMap gauge source files. And there I had to use the FS2K2Gauges.h file to get it to compile. Which obviouse to you guys makes sense since the gauge is for the FS2K2 environment.I am simply confused over what to use for CFS2 simulator.Thank you once again for any help on this issue. And I hope I am not wearing out my welcome.very best regards,George

Share this post


Link to post
Share on other sites
Guest bartels

The information in the documents in sd2gau15.zip is valid for any simulator version after Fs2000, also most of the source code, which can be identically used for the versions (together with the gauges.h of fs98 the info and sources would be broadly FS98 compatible too).The gauges.h itself is for Fs2002 (and later), also the flightmap gauge works and compiles only for Fs2002. The last sd2gauxx.zip with a fs2000 (and cfs2) compatible gauges.h was sd2gau12.zip. Sorry but time went on. I can send you the "old" issures if you don't have them.It is as I already said possible to "upscale" the FS2000 gauges.h to CFS2 by adding some help_ids/keys/tokens. I have never tried to "downcsale"the FS2002 gauges.h to CFS2. It might be, that some techniques, e.g. the GDI drawing by using IMAGE_CREATE_DIBSECTION, were already usable in CFS2, but I don't know, I never tried. CFS2 being an "interims"-FS lacks of all information about.Again: usually all gauges for FS2000/CFS2 work also for FS2002 and FS2004, even without recompiling. For most of the sources the only difference is in using a different gauges.h (e.g. to prevent the "old modules" warning in Fs2004). There are however some sources that rely on the FS2002 gauges.h with it changes, namely the flightmap.c. These won't work with old gauge.h's and also not for older FS versions then FS2002.Arne Bartels

Share this post


Link to post
Share on other sites
Guest grb

Arne,After not being able to respond to your offer, I keeped getting cannot display page....screen, I sent you a email, indicating that I would like to have the sd2gau12.zip file when you can make some time to do so. As mail message indicated, a hyperlink in this thread for the download is fine with me or if you wanted to mail it via. email.Thank you for your comments in your last thread. Obviously I have a lot of things to learn before I will be able to do anything worth while. But hopefully it will stay interesting.take care,George

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...