Changeset 1848

Show
Ignore:
Timestamp:
11/06/08 09:20:50 (2 months ago)
Author:
ddb174
Message:

The Count2 subobjects are all parsed now(they contain texture references). Some partial support for Count3 objects, but it turns out I can just peel the Texture index off the tail instead of parsing this complex object type.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • drizzle/DrizzlePrp/src/automation/realmyst.java

    r1847 r1848  
    1010import export3ds.*; 
    1111import java.util.Vector; 
     12import java.io.File; 
    1213 
    1314public class realmyst 
    1415{ 
     16    public static Vector<Mdb> filterMdbsByRoom(Vector<Mdb> mdbs, String[] rooms) 
     17    { 
     18        Vector<Mdb> result = new Vector(); 
     19        for(Mdb mdb: mdbs) 
     20        { 
     21            String objname = mdb.name.toString(); 
     22            //String oname = mdb.name.toString().toLowerCase(); 
     23            int ind = objname.indexOf(".."); 
     24            if(ind==-1) 
     25            { 
     26                m.msg("objectname has no .. : "+objname); 
     27                break; 
     28            } 
     29             
     30            String curroom = objname.substring(0, ind); 
     31            m.msg("objectname: "+curroom); 
     32            for(String room: rooms) 
     33            { 
     34                if(room.equals(curroom)) 
     35                { 
     36                    result.add(mdb); 
     37                } 
     38            } 
     39            //if(mdb.name.toString().toLowerCase().startsWith("myst..")) 
     40            //{ 
     41            //    mdbs.add(mdb); 
     42            //} 
     43        } 
     44        return result; 
     45    } 
     46    public static Vector<Hsm> realAllHsms(String folder) 
     47    { 
     48        File f = new File(folder+"/scn/maps"); 
     49        //realmyst.rmcontext.get().curnum=0; 
     50        Vector<Hsm> hsms = new Vector<Hsm>(); 
     51        int count = 0; 
     52        for(File child: f.listFiles()) 
     53        { 
     54            if(child.getName().toLowerCase().endsWith(".hsm")) 
     55            { 
     56                //realmyst.rmcontext.get().curnum++; 
     57                count++; 
     58                //if(count>400) break; 
     59                try 
     60                { 
     61                    int fs = (int)child.length(); 
     62                    shared.IBytestream bs = shared.SerialBytestream.createFromFile(child); 
     63                    Hsm hsm = new Hsm(bs,child.getName()); 
     64                    int offset = bs.getAbsoluteOffset(); 
     65                    int bytesleft = bs.getBytesRemaining(); 
     66 
     67                    //if (mdb.filesizeMinusHeader!=fs-offset) 
     68                    //{ 
     69                    //    int dummy=0; 
     70                    //} 
     71                    if(bytesleft!=0) 
     72                    { 
     73                        int dummy=0; 
     74                    } 
     75 
     76                    //String oname = hsm.name.toString().toLowerCase(); 
     77                    //int ind = oname.indexOf(".."); 
     78                    //if(ind==-1) m.msg("objectname has no .."); 
     79                    //else m.msg("objectname: "+oname.substring(0, ind)); 
     80                    //if(mdb.name.toString().toLowerCase().startsWith("myst..")) 
     81                    //{ 
     82                    //    mdbs.add(mdb); 
     83                    //} 
     84 
     85                    hsms.add(hsm); 
     86 
     87                    int dummy=0; 
     88                } 
     89                catch(shared.ignore e) 
     90                { 
     91                    m.warn("Error so skipping file."); 
     92                } 
     93            } 
     94        } 
     95        return hsms; 
     96    } 
     97    public static Vector<Mdb> readAllMdbs(String folder) 
     98    { 
     99        File f = new File(folder+"/mdb"); 
     100        rmcontext.get().curnum=0; 
     101        Vector<Mdb> mdbs = new Vector<Mdb>(); 
     102        int count = 0; 
     103        for(File child: f.listFiles()) 
     104        { 
     105            if(child.getName().toLowerCase().endsWith(".vdb")) 
     106            { 
     107                rmcontext.get().curnum++; 
     108                count++; 
     109                //if(count>400) break; 
     110                try 
     111                { 
     112                    int fs = (int)child.length(); 
     113                    shared.IBytestream bs = shared.SerialBytestream.createFromFile(child); 
     114                    Mdb mdb = new Mdb(bs,"102445243.vdb"); 
     115                    int offset = bs.getAbsoluteOffset(); 
     116                    int bytesleft = bs.getBytesRemaining(); 
     117 
     118                    //if (mdb.filesizeMinusHeader!=fs-offset) 
     119                    //{ 
     120                    //    int dummy=0; 
     121                    //} 
     122                    if(bytesleft!=0) 
     123                    { 
     124                        int dummy=0; 
     125                    } 
     126 
     127                    //String oname = mdb.name.toString().toLowerCase(); 
     128                    //int ind = oname.indexOf(".."); 
     129                    //if(ind==-1) m.msg("objectname has no .."); 
     130                    //else m.msg("objectname: "+oname.substring(0, ind)); 
     131                    //if(mdb.name.toString().toLowerCase().startsWith("myst..")) 
     132                    //{ 
     133                    mdbs.add(mdb); 
     134                    //} 
     135 
     136                    int dummy=0; 
     137                } 
     138                catch(shared.ignore e) 
     139                { 
     140                    m.warn("Error so skipping file."); 
     141                } 
     142            } 
     143        } 
     144        return mdbs; 
     145    } 
     146    public static Vector<Sdb> readAllSdbs(String folder) 
     147    { 
     148        File f = new File(folder+"/sdb"); 
     149        Vector<Sdb> sdbs = new Vector(); 
     150        for(File child: f.listFiles()) 
     151        { 
     152            if(child.getName().toLowerCase().endsWith(".vdb")) 
     153            { 
     154                try 
     155                { 
     156                    int fs = (int)child.length(); 
     157                    shared.IBytestream bs = shared.SerialBytestream.createFromFile(child); 
     158                    Sdb sdb = new Sdb(bs); 
     159                    int offset = bs.getAbsoluteOffset(); 
     160                    int bytesleft = bs.getBytesRemaining(); 
     161 
     162                    if (sdb.filesizeMinusHeader!=fs-offset) 
     163                    { 
     164                        int dummy=0; 
     165                    } 
     166                    if(bytesleft!=0) 
     167                    { 
     168                        int dummy=0; 
     169                    } 
     170                    int dummy=0; 
     171 
     172                    sdbs.add(sdb); 
     173                } 
     174                catch(shared.ignore e) 
     175                { 
     176                    m.warn("Error so skipping file."); 
     177                } 
     178            } 
     179        } 
     180        return sdbs; 
     181    } 
     182 
     183    public static String[] findRoomInfo(Vector<Sdb> sdbs, String agecode) 
     184    { 
     185        //Valid agecodes are: Channel, Dni, Mech, Rime, Sel, Stone, Myst 
     186        String soughtObject; 
     187        if(agecode.equals("Myst")) 
     188            soughtObject = "HoldingPen_Channel"; 
     189        else if(agecode.equals("Channel")||agecode.equals("Channel")||agecode.equals("Channel")||agecode.equals("Channel")||agecode.equals("Channel")||agecode.equals("Channel")||agecode.equals("Channel")) 
     190            soughtObject = "HoldingPen_"+agecode+"ToMyst"; 
     191        else throw new uncaughtexception("realMyst Agename wasn't known, it was probably a typo.:"+agecode); 
     192         
     193        for(Sdb sdb: sdbs) 
     194        { 
     195            String objname = sdb.name.toString(); 
     196            if(objname.startsWith("HoldingPen_")) 
     197            { 
     198                String room = sdb.strs[0].toString(); 
     199                if(room.equals("global")) 
     200                { 
     201                    if(objname.equals(soughtObject)) 
     202                    { 
     203                        Vector<String> list2500=new Vector(); 
     204                        Vector<String> list2501=new Vector(); 
     205                        for(Count10.occref occ: sdb.count10s[0].occrefs1) 
     206                        { 
     207                            if(occ.u3==2500) list2500.add(occ.subs[0].xstr.toString()); 
     208                            if(occ.u3==2501) list2501.add(occ.subs[0].xstr.toString()); 
     209                        } 
     210                        //String list1 = sdb.count10s[0].occrefs1[2].subs[0].xstr.toString(); 
     211                        //String list2 = sdb.count10s[0].occrefs1[3].subs[0].xstr.toString(); 
     212                         
     213                        String[] result = list2501.get(0).split(","); 
     214                        return result; 
     215                    }                     
     216                     
     217                    int dummy=0; 
     218                } 
     219                int dummy=0; 
     220            } 
     221            int dummy=0; 
     222        } 
     223        return null; 
     224    } 
     225     
    15226    public static void saveDdsFiles(Vector<Hsm> hsms, String outfolder) 
    16227    { 
  • drizzle/DrizzlePrp/src/gui/Gui.form

    r1847 r1848  
    29382938              </Constraints> 
    29392939            </Component> 
     2940            <Component class="javax.swing.JButton" name="jButton110"> 
     2941              <Properties> 
     2942                <Property name="text" type="java.lang.String" value="full test"/> 
     2943              </Properties> 
     2944              <Events> 
     2945                <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton110ActionPerformed"/> 
     2946              </Events> 
     2947              <Constraints> 
     2948                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> 
     2949                  <AbsoluteConstraints x="380" y="160" width="-1" height="-1"/> 
     2950                </Constraint> 
     2951              </Constraints> 
     2952            </Component> 
    29402953          </SubComponents> 
    29412954        </Container> 
  • drizzle/DrizzlePrp/src/gui/Gui.java

    r1847 r1848  
    579579        jButton108 = new javax.swing.JButton(); 
    580580        jButton109 = new javax.swing.JButton(); 
     581        jButton110 = new javax.swing.JButton(); 
    581582        jPanel12 = new javax.swing.JPanel(); 
    582583        jButton50 = new javax.swing.JButton(); 
     
    24792480                jButton109.setBounds(680, 60, 96, 36); 
    24802481 
     2482                jButton110.setText("full test"); 
     2483                jButton110.addActionListener(new java.awt.event.ActionListener() { 
     2484                    public void actionPerformed(java.awt.event.ActionEvent evt) { 
     2485                        jButton110ActionPerformed(evt); 
     2486                    } 
     2487                }); 
     2488                jPanel10.add(jButton110); 
     2489                jButton110.setBounds(380, 160, 63, 36); 
     2490 
    24812491                tabsState3.addTab("realMyst", jPanel10); 
    24822492 
     
    39773987    { 
    39783988        if(f.getParentFile().getName().toLowerCase().equals("sdb")) 
     3989        { 
    39793990            sdb = new realmyst.Sdb(bs); 
     3991            for(int i=0;i<sdb.count2s.length;i++) 
     3992            { 
     3993                realmyst.Count2 c2 = sdb.count2s[i]; 
     3994                String curtex = c2.sb2.str.toString(); 
     3995                if(curtex.equals("GBdock.hsm")) 
     3996                { 
     3997                    int dummy=0; 
     3998                } 
     3999            } 
     4000        } 
    39804001        else if(f.getParentFile().getName().toLowerCase().equals("mdb")) 
    39814002            mdb = new realmyst.Mdb(bs,"none"); 
     
    40054026private void jButton104ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton104ActionPerformed 
    40064027    String outfol = this.textfieldState24.getText(); 
     4028    m.state.push(); 
    40074029    m.state.curstate.writeToFile = true; 
    40084030     
    4009     File f = new File(outfol+"/sdb"); 
    4010     for(File child: f.listFiles()) 
    4011     { 
    4012         if(child.getName().toLowerCase().endsWith(".vdb")) 
    4013         { 
    4014             try 
    4015             { 
    4016                 int fs = (int)child.length(); 
    4017                 shared.IBytestream bs = shared.SerialBytestream.createFromFile(child); 
    4018                 realmyst.Sdb mdb = new realmyst.Sdb(bs); 
    4019                 int offset = bs.getAbsoluteOffset(); 
    4020                 int bytesleft = bs.getBytesRemaining(); 
    4021  
    4022                 if (mdb.filesizeMinusHeader!=fs-offset) 
    4023                 { 
    4024                     int dummy=0; 
    4025                 } 
    4026                 if(bytesleft!=0) 
    4027                 { 
    4028                     int dummy=0; 
    4029                 } 
    4030                 int dummy=0; 
    4031             } 
    4032             catch(shared.ignore e) 
    4033             { 
    4034                 m.warn("Error so skipping file."); 
    4035             } 
    4036         } 
    4037     } 
     4031    Vector<realmyst.Sdb> sdbs = automation.realmyst.readAllSdbs(outfol); 
     4032    String[] rooms = automation.realmyst.findRoomInfo(sdbs,"Myst"); 
     4033     
     4034    m.state.pop(); 
    40384035     
    40394036    /*File f2 = new File(outfol+"/mdb"); 
     
    40734070private void jButton106ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton106ActionPerformed 
    40744071    String outfol = this.textfieldState24.getText(); 
     4072    m.state.push(); 
    40754073    m.state.curstate.writeToFile = true; 
    40764074     
    4077     File f = new File(outfol+"/mdb"); 
    4078     realmyst.rmcontext.get().curnum=0; 
    4079     Vector<realmyst.Mdb> mdbs = new Vector<realmyst.Mdb>(); 
    4080     int count = 0; 
    4081     for(File child: f.listFiles()) 
    4082     { 
    4083         if(child.getName().toLowerCase().endsWith(".vdb")) 
    4084         { 
    4085             realmyst.rmcontext.get().curnum++; 
    4086             count++; 
    4087             //if(count>400) break; 
    4088             try 
    4089             { 
    4090                 int fs = (int)child.length(); 
    4091                 shared.IBytestream bs = shared.SerialBytestream.createFromFile(child); 
    4092                 realmyst.Mdb mdb = new realmyst.Mdb(bs,"102445243.vdb"); 
    4093                 int offset = bs.getAbsoluteOffset(); 
    4094                 int bytesleft = bs.getBytesRemaining(); 
    4095  
    4096                 //if (mdb.filesizeMinusHeader!=fs-offset) 
    4097                 //{ 
    4098                 //    int dummy=0; 
    4099                 //} 
    4100                 if(bytesleft!=0) 
    4101                 { 
    4102                     int dummy=0; 
    4103                 } 
    4104                  
    4105                 String oname = mdb.name.toString().toLowerCase(); 
    4106                 int ind = oname.indexOf(".."); 
    4107                 if(ind==-1) m.msg("objectname has no .."); 
    4108                 else m.msg("objectname: "+oname.substring(0, ind)); 
    4109                 if(mdb.name.toString().toLowerCase().startsWith("myst..")) 
    4110                 { 
    4111                     mdbs.add(mdb); 
    4112                 } 
    4113                  
    4114                 int dummy=0; 
    4115             } 
    4116             catch(shared.ignore e) 
    4117             { 
    4118                 m.warn("Error so skipping file."); 
    4119             } 
    4120         } 
    4121     } 
     4075    Vector<realmyst.Mdb> mdbs = automation.realmyst.readAllMdbs(outfol); 
    41224076    automation.realmyst.save3dsFile(mdbs); 
    41234077 
     4078    m.state.pop(); 
    41244079}//GEN-LAST:event_jButton106ActionPerformed 
    41254080 
     
    41324087    //m.state.curstate.writeToFile = true; 
    41334088     
    4134     File f = new File(outfol+"/scn/maps"); 
    4135     //realmyst.rmcontext.get().curnum=0; 
    4136     Vector<realmyst.Hsm> hsms = new Vector<realmyst.Hsm>(); 
    4137     int count = 0; 
    4138     for(File child: f.listFiles()) 
    4139     { 
    4140         if(child.getName().toLowerCase().endsWith(".hsm")) 
    4141         { 
    4142             //realmyst.rmcontext.get().curnum++; 
    4143             count++; 
    4144             //if(count>400) break; 
    4145             try 
    4146             { 
    4147                 int fs = (int)child.length(); 
    4148                 shared.IBytestream bs = shared.SerialBytestream.createFromFile(child); 
    4149                 realmyst.Hsm hsm = new realmyst.Hsm(bs,child.getName()); 
    4150                 int offset = bs.getAbsoluteOffset(); 
    4151                 int bytesleft = bs.getBytesRemaining(); 
    4152  
    4153                 //if (mdb.filesizeMinusHeader!=fs-offset) 
    4154                 //{ 
    4155                 //    int dummy=0; 
    4156                 //} 
    4157                 if(bytesleft!=0) 
    4158                 { 
    4159                     int dummy=0; 
    4160                 } 
    4161                  
    4162                 //String oname = hsm.name.toString().toLowerCase(); 
    4163                 //int ind = oname.indexOf(".."); 
    4164                 //if(ind==-1) m.msg("objectname has no .."); 
    4165                 //else m.msg("objectname: "+oname.substring(0, ind)); 
    4166                 //if(mdb.name.toString().toLowerCase().startsWith("myst..")) 
    4167                 //{ 
    4168                 //    mdbs.add(mdb); 
    4169                 //} 
    4170                  
    4171                 hsms.add(hsm); 
    4172                  
    4173                 int dummy=0; 
    4174             } 
    4175             catch(shared.ignore e) 
    4176             { 
    4177                 m.warn("Error so skipping file."); 
    4178             } 
    4179         } 
    4180     } 
     4089    Vector<realmyst.Hsm> hsms = automation.realmyst.realAllHsms(outfol); 
    41814090    //automation.realmyst.save3dsFile(mdbs); 
    41824091    automation.realmyst.saveDdsFiles(hsms,"c:/hsmout"); 
     
    42064115        //"me_conpane", 
    42074116         
    4208         "se_stair04", 
    4209         "selenitic", 
    4210         "se_stair03", 
    4211         "se_stair02", 
     4117        //"se_stair04", 
     4118        //"selenitic", 
     4119        //"se_stair03", 
     4120        //"se_stair02", 
    42124121         
    42134122        //"cabin", 
     
    42274136        //"sship_tunnel", 
    42284137        //"lighthouse", 
     4138         
     4139        "myst..base_mountain" 
    42294140    }; 
    42304141    Vector<File> files = filesearcher.search.getallfiles(folder, false); 
     
    42354146        { 
    42364147            String filename = f.getName(); 
     4148            m.msg("String found in file:"+filename); 
    42374149            int dummy=0; 
    42384150        } 
    42394151    } 
    42404152}//GEN-LAST:event_jButton109ActionPerformed 
     4153 
     4154private void jButton110ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton110ActionPerformed 
     4155 
     4156    String outfol = this.textfieldState24.getText(); 
     4157     
     4158    Vector<realmyst.Sdb> sdbs = automation.realmyst.readAllSdbs(outfol); 
     4159    String[] mystrooms = automation.realmyst.findRoomInfo(sdbs,"Myst"); 
     4160     
     4161    Vector<realmyst.Mdb> mdbs = automation.realmyst.readAllMdbs(outfol); 
     4162    Vector<realmyst.Mdb> mystmdbs = automation.realmyst.filterMdbsByRoom(mdbs, mystrooms); 
     4163     
     4164    automation.realmyst.save3dsFile(mystmdbs); 
     4165 
     4166     
     4167}//GEN-LAST:event_jButton110ActionPerformed 
    42414168     
    42424169/*class c2 extends javax.swing.DefaultListSelectionModel 
     
    43134240    private javax.swing.JButton jButton109; 
    43144241    private javax.swing.JButton jButton11; 
     4242    private javax.swing.JButton jButton110; 
    43154243    private javax.swing.JButton jButton12; 
    43164244    private javax.swing.JButton jButton13; 
  • drizzle/DrizzlePrp/src/realmyst/Count10.java

    r1847 r1848  
    2525    //int tag; 
    2626    public Typeid type; 
    27     int size; 
    28     int sub1; 
     27    public int size; 
     28    public int u1; 
     29    public Bstr s1; 
     30    public byte b1; 
     31    public int u2; 
     32    public int u3; 
     33    public int u4; 
     34    public int u5; 
     35    public Bstr s2; 
     36    public int count1; 
     37    public occref[] occrefs1; 
     38    public int count2; 
     39    public occref[] occrefs2; 
     40    public int count3Maybe; 
     41    public int count4; 
     42    public StringAndByte[] stringAndBytes; 
     43    //int sub1; 
    2944    //Bstr xsubs; 
    30     Flagsen xsubs; 
    31     int sub2; 
     45    //Flagsen xsubs; 
     46    //int sub2; 
    3247    //Flagsen[] subs2; 
    33     TaggedObj[] subs2; 
     48    //TaggedObj[] subs2; 
    3449     
    3550    public Count10(IBytestream c) 
     
    4156        size = c.readInt(); //size of this object (including type). 
    4257         
    43         int u1 = c.readInt(); e.ensure(u1,1); 
    44         Bstr s1 = new Bstr(c); 
    45         byte b1 = c.readByte(); e.ensure((int)b1,16); 
    46         int u2 = c.readInt(); e.ensure(u2,0); 
    47         int u3 = c.readInt(); e.ensure(u3,0); 
    48         int u4 = c.readInt(); e.ensure(u4,4); 
    49         int u5 = c.readInt(); e.ensure(u5,0,256,8,1); 
    50         Bstr s2 = new Bstr(c); 
    51          
    52         int count1 = c.readInt(); 
    53         c.readArray(occref.class, count1); 
    54  
    55         int count2 = c.readInt(); 
    56         c.readArray(occref.class, count2); 
    57          
    58         int count3Maybe = c.readInt(); e.ensure(count3Maybe==0); 
    59          
    60         int count4 = c.readInt(); 
    61         c.readArray(stringAndByte.class, count4); 
     58        u1 = c.readInt(); e.ensure(u1,1); 
     59        s1 = new Bstr(c); 
     60        b1 = c.readByte(); e.ensure((int)b1,16); 
     61        u2 = c.readInt(); e.ensure(u2,0); 
     62        u3 = c.readInt(); e.ensure(u3,0); 
     63        u4 = c.readInt(); e.ensure(u4,4); 
     64        u5 = c.readInt(); e.ensure(u5,0,256,8,1); 
     65        s2 = new Bstr(c); 
     66         
     67        count1 = c.readInt(); 
     68        occrefs1 = c.readArray(occref.class, count1); 
     69 
     70        count2 = c.readInt(); 
     71        occrefs2 = c.readArray(occref.class, count2); 
     72         
     73        count3Maybe = c.readInt(); e.ensure(count3Maybe==0); 
     74         
     75        count4 = c.readInt(); 
     76        stringAndBytes = c.readArray(StringAndByte.class, count4); 
    6277         
    6378        /*sub1 = c.readInt(); 
     
    8196         
    8297    } 
    83     public static class stringAndByte 
    84     { 
    85         public stringAndByte(IBytestream c) 
    86         { 
    87             //sub_45A950, I think 
    88              
    89             Bstr str = new Bstr(c); 
    90             byte b = c.readByte(); //this is used in the switch. 
    91             int dummy=0; 
    92         } 
    93     } 
    9498    public static class occref 
    9599    { 
     100        public Typeid type; 
     101        public int u1; 
     102        public int u2; 
     103        public int u3; 
     104        public int u4; 
     105        public int count; 
     106        public suboccref[] subs; 
     107         
    96108        public static class suboccref 
    97109        { 
     110            public int u6; 
     111            public int u7; 
     112            public int u8; 
     113            public int u9; 
     114            public int u10; 
     115             
     116            public int xint; 
     117            public Flt xfloat; 
     118            public Bstr xstr; 
     119            public Vertex xvertex; 
     120            //public Quat xquat; 
     121             
    98122            public suboccref(IBytestream c) 
    99123            { 
    100124                //sub_5070E0??? (called only by sub_508420) 
    101125                 
    102                 int u6 = c.readInt(); e.ensure(u6,0); 
    103                 int u7 = c.readInt(); e.ensure(u7,1); 
    104                 int u8 = c.readInt(); e.ensure(u8,0,37842956); //only saw 27842956 once 
    105                 int u9 = c.readInt(); e.ensure(u9,1,2,3,4,5,6); 
    106                 m.msg("u9="+Integer.toString(u9)); 
     126                u6 = c.readInt(); e.ensure(u6,0); 
     127                u7 = c.readInt(); e.ensure(u7,1); 
     128                u8 = c.readInt(); e.ensure(u8,0,37842956); //only saw 27842956 once 
     129                u9 = c.readInt(); e.ensure(u9,1,2,3,4,5,6); 
     130                //m.msg("u9="+Integer.toString(u9)); 
     131                u10 = c.readInt(); 
    107132                if(u9==5) 
    108133                { 
    109                     //this is presumably a vertex or quaternion. 
    110                     int u10 = c.readInt(); 
     134                    //this is presumably a vertex or quaternion. Possibly a RGBA. 
    111135                    Flt x = new Flt(c); 
    112136                    Flt y = new Flt(c); 
    113137                    Flt z = new Flt(c); 
    114138                    int uc1 = c.readInt(); //seems to be 0, so probably a Flt, making this a quaternion. 
    115                     if(uc1!=0) 
    116                     { 
    117                         int dummy=0; 
    118                     } 
     139                    //if(uc1!=0) 
     140                    //{ 
     141                    //    int dummy=0; 
     142                    //} 
     143                    //xquat = new Quat(c); 
    119144                    int dummy=0; 
    120145                } 
    121146                else if(u9==6) 
    122147                { 
    123                     int u10 = c.readInt(); 
    124148                    int count = c.readInt(); 
    125149                    Bstr[] sb1 = c.readArray(Bstr.class, count); 
     
    129153                { 
    130154                    //vertex? 
    131                     int u10 = c.readInt(); 
    132155                    //int ua1 = c.readInt(); 
    133156                    //int ua2 = c.readInt(); 
    134157                    //int ua3 = c.readInt(); 
    135                     Flt ua1 = new Flt(c); 
    136                     Flt ua2 = new Flt(c); 
    137                     Flt ua3 = new Flt(c); 
     158                    //Flt ua1 = new Flt(c); 
     159                    //Flt ua2 = new Flt(c); 
     160                    //Flt ua3 = new Flt(c); 
     161                    xvertex = new Vertex(c); 
    138162                    //if(!ua1.approxequals(0)) 
    139163                    //{ 
     
    143167                else if(u9==3) 
    144168                { 
    145                     int u10 = c.readInt(); //e.ensure(u10,1,0,16); 
    146                     Bstr s1 = new Bstr(c); 
     169                    //int u10 = c.readInt(); //e.ensure(u10,1,0,16); 
     170                    xstr = new Bstr(c); 
    147171                    int dummy=0; 
    148172                } 
    149173                else if(u9==1) 
    150174                { 
    151                     int u10 = c.readInt(); 
    152                     int u11 = c.readInt(); 
     175                    xint = c.readInt(); 
    153176                } 
    154177                else if(u9==2) 
    155178                { 
    156                     int u10 = c.readInt(); 
    157                     Flt f1 = new Flt(c); 
     179                    xfloat = new Flt(c); 
    158180                } 
    159181             
     
    164186            //sub_508420? 
    165187             
    166             Typeid type = Typeid.read(c); //e.ensure(type==Typeid.occref); 
    167             int u1 = c.readInt(); e.ensure(u1,0); 
    168             int u2 = c.readInt(); e.ensure(u2,1); 
    169             int u3 = c.readInt(); //? 
    170             int u4 = c.readInt(); e.ensure(u4,0,1,4,6,7,5,37837212); 
    171             int count = c.readInt(); //e.ensure(u5,2); 
    172             suboccref[] subs = c.readArray(suboccref.class, count); 
     188            type = Typeid.read(c); //e.ensure(type==Typeid.occref); 
     189            u1 = c.readInt(); e.ensure(u1,0); 
     190            u2 = c.readInt(); e.ensure(u2,1); 
     191            u3 = c.readInt(); //? 
     192            u4 = c.readInt(); e.ensure(u4,0,1,4,6,7,5,37837212); 
     193            count = c.readInt(); //e.ensure(u5,2); 
     194            subs = c.readArray(suboccref.class, count); 
    173195            //Object[] subs = new Object[count]; 
    174196            //for(int i=0;i<count;i++) 
  • drizzle/DrizzlePrp/src/realmyst/Count11.java

    r1847 r1848  
    3232        int u1 = c.readInt(); //total length of this object. 
    3333        int endpos = startpos+u1; 
    34         m.msg("u1(binary)="+Integer.toBinaryString(u1)); 
     34        //m.msg("u1(binary)="+Integer.toBinaryString(u1)); 
    3535        int u2 = c.readInt(); e.ensure(u2,0,1); //1 
    3636        int u3 = c.readInt(); e.ensure(u3,-1); 
     
    4545            //if(u5==1) 
    4646            //if((u1&32)!=0) 
    47             if(c.getAbsoluteOffset()!=endpos) 
     47            //if(c.getAbsoluteOffset()!=endpos) 
     48            if(u4==1) 
    4849            { 
    49                 m.msg("reading extra int and flt"); 
     50                //if(u4!=1) 
     51                //{ 
     52                //    int dummy=0; 
     53                //} 
     54                //m.msg("reading extra int and flt"); 
    5055                int u6 = c.readInt(); e.ensure(u6,4,10); 
    5156                Flt f1 = new Flt(c); //0.5 
    5257                int dummy=0; 
    5358            } 
     59            //else 
     60            //{ 
     61                //if(u4==1) 
     62                //{ 
     63                //    int dummy=0; 
     64                //} 
     65            //} 
    5466        } 
    5567        else if(u2==1) 
  • drizzle/DrizzlePrp/src/realmyst/Count3Undone.java

    r1847 r1848  
    2121import shared.*; 
    2222 
     23//SceneObject? 
    2324public class Count3Undone 
    2425{ 
     
    2627    int size; 
    2728     
     29    int possibility; 
     30     
    2831    public Count3Undone(IBytestream c) 
    2932    { 
    30         type = Typeid.read(c); 
     33        int startpos = c.getAbsoluteOffset(); 
     34        String start = "0x"+Integer.toHexString(startpos); 
     35        type = Typeid.read(c); e.ensure(type==Typeid.count3); 
    3136        size = c.readInt(); 
     37        String end = "0x"+Integer.toHexString(startpos+size); 
    3238         
    3339        //skip the rest. 
    34         c.readBytes(size-8); 
     40        IBytestream d = c.Fork(); 
     41        //if(size>184) 
     42        { 
     43            //byte[] rawdata = c.readBytes(size-8); 
     44            byte[] rawdata1 = c.readBytes(size-8-4); 
     45            possibility = c.readInt(); //the texture index! -1 presumably means no texture. 
     46            m.msg("Possibility: "+Integer.toString(possibility)); 
     47            if(true)return; 
     48        } 
     49         
     50        //just use a fork 
     51        c = d; 
     52         
     53        int u1 = c.readInt();  e.ensure(u1,1); 
     54         
     55        StringAndByte sb2 = new StringAndByte(c); 
     56        //int bytecount = c.readInt(); 
     57        //if(bytecount>256) return; 
     58        //c.readBytes(bytecount); 
     59        //byte endbyte = c.readByte(); 
     60        //if(true)return; 
     61        //if(sb2.str.toString().startsWith("myst..base_mountain")) 
     62        { 
     63            int dummy=0; 
     64        } 
     65        int u3 = c.readInt(); e.ensure(u3,0,1); 
     66        if(u3==1)  
     67        { 
     68            StringAndByte sb3a = new StringAndByte(c); 
     69            int dummy=0; 
     70        } 
     71        int u4 = c.readInt(); e.ensure(u4,3); 
     72        int u5 = c.readInt(); e.ensure(u5,0); 
     73        int u6 = c.readInt(); //e.ensure(u6,5,8,4,13,37,12,36,21,9,1,33); //13 
     74        int u7 = c.readInt(); e.ensure(u7,1); //todo: rsetore this. 
     75        int u8 = c.readInt(); e.ensure(u8,0,0x40c0,0x80,0x4000,0x4080,0x4040,0x60c0,0x200c0,0x20040,0x40d0,0x4050,0x4010,0x4090); //16576,128, 0x4000 
     76        int u8b=0; 
     77        if((u8&0x4000)!=0) 
     78        { 
     79            u8b = c.readInt(); e.ensure(u8b,0,2,0x20,130,8,34); 
     80        } 
     81        int u9 = c.readInt(); e.ensure(u9,0,128,2,3,8,32,130,1,34,160); //128 
     82        int u10 = c.readInt(); //e.ensure(u10,0,1,0x2000,0x40,0x41,0x200,0x2040,3,2,0x4000); //1,0x2000 
     83        int u11 = c.readInt(); //e.ensure(u11,0,0x2000,0x40,0x1,0x11,0x19,0x8,0x243,0x80,0x41,2,0x100,0x18,0x2040); //0x2000,0x40 
     84        int u12 = c.readInt(); e.ensure(u12,0,16,17,8,4,1,24,128,256,32); 
     85        int u13 = c.readInt(); //e.ensure(u13,0,4); //sometimes a float. 
     86        //m.msg("count3: u8b="+Integer.toString(u8b)+" u9="+Integer.toString(u9)); 
     87        //if(true)return; 
     88        Flt u14 = new Flt(c); 
     89        Flt u15 = new Flt(c); 
     90        Flt u16 = new Flt(c); 
     91        Flt u17 = new Flt(c); 
     92        Flt u18 = new Flt(c); 
     93        Flt f19 = new Flt(c); 
     94        Flt f20 = new Flt(c); 
     95        Flt f21 = new Flt(c); 
     96        Flt f22 = new Flt(c); 
     97        Flt f23 = new Flt(c); 
     98        int u25=0; Bstr s26=null;//int u26=0; Flt f27=null; Flt f28=null; 
     99        if((u8&0x2000)!=0) 
     100        { 
     101            u25 = c.readInt(); e.ensure(u25,4,0); 
     102            //u26 = c.readInt(); e.ensure(u26,8); 
     103            //f27 = new Flt(c); 
     104            //f28 = new Flt(c); 
     105            s26 = new Bstr(c); 
     106        } 
     107        int u29=0; Bstr s30=null; 
     108        if((u8&0x20000)!=0) 
     109        { 
     110            u29 = c.readInt(); e.ensure(u29,0); 
     111            s30 = new Bstr(c); 
     112        } 
     113        if((u8&0x10)!=0) //16 floats; a matrix?  xform state? 
     114        { 
     115            Flt f31 = new Flt(c); 
     116            //int u32 = c.readInt(); e.ensure(u32,0x80000000); 
     117            Flt u32 = new Flt(c); 
     118            //int u33 = c.readInt(); e.ensure(u33,0); 
     119            Flt u33 = new Flt(c); 
     120            Flt f34 = new Flt(c); 
     121            //int u35 = c.readInt(); e.ensure(u35,0,0x35000000,0xc0000000); 
     122            Flt u35 = new Flt(c); 
     123            Flt f36 = new Flt(c); 
     124            int u36 = c.readInt(); e.ensure(u36,0); 
     125            //int u37 = c.readInt(); e.ensure(u35,0); 
     126            Flt u37 = new Flt(c); 
     127            //int u38 = c.readInt(); e.ensure(u38,0); 
     128            Flt u38 = new Flt(c); 
     129            //int u39 = c.readInt(); e.ensure(u39,0x80000000); 
     130            Flt u39 = new Flt(c); 
     131            Flt f40 = new Flt(c); 
     132            //int u41 = c.readInt(); e.ensure(u41,0); 
     133            Flt u41 = new Flt(c); 
     134            int u42 = c.readInt(); e.ensure(u42,0); 
     135            int u43 = c.readInt(); e.ensure(u43,0); 
     136            int u44 = c.readInt(); e.ensure(u44,0); 
     137            Flt f45 = new Flt(c); 
     138            int dummy=0; 
     139        } 
     140        if((u8&0x4000)!=0) 
     141        { 
     142            //u8b = c.readInt(); e.ensure(u8b,0,2,0x20,130,8,34); 
     143        } 
     144        int u24 = c.readInt(); //e.ensure(u24,-1,13,50,0,7,20,22,47,27,28,41); //50 
     145         
     146         
     147        int bytesleft = (startpos+size)-c.getAbsoluteOffset(); 
     148        if(bytesleft!=0) 
     149        { 
     150            int dummy=0; 
     151        } 
     152         
    35153    } 
    36154} 
  • drizzle/DrizzlePrp/src/realmyst/Sdb.java

    r1847 r1848  
    2020    public Bstr[] strs; 
    2121     
    22     public Count10[] count10s    ; 
     22    public Count2[] count2s; 
     23    public Count3Undone[] count3s; 
     24    public Count10[] count10s; 
    2325     
    2426    public Sdb(IBytestream c) 
     
    106108            //ignore = false; 
    107109            //throw new ignore("Unhandled count2."); 
    108             Count2Undone[] count2s = c.readArray(Count2Undone.class, count2); 
     110            count2s = c.readArray(Count2.class, count2); 
    109111        } 
    110112        int count3 = c.readInt(); //v72 
     
    113115            //ignore = false; 
    114116            //throw new ignore("Unhandled count3."); 
    115             Count3Undone[] count3s = c.readArray(Count3Undone.class, count3); 
     117            count3s = c.readArray(Count3Undone.class, count3); 
    116118        } 
    117119