by Merk » Thu Jun 23, 2005 9:23 pm
Yep, that also seems to work. I had written the routine to check prior states of display.screenwidth, display.screenheight, and display.hasgraphics. I commented that out and just checked display.needs_repaint, and it appeared to work the same.
The trick is, where best to put it? I found that if I put it in main() then it only works for any verb routines that return True. I thought only XVerbs would cause it not to re-run main(), but it seems that any verb routine that doesn't return True skips main() as well. So, I did a replace preParse() and put it there. I don't actually pre-parse anything -- I just check the screen change, and return false. That works as long as it's a recognized command. If the command references unknown objects, or starts with an unknown verb, then it appears the Parse() routine doesn't continue far enough to call preParse().
Any suggestions on where best to put it? I'd like to run it before the player's command is processed, as opposed to after. If running after, the result of the command would be erased during my screen re-draw. Unless I drop it in at the very beginning of Parse(), I'm not sure how to make sure it works after every command.
Thanks!
---- Mike.
Yep, that also seems to work. I had written the routine to check prior states of display.screenwidth, display.screenheight, and display.hasgraphics. I commented that out and just checked display.needs_repaint, and it appeared to work the same.
The trick is, where best to put it? I found that if I put it in main() then it only works for any verb routines that return True. I thought only XVerbs would cause it not to re-run main(), but it seems that any verb routine that doesn't return True skips main() as well. So, I did a replace preParse() and put it there. I don't actually pre-parse anything -- I just check the screen change, and return false. That works as long as it's a recognized command. If the command references unknown objects, or starts with an unknown verb, then it appears the Parse() routine doesn't continue far enough to call preParse().
Any suggestions on where best to put it? I'd like to run it before the player's command is processed, as opposed to after. If running after, the result of the command would be erased during my screen re-draw. Unless I drop it in at the very beginning of Parse(), I'm not sure how to make sure it works after every command.
Thanks!
---- Mike.