• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 2D panel redraw problem

DragonflightDesign

Resource contributor
Messages
1,390
Country
northernireland
Firstly - this ONLY happens in P3Dv4. If compiled to 32-bit and launched in FSX, no problems.

I have a gauge that draws the background (MAKE_STATIC) and two MAKE_ICONS that add two bitmaps to represent night lighting when the cockpit lights are turned on. All instruments and swicthes have the required 'night-lit' additional bitmaps that are switched in with the cockpit lights being turned on. All bitmaps involved in the cockpit lighting have the IMAGE_USE_BRIGHT flag applied in the gauge update callback when the cockpit lights are turned on.

Initial summary: the cockpit light are turned on, the 'lit' bitmaps are all switched in and the IMAGE_USE_BRIGHT flag applied. Reverse for cockpit lights off.

What happens: for between 1 and 10 actions on the lights switch, all works perfectly.
Between 8 and 10 clicks, the following always happens when the lights are turned on:

- The background bitmap lights up and overwrites all the other bitmaps i.e. I see the background only
- All gauges that are constantly updated (e.g. airspeed) immediately reappear
- All switches remain invisible until I click on the relevant area and then they reappear (sometimes just one, sometimes more than one. It depends if they are grouped. For example, the overhead panel switches will all reappear if I click one because they are all in the same gauge).
- P3Dv4 fails to draw transparency i.e. I get big black rectangles on screen.

Turn the lights off and everything reappears correctly (lights off etc.).

Four days later... :banghead: It's obviously a redraw problem but introducing SET_OFFSCREEN into the equation to force a redraw does nothing for the problem.

Anyone...?
 
Confirmed it's a redraw problem; specifically, IMAGE_HIDDEN seems to behave slightly differently in P3Dv4 compared to FSX. Whether that's because the program is now 64-bit and is compiled differently, I have no idea. The solution (many, many hours) later was to shuffle the gauge contents so that the background lighting images were at the top of the macro list and then control them using the IMAGE_HIDDEN_TREE flag. I wrote a shedload of new macro helpers while I was hammering at this problem (similar to HIDE_LISTELEMENT etc.) which will be included in the next issue of sd2gau.

One of my RL customers is Lockheed Orlando. I have a service request from them at the moment. Maybe I should force them to fix this problem in exchange? :stirthepo:rotfl:
 
Back
Top