I see a bug. Did right-button dragging ever work?

Discussion of all aspects of the game engine, including development of new and existing features.

Moderators: Forum Moderators, Developers

I see a bug. Did right-button dragging ever work?

Postby singalen » March 19th, 2017, 7:15 pm

I think I see an error which breaks dragging.

In mouse_handler_base.cpp around line 118:
(SDL_GetMouseState(&mx,&my) & SDL_BUTTON_LEFT) != 0
SDL_GetMouseState() returns the state of ALL buttons, it's a bit mask. SDL_BUTTON_LEFT is the button ID.
I'm sure this should be
(SDL_GetMouseState(&mx,&my) & SDL_BUTTON(SDL_BUTTON_LEFT)) != 0
because SDL_BUTTON() turns button ID into a respective bit in a bit status field.

It only works for SDL_BUTTON_LEFT because SDL_BUTTON(SDL_BUTTON_LEFT) == 1 and SDL_BUTTON_LEFT == 1.

Did right-button dragging ever work? Looks like there was supposed to be left-button and right-button dragging, but now right click invokes a context menu immediately.
Was it supposed to drag a map? I would be pretty happy to use a map dragging functionality in a touch UI.
User avatar
singalen
iOS Port Maintainer
 
Posts: 164
Joined: January 3rd, 2007, 10:18 am
Location: bay

Re: I see a bug. Did right-button dragging ever work?

Postby singalen » March 20th, 2017, 1:47 am

Edit: I found the commit that added the hint of right-dragging: https://github.com/wesnoth/wesnoth/comm ... 815c1dfbee
Right-dragging never existed in the first place. Maybe it's time for it!
User avatar
singalen
iOS Port Maintainer
 
Posts: 164
Joined: January 3rd, 2007, 10:18 am
Location: bay

Re: I see a bug. Did right-button dragging ever work?

Postby gfgtdf » March 26th, 2017, 10:41 pm

I am not sure what the bug here is. Whta exact behavuour woudl you expect if people right-drag things? I also have never seen right-dragging in other applications eigher.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
gfgtdf
Developer
 
Posts: 912
Joined: February 10th, 2013, 2:25 pm

Re: I see a bug. Did right-button dragging ever work?

Postby singalen » March 27th, 2017, 1:41 am

After some research, I don't expect right-dragging to work, as it never did.

The only thing remaining (which has no effect now though) is:
(SDL_GetMouseState(&mx,&my) & SDL_BUTTON_LEFT) != 0
should be
(SDL_GetMouseState(&mx,&my) & SDL_BUTTON(SDL_BUTTON_LEFT)) != 0
User avatar
singalen
iOS Port Maintainer
 
Posts: 164
Joined: January 3rd, 2007, 10:18 am
Location: bay


Return to Coder’s Corner

Who is online

Users browsing this forum: No registered users and 1 guest