Exemple #1
0
        public void SetTexture(long command)
        {
            FinalizeSubset();
            int w0 = (int)(command >> 0x20);
            int w1 = (int)(command & 0xFFFFFFFF);

            TextureManager.Tile tile = texMan.tiles[tmpLastTile = Utility.GetBits(w1, 3, 0x18)];
            if (w1 >> 0x18 != 0)
            {
                tmpSubset.texture.segmentedPointer = w1;
            }
            tmpSubset.texture.fmt = Utility.GetBits(w0, 3, 0x15);
            tmpSubset.texture.bpp = Utility.GetBits(w0, 2, 0x13);
            int a = Utility.GetBits(w0, 0xC, 0);

            if (a != 0)
            {
                tmpSubset.texture.width = a + 1;
            }

            ushort tsX = (ushort)Utility.GetBits(w1, 16, 16);
            ushort tsY = (ushort)Utility.GetBits(w1, 16, 0);

            //tmpSubset.texture.width = (ushort)(tsX >> 6) + 1;
            //tmpSubset.texture.height = (ushort)(tsY >> 6) + 1;
            //tmpSubset.texture.height = tmpSubset.texture.width == 0 ? 0 : (tmpSubset.texture.texels + 1) / tmpSubset.texture.width;
        }
Exemple #2
0
        public void LoadBlock(long command)
        {
            FinalizeSubset();
            int w0 = (int)(command >> 0x20), w1 = (int)(command & 0xFFFFFFFF);

            TextureManager.Tile tile = texMan.tiles[tmpLastTile = Utility.GetBits(w1, 4, 0x18)];
            tile.uls = Utility.GetBits(w0, 0xC, 0xC);
            tile.ult = Utility.GetBits(w0, 0xC, 0);
            tmpSubset.texture.texels = Utility.GetBits(w1, 0xC, 0xC);
            tmpSubset.texture.dxt    = Utility.GetBits(w1, 0xC, 0);

            tmpSubset.texture.height = tmpSubset.texture.width == 0 ? 0 : (tmpSubset.texture.texels + 1) / tmpSubset.texture.width;
        }
Exemple #3
0
        public void SetTileSize(long command)
        {
            FinalizeSubset();
            int w0 = (int)(command >> 0x20);
            int w1 = (int)(command & 0xFFFFFFFF);

            TextureManager.Tile tile = texMan.tiles[tmpLastTile = Utility.GetBits(w1, 4, 0x18)];
            tile.uls = Utility.GetBits(w0, 0xC, 0xC);
            tile.ult = Utility.GetBits(w0, 0xC, 0);
            tile.lrs = Utility.GetBits(w1, 0xC, 0xC);
            tile.lrt = Utility.GetBits(w1, 0xC, 0);

            tmpSubset.texture.width  = (tile.lrs - tile.uls) / 4 + 1;
            tmpSubset.texture.height = (tile.lrt - tile.ult) / 4 + 1;
        }