Skip to content

Commit

Permalink
MFD: Run MFDs as module no longer. Hopefully that gives added stability.
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiVChr committed Oct 6, 2023
1 parent fd99e69 commit 6a37633
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Nasal/MFD/display-system.nas
Original file line number Diff line number Diff line change
Expand Up @@ -5255,7 +5255,6 @@ var unload = func {
}
DisplayDevice = nil;
DisplaySystem = nil;
swapAircraftSOI = nil;
f16_mfd.del();
}

Expand All @@ -5265,6 +5264,8 @@ var printfDebug = func {if (debugDisplays) {var str = call(sprintf,arg,nil,nil,v
# Note calling printf directly with call() will sometimes crash the sim, so we call sprintf instead.


main(nil);# disable this line if running as module

#TODO: rockerbuttons as controls
# resolutions
# crash exit GM
Expand Down
12 changes: 6 additions & 6 deletions Nasal/f16.nas
Original file line number Diff line number Diff line change
Expand Up @@ -1866,12 +1866,12 @@ var main_init_listener = setlistener("sim/signals/fdm-initialized", func {
#rp.setMainFile("radar-prototype.nas");#
#rp.load();#
#-- load MFD as reloadable module
var mfd = modules.Module.new("f16_MFD"); # Module name
mfd.setDebug(0); # 0=(mostly) silent; 1=print setlistener and maketimer calls to console; 2=print also each listener hit, be very careful with this!
mfd.setFilePath(getprop("/sim/aircraft-dir")~"/Nasal/MFD");
mfd.setMainFile("display-system.nas");
mfd.setNamespace("displays");
mfd.load();
#var mfd = modules.Module.new("f16_MFD"); # Module name
#mfd.setDebug(0); # 0=(mostly) silent; 1=print setlistener and maketimer calls to console; 2=print also each listener hit, be very careful with this!
#mfd.setFilePath(getprop("/sim/aircraft-dir")~"/Nasal/MFD");
#mfd.setMainFile("display-system.nas");
#mfd.setNamespace("displays");
#mfd.load();
setprop("sim/rendering/headshake/enabled",0);# This does not work very well in F-16. So this makes people have to enable it explicit to have it. Don't know why its forced on us by default.
# debug:
#
Expand Down
4 changes: 2 additions & 2 deletions f16-base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1602,9 +1602,9 @@
<!--file>Aircraft/f16/Nasal/MFD/MFD_main.nas</file-->
<!--<file>Aircraft/f16/Nasal/blackout.nas</file>-->
</f16>
<!--displays> loaded via another method in f16.nas
<displays>
<file>Aircraft/f16/Nasal/MFD/display-system.nas</file>
</displays-->
</displays>
<liveries>
<file>Aircraft/f16/Nasal/liveries.nas</file>
</liveries>
Expand Down

0 comments on commit 6a37633

Please sign in to comment.