equal
deleted
inserted
replaced
396 public void initSolidLoops() { |
396 public void initSolidLoops() { |
397 this.solidloops = getSolidLoops(getSurfaceType()); |
397 this.solidloops = getSolidLoops(getSurfaceType()); |
398 } |
398 } |
399 |
399 |
400 private static final int CACHE_SIZE = 5; |
400 private static final int CACHE_SIZE = 5; |
401 private static RenderLoops loopcache[] = new RenderLoops[CACHE_SIZE]; |
401 private static RenderLoops[] loopcache = new RenderLoops[CACHE_SIZE]; |
402 private static SurfaceType typecache[] = new SurfaceType[CACHE_SIZE]; |
402 private static SurfaceType[] typecache = new SurfaceType[CACHE_SIZE]; |
403 public static synchronized RenderLoops getSolidLoops(SurfaceType type) { |
403 public static synchronized RenderLoops getSolidLoops(SurfaceType type) { |
404 for (int i = CACHE_SIZE - 1; i >= 0; i--) { |
404 for (int i = CACHE_SIZE - 1; i >= 0; i--) { |
405 SurfaceType t = typecache[i]; |
405 SurfaceType t = typecache[i]; |
406 if (t == type) { |
406 if (t == type) { |
407 return loopcache[i]; |
407 return loopcache[i]; |