scroll automap content with the mouse (proof of concept)#1809
scroll automap content with the mouse (proof of concept)#1809fabiangreffrath wants to merge 4 commits intomasterfrom
Conversation
|
I tried this artifact (Win-64), but couldn't get the feature to work: I bound |
|
I can reproduce this, but I swear I had it working yesterday. Now it seems that mouse movement event aren't even passed to |
|
Can you confirm that it works with Uncapped Framerate disabled? What the... 🤔 |
I'm afraid I need some support from @ceski-1 here. |
|
Here is the culprit: diff --git a/src/d_main.c b/src/d_main.c
index ead2b8ba..7f346438 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -191,7 +191,7 @@ void D_PostEvent(event_t *ev)
switch (ev->type)
{
case ev_mouse:
- if (uncapped && raw_input)
+ if (uncapped && raw_input && !automapactive)
{
G_MovementResponder(ev);
G_PrepMouseTiccmd();Still works awkwardly with |
|
There is a similar line in Line 538 in 6eb4413 |
|
I think the code in |
|
At a first glance, I don't think this will be trivial. The mouse input code doesn't consider this at all. |
Late reply, but yes, it works with capped. You might be aware, but I noticed that the scrolling speed isn't adjusted by zoom; I think it should be. Other than that, I like it! |
By adding another event type, we can avoid mouse input code: diff --git a/src/am_map.c b/src/am_map.c
index f717f8a9..7950030b 100644
--- a/src/am_map.c
+++ b/src/am_map.c
@@ -977,7 +977,7 @@ boolean AM_Responder
m_paninc.x = 0;
m_paninc.y = 0;
- if (mousepan && ev->type == ev_mouse)
+ if (mousepan && ev->type == ev_mouse_rel)
{
m_paninc.x -= (int)G_CalcMouseSide(ev->data1) * MAPUNIT;
m_paninc.y += (int)G_CalcMouseVert(ev->data2) * MAPUNIT;
diff --git a/src/d_event.h b/src/d_event.h
index 18c9ee30..d0455000 100644
--- a/src/d_event.h
+++ b/src/d_event.h
@@ -34,6 +34,7 @@ typedef enum evtype_e
ev_mouseb_up,
ev_mouse,
ev_mouse_state,
+ ev_mouse_rel,
ev_joyb_down,
ev_joyb_up,
ev_joystick,
diff --git a/src/i_input.c b/src/i_input.c
index 5c1716ae..343b3989 100644
--- a/src/i_input.c
+++ b/src/i_input.c
@@ -19,11 +19,11 @@
#include "d_event.h"
#include "d_main.h"
#include "doomkeys.h"
+#include "doomstat.h"
#include "doomtype.h"
#include "i_gamepad.h"
#include "i_printf.h"
#include "i_system.h"
-#include "m_config.h"
#define AXIS_BUTTON_DEADZONE (SDL_JOYSTICK_AXIS_MAX / 3)
@@ -424,12 +424,19 @@ void I_DelayEvent(void)
void I_ReadMouse(void)
{
static event_t ev = {.type = ev_mouse};
+ static int oldgametic;
SDL_GetRelativeMouseState(&ev.data1, &ev.data2);
if (ev.data1 || ev.data2)
{
D_PostEvent(&ev);
+ if (oldgametic != gametic)
+ {
+ oldgametic = gametic;
+ ev.type = ev_mouse_rel;
+ D_PostEvent(&ev);
+ }
ev.data1 = ev.data2 = 0;
}
}
Still the interpolation is not working properly. |
I spent an hour on it and failed. My idea is a stripped down |
|
Wow, this is getting really complicated. |
Fixes #1729