code stringlengths 57 237k |
|---|
package projects.tanks.client.panel.model.videoads.videoadsbattleresult {
import alternativa.osgi.OSGi;
import alternativa.protocol.IProtocol;
import alternativa.protocol.OptionalMap;
import alternativa.protocol.ProtocolBuffer;
import alternativa.types.Long;
import flash.utils.ByteArray;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.network.command.SpaceCommand;
import platform.client.fp10.core.type.IGameObject;
import platform.client.fp10.core.type.ISpace;
public class VideoAdsBattleResultModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var _showedId:Long = Long.getLong(685813516,-497106284);
private var model:IModel;
public function VideoAdsBattleResultModelServer(param1:IModel) {
super();
this.model = param1;
var local2:ByteArray = new ByteArray();
this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol));
this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap());
}
public function showed() : void {
ByteArray(this.protocolBuffer.writer).position = 0;
ByteArray(this.protocolBuffer.writer).length = 0;
ByteArray(this.protocolBuffer.writer).position = 0;
if(Model.object == null) {
throw new Error("Execute method without model context.");
}
var local1:SpaceCommand = new SpaceCommand(Model.object.id,this._showedId,this.protocolBuffer);
var local2:IGameObject = Model.object;
var local3:ISpace = local2.space;
local3.commandSender.sendCommand(local1);
this.protocolBuffer.optionalMap.clear();
}
}
}
|
package alternativa.engine3d.containers
{
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Camera3D;
import alternativa.engine3d.core.Debug;
import alternativa.engine3d.core.Face;
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.core.Object3DContainer;
import alternativa.engine3d.core.RayIntersectionData;
import alternativa.engine3d.core.ShadowAtlas;
import alternativa.engine3d.core.VG;
import alternativa.engine3d.core.Vertex;
import alternativa.engine3d.materials.Material;
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.engine3d.objects.BSP;
import alternativa.engine3d.objects.Decal;
import alternativa.engine3d.objects.Mesh;
import alternativa.engine3d.objects.Occluder;
import alternativa.engine3d.objects.Sprite3D;
import alternativa.gfx.core.Device;
import alternativa.gfx.core.IndexBufferResource;
import alternativa.gfx.core.VertexBufferResource;
import flash.geom.Matrix3D;
import flash.geom.Vector3D;
import flash.utils.Dictionary;
use namespace alternativa3d;
public class KDContainer extends ConflictContainer
{
private static const treeSphere:Vector3D = new Vector3D();
private static const splitCoordsX:Vector.<Number> = new Vector.<Number>();
private static const splitCoordsY:Vector.<Number> = new Vector.<Number>();
private static const splitCoordsZ:Vector.<Number> = new Vector.<Number>();
public var debugAlphaFade:Number = 0.8;
public var ignoreChildrenInCollider:Boolean = false;
alternativa3d var root:KDNode;
private var nearPlaneX:Number;
private var nearPlaneY:Number;
private var nearPlaneZ:Number;
private var nearPlaneOffset:Number;
private var farPlaneX:Number;
private var farPlaneY:Number;
private var farPlaneZ:Number;
private var farPlaneOffset:Number;
private var leftPlaneX:Number;
private var leftPlaneY:Number;
private var leftPlaneZ:Number;
private var leftPlaneOffset:Number;
private var rightPlaneX:Number;
private var rightPlaneY:Number;
private var rightPlaneZ:Number;
private var rightPlaneOffset:Number;
private var topPlaneX:Number;
private var topPlaneY:Number;
private var topPlaneZ:Number;
private var topPlaneOffset:Number;
private var bottomPlaneX:Number;
private var bottomPlaneY:Number;
private var bottomPlaneZ:Number;
private var bottomPlaneOffset:Number;
private var occluders:Vector.<Vertex>;
private var numOccluders:int;
private var materials:Dictionary;
private var opaqueList:Object3D;
private var transparent:Vector.<Object3D>;
private var transparentLength:int = 0;
private var receiversVertexBuffers:Vector.<VertexBufferResource>;
private var receiversIndexBuffers:Vector.<IndexBufferResource>;
private var isCreated:Boolean = false;
public var batched:Boolean = true;
public function KDContainer()
{
this.occluders = new Vector.<Vertex>();
this.materials = new Dictionary();
this.transparent = new Vector.<Object3D>();
this.receiversVertexBuffers = new Vector.<VertexBufferResource>();
this.receiversIndexBuffers = new Vector.<IndexBufferResource>();
super();
}
public function createTree(param1:Vector.<Object3D>, param2:Vector.<Occluder> = null) : void
{
var _loc3_:int = 0;
var _loc4_:Object3D = null;
var _loc5_:Object3D = null;
var _loc8_:Object3D = null;
var _loc9_:Object3D = null;
var _loc10_:Object3D = null;
var _loc11_:Object3D = null;
var _loc12_:Material = null;
var _loc14_:Number = NaN;
var _loc15_:Number = NaN;
var _loc16_:Number = NaN;
var _loc17_:Number = NaN;
var _loc18_:Number = NaN;
var _loc19_:Number = NaN;
var _loc20_:Number = NaN;
var _loc21_:Number = NaN;
var _loc22_:Number = NaN;
var _loc23_:Number = NaN;
var _loc24_:Number = NaN;
var _loc25_:Number = NaN;
var _loc26_:Vertex = null;
var _loc27_:Face = null;
var _loc28_:Vertex = null;
var _loc29_:Mesh = null;
var _loc30_:Mesh = null;
var _loc31_:BSP = null;
var _loc32_:Vector.<Vector.<Number>> = null;
var _loc33_:Vector.<Vector.<uint>> = null;
this.destroyTree();
var _loc6_:int = param1.length;
var _loc7_:int = param2 != null ? int(int(param2.length)) : int(int(0));
var _loc13_:Dictionary = new Dictionary();
_loc3_ = 0;
while(_loc3_ < _loc6_)
{
_loc4_ = param1[_loc3_];
_loc12_ = _loc4_ is Mesh ? (_loc4_ as Mesh).faceList.material : (_loc4_ is BSP ? ((_loc4_ as BSP).faces.length > 0 ? (_loc4_ as BSP).faces[0].material : null) : null);
if(_loc12_ != null)
{
this.materials[_loc12_] = true;
if(_loc12_.transparent)
{
this.transparent[this.transparentLength] = _loc4_;
++this.transparentLength;
}
else
{
_loc29_ = _loc13_[_loc12_];
if(_loc29_ == null)
{
_loc29_ = new Mesh();
_loc13_[_loc12_] = _loc29_;
_loc29_.next = this.opaqueList;
this.opaqueList = _loc29_;
_loc29_.setParent(this);
}
_loc4_ = _loc4_.clone();
_loc4_.composeMatrix();
if(_loc4_ is Mesh)
{
_loc30_ = _loc4_ as Mesh;
if(_loc30_.faceList != null)
{
_loc26_ = _loc30_.vertexList;
while(_loc26_ != null)
{
_loc20_ = _loc26_.x;
_loc21_ = _loc26_.y;
_loc22_ = _loc26_.z;
_loc26_.x = _loc4_.ma * _loc20_ + _loc4_.mb * _loc21_ + _loc4_.mc * _loc22_ + _loc4_.md;
_loc26_.y = _loc4_.me * _loc20_ + _loc4_.mf * _loc21_ + _loc4_.mg * _loc22_ + _loc4_.mh;
_loc26_.z = _loc4_.mi * _loc20_ + _loc4_.mj * _loc21_ + _loc4_.mk * _loc22_ + _loc4_.ml;
_loc23_ = _loc26_.normalX;
_loc24_ = _loc26_.normalY;
_loc25_ = _loc26_.normalZ;
_loc26_.normalX = _loc4_.ma * _loc23_ + _loc4_.mb * _loc24_ + _loc4_.mc * _loc25_;
_loc26_.normalY = _loc4_.me * _loc23_ + _loc4_.mf * _loc24_ + _loc4_.mg * _loc25_;
_loc26_.normalZ = _loc4_.mi * _loc23_ + _loc4_.mj * _loc24_ + _loc4_.mk * _loc25_;
_loc26_.transformId = 0;
if(_loc26_.next == null)
{
_loc28_ = _loc26_;
}
_loc26_ = _loc26_.next;
}
_loc28_.next = _loc29_.vertexList;
_loc29_.vertexList = _loc30_.vertexList;
_loc30_.vertexList = null;
_loc27_ = _loc30_.faceList;
while(_loc27_.next != null)
{
_loc27_ = _loc27_.next;
}
_loc27_.next = _loc29_.faceList;
_loc29_.faceList = _loc30_.faceList;
_loc30_.faceList = null;
}
}
else if(_loc4_ is BSP)
{
_loc31_ = _loc4_ as BSP;
if(_loc31_.root != null)
{
_loc26_ = _loc31_.vertexList;
while(_loc26_ != null)
{
_loc20_ = _loc26_.x;
_loc21_ = _loc26_.y;
_loc22_ = _loc26_.z;
_loc26_.x = _loc4_.ma * _loc20_ + _loc4_.mb * _loc21_ + _loc4_.mc * _loc22_ + _loc4_.md;
_loc26_.y = _loc4_.me * _loc20_ + _loc4_.mf * _loc21_ + _loc4_.mg * _loc22_ + _loc4_.mh;
_loc26_.z = _loc4_.mi * _loc20_ + _loc4_.mj * _loc21_ + _loc4_.mk * _loc22_ + _loc4_.ml;
_loc23_ = _loc26_.normalX;
_loc24_ = _loc26_.normalY;
_loc25_ = _loc26_.normalZ;
_loc26_.normalX = _loc4_.ma * _loc23_ + _loc4_.mb * _loc24_ + _loc4_.mc * _loc25_;
_loc26_.normalY = _loc4_.me * _loc23_ + _loc4_.mf * _loc24_ + _loc4_.mg * _loc25_;
_loc26_.normalZ = _loc4_.mi * _loc23_ + _loc4_.mj * _loc24_ + _loc4_.mk * _loc25_;
_loc26_.transformId = 0;
if(_loc26_.next == null)
{
_loc28_ = _loc26_;
}
_loc26_ = _loc26_.next;
}
_loc28_.next = _loc29_.vertexList;
_loc29_.vertexList = _loc31_.vertexList;
_loc31_.vertexList = null;
for each(_loc27_ in _loc31_.faces)
{
_loc27_.next = _loc29_.faceList;
_loc29_.faceList = _loc27_;
}
_loc31_.faces.length = 0;
_loc31_.root = null;
}
}
}
}
_loc3_++;
}
for each(_loc29_ in _loc13_)
{
_loc29_.calculateFacesNormals(true);
_loc29_.calculateBounds();
}
_loc14_ = 1e+22;
_loc15_ = 1e+22;
_loc16_ = 1e+22;
_loc17_ = -1e+22;
_loc18_ = -1e+22;
_loc19_ = -1e+22;
_loc3_ = 0;
while(_loc3_ < _loc6_)
{
_loc4_ = param1[_loc3_];
_loc5_ = this.createObjectBounds(_loc4_);
if(_loc5_.boundMinX <= _loc5_.boundMaxX)
{
if(_loc4_._parent != null)
{
_loc4_._parent.removeChild(_loc4_);
}
_loc4_.setParent(this);
_loc4_.next = _loc8_;
_loc8_ = _loc4_;
_loc5_.next = _loc9_;
_loc9_ = _loc5_;
if(_loc5_.boundMinX < _loc14_)
{
_loc14_ = _loc5_.boundMinX;
}
if(_loc5_.boundMaxX > _loc17_)
{
_loc17_ = _loc5_.boundMaxX;
}
if(_loc5_.boundMinY < _loc15_)
{
_loc15_ = _loc5_.boundMinY;
}
if(_loc5_.boundMaxY > _loc18_)
{
_loc18_ = _loc5_.boundMaxY;
}
if(_loc5_.boundMinZ < _loc16_)
{
_loc16_ = _loc5_.boundMinZ;
}
if(_loc5_.boundMaxZ > _loc19_)
{
_loc19_ = _loc5_.boundMaxZ;
}
}
_loc3_++;
}
_loc3_ = 0;
while(_loc3_ < _loc7_)
{
_loc4_ = param2[_loc3_];
_loc5_ = this.createObjectBounds(_loc4_);
if(_loc5_.boundMinX <= _loc5_.boundMaxX)
{
if(!(_loc5_.boundMinX < _loc14_ || _loc5_.boundMaxX > _loc17_ || _loc5_.boundMinY < _loc15_ || _loc5_.boundMaxY > _loc18_ || _loc5_.boundMinZ < _loc16_ || _loc5_.boundMaxZ > _loc19_))
{
if(_loc4_._parent != null)
{
_loc4_._parent.removeChild(_loc4_);
}
_loc4_.setParent(this);
_loc4_.next = _loc10_;
_loc10_ = _loc4_;
_loc5_.next = _loc11_;
_loc11_ = _loc5_;
}
}
_loc3_++;
}
if(_loc8_ != null)
{
this.root = this.createNode(_loc8_,_loc9_,_loc10_,_loc11_,_loc14_,_loc15_,_loc16_,_loc17_,_loc18_,_loc19_);
_loc32_ = new Vector.<Vector.<Number>>();
_loc33_ = new Vector.<Vector.<uint>>();
_loc32_[0] = new Vector.<Number>();
_loc33_[0] = new Vector.<uint>();
this.root.createReceivers(_loc32_,_loc33_);
_loc3_ = 0;
while(_loc3_ < _loc32_.length)
{
this.receiversVertexBuffers[_loc3_] = new VertexBufferResource(_loc32_[_loc3_],3);
this.receiversIndexBuffers[_loc3_] = new IndexBufferResource(_loc33_[_loc3_]);
_loc3_++;
}
}
}
public function destroyTree() : void
{
var _loc1_:int = 0;
var _loc2_:* = undefined;
var _loc3_:Object3D = null;
var _loc4_:Mesh = null;
var _loc5_:BSP = null;
var _loc6_:TextureMaterial = null;
for(_loc2_ in this.materials)
{
_loc6_ = _loc2_ as TextureMaterial;
if(_loc6_.texture != null)
{
_loc6_.textureResource.reset();
}
if(_loc6_._textureATF != null)
{
_loc6_.textureATFResource.reset();
}
if(_loc6_._textureATFAlpha != null)
{
_loc6_.textureATFAlphaResource.reset();
}
}
_loc3_ = this.opaqueList;
while(_loc3_ != null)
{
if(_loc3_ is Mesh)
{
_loc4_ = _loc3_ as Mesh;
if(_loc4_.vertexBuffer != null)
{
_loc4_.vertexBuffer.reset();
}
if(_loc4_.indexBuffer != null)
{
_loc4_.indexBuffer.reset();
}
_loc4_.destroy();
}
else if(_loc3_ is BSP)
{
_loc5_ = _loc3_ as BSP;
if(_loc5_.vertexBuffer != null)
{
_loc5_.vertexBuffer.reset();
}
if(_loc5_.indexBuffer != null)
{
_loc5_.indexBuffer.reset();
}
_loc5_.destroy();
}
_loc3_ = _loc3_.next;
}
_loc1_ = 0;
while(_loc1_ < this.transparentLength)
{
_loc3_ = this.transparent[_loc1_];
if(_loc3_ is Mesh)
{
_loc4_ = _loc3_ as Mesh;
if(_loc4_.vertexBuffer != null)
{
_loc4_.vertexBuffer.reset();
}
if(_loc4_.indexBuffer != null)
{
_loc4_.indexBuffer.reset();
}
_loc4_.destroy();
}
else if(_loc3_ is BSP)
{
_loc5_ = _loc3_ as BSP;
if(_loc5_.vertexBuffer != null)
{
_loc5_.vertexBuffer.reset();
}
if(_loc5_.indexBuffer != null)
{
_loc5_.indexBuffer.reset();
}
_loc5_.destroy();
}
_loc1_++;
}
this.materials = new Dictionary();
this.opaqueList = null;
this.transparent.length = 0;
this.transparentLength = 0;
if(this.root != null)
{
this.destroyNode(this.root);
this.root = null;
}
_loc1_ = 0;
while(_loc1_ < this.receiversVertexBuffers.length)
{
VertexBufferResource(this.receiversVertexBuffers[_loc1_]).dispose();
IndexBufferResource(this.receiversIndexBuffers[_loc1_]).dispose();
_loc1_++;
}
this.receiversVertexBuffers.length = 0;
this.receiversIndexBuffers.length = 0;
this.isCreated = false;
}
override public function intersectRay(param1:Vector3D, param2:Vector3D, param3:Dictionary = null, param4:Camera3D = null) : RayIntersectionData
{
var _loc6_:RayIntersectionData = null;
if(param3 != null && param3[this])
{
return null;
}
if(!boundIntersectRay(param1,param2,boundMinX,boundMinY,boundMinZ,boundMaxX,boundMaxY,boundMaxZ))
{
return null;
}
var _loc5_:RayIntersectionData = super.intersectRay(param1,param2,param3,param4);
if(this.root != null && boundIntersectRay(param1,param2,this.root.boundMinX,this.root.boundMinY,this.root.boundMinZ,this.root.boundMaxX,this.root.boundMaxY,this.root.boundMaxZ))
{
_loc6_ = this.intersectRayNode(this.root,param1,param2,param3,param4);
if(_loc6_ != null && (_loc5_ == null || _loc6_.time < _loc5_.time))
{
_loc5_ = _loc6_;
}
}
return _loc5_;
}
private function intersectRayNode(param1:KDNode, param2:Vector3D, param3:Vector3D, param4:Dictionary, param5:Camera3D) : RayIntersectionData
{
var _loc6_:RayIntersectionData = null;
var _loc7_:Number = NaN;
var _loc8_:Object3D = null;
var _loc9_:Object3D = null;
var _loc10_:Vector3D = null;
var _loc11_:Vector3D = null;
var _loc12_:Boolean = false;
var _loc13_:Boolean = false;
var _loc14_:Number = NaN;
var _loc15_:Number = NaN;
var _loc16_:RayIntersectionData = null;
if(param1.negative != null)
{
_loc12_ = param1.axis == 0;
_loc13_ = param1.axis == 1;
_loc14_ = (!!_loc12_ ? param2.x : (!!_loc13_ ? param2.y : param2.z)) - param1.coord;
if(_loc14_ > 0)
{
if(boundIntersectRay(param2,param3,param1.positive.boundMinX,param1.positive.boundMinY,param1.positive.boundMinZ,param1.positive.boundMaxX,param1.positive.boundMaxY,param1.positive.boundMaxZ))
{
_loc6_ = this.intersectRayNode(param1.positive,param2,param3,param4,param5);
if(_loc6_ != null)
{
return _loc6_;
}
}
_loc7_ = !!_loc12_ ? Number(Number(param3.x)) : (!!_loc13_ ? Number(Number(param3.y)) : Number(Number(param3.z)));
if(_loc7_ < 0)
{
_loc8_ = param1.objectList;
_loc9_ = param1.objectBoundList;
while(_loc8_ != null)
{
if(boundIntersectRay(param2,param3,_loc9_.boundMinX,_loc9_.boundMinY,_loc9_.boundMinZ,_loc9_.boundMaxX,_loc9_.boundMaxY,_loc9_.boundMaxZ))
{
_loc8_.composeMatrix();
_loc8_.invertMatrix();
if(_loc10_ == null)
{
_loc10_ = new Vector3D();
_loc11_ = new Vector3D();
}
_loc10_.x = _loc8_.ma * param2.x + _loc8_.mb * param2.y + _loc8_.mc * param2.z + _loc8_.md;
_loc10_.y = _loc8_.me * param2.x + _loc8_.mf * param2.y + _loc8_.mg * param2.z + _loc8_.mh;
_loc10_.z = _loc8_.mi * param2.x + _loc8_.mj * param2.y + _loc8_.mk * param2.z + _loc8_.ml;
_loc11_.x = _loc8_.ma * param3.x + _loc8_.mb * param3.y + _loc8_.mc * param3.z;
_loc11_.y = _loc8_.me * param3.x + _loc8_.mf * param3.y + _loc8_.mg * param3.z;
_loc11_.z = _loc8_.mi * param3.x + _loc8_.mj * param3.y + _loc8_.mk * param3.z;
_loc6_ = _loc8_.intersectRay(_loc10_,_loc11_,param4,param5);
if(_loc6_ != null)
{
return _loc6_;
}
}
_loc8_ = _loc8_.next;
_loc9_ = _loc9_.next;
}
if(boundIntersectRay(param2,param3,param1.negative.boundMinX,param1.negative.boundMinY,param1.negative.boundMinZ,param1.negative.boundMaxX,param1.negative.boundMaxY,param1.negative.boundMaxZ))
{
return this.intersectRayNode(param1.negative,param2,param3,param4,param5);
}
}
}
else
{
if(boundIntersectRay(param2,param3,param1.negative.boundMinX,param1.negative.boundMinY,param1.negative.boundMinZ,param1.negative.boundMaxX,param1.negative.boundMaxY,param1.negative.boundMaxZ))
{
_loc6_ = this.intersectRayNode(param1.negative,param2,param3,param4,param5);
if(_loc6_ != null)
{
return _loc6_;
}
}
_loc7_ = !!_loc12_ ? Number(Number(param3.x)) : (!!_loc13_ ? Number(Number(param3.y)) : Number(Number(param3.z)));
if(_loc7_ > 0)
{
_loc8_ = param1.objectList;
_loc9_ = param1.objectBoundList;
while(_loc8_ != null)
{
if(boundIntersectRay(param2,param3,_loc9_.boundMinX,_loc9_.boundMinY,_loc9_.boundMinZ,_loc9_.boundMaxX,_loc9_.boundMaxY,_loc9_.boundMaxZ))
{
_loc8_.composeMatrix();
_loc8_.invertMatrix();
if(_loc10_ == null)
{
_loc10_ = new Vector3D();
_loc11_ = new Vector3D();
}
_loc10_.x = _loc8_.ma * param2.x + _loc8_.mb * param2.y + _loc8_.mc * param2.z + _loc8_.md;
_loc10_.y = _loc8_.me * param2.x + _loc8_.mf * param2.y + _loc8_.mg * param2.z + _loc8_.mh;
_loc10_.z = _loc8_.mi * param2.x + _loc8_.mj * param2.y + _loc8_.mk * param2.z + _loc8_.ml;
_loc11_.x = _loc8_.ma * param3.x + _loc8_.mb * param3.y + _loc8_.mc * param3.z;
_loc11_.y = _loc8_.me * param3.x + _loc8_.mf * param3.y + _loc8_.mg * param3.z;
_loc11_.z = _loc8_.mi * param3.x + _loc8_.mj * param3.y + _loc8_.mk * param3.z;
_loc6_ = _loc8_.intersectRay(_loc10_,_loc11_,param4,param5);
if(_loc6_ != null)
{
return _loc6_;
}
}
_loc8_ = _loc8_.next;
_loc9_ = _loc9_.next;
}
if(boundIntersectRay(param2,param3,param1.positive.boundMinX,param1.positive.boundMinY,param1.positive.boundMinZ,param1.positive.boundMaxX,param1.positive.boundMaxY,param1.positive.boundMaxZ))
{
return this.intersectRayNode(param1.positive,param2,param3,param4,param5);
}
}
}
return null;
}
_loc15_ = 1e+22;
_loc8_ = param1.objectList;
while(_loc8_ != null)
{
_loc8_.composeMatrix();
_loc8_.invertMatrix();
if(_loc10_ == null)
{
_loc10_ = new Vector3D();
_loc11_ = new Vector3D();
}
_loc10_.x = _loc8_.ma * param2.x + _loc8_.mb * param2.y + _loc8_.mc * param2.z + _loc8_.md;
_loc10_.y = _loc8_.me * param2.x + _loc8_.mf * param2.y + _loc8_.mg * param2.z + _loc8_.mh;
_loc10_.z = _loc8_.mi * param2.x + _loc8_.mj * param2.y + _loc8_.mk * param2.z + _loc8_.ml;
_loc11_.x = _loc8_.ma * param3.x + _loc8_.mb * param3.y + _loc8_.mc * param3.z;
_loc11_.y = _loc8_.me * param3.x + _loc8_.mf * param3.y + _loc8_.mg * param3.z;
_loc11_.z = _loc8_.mi * param3.x + _loc8_.mj * param3.y + _loc8_.mk * param3.z;
_loc6_ = _loc8_.intersectRay(_loc10_,_loc11_,param4,param5);
if(_loc6_ != null && _loc6_.time < _loc15_)
{
_loc15_ = _loc6_.time;
_loc16_ = _loc6_;
}
_loc8_ = _loc8_.next;
}
return _loc16_;
}
override alternativa3d function checkIntersection(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number, param8:Dictionary) : Boolean
{
if(super.checkIntersection(param1,param2,param3,param4,param5,param6,param7,param8))
{
return true;
}
if(this.root != null && boundCheckIntersection(param1,param2,param3,param4,param5,param6,param7,this.root.boundMinX,this.root.boundMinY,this.root.boundMinZ,this.root.boundMaxX,this.root.boundMaxY,this.root.boundMaxZ))
{
return this.checkIntersectionNode(this.root,param1,param2,param3,param4,param5,param6,param7,param8);
}
return false;
}
private function checkIntersectionNode(param1:KDNode, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number, param8:Number, param9:Dictionary) : Boolean
{
var _loc10_:Object3D = null;
var _loc11_:Object3D = null;
var _loc12_:Number = NaN;
var _loc13_:Number = NaN;
var _loc14_:Number = NaN;
var _loc15_:Number = NaN;
var _loc16_:Number = NaN;
var _loc17_:Number = NaN;
var _loc18_:Number = NaN;
var _loc19_:Boolean = false;
var _loc20_:Boolean = false;
var _loc21_:Number = NaN;
var _loc22_:Number = NaN;
if(param1.negative != null)
{
_loc19_ = param1.axis == 0;
_loc20_ = param1.axis == 1;
_loc21_ = (!!_loc19_ ? param2 : (!!_loc20_ ? param3 : param4)) - param1.coord;
_loc22_ = !!_loc19_ ? Number(Number(param5)) : (!!_loc20_ ? Number(Number(param6)) : Number(Number(param7)));
if(_loc21_ > 0)
{
if(_loc22_ < 0)
{
_loc18_ = -_loc21_ / _loc22_;
if(_loc18_ < param8)
{
_loc10_ = param1.objectList;
_loc11_ = param1.objectBoundList;
while(_loc10_ != null)
{
if(boundCheckIntersection(param2,param3,param4,param5,param6,param7,param8,_loc11_.boundMinX,_loc11_.boundMinY,_loc11_.boundMinZ,_loc11_.boundMaxX,_loc11_.boundMaxY,_loc11_.boundMaxZ))
{
_loc10_.composeMatrix();
_loc10_.invertMatrix();
_loc12_ = _loc10_.ma * param2 + _loc10_.mb * param3 + _loc10_.mc * param4 + _loc10_.md;
_loc13_ = _loc10_.me * param2 + _loc10_.mf * param3 + _loc10_.mg * param4 + _loc10_.mh;
_loc14_ = _loc10_.mi * param2 + _loc10_.mj * param3 + _loc10_.mk * param4 + _loc10_.ml;
_loc15_ = _loc10_.ma * param5 + _loc10_.mb * param6 + _loc10_.mc * param7;
_loc16_ = _loc10_.me * param5 + _loc10_.mf * param6 + _loc10_.mg * param7;
_loc17_ = _loc10_.mi * param5 + _loc10_.mj * param6 + _loc10_.mk * param7;
if(_loc10_.checkIntersection(_loc12_,_loc13_,_loc14_,_loc15_,_loc16_,_loc17_,param8,param9))
{
return true;
}
}
_loc10_ = _loc10_.next;
_loc11_ = _loc11_.next;
}
if(boundCheckIntersection(param2,param3,param4,param5,param6,param7,param8,param1.negative.boundMinX,param1.negative.boundMinY,param1.negative.boundMinZ,param1.negative.boundMaxX,param1.negative.boundMaxY,param1.negative.boundMaxZ) && this.checkIntersectionNode(param1.negative,param2,param3,param4,param5,param6,param7,param8,param9))
{
return true;
}
}
}
return boundCheckIntersection(param2,param3,param4,param5,param6,param7,param8,param1.positive.boundMinX,param1.positive.boundMinY,param1.positive.boundMinZ,param1.positive.boundMaxX,param1.positive.boundMaxY,param1.positive.boundMaxZ) && this.checkIntersectionNode(param1.positive,param2,param3,param4,param5,param6,param7,param8,param9);
}
if(_loc22_ > 0)
{
_loc18_ = -_loc21_ / _loc22_;
if(_loc18_ < param8)
{
_loc10_ = param1.objectList;
_loc11_ = param1.objectBoundList;
while(_loc10_ != null)
{
if(boundCheckIntersection(param2,param3,param4,param5,param6,param7,param8,_loc11_.boundMinX,_loc11_.boundMinY,_loc11_.boundMinZ,_loc11_.boundMaxX,_loc11_.boundMaxY,_loc11_.boundMaxZ))
{
_loc10_.composeMatrix();
_loc10_.invertMatrix();
_loc12_ = _loc10_.ma * param2 + _loc10_.mb * param3 + _loc10_.mc * param4 + _loc10_.md;
_loc13_ = _loc10_.me * param2 + _loc10_.mf * param3 + _loc10_.mg * param4 + _loc10_.mh;
_loc14_ = _loc10_.mi * param2 + _loc10_.mj * param3 + _loc10_.mk * param4 + _loc10_.ml;
_loc15_ = _loc10_.ma * param5 + _loc10_.mb * param6 + _loc10_.mc * param7;
_loc16_ = _loc10_.me * param5 + _loc10_.mf * param6 + _loc10_.mg * param7;
_loc17_ = _loc10_.mi * param5 + _loc10_.mj * param6 + _loc10_.mk * param7;
if(_loc10_.checkIntersection(_loc12_,_loc13_,_loc14_,_loc15_,_loc16_,_loc17_,param8,param9))
{
return true;
}
}
_loc10_ = _loc10_.next;
_loc11_ = _loc11_.next;
}
if(boundCheckIntersection(param2,param3,param4,param5,param6,param7,param8,param1.positive.boundMinX,param1.positive.boundMinY,param1.positive.boundMinZ,param1.positive.boundMaxX,param1.positive.boundMaxY,param1.positive.boundMaxZ) && this.checkIntersectionNode(param1.positive,param2,param3,param4,param5,param6,param7,param8,param9))
{
return true;
}
}
}
return boundCheckIntersection(param2,param3,param4,param5,param6,param7,param8,param1.negative.boundMinX,param1.negative.boundMinY,param1.negative.boundMinZ,param1.negative.boundMaxX,param1.negative.boundMaxY,param1.negative.boundMaxZ) && this.checkIntersectionNode(param1.negative,param2,param3,param4,param5,param6,param7,param8,param9);
}
_loc10_ = param1.objectList;
while(_loc10_ != null)
{
_loc10_.composeMatrix();
_loc10_.invertMatrix();
_loc12_ = _loc10_.ma * param2 + _loc10_.mb * param3 + _loc10_.mc * param4 + _loc10_.md;
_loc13_ = _loc10_.me * param2 + _loc10_.mf * param3 + _loc10_.mg * param4 + _loc10_.mh;
_loc14_ = _loc10_.mi * param2 + _loc10_.mj * param3 + _loc10_.mk * param4 + _loc10_.ml;
_loc15_ = _loc10_.ma * param5 + _loc10_.mb * param6 + _loc10_.mc * param7;
_loc16_ = _loc10_.me * param5 + _loc10_.mf * param6 + _loc10_.mg * param7;
_loc17_ = _loc10_.mi * param5 + _loc10_.mj * param6 + _loc10_.mk * param7;
if(_loc10_.checkIntersection(_loc12_,_loc13_,_loc14_,_loc15_,_loc16_,_loc17_,param8,param9))
{
return true;
}
_loc10_ = _loc10_.next;
}
return false;
}
override alternativa3d function collectPlanes(param1:Vector3D, param2:Vector3D, param3:Vector3D, param4:Vector3D, param5:Vector3D, param6:Vector.<Face>, param7:Dictionary = null) : void
{
var _loc9_:Object3D = null;
if(param7 != null && param7[this])
{
return;
}
var _loc8_:Vector3D = calculateSphere(param1,param2,param3,param4,param5,treeSphere);
if(!this.ignoreChildrenInCollider)
{
if(!boundIntersectSphere(_loc8_,boundMinX,boundMinY,boundMinZ,boundMaxX,boundMaxY,boundMaxZ))
{
_loc8_ = null;
return;
}
_loc8_ = null;
_loc9_ = childrenList;
while(_loc9_ != null)
{
_loc9_.composeAndAppend(this);
_loc9_.collectPlanes(param1,param2,param3,param4,param5,param6,param7);
_loc9_ = _loc9_.next;
}
}
if(this.root != null && boundIntersectSphere(_loc8_,this.root.boundMinX,this.root.boundMinY,this.root.boundMinZ,this.root.boundMaxX,this.root.boundMaxY,this.root.boundMaxZ))
{
this.collectPlanesNode(this.root,_loc8_,param1,param2,param3,param4,param5,param6,param7);
}
}
private function collectPlanesNode(param1:KDNode, param2:Vector3D, param3:Vector3D, param4:Vector3D, param5:Vector3D, param6:Vector3D, param7:Vector3D, param8:Vector.<Face>, param9:Dictionary = null) : void
{
var _loc10_:Object3D = null;
var _loc11_:Object3D = null;
var _loc12_:Boolean = false;
var _loc13_:Boolean = false;
var _loc14_:Number = NaN;
if(param1.negative != null)
{
_loc12_ = param1.axis == 0;
_loc13_ = param1.axis == 1;
_loc14_ = (!!_loc12_ ? param2.x : (!!_loc13_ ? param2.y : param2.z)) - param1.coord;
if(_loc14_ >= param2.w)
{
if(boundIntersectSphere(param2,param1.positive.boundMinX,param1.positive.boundMinY,param1.positive.boundMinZ,param1.positive.boundMaxX,param1.positive.boundMaxY,param1.positive.boundMaxZ))
{
this.collectPlanesNode(param1.positive,param2,param3,param4,param5,param6,param7,param8,param9);
}
}
else if(_loc14_ <= -param2.w)
{
if(boundIntersectSphere(param2,param1.negative.boundMinX,param1.negative.boundMinY,param1.negative.boundMinZ,param1.negative.boundMaxX,param1.negative.boundMaxY,param1.negative.boundMaxZ))
{
this.collectPlanesNode(param1.negative,param2,param3,param4,param5,param6,param7,param8,param9);
}
}
else
{
_loc10_ = param1.objectList;
_loc11_ = param1.objectBoundList;
while(_loc10_ != null)
{
if(boundIntersectSphere(param2,_loc11_.boundMinX,_loc11_.boundMinY,_loc11_.boundMinZ,_loc11_.boundMaxX,_loc11_.boundMaxY,_loc11_.boundMaxZ))
{
_loc10_.composeAndAppend(this);
_loc10_.collectPlanes(param3,param4,param5,param6,param7,param8,param9);
}
_loc10_ = _loc10_.next;
_loc11_ = _loc11_.next;
}
if(boundIntersectSphere(param2,param1.positive.boundMinX,param1.positive.boundMinY,param1.positive.boundMinZ,param1.positive.boundMaxX,param1.positive.boundMaxY,param1.positive.boundMaxZ))
{
this.collectPlanesNode(param1.positive,param2,param3,param4,param5,param6,param7,param8,param9);
}
if(boundIntersectSphere(param2,param1.negative.boundMinX,param1.negative.boundMinY,param1.negative.boundMinZ,param1.negative.boundMaxX,param1.negative.boundMaxY,param1.negative.boundMaxZ))
{
this.collectPlanesNode(param1.negative,param2,param3,param4,param5,param6,param7,param8,param9);
}
}
}
else
{
_loc10_ = param1.objectList;
while(_loc10_ != null)
{
_loc10_.composeAndAppend(this);
_loc10_.collectPlanes(param3,param4,param5,param6,param7,param8,param9);
_loc10_ = _loc10_.next;
}
}
}
public function createDecal(param1:Vector3D, param2:Vector3D, param3:Number, param4:Number, param5:Number, param6:Number, param7:Material) : Decal
{
var _loc8_:Decal = new Decal();
_loc8_.attenuation = param6;
var _loc9_:Matrix3D = new Matrix3D();
_loc9_.appendRotation(param4 * 180 / Math.PI,Vector3D.Z_AXIS);
_loc9_.appendRotation(Math.atan2(-param2.z,Math.sqrt(param2.x * param2.x + param2.y * param2.y)) * 180 / Math.PI - 90,Vector3D.X_AXIS);
_loc9_.appendRotation(-Math.atan2(-param2.x,-param2.y) * 180 / Math.PI,Vector3D.Z_AXIS);
_loc9_.appendTranslation(param1.x,param1.y,param1.z);
_loc8_.matrix = _loc9_;
_loc8_.composeMatrix();
_loc8_.boundMinX = -param3;
_loc8_.boundMaxX = param3;
_loc8_.boundMinY = -param3;
_loc8_.boundMaxY = param3;
_loc8_.boundMinZ = -param6;
_loc8_.boundMaxZ = param6;
var _loc10_:Number = 1e+22;
var _loc11_:Number = 1e+22;
var _loc12_:Number = 1e+22;
var _loc13_:Number = -1e+22;
var _loc14_:Number = -1e+22;
var _loc15_:Number = -1e+22;
var _loc16_:Vertex = boundVertexList;
_loc16_.x = _loc8_.boundMinX;
_loc16_.y = _loc8_.boundMinY;
_loc16_.z = _loc8_.boundMinZ;
_loc16_ = _loc16_.next;
_loc16_.x = _loc8_.boundMaxX;
_loc16_.y = _loc8_.boundMinY;
_loc16_.z = _loc8_.boundMinZ;
_loc16_ = _loc16_.next;
_loc16_.x = _loc8_.boundMinX;
_loc16_.y = _loc8_.boundMaxY;
_loc16_.z = _loc8_.boundMinZ;
_loc16_ = _loc16_.next;
_loc16_.x = _loc8_.boundMaxX;
_loc16_.y = _loc8_.boundMaxY;
_loc16_.z = _loc8_.boundMinZ;
_loc16_ = _loc16_.next;
_loc16_.x = _loc8_.boundMinX;
_loc16_.y = _loc8_.boundMinY;
_loc16_.z = _loc8_.boundMaxZ;
_loc16_ = _loc16_.next;
_loc16_.x = _loc8_.boundMaxX;
_loc16_.y = _loc8_.boundMinY;
_loc16_.z = _loc8_.boundMaxZ;
_loc16_ = _loc16_.next;
_loc16_.x = _loc8_.boundMinX;
_loc16_.y = _loc8_.boundMaxY;
_loc16_.z = _loc8_.boundMaxZ;
_loc16_ = _loc16_.next;
_loc16_.x = _loc8_.boundMaxX;
_loc16_.y = _loc8_.boundMaxY;
_loc16_.z = _loc8_.boundMaxZ;
_loc16_ = boundVertexList;
while(_loc16_ != null)
{
_loc16_.cameraX = _loc8_.ma * _loc16_.x + _loc8_.mb * _loc16_.y + _loc8_.mc * _loc16_.z + _loc8_.md;
_loc16_.cameraY = _loc8_.me * _loc16_.x + _loc8_.mf * _loc16_.y + _loc8_.mg * _loc16_.z + _loc8_.mh;
_loc16_.cameraZ = _loc8_.mi * _loc16_.x + _loc8_.mj * _loc16_.y + _loc8_.mk * _loc16_.z + _loc8_.ml;
if(_loc16_.cameraX < _loc10_)
{
_loc10_ = _loc16_.cameraX;
}
if(_loc16_.cameraX > _loc13_)
{
_loc13_ = _loc16_.cameraX;
}
if(_loc16_.cameraY < _loc11_)
{
_loc11_ = _loc16_.cameraY;
}
if(_loc16_.cameraY > _loc14_)
{
_loc14_ = _loc16_.cameraY;
}
if(_loc16_.cameraZ < _loc12_)
{
_loc12_ = _loc16_.cameraZ;
}
if(_loc16_.cameraZ > _loc15_)
{
_loc15_ = _loc16_.cameraZ;
}
_loc16_ = _loc16_.next;
}
_loc8_.invertMatrix();
if(param5 > Math.PI / 2)
{
param5 = Math.PI / 2;
}
if(this.root != null)
{
this.root.collectPolygons(_loc8_,Math.sqrt(param3 * param3 + param3 * param3 + param6 * param6),Math.cos(param5) - 0.001,_loc10_,_loc13_,_loc11_,_loc14_,_loc12_,_loc15_);
}
if(_loc8_.faceList != null)
{
_loc8_.calculateBounds();
}
else
{
_loc8_.boundMinX = -1;
_loc8_.boundMinY = -1;
_loc8_.boundMinZ = -1;
_loc8_.boundMaxX = 1;
_loc8_.boundMaxY = 1;
_loc8_.boundMaxZ = 1;
}
_loc8_.setMaterialToAllFaces(param7);
return _loc8_;
}
override public function clone() : Object3D
{
var _loc1_:KDContainer = new KDContainer();
_loc1_.clonePropertiesFrom(this);
return _loc1_;
}
override protected function clonePropertiesFrom(param1:Object3D) : void
{
super.clonePropertiesFrom(param1);
var _loc2_:KDContainer = param1 as KDContainer;
this.debugAlphaFade = _loc2_.debugAlphaFade;
if(_loc2_.root != null)
{
this.root = _loc2_.cloneNode(_loc2_.root,this);
}
}
private function cloneNode(param1:KDNode, param2:Object3DContainer) : KDNode
{
var _loc4_:Object3D = null;
var _loc5_:Object3D = null;
var _loc6_:Object3D = null;
var _loc3_:KDNode = new KDNode();
_loc3_.axis = param1.axis;
_loc3_.coord = param1.coord;
_loc3_.minCoord = param1.minCoord;
_loc3_.maxCoord = param1.maxCoord;
_loc3_.boundMinX = param1.boundMinX;
_loc3_.boundMinY = param1.boundMinY;
_loc3_.boundMinZ = param1.boundMinZ;
_loc3_.boundMaxX = param1.boundMaxX;
_loc3_.boundMaxY = param1.boundMaxY;
_loc3_.boundMaxZ = param1.boundMaxZ;
_loc4_ = param1.objectList;
_loc5_ = null;
while(_loc4_ != null)
{
_loc6_ = _loc4_.clone();
if(_loc3_.objectList != null)
{
_loc5_.next = _loc6_;
}
else
{
_loc3_.objectList = _loc6_;
}
_loc5_ = _loc6_;
_loc6_.setParent(param2);
_loc4_ = _loc4_.next;
}
_loc4_ = param1.objectBoundList;
_loc5_ = null;
while(_loc4_ != null)
{
_loc6_ = _loc4_.clone();
if(_loc3_.objectBoundList != null)
{
_loc5_.next = _loc6_;
}
else
{
_loc3_.objectBoundList = _loc6_;
}
_loc5_ = _loc6_;
_loc4_ = _loc4_.next;
}
_loc4_ = param1.occluderList;
_loc5_ = null;
while(_loc4_ != null)
{
_loc6_ = _loc4_.clone();
if(_loc3_.occluderList != null)
{
_loc5_.next = _loc6_;
}
else
{
_loc3_.occluderList = _loc6_;
}
_loc5_ = _loc6_;
_loc6_.setParent(param2);
_loc4_ = _loc4_.next;
}
_loc4_ = param1.occluderBoundList;
_loc5_ = null;
while(_loc4_ != null)
{
_loc6_ = _loc4_.clone();
if(_loc3_.occluderBoundList != null)
{
_loc5_.next = _loc6_;
}
else
{
_loc3_.occluderBoundList = _loc6_;
}
_loc5_ = _loc6_;
_loc4_ = _loc4_.next;
}
if(param1.negative != null)
{
_loc3_.negative = this.cloneNode(param1.negative,param2);
}
if(param1.positive != null)
{
_loc3_.positive = this.cloneNode(param1.positive,param2);
}
return _loc3_;
}
override alternativa3d function draw(param1:Camera3D) : void
{
var _loc2_:int = 0;
var _loc3_:Object3D = null;
var _loc4_:VG = null;
var _loc5_:VG = null;
var _loc7_:Boolean = false;
var _loc8_:Object3D = null;
var _loc9_:VG = null;
var _loc10_:int = 0;
var _loc11_:Vertex = null;
var _loc12_:Vertex = null;
var _loc13_:ShadowAtlas = null;
this.uploadResources(param1.device);
calculateInverseMatrix();
var _loc6_:int = !!param1.debug ? int(int(param1.checkInDebug(this))) : int(int(0));
if(_loc6_ & Debug.BOUNDS)
{
Debug.drawBounds(param1,this,boundMinX,boundMinY,boundMinZ,boundMaxX,boundMaxY,boundMaxZ);
}
if(this.batched)
{
_loc7_ = param1.debug;
if(_loc6_ && _loc6_ & Debug.NODES)
{
param1.debug = false;
}
_loc3_ = this.opaqueList;
while(_loc3_ != null)
{
_loc3_.ma = ma;
_loc3_.mb = mb;
_loc3_.mc = mc;
_loc3_.md = md;
_loc3_.me = me;
_loc3_.mf = mf;
_loc3_.mg = mg;
_loc3_.mh = mh;
_loc3_.mi = mi;
_loc3_.mj = mj;
_loc3_.mk = mk;
_loc3_.ml = ml;
_loc3_.concat(this);
_loc3_.draw(param1);
if(!param1.view.constrained && param1.shadowMap != null && param1.shadowMapStrength > 0 && _loc3_.concatenatedAlpha >= _loc3_.shadowMapAlphaThreshold)
{
param1.casterObjects[param1.casterCount] = _loc3_;
++param1.casterCount;
}
_loc3_ = _loc3_.next;
}
param1.debug = _loc7_;
_loc5_ = super.getVG(param1);
if(!param1.view.constrained && param1.shadowMap != null && param1.shadowMapStrength > 0)
{
_loc3_ = childrenList;
while(_loc3_ != null)
{
if(_loc3_.visible)
{
if(_loc3_ is Mesh || _loc3_ is BSP || _loc3_ is Sprite3D)
{
if(_loc3_.concatenatedAlpha >= _loc3_.shadowMapAlphaThreshold)
{
param1.casterObjects[param1.casterCount] = _loc3_;
++param1.casterCount;
}
}
else if(_loc3_ is Object3DContainer)
{
_loc8_ = Object3DContainer(_loc3_).childrenList;
while(_loc8_ != null)
{
if((_loc8_ is Mesh || _loc8_ is BSP || _loc8_ is Sprite3D) && _loc8_.concatenatedAlpha >= _loc8_.shadowMapAlphaThreshold)
{
param1.casterObjects[param1.casterCount] = _loc8_;
++param1.casterCount;
}
_loc8_ = _loc8_.next;
}
}
}
_loc3_ = _loc3_.next;
}
}
_loc2_ = 0;
while(_loc2_ < this.transparentLength)
{
_loc3_ = this.transparent[_loc2_];
_loc3_.composeAndAppend(this);
if(_loc3_.cullingInCamera(param1,culling) >= 0)
{
_loc3_.concat(this);
_loc9_ = _loc3_.getVG(param1);
if(_loc9_ != null)
{
_loc9_.next = _loc5_;
_loc5_ = _loc9_;
}
}
if(!param1.view.constrained && param1.shadowMap != null && param1.shadowMapStrength > 0 && _loc3_.concatenatedAlpha >= _loc3_.shadowMapAlphaThreshold)
{
param1.casterObjects[param1.casterCount] = _loc3_;
++param1.casterCount;
}
_loc2_++;
}
if(_loc5_ != null)
{
if(_loc5_.next != null)
{
if(resolveByAABB)
{
_loc4_ = _loc5_;
while(_loc4_ != null)
{
_loc4_.calculateAABB(ima,imb,imc,imd,ime,imf,img,imh,imi,imj,imk,iml);
_loc4_ = _loc4_.next;
}
drawAABBGeometry(param1,_loc5_);
}
else if(resolveByOOBB)
{
_loc4_ = _loc5_;
while(_loc4_ != null)
{
_loc4_.calculateOOBB(this);
_loc4_ = _loc4_.next;
}
drawOOBBGeometry(param1,_loc5_);
}
else
{
drawConflictGeometry(param1,_loc5_);
}
}
else
{
_loc5_.draw(param1,threshold,this);
_loc5_.destroy();
}
}
}
else if(this.root != null)
{
this.calculateCameraPlanes(param1.nearClipping,param1.farClipping);
_loc10_ = this.cullingInContainer(culling,this.root.boundMinX,this.root.boundMinY,this.root.boundMinZ,this.root.boundMaxX,this.root.boundMaxY,this.root.boundMaxZ);
if(_loc10_ >= 0)
{
this.numOccluders = 0;
if(param1.numOccluders > 0)
{
this.updateOccluders(param1);
}
_loc5_ = super.getVG(param1);
_loc4_ = _loc5_;
while(_loc4_ != null)
{
_loc4_.calculateAABB(ima,imb,imc,imd,ime,imf,img,imh,imi,imj,imk,iml);
_loc4_ = _loc4_.next;
}
this.drawNode(this.root,_loc10_,param1,_loc5_);
_loc2_ = 0;
while(_loc2_ < this.numOccluders)
{
_loc11_ = this.occluders[_loc2_];
_loc12_ = _loc11_;
while(_loc12_.next != null)
{
_loc12_ = _loc12_.next;
}
_loc12_.next = Vertex.collector;
Vertex.collector = _loc11_;
this.occluders[_loc2_] = null;
_loc2_++;
}
this.numOccluders = 0;
}
else
{
super.draw(param1);
}
}
else
{
super.draw(param1);
}
if(this.root != null && _loc6_ & Debug.NODES)
{
this.debugNode(this.root,_loc10_,param1,1);
Debug.drawBounds(param1,this,this.root.boundMinX,this.root.boundMinY,this.root.boundMinZ,this.root.boundMaxX,this.root.boundMaxY,this.root.boundMaxZ,14496733);
}
if(this.root != null)
{
param1.receiversVertexBuffers = this.receiversVertexBuffers;
param1.receiversIndexBuffers = this.receiversIndexBuffers;
for each(_loc13_ in param1.shadowAtlases)
{
_loc2_ = 0;
while(_loc2_ < _loc13_.shadowsCount)
{
this.root.collectReceivers(_loc13_.shadows[_loc2_]);
_loc2_++;
}
}
}
}
override alternativa3d function getVG(param1:Camera3D) : VG
{
var _loc3_:int = 0;
var _loc2_:VG = super.getVG(param1);
if(this.root != null)
{
this.numOccluders = 0;
calculateInverseMatrix();
this.calculateCameraPlanes(param1.nearClipping,param1.farClipping);
_loc3_ = this.cullingInContainer(culling,this.root.boundMinX,this.root.boundMinY,this.root.boundMinZ,this.root.boundMaxX,this.root.boundMaxY,this.root.boundMaxZ);
if(_loc3_ >= 0)
{
_loc2_ = this.collectVGNode(this.root,_loc3_,param1,_loc2_);
}
}
return _loc2_;
}
private function collectVGNode(param1:KDNode, param2:int, param3:Camera3D, param4:VG = null) : VG
{
var _loc5_:VG = null;
var _loc6_:VG = null;
var _loc9_:VG = null;
var _loc10_:int = 0;
var _loc11_:int = 0;
var _loc7_:Object3D = param1.objectList;
var _loc8_:Object3D = param1.objectBoundList;
while(_loc7_ != null)
{
if(_loc7_.visible && ((_loc7_.culling = param2) == 0 || (_loc7_.culling = this.cullingInContainer(param2,_loc8_.boundMinX,_loc8_.boundMinY,_loc8_.boundMinZ,_loc8_.boundMaxX,_loc8_.boundMaxY,_loc8_.boundMaxZ)) >= 0))
{
_loc7_.composeAndAppend(this);
_loc7_.concat(this);
_loc9_ = _loc7_.getVG(param3);
if(_loc9_ != null)
{
if(_loc5_ != null)
{
_loc6_.next = _loc9_;
}
else
{
_loc5_ = _loc9_;
_loc6_ = _loc9_;
}
while(_loc6_.next != null)
{
_loc6_ = _loc6_.next;
}
}
}
_loc7_ = _loc7_.next;
_loc8_ = _loc8_.next;
}
if(_loc5_ != null)
{
_loc6_.next = param4;
param4 = _loc5_;
}
if(param1.negative != null)
{
_loc10_ = param2 > 0 ? int(int(this.cullingInContainer(param2,param1.negative.boundMinX,param1.negative.boundMinY,param1.negative.boundMinZ,param1.negative.boundMaxX,param1.negative.boundMaxY,param1.negative.boundMaxZ))) : int(int(0));
_loc11_ = param2 > 0 ? int(int(this.cullingInContainer(param2,param1.positive.boundMinX,param1.positive.boundMinY,param1.positive.boundMinZ,param1.positive.boundMaxX,param1.positive.boundMaxY,param1.positive.boundMaxZ))) : int(int(0));
if(_loc10_ >= 0)
{
param4 = this.collectVGNode(param1.negative,_loc10_,param3,param4);
}
if(_loc11_ >= 0)
{
param4 = this.collectVGNode(param1.positive,_loc11_,param3,param4);
}
}
return param4;
}
private function uploadResources(param1:Device) : void
{
var _loc2_:* = undefined;
var _loc3_:Object3D = null;
var _loc4_:Mesh = null;
var _loc5_:BSP = null;
var _loc7_:TextureMaterial = null;
if(this.isCreated)
{
return;
}
this.isCreated = true;
for(_loc2_ in this.materials)
{
_loc7_ = _loc2_ as TextureMaterial;
if(_loc7_.texture != null)
{
param1.uploadResource(_loc7_.textureResource);
}
if(_loc7_._textureATF != null)
{
param1.uploadResource(_loc7_.textureATFResource);
}
if(_loc7_._textureATFAlpha != null)
{
param1.uploadResource(_loc7_.textureATFAlphaResource);
}
}
_loc3_ = this.opaqueList;
while(_loc3_ != null)
{
if(_loc3_ is Mesh)
{
_loc4_ = _loc3_ as Mesh;
_loc4_.prepareResources();
param1.uploadResource(_loc4_.vertexBuffer);
param1.uploadResource(_loc4_.indexBuffer);
}
else if(_loc3_ is BSP)
{
_loc5_ = _loc3_ as BSP;
_loc5_.prepareResources();
param1.uploadResource(_loc5_.vertexBuffer);
param1.uploadResource(_loc5_.indexBuffer);
}
_loc3_ = _loc3_.next;
}
var _loc6_:int = 0;
while(_loc6_ < this.transparentLength)
{
_loc3_ = this.transparent[_loc6_];
if(_loc3_ is Mesh)
{
_loc4_ = _loc3_ as Mesh;
_loc4_.prepareResources();
param1.uploadResource(_loc4_.vertexBuffer);
param1.uploadResource(_loc4_.indexBuffer);
}
else if(_loc3_ is BSP)
{
_loc5_ = _loc3_ as BSP;
_loc5_.prepareResources();
param1.uploadResource(_loc5_.vertexBuffer);
param1.uploadResource(_loc5_.indexBuffer);
}
_loc6_++;
}
_loc6_ = 0;
while(_loc6_ < this.receiversVertexBuffers.length)
{
param1.uploadResource(this.receiversVertexBuffers[_loc6_]);
param1.uploadResource(this.receiversIndexBuffers[_loc6_]);
_loc6_++;
}
}
override alternativa3d function updateBounds(param1:Object3D, param2:Object3D = null) : void
{
super.updateBounds(param1,param2);
if(this.root != null)
{
if(param2 != null)
{
this.updateBoundsNode(this.root,param1,param2);
}
else
{
if(this.root.boundMinX < param1.boundMinX)
{
param1.boundMinX = this.root.boundMinX;
}
if(this.root.boundMaxX > param1.boundMaxX)
{
param1.boundMaxX = this.root.boundMaxX;
}
if(this.root.boundMinY < param1.boundMinY)
{
param1.boundMinY = this.root.boundMinY;
}
if(this.root.boundMaxY > param1.boundMaxY)
{
param1.boundMaxY = this.root.boundMaxY;
}
if(this.root.boundMinZ < param1.boundMinZ)
{
param1.boundMinZ = this.root.boundMinZ;
}
if(this.root.boundMaxZ > param1.boundMaxZ)
{
param1.boundMaxZ = this.root.boundMaxZ;
}
}
}
}
private function updateBoundsNode(param1:KDNode, param2:Object3D, param3:Object3D) : void
{
var _loc4_:Object3D = param1.objectList;
while(_loc4_ != null)
{
if(param3 != null)
{
_loc4_.composeAndAppend(param3);
}
else
{
_loc4_.composeMatrix();
}
_loc4_.updateBounds(param2,_loc4_);
_loc4_ = _loc4_.next;
}
if(param1.negative != null)
{
this.updateBoundsNode(param1.negative,param2,param3);
this.updateBoundsNode(param1.positive,param2,param3);
}
}
private function debugNode(param1:KDNode, param2:int, param3:Camera3D, param4:Number) : void
{
var _loc5_:int = 0;
var _loc6_:int = 0;
if(param1 != null && param1.negative != null)
{
_loc5_ = param2 > 0 ? int(int(this.cullingInContainer(param2,param1.negative.boundMinX,param1.negative.boundMinY,param1.negative.boundMinZ,param1.negative.boundMaxX,param1.negative.boundMaxY,param1.negative.boundMaxZ))) : int(int(0));
_loc6_ = param2 > 0 ? int(int(this.cullingInContainer(param2,param1.positive.boundMinX,param1.positive.boundMinY,param1.positive.boundMinZ,param1.positive.boundMaxX,param1.positive.boundMaxY,param1.positive.boundMaxZ))) : int(int(0));
if(_loc5_ >= 0)
{
this.debugNode(param1.negative,_loc5_,param3,param4 * this.debugAlphaFade);
}
Debug.drawKDNode(param3,this,param1.axis,param1.coord,param1.boundMinX,param1.boundMinY,param1.boundMinZ,param1.boundMaxX,param1.boundMaxY,param1.boundMaxZ,param4);
if(_loc6_ >= 0)
{
this.debugNode(param1.positive,_loc6_,param3,param4 * this.debugAlphaFade);
}
}
}
private function drawNode(param1:KDNode, param2:int, param3:Camera3D, param4:VG) : void
{
var _loc6_:VG = null;
var _loc7_:VG = null;
var _loc8_:VG = null;
var _loc9_:VG = null;
var _loc10_:Object3D = null;
var _loc11_:Object3D = null;
var _loc12_:int = 0;
var _loc13_:int = 0;
var _loc14_:Boolean = false;
var _loc15_:Boolean = false;
var _loc16_:Number = NaN;
var _loc17_:Number = NaN;
if(param3.occludedAll)
{
while(param4 != null)
{
_loc6_ = param4.next;
param4.destroy();
param4 = _loc6_;
}
return;
}
if(param1.negative != null)
{
_loc12_ = param2 > 0 || this.numOccluders > 0 ? int(int(this.cullingInContainer(param2,param1.negative.boundMinX,param1.negative.boundMinY,param1.negative.boundMinZ,param1.negative.boundMaxX,param1.negative.boundMaxY,param1.negative.boundMaxZ))) : int(int(0));
_loc13_ = param2 > 0 || this.numOccluders > 0 ? int(int(this.cullingInContainer(param2,param1.positive.boundMinX,param1.positive.boundMinY,param1.positive.boundMinZ,param1.positive.boundMaxX,param1.positive.boundMaxY,param1.positive.boundMaxZ))) : int(int(0));
_loc14_ = param1.axis == 0;
_loc15_ = param1.axis == 1;
if(_loc12_ >= 0 && _loc13_ >= 0)
{
while(param4 != null)
{
_loc6_ = param4.next;
if(param4.numOccluders < this.numOccluders && this.occludeGeometry(param3,param4))
{
param4.destroy();
}
else
{
_loc16_ = !!_loc14_ ? Number(Number(param4.boundMinX)) : (!!_loc15_ ? Number(Number(param4.boundMinY)) : Number(Number(param4.boundMinZ)));
_loc17_ = !!_loc14_ ? Number(Number(param4.boundMaxX)) : (!!_loc15_ ? Number(Number(param4.boundMaxY)) : Number(Number(param4.boundMaxZ)));
if(_loc17_ <= param1.maxCoord)
{
if(_loc16_ < param1.minCoord)
{
param4.next = _loc7_;
_loc7_ = param4;
}
else
{
param4.next = _loc8_;
_loc8_ = param4;
}
}
else if(_loc16_ >= param1.minCoord)
{
param4.next = _loc9_;
_loc9_ = param4;
}
else
{
param4.split(param3,param1.axis == 0 ? Number(Number(1)) : Number(Number(0)),param1.axis == 1 ? Number(Number(1)) : Number(Number(0)),param1.axis == 2 ? Number(Number(1)) : Number(Number(0)),param1.coord,threshold);
if(param4.next != null)
{
param4.next.next = _loc7_;
_loc7_ = param4.next;
}
if(param4.faceStruct != null)
{
param4.next = _loc9_;
_loc9_ = param4;
}
else
{
param4.destroy();
}
}
}
param4 = _loc6_;
}
if(_loc14_ && imd > param1.coord || _loc15_ && imh > param1.coord || !_loc14_ && !_loc15_ && iml > param1.coord)
{
this.drawNode(param1.positive,_loc13_,param3,_loc9_);
while(_loc8_ != null)
{
_loc6_ = _loc8_.next;
if(_loc8_.numOccluders >= this.numOccluders || !this.occludeGeometry(param3,_loc8_))
{
_loc8_.draw(param3,threshold,this);
}
_loc8_.destroy();
_loc8_ = _loc6_;
}
_loc10_ = param1.objectList;
_loc11_ = param1.objectBoundList;
while(_loc10_ != null)
{
if(_loc10_.visible && ((_loc10_.culling = param2) == 0 && this.numOccluders == 0 || (_loc10_.culling = this.cullingInContainer(param2,_loc11_.boundMinX,_loc11_.boundMinY,_loc11_.boundMinZ,_loc11_.boundMaxX,_loc11_.boundMaxY,_loc11_.boundMaxZ)) >= 0))
{
_loc10_.copyAndAppend(_loc11_,this);
_loc10_.concat(this);
_loc10_.draw(param3);
}
_loc10_ = _loc10_.next;
_loc11_ = _loc11_.next;
}
_loc10_ = param1.occluderList;
_loc11_ = param1.occluderBoundList;
while(_loc10_ != null)
{
if(_loc10_.visible && ((_loc10_.culling = param2) == 0 && this.numOccluders == 0 || (_loc10_.culling = this.cullingInContainer(param2,_loc11_.boundMinX,_loc11_.boundMinY,_loc11_.boundMinZ,_loc11_.boundMaxX,_loc11_.boundMaxY,_loc11_.boundMaxZ)) >= 0))
{
_loc10_.copyAndAppend(_loc11_,this);
_loc10_.concat(this);
_loc10_.draw(param3);
}
_loc10_ = _loc10_.next;
_loc11_ = _loc11_.next;
}
if(param1.occluderList != null)
{
this.updateOccluders(param3);
}
this.drawNode(param1.negative,_loc12_,param3,_loc7_);
}
else
{
this.drawNode(param1.negative,_loc12_,param3,_loc7_);
while(_loc8_ != null)
{
_loc6_ = _loc8_.next;
if(_loc8_.numOccluders >= this.numOccluders || !this.occludeGeometry(param3,_loc8_))
{
_loc8_.draw(param3,threshold,this);
}
_loc8_.destroy();
_loc8_ = _loc6_;
}
_loc10_ = param1.objectList;
_loc11_ = param1.objectBoundList;
while(_loc10_ != null)
{
if(_loc10_.visible && ((_loc10_.culling = param2) == 0 && this.numOccluders == 0 || (_loc10_.culling = this.cullingInContainer(param2,_loc11_.boundMinX,_loc11_.boundMinY,_loc11_.boundMinZ,_loc11_.boundMaxX,_loc11_.boundMaxY,_loc11_.boundMaxZ)) >= 0))
{
_loc10_.copyAndAppend(_loc11_,this);
_loc10_.concat(this);
_loc10_.draw(param3);
}
_loc10_ = _loc10_.next;
_loc11_ = _loc11_.next;
}
_loc10_ = param1.occluderList;
_loc11_ = param1.occluderBoundList;
while(_loc10_ != null)
{
if(_loc10_.visible && ((_loc10_.culling = param2) == 0 && this.numOccluders == 0 || (_loc10_.culling = this.cullingInContainer(param2,_loc11_.boundMinX,_loc11_.boundMinY,_loc11_.boundMinZ,_loc11_.boundMaxX,_loc11_.boundMaxY,_loc11_.boundMaxZ)) >= 0))
{
_loc10_.copyAndAppend(_loc11_,this);
_loc10_.concat(this);
_loc10_.draw(param3);
}
_loc10_ = _loc10_.next;
_loc11_ = _loc11_.next;
}
if(param1.occluderList != null)
{
this.updateOccluders(param3);
}
this.drawNode(param1.positive,_loc13_,param3,_loc9_);
}
}
else if(_loc12_ >= 0)
{
while(param4 != null)
{
_loc6_ = param4.next;
if(param4.numOccluders < this.numOccluders && this.occludeGeometry(param3,param4))
{
param4.destroy();
}
else
{
_loc16_ = !!_loc14_ ? Number(Number(param4.boundMinX)) : (!!_loc15_ ? Number(Number(param4.boundMinY)) : Number(Number(param4.boundMinZ)));
_loc17_ = !!_loc14_ ? Number(Number(param4.boundMaxX)) : (!!_loc15_ ? Number(Number(param4.boundMaxY)) : Number(Number(param4.boundMaxZ)));
if(_loc17_ <= param1.maxCoord)
{
param4.next = _loc7_;
_loc7_ = param4;
}
else if(_loc16_ >= param1.minCoord)
{
param4.destroy();
}
else
{
param4.crop(param3,param1.axis == 0 ? Number(Number(-1)) : Number(Number(0)),param1.axis == 1 ? Number(Number(-1)) : Number(Number(0)),param1.axis == 2 ? Number(Number(-1)) : Number(Number(0)),-param1.coord,threshold);
if(param4.faceStruct != null)
{
param4.next = _loc7_;
_loc7_ = param4;
}
else
{
param4.destroy();
}
}
}
param4 = _loc6_;
}
this.drawNode(param1.negative,_loc12_,param3,_loc7_);
}
else if(_loc13_ >= 0)
{
while(param4 != null)
{
_loc6_ = param4.next;
if(param4.numOccluders < this.numOccluders && this.occludeGeometry(param3,param4))
{
param4.destroy();
}
else
{
_loc16_ = !!_loc14_ ? Number(Number(param4.boundMinX)) : (!!_loc15_ ? Number(Number(param4.boundMinY)) : Number(Number(param4.boundMinZ)));
_loc17_ = !!_loc14_ ? Number(Number(param4.boundMaxX)) : (!!_loc15_ ? Number(Number(param4.boundMaxY)) : Number(Number(param4.boundMaxZ)));
if(_loc17_ <= param1.maxCoord)
{
param4.destroy();
}
else if(_loc16_ >= param1.minCoord)
{
param4.next = _loc9_;
_loc9_ = param4;
}
else
{
param4.crop(param3,param1.axis == 0 ? Number(Number(1)) : Number(Number(0)),param1.axis == 1 ? Number(Number(1)) : Number(Number(0)),param1.axis == 2 ? Number(Number(1)) : Number(Number(0)),param1.coord,threshold);
if(param4.faceStruct != null)
{
param4.next = _loc9_;
_loc9_ = param4;
}
else
{
param4.destroy();
}
}
}
param4 = _loc6_;
}
this.drawNode(param1.positive,_loc13_,param3,_loc9_);
}
else
{
while(param4 != null)
{
_loc6_ = param4.next;
param4.destroy();
param4 = _loc6_;
}
}
}
else
{
if(param1.objectList != null)
{
if(param1.objectList.next != null || param4 != null)
{
while(param4 != null)
{
_loc6_ = param4.next;
if(param4.numOccluders < this.numOccluders && this.occludeGeometry(param3,param4))
{
param4.destroy();
}
else
{
param4.next = _loc8_;
_loc8_ = param4;
}
param4 = _loc6_;
}
_loc10_ = param1.objectList;
_loc11_ = param1.objectBoundList;
while(_loc10_ != null)
{
if(_loc10_.visible && ((_loc10_.culling = param2) == 0 && this.numOccluders == 0 || (_loc10_.culling = this.cullingInContainer(param2,_loc11_.boundMinX,_loc11_.boundMinY,_loc11_.boundMinZ,_loc11_.boundMaxX,_loc11_.boundMaxY,_loc11_.boundMaxZ)) >= 0))
{
_loc10_.copyAndAppend(_loc11_,this);
_loc10_.concat(this);
param4 = _loc10_.getVG(param3);
while(param4 != null)
{
_loc6_ = param4.next;
param4.next = _loc8_;
_loc8_ = param4;
param4 = _loc6_;
}
}
_loc10_ = _loc10_.next;
_loc11_ = _loc11_.next;
}
if(_loc8_ != null)
{
if(_loc8_.next != null)
{
drawConflictGeometry(param3,_loc8_);
}
else
{
_loc8_.draw(param3,threshold,this);
_loc8_.destroy();
}
}
}
else
{
_loc10_ = param1.objectList;
if(_loc10_.visible)
{
_loc10_.copyAndAppend(param1.objectBoundList,this);
_loc10_.culling = param2;
_loc10_.concat(this);
_loc10_.draw(param3);
}
}
}
else if(param4 != null)
{
if(param4.next != null)
{
if(this.numOccluders > 0)
{
while(param4 != null)
{
_loc6_ = param4.next;
if(param4.numOccluders < this.numOccluders && this.occludeGeometry(param3,param4))
{
param4.destroy();
}
else
{
param4.next = _loc8_;
_loc8_ = param4;
}
param4 = _loc6_;
}
if(_loc8_ != null)
{
if(_loc8_.next != null)
{
if(resolveByAABB)
{
drawAABBGeometry(param3,_loc8_);
}
else if(resolveByOOBB)
{
param4 = _loc8_;
while(param4 != null)
{
param4.calculateOOBB(this);
param4 = param4.next;
}
drawOOBBGeometry(param3,_loc8_);
}
else
{
drawConflictGeometry(param3,_loc8_);
}
}
else
{
_loc8_.draw(param3,threshold,this);
_loc8_.destroy();
}
}
}
else
{
_loc8_ = param4;
if(resolveByAABB)
{
drawAABBGeometry(param3,_loc8_);
}
else if(resolveByOOBB)
{
param4 = _loc8_;
while(param4 != null)
{
param4.calculateOOBB(this);
param4 = param4.next;
}
drawOOBBGeometry(param3,_loc8_);
}
else
{
drawConflictGeometry(param3,_loc8_);
}
}
}
else
{
if(param4.numOccluders >= this.numOccluders || !this.occludeGeometry(param3,param4))
{
param4.draw(param3,threshold,this);
}
param4.destroy();
}
}
_loc10_ = param1.occluderList;
_loc11_ = param1.occluderBoundList;
while(_loc10_ != null)
{
if(_loc10_.visible && ((_loc10_.culling = param2) == 0 && this.numOccluders == 0 || (_loc10_.culling = this.cullingInContainer(param2,_loc11_.boundMinX,_loc11_.boundMinY,_loc11_.boundMinZ,_loc11_.boundMaxX,_loc11_.boundMaxY,_loc11_.boundMaxZ)) >= 0))
{
_loc10_.copyAndAppend(_loc11_,this);
_loc10_.concat(this);
_loc10_.draw(param3);
}
_loc10_ = _loc10_.next;
_loc11_ = _loc11_.next;
}
if(param1.occluderList != null)
{
this.updateOccluders(param3);
}
}
}
private function createObjectBounds(param1:Object3D) : Object3D
{
var _loc2_:Object3D = new Object3D();
_loc2_.boundMinX = 1e+22;
_loc2_.boundMinY = 1e+22;
_loc2_.boundMinZ = 1e+22;
_loc2_.boundMaxX = -1e+22;
_loc2_.boundMaxY = -1e+22;
_loc2_.boundMaxZ = -1e+22;
param1.composeMatrix();
param1.updateBounds(_loc2_,param1);
_loc2_.ma = param1.ma;
_loc2_.mb = param1.mb;
_loc2_.mc = param1.mc;
_loc2_.md = param1.md;
_loc2_.me = param1.me;
_loc2_.mf = param1.mf;
_loc2_.mg = param1.mg;
_loc2_.mh = param1.mh;
_loc2_.mi = param1.mi;
_loc2_.mj = param1.mj;
_loc2_.mk = param1.mk;
_loc2_.ml = param1.ml;
return _loc2_;
}
private function createNode(param1:Object3D, param2:Object3D, param3:Object3D, param4:Object3D, param5:Number, param6:Number, param7:Number, param8:Number, param9:Number, param10:Number) : KDNode
{
var _loc12_:int = 0;
var _loc13_:int = 0;
var _loc14_:Object3D = null;
var _loc15_:Object3D = null;
var _loc16_:Number = NaN;
var _loc21_:Number = NaN;
var _loc23_:int = 0;
var _loc24_:int = 0;
var _loc25_:Number = NaN;
var _loc26_:Number = NaN;
var _loc27_:Number = NaN;
var _loc28_:Number = NaN;
var _loc29_:Object3D = null;
var _loc30_:Object3D = null;
var _loc31_:Object3D = null;
var _loc32_:Object3D = null;
var _loc33_:Object3D = null;
var _loc34_:Object3D = null;
var _loc35_:Object3D = null;
var _loc36_:Object3D = null;
var _loc37_:Number = NaN;
var _loc38_:Number = NaN;
var _loc39_:Object3D = null;
var _loc40_:Object3D = null;
var _loc41_:Number = NaN;
var _loc42_:Number = NaN;
var _loc43_:Number = NaN;
var _loc44_:Number = NaN;
var _loc45_:Number = NaN;
var _loc46_:Number = NaN;
var _loc47_:Number = NaN;
var _loc48_:Number = NaN;
var _loc49_:Number = NaN;
var _loc50_:Number = NaN;
var _loc51_:Number = NaN;
var _loc52_:Number = NaN;
var _loc11_:KDNode = new KDNode();
_loc11_.boundMinX = param5;
_loc11_.boundMinY = param6;
_loc11_.boundMinZ = param7;
_loc11_.boundMaxX = param8;
_loc11_.boundMaxY = param9;
_loc11_.boundMaxZ = param10;
if(param1 == null)
{
if(param3 != null)
{
}
return _loc11_;
}
var _loc17_:int = 0;
var _loc18_:int = 0;
var _loc19_:int = 0;
_loc15_ = param2;
while(_loc15_ != null)
{
if(_loc15_.boundMinX > param5 + threshold)
{
_loc13_ = 0;
while(_loc13_ < _loc17_)
{
if(_loc15_.boundMinX >= splitCoordsX[_loc13_] - threshold && _loc15_.boundMinX <= splitCoordsX[_loc13_] + threshold)
{
break;
}
_loc13_++;
}
if(_loc13_ == _loc17_)
{
var _loc53_:* = _loc17_++;
splitCoordsX[_loc53_] = _loc15_.boundMinX;
}
}
if(_loc15_.boundMaxX < param8 - threshold)
{
_loc13_ = 0;
while(_loc13_ < _loc17_)
{
if(_loc15_.boundMaxX >= splitCoordsX[_loc13_] - threshold && _loc15_.boundMaxX <= splitCoordsX[_loc13_] + threshold)
{
break;
}
_loc13_++;
}
if(_loc13_ == _loc17_)
{
_loc53_ = _loc17_++;
splitCoordsX[_loc53_] = _loc15_.boundMaxX;
}
}
if(_loc15_.boundMinY > param6 + threshold)
{
_loc13_ = 0;
while(_loc13_ < _loc18_)
{
if(_loc15_.boundMinY >= splitCoordsY[_loc13_] - threshold && _loc15_.boundMinY <= splitCoordsY[_loc13_] + threshold)
{
break;
}
_loc13_++;
}
if(_loc13_ == _loc18_)
{
_loc53_ = _loc18_++;
splitCoordsY[_loc53_] = _loc15_.boundMinY;
}
}
if(_loc15_.boundMaxY < param9 - threshold)
{
_loc13_ = 0;
while(_loc13_ < _loc18_)
{
if(_loc15_.boundMaxY >= splitCoordsY[_loc13_] - threshold && _loc15_.boundMaxY <= splitCoordsY[_loc13_] + threshold)
{
break;
}
_loc13_++;
}
if(_loc13_ == _loc18_)
{
_loc53_ = _loc18_++;
splitCoordsY[_loc53_] = _loc15_.boundMaxY;
}
}
if(_loc15_.boundMinZ > param7 + threshold)
{
_loc13_ = 0;
while(_loc13_ < _loc19_)
{
if(_loc15_.boundMinZ >= splitCoordsZ[_loc13_] - threshold && _loc15_.boundMinZ <= splitCoordsZ[_loc13_] + threshold)
{
break;
}
_loc13_++;
}
if(_loc13_ == _loc19_)
{
_loc53_ = _loc19_++;
splitCoordsZ[_loc53_] = _loc15_.boundMinZ;
}
}
if(_loc15_.boundMaxZ < param10 - threshold)
{
_loc13_ = 0;
while(_loc13_ < _loc19_)
{
if(_loc15_.boundMaxZ >= splitCoordsZ[_loc13_] - threshold && _loc15_.boundMaxZ <= splitCoordsZ[_loc13_] + threshold)
{
break;
}
_loc13_++;
}
if(_loc13_ == _loc19_)
{
_loc53_ = _loc19_++;
splitCoordsZ[_loc53_] = _loc15_.boundMaxZ;
}
}
_loc15_ = _loc15_.next;
}
var _loc20_:int = -1;
var _loc22_:Number = 1e+22;
_loc25_ = (param9 - param6) * (param10 - param7);
_loc12_ = 0;
while(_loc12_ < _loc17_)
{
_loc16_ = splitCoordsX[_loc12_];
_loc26_ = _loc25_ * (_loc16_ - param5);
_loc27_ = _loc25_ * (param8 - _loc16_);
_loc23_ = 0;
_loc24_ = 0;
_loc15_ = param2;
while(_loc15_ != null)
{
if(_loc15_.boundMaxX <= _loc16_ + threshold)
{
if(_loc15_.boundMinX < _loc16_ - threshold)
{
_loc23_++;
}
}
else
{
if(_loc15_.boundMinX < _loc16_ - threshold)
{
break;
}
_loc24_++;
}
_loc15_ = _loc15_.next;
}
if(_loc15_ == null)
{
_loc28_ = _loc26_ * _loc23_ + _loc27_ * _loc24_;
if(_loc28_ < _loc22_)
{
_loc22_ = _loc28_;
_loc20_ = 0;
_loc21_ = _loc16_;
}
}
_loc12_++;
}
_loc25_ = (param8 - param5) * (param10 - param7);
_loc12_ = 0;
while(_loc12_ < _loc18_)
{
_loc16_ = splitCoordsY[_loc12_];
_loc26_ = _loc25_ * (_loc16_ - param6);
_loc27_ = _loc25_ * (param9 - _loc16_);
_loc23_ = 0;
_loc24_ = 0;
_loc15_ = param2;
while(_loc15_ != null)
{
if(_loc15_.boundMaxY <= _loc16_ + threshold)
{
if(_loc15_.boundMinY < _loc16_ - threshold)
{
_loc23_++;
}
}
else
{
if(_loc15_.boundMinY < _loc16_ - threshold)
{
break;
}
_loc24_++;
}
_loc15_ = _loc15_.next;
}
if(_loc15_ == null)
{
_loc28_ = _loc26_ * _loc23_ + _loc27_ * _loc24_;
if(_loc28_ < _loc22_)
{
_loc22_ = _loc28_;
_loc20_ = 1;
_loc21_ = _loc16_;
}
}
_loc12_++;
}
_loc25_ = (param8 - param5) * (param9 - param6);
_loc12_ = 0;
while(_loc12_ < _loc19_)
{
_loc16_ = splitCoordsZ[_loc12_];
_loc26_ = _loc25_ * (_loc16_ - param7);
_loc27_ = _loc25_ * (param10 - _loc16_);
_loc23_ = 0;
_loc24_ = 0;
_loc15_ = param2;
while(_loc15_ != null)
{
if(_loc15_.boundMaxZ <= _loc16_ + threshold)
{
if(_loc15_.boundMinZ < _loc16_ - threshold)
{
_loc23_++;
}
}
else
{
if(_loc15_.boundMinZ < _loc16_ - threshold)
{
break;
}
_loc24_++;
}
_loc15_ = _loc15_.next;
}
if(_loc15_ == null)
{
_loc28_ = _loc26_ * _loc23_ + _loc27_ * _loc24_;
if(_loc28_ < _loc22_)
{
_loc22_ = _loc28_;
_loc20_ = 2;
_loc21_ = _loc16_;
}
}
_loc12_++;
}
if(_loc20_ < 0)
{
_loc11_.objectList = param1;
_loc11_.objectBoundList = param2;
_loc11_.occluderList = param3;
_loc11_.occluderBoundList = param4;
}
else
{
_loc11_.axis = _loc20_;
_loc11_.coord = _loc21_;
_loc11_.minCoord = _loc21_ - threshold;
_loc11_.maxCoord = _loc21_ + threshold;
_loc14_ = param1;
_loc15_ = param2;
while(_loc14_ != null)
{
_loc39_ = _loc14_.next;
_loc40_ = _loc15_.next;
_loc14_.next = null;
_loc15_.next = null;
_loc37_ = _loc20_ == 0 ? Number(Number(_loc15_.boundMinX)) : (_loc20_ == 1 ? Number(Number(_loc15_.boundMinY)) : Number(Number(_loc15_.boundMinZ)));
_loc38_ = _loc20_ == 0 ? Number(Number(_loc15_.boundMaxX)) : (_loc20_ == 1 ? Number(Number(_loc15_.boundMaxY)) : Number(Number(_loc15_.boundMaxZ)));
if(_loc38_ <= _loc21_ + threshold)
{
if(_loc37_ < _loc21_ - threshold)
{
_loc14_.next = _loc29_;
_loc29_ = _loc14_;
_loc15_.next = _loc30_;
_loc30_ = _loc15_;
}
else
{
_loc14_.next = _loc11_.objectList;
_loc11_.objectList = _loc14_;
_loc15_.next = _loc11_.objectBoundList;
_loc11_.objectBoundList = _loc15_;
}
}
else if(_loc37_ >= _loc21_ - threshold)
{
_loc14_.next = _loc33_;
_loc33_ = _loc14_;
_loc15_.next = _loc34_;
_loc34_ = _loc15_;
}
_loc14_ = _loc39_;
_loc15_ = _loc40_;
}
_loc14_ = param3;
_loc15_ = param4;
while(_loc14_ != null)
{
_loc39_ = _loc14_.next;
_loc40_ = _loc15_.next;
_loc14_.next = null;
_loc15_.next = null;
_loc37_ = _loc20_ == 0 ? Number(Number(_loc15_.boundMinX)) : (_loc20_ == 1 ? Number(Number(_loc15_.boundMinY)) : Number(Number(_loc15_.boundMinZ)));
_loc38_ = _loc20_ == 0 ? Number(Number(_loc15_.boundMaxX)) : (_loc20_ == 1 ? Number(Number(_loc15_.boundMaxY)) : Number(Number(_loc15_.boundMaxZ)));
if(_loc38_ <= _loc21_ + threshold)
{
if(_loc37_ < _loc21_ - threshold)
{
_loc14_.next = _loc31_;
_loc31_ = _loc14_;
_loc15_.next = _loc32_;
_loc32_ = _loc15_;
}
else
{
_loc14_.next = _loc11_.occluderList;
_loc11_.occluderList = _loc14_;
_loc15_.next = _loc11_.occluderBoundList;
_loc11_.occluderBoundList = _loc15_;
}
}
else if(_loc37_ >= _loc21_ - threshold)
{
_loc14_.next = _loc35_;
_loc35_ = _loc14_;
_loc15_.next = _loc36_;
_loc36_ = _loc15_;
}
_loc14_ = _loc39_;
_loc15_ = _loc40_;
}
_loc41_ = _loc11_.boundMinX;
_loc42_ = _loc11_.boundMinY;
_loc43_ = _loc11_.boundMinZ;
_loc44_ = _loc11_.boundMaxX;
_loc45_ = _loc11_.boundMaxY;
_loc46_ = _loc11_.boundMaxZ;
_loc47_ = _loc11_.boundMinX;
_loc48_ = _loc11_.boundMinY;
_loc49_ = _loc11_.boundMinZ;
_loc50_ = _loc11_.boundMaxX;
_loc51_ = _loc11_.boundMaxY;
_loc52_ = _loc11_.boundMaxZ;
if(_loc20_ == 0)
{
_loc44_ = _loc21_;
_loc47_ = _loc21_;
}
else if(_loc20_ == 1)
{
_loc45_ = _loc21_;
_loc48_ = _loc21_;
}
else
{
_loc46_ = _loc21_;
_loc49_ = _loc21_;
}
_loc11_.negative = this.createNode(_loc29_,_loc30_,_loc31_,_loc32_,_loc41_,_loc42_,_loc43_,_loc44_,_loc45_,_loc46_);
_loc11_.positive = this.createNode(_loc33_,_loc34_,_loc35_,_loc36_,_loc47_,_loc48_,_loc49_,_loc50_,_loc51_,_loc52_);
}
return _loc11_;
}
private function destroyNode(param1:KDNode) : void
{
var _loc2_:Object3D = null;
var _loc3_:Object3D = null;
var _loc5_:Receiver = null;
if(param1.negative != null)
{
this.destroyNode(param1.negative);
param1.negative = null;
}
if(param1.positive != null)
{
this.destroyNode(param1.positive);
param1.positive = null;
}
_loc2_ = param1.objectList;
while(_loc2_ != null)
{
_loc3_ = _loc2_.next;
_loc2_.setParent(null);
_loc2_.next = null;
_loc2_ = _loc3_;
}
_loc2_ = param1.objectBoundList;
while(_loc2_ != null)
{
_loc3_ = _loc2_.next;
_loc2_.next = null;
_loc2_ = _loc3_;
}
_loc2_ = param1.occluderList;
while(_loc2_ != null)
{
_loc3_ = _loc2_.next;
_loc2_.setParent(null);
_loc2_.next = null;
_loc2_ = _loc3_;
}
_loc2_ = param1.occluderBoundList;
while(_loc2_ != null)
{
_loc3_ = _loc2_.next;
_loc2_.next = null;
_loc2_ = _loc3_;
}
var _loc4_:Receiver = param1.receiverList;
while(_loc4_ != null)
{
_loc5_ = _loc4_.next;
_loc4_.next = null;
_loc4_ = _loc5_;
}
param1.objectList = null;
param1.objectBoundList = null;
param1.occluderList = null;
param1.occluderBoundList = null;
param1.receiverList = null;
}
private function calculateCameraPlanes(param1:Number, param2:Number) : void
{
this.nearPlaneX = imc;
this.nearPlaneY = img;
this.nearPlaneZ = imk;
this.nearPlaneOffset = (imc * param1 + imd) * this.nearPlaneX + (img * param1 + imh) * this.nearPlaneY + (imk * param1 + iml) * this.nearPlaneZ;
this.farPlaneX = -imc;
this.farPlaneY = -img;
this.farPlaneZ = -imk;
this.farPlaneOffset = (imc * param2 + imd) * this.farPlaneX + (img * param2 + imh) * this.farPlaneY + (imk * param2 + iml) * this.farPlaneZ;
var _loc3_:Number = -ima - imb + imc;
var _loc4_:Number = -ime - imf + img;
var _loc5_:Number = -imi - imj + imk;
var _loc6_:Number = ima - imb + imc;
var _loc7_:Number = ime - imf + img;
var _loc8_:Number = imi - imj + imk;
this.topPlaneX = _loc8_ * _loc4_ - _loc7_ * _loc5_;
this.topPlaneY = _loc6_ * _loc5_ - _loc8_ * _loc3_;
this.topPlaneZ = _loc7_ * _loc3_ - _loc6_ * _loc4_;
this.topPlaneOffset = imd * this.topPlaneX + imh * this.topPlaneY + iml * this.topPlaneZ;
_loc3_ = _loc6_;
_loc4_ = _loc7_;
_loc5_ = _loc8_;
_loc6_ = ima + imb + imc;
_loc7_ = ime + imf + img;
_loc8_ = imi + imj + imk;
this.rightPlaneX = _loc8_ * _loc4_ - _loc7_ * _loc5_;
this.rightPlaneY = _loc6_ * _loc5_ - _loc8_ * _loc3_;
this.rightPlaneZ = _loc7_ * _loc3_ - _loc6_ * _loc4_;
this.rightPlaneOffset = imd * this.rightPlaneX + imh * this.rightPlaneY + iml * this.rightPlaneZ;
_loc3_ = _loc6_;
_loc4_ = _loc7_;
_loc5_ = _loc8_;
_loc6_ = -ima + imb + imc;
_loc7_ = -ime + imf + img;
_loc8_ = -imi + imj + imk;
this.bottomPlaneX = _loc8_ * _loc4_ - _loc7_ * _loc5_;
this.bottomPlaneY = _loc6_ * _loc5_ - _loc8_ * _loc3_;
this.bottomPlaneZ = _loc7_ * _loc3_ - _loc6_ * _loc4_;
this.bottomPlaneOffset = imd * this.bottomPlaneX + imh * this.bottomPlaneY + iml * this.bottomPlaneZ;
_loc3_ = _loc6_;
_loc4_ = _loc7_;
_loc5_ = _loc8_;
_loc6_ = -ima - imb + imc;
_loc7_ = -ime - imf + img;
_loc8_ = -imi - imj + imk;
this.leftPlaneX = _loc8_ * _loc4_ - _loc7_ * _loc5_;
this.leftPlaneY = _loc6_ * _loc5_ - _loc8_ * _loc3_;
this.leftPlaneZ = _loc7_ * _loc3_ - _loc6_ * _loc4_;
this.leftPlaneOffset = imd * this.leftPlaneX + imh * this.leftPlaneY + iml * this.leftPlaneZ;
}
private function updateOccluders(param1:Camera3D) : void
{
var _loc3_:Vertex = null;
var _loc4_:Vertex = null;
var _loc5_:Vertex = null;
var _loc6_:Number = NaN;
var _loc7_:Number = NaN;
var _loc8_:Number = NaN;
var _loc9_:Number = NaN;
var _loc10_:Number = NaN;
var _loc11_:Number = NaN;
var _loc2_:int = this.numOccluders;
while(_loc2_ < param1.numOccluders)
{
_loc3_ = null;
_loc4_ = param1.occluders[_loc2_];
while(_loc4_ != null)
{
_loc5_ = _loc4_.create();
_loc5_.next = _loc3_;
_loc3_ = _loc5_;
_loc6_ = ima * _loc4_.x + imb * _loc4_.y + imc * _loc4_.z;
_loc7_ = ime * _loc4_.x + imf * _loc4_.y + img * _loc4_.z;
_loc8_ = imi * _loc4_.x + imj * _loc4_.y + imk * _loc4_.z;
_loc9_ = ima * _loc4_.u + imb * _loc4_.v + imc * _loc4_.offset;
_loc10_ = ime * _loc4_.u + imf * _loc4_.v + img * _loc4_.offset;
_loc11_ = imi * _loc4_.u + imj * _loc4_.v + imk * _loc4_.offset;
_loc3_.x = _loc11_ * _loc7_ - _loc10_ * _loc8_;
_loc3_.y = _loc9_ * _loc8_ - _loc11_ * _loc6_;
_loc3_.z = _loc10_ * _loc6_ - _loc9_ * _loc7_;
_loc3_.offset = imd * _loc3_.x + imh * _loc3_.y + iml * _loc3_.z;
_loc4_ = _loc4_.next;
}
this.occluders[this.numOccluders] = _loc3_;
++this.numOccluders;
_loc2_++;
}
}
private function cullingInContainer(param1:int, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number) : int
{
var _loc9_:Vertex = null;
if(param1 > 0)
{
if(param1 & 1)
{
if(this.nearPlaneX >= 0)
{
if(this.nearPlaneY >= 0)
{
if(this.nearPlaneZ >= 0)
{
if(param5 * this.nearPlaneX + param6 * this.nearPlaneY + param7 * this.nearPlaneZ <= this.nearPlaneOffset)
{
return -1;
}
if(param2 * this.nearPlaneX + param3 * this.nearPlaneY + param4 * this.nearPlaneZ > this.nearPlaneOffset)
{
param1 &= 62;
}
}
else
{
if(param5 * this.nearPlaneX + param6 * this.nearPlaneY + param4 * this.nearPlaneZ <= this.nearPlaneOffset)
{
return -1;
}
if(param2 * this.nearPlaneX + param3 * this.nearPlaneY + param7 * this.nearPlaneZ > this.nearPlaneOffset)
{
param1 &= 62;
}
}
}
else if(this.nearPlaneZ >= 0)
{
if(param5 * this.nearPlaneX + param3 * this.nearPlaneY + param7 * this.nearPlaneZ <= this.nearPlaneOffset)
{
return -1;
}
if(param2 * this.nearPlaneX + param6 * this.nearPlaneY + param4 * this.nearPlaneZ > this.nearPlaneOffset)
{
param1 &= 62;
}
}
else
{
if(param5 * this.nearPlaneX + param3 * this.nearPlaneY + param4 * this.nearPlaneZ <= this.nearPlaneOffset)
{
return -1;
}
if(param2 * this.nearPlaneX + param6 * this.nearPlaneY + param7 * this.nearPlaneZ > this.nearPlaneOffset)
{
param1 &= 62;
}
}
}
else if(this.nearPlaneY >= 0)
{
if(this.nearPlaneZ >= 0)
{
if(param2 * this.nearPlaneX + param6 * this.nearPlaneY + param7 * this.nearPlaneZ <= this.nearPlaneOffset)
{
return -1;
}
if(param5 * this.nearPlaneX + param3 * this.nearPlaneY + param4 * this.nearPlaneZ > this.nearPlaneOffset)
{
param1 &= 62;
}
}
else
{
if(param2 * this.nearPlaneX + param6 * this.nearPlaneY + param4 * this.nearPlaneZ <= this.nearPlaneOffset)
{
return -1;
}
if(param5 * this.nearPlaneX + param3 * this.nearPlaneY + param7 * this.nearPlaneZ > this.nearPlaneOffset)
{
param1 &= 62;
}
}
}
else if(this.nearPlaneZ >= 0)
{
if(param2 * this.nearPlaneX + param3 * this.nearPlaneY + param7 * this.nearPlaneZ <= this.nearPlaneOffset)
{
return -1;
}
if(param5 * this.nearPlaneX + param6 * this.nearPlaneY + param4 * this.nearPlaneZ > this.nearPlaneOffset)
{
param1 &= 62;
}
}
else
{
if(param2 * this.nearPlaneX + param3 * this.nearPlaneY + param4 * this.nearPlaneZ <= this.nearPlaneOffset)
{
return -1;
}
if(param5 * this.nearPlaneX + param6 * this.nearPlaneY + param7 * this.nearPlaneZ > this.nearPlaneOffset)
{
param1 &= 62;
}
}
}
if(param1 & 2)
{
if(this.farPlaneX >= 0)
{
if(this.farPlaneY >= 0)
{
if(this.farPlaneZ >= 0)
{
if(param5 * this.farPlaneX + param6 * this.farPlaneY + param7 * this.farPlaneZ <= this.farPlaneOffset)
{
return -1;
}
if(param2 * this.farPlaneX + param3 * this.farPlaneY + param4 * this.farPlaneZ > this.farPlaneOffset)
{
param1 &= 61;
}
}
else
{
if(param5 * this.farPlaneX + param6 * this.farPlaneY + param4 * this.farPlaneZ <= this.farPlaneOffset)
{
return -1;
}
if(param2 * this.farPlaneX + param3 * this.farPlaneY + param7 * this.farPlaneZ > this.farPlaneOffset)
{
param1 &= 61;
}
}
}
else if(this.farPlaneZ >= 0)
{
if(param5 * this.farPlaneX + param3 * this.farPlaneY + param7 * this.farPlaneZ <= this.farPlaneOffset)
{
return -1;
}
if(param2 * this.farPlaneX + param6 * this.farPlaneY + param4 * this.farPlaneZ > this.farPlaneOffset)
{
param1 &= 61;
}
}
else
{
if(param5 * this.farPlaneX + param3 * this.farPlaneY + param4 * this.farPlaneZ <= this.farPlaneOffset)
{
return -1;
}
if(param2 * this.farPlaneX + param6 * this.farPlaneY + param7 * this.farPlaneZ > this.farPlaneOffset)
{
param1 &= 61;
}
}
}
else if(this.farPlaneY >= 0)
{
if(this.farPlaneZ >= 0)
{
if(param2 * this.farPlaneX + param6 * this.farPlaneY + param7 * this.farPlaneZ <= this.farPlaneOffset)
{
return -1;
}
if(param5 * this.farPlaneX + param3 * this.farPlaneY + param4 * this.farPlaneZ > this.farPlaneOffset)
{
param1 &= 61;
}
}
else
{
if(param2 * this.farPlaneX + param6 * this.farPlaneY + param4 * this.farPlaneZ <= this.farPlaneOffset)
{
return -1;
}
if(param5 * this.farPlaneX + param3 * this.farPlaneY + param7 * this.farPlaneZ > this.farPlaneOffset)
{
param1 &= 61;
}
}
}
else if(this.farPlaneZ >= 0)
{
if(param2 * this.farPlaneX + param3 * this.farPlaneY + param7 * this.farPlaneZ <= this.farPlaneOffset)
{
return -1;
}
if(param5 * this.farPlaneX + param6 * this.farPlaneY + param4 * this.farPlaneZ > this.farPlaneOffset)
{
param1 &= 61;
}
}
else
{
if(param2 * this.farPlaneX + param3 * this.farPlaneY + param4 * this.farPlaneZ <= this.farPlaneOffset)
{
return -1;
}
if(param5 * this.farPlaneX + param6 * this.farPlaneY + param7 * this.farPlaneZ > this.farPlaneOffset)
{
param1 &= 61;
}
}
}
if(param1 & 4)
{
if(this.leftPlaneX >= 0)
{
if(this.leftPlaneY >= 0)
{
if(this.leftPlaneZ >= 0)
{
if(param5 * this.leftPlaneX + param6 * this.leftPlaneY + param7 * this.leftPlaneZ <= this.leftPlaneOffset)
{
return -1;
}
if(param2 * this.leftPlaneX + param3 * this.leftPlaneY + param4 * this.leftPlaneZ > this.leftPlaneOffset)
{
param1 &= 59;
}
}
else
{
if(param5 * this.leftPlaneX + param6 * this.leftPlaneY + param4 * this.leftPlaneZ <= this.leftPlaneOffset)
{
return -1;
}
if(param2 * this.leftPlaneX + param3 * this.leftPlaneY + param7 * this.leftPlaneZ > this.leftPlaneOffset)
{
param1 &= 59;
}
}
}
else if(this.leftPlaneZ >= 0)
{
if(param5 * this.leftPlaneX + param3 * this.leftPlaneY + param7 * this.leftPlaneZ <= this.leftPlaneOffset)
{
return -1;
}
if(param2 * this.leftPlaneX + param6 * this.leftPlaneY + param4 * this.leftPlaneZ > this.leftPlaneOffset)
{
param1 &= 59;
}
}
else
{
if(param5 * this.leftPlaneX + param3 * this.leftPlaneY + param4 * this.leftPlaneZ <= this.leftPlaneOffset)
{
return -1;
}
if(param2 * this.leftPlaneX + param6 * this.leftPlaneY + param7 * this.leftPlaneZ > this.leftPlaneOffset)
{
param1 &= 59;
}
}
}
else if(this.leftPlaneY >= 0)
{
if(this.leftPlaneZ >= 0)
{
if(param2 * this.leftPlaneX + param6 * this.leftPlaneY + param7 * this.leftPlaneZ <= this.leftPlaneOffset)
{
return -1;
}
if(param5 * this.leftPlaneX + param3 * this.leftPlaneY + param4 * this.leftPlaneZ > this.leftPlaneOffset)
{
param1 &= 59;
}
}
else
{
if(param2 * this.leftPlaneX + param6 * this.leftPlaneY + param4 * this.leftPlaneZ <= this.leftPlaneOffset)
{
return -1;
}
if(param5 * this.leftPlaneX + param3 * this.leftPlaneY + param7 * this.leftPlaneZ > this.leftPlaneOffset)
{
param1 &= 59;
}
}
}
else if(this.leftPlaneZ >= 0)
{
if(param2 * this.leftPlaneX + param3 * this.leftPlaneY + param7 * this.leftPlaneZ <= this.leftPlaneOffset)
{
return -1;
}
if(param5 * this.leftPlaneX + param6 * this.leftPlaneY + param4 * this.leftPlaneZ > this.leftPlaneOffset)
{
param1 &= 59;
}
}
else
{
if(param2 * this.leftPlaneX + param3 * this.leftPlaneY + param4 * this.leftPlaneZ <= this.leftPlaneOffset)
{
return -1;
}
if(param5 * this.leftPlaneX + param6 * this.leftPlaneY + param7 * this.leftPlaneZ > this.leftPlaneOffset)
{
param1 &= 59;
}
}
}
if(param1 & 8)
{
if(this.rightPlaneX >= 0)
{
if(this.rightPlaneY >= 0)
{
if(this.rightPlaneZ >= 0)
{
if(param5 * this.rightPlaneX + param6 * this.rightPlaneY + param7 * this.rightPlaneZ <= this.rightPlaneOffset)
{
return -1;
}
if(param2 * this.rightPlaneX + param3 * this.rightPlaneY + param4 * this.rightPlaneZ > this.rightPlaneOffset)
{
param1 &= 55;
}
}
else
{
if(param5 * this.rightPlaneX + param6 * this.rightPlaneY + param4 * this.rightPlaneZ <= this.rightPlaneOffset)
{
return -1;
}
if(param2 * this.rightPlaneX + param3 * this.rightPlaneY + param7 * this.rightPlaneZ > this.rightPlaneOffset)
{
param1 &= 55;
}
}
}
else if(this.rightPlaneZ >= 0)
{
if(param5 * this.rightPlaneX + param3 * this.rightPlaneY + param7 * this.rightPlaneZ <= this.rightPlaneOffset)
{
return -1;
}
if(param2 * this.rightPlaneX + param6 * this.rightPlaneY + param4 * this.rightPlaneZ > this.rightPlaneOffset)
{
param1 &= 55;
}
}
else
{
if(param5 * this.rightPlaneX + param3 * this.rightPlaneY + param4 * this.rightPlaneZ <= this.rightPlaneOffset)
{
return -1;
}
if(param2 * this.rightPlaneX + param6 * this.rightPlaneY + param7 * this.rightPlaneZ > this.rightPlaneOffset)
{
param1 &= 55;
}
}
}
else if(this.rightPlaneY >= 0)
{
if(this.rightPlaneZ >= 0)
{
if(param2 * this.rightPlaneX + param6 * this.rightPlaneY + param7 * this.rightPlaneZ <= this.rightPlaneOffset)
{
return -1;
}
if(param5 * this.rightPlaneX + param3 * this.rightPlaneY + param4 * this.rightPlaneZ > this.rightPlaneOffset)
{
param1 &= 55;
}
}
else
{
if(param2 * this.rightPlaneX + param6 * this.rightPlaneY + param4 * this.rightPlaneZ <= this.rightPlaneOffset)
{
return -1;
}
if(param5 * this.rightPlaneX + param3 * this.rightPlaneY + param7 * this.rightPlaneZ > this.rightPlaneOffset)
{
param1 &= 55;
}
}
}
else if(this.rightPlaneZ >= 0)
{
if(param2 * this.rightPlaneX + param3 * this.rightPlaneY + param7 * this.rightPlaneZ <= this.rightPlaneOffset)
{
return -1;
}
if(param5 * this.rightPlaneX + param6 * this.rightPlaneY + param4 * this.rightPlaneZ > this.rightPlaneOffset)
{
param1 &= 55;
}
}
else
{
if(param2 * this.rightPlaneX + param3 * this.rightPlaneY + param4 * this.rightPlaneZ <= this.rightPlaneOffset)
{
return -1;
}
if(param5 * this.rightPlaneX + param6 * this.rightPlaneY + param7 * this.rightPlaneZ > this.rightPlaneOffset)
{
param1 &= 55;
}
}
}
if(param1 & 16)
{
if(this.topPlaneX >= 0)
{
if(this.topPlaneY >= 0)
{
if(this.topPlaneZ >= 0)
{
if(param5 * this.topPlaneX + param6 * this.topPlaneY + param7 * this.topPlaneZ <= this.topPlaneOffset)
{
return -1;
}
if(param2 * this.topPlaneX + param3 * this.topPlaneY + param4 * this.topPlaneZ > this.topPlaneOffset)
{
param1 &= 47;
}
}
else
{
if(param5 * this.topPlaneX + param6 * this.topPlaneY + param4 * this.topPlaneZ <= this.topPlaneOffset)
{
return -1;
}
if(param2 * this.topPlaneX + param3 * this.topPlaneY + param7 * this.topPlaneZ > this.topPlaneOffset)
{
param1 &= 47;
}
}
}
else if(this.topPlaneZ >= 0)
{
if(param5 * this.topPlaneX + param3 * this.topPlaneY + param7 * this.topPlaneZ <= this.topPlaneOffset)
{
return -1;
}
if(param2 * this.topPlaneX + param6 * this.topPlaneY + param4 * this.topPlaneZ > this.topPlaneOffset)
{
param1 &= 47;
}
}
else
{
if(param5 * this.topPlaneX + param3 * this.topPlaneY + param4 * this.topPlaneZ <= this.topPlaneOffset)
{
return -1;
}
if(param2 * this.topPlaneX + param6 * this.topPlaneY + param7 * this.topPlaneZ > this.topPlaneOffset)
{
param1 &= 47;
}
}
}
else if(this.topPlaneY >= 0)
{
if(this.topPlaneZ >= 0)
{
if(param2 * this.topPlaneX + param6 * this.topPlaneY + param7 * this.topPlaneZ <= this.topPlaneOffset)
{
return -1;
}
if(param5 * this.topPlaneX + param3 * this.topPlaneY + param4 * this.topPlaneZ > this.topPlaneOffset)
{
param1 &= 47;
}
}
else
{
if(param2 * this.topPlaneX + param6 * this.topPlaneY + param4 * this.topPlaneZ <= this.topPlaneOffset)
{
return -1;
}
if(param5 * this.topPlaneX + param3 * this.topPlaneY + param7 * this.topPlaneZ > this.topPlaneOffset)
{
param1 &= 47;
}
}
}
else if(this.topPlaneZ >= 0)
{
if(param2 * this.topPlaneX + param3 * this.topPlaneY + param7 * this.topPlaneZ <= this.topPlaneOffset)
{
return -1;
}
if(param5 * this.topPlaneX + param6 * this.topPlaneY + param4 * this.topPlaneZ > this.topPlaneOffset)
{
param1 &= 47;
}
}
else
{
if(param2 * this.topPlaneX + param3 * this.topPlaneY + param4 * this.topPlaneZ <= this.topPlaneOffset)
{
return -1;
}
if(param5 * this.topPlaneX + param6 * this.topPlaneY + param7 * this.topPlaneZ > this.topPlaneOffset)
{
param1 &= 47;
}
}
}
if(param1 & 32)
{
if(this.bottomPlaneX >= 0)
{
if(this.bottomPlaneY >= 0)
{
if(this.bottomPlaneZ >= 0)
{
if(param5 * this.bottomPlaneX + param6 * this.bottomPlaneY + param7 * this.bottomPlaneZ <= this.bottomPlaneOffset)
{
return -1;
}
if(param2 * this.bottomPlaneX + param3 * this.bottomPlaneY + param4 * this.bottomPlaneZ > this.bottomPlaneOffset)
{
param1 &= 31;
}
}
else
{
if(param5 * this.bottomPlaneX + param6 * this.bottomPlaneY + param4 * this.bottomPlaneZ <= this.bottomPlaneOffset)
{
return -1;
}
if(param2 * this.bottomPlaneX + param3 * this.bottomPlaneY + param7 * this.bottomPlaneZ > this.bottomPlaneOffset)
{
param1 &= 31;
}
}
}
else if(this.bottomPlaneZ >= 0)
{
if(param5 * this.bottomPlaneX + param3 * this.bottomPlaneY + param7 * this.bottomPlaneZ <= this.bottomPlaneOffset)
{
return -1;
}
if(param2 * this.bottomPlaneX + param6 * this.bottomPlaneY + param4 * this.bottomPlaneZ > this.bottomPlaneOffset)
{
param1 &= 31;
}
}
else
{
if(param5 * this.bottomPlaneX + param3 * this.bottomPlaneY + param4 * this.bottomPlaneZ <= this.bottomPlaneOffset)
{
return -1;
}
if(param2 * this.bottomPlaneX + param6 * this.bottomPlaneY + param7 * this.bottomPlaneZ > this.bottomPlaneOffset)
{
param1 &= 31;
}
}
}
else if(this.bottomPlaneY >= 0)
{
if(this.bottomPlaneZ >= 0)
{
if(param2 * this.bottomPlaneX + param6 * this.bottomPlaneY + param7 * this.bottomPlaneZ <= this.bottomPlaneOffset)
{
return -1;
}
if(param5 * this.bottomPlaneX + param3 * this.bottomPlaneY + param4 * this.bottomPlaneZ > this.bottomPlaneOffset)
{
param1 &= 31;
}
}
else
{
if(param2 * this.bottomPlaneX + param6 * this.bottomPlaneY + param4 * this.bottomPlaneZ <= this.bottomPlaneOffset)
{
return -1;
}
if(param5 * this.bottomPlaneX + param3 * this.bottomPlaneY + param7 * this.bottomPlaneZ > this.bottomPlaneOffset)
{
param1 &= 31;
}
}
}
else if(this.bottomPlaneZ >= 0)
{
if(param2 * this.bottomPlaneX + param3 * this.bottomPlaneY + param7 * this.bottomPlaneZ <= this.bottomPlaneOffset)
{
return -1;
}
if(param5 * this.bottomPlaneX + param6 * this.bottomPlaneY + param4 * this.bottomPlaneZ > this.bottomPlaneOffset)
{
param1 &= 31;
}
}
else
{
if(param2 * this.bottomPlaneX + param3 * this.bottomPlaneY + param4 * this.bottomPlaneZ <= this.bottomPlaneOffset)
{
return -1;
}
if(param5 * this.bottomPlaneX + param6 * this.bottomPlaneY + param7 * this.bottomPlaneZ > this.bottomPlaneOffset)
{
param1 &= 31;
}
}
}
}
var _loc8_:int = 0;
while(true)
{
if(_loc8_ >= this.numOccluders)
{
return param1;
}
_loc9_ = this.occluders[_loc8_];
while(_loc9_ != null)
{
if(_loc9_.x >= 0)
{
if(_loc9_.y >= 0)
{
if(_loc9_.z >= 0)
{
if(param5 * _loc9_.x + param6 * _loc9_.y + param7 * _loc9_.z > _loc9_.offset)
{
break;
}
}
else if(param5 * _loc9_.x + param6 * _loc9_.y + param4 * _loc9_.z > _loc9_.offset)
{
break;
}
}
else if(_loc9_.z >= 0)
{
if(param5 * _loc9_.x + param3 * _loc9_.y + param7 * _loc9_.z > _loc9_.offset)
{
break;
}
}
else if(param5 * _loc9_.x + param3 * _loc9_.y + param4 * _loc9_.z > _loc9_.offset)
{
break;
}
}
else if(_loc9_.y >= 0)
{
if(_loc9_.z >= 0)
{
if(param2 * _loc9_.x + param6 * _loc9_.y + param7 * _loc9_.z > _loc9_.offset)
{
break;
}
}
else if(param2 * _loc9_.x + param6 * _loc9_.y + param4 * _loc9_.z > _loc9_.offset)
{
break;
}
}
else if(_loc9_.z >= 0)
{
if(param2 * _loc9_.x + param3 * _loc9_.y + param7 * _loc9_.z > _loc9_.offset)
{
break;
}
}
else if(param2 * _loc9_.x + param3 * _loc9_.y + param4 * _loc9_.z > _loc9_.offset)
{
break;
}
_loc9_ = _loc9_.next;
}
if(_loc9_ == null)
{
break;
}
_loc8_++;
}
return -1;
}
private function occludeGeometry(param1:Camera3D, param2:VG) : Boolean
{
var _loc4_:Vertex = null;
var _loc3_:int = param2.numOccluders;
while(true)
{
if(_loc3_ >= this.numOccluders)
{
param2.numOccluders = this.numOccluders;
return false;
}
_loc4_ = this.occluders[_loc3_];
while(_loc4_ != null)
{
if(_loc4_.x >= 0)
{
if(_loc4_.y >= 0)
{
if(_loc4_.z >= 0)
{
if(param2.boundMaxX * _loc4_.x + param2.boundMaxY * _loc4_.y + param2.boundMaxZ * _loc4_.z > _loc4_.offset)
{
break;
}
}
else if(param2.boundMaxX * _loc4_.x + param2.boundMaxY * _loc4_.y + param2.boundMinZ * _loc4_.z > _loc4_.offset)
{
break;
}
}
else if(_loc4_.z >= 0)
{
if(param2.boundMaxX * _loc4_.x + param2.boundMinY * _loc4_.y + param2.boundMaxZ * _loc4_.z > _loc4_.offset)
{
break;
}
}
else if(param2.boundMaxX * _loc4_.x + param2.boundMinY * _loc4_.y + param2.boundMinZ * _loc4_.z > _loc4_.offset)
{
break;
}
}
else if(_loc4_.y >= 0)
{
if(_loc4_.z >= 0)
{
if(param2.boundMinX * _loc4_.x + param2.boundMaxY * _loc4_.y + param2.boundMaxZ * _loc4_.z > _loc4_.offset)
{
break;
}
}
else if(param2.boundMinX * _loc4_.x + param2.boundMaxY * _loc4_.y + param2.boundMinZ * _loc4_.z > _loc4_.offset)
{
break;
}
}
else if(_loc4_.z >= 0)
{
if(param2.boundMinX * _loc4_.x + param2.boundMinY * _loc4_.y + param2.boundMaxZ * _loc4_.z > _loc4_.offset)
{
break;
}
}
else if(param2.boundMinX * _loc4_.x + param2.boundMinY * _loc4_.y + param2.boundMinZ * _loc4_.z > _loc4_.offset)
{
break;
}
_loc4_ = _loc4_.next;
}
if(_loc4_ == null)
{
break;
}
_loc3_++;
}
return true;
}
}
}
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Face;
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.core.Shadow;
import alternativa.engine3d.core.Vertex;
import alternativa.engine3d.core.Wrapper;
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.engine3d.objects.BSP;
import alternativa.engine3d.objects.Decal;
import alternativa.engine3d.objects.Mesh;
use namespace alternativa3d;
class KDNode
{
public var negative:KDNode;
public var positive:KDNode;
public var axis:int;
public var coord:Number;
public var minCoord:Number;
public var maxCoord:Number;
public var boundMinX:Number;
public var boundMinY:Number;
public var boundMinZ:Number;
public var boundMaxX:Number;
public var boundMaxY:Number;
public var boundMaxZ:Number;
public var objectList:Object3D;
public var objectBoundList:Object3D;
public var occluderList:Object3D;
public var occluderBoundList:Object3D;
public var receiverList:Receiver;
function KDNode()
{
super();
}
public function createReceivers(param1:Vector.<Vector.<Number>>, param2:Vector.<Vector.<uint>>) : void
{
var _loc3_:Receiver = null;
var _loc5_:Receiver = null;
var _loc6_:Vertex = null;
var _loc7_:Vertex = null;
var _loc8_:Vector.<Face> = null;
var _loc9_:int = 0;
var _loc10_:TextureMaterial = null;
var _loc11_:int = 0;
var _loc12_:int = 0;
var _loc13_:Vector.<Number> = null;
var _loc14_:Vector.<uint> = null;
var _loc15_:int = 0;
var _loc16_:int = 0;
var _loc17_:int = 0;
var _loc18_:int = 0;
var _loc19_:Face = null;
var _loc20_:Wrapper = null;
var _loc21_:uint = 0;
var _loc22_:uint = 0;
var _loc23_:uint = 0;
var _loc4_:Object3D = null;
_loc3_ = null;
_loc5_ = null;
_loc6_ = null;
_loc7_ = null;
_loc8_ = null;
_loc9_ = 0;
_loc10_ = null;
_loc11_ = 0;
_loc12_ = 0;
_loc13_ = null;
_loc14_ = null;
_loc15_ = 0;
_loc16_ = 0;
_loc17_ = 0;
_loc18_ = 0;
_loc19_ = null;
_loc20_ = null;
_loc21_ = 0;
_loc22_ = 0;
_loc23_ = 0;
this.receiverList = null;
_loc4_ = this.objectList;
while(_loc4_ != null)
{
_loc4_.composeMatrix();
_loc5_ = new Receiver();
if(_loc3_ != null)
{
_loc3_.next = _loc5_;
}
else
{
this.receiverList = _loc5_;
}
_loc3_ = _loc5_;
if(_loc4_ is Mesh)
{
_loc7_ = (_loc4_ as Mesh).vertexList;
_loc8_ = (_loc4_ as Mesh).faces;
}
else if(_loc4_ is BSP)
{
_loc7_ = (_loc4_ as BSP).vertexList;
_loc8_ = (_loc4_ as BSP).faces;
}
_loc9_ = _loc8_.length;
_loc10_ = _loc8_[0].material as TextureMaterial;
if(_loc9_ > 0 && _loc10_ != null)
{
_loc11_ = 0;
_loc6_ = _loc7_;
while(_loc6_ != null)
{
_loc11_++;
_loc6_ = _loc6_.next;
}
_loc12_ = param1.length - 1;
_loc13_ = param1[_loc12_];
if(_loc13_.length / 3 + _loc11_ > 65535)
{
_loc12_++;
param1[_loc12_] = new Vector.<Number>();
param2[_loc12_] = new Vector.<uint>();
_loc13_ = param1[_loc12_];
}
_loc14_ = param2[_loc12_];
_loc15_ = _loc13_.length;
_loc16_ = _loc15_ / 3;
_loc17_ = _loc14_.length;
_loc5_.buffer = _loc12_;
_loc5_.firstIndex = _loc17_;
_loc5_.transparent = _loc10_.transparent;
_loc6_ = _loc7_;
while(_loc6_ != null)
{
_loc13_[_loc15_] = _loc6_.x * _loc4_.ma + _loc6_.y * _loc4_.mb + _loc6_.z * _loc4_.mc + _loc4_.md;
_loc15_++;
_loc13_[_loc15_] = _loc6_.x * _loc4_.me + _loc6_.y * _loc4_.mf + _loc6_.z * _loc4_.mg + _loc4_.mh;
_loc15_++;
_loc13_[_loc15_] = _loc6_.x * _loc4_.mi + _loc6_.y * _loc4_.mj + _loc6_.z * _loc4_.mk + _loc4_.ml;
_loc15_++;
_loc6_.index = _loc16_;
_loc16_++;
_loc6_ = _loc6_.next;
}
_loc18_ = 0;
while(_loc18_ < _loc9_)
{
_loc19_ = _loc8_[_loc18_];
if(_loc19_.normalX * _loc4_.mi + _loc19_.normalY * _loc4_.mj + _loc19_.normalZ * _loc4_.mk >= -0.5)
{
_loc20_ = _loc19_.wrapper;
_loc21_ = _loc20_.vertex.index;
_loc20_ = _loc20_.next;
_loc22_ = _loc20_.vertex.index;
_loc20_ = _loc20_.next;
while(_loc20_ != null)
{
_loc23_ = _loc20_.vertex.index;
_loc14_[_loc17_] = _loc21_;
_loc17_++;
_loc14_[_loc17_] = _loc22_;
_loc17_++;
_loc14_[_loc17_] = _loc23_;
_loc17_++;
++_loc5_.numTriangles;
_loc22_ = _loc23_;
_loc20_ = _loc20_.next;
}
}
_loc18_++;
}
}
_loc4_ = _loc4_.next;
}
if(this.negative != null)
{
this.negative.createReceivers(param1,param2);
}
if(this.positive != null)
{
this.positive.createReceivers(param1,param2);
}
}
public function collectReceivers(param1:Shadow) : void
{
var _loc2_:Object3D = null;
var _loc3_:Object3D = null;
var _loc4_:Receiver = null;
var _loc5_:Boolean = false;
var _loc6_:Boolean = false;
var _loc7_:Number = NaN;
var _loc8_:Number = NaN;
_loc2_ = null;
_loc3_ = null;
_loc4_ = null;
_loc5_ = false;
_loc6_ = false;
_loc7_ = NaN;
_loc8_ = NaN;
if(this.negative != null)
{
_loc5_ = this.axis == 0;
_loc6_ = this.axis == 1;
_loc7_ = !!_loc5_ ? Number(Number(param1.boundMinX)) : (!!_loc6_ ? Number(Number(param1.boundMinY)) : Number(Number(param1.boundMinZ)));
_loc8_ = !!_loc5_ ? Number(Number(param1.boundMaxX)) : (!!_loc6_ ? Number(Number(param1.boundMaxY)) : Number(Number(param1.boundMaxZ)));
if(_loc8_ <= this.maxCoord)
{
this.negative.collectReceivers(param1);
}
else if(_loc7_ >= this.minCoord)
{
this.positive.collectReceivers(param1);
}
else
{
if(_loc5_)
{
_loc3_ = this.objectBoundList;
_loc2_ = this.objectList;
_loc4_ = this.receiverList;
while(_loc3_ != null)
{
if(_loc4_.numTriangles > 0 && param1.boundMinY < _loc3_.boundMaxY && param1.boundMaxY > _loc3_.boundMinY && param1.boundMinZ < _loc3_.boundMaxZ && param1.boundMaxZ > _loc3_.boundMinZ)
{
if(!_loc4_.transparent)
{
param1.receiversBuffers[param1.receiversCount] = _loc4_.buffer;
param1.receiversFirstIndexes[param1.receiversCount] = _loc4_.firstIndex;
param1.receiversNumsTriangles[param1.receiversCount] = _loc4_.numTriangles;
++param1.receiversCount;
}
}
_loc3_ = _loc3_.next;
_loc2_ = _loc2_.next;
_loc4_ = _loc4_.next;
}
}
else if(_loc6_)
{
_loc3_ = this.objectBoundList;
_loc2_ = this.objectList;
_loc4_ = this.receiverList;
while(_loc3_ != null)
{
if(_loc4_.numTriangles > 0 && param1.boundMinX < _loc3_.boundMaxX && param1.boundMaxX > _loc3_.boundMinX && param1.boundMinZ < _loc3_.boundMaxZ && param1.boundMaxZ > _loc3_.boundMinZ)
{
if(!_loc4_.transparent)
{
param1.receiversBuffers[param1.receiversCount] = _loc4_.buffer;
param1.receiversFirstIndexes[param1.receiversCount] = _loc4_.firstIndex;
param1.receiversNumsTriangles[param1.receiversCount] = _loc4_.numTriangles;
++param1.receiversCount;
}
}
_loc3_ = _loc3_.next;
_loc2_ = _loc2_.next;
_loc4_ = _loc4_.next;
}
}
else
{
_loc3_ = this.objectBoundList;
_loc2_ = this.objectList;
_loc4_ = this.receiverList;
while(_loc3_ != null)
{
if(_loc4_.numTriangles > 0 && param1.boundMinX < _loc3_.boundMaxX && param1.boundMaxX > _loc3_.boundMinX && param1.boundMinY < _loc3_.boundMaxY && param1.boundMaxY > _loc3_.boundMinY)
{
if(!_loc4_.transparent)
{
param1.receiversBuffers[param1.receiversCount] = _loc4_.buffer;
param1.receiversFirstIndexes[param1.receiversCount] = _loc4_.firstIndex;
param1.receiversNumsTriangles[param1.receiversCount] = _loc4_.numTriangles;
++param1.receiversCount;
}
}
_loc3_ = _loc3_.next;
_loc2_ = _loc2_.next;
_loc4_ = _loc4_.next;
}
}
this.negative.collectReceivers(param1);
this.positive.collectReceivers(param1);
}
}
else
{
_loc2_ = this.objectList;
_loc4_ = this.receiverList;
while(_loc4_ != null)
{
if(_loc4_.numTriangles > 0)
{
if(!_loc4_.transparent)
{
param1.receiversBuffers[param1.receiversCount] = _loc4_.buffer;
param1.receiversFirstIndexes[param1.receiversCount] = _loc4_.firstIndex;
param1.receiversNumsTriangles[param1.receiversCount] = _loc4_.numTriangles;
++param1.receiversCount;
}
}
_loc2_ = _loc2_.next;
_loc4_ = _loc4_.next;
}
}
}
public function collectPolygons(param1:Decal, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number, param8:Number, param9:Number) : void
{
var _loc10_:Object3D = null;
var _loc11_:Object3D = null;
var _loc12_:Boolean = false;
var _loc13_:Boolean = false;
var _loc14_:Number = NaN;
var _loc15_:Number = NaN;
_loc10_ = null;
_loc11_ = null;
_loc12_ = false;
_loc13_ = false;
_loc14_ = NaN;
_loc15_ = NaN;
if(this.negative != null)
{
_loc12_ = this.axis == 0;
_loc13_ = this.axis == 1;
_loc14_ = !!_loc12_ ? Number(Number(param4)) : (!!_loc13_ ? Number(Number(param6)) : Number(Number(param8)));
_loc15_ = !!_loc12_ ? Number(Number(param5)) : (!!_loc13_ ? Number(Number(param7)) : Number(Number(param9)));
if(_loc15_ <= this.maxCoord)
{
this.negative.collectPolygons(param1,param2,param3,param4,param5,param6,param7,param8,param9);
}
else if(_loc14_ >= this.minCoord)
{
this.positive.collectPolygons(param1,param2,param3,param4,param5,param6,param7,param8,param9);
}
else
{
_loc11_ = this.objectBoundList;
_loc10_ = this.objectList;
while(_loc11_ != null)
{
if(_loc12_)
{
if(param6 < _loc11_.boundMaxY && param7 > _loc11_.boundMinY && param8 < _loc11_.boundMaxZ && param9 > _loc11_.boundMinZ)
{
this.clip(param1,param2,param3,_loc10_);
}
}
else if(_loc13_)
{
if(param4 < _loc11_.boundMaxX && param5 > _loc11_.boundMinX && param8 < _loc11_.boundMaxZ && param9 > _loc11_.boundMinZ)
{
this.clip(param1,param2,param3,_loc10_);
}
}
else if(param4 < _loc11_.boundMaxX && param5 > _loc11_.boundMinX && param6 < _loc11_.boundMaxY && param7 > _loc11_.boundMinY)
{
this.clip(param1,param2,param3,_loc10_);
}
_loc11_ = _loc11_.next;
_loc10_ = _loc10_.next;
}
this.negative.collectPolygons(param1,param2,param3,param4,param5,param6,param7,param8,param9);
this.positive.collectPolygons(param1,param2,param3,param4,param5,param6,param7,param8,param9);
}
}
else
{
_loc10_ = this.objectList;
while(_loc10_ != null)
{
this.clip(param1,param2,param3,_loc10_);
_loc10_ = _loc10_.next;
}
}
}
private function clip(param1:Decal, param2:Number, param3:Number, param4:Object3D) : void
{
var _loc5_:Face = null;
var _loc6_:Vertex = null;
var _loc7_:Wrapper = null;
var _loc9_:Vector.<Face> = null;
var _loc10_:int = 0;
var _loc11_:int = 0;
var _loc12_:Number = NaN;
var _loc13_:Number = NaN;
var _loc14_:Vertex = null;
var _loc15_:Vertex = null;
var _loc16_:Vertex = null;
var _loc17_:Vertex = null;
var _loc18_:Vertex = null;
var _loc19_:Vertex = null;
var _loc20_:Wrapper = null;
_loc5_ = null;
_loc6_ = null;
_loc7_ = null;
var _loc8_:Vertex = null;
_loc9_ = null;
_loc10_ = 0;
_loc11_ = 0;
_loc12_ = NaN;
_loc13_ = NaN;
_loc14_ = null;
_loc15_ = null;
_loc16_ = null;
_loc17_ = null;
_loc18_ = null;
_loc19_ = null;
_loc20_ = null;
if(param4 is Mesh)
{
_loc8_ = Mesh(param4).vertexList;
_loc5_ = Mesh(param4).faceList;
if(_loc5_.material == null || _loc5_.material.transparent)
{
return;
}
_loc9_ = Mesh(param4).faces;
}
else if(param4 is BSP)
{
_loc8_ = BSP(param4).vertexList;
_loc9_ = BSP(param4).faces;
_loc5_ = _loc9_[0];
if(_loc5_.material == null || _loc5_.material.transparent)
{
return;
}
}
param4.composeAndAppend(param1);
param4.calculateInverseMatrix();
++param4.transformId;
_loc10_ = _loc9_.length;
_loc11_ = 0;
while(_loc11_ < _loc10_)
{
_loc5_ = _loc9_[_loc11_];
if(-_loc5_.normalX * param4.imc - _loc5_.normalY * param4.img - _loc5_.normalZ * param4.imk >= param3)
{
_loc12_ = _loc5_.normalX * param4.imd + _loc5_.normalY * param4.imh + _loc5_.normalZ * param4.iml;
if(!(_loc12_ <= _loc5_.offset - param2 || _loc12_ >= _loc5_.offset + param2))
{
_loc7_ = _loc5_.wrapper;
while(_loc7_ != null)
{
_loc6_ = _loc7_.vertex;
if(_loc6_.transformId != param4.transformId)
{
_loc6_.cameraX = param4.ma * _loc6_.x + param4.mb * _loc6_.y + param4.mc * _loc6_.z + param4.md;
_loc6_.cameraY = param4.me * _loc6_.x + param4.mf * _loc6_.y + param4.mg * _loc6_.z + param4.mh;
_loc6_.cameraZ = param4.mi * _loc6_.x + param4.mj * _loc6_.y + param4.mk * _loc6_.z + param4.ml;
_loc6_.transformId = param4.transformId;
}
_loc7_ = _loc7_.next;
}
_loc7_ = _loc5_.wrapper;
while(_loc7_ != null)
{
if(_loc7_.vertex.cameraX > param1.boundMinX)
{
break;
}
_loc7_ = _loc7_.next;
}
if(_loc7_ != null)
{
_loc7_ = _loc5_.wrapper;
while(_loc7_ != null)
{
if(_loc7_.vertex.cameraX < param1.boundMaxX)
{
break;
}
_loc7_ = _loc7_.next;
}
if(_loc7_ != null)
{
_loc7_ = _loc5_.wrapper;
while(_loc7_ != null)
{
if(_loc7_.vertex.cameraY > param1.boundMinY)
{
break;
}
_loc7_ = _loc7_.next;
}
if(_loc7_ != null)
{
_loc7_ = _loc5_.wrapper;
while(_loc7_ != null)
{
if(_loc7_.vertex.cameraY < param1.boundMaxY)
{
break;
}
_loc7_ = _loc7_.next;
}
if(_loc7_ != null)
{
_loc7_ = _loc5_.wrapper;
while(_loc7_ != null)
{
if(_loc7_.vertex.cameraZ > param1.boundMinZ)
{
break;
}
_loc7_ = _loc7_.next;
}
if(_loc7_ != null)
{
_loc7_ = _loc5_.wrapper;
while(_loc7_ != null)
{
if(_loc7_.vertex.cameraZ < param1.boundMaxZ)
{
break;
}
_loc7_ = _loc7_.next;
}
if(_loc7_ != null)
{
_loc18_ = null;
_loc19_ = null;
_loc7_ = _loc5_.wrapper;
while(_loc7_ != null)
{
_loc6_ = _loc7_.vertex;
_loc16_ = new Vertex();
_loc16_.x = _loc6_.cameraX;
_loc16_.y = _loc6_.cameraY;
_loc16_.z = _loc6_.cameraZ;
_loc16_.normalX = param4.ma * _loc6_.normalX + param4.mb * _loc6_.normalY + param4.mc * _loc6_.normalZ;
_loc16_.normalY = param4.me * _loc6_.normalX + param4.mf * _loc6_.normalY + param4.mg * _loc6_.normalZ;
_loc16_.normalZ = param4.mi * _loc6_.normalX + param4.mj * _loc6_.normalY + param4.mk * _loc6_.normalZ;
if(_loc19_ != null)
{
_loc19_.next = _loc16_;
}
else
{
_loc18_ = _loc16_;
}
_loc19_ = _loc16_;
_loc7_ = _loc7_.next;
}
_loc14_ = _loc19_;
_loc15_ = _loc18_;
_loc18_ = null;
_loc19_ = null;
while(_loc15_ != null)
{
_loc17_ = _loc15_.next;
_loc15_.next = null;
if(_loc15_.z > param1.boundMinZ && _loc14_.z <= param1.boundMinZ || _loc15_.z <= param1.boundMinZ && _loc14_.z > param1.boundMinZ)
{
_loc13_ = (param1.boundMinZ - _loc14_.z) / (_loc15_.z - _loc14_.z);
_loc16_ = new Vertex();
_loc16_.x = _loc14_.x + (_loc15_.x - _loc14_.x) * _loc13_;
_loc16_.y = _loc14_.y + (_loc15_.y - _loc14_.y) * _loc13_;
_loc16_.z = _loc14_.z + (_loc15_.z - _loc14_.z) * _loc13_;
_loc16_.normalX = _loc14_.normalX + (_loc15_.normalX - _loc14_.normalX) * _loc13_;
_loc16_.normalY = _loc14_.normalY + (_loc15_.normalY - _loc14_.normalY) * _loc13_;
_loc16_.normalZ = _loc14_.normalZ + (_loc15_.normalZ - _loc14_.normalZ) * _loc13_;
if(_loc19_ != null)
{
_loc19_.next = _loc16_;
}
else
{
_loc18_ = _loc16_;
}
_loc19_ = _loc16_;
}
if(_loc15_.z > param1.boundMinZ)
{
if(_loc19_ != null)
{
_loc19_.next = _loc15_;
}
else
{
_loc18_ = _loc15_;
}
_loc19_ = _loc15_;
}
_loc14_ = _loc15_;
_loc15_ = _loc17_;
}
if(_loc18_ != null)
{
_loc14_ = _loc19_;
_loc15_ = _loc18_;
_loc18_ = null;
_loc19_ = null;
while(_loc15_ != null)
{
_loc17_ = _loc15_.next;
_loc15_.next = null;
if(_loc15_.z < param1.boundMaxZ && _loc14_.z >= param1.boundMaxZ || _loc15_.z >= param1.boundMaxZ && _loc14_.z < param1.boundMaxZ)
{
_loc13_ = (param1.boundMaxZ - _loc14_.z) / (_loc15_.z - _loc14_.z);
_loc16_ = new Vertex();
_loc16_.x = _loc14_.x + (_loc15_.x - _loc14_.x) * _loc13_;
_loc16_.y = _loc14_.y + (_loc15_.y - _loc14_.y) * _loc13_;
_loc16_.z = _loc14_.z + (_loc15_.z - _loc14_.z) * _loc13_;
_loc16_.normalX = _loc14_.normalX + (_loc15_.normalX - _loc14_.normalX) * _loc13_;
_loc16_.normalY = _loc14_.normalY + (_loc15_.normalY - _loc14_.normalY) * _loc13_;
_loc16_.normalZ = _loc14_.normalZ + (_loc15_.normalZ - _loc14_.normalZ) * _loc13_;
if(_loc19_ != null)
{
_loc19_.next = _loc16_;
}
else
{
_loc18_ = _loc16_;
}
_loc19_ = _loc16_;
}
if(_loc15_.z < param1.boundMaxZ)
{
if(_loc19_ != null)
{
_loc19_.next = _loc15_;
}
else
{
_loc18_ = _loc15_;
}
_loc19_ = _loc15_;
}
_loc14_ = _loc15_;
_loc15_ = _loc17_;
}
if(_loc18_ != null)
{
_loc14_ = _loc19_;
_loc15_ = _loc18_;
_loc18_ = null;
_loc19_ = null;
while(_loc15_ != null)
{
_loc17_ = _loc15_.next;
_loc15_.next = null;
if(_loc15_.x > param1.boundMinX && _loc14_.x <= param1.boundMinX || _loc15_.x <= param1.boundMinX && _loc14_.x > param1.boundMinX)
{
_loc13_ = (param1.boundMinX - _loc14_.x) / (_loc15_.x - _loc14_.x);
_loc16_ = new Vertex();
_loc16_.x = _loc14_.x + (_loc15_.x - _loc14_.x) * _loc13_;
_loc16_.y = _loc14_.y + (_loc15_.y - _loc14_.y) * _loc13_;
_loc16_.z = _loc14_.z + (_loc15_.z - _loc14_.z) * _loc13_;
_loc16_.normalX = _loc14_.normalX + (_loc15_.normalX - _loc14_.normalX) * _loc13_;
_loc16_.normalY = _loc14_.normalY + (_loc15_.normalY - _loc14_.normalY) * _loc13_;
_loc16_.normalZ = _loc14_.normalZ + (_loc15_.normalZ - _loc14_.normalZ) * _loc13_;
if(_loc19_ != null)
{
_loc19_.next = _loc16_;
}
else
{
_loc18_ = _loc16_;
}
_loc19_ = _loc16_;
}
if(_loc15_.x > param1.boundMinX)
{
if(_loc19_ != null)
{
_loc19_.next = _loc15_;
}
else
{
_loc18_ = _loc15_;
}
_loc19_ = _loc15_;
}
_loc14_ = _loc15_;
_loc15_ = _loc17_;
}
if(_loc18_ != null)
{
_loc14_ = _loc19_;
_loc15_ = _loc18_;
_loc18_ = null;
_loc19_ = null;
while(_loc15_ != null)
{
_loc17_ = _loc15_.next;
_loc15_.next = null;
if(_loc15_.x < param1.boundMaxX && _loc14_.x >= param1.boundMaxX || _loc15_.x >= param1.boundMaxX && _loc14_.x < param1.boundMaxX)
{
_loc13_ = (param1.boundMaxX - _loc14_.x) / (_loc15_.x - _loc14_.x);
_loc16_ = new Vertex();
_loc16_.x = _loc14_.x + (_loc15_.x - _loc14_.x) * _loc13_;
_loc16_.y = _loc14_.y + (_loc15_.y - _loc14_.y) * _loc13_;
_loc16_.z = _loc14_.z + (_loc15_.z - _loc14_.z) * _loc13_;
_loc16_.normalX = _loc14_.normalX + (_loc15_.normalX - _loc14_.normalX) * _loc13_;
_loc16_.normalY = _loc14_.normalY + (_loc15_.normalY - _loc14_.normalY) * _loc13_;
_loc16_.normalZ = _loc14_.normalZ + (_loc15_.normalZ - _loc14_.normalZ) * _loc13_;
if(_loc19_ != null)
{
_loc19_.next = _loc16_;
}
else
{
_loc18_ = _loc16_;
}
_loc19_ = _loc16_;
}
if(_loc15_.x < param1.boundMaxX)
{
if(_loc19_ != null)
{
_loc19_.next = _loc15_;
}
else
{
_loc18_ = _loc15_;
}
_loc19_ = _loc15_;
}
_loc14_ = _loc15_;
_loc15_ = _loc17_;
}
if(_loc18_ != null)
{
_loc14_ = _loc19_;
_loc15_ = _loc18_;
_loc18_ = null;
_loc19_ = null;
while(_loc15_ != null)
{
_loc17_ = _loc15_.next;
_loc15_.next = null;
if(_loc15_.y > param1.boundMinY && _loc14_.y <= param1.boundMinY || _loc15_.y <= param1.boundMinY && _loc14_.y > param1.boundMinY)
{
_loc13_ = (param1.boundMinY - _loc14_.y) / (_loc15_.y - _loc14_.y);
_loc16_ = new Vertex();
_loc16_.x = _loc14_.x + (_loc15_.x - _loc14_.x) * _loc13_;
_loc16_.y = _loc14_.y + (_loc15_.y - _loc14_.y) * _loc13_;
_loc16_.z = _loc14_.z + (_loc15_.z - _loc14_.z) * _loc13_;
_loc16_.normalX = _loc14_.normalX + (_loc15_.normalX - _loc14_.normalX) * _loc13_;
_loc16_.normalY = _loc14_.normalY + (_loc15_.normalY - _loc14_.normalY) * _loc13_;
_loc16_.normalZ = _loc14_.normalZ + (_loc15_.normalZ - _loc14_.normalZ) * _loc13_;
if(_loc19_ != null)
{
_loc19_.next = _loc16_;
}
else
{
_loc18_ = _loc16_;
}
_loc19_ = _loc16_;
}
if(_loc15_.y > param1.boundMinY)
{
if(_loc19_ != null)
{
_loc19_.next = _loc15_;
}
else
{
_loc18_ = _loc15_;
}
_loc19_ = _loc15_;
}
_loc14_ = _loc15_;
_loc15_ = _loc17_;
}
if(_loc18_ != null)
{
_loc14_ = _loc19_;
_loc15_ = _loc18_;
_loc18_ = null;
_loc19_ = null;
while(_loc15_ != null)
{
_loc17_ = _loc15_.next;
_loc15_.next = null;
if(_loc15_.y < param1.boundMaxY && _loc14_.y >= param1.boundMaxY || _loc15_.y >= param1.boundMaxY && _loc14_.y < param1.boundMaxY)
{
_loc13_ = (param1.boundMaxY - _loc14_.y) / (_loc15_.y - _loc14_.y);
_loc16_ = new Vertex();
_loc16_.x = _loc14_.x + (_loc15_.x - _loc14_.x) * _loc13_;
_loc16_.y = _loc14_.y + (_loc15_.y - _loc14_.y) * _loc13_;
_loc16_.z = _loc14_.z + (_loc15_.z - _loc14_.z) * _loc13_;
_loc16_.normalX = _loc14_.normalX + (_loc15_.normalX - _loc14_.normalX) * _loc13_;
_loc16_.normalY = _loc14_.normalY + (_loc15_.normalY - _loc14_.normalY) * _loc13_;
_loc16_.normalZ = _loc14_.normalZ + (_loc15_.normalZ - _loc14_.normalZ) * _loc13_;
if(_loc19_ != null)
{
_loc19_.next = _loc16_;
}
else
{
_loc18_ = _loc16_;
}
_loc19_ = _loc16_;
}
if(_loc15_.y < param1.boundMaxY)
{
if(_loc19_ != null)
{
_loc19_.next = _loc15_;
}
else
{
_loc18_ = _loc15_;
}
_loc19_ = _loc15_;
}
_loc14_ = _loc15_;
_loc15_ = _loc17_;
}
if(_loc18_ != null)
{
_loc5_ = new Face();
_loc20_ = null;
_loc6_ = _loc18_;
while(_loc6_ != null)
{
_loc17_ = _loc6_.next;
_loc6_.next = param1.vertexList;
param1.vertexList = _loc6_;
_loc6_.u = (_loc6_.x - param1.boundMinX) / (param1.boundMaxX - param1.boundMinX);
_loc6_.v = (_loc6_.y - param1.boundMinY) / (param1.boundMaxY - param1.boundMinY);
if(_loc20_ != null)
{
_loc20_.next = new Wrapper();
_loc20_ = _loc20_.next;
}
else
{
_loc5_.wrapper = new Wrapper();
_loc20_ = _loc5_.wrapper;
}
_loc20_.vertex = _loc6_;
_loc6_ = _loc17_;
}
_loc5_.calculateBestSequenceAndNormal();
_loc5_.next = param1.faceList;
param1.faceList = _loc5_;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
_loc11_++;
}
}
}
class Receiver
{
public var next:Receiver;
public var transparent:Boolean = false;
public var buffer:int = -1;
public var firstIndex:int = -1;
public var numTriangles:int = 0;
function Receiver()
{
super();
}
}
|
package alternativa.engine3d.primitives
{
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Face;
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.core.Vertex;
import alternativa.engine3d.core.Wrapper;
import alternativa.engine3d.materials.Material;
import alternativa.engine3d.objects.Mesh;
use namespace alternativa3d;
public class Plane extends Mesh
{
public function Plane(param1:Number = 100, param2:Number = 100, param3:uint = 1, param4:uint = 1, param5:Boolean = true, param6:Boolean = false, param7:Boolean = false, param8:Material = null, param9:Material = null)
{
var _loc16_:Number = NaN;
var _loc10_:int = 0;
var _loc11_:int = 0;
super();
if(param3 < 1)
{
throw new ArgumentError(param3 + " width segments not enough.");
}
if(param4 < 1)
{
throw new ArgumentError(param4 + " length segments not enough.");
}
var _loc13_:int = param3 + 1;
var _loc14_:int = param4 + 1;
var _loc15_:Number = param1 * 0.5;
_loc16_ = param2 * 0.5;
var _loc17_:Number = 1 / param3;
var _loc18_:Number = 1 / param4;
var _loc19_:Number = param1 / param3;
var _loc20_:Number = param2 / param4;
var _loc21_:Vector.<Vertex> = new Vector.<Vertex>();
var _loc22_:int = 0;
_loc10_ = 0;
while(_loc10_ < _loc13_)
{
_loc11_ = 0;
while(_loc11_ < _loc14_)
{
var _loc23_:* = _loc22_++;
_loc21_[_loc23_] = this.createVertex(_loc10_ * _loc19_ - _loc15_,_loc11_ * _loc20_ - _loc16_,0,_loc10_ * _loc17_,(param4 - _loc11_) * _loc18_);
_loc11_++;
}
_loc10_++;
}
_loc10_ = 0;
while(_loc10_ < _loc13_)
{
_loc11_ = 0;
while(_loc11_ < _loc14_)
{
if(_loc10_ < param3 && _loc11_ < param4)
{
this.createFace(_loc21_[_loc10_ * _loc14_ + _loc11_],_loc21_[(_loc10_ + 1) * _loc14_ + _loc11_],_loc21_[(_loc10_ + 1) * _loc14_ + _loc11_ + 1],_loc21_[_loc10_ * _loc14_ + _loc11_ + 1],0,0,1,0,param6,param7,param9);
}
_loc11_++;
}
_loc10_++;
}
if(param5)
{
_loc22_ = 0;
_loc10_ = 0;
while(_loc10_ < _loc13_)
{
_loc11_ = 0;
while(_loc11_ < _loc14_)
{
_loc23_ = _loc22_++;
_loc21_[_loc23_] = this.createVertex(_loc10_ * _loc19_ - _loc15_,_loc11_ * _loc20_ - _loc16_,0,(param3 - _loc10_) * _loc17_,(param4 - _loc11_) * _loc18_);
_loc11_++;
}
_loc10_++;
}
_loc10_ = 0;
while(_loc10_ < _loc13_)
{
_loc11_ = 0;
while(_loc11_ < _loc14_)
{
if(_loc10_ < param3 && _loc11_ < param4)
{
this.createFace(_loc21_[(_loc10_ + 1) * _loc14_ + _loc11_ + 1],_loc21_[(_loc10_ + 1) * _loc14_ + _loc11_],_loc21_[_loc10_ * _loc14_ + _loc11_],_loc21_[_loc10_ * _loc14_ + _loc11_ + 1],0,0,-1,0,param6,param7,param8);
}
_loc11_++;
}
_loc10_++;
}
}
boundMinX = -_loc15_;
boundMinY = -_loc16_;
boundMinZ = 0;
boundMaxX = _loc15_;
boundMaxY = _loc16_;
boundMaxZ = 0;
}
private function createVertex(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number) : Vertex
{
var _loc6_:Vertex = new Vertex();
_loc6_.x = param1;
_loc6_.y = param2;
_loc6_.z = param3;
_loc6_.u = param4;
_loc6_.v = param5;
_loc6_.next = vertexList;
vertexList = _loc6_;
return _loc6_;
}
private function createFace(param1:Vertex, param2:Vertex, param3:Vertex, param4:Vertex, param5:Number, param6:Number, param7:Number, param8:Number, param9:Boolean, param10:Boolean, param11:Material) : void
{
var _loc12_:Vertex = null;
var _loc13_:Face = null;
if(param9)
{
param5 = -param5;
param6 = -param6;
param7 = -param7;
param8 = -param8;
_loc12_ = param1;
param1 = param4;
param4 = _loc12_;
_loc12_ = param2;
param2 = param3;
param3 = _loc12_;
}
if(param10)
{
_loc13_ = new Face();
_loc13_.material = param11;
_loc13_.wrapper = new Wrapper();
_loc13_.wrapper.vertex = param1;
_loc13_.wrapper.next = new Wrapper();
_loc13_.wrapper.next.vertex = param2;
_loc13_.wrapper.next.next = new Wrapper();
_loc13_.wrapper.next.next.vertex = param3;
_loc13_.normalX = param5;
_loc13_.normalY = param6;
_loc13_.normalZ = param7;
_loc13_.offset = param8;
_loc13_.next = faceList;
faceList = _loc13_;
_loc13_ = new Face();
_loc13_.material = param11;
_loc13_.wrapper = new Wrapper();
_loc13_.wrapper.vertex = param1;
_loc13_.wrapper.next = new Wrapper();
_loc13_.wrapper.next.vertex = param3;
_loc13_.wrapper.next.next = new Wrapper();
_loc13_.wrapper.next.next.vertex = param4;
_loc13_.normalX = param5;
_loc13_.normalY = param6;
_loc13_.normalZ = param7;
_loc13_.offset = param8;
_loc13_.next = faceList;
faceList = _loc13_;
}
else
{
_loc13_ = new Face();
_loc13_.material = param11;
_loc13_.wrapper = new Wrapper();
_loc13_.wrapper.vertex = param1;
_loc13_.wrapper.next = new Wrapper();
_loc13_.wrapper.next.vertex = param2;
_loc13_.wrapper.next.next = new Wrapper();
_loc13_.wrapper.next.next.vertex = param3;
_loc13_.wrapper.next.next.next = new Wrapper();
_loc13_.wrapper.next.next.next.vertex = param4;
_loc13_.normalX = param5;
_loc13_.normalY = param6;
_loc13_.normalZ = param7;
_loc13_.offset = param8;
_loc13_.next = faceList;
faceList = _loc13_;
}
}
override public function clone() : Object3D
{
var _loc1_:Plane = new Plane();
_loc1_.clonePropertiesFrom(this);
return _loc1_;
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.weapon.turret {
import alternativa.osgi.OSGi;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.OptionalMap;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
import alternativa.types.Short;
import flash.utils.ByteArray;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.network.command.SpaceCommand;
import platform.client.fp10.core.type.IGameObject;
import platform.client.fp10.core.type.ISpace;
import projects.tanks.client.battlefield.models.user.tank.commands.TurretStateCommand;
public class RotatingTurretModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var _updateId:Long = Long.getLong(136019789,1773777629);
private var _update_clientTimeCodec:ICodec;
private var _update_incarnationIdCodec:ICodec;
private var _update_turretStateCommandCodec:ICodec;
private var model:IModel;
public function RotatingTurretModelServer(param1:IModel) {
super();
this.model = param1;
var local2:ByteArray = new ByteArray();
this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol));
this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap());
this._update_clientTimeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false));
this._update_incarnationIdCodec = this.protocol.getCodec(new TypeCodecInfo(Short,false));
this._update_turretStateCommandCodec = this.protocol.getCodec(new TypeCodecInfo(TurretStateCommand,false));
}
public function update(param1:int, param2:int, param3:TurretStateCommand) : void {
ByteArray(this.protocolBuffer.writer).position = 0;
ByteArray(this.protocolBuffer.writer).length = 0;
this._update_clientTimeCodec.encode(this.protocolBuffer,param1);
this._update_incarnationIdCodec.encode(this.protocolBuffer,param2);
this._update_turretStateCommandCodec.encode(this.protocolBuffer,param3);
ByteArray(this.protocolBuffer.writer).position = 0;
if(Model.object == null) {
throw new Error("Execute method without model context.");
}
var local4:SpaceCommand = new SpaceCommand(Model.object.id,this._updateId,this.protocolBuffer);
var local5:IGameObject = Model.object;
var local6:ISpace = local5.space;
local6.commandSender.sendCommand(local4);
this.protocolBuffer.optionalMap.clear();
}
}
}
|
package projects.tanks.client.panel.model.quest.weekly {
public class WeeklyQuestShowingCC {
private var _hasNewQuests:Boolean;
private var _timeToNextQuest:int;
public function WeeklyQuestShowingCC(param1:Boolean = false, param2:int = 0) {
super();
this._hasNewQuests = param1;
this._timeToNextQuest = param2;
}
public function get hasNewQuests() : Boolean {
return this._hasNewQuests;
}
public function set hasNewQuests(param1:Boolean) : void {
this._hasNewQuests = param1;
}
public function get timeToNextQuest() : int {
return this._timeToNextQuest;
}
public function set timeToNextQuest(param1:int) : void {
this._timeToNextQuest = param1;
}
public function toString() : String {
var local1:String = "WeeklyQuestShowingCC [";
local1 += "hasNewQuests = " + this.hasNewQuests + " ";
local1 += "timeToNextQuest = " + this.timeToNextQuest + " ";
return local1 + "]";
}
}
}
|
package projects.tanks.client.panel.model.entrancealert
{
public interface IEntranceAlertModelBase
{
}
}
|
package alternativa.tanks.sfx
{
import alternativa.math.Vector3;
import alternativa.object.ClientObject;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.vehicles.tanks.Tank;
import flash.media.Sound;
public class TankSounds implements ISound3DEffect
{
private static var _tankPos:Vector3 = new Vector3();
private var _owner:ClientObject;
private var _tank:Tank;
private var engineSounds:EngineSounds;
private var turretSound:Sound3D;
private var turretSoundPlaying:Boolean;
private var _engineMode:int = 1;
private var _enabled:Boolean = false;
public function TankSounds(owner:ClientObject, tank:Tank, engineIdleSound:Sound, engineAccelerationSound:Sound, engineMovingSound:Sound, turretSound:Sound)
{
super();
this._owner = owner;
this._tank = tank;
this.engineSounds = new EngineSounds(engineIdleSound,engineAccelerationSound,engineMovingSound);
this.turretSound = Sound3D.create(turretSound,500,2000,5,0.5);
}
public function get owner() : ClientObject
{
return this._owner;
}
public function setIdleMode() : void
{
this._engineMode = EngineSounds.IDLE;
if(this._enabled)
{
this.engineSounds.setIdleMode();
}
}
public function setAccelerationMode() : void
{
this._engineMode = EngineSounds.ACCELERATING;
if(this._enabled)
{
this.engineSounds.setAccelerationMode();
}
}
public function setTurningMode() : void
{
this._engineMode = EngineSounds.TURNING;
if(this._enabled)
{
this.engineSounds.setTurningMode();
}
}
public function get tank() : Tank
{
return this._tank;
}
public function set tank(value:Tank) : void
{
this._tank = value;
}
public function playTurretSound(play:Boolean) : void
{
if(!this._enabled)
{
return;
}
if(play)
{
if(!this.turretSoundPlaying)
{
this.turretSoundPlaying = true;
this.turretSound.play(100,0);
}
}
else if(this.turretSoundPlaying)
{
this.turretSound.stop();
this.turretSoundPlaying = false;
}
}
public function play(millis:int, camera:GameCamera) : Boolean
{
if(this._tank == null)
{
return false;
}
if(!this._enabled)
{
return true;
}
_tankPos.vCopy(this._tank.state.pos);
this.engineSounds.update(millis,camera.pos,_tankPos,camera.xAxis);
this.turretSound.checkVolume(camera.pos,_tankPos,camera.xAxis);
return true;
}
public function destroy() : void
{
this.engineSounds.stop();
this.turretSound.stop();
}
public function kill() : void
{
}
public function get numSounds() : int
{
return 2;
}
public function readPosition(result:Vector3) : void
{
result.vCopy(this._tank.state.pos);
}
public function set enabled(value:Boolean) : void
{
if(this._enabled == value)
{
return;
}
this._enabled = value;
this.updateSounds();
}
private function updateSounds() : void
{
if(this._enabled)
{
switch(this._engineMode)
{
case EngineSounds.IDLE:
this.engineSounds.setIdleMode();
break;
case EngineSounds.ACCELERATING:
this.engineSounds.setAccelerationMode();
break;
case EngineSounds.TURNING:
this.engineSounds.setTurningMode();
}
}
else
{
this.turretSound.stop();
this.turretSoundPlaying = false;
this.engineSounds.setSilentMode();
}
}
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.utils {
public class UidUtil {
public function UidUtil() {
super();
}
public static function userNameWithoutClanTag(param1:String) : String {
var local2:int = int(param1.indexOf("] "));
if(local2 > 0) {
return param1.substr(local2 + 2);
}
return param1;
}
}
}
|
package alternativa.engine3d.objects {
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Camera3D;
import alternativa.engine3d.core.Debug;
import alternativa.engine3d.core.Face;
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.core.RayIntersectionData;
import alternativa.engine3d.core.VG;
import alternativa.engine3d.core.Vertex;
import alternativa.engine3d.core.Wrapper;
import alternativa.engine3d.materials.Material;
import flash.geom.Vector3D;
import flash.utils.Dictionary;
use namespace alternativa3d;
public class Skin extends Mesh {
alternativa3d var jointList:Joint;
alternativa3d var localList:Face;
public function Skin() {
super();
shadowMapAlphaThreshold = 100;
}
public function addJoint(param1:Joint) : Joint {
var local2:Joint = null;
if(param1 == null) {
throw new TypeError("Parameter joint must be non-null.");
}
if(param1.alternativa3d::_parentJoint != null) {
param1.alternativa3d::_parentJoint.removeChild(param1);
} else if(param1.alternativa3d::_skin != null) {
param1.alternativa3d::_skin.removeJoint(param1);
}
param1.alternativa3d::_parentJoint = null;
param1.alternativa3d::setSkin(this);
if(this.alternativa3d::jointList == null) {
this.alternativa3d::jointList = param1;
} else {
local2 = this.alternativa3d::jointList;
while(local2 != null) {
if(local2.alternativa3d::nextJoint == null) {
local2.alternativa3d::nextJoint = param1;
break;
}
local2 = local2.alternativa3d::nextJoint;
}
}
return param1;
}
public function removeJoint(param1:Joint) : Joint {
var local2:Joint = null;
var local3:Joint = null;
if(param1 == null) {
throw new TypeError("Parameter joint must be non-null.");
}
if(param1.alternativa3d::_parentJoint != null || param1.alternativa3d::_skin != this) {
throw new ArgumentError("The supplied Joint must be contained in the caller.");
}
local3 = this.alternativa3d::jointList;
while(local3 != null) {
if(local3 == param1) {
if(local2 != null) {
local2.alternativa3d::nextJoint = local3.alternativa3d::nextJoint;
} else {
this.alternativa3d::jointList = local3.alternativa3d::nextJoint;
}
local3.alternativa3d::nextJoint = null;
local3.alternativa3d::_parentJoint = null;
local3.alternativa3d::setSkin(null);
return param1;
}
local2 = local3;
local3 = local3.alternativa3d::nextJoint;
}
return null;
}
public function getJointAt(param1:int) : Joint {
if(param1 < 0) {
throw new RangeError("The supplied index is out of bounds.");
}
var local2:Joint = this.alternativa3d::jointList;
var local3:int = 0;
while(local3 < param1) {
if(local2 == null) {
throw new RangeError("The supplied index is out of bounds.");
}
local2 = local2.alternativa3d::nextJoint;
local3++;
}
if(local2 == null) {
throw new RangeError("The supplied index is out of bounds.");
}
return local2;
}
public function get numJoints() : int {
var local1:int = 0;
var local2:Joint = this.alternativa3d::jointList;
while(local2 != null) {
local1++;
local2 = local2.alternativa3d::nextJoint;
}
return local1;
}
public function getJointByName(param1:String) : Joint {
var local4:Joint = null;
var local6:int = 0;
var local7:Vector.<Joint> = null;
var local8:Joint = null;
if(param1 == null) {
throw new TypeError("Parameter name must be non-null.");
}
var local2:Vector.<Joint> = new Vector.<Joint>();
var local3:Vector.<Joint> = new Vector.<Joint>();
local4 = this.alternativa3d::jointList;
while(local4 != null) {
if(local4.name == param1) {
return local4;
}
local2.push(local4);
local4 = local4.alternativa3d::nextJoint;
}
var local5:int = this.numJoints;
while(local5 > 0) {
local6 = 0;
while(local6 < local5) {
local4 = local2[local6];
local8 = local4.alternativa3d::childrenList;
while(local8 != null) {
if(local8.name == param1) {
return local8;
}
if(local8.alternativa3d::childrenList != null) {
local3.push(local8);
}
local8 = local8.alternativa3d::nextJoint;
}
local6++;
}
local7 = local2;
local2 = local3;
local3 = local7;
local3.length = 0;
local5 = int(local2.length);
}
return null;
}
override public function addVertex(param1:Number, param2:Number, param3:Number, param4:Number = 0, param5:Number = 0, param6:Object = null) : Vertex {
this.alternativa3d::clearLocal();
return super.addVertex(param1,param2,param3,param4,param5,param6);
}
override public function removeVertex(param1:Vertex) : Vertex {
this.alternativa3d::clearLocal();
var local2:Vertex = super.removeVertex(param1);
var local3:Joint = this.alternativa3d::jointList;
while(local3 != null) {
this.unbindVertex(local3,local2);
local3 = local3.alternativa3d::nextJoint;
}
return local2;
}
override public function removeVertexById(param1:Object) : Vertex {
this.alternativa3d::clearLocal();
var local2:Vertex = super.removeVertexById(param1);
var local3:Joint = this.alternativa3d::jointList;
while(local3 != null) {
this.unbindVertex(local3,local2);
local3 = local3.alternativa3d::nextJoint;
}
return local2;
}
private function unbindVertex(param1:Joint, param2:Vertex) : void {
param1.unbindVertex(param2);
var local3:Joint = param1.alternativa3d::childrenList;
while(local3 != null) {
this.unbindVertex(local3,param2);
local3 = local3.alternativa3d::nextJoint;
}
}
override public function addFace(param1:Vector.<Vertex>, param2:Material = null, param3:Object = null) : Face {
this.alternativa3d::clearLocal();
return super.addFace(param1,param2,param3);
}
override public function addFaceByIds(param1:Array, param2:Material = null, param3:Object = null) : Face {
this.alternativa3d::clearLocal();
return super.addFaceByIds(param1,param2,param3);
}
override public function addTriFace(param1:Vertex, param2:Vertex, param3:Vertex, param4:Material = null, param5:Object = null) : Face {
this.alternativa3d::clearLocal();
return super.addTriFace(param1,param2,param3,param4,param5);
}
override public function addQuadFace(param1:Vertex, param2:Vertex, param3:Vertex, param4:Vertex, param5:Material = null, param6:Object = null) : Face {
this.alternativa3d::clearLocal();
return super.addQuadFace(param1,param2,param3,param4,param5,param6);
}
override public function removeFace(param1:Face) : Face {
this.alternativa3d::clearLocal();
return super.removeFace(param1);
}
override public function removeFaceById(param1:Object) : Face {
this.alternativa3d::clearLocal();
return super.removeFaceById(param1);
}
override public function addVerticesAndFaces(param1:Vector.<Number>, param2:Vector.<Number>, param3:Vector.<int>, param4:Boolean = false, param5:Material = null) : void {
this.alternativa3d::clearLocal();
super.addVerticesAndFaces(param1,param2,param3,param4,param5);
}
override public function weldVertices(param1:Number = 0, param2:Number = 0) : void {
var local3:Vertex = null;
var local5:* = undefined;
var local6:Joint = null;
this.alternativa3d::clearLocal();
var local4:Dictionary = new Dictionary();
local3 = alternativa3d::vertexList;
while(local3 != null) {
local4[local3] = true;
local3 = local3.alternativa3d::next;
}
super.weldVertices(param1,param2);
local3 = alternativa3d::vertexList;
while(local3 != null) {
delete local4[local3];
local3 = local3.alternativa3d::next;
}
for(local5 in local4) {
local3 = local5;
local6 = this.alternativa3d::jointList;
while(local6 != null) {
this.unbindVertex(local6,local3);
local6 = local6.alternativa3d::nextJoint;
}
}
}
override public function weldFaces(param1:Number = 0, param2:Number = 0, param3:Number = 0, param4:Boolean = false) : void {
this.alternativa3d::clearLocal();
super.weldFaces(param1,param2,param3,param4);
}
override public function optimizeForDynamicBSP(param1:int = 1) : void {
this.alternativa3d::clearLocal();
super.optimizeForDynamicBSP(param1);
}
public function calculateBindingMatrices() : void {
alternativa3d::ma = 1;
alternativa3d::mb = 0;
alternativa3d::mc = 0;
alternativa3d::md = 0;
alternativa3d::me = 0;
alternativa3d::mf = 1;
alternativa3d::mg = 0;
alternativa3d::mh = 0;
alternativa3d::mi = 0;
alternativa3d::mj = 0;
alternativa3d::mk = 1;
alternativa3d::ml = 0;
var local1:Joint = this.alternativa3d::jointList;
while(local1 != null) {
local1.alternativa3d::calculateBindingMatrix(this);
local1 = local1.alternativa3d::nextJoint;
}
}
public function normalizeWeights() : void {
var local2:Joint = null;
var local1:Vertex = alternativa3d::vertexList;
while(local1 != null) {
local1.alternativa3d::offset = 0;
local1 = local1.alternativa3d::next;
}
local2 = this.alternativa3d::jointList;
while(local2 != null) {
local2.alternativa3d::addWeights();
local2 = local2.alternativa3d::nextJoint;
}
local2 = this.alternativa3d::jointList;
while(local2 != null) {
local2.alternativa3d::normalizeWeights();
local2 = local2.alternativa3d::nextJoint;
}
}
override public function intersectRay(param1:Vector3D, param2:Vector3D, param3:Dictionary = null, param4:Camera3D = null) : RayIntersectionData {
var local7:Face = null;
var local8:Face = null;
if(param3 != null && Boolean(param3[this])) {
return null;
}
if(!alternativa3d::boundIntersectRay(param1,param2,boundMinX,boundMinY,boundMinZ,boundMaxX,boundMaxY,boundMaxZ)) {
return null;
}
this.alternativa3d::updateLocal();
var local5:Face = alternativa3d::faceList;
alternativa3d::faceList = this.alternativa3d::localList;
calculateFacesNormals(true);
var local6:RayIntersectionData = super.intersectRay(param1,param2,param3,param4);
alternativa3d::faceList = local5;
if(local6 != null) {
local7 = alternativa3d::faceList;
local8 = this.alternativa3d::localList;
while(local7 != null) {
if(local8 == local6.face) {
local6.face = local7;
break;
}
local7 = local7.alternativa3d::next;
local8 = local8.alternativa3d::next;
}
}
return local6;
}
override alternativa3d function checkIntersection(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number, param8:Dictionary) : Boolean {
this.alternativa3d::updateLocal();
var local9:Face = alternativa3d::faceList;
alternativa3d::faceList = this.alternativa3d::localList;
calculateFacesNormals(true);
var local10:Boolean = super.alternativa3d::checkIntersection(param1,param2,param3,param4,param5,param6,param7,param8);
alternativa3d::faceList = local9;
return local10;
}
override alternativa3d function collectPlanes(param1:Vector3D, param2:Vector3D, param3:Vector3D, param4:Vector3D, param5:Vector3D, param6:Vector.<Face>, param7:Dictionary = null) : void {
if(param7 != null && Boolean(param7[this])) {
return;
}
var local8:Vector3D = alternativa3d::calculateSphere(param1,param2,param3,param4,param5);
if(!alternativa3d::boundIntersectSphere(local8,boundMinX,boundMinY,boundMinZ,boundMaxX,boundMaxY,boundMaxZ)) {
return;
}
var local9:Face = alternativa3d::faceList;
alternativa3d::faceList = this.alternativa3d::localList;
calculateFacesNormals(true);
super.alternativa3d::collectPlanes(param1,param2,param3,param4,param5,param6,param7);
alternativa3d::faceList = local9;
}
public function attach(param1:Skin) : void {
var local3:Vertex = null;
var local4:Face = null;
var local5:Joint = null;
this.alternativa3d::clearLocal();
param1.alternativa3d::clearLocal();
if(alternativa3d::vertexList == null) {
alternativa3d::vertexList = param1.alternativa3d::vertexList;
} else {
local3 = alternativa3d::vertexList;
while(local3.alternativa3d::next != null) {
local3 = local3.alternativa3d::next;
}
local3.alternativa3d::next = param1.alternativa3d::vertexList;
}
param1.alternativa3d::vertexList = null;
if(alternativa3d::faceList == null) {
alternativa3d::faceList = param1.alternativa3d::faceList;
} else {
local4 = alternativa3d::faceList;
while(local4.alternativa3d::next != null) {
local4 = local4.alternativa3d::next;
}
local4.alternativa3d::next = param1.alternativa3d::faceList;
}
param1.alternativa3d::faceList = null;
var local2:Joint = param1.alternativa3d::jointList;
while(local2 != null) {
if(local2.name == null || local2.name == "") {
this.addJointFast(local2);
} else {
local5 = this.getJointByName(local2.name);
if(local5 != null) {
this.mergeJoints(local2,local5);
} else {
this.addJointFast(local2);
}
}
local2 = local2.alternativa3d::nextJoint;
}
param1.alternativa3d::jointList = null;
}
private function addJointFast(param1:Joint) : Joint {
var local2:Joint = null;
param1.alternativa3d::_parentJoint = null;
param1.alternativa3d::setSkinFast(this);
if(this.alternativa3d::jointList == null) {
this.alternativa3d::jointList = param1;
} else {
local2 = this.alternativa3d::jointList;
while(local2 != null) {
if(local2.alternativa3d::nextJoint == null) {
local2.alternativa3d::nextJoint = param1;
break;
}
local2 = local2.alternativa3d::nextJoint;
}
}
return param1;
}
private function mergeJoints(param1:Joint, param2:Joint) : void {
var local5:Joint = null;
var local3:VertexBinding = param1.alternativa3d::vertexBindingList;
if(local3 != null) {
while(local3.alternativa3d::next != null) {
local3 = local3.alternativa3d::next;
}
local3.alternativa3d::next = param2.alternativa3d::vertexBindingList;
param2.alternativa3d::vertexBindingList = param1.alternativa3d::vertexBindingList;
}
param1.alternativa3d::vertexBindingList = null;
var local4:Joint = param1.alternativa3d::childrenList;
while(local4 != null) {
if(local4.name == null || local4.name.length == 0) {
param2.alternativa3d::addChildFast(local4);
} else {
local5 = this.findJointChildByName(local4.name,param2);
if(local5 != null) {
this.mergeJoints(local4,local5);
} else {
param2.alternativa3d::addChildFast(local4);
}
}
local4 = local4.alternativa3d::nextJoint;
}
param1.alternativa3d::childrenList = null;
}
private function findJointChildByName(param1:String, param2:Joint) : Joint {
var local3:Joint = param2.alternativa3d::childrenList;
while(local3 != null) {
if(local3.name == param1) {
return local3;
}
local3 = local3.alternativa3d::nextJoint;
}
return null;
}
override public function clone() : Object3D {
this.alternativa3d::clearLocal();
var local1:Skin = new Skin();
local1.clonePropertiesFrom(this);
return local1;
}
override protected function clonePropertiesFrom(param1:Object3D) : void {
var local3:Vertex = null;
var local4:Vertex = null;
var local6:Joint = null;
var local7:Joint = null;
super.clonePropertiesFrom(param1);
var local2:Skin = param1 as Skin;
local3 = local2.alternativa3d::vertexList;
local4 = alternativa3d::vertexList;
while(local3 != null) {
local3.alternativa3d::value = local4;
local3 = local3.alternativa3d::next;
local4 = local4.alternativa3d::next;
}
var local5:Joint = local2.alternativa3d::jointList;
while(local5 != null) {
local7 = this.cloneJoint(local5);
if(this.alternativa3d::jointList != null) {
local6.alternativa3d::nextJoint = local7;
} else {
this.alternativa3d::jointList = local7;
}
local6 = local7;
local7.alternativa3d::_parentJoint = null;
local7.alternativa3d::setSkinFast(this);
local5 = local5.alternativa3d::nextJoint;
}
local3 = local2.alternativa3d::vertexList;
while(local3 != null) {
local3.alternativa3d::value = null;
local3 = local3.alternativa3d::next;
}
}
override alternativa3d function draw(param1:Camera3D) : void {
var local4:Vertex = null;
var local5:Joint = null;
if(alternativa3d::faceList == null) {
return;
}
if(clipping == 0) {
if(Boolean(alternativa3d::culling & 1)) {
return;
}
alternativa3d::culling = 0;
}
var local2:int = param1.debug ? int(param1.alternativa3d::checkInDebug(this)) : 0;
if(Boolean(local2 & Debug.BOUNDS)) {
Debug.alternativa3d::drawBounds(param1,this,boundMinX,boundMinY,boundMinZ,boundMaxX,boundMaxY,boundMaxZ);
}
if(alternativa3d::transformId > 500000000) {
alternativa3d::transformId = 0;
local4 = alternativa3d::vertexList;
while(local4 != null) {
local4.alternativa3d::transformId = 0;
local4 = local4.alternativa3d::next;
}
}
++alternativa3d::transformId;
alternativa3d::calculateInverseMatrix();
var local3:Face = this.alternativa3d::prepareFaces(param1,this.alternativa3d::localList);
if(local3 == null) {
return;
}
if(alternativa3d::culling > 0) {
if(clipping == 1) {
local3 = param1.alternativa3d::cull(local3,alternativa3d::culling);
} else {
local3 = param1.alternativa3d::clip(local3,alternativa3d::culling);
}
if(local3 == null) {
return;
}
}
if(local3.alternativa3d::processNext != null) {
if(sorting == 1) {
local3 = param1.alternativa3d::sortByAverageZ(local3);
} else if(sorting == 2) {
local3 = param1.alternativa3d::sortByDynamicBSP(local3,threshold);
}
}
if(Boolean(local2 & Debug.BONES)) {
local5 = this.alternativa3d::jointList;
while(local5 != null) {
local5.alternativa3d::drawDebug(param1);
local5 = local5.alternativa3d::nextJoint;
}
}
if(Boolean(local2 & Debug.EDGES)) {
Debug.alternativa3d::drawEdges(param1,local3,16777215);
}
alternativa3d::drawFaces(param1,local3);
}
override alternativa3d function getVG(param1:Camera3D) : VG {
var local4:Joint = null;
var local5:Vertex = null;
var local6:Face = null;
var local7:Face = null;
var local8:Face = null;
if(alternativa3d::faceList == null) {
return null;
}
if(clipping == 0) {
if(Boolean(alternativa3d::culling & 1)) {
return null;
}
alternativa3d::culling = 0;
}
var local2:int = param1.debug ? int(param1.alternativa3d::checkInDebug(this)) : 0;
if(Boolean(local2 & Debug.BONES)) {
local4 = this.alternativa3d::jointList;
while(local4 != null) {
local4.alternativa3d::drawDebug(param1);
local4 = local4.alternativa3d::nextJoint;
}
}
if(alternativa3d::transformId > 500000000) {
alternativa3d::transformId = 0;
local5 = alternativa3d::vertexList;
while(local5 != null) {
local5.alternativa3d::transformId = 0;
local5 = local5.alternativa3d::next;
}
}
++alternativa3d::transformId;
alternativa3d::calculateInverseMatrix();
var local3:Face = this.alternativa3d::prepareFaces(param1,this.alternativa3d::localList);
if(local3 == null) {
return null;
}
if(alternativa3d::culling > 0) {
if(clipping == 1) {
local3 = param1.alternativa3d::cull(local3,alternativa3d::culling);
} else {
local3 = param1.alternativa3d::clip(local3,alternativa3d::culling);
}
if(local3 == null) {
return null;
}
}
if(alternativa3d::concatenatedAlpha >= 1 && alternativa3d::concatenatedBlendMode == "normal") {
local8 = null;
local6 = local3;
local3 = null;
while(local6 != null) {
local7 = local6.alternativa3d::processNext;
if(local6.material != null && !local6.material.alternativa3d::transparent) {
local6.alternativa3d::processNext = local8;
local8 = local6;
} else {
local6.alternativa3d::processNext = local3;
local3 = local6;
}
local6 = local7;
}
local6 = local8;
while(local6 != null) {
local7 = local6.alternativa3d::processNext;
if(local7 == null || local7.material != local8.material) {
local6.alternativa3d::processNext = null;
param1.alternativa3d::addTransparentOpaque(local8,this);
local8 = local7;
}
local6 = local7;
}
if(local3 == null) {
return null;
}
}
return VG.alternativa3d::create(this,local3,sorting,local2,false);
}
override alternativa3d function prepareFaces(param1:Camera3D, param2:Face) : Face {
var local4:Wrapper = null;
var local5:Vertex = null;
var local6:Vertex = null;
var local7:Vertex = null;
var local8:Number = NaN;
var local9:Number = NaN;
var local10:Number = NaN;
var local11:Number = NaN;
var local12:Number = NaN;
var local13:Number = NaN;
var local14:Number = NaN;
var local15:Number = NaN;
var local16:Number = NaN;
this.alternativa3d::updateLocal();
var local3:Face = param2;
while(local3 != null) {
local4 = local3.alternativa3d::wrapper;
local5 = local4.alternativa3d::vertex;
local4 = local4.alternativa3d::next;
local6 = local4.alternativa3d::vertex;
local4 = local4.alternativa3d::next;
local7 = local4.alternativa3d::vertex;
local8 = local6.x - local5.x;
local9 = local6.y - local5.y;
local10 = local6.z - local5.z;
local11 = local7.x - local5.x;
local12 = local7.y - local5.y;
local13 = local7.z - local5.z;
local14 = local13 * local9 - local12 * local10;
local15 = local11 * local10 - local13 * local8;
local16 = local12 * local8 - local11 * local9;
local3.alternativa3d::normalX = local14;
local3.alternativa3d::normalY = local15;
local3.alternativa3d::normalZ = local16;
local3.alternativa3d::offset = local5.x * local14 + local5.y * local15 + local5.z * local16;
local3 = local3.alternativa3d::next;
}
return super.alternativa3d::prepareFaces(param1,param2);
}
override alternativa3d function prepareResources() : void {
}
override alternativa3d function deleteResources() : void {
}
alternativa3d function updateLocal() : void {
var local1:Vertex = null;
var local2:Face = null;
var local3:Face = null;
var local6:Face = null;
var local7:Wrapper = null;
var local8:Wrapper = null;
var local9:Wrapper = null;
var local10:Material = null;
var local11:Vertex = null;
if(this.alternativa3d::localList == null) {
local1 = alternativa3d::vertexList;
while(local1 != null) {
local1.alternativa3d::value = new Vertex();
local1 = local1.alternativa3d::next;
}
local2 = alternativa3d::faceList;
while(local2 != null) {
local3 = new Face();
local7 = null;
local8 = local2.alternativa3d::wrapper;
while(local8 != null) {
local9 = new Wrapper();
local9.alternativa3d::vertex = local8.alternativa3d::vertex.alternativa3d::value;
if(local7 != null) {
local7.alternativa3d::next = local9;
} else {
local3.alternativa3d::wrapper = local9;
}
local7 = local9;
local8 = local8.alternativa3d::next;
}
if(local6 != null) {
local6.alternativa3d::next = local3;
} else {
this.alternativa3d::localList = local3;
}
local6 = local3;
local2 = local2.alternativa3d::next;
}
}
var local4:Boolean = false;
local2 = alternativa3d::faceList;
local3 = this.alternativa3d::localList;
while(local2 != null) {
local10 = local2.material;
local4 ||= local10 != null && Boolean(local10.alternativa3d::useVerticesNormals);
local3.material = local2.material;
local2 = local2.alternativa3d::next;
local3 = local3.alternativa3d::next;
}
local1 = alternativa3d::vertexList;
while(local1 != null) {
local11 = local1.alternativa3d::value;
local11.x = 0;
local11.y = 0;
local11.z = 0;
local11.u = local1.u;
local11.v = local1.v;
local11.normalX = 0;
local11.normalY = 0;
local11.normalZ = 0;
local11.alternativa3d::drawId = 0;
local1 = local1.alternativa3d::next;
}
var local5:Joint = this.alternativa3d::jointList;
while(local5 != null) {
local5.alternativa3d::composeMatrix();
local5.alternativa3d::calculateVertices(local4,false);
local5 = local5.alternativa3d::nextJoint;
}
}
alternativa3d function clearLocal() : void {
var local1:Vertex = alternativa3d::vertexList;
while(local1 != null) {
local1.alternativa3d::value = null;
local1 = local1.alternativa3d::next;
}
this.alternativa3d::localList = null;
}
override alternativa3d function updateBounds(param1:Object3D, param2:Object3D = null) : void {
this.alternativa3d::updateLocal();
var local3:Face = alternativa3d::faceList;
alternativa3d::faceList = this.alternativa3d::localList;
super.alternativa3d::updateBounds(param1,param2);
alternativa3d::faceList = local3;
}
override alternativa3d function split(param1:Vector3D, param2:Vector3D, param3:Vector3D, param4:Number) : Vector.<Object3D> {
return new Vector.<Object3D>(2);
}
private function cloneJoint(param1:Joint) : Joint {
var local3:VertexBinding = null;
var local6:Joint = null;
var local7:VertexBinding = null;
var local8:Joint = null;
var local2:Joint = new Joint();
local2.name = param1.name;
local2.x = param1.x;
local2.y = param1.y;
local2.z = param1.z;
local2.rotationX = param1.rotationX;
local2.rotationY = param1.rotationY;
local2.rotationZ = param1.rotationZ;
local2.scaleX = param1.scaleX;
local2.scaleY = param1.scaleY;
local2.scaleZ = param1.scaleZ;
local2.alternativa3d::bma = param1.alternativa3d::bma;
local2.alternativa3d::bmb = param1.alternativa3d::bmb;
local2.alternativa3d::bmc = param1.alternativa3d::bmc;
local2.alternativa3d::bmd = param1.alternativa3d::bmd;
local2.alternativa3d::bme = param1.alternativa3d::bme;
local2.alternativa3d::bmf = param1.alternativa3d::bmf;
local2.alternativa3d::bmg = param1.alternativa3d::bmg;
local2.alternativa3d::bmh = param1.alternativa3d::bmh;
local2.alternativa3d::bmi = param1.alternativa3d::bmi;
local2.alternativa3d::bmj = param1.alternativa3d::bmj;
local2.alternativa3d::bmk = param1.alternativa3d::bmk;
local2.alternativa3d::bml = param1.alternativa3d::bml;
if(param1 is Bone) {
Bone(local2).length = Bone(param1).length;
Bone(local2).alternativa3d::distance = Bone(param1).alternativa3d::distance;
Bone(local2).alternativa3d::lx = Bone(param1).alternativa3d::lx;
Bone(local2).alternativa3d::ly = Bone(param1).alternativa3d::ly;
Bone(local2).alternativa3d::lz = Bone(param1).alternativa3d::lz;
Bone(local2).alternativa3d::ldot = Bone(param1).alternativa3d::ldot;
}
var local4:VertexBinding = param1.alternativa3d::vertexBindingList;
while(local4 != null) {
local7 = new VertexBinding();
local7.alternativa3d::vertex = local4.alternativa3d::vertex.alternativa3d::value;
local7.alternativa3d::weight = local4.alternativa3d::weight;
if(local3 != null) {
local3.alternativa3d::next = local7;
} else {
local2.alternativa3d::vertexBindingList = local7;
}
local3 = local7;
local4 = local4.alternativa3d::next;
}
var local5:Joint = param1.alternativa3d::childrenList;
while(local5 != null) {
local8 = this.cloneJoint(local5);
if(local2.alternativa3d::childrenList != null) {
local6.alternativa3d::nextJoint = local8;
} else {
local2.alternativa3d::childrenList = local8;
}
local6 = local8;
local8.alternativa3d::_parentJoint = local2;
local5 = local5.alternativa3d::nextJoint;
}
return local2;
}
}
}
|
package alternativa.tanks.gui.frames {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.frames.YellowFrameSkin_frame.png")]
public class YellowFrameSkin_frame extends BitmapAsset {
public function YellowFrameSkin_frame() {
super();
}
}
}
|
package com.lorentz.SVG.data.path
{
public class SVGLineToVerticalCommand extends SVGPathCommand
{
public var y:Number = 0;
public var absolute:Boolean = false;
public function SVGLineToVerticalCommand(absolute:Boolean, y:Number = 0)
{
super();
this.absolute = absolute;
this.y = y;
}
override public function get type():String {
return absolute ? "V" : "v";
}
override public function clone():Object {
var copy:SVGLineToVerticalCommand = new SVGLineToVerticalCommand(absolute);
copy.y = y;
return copy;
}
}
} |
package _codec.projects.tanks.client.battlefield.models.battle.battlefield.fps {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import projects.tanks.client.battlefield.models.battle.battlefield.fps.FpsStatisticType;
public class CodecFpsStatisticType implements ICodec {
public function CodecFpsStatisticType() {
super();
}
public function init(param1:IProtocol) : void {
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:FpsStatisticType = null;
var local3:int = int(param1.reader.readInt());
switch(local3) {
case 0:
local2 = FpsStatisticType.SOFTWARE;
break;
case 1:
local2 = FpsStatisticType.HARDWARE_CONSTRAINT;
break;
case 2:
local2 = FpsStatisticType.HARDWARE_BASELINE;
}
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:int = int(param2.value);
param1.writer.writeInt(local3);
}
}
}
|
package alternativa.tanks.gui.settings.controls {
import alternativa.tanks.service.settings.SettingEnum;
public interface SettingControl {
function getSetting() : SettingEnum;
function getSettingValue() : Object;
}
}
|
package alternativa.tanks.view.icons {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.view.icons.BattleParamsCheckButtonIcons_ultimatesClass.png")]
public class BattleParamsCheckButtonIcons_ultimatesClass extends BitmapAsset {
public function BattleParamsCheckButtonIcons_ultimatesClass() {
super();
}
}
}
|
package alternativa.tanks.battle.objects.tank.controllers {
import alternativa.osgi.service.command.CommandService;
import alternativa.osgi.service.command.FormattedOutput;
import alternativa.tanks.battle.events.BattleEventDispatcher;
import alternativa.tanks.battle.objects.tank.Tank;
import alternativa.tanks.battle.objects.tank.tankchassis.TrackedChassis;
import alternativa.tanks.service.settings.keybinding.GameActionEnum;
import alternativa.tanks.services.battleinput.BattleInputService;
import alternativa.tanks.services.battleinput.GameActionListener;
import alternativa.tanks.utils.MathUtils;
public class LocalChassisController extends ChassisController implements GameActionListener {
[Inject]
public static var commandService:CommandService;
[Inject]
public static var battleEventDispatcher:BattleEventDispatcher;
[Inject]
public static var battleInputService:BattleInputService;
private static const REVERSE_BACK_TURN_MASK:int = 1 << BIT_REVERSE_TURN;
private var reverseBackTurnMask:int;
private var cheatController:LocalCheatController;
private var isEnabled:Boolean = false;
public function LocalChassisController(param1:Tank, param2:ChassisControlListener) {
super(param1,param2);
}
public function enable() : void {
if(!this.isEnabled) {
this.isEnabled = true;
battleInputService.addGameActionListener(this);
}
}
public function disable() : void {
if(this.isEnabled) {
this.isEnabled = false;
battleInputService.removeGameActionListener(this);
setControlState(0,TrackedChassis.TURN_SPEED_COUNT);
}
}
public function onGameAction(param1:GameActionEnum, param2:Boolean) : void {
var local4:int = 0;
var local3:int = controlState;
switch(param1) {
case GameActionEnum.CHASSIS_FORWARD_MOVEMENT:
local3 = MathUtils.changeBitValue(controlState,BIT_FORWARD,param2);
break;
case GameActionEnum.CHASSIS_BACKWARD_MOVEMENT:
local3 = MathUtils.changeBitValue(controlState,BIT_BACK,param2);
break;
case GameActionEnum.CHASSIS_LEFT_MOVEMENT:
local3 = MathUtils.changeBitValue(controlState,BIT_LEFT,param2);
break;
case GameActionEnum.CHASSIS_RIGHT_MOVEMENT:
local3 = MathUtils.changeBitValue(controlState,BIT_RIGHT,param2);
}
if(local3 != controlState) {
local4 = local3 | this.reverseBackTurnMask;
setControlState(local4,TrackedChassis.TURN_SPEED_COUNT);
}
}
override protected function onAppliedControlStateChanged(param1:int) : void {
listener.onChassisControlChanged(param1,true);
}
public function setReversedBackTurn(param1:Boolean) : void {
if(param1) {
this.reverseBackTurnMask = REVERSE_BACK_TURN_MASK;
} else {
this.reverseBackTurnMask = 0;
controlState &= ~REVERSE_BACK_TURN_MASK;
}
}
[Obfuscation(rename="false")]
override public function close() : void {
super.close();
this.disable();
}
private function enableCheatControls(param1:FormattedOutput) : void {
}
}
}
|
package alternativa.tanks.battle.objects.tank.skintexturesregistry {
import flash.display.BitmapData;
internal class TextureEntry {
public var referenceCount:int;
public var texture:BitmapData;
public function TextureEntry(param1:BitmapData) {
super();
this.texture = param1;
}
}
}
|
package alternativa.tanks.service.paymentcomplete {
import flash.events.IEventDispatcher;
public interface PaymentCompleteService extends IEventDispatcher {
function paymentCompleted() : void;
}
}
|
package _codec.projects.tanks.client.battlefield.models.effects.description {
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.EnumCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.battlefield.models.effects.description.EffectCategory;
import projects.tanks.client.battlefield.models.effects.description.EffectDescriptionCC;
public class CodecEffectDescriptionCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_category:ICodec;
private var codec_index:ICodec;
private var codec_tank:ICodec;
public function CodecEffectDescriptionCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_category = param1.getCodec(new EnumCodecInfo(EffectCategory,false));
this.codec_index = param1.getCodec(new TypeCodecInfo(int,false));
this.codec_tank = param1.getCodec(new TypeCodecInfo(IGameObject,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:EffectDescriptionCC = new EffectDescriptionCC();
local2.category = this.codec_category.decode(param1) as EffectCategory;
local2.index = this.codec_index.decode(param1) as int;
local2.tank = this.codec_tank.decode(param1) as IGameObject;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:EffectDescriptionCC = EffectDescriptionCC(param2);
this.codec_category.encode(param1,local3.category);
this.codec_index.encode(param1,local3.index);
this.codec_tank.encode(param1,local3.tank);
}
}
}
|
package alternativa.tanks.models.battle.gui.inventory {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.models.battle.gui.inventory.HudInventoryIcon_armorColorIconClass.png")]
public class HudInventoryIcon_armorColorIconClass extends BitmapAsset {
public function HudInventoryIcon_armorColorIconClass() {
super();
}
}
}
|
package scpacker.gui.en
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class GTanksIEN_coldload13 extends BitmapAsset
{
public function GTanksIEN_coldload13()
{
super();
}
}
}
|
package controls.timer {
public interface CountDownTimerOnCompleteBefore {
function onCompleteBefore(param1:CountDownTimer, param2:Boolean) : void;
}
}
|
package alternativa.tanks.engine3d {
import flash.display.BitmapData;
public class DefaultEffectsMaterialRegistry extends TextureMaterialRegistryBase implements EffectsMaterialRegistry {
public function DefaultEffectsMaterialRegistry() {
super(new DefaultTextureMaterialFactory());
}
override protected function getTexture(param1:BitmapData, param2:Boolean) : BitmapData {
return param1;
}
}
}
|
package alternativa.engine3d.core {
import flash.display.Stage;
import flash.events.Event;
import flash.net.SharedObject;
import flash.utils.clearInterval;
import flash.utils.getTimer;
import flash.utils.setTimeout;
public class PerformanceController {
public static const FOG:String = "fog";
public static const DIRECTIONAL_LIGHT:String = "directionalLight";
public static const SHADOW_MAP:String = "shadowMap";
public static const SOFT_TRANSPARENCY:String = "softTransparency";
public static const SHADOWS:String = "shadows";
public static const ANTI_ALIAS:String = "antiAlias";
public static const SSAO:String = "ssao";
public static const DEFERRED_LIGHTING:String = "deferredLighting";
private static var storage:SharedObject = SharedObject.getLocal("performance");
private var types:Vector.<String> = new Vector.<String>();
private var speeds:Vector.<Number> = new Vector.<Number>();
private var actives:Vector.<Boolean> = new Vector.<Boolean>();
private var stage:Stage;
private var camera:Camera3D;
private var fpsThreshold:Number;
private var ratioThreshold:Number;
private var testTime:Number;
private var maxAttempts:uint;
private var key:String;
private var traceLog:Boolean;
private var mask:int;
private var id:uint;
private var idleId:uint;
private var timer:int;
private var frameCounter:int;
private var lowCounter:int;
private var state:int;
private var features:Vector.<Feature>;
private var featuresCount:int;
private var index:int;
private var _block:Boolean = false;
private var afterIdle:Boolean;
public function PerformanceController() {
super();
}
public function addFeature(param1:String, param2:Number, param3:Boolean) : void {
var local4:String = null;
if(this.camera != null) {
throw new Error("Cannot add feature during analysis.");
}
if(param1 != FOG && param1 != SHADOWS && param1 != DIRECTIONAL_LIGHT && param1 != SHADOW_MAP && param1 != SOFT_TRANSPARENCY && param1 != ANTI_ALIAS && param1 != SSAO && param1 != DEFERRED_LIGHTING) {
throw new Error("Nonexistent feature.");
}
for each(local4 in this.types) {
if(local4 == param1) {
throw new Error("Feature already exists.");
}
}
this.types.push(param1);
this.speeds.push(param2);
this.actives.push(param3);
}
public function get activated() : Boolean {
return this.camera != null;
}
public function clearSharedObject() : void {
storage.clear();
}
public function start(param1:Stage, param2:Camera3D, param3:Number, param4:Number, param5:Number, param6:Number, param7:uint, param8:String, param9:Boolean = false) : void {
var local10:int = 0;
if(this.camera != null) {
throw new Error("Analysis already started.");
}
var local11:int = int(this.types.length);
this.stage = param1;
this.camera = param2;
this.fpsThreshold = param3;
this.ratioThreshold = param4;
this.testTime = param6;
this.maxAttempts = param7;
this.key = param8;
this.traceLog = param9;
this.mask = 0;
local10 = 0;
while(local10 < local11) {
this.key += "_5_" + this.types[local10];
if(this.actives[local10]) {
this.mask |= 1 << local10;
}
local10++;
}
if(storage.data[this.key] != undefined) {
this.mask = storage.data[this.key];
} else {
this.save();
}
this.features = new Vector.<Feature>();
this.featuresCount = 0;
local10 = 0;
while(local10 < local11) {
if((this.mask & 1 << local10) > 0) {
this.features[this.featuresCount] = new Feature(this.types[local10],this.speeds[local10]);
++this.featuresCount;
}
local10++;
}
this.index = this.featuresCount - 1;
local10 = 0;
while(local10 < local11) {
if((this.mask & 1 << local10) == 0) {
this.features[this.featuresCount] = new Feature(this.types[local10],this.speeds[local10]);
++this.featuresCount;
this.disableFeature(this.types[local10]);
}
local10++;
}
this.afterIdle = false;
if(param5 > 0) {
this.idleId = setTimeout(this.onIdle,param5 * 1000);
} else {
this.onIdle();
}
this.traceFeatures("\nStart",true);
}
public function stop() : void {
if(this.camera == null) {
return;
}
this.stage.removeEventListener(Event.ENTER_FRAME,this.onEnterFrame);
clearInterval(this.id);
clearInterval(this.idleId);
var local1:int = int(this.types.length);
var local2:int = 0;
while(local2 < local1) {
this.restoreFeature(this.types[local2]);
local2++;
}
this.stage = null;
this.camera = null;
}
public function get block() : Boolean {
return this._block;
}
public function set block(param1:Boolean) : void {
if(this._block != param1) {
this._block = param1;
this.traceFeatures("\nBlock " + this._block,false);
if(this.camera != null && this.afterIdle) {
if(this._block) {
this.stage.removeEventListener(Event.ENTER_FRAME,this.onEnterFrame);
clearInterval(this.id);
if(this.index < this.featuresCount - 1) {
this.disableFeature(Feature(this.features[this.index + 1]).type);
}
} else {
this.stage.addEventListener(Event.ENTER_FRAME,this.onEnterFrame);
this.timer = getTimer();
if(this.state == 0) {
this.testCurrent();
}
}
}
}
}
private function onIdle() : void {
this.state = 0;
this.afterIdle = true;
if(!this._block) {
this.stage.addEventListener(Event.ENTER_FRAME,this.onEnterFrame);
this.timer = getTimer();
this.testCurrent();
}
}
private function onEnterFrame(param1:Event) : void {
var local4:Number = NaN;
var local2:int = getTimer();
var local3:Number = (local2 - this.timer) / 1000;
this.timer = local2;
if(this.state == 1) {
local4 = this.changeStrength(Feature(this.features[this.index]).type,local3 * this.speeds[this.index]);
if(local4 >= 1) {
if(this.index + 1 < this.featuresCount) {
this.testNext();
} else {
this.testCurrent();
}
}
} else if(this.state == -1) {
local4 = this.changeStrength(Feature(this.features[this.index]).type,-local3 * this.speeds[this.index]);
if(local4 <= 0) {
this.mask &= ~(1 << this.types.indexOf(Feature(this.features[this.index]).type));
this.save();
--this.index;
this.swap();
this.traceFeatures(null,true);
this.testCurrent();
}
} else {
++this.frameCounter;
if(1 / local3 < this.fpsThreshold) {
++this.lowCounter;
}
}
}
private function testNext() : void {
this.state = 0;
this.frameCounter = 0;
this.lowCounter = 0;
this.testFeature(Feature(this.features[this.index + 1]).type);
this.id = setTimeout(this.onTestNext,this.testTime * 1000);
this.traceFeatures("\nTest Next " + String(this.index + 1) + " " + this.features[this.index + 1].type,false);
}
private function onTestNext() : void {
if(this.lowCounter / this.frameCounter < this.ratioThreshold) {
++this.index;
this.mask |= 1 << this.types.indexOf(Feature(this.features[this.index]).type);
this.save();
Feature(this.features[this.index]).attempts = 0;
this.state = 1;
this.traceFeatures("SUCCESS",true);
} else {
this.swap();
this.traceFeatures("FAIL",true);
if(this.index + 1 < this.featuresCount) {
this.testNext();
} else {
this.testCurrent();
}
}
}
private function testCurrent() : void {
this.state = 0;
this.frameCounter = 0;
this.lowCounter = 0;
this.id = setTimeout(this.onTestCurrent,this.testTime * 1000);
this.traceFeatures("\nTest Current " + this.index + " " + (this.index >= 0 ? this.features[this.index].type : "none"),false);
}
private function onTestCurrent() : void {
if(this.lowCounter / this.frameCounter < this.ratioThreshold) {
this.traceFeatures("SUCCESS",true);
if(this.index + 1 < this.featuresCount) {
this.testNext();
} else {
this.testCurrent();
}
} else if(this.index >= 0) {
this.traceFeatures("FAIL",false);
this.state = -1;
} else {
this.traceFeatures("FAIL",true);
this.testCurrent();
}
}
private function swap() : void {
var local1:Feature = Feature(this.features[this.index + 1]);
this.disableFeature(local1.type);
++local1.attempts;
var local2:int = this.index + 1;
while(local2 < this.featuresCount - 1) {
this.features[local2] = this.features[local2 + 1];
local2++;
}
if(local1.attempts < this.maxAttempts) {
this.features[this.featuresCount - 1] = local1;
} else {
--this.featuresCount;
this.features.length = this.featuresCount;
}
}
private function save() : void {
storage.data[this.key] = this.mask;
}
private function traceFeatures(param1:String = null, param2:Boolean = false) : void {
var local3:int = 0;
var local4:String = null;
if(this.traceLog) {
if(param1 != null) {
}
if(param2) {
local3 = 0;
while(local3 <= this.index) {
local3++;
}
local3 = this.index + 1;
while(local3 < this.featuresCount) {
local3++;
}
local4 = " ";
local3 = 0;
while(local3 < this.types.length) {
local4 += this.types[local3] + ((this.mask & 1 << local3) > 0 ? "+ " : "- ");
local3++;
}
}
}
}
private function disableFeature(param1:String) : void {
switch(param1) {
case FOG:
this.camera.fogStrength = 0;
break;
case DIRECTIONAL_LIGHT:
this.camera.directionalLightStrength = 0;
break;
case SHADOW_MAP:
this.camera.shadowMapStrength = 0;
break;
case SOFT_TRANSPARENCY:
this.camera.softTransparencyStrength = 0;
break;
case SHADOWS:
this.camera.shadowsStrength = 0;
break;
case ANTI_ALIAS:
this.camera.view.antiAliasEnabled = false;
break;
case SSAO:
this.camera.ssaoStrength = 0;
break;
case DEFERRED_LIGHTING:
this.camera.deferredLightingStrength = 0;
}
}
private function restoreFeature(param1:String) : void {
switch(param1) {
case FOG:
this.camera.fogStrength = 1;
break;
case DIRECTIONAL_LIGHT:
this.camera.directionalLightStrength = 1;
break;
case SHADOW_MAP:
this.camera.shadowMapStrength = 1;
break;
case SOFT_TRANSPARENCY:
this.camera.softTransparencyStrength = 1;
break;
case SHADOWS:
this.camera.shadowsStrength = 1;
this.camera.shadowsDistanceMultiplier = 1;
break;
case ANTI_ALIAS:
this.camera.view.antiAliasEnabled = true;
break;
case SSAO:
this.camera.ssaoStrength = 1;
break;
case DEFERRED_LIGHTING:
this.camera.deferredLightingStrength = 1;
}
}
private function testFeature(param1:String) : void {
switch(param1) {
case FOG:
this.camera.fogStrength = 0.01;
break;
case DIRECTIONAL_LIGHT:
this.camera.directionalLightStrength = 0.01;
break;
case SHADOW_MAP:
this.camera.shadowMapStrength = 0.01;
break;
case SOFT_TRANSPARENCY:
this.camera.softTransparencyStrength = 0.01;
break;
case SHADOWS:
this.camera.shadowsStrength = 0.01;
break;
case ANTI_ALIAS:
this.camera.view.antiAliasEnabled = true;
break;
case SSAO:
this.camera.ssaoStrength = 0.01;
break;
case DEFERRED_LIGHTING:
this.camera.deferredLightingStrength = 0.01;
}
}
private function changeStrength(param1:String, param2:Number) : Number {
var local3:Number = 0;
switch(param1) {
case FOG:
this.camera.fogStrength += param2;
if(this.camera.fogStrength > 1) {
this.camera.fogStrength = 1;
}
if(this.camera.fogStrength < 0) {
this.camera.fogStrength = 0;
}
local3 = this.camera.fogStrength;
break;
case DIRECTIONAL_LIGHT:
this.camera.directionalLightStrength += param2;
if(this.camera.directionalLightStrength > 1) {
this.camera.directionalLightStrength = 1;
}
if(this.camera.directionalLightStrength < 0) {
this.camera.directionalLightStrength = 0;
}
local3 = this.camera.directionalLightStrength;
break;
case SHADOW_MAP:
this.camera.shadowMapStrength += param2;
if(this.camera.shadowMapStrength > 1) {
this.camera.shadowMapStrength = 1;
}
if(this.camera.shadowMapStrength < 0) {
this.camera.shadowMapStrength = 0;
}
local3 = this.camera.shadowMapStrength;
break;
case SOFT_TRANSPARENCY:
this.camera.softTransparencyStrength += param2;
if(this.camera.softTransparencyStrength > 1) {
this.camera.softTransparencyStrength = 1;
}
if(this.camera.softTransparencyStrength < 0) {
this.camera.softTransparencyStrength = 0;
}
local3 = this.camera.softTransparencyStrength;
break;
case SHADOWS:
this.camera.shadowsStrength += param2;
if(this.camera.shadowsStrength > 1) {
this.camera.shadowsStrength = 1;
}
if(this.camera.shadowsStrength < 0) {
this.camera.shadowsStrength = 0;
}
local3 = this.camera.shadowsStrength;
break;
case ANTI_ALIAS:
this.camera.view.antiAliasEnabled = param2 > 0;
local3 = this.camera.view.antiAliasEnabled ? 1 : 0;
break;
case SSAO:
this.camera.ssaoStrength += param2;
if(this.camera.ssaoStrength > 1) {
this.camera.ssaoStrength = 1;
}
if(this.camera.ssaoStrength < 0) {
this.camera.ssaoStrength = 0;
}
local3 = this.camera.ssaoStrength;
break;
case DEFERRED_LIGHTING:
this.camera.deferredLightingStrength += param2;
if(this.camera.deferredLightingStrength > 1) {
this.camera.deferredLightingStrength = 1;
}
if(this.camera.deferredLightingStrength < 0) {
this.camera.deferredLightingStrength = 0;
}
local3 = this.camera.deferredLightingStrength;
}
return local3;
}
}
}
class Feature {
public var type:String;
public var speed:Number;
public var attempts:int = 0;
public function Feature(param1:String, param2:Number) {
super();
this.type = param1;
this.speed = param2;
}
}
|
package alternativa.tanks.gui.panel.buttons {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.panel.buttons.ShopBarButton_shopCrystals.png")]
public class ShopBarButton_shopCrystals extends BitmapAsset {
public function ShopBarButton_shopCrystals() {
super();
}
}
}
|
package alternativa.tanks.sfx {
public class Blinker {
private var initialInterval:int;
private var minInterval:int;
private var intervalDecrement:int;
private var maxValue:Number;
private var minValue:Number;
private var speedCoeff:Number;
private var value:Number;
private var _speed:Number;
private var valueDelta:Number;
private var switchTime:int;
private var currInterval:int;
public function Blinker(param1:int, param2:int, param3:int, param4:Number, param5:Number, param6:Number) {
super();
this.initialInterval = param1;
this.minInterval = param2;
this.intervalDecrement = param3;
this.minValue = param4;
this.maxValue = param5;
this.speedCoeff = param6;
this.valueDelta = param5 - param4;
}
public function setInitialInterval(param1:int) : void {
this.initialInterval = param1;
}
public function init(param1:int) : void {
this.value = this.maxValue;
this.currInterval = this.initialInterval;
this._speed = this.getSpeed(-1);
this.switchTime = param1 + this.currInterval;
}
public function setMaxValue(param1:Number) : void {
if(param1 >= this.minValue) {
this.maxValue = param1;
this.valueDelta = this.maxValue - this.minValue;
}
}
public function setMinValue(param1:Number) : void {
if(param1 <= this.maxValue) {
this.minValue = param1;
this.valueDelta = this.maxValue - this.minValue;
}
}
public function getMinValue() : Number {
return this.minValue;
}
public function updateValue(param1:int, param2:int) : Number {
this.value += this._speed * param2;
if(this.value > this.maxValue) {
this.value = this.maxValue;
}
if(this.value < this.minValue) {
this.value = this.minValue;
}
if(param1 >= this.switchTime) {
if(this.currInterval > this.minInterval) {
this.currInterval -= this.intervalDecrement;
if(this.currInterval < this.minInterval) {
this.currInterval = this.minInterval;
}
}
this.switchTime = param1 + this.currInterval;
if(this._speed < 0) {
this._speed = this.getSpeed(1);
} else {
this._speed = this.getSpeed(-1);
}
}
return this.value;
}
private function getSpeed(param1:Number) : Number {
return param1 * this.speedCoeff * this.valueDelta / this.currInterval;
}
}
}
|
package alternativa.tanks.models.weapon.rocketlauncher.sfx {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class RocketLauncherSfxAdapt implements RocketLauncherSfx {
private var object:IGameObject;
private var impl:RocketLauncherSfx;
public function RocketLauncherSfxAdapt(param1:IGameObject, param2:RocketLauncherSfx) {
super();
this.object = param1;
this.impl = param2;
}
public function getSfxData() : RocketLauncherSfxData {
var result:RocketLauncherSfxData = null;
try {
Model.object = this.object;
result = this.impl.getSfxData();
}
finally {
Model.popObject();
}
return result;
}
}
}
|
package alternativa.tanks.gui
{
import alternativa.init.Main;
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.model.panel.IPanel;
import assets.scroller.color.ScrollThumbSkinGreen;
import assets.scroller.color.ScrollTrackGreen;
import controls.DefaultButton;
import controls.Label;
import controls.PaymentButton;
import controls.TankCombo;
import controls.TankWindow;
import controls.TankWindowInner;
import fl.containers.ScrollPane;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.DisplayObjectContainer;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Point;
import flash.net.SharedObject;
import projects.tanks.client.panel.model.payment.SMSNumber;
public class PaymentWindow extends Sprite
{
[Embed(source="1031.png")]
private static const bitmapCrystalsPic:Class;
private static const crystalsBd:BitmapData = new bitmapCrystalsPic().bitmapData;
[Embed(source="831.png")]
private static const bitmapError:Class;
private static const errorBd:BitmapData = new bitmapError().bitmapData;
public static const SYSTEM_TYPE_SMS:String = "sms";
public static const SYSTEM_TYPE_QIWI:String = "mk";
public static const SYSTEM_TYPE_YANDEX:String = "yandex";
public static const SYSTEM_TYPE_VISA:String = "bank_card";
public static const SYSTEM_TYPE_WEBMONEY:String = "wm";
public static const SYSTEM_TYPE_EASYPAY:String = "easypay";
public static const SYSTEM_TYPE_PAYPAL:String = "paypal";
public static const SYSTEM_TYPE_TERMINAL:String = "terminal";
public static var SYSTEM_TYPE_PREPAID:String = "prepaid";
public static const SYSTEM_TYPE_WALLIE:String = "wallie";
public static const SYSTEM_TYPE_PAYSAFE:String = "paysafecard";
public static const SYSTEM_TYPE_RIXTY:String = "rixty";
public static const SYSTEM_TYPE_CASHU:String = "cashu";
public static const SYSTEM_TYPE_CHRONOPAY:String = "chronopay";
public static const SYSTEM_TYPE_LIQPAY:String = "liqpay";
public static const SYSTEM_TYPE_ALIPAY:String = "alipay";
private var localeService:ILocaleService;
private var storage:SharedObject;
private var panelModel:IPanel;
private var dialogsLayer:DisplayObjectContainer;
private var window:TankWindow;
private var windowSize:Point;
private const windowMargin:int = 11;
private const spaceModule:int = 7;
private const buttonSize:Point = new Point(155,50);
private var numbers:Array;
private var systemTypesNum:int;
private var systemTypeButtonsSmall:Array;
private var systemTypeButtons:Array;
private var systemTypeButtonNames:Array;
private var systemTypeButtonsInner:TankWindowInner;
private var systemTypeButtonsSpace:int = 2;
private var bigButtonsContainer:Sprite;
private var smallButtonsContainer:Sprite;
private var systemTypeTitle:Label;
private var systemTypeDescriptions:Array;
private var systemTypeDescription:Label;
private var systemTypeDescriptionInner:TankWindowInner;
private var systemTypeDescriptionInnerWidth:int = 200;
private var errorInner:TankWindowInner;
private var errorButton:DefaultButton;
private var errorIcon:Bitmap;
private var errorLabel:Label;
private var colomn2x:int;
private var colomn3x:int;
private var tabContainers:Array;
private var currentTabIndex:int = 0;
private var exchangeGroup:ExchangeGroup;
private var rates:Array;
private var crystals:int;
private var WMCombo:TankCombo;
private var proceedButton:DefaultButton;
private var crystalsPic:Bitmap;
private var header:Label;
private var headerInner:TankWindowInner;
private var scrollPane:ScrollPane;
private var scrollContainer:Sprite;
private var smsBlock:SMSblock;
public var terminalCountriesCombo:TankCombo;
private var wallieButton:PaymentButton;
private var paysafeButton:PaymentButton;
private var rixtyButton:PaymentButton;
private var cashuButton:PaymentButton;
private var chronopayButton:PaymentButton;
private var liqpayButton:PaymentButton;
private var chronopaySelected:Boolean;
private var prepayCardSelectedIndex:int;
private var INDEX_SMS:int;
private var INDEX_QIWI:int;
private var INDEX_YANDEX:int;
private var INDEX_VISA:int;
private var INDEX_WEBMONEY:int;
private var INDEX_EASYPAY:int;
private var INDEX_WEBCREDS:int;
private var INDEX_PAYPAL:int;
private var INDEX_TERMINAL:int;
private var INDEX_PREPAID:int;
private var INDEX_WALLIE:int;
private var INDEX_PAYSAFE:int;
private var INDEX_RIXTY:int;
private var INDEX_CASHU:int;
private var INDEX_ALIPAY:int;
private var buttonTypes:Array;
private var bugReportWindow:PaymentBugReportWindow;
private var visaRateValue:Number;
private var visaCurrency:String;
private var prepaidRate:Number = 0;
public function PaymentWindow()
{
super();
throw new Error("");
}
private function confScroll() : void
{
this.scrollPane.setStyle("downArrowUpSkin",ScrollArrowDownGreen);
this.scrollPane.setStyle("downArrowDownSkin",ScrollArrowDownGreen);
this.scrollPane.setStyle("downArrowOverSkin",ScrollArrowDownGreen);
this.scrollPane.setStyle("downArrowDisabledSkin",ScrollArrowDownGreen);
this.scrollPane.setStyle("upArrowUpSkin",ScrollArrowUpGreen);
this.scrollPane.setStyle("upArrowDownSkin",ScrollArrowUpGreen);
this.scrollPane.setStyle("upArrowOverSkin",ScrollArrowUpGreen);
this.scrollPane.setStyle("upArrowDisabledSkin",ScrollArrowUpGreen);
this.scrollPane.setStyle("trackUpSkin",ScrollTrackGreen);
this.scrollPane.setStyle("trackDownSkin",ScrollTrackGreen);
this.scrollPane.setStyle("trackOverSkin",ScrollTrackGreen);
this.scrollPane.setStyle("trackDisabledSkin",ScrollTrackGreen);
this.scrollPane.setStyle("thumbUpSkin",ScrollThumbSkinGreen);
this.scrollPane.setStyle("thumbDownSkin",ScrollThumbSkinGreen);
this.scrollPane.setStyle("thumbOverSkin",ScrollThumbSkinGreen);
this.scrollPane.setStyle("thumbDisabledSkin",ScrollThumbSkinGreen);
}
public function resize(width:int, height:int) : void
{
var b:PaymentButton = null;
var smallButton:DefaultButton = null;
Main.writeVarsToConsoleChannel("PAYMENT WINDOW","resize");
this.scrollPane.update();
this.windowSize.x = width;
this.windowSize.y = height;
this.window.width = width;
this.window.height = height;
if(this.localeService.language != "cn")
{
this.errorInner.y = height - this.windowMargin - this.errorInner.height;
this.errorInner.width = width - this.windowMargin * 2 - this.errorInner.x;
this.errorIcon.y = this.errorInner.y + int((this.errorInner.height - this.errorIcon.height) * 0.5);
this.errorLabel.y = this.errorInner.y + int((this.errorInner.height - this.errorLabel.height) * 0.5);
this.errorButton.y = this.errorInner.y + this.spaceModule;
this.errorButton.x = width - 125;
this.errorLabel.width = this.errorButton.x - this.errorLabel.x - this.windowMargin;
}
this.headerInner.width = width - this.windowMargin * 2;
this.headerInner.height = this.crystalsPic.height;
this.header.width = width - this.header.x - this.windowMargin * 2;
this.crystalsPic.y = this.headerInner.y;
this.header.y = this.crystalsPic.y + Math.round((this.crystalsPic.height - this.header.textHeight) * 0.5);
var row2y:int = this.headerInner.y + this.headerInner.height + this.spaceModule - 2;
this.systemTypeButtonsInner.y = row2y;
this.systemTypeButtonsInner.height = height - row2y - this.windowMargin;
this.bigButtonsContainer.y = row2y + this.spaceModule + 1;
this.smallButtonsContainer.y = this.bigButtonsContainer.y;
for(var i:int = 0; i < this.systemTypesNum; i++)
{
b = this.systemTypeButtons[i];
b.y = i * (b.height + this.systemTypeButtonsSpace);
smallButton = this.systemTypeButtonsSmall[i];
smallButton.y = i * (smallButton.height + this.systemTypeButtonsSpace);
}
if(height - (this.bigButtonsContainer.y + this.systemTypesNum * (this.systemTypeButtons[0] as PaymentButton).height + (this.systemTypesNum - 1) * this.systemTypeButtonsSpace + this.spaceModule + 1 + this.windowMargin) >= 0)
{
this.bigButtonsContainer.visible = true;
this.smallButtonsContainer.visible = false;
}
else
{
this.bigButtonsContainer.visible = false;
this.smallButtonsContainer.visible = true;
}
this.systemTypeTitle.y = this.systemTypeButtonsInner.y - 5;
this.systemTypeDescriptionInner.y = row2y + this.spaceModule * 3;
this.systemTypeDescriptionInner.width = width - this.windowMargin * 2 - this.systemTypeDescriptionInner.x;
var descriptionHeight:int = int((height - this.systemTypeDescriptionInner.y - this.windowMargin * 2) * 0.4) - (this.localeService.language != "cn" ? this.errorInner.height : 0) - this.windowMargin;
this.systemTypeDescriptionInner.height = descriptionHeight;
this.systemTypeDescription.width = this.systemTypeDescriptionInner.width - this.spaceModule * 3;
this.colomn3x = int(this.systemTypeDescriptionInner.width * 0.25);
var colomn3width:int = int(this.systemTypeDescriptionInner.width * 0.5);
this.scrollPane.x = this.systemTypeDescriptionInner.x;
this.scrollPane.y = this.systemTypeDescriptionInner.y + this.spaceModule;
this.scrollPane.setSize(this.systemTypeDescriptionInner.width,descriptionHeight - this.spaceModule * 2);
this.scrollPane.update();
this.tabContainers[this.currentTabIndex].x = this.colomn2x + this.windowMargin;
this.tabContainers[this.currentTabIndex].y = this.systemTypeDescriptionInner.y + descriptionHeight + this.spaceModule;
if(this.currentTabIndex == this.INDEX_SMS && this.localeService.language != "cn")
{
this.smsBlock.resize(this.systemTypeDescriptionInner.width,height - this.tabContainers[this.currentTabIndex].y - this.windowMargin * 2 - this.errorInner.height);
}
else
{
if(this.currentTabIndex == this.INDEX_WEBMONEY && this.localeService.language != "cn")
{
this.WMCombo.x = this.colomn3x;
this.WMCombo.width = colomn3width;
this.exchangeGroup.y = this.spaceModule * 5;
}
else if(this.currentTabIndex == this.INDEX_TERMINAL && this.localeService.language != "cn")
{
this.terminalCountriesCombo.x = this.colomn3x + 4;
this.terminalCountriesCombo.width = colomn3width - 8;
this.exchangeGroup.y = this.spaceModule * 5;
}
else
{
this.exchangeGroup.y = 0;
}
this.exchangeGroup.x = this.currentTabIndex == this.INDEX_VISA || this.currentTabIndex == this.INDEX_PREPAID ? Number(Number(this.chronopayButton.width + this.spaceModule)) : Number(Number(this.colomn3x));
this.exchangeGroup.resize(colomn3width);
this.proceedButton.x = this.currentTabIndex == this.INDEX_VISA || this.currentTabIndex == this.INDEX_PREPAID ? Number(Number(this.chronopayButton.width + this.spaceModule + 4)) : Number(Number(this.colomn3x + 4));
this.proceedButton.y = !this.exchangeGroup.visible ? Number(Number(this.spaceModule * 5 + 3)) : Number(Number(this.exchangeGroup.y + this.exchangeGroup.height + this.spaceModule));
this.proceedButton.width = colomn3width - 8;
}
}
public function setInitData(countries:Array, rates:Array, accountId:String, projectId:int, formId:String) : void
{
}
public function setOperators(operators:Array) : void
{
}
public function setNumbers(numbers:Array) : void
{
}
private function sortNumbersByCost(n1:SMSNumber, n2:SMSNumber) : int
{
return 0;
}
public function get selectedCountry() : String
{
return this.smsBlock.countriesCombo.selectedItem["id"] as String;
}
public function get selectedOperator() : int
{
return int(this.smsBlock.operatorsCombo.selectedItem["id"] as int);
}
private function lockProceedButtons() : void
{
this.proceedButton.enable = false;
}
private function unlockProceedButtons() : void
{
this.proceedButton.enable = true;
}
private function onSystemSelect(e:MouseEvent) : void
{
var index:int = 0;
Main.writeVarsToConsoleChannel("PAYMENT","onSystemSelect");
if(this.bigButtonsContainer.visible)
{
Main.writeVarsToConsoleChannel("PAYMENT"," type: %1",(e.currentTarget as PaymentButton).type);
index = this.systemTypeButtons.indexOf(e.currentTarget);
}
else
{
index = this.systemTypeButtonsSmall.indexOf(e.currentTarget);
}
this.setSystemIndex(index);
}
private function setSystemIndex(index:int) : void
{
Main.writeVarsToConsoleChannel("PAYMENT","setSystemIndex: %1",index);
(this.tabContainers[this.currentTabIndex] as Sprite).visible = false;
var button:PaymentButton = this.systemTypeButtons[this.currentTabIndex];
button.enable = true;
var smallButton:DefaultButton = this.systemTypeButtonsSmall[this.currentTabIndex];
smallButton.enable = true;
button = this.systemTypeButtons[index];
button.enable = false;
smallButton = this.systemTypeButtonsSmall[index];
smallButton.enable = false;
this.currentTabIndex = index;
(this.tabContainers[this.currentTabIndex] as Sprite).visible = true;
this.systemTypeTitle.text = this.systemTypeButtonNames[index] as String;
var helpURL:String = this.localeService.language == "ru" ? "<font color=\'#00ff0b\'><u><a href=\'http://forum.tankionline.com/posts/list/12852.page\' target=\'_blank\'>Инструкция по покупке кристаллов</a></u></font>" : (this.localeService.language == "en" ? "<font color=\'#00ff0b\'><u><a href=\'http://forum.tankionline.com/posts/list/1171.page#101800\' target=\'_blank\'>Crystal purchase instruction</a></u></font>" : "<font color=\'#00ff0b\'><u><a href=\'http://forum.3dtank.com/posts/list/7.page\' target=\'_blank\'>水晶购买指南</a></u></font>");
this.systemTypeDescription.htmlText = (this.systemTypeDescriptions[index] as String) + "\n\n" + helpURL;
this.scrollPane.update();
if(this.currentTabIndex != this.INDEX_SMS)
{
if(this.exchangeGroup.inputValue != 0)
{
this.onExchangeChange();
}
this.WMCombo.visible = this.currentTabIndex == this.INDEX_WEBMONEY;
this.terminalCountriesCombo.visible = this.currentTabIndex == this.INDEX_TERMINAL;
this.exchangeGroup.visible = !(this.currentTabIndex == this.INDEX_YANDEX || this.currentTabIndex == this.INDEX_WEBMONEY || this.currentTabIndex == this.INDEX_TERMINAL);
if(this.currentTabIndex == this.INDEX_YANDEX || this.currentTabIndex == this.INDEX_WEBMONEY)
{
this.proceedButton.enable = true;
}
else
{
this.proceedButton.enable = this.currentTabIndex == this.INDEX_TERMINAL && this.terminalCountriesCombo.selectedItem != null || this.currentTabIndex != this.INDEX_TERMINAL && this.exchangeGroup.inputValue != 0;
}
}
this.chronopayButton.visible = this.liqpayButton.visible = this.currentTabIndex == this.INDEX_VISA;
this.wallieButton.visible = this.paysafeButton.visible = this.rixtyButton.visible = this.currentTabIndex == this.INDEX_PREPAID;
this.cashuButton.visible = this.currentTabIndex == this.INDEX_PREPAID && SYSTEM_TYPE_PREPAID == "prepaiden";
this.resize(this.windowSize.x,this.windowSize.y);
this.storage.data.paymentSystemType = this.buttonTypes[this.currentTabIndex];
}
private function onCountrySelect(e:Event) : void
{
if(this.smsBlock.countriesCombo.selectedItem != null && this.smsBlock.countriesCombo.selectedItem != "")
{
this.storage.data.userCountryName = this.smsBlock.countriesCombo.selectedItem["gameName"];
dispatchEvent(new PaymentWindowEvent(PaymentWindowEvent.SELECT_COUNTRY));
}
}
private function onOperatorSelect(e:Event) : void
{
if(this.smsBlock.operatorsCombo.selectedItem != null && this.smsBlock.operatorsCombo.selectedItem != "")
{
this.storage.data.userOperatorName = this.smsBlock.operatorsCombo.selectedItem["gameName"];
dispatchEvent(new PaymentWindowEvent(PaymentWindowEvent.SELECT_OPERATOR));
}
}
private function onProceedButtonClick(e:MouseEvent) : void
{
}
private function onWMComboSelect(e:Event) : void
{
this.storage.data.paymentWMType = this.WMCombo.selectedItem["gameName"];
this.onExchangeChange();
}
private function onChronopaySelected(e:MouseEvent) : void
{
}
private function onLiqpaySelected(e:MouseEvent) : void
{
}
private function onPrepaidButtonSelected(e:MouseEvent = null) : void
{
}
private function onExchangeChange(e:Event = null) : void
{
}
private function onErrorButtonClick(e:MouseEvent) : void
{
}
private function alignReportWindow(e:Event = null) : void
{
this.bugReportWindow.x = Math.round((Main.stage.stageWidth - this.bugReportWindow.width) * 0.5);
this.bugReportWindow.y = Math.round((Main.stage.stageHeight - this.bugReportWindow.height) * 0.5);
}
}
}
|
package alternativa.tanks.view.battleinfo {
import alternativa.osgi.service.locale.ILocaleService;
import projects.tanks.clients.fp10.libraries.TanksLocale;
public class LocaleBattleInfo {
[Inject]
public static var localeService:ILocaleService;
public function LocaleBattleInfo() {
super();
}
public static function get fightButtonLabel() : String {
return localeService.getText(TanksLocale.TEXT_BATTLEINFO_PANEL_BUTTON_PLAY);
}
public static function get noNameText() : String {
return localeService.getText(TanksLocale.TEXT_BATTLEINFO_PANEL_NONAME_TEXT);
}
public static function get proBattleAlertLabel() : String {
return localeService.getText(TanksLocale.TEXT_BATTLE_PRO_BATTLE_SUBSCRIBE);
}
public static function get returnToBattleButtonLabel() : String {
return localeService.getText(TanksLocale.TEXT_REARM_BATTLE_RETURN);
}
public static function get exitFromBattleButtonLabel() : String {
return localeService.getText(TanksLocale.TEXT_REARM_BATTLE_EXIT);
}
public static function get buyAbonementButtonLabel() : String {
return localeService.getText(TanksLocale.TEXT_BUY_PRO_ABONEMENT);
}
}
}
|
package _codec.projects.tanks.client.tanksservices.model.reconnect {
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.tanksservices.model.reconnect.ReconnectCC;
public class CodecReconnectCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_configUrlTemplate:ICodec;
private var codec_serverNumber:ICodec;
public function CodecReconnectCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_configUrlTemplate = param1.getCodec(new TypeCodecInfo(String,false));
this.codec_serverNumber = param1.getCodec(new TypeCodecInfo(int,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:ReconnectCC = new ReconnectCC();
local2.configUrlTemplate = this.codec_configUrlTemplate.decode(param1) as String;
local2.serverNumber = this.codec_serverNumber.decode(param1) as int;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:ReconnectCC = ReconnectCC(param2);
this.codec_configUrlTemplate.encode(param1,local3.configUrlTemplate);
this.codec_serverNumber.encode(param1,local3.serverNumber);
}
}
}
|
package com.lorentz.SVG.drawing
{
import com.lorentz.SVG.data.MarkerPlace;
import com.lorentz.SVG.data.MarkerType;
import com.lorentz.SVG.utils.ArcUtils;
import com.lorentz.SVG.utils.MathUtils;
import flash.geom.Point;
public class MarkersPlacesCapturerDrawer implements IDrawer
{
private var _baseDrawer:IDrawer;
private var _markersInfo:Vector.<MarkerPlace> = new Vector.<MarkerPlace>();
private var _firstCommand:Boolean = true;
public function getMarkersInfo():Vector.<MarkerPlace>
{
setLastMarkAsEndMark();
return _markersInfo;
}
public function MarkersPlacesCapturerDrawer(baseDrawer:IDrawer)
{
_baseDrawer = baseDrawer;
}
public function arcTo(rx:Number, ry:Number, angle:Number, largeArcFlag:Boolean, sweepFlag:Boolean, x:Number, y:Number):void
{
var startAngle:Number = getArcStartAngle(rx, ry, angle, largeArcFlag, sweepFlag, x, y, penX, penY);
var endAngle:Number = getArcEndAngle(rx, ry, angle, largeArcFlag, sweepFlag, x, y, penX, penY);
if(_firstCommand){
_firstCommand = false;
_markersInfo.push(new MarkerPlace(new Point(penX, penY), startAngle, MarkerType.START));
} else {
_markersInfo[_markersInfo.length-1].averageAngle(startAngle);
}
_markersInfo.push(new MarkerPlace(new Point(x, y), endAngle, MarkerType.MID));
_baseDrawer.arcTo(rx, ry, angle, largeArcFlag, sweepFlag, x, y);
}
public function cubicCurveTo(cx1:Number, cy1:Number, cx2:Number, cy2:Number, x:Number, y:Number):void
{
var startAngle:Number = getCubicCurveStartAngle(penX, penY, cx1, cy1, cx2, cy2, x, y);
var endAngle:Number = getCubicCurveEndAngle(penX, penY, cx1, cy1, cx2, cy2, x, y);
if(_firstCommand){
_firstCommand = false;
_markersInfo.push(new MarkerPlace(new Point(penX, penY), startAngle, MarkerType.START));
} else {
_markersInfo[_markersInfo.length-1].averageAngle(startAngle);
}
_markersInfo.push(new MarkerPlace(new Point(x, y), endAngle, MarkerType.MID));
_baseDrawer.cubicCurveTo(cx1, cy1, cx2, cy2, x, y);
}
public function curveTo(cx:Number, cy:Number, x:Number, y:Number):void
{
var startAngle:Number = getQuadCurveStartAngle(penX, penY, cx, cy, x, y);
var endAngle:Number = getQuadCurveEndAngle(penX, penY, cx, cy, x, y);
if(_firstCommand){
_firstCommand = false;
_markersInfo.push(new MarkerPlace(new Point(penX, penY), startAngle, MarkerType.START));
} else {
_markersInfo[_markersInfo.length-1].averageAngle(startAngle);
}
_markersInfo.push(new MarkerPlace(new Point(x, y), endAngle, MarkerType.MID));
_baseDrawer.curveTo(cx, cy, x, y);
}
public function lineTo(x:Number, y:Number):void
{
var angle:Number = getLineAngle(penX, penY, x, y);
if(_firstCommand){
_firstCommand = false;
_markersInfo.push(new MarkerPlace(new Point(penX, penY), angle, MarkerType.START));
} else {
_markersInfo[_markersInfo.length-1].averageAngle(angle);
}
_markersInfo.push(new MarkerPlace(new Point(x, y), angle, MarkerType.MID));
_baseDrawer.lineTo(x, y);
}
public function moveTo(x:Number, y:Number):void
{
setLastMarkAsEndMark();
_firstCommand = true;
_baseDrawer.moveTo(x, y);
}
public function get penX():Number
{
return _baseDrawer.penX;
}
public function get penY():Number
{
return _baseDrawer.penY;
}
private function getArcStartAngle(rx:Number, ry:Number, angle:Number, largeArcFlag:Boolean, sweepFlag:Boolean, x:Number, y:Number, sx:Number, sy:Number):Number {
var ellipticalArc:Object = ArcUtils.computeSvgArc(rx, ry, angle, largeArcFlag, sweepFlag, x, y, sx, sy);
var curves:Array = ArcUtils.convertToCurves(ellipticalArc.cx, ellipticalArc.cy, ellipticalArc.startAngle, ellipticalArc.arc, ellipticalArc.radius, ellipticalArc.yRadius, ellipticalArc.xAxisRotation);
var firstQuadCurve:Object = curves[0];
return getQuadCurveStartAngle(firstQuadCurve.s.x, firstQuadCurve.s.y, firstQuadCurve.c.x, firstQuadCurve.c.y, firstQuadCurve.p.x, firstQuadCurve.p.y);
}
private function getArcEndAngle(rx:Number, ry:Number, angle:Number, largeArcFlag:Boolean, sweepFlag:Boolean, x:Number, y:Number, sx:Number, sy:Number):Number {
var ellipticalArc:Object = ArcUtils.computeSvgArc(rx, ry, angle, largeArcFlag, sweepFlag, x, y, sx, sy);
var curves:Array = ArcUtils.convertToCurves(ellipticalArc.cx, ellipticalArc.cy, ellipticalArc.startAngle, ellipticalArc.arc, ellipticalArc.radius, ellipticalArc.yRadius, ellipticalArc.xAxisRotation);
var lastQuadCurve:Object = curves[curves.length - 1];
return getQuadCurveEndAngle(lastQuadCurve.s.x, lastQuadCurve.s.y, lastQuadCurve.c.x, lastQuadCurve.c.y, lastQuadCurve.p.x, lastQuadCurve.p.y);
}
private function getCubicCurveStartAngle(sx:Number, sy:Number, cx1:Number, cy1:Number, cx2:Number, cy2:Number, x:Number, y:Number):Number
{
if(cx1 == sx && cy1 == sy)
return MathUtils.radiusToDegress(Math.atan2(cy2 - sy, cx2 - sx));
else
return MathUtils.radiusToDegress(Math.atan2(cy1 - sy, cx1 - sx));
}
private function getCubicCurveEndAngle(sx:Number, sy:Number, cx1:Number, cy1:Number, cx2:Number, cy2:Number, x:Number, y:Number):Number
{
if(cx2 == x && cy2 == y)
return MathUtils.radiusToDegress(Math.atan2(y - cy1, x - cx1));
else
return MathUtils.radiusToDegress(Math.atan2(y - cy2, x - cx2));
}
private function getQuadCurveStartAngle(sx:Number, sy:Number, cx:Number, cy:Number, x:Number, y:Number):Number {
return MathUtils.radiusToDegress(Math.atan2(cy - sy, cx - sx));
}
private function getQuadCurveEndAngle(sx:Number, sy:Number, cx:Number, cy:Number, x:Number, y:Number):Number {
return MathUtils.radiusToDegress(Math.atan2(y - cy, x - cx));
}
private function getLineAngle(sx:Number, sy:Number, x:Number, y:Number):Number{
return MathUtils.radiusToDegress(Math.atan2(y - sy, x - sx));
}
private function setLastMarkAsEndMark():void {
if(_markersInfo.length > 0)
_markersInfo[_markersInfo.length-1].type = MarkerType.END;
}
}
} |
package alternativa.init {
import alternativa.osgi.OSGi;
import alternativa.osgi.bundle.IBundleActivator;
import alternativa.osgi.service.display.IDisplay;
import alternativa.tanks.servermodels.GoogleEntranceModel;
import alternativa.tanks.servermodels.IGoogleEntranceModel;
import alternativa.tanks.service.IEntranceClientFacade;
import alternativa.tanks.service.IEntranceServerFacade;
import alternativa.tanks.service.IExternalEntranceService;
import alternativa.tanks.service.IPasswordParamsService;
import alternativa.tanks.service.IRegistrationUXService;
import alternativa.tanks.service.impl.ExternalEntranceService;
import alternativa.tanks.service.impl.PasswordParamsService;
import alternativa.tanks.service.impl.RegistrationUXService;
public class UserModelActivator implements IBundleActivator {
private static var _osgi:OSGi;
public function UserModelActivator() {
super();
}
public static function registerClientFacade(param1:IEntranceClientFacade) : void {
if(_osgi.getService(IEntranceClientFacade) != null) {
_osgi.unregisterService(IEntranceClientFacade);
}
_osgi.registerService(IEntranceClientFacade,param1);
}
public static function registerServerFacade(param1:IEntranceServerFacade) : void {
if(_osgi.getService(IEntranceServerFacade) != null) {
_osgi.unregisterService(IEntranceServerFacade);
}
_osgi.registerService(IEntranceServerFacade,param1);
}
public static function unregisterClientFacade() : void {
_osgi.unregisterService(IEntranceClientFacade);
}
public static function unregisterServerFacade() : void {
_osgi.unregisterService(IEntranceServerFacade);
}
public function start(param1:OSGi) : void {
_osgi = param1;
param1.registerService(IPasswordParamsService,new PasswordParamsService());
param1.registerService(IExternalEntranceService,new ExternalEntranceService());
param1.registerService(IRegistrationUXService,new RegistrationUXService());
param1.registerService(IGoogleEntranceModel,new GoogleEntranceModel());
new EntranceContext((param1.getService(IDisplay) as IDisplay).contentUILayer);
}
public function stop(param1:OSGi) : void {
param1.unregisterService(IPasswordParamsService);
param1.unregisterService(IExternalEntranceService);
param1.unregisterService(IRegistrationUXService);
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.sfx.shoot.ricochet {
import alternativa.osgi.OSGi;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.registry.ModelRegistry;
public class RicochetSFXModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:RicochetSFXModelServer;
private var client:IRicochetSFXModelBase = IRicochetSFXModelBase(this);
private var modelId:Long = Long.getLong(1224006945,1002444060);
public function RicochetSFXModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new RicochetSFXModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(RicochetSFXCC,false)));
}
protected function getInitParam() : RicochetSFXCC {
return RicochetSFXCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
var local3:* = param1;
switch(false ? 0 : 0) {
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package alternativa.engine3d.objects
{
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Camera3D;
import alternativa.engine3d.core.Debug;
import alternativa.engine3d.core.Face;
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.core.RayIntersectionData;
import alternativa.engine3d.core.VG;
import alternativa.engine3d.core.Vertex;
import alternativa.engine3d.core.Wrapper;
import alternativa.engine3d.lights.OmniLight;
import alternativa.engine3d.lights.SpotLight;
import alternativa.engine3d.lights.TubeLight;
import alternativa.engine3d.materials.Material;
import alternativa.engine3d.materials.TextureMaterial;
import flash.display.BitmapData;
import flash.geom.Vector3D;
import flash.utils.Dictionary;
use namespace alternativa3d;
public class Sprite3D extends Object3D
{
public var faces:Vector.<Face>;
public var material:Material;
public var originX:Number = 0.5;
public var originY:Number = 0.5;
public var sorting:int = 0;
public var clipping:int = 2;
public var rotation:Number = 0;
public var autoSize:Boolean = false;
public var width:Number;
public var height:Number;
public var perspectiveScale:Boolean = true;
public var topLeftU:Number = 0;
public var topLeftV:Number = 0;
public var bottomRightU:Number = 1;
public var bottomRightV:Number = 1;
public var depthTest:Boolean = true;
alternativa3d var lightConst:Vector.<Number>;
alternativa3d var lighted:Boolean;
public function Sprite3D(param1:Number, param2:Number, param3:Material = null)
{
this.lightConst = Vector.<Number>([0,0,0,1]);
super();
this.width = param1;
this.height = param2;
this.material = param3;
shadowMapAlphaThreshold = 100;
this.faces = new Vector.<Face>();
}
override public function intersectRay(param1:Vector3D, param2:Vector3D, param3:Dictionary = null, param4:Camera3D = null) : RayIntersectionData
{
var _loc5_:RayIntersectionData = null;
var _loc24_:Vertex = null;
var _loc25_:Number = NaN;
var _loc26_:Number = NaN;
var _loc27_:Number = NaN;
var _loc28_:Number = NaN;
var _loc29_:Number = NaN;
var _loc30_:Vector3D = null;
if(param4 == null || param3 != null && param3[this])
{
return null;
}
param4.composeCameraMatrix();
var _loc6_:Object3D = param4;
while(_loc6_._parent != null)
{
_loc6_ = _loc6_._parent;
_loc6_.composeMatrix();
param4.appendMatrix(_loc6_);
}
param4.invertMatrix();
composeMatrix();
_loc6_ = this;
while(_loc6_._parent != null)
{
_loc6_ = _loc6_._parent;
_loc6_.composeMatrix();
appendMatrix(_loc6_);
}
appendMatrix(param4);
calculateInverseMatrix();
var _loc7_:Number = param4.nearClipping;
var _loc8_:Number = param4.farClipping;
param4.nearClipping = -Number.MAX_VALUE;
param4.farClipping = Number.MAX_VALUE;
culling = 0;
var _loc9_:Face = this.calculateFace(param4);
param4.nearClipping = _loc7_;
param4.farClipping = _loc8_;
var _loc10_:Wrapper = _loc9_.wrapper;
while(_loc10_ != null)
{
_loc24_ = _loc10_.vertex;
_loc24_.x = ima * _loc24_.cameraX + imb * _loc24_.cameraY + imc * _loc24_.cameraZ + imd;
_loc24_.y = ime * _loc24_.cameraX + imf * _loc24_.cameraY + img * _loc24_.cameraZ + imh;
_loc24_.z = imi * _loc24_.cameraX + imj * _loc24_.cameraY + imk * _loc24_.cameraZ + iml;
_loc10_ = _loc10_.next;
}
var _loc11_:Wrapper = _loc9_.wrapper;
var _loc12_:Vertex = _loc11_.vertex;
_loc11_ = _loc11_.next;
var _loc13_:Vertex = _loc11_.vertex;
_loc11_ = _loc11_.next;
var _loc14_:Vertex = _loc11_.vertex;
_loc11_ = _loc11_.next;
var _loc15_:Vertex = _loc11_.vertex;
_loc12_.u = this.topLeftU;
_loc12_.v = this.topLeftV;
_loc13_.u = this.topLeftU;
_loc13_.v = this.bottomRightV;
_loc14_.u = this.bottomRightU;
_loc14_.v = this.bottomRightV;
_loc15_.u = this.bottomRightU;
_loc15_.v = this.topLeftV;
var _loc16_:Number = _loc13_.x - _loc12_.x;
var _loc17_:Number = _loc13_.y - _loc12_.y;
var _loc18_:Number = _loc13_.z - _loc12_.z;
var _loc19_:Number = _loc14_.x - _loc12_.x;
var _loc20_:Number = _loc14_.y - _loc12_.y;
var _loc21_:Number = _loc14_.z - _loc12_.z;
_loc9_.normalX = _loc21_ * _loc17_ - _loc20_ * _loc18_;
_loc9_.normalY = _loc19_ * _loc18_ - _loc21_ * _loc16_;
_loc9_.normalZ = _loc20_ * _loc16_ - _loc19_ * _loc17_;
var _loc22_:Number = 1 / Math.sqrt(_loc9_.normalX * _loc9_.normalX + _loc9_.normalY * _loc9_.normalY + _loc9_.normalZ * _loc9_.normalZ);
_loc9_.normalX *= _loc22_;
_loc9_.normalY *= _loc22_;
_loc9_.normalZ *= _loc22_;
_loc9_.offset = _loc12_.x * _loc9_.normalX + _loc12_.y * _loc9_.normalY + _loc12_.z * _loc9_.normalZ;
var _loc23_:Number = param2.x * _loc9_.normalX + param2.y * _loc9_.normalY + param2.z * _loc9_.normalZ;
if(_loc23_ < 0)
{
_loc25_ = param1.x * _loc9_.normalX + param1.y * _loc9_.normalY + param1.z * _loc9_.normalZ - _loc9_.offset;
if(_loc25_ > 0)
{
_loc26_ = -_loc25_ / _loc23_;
_loc27_ = param1.x + param2.x * _loc26_;
_loc28_ = param1.y + param2.y * _loc26_;
_loc29_ = param1.z + param2.z * _loc26_;
_loc10_ = _loc9_.wrapper;
while(_loc10_ != null)
{
_loc12_ = _loc10_.vertex;
_loc13_ = _loc10_.next != null ? _loc10_.next.vertex : _loc9_.wrapper.vertex;
_loc16_ = _loc13_.x - _loc12_.x;
_loc17_ = _loc13_.y - _loc12_.y;
_loc18_ = _loc13_.z - _loc12_.z;
_loc19_ = _loc27_ - _loc12_.x;
_loc20_ = _loc28_ - _loc12_.y;
_loc21_ = _loc29_ - _loc12_.z;
if((_loc21_ * _loc17_ - _loc20_ * _loc18_) * _loc9_.normalX + (_loc19_ * _loc18_ - _loc21_ * _loc16_) * _loc9_.normalY + (_loc20_ * _loc16_ - _loc19_ * _loc17_) * _loc9_.normalZ < 0)
{
break;
}
_loc10_ = _loc10_.next;
}
if(_loc10_ == null)
{
_loc30_ = new Vector3D(_loc27_,_loc28_,_loc29_);
_loc5_ = new RayIntersectionData();
_loc5_.object = this;
_loc5_.face = null;
_loc5_.point = _loc30_;
_loc5_.uv = _loc9_.getUV(_loc30_);
_loc5_.time = _loc26_;
}
}
}
param4.deferredDestroy();
return _loc5_;
}
override public function clone() : Object3D
{
var _loc1_:Sprite3D = new Sprite3D(this.width,this.height);
_loc1_.clonePropertiesFrom(this);
return _loc1_;
}
override protected function clonePropertiesFrom(param1:Object3D) : void
{
super.clonePropertiesFrom(param1);
var _loc2_:Sprite3D = param1 as Sprite3D;
this.width = _loc2_.width;
this.height = _loc2_.height;
this.autoSize = _loc2_.autoSize;
this.material = _loc2_.material;
this.clipping = _loc2_.clipping;
this.sorting = _loc2_.sorting;
this.originX = _loc2_.originX;
this.originY = _loc2_.originY;
this.topLeftU = _loc2_.topLeftU;
this.topLeftV = _loc2_.topLeftV;
this.bottomRightU = _loc2_.bottomRightU;
this.bottomRightV = _loc2_.bottomRightV;
this.rotation = _loc2_.rotation;
this.perspectiveScale = _loc2_.perspectiveScale;
}
override alternativa3d function draw(param1:Camera3D) : void
{
var _loc2_:int = 0;
if(this.material == null)
{
return;
}
var _loc3_:Face = this.calculateFace(param1);
if(_loc3_ != null)
{
this.lighted = false;
if(useLight && !param1.view.constrained && param1.deferredLighting && param1.deferredLightingStrength > 0)
{
this.calculateLight(param1);
}
if(param1.debug && (_loc2_ = param1.checkInDebug(this)) > 0)
{
if(_loc2_ & Debug.EDGES)
{
Debug.drawEdges(param1,_loc3_,16777215);
}
if(_loc2_ & Debug.BOUNDS)
{
Debug.drawBounds(param1,this,boundMinX,boundMinY,boundMinZ,boundMaxX,boundMaxY,boundMaxZ);
}
}
param1.addTransparent(_loc3_,this);
}
}
override alternativa3d function getVG(param1:Camera3D) : VG
{
if(this.material == null)
{
return null;
}
var _loc2_:Face = this.calculateFace(param1);
if(_loc2_ != null)
{
this.lighted = false;
if(useLight && !param1.view.constrained && param1.deferredLighting && param1.deferredLightingStrength > 0)
{
this.calculateLight(param1);
}
_loc2_.normalX = 0;
_loc2_.normalY = 0;
_loc2_.normalZ = -1;
_loc2_.offset = -ml;
return VG.create(this,_loc2_,this.sorting,!!param1.debug ? int(int(param1.checkInDebug(this))) : int(int(0)),true);
}
return null;
}
private function calculateLight(param1:Camera3D) : void
{
var _loc4_:int = 0;
var _loc5_:Number = NaN;
var _loc6_:Number = NaN;
var _loc7_:Number = NaN;
var _loc8_:Number = NaN;
var _loc9_:Number = NaN;
var _loc10_:Number = NaN;
var _loc11_:Number = NaN;
var _loc12_:Number = NaN;
var _loc20_:OmniLight = null;
var _loc21_:SpotLight = null;
var _loc22_:Number = NaN;
var _loc23_:Number = NaN;
var _loc24_:TubeLight = null;
var _loc25_:Number = NaN;
var _loc26_:Number = NaN;
var _loc27_:Number = NaN;
var _loc28_:Number = NaN;
var _loc29_:Number = NaN;
var _loc30_:Number = NaN;
var _loc2_:Number = param1.viewSizeX / param1.focalLength;
var _loc3_:Number = param1.viewSizeY / param1.focalLength;
if(!param1.view.constrained && (param1.directionalLight != null && param1.directionalLightStrength > 0 || param1.shadowMap != null && param1.shadowMapStrength > 0))
{
this.lightConst[0] = 0;
this.lightConst[1] = 0;
this.lightConst[2] = 0;
}
else
{
this.lightConst[0] = 1;
this.lightConst[1] = 1;
this.lightConst[2] = 1;
}
var _loc13_:Number = md * _loc2_;
var _loc14_:Number = mh * _loc3_;
var _loc15_:Number = ml;
var _loc16_:Number = Math.sqrt(_loc13_ * _loc13_ + _loc14_ * _loc14_ + _loc15_ * _loc15_);
var _loc17_:Number = -_loc13_ / _loc16_;
var _loc18_:Number = -_loc14_ / _loc16_;
var _loc19_:Number = -_loc15_ / _loc16_;
_loc4_ = 0;
while(_loc4_ < param1.omniesCount)
{
_loc20_ = param1.omnies[_loc4_];
_loc5_ = _loc20_.cmd * _loc2_;
_loc6_ = _loc20_.cmh * _loc3_;
_loc7_ = _loc20_.cml;
_loc8_ = _loc20_.attenuationEnd;
if(_loc5_ - _loc8_ < _loc13_ && _loc5_ + _loc8_ > _loc13_ && _loc6_ - _loc8_ < _loc14_ && _loc6_ + _loc8_ > _loc14_ && _loc7_ - _loc8_ < _loc15_ && _loc7_ + _loc8_ > _loc15_)
{
_loc5_ -= _loc13_;
_loc6_ -= _loc14_;
_loc7_ -= _loc15_;
_loc16_ = Math.sqrt(_loc5_ * _loc5_ + _loc6_ * _loc6_ + _loc7_ * _loc7_);
if(_loc16_ > 0 && _loc16_ < _loc8_)
{
_loc5_ /= _loc16_;
_loc6_ /= _loc16_;
_loc7_ /= _loc16_;
_loc9_ = (_loc8_ - _loc16_) / (_loc20_.attenuationEnd - _loc20_.attenuationBegin);
if(_loc9_ > 1)
{
_loc9_ = 1;
}
if(_loc9_ < 0)
{
_loc9_ = 0;
}
_loc9_ *= _loc9_;
_loc11_ = _loc5_ * _loc17_ + _loc6_ * _loc18_ + _loc7_ * _loc19_;
_loc11_ *= 0.5;
_loc11_ += 0.5;
_loc12_ = _loc9_ * _loc11_ * _loc20_.intensity * 2 * param1.deferredLightingStrength;
this.lightConst[0] += _loc12_ * (_loc20_.color >> 16 & 255) / 255;
this.lightConst[1] += _loc12_ * (_loc20_.color >> 8 & 255) / 255;
this.lightConst[2] += _loc12_ * (_loc20_.color & 255) / 255;
this.lighted = true;
}
}
_loc4_++;
}
_loc4_ = 0;
while(_loc4_ < param1.spotsCount)
{
_loc21_ = param1.spots[_loc4_];
_loc5_ = _loc21_.cmd * _loc2_;
_loc6_ = _loc21_.cmh * _loc3_;
_loc7_ = _loc21_.cml;
_loc8_ = _loc21_.attenuationEnd;
if(_loc5_ - _loc8_ < _loc13_ && _loc5_ + _loc8_ > _loc13_ && _loc6_ - _loc8_ < _loc14_ && _loc6_ + _loc8_ > _loc14_ && _loc7_ - _loc8_ < _loc15_ && _loc7_ + _loc8_ > _loc15_)
{
_loc5_ -= _loc13_;
_loc6_ -= _loc14_;
_loc7_ -= _loc15_;
_loc16_ = Math.sqrt(_loc5_ * _loc5_ + _loc6_ * _loc6_ + _loc7_ * _loc7_);
if(_loc16_ > 0 && _loc16_ < _loc8_)
{
_loc5_ /= _loc16_;
_loc6_ /= _loc16_;
_loc7_ /= _loc16_;
_loc22_ = -_loc5_ * _loc21_.cmc * _loc2_ - _loc6_ * _loc21_.cmg * _loc3_ - _loc7_ * _loc21_.cmk;
_loc23_ = Math.cos(_loc21_.falloff * 0.5);
if(_loc22_ > _loc23_)
{
_loc11_ = _loc5_ * _loc17_ + _loc6_ * _loc18_ + _loc7_ * _loc19_;
_loc11_ *= 0.5;
_loc11_ += 0.5;
_loc9_ = (_loc8_ - _loc16_) / (_loc21_.attenuationEnd - _loc21_.attenuationBegin);
if(_loc9_ > 1)
{
_loc9_ = 1;
}
if(_loc9_ < 0)
{
_loc9_ = 0;
}
_loc9_ *= _loc9_;
_loc10_ = (_loc22_ - _loc23_) / (Math.cos(_loc21_.hotspot * 0.5) - _loc23_);
if(_loc10_ > 1)
{
_loc10_ = 1;
}
if(_loc10_ < 0)
{
_loc10_ = 0;
}
_loc10_ *= _loc10_;
_loc12_ = _loc9_ * _loc10_ * _loc11_ * _loc21_.intensity * 2 * param1.deferredLightingStrength;
this.lightConst[0] += _loc12_ * (_loc21_.color >> 16 & 255) / 255;
this.lightConst[1] += _loc12_ * (_loc21_.color >> 8 & 255) / 255;
this.lightConst[2] += _loc12_ * (_loc21_.color & 255) / 255;
this.lighted = true;
}
}
}
_loc4_++;
}
_loc4_ = 0;
while(_loc4_ < param1.tubesCount)
{
_loc24_ = param1.tubes[_loc4_];
_loc25_ = _loc24_.length * 0.5;
_loc26_ = _loc25_ + _loc24_.falloff;
_loc27_ = _loc24_.cmc * _loc2_;
_loc28_ = _loc24_.cmg * _loc2_;
_loc29_ = _loc24_.cmk;
_loc5_ = _loc24_.cmd * _loc2_ + _loc27_ * _loc25_;
_loc6_ = _loc24_.cmh * _loc3_ + _loc28_ * _loc25_;
_loc7_ = _loc24_.cml + _loc29_ * _loc25_;
_loc30_ = _loc27_ * (_loc13_ - _loc5_) + _loc28_ * (_loc14_ - _loc6_) + _loc29_ * (_loc15_ - _loc7_);
if(_loc30_ > -_loc26_ && _loc30_ < _loc26_)
{
_loc5_ += _loc27_ * _loc30_ - _loc13_;
_loc6_ += _loc28_ * _loc30_ - _loc14_;
_loc7_ += _loc29_ * _loc30_ - _loc15_;
_loc16_ = Math.sqrt(_loc5_ * _loc5_ + _loc6_ * _loc6_ + _loc7_ * _loc7_);
if(_loc16_ > 0 && _loc16_ < _loc24_.attenuationEnd)
{
_loc5_ /= _loc16_;
_loc6_ /= _loc16_;
_loc7_ /= _loc16_;
_loc11_ = _loc5_ * _loc17_ + _loc6_ * _loc18_ + _loc7_ * _loc19_;
_loc11_ *= 0.5;
_loc11_ += 0.5;
_loc9_ = (_loc24_.attenuationEnd - _loc16_) / (_loc24_.attenuationEnd - _loc24_.attenuationBegin);
if(_loc9_ > 1)
{
_loc9_ = 1;
}
if(_loc9_ < 0)
{
_loc9_ = 0;
}
_loc9_ *= _loc9_;
if(_loc30_ < 0)
{
_loc30_ = -_loc30_;
}
_loc10_ = (_loc26_ - _loc30_) / (_loc26_ - _loc25_);
if(_loc10_ > 1)
{
_loc10_ = 1;
}
if(_loc10_ < 0)
{
_loc10_ = 0;
}
_loc10_ *= _loc10_;
_loc12_ = _loc9_ * _loc10_ * _loc11_ * _loc24_.intensity * 2 * param1.deferredLightingStrength;
this.lightConst[0] += _loc12_ * (_loc24_.color >> 16 & 255) / 255;
this.lightConst[1] += _loc12_ * (_loc24_.color >> 8 & 255) / 255;
this.lightConst[2] += _loc12_ * (_loc24_.color & 255) / 255;
this.lighted = true;
}
}
_loc4_++;
}
}
private function calculateFace(param1:Camera3D) : Face
{
var _loc3_:Number = NaN;
var _loc4_:Number = NaN;
var _loc5_:Number = NaN;
var _loc6_:Number = NaN;
var _loc7_:Number = NaN;
var _loc8_:Number = NaN;
var _loc9_:Number = NaN;
var _loc10_:Number = NaN;
var _loc11_:Vertex = null;
var _loc12_:Vertex = null;
var _loc22_:Number = NaN;
var _loc25_:BitmapData = null;
var _loc26_:Number = NaN;
var _loc27_:Number = NaN;
var _loc28_:Number = NaN;
var _loc29_:Number = NaN;
var _loc30_:Number = NaN;
var _loc31_:Number = NaN;
var _loc32_:Number = NaN;
var _loc33_:Number = NaN;
culling &= 60;
var _loc2_:Number = ml;
if(_loc2_ <= param1.nearClipping || _loc2_ >= param1.farClipping)
{
return null;
}
var _loc13_:Number = this.width;
var _loc14_:Number = this.height;
var _loc15_:Number = this.bottomRightU - this.topLeftU;
var _loc16_:Number = this.bottomRightV - this.topLeftV;
if(this.autoSize && this.material is TextureMaterial)
{
_loc25_ = (this.material as TextureMaterial).texture;
if(_loc25_ != null)
{
_loc13_ = _loc25_.width * _loc15_;
_loc14_ = _loc25_.height * _loc16_;
}
}
var _loc17_:Number = param1.viewSizeX / _loc2_;
var _loc18_:Number = param1.viewSizeY / _loc2_;
var _loc19_:Number = param1.focalLength / _loc2_;
var _loc20_:Number = param1.focalLength / param1.viewSizeX;
var _loc21_:Number = param1.focalLength / param1.viewSizeY;
_loc3_ = ma / _loc20_;
_loc4_ = me / _loc21_;
_loc22_ = Math.sqrt(_loc3_ * _loc3_ + _loc4_ * _loc4_ + mi * mi);
_loc3_ = mb / _loc20_;
_loc4_ = mf / _loc21_;
_loc22_ += Math.sqrt(_loc3_ * _loc3_ + _loc4_ * _loc4_ + mj * mj);
_loc3_ = mc / _loc20_;
_loc4_ = mg / _loc21_;
_loc22_ += Math.sqrt(_loc3_ * _loc3_ + _loc4_ * _loc4_ + mk * mk);
_loc22_ /= 3;
if(!this.perspectiveScale)
{
_loc22_ /= _loc19_;
}
if(this.rotation == 0)
{
_loc26_ = _loc22_ * _loc13_ * _loc20_;
_loc27_ = _loc22_ * _loc14_ * _loc21_;
_loc3_ = md - this.originX * _loc26_;
_loc4_ = mh - this.originY * _loc27_;
_loc7_ = _loc3_ + _loc26_;
_loc8_ = _loc4_ + _loc27_;
if(culling > 0 && (_loc3_ > _loc2_ || _loc4_ > _loc2_ || _loc7_ < -_loc2_ || _loc8_ < -_loc2_))
{
return null;
}
_loc11_ = Vertex.createList(4);
_loc12_ = _loc11_;
_loc12_.cameraX = _loc3_;
_loc12_.cameraY = _loc4_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.topLeftU;
_loc12_.v = this.topLeftV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc3_;
_loc12_.cameraY = _loc8_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.topLeftU;
_loc12_.v = this.bottomRightV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc7_;
_loc12_.cameraY = _loc8_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.bottomRightU;
_loc12_.v = this.bottomRightV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc7_;
_loc12_.cameraY = _loc4_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.bottomRightU;
_loc12_.v = this.topLeftV;
}
else
{
_loc28_ = -Math.sin(this.rotation) * _loc22_;
_loc29_ = Math.cos(this.rotation) * _loc22_;
_loc30_ = _loc29_ * _loc13_ * _loc20_;
_loc31_ = -_loc28_ * _loc13_ * _loc21_;
_loc32_ = _loc28_ * _loc14_ * _loc20_;
_loc33_ = _loc29_ * _loc14_ * _loc21_;
_loc3_ = md - this.originX * _loc30_ - this.originY * _loc32_;
_loc4_ = mh - this.originX * _loc31_ - this.originY * _loc33_;
_loc5_ = _loc3_ + _loc32_;
_loc6_ = _loc4_ + _loc33_;
_loc7_ = _loc3_ + _loc30_ + _loc32_;
_loc8_ = _loc4_ + _loc31_ + _loc33_;
_loc9_ = _loc3_ + _loc30_;
_loc10_ = _loc4_ + _loc31_;
if(culling > 0)
{
if(this.clipping == 1)
{
if(culling & 4 && _loc2_ <= -_loc3_ && _loc2_ <= -_loc5_ && _loc2_ <= -_loc7_ && _loc2_ <= -_loc9_)
{
return null;
}
if(culling & 8 && _loc2_ <= _loc3_ && _loc2_ <= _loc5_ && _loc2_ <= _loc7_ && _loc2_ <= _loc9_)
{
return null;
}
if(culling & 16 && _loc2_ <= -_loc4_ && _loc2_ <= -_loc6_ && _loc2_ <= -_loc8_ && _loc2_ <= -_loc10_)
{
return null;
}
if(culling & 32 && _loc2_ <= _loc4_ && _loc2_ <= _loc6_ && _loc2_ <= _loc8_ && _loc2_ <= _loc10_)
{
return null;
}
_loc11_ = Vertex.createList(4);
_loc12_ = _loc11_;
_loc12_.cameraX = _loc3_;
_loc12_.cameraY = _loc4_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.topLeftU;
_loc12_.v = this.topLeftV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc3_ + _loc32_;
_loc12_.cameraY = _loc4_ + _loc33_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.topLeftU;
_loc12_.v = this.bottomRightV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc3_ + _loc30_ + _loc32_;
_loc12_.cameraY = _loc4_ + _loc31_ + _loc33_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.bottomRightU;
_loc12_.v = this.bottomRightV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc3_ + _loc30_;
_loc12_.cameraY = _loc4_ + _loc31_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.bottomRightU;
_loc12_.v = this.topLeftV;
}
else
{
if(culling & 4)
{
if(_loc2_ <= -_loc3_ && _loc2_ <= -_loc5_ && _loc2_ <= -_loc7_ && _loc2_ <= -_loc9_)
{
return null;
}
if(_loc2_ > -_loc3_ && _loc2_ > -_loc5_ && _loc2_ > -_loc7_ && _loc2_ > -_loc9_)
{
culling &= 59;
}
}
if(culling & 8)
{
if(_loc2_ <= _loc3_ && _loc2_ <= _loc5_ && _loc2_ <= _loc7_ && _loc2_ <= _loc9_)
{
return null;
}
if(_loc2_ > _loc3_ && _loc2_ > _loc5_ && _loc2_ > _loc7_ && _loc2_ > _loc9_)
{
culling &= 55;
}
}
if(culling & 16)
{
if(_loc2_ <= -_loc4_ && _loc2_ <= -_loc6_ && _loc2_ <= -_loc8_ && _loc2_ <= -_loc10_)
{
return null;
}
if(_loc2_ > -_loc4_ && _loc2_ > -_loc6_ && _loc2_ > -_loc8_ && _loc2_ > -_loc10_)
{
culling &= 47;
}
}
if(culling & 32)
{
if(_loc2_ <= _loc4_ && _loc2_ <= _loc6_ && _loc2_ <= _loc8_ && _loc2_ <= _loc10_)
{
return null;
}
if(_loc2_ > _loc4_ && _loc2_ > _loc6_ && _loc2_ > _loc8_ && _loc2_ > _loc10_)
{
culling &= 31;
}
}
_loc11_ = Vertex.createList(4);
_loc12_ = _loc11_;
_loc12_.cameraX = _loc3_;
_loc12_.cameraY = _loc4_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.topLeftU;
_loc12_.v = this.topLeftV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc3_ + _loc32_;
_loc12_.cameraY = _loc4_ + _loc33_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.topLeftU;
_loc12_.v = this.bottomRightV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc3_ + _loc30_ + _loc32_;
_loc12_.cameraY = _loc4_ + _loc31_ + _loc33_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.bottomRightU;
_loc12_.v = this.bottomRightV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc3_ + _loc30_;
_loc12_.cameraY = _loc4_ + _loc31_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.bottomRightU;
_loc12_.v = this.topLeftV;
}
}
else
{
_loc11_ = Vertex.createList(4);
_loc12_ = _loc11_;
_loc12_.cameraX = _loc3_;
_loc12_.cameraY = _loc4_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.topLeftU;
_loc12_.v = this.topLeftV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc3_ + _loc32_;
_loc12_.cameraY = _loc4_ + _loc33_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.topLeftU;
_loc12_.v = this.bottomRightV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc3_ + _loc30_ + _loc32_;
_loc12_.cameraY = _loc4_ + _loc31_ + _loc33_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.bottomRightU;
_loc12_.v = this.bottomRightV;
_loc12_ = _loc12_.next;
_loc12_.cameraX = _loc3_ + _loc30_;
_loc12_.cameraY = _loc4_ + _loc31_;
_loc12_.cameraZ = _loc2_;
_loc12_.u = this.bottomRightU;
_loc12_.v = this.topLeftV;
}
}
param1.lastVertex.next = _loc11_;
param1.lastVertex = _loc12_;
var _loc23_:Face = Face.create();
_loc23_.material = this.material;
param1.lastFace.next = _loc23_;
param1.lastFace = _loc23_;
var _loc24_:Wrapper = Wrapper.create();
_loc23_.wrapper = _loc24_;
_loc24_.vertex = _loc11_;
_loc11_ = _loc11_.next;
while(_loc11_ != null)
{
_loc24_.next = _loc24_.create();
_loc24_ = _loc24_.next;
_loc24_.vertex = _loc11_;
_loc11_ = _loc11_.next;
}
this.faces.insertAt(this.faces.length,_loc23_);
return _loc23_;
}
override alternativa3d function updateBounds(param1:Object3D, param2:Object3D = null) : void
{
var _loc11_:BitmapData = null;
var _loc12_:Number = NaN;
var _loc13_:Number = NaN;
var _loc14_:Number = NaN;
var _loc15_:Number = NaN;
var _loc3_:Number = this.width;
var _loc4_:Number = this.height;
if(this.autoSize && this.material is TextureMaterial)
{
_loc11_ = (this.material as TextureMaterial).texture;
if(_loc11_ != null)
{
_loc3_ = _loc11_.width * (this.bottomRightU - this.topLeftU);
_loc4_ = _loc11_.height * (this.bottomRightV - this.topLeftV);
}
}
var _loc5_:Number = (this.originX >= 0.5 ? this.originX : 1 - this.originX) * _loc3_;
var _loc6_:Number = (this.originY >= 0.5 ? this.originY : 1 - this.originY) * _loc4_;
var _loc7_:Number = Math.sqrt(_loc5_ * _loc5_ + _loc6_ * _loc6_);
var _loc8_:Number = 0;
var _loc9_:Number = 0;
var _loc10_:Number = 0;
if(param2 != null)
{
_loc12_ = param2.ma;
_loc13_ = param2.me;
_loc14_ = param2.mi;
_loc15_ = Math.sqrt(_loc12_ * _loc12_ + _loc13_ * _loc13_ + _loc14_ * _loc14_);
_loc12_ = param2.mb;
_loc13_ = param2.mf;
_loc14_ = param2.mj;
_loc15_ += Math.sqrt(_loc12_ * _loc12_ + _loc13_ * _loc13_ + _loc14_ * _loc14_);
_loc12_ = param2.mc;
_loc13_ = param2.mg;
_loc14_ = param2.mk;
_loc15_ += Math.sqrt(_loc12_ * _loc12_ + _loc13_ * _loc13_ + _loc14_ * _loc14_);
_loc7_ *= _loc15_ / 3;
_loc8_ = param2.md;
_loc9_ = param2.mh;
_loc10_ = param2.ml;
}
if(_loc8_ - _loc7_ < param1.boundMinX)
{
param1.boundMinX = _loc8_ - _loc7_;
}
if(_loc8_ + _loc7_ > param1.boundMaxX)
{
param1.boundMaxX = _loc8_ + _loc7_;
}
if(_loc9_ - _loc7_ < param1.boundMinY)
{
param1.boundMinY = _loc9_ - _loc7_;
}
if(_loc9_ + _loc7_ > param1.boundMaxY)
{
param1.boundMaxY = _loc9_ + _loc7_;
}
if(_loc10_ - _loc7_ < param1.boundMinZ)
{
param1.boundMinZ = _loc10_ - _loc7_;
}
if(_loc10_ + _loc7_ > param1.boundMaxZ)
{
param1.boundMaxZ = _loc10_ + _loc7_;
}
}
override public function destroy() : void
{
var face:Face = null;
var textMat:TextureMaterial = this.material as TextureMaterial;
if(textMat != null)
{
textMat.dispose();
textMat = null;
}
if(this.material != null)
{
this.material = null;
}
if(this.faces != null)
{
for each(face in this.faces)
{
face.destroy();
face = null;
}
}
}
}
}
|
package projects.tanks.client.achievements.model.panel {
import projects.tanks.client.achievements.model.Achievement;
public interface IAchievementPanelModelBase {
function activateAchievement(param1:Achievement) : void;
function completeAchievement(param1:Achievement, param2:String, param3:int) : void;
}
}
|
package alternativa.tanks.models.weapon.ricochet {
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.tanks.engine3d.TextureAnimation;
import alternativa.tanks.sfx.LightAnimation;
import flash.media.Sound;
public class RicochetSFXData {
public var shotAnimation:TextureAnimation;
public var muzzleFlashMaterial:TextureMaterial;
public var ricochetFlashAnimation:TextureAnimation;
public var explosionAnimation:TextureAnimation;
public var tailTrailMaterial:TextureMaterial;
public var shotSound:Sound;
public var ricochetSound:Sound;
public var explosionSound:Sound;
public var shotLightAnimation:LightAnimation;
public var hitLightAnimation:LightAnimation;
public var ricochetLightAnimation:LightAnimation;
public var shellLightAnimation:LightAnimation;
public function RicochetSFXData() {
super();
}
}
}
|
package alternativa.tanks.gui.garagelist {
import alternativa.tanks.gui.TimerKitCouldBeBoughtContext;
import alternativa.tanks.gui.category.CategoryButtonsList;
import alternativa.tanks.gui.category.CategoryButtonsListEvent;
import alternativa.tanks.model.item.itemforpartners.ItemEnabledForPartner;
import alternativa.tanks.model.item.kit.GarageKit;
import alternativa.tanks.model.item.present.UserPresent;
import alternativa.tanks.service.garage.GarageService;
import alternativa.tanks.service.item.ItemService;
import alternativa.tanks.service.notificationcategories.INotificationGarageCategoriesService;
import alternativa.tanks.service.notificationcategories.NotificationGarageCategoriesEvent;
import alternativa.tanks.types.MultiGameObjectDictionary;
import controls.timer.CountDownTimer;
import flash.events.Event;
import flash.utils.clearTimeout;
import flash.utils.getTimer;
import flash.utils.setTimeout;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.commons.types.ItemCategoryEnum;
import projects.tanks.client.commons.types.ItemViewCategoryEnum;
import projects.tanks.client.garage.models.item.container.lootbox.ILootBoxModelBase;
import projects.tanks.client.garage.models.item.kit.KitItem;
import projects.tanks.clients.fp10.libraries.tanksservices.service.premium.PremiumService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.storage.IStorageService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.userproperties.IUserPropertiesService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.userproperties.UserPropertiesServiceEvent;
import projects.tanks.clients.fp10.libraries.tanksservices.utils.removeDisplayObject;
public class GarageListController {
[Inject]
public static var itemService:ItemService;
[Inject]
public static var premiumService:PremiumService;
[Inject]
public static var userPropertiesService:IUserPropertiesService;
[Inject]
public static var storageService:IStorageService;
[Inject]
public static var notificationGarageCategoriesService:INotificationGarageCategoriesService;
[Inject]
public static var garageService:GarageService;
private static const DEFAULT_CATEGORY_TO_SHOW:ItemViewCategoryEnum = ItemViewCategoryEnum.WEAPON;
private static const LAST_SHOWED_GARAGE_CATEGORY_SHARED_KEY:String = "LAST_SHOWED_GARAGE_CATEGORY";
private static const UPDATE_VISIBILITY_DISCOUNT_INDICATORS_DELAY:int = 1000;
private var _garageList:GarageList;
private var _categoryButtons:CategoryButtonsList;
private var _itemsInDepot:Vector.<IGameObject>;
private var _itemsInStore:Vector.<IGameObject>;
private var _itemsInStoreFromServer:Vector.<IGameObject>;
private var _currentShowingCategory:ItemViewCategoryEnum;
private var _kitsByItem:MultiGameObjectDictionary;
private var _updateVisibilityDiscountIndicatorsTimeoutId:uint;
public function GarageListController(param1:GarageList, param2:CategoryButtonsList) {
super();
this._garageList = param1;
this._categoryButtons = param2;
this.init();
}
private function init() : void {
this._itemsInDepot = new Vector.<IGameObject>();
this._itemsInStore = new Vector.<IGameObject>();
userPropertiesService.addEventListener(UserPropertiesServiceEvent.UPDATE_RANK,this.onRankChange);
notificationGarageCategoriesService.addEventListener(NotificationGarageCategoriesEvent.NOTIFICATION_CHANGE,this.onChangeNotificationGarageCategory);
this._categoryButtons.addEventListener(CategoryButtonsListEvent.CATEGORY_SELECTED,this.onCategoryButtonsSelected);
premiumService.addEventListener(Event.CHANGE,this.onSelfPremiumChanged);
this.updateVisibilityNotificationIconOnCategories();
}
private function onRankChange(param1:UserPropertiesServiceEvent) : void {
this.updateStore();
this.showCategory(this._currentShowingCategory);
}
private function onCategoryButtonsSelected(param1:CategoryButtonsListEvent) : void {
if(this._currentShowingCategory != param1.getCategory()) {
this.showCategory(param1.getCategory());
}
}
private function onSelfPremiumChanged(param1:Event) : void {
var local3:IGameObject = null;
var local2:int = this._garageList.itemsCount() - 1;
while(local2 >= 0) {
local3 = this._garageList.getItemAt(local2);
if(Boolean(itemService.isPremiumItem(local3)) && this.isItemInStore(local3)) {
this._garageList.updateShowLockPremium(local3,!premiumService.hasPremium());
}
local2--;
}
this._garageList.sort();
this.selectAndScrollToItemInCategory(this._garageList.selectedItem);
}
private function onChangeNotificationGarageCategory(param1:NotificationGarageCategoriesEvent) : void {
this.updateVisibilityNotificationIconOnCategories();
}
private function updateVisibilityNotificationIconOnCategories() : void {
var local4:ItemViewCategoryEnum = null;
var local1:Vector.<ItemViewCategoryEnum> = ItemViewCategoryEnum.values;
var local2:int = int(local1.length);
var local3:int = 0;
while(local3 < local2) {
local4 = local1[local3];
if(notificationGarageCategoriesService.isNeedShowNewItemNotification(local4)) {
if(this._currentShowingCategory == local4) {
notificationGarageCategoriesService.categoryShowed(local4);
} else {
this._categoryButtons.hideDiscountIndicator(local4);
this._categoryButtons.showNewItemIndicator(local4);
}
}
local3++;
}
}
public function initDepot(param1:Vector.<IGameObject>) : void {
var local2:IGameObject = null;
for each(local2 in param1) {
itemService.addItem(local2);
}
for each(local2 in param1) {
if(!this.needExcludeFromDepot(local2)) {
this._itemsInDepot.push(local2);
}
}
}
private function needExcludeFromDepot(param1:IGameObject) : Boolean {
var local2:ItemCategoryEnum = itemService.getCategory(param1);
if(local2 == ItemCategoryEnum.INVENTORY || local2 == ItemCategoryEnum.CONTAINER) {
return true;
}
var local3:ItemViewCategoryEnum = itemService.getViewCategory(param1);
if(local3 == ItemViewCategoryEnum.INVISIBLE) {
return true;
}
if(Boolean(itemService.isModificationItem(param1)) && param1 != itemService.getMaxUserModificationItem(param1)) {
return true;
}
return false;
}
public function initStore(param1:Vector.<IGameObject>) : void {
this._itemsInStoreFromServer = param1;
this.updateStore();
}
private function updateStore() : void {
this._itemsInStore = new Vector.<IGameObject>();
this.addBuyableItemToStore();
this.excludeNotBuyableModificationItemFromStore();
this.updateKitsFromStore();
}
private function updateKitsFromStore() : void {
var local3:IGameObject = null;
var local4:Vector.<KitItem> = null;
var local5:KitItem = null;
this._kitsByItem = new MultiGameObjectDictionary();
var local1:int = int(this._itemsInStore.length);
var local2:int = 0;
while(local2 < local1) {
local3 = this._itemsInStore[local2];
if(itemService.isKit(local3)) {
local4 = GarageKit(local3.adapt(GarageKit)).getItems();
for each(local5 in local4) {
this._kitsByItem.put(local5.item,local3);
}
}
local2++;
}
}
public function updateKitsContainsItem(param1:IGameObject) : void {
var local4:IGameObject = null;
if(this._kitsByItem == null) {
return;
}
var local2:Vector.<IGameObject> = this._kitsByItem.getValues(param1);
var local3:int = local2.length - 1;
while(local3 >= 0) {
local4 = local2[local3];
if(!itemService.canBuy(local4)) {
this.removeSingleItemFromStore(local4);
} else {
this._garageList.updateCost(local4,itemService.getPrice(local4));
}
local3--;
}
}
private function addBuyableItemToStore() : void {
var local3:IGameObject = null;
var local1:int = int(this._itemsInStoreFromServer.length);
var local2:int = 0;
while(local2 < local1) {
local3 = this._itemsInStoreFromServer[local2];
if(Boolean(itemService.canBuy(local3)) && this.availableInPartner(local3)) {
this._itemsInStore.push(local3);
}
local2++;
}
}
private function availableInPartner(param1:IGameObject) : Boolean {
if(!param1.hasModel(ItemEnabledForPartner)) {
return true;
}
return ItemEnabledForPartner(param1.adapt(ItemEnabledForPartner)).isAvailable();
}
private function excludeNotBuyableModificationItemFromStore() : void {
var local4:IGameObject = null;
var local5:IGameObject = null;
var local6:IGameObject = null;
var local1:Vector.<IGameObject> = new Vector.<IGameObject>();
var local2:int = int(this._itemsInStore.length);
var local3:int = 0;
while(local3 < local2) {
local4 = this._itemsInStore[local3];
if(itemService.isModificationItem(local4)) {
if(itemService.isPremiumItem(local4)) {
local1.push(local4);
} else {
local5 = itemService.getMaxUserModificationItem(local4);
if(local5 == null && itemService.getModificationIndex(local4) == 0) {
local6 = itemService.getMaxAvailableModification(local4);
if(local6 == null) {
local1.push(local4);
} else {
local1.push(local6);
}
}
}
} else {
local1.push(local4);
}
local3++;
}
this._itemsInStore = local1;
}
public function showCategory(param1:ItemViewCategoryEnum, param2:IGameObject = null) : void {
var local7:ItemViewCategoryEnum = null;
var local8:IGameObject = null;
var local9:IGameObject = null;
var local10:int = 0;
if(!this._categoryButtons.getCategoryButtonVisibility(param1)) {
local7 = this._categoryButtons.findVisibleCategory();
this.showCategory(local7);
return;
}
this._currentShowingCategory = param1;
this._categoryButtons.select(param1);
var local3:Vector.<IGameObject> = this.getItemsByCategory(this._itemsInDepot,param1);
var local4:Vector.<IGameObject> = this.getItemsByCategory(this._itemsInStore,param1);
this._garageList.clearList();
var local5:int = int(local3.length);
var local6:int = 0;
while(local6 < local5) {
this._garageList.addItem(this.createData(local3[local6],true));
local6++;
}
local5 = int(local4.length);
local6 = 0;
while(local6 < local5) {
this._garageList.addItem(this.createData(local4[local6],false));
local6++;
}
this._garageList.sort();
storageService.getStorage().data[LAST_SHOWED_GARAGE_CATEGORY_SHARED_KEY] = param1.value;
if(this._garageList.itemsCount() > 0) {
local8 = this._garageList.getItemAt(0);
if(param2 == null) {
local9 = this.getMountedItemInCategory(local3);
if(local9 == null) {
this.selectAndScrollToItemInCategory(local8);
} else {
this._garageList.scrollTo(local8);
this._garageList.select(local9);
}
} else {
local10 = this._garageList.indexById(param2);
if(local10 == -1) {
this.selectAndScrollToItemInCategory(local8);
} else {
this.selectAndScrollToItemInCategory(param2);
}
}
}
this.resetNotificationCategory(param1);
this.updateVisibilityDiscountIndicators();
}
private function getMountedItemInCategory(param1:Vector.<IGameObject>) : IGameObject {
var local2:IGameObject = null;
var local5:IGameObject = null;
var local3:int = int(param1.length);
var local4:int = 0;
while(local4 < local3) {
local5 = param1[local4];
if(itemService.isMounted(local5)) {
local2 = local5;
break;
}
local4++;
}
return local2;
}
private function resetNotificationCategory(param1:ItemViewCategoryEnum) : void {
this._categoryButtons.hideNewItemIndicator(param1);
notificationGarageCategoriesService.categoryShowed(param1);
}
private function selectAndScrollToItemInCategory(param1:IGameObject) : void {
this._garageList.unselect();
this._garageList.select(param1);
this._garageList.scrollTo(param1);
}
private function createData(param1:IGameObject, param2:Boolean) : GarageListRendererData {
var local3:GarageListRendererData = new GarageListRendererData();
local3.id = param1;
local3.name = itemService.getName(param1);
local3.type = itemService.getCategory(param1);
local3.mod = itemService.getModificationIndex(param1);
local3.crystalPrice = itemService.getPrice(param1);
if(param2) {
local3.rank = -1;
local3.showLockPremium = false;
local3.discount = this.getDiscountForDepotItem(param1);
} else {
local3.rank = this.determineShowingRankIndex(param1);
local3.showLockPremium = Boolean(itemService.isPremiumItem(param1)) && !premiumService.hasPremium();
local3.discount = itemService.getDiscount(param1);
}
local3.installed = itemService.isMounted(param1);
local3.garageElement = param2;
local3.count = itemService.getCount(param1);
local3.preview = itemService.getPreviewResource(param1);
local3.sort = itemService.getPosition(param1);
local3.timerDiscount = this.getEndDiscountTimer(param1,param2);
if(itemService.isGivenPresent(param1)) {
local3.appearanceTime = UserPresent(param1.adapt(UserPresent)).getDate().time;
} else if(param1.hasModel(ILootBoxModelBase)) {
local3.appearanceTime = 1;
} else {
local3.appearanceTime = 0;
}
return local3;
}
private function getDiscountForDepotItem(param1:IGameObject) : int {
var local3:IGameObject = null;
var local2:int = 0;
if(itemService.isCountable(param1)) {
local2 = int(itemService.getDiscount(param1));
} else if(Boolean(itemService.isModificationItem(param1)) && Boolean(itemService.hasNextModification(param1))) {
local3 = itemService.getMaxAvailableOrNextNotAvailableModification(param1);
local2 = int(itemService.getDiscount(local3));
}
return local2;
}
private function determineShowingRankIndex(param1:IGameObject) : int {
var local2:int = int(itemService.getMinRankIndex(param1));
var local3:int = int(itemService.getMaxRankIndex(param1));
var local4:int = int(userPropertiesService.rank);
if(local4 < local2) {
return local2;
}
if(local4 > local3) {
return local3;
}
return 0;
}
private function getEndDiscountTimer(param1:IGameObject, param2:Boolean) : CountDownTimer {
if(itemService.isKit(param1)) {
return this.getEndDiscountTimerForKit(param1);
}
var local3:IGameObject = param1;
if(Boolean(itemService.isModificationItem(param1)) && param2) {
if(!itemService.hasNextModification(param1)) {
return null;
}
local3 = itemService.getMaxAvailableOrNextNotAvailableModification(param1);
}
return itemService.getEndDiscountTimer(local3);
}
private function getEndDiscountTimerForKit(param1:IGameObject) : CountDownTimer {
var local2:CountDownTimer = null;
var local6:TimerKitCouldBeBoughtContext = null;
var local3:Vector.<TimerKitCouldBeBoughtContext> = garageService.getView().getTimersKitCouldBeBoughtContext();
var local4:int = int(local3.length);
var local5:int = 0;
while(local5 < local4) {
local6 = local3[local5];
if(local6.item == param1) {
local2 = local6.timer;
break;
}
local5++;
}
return local2;
}
public function getItemsByCategory(param1:Vector.<IGameObject>, param2:ItemViewCategoryEnum) : Vector.<IGameObject> {
var local6:IGameObject = null;
var local3:Vector.<IGameObject> = new Vector.<IGameObject>();
var local4:int = int(param1.length);
var local5:int = 0;
while(local5 < local4) {
local6 = param1[local5];
if(itemService.getViewCategory(local6) == param2) {
local3.push(local6);
}
local5++;
}
return local3;
}
public function destroy() : void {
userPropertiesService.removeEventListener(UserPropertiesServiceEvent.UPDATE_RANK,this.onRankChange);
notificationGarageCategoriesService.removeEventListener(NotificationGarageCategoriesEvent.NOTIFICATION_CHANGE,this.onChangeNotificationGarageCategory);
this._categoryButtons.removeEventListener(CategoryButtonsListEvent.CATEGORY_SELECTED,this.onCategoryButtonsSelected);
premiumService.removeEventListener(Event.CHANGE,this.onSelfPremiumChanged);
clearTimeout(this._updateVisibilityDiscountIndicatorsTimeoutId);
removeDisplayObject(this._garageList);
removeDisplayObject(this._categoryButtons);
this._garageList.destroy();
this._categoryButtons.destroy();
this._garageList = null;
this._categoryButtons = null;
this._itemsInDepot = null;
this._itemsInStore = null;
}
public function isItemInDepot(param1:IGameObject) : Boolean {
if(this._itemsInDepot == null) {
return false;
}
return this._itemsInDepot.indexOf(param1) != -1;
}
public function isItemInStore(param1:IGameObject) : Boolean {
if(this._itemsInStore == null) {
return false;
}
return this._itemsInStore.indexOf(param1) != -1;
}
public function addItemToDepot(param1:IGameObject) : void {
if(this.isItemInDepot(param1)) {
return;
}
itemService.addItem(param1);
if(!this.needExcludeFromDepot(param1)) {
this._itemsInDepot.push(param1);
}
this.updateVisibilityDiscountIndicatorsWithDelay();
if(this._currentShowingCategory == itemService.getViewCategory(param1)) {
this._garageList.addItem(this.createData(param1,true));
this._garageList.sort();
this.selectAndScrollToItemInCategory(param1);
}
}
public function removeItemFromDepot(param1:IGameObject) : void {
var local2:int = int(this._itemsInDepot.indexOf(param1));
if(local2 != -1) {
itemService.removeItem(param1);
this._itemsInDepot.splice(local2,1);
}
if(this._garageList.indexById(param1) != -1) {
this._garageList.deleteItem(param1);
}
this.updateSelection();
}
public function addItemToStore(param1:IGameObject) : void {
if(this.isItemInStore(param1) || !itemService.canBuy(param1)) {
return;
}
this._itemsInStore.push(param1);
if(this._currentShowingCategory == itemService.getViewCategory(param1)) {
this._garageList.addItem(this.createData(param1,false));
this._garageList.sort();
this.selectAndScrollToItemInCategory(param1);
}
}
public function removeSingleItemFromStore(param1:IGameObject) : void {
var local3:Vector.<KitItem> = null;
var local4:KitItem = null;
var local2:int = int(this._itemsInStore.indexOf(param1));
if(local2 != -1) {
this._itemsInStore.splice(local2,1);
}
if(this._garageList.indexById(param1) != -1) {
this._garageList.deleteItem(param1);
}
if(itemService.isKit(param1)) {
local3 = GarageKit(param1.adapt(GarageKit)).getItems();
for each(local4 in local3) {
this._kitsByItem.remove(local4.item,param1);
}
}
}
public function removeItemFromStore(param1:IGameObject) : void {
if(itemService.isGrouped(param1)) {
this.removeGroupedItemsFromStore(param1);
} else {
this.removeSingleItemFromStore(param1);
}
this.updateSelection();
}
private function removeGroupedItemsFromStore(param1:IGameObject) : void {
var local4:IGameObject = null;
var local2:int = int(itemService.getGroup(param1));
var local3:int = this._itemsInStore.length - 1;
while(local3 >= 0) {
local4 = this._itemsInStore[local3];
if(Boolean(itemService.isGrouped(local4)) && itemService.getGroup(local4) == local2) {
this.removeSingleItemFromStore(local4);
}
local3--;
}
}
public function get itemsInDepot() : Vector.<IGameObject> {
return this._itemsInDepot;
}
public function showDefaultCategory() : void {
this.showCategory(this.getCategoryFromShared());
}
private function getCategoryFromShared() : ItemViewCategoryEnum {
var local1:int = 0;
if(storageService.getStorage().data.hasOwnProperty(LAST_SHOWED_GARAGE_CATEGORY_SHARED_KEY)) {
local1 = int(storageService.getStorage().data[LAST_SHOWED_GARAGE_CATEGORY_SHARED_KEY]);
if(local1 < 0 || local1 >= ItemViewCategoryEnum.values.length) {
return DEFAULT_CATEGORY_TO_SHOW;
}
return ItemViewCategoryEnum.values[local1];
}
return DEFAULT_CATEGORY_TO_SHOW;
}
public function showItemInCategory(param1:IGameObject) : void {
var local3:IGameObject = null;
var local2:IGameObject = param1;
if(itemService.isModificationItem(param1)) {
local3 = itemService.getMaxUserModificationItem(param1);
if(local3 != null) {
local2 = local3;
} else {
local2 = itemService.getMaxAvailableModification(param1);
}
}
this.showCategory(itemService.getViewCategory(local2),local2);
}
public function updateSelection() : void {
if(this._garageList.selectedItem == null && this._garageList.itemsCount() > 0) {
this.selectAndScrollToItemInCategory(this._garageList.getItemAt(0));
}
}
public function updateDiscount(param1:IGameObject) : void {
var local2:IGameObject = null;
this.updateKitsContainsItem(param1);
this.updateVisibilityDiscountIndicatorsWithDelay();
if(this.isItemInStore(param1)) {
this._garageList.updateDiscountAndCost(param1,itemService.getDiscount(param1),itemService.getEndDiscountTimer(param1),itemService.getPrice(param1));
return;
}
if(itemService.isModificationItem(param1)) {
local2 = itemService.getMaxUserModificationItem(param1);
if(local2 != null && itemService.getMaxAvailableOrNextNotAvailableModification(local2) == param1) {
this._garageList.updateDiscountWithTimer(local2,itemService.getDiscount(param1),itemService.getEndDiscountTimer(param1));
}
return;
}
if(itemService.isCountable(param1)) {
this._garageList.updateDiscountAndCost(param1,itemService.getDiscount(param1),itemService.getEndDiscountTimer(param1),itemService.getPrice(param1));
}
}
private function updateVisibilityDiscountIndicatorsWithDelay() : void {
clearTimeout(this._updateVisibilityDiscountIndicatorsTimeoutId);
this._updateVisibilityDiscountIndicatorsTimeoutId = setTimeout(this.updateVisibilityDiscountIndicators,UPDATE_VISIBILITY_DISCOUNT_INDICATORS_DELAY);
}
private function updateVisibilityDiscountIndicators() : void {
var local4:ItemViewCategoryEnum = null;
var local5:Boolean = false;
var local1:Vector.<ItemViewCategoryEnum> = ItemViewCategoryEnum.values;
var local2:int = int(local1.length);
var local3:int = 0;
while(local3 < local2) {
local4 = local1[local3];
if(local4 != ItemViewCategoryEnum.INVISIBLE) {
local5 = false;
if(local4 != ItemViewCategoryEnum.KIT && !notificationGarageCategoriesService.isNeedShowNewItemNotification(local4)) {
if(this.hasAvailableTemporaryDiscounts(local4)) {
local5 = true;
}
}
if(local5) {
this._categoryButtons.showDiscountIndicator(local4);
} else {
this._categoryButtons.hideDiscountIndicator(local4);
}
}
local3++;
}
}
private function hasAvailableTemporaryDiscounts(param1:ItemViewCategoryEnum) : Boolean {
var local3:int = 0;
var local4:int = 0;
var local6:IGameObject = null;
var local7:IGameObject = null;
var local2:Vector.<IGameObject> = this.getItemsByCategory(this._itemsInDepot,param1);
local4 = int(local2.length);
local3 = 0;
while(local3 < local4) {
local6 = local2[local3];
if(this.isAvailableTemporaryDiscount(local6,true)) {
return true;
}
local3++;
}
var local5:Vector.<IGameObject> = this.getItemsByCategory(this._itemsInStore,param1);
local4 = int(local5.length);
local3 = 0;
while(local3 < local4) {
local7 = local5[local3];
if(this.isAvailableTemporaryDiscount(local7,false)) {
return true;
}
local3++;
}
return false;
}
private function isAvailableTemporaryDiscount(param1:IGameObject, param2:Boolean) : Boolean {
var local3:Boolean = false;
var local4:CountDownTimer = null;
if(param2) {
if(this.getDiscountForDepotItem(param1) > 0) {
local4 = this.getEndDiscountTimer(param1,param2);
}
} else if(userPropertiesService.rank >= itemService.getMinRankIndex(param1)) {
local4 = itemService.getEndDiscountTimer(param1);
}
if(local4 != null) {
local3 = local4.getEndTime() > getTimer();
}
return local3;
}
public function getCurrentCategoryItemsCount() : int {
return this._garageList.itemsCount();
}
}
}
|
package projects.tanks.client.panel.model.shop.kitview.localized {
import alternativa.osgi.OSGi;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.registry.ModelRegistry;
public class KitViewResourceLocalizedModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:KitViewResourceLocalizedModelServer;
private var client:IKitViewResourceLocalizedModelBase = IKitViewResourceLocalizedModelBase(this);
private var modelId:Long = Long.getLong(1033850810,311451738);
public function KitViewResourceLocalizedModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new KitViewResourceLocalizedModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(KitViewResourceLocalizedCC,false)));
}
protected function getInitParam() : KitViewResourceLocalizedCC {
return KitViewResourceLocalizedCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
var local3:* = param1;
switch(false ? 0 : 0) {
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package projects.tanks.client.panel.model.shop.shopcategory {
public interface IShopCategoryModelBase {
}
}
|
package alternativa.tanks.battle.events.death {
import alternativa.types.Long;
public class TankReloadedEvent {
public var userId:Long;
public function TankReloadedEvent(param1:Long) {
super();
this.userId = param1;
}
}
}
|
package com.alternativaplatform.projects.tanks.client.models.tank.criticalhit
{
public interface ITankCriticalHitModelBase
{
}
}
|
package alternativa.tanks.models.battle.commonflag {
import alternativa.tanks.battle.objects.tank.Tank;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class FlagNotificationEvents implements FlagNotification {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function FlagNotificationEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function guiShowFlagDropped(param1:CommonFlag) : void {
var i:int = 0;
var m:FlagNotification = null;
var flag:CommonFlag = param1;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = FlagNotification(this.impl[i]);
m.guiShowFlagDropped(flag);
i++;
}
}
finally {
Model.popObject();
}
}
public function guiShowFlagCarried(param1:CommonFlag) : void {
var i:int = 0;
var m:FlagNotification = null;
var flag:CommonFlag = param1;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = FlagNotification(this.impl[i]);
m.guiShowFlagCarried(flag);
i++;
}
}
finally {
Model.popObject();
}
}
public function guiShowFlagAtBase(param1:CommonFlag) : void {
var i:int = 0;
var m:FlagNotification = null;
var flag:CommonFlag = param1;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = FlagNotification(this.impl[i]);
m.guiShowFlagAtBase(flag);
i++;
}
}
finally {
Model.popObject();
}
}
public function notifyFlagTaken(param1:CommonFlag, param2:Tank) : void {
var i:int = 0;
var m:FlagNotification = null;
var flag:CommonFlag = param1;
var carrier:Tank = param2;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = FlagNotification(this.impl[i]);
m.notifyFlagTaken(flag,carrier);
i++;
}
}
finally {
Model.popObject();
}
}
public function notifyFlagReturned(param1:CommonFlag, param2:IGameObject) : void {
var i:int = 0;
var m:FlagNotification = null;
var flag:CommonFlag = param1;
var user:IGameObject = param2;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = FlagNotification(this.impl[i]);
m.notifyFlagReturned(flag,user);
i++;
}
}
finally {
Model.popObject();
}
}
public function notifyFlagDropped(param1:CommonFlag) : void {
var i:int = 0;
var m:FlagNotification = null;
var flag:CommonFlag = param1;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = FlagNotification(this.impl[i]);
m.notifyFlagDropped(flag);
i++;
}
}
finally {
Model.popObject();
}
}
public function notifyFlagThrown(param1:CommonFlag) : void {
var i:int = 0;
var m:FlagNotification = null;
var flag:CommonFlag = param1;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = FlagNotification(this.impl[i]);
m.notifyFlagThrown(flag);
i++;
}
}
finally {
Model.popObject();
}
}
public function notifyFlagDelivered(param1:CommonFlag, param2:Tank) : void {
var i:int = 0;
var m:FlagNotification = null;
var flag:CommonFlag = param1;
var deliverer:Tank = param2;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = FlagNotification(this.impl[i]);
m.notifyFlagDelivered(flag,deliverer);
i++;
}
}
finally {
Model.popObject();
}
}
public function notifyFlagFacedOff(param1:CommonFlag) : void {
var i:int = 0;
var m:FlagNotification = null;
var flag:CommonFlag = param1;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = FlagNotification(this.impl[i]);
m.notifyFlagFacedOff(flag);
i++;
}
}
finally {
Model.popObject();
}
}
public function notifyReadyToFaceOff() : void {
var i:int = 0;
var m:FlagNotification = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = FlagNotification(this.impl[i]);
m.notifyReadyToFaceOff();
i++;
}
}
finally {
Model.popObject();
}
}
}
}
|
package forms.buttons
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class MainPanelSpinsButton_overBtn extends BitmapAsset
{
public function MainPanelSpinsButton_overBtn()
{
super();
}
}
}
|
package alternativa.osgi.service.console {
import alternativa.osgi.service.command.CommandService;
import alternativa.osgi.service.command.FormattedOutput;
import alternativa.osgi.service.launcherparams.ILauncherParams;
import alternativa.osgi.service.logging.LogLevel;
import alternativa.osgi.service.logging.LogTarget;
public class ConsoleLogTarget implements LogTarget {
private static const ANY_CHANNEL:* = "ANY_CHANNEL";
private static const ANY_LOGLEVEL:LogLevel = null;
private const EMPTY_VECTOR:Vector.<LogEntry> = new Vector.<LogEntry>(0);
private const channels:Object = {};
private var logEntrySequence:int;
private var commandService:CommandService;
private var bufferSize:int;
private var connectedChannel:Object = {};
private var connectToAllChannel:Boolean;
private var console:IConsole;
public function ConsoleLogTarget(param1:CommandService, param2:IConsole, param3:ILauncherParams) {
super();
this.console = param2;
this.commandService = param1;
this.bufferSize = int(param3.getParameter("log_channel_buffer_size","1000"));
this.setupAutoConnectedChannel(param3);
param1.registerCommand("log","channels","Список каналов",[],this.cmdChannelsList);
param1.registerCommand("log","channel","Показать сообщения из канала",[String],this.cmdShowChannel);
param1.registerCommand("log","connect","Показывать новые сообщения из канала",[String],this.cmdConnectChannel);
param1.registerCommand("log","disconnect","Показывать новые сообщения из канала",[String],this.cmdDisconnectChannel);
param1.registerCommand("log","trace","Посмотреть trace сообщения",[],this.cmdShow(LogLevel.TRACE));
param1.registerCommand("log","info","Посмотреть info сообщения",[],this.cmdShow(LogLevel.INFO));
param1.registerCommand("log","warning","Посмотреть warning сообщения",[],this.cmdShow(LogLevel.WARNING));
param1.registerCommand("log","debug","Посмотреть debug сообщения",[],this.cmdShow(LogLevel.DEBUG));
param1.registerCommand("log","error","Посмотреть error сообщения",[],this.cmdShow(LogLevel.ERROR));
}
public function log(param1:Object, param2:LogLevel, param3:String, param4:Array = null) : void {
var local5:LogEntry = new LogEntry(this.logEntrySequence++,param1,param2,param3,param4);
var local6:Vector.<LogEntry> = this.getOrCreateBufferForChannel(param1);
local6.push(local5);
if(Boolean(this.connectedChannel[param1]) || this.connectToAllChannel) {
this.print(this.console,local5);
}
if(local6.length > this.bufferSize) {
local6.splice(1,100);
}
}
private function setupAutoConnectedChannel(param1:ILauncherParams) : void {
var local3:String = null;
var local2:String = param1.getParameter("showlog");
if(Boolean(local2)) {
if(local2 == "*") {
this.connectToAllChannel = true;
} else {
for each(local3 in local2.split(",")) {
this.connectedChannel[local3] = true;
}
}
}
}
private function cmdDisconnectChannel(param1:FormattedOutput, param2:String) : void {
delete this.connectedChannel[param2];
}
private function cmdConnectChannel(param1:FormattedOutput, param2:String) : void {
this.connectedChannel[param2] = param2;
}
private function cmdShow(param1:LogLevel) : Function {
var logLevel:LogLevel = param1;
return function(param1:FormattedOutput):void {
var local3:* = undefined;
var local2:* = getLogEntriesForLevel(logLevel);
for each(local3 in local2) {
print(param1,local3);
}
};
}
private function getLogEntriesForLevel(param1:LogLevel) : Vector.<LogEntry> {
var channelName:String = null;
var channelEntries:Vector.<LogEntry> = null;
var logEntry:LogEntry = null;
var logLevel:LogLevel = param1;
var result:Vector.<LogEntry> = new Vector.<LogEntry>();
for(channelName in this.channels) {
channelEntries = this.channels[channelName];
for each(logEntry in channelEntries) {
if(logEntry.level == logLevel) {
result.push(logEntry);
}
}
}
result.sort(function(param1:LogEntry, param2:LogEntry):Number {
return param1.ordinal - param2.ordinal;
});
return result;
}
private function cmdShowChannel(param1:FormattedOutput, param2:String) : void {
var local5:LogEntry = null;
var local3:Vector.<LogEntry> = this.getBufferForChannel(param2);
var local4:int = 0;
while(local4 < local3.length) {
local5 = local3[local4];
if(this.filtered(local5,param2,ANY_LOGLEVEL)) {
this.print(param1,local5);
}
local4++;
}
}
private function cmdChannelsList(param1:FormattedOutput) : void {
var local2:String = null;
for(local2 in this.channels) {
param1.addText(local2);
}
}
private function filtered(param1:LogEntry, param2:*, param3:LogLevel) : Boolean {
if(param1.level != param3 && param3 != ANY_LOGLEVEL) {
return false;
}
if(param1.object != param2 && param2 != ANY_CHANNEL) {
return false;
}
return true;
}
private function insertVars(param1:String, param2:Array) : String {
var local3:int = 0;
if(param2 != null) {
local3 = 0;
while(local3 < param2.length) {
param1 = param1.replace("%" + (local3 + 1),param2[local3]);
local3++;
}
}
return param1;
}
private function print(param1:FormattedOutput, param2:LogEntry) : void {
param1.addText(param2.level.getName() + " [" + param2.object + "] " + this.insertVars(param2.message,param2.params));
}
private function getOrCreateBufferForChannel(param1:Object) : Vector.<LogEntry> {
var local2:Vector.<LogEntry> = this.getBufferForChannel(param1);
if(local2 == this.EMPTY_VECTOR) {
local2 = new Vector.<LogEntry>();
this.channels[param1] = local2;
}
return local2;
}
private function getBufferForChannel(param1:Object) : Vector.<LogEntry> {
return Boolean(this.channels[param1]) ? this.channels[param1] : this.EMPTY_VECTOR;
}
}
}
|
package alternativa.tanks.model.payment.modes {
import platform.client.fp10.core.type.IGameObject;
public class CrystalsOnlyPaymentModeAdapt implements CrystalsOnlyPaymentMode {
private var object:IGameObject;
private var impl:CrystalsOnlyPaymentMode;
public function CrystalsOnlyPaymentModeAdapt(param1:IGameObject, param2:CrystalsOnlyPaymentMode) {
super();
this.object = param1;
this.impl = param2;
}
}
}
|
package controls.cellrenderer {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/controls.cellrenderer.CellUnavailable_normalLeft.png")]
public class CellUnavailable_normalLeft extends BitmapAsset {
public function CellUnavailable_normalLeft() {
super();
}
}
}
|
package alternativa.tanks.models.license {
import alternativa.tanks.models.user.ClanUserService;
import platform.client.fp10.core.model.ObjectLoadListener;
import projects.tanks.client.clans.license.user.ILicenseClanUserModelBase;
import projects.tanks.client.clans.license.user.LicenseClanUserModelBase;
[ModelInfo]
public class LicenseClanUserModel extends LicenseClanUserModelBase implements ILicenseClanUserModelBase, ObjectLoadListener {
[Inject]
public static var clanUserService:ClanUserService;
public function LicenseClanUserModel() {
super();
}
public function objectLoaded() : void {
if(getInitParam() == null) {
return;
}
clanUserService.hasClanLicense = getInitParam().clanLicense;
clanUserService.licenseGarageObject = getInitParam().licenseGarageObject;
}
public function addClanLicense() : void {
clanUserService.hasClanLicense = true;
}
public function removeClanLicense() : void {
clanUserService.hasClanLicense = false;
}
}
}
|
package _codec.projects.tanks.client.battlefield.models.tankparts.engine {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.battlefield.models.tankparts.engine.EngineCC;
public class VectorCodecEngineCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecEngineCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(EngineCC,false));
if(this.optionalElement) {
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:int = int(LengthCodecHelper.decodeLength(param1));
var local3:Vector.<EngineCC> = new Vector.<EngineCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = EngineCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:EngineCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<EngineCC> = Vector.<EngineCC>(param2);
var local5:int = int(local3.length);
LengthCodecHelper.encodeLength(param1,local5);
var local6:int = 0;
while(local6 < local5) {
this.elementCodec.encode(param1,local3[local6]);
local6++;
}
}
}
}
|
package alternativa.tanks.model {
import org.robotlegs.mvcs.Actor;
public class EntranceUrlParamsModel extends Actor {
private var _entranceHash:String;
private var _singleUseHash:String;
private var _domain:String;
private var _passedCallsign:String;
private var _passedPassword:String;
private var _emailConfirmHash:String;
private var _emailChangeHash:String;
private var _email:String;
private var _referralHash:String;
private var _tutorialHash:String;
private var _changeUidHash:String;
public function EntranceUrlParamsModel() {
super();
}
public function get entranceHash() : String {
return this._entranceHash;
}
public function get domain() : String {
return this._domain;
}
public function get passedCallsign() : String {
return this._passedCallsign;
}
public function get emailConfirmHash() : String {
return this._emailConfirmHash;
}
public function get emailChangeHash() : String {
return this._emailChangeHash;
}
public function get email() : String {
return this._email;
}
public function get referralHash() : String {
return this._referralHash;
}
public function get singleUseHash() : String {
return this._singleUseHash;
}
public function set entranceHash(param1:String) : void {
this._entranceHash = param1;
}
public function set domain(param1:String) : void {
this._domain = param1;
}
public function set passedCallsign(param1:String) : void {
this._passedCallsign = param1;
}
public function set emailConfirmHash(param1:String) : void {
this._emailConfirmHash = param1;
}
public function set emailChangeHash(param1:String) : void {
this._emailChangeHash = param1;
}
public function set email(param1:String) : void {
this._email = param1;
}
public function set referralHash(param1:String) : void {
this._referralHash = param1;
}
public function set singleUseHash(param1:String) : void {
this._singleUseHash = param1;
}
public function get tutorialHash() : String {
return this._tutorialHash;
}
public function set tutorialHash(param1:String) : void {
this._tutorialHash = param1;
}
public function get passedPassword() : String {
return this._passedPassword;
}
public function set passedPassword(param1:String) : void {
this._passedPassword = param1;
}
public function get changeUidHash() : String {
return this._changeUidHash;
}
public function set changeUidHash(param1:String) : void {
this._changeUidHash = param1;
}
}
}
|
package _codec.projects.tanks.client.panel.model.shop.premiumpackage {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.panel.model.shop.premiumpackage.PremiumPackageCC;
public class VectorCodecPremiumPackageCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecPremiumPackageCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(PremiumPackageCC,false));
if(this.optionalElement) {
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:int = LengthCodecHelper.decodeLength(param1);
var local3:Vector.<PremiumPackageCC> = new Vector.<PremiumPackageCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = PremiumPackageCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:PremiumPackageCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<PremiumPackageCC> = Vector.<PremiumPackageCC>(param2);
var local5:int = int(local3.length);
LengthCodecHelper.encodeLength(param1,local5);
var local6:int = 0;
while(local6 < local5) {
this.elementCodec.encode(param1,local3[local6]);
local6++;
}
}
}
}
|
package alternativa.tanks.model.payment.shop.premium {
import alternativa.tanks.gui.shop.shopitems.item.base.ShopButton;
import alternativa.tanks.gui.shop.shopitems.item.premiumitem.PremiumPackageButton;
import alternativa.tanks.model.payment.shop.ShopItemView;
import projects.tanks.client.panel.model.shop.premiumpackage.IPremiumPackageModelBase;
import projects.tanks.client.panel.model.shop.premiumpackage.PremiumPackageModelBase;
[ModelInfo]
public class PremiumPackageModel extends PremiumPackageModelBase implements IPremiumPackageModelBase, PremiumPackage, ShopItemView {
public function PremiumPackageModel() {
super();
}
public function getDurationInDays() : int {
return getInitParam().durationInDays;
}
public function getButtonView() : ShopButton {
return new PremiumPackageButton(object);
}
}
}
|
package alternativa.tanks.models.sfx.flame
{
import alternativa.engine3d.core.Object3D;
import alternativa.math.Vector3;
import alternativa.tanks.models.tank.TankData;
import alternativa.tanks.models.weapon.weakening.IWeaponWeakeningModel;
import alternativa.tanks.sfx.EffectsPair;
public interface IFlamethrowerSFXModel
{
function getSpecialEffects(param1:TankData, param2:Vector3, param3:Object3D, param4:IWeaponWeakeningModel) : EffectsPair;
}
}
|
package alternativa.tanks.service.referrals {
import flash.events.EventDispatcher;
import projects.tanks.client.panel.model.referrals.ReferralIncomeData;
public class ReferralsServiceImpl extends EventDispatcher implements ReferralsService {
private var referrals:Vector.<ReferralIncomeData>;
private var link:String;
public function ReferralsServiceImpl() {
super();
}
public function updateReferralsData(param1:Vector.<ReferralIncomeData>) : void {
this.referrals = param1;
dispatchEvent(new ReferralsServiceEvent(ReferralsServiceEvent.DATA_UPDATED));
}
public function getReferrals() : Vector.<ReferralIncomeData> {
return this.referrals;
}
public function setInviteLink(param1:String) : void {
this.link = param1;
}
public function getInviteLink() : String {
return this.link;
}
public function requestUpdatingReferralsData() : void {
dispatchEvent(new ReferralsServiceEvent(ReferralsServiceEvent.UPDATE_DATA_REQUEST));
}
}
}
|
package alternativa.tanks.controller.commands {
import alternativa.tanks.controller.events.GetNewCaptchaEvent;
import alternativa.tanks.service.IEntranceServerFacade;
import org.robotlegs.mvcs.Command;
public class GetNewCaptchaCommand extends Command {
[Inject]
public var serverFacade:IEntranceServerFacade;
[Inject]
public var event:GetNewCaptchaEvent;
public function GetNewCaptchaCommand() {
super();
}
override public function execute() : void {
this.serverFacade.getNewCaptcha(this.event.location);
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.sfx.colortransform {
public interface IColorTransformModelBase {
}
}
|
package alternativa.tanks.view.timeleftindicator {
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.PixelSnapping;
public class BigWhiteTimeLeftIndicator extends TimeLeftIndicator {
private static const emptyMarkerClass:Class = BigWhiteTimeLeftIndicator_emptyMarkerClass;
private static const emptyMarkerBitmapData:BitmapData = new emptyMarkerClass().bitmapData;
private static const fullMarkerClass:Class = BigWhiteTimeLeftIndicator_fullMarkerClass;
private static const fullMarkerBitmapData:BitmapData = new fullMarkerClass().bitmapData;
public function BigWhiteTimeLeftIndicator() {
imageFull = new Bitmap(fullMarkerBitmapData,PixelSnapping.AUTO,true);
addChild(new Bitmap(emptyMarkerBitmapData,PixelSnapping.AUTO,true));
super();
}
}
}
|
package mx.core {
public interface IRepeaterClient {
function get instanceIndices() : Array;
function set instanceIndices(value:Array) : void;
function get isDocument() : Boolean;
function get repeaterIndices() : Array;
function set repeaterIndices(value:Array) : void;
function get repeaters() : Array;
function set repeaters(value:Array) : void;
function initializeRepeaterArrays(parent:IRepeaterClient) : void;
}
}
|
package projects.tanks.client.garage.models.item.device {
public interface IItemDevicesGarageModelBase {
}
}
|
package _codec.projects.tanks.client.panel.model.profile.userproperties {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.panel.model.profile.userproperties.UserPropertiesCC;
public class VectorCodecUserPropertiesCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecUserPropertiesCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(UserPropertiesCC,false));
if(this.optionalElement) {
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
}
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:int = LengthCodecHelper.decodeLength(param1);
var local3:Vector.<UserPropertiesCC> = new Vector.<UserPropertiesCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = UserPropertiesCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:UserPropertiesCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<UserPropertiesCC> = Vector.<UserPropertiesCC>(param2);
var local5:int = int(local3.length);
LengthCodecHelper.encodeLength(param1,local5);
var local6:int = 0;
while(local6 < local5) {
this.elementCodec.encode(param1,local3[local6]);
local6++;
}
}
}
}
|
package platform.client.fp10.core.type.impl {
import alternativa.osgi.service.logging.LogService;
import alternativa.osgi.service.logging.Logger;
import alternativa.osgi.service.network.INetworkService;
import alternativa.protocol.IProtocol;
import alternativa.types.Long;
import flash.utils.Dictionary;
import platform.client.fp10.core.model.IObjectLoadListener;
import platform.client.fp10.core.model.ObjectUnloadListener;
import platform.client.fp10.core.model.ObjectUnloadPostListener;
import platform.client.fp10.core.network.ICommandSender;
import platform.client.fp10.core.network.connection.ConnectionCloseStatus;
import platform.client.fp10.core.network.connection.ConnectionConnectParameters;
import platform.client.fp10.core.network.connection.ConnectionInitializers;
import platform.client.fp10.core.network.connection.IConnection;
import platform.client.fp10.core.network.connection.IProtectionContext;
import platform.client.fp10.core.network.connection.protection.PrimitiveProtectionContext;
import platform.client.fp10.core.network.connection.protection.XorBasedProtectionContext;
import platform.client.fp10.core.network.handler.ISpaceCommandHandler;
import platform.client.fp10.core.protocol.codec.SpaceRootCodec;
import platform.client.fp10.core.service.errormessage.IErrorMessageService;
import platform.client.fp10.core.service.transport.ITransportService;
import platform.client.fp10.core.type.*;
public class Space implements ISpace {
[Inject]
public static var logService:LogService;
[Inject]
public static var messageBoxService:IErrorMessageService;
[Inject]
public static var networkService:INetworkService;
[Inject]
public static var transportService:ITransportService;
private static var logger:Logger;
private var _id:Long;
private var objectById:Dictionary = new Dictionary();
private var _objects:Vector.<IGameObject>;
private var connection:IConnection;
private var listeners:Vector.<ISpaceListener>;
public function Space(param1:Long, param2:ISpaceCommandHandler, param3:IProtocol, param4:Boolean) {
super();
this._id = param1;
this._objects = new Vector.<IGameObject>();
logger = logger || logService.getLogger("space");
this.listeners = new Vector.<ISpaceListener>();
var local5:IProtectionContext = param4 ? new XorBasedProtectionContext(transportService.hash,param1) : PrimitiveProtectionContext.INSTANCE;
var local6:ConnectionInitializers = new ConnectionInitializers(param3,new SpaceRootCodec(),param2,networkService.secure,param1,local5);
this.connection = transportService.createConnection(local6);
param2.setSpace(this);
var local7:GameClass = new GameClass(Long.getLong(0,0),new Vector.<Long>());
this.createObject(param1,local7,"Space object");
}
public function connect(param1:String, param2:Vector.<int>) : void {
this.connection.connect(new ConnectionConnectParameters(param1,param2));
}
public function close() : void {
this.connection.close(ConnectionCloseStatus.SPACE_CLOSED);
this.invokeSpaceClosedListeners();
}
private function invokeSpaceClosedListeners() : void {
var local2:ISpaceListener = null;
var local1:Vector.<ISpaceListener> = this.listeners.concat();
for each(local2 in local1) {
local2.spaceClosed();
}
}
public function createObject(param1:Long, param2:IGameClass, param3:String) : IGameObject {
var local4:GameObject = null;
if(this.objectById[param1] == null) {
local4 = new GameObject(param1,GameClass(param2),param3,this);
this.objectById[local4.id] = local4;
this._objects.push(local4);
}
return this.objectById[param1];
}
public function destroyObject(param1:Long) : void {
var objectId:Long = param1;
var clientObject:GameObject = this.objectById[objectId];
if(clientObject != null) {
try {
this.invokeUnloadListeners(clientObject);
this.invokeDestructionListeners(clientObject);
}
catch(e:Error) {
processUnloadingError(e,objectId);
}
finally {
this.removeObject(clientObject);
}
}
}
private function invokeUnloadListeners(param1:IGameObject) : void {
var local2:IObjectLoadListener = IObjectLoadListener(param1.event(IObjectLoadListener));
local2.objectUnloaded();
ObjectUnloadListener(param1.event(ObjectUnloadListener)).objectUnloaded();
local2.objectUnloadedPost();
ObjectUnloadPostListener(param1.event(ObjectUnloadPostListener)).objectUnloadedPost();
}
private function invokeDestructionListeners(param1:GameObject) : void {
var local3:ISpaceListener = null;
var local2:Vector.<ISpaceListener> = this.listeners.concat();
for each(local3 in local2) {
local3.objectDestroyed(param1);
}
}
private function processUnloadingError(param1:Error, param2:Long) : void {
}
private function removeObject(param1:GameObject) : void {
this._objects.splice(this._objects.indexOf(param1),1);
delete this.objectById[param1.id];
param1.clear();
}
public function getObject(param1:Long) : IGameObject {
return this.objectById[param1];
}
public function get objects() : Vector.<IGameObject> {
return this._objects;
}
public function get id() : Long {
return this._id;
}
public function get commandSender() : ICommandSender {
return this.connection;
}
public function get rootObject() : IGameObject {
return this.getObject(this._id);
}
public function addEventListener(param1:ISpaceListener) : void {
if(this.listeners.indexOf(param1) == -1) {
this.listeners.push(param1);
}
}
public function removeEventListener(param1:ISpaceListener) : void {
var local2:int = int(this.listeners.indexOf(param1));
if(local2 != -1) {
this.listeners.splice(local2,1);
}
}
public function modelsDataReady(param1:IGameObject) : void {
var local3:ISpaceListener = null;
var local2:Vector.<ISpaceListener> = this.listeners.concat();
for each(local3 in local2) {
local3.objectCreated(param1);
}
}
public function toString() : String {
return "[Space id=" + this.id + "]";
}
}
}
|
package alternativa.tanks.service {
public interface AccountService {
function get haveVisitedTankiAlready() : Boolean;
function set haveVisitedTankiAlready(param1:Boolean) : void;
function get storedUserName() : String;
function set storedUserName(param1:String) : void;
function get entranceHash() : String;
}
}
|
package alternativa.tanks.sfx {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.sfx.LevelUpEffectFactory_BeamTexture.jpg")]
public class LevelUpEffectFactory_BeamTexture extends BitmapAsset {
public function LevelUpEffectFactory_BeamTexture() {
super();
}
}
}
|
package projects.tanks.client.panel.model.payment.modes.onlyurl {
import alternativa.osgi.OSGi;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.OptionalMap;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
import flash.utils.ByteArray;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.network.command.SpaceCommand;
import platform.client.fp10.core.type.IGameObject;
import platform.client.fp10.core.type.ISpace;
public class OnlyUrlPaymentModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var _getPaymentUrlId:Long = Long.getLong(1335834608,740239090);
private var _getPaymentUrl_shopItemIdCodec:ICodec;
private var model:IModel;
public function OnlyUrlPaymentModelServer(param1:IModel) {
super();
this.model = param1;
var local2:ByteArray = new ByteArray();
this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol));
this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap());
this._getPaymentUrl_shopItemIdCodec = this.protocol.getCodec(new TypeCodecInfo(Long,false));
}
public function getPaymentUrl(param1:Long) : void {
ByteArray(this.protocolBuffer.writer).position = 0;
ByteArray(this.protocolBuffer.writer).length = 0;
this._getPaymentUrl_shopItemIdCodec.encode(this.protocolBuffer,param1);
ByteArray(this.protocolBuffer.writer).position = 0;
if(Model.object == null) {
throw new Error("Execute method without model context.");
}
var local2:SpaceCommand = new SpaceCommand(Model.object.id,this._getPaymentUrlId,this.protocolBuffer);
var local3:IGameObject = Model.object;
var local4:ISpace = local3.space;
local4.commandSender.sendCommand(local2);
this.protocolBuffer.optionalMap.clear();
}
}
}
|
package platform.client.core.general.socialnetwork.models.socialnetworkparameters {
import alternativa.osgi.OSGi;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.registry.ModelRegistry;
public class SocialNetworkParametersModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:SocialNetworkParametersModelServer;
private var client:ISocialNetworkParametersModelBase = ISocialNetworkParametersModelBase(this);
private var modelId:Long = Long.getLong(1480731399,760833293);
public function SocialNetworkParametersModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new SocialNetworkParametersModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(SocialNetworkParametersCC,false)));
}
protected function getInitParam() : SocialNetworkParametersCC {
return SocialNetworkParametersCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
var local3:* = param1;
switch(false ? 0 : 0) {
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package projects.tanks.client.clans.user {
import alternativa.osgi.OSGi;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.registry.ModelRegistry;
import platform.client.fp10.core.type.IGameObject;
public class ClanUserModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:ClanUserModelServer;
private var client:IClanUserModelBase = IClanUserModelBase(this);
private var modelId:Long = Long.getLong(259670316,1522052296);
private var _alreadyInAcceptedId:Long = Long.getLong(57363867,1237781863);
private var _alreadyInAccepted_nameCodec:ICodec;
private var _alreadyInClanId:Long = Long.getLong(618126442,-725356522);
private var _alreadyInClanOutgoingId:Long = Long.getLong(1671975780,-1329402274);
private var _alreadyInClanOutgoing_nameCodec:ICodec;
private var _alreadyInClanOutgoing_lightClanCodec:ICodec;
private var _alreadyInIncomingId:Long = Long.getLong(57363920,-817863194);
private var _alreadyInIncoming_nameCodec:ICodec;
private var _alreadyInIncoming_clanCodec:ICodec;
private var _alreadyInOutgoingId:Long = Long.getLong(57363960,-848977620);
private var _alreadyInOutgoing_nameCodec:ICodec;
private var _clanBlockedId:Long = Long.getLong(325235064,-2121980921);
private var _clanExistId:Long = Long.getLong(1693514433,32146500);
private var _clanIncomingRequestDisabledId:Long = Long.getLong(944293305,-1852342578);
private var _clanNotExistId:Long = Long.getLong(1492352330,720837769);
private var _creatorLeaveOfClanIfEmptyClanId:Long = Long.getLong(1273341198,-1482111631);
private var _joinClanId:Long = Long.getLong(193176875,2068732989);
private var _leftClanId:Long = Long.getLong(193176886,893937818);
private var _leftClan_restrictionTimeInSecCodec:ICodec;
private var _removeClanBonusesId:Long = Long.getLong(1136230800,538530230);
private var _showAlertFullClanId:Long = Long.getLong(2062667168,-2002974215);
private var _updateStatusBonusesClanId:Long = Long.getLong(1570177194,1280257195);
private var _updateStatusBonusesClan_canGiveBonusesClanCodec:ICodec;
private var _userLowRankId:Long = Long.getLong(321756128,1414681448);
public function ClanUserModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new ClanUserModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(ClanUserCC,false)));
this._alreadyInAccepted_nameCodec = this._protocol.getCodec(new TypeCodecInfo(String,false));
this._alreadyInClanOutgoing_nameCodec = this._protocol.getCodec(new TypeCodecInfo(String,false));
this._alreadyInClanOutgoing_lightClanCodec = this._protocol.getCodec(new TypeCodecInfo(IGameObject,false));
this._alreadyInIncoming_nameCodec = this._protocol.getCodec(new TypeCodecInfo(String,false));
this._alreadyInIncoming_clanCodec = this._protocol.getCodec(new TypeCodecInfo(IGameObject,false));
this._alreadyInOutgoing_nameCodec = this._protocol.getCodec(new TypeCodecInfo(String,false));
this._leftClan_restrictionTimeInSecCodec = this._protocol.getCodec(new TypeCodecInfo(int,false));
this._updateStatusBonusesClan_canGiveBonusesClanCodec = this._protocol.getCodec(new TypeCodecInfo(Boolean,false));
}
protected function getInitParam() : ClanUserCC {
return ClanUserCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
switch(param1) {
case this._alreadyInAcceptedId:
this.client.alreadyInAccepted(String(this._alreadyInAccepted_nameCodec.decode(param2)));
break;
case this._alreadyInClanId:
this.client.alreadyInClan();
break;
case this._alreadyInClanOutgoingId:
this.client.alreadyInClanOutgoing(String(this._alreadyInClanOutgoing_nameCodec.decode(param2)),IGameObject(this._alreadyInClanOutgoing_lightClanCodec.decode(param2)));
break;
case this._alreadyInIncomingId:
this.client.alreadyInIncoming(String(this._alreadyInIncoming_nameCodec.decode(param2)),IGameObject(this._alreadyInIncoming_clanCodec.decode(param2)));
break;
case this._alreadyInOutgoingId:
this.client.alreadyInOutgoing(String(this._alreadyInOutgoing_nameCodec.decode(param2)));
break;
case this._clanBlockedId:
this.client.clanBlocked();
break;
case this._clanExistId:
this.client.clanExist();
break;
case this._clanIncomingRequestDisabledId:
this.client.clanIncomingRequestDisabled();
break;
case this._clanNotExistId:
this.client.clanNotExist();
break;
case this._creatorLeaveOfClanIfEmptyClanId:
this.client.creatorLeaveOfClanIfEmptyClan();
break;
case this._joinClanId:
this.client.joinClan();
break;
case this._leftClanId:
this.client.leftClan(int(this._leftClan_restrictionTimeInSecCodec.decode(param2)));
break;
case this._removeClanBonusesId:
this.client.removeClanBonuses();
break;
case this._showAlertFullClanId:
this.client.showAlertFullClan();
break;
case this._updateStatusBonusesClanId:
this.client.updateStatusBonusesClan(Boolean(this._updateStatusBonusesClan_canGiveBonusesClanCodec.decode(param2)));
break;
case this._userLowRankId:
this.client.userLowRank();
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package
{
import alternativa.init.UserModelActivator;
import specter.utils.Logger;
public class Authorization
{
public var userModel:UserModelActivator;
public function Authorization()
{
super();
this.userModel = new UserModelActivator();
}
public function init() : void
{
this.userModel.start(Game.getInstance.osgi);
this.userModel.userModel.initObject(Game.getInstance.classObject,false,false);
this.userModel.userModel.objectLoaded(Game.getInstance.classObject);
Logger.log("Authorization::init()");
}
}
}
|
package alternativa.tanks.models.tank.support {
import alternativa.tanks.battle.events.BattleEventDispatcher;
import alternativa.tanks.battle.events.BattleEventListener;
import alternativa.tanks.battle.events.PauseActivationEvent;
import alternativa.tanks.battle.events.PauseDeactivationEvent;
import alternativa.tanks.battle.events.reload.ReloadActivateEvent;
import alternativa.tanks.battle.events.reload.ReloadDeactivateEvent;
import alternativa.tanks.battle.events.suicide.SuicideActivationEvent;
import alternativa.tanks.battle.events.suicide.SuicideDeactivationEvent;
import alternativa.tanks.models.battle.gui.indicators.TurnOverIndicator;
import platform.client.fp10.core.type.AutoClosable;
import projects.tanks.clients.flash.commons.services.layout.event.LobbyLayoutServiceEvent;
import projects.tanks.clients.fp10.libraries.tanksservices.service.dialogwindowdispatcher.DialogWindowsDispatcherServiceEvent;
import projects.tanks.clients.fp10.libraries.tanksservices.service.dialogwindowdispatcher.IDialogWindowsDispatcherService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.layout.ILobbyLayoutService;
public class TurnOverIndicatorSupport implements AutoClosable, BattleEventListener {
[Inject]
public static var battleEventDispatcher:BattleEventDispatcher;
[Inject]
public static var dialogWindowsDispatcherService:IDialogWindowsDispatcherService;
[Inject]
public static var lobbyLayoutService:ILobbyLayoutService;
private var turnOverIndicator:TurnOverIndicator;
private var isSuiciding:Boolean;
private var isRearmorReloading:Boolean;
private var isPausing:Boolean;
private var shouldBeShown:Boolean;
public function TurnOverIndicatorSupport() {
super();
this.turnOverIndicator = new TurnOverIndicator();
this.addEventHandlers();
this.isSuiciding = false;
this.isRearmorReloading = false;
this.isPausing = false;
this.shouldBeShown = false;
}
public function shouldShow() : void {
this.shouldBeShown = true;
this.processIndicatorVisibility();
}
public function hide() : void {
this.shouldBeShown = false;
this.turnOverIndicator.hide();
}
public function handleBattleEvent(param1:Object) : void {
if(param1 is SuicideActivationEvent) {
this.isSuiciding = true;
} else if(param1 is SuicideDeactivationEvent) {
this.isSuiciding = false;
} else if(param1 is ReloadActivateEvent) {
this.isRearmorReloading = true;
} else if(param1 is ReloadDeactivateEvent) {
this.isRearmorReloading = false;
} else if(param1 is PauseActivationEvent) {
this.isPausing = true;
} else if(param1 is PauseDeactivationEvent) {
this.isPausing = false;
}
this.processIndicatorVisibility();
}
private function processIndicatorVisibility() : void {
if(this.shouldBeShown && this.canBeShown()) {
this.turnOverIndicator.show();
} else {
this.turnOverIndicator.hide();
}
}
private function canBeShown() : Boolean {
return !this.isRearmorReloading && !this.isSuiciding && !lobbyLayoutService.isWindowOpenOverBattle() && !this.isPausing;
}
private function addEventHandlers() : void {
battleEventDispatcher.addBattleEventListener(SuicideActivationEvent,this);
battleEventDispatcher.addBattleEventListener(SuicideDeactivationEvent,this);
battleEventDispatcher.addBattleEventListener(PauseActivationEvent,this);
battleEventDispatcher.addBattleEventListener(PauseDeactivationEvent,this);
battleEventDispatcher.addBattleEventListener(ReloadActivateEvent,this);
battleEventDispatcher.addBattleEventListener(ReloadDeactivateEvent,this);
dialogWindowsDispatcherService.addEventListener(DialogWindowsDispatcherServiceEvent.OPEN,this.handleBattleEvent);
dialogWindowsDispatcherService.addEventListener(DialogWindowsDispatcherServiceEvent.CLOSE,this.handleBattleEvent);
lobbyLayoutService.addEventListener(LobbyLayoutServiceEvent.BEGIN_LAYOUT_SWITCH,this.handleBattleEvent);
lobbyLayoutService.addEventListener(LobbyLayoutServiceEvent.END_LAYOUT_SWITCH,this.handleBattleEvent);
}
private function removeEventHandlers() : void {
battleEventDispatcher.removeBattleEventListener(SuicideActivationEvent,this);
battleEventDispatcher.removeBattleEventListener(SuicideDeactivationEvent,this);
battleEventDispatcher.removeBattleEventListener(PauseActivationEvent,this);
battleEventDispatcher.removeBattleEventListener(PauseDeactivationEvent,this);
battleEventDispatcher.removeBattleEventListener(ReloadActivateEvent,this);
battleEventDispatcher.removeBattleEventListener(ReloadDeactivateEvent,this);
dialogWindowsDispatcherService.removeEventListener(DialogWindowsDispatcherServiceEvent.OPEN,this.handleBattleEvent);
dialogWindowsDispatcherService.removeEventListener(DialogWindowsDispatcherServiceEvent.CLOSE,this.handleBattleEvent);
lobbyLayoutService.removeEventListener(LobbyLayoutServiceEvent.BEGIN_LAYOUT_SWITCH,this.handleBattleEvent);
lobbyLayoutService.removeEventListener(LobbyLayoutServiceEvent.END_LAYOUT_SWITCH,this.handleBattleEvent);
}
[Obfuscation(rename="false")]
public function close() : void {
this.removeEventHandlers();
this.turnOverIndicator.destroy();
this.turnOverIndicator = null;
this.isSuiciding = false;
this.isRearmorReloading = false;
this.isPausing = false;
this.shouldBeShown = false;
}
}
}
|
package assets.button {
import flash.display.BitmapData;
[Embed(source="/_assets/assets.button.button_def_UP_LEFT.png")]
public dynamic class button_def_UP_LEFT extends BitmapData {
public function button_def_UP_LEFT(param1:int = 7, param2:int = 30) {
super(param1,param2);
}
}
}
|
package alternativa.tanks.gui.friends.battleLink {
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.gui.friends.list.renderer.FriendsAcceptedListRenderer;
import alternativa.types.Long;
import assets.cellrenderer.battlelist.SportBattleItemIcon;
import controls.base.LabelBase;
import flash.display.Bitmap;
import flash.display.Sprite;
import forms.ColorConstants;
import forms.contextmenu.BattleInviteContextMenuLabel;
import platform.client.fp10.core.service.address.AddressService;
import projects.tanks.clients.fp10.libraries.TanksLocale;
import projects.tanks.clients.fp10.libraries.tanksservices.model.notifier.battle.BattleLinkData;
import projects.tanks.clients.fp10.libraries.tanksservices.service.layout.ILobbyLayoutService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.user.IUserInfoLabelUpdater;
import projects.tanks.clients.fp10.libraries.tanksservices.service.user.IUserInfoService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.user.UserInfoLabelUpdaterEvent;
import projects.tanks.clients.fp10.libraries.tanksservices.service.userproperties.IUserPropertiesService;
public class BattleLink extends Sprite {
[Inject]
public static var userInfoService:IUserInfoService;
[Inject]
public static var addressService:AddressService;
[Inject]
public static var lobbyLayoutService:ILobbyLayoutService;
[Inject]
public static var localeService:ILocaleService;
[Inject]
public static var userPropertiesService:IUserPropertiesService;
private var _userId:Long;
private var _data:BattleLinkData;
private var _proBattleIcon:SportBattleItemIcon;
private var _label:LabelBase;
private var _labelCont:Sprite;
private var _userInfoUpdater:IUserInfoLabelUpdater;
private var _availableBattleIcon:Bitmap;
public function BattleLink(param1:Long) {
super();
this._userId = param1;
this.init();
}
private function init() : void {
this.tabChildren = false;
this.tabEnabled = false;
this._availableBattleIcon = new Bitmap(BattleInviteContextMenuLabel.battleInviteBitmapData);
this._availableBattleIcon.y = (FriendsAcceptedListRenderer.ROW_HEIGHT - this._availableBattleIcon.height) / 2;
this._availableBattleIcon.visible = false;
addChild(this._availableBattleIcon);
this._proBattleIcon = new SportBattleItemIcon();
this._proBattleIcon.gotoAndStop(1);
this._proBattleIcon.visible = false;
this._proBattleIcon.y = (FriendsAcceptedListRenderer.ROW_HEIGHT - this._proBattleIcon.height) / 2;
addChild(this._proBattleIcon);
this._labelCont = new Sprite();
addChild(this._labelCont);
this._label = new LabelBase();
this._label.color = ColorConstants.GREEN_LABEL;
this._label.mouseEnabled = false;
this._labelCont.addChild(this._label);
this._labelCont.y = -1;
this._proBattleIcon.x = 0;
this._availableBattleIcon.x = this._proBattleIcon.x + this._proBattleIcon.width + 5;
this._labelCont.x = this._availableBattleIcon.x + this._availableBattleIcon.width + 2;
this._userInfoUpdater = userInfoService.getOrCreateUpdater(this._userId);
this._userInfoUpdater.addEventListener(UserInfoLabelUpdaterEvent.CHANGE_BATTLE_LINK,this.onChangeBattleLink);
if(this._userInfoUpdater.hasData()) {
this.updateBattleLink(this._userInfoUpdater.battleLink);
}
}
private function onChangeBattleLink(param1:UserInfoLabelUpdaterEvent) : void {
this.updateBattleLink(this._userInfoUpdater.battleLink);
}
private function updateBattleLink(param1:BattleLinkData) : void {
this._data = param1;
this._proBattleIcon.visible = false;
this._availableBattleIcon.visible = false;
var local2:String = "";
var local3:Boolean = false;
if(this.hasData()) {
if(!this._data.proBattle) {
local2 = param1.inGroup ? localeService.getText(TanksLocale.TEXT_FRIENDS_IN_GROUP) : localeService.getText(TanksLocale.TEXT_FRIENDS_IN_BATTLE);
} else if(this._data.isShowBattle()) {
local2 = this.getInProBattleText(param1);
this._proBattleIcon.visible = true;
this._availableBattleIcon.visible = this._data.availableRank();
local3 = this._data.isClickable();
}
}
this._labelCont.buttonMode = this._labelCont.useHandCursor = local3;
this._label.htmlText = local2;
}
private function getInProBattleText(param1:BattleLinkData) : String {
if(this.isSelfBattle()) {
return param1.mapName + " " + localeService.getText(TanksLocale.TEXT_FRIENDS_YOU_ARE_HERE_BATTLE_INDICATOR);
}
return param1.isClickable() ? "<u>" + param1.mapName + "</u>" : param1.mapName;
}
private function isSelfBattle() : Boolean {
return addressService != null && this._data.isSelfBattle();
}
public function get data() : BattleLinkData {
return this._data;
}
public function hasData() : Boolean {
return this._data != null;
}
public function removeEvents() : void {
this._userInfoUpdater.removeEventListener(UserInfoLabelUpdaterEvent.CHANGE_BATTLE_LINK,this.onChangeBattleLink);
}
public function get labelCont() : Sprite {
return this._labelCont;
}
}
}
|
package projects.tanks.client.panel.model.quest.daily.type.map {
import alternativa.osgi.OSGi;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.types.Long;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
public class ScoreCollectOnMapDailyQuestModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:ScoreCollectOnMapDailyQuestModelServer;
private var client:IScoreCollectOnMapDailyQuestModelBase = IScoreCollectOnMapDailyQuestModelBase(this);
private var modelId:Long = Long.getLong(2038809803,-77133727);
public function ScoreCollectOnMapDailyQuestModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new ScoreCollectOnMapDailyQuestModelServer(IModel(this));
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
var local3:* = param1;
switch(false ? 0 : 0) {
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package alternativa.protocol.info {
import flash.utils.getQualifiedClassName;
public class TypeCodecInfo extends CodecInfo {
private var _type:Class;
public function TypeCodecInfo(param1:Class, param2:Boolean) {
super(param2);
this._type = param1;
}
public function get type() : Class {
return this._type;
}
override public function toString() : String {
return "[TypeCodecInfo " + super.toString() + " type=" + getQualifiedClassName(this.type);
}
}
}
|
package alternativa.tanks.models.weapon.ricochet
{
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.lights.OmniLight;
import alternativa.init.Main;
import alternativa.math.Matrix3;
import alternativa.math.Vector3;
import alternativa.object.ClientObject;
import alternativa.physics.Body;
import alternativa.physics.collision.ICollisionDetector;
import alternativa.physics.collision.IRayCollisionPredicate;
import alternativa.physics.collision.types.RayIntersection;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.engine3d.AnimatedSprite3D;
import alternativa.tanks.engine3d.TextureAnimation;
import alternativa.tanks.models.battlefield.BattlefieldModel;
import alternativa.tanks.models.battlefield.IBattleField;
import alternativa.tanks.models.battlefield.gamemode.GameModes;
import alternativa.tanks.models.battlefield.scene3dcontainer.Scene3DContainer;
import alternativa.tanks.models.sfx.shoot.ricochet.RicochetSFXData;
import alternativa.tanks.models.tank.TankData;
import alternativa.tanks.models.weapon.weakening.IWeaponWeakeningModel;
import alternativa.tanks.physics.CollisionGroup;
import alternativa.tanks.sfx.AnimatedSpriteEffectNew;
import alternativa.tanks.sfx.IGraphicEffect;
import alternativa.tanks.sfx.SFXUtils;
import alternativa.tanks.sfx.Sound3D;
import alternativa.tanks.sfx.Sound3DEffect;
import alternativa.tanks.sfx.SoundOptions;
import alternativa.tanks.sfx.StaticObject3DPositionProvider;
import alternativa.tanks.utils.objectpool.ObjectPool;
import alternativa.tanks.utils.objectpool.PooledObject;
import flash.media.Sound;
public class RicochetShot extends PooledObject implements IGraphicEffect, IRayCollisionPredicate
{
private static const SHOT_SIZE:Number = 300;
private static const BUMP_FLASH_SIZE:Number = 80;
private static const ANIMATION_FPS:Number = 30;
private static const NUM_RADIAL_RAYS:int = 6;
private static const RADIAL_ANGLE_STEP:Number = 2 * Math.PI / NUM_RADIAL_RAYS;
private static var rotationMatrix:Matrix3 = new Matrix3();
private static var _normal:Vector3 = new Vector3();
private static var _rayHit:RayIntersection = new RayIntersection();
private static var _rayOrigin:Vector3 = new Vector3();
private static var _rayDirection:Vector3 = new Vector3();
private static var counter:int;
public var id:int;
public var shooterData:TankData;
public var totalDistance:Number = 0;
public var sfxData:RicochetSFXData;
private var battlefield:IBattleField;
private var radialPoints:Vector.<Vector3>;
private var currPos:Vector3;
private var direction:Vector3;
private var listener:IRicochetShotListener;
private var ricochetData:RicochetData;
private var collisionDetector:ICollisionDetector;
private var sprite:AnimatedSprite3D;
private var numFrames:int;
private var currFrame:Number;
private var battleField:BattlefieldModel;
private var omni:OmniLight;
private var weakeningModel:IWeaponWeakeningModel;
private var ricochetCount:int;
private var tailTrail:TailTrail;
private var isFirstFrame:Boolean;
public function RicochetShot(objectPool:ObjectPool)
{
this.currPos = new Vector3();
this.direction = new Vector3();
this.battleField = Main.osgi.getService(IBattleField) as BattlefieldModel;
this.omni = new OmniLight(Math.random() * 16777215,SHOT_SIZE / 2 - 50,SHOT_SIZE);
super(objectPool);
this.radialPoints = new Vector.<Vector3>(NUM_RADIAL_RAYS,true);
for(var i:int = 0; i < NUM_RADIAL_RAYS; i++)
{
this.radialPoints[i] = new Vector3();
}
this.sprite = new AnimatedSprite3D(300,300);
this.sprite.softAttenuation = 0;
this.sprite.looped = true;
this.tailTrail = new TailTrail(100,300);
}
public function init(startPos:Vector3, direction:Vector3, shooterData:TankData, ricochetData:RicochetData, sfxData:RicochetSFXData, collisionDetector:ICollisionDetector, weakeningModel:IWeaponWeakeningModel, listener:IRicochetShotListener, battlefield:IBattleField) : void
{
this.currPos.vCopy(startPos);
this.direction.vCopy(direction);
this.shooterData = shooterData;
this.ricochetData = ricochetData;
this.sfxData = sfxData;
this.collisionDetector = collisionDetector;
this.weakeningModel = weakeningModel;
this.listener = listener;
this.battlefield = battlefield;
this.id = counter++;
this.numFrames = sfxData.shotMaterials.length;
this.currFrame = this.numFrames * Math.random();
this.sprite.rotation = 6.28 * Math.random();
this.sprite.colorTransform = null;
var animaton:TextureAnimation = sfxData.dataShot;
this.sprite.setAnimationData(animaton);
this.sprite.setFrameIndex(this.sprite.getNumFrames() * Math.random());
this.tailTrail.material = sfxData.tailTrailMaterial;
this.tailTrail.colorTransform = null;
this.initRadialPoints(startPos,direction,ricochetData.shotRadius);
this.totalDistance = 0;
this.ricochetCount = 0;
this.isFirstFrame = true;
}
public function addToContainer(container:Scene3DContainer) : void
{
container.addChild(this.sprite);
container.addChild(this.tailTrail);
if(this.battleField.gameMode == GameModes.HALLOWEEN)
{
container.addChild(this.omni);
this.omni.color = Math.random() * 16777215;
}
if(this.battleField.gameMode == GameModes.DAY)
{
container.addChild(this.omni);
this.omni.color = 16777215;
}
}
public function get owner() : ClientObject
{
return null;
}
public function play(millis:int, camera:GameCamera) : Boolean
{
var currDistance:Number = NaN;
var body:Body = null;
var hitTime:Number = NaN;
var i:int = 0;
var origin:Vector3 = null;
var bumpFlashEffect:AnimatedSpriteEffectNew = null;
var posProvider:StaticObject3DPositionProvider = null;
var animaton:TextureAnimation = null;
if(this.totalDistance > this.ricochetData.shotDistance)
{
return false;
}
if(this.isFirstFrame)
{
this.isFirstFrame = false;
_rayOrigin.x = this.currPos.x;
_rayOrigin.y = this.currPos.y;
_rayOrigin.z = this.currPos.z + this.ricochetData.shotRadius;
_rayDirection.z = -1;
if(this.collisionDetector.intersectRayWithStatic(_rayOrigin,_rayDirection,CollisionGroup.STATIC,this.ricochetData.shotRadius,null,_rayHit))
{
return false;
}
}
var dt:Number = millis / 1000;
var frameDistance:Number = this.ricochetData.shotSpeed * dt;
while(frameDistance > 0)
{
hitTime = -1;
if(this.collisionDetector.intersectRay(this.currPos,this.direction,CollisionGroup.WEAPON,frameDistance,this,_rayHit))
{
hitTime = _rayHit.t;
body = _rayHit.primitive.body;
if(body != null)
{
this.currPos.vAddScaled(hitTime,this.direction);
this.listener.shotHit(this,this.currPos,this.direction,body);
return false;
}
currDistance = hitTime;
_normal.vCopy(_rayHit.normal);
}
else
{
currDistance = frameDistance;
}
for(i = 0; i < NUM_RADIAL_RAYS; i++)
{
origin = this.radialPoints[i];
if(this.collisionDetector.intersectRay(origin,this.direction,CollisionGroup.WEAPON,currDistance,null,_rayHit))
{
body = _rayHit.primitive.body;
if(body != null && !(this.shooterData.tank == body && this.ricochetCount == 0))
{
this.currPos.vAddScaled(_rayHit.t,this.direction);
this.listener.shotHit(this,this.currPos,this.direction,body);
return false;
}
}
origin.vAddScaled(currDistance,this.direction);
}
if(hitTime > -1)
{
++this.ricochetCount;
this.totalDistance += hitTime;
frameDistance -= hitTime;
this.currPos.vAddScaled(hitTime,this.direction).vAddScaled(0.1,_normal);
this.direction.vAddScaled(-2 * this.direction.vDot(_normal),_normal);
this.initRadialPoints(this.currPos,this.direction,this.ricochetData.shotRadius);
bumpFlashEffect = AnimatedSpriteEffectNew(objectPool.getObject(AnimatedSpriteEffectNew));
posProvider = StaticObject3DPositionProvider(objectPool.getObject(StaticObject3DPositionProvider));
posProvider.init(this.currPos,50);
animaton = this.sfxData.dataFlash;
bumpFlashEffect.init(BUMP_FLASH_SIZE,BUMP_FLASH_SIZE,animaton,Math.random() * Math.PI * 2,posProvider,0.5,0.5,null,0);
this.battlefield.addGraphicEffect(bumpFlashEffect);
this.addSoundEffect(this.sfxData.ricochetSound,this.currPos,SoundOptions.nearRadius,SoundOptions.farRadius,SoundOptions.farDelimiter,0.8);
}
else
{
this.totalDistance += frameDistance;
this.currPos.vAddScaled(frameDistance,this.direction);
frameDistance = 0;
}
}
this.sprite.x = this.currPos.x;
this.sprite.y = this.currPos.y;
this.sprite.z = this.currPos.z;
if(this.battleField.gameMode == GameModes.HALLOWEEN || this.battleField.gameMode == GameModes.DAY)
{
this.omni.x = this.currPos.x;
}
this.omni.y = this.currPos.y;
this.omni.z = this.currPos.z;
this.sprite.update(dt);
var impactCoeff:Number = this.weakeningModel.getImpactCoeff(this.shooterData.turret,0.01 * this.totalDistance);
var size:Number = SHOT_SIZE * impactCoeff;
this.sprite.width = size;
this.sprite.height = size;
this.sprite.rotation -= 0.003 * millis;
var cameraPosition:Vector3 = camera.pos;
SFXUtils.alignObjectPlaneToView(this.tailTrail,this.currPos,this.direction,camera.pos);
var dx:Number = this.currPos.x - cameraPosition.x;
var dy:Number = this.currPos.y - cameraPosition.y;
var dz:Number = this.currPos.z - cameraPosition.z;
var len:Number = dx * dx + dy * dy + dz * dz;
if(len > 0.00001)
{
len = 1 / Math.sqrt(len);
dx *= len;
dy *= len;
dz *= len;
}
var dot:Number = dx * this.direction.x + dy * this.direction.y + dz * this.direction.z;
if(dot < 0)
{
dot = -dot;
}
if(dot > 0.5)
{
this.tailTrail.alpha = 2 * (1 - dot) * impactCoeff;
}
else
{
this.tailTrail.alpha = impactCoeff;
}
return true;
}
public function destroy() : void
{
this.sprite.alternativa3d::removeFromParent();
if(this.battleField.gameMode == GameModes.HALLOWEEN || this.battleField.gameMode == GameModes.DAY)
{
this.omni.parent.removeChild(this.omni);
}
this.sprite.material = null;
this.sprite.colorTransform = null;
this.tailTrail.alternativa3d::removeFromParent();
this.tailTrail.material = null;
this.tailTrail.colorTransform = null;
this.shooterData = null;
this.ricochetData = null;
this.sfxData = null;
this.collisionDetector = null;
this.weakeningModel = null;
this.listener = null;
this.battlefield = null;
storeInPool();
}
public function kill() : void
{
this.totalDistance = this.ricochetData.shotDistance + 1;
}
public function considerBody(body:Body) : Boolean
{
return !(body == this.shooterData.tank && this.ricochetCount == 0);
}
override protected function getClass() : Class
{
return RicochetShot;
}
private function initRadialPoints(centerPoint:Vector3, dir:Vector3, radius:Number) : void
{
var i:int = 0;
var axis:int = 0;
var min:Number = 1e+308;
var d:Number = dir.x < 0 ? Number(-dir.x) : Number(dir.x);
if(d < min)
{
min = d;
axis = 0;
}
d = dir.y < 0 ? Number(-dir.y) : Number(dir.y);
if(d < min)
{
min = d;
axis = 1;
}
d = dir.z < 0 ? Number(-dir.z) : Number(dir.z);
if(d < min)
{
axis = 2;
}
var v:Vector3 = new Vector3();
switch(axis)
{
case 0:
v.x = 0;
v.y = dir.z;
v.z = -dir.y;
break;
case 1:
v.x = -dir.z;
v.y = 0;
v.z = dir.x;
break;
case 2:
v.x = dir.y;
v.y = -dir.x;
v.z = 0;
}
v.vNormalize().vScale(radius);
rotationMatrix.fromAxisAngle(dir,RADIAL_ANGLE_STEP);
Vector3(this.radialPoints[0]).vCopy(centerPoint).vAdd(v);
for(i = 1; i < NUM_RADIAL_RAYS; i++)
{
v.vTransformBy3(rotationMatrix);
Vector3(this.radialPoints[i]).vCopy(centerPoint).vAdd(v);
}
}
private function addSoundEffect(sound:Sound, position:Vector3, nearRadius:Number, farRadius:Number, farDelimiter:Number, soundVolume:Number) : void
{
var sound3d:Sound3D = null;
var soundEffect:Sound3DEffect = null;
if(sound != null)
{
sound3d = Sound3D.create(sound,nearRadius,farRadius,farDelimiter,soundVolume);
soundEffect = Sound3DEffect.create(objectPool,null,position,sound3d);
this.battlefield.addSound3DEffect(soundEffect);
}
}
}
}
import alternativa.tanks.models.sfx.SimplePlane;
class TailTrail extends SimplePlane
{
function TailTrail(width:Number, length:Number)
{
super(width,length,0.5,1);
setUVs(1,1,1,0,0,0,0,1);
}
}
|
package alternativa.tanks.gui
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class ItemInfoPanel_bitmapDamageShaft extends BitmapAsset
{
public function ItemInfoPanel_bitmapDamageShaft()
{
super();
}
}
}
|
package projects.tanks.client.commons.models.challenge.time {
public class ChallengesTimeCC {
private var _timeLeftSec:int;
public function ChallengesTimeCC(param1:int = 0) {
super();
this._timeLeftSec = param1;
}
public function get timeLeftSec() : int {
return this._timeLeftSec;
}
public function set timeLeftSec(param1:int) : void {
this._timeLeftSec = param1;
}
public function toString() : String {
var local1:String = "ChallengesTimeCC [";
local1 += "timeLeftSec = " + this.timeLeftSec + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.gui
{
import flash.events.Event;
public class SettingsWindowEvent extends Event
{
public static const CHANGE_TEXTURE_QUALITY:String = "SettingsWindowEventChangeTextureQuality";
public static const CHANGE_VOLUME:String = "SettingsWindowEventChangeVolume";
public static const RESEND_CONFIRMATION:String = "SettingsWindowEventResendConfirmation";
public static const CANCEL_SETTINGS:String = "SettingsWindowEventCancelSettings";
public static const ACCEPT_SETTINGS:String = "SettingsWindowEventAcceptSettings";
public static const CHANGE_PASSWORD:String = "SettingsWindowEventChangePassword";
public function SettingsWindowEvent(type:String)
{
super(type,true,false);
}
}
}
|
package platform.client.fp10.core.network.command.control.client {
import platform.client.fp10.core.network.command.ControlCommand;
import platform.client.fp10.core.network.command.IConnectionInitCommand;
public class HashRequestCommand extends ControlCommand implements IConnectionInitCommand {
public var parameterNames:Array;
public var parameterValues:Array;
public function HashRequestCommand(param1:Array, param2:Array) {
super(ControlCommand.CL_HASH_REQUEST,"Hash request");
if(param1 == null) {
throw new ArgumentError("Parameter parameterNames is null");
}
if(param2 == null) {
throw new ArgumentError("Parameter parameterValues is null");
}
this.parameterNames = param1;
this.parameterValues = param2;
}
}
}
|
package {
import flash.display.MovieClip;
[Embed(source="/_assets/assets.swf", symbol="symbol767")]
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
public function ScrollArrowDown_overSkin() {
super();
}
}
}
|
package projects.tanks.client.panel.model.battleinvite {
import platform.client.fp10.core.resource.types.SoundResource;
public class BattleInviteCC {
private var _soundNotification:SoundResource;
public function BattleInviteCC(param1:SoundResource = null) {
super();
this._soundNotification = param1;
}
public function get soundNotification() : SoundResource {
return this._soundNotification;
}
public function set soundNotification(param1:SoundResource) : void {
this._soundNotification = param1;
}
public function toString() : String {
var local1:String = "BattleInviteCC [";
local1 += "soundNotification = " + this.soundNotification + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.models.weapon.shaft.states
{
public class ShaftModes
{
public static var IDLE:ShaftModes = new ShaftModes();
public static var TARGET_ACTIVATION:ShaftModes = new ShaftModes();
public static var TARGETING:ShaftModes = new ShaftModes();
public static var TARGET_DEACTIVATION:ShaftModes = new ShaftModes();
public function ShaftModes()
{
super();
}
}
}
|
package alternativa.network
{
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.net.Socket;
public class RFC2817Socket extends Socket
{
private var proxyHost:String = null;
private var host:String = null;
private var proxyPort:int = 0;
private var port:int = 0;
private var deferredEventHandlers:Object;
private var buffer:String;
public function RFC2817Socket(host:String = null, port:int = 0)
{
this.deferredEventHandlers = new Object();
this.buffer = new String();
super(host,port);
}
public function setProxyInfo(host:String, port:int) : void
{
this.proxyHost = host;
this.proxyPort = port;
var deferredSocketDataHandler:Object = this.deferredEventHandlers[ProgressEvent.SOCKET_DATA];
var deferredConnectHandler:Object = this.deferredEventHandlers[Event.CONNECT];
if(deferredSocketDataHandler != null)
{
super.removeEventListener(ProgressEvent.SOCKET_DATA,deferredSocketDataHandler.listener,deferredSocketDataHandler.useCapture);
}
if(deferredConnectHandler != null)
{
super.removeEventListener(Event.CONNECT,deferredConnectHandler.listener,deferredConnectHandler.useCapture);
}
}
override public function connect(host:String, port:int) : void
{
if(this.proxyHost == null)
{
this.redirectConnectEvent();
this.redirectSocketDataEvent();
super.connect(host,port);
}
else
{
this.host = host;
this.port = port;
super.addEventListener(Event.CONNECT,this.onConnect);
super.addEventListener(ProgressEvent.SOCKET_DATA,this.onSocketData);
super.connect(this.proxyHost,this.proxyPort);
}
}
private function onConnect(event:Event) : void
{
this.writeUTFBytes("CONNECT " + this.host + ":" + this.port + " HTTP/1.1\n\n");
this.flush();
this.redirectConnectEvent();
}
private function onSocketData(event:ProgressEvent) : void
{
while(this.bytesAvailable != 0)
{
this.buffer += this.readUTFBytes(1);
if(this.buffer.search(/\r?\n\r?\n$/) != -1)
{
this.checkResponse(event);
break;
}
}
}
private function checkResponse(event:ProgressEvent) : void
{
var ioError:IOErrorEvent = null;
var responseCode:String = this.buffer.substr(this.buffer.indexOf(" ") + 1,3);
if(responseCode.search(/^2/) == -1)
{
ioError = new IOErrorEvent(IOErrorEvent.IO_ERROR);
ioError.text = "Error connecting to the proxy [" + this.proxyHost + "] on port [" + this.proxyPort + "]: " + this.buffer;
this.dispatchEvent(ioError);
}
else
{
this.redirectSocketDataEvent();
this.dispatchEvent(new Event(Event.CONNECT));
if(this.bytesAvailable > 0)
{
this.dispatchEvent(event);
}
}
this.buffer = null;
}
private function redirectConnectEvent() : void
{
super.removeEventListener(Event.CONNECT,this.onConnect);
var deferredEventHandler:Object = this.deferredEventHandlers[Event.CONNECT];
if(deferredEventHandler != null)
{
super.addEventListener(Event.CONNECT,deferredEventHandler.listener,deferredEventHandler.useCapture,deferredEventHandler.priority,deferredEventHandler.useWeakReference);
}
}
private function redirectSocketDataEvent() : void
{
super.removeEventListener(ProgressEvent.SOCKET_DATA,this.onSocketData);
var deferredEventHandler:Object = this.deferredEventHandlers[ProgressEvent.SOCKET_DATA];
if(deferredEventHandler != null)
{
super.addEventListener(ProgressEvent.SOCKET_DATA,deferredEventHandler.listener,deferredEventHandler.useCapture,deferredEventHandler.priority,deferredEventHandler.useWeakReference);
}
}
override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0.0, useWeakReference:Boolean = false) : void
{
if(type == Event.CONNECT || type == ProgressEvent.SOCKET_DATA)
{
this.deferredEventHandlers[type] = {
"listener":listener,
"useCapture":useCapture,
"priority":priority,
"useWeakReference":useWeakReference
};
}
else
{
super.addEventListener(type,listener,useCapture,priority,useWeakReference);
}
}
}
}
|
package projects.tanks.clients.fp10.Prelauncher.locales.ES {
import projects.tanks.clients.fp10.Prelauncher.Locale;
import projects.tanks.clients.fp10.Prelauncher.controls.bottompanel.PartnerLogo.PartnerLogo;
import projects.tanks.clients.fp10.Prelauncher.locales.Locales;
import projects.tanks.clients.fp10.Prelauncher.locales.TextLinkPair;
public class LocaleES extends Locale {
public function LocaleES() {
super();
this.name = Locales.ES;
this.playText = "JUGAR";
this.exitText = "EXIT";
partners.push(PartnerLogo.FB,"https://facebook.com/TankiOnlineLATAM/");
partners.push(PartnerLogo.TWITTER,"https://twitter.com/tankionline_lat");
partners.push(PartnerLogo.YOUTUBE,"https://www.youtube.com/channel/UCslyFVwgmzkh_0H_9Cn2Wqw");
partners.push(PartnerLogo.INSTAGRAM,"http://www.instagram.com/tankionline_lat");
partners.push(PartnerLogo.TWITCH,"http://www.twitch.tv/tankionline_latam");
this.game = new TextLinkPair("Juego","http://tankionline.com/es/");
this.materials = new TextLinkPair("Recursos","http://tankionline.com/es/media/");
this.forum = new TextLinkPair("Foro","http://es.tankiforum.com/");
this.wiki = new TextLinkPair("Wiki","http://es.tankiwiki.com/");
this.ratings = new TextLinkPair("Clasificaciones","http://ratings.tankionline.com/es/");
this.help = new TextLinkPair("Ayuda","http://help.tankionline.com/es/");
this.license = new TextLinkPair("Acuerdo de licencia para el usuario final","http://tankionline.com/es/eula/");
this.aboutCompany = new TextLinkPair("©2017 Tanki Online Europe Ltd. Todos los derechos reservados.","");
this.techSupport = new TextLinkPair("Contáctenos para resolver cualquier dificultad:","");
this.email = new TextLinkPair("support@tankionline.com","mailto:support@tankionline.com");
this.rules = new TextLinkPair("Reglas del juego","http://tankionline.com/es/rules/");
this.confidentialityPolicy = new TextLinkPair("Políticas de privacidad y cookies","http://tankionline.com/es/privacy/");
}
}
}
|
package alternativa.tanks.model.payment.shop.kit {
import alternativa.tanks.gui.shop.shopitems.item.details.ShopItemDetails;
import alternativa.tanks.gui.shop.shopitems.item.kits.description.KitPackageDescriptionView;
import alternativa.tanks.model.payment.shop.ShopItemDetailsView;
import projects.tanks.client.panel.model.shop.kitpackage.IKitPackageModelBase;
import projects.tanks.client.panel.model.shop.kitpackage.KitPackageItemInfo;
import projects.tanks.client.panel.model.shop.kitpackage.KitPackageModelBase;
[ModelInfo]
public class KitPackageModel extends KitPackageModelBase implements IKitPackageModelBase, KitPackage, ShopItemDetailsView {
public function KitPackageModel() {
super();
}
public function getName() : String {
return getInitParam().name;
}
public function getItemInfos() : Vector.<KitPackageItemInfo> {
return getInitParam().itemInfos;
}
public function getDetailsView() : ShopItemDetails {
return new KitPackageDescriptionView(object);
}
public function isDetailedViewRequired() : Boolean {
return getInitParam().showDetails;
}
}
}
|
package projects.tanks.client.battlefield.gui.models.inventory
{
public interface IInventoryModelBase
{
}
}
|
package alternativa.protocol.codec.primitive {
import alternativa.protocol.ICodec;
public interface IPrimitiveCodec extends ICodec {
function nullValue() : Object;
}
}
|
package alternativa.tanks.models.weapon.machinegun.sfx {
import alternativa.engine3d.core.Object3D;
import alternativa.math.Vector3;
import alternativa.tanks.battle.scene3d.scene3dcontainer.Scene3DContainer;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.sfx.GraphicEffect;
import alternativa.tanks.sfx.StaticObject3DPositionProvider;
import alternativa.tanks.utils.objectpool.Pool;
import alternativa.tanks.utils.objectpool.PooledObject;
public class MachineGunHitEffect extends PooledObject implements GraphicEffect {
private static const DUST_SIZE:Number = 90;
private static const DUST_SPEED:Number = 200;
private static const DUST_TOP:Number = 60;
private static const DUST_INTERVAL:Number = 0.15;
private static const LIFE_TIME:Number = 0.25;
private static const EFFECT_POSITION_OBJECT:Object3D = new Object3D();
private static const EFFECT_POSITION:Vector3 = new Vector3();
private var dust:Smoke = new Smoke(DUST_SIZE,DUST_SPEED,DUST_TOP,DUST_INTERVAL);
private var crumbs:Crumbs = new Crumbs();
private var positionProvider:StaticObject3DPositionProvider;
private var time:Number;
public function MachineGunHitEffect(param1:Pool) {
super(param1);
}
public function addedToScene(param1:Scene3DContainer) : void {
this.crumbs.setContainer(param1);
this.crumbs.start();
this.dust.setContainer(param1);
this.dust.start();
}
public function init(param1:StaticObject3DPositionProvider, param2:MachineGunSFXData) : void {
this.positionProvider = param1;
param1.initPosition(EFFECT_POSITION_OBJECT);
this.dust.setAnimation(param2.dustTexture);
this.crumbs.setMaterial(param2.crumbsTexture);
this.time = 0;
}
public function play(param1:int, param2:GameCamera) : Boolean {
this.positionProvider.updateObjectPosition(EFFECT_POSITION_OBJECT,param2,param1);
this.updateEmitterPosition();
var local3:Number = param1 / 1000;
this.time += local3;
if(this.time >= LIFE_TIME) {
this.dust.stop();
this.crumbs.stop();
}
var local4:Boolean = this.dust.update(local3);
return this.crumbs.update(local3) || local4;
}
private function updateEmitterPosition() : void {
EFFECT_POSITION.x = EFFECT_POSITION_OBJECT.x;
EFFECT_POSITION.y = EFFECT_POSITION_OBJECT.y;
EFFECT_POSITION.z = EFFECT_POSITION_OBJECT.z;
this.dust.setEmitterPosition(EFFECT_POSITION);
this.crumbs.setEmitterPosition(EFFECT_POSITION);
}
public function destroy() : void {
this.dust.clear();
this.crumbs.clear();
this.positionProvider.destroy();
this.positionProvider = null;
recycle();
}
public function kill() : void {
this.dust.stop();
this.crumbs.stop();
}
}
}
|
package alternativa.tanks.bonuses {
public interface BonusController {
function start() : void;
function runBeforePhysicsUpdate(param1:Number) : void;
function interpolatePhysicsState(param1:Number) : void;
function render() : void;
}
}
|
package alternativa.tanks.model.shop.items.utils
{
public class FormatUtils
{
public function FormatUtils()
{
super();
}
public static function valueToString(param1:Number, param2:int, param3:Boolean) : String
{
if(param3)
{
param1 = Math.ceil(param1);
}
if(param1 % 1 != 0)
{
return String(param1);
}
var _loc4_:String = param1.toFixed(param2);
var _loc5_:String = "";
if(param2 > 0)
{
_loc5_ = _loc4_.substr(_loc4_.length - param2 - 1);
if(_loc5_ == ".00")
{
_loc5_ = "";
}
_loc4_ = _loc4_.substr(0,_loc4_.length - param2 - 1);
}
while(_loc4_.length > 3)
{
_loc5_ = " " + _loc4_.substr(_loc4_.length - 3,3) + _loc5_;
_loc4_ = _loc4_.substr(0,_loc4_.length - 3);
}
return _loc4_ + _loc5_;
}
}
}
|
package alternativa.tanks.model.garage.present {
import alternativa.tanks.gui.present.give.CheckUidEvent;
import alternativa.tanks.gui.present.give.PresentPrepareWindow;
import alternativa.tanks.gui.present.give.SendPresentEvent;
import alternativa.tanks.model.garage.GaragePurchaseConfirmation;
import alternativa.tanks.service.item.ItemService;
import flash.events.Event;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.garage.models.garage.present.IPresentPurchaseModelBase;
import projects.tanks.client.garage.models.garage.present.PresentPurchaseModelBase;
[ModelInfo]
public class PresentPurchaseModel extends PresentPurchaseModelBase implements IPresentPurchaseModelBase, PresentPurchase {
[Inject]
public static var itemService:ItemService;
private var uid:String;
private var text:String;
private var price:int;
private var presentPrepareWindow:PresentPrepareWindow;
private var presentItem:IGameObject;
public function PresentPurchaseModel() {
super();
}
public function preparePresent(param1:IGameObject) : void {
this.presentItem = param1;
this.presentPrepareWindow = new PresentPrepareWindow();
this.presentPrepareWindow.addEventListener(SendPresentEvent.SEND_PRESENT,getFunctionWrapper(this.onSendPresent));
this.presentPrepareWindow.addEventListener(Event.CANCEL,getFunctionWrapper(this.onCancelPresentPrepareWindow));
this.presentPrepareWindow.addEventListener(CheckUidEvent.CHECK_UID,getFunctionWrapper(this.checkUid));
}
private function onCancelPresentPrepareWindow(param1:Event) : void {
this.onClosePresentPrepareWindow();
}
private function onClosePresentPrepareWindow() : void {
this.presentPrepareWindow.removeEventListener(SendPresentEvent.SEND_PRESENT,getFunctionWrapper(this.onSendPresent));
this.presentPrepareWindow.removeEventListener(Event.CANCEL,getFunctionWrapper(this.onClosePresentPrepareWindow));
this.presentPrepareWindow.removeEventListener(CheckUidEvent.CHECK_UID,getFunctionWrapper(this.checkUid));
this.presentPrepareWindow = null;
}
private function onSendPresent(param1:SendPresentEvent) : void {
this.uid = param1.uid;
this.text = param1.text;
this.price = itemService.getPrice(this.presentItem);
this.onClosePresentPrepareWindow();
GaragePurchaseConfirmation(object.adapt(GaragePurchaseConfirmation)).showConfirmationAlert(this.price);
}
public function confirmPresentPurchase(param1:IGameObject) : void {
server.purchasePresent(this.uid,param1,this.text,this.price);
}
public function setUidAvailable(param1:Boolean) : void {
this.presentPrepareWindow.setUidAvailable(param1);
}
private function checkUid(param1:CheckUidEvent) : void {
server.checkUid(param1.uid);
}
}
}
|
package scpacker.gui
{
import controls.DefaultButton;
import controls.Label;
import controls.TankInput;
import controls.TankWindow;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.filters.BitmapFilter;
import flash.filters.BitmapFilterQuality;
import flash.filters.BlurFilter;
public class ConfirmEmailCode extends Sprite
{
private var text:String;
private var callback:Function;
private var window:TankWindow;
private var textLabel:Label;
private var codeInput:TankInput;
private var confirmButton:DefaultButton;
private var bg:Sprite;
private var bmp:Bitmap;
public function ConfirmEmailCode(text:String, callback:Function)
{
this.window = new TankWindow();
this.textLabel = new Label();
this.codeInput = new TankInput();
this.confirmButton = new DefaultButton();
this.bg = new Sprite();
this.bmp = new Bitmap();
super();
this.text = text;
this.callback = callback;
addEventListener(Event.ADDED_TO_STAGE,this.onAddedToStage);
}
private function draw() : void
{
addChild(this.bg);
this.drawBg();
addChild(this.window);
this.window.width = 400;
this.window.height = 115;
this.window.addChild(this.textLabel);
this.textLabel.text = this.text;
this.textLabel.x = 15;
this.textLabel.y = 15;
this.window.addChild(this.codeInput);
this.codeInput.maxChars = 32;
this.codeInput.x = 15;
this.codeInput.y = 35;
this.codeInput.width = this.window.width - 30;
this.window.addChild(this.confirmButton);
this.confirmButton.label = "OK";
this.confirmButton.x = this.window.width - this.confirmButton.width - 15;
this.confirmButton.y = 35 * 2;
this.confirmButton.addEventListener(MouseEvent.CLICK,this.onClickButton);
}
private function onClickButton(event:Event) : void
{
var code:String = this.codeInput.value;
if(code == null || code.length != 32 || code.length > 32)
{
this.codeInput.validValue = false;
return;
}
this.codeInput.validValue = true;
this.callback.call(null,code);
this.confirmButton.removeEventListener(MouseEvent.CLICK,this.onClickButton);
stage.removeEventListener(Event.RESIZE,this.resize);
removeChildren(0,numChildren - 1);
}
private function drawBg() : void
{
var data:BitmapData = null;
var filter:BitmapFilter = new BlurFilter(5,5,BitmapFilterQuality.HIGH);
var myFilters:Array = new Array();
myFilters.push(filter);
data = new BitmapData(stage.stageWidth,stage.stageHeight,true,0);
this.bmp.visible = false;
data.draw(stage);
this.bmp.visible = true;
this.bmp.filters = myFilters;
this.bmp.bitmapData = data;
this.bg.addChild(this.bmp);
}
private function onAddedToStage(event:Event) : void
{
this.draw();
stage.addEventListener(Event.RESIZE,this.resize);
this.resize(null);
removeEventListener(Event.ADDED_TO_STAGE,this.onAddedToStage);
}
private function resize(event:Event) : void
{
this.window.x = stage.stageWidth / 2 - this.window.width / 2;
this.window.y = stage.stageHeight / 2 - this.window.height / 2;
this.drawBg();
}
}
}
|
package projects.tanks.clients.fp10.Prelauncher.makeup {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/projects.tanks.clients.fp10.Prelauncher.makeup.MakeUp_ratingsIconMakeUp.png")]
public class MakeUp_ratingsIconMakeUp extends BitmapAsset {
public function MakeUp_ratingsIconMakeUp() {
super();
}
}
}
|
package alternativa.tanks.gui.shop.shopitems.item.kits.serverlayoutkit {
import alternativa.tanks.gui.shop.shopitems.event.ShopItemChosen;
import alternativa.tanks.gui.shop.shopitems.item.base.ShopButton;
import alternativa.tanks.gui.shop.shopitems.item.base.ShopButtonClickDisable;
import alternativa.tanks.gui.shop.shopitems.item.base.ShopButtonDiscount;
import alternativa.tanks.gui.shop.shopitems.item.utils.FormatUtils;
import alternativa.tanks.model.payment.shop.item.ShopItem;
import controls.Label;
import controls.base.LabelBase;
import flash.display.Bitmap;
import flash.events.MouseEvent;
import flash.text.TextFormat;
import platform.client.fp10.core.resource.BatchResourceLoader;
import platform.client.fp10.core.resource.Resource;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.panel.model.shop.clientlayoutkit.KitBundleViewCC;
public class KitBundleButton extends ShopButton implements ShopButtonClickDisable, ShopButtonDiscount {
private var cc:KitBundleViewCC;
protected var item:IGameObject;
private const BUNDLE_WIDTH:Number = 279;
private const BUNDLE_HEIGHT:Number = 143;
private const DEFAULT_FONT_SIZE:Number = 22;
public function KitBundleButton(param1:IGameObject, param2:KitBundleViewCC) {
super(new KitBundleSkin(param2));
this.cc = param2;
this.item = param1;
this.initImages();
addEventListener(MouseEvent.CLICK,this.onMouseClick);
}
override public function get widthInCells() : int {
return 3;
}
private function onMouseClick(param1:MouseEvent) : void {
dispatchEvent(new ShopItemChosen(this.item));
}
private function initImages() : * {
var i:* = undefined;
var image:* = undefined;
var resources:Vector.<Resource> = new Vector.<Resource>();
for(i in this.cc.imageBlocks) {
image = this.cc.imageBlocks[i].image;
if(image.isLazy && !image.isLoaded && resources.indexOf(image) < 0) {
resources.push(image);
}
}
if(resources.length > 0) {
new BatchResourceLoader(function():void {
onImageLoaded();
}).load(resources);
} else {
this.onImageLoaded();
}
}
private function onImageLoaded() : * {
var local1:* = undefined;
var local2:* = undefined;
var local3:* = undefined;
for(local1 in this.cc.imageBlocks) {
local2 = this.cc.imageBlocks[local1];
local3 = new Bitmap(local2.image.data);
local3.x = this.getXPosition(local2.positionPercentX);
local3.y = this.getYPosition(local2.positionPercentY);
addChild(local3);
}
this.initTexts();
this.initPrice();
}
private function initTexts() : * {
var local1:* = undefined;
var local2:* = undefined;
var local3:Label = null;
var local4:* = undefined;
for(local1 in this.cc.textBlocks) {
local2 = this.cc.textBlocks[local1];
local3 = new LabelBase();
local4 = this.getFontSize(local2.fontPercentSize);
local3.color = local2.color;
local3.size = local4;
local3.bold = true;
local3.setTextFormat(new TextFormat());
local3.text = local2.text;
local3.mouseEnabled = false;
local3.x = this.getXPosition(local2.positionPercentX);
local3.y = this.getYPosition(local2.positionPercentY) - local3.height + local4;
addChild(local3);
}
}
private function initPrice() : * {
var local1:Label = new LabelBase();
local1.color = this.cc.priceLabelColor;
var local2:Number = this.getFontSize(this.cc.priceLabelFontPercentSize);
local1.size = local2;
local1.bold = true;
local1.htmlText = this.getPriceLabelText();
local1.mouseEnabled = false;
local1.x = this.getXPosition(this.cc.priceLabelPositionPercentX);
local1.y = this.getYPosition(this.cc.priceLabelPositionPercentY) - local1.height + local2;
addChild(local1);
}
protected function get shopItem() : ShopItem {
return ShopItem(this.item.adapt(ShopItem));
}
private function getPriceLabelText() : String {
return this.getFormattedPriceText(this.getPriceWithDiscount()) + " " + this.shopItem.getCurrencyName();
}
private function getFormattedPriceText(param1:Number) : String {
return FormatUtils.valueToString(param1,this.shopItem.getCurrencyRoundingPrecision(),false);
}
protected function getPriceWithDiscount() : Number {
return this.shopItem.getPriceWithDiscount();
}
private function getFontSize(param1:int) : Number {
return param1 == int.MIN_VALUE ? this.DEFAULT_FONT_SIZE : this.DEFAULT_FONT_SIZE * param1 / 100;
}
private function getYPosition(param1:int) : Number {
return this.BUNDLE_HEIGHT * param1 / 100;
}
private function getXPosition(param1:int) : Number {
return (this.BUNDLE_WIDTH + 2) * this.widthInCells * param1 / 100;
}
public function disableClick() : * {
alpha = 0.9;
mouseEnabled = false;
}
public function applyPayModeDiscountAndUpdatePriceLabel(param1:IGameObject) : void {
}
}
}
|
package alternativa.tanks.gui.panel.buttons {
import flash.display.Bitmap;
public class MainPanelOrangeWideButton extends MainPanelWideButton {
private static const buttonNormal:Class = MainPanelOrangeWideButton_buttonNormal;
private static const buttonNormalBitmap:Bitmap = new buttonNormal();
private static const buttonOver:Class = MainPanelOrangeWideButton_buttonOver;
private static const buttonOverBitmap:Bitmap = new buttonOver();
public function MainPanelOrangeWideButton(param1:Bitmap, param2:int, param3:int) {
super(param1,param2,param3,buttonOverBitmap,buttonNormalBitmap);
}
}
}
|
package projects.tanks.clients.flash.commons.services.payment {
import flash.events.IEventDispatcher;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.commons.types.ShopCategoryEnum;
public interface PaymentDisplayService extends IEventDispatcher {
function openPayment() : void;
function openPaymentAt(param1:ShopCategoryEnum) : void;
function openPaymentForGarageItem(param1:IGameObject) : void;
function openPaymentForShopItem(param1:IGameObject) : void;
function closePayment() : void;
function loadPayment() : void;
function reloadPayment() : void;
function handlePaymentLoadingComplete() : void;
function handlePaymentUnloadingComplete() : void;
function isPaymentDisplayed() : Boolean;
}
}
|
package alternativa.tanks.view.icons {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.view.icons.BattleParamsCheckButtonIcons_suppliesClass.png")]
public class BattleParamsCheckButtonIcons_suppliesClass extends BitmapAsset {
public function BattleParamsCheckButtonIcons_suppliesClass() {
super();
}
}
}
|
package projects.tanks.clients.tankslauncershared.dishonestprogressbar {
import mx.core.BitmapAsset;
[Embed(source="/_assets/projects.tanks.clients.tankslauncershared.dishonestprogressbar.LoadingLabel_loadingLabelDeClass.png")]
public class LoadingLabel_loadingLabelDeClass extends BitmapAsset {
public function LoadingLabel_loadingLabelDeClass() {
super();
}
}
}
|
package alternativa.osgi.service.network
{
public interface INetworkService
{
function addEventListener(param1:INetworkListener) : void;
function removeEventListener(param1:INetworkListener) : void;
function get server() : String;
function get ports() : Array;
function get resourcesPath() : String;
function get proxyHost() : String;
function get proxyPort() : int;
}
}
|
package alternativa.tanks.models.weapon.rocketlauncher.radio {
import flash.events.Event;
public class RocketExplodeEvent extends Event {
public static var ALL:* = "ROCKET_EXPLODE_ALL_EVENT";
public static var SINGLE:* = "ROCKET_EXPLODE_SINGLE_EVENT";
public var rocketId:int = 0;
public function RocketExplodeEvent(param1:String, param2:int = 0) {
super(param1);
this.rocketId = param2;
}
}
}
|
package alternativa.tanks.models.clan.accepted {
import alternativa.tanks.gui.clanmanagement.ClanManagementPanel;
import alternativa.tanks.models.service.ClanService;
import alternativa.types.Long;
import projects.tanks.client.clans.clan.accepted.ClanAcceptedModelBase;
import projects.tanks.client.clans.clan.accepted.IClanAcceptedModelBase;
[ModelInfo]
public class ClanAcceptedModel extends ClanAcceptedModelBase implements IClanAcceptedModel, IClanAcceptedModelBase {
[Inject]
public static var clanService:ClanService;
public function ClanAcceptedModel() {
super();
}
public function onAdding(param1:Long) : void {
if(this.getManagementPanel() != null) {
this.getManagementPanel().addingAcceptedUser(param1);
}
}
public function onRemoved(param1:Long) : void {
if(this.getManagementPanel() != null) {
this.getManagementPanel().removeAcceptedUser(param1);
}
}
public function getAcceptedUsers() : Vector.<Long> {
return getInitParam().objects;
}
private function getManagementPanel() : ClanManagementPanel {
return clanService.clanManagementPanel;
}
}
}
|
package alternativa.tanks.battle.objects.tank {
import alternativa.math.Quaternion;
import alternativa.math.Vector3;
import alternativa.physics.Body;
import alternativa.physics.BodyState;
import alternativa.tanks.battle.events.BattleEventDispatcher;
import alternativa.tanks.utils.DataValidationErrorEvent;
import alternativa.tanks.utils.DataValidatorType;
import alternativa.tanks.utils.EncryptedNumber;
import alternativa.tanks.utils.EncryptedNumberImpl;
public class BodyPhysicsStateValidator {
private const hash:EncryptedNumber = new EncryptedNumberImpl();
private const cx:EncryptedNumber = new EncryptedNumberImpl(Math.random() + 1);
private const cy:EncryptedNumber = new EncryptedNumberImpl(Math.random() + 1);
private const cz:EncryptedNumber = new EncryptedNumberImpl(Math.random() + 1);
private const cw:EncryptedNumber = new EncryptedNumberImpl(Math.random() + 1);
private var body:Body;
private const prevPosition:Vector3 = new Vector3();
private const prevOrientation:Quaternion = new Quaternion();
private var eventDispatcher:BattleEventDispatcher;
public function BodyPhysicsStateValidator(param1:Body, param2:BattleEventDispatcher) {
super();
this.body = param1;
this.eventDispatcher = param2;
this.refresh();
}
public function refresh() : void {
var local1:BodyState = this.body.state;
var local2:Vector3 = local1.position;
var local3:Quaternion = local1.orientation;
var local4:Number = Number(this.cx.getNumber());
var local5:Number = Number(this.cy.getNumber());
var local6:Number = Number(this.cz.getNumber());
this.hash.setNumber(local4 * local2.x + local5 * local2.y + local6 * local2.z + local4 * local3.x + local5 * local3.y + local6 * local3.z + this.cw.getNumber() * local3.w);
this.prevPosition.copy(local2);
this.prevOrientation.copy(local3);
}
public function validate() : void {
var local1:BodyState = this.body.state;
var local2:Vector3 = local1.position;
var local3:Quaternion = local1.orientation;
var local4:Number = Number(this.cx.getNumber());
var local5:Number = Number(this.cy.getNumber());
var local6:Number = Number(this.cz.getNumber());
var local7:Number = local4 * local2.x + local5 * local2.y + local6 * local2.z + local4 * local3.x + local5 * local3.y + local6 * local3.z + this.cw.getNumber() * local3.w;
if(local7 != this.hash.getNumber()) {
this.eventDispatcher.dispatchEvent(new DataValidationErrorEvent(DataValidatorType.TANK_POSITION));
}
}
}
}
|
package _codec.projects.tanks.client.battlefield.models.tankparts.sfx.shoot.ricochet {
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.TypeCodecInfo;
import platform.client.fp10.core.resource.types.MultiframeTextureResource;
import platform.client.fp10.core.resource.types.SoundResource;
import platform.client.fp10.core.resource.types.TextureResource;
import projects.tanks.client.battlefield.models.tankparts.sfx.lighting.entity.LightingSFXEntity;
import projects.tanks.client.battlefield.models.tankparts.sfx.shoot.ricochet.RicochetSFXCC;
public class CodecRicochetSFXCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_bumpFlashTexture:ICodec;
private var codec_explosionTexture:ICodec;
private var codec_explostinSound:ICodec;
private var codec_lightingSFXEntity:ICodec;
private var codec_ricochetSound:ICodec;
private var codec_shotFlashTexture:ICodec;
private var codec_shotSound:ICodec;
private var codec_shotTexture:ICodec;
private var codec_tailTrailTexutre:ICodec;
public function CodecRicochetSFXCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_bumpFlashTexture = param1.getCodec(new TypeCodecInfo(MultiframeTextureResource,false));
this.codec_explosionTexture = param1.getCodec(new TypeCodecInfo(MultiframeTextureResource,false));
this.codec_explostinSound = param1.getCodec(new TypeCodecInfo(SoundResource,false));
this.codec_lightingSFXEntity = param1.getCodec(new TypeCodecInfo(LightingSFXEntity,false));
this.codec_ricochetSound = param1.getCodec(new TypeCodecInfo(SoundResource,false));
this.codec_shotFlashTexture = param1.getCodec(new TypeCodecInfo(TextureResource,false));
this.codec_shotSound = param1.getCodec(new TypeCodecInfo(SoundResource,false));
this.codec_shotTexture = param1.getCodec(new TypeCodecInfo(MultiframeTextureResource,false));
this.codec_tailTrailTexutre = param1.getCodec(new TypeCodecInfo(TextureResource,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:RicochetSFXCC = new RicochetSFXCC();
local2.bumpFlashTexture = this.codec_bumpFlashTexture.decode(param1) as MultiframeTextureResource;
local2.explosionTexture = this.codec_explosionTexture.decode(param1) as MultiframeTextureResource;
local2.explostinSound = this.codec_explostinSound.decode(param1) as SoundResource;
local2.lightingSFXEntity = this.codec_lightingSFXEntity.decode(param1) as LightingSFXEntity;
local2.ricochetSound = this.codec_ricochetSound.decode(param1) as SoundResource;
local2.shotFlashTexture = this.codec_shotFlashTexture.decode(param1) as TextureResource;
local2.shotSound = this.codec_shotSound.decode(param1) as SoundResource;
local2.shotTexture = this.codec_shotTexture.decode(param1) as MultiframeTextureResource;
local2.tailTrailTexutre = this.codec_tailTrailTexutre.decode(param1) as TextureResource;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:RicochetSFXCC = RicochetSFXCC(param2);
this.codec_bumpFlashTexture.encode(param1,local3.bumpFlashTexture);
this.codec_explosionTexture.encode(param1,local3.explosionTexture);
this.codec_explostinSound.encode(param1,local3.explostinSound);
this.codec_lightingSFXEntity.encode(param1,local3.lightingSFXEntity);
this.codec_ricochetSound.encode(param1,local3.ricochetSound);
this.codec_shotFlashTexture.encode(param1,local3.shotFlashTexture);
this.codec_shotSound.encode(param1,local3.shotSound);
this.codec_shotTexture.encode(param1,local3.shotTexture);
this.codec_tailTrailTexutre.encode(param1,local3.tailTrailTexutre);
}
}
}
|
package alternativa.tanks.materials
{
import alternativa.engine3d.core.ShadowMap;
import alternativa.gfx.agal.FragmentShader;
import alternativa.gfx.agal.SamplerDim;
import alternativa.gfx.agal.SamplerFilter;
import alternativa.gfx.agal.SamplerMipMap;
import alternativa.gfx.agal.SamplerRepeat;
import alternativa.gfx.agal.SamplerType;
public class PaintFragmentShader extends FragmentShader
{
public function PaintFragmentShader(param1:Boolean, param2:Boolean, param3:Boolean, param4:Boolean, param5:Boolean, param6:Boolean, param7:Boolean, param8:Boolean, param9:Boolean, param10:Boolean, param11:Boolean, param12:Boolean, param13:Boolean, param14:Boolean, param15:Boolean, param16:Boolean, param17:Boolean, param18:Boolean)
{
var _loc23_:int = 0;
super();
var _loc19_:SamplerRepeat = !!param1 ? SamplerRepeat.WRAP : SamplerRepeat.CLAMP;
var _loc20_:SamplerFilter = !!param2 ? SamplerFilter.LINEAR : SamplerFilter.NEAREST;
var _loc21_:SamplerMipMap = !!param3 ? (!!param2 ? SamplerMipMap.LINEAR : SamplerMipMap.NEAREST) : SamplerMipMap.NONE;
var _loc22_:SamplerType = !!param4 ? SamplerType.DXT1 : SamplerType.RGBA;
tex(ft0,v6,fs4.dim(SamplerDim.D2).repeat(_loc19_).filter(_loc20_).mipmap(_loc21_).type(_loc22_));
tex(ft1,v0,fs6.dim(SamplerDim.D2).repeat(_loc19_).filter(_loc20_).mipmap(_loc21_).type(_loc22_));
mul(ft2,ft0,ft1);
mul(ft2,fc[23].w,ft2);
sub(ft3,fc[23].z,ft0);
sub(ft4,fc[23].z,ft1);
mul(ft3,fc[23].w,ft3);
mul(ft3,ft3,ft4);
sub(ft3,fc[23].z,ft3);
sge(ft4.x,ft1.x,fc[23].z);
sub(ft4.y,fc[23].z,ft4.x);
mul(ft5,ft4.x,ft3);
mul(ft6,ft4.y,ft2);
add(ft0,ft5,ft6);
mov(ft0.w,ft1.w);
tex(ft1,v0,fs0.dim(SamplerDim.D2).repeat(_loc19_).filter(_loc20_).mipmap(_loc21_).type(_loc22_));
sub(ft2.w,fc[23].z,ft1.w);
mul(ft0.x,ft0.x,ft2.w);
mul(ft0.y,ft0.y,ft2.w);
mul(ft0.z,ft0.z,ft2.w);
add(ft0.xyz,ft0.xyz,ft1.xyz);
mov(ft1,fc[23].x);
mov(ft2,fc[23].x);
mov(ft3,fc[23].x);
mov(ft4,fc[23].x);
mov(ft5,fc[23].x);
mov(ft6,fc[23].x);
if(param5)
{
sub(ft1.w,ft0,fc[14]);
kil(ft1.w);
}
if(param6)
{
add(ft1.w,ft0,fc[18]);
div(ft0.xyz,ft0,ft1.w);
}
if(param7)
{
mul(ft0.xyz,ft0,fc[0]);
add(ft0.xyz,ft0,fc[1]);
}
if(param8)
{
mul(ft0.w,ft0,fc[0]);
}
if(param9)
{
abs(ft1,v0.z);
sat(ft1,ft1);
sub(ft1,fc[17],ft1);
mul(ft0.w,ft0,ft1);
}
if(param11 || param12 || param13 || param15)
{
div(ft4,v1,v1.z);
mul(ft4.xy,ft4,fc[18]);
add(ft4.xy,ft4,fc[18]);
}
if(param11 || param12 || param13)
{
mul(ft3,ft4,fc[4]);
}
if(param11 || param12)
{
tex(ft1,ft3,fs1.dim(SamplerDim.D2).repeat(SamplerRepeat.CLAMP).filter(SamplerFilter.NEAREST).mipmap(SamplerMipMap.NONE));
}
if(param13)
{
tex(ft6,ft3,fs5.dim(SamplerDim.D2).repeat(SamplerRepeat.CLAMP).filter(SamplerFilter.NEAREST).mipmap(SamplerMipMap.NONE));
}
if(param11)
{
dp3(ft2,ft1,fc[17]);
sub(ft2,ft2,v1);
abs(ft2,ft2);
div(ft2,ft2,fc[14]);
sat(ft2,ft2);
mul(ft0.w,ft0,ft2.z);
}
if(param12)
{
mul(ft2,fc[12],ft1.w);
sub(ft2,fc[17].w,ft2);
mul(ft0.xyz,ft0,ft2);
}
if(param15)
{
mov(ft5,fc[5]);
mul(ft5.z,ft5,v2);
mul(ft3,ft4,fc[7]);
tex(ft1,ft3,fs3.dim(SamplerDim.D2).repeat(SamplerRepeat.WRAP).filter(SamplerFilter.NEAREST).mipmap(SamplerMipMap.NONE));
mul(ft1.z,ft1,fc[6]);
mul(ft2,ft1.z,ft1);
_loc23_ = 0;
while(_loc23_ < ShadowMap.numSamples)
{
if(_loc23_ == 0)
{
add(ft1,ft2,v2);
tex(ft1,ft1,fs2.dim(SamplerDim.D2).repeat(SamplerRepeat.CLAMP).filter(SamplerFilter.NEAREST).mipmap(SamplerMipMap.NONE));
dp3(ft1,ft1,ft5);
sat(ft1,ft1);
mov(ft4,ft1);
}
else
{
if(_loc23_ % 2 > 0)
{
dp3(ft3.x,ft2,fc[8]);
dp3(ft3.y,ft2,fc[9]);
add(ft1,ft3,v2);
}
else
{
dp3(ft2.x,ft3,fc[8]);
dp3(ft2.y,ft3,fc[9]);
add(ft1,ft2,v2);
}
tex(ft1,ft1,fs2.dim(SamplerDim.D2).repeat(SamplerRepeat.CLAMP).filter(SamplerFilter.NEAREST).mipmap(SamplerMipMap.NONE));
dp3(ft1,ft1,ft5);
sat(ft1,ft1);
add(ft4,ft4,ft1);
}
_loc23_++;
}
mul(ft2,ft4,fc[6]);
sat(ft1,v2);
mul(ft2,ft2,ft1);
mul(ft2.w,ft2,fc[7]);
}
if(param10)
{
if(param15)
{
sat(ft1,v1);
max(ft2,ft2,ft1);
}
else
{
sat(ft2,v1);
}
}
if(param15 || param10)
{
sub(ft2,fc[17],ft2);
mul(ft2,fc[10],ft2.w);
add(ft2,ft2,fc[11]);
if(param13)
{
add(ft6,ft6,ft6);
add(ft2,ft2,ft6);
}
else if(param14)
{
add(ft2,ft2,fc[13]);
}
mul(ft0.xyz,ft0,ft2);
}
else if(param13)
{
add(ft2,ft6,ft6);
mul(ft0.xyz,ft0,ft2);
}
else if(param14)
{
mul(ft0.xyz,ft0,fc[13]);
}
if(param16)
{
if(param17)
{
mul(ft0.xyz,ft0,fc[13].w);
add(ft0.xyz,ft0,fc[13]);
}
else
{
sat(ft1,v0);
mul(ft1,ft1,fc[2]);
if(param18)
{
sub(ft1,fc[17],ft1);
mul(ft0.w,ft0,ft1);
}
else
{
mul(ft1.xyz,fc[2],ft1.w);
sub(ft1.w,fc[17],ft1);
mul(ft0.xyz,ft0,ft1.w);
add(ft0.xyz,ft0,ft1);
}
}
}
mov(oc,ft0);
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.