SpiritQuaddicted / reQuiem

reQuiem is a custom OpenGL Quake engine for Windows and Linux. It's designed for maximum compatibility with all things Quake - past, present and future. It's fast, reliable, and easy to configure. In short: it fixes what was broken, improves what needed improving, and leaves the rest alone. It was developed by jdhack.
GNU General Public License v2.0
17 stars 2 forks source link

always-on-mouselook enabled by default #55

Closed neogeographica closed 10 years ago

neogeographica commented 10 years ago

(Another of the "out-of-the-box experience" items from that email.)

The method of doing this isn't as obvious/trivial as some of the others, so I'll put this up for potential comments before changing anything.

I kind of like the way that Engoo handles this, with a new m_look cvar that essentially flips the sense of +mlook. In Engoo, if m_look is 1 then always-on-mouselook is enabled (and pressing a +mlook key would actually turn off mouselook rather than turning it on).

We could default m_look to 1 in reQuiem so that always-on-mouselook is enabled by default. This would differ from Engoo's behavior, which defaults it to 0.

Engoo implements the m_look behavior by replacing all occurrences of (in_mlook.state & 1) with ((in_mlook.state & 1) ^ ((int)m_look->value & 1)).

That would work, but at first glance it looks like we could handle things more efficiently by only checking the value of m_look if/when the +mlook key is pressed or released, i.e. make the IN_MLookDown and IN_MLookUp functions decide whether to call KeyUp or KeyDown depending on the value of m_look.

There might be some reason not to do that which I haven't noticed yet. Also I'd need to be careful about at least a couple of things:

neogeographica commented 10 years ago

One solution in https://github.com/SpiritQuaddicted/reQuiem/commit/5164cc4c189ebf4a76940ed34ecf35af5eb88f0e on the m_look branch ... see the description of that commit for a bit of discussion. Comments on those alternatives welcome.

neogeographica commented 10 years ago

Pull request is out. The proposed functionality there is different than in the thoughts above... see the pull request comments.