Jump to content
Sign in to follow this  
GHD

SCASM source.

Recommended Posts

If I am creating the source for an LWMDataAreaDrawPolygons and the LWMPoly3 would contain just the four corner points of the area, is there a another macro which is more efficient than LWMPoly3.In other words, how do I specify that the whole area is to contain water?George

Share this post


Link to post
Share on other sites
Guest luissa

>If I am creating the source for an LWMDataAreaDrawPolygons>and the LWMPoly3 would contain just the four corner points of>the area, is there a another macro which is more efficient>than LWMPoly3.>>In other words, how do I specify that the whole area is to>contain water?>>GeorgeHello George,I could not understand your exact problem. In any case I post here the SCASM macros that I use for AreaFill LWM masks.Regards, Luis; *************************************; Area01X01Poly.scm macro; used instead of AreaFill 1X1 to avoid crashes (?); %1 = type 0=water 1=land 2=flatten 3=transparent; %2 = column 0 ... 31; %3 = row 0 ... 31; %4 = height if type=0 or =2mif( [%1 == 2] ) LWMAreaDrawPoly( 1 2 %2 %3 )melse LWMAreaDrawPoly( 1 3 %2 %3 )mifendmif( [%1 == 1] ) LWMPoly( 4 1 %4 0 0 255 0 255 255 0 255 )melse LWMPoly( 4 0 %4 0 0 255 0 255 255 0 255 )mifend; *************************************; Area02X02Poly.scm macro; used instead of AreaFill 2X2 to avoid crashes (?); %1 = type 0=water 1=land 2=flatten 3=transparent; %2 = column 0 ... 15; %3 = row 0 ... 15; %4 = height if type=0 or =2UVar( $C0 [2 * %2] )UVar( $C1 [2 * %2 + 1] )UVar( $R0 [2 * %3 ] )UVar( $R1 [2 * %3 + 1] )macro( Area01X01Poly.scm %1 [$C0] [$R0] %4 )macro( Area01X01Poly.scm %1 [$C1] [$R0] %4 )macro( Area01X01Poly.scm %1 [$C0] [$R1] %4 )macro( Area01X01Poly.scm %1 [$C1] [$R1] %4 ); *************************************; Area04X04Poly.scm macro; used instead of AreaFill 4X4 to avoid crashes (?); %1 = type 0=water 1=land 2=flatten 3=transparent; %2 = column 0 ... 7; %3 = row 0 ... 7; %4 = height if type=0 or =2UVar( $C00 [2 * %2] )UVar( $C11 [2 * %2 + 1] )UVar( $R00 [2 * %3 ] )UVar( $R11 [2 * %3 + 1] )macro( Area02X02Poly.scm %1 [$C00] [$R00] %4 )macro( Area02X02Poly.scm %1 [$C11] [$R00] %4 )macro( Area02X02Poly.scm %1 [$C00] [$R11] %4 )macro( Area02X02Poly.scm %1 [$C11] [$R11] %4 ); the next ones follow the same rules; *************************************; Area08X08Poly.scm macro; *************************************; Area16X16Poly.scm macro; *************************************; Area32X32Poly.scm macro; finally here is a SCASM source file with one of these macros:Header( 1 -89 90 -179 180 )LWMFileHeader:cell00macro( Area01X01Poly.scm 0 18 7 0 )LWMIndexList( 1 362 142 3 0 0 )LWMEnd

Share this post


Link to post
Share on other sites

Hello Luis,What I would output for a full LOD13 area would be: LWMDataAreaDrawPolygons 1,_Transparent_,1,28,6 LWMPoly3 4, 0, _Water_, 122, 27, 122, 27 LWMPoint3 0, 0, 0 LWMPoint3 255, 0, 0 LWMPoint3 255, 255, 0 LWMPoint3 0, 255, 0I just wondered if there was a more elegant solution.Regards,George

Share this post


Link to post
Share on other sites

Hi George.You could make an areafill:LWMDataAreaFill1x1 0, _Water_, 1, 28, 6LWMDataAreaHeight 122, 27If I remember correctly, we have a problem with the Map view or GPS, and the areafills. You might need to check that out before using them.Dick

Share this post


Link to post
Share on other sites

Thanks Dick,That is what I was looking for, however, if there might be a problem, perhaps I should stick to using LWMPoly3's.What I have done is written a program to convert the output of Steve Greenwood's FSTFlatten program to LWM format using your kindly supplied code for lat/long conversion and Jim Kier's graphics code and during this realised that there might be some areas which are completely filled, see the rectangular area in the test output below.Georgehttp://www.geo-davison.demon.co.uk/Flatten2LWM.jpg

Share this post


Link to post
Share on other sites

Hi George.I'm not certain there is a problem, but you might need to do a search of the forum for "LWMDataAreaFill", and see what comes up.I'll look this weekend, as well, and see if I can recreate any problem to verify.Dick

Share this post


Link to post
Share on other sites

Hi Dick,I did the search, but most of the topics were from about two years ago and applied to FS8 and CFS2.As I am about to implement the output code, I think I will carry on using polys.George

Share this post


Link to post
Share on other sites

>Hi George.>>Here's a good thread:>>http://forums.avsim.net/dcboard.php?az=sho...13776&mode=full>>The summary is:>>Don't use LWM areafills...make the polys instead. The crashes>are from the map or GPS gauge use. I remember the problem now.> :(>>DickThanks again Dick. This is very relevant to some other work I'm collaborating on.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...