I6: clearing the screen in RestoreColours() if COLOUR is set

The inform6 release notes file has a section describing new library routines that were added in 6/11 to abstract away zcode/glulx platform differences.

ClearScreen and SetColour are both listed. RestoreColours isn’t mentioned; it seems to be a private routine used in conjunction with SetColour to maintain the correct color settings after a restore or undo.

The description of SetColour says:

I took your UNDO AND COLOR test program, changed the @set_colour calls to SetColour() calls, removed the ClearScreen() call from RestoreColours, and compiled it for both zcode and glulx. (I did not add ClearScreen() calls after the SetColour() calls.)

On zcode, it behaves as you describe: the color changes each time the player looks into a sphere, and the screen is not cleared. After “LOOK INTO RED SPHERE / LOOK INTO GREEN SPHERE / LOOK INTO BLUE SPHERE / UNDO”, the text turns from blue back to green. (The issue on github says it turns white at this point. Typo?)

On glulx, the same commands caused the screen to be cleared after each SetColour and after the undo, even though the ClearScreen() call was commented out of RestoreColours. (*)

So, one reason to keep the call would be to make zcode and glulx games behave identically.

As for why Glulx SetColour clears the screen in the first place, maybe because an abrupt color scheme change in the middle of a screen of text was thought to look bad. (Edit: See Dannii’s post below for the real reason.)

(*) The screen didn’t actually change colors with any of the several glulx interpreters that I tried. A search here on the forums for “glulx SetColour” turns up a couple of interesting threads (1, 2) suggesting that it never worked.