



DrawStatusLine (lines 5679-5741)
Back to List
Browsing parserm.h
5679 ! Except in Version 3, the DrawStatusLine routine does just that: this is
5680 ! provided explicitly so that it can be Replace'd to change the style, and
5681 ! as written it emulates the ordinary Standard game status line, which is
5682 ! drawn in hardware
5683 ! ----------------------------------------------------------------------------
5684
5685 #Ifdef TARGET_ZCODE;
5686
5687 #IfV5;
5688
5689 #Iftrue (#version_number == 6);
5690 [ DrawStatusLine width x charw scw mvw;
5691 (0-->8) = (0-->8) &~ $$00000100;
5692
5693 StatusLineHeight(gg_statuswin_size);
5694 ! Now clear the window. This isn't totally trivial. Our approach is to select the
5695 ! fixed space font, measure its width, and print an appropriate
5696 ! number of spaces. We round up if the screen isn't a whole number
5697 ! of characters wide, and rely on window 1 being set to clip by default.
5698 MoveCursor(1, 1);
5699 @set_font 4 -> x;
5700 width = ScreenWidth();
5701 spaces width;
5702 ! Back to standard font for the display. We use output_stream 3 to
5703 ! measure the space required, the aim being to get 50 characters
5704 ! worth of space for the location name.
5705 MoveCursor(1, 2);
5706 @set_font 1 -> x;
5707 if (location == thedark)
5708 print (name) location;
5709 else {
5710 FindVisibilityLevels();
5711 if (visibility_ceiling == location) print (name) location;
5712 else print (The) visibility_ceiling;
5713 }
5714 @get_wind_prop 1 3 -> width;
5715 @get_wind_prop 1 13 -> charw;
5716 charw = charw & $FF;
5717 @output_stream 3 StorageForShortName;
5718 print (string) SCORE__TX, "00000";
5719 @output_stream -3; scw = HDR_PIXELSTO3-->0 + charw;
5720 @output_stream 3 StorageForShortName;
5721 print (string) MOVES__TX, "00000";
5722 @output_stream -3; mvw = HDR_PIXELSTO3-->0 + charw;
5723 if (width - scw - mvw >= 50*charw) {
5724 x = 1+width-scw-mvw;
5725 @set_cursor 1 x; print (string) SCORE__TX, sline1;
5726 x = x+scw;
5727 @set_cursor 1 x; print (string) MOVES__TX, sline2;
5728 }
5729 else {
5730 @output_stream 3 StorageForShortName;
5731 print "00000/00000";
5732 @output_stream -3; scw = HDR_PIXELSTO3-->0 + charw;
5733 if (width - scw >= 50*charw) {
5734 x = 1+width-scw;
5735 @set_cursor 1 x; print sline1, "/", sline2;
5736 }
5737 }
5738 ! Reselect roman, as Infocom's interpreters interpreters go funny
5739 ! if reverse is selected twice.
5740 MainWindow();
5741 ];
Last updated 27 February 2004.
This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation.
Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson assisted by C Knight.