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.

Moderator: Forum Moderators

Post Reply
User avatar
singalen
iOS Port Maintainer
Posts: 314
Joined: January 3rd, 2007, 10:18 am
Location: bay

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

Post by singalen »

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: 314
Joined: January 3rd, 2007, 10:18 am
Location: bay

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

Post by singalen »

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!
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

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

Post by gfgtdf »

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.
User avatar
singalen
iOS Port Maintainer
Posts: 314
Joined: January 3rd, 2007, 10:18 am
Location: bay

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

Post by singalen »

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
Post Reply