Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
Conflicts:
	src/bms/player/beatoraja/play/LaneRenderer.java
  • Loading branch information
exch-bms2 committed Jul 23, 2016
2 parents 13901bc + db2eb81 commit b764bd6
Show file tree
Hide file tree
Showing 19 changed files with 334 additions and 229 deletions.
3 changes: 3 additions & 0 deletions src/bms/player/beatoraja/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ public void create() {

@Override
public void render() {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

final int time = current.getNowTime();
current.render();
sprite.begin();
Expand Down
8 changes: 8 additions & 0 deletions src/bms/player/beatoraja/MainState.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,18 @@ public String getTitle() {
return "";
}

public String getSubtitle() {
return "";
}

public String getArtist() {
return "";
}

public String getSubartist() {
return "";
}

public String getGenre() {
return "";
}
Expand Down
3 changes: 0 additions & 3 deletions src/bms/player/beatoraja/decide/MusicDecide.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ public void create(PlayerResource resource) {
public void render() {
SpriteBatch sprite = main.getSpriteBatch();
long nowtime = getNowTime();
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

final float w = main.RESOLUTION[resource.getConfig().getResolution()].width;
final float h = main.RESOLUTION[resource.getConfig().getResolution()].height;

Expand Down
6 changes: 3 additions & 3 deletions src/bms/player/beatoraja/decide/MusicDecideSkin.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ public MusicDecideSkin(Rectangle r) {
dw = r.width / 1280.0f;
dh = r.height / 720.0f;

SkinText genre = new SkinText("skin/VL-Gothic-Regular.ttf",0,20);
SkinText genre = new SkinText("skin/VL-Gothic-Regular.ttf",0,20, 2);
genre.setTextResourceAccessor(TextResourceAccessor.GENRE);
setDestination(genre, 0, 300, 420, 18, 18, 0, 255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0);
setDestination(genre, 3000, 380, 420, 18, 18, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.add(genre);
SkinText title = new SkinText("skin/VL-Gothic-Regular.ttf",0,24);
SkinText title = new SkinText("skin/VL-Gothic-Regular.ttf",0,24, 2);
title.setTextResourceAccessor(TextResourceAccessor.TITLE);
setDestination(title, 0, 340, 360, 18, 18, 0, 255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0);
this.add(title);
SkinText artist = new SkinText("skin/VL-Gothic-Regular.ttf",0,20);
SkinText artist = new SkinText("skin/VL-Gothic-Regular.ttf",0,20, 2);
artist.setTextResourceAccessor(TextResourceAccessor.ARTIST);
setDestination(artist, 0, 380, 300,18, 18, 0, 255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0);
setDestination(artist, 3000, 300, 300,18, 18, 0, 255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0);
Expand Down
34 changes: 18 additions & 16 deletions src/bms/player/beatoraja/play/BMSPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public class BMSPlayer extends MainState {
private PlaySkin skin;

private GrooveGauge gauge;

private long readytime;
/**
* プレイ開始時間。0の場合はプレイ開始前
*/
Expand Down Expand Up @@ -409,7 +411,7 @@ public void render() {
if (resource.mediaLoadFinished() && !input.startPressed()) {
bga.prepare();
state = STATE_READY;
starttime = System.currentTimeMillis();
readytime = System.currentTimeMillis();
Logger.getGlobal().info("STATE_READYに移行");
}
break;
Expand All @@ -421,7 +423,8 @@ public void render() {
systemfont.draw(sprite, "GET READY", skin.getLaneGroupRegion()[0].x + skin.getLaneGroupRegion()[0].width / 2 - 35,
skin.getLaneGroupRegion()[0].y + 200);
sprite.end();
if (time > 1000) {
final long rt = System.currentTimeMillis() - readytime;
if (rt > 1000) {
state = STATE_PLAY;
starttime = System.currentTimeMillis();
input.setStartTime(starttime);
Expand Down Expand Up @@ -513,7 +516,7 @@ public void render() {
Gdx.gl.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
shape.begin(ShapeType.Filled);
long l2 = System.currentTimeMillis() - finishtime;
shape.setColor(1, 1, 1, ((float) l2) / 5000f);
shape.setColor(1, 1, 1, ((float) l2) / 1000f);
shape.rect(0, 0, w, h);
shape.end();
Gdx.gl.glDisable(GL11.GL_BLEND);
Expand Down Expand Up @@ -650,9 +653,6 @@ private void renderMain(int time) {
final ShapeRenderer shape = main.getShapeRenderer();
final SpriteBatch sprite = main.getSpriteBatch();

Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

// グラフ描画
graphrender.drawGraph(skin, sprite, systemfont, shape, this.judge);

Expand All @@ -674,17 +674,19 @@ private void renderMain(int time) {
lanerender.drawLane(systemfont, time);

// BGA再生
Rectangle r = skin.getBGAregion();
shape.begin(ShapeType.Line);
shape.setColor(Color.WHITE);
shape.rect(r.x - 1, r.y - 1, r.width + 2, r.height + 2);
shape.end();
shape.begin(ShapeType.Filled);
shape.setColor(Color.BLACK);
shape.rect(r.x, r.y, r.width, r.height);
shape.end();
Rectangle[] region = skin.getBGAregion();
for(Rectangle r : region) {
shape.begin(ShapeType.Line);
shape.setColor(Color.GRAY);
shape.rect(r.x - 1, r.y - 1, r.width + 2, r.height + 2);
shape.end();
shape.begin(ShapeType.Filled);
shape.setColor(Color.BLACK);
shape.rect(r.x, r.y, r.width, r.height);
shape.end();
}

bga.drawBGA(sprite, r, state == STATE_PRELOAD ? -1 : time);
bga.drawBGA(sprite, region, state == STATE_PRELOAD || state == STATE_READY ? -1 : time);

// ゲージ描画
Rectangle gr = skin.getGaugeRegion();
Expand Down
154 changes: 71 additions & 83 deletions src/bms/player/beatoraja/play/LaneRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,13 @@ public float getLanecover() {
return lanecover;
}

public void setLanecover(float lanecover) {
this.lanecover = lanecover;
if (this.fixhispeed != Config.FIX_HISPEED_OFF) {
hispeed = (float) ((2400f / (basebpm / 100) / gvalue) * 0.6 * (1 - (enableLanecover ? lanecover : 0)));
}
}
public void setLanecover(float lanecover) {
lanecover = (lanecover < 0 ? 0 : (lanecover > 1 ? 1 : lanecover));
this.lanecover = lanecover;
if (this.fixhispeed != Config.FIX_HISPEED_OFF) {
hispeed = (float) ((2400f / (basebpm / 100) / gvalue) * 0.6 * (1 - (enableLanecover ? lanecover : 0)));
}
}

public void setEnableLanecover(boolean b) {
enableLanecover = b;
Expand Down Expand Up @@ -317,83 +318,70 @@ public void drawLane(BitmapFont font, long time) {
shape.end();
}

// 各種コントロール入力判定
// TODO ここで各種コントロール入力判定をやるべきではないかも
if (enableControl) {
BMSPlayerInputProcessor input = main.getBMSPlayerInputProcessor();
if (input.getCursorState()[0]) {
if (!cursorpressed) {
float f = lanecover;
f = f - 0.01f;
if (f < 0) {
f = 0;
}
this.setLanecover(f);
cursorpressed = true;
}
} else if (input.getCursorState()[1]) {
if (!cursorpressed) {
float f = lanecover;
f = f + 0.01f;
if (f > 1) {
f = 1;
}
this.setLanecover(f);
cursorpressed = true;
}
} else {
cursorpressed = false;
}
if (input.startPressed()) {
if (auto == 0) {
// change hi speed by START + Keys
boolean[] key = input.getKeystate();
if (key[0] || key[2] || key[4] || key[6]) {
if (!hschanged) {
changeHispeed(false);
hschanged = true;
}
} else if (key[1] || key[3] || key[5]) {
if (!hschanged) {
changeHispeed(true);
hschanged = true;
}
} else {
hschanged = false;
}

// move lane cover by START + Scratch
if (keystate[7] | keystate[8]) {
long l = System.currentTimeMillis();
if (l - lanecovertiming > 50) {
float f = lanecover;
f = f + (keystate[7] ? 0.001f : -0.001f);
if (f > 1) {
f = 1;
}
if (f < 0) {
f = 0;
}
this.setLanecover(f);
lanecovertiming = l;
}
}
}
// show-hide lane cover by double-press START
if (!startpressed) {
long stime = System.currentTimeMillis();
if (stime < startpressedtime + 500) {
setEnableLanecover(!isEnableLanecover());
startpressedtime = 0;
} else {
startpressedtime = stime;
}
}
startpressed = true;
} else {
startpressed = false;
}
}
// 各種コントロール入力判定
// TODO ここで各種コントロール入力判定をやるべきではないかも
if (enableControl) {
BMSPlayerInputProcessor input = main.getBMSPlayerInputProcessor();
if (input.getCursorState()[0]) {
if (!cursorpressed) {
this.setLanecover(lanecover - 0.01f);
cursorpressed = true;
}
} else if (input.getCursorState()[1]) {
if (!cursorpressed) {
this.setLanecover(lanecover + 0.01f);
cursorpressed = true;
}
} else {
cursorpressed = false;
}
// move lane cover by mouse wheel
if(input.getScroll() != 0) {
this.setLanecover(lanecover - input.getScroll() * 0.005f);
input.resetScroll();
}
if (input.startPressed()) {
if (auto == 0) {
// change hi speed by START + Keys
boolean[] key = input.getKeystate();
if (key[0] || key[2] || key[4] || key[6]) {
if (!hschanged) {
changeHispeed(false);
hschanged = true;
}
} else if (key[1] || key[3] || key[5]) {
if (!hschanged) {
changeHispeed(true);
hschanged = true;
}
} else {
hschanged = false;
}

// move lane cover by START + Scratch
if (keystate[7] | keystate[8]) {
long l = System.currentTimeMillis();
if (l - lanecovertiming > 50) {
this.setLanecover(lanecover+ (keystate[7] ? 0.001f : -0.001f));
lanecovertiming = l;
}
}
}
// show-hide lane cover by double-press START
if (!startpressed) {
long stime = System.currentTimeMillis();
if (stime < startpressedtime + 500) {
setEnableLanecover(!isEnableLanecover());
startpressedtime = 0;
} else {
startpressedtime = stime;
}
}
startpressed = true;
} else {
startpressed = false;
}
}

float y = hl;

Expand Down
Loading

0 comments on commit b764bd6

Please sign in to comment.