fix for guitar hero

git-svn-id: http://wiiusej.googlecode.com/svn/trunk@190 ae48ae66-6a45-0410-b38e-211266189506
This commit is contained in:
guilhem.duche
2008-07-29 21:10:26 +00:00
parent 5b2e5b41c8
commit 3bb0b50c35
2 changed files with 9 additions and 9 deletions

View File

@@ -162,10 +162,10 @@ public class GuitarHero3ButtonsEventPanel extends javax.swing.JPanel implements
//blue button
if (buttons.isButtonBlueJustPressed()) {
blueButton.setSelected(true);
orangeButton.setText("X");
blueButton.setText("X");
} else if (buttons.isButtonBlueJustReleased()) {
blueButton.setSelected(false);
orangeButton.setText("O");
blueButton.setText("O");
}
//Yellow button

View File

@@ -99,7 +99,7 @@ public abstract class JoystickEventPanel extends javax.swing.JPanel implements
// compute coordinates
if (lastJoystickEvent != null) {
double xAng = Math.sin(lastJoystickEvent.getAngle() * Math.PI
double xAng = Math.sin(lastJoystickEvent.getAngle() * Math.PI
/ 180.0)
* lastJoystickEvent.getMagnitude();
double yAng = Math.cos(lastJoystickEvent.getAngle() * Math.PI
@@ -107,12 +107,12 @@ public abstract class JoystickEventPanel extends javax.swing.JPanel implements
* lastJoystickEvent.getMagnitude();
int halfWidth = (int) Math.round(shape.getBounds().getWidth() / 2);
int halHeight = (int) Math.round(shape.getBounds().getHeight() / 2);
int xAmplitude = (int)Math.round(xCenter-shape.getBounds().getWidth());
int yAmplitude = (int)Math.round(xCenter-shape.getBounds().getHeight());
int xShift = (int)Math.round(xAng * xAmplitude);
int yShift = (int)Math.round(yAng * yAmplitude);
int x = xCenter + xShift - halfWidth;
int y = yCenter - yShift - halHeight;
int xAmplitude = (int) Math.round(xCenter - shape.getBounds().getWidth());
int yAmplitude = (int) Math.round(xCenter - shape.getBounds().getHeight());
int xShift = (int) Math.round(xAng * xAmplitude);
int yShift = (int) Math.round(yAng * yAmplitude);
int x = xCenter + xShift - halfWidth;
int y = yCenter - yShift - halHeight;
// shape
g2.translate(x, y);
g2.setPaint(borderColor);