MCPcopy Create free account
hub / github.com/diasurgical/devilution / init_touch

Function init_touch

SourceX/controls/touch.cpp:66–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64static DraggingType multi_finger_dragging[TOUCH_PORT_MAX_NUM]; // keep track whether we are currently drag-and-dropping
65
66static void init_touch(void)
67{
68 for (int port = 0; port < TOUCH_PORT_MAX_NUM; port++) {
69 for (int i = 0; i < MAX_NUM_FINGERS; i++) {
70 finger[port][i].id = NO_TOUCH;
71 }
72 multi_finger_dragging[port] = DRAG_NONE;
73 }
74
75 for (int port = 0; port < TOUCH_PORT_MAX_NUM; port++) {
76 for (int i = 0; i < 2; i++) {
77 simulated_click_start_time[port][i] = 0;
78 }
79 }
80
81 SDL_DisplayMode current;
82 SDL_GetCurrentDisplayMode(0, &current);
83 visible_height = current.h;
84 visible_width = (current.h * SCREEN_WIDTH) / SCREEN_HEIGHT;
85 x_borderwidth = (current.w - visible_width) / 2;
86 y_borderwidth = (current.h - visible_height) / 2;
87}
88
89static void preprocess_events(SDL_Event *event)
90{

Callers 1

handle_touchFunction · 0.85

Calls 1

Tested by

no test coverage detected