(String resName)
| 70 | } |
| 71 | |
| 72 | public void load(String resName) { |
| 73 | try { |
| 74 | InputStream is = StaticData.getInstance().getAssetsLoader().getResourceAsStream(resName + "/animate.bin"); |
| 75 | int smileCount = is.read(); |
| 76 | |
| 77 | icons = new AniIcon[smileCount]; |
| 78 | for (int smileNum = 0; smileNum < smileCount; smileNum++) { |
| 79 | int imageCount = is.read(); |
| 80 | int frameCount = is.read(); |
| 81 | AniIcon icon = new AniIcon(getAnimationFile(resName, smileNum), imageCount, frameCount); |
| 82 | boolean loaded = (0 < icon.getWidth()); |
| 83 | if (!loaded) { |
| 84 | width = height = 0; |
| 85 | return; |
| 86 | } |
| 87 | for (int frameNum = 0; frameNum < frameCount; frameNum++) { |
| 88 | int iconIndex = is.read(); |
| 89 | int delay = is.read() * WAIT_TIME; |
| 90 | icon.addFrame(frameNum, iconIndex, delay); |
| 91 | } |
| 92 | icons[smileNum] = icon; |
| 93 | width = Math.max(width, icon.getWidth()); |
| 94 | height = Math.max(height, icon.getHeight()); |
| 95 | } |
| 96 | } catch (Exception e) { |
| 97 | } |
| 98 | if (size() > 0) { |
| 99 | thread = new Thread(this); |
| 100 | thread.start(); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | private static final int WAIT_TIME = 100; |
| 105 | public void run() { |
no test coverage detected