now using float for wheel
This commit is contained in:
parent
30ba0b2ae0
commit
9e990680dc
|
|
@ -96,12 +96,12 @@ RB_METHOD(inputMouseY){
|
||||||
// wheel :3
|
// wheel :3
|
||||||
RB_METHOD(inputWheelX) {
|
RB_METHOD(inputWheelX) {
|
||||||
RB_UNUSED_PARAM;
|
RB_UNUSED_PARAM;
|
||||||
return rb_fix_new(shState->input().wheelX());
|
return rb_float_new(shState->input().wheelX());
|
||||||
}
|
}
|
||||||
|
|
||||||
RB_METHOD(inputWheelY) {
|
RB_METHOD(inputWheelY) {
|
||||||
RB_UNUSED_PARAM;
|
RB_UNUSED_PARAM;
|
||||||
return rb_fix_new(shState->input().wheelY());
|
return rb_float_new(shState->input().wheelY());
|
||||||
}
|
}
|
||||||
|
|
||||||
RB_METHOD(inputWheelFlipped) {
|
RB_METHOD(inputWheelFlipped) {
|
||||||
|
|
@ -165,9 +165,9 @@ void inputBindingInit(){
|
||||||
_rb_define_module_function(module, "mouse_y", inputMouseY);
|
_rb_define_module_function(module, "mouse_y", inputMouseY);
|
||||||
|
|
||||||
// wheel support :P
|
// wheel support :P
|
||||||
_rb_define_module_function(module, "mouse_wheel_x", inputWheelX);
|
_rb_define_module_function(module, "wheel_x", inputWheelX);
|
||||||
_rb_define_module_function(module, "mouse_wheel_y", inputWheelY);
|
_rb_define_module_function(module, "wheel_y", inputWheelY);
|
||||||
_rb_define_module_function(module, "mouse_wheel_flipped", inputWheelFlipped);
|
_rb_define_module_function(module, "wheel_flipped", inputWheelFlipped);
|
||||||
|
|
||||||
_rb_define_module_function(module, "quit?", inputQuit);
|
_rb_define_module_function(module, "quit?", inputQuit);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,10 @@ class Window_Settings
|
||||||
|
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
if @visible
|
||||||
|
@version.bitmap.clear
|
||||||
|
@version.bitmap.draw_text(0, 0, @version.bitmap.width, @version.bitmap.height, Input.wheel_y.to_s)
|
||||||
|
end
|
||||||
|
|
||||||
@version.opacity = 128
|
@version.opacity = 128
|
||||||
|
|
||||||
|
|
@ -350,12 +354,8 @@ class Window_Settings
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if Input.mouse_wheel_y > 0
|
if Input.wheel_y != 0
|
||||||
@index = (@index - 1) % @data.size
|
@index = (@index - Input.wheel_y.round) % @data.size
|
||||||
$game_system.se_play($data_system.cursor_se)
|
|
||||||
end
|
|
||||||
if Input.mouse_wheel_y < 0
|
|
||||||
@index = (@index + 1) % @data.size
|
|
||||||
$game_system.se_play($data_system.cursor_se)
|
$game_system.se_play($data_system.cursor_se)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -434,8 +434,8 @@ void EventThread::process(RGSSThreadData &rtData){
|
||||||
case SDL_EVENT_MOUSE_WHEEL:
|
case SDL_EVENT_MOUSE_WHEEL:
|
||||||
{
|
{
|
||||||
mouseState.wheelFlipped = event.wheel.direction == SDL_MOUSEWHEEL_FLIPPED;
|
mouseState.wheelFlipped = event.wheel.direction == SDL_MOUSEWHEEL_FLIPPED;
|
||||||
mouseState.wheelX += event.wheel.integer_x;
|
mouseState.wheelX += event.wheel.x;
|
||||||
mouseState.wheelY += event.wheel.integer_y;
|
mouseState.wheelY += event.wheel.y;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ public:
|
||||||
|
|
||||||
// mouse wheel support for sunshine
|
// mouse wheel support for sunshine
|
||||||
bool wheelFlipped;
|
bool wheelFlipped;
|
||||||
int wheelX, wheelY;
|
float wheelX, wheelY;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FingerState{
|
struct FingerState{
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ static const Input::ButtonCode otherDirs[4][3] = {
|
||||||
|
|
||||||
// storing wheel as buffer cause yes.
|
// storing wheel as buffer cause yes.
|
||||||
struct MouseFrameState {
|
struct MouseFrameState {
|
||||||
int wheelX, wheelY;
|
float wheelX, wheelY;
|
||||||
bool wheelFlipped;
|
bool wheelFlipped;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -704,8 +704,8 @@ int Input::mouseY(){
|
||||||
}
|
}
|
||||||
|
|
||||||
// wheel support :3
|
// wheel support :3
|
||||||
int Input::wheelX() { return p->mouseWheelState.wheelX; }
|
float Input::wheelX() { return p->mouseWheelState.wheelX; }
|
||||||
int Input::wheelY() { return p->mouseWheelState.wheelY; }
|
float Input::wheelY() { return p->mouseWheelState.wheelY; }
|
||||||
bool Input::wheelFlipped() { return p->mouseWheelState.wheelFlipped; }
|
bool Input::wheelFlipped() { return p->mouseWheelState.wheelFlipped; }
|
||||||
|
|
||||||
bool Input::hasQuit(){
|
bool Input::hasQuit(){
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ public:
|
||||||
int mouseY();
|
int mouseY();
|
||||||
|
|
||||||
// more non-standard extensions
|
// more non-standard extensions
|
||||||
int wheelX();
|
float wheelX();
|
||||||
int wheelY();
|
float wheelY();
|
||||||
bool wheelFlipped();
|
bool wheelFlipped();
|
||||||
|
|
||||||
bool hasQuit();
|
bool hasQuit();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue