Esempio n. 1
0
    public static void DrawSprt(Boolean abe, Boolean tge, ref Color32 c0, ref PSX_LIBGPU.XY p0, ref PSX_LIBGPU.UV t0, ref PSX_LIBGPU.WH size, Int32 TP, Int32 ABR, Int32 TY, Int32 TX, Int32 clutY, Int32 clutX)
    {
        Byte a = c0.a;

        PSXGPU.p1.x  = (Single)(p0.x + size.w);
        PSXGPU.p1.y  = (Single)(p0.y + size.h);
        PSXGPU.p1.z  = PSXGPU.zDepth;
        PSXGPU.uv0.x = (Single)t0.u + 0.5f;
        PSXGPU.uv0.y = (Single)t0.v + 0.5f;
        PSXGPU.uv1.x = (Single)((Int16)t0.u + size.w) - 0.5f;
        PSXGPU.uv1.y = (Single)((Int16)t0.v + size.h) - 0.5f;
        PSXGPU.SetMaterial(PSXGPU.matPSXShaderTextureShading);
        PSXGPU.SetTexture(TP, TY, TX, clutY, clutX, FilterMode.Bilinear);
        c0.a = PSXGPU.SetShader(abe, ABR, PSXGPU.drOffset);
        PSXGPU.SetPolygon(7);
        GL.Color(c0);
        GL.TexCoord(PSXGPU.uv0);
        GL.Vertex3((Single)p0.x, (Single)p0.y, PSXGPU.zDepth);
        GL.Color(c0);
        GL.TexCoord2(PSXGPU.uv1.x, PSXGPU.uv0.y);
        GL.Vertex3(PSXGPU.p1.x, (Single)p0.y, PSXGPU.zDepth);
        GL.Color(c0);
        GL.TexCoord(PSXGPU.uv1);
        GL.Vertex(PSXGPU.p1);
        GL.Color(c0);
        GL.TexCoord2(PSXGPU.uv0.x, PSXGPU.uv1.y);
        GL.Vertex3((Single)p0.x, PSXGPU.p1.y, PSXGPU.zDepth);
        GL.End();
        c0.a = a;
    }
Esempio n. 2
0
    public static void DrawPolyGT3(Int32 drawMode, Byte code, UInt16 clut, UInt16 tpage, Boolean tge, ref Color32 c0, ref PSX_LIBGPU.XY p0, ref PSX_LIBGPU.UV t0, ref Color32 c1, ref PSX_LIBGPU.XY p1, ref PSX_LIBGPU.UV t1, ref Color32 c2, ref PSX_LIBGPU.XY p2, ref PSX_LIBGPU.UV t2)
    {
        Byte    a       = c0.a;
        Byte    a2      = c1.a;
        Byte    a3      = c2.a;
        Boolean abe     = PSXGPU.IsSemiTrans(code);
        Int32   flagABR = PSXGPU.GetFlagABR(tpage);

        if ((drawMode & 1) != 0)
        {
            Int32 flagTP    = PSXGPU.GetFlagTP(tpage);
            Int32 flagTY    = PSXGPU.GetFlagTY(tpage);
            Int32 flagTX    = PSXGPU.GetFlagTX(tpage);
            Int32 flagClutY = PSXGPU.GetFlagClutY(clut);
            Int32 flagClutX = PSXGPU.GetFlagClutX(clut);
            PSXGPU.SetMaterial(PSXGPU.matPSXShaderTextureShading);
            PSXGPU.SetTexture(flagTP, flagTY, flagTX, flagClutY, flagClutX, FilterMode.Point);
            c0.a = (c1.a = (c2.a = PSXGPU.SetShader(abe, flagABR, PSXGPU.drOffset)));
            PSXGPU.SetPolygon(4);
        }
        else
        {
            c0.a = (c1.a = (c2.a = PSXGPU.GetAlpha(abe, flagABR)));
        }
        GL.Color(c0);
        GL.TexCoord2((Single)t0.u, (Single)t0.v);
        GL.Vertex3((Single)p0.x, (Single)p0.y, PSXGPU.zDepth);
        GL.Color(c1);
        GL.TexCoord2((Single)t1.u, (Single)t1.v);
        GL.Vertex3((Single)p1.x, (Single)p1.y, PSXGPU.zDepth);
        GL.Color(c2);
        GL.TexCoord2((Single)t2.u, (Single)t2.v);
        GL.Vertex3((Single)p2.x, (Single)p2.y, PSXGPU.zDepth);
        if ((drawMode & 2) != 0)
        {
            GL.End();
        }
        c0.a = a;
        c1.a = a2;
        c2.a = a3;
    }