exch-bms2/beatoraja

Skin: Height of LNStart/End would be calculated wrong

Opened this issue · 1 comments

sr8e commented

It seems that height of any note type other than normal note (e.g., LN start/end, mines, etc.) image is the same as normal note even if different value is specified.

Example:
Suppose that normal note and LN start/end image is defined as below:

skin.image={
  {id="note", src="note_src", x=0, y=0, w=30, h=10},
  {id="lnstart", src="note_src", x=0, y=15, w=30, h=20},
  {id="lnend", src="note_src", x=0, y=40, w=30, h=20},
}

then LN start/end should be rendered twice as long as normal note, but actually it is the same length.

sr8e commented

I just started working around this issue.

I found that heights of notes are the same regardless of their types, set to SkinLane.scale;

for (int lane = 0; lane < lanes.length; lane++) {
final float scale = lanes[lane].scale;
final Note note = tl.getNote(lane);
if (note != null) {
//4分のタイミングでノートを拡大する
float dstx = lanes[lane].region.x + offsetX;
float dsty = (float) y + offsetY - offsetH / 2;
float dstw = lanes[lane].region.width + offsetW;
float dsth = scale + offsetH;

and SkinLane.scale is set to height of normal note.

if(i < sk.note.size.length) {
scale[i] = sk.note.size[i] * dy;
} else {
scale[i] = ((SkinSourceImage)notes[i]).getImages()[0][0].getRegionHeight() * dy;
}

So we have to add other scale properties for other note types like scaleLnStart, scaleMine, etc... (or change scale to float[])

Anyway it might affect existing json skin if skin.note.size is specified in it.