Skip to content

Commit

Permalink
Remove redundant whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Chazoshtare committed Jun 25, 2022
1 parent 2f684d6 commit 7af5826
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
6 changes: 3 additions & 3 deletions src/bms/player/beatoraja/config/KeyConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void render() {
if (input.isControlKeyPressed(ControlKeys.NUM1)) {
config.setMusicselectinput((config.getMusicselectinput() + 1) % 3);
}
// change contronnler device 1
// change controller device 1
if (input.isControlKeyPressed(ControlKeys.NUM2)) {
if (controllers.length > 0) {
int index = 0;
Expand All @@ -187,7 +187,7 @@ public void render() {
pc.setController(pc.getController());
}
}
// change contronnler device 2
// change controller device 2
if (input.isControlKeyPressed(ControlKeys.NUM3)) {
if (controllers.length > 0 && pc.getController().length > 1) {
int index = 0;
Expand Down Expand Up @@ -292,7 +292,7 @@ public void render() {
sprite.begin();
titlefont.setColor(Color.WHITE);
titlefont.draw(sprite, keys[i], 50 * scaleX, (y + 22) * scaleY);
titlefont.draw(sprite, getMouseScratchKeyString(keysa[i], getKeyboardKeyAssign(keysa[i]) != -1 ?
titlefont.draw(sprite, getMouseScratchKeyString(keysa[i], getKeyboardKeyAssign(keysa[i]) != -1 ?
Keys.toString(getKeyboardKeyAssign(keysa[i])) : "----"), 202 * scaleX, (y + 22) * scaleY);
titlefont.draw(sprite, getControllerKeyAssign(0, keysa[i]) != -1
? BMControllerInputProcessor.BMKeys.toString(getControllerKeyAssign(0, keysa[i])) : "----",
Expand Down
62 changes: 31 additions & 31 deletions src/bms/player/beatoraja/input/BMSPlayerInputProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
* @author exch
*/
public class BMSPlayerInputProcessor {

private boolean enable = true;

private KeyBoardInputProcesseor kbinput;

private BMControllerInputProcessor[] bminput;

private MidiInputProcessor midiinput;

private KeyLogger keylog = new KeyLogger();

public BMSPlayerInputProcessor(Config config, PlayerConfig player) {
Expand Down Expand Up @@ -74,7 +74,7 @@ public BMSPlayerInputProcessor(Config config, PlayerConfig player) {
devices.add(bm);
}
devices.add(midiinput);

this.analogScroll = config.isAnalogScroll();
}

Expand Down Expand Up @@ -164,7 +164,7 @@ public void setStartTime(long starttime) {
}
midiinput.setStartTime(starttime);
}

public void setKeyLogMarginTime(long milliMarginTime) {
microMarginTime = milliMarginTime * 1000;
}
Expand All @@ -181,7 +181,7 @@ public long getStartTime() {
public boolean getKeyState(int id) {
return id >= 0 && id < keystate.length ? keystate[id] : false;
}

/**
* 指定のキーIDのキー状態を設定する
* @param id キーID
Expand All @@ -194,14 +194,14 @@ public void setKeyState(int id, boolean pressed, long time) {
this.time[id] = time;
}
}

/**
* 指定のキーIDのキー状態変更時間を返す
* @param id キーID
* @return キー状態の変更時間。変更されていない場合はLong.MIN_VALUE
*/
public long getKeyChangedTime(int id) {
return id >= 0 && id < time.length ? time[id] : Long.MIN_VALUE;
return id >= 0 && id < time.length ? time[id] : Long.MIN_VALUE;
}

/**
Expand All @@ -217,7 +217,7 @@ public boolean resetKeyChangedTime(int id) {
}
return false;
}

/**
* 全てのキー状態をリセットする
*/
Expand Down Expand Up @@ -249,16 +249,16 @@ public void setPlayConfig(PlayModeConfig playconfig) {
keystate[i] = false;
time[i] = Long.MIN_VALUE;
}

int kbcount = setPlayConfig0(kbkeys, exclusive);

int[][] cokeys = new int[playconfig.getController().length][];
int cocount = 0;
for(int i = 0;i < cokeys.length;i++) {
cokeys[i] = playconfig.getController()[i].getKeyAssign();
cocount += setPlayConfig0(cokeys[i], exclusive);
}

MidiConfig.Input[] mikeys = playconfig.getMidiConfig().getKeys();
int micount = 0;
for(int i = 0;i < mikeys.length;i++) {
Expand All @@ -269,7 +269,7 @@ public void setPlayConfig(PlayModeConfig playconfig) {
micount++;
}
}

// 各デバイスにキーコンフィグをセット
kbinput.setConfig(playconfig.getKeyboardConfig());
for(int i = 0;i < bminput.length;i++) {
Expand All @@ -281,20 +281,20 @@ public void setPlayConfig(PlayModeConfig playconfig) {
}
}
midiinput.setConfig(playconfig.getMidiConfig());

if(kbcount >= cocount && kbcount >= micount) {
type = Type.KEYBOARD;
} else if(cocount >= kbcount && cocount >= micount) {
type = Type.BM_CONTROLLER;
} else {
type = Type.MIDI;
type = Type.MIDI;
}
}

public BMSPlayerInputDevice.Type getDeviceType() {
return type;
}

private int setPlayConfig0(int[] keys, boolean[] exclusive) {
int count = 0;
for(int i = 0;i < keys.length;i++) {
Expand All @@ -307,7 +307,7 @@ private int setPlayConfig0(int[] keys, boolean[] exclusive) {
}
return count;
}

public void setEnable(boolean enable) {
this.enable = enable;
if(!enable) {
Expand All @@ -317,7 +317,7 @@ public void setEnable(boolean enable) {
}
}
}

public boolean getControlKeyState(ControlKeys key) {
return kbinput.getKeyState(key.keycode);
}
Expand All @@ -329,7 +329,7 @@ public boolean isControlKeyPressed(ControlKeys key) {
public boolean isControlKeyPressed(ControlKeys key, int heldModifiers, int... notHeldModifiers) {
return kbinput.isKeyPressed(key.keycode, heldModifiers, notHeldModifiers);
}

protected void keyChanged(BMSPlayerInputDevice device, long presstime, int i, boolean pressed) {
if (!enable) {
return;
Expand Down Expand Up @@ -429,7 +429,7 @@ public boolean isActivated(KeyCommand key) {
}
return false;
}

public boolean isSelectPressed() {
return selectPressed;
}
Expand Down Expand Up @@ -513,18 +513,18 @@ public void poll() {
public void dispose() {
midiinput.close();
}

/**
* キーロガー
*
*
* @author exch
*/
private static class KeyLogger {

public static final int INITIAL_LOG_COUNT = 10000;

private final Array<KeyInputLog> keylog;

private final KeyInputLog[] logpool;
private int poolindex;

Expand All @@ -533,10 +533,10 @@ public KeyLogger() {
logpool = new KeyInputLog[INITIAL_LOG_COUNT];
clear();
}

/**
* キー入力ログを追加する
*
*
* @param presstime キー入力時間(us)
* @param keycode キーコード
* @param pressed 押されたかどうか
Expand All @@ -549,7 +549,7 @@ public void add(long presstime, int keycode, boolean pressed) {
log.pressed = pressed;
keylog.add(log);
}

/**
* キーログをクリアする
*/
Expand All @@ -559,13 +559,13 @@ public void clear() {
logpool[i] = new KeyInputLog();
}
}

/**
*
*
* @return
*/
public KeyInputLog[] toArray() {
return keylog.toArray(KeyInputLog.class);
}
}
}
}
2 changes: 1 addition & 1 deletion src/bms/player/beatoraja/play/BMSPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ public ScoreData createScoreData() {

score.setPassnotes(notes);
score.setMinbp(score.getEbd() + score.getLbd() + score.getEpr() + score.getLpr() + score.getEms() + score.getLms() + resource.getSongdata().getNotes() - notes);

long count = 0;
long avgduration = 0;
final int lanes = model.getMode().key;
Expand Down

0 comments on commit 7af5826

Please sign in to comment.