mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-04-26 00:32:20 -05:00
Document ov19_021D6104 as TouchDial (#602)
This commit is contained in:
parent
9aceece59b
commit
dcb700201b
|
|
@ -1,10 +0,0 @@
|
|||
#ifndef POKEPLATINUM_OV19_021D603C_H
|
||||
#define POKEPLATINUM_OV19_021D603C_H
|
||||
|
||||
#include "overlay019/struct_ov19_021D6104.h"
|
||||
|
||||
void ov19_021D603C(UnkStruct_ov19_021D6104 *param0, int param1, int param2, int param3, int param4);
|
||||
int ov19_021D60A8(UnkStruct_ov19_021D6104 *param0);
|
||||
int ov19_021D614C(const UnkStruct_ov19_021D6104 *param0);
|
||||
|
||||
#endif // POKEPLATINUM_OV19_021D603C_H
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV19_021D6104_H
|
||||
#define POKEPLATINUM_STRUCT_OV19_021D6104_H
|
||||
|
||||
#include "touch_screen.h"
|
||||
|
||||
typedef struct UnkStruct_ov19_021D6104_t {
|
||||
u32 unk_00;
|
||||
u32 unk_04;
|
||||
u32 unk_08;
|
||||
u32 unk_0C;
|
||||
u32 unk_10;
|
||||
u32 unk_14;
|
||||
u32 unk_18;
|
||||
BOOL unk_1C;
|
||||
u16 unk_20;
|
||||
u8 padding_22[2];
|
||||
int unk_24;
|
||||
TouchScreenHitTable unk_28;
|
||||
TouchScreenHitTable unk_2C;
|
||||
int (*unk_30)(struct UnkStruct_ov19_021D6104_t *, BOOL, BOOL);
|
||||
} UnkStruct_ov19_021D6104;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV19_021D6104_H
|
||||
34
include/overlay019/touch_dial.h
Normal file
34
include/overlay019/touch_dial.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef POKEPLATINUM_TOUCH_DIAL_H
|
||||
#define POKEPLATINUM_TOUCH_DIAL_H
|
||||
|
||||
#include "touch_screen.h"
|
||||
|
||||
typedef struct TouchDial {
|
||||
u32 unused; // always 0, never read from
|
||||
u32 initialTouchX;
|
||||
u32 initialTouchY;
|
||||
u32 circleX;
|
||||
u32 circleY;
|
||||
u32 currentTouchX;
|
||||
u32 currentTouchY;
|
||||
BOOL touchInBounds;
|
||||
u16 initialTouchAngle;
|
||||
u8 padding_22[2];
|
||||
int buttonDirection;
|
||||
TouchScreenHitTable innerCircle;
|
||||
TouchScreenHitTable outerCircle;
|
||||
int (*action)(struct TouchDial *, BOOL, BOOL);
|
||||
} TouchDial;
|
||||
|
||||
enum TouchDialState {
|
||||
TOUCH_DIAL_NO_TOUCH,
|
||||
TOUCH_DIAL_INITIAL_TOUCH,
|
||||
TOUCH_DIAL_SCROLLING,
|
||||
TOUCH_DIAL_END_SCROLL
|
||||
};
|
||||
|
||||
void TouchDial_Init(TouchDial *touchDial, int circleX, int circleY, int innerRadius, int outerRadius);
|
||||
int TouchDial_HandleAction(TouchDial *touchDial);
|
||||
int TouchDial_CalcScrollAmount(const TouchDial *touchDial);
|
||||
|
||||
#endif // POKEPLATINUM_TOUCH_DIAL_H
|
||||
|
|
@ -749,7 +749,7 @@ Overlay overlay19
|
|||
{
|
||||
After main
|
||||
Object main.nef.p/src_overlay019_ov19_021D0D80.c.o
|
||||
Object main.nef.p/src_overlay019_ov19_021D603C.c.o
|
||||
Object main.nef.p/src_overlay019_touch_dial.c.o
|
||||
Object main.nef.p/src_overlay019_ov19_021D61B0.c.o
|
||||
Object main.nef.p/src_overlay019_ov19_021D79F8.c.o
|
||||
Object main.nef.p/src_overlay019_ov19_021D8B54.c.o
|
||||
|
|
|
|||
|
|
@ -569,7 +569,7 @@ pokeplatinum_c = files(
|
|||
'overlay017/ov17_02252CEC.c',
|
||||
'overlay018/ov18_0221F800.c',
|
||||
'overlay019/ov19_021D0D80.c',
|
||||
'overlay019/ov19_021D603C.c',
|
||||
'overlay019/touch_dial.c',
|
||||
'overlay019/ov19_021D61B0.c',
|
||||
'overlay019/ov19_021D79F8.c',
|
||||
'overlay019/ov19_021D8B54.c',
|
||||
|
|
|
|||
|
|
@ -18,15 +18,14 @@
|
|||
#include "overlay019/box_menu.h"
|
||||
#include "overlay019/box_mon_selection.h"
|
||||
#include "overlay019/box_settings.h"
|
||||
#include "overlay019/ov19_021D603C.h"
|
||||
#include "overlay019/ov19_021D61B0.h"
|
||||
#include "overlay019/pc_compare_mon.h"
|
||||
#include "overlay019/pc_mon_preview.h"
|
||||
#include "overlay019/struct_ov19_021D4DF0.h"
|
||||
#include "overlay019/struct_ov19_021D4EE4.h"
|
||||
#include "overlay019/struct_ov19_021D4F34.h"
|
||||
#include "overlay019/struct_ov19_021D6104.h"
|
||||
#include "overlay019/struct_ov19_021D61B0_decl.h"
|
||||
#include "overlay019/touch_dial.h"
|
||||
#include "overlay084/const_ov84_02241130.h"
|
||||
#include "savedata/save_table.h"
|
||||
|
||||
|
|
@ -157,7 +156,7 @@ typedef struct UnkStruct_ov19_021D5DF8_t {
|
|||
};
|
||||
BoxSelectorPopup boxSelector;
|
||||
u32 unk_1C4;
|
||||
UnkStruct_ov19_021D6104 unk_1C8;
|
||||
TouchDial touchDial;
|
||||
int unk_1FC;
|
||||
u32 unk_200;
|
||||
BOOL unk_204;
|
||||
|
|
@ -3084,7 +3083,7 @@ static void ov19_021D4640(UnkStruct_ov19_021D5DF8 *param0, u32 *param1)
|
|||
ov19_021D5D94(¶m0->unk_00, 1);
|
||||
ov19_021D5D9C(&(param0->unk_00), ov19_GetCurrentBox(¶m0->unk_00));
|
||||
ov19_BoxTaskHandler(param0->unk_114, FUNC_ov19_021D7278);
|
||||
ov19_021D603C(&(param0->unk_1C8), 0, 192, 56, 88);
|
||||
TouchDial_Init(&(param0->touchDial), 0, 192, 56, 88);
|
||||
param0->unk_204 = 0;
|
||||
param0->unk_208 = 1;
|
||||
(*param1) = 1;
|
||||
|
|
@ -3136,17 +3135,17 @@ static void ov19_021D4640(UnkStruct_ov19_021D5DF8 *param0, u32 *param1)
|
|||
}
|
||||
}
|
||||
|
||||
switch (ov19_021D60A8(¶m0->unk_1C8)) {
|
||||
case 1:
|
||||
switch (TouchDial_HandleAction(¶m0->touchDial)) {
|
||||
case TOUCH_DIAL_INITIAL_TOUCH:
|
||||
param0->unk_1FC = ov19_021D5EB8(¶m0->unk_00);
|
||||
param0->unk_204 = 0;
|
||||
param0->unk_20C = 0;
|
||||
param0->unk_208 = 0;
|
||||
break;
|
||||
case 2: {
|
||||
case TOUCH_DIAL_SCROLLING: {
|
||||
int v1;
|
||||
|
||||
v1 = ov19_021D614C(¶m0->unk_1C8);
|
||||
v1 = TouchDial_CalcScrollAmount(¶m0->touchDial);
|
||||
|
||||
if (v1 != param0->unk_20C) {
|
||||
int v2, v3;
|
||||
|
|
@ -3168,7 +3167,7 @@ static void ov19_021D4640(UnkStruct_ov19_021D5DF8 *param0, u32 *param1)
|
|||
(*param1) = 2;
|
||||
}
|
||||
} break;
|
||||
case 3: {
|
||||
case TOUCH_DIAL_END_SCROLL: {
|
||||
int v4, v5;
|
||||
|
||||
v4 = ov19_GetCurrentBox(¶m0->unk_00);
|
||||
|
|
@ -3182,7 +3181,7 @@ static void ov19_021D4640(UnkStruct_ov19_021D5DF8 *param0, u32 *param1)
|
|||
break;
|
||||
case 2:
|
||||
if (param0->unk_208 == 0) {
|
||||
if (ov19_021D60A8(¶m0->unk_1C8) == 3) {
|
||||
if (TouchDial_HandleAction(¶m0->touchDial) == TOUCH_DIAL_END_SCROLL) {
|
||||
int v6, v7;
|
||||
|
||||
v6 = ov19_GetCurrentBox(¶m0->unk_00);
|
||||
|
|
@ -3230,7 +3229,7 @@ static void ov19_021D4938(UnkStruct_ov19_021D5DF8 *param0, u32 *param1)
|
|||
ov19_SetMarkingsButtonsScrollOffset(&(param0->unk_00), 0);
|
||||
ov19_021D5D9C(&(param0->unk_00), 0);
|
||||
ov19_BoxTaskHandler(param0->unk_114, FUNC_ov19_021D7278);
|
||||
ov19_021D603C(&(param0->unk_1C8), 255, 192, 56, 88);
|
||||
TouchDial_Init(&(param0->touchDial), 255, 192, 56, 88);
|
||||
param0->unk_204 = 0;
|
||||
param0->unk_208 = 1;
|
||||
(*param1) = 1;
|
||||
|
|
@ -3261,17 +3260,17 @@ static void ov19_021D4938(UnkStruct_ov19_021D5DF8 *param0, u32 *param1)
|
|||
break;
|
||||
}
|
||||
|
||||
switch (ov19_021D60A8(¶m0->unk_1C8)) {
|
||||
case 1:
|
||||
switch (TouchDial_HandleAction(¶m0->touchDial)) {
|
||||
case TOUCH_DIAL_INITIAL_TOUCH:
|
||||
param0->unk_1FC = ov19_021D5EB8(¶m0->unk_00);
|
||||
param0->unk_204 = 0;
|
||||
param0->unk_20C = 0;
|
||||
param0->unk_208 = 0;
|
||||
break;
|
||||
case 2: {
|
||||
case TOUCH_DIAL_SCROLLING: {
|
||||
int v0;
|
||||
|
||||
v0 = ov19_021D614C(¶m0->unk_1C8);
|
||||
v0 = TouchDial_CalcScrollAmount(¶m0->touchDial);
|
||||
|
||||
if (v0 != param0->unk_20C) {
|
||||
int v1, offset;
|
||||
|
|
@ -3295,7 +3294,7 @@ static void ov19_021D4938(UnkStruct_ov19_021D5DF8 *param0, u32 *param1)
|
|||
(*param1) = 2;
|
||||
}
|
||||
} break;
|
||||
case 3: {
|
||||
case TOUCH_DIAL_END_SCROLL: {
|
||||
int v3, v4;
|
||||
|
||||
v3 = ov19_GetCurrentBox(¶m0->unk_00);
|
||||
|
|
@ -3309,7 +3308,7 @@ static void ov19_021D4938(UnkStruct_ov19_021D5DF8 *param0, u32 *param1)
|
|||
break;
|
||||
case 2:
|
||||
if (param0->unk_208 == 0) {
|
||||
if (ov19_021D60A8(¶m0->unk_1C8) == 3) {
|
||||
if (TouchDial_HandleAction(¶m0->touchDial) == TOUCH_DIAL_END_SCROLL) {
|
||||
int v5, v6;
|
||||
|
||||
v5 = ov19_GetCurrentBox(¶m0->unk_00);
|
||||
|
|
|
|||
|
|
@ -1,139 +0,0 @@
|
|||
#include "overlay019/ov19_021D603C.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "overlay019/struct_ov19_021D6104.h"
|
||||
|
||||
#include "touch_screen.h"
|
||||
|
||||
static void ov19_021D60FC(UnkStruct_ov19_021D6104 *param0, int (*func)(UnkStruct_ov19_021D6104 *, BOOL, BOOL));
|
||||
static int ov19_021D6104(UnkStruct_ov19_021D6104 *param0, BOOL param1, BOOL param2);
|
||||
static int ov19_021D6134(UnkStruct_ov19_021D6104 *param0, BOOL param1, BOOL param2);
|
||||
static u16 ov19_021D6164(const UnkStruct_ov19_021D6104 *param0, u32 param1, u32 param2);
|
||||
static int ov19_021D617C(const UnkStruct_ov19_021D6104 *param0, u16 param1, u16 param2);
|
||||
|
||||
void ov19_021D603C(UnkStruct_ov19_021D6104 *param0, int param1, int param2, int param3, int param4)
|
||||
{
|
||||
param0->unk_30 = ov19_021D6104;
|
||||
param0->unk_1C = 0;
|
||||
param0->unk_0C = param1;
|
||||
param0->unk_10 = param2;
|
||||
param0->unk_14 = param1;
|
||||
param0->unk_18 = param2;
|
||||
param0->unk_04 = param1;
|
||||
param0->unk_08 = param2;
|
||||
param0->unk_28.circle.code = TOUCHSCREEN_USE_CIRCLE;
|
||||
param0->unk_28.circle.x = param1;
|
||||
param0->unk_28.circle.y = param2;
|
||||
param0->unk_28.circle.r = param3;
|
||||
param0->unk_2C.circle.code = TOUCHSCREEN_USE_CIRCLE;
|
||||
param0->unk_2C.circle.x = param1;
|
||||
param0->unk_2C.circle.y = param2;
|
||||
param0->unk_2C.circle.r = param4;
|
||||
|
||||
if (param1 < 128) {
|
||||
param0->unk_24 = 1;
|
||||
} else {
|
||||
param0->unk_24 = -1;
|
||||
}
|
||||
}
|
||||
|
||||
int ov19_021D60A8(UnkStruct_ov19_021D6104 *param0)
|
||||
{
|
||||
BOOL v0, v1;
|
||||
|
||||
if ((TouchScreen_LocationHeld(¶m0->unk_2C) == 1) && (TouchScreen_LocationHeld(¶m0->unk_28) == 0)) {
|
||||
u32 v2, v3;
|
||||
|
||||
v0 = 1;
|
||||
v1 = (param0->unk_1C == 0);
|
||||
|
||||
if (TouchScreen_GetHoldState(&v2, &v3)) {
|
||||
param0->unk_14 = v2;
|
||||
param0->unk_18 = v3;
|
||||
}
|
||||
} else {
|
||||
v0 = 0;
|
||||
v1 = 0;
|
||||
}
|
||||
|
||||
param0->unk_1C = v0;
|
||||
return param0->unk_30(param0, v0, v1);
|
||||
}
|
||||
|
||||
static void ov19_021D60FC(UnkStruct_ov19_021D6104 *param0, int (*func)(UnkStruct_ov19_021D6104 *, BOOL, BOOL))
|
||||
{
|
||||
param0->unk_00 = 0;
|
||||
param0->unk_30 = func;
|
||||
}
|
||||
|
||||
static int ov19_021D6104(UnkStruct_ov19_021D6104 *param0, BOOL param1, BOOL param2)
|
||||
{
|
||||
if (param1 && param2) {
|
||||
param0->unk_04 = param0->unk_14;
|
||||
param0->unk_08 = param0->unk_18;
|
||||
param0->unk_20 = ov19_021D6164(param0, param0->unk_04, param0->unk_08);
|
||||
ov19_021D60FC(param0, ov19_021D6134);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ov19_021D6134(UnkStruct_ov19_021D6104 *param0, BOOL param1, BOOL param2)
|
||||
{
|
||||
if (param1 == 0) {
|
||||
ov19_021D60FC(param0, ov19_021D6104);
|
||||
return 3;
|
||||
}
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
int ov19_021D614C(const UnkStruct_ov19_021D6104 *param0)
|
||||
{
|
||||
int v0;
|
||||
u16 v1 = ov19_021D6164(param0, param0->unk_14, param0->unk_18);
|
||||
v0 = ov19_021D617C(param0, param0->unk_20, v1);
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
static u16 ov19_021D6164(const UnkStruct_ov19_021D6104 *param0, u32 param1, u32 param2)
|
||||
{
|
||||
fx32 v0, v1;
|
||||
|
||||
v0 = ((int)(param1 - param0->unk_0C)) << FX32_SHIFT;
|
||||
v1 = ((int)(param2 - param0->unk_10)) << FX32_SHIFT;
|
||||
|
||||
return FX_Atan2Idx(v1, v0);
|
||||
}
|
||||
|
||||
static int ov19_021D617C(const UnkStruct_ov19_021D6104 *param0, u16 param1, u16 param2)
|
||||
{
|
||||
static const u16 v0[] = {
|
||||
0x300,
|
||||
0x1800,
|
||||
};
|
||||
int v1, v2, v3, v4;
|
||||
|
||||
v1 = param2 - param1;
|
||||
|
||||
if (v1 < 0) {
|
||||
v3 = -1;
|
||||
v1 *= -1;
|
||||
} else {
|
||||
v3 = 1;
|
||||
}
|
||||
|
||||
for (v2 = 0; v2 < NELEMS(v0); v2++) {
|
||||
if (v1 < v0[v2]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
v2 = v2 * v3 * param0->unk_24;
|
||||
|
||||
return v2;
|
||||
}
|
||||
131
src/overlay019/touch_dial.c
Normal file
131
src/overlay019/touch_dial.c
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
#include "overlay019/touch_dial.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "touch_screen.h"
|
||||
|
||||
static void TouchDial_RegisterAction(TouchDial *touchDial, int (*func)(TouchDial *, BOOL, BOOL));
|
||||
static int TouchDial_TrySetInitialTouchAction(TouchDial *touchDial, BOOL touchInBounds, BOOL param2);
|
||||
static int TouchDial_CheckForNewScrollAction(TouchDial *touchDial, BOOL touchInBounds, BOOL param2);
|
||||
static u16 TouchDial_GetTouchAngle(const TouchDial *touchDial, u32 x, u32 y);
|
||||
static int TouchDial_CalcScrollAmountFromAngle(const TouchDial *touchDial, u16 initialAngle, u16 currentAngle);
|
||||
|
||||
void TouchDial_Init(TouchDial *touchDial, int circleX, int circleY, int innerRadius, int outerRadius)
|
||||
{
|
||||
touchDial->action = TouchDial_TrySetInitialTouchAction;
|
||||
touchDial->touchInBounds = FALSE;
|
||||
touchDial->circleX = circleX;
|
||||
touchDial->circleY = circleY;
|
||||
touchDial->currentTouchX = circleX;
|
||||
touchDial->currentTouchY = circleY;
|
||||
touchDial->initialTouchX = circleX;
|
||||
touchDial->initialTouchY = circleY;
|
||||
touchDial->innerCircle.circle.code = TOUCHSCREEN_USE_CIRCLE;
|
||||
touchDial->innerCircle.circle.x = circleX;
|
||||
touchDial->innerCircle.circle.y = circleY;
|
||||
touchDial->innerCircle.circle.r = innerRadius;
|
||||
touchDial->outerCircle.circle.code = TOUCHSCREEN_USE_CIRCLE;
|
||||
touchDial->outerCircle.circle.x = circleX;
|
||||
touchDial->outerCircle.circle.y = circleY;
|
||||
touchDial->outerCircle.circle.r = outerRadius;
|
||||
|
||||
if (circleX < 128) {
|
||||
touchDial->buttonDirection = 1;
|
||||
} else {
|
||||
touchDial->buttonDirection = -1;
|
||||
}
|
||||
}
|
||||
|
||||
int TouchDial_HandleAction(TouchDial *touchDial)
|
||||
{
|
||||
BOOL touchInBounds, previousTouchInBounds;
|
||||
|
||||
if (TouchScreen_LocationHeld(&touchDial->outerCircle) == TRUE && TouchScreen_LocationHeld(&touchDial->innerCircle) == FALSE) {
|
||||
u32 x, y;
|
||||
|
||||
touchInBounds = TRUE;
|
||||
previousTouchInBounds = !touchDial->touchInBounds;
|
||||
|
||||
if (TouchScreen_GetHoldState(&x, &y)) {
|
||||
touchDial->currentTouchX = x;
|
||||
touchDial->currentTouchY = y;
|
||||
}
|
||||
} else {
|
||||
touchInBounds = FALSE;
|
||||
previousTouchInBounds = FALSE;
|
||||
}
|
||||
|
||||
touchDial->touchInBounds = touchInBounds;
|
||||
return touchDial->action(touchDial, touchInBounds, previousTouchInBounds);
|
||||
}
|
||||
|
||||
static void TouchDial_RegisterAction(TouchDial *touchDial, int (*action)(TouchDial *, BOOL, BOOL))
|
||||
{
|
||||
touchDial->unused = 0;
|
||||
touchDial->action = action;
|
||||
}
|
||||
|
||||
static int TouchDial_TrySetInitialTouchAction(TouchDial *touchDial, BOOL touchInBounds, BOOL previousTouchInBounds)
|
||||
{
|
||||
if (touchInBounds && previousTouchInBounds) {
|
||||
touchDial->initialTouchX = touchDial->currentTouchX;
|
||||
touchDial->initialTouchY = touchDial->currentTouchY;
|
||||
touchDial->initialTouchAngle = TouchDial_GetTouchAngle(touchDial, touchDial->initialTouchX, touchDial->initialTouchY);
|
||||
TouchDial_RegisterAction(touchDial, TouchDial_CheckForNewScrollAction);
|
||||
return TOUCH_DIAL_INITIAL_TOUCH;
|
||||
}
|
||||
|
||||
return TOUCH_DIAL_NO_TOUCH;
|
||||
}
|
||||
|
||||
static int TouchDial_CheckForNewScrollAction(TouchDial *touchDial, BOOL touchInBounds, BOOL previousTouchInBounds)
|
||||
{
|
||||
if (touchInBounds == FALSE) {
|
||||
TouchDial_RegisterAction(touchDial, TouchDial_TrySetInitialTouchAction);
|
||||
return TOUCH_DIAL_END_SCROLL;
|
||||
}
|
||||
|
||||
return TOUCH_DIAL_SCROLLING;
|
||||
}
|
||||
|
||||
int TouchDial_CalcScrollAmount(const TouchDial *touchDial)
|
||||
{
|
||||
u16 currentAngle = TouchDial_GetTouchAngle(touchDial, touchDial->currentTouchX, touchDial->currentTouchY);
|
||||
return TouchDial_CalcScrollAmountFromAngle(touchDial, touchDial->initialTouchAngle, currentAngle);
|
||||
}
|
||||
|
||||
static u16 TouchDial_GetTouchAngle(const TouchDial *touchDial, u32 x, u32 y)
|
||||
{
|
||||
fx32 relativeX = (int)(x - touchDial->circleX) << FX32_SHIFT;
|
||||
fx32 relativeY = (int)(y - touchDial->circleY) << FX32_SHIFT;
|
||||
|
||||
return FX_Atan2Idx(relativeY, relativeX);
|
||||
}
|
||||
|
||||
static int TouchDial_CalcScrollAmountFromAngle(const TouchDial *touchDial, u16 initialAngle, u16 currentAngle)
|
||||
{
|
||||
static const u16 angleBreakpoints[] = {
|
||||
FX_DEG_TO_IDX(FX32_CONST(4.219)),
|
||||
FX_DEG_TO_IDX(FX32_CONST(33.75)),
|
||||
};
|
||||
int angleChange, i;
|
||||
|
||||
angleChange = currentAngle - initialAngle;
|
||||
|
||||
int angleChangeDirection;
|
||||
if (angleChange < 0) {
|
||||
angleChangeDirection = -1;
|
||||
angleChange *= -1;
|
||||
} else {
|
||||
angleChangeDirection = 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < NELEMS(angleBreakpoints); i++) {
|
||||
if (angleChange < angleBreakpoints[i]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return i * angleChangeDirection * touchDial->buttonDirection;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user