Re: changing the mouse pointer location

Bernhard Wymann <[email protected]>
Newsgroups gmane.games.torcs.general
Organization wytec
Message-ID <[email protected]>
Hi st
> This is a continuous nuisance and a cause for engine overheating, and I

:-)

> hope there is a simple solution. In my track creation and editing
> efforts, I always have to re-start TORCS like a hundred times to see how
> the track looks and what changes are still needed, and the stupid mouse

Why do you restart it, the track list is updated (IIRC) when you enter 
the track selection, and if the track name does not change you just need 
to restart the race to see the modified track (because it is loaded at 
the start of the race)?

> pointer from the desktop is always in the way, right in the middle of
> the screen, the last thing I need before my eyes. And while you might
> consider this totally trivial, it really slows me down a lot, having to
> always reach for the mouse and chase the uninvited pointer off the
> screen before being able to continue to the track. And multiply that by
> a hundred (or whatever), and it really gets annoying.

Ok, yes, such stuff can be annoying...

> Now, is there a way to edit the game code so that the pointer would no
> longer appear in the middle of the screen as described above but
> preferably at the bottom? I know "make" probably needs to be run
> afterward too. If anybody out there could point out the right source
> file where this variable is and how to alter it appropriately, I'd be
> grateful, and the misfiring engine might cool down too.

Lets see...
find . -name "*.cpp" -exec grep -H -i cursor {} \;

-> so src/libs/tgfclient/gui.cpp looks interesting, maybe "GfuiMouseShow"?

Then google:
https://www.google.com/search?q=glut+mouse+cursor+positioning

-> glutWarpPointer could do the trick

Looking for this in TORCS:
find . -name "*.cpp" -exec grep -H -i Pointer {} \;

-> src/libs/tgfclient/gui.cpp -> glutWarpPointer, GfuiMouseSetPos, this 
could be your thing:-)

Maybe you need to dig a tad further, but I guess this is a major hint 
for your solution, the next step would be to look up the places where
GfuiMouseSetPos is used.

But as I pointed out above, I think the main flaw is that you restart 
TORCS at all, if you just edit an existing track restarting the game 
session should relaod the track, not even reselection of the track 
should be required;-)

Keep us informed about your solution (hacked TORCS or adopted workflow, 
whatever).

Best regards

Bernhard

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.