Main repository of MikuMikuStudio
リビジョン | 6d60d7075c9dd15e4734d34c46ee3b7dbf37d962 (tree) |
---|---|
日時 | 2013-11-23 05:58:27 |
作者 | kobayasi <kobayasi@pscn...> |
コミッター | kobayasi |
fix BufferedReader read bug.
@@ -62,8 +62,11 @@ public class BitmapFontLoader implements AssetLoader { | ||
62 | 62 | String regex = "[\\s=]+"; |
63 | 63 | |
64 | 64 | font.setCharSet(charSet); |
65 | - while (reader.ready()){ | |
65 | + while (true){ | |
66 | 66 | String line = reader.readLine(); |
67 | + if (line == null) { | |
68 | + break; | |
69 | + } | |
67 | 70 | String[] tokens = line.split(regex); |
68 | 71 | if (tokens[0].equals("info")){ |
69 | 72 | // Get rendered size |
@@ -101,8 +101,11 @@ public class GLSLLoader implements AssetLoader { | ||
101 | 101 | |
102 | 102 | StringBuilder sb = new StringBuilder(); |
103 | 103 | BufferedReader r = new BufferedReader(new InputStreamReader(in)); |
104 | - while (r.ready()){ | |
104 | + while (true){ | |
105 | 105 | String ln = r.readLine(); |
106 | + if (ln == null) { | |
107 | + break; | |
108 | + } | |
106 | 109 | if (ln.startsWith("#import ")){ |
107 | 110 | ln = ln.substring(8).trim(); |
108 | 111 | if (ln.startsWith("\"") && ln.endsWith("\"") && ln.length() > 3){ |