コード例 #1
0
ファイル: Fast3DScripts.cs プロジェクト: theirishduck/Quad64
        private static void switchTextureStatus(ref Model3D mdl, ref TempMaterial temp, bool status, byte?areaID)
        {
            ROM rom = ROM.Instance;

            if (mdl.builder.processingTexture != status)
            {
                if (status == false)
                {
                    if (!mdl.builder.hasTexture(temp.segOff))
                    {
                        if (temp.segOff != 0 && temp.w != 0 && temp.h != 0)
                        {
                            mdl.builder.AddTexture(
                                TextureFormats.decodeTexture(
                                    temp.format,
                                    rom.getDataFromSegmentAddress_safe(
                                        temp.segOff,
                                        (uint)(temp.w * temp.h * 4),
                                        areaID
                                        ),
                                    temp.w,
                                    temp.h,
                                    temp.palette,
                                    temp.isPaletteRGBA16
                                    ),
                                mdl.builder.newTexInfo(temp.wrapS, temp.wrapT),
                                temp.segOff
                                );
                        }
                        else
                        {
                            mdl.builder.AddTexture(
                                TextureFormats.createColorTexture(System.Drawing.Color.FromArgb((int)temp.color)),
                                mdl.builder.newTexInfo(temp.wrapS, temp.wrapT),
                                temp.segOff
                                );
                        }
                    }
                }
                mdl.builder.processingTexture = status;
            }
        }
コード例 #2
0
        private static void switchTextureStatus(ref Model3D mdl, ref TempMaterial temp, bool status)
        {
            ROM rom = ROM.Instance;

            if (mdl.builder.processingTexture != status)
            {
                if (status == false)
                {
                    if (!mdl.builder.hasTexture(temp.segOff))
                    {
                        //System.Console.WriteLine("Adding new texture!");
                        if (temp.segOff != 0)
                        {
                            //System.Console.WriteLine("temp.segOff = " + temp.segOff.ToString("X8"));
                            mdl.builder.AddTexture(
                                TextureFormats.decodeTexture(
                                    temp.format,
                                    rom.getDataFromSegmentAddress(
                                        temp.segOff,
                                        (uint)(temp.w * temp.h * 2)
                                        ),
                                    temp.w,
                                    temp.h
                                    ),
                                mdl.builder.newTexInfo(temp.wrapS, temp.wrapT),
                                temp.segOff
                                );
                        }
                        else
                        {
                            mdl.builder.AddTexture(
                                TextureFormats.createColorTexture(System.Drawing.Color.FromArgb((int)temp.color)),
                                mdl.builder.newTexInfo(temp.wrapS, temp.wrapT),
                                temp.segOff
                                );
                        }
                    }
                }
                mdl.builder.processingTexture = status;
            }
        }