Changeset 1843

Show
Ignore:
Timestamp:
11/04/08 07:54:24 (2 months ago)
Author:
ddb174
Message:

Can now parse all mdb files from realMyst!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • drizzle/DrizzlePrp/src/gui/Gui.form

    r1842 r1843  
    9999              <Group type="102" alignment="0" attributes="0"> 
    100100                  <EmptySpace max="-2" attributes="0"/> 
    101                   <Component id="jButton61" min="-2" pref="190" max="-2" attributes="0"/> 
     101                  <Group type="103" groupAlignment="0" attributes="0"> 
     102                      <Group type="102" alignment="0" attributes="0"> 
     103                          <EmptySpace min="6" pref="6" max="6" attributes="0"/> 
     104                          <Component id="jButton107" min="-2" max="-2" attributes="0"/> 
     105                      </Group> 
     106                      <Component id="jButton61" alignment="0" min="-2" pref="190" max="-2" attributes="0"/> 
     107                  </Group> 
    102108                  <EmptySpace max="32767" attributes="0"/> 
    103109              </Group> 
     
    109115                  <EmptySpace max="-2" attributes="0"/> 
    110116                  <Component id="jButton61" min="-2" max="-2" attributes="0"/> 
    111                   <EmptySpace pref="112" max="32767" attributes="0"/> 
     117                  <EmptySpace max="-2" attributes="0"/> 
     118                  <Component id="jButton107" min="-2" max="-2" attributes="0"/> 
     119                  <EmptySpace pref="70" max="32767" attributes="0"/> 
    112120              </Group> 
    113121          </Group> 
     
    121129          <Events> 
    122130            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton61ActionPerformed"/> 
     131          </Events> 
     132        </Component> 
     133        <Component class="javax.swing.JButton" name="jButton107"> 
     134          <Properties> 
     135            <Property name="text" type="java.lang.String" value="Save settings"/> 
     136          </Properties> 
     137          <Events> 
     138            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton107ActionPerformed"/> 
    123139          </Events> 
    124140        </Component> 
     
    397413                  <Group type="102" alignment="0" attributes="0"> 
    398414                      <EmptySpace max="-2" attributes="0"/> 
    399                       <Component id="tabsState2" max="32767" attributes="0"/> 
     415                      <Component id="tabsState2" pref="400" max="32767" attributes="0"/> 
    400416                      <EmptySpace max="-2" attributes="0"/> 
    401417                  </Group> 
     
    668684                              <EmptySpace max="-2" attributes="0"/> 
    669685                              <Component id="jButton53" min="-2" max="-2" attributes="0"/> 
    670                               <EmptySpace pref="266" max="32767" attributes="0"/> 
     686                              <EmptySpace pref="242" max="32767" attributes="0"/> 
    671687                          </Group> 
    672688                      </Group> 
     
    13181334                              <EmptySpace max="-2" attributes="0"/> 
    13191335                              <Component id="checkboxState20" min="-2" max="-2" attributes="0"/> 
    1320                               <EmptySpace pref="106" max="32767" attributes="0"/> 
     1336                              <EmptySpace pref="82" max="32767" attributes="0"/> 
    13211337                          </Group> 
    13221338                      </Group> 
     
    14991515                                  </Group> 
    15001516                              </Group> 
    1501                               <EmptySpace pref="71" max="32767" attributes="0"/> 
     1517                              <EmptySpace pref="47" max="32767" attributes="0"/> 
    15021518                          </Group> 
    15031519                      </Group> 
  • drizzle/DrizzlePrp/src/gui/Gui.java

    r1842 r1843  
    380380        jPanel26 = new javax.swing.JPanel(); 
    381381        jButton61 = new javax.swing.JButton(); 
     382        jButton107 = new javax.swing.JButton(); 
    382383        jPanel27 = new javax.swing.JPanel(); 
    383384        jButton2 = new javax.swing.JButton(); 
     
    655656        }); 
    656657 
     658        jButton107.setText("Save settings"); 
     659        jButton107.addActionListener(new java.awt.event.ActionListener() { 
     660            public void actionPerformed(java.awt.event.ActionEvent evt) { 
     661                jButton107ActionPerformed(evt); 
     662            } 
     663        }); 
     664 
    657665        javax.swing.GroupLayout jPanel26Layout = new javax.swing.GroupLayout(jPanel26); 
    658666        jPanel26.setLayout(jPanel26Layout); 
     
    661669            .addGroup(jPanel26Layout.createSequentialGroup() 
    662670                .addContainerGap() 
    663                 .addComponent(jButton61, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE) 
     671                .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
     672                    .addGroup(jPanel26Layout.createSequentialGroup() 
     673                        .addGap(6, 6, 6) 
     674                        .addComponent(jButton107)) 
     675                    .addComponent(jButton61, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)) 
    664676                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 
    665677        ); 
     
    669681                .addContainerGap() 
    670682                .addComponent(jButton61) 
    671                 .addContainerGap(112, Short.MAX_VALUE)) 
     683                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
     684                .addComponent(jButton107) 
     685                .addContainerGap(70, Short.MAX_VALUE)) 
    672686        ); 
    673687 
     
    10161030                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    10171031                .addComponent(jButton53) 
    1018                 .addContainerGap(266, Short.MAX_VALUE)) 
     1032                .addContainerGap(242, Short.MAX_VALUE)) 
    10191033        ); 
    10201034 
     
    13721386                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    13731387                    .addComponent(checkboxState20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 
    1374                     .addContainerGap(106, Short.MAX_VALUE)) 
     1388                    .addContainerGap(82, Short.MAX_VALUE)) 
    13751389            ); 
    13761390 
     
    15341548                                .addGap(116, 116, 116) 
    15351549                                .addComponent(jButton99))) 
    1536                         .addContainerGap(71, Short.MAX_VALUE)) 
     1550                        .addContainerGap(47, Short.MAX_VALUE)) 
    15371551                ); 
    15381552 
     
    15521566                    .addGroup(jPanel13Layout.createSequentialGroup() 
    15531567                        .addContainerGap() 
    1554                         .addComponent(tabsState2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
     1568                        .addComponent(tabsState2, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) 
    15551569                        .addContainerGap()) 
    15561570                ); 
     
    39453959            sdb = new realmyst.Sdb(bs); 
    39463960        else if(f.getParentFile().getName().toLowerCase().equals("mdb")) 
    3947             mdb = new realmyst.Mdb(bs); 
     3961            mdb = new realmyst.Mdb(bs,"none"); 
    39483962    } 
    39493963    else if(filename.toLowerCase().endsWith(".shp")) 
     
    40034017    } 
    40044018     
    4005     File f2 = new File(outfol+"/mdb"); 
     4019    /*File f2 = new File(outfol+"/mdb"); 
    40064020    for(File child: f2.listFiles()) 
    40074021    { 
     
    40244038            int dummy=0; 
    40254039        } 
    4026     } 
     4040    }*/ 
    40274041     
    40284042}//GEN-LAST:event_jButton104ActionPerformed 
     
    40424056     
    40434057    File f = new File(outfol+"/mdb"); 
     4058    realmyst.rmcontext.get().curnum=0; 
     4059    Vector<realmyst.Mdb> mdbs = new Vector<realmyst.Mdb>(); 
     4060    int count = 0; 
    40444061    for(File child: f.listFiles()) 
    40454062    { 
    40464063        if(child.getName().toLowerCase().endsWith(".vdb")) 
    40474064        { 
     4065            realmyst.rmcontext.get().curnum++; 
     4066            count++; 
     4067            //if(count>400) break; 
    40484068            try 
    40494069            { 
    40504070                int fs = (int)child.length(); 
    40514071                shared.IBytestream bs = shared.SerialBytestream.createFromFile(child); 
    4052                 realmyst.Mdb mdb = new realmyst.Mdb(bs); 
     4072                realmyst.Mdb mdb = new realmyst.Mdb(bs,"102445243.vdb"); 
    40534073                int offset = bs.getAbsoluteOffset(); 
    40544074                int bytesleft = bs.getBytesRemaining(); 
     
    40624082                    int dummy=0; 
    40634083                } 
     4084                 
     4085                String oname = mdb.name.toString().toLowerCase(); 
     4086                int ind = oname.indexOf(".."); 
     4087                if(ind==-1) m.msg("objectname has no .."); 
     4088                else m.msg("objectname: "+oname.substring(0, ind)); 
     4089                if(mdb.name.toString().toLowerCase().startsWith("myst..")) 
     4090                { 
     4091                    mdbs.add(mdb); 
     4092                } 
     4093                 
    40644094                int dummy=0; 
    40654095            } 
     
    40704100        } 
    40714101    } 
    4072      
     4102    automation.realmyst.save3dsFile(mdbs); 
    40734103 
    40744104}//GEN-LAST:event_jButton106ActionPerformed 
     4105 
     4106private void jButton107ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton107ActionPerformed 
     4107    shared.State.AllStates.pullandsave(settingsfile); 
     4108}//GEN-LAST:event_jButton107ActionPerformed 
    40754109     
    40764110/*class c2 extends javax.swing.DefaultListSelectionModel 
     
    41434177    private javax.swing.JButton jButton105; 
    41444178    private javax.swing.JButton jButton106; 
     4179    private javax.swing.JButton jButton107; 
    41454180    private javax.swing.JButton jButton11; 
    41464181    private javax.swing.JButton jButton12; 
  • drizzle/DrizzlePrp/src/realmyst/Mdb.java

    r1842 r1843  
    1212public class Mdb 
    1313{ 
    14     public int tag; 
     14    //public int tag; 
     15    public Typeid type; 
    1516    public int filesize; 
    1617    public int u2; 
    1718    public Bstr name; 
    1819    //public int u3; 
    19     public Bstr u3; 
    20     public int strCount; //number of Bstrs that follow 
    21     public Bstr[] strs; 
     20    //public Bstr u3; 
     21    //public int strCount; //number of Bstrs that follow 
     22    //public Bstr[] strs; 
     23    byte b3; 
     24    int u4; 
     25    int u5; 
     26    int u6; 
     27    int u7; 
     28    int u8; 
     29    int u9; 
     30    int u10; 
     31    public Sixlet start; 
     32    public Sixlet[] bunch; 
     33    public Face[] fs;     
     34    IntsIndex ii; 
     35    IntsFullIndex ifi; 
     36    public wha[] whas; 
     37     
    2238     
    2339    static Primary main; 
    2440     
    25     public Mdb(IBytestream c) 
    26     { 
     41    public Mdb(IBytestream c, String fntrap) 
     42    { 
     43        int curfilenum = realmyst.rmcontext.get().curnum; 
     44         
    2745        //tag = c.readInt(); 
    28         Typeid type = Typeid.read(c); 
     46        type = Typeid.read(c); 
    2947        if(type!=Typeid.mdb) 
    3048        { 
     
    3755        String trap =  
    3856                //"aurora..sn_TOWER_observe_roof01" 
    39                 "aurora..switchtube" 
     57                //"aurora..switchtube" 
     58                "aurora..boltref03" 
    4059                ; 
    4160        if(name.toString().toLowerCase().startsWith(trap.toLowerCase())) 
     
    4362            int dummy=0; 
    4463        } 
    45  
    46         byte b3 = c.readByte(); e.ensure((int)b3,3); //always 3 
    47         int u4 = c.readInt(); e.ensure(u4,0); //always 0 
    48         int u5 = c.readInt(); e.ensure(u5,3); //always 3 
    49         int u6 = c.readInt(); e.ensure(u6,0,1); //0 or 1 
    50         int u7 = c.readInt(); e.ensure(u7,257,1); //1,11,2305,257,265,267,283,321,331,9 //0x1,B,901,101,109,10B,11B,141,14B,9 //100101011011 are the bits used. 
    51         m.msg("u7="+Integer.toString(u7)); 
    52         int u8 = c.readInt(); e.ensure(u8,257,1); //0,1,11,257,265,267,283,321,331,9 //0x0,1,B,101,109,10B,11B,141,14B,9 
    53         m.msg("u8="+Integer.toString(u8)); 
    54         int u9 = c.readInt(); e.ensure(u9,1); //1,2305 //0x1,901 
    55         m.msg("u9="+Integer.toString(u9)); 
    56         int u10 = c.readInt(); e.ensure(u10,0); //0 or 1 
    57         m.msg("u10="+Integer.toString(u10)); 
    58         m.msg(name.toString()); 
     64        if(c.sourceName.toLowerCase().endsWith(fntrap.toLowerCase())) 
     65        { 
     66            int dummy=0; 
     67        } 
     68        if(c.sourceName.toLowerCase().endsWith("104988212.vdb".toLowerCase())) 
     69        { 
     70            int dummy=0; 
     71        } 
     72 
     73        b3 = c.readByte(); e.ensure((int)b3,3); //always 3 
     74        u4 = c.readInt(); e.ensure(u4,0); //always 0 
     75        u5 = c.readInt(); e.ensure(u5,3); //always 3 
     76        u6 = c.readInt(); e.ensure(u6,0,1); //0 or 1 
     77        u7 = c.readInt(); e.ensure(u7,257,1,267,321,331,11,265,9,2305,283); //1,11,2305,257,265,267,283,321,331,9 //0x1,B,901,101,109,10B,11B,141,14B,9 //100101011011 are the bits used. 
     78        //m.msg("u7="+Integer.toString(u7)); 
     79        if(u7==2305) 
     80        { 
     81            int altu8 = c.readInt(); e.ensure(altu8,0); 
     82            //int altu9 = c.readInt(); e.ensure(altu9,2305); 
     83            //int altu10 = c.readInt(); e.ensure(altu10,1); 
     84            //int altu11 = c.readInt(); e.ensure(altu11,0); 
     85            //Sixlet start = new Sixlet(c); 
     86            //int vertcount = c.readInt(); 
     87            //Vertex[] verts = c.readArray(Vertex.class, vertcount); 
     88        } 
     89        u8 = c.readInt(); e.ensure(u8,257,1,267,321,331,11,265,9,2305,283); //0,1,11,257,265,267,283,321,331,9 //0x0,1,B,101,109,10B,11B,141,14B,9 
     90        //m.msg("u8="+Integer.toString(u8)); 
     91        u9 = c.readInt(); e.ensure(u9,1); //1,2305 //0x1,901 
     92        //m.msg("u9="+Integer.toString(u9)); 
     93        u10 = c.readInt(); e.ensure(u10,0); //0 or 1 
     94        //m.msg("u10="+Integer.toString(u10)); 
     95        //m.msg(name.toString()); 
    5996        //m.err("Unhandled tag: 0x"+Integer.toHexString(tag)); 
    6097         
    61         Sixlet start = new Sixlet(c); //opposite corners of bounding box? 
    62          
    63         int s1 = c.readInt(); e.ensure(s1,3,1,2);//3 (1 seemed the same, 2 ignores quats: this is probably flags.) 
    64          
    65         int s2 = c.readInt(); //4 
    66         Sixlet bunch[] = c.readArray(Sixlet.class, s2); //vertex and vertex normal (vertex normal is average of face normals of adjacent faces.) 
    67         Quat[] quats = null; //I think this is actually a RGBA colour. 
    68         if(s1!=2) 
    69         { 
    70             quats = c.readArray(Quat.class, s2); 
    71         } 
    72          
    73         int u21 = c.readInt(); //e.ensure(u21,0); 
    74         Vertex[] trips = c.readArray(Vertex.class, u21); //uvw maybe? 
     98        start = new Sixlet(c); //opposite corners of bounding box? 
     99         
     100        if(u7==2305) 
     101        { 
     102            int vertcount = c.readInt(); 
     103            Vertex[] verts = c.readArray(Vertex.class, vertcount); 
     104        } 
     105        else 
     106        { 
     107            int s1 = c.readInt(); e.ensure(s1,3,1,2);//3 (1 seemed the same, 2 ignores quats: this is probably flags.) 
     108 
     109            int s2 = c.readInt(); //4 
     110            bunch = c.readArray(Sixlet.class, s2); //vertex and vertex normal (vertex normal is average of face normals of adjacent faces.) 
     111            Quat[] quats = null; //I think this is actually a RGBA colour. 
     112            if(s1!=2) 
     113            { 
     114                quats = c.readArray(Quat.class, s2); 
     115            } 
     116 
     117            int u21 = c.readInt(); //e.ensure(u21,0); 
     118            Vertex[] trips = c.readArray(Vertex.class, u21); //uvw maybe? 
     119        } 
    75120         
    76121        if(u6==1) //u7 and u8 are also 1 in this case. 
    77122        { 
    78123            //int xu1 = c.readInt(); e.ensure(xu1,0); 
    79             int xu2 = c.readInt(); e.ensure(xu2,0); 
    80             int xu3 = c.readInt(); e.ensure(xu3,3); 
    81             int xu4 = c.readInt(); e.ensure(xu4,0); 
     124            int xu2 = c.readInt(); e.ensure(xu2,0,1); //1 seems to be the same. 
     125            int xu3 = c.readInt(); //e.ensure(xu3,3); 
     126             
     127            repeataround[] repeatarounds = c.readArray(repeataround.class, xu3); 
     128             
     129            /*int xu4 = c.readInt(); e.ensure(xu4,0); 
    82130            int xu5 = c.readInt(); e.ensure(xu5,18433); 
    83131            int xu6 = c.readInt(); e.ensure(xu6,1); 
     
    85133            Sixlet xu8 = new Sixlet(c); 
    86134            int xu9 = c.readInt(); e.ensure(xu9,0); 
    87             int dummy=0; 
    88              
    89135            repeat r1 = new repeat(c); 
    90136            int xub3 = c.readInt(); e.ensure(xub3,0); 
     137             
    91138            int xub4 = c.readInt(); e.ensure(xub4,0); 
    92139            int xub5 = c.readInt(); e.ensure(xub5,18433); 
     
    107154            repeat r3 = new repeat(c); 
    108155             
    109             int x10 = c.readInt(); e.ensure(x10,0); 
    110             int x11 = c.readInt(); e.ensure(x11,5); 
     156            int x10 = c.readInt(); e.ensure(x10,0);*/ 
     157             
     158             
     159            int x11 = c.readInt(); //e.ensure(x11,5); 
    111160            huh[] huhs = c.readArray(huh.class, x11); 
    112161             
    113             int[] extraints = c.readInts(6); 
     162            //int[] extraints = c.readInts(6); 
     163            IntsIndex[] intIndexes = c.readArray(IntsIndex.class, xu3); 
     164            IntsFullIndex[] ind = new IntsFullIndex[xu3]; 
     165            for(int i=0;i<xu3;i++) 
     166            { 
     167                int curnum = repeatarounds[i].r1.u24; 
     168                ind[i] = new IntsFullIndex(c, intIndexes[i], curnum); 
     169            } 
    114170             
    115171            return; 
    116172        } 
    117173         
    118         int u22 = c.readInt(); e.ensure(u22,128); 
     174        int u22 = c.readInt(); e.ensure(u22,128,131,129,165); //131,129 seems to be the same. 
    119175         
    120176        int u23 = c.readInt(); //e.ensure(u23,4); 
    121         Face[] fs = c.readArray(Face.class, u23); //this maps from the longer lists to the shorter lists; or maybe it gives multiple items from the longer lists given an item from the shorter lists         //or should this be u23 instead of s2? 
     177        fs = c.readArray(Face.class, u23); //this maps from the longer lists to the shorter lists; or maybe it gives multiple items from the longer lists given an item from the shorter lists         //or should this be u23 instead of s2? 
    122178         
    123179        int u24 = c.readInt(); //e.ensure(u24,2); 
    124         wha[] whas = c.readArray(wha.class, u24); 
    125  
    126          
    127          
    128         if(true) 
    129         { 
    130             /*Vertex[] verts = new Vertex[bunch.length]; 
    131             for(int i=0;i<bunch.length;i++) 
    132             { 
    133                 Flt x = bunch[i].f1; 
    134                 Flt y = bunch[i].f2; 
    135                 Flt z = bunch[i].f3; 
    136                 verts[i] = Vertex.createFromFlts(x, y, z); 
    137             }*/ 
    138             Vertex[] verts = new Vertex[fs.length]; 
    139             for(int i=0;i<fs.length;i++) 
    140             { 
    141                 int to = fs[i].v2; 
    142                 int from = fs[i].v3; 
    143                 Flt x= bunch[to].f1; 
    144                 Flt y= bunch[to].f2; 
    145                 Flt z= bunch[to].f3; 
    146                 verts[i] = Vertex.createFromFlts(x, y, z); 
    147             } 
    148              
    149             ShortTriplet[] faces = new ShortTriplet[whas.length]; 
    150             for(int i=0;i<whas.length;i++) 
    151             { 
    152                 int v1 = whas[i].u6; 
    153                 int v2 = whas[i].u7; 
    154                 int v3 = whas[i].u8; 
    155                 faces[i] = ShortTriplet.createFromShorts((short)v1, (short)v2, (short)v3); 
    156             } 
    157              
    158             String objname = this.name.toString(); 
    159              
    160             if(main==null) 
    161             { 
    162                 main = Primary.createNull(); 
    163                 main.meshdata.mat = Material.create("defaultmat"); 
    164             } 
    165             NamedObj newobj = NamedObj.createNull(objname); 
    166             newobj.namedTriangleObject = NamedTriangleObject.createNull(); 
    167             newobj.namedTriangleObject.points = PointArray.create(verts); 
    168             newobj.namedTriangleObject.faces = FaceArray.create(faces, "defaultmat"); 
    169             main.meshdata.objs.add(newobj); 
    170              
    171             IBytedeque out = new Bytedeque2(); 
    172             main.compile(out); 
    173             byte[] filedata = out.getAllBytes(); 
    174             FileUtils.WriteFile("c:/test.3ds", filedata); 
    175         } 
    176         if(true)return; 
    177          
    178          
    179          
    180          
    181         int u25 = c.readInt(); //??? 
    182          
    183         Face[] fs2 = c.readArray(Face.class, u24); 
     180        whas = c.readArray(wha.class, u24); 
     181 
     182        if(whas.length>0) 
     183        { 
     184            int abc = whas[0].u1; 
     185            int dummy=0; 
     186        } 
     187         
     188         
     189        //if(true)return; 
     190         
     191         
     192         
     193         
     194        Face[] fs2=null; 
     195        //if(u7!=267) 
     196        if(u7==1||u7==11||u7==9) 
     197        { 
     198            int dummy=0; 
     199        } 
     200        else 
     201        { 
     202            int u25 = c.readInt(); //??? 
     203             
     204            fs2 = c.readArray(Face.class, u24); 
     205        } 
    184206         
    185207        //int u26 = c.readInt(); //6  6  6  4  3 
     
    191213        //int u32 = c.readInt(); //59 53 53 
    192214        //int u33 = c.readInt(); //5  5  5 
     215         
     216        //IntsIndex: 
    193217        int u26 = c.readInt(); 
    194         int[] extra = c.readInts(u26-1); //n-1 extra ints. 
    195         int u32 = c.readInt(); 
    196         int u33 = c.readInt(); 
     218        //int[] extra = c.readInts(u26-1); //n-1 extra ints. 
     219        //int u32 = c.readInt(); 
     220        int[] extra = c.readInts(u26); 
     221 
     222        //if(u7!=267) 
     223        //{ 
     224        ii = new IntsIndex(c); 
     225        ifi = new IntsFullIndex(c, ii, u24); 
     226        //} 
     227         
     228         
     229        /*int u33 = c.readInt(); 
    197230        int[] intsIndex = c.readInts(u33);//u32+u33);//u21); 
    198231        if(u33!=1) //if there's only one index, I think it ignores these, since they must all be that value. 
     
    203236        { 
    204237            int dummy=0; 
    205         } 
     238        }*/ 
    206239         
    207240        int dummy=0; 
    208241    } 
     242    public static class IntsFullIndex 
     243    { 
     244        int[] values; 
     245         
     246        public IntsFullIndex(IBytestream c, IntsIndex index, int count) 
     247        { 
     248            if(index.count==0) 
     249            { 
     250                values = new int[0]; //no values to put in. 
     251            } 
     252            else if(index.count==1) 
     253            { 
     254                //only one possible values, so just fill it in. 
     255                int value = index.indices[0]; 
     256                values = new int[count]; 
     257                for(int i=0;i<count;i++) 
     258                { 
     259                    values[i] = value; 
     260                } 
     261            } 
     262            else 
     263            { 
     264                values = c.readInts(count); 
     265            } 
     266        } 
     267    } 
     268    public static class IntsIndex 
     269    { 
     270        int count; 
     271        int[] indices; 
     272         
     273        public IntsIndex(IBytestream c) 
     274        { 
     275            count = c.readInt(); 
     276            indices = c.readInts(count); 
     277        } 
     278    } 
    209279    public static class huh 
    210280    { 
     281        short u1; 
     282        short u2; 
     283        int u3; 
     284        short u4; 
     285        int u5; 
     286        Flt f6; 
     287        int u7; 
     288        Flt f8; 
     289        int u9; 
     290        int u10; 
     291        Sixlet s11; 
     292         
    211293        public huh(IBytestream c) 
    212294        { 
    213             short u1 = c.readShort(); 
    214             short u2 = c.readShort(); 
    215             int u3 = c.readInt(); 
    216             short u4 = c.readShort(); 
    217             int u5 = c.readInt(); 
    218             Flt f6 = new Flt(c); 
    219             int u7 = c.readInt(); 
    220             Flt f8 = new Flt(c); 
    221             int u9 = c.readInt(); 
    222             int u10 = c.readInt(); 
    223             Sixlet s11 = new Sixlet(c); 
     295            u1 = c.readShort(); 
     296            u2 = c.readShort(); 
     297            u3 = c.readInt(); 
     298            u4 = c.readShort(); 
     299            u5 = c.readInt(); 
     300            f6 = new Flt(c); 
     301            u7 = c.readInt(); 
     302            f8 = new Flt(c); 
     303            u9 = c.readInt(); 
     304            u10 = c.readInt(); 
     305            s11 = new Sixlet(c); 
     306        } 
     307    } 
     308    public static class repeataround 
     309    { 
     310        int xu4; 
     311        int xu5; 
     312        int xu6; 
     313        int xu7; 
     314        Sixlet xu8; 
     315        int xu9; 
     316        repeat r1; 
     317        int xub3; 
     318         
     319        int xxvertcount; 
     320        Face[] xxfaces; 
     321         
     322        public repeataround(IBytestream c) 
     323        { 
     324            xu4 = c.readInt(); e.ensure(xu4,0); 
     325            xu5 = c.readInt(); e.ensure(xu5,18433,18753); 
     326            xu6 = c.readInt(); e.ensure(xu6,1); 
     327            xu7 = c.readInt(); e.ensure(xu7,0); 
     328            xu8 = new Sixlet(c); 
     329            xu9 = c.readInt(); //e.ensure(xu9,0,2527); 
     330            r1 = new repeat(c); 
     331            if(xu5==18753) 
     332            { 
     333                xxvertcount = c.readInt(); 
     334                xxfaces = c.readArray(Face.class, r1.u24); 
     335            } 
     336            xub3 = c.readInt(); e.ensure(xub3,0); 
     337             
     338            int dummy=0; 
    224339        } 
    225340    } 
    226341    public static class repeat 
    227342    { 
     343        int u22; 
     344        int u23; 
     345        Face[] fs; 
     346        int u24; 
     347        wha[] whas; 
     348         
    228349        public repeat(IBytestream c) 
    229350        { 
    230             int u22 = c.readInt(); e.ensure(u22,128); 
    231  
    232             int u23 = c.readInt(); //e.ensure(u23,4); 
    233             Face[] fs = c.readArray(Face.class, u23); //or should this be u23 instead of s2? 
    234  
    235             int u24 = c.readInt(); //e.ensure(u24,2); 
    236             wha[] whas = c.readArray(wha.class, u24); 
     351            u22 = c.readInt(); e.ensure(u22,128,129); 
     352 
     353            u23 = c.readInt(); //e.ensure(u23,4); 
     354            fs = c.readArray(Face.class, u23); //or should this be u23 instead of s2? 
     355 
     356            u24 = c.readInt(); //e.ensure(u24,2); 
     357            whas = c.readArray(wha.class, u24); 
    237358        } 
    238359    } 
    239360    public static class wha 
    240361    { 
    241         int u1; //tag? 
    242         Flt f2; //normal x 
    243         Flt f3; //normal y 
     362        public int u1; //tag? 
     363        public Flt f2; //normal x 
     364        public Flt f3; //normal y 
    244365        //int u4; 
    245         Flt f4; //normal z 
    246         Flt f5; //dot product of normal and vertex. 
    247         int u6; //face vert1 
    248         int u7; //face vert2 
    249         int u8; //face vert3 
    250         Flt f9;  //vertex x 
    251         Flt f10; //vertex y 
    252         Flt f11; //vertex z 
    253         Flt f12; 
     366        public Flt f4; //normal z 
     367        public Flt f5; //dot product of normal and vertex. 
     368        public int u6; //face vert1 
     369        public int u7; //face vert2 
     370        public int u8; //face vert3 
     371        public Flt f9;  //vertex x 
     372        public Flt f10; //vertex y 
     373        public Flt f11; //vertex z 
     374        public Flt f12; 
    254375         
    255376        public wha(IBytestream c) 
    256377        { 
    257378            u1 = c.readInt(); 
    258             f2 = new Flt(c); 
    259             f3 = new Flt(c); 
    260             //u4 = c.readInt(); 
    261             f4 = new Flt(c); 
    262             f5 = new Flt(c); 
    263             u6 = c.readInt(); 
    264             u7 = c.readInt(); 
    265             u8 = c.readInt(); 
    266             f9 = new Flt(c); 
    267             f10 = new Flt(c); 
    268             f11 = new Flt(c); 
    269             f12 = new Flt(c); 
     379             
     380            //9f,9b,9d,bf, 
     381            if(u1==159||u1==155||u1==157||u1==191||u1==189||u1==185||u1==153||u1==187) 
     382            { 
     383                f2 = new Flt(c); 
     384                f3 = new Flt(c); 
     385                //u4 = c.readInt(); 
     386                f4 = new Flt(c); 
     387                f5 = new Flt(c); 
     388                u6 = c.readInt(); 
     389                u7 = c.readInt(); 
     390                u8 = c.readInt(); 
     391                f9 = new Flt(c); 
     392                f10 = new Flt(c); 
     393                f11 = new Flt(c); 
     394                f12 = new Flt(c); 
     395            } 
     396            else if(u1==23||u1==21||u1==17||u1==53||u1==55) 
     397            { 
     398                f2 = new Flt(c); 
     399                f3 = new Flt(c); 
     400                f4 = new Flt(c); 
     401                f5 = new Flt(c); 
     402                u6 = c.readInt(); 
     403                u7 = c.readInt(); 
     404                u8 = c.readInt(); 
     405            } 
     406            else 
     407            { 
     408                int dummy=0; 
     409            } 
    270410        } 
    271411    } 
    272412    public static class Sixlet 
    273413    { 
    274         Flt f1; 
    275         Flt f2; 
    276         Flt f3; 
    277         Flt f4; 
    278         Flt f5; 
    279         Flt f6; 
     414        public Flt f1; 
     415        public Flt f2; 
     416        public Flt f3; 
     417        public Flt f4; 
     418        public Flt f5; 
     419        public Flt f6; 
    280420         
    281421        public Sixlet(IBytestream c) 
  • drizzle/DrizzlePrp/src/realmyst/rmcontext.java

    r1833 r1843  
    2727{ 
    2828    //IBytestream in; 
    29      
     29    public int curnum; 
    3030    /*public rmcontext(IBytestream in2) 
    3131    {