Today it's mostly been menus and a nasty vid_restart bug.
The menu work was totally behind the scenes, and involved a lot of cleanup and standardisation of ways of doing things. The end result will hopefully be simpler, more maintainable, and less potentially buggy code for me. If you've ever looked at my HUD menu code you'll know what I mean.
The vid_restart bug caught me by surprise. I was adding toggleable vsync and testing it out, when I noticed some seriously weird behaviour when doing a vid_restart from a full-screen console. Funny thing is that it works perfectly when in a menu or an in-game console. First you get some bad graphical corruption and it looks as though the engine has hung. Press ESC a few times and the menu will come up, but the Q cursor will be spinning veeeery slow. After a few seconds it picks up speed, and eventually settles back to normal speed.
I suppose it's probably always been there, but I'm damned if I can find the root cause right now. To temporarily resolve it I've put in what must be the cheapest and cheesiest hack I've ever seen; I fire a togglemenu command, then a wait, then togglemenu again to remove the menu. This works but it doesn't hold well over more than 1 consecutive vid_restart, when the whole thing just happens again.
I must go back to some of the older code and see if I can discover what point it came in at. I may also rework vsync changes to only take effect if you have a 3D view up (which is the only place it really matters), but that still won't resolve the more general bug.
Anyway, you heard me say "vsync" (twice now), so yes, vid_vsync is now in (default 0) to enable you to switch vsync on or off as you wish. Previous releases always had it off, and I always wanted to include the option. Yes, changing it does require a vid_restart as vsync settings are specified at device Creation or Reset time. I've set up the engine to do this automatically for you so all should be nice and fine.
I'm not certain about the internal workings of OpenGL or why it's able to do vsync in a much simpler manner via wglSwapInterval (or equivalent), but I suspect that it may encapsulate a lot of behind-the-scenes nastiness that D3D shoves in your face.
Tuesday, November 3, 2009
Barrels of fun
Posted by
mhquake
at
12:47 AM
Subscribe to:
Post Comments (Atom)
6 comments:
Great job on the DirectQ updates. You're packing in a lot of stuff for this next DQ version.
Here's something (hopefully) a little easier to implement;
A cvar that allows you to enable/disable the "Do you want to quit?" box that pops up when you hit F10 or type "quit" in the console.
Keep up the good work!
Now that I come to think of it, the Quit option should only pop the dialog when selected from the menu or from F10. I'd prefer to keep the dialog with those two as they could be accidentally selected in-game (it seems the lesser of 2 evils).
When typed at the console you've pretty much already told the engine that you want to quit, so why should it ask you again?
Good suggestion. I can see a way of getting this to work (but without the cvar, this seems more something that a "sensible default" approach is more appropriate for).
I never much liked that level. It seems the further Doom II got going, the levels became dull, and that level always stood-out to me as "here we go, the game is over"; it's alright now I guess. It did have a lot of barrels, if I remember. . .
You know, I don't think I've ever played that level. Didn't really get too far in Doom II before getting bored of it, the novelty had worn off.
Yeah, my bad.
It doesn't pop up when I type "quit" in the console, but only when I hit F10 or the other key I have "quit" bound to.
It's more of a anti-nag feature than anything. I can live with hitting the "Y" key if necessary. :)
I'd definitely prefer to keep the "Y" key in cases where a single-key quit can be accidentally done. I'm also dubious about a cvar to make it optional. If you expose it in a menu it becomes an option that might be selected by those who shouldn't, if you don't it becomes a hidden setting that might be forgotten about. Hard to see a balance.
Post a Comment