MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / load

Method load

src/main/java/images/AniImageList.java:72–102  ·  view source on GitHub ↗
(String resName)

Source from the content-addressed store, hash-verified

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() {

Callers 1

getInstanceMethod · 0.45

Calls 10

getInstanceMethod · 0.95
getAnimationFileMethod · 0.95
getWidthMethod · 0.95
addFrameMethod · 0.95
getHeightMethod · 0.95
sizeMethod · 0.95
getAssetsLoaderMethod · 0.80
getResourceAsStreamMethod · 0.65
readMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected