public Form2(LUTs lutc, string namein, char typet) { luts = lutc; type = typet; name = namein; InitializeComponent(); }
public void ParseDL(int offset, LUTs LUTc, SpecialRendering specialRendering = SpecialRendering.Off, List <GBI.Utils.LSUtil> labelsearchers = null, GBI.GBI GBIc = null) { if (GBIc == null) { GBIc = new GBI.GBI(); } GBI.F3DCommand dlelem; for (int n = offset; n < dldata.Count; n++) { dlelem = dldata[n]; switch (dlelem.Command) { case GBI.GBICommand.gsSPEndDisplayList: if (specialRendering == SpecialRendering.SEQ) { break; } return; case GBI.GBICommand.gsSPDisplayList: if (specialRendering == SpecialRendering.SEQ) { break; } ParseDL(F3DUtils.getIndexFromLabelSearchersAndName(labelsearchers, dlelem.Params[0].GetVal()), LUTc, SpecialRendering.Off, null, GBIc); break; case GBI.GBICommand.gsSP1Triangle: GBIc.gsSP1Triangle( dlelem.Params[0].GetVal(), dlelem.Params[1].GetVal(), dlelem.Params[2].GetVal(), dlelem.Params.Count > 3 ? dlelem.Params[3].GetVal() : 0 ); break; case GBI.GBICommand.gsSP2Triangles: GBIc.gsSP2Triangles( dlelem.Params[0].GetVal(), dlelem.Params[1].GetVal(), dlelem.Params[2].GetVal(), dlelem.Params[3].GetVal(), dlelem.Params[4].GetVal(), dlelem.Params[5].GetVal(), dlelem.Params[6].GetVal(), dlelem.Params.Count > 7 ? dlelem.Params[7].GetVal() : 0 ); break; case GBI.GBICommand.gsSPClearGeometryMode: GBIc.gsSPClearGeometryMode(F3DUtils.getGeomModeFromParams(dlelem.Params)); break; case GBI.GBICommand.gsSPSetGeometryMode: GBIc.gsSPSetGeometryMode(F3DUtils.getGeomModeFromParams(dlelem.Params)); break; case GBI.GBICommand.gsSPVertex: GBIc.gsSPVertex(F3DUtils.getVtxFromName(dlelem.Params[0].GetVal(), LUTc.vtxLUT).ToArray(), (byte)dlelem.Params[1].GetVal(), (byte)dlelem.Params[2].GetVal()); break; case GBI.GBICommand.gsSPLight: GBIc.gsSPLight(F3DUtils.getLightFromName(dlelem.Params[0].GetVal(), LUTc.lightLUT), (byte)dlelem.Params[1].GetVal()); break; case GBI.GBICommand.gsDPSetEnvColor: GBIc.gsDPSetEnvColor( (byte)dlelem.Params[0].GetVal(), //r (byte)dlelem.Params[1].GetVal(), //g (byte)dlelem.Params[2].GetVal(), //b (byte)dlelem.Params[3].GetVal() //a ); break; case GBI.GBICommand.gsDPSetTextureImage: GBIc.gsDPSetTextureImage(F3DUtils.getTexFromName(dlelem.Params[3].GetVal(), LUTc.texLUT)); break; case GBI.GBICommand.gsDPLoadTextureBlock: GBIc.gsDPSetTextureImage(F3DUtils.getTexFromName(dlelem.Params[0].GetVal(), LUTc.texLUT)); break; case GBI.GBICommand.gsDPSetTile: GBIc.gsDPSetTile(F3DUtils.getWarpSTFromParams(dlelem.Params)); break; } } }
public void ParseDL(int offset, GBI GBIc, LUTs LUTc) { int n = -1; foreach (string line in dldata) { n++; if (n < offset - 1) { continue; } if (!(line.Contains("gsSP") || line.Contains("gsDP"))) { continue; } vals = MISCUtils.ParseAsmbd(line); if (vals[0] == "gsSPEndDisplayList" && offset > 0) { return; } if (vals[0] == "gsSP1Triangle") { GBIc.gsSP1Triangle( MISCUtils.ParseInt(vals[1]), MISCUtils.ParseInt(vals[2]), MISCUtils.ParseInt(vals[3]), MISCUtils.ParseInt(vals[4]) ); } if (vals[0] == "gsSP2Triangles") { GBIc.gsSP2Triangles( MISCUtils.ParseInt(vals[1]), MISCUtils.ParseInt(vals[2]), MISCUtils.ParseInt(vals[3]), MISCUtils.ParseInt(vals[4]), MISCUtils.ParseInt(vals[5]), MISCUtils.ParseInt(vals[6]), MISCUtils.ParseInt(vals[7]), MISCUtils.ParseInt(vals[8]) ); } if (vals[0] == "gsSPClearGeometryMode") { GBIc.gsSPClearGeometryMode(F3DUtils.getGeomModeFromLineData(vals)); } if (vals[0] == "gsSPSetGeometryMode") { GBIc.gsSPSetGeometryMode(F3DUtils.getGeomModeFromLineData(vals)); } if (vals[0] == "gsSPVertex") { GBIc.gsSPVertex(F3DUtils.getVtxFromName(vals[1], LUTc.vtxLUT).ToArray(), (byte)MISCUtils.ParseInt(vals[2]), (byte)MISCUtils.ParseInt(vals[3])); } if (vals[0] == "gsSPLight") { GBIc.gsSPLight(F3DUtils.getLightFromName(vals[1], LUTc.lightLUT), (byte)MISCUtils.ParseInt(vals[2])); } if (vals[0] == "gsDPSetEnvColor") { GBIc.gsDPSetEnvColor( (byte)MISCUtils.ParseInt(vals[1]), //r (byte)MISCUtils.ParseInt(vals[2]), //g (byte)MISCUtils.ParseInt(vals[3]), //b (byte)MISCUtils.ParseInt(vals[4]) //a ); } if (vals[0] == "gsDPSetTextureImage") { GBIc.gsDPSetTextureImage(F3DUtils.getTexFromName(vals[4], LUTc.texLUT)); } if (vals[0] == "gsDPSetTile") { GBIc.gsDPSetTile(F3DUtils.getWarpSTFromLineData(vals)); } } }