Example #1
0
        public virtual GETexture getGEIndexedTexture(IRenderingEngine re, GETexture baseGETexture, int address, int bufferWidth, int width, int height, int pixelFormat)
        {
            GETexture geTexture = checkGETexture(address, bufferWidth, width, height, pixelFormat);

            if (geTexture == null)
            {
                long?key = getKey(address, bufferWidth, width, height, pixelFormat);
                geTexture       = new GEIndexedTexture(baseGETexture, address, bufferWidth, width, height, pixelFormat);
                geTextures[key] = geTexture;
            }

            return(geTexture);
        }
Example #2
0
        private GETexture checkGETexturePSM8888(int address, int bufferWidth, int width, int height, int pixelFormat)
        {
            GETexture geTexture = null;

            if (pixelFormat == GeCommands.TPSM_PIXEL_STORAGE_MODE_32BIT_ABGR8888)
            {
                geTexture = checkGETexture(address, bufferWidth << 1, width, height, GeCommands.TPSM_PIXEL_STORAGE_MODE_16BIT_BGR5650);
                if (geTexture != null)
                {
                    long?key = getKey(address, bufferWidth, width, height, pixelFormat);
                    geTextures.Remove(key);
                }
            }

            return(geTexture);
        }
Example #3
0
        public GEIndexedTexture(GETexture geTexture, int address, int bufferWidth, int width, int height, int pixelFormat) : base(geTexture, address, bufferWidth, width, height, pixelFormat)
        {
            // Map the pixel format:
            // TPSM_PIXEL_STORAGE_MODE_16BIT_INDEXED -> RE_PIXEL_STORAGE_16BIT_INDEXED_BGR5650
            //                                          RE_PIXEL_STORAGE_16BIT_INDEXED_ABGR5651
            //                                          RE_PIXEL_STORAGE_16BIT_INDEXED_ABGR4444
            // TPSM_PIXEL_STORAGE_MODE_32BIT_INDEXED -> RE_PIXEL_STORAGE_32BIT_INDEXED_ABGR8888
            switch (pixelFormat)
            {
            case GeCommands.TPSM_PIXEL_STORAGE_MODE_16BIT_INDEXED:
                this.pixelFormat = geTexture.pixelFormat - GeCommands.TPSM_PIXEL_STORAGE_MODE_16BIT_BGR5650 + pspsharp.graphics.RE.IRenderingEngine_Fields.RE_PIXEL_STORAGE_16BIT_INDEXED_BGR5650;
                break;

            case GeCommands.TPSM_PIXEL_STORAGE_MODE_32BIT_INDEXED:
                this.pixelFormat = pspsharp.graphics.RE.IRenderingEngine_Fields.RE_PIXEL_STORAGE_32BIT_INDEXED_ABGR8888;
                break;
            }
        }
Example #4
0
        public virtual GETexture getGETexture(IRenderingEngine re, int address, int bufferWidth, int width, int height, int pixelFormat, bool useViewportResize)
        {
            int       gePixelFormat = getTexturePixelFormat(pixelFormat);
            GETexture geTexture     = checkGETexturePSM8888(address, bufferWidth, width, height, pixelFormat);

            if (geTexture == null)
            {
                geTexture = checkGETexture(address, bufferWidth, width, height, pixelFormat);
            }

            if (geTexture == null)
            {
                long?key = getKey(address, bufferWidth, width, height, pixelFormat);
                geTexture       = new GETexture(address, bufferWidth, width, height, gePixelFormat, useViewportResize);
                geTextures[key] = geTexture;
            }

            return(geTexture);
        }
Example #5
0
 public GEResizedTexture(GETexture geTexture, int address, int bufferWidth, int width, int height, int pixelFormat) : base(geTexture, address, bufferWidth, width, height, pixelFormat, false)
 {
     x = 0;
     y = height - geTexture.Height;
 }
Example #6
0
 public GEProxyTexture(GETexture geTexture, int address, int bufferWidth, int width, int height, int pixelFormat, bool useViewportResize) : base(address, Utilities.makePow2(width), width, height, pixelFormat, useViewportResize)
 {
     this.geTexture = geTexture;
 }