[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Patch : cursor follow the mouse
Hello,
This is another patch for CF, it let the cursor follow the mouse : less click when you play :), just move the mouse !
--
Sébastien
diff -urNp crimson-0.5.3_orig/src/cf/game.cpp crimson-0.5.3_patch/src/cf/game.cpp
--- crimson-0.5.3_orig/src/cf/game.cpp 2007-06-24 17:30:18.000000000 +0200
+++ crimson-0.5.3_patch/src/cf/game.cpp 2014-03-23 12:37:06.000000000 +0100
@@ -1459,6 +1459,11 @@ GUI_Status Game::HandleEvent( const SDL_
break;
}
+ } else if (event.type == SDL_MOUSEMOTION ) {
+ Point pos;
+ if ( !mv->Pixel2Hex( event.button.x - mwin->x, event.button.y - mwin->y, pos ) ) {
+ if (mv->Cursor() != pos) SetCursor( pos );
+ }
} else if ( event.type == SDL_MOUSEBUTTONDOWN ) {
Point pos;
if ( event.button.button == SDL_BUTTON_LEFT ) {