[Sandy] [sandy commit] r975 - - fixed maxcar demo (AS3 version is fine).
Russell Weir
damonsbane at gmail.com
Sun Mar 15 11:32:12 PST 2009
Yeah, go ahead. I'll take care of any merge problems, and I don't think
there will be many, as it's mostly additional classes on my end.
R
On Sun, Mar 15, 2009 at 11:59 AM, Niel Drummond <
niel.drummond at grumpytoad.org> wrote:
> Russell Weir wrote:
>
>> Did you do these changes in trunk as well, on your machine?
>>
>>
> not yet... there are a number of bug fixing patches that are waiting to be
> merged pending your changes for MD3. let me know if you'd prefer i commit
> now.
>
> - Niel
>
> On Sun, Mar 15, 2009 at 5:31 AM, <codesite-noreply at google.com> wrote:
>>
>>
>>
>>> Author: cyanescent
>>> Date: Sun Mar 15 05:12:04 2009
>>> New Revision: 975
>>>
>>> Modified:
>>> trunk/sandy/haxe/branches/3.1/src/sandy/parser/Parser3DS.hx
>>> trunk/sandy/haxe/branches/3.1/src/sandy/parser/Parser3DSChunkTypes.hx
>>>
>>> Log:
>>> - fixed maxcar demo (AS3 version is fine).
>>> - small optimisations on 3DS parser.
>>>
>>>
>>>
>>> Modified: trunk/sandy/haxe/branches/3.1/src/sandy/parser/Parser3DS.hx
>>>
>>>
>>> ==============================================================================
>>> --- trunk/sandy/haxe/branches/3.1/src/sandy/parser/Parser3DS.hx
>>> (original)
>>> +++ trunk/sandy/haxe/branches/3.1/src/sandy/parser/Parser3DS.hx Sun Mar
>>> 15
>>> 05:12:04 2009
>>> @@ -36,7 +36,6 @@
>>>
>>> class Parser3DS extends AParser, implements IParser
>>> {
>>> - private var _rot_m:Array<Matrix4>;
>>> private var currentObjectName:String;
>>> private var data:ByteArray;
>>> /*private var _animation:Hash<Keyframer>;*/
>>> @@ -47,7 +46,7 @@
>>> private var textureFileNames:Hash<String>;
>>> private var currentMaterialName:String;
>>> private var currentMeshMaterialName:String;
>>> - private var currentMeshMaterialsMap:Array<Array<Dynamic>>;
>>> + private var currentMeshMaterialsMap:Array<haxe.FastList<String>>;
>>>
>>> /**
>>> * Creates a new Parser3DS instance.
>>> @@ -78,7 +77,6 @@
>>> data.endian = Endian.LITTLE_ENDIAN;
>>> // --
>>> var currentObjectName:String = null;
>>> - var _rot_m:Array<Matrix4> = new Array();
>>> /* var ad:Array = new Array(); */
>>> var pi180:Float = 180 / Math.PI;
>>> // --
>>> @@ -123,10 +121,11 @@
>>> currentMeshMaterialName =
>>> readString
>>> ();
>>> //trace ("currentMeshMaterialName <- " + currentMeshMaterialName);
>>> // this chunk has face list
>>> - var faceList:Array<Dynamic> = [
>>> currentMeshMaterialName ];
>>> + var
>>> faceList:haxe.FastList<String>
>>> = new haxe.FastList<String>();
>>> + faceList.add(
>>> currentMeshMaterialName );
>>> var numFaces:Int =
>>> data.readUnsignedShort();
>>> for (f in 0...numFaces) {
>>> - faceList.push
>>> (data.readUnsignedShort());
>>> + faceList.add
>>> (Std.string(data.readUnsignedShort()));
>>> }
>>> currentMeshMaterialsMap.push
>>> (faceList);
>>>
>>> @@ -142,13 +141,14 @@
>>> if
>>> (currentMeshMaterialsMap.length < 2) {
>>> // 1 or less
>>> materials
>>> if
>>> (textureFileNames.exists(currentMeshMaterialName))
>>> -
>>> applyTextureToShape(l_oShape, textureFileNames
>>> .get(currentMeshMaterialName));
>>> +
>>> applyTextureToShape(l_oShape,
>>> textureFileNames.get(currentMeshMaterialName));
>>> } else {
>>> // multiple
>>> materials per shape
>>> for (faceList1 in
>>> currentMeshMaterialsMap) {
>>> -
>>> if(textureFileNames.exists(Std.string(faceList1[0]))) {
>>> -
>>> for
>>> (p1 in 1...faceList1.length) {
>>> -
>>> applyTextureToShape(l_oShape.aPolygons[faceList1[p1]],
>>> textureFileNames.get(faceList1[0]));
>>> +
>>> if(textureFileNames.exists(faceList1.first())) {
>>> +
>>> faceList1.pop();
>>> +
>>> for
>>> (p1 in faceList1) {
>>> +
>>> applyTextureToShape(l_oShape.aPolygons[Std.parseInt(p1)],
>>> textureFileNames.get(faceList1.first()));
>>> }
>>> }
>>> }
>>> @@ -254,7 +254,10 @@
>>> // occasionally parser creates empty shapes here
>>> if (l_oGeometry.aFacesVertexID.length > 0) {
>>> l_oShape = new Shape3D( currentObjectName,
>>> l_oGeometry, l_oAppearance);
>>> - if( l_oMatrix != null) _applyMatrixToShape(
>>> l_oShape, l_oMatrix );
>>> +
>>> + // AS3 <-> haXe discrepency, fix for maxcar demo
>>> + //if( l_oMatrix != null) _applyMatrixToShape(
>>> l_oShape, l_oMatrix );
>>> +
>>> m_oGroup.addChild( l_oShape );
>>> if (currentMeshMaterialsMap.length < 2) {
>>> // 1 or less materials
>>> @@ -263,9 +266,10 @@
>>> } else {
>>> // multiple materials per shape
>>> for(faceList2 in currentMeshMaterialsMap) {
>>> - if
>>> (textureFileNames.exists(Std.string(faceList2[0]))) {
>>> - for (p2 in
>>> 1...faceList2.length) {
>>> -
>>> applyTextureToShape(l_oShape.aPolygons[faceList2[p2]],
>>> textureFileNames.get(Std.string(faceList2[0])));
>>> + if
>>> (textureFileNames.exists(faceList2.first())) {
>>> + faceList2.pop();
>>> + for (p2 in faceList2) {
>>> +
>>> applyTextureToShape(l_oShape.aPolygons[Std.parseInt(p2)],
>>> textureFileNames.get(Std.string(faceList2.first())));
>>> }
>>> }
>>> }
>>>
>>> Modified:
>>> trunk/sandy/haxe/branches/3.1/src/sandy/parser/Parser3DSChunkTypes.hx
>>>
>>>
>>> ==============================================================================
>>> --- trunk/sandy/haxe/branches/3.1/src/sandy/parser/Parser3DSChunkTypes.hx
>>> (original)
>>> +++ trunk/sandy/haxe/branches/3.1/src/sandy/parser/Parser3DSChunkTypes.hx
>>> Sun Mar 15 05:12:04 2009
>>> @@ -17,104 +17,104 @@
>>> {
>>> //>------ primary chunk
>>>
>>> - public static var MAIN3DS :Int = 0x4D4D;
>>> + public static inline var MAIN3DS :Int = 0x4D4D;
>>>
>>> - public static var EDIT3DS :Int = 0x3D3D; // this is the
>>> start of the editor config
>>> - public static var KEYF3DS :Int = 0xB000; // this is the
>>> start of the keyframer config
>>> + public static inline var EDIT3DS :Int = 0x3D3D; // this is
>>> the start of the editor config
>>> + public static inline var KEYF3DS :Int = 0xB000; // this is
>>> the start of the keyframer config
>>>
>>> //>------ sub defines of EDIT3DS
>>>
>>> - public static var EDIT_MATERIAL :Int = 0xAFFF;
>>> - public static var EDIT_CONFIG1 :Int = 0x0100;
>>> - public static var EDIT_CONFIG2 :Int = 0x3E3D;
>>> - public static var EDIT_VIEW_P1 :Int = 0x7012;
>>> - public static var EDIT_VIEW_P2 :Int = 0x7011;
>>> - public static var EDIT_VIEW_P3 :Int = 0x7020;
>>> - public static var EDIT_VIEW1 :Int = 0x7001;
>>> - public static var EDIT_BACKGR :Int = 0x1200;
>>> - public static var EDIT_AMBIENT :Int = 0x2100;
>>> - public static var EDIT_OBJECT :Int = 0x4000;
>>> -
>>> - public static var EDIT_UNKNW01 :Int = 0x1100;
>>> - public static var EDIT_UNKNW02 :Int = 0x1201;
>>> - public static var EDIT_UNKNW03 :Int = 0x1300;
>>> - public static var EDIT_UNKNW04 :Int = 0x1400;
>>> - public static var EDIT_UNKNW05 :Int = 0x1420;
>>> - public static var EDIT_UNKNW06 :Int = 0x1450;
>>> - public static var EDIT_UNKNW07 :Int = 0x1500;
>>> - public static var EDIT_UNKNW08 :Int = 0x2200;
>>> - public static var EDIT_UNKNW09 :Int = 0x2201;
>>> - public static var EDIT_UNKNW10 :Int = 0x2210;
>>> - public static var EDIT_UNKNW11 :Int = 0x2300;
>>> - public static var EDIT_UNKNW12 :Int = 0x2302;
>>> - public static var EDIT_UNKNW13 :Int = 0x3000;
>>> - public static var EDIT_UNKNW14 :Int = 0xAFFF;
>>> + public static inline var EDIT_MATERIAL :Int = 0xAFFF;
>>> + public static inline var EDIT_CONFIG1 :Int = 0x0100;
>>> + public static inline var EDIT_CONFIG2 :Int = 0x3E3D;
>>> + public static inline var EDIT_VIEW_P1 :Int = 0x7012;
>>> + public static inline var EDIT_VIEW_P2 :Int = 0x7011;
>>> + public static inline var EDIT_VIEW_P3 :Int = 0x7020;
>>> + public static inline var EDIT_VIEW1 :Int = 0x7001;
>>> + public static inline var EDIT_BACKGR :Int = 0x1200;
>>> + public static inline var EDIT_AMBIENT :Int = 0x2100;
>>> + public static inline var EDIT_OBJECT :Int = 0x4000;
>>> +
>>> + public static inline var EDIT_UNKNW01 :Int = 0x1100;
>>> + public static inline var EDIT_UNKNW02 :Int = 0x1201;
>>> + public static inline var EDIT_UNKNW03 :Int = 0x1300;
>>> + public static inline var EDIT_UNKNW04 :Int = 0x1400;
>>> + public static inline var EDIT_UNKNW05 :Int = 0x1420;
>>> + public static inline var EDIT_UNKNW06 :Int = 0x1450;
>>> + public static inline var EDIT_UNKNW07 :Int = 0x1500;
>>> + public static inline var EDIT_UNKNW08 :Int = 0x2200;
>>> + public static inline var EDIT_UNKNW09 :Int = 0x2201;
>>> + public static inline var EDIT_UNKNW10 :Int = 0x2210;
>>> + public static inline var EDIT_UNKNW11 :Int = 0x2300;
>>> + public static inline var EDIT_UNKNW12 :Int = 0x2302;
>>> + public static inline var EDIT_UNKNW13 :Int = 0x3000;
>>> + public static inline var EDIT_UNKNW14 :Int = 0xAFFF;
>>>
>>> //>------ sub defines of EDIT_OBJECT
>>> - public static var OBJ_TRIMESH :Int = 0x4100;
>>> - public static var OBJ_LIGHT :Int = 0x4600;
>>> - public static var OBJ_CAMERA :Int = 0x4700;
>>> + public static inline var OBJ_TRIMESH :Int = 0x4100;
>>> + public static inline var OBJ_LIGHT :Int = 0x4600;
>>> + public static inline var OBJ_CAMERA :Int = 0x4700;
>>>
>>> - public static var OBJ_UNKNWN01 :Int = 0x4010;
>>> - public static var OBJ_UNKNWN02 :Int = 0x4012; //>>---- Could be
>>> shadow
>>> + public static inline var OBJ_UNKNWN01 :Int = 0x4010;
>>> + public static inline var OBJ_UNKNWN02 :Int = 0x4012; //>>----
>>> Could be shadow
>>>
>>> // MAP_TEXFLNM is part of MAT_TEXMAP, MAT_TEXMAP is part of
>>> EDIT_MATERIAL
>>> - public static var MAT_NAME :Int = 0xA000;
>>> - public static var MAT_TEXMAP :Int = 0xA200;
>>> - public static var MAT_TEXFLNM :Int = 0xA300;
>>> + public static inline var MAT_NAME :Int = 0xA000;
>>> + public static inline var MAT_TEXMAP :Int = 0xA200;
>>> + public static inline var MAT_TEXFLNM :Int = 0xA300;
>>>
>>> //>------ sub defines of OBJ_CAMERA
>>> - public static var CAM_UNKNWN01 :Int = 0x4710;
>>> - public static var CAM_UNKNWN02 :Int = 0x4720;
>>> + public static inline var CAM_UNKNWN01 :Int = 0x4710;
>>> + public static inline var CAM_UNKNWN02 :Int = 0x4720;
>>>
>>> //>------ sub defines of OBJ_LIGHT
>>> - public static var LIT_OFF :Int = 0x4620;
>>> - public static var LIT_SPOT :Int = 0x4610;
>>> - public static var LIT_UNKNWN01 :Int = 0x465A;
>>> + public static inline var LIT_OFF :Int = 0x4620;
>>> + public static inline var LIT_SPOT :Int = 0x4610;
>>> + public static inline var LIT_UNKNWN01 :Int = 0x465A;
>>>
>>> //>------ sub defines of OBJ_TRIMESH
>>> - public static var TRI_VERTEXL :Int = 0x4110;
>>> - public static var TRI_FACEL2 :Int = 0x4111;
>>> - public static var TRI_FACEL1 :Int = 0x4120;
>>> - public static var TRI_MATERIAL:Int = 0x4130;
>>> - public static var TRI_TEXCOORD :Int = 0x4140; // DAS 11-26-04
>>> - public static var TRI_SMOOTH :Int = 0x4150;
>>> - public static var TRI_LOCAL :Int = 0x4160;
>>> - public static var TRI_VISIBLE :Int = 0x4165;
>>> + public static inline var TRI_VERTEXL :Int = 0x4110;
>>> + public static inline var TRI_FACEL2 :Int = 0x4111;
>>> + public static inline var TRI_FACEL1 :Int = 0x4120;
>>> + public static inline var TRI_MATERIAL:Int = 0x4130;
>>> + public static inline var TRI_TEXCOORD :Int = 0x4140; // DAS
>>> 11-26-04
>>> + public static inline var TRI_SMOOTH :Int = 0x4150;
>>> + public static inline var TRI_LOCAL :Int = 0x4160;
>>> + public static inline var TRI_VISIBLE :Int = 0x4165;
>>>
>>>
>>> //>>------ sub defs of KEYF3DS
>>>
>>> - public static var KEYF_UNKNWN01 :Int = 0xB009;
>>> - public static var KEYF_UNKNWN02 :Int = 0xB00A;
>>> - public static var KEYF_FRAMES :Int = 0xB008;
>>> - public static var KEYF_OBJDES :Int = 0xB002;
>>> + public static inline var KEYF_UNKNWN01 :Int = 0xB009;
>>> + public static inline var KEYF_UNKNWN02 :Int = 0xB00A;
>>> + public static inline var KEYF_FRAMES :Int = 0xB008;
>>> + public static inline var KEYF_OBJDES :Int = 0xB002;
>>>
>>> //>>------ FRAMES INFO
>>> - public static var NODE_ID :Int = 0xB030;
>>> - public static var NODE_HDR :Int = 0xB010;
>>> - public static var PIVOT :Int = 0xB013;
>>> - public static var POS_TRACK_TAG :Int = 0xB020;
>>> - public static var ROT_TRACK_TAG :Int = 0xB021;
>>> - public static var SCL_TRACK_TAG :Int = 0xB022;
>>> + public static inline var NODE_ID :Int = 0xB030;
>>> + public static inline var NODE_HDR :Int = 0xB010;
>>> + public static inline var PIVOT :Int = 0xB013;
>>> + public static inline var POS_TRACK_TAG :Int = 0xB020;
>>> + public static inline var ROT_TRACK_TAG :Int = 0xB021;
>>> + public static inline var SCL_TRACK_TAG :Int = 0xB022;
>>>
>>> //>>------ these define the different color chunk types
>>> - public static var COL_RGB :Int = 0x0010;
>>> - public static var COL_TRU :Int = 0x0011;
>>> - public static var COL_UNK :Int = 0x0013;
>>> + public static inline var COL_RGB :Int = 0x0010;
>>> + public static inline var COL_TRU :Int = 0x0011;
>>> + public static inline var COL_UNK :Int = 0x0013;
>>>
>>> //>>------ defines for viewport chunks
>>>
>>> - public static var TOP :Int = 0x0001;
>>> - public static var BOTTOM :Int = 0x0002;
>>> - public static var LEFT :Int = 0x0003;
>>> - public static var RIGHT :Int = 0x0004;
>>> - public static var FRONT :Int = 0x0005;
>>> - public static var BACK :Int = 0x0006;
>>> - public static var USER :Int = 0x0007;
>>> - public static var CAMERA :Int = 0x0008; // :Int = 0xFFFF
>>> is
>>> the actual code read from file
>>> - public static var LIGHT :Int = 0x0009;
>>> - public static var DISABLED :Int = 0x0010;
>>> - public static var BOGUS :Int = 0x0011;
>>> + public static inline var TOP :Int = 0x0001;
>>> + public static inline var BOTTOM :Int = 0x0002;
>>> + public static inline var LEFT :Int = 0x0003;
>>> + public static inline var RIGHT :Int = 0x0004;
>>> + public static inline var FRONT :Int = 0x0005;
>>> + public static inline var BACK :Int = 0x0006;
>>> + public static inline var USER :Int = 0x0007;
>>> + public static inline var CAMERA :Int = 0x0008; // :Int =
>>> 0xFFFF is the actual code read from file
>>> + public static inline var LIGHT :Int = 0x0009;
>>> + public static inline var DISABLED :Int = 0x0010;
>>> + public static inline var BOGUS :Int = 0x0011;
>>> }
>>>
>>>
>>> _______________________________________________
>>> Sandy mailing list
>>> Sandy at osflash.org
>>> http://osflash.org/mailman/listinfo/sandy_osflash.org
>>>
>>>
>>>
>> _______________________________________________
>> Sandy mailing list
>> Sandy at osflash.org
>> http://osflash.org/mailman/listinfo/sandy_osflash.org
>>
>>
>
>
> _______________________________________________
> Sandy mailing list
> Sandy at osflash.org
> http://osflash.org/mailman/listinfo/sandy_osflash.org
>
More information about the Sandy
mailing list