mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
reduce dif memory usage
This commit is contained in:
parent
2694d2ce68
commit
bde64220f3
1 changed files with 52 additions and 0 deletions
|
|
@ -422,6 +422,7 @@ class DifBuilder {
|
|||
var difresource = ResourceLoader.loadInterior(path);
|
||||
difresource.acquire();
|
||||
dif = difresource.resource;
|
||||
dumbDownDif(dif);
|
||||
}
|
||||
var geo = (so == -1 ? dif.interiors[0] : dif.subObjects[so]);
|
||||
var triangles = [];
|
||||
|
|
@ -1016,4 +1017,55 @@ class DifBuilder {
|
|||
worker.run();
|
||||
});
|
||||
}
|
||||
|
||||
// Keeps only relevant parts of the dif to reduce memory footprint
|
||||
static function dumbDownDif(dif:Dif) {
|
||||
dif.aiSpecialNodes = null;
|
||||
dif.forceFields = null;
|
||||
dif.triggers = null;
|
||||
dif.gameEntities = null;
|
||||
dif.interiorPathfollowers = null;
|
||||
dif.triggers = null;
|
||||
dif.vehicleCollision = null;
|
||||
for (itr in dif.interiors.concat(dif.subObjects)) {
|
||||
itr.alarmAmbientColor = null;
|
||||
itr.alarmLMapIndices = null;
|
||||
itr.animatedLights = null;
|
||||
itr.baseAmbientColor = null;
|
||||
itr.bspNodes = null;
|
||||
itr.bspSolidLeaves = null;
|
||||
itr.convexHullEmitStrings = null;
|
||||
itr.convexHulls = null;
|
||||
itr.coordBinIndices = null;
|
||||
itr.boundingSphere = null;
|
||||
itr.coordBins = null;
|
||||
itr.edges = null;
|
||||
itr.edges2 = null;
|
||||
itr.hullEmitStringIndices = null;
|
||||
itr.hullIndices = null;
|
||||
itr.hullPlaneIndices = null;
|
||||
itr.hullSurfaceIndices = null;
|
||||
itr.lightMaps = null;
|
||||
itr.lightStates = null;
|
||||
itr.nameBuffer = null;
|
||||
itr.normalIndices = null;
|
||||
itr.normalLMapIndices = null;
|
||||
itr.nullSurfaces = null;
|
||||
itr.pointVisibilities = null;
|
||||
itr.polyListPlanes = null;
|
||||
itr.polyListPoints = null;
|
||||
itr.polyListStrings = null;
|
||||
itr.portals = null;
|
||||
itr.solidLeafSurfaces = null;
|
||||
itr.stateDataBuffers = null;
|
||||
itr.zones = null;
|
||||
itr.zoneSurfaces = null;
|
||||
itr.zoneStaticMeshes = null;
|
||||
itr.windingIndices = null;
|
||||
itr.texNormals = null;
|
||||
itr.texMatrices = null;
|
||||
itr.texMatIndices = null;
|
||||
itr.stateDatas = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue