201 |
Background bg, float priority) { |
Background bg, float priority) { |
202 |
if(dbg) pa("MipzipLoader "+this+" goal "+level+ |
if(dbg) pa("MipzipLoader "+this+" goal "+level+ |
203 |
" now at "+currentBaseLevel); |
" now at "+currentBaseLevel); |
204 |
if(level != goalBaseLevel) { |
if(level != goalBaseLevel || level != currentBaseLevel) { |
205 |
this.goalBaseLevel = level; |
this.goalBaseLevel = level; |
206 |
this.bg = bg; |
this.bg = bg; |
207 |
this.priority = priority; |
this.priority = priority; |
309 |
* @return Memory, in bytes |
* @return Memory, in bytes |
310 |
*/ |
*/ |
311 |
public int getMemory(int level) { |
public int getMemory(int level) { |
312 |
|
if(level < 0) level = 0; |
313 |
|
if(level > levels.length-1) level = levels.length-1; |
314 |
int bytesForLevel = levels[level].size.width * levels[level].size.height * bitsPerTexel / 8; |
int bytesForLevel = levels[level].size.width * levels[level].size.height * bitsPerTexel / 8; |
315 |
int totalBytes = (bytesForLevel * 4) / 3; |
int totalBytes = (bytesForLevel * 4) / 3; |
316 |
return totalBytes; |
return totalBytes; |