correct some integer parsing together for little score and big score (#7)

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 2 years ago
parent e68dee75f3
commit 64e7841139
  1. 16
      ArcadeReader.java
  2. 2
      readers/PopnReader.java
  3. 11
      readers/Reader.java
  4. 16
      readers/SoundVoltexReader.java
  5. 3
      readers/fonts/Font.java
  6. 22
      readers/fonts/sdvx_EXScore
  7. BIN
      result.png
  8. 12
      sigPlace.java
  9. BIN
      sub.png
  10. BIN
      test.png

@ -589,11 +589,11 @@ public class ArcadeReader {
test("sdvx1.png",SoundVoltexReader.class,
3019559/*score*/,
SDVX_D/*rank*/,
new int[]{13,59,31,495,34,56,502}/*notes*/,
new int[]{13,59,31,495,34,56,582}/*notes*/,
0/*difficulty*/,
0.0/*pct*/,
233/*maxcombo*/,
"{failed:false}"/*other*/);
"{ex:1696,chip_scritical:72,chip_critical:65,chip_near:115,chip_error:240,long_scritical:79,long_error:93,vol_scritical:344,vol_error:262,failed:true}"/*other*/);
test("sdvx2.png",SoundVoltexReader.class,
2060643/*score*/,
SDVX_D/*rank*/,
@ -601,7 +601,7 @@ public class ArcadeReader {
0/*difficulty*/,
0.0/*pct*/,
87/*maxcombo*/,
"{failed:false}"/*other*/);
"{ex:361,chip_scritical:5,chip_critical:5,chip_near:3,chip_error:26,long_scritical:53,long_error:79,vol_scritical:102,vol_error:4,failed:true}"/*other*/);
test("sdvx3.png",SoundVoltexReader.class,
8759328/*score*/,
SDVX_A/*rank*/,
@ -609,7 +609,7 @@ public class ArcadeReader {
0/*difficulty*/,
0.0/*pct*/,
257/*maxcombo*/,
"{failed:false}"/*other*/);
"{ex:5816,chip_scritical:408,chip_critical:296,chip_near:244,chip_error:67,long_scritical:423,long_error:11,vol_scritical:629,vol_error:66,failed:true}"/*other*/);
test("sdvx4.png",SoundVoltexReader.class,
9129755/*score*/,
SDVX_APLUS/*rank*/,
@ -617,7 +617,7 @@ public class ArcadeReader {
0/*difficulty*/,
0.0/*pct*/,
234/*maxcombo*/,
"{failed:false}"/*other*/);
"{ex:4882,chip_scritical:274,chip_critical:193,chip_near:170,chip_error:32,long_scritical:308,long_error:13,vol_scritical:892,vol_error:37,failed:true}"/*other*/);
test("sdvx5.png",SoundVoltexReader.class,
9653667/*score*/,
SDVX_AAPLUS/*rank*/,
@ -625,7 +625,7 @@ public class ArcadeReader {
0/*difficulty*/,
0.0/*pct*/,
593/*maxcombo*/,
"{failed:false}"/*other*/);
"{ex:4119,chip_scritical:173,chip_critical:109,chip_near:65,chip_error:4,long_scritical:375,long_error:1,vol_scritical:969,vol_error:22,failed:false}"/*other*/);
test("sdvx6.png",SoundVoltexReader.class,
9698351/*score*/,
SDVX_AA/*rank*/,
@ -633,7 +633,7 @@ public class ArcadeReader {
17/*difficulty*/,
0.0/*pct*/,
372/*maxcombo*/,
"{failed:false}"/*other*/);
"{ex:5525,chip_scritical:341,chip_critical:185,chip_near:99,chip_error:8,long_scritical:345,long_error:17,vol_scritical:1096,vol_error:32,failed:true}"/*other*/);
test("sdvx7.png",SoundVoltexReader.class,
9698351/*score*/,
SDVX_AA/*rank*/,
@ -641,6 +641,6 @@ public class ArcadeReader {
0/*difficulty*/,
0.0/*pct*/,
372/*maxcombo*/,
"{failed:false}"/*other*/);
"{ex:5525,chip_scritical:341,chip_critical:185,chip_near:99,chip_error:8,long_scritical:345,long_error:17,vol_scritical:1096,vol_error:32,failed:true}"/*other*/);
}
}

@ -204,7 +204,7 @@ public class PopnReader extends Reader{
case 4:{
Font f = Font.FONT_POPN_NOTECOUNT;
List<Glyph> glyphs = Glyph.split(cutImg);
return f.convertGlyphs(glyphs,true);
return f.convertGlyphs(glyphs);
}
case 5:{
Font f = Font.FONT_POPN_COMBO;

@ -304,7 +304,7 @@ public abstract class Reader{
int convertToInt(String[]data){return convertToInt("",data);}
int convertToInt(String prefix,String[] data) {
int numb=0;
String numb="";
for (int i=0;i<data.length;i++) {
String s = data[i];
int j=0;
@ -319,8 +319,7 @@ public abstract class Reader{
for (int k=0;k<number_alternatives.length;k++) {
for (int l=0;l<number_alternatives[k].length;l++) {
if (s.charAt(j)==number_alternatives[k][l]) {
numb*=10;
numb+=k;
numb+=number_alternatives[k][l];
//System.out.println(" "+s.charAt(j)+" found for "+k+".");
break letter_iterator;
}
@ -328,7 +327,11 @@ public abstract class Reader{
}
}
}
return numb;
if (numb.length()>0) {
return Integer.parseInt(numb);
} else {
return 0;
}
}
@Override
public String toString() {

@ -110,7 +110,7 @@ public class SoundVoltexReader extends Reader{
}break;
case 3:{
final ColorRange TARGETCOLOR = new ColorRange(230,255,180,255,20,255);
final ColorRange SEEKINGCOLOR = new ColorRange(130,255,100,255,15,255);
final ColorRange SEEKINGCOLOR = new ColorRange(200,255,180,255,15,255);
final Color FINALCOLOR = Color.MAGENTA;
for (int i=0;i<arr.length;i++) {
Color col = new Color(arr[i],true);
@ -339,6 +339,10 @@ public class SoundVoltexReader extends Reader{
sig_data[counter++]=val;
currentHeight+=readRegions.get(i).h+REGION_PADDING;
}
//695,933 140,8,8
if (new Color(originalImg.getRGB(695,933)).equals(new Color(140,8,8))) {
failed=true;
}
//912,1204
Color col = new Color(originalImg.getRGB(912,1204),true);
ColorRange range = new ColorRange(90,110,225,245,250,255);
@ -384,7 +388,7 @@ public class SoundVoltexReader extends Reader{
case 3:{
Font f = Font.FONT_SDVX_EXSCORE;
List<Glyph> glyphs = Glyph.split(cutImg);
return f.convertGlyphs(glyphs);
return f.convertGlyphs(glyphs,true);
}
case 5:
case 6:
@ -421,17 +425,17 @@ public class SoundVoltexReader extends Reader{
score=convertToInt(splitter);
}break;
case 2:{
int score2=convertToInt(splitter);
score=convertToInt(new String[]{Integer.toString(score),Integer.toString(score2)});
String score2=convertToString(splitter);
score=convertToInt(new String[]{Integer.toString(score),score2});
}break;
case 3:{
other+="{ex:"+Integer.toString(convertToInt("EX SCORE",splitter))+",";
}break;
case 4:{
pct=convertToDouble(splitter);//We're lucky excessive and effective rate have the same number of characters...
if (effectiveRate&&pct<70) {
/*if (effectiveRate&&pct<70) {
failed=true;
}
}*/
}break;
case 5:{
notes[0]=convertToInt("ERROR",splitter);

@ -198,6 +198,9 @@ public class Font {
}
sb.append(bestGlyph);
}
if (debug) {
System.out.println(sb.toString()+"\n========");
}
return sb.toString();
}
}

@ -1,30 +1,30 @@
9
11
011111110111001111110000011110000011110000011110000011110000011110000011110000011110000011011111111
000111100010000110110000010110000011110000011110000011110000011110000011110000011010000011011111110
2
11
1111111111111111111111
8
11
1111111011111111000000110000001100000011011111111111111011000000110000001100000011111111
1111110011111110000000110000001100000011001111100111110011000000110000001100000011111111
8
11
1111111011111111000000110000001100000011000111100001111000000011000000110000001111111111
1111110011111110000000110000001100000011000111100001111000000011000000110000001111111110
8
11
0000111100011111001110110011001101110011111000111111111111111111000000110000001100000011
0000111100001011000100110011001100100011010000111111111101111111000000110000001100000011
8
11
1111111111111111110000001100000011111110111111110000001100000011000000110000001111111111
1111111111111111110000001100000011111100111111100000001100000011000000110000001111111110
9
11
011111111111111111110000000110000000111111110111111111110000011110000011110000011110000011111111111
8
11
1111111111111111000000110000011000000110000011100000110000011100000110000001100000110000
001111111011111111110000000110000000111111100111111110110000011110000011110000011110000011011111110
0
0
9
11
011111110111001111110000011110000011110000011011111110011111110110000011110000011110000011111111111
001111100010000110110000011110000011110000010011111110011111110110000010110000011110000011011111110
9
11
011111110111111111110000011110000011110000011110000011111111111011111111000000011000000011111111111
001111100011111110110000011110000011110000011110000011011111111001111111000000011000000011111111110

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

@ -81,21 +81,21 @@ public class sigPlace {
final static int TRANSPARENT = new Color(0,0,0,0).getRGB();
public static void main(String[] args) {
/*String fontName = "lovelive_score";
String value = "325415";
Path f = Paths.get("tests","lovelive1.png");
/*String fontName = "sdvx_EXScore";
String value = "05525";
Path f = Paths.get("tests","sdvx6.png");
BufferedImage img;
try {
img = ImageIO.read(f.toFile());
Box scoreBox = new Box(713,401,232,50);
Box scoreBox = new Box(630,1142,110,16);
int[] arr = img.getRGB(scoreBox.x, scoreBox.y, scoreBox.w, scoreBox.h, null, 0, scoreBox.w);
BufferedImage newImg = new BufferedImage(scoreBox.w,scoreBox.h,BufferedImage.TYPE_INT_ARGB);
int width=scoreBox.w;
final ColorRange TARGETCOLOR = new ColorRange(240,255,130,150,0,10);
final ColorRange SEEKINGCOLOR = new ColorRange(140,255,120,255,0,180);
final ColorRange TARGETCOLOR = new ColorRange(230,255,180,255,20,255);
final ColorRange SEEKINGCOLOR = new ColorRange(200,255,180,255,15,255);
final Color FINALCOLOR = Color.MAGENTA;
for (int i=0;i<arr.length;i++) {
Color col = new Color(arr[i],true);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 275 B

Loading…
Cancel
Save