Skip to content

Commit

Permalink
Update Kinc
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Dec 18, 2023
1 parent 6183792 commit ca3cbc7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Backends/Kinc-HL/kinc-bridge/system.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ void hl_kinc_system_load_url(vbyte *url) {
}

vbyte *hl_kinc_get_gamepad_id(int index) {
return (vbyte*)kinc_gamepad_product_name(index);
return (vbyte *)kinc_gamepad_product_name(index);
}

vbyte *hl_kinc_get_gamepad_vendor(int index) {
return (vbyte*)kinc_gamepad_vendor(index);
return (vbyte *)kinc_gamepad_vendor(index);
}

bool hl_kinc_gamepad_connected(int index) {
Expand Down Expand Up @@ -137,12 +137,12 @@ void hl_kinc_register_pen(vclosure *penDown, vclosure *penUp, vclosure *penMove)
kinc_pen_set_move_callback(*((FN_PEN_MOVE *)(&penMove->fun)));
}

typedef void (*FN_GAMEPAD_AXIS)(int, int, float);
typedef void (*FN_GAMEPAD_BUTTON)(int, int, float);
typedef void (*FN_GAMEPAD_AXIS)(int, int, float, void *);
typedef void (*FN_GAMEPAD_BUTTON)(int, int, float, void *);

void hl_kinc_register_gamepad(vclosure *gamepadAxis, vclosure *gamepadButton) {
kinc_gamepad_set_axis_callback(*((FN_GAMEPAD_AXIS *)(&gamepadAxis->fun)));
kinc_gamepad_set_button_callback(*((FN_GAMEPAD_BUTTON *)(&gamepadButton->fun)));
kinc_gamepad_set_axis_callback(*((FN_GAMEPAD_AXIS *)(&gamepadAxis->fun)), NULL);
kinc_gamepad_set_button_callback(*((FN_GAMEPAD_BUTTON *)(&gamepadButton->fun)), NULL);
}

typedef void (*FN_TOUCH_START)(int, int, int);
Expand Down
10 changes: 5 additions & 5 deletions Backends/Kinc-hxcpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <stdlib.h>

#ifdef ANDROID
//#include <Kore/Vr/VrInterface.h>
// #include <Kore/Vr/VrInterface.h>
#endif

namespace {
Expand Down Expand Up @@ -103,11 +103,11 @@ namespace {
Sensor_obj::_changed(1, x, y, z);
}

void gamepadAxis(int gamepad, int axis, float value) {
void gamepadAxis(int gamepad, int axis, float value, void *data) {
SystemImpl_obj::gamepadAxis(gamepad, axis, value);
}

void gamepadButton(int gamepad, int button, float value) {
void gamepadButton(int gamepad, int button, float value, void *data) {
SystemImpl_obj::gamepadButton(gamepad, button, value);
}

Expand Down Expand Up @@ -311,8 +311,8 @@ void init_kinc(const char *name, int width, int height, kinc_window_options_t *w
kinc_eraser_set_press_callback(penEraserDown);
kinc_eraser_set_release_callback(penEraserUp);
kinc_eraser_set_move_callback(penEraserMove);
kinc_gamepad_set_axis_callback(gamepadAxis);
kinc_gamepad_set_button_callback(gamepadButton);
kinc_gamepad_set_axis_callback(gamepadAxis, nullptr);
kinc_gamepad_set_button_callback(gamepadButton, nullptr);
kinc_surface_set_touch_start_callback(touchStart);
kinc_surface_set_touch_end_callback(touchEnd);
kinc_surface_set_move_callback(touchMove);
Expand Down

0 comments on commit ca3cbc7

Please sign in to comment.