Jump to content
Sign in to follow this  
WarpD

Loading gauge bitmaps other than via resource handle

Recommended Posts

Guest darrenecm

Is anyone out there using an alternative method of loading their gauge bitmaps other than storing them as resources attached to the .gau file and giving the MAKE_STATIC macros their resource handle? I'm not entirely experienced with .dll style coding and do not yet know how to proceed any differently.Ideally, I'd like to have all my gauge artwork in a seperate, compressed file that I load and decompress at run-time and then provide a pointer to the image for the MAKE_STATIC to refer to.Doing this has two benefits. The disk space 'footprint' of my gauge files is reduced for the user and the masterful artwork I painstakingly create for my gauges is better protected from extraction and misuse by others :)Any tips will be most welcome.Grassy arse Amigos- Darren

Share this post


Link to post
Share on other sites

Is it possible, sure.Is it a good approach, probably not.The CPU load to open those files will reduce the efficiency. Especially if they're compressed. As an end user, I wouldn't apprecicate it to be honest. I don't like sitting around waiting for FS to load as it is... and adding in increased load times for a specific aircraft will exacerbate the issue.As a developer I understand your desire to protect your efforts, but there are times you have to accept certain risks. Such a possibly significant impact against the performance of your product in the sim is most likely not worth it. People will definitely publicly talk about it and that will, in the end, impact your distribution.As for referencing the image for the MAKE_STATIC call. Most likely not possible exactly that way. A gauge has to have a static image as it's 'base' before any other element. The gauge has to have the element at gauge creation within FS which means the bitmap image has to be there at that point. Since the only way to 'load' via the macro is with a resource ID... it would be impossible to avoid that step. The only way to support images the way you want is to declare all placeholder bitmaps for the elements and then use something like GDI+ to overwrite them as the gauge draw routine is called by FS.Just not a very good idea with regards to overall performance.


Ed Wilson

Mindstar Aviation
My Playland - I69

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...