Merge branch '86Box:master' into nec-v20

This commit is contained in:
Jasmine Iwanek
2022-09-18 17:30:54 -04:00
committed by GitHub
8 changed files with 27 additions and 12 deletions

View File

@@ -16,3 +16,4 @@ IndentPPDirectives: AfterHash
IndentExternBlock: NoIndent
PointerAlignment: Right
SpaceAfterCStyleCast: true
SortIncludes: false

View File

@@ -180,8 +180,8 @@ load_general(void)
lang_id = plat_language_code(p);
mouse_sensitivity = ini_section_get_double(cat, "mouse_sensitivity", 1.0);
if (mouse_sensitivity < 0.5)
mouse_sensitivity = 0.5;
if (mouse_sensitivity < 0.1)
mouse_sensitivity = 0.1;
else if (mouse_sensitivity > 2.0)
mouse_sensitivity = 2.0;

View File

@@ -1064,11 +1064,15 @@ isapnp_reset_device(void *priv, uint8_t ldn)
static const device_t isapnp_device = {
"ISA Plug and Play",
"isapnp",
0,
0,
isapnp_init, isapnp_close, NULL,
{ NULL }, NULL, NULL,
NULL
.name = "ISA Plug and Play",
.internal_name = "isapnp",
.flags = 0,
.local = 0,
.init = isapnp_init,
.close = isapnp_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};

View File

@@ -136,6 +136,7 @@ extern int is_pentium; /* TODO: Move back to cpu/cpu.h when it's figured out,
how to remove that hack from the ET4000/W32p. */
extern int fixed_size_x, fixed_size_y;
extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */
extern double mouse_x_error, mouse_y_error; /* Mouse error accumulators */
extern int pit_mode; /* (C) force setting PIT mode */
extern int fm_driver; /* (C) select FM sound driver */

View File

@@ -88,7 +88,7 @@
<item row="7" column="0" colspan="2">
<widget class="QSlider" name="horizontalSlider">
<property name="minimum">
<number>50</number>
<number>10</number>
</property>
<property name="maximum">
<number>200</number>

View File

@@ -54,6 +54,7 @@ extern "C" {
#include <86box/video.h>
double mouse_sensitivity = 1.0;
double mouse_x_error = 0.0, mouse_y_error = 0.0;
}
struct mouseinputdata {
@@ -151,8 +152,14 @@ RendererStack::mousePoll()
#endif
this->mouse_poll_func();
mouse_x *= mouse_sensitivity;
mouse_y *= mouse_sensitivity;
double scaled_x = mouse_x * mouse_sensitivity + mouse_x_error;
double scaled_y = mouse_y * mouse_sensitivity + mouse_y_error;
mouse_x = static_cast<int>(scaled_x);
mouse_y = static_cast<int>(scaled_y);
mouse_x_error = scaled_x - mouse_x;
mouse_y_error = scaled_y - mouse_y;
}
int ignoreNextMouseEvent = 1;

View File

@@ -44,6 +44,7 @@ int resize_pending = 0;
int resize_w = 0;
int resize_h = 0;
double mouse_sensitivity = 1.0; /* Unused. */
double mouse_x_error = 0.0, mouse_y_error = 0.0; /* Unused. */
static uint8_t interpixels[17842176];
extern void RenderImGui();

View File

@@ -29,6 +29,7 @@
int mouse_capture;
double mouse_sensitivity = 1.0; /* Unused. */
double mouse_x_error = 0.0, mouse_y_error = 0.0; /* Unused. */
typedef struct {
int buttons;