Experimental test for atlas OOM
This commit is contained in:
@@ -102,10 +102,10 @@ public class MultiPacker implements Disposable{
|
|||||||
//main page can be massive, but 8192 throws GL_OUT_OF_MEMORY on some GPUs and I can't deal with it yet.
|
//main page can be massive, but 8192 throws GL_OUT_OF_MEMORY on some GPUs and I can't deal with it yet.
|
||||||
main(4096),
|
main(4096),
|
||||||
|
|
||||||
environment(4096, 2048),
|
environment(2048, 2048),
|
||||||
editor(4096, 2048),
|
editor(2048, 2048),
|
||||||
rubble(4096, 2048),
|
rubble(4096, 2048),
|
||||||
ui(4096);
|
ui(2048);
|
||||||
|
|
||||||
public static final PageType[] all = values();
|
public static final PageType[] all = values();
|
||||||
|
|
||||||
|
|||||||
@@ -884,6 +884,34 @@ public class UnitType extends UnlockableContent{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO test
|
||||||
|
if(sample instanceof Tankc){
|
||||||
|
PixmapRegion pix = Core.atlas.getPixmap(treadRegion);
|
||||||
|
|
||||||
|
for(int r = 0; r < treadRects.length; r++){
|
||||||
|
Rect treadRect = treadRects[r];
|
||||||
|
//slice is always 1 pixel wide
|
||||||
|
Pixmap slice = pix.crop((int)(treadRect.x + pix.width/2f), (int)(treadRect.y + pix.height/2f), 1, (int)treadRect.height);
|
||||||
|
int frames = treadFrames;
|
||||||
|
for(int i = 0; i < frames; i++){
|
||||||
|
int pullOffset = treadPullOffset;
|
||||||
|
Pixmap frame = new Pixmap(slice.width, slice.height);
|
||||||
|
for(int y = 0; y < slice.height; y++){
|
||||||
|
int idx = y + i;
|
||||||
|
if(idx >= slice.height){
|
||||||
|
idx -= slice.height;
|
||||||
|
idx += pullOffset;
|
||||||
|
idx = Mathf.mod(idx, slice.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
frame.setRaw(0, y, slice.getRaw(0, idx));
|
||||||
|
}
|
||||||
|
|
||||||
|
packer.add(PageType.main, name + "-treads" + r + "-" + i, frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return the time required to build this unit, as a value that takes into account reconstructors */
|
/** @return the time required to build this unit, as a value that takes into account reconstructors */
|
||||||
|
|||||||
+1
-1
@@ -25,4 +25,4 @@ org.gradle.caching=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
archash=f826256196
|
archash=89f5cbe7ab
|
||||||
|
|||||||
Reference in New Issue
Block a user