6
6
import com .rolandoislas .drcsimclient .config .ConfigController ;
7
7
import com .rolandoislas .drcsimclient .config .ConfigControllerConfig ;
8
8
import com .rolandoislas .drcsimclient .data .Constants ;
9
- import com .rolandoislas .drcsimclient .net .Codec ;
10
9
import com .rolandoislas .drcsimclient .stage .StageControl ;
11
10
12
11
import static com .rolandoislas .drcsimclient .Client .sockets ;
@@ -24,7 +23,7 @@ public void init(StageControl stage) {
24
23
25
24
@ Override
26
25
public void update () {
27
- int buttonBits = 0 ;
26
+ short buttonBits = 0 ;
28
27
float [] axes = {0 , 0 , 0 , 0 };
29
28
for (Controller controller : Controllers .getControllers ()) {
30
29
ConfigControllerConfig config = this .config .get (controller .getName ());
@@ -65,12 +64,12 @@ public void update() {
65
64
buttonBits |= Constants .BUTTON_HOME ;
66
65
// Microphone
67
66
if (controller .getButton (config .micBlow ))
68
- sockets .sendCommand ( Constants . COMMAND_INPUT_MIC_BLOW , Codec . encodeInput ( true ) );
67
+ sockets .sendMicBlow ( );
69
68
// Check joystick
70
- axes [0 ] = controller .getAxis (config .joystickLeftX );
71
- axes [1 ] = controller .getAxis (config .joystickLeftY );
72
- axes [2 ] = controller .getAxis (config .joystickRightX );
73
- axes [3 ] = controller .getAxis (config .joystickRightY );
69
+ axes [0 ] = ( short ) controller .getAxis (config .joystickLeftX );
70
+ axes [1 ] = ( short ) controller .getAxis (config .joystickLeftY );
71
+ axes [2 ] = ( short ) controller .getAxis (config .joystickRightX );
72
+ axes [3 ] = ( short ) controller .getAxis (config .joystickRightY );
74
73
}
75
74
sockets .sendButtonInput (buttonBits );
76
75
sockets .sendJoystickInput (axes );
0 commit comments