mirror of
https://github.com/MapMakersAndProgrammers/TankiOnline2.0DemoClient.git
synced 2025-10-26 09:59:07 -07:00
Add mostly deobfuscated package, class and function name source
This commit is contained in:
86
src/alternativa/engine3d/loaders/ParserMaterial.as
Normal file
86
src/alternativa/engine3d/loaders/ParserMaterial.as
Normal file
@@ -0,0 +1,86 @@
|
||||
package alternativa.engine3d.loaders
|
||||
{
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import alternativa.engine3d.core.Camera3D;
|
||||
import alternativa.engine3d.core.Light3D;
|
||||
import alternativa.engine3d.materials.*;
|
||||
import alternativa.engine3d.objects.Surface;
|
||||
import alternativa.engine3d.resources.ExternalTextureResource;
|
||||
import alternativa.engine3d.resources.Geometry;
|
||||
import alternativa.engine3d.resources.TextureResource;
|
||||
import avmplus.getQualifiedClassName;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.utils.getDefinitionByName;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class ParserMaterial extends Material
|
||||
{
|
||||
public var colors:Object;
|
||||
|
||||
public var textures:Object;
|
||||
|
||||
public var transparency:Number = 0;
|
||||
|
||||
public var §_-3m§:String = "diffuse";
|
||||
|
||||
private var textureMaterial:TextureMaterial;
|
||||
|
||||
private var §_-h7§:FillMaterial;
|
||||
|
||||
public function ParserMaterial()
|
||||
{
|
||||
super();
|
||||
this.textures = new Object();
|
||||
this.colors = new Object();
|
||||
}
|
||||
|
||||
override alternativa3d function fillResources(resources:Dictionary, resourceType:Class) : void
|
||||
{
|
||||
var texture:TextureResource = null;
|
||||
super.alternativa3d::fillResources(resources,resourceType);
|
||||
for each(texture in this.textures)
|
||||
{
|
||||
if(texture != null && Boolean(A3DUtils.alternativa3d::checkParent(getDefinitionByName(getQualifiedClassName(texture)) as Class,resourceType)))
|
||||
{
|
||||
resources[texture] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override alternativa3d function collectDraws(camera:Camera3D, surface:Surface, geometry:Geometry, lights:Vector.<Light3D>, lightsLength:int, objectRenderPriority:int = -1) : void
|
||||
{
|
||||
var map:ExternalTextureResource = null;
|
||||
var colorO:Object = this.colors[this.§_-3m§];
|
||||
if(colorO != null)
|
||||
{
|
||||
if(this.§_-h7§ == null)
|
||||
{
|
||||
this.§_-h7§ = new FillMaterial(int(colorO));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§_-h7§.color = int(colorO);
|
||||
}
|
||||
this.§_-h7§.alternativa3d::collectDraws(camera,surface,geometry,lights,lightsLength,objectRenderPriority);
|
||||
}
|
||||
else
|
||||
{
|
||||
map = this.textures[this.§_-3m§];
|
||||
if(map != null)
|
||||
{
|
||||
if(this.textureMaterial == null)
|
||||
{
|
||||
this.textureMaterial = new TextureMaterial(map);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.textureMaterial.diffuseMap = map;
|
||||
}
|
||||
this.textureMaterial.alternativa3d::collectDraws(camera,surface,geometry,lights,lightsLength,objectRenderPriority);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user