Ejemplo n.º 1
0
        private static void CMD_13(ref Model3D mdl, ref Level lvl, byte[] cmd, byte?areaID)
        {
            byte  drawLayer  = cmd[1];
            short x          = (short)bytesToInt(cmd, 2, 2);
            short y          = (short)bytesToInt(cmd, 4, 2);
            short z          = (short)bytesToInt(cmd, 6, 2);
            uint  seg_offset = bytesToInt(cmd, 8, 4);
            byte  seg        = (byte)(seg_offset >> 24);

            if (seg > 0x20)
            {
                return;
            }
            uint off = seg_offset & 0xFFFFFF;

            mdl.builder.Offset = new OpenTK.Vector3(x, y, z) + getTotalOffset();
            // Don't bother processing duplicate display lists.
            if (seg_offset != 0)
            {
                if (!mdl.hasGeoDisplayList(off))
                {
                    Fast3DScripts.parse(ref mdl, ref lvl, seg, off, areaID);
                }
                lvl.temp_bgInfo.usesFog              = mdl.builder.UsesFog;
                lvl.temp_bgInfo.fogColor             = mdl.builder.FogColor;
                lvl.temp_bgInfo.fogColor_romLocation = mdl.builder.FogColor_romLocation;
            }
            else
            {
                nodeCurrent.offset += new OpenTK.Vector3(x, y, z);
            }
        }
Ejemplo n.º 2
0
        private static void CMD_15(ref Model3D mdl, ref Level lvl, byte[] cmd)
        {
            // if (bytesToInt(cmd, 4, 4) != 0x07006D70) return;
            byte drawLayer = cmd[1];
            byte seg       = cmd[4];
            uint off       = bytesToInt(cmd, 5, 3);

            mdl.builder.Offset = getTotalOffset();
            // Don't bother processing duplicate display lists.
            if (!mdl.hasGeoDisplayList(off))
            {
                Globals.DEBUG_PDL = bytesToInt(cmd, 4, 4);
                Fast3DScripts.parse(ref mdl, ref lvl, seg, off);
            }
        }
Ejemplo n.º 3
0
        private static void CMD_15(ref Model3D mdl, ref Level lvl, byte[] cmd, byte?areaID)
        {
            // if (bytesToInt(cmd, 4, 4) != 0x07006D70) return;
            byte drawLayer = cmd[1];
            byte seg       = cmd[4];

            if (seg > 0x20)
            {
                return;
            }
            uint off = bytesToInt(cmd, 5, 3);

            mdl.builder.Offset = getTotalOffset();
            // Don't bother processing duplicate display lists.
            if (!mdl.hasGeoDisplayList(off))
            {
                Fast3DScripts.parse(ref mdl, ref lvl, seg, off, areaID);
            }

            lvl.temp_bgInfo.usesFog              = mdl.builder.UsesFog;
            lvl.temp_bgInfo.fogColor             = mdl.builder.FogColor;
            lvl.temp_bgInfo.fogColor_romLocation = mdl.builder.FogColor_romLocation;
        }
Ejemplo n.º 4
0
        private static void CMD_13(ref Model3D mdl, ref Level lvl, byte[] cmd)
        {
            byte  drawLayer  = cmd[1];
            short x          = (short)bytesToInt(cmd, 2, 2);
            short y          = (short)bytesToInt(cmd, 4, 2);
            short z          = (short)bytesToInt(cmd, 6, 2);
            uint  seg_offset = bytesToInt(cmd, 8, 4);
            byte  seg        = (byte)(seg_offset >> 24);
            uint  off        = seg_offset & 0xFFFFFF;

            mdl.builder.Offset = new OpenTK.Vector3(x, y, z) + getTotalOffset();
            // Don't bother processing duplicate display lists.
            if (seg_offset != 0)
            {
                if (!mdl.hasGeoDisplayList(off))
                {
                    Fast3DScripts.parse(ref mdl, ref lvl, seg, off);
                }
            }
            else
            {
                nodeCurrent.offset += new OpenTK.Vector3(x, y, z);
            }
        }