Exemple #1
0
    private void EncodeRGBAFloatTo16Bytes(float r, float g, float b, float a, byte[] rawTexdata, int idx_u, int idx_v)
    {
        int num = idx_v * 4 * 16 + idx_u * 16;
        UBER_RGBA_ByteArray uber_RGBA_ByteArray = default(UBER_RGBA_ByteArray);

        uber_RGBA_ByteArray.R = r;
        uber_RGBA_ByteArray.G = g;
        uber_RGBA_ByteArray.B = b;
        uber_RGBA_ByteArray.A = a;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte0;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte1;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte2;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte3;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte4;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte5;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte6;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte7;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte8;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte9;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte10;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte11;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte12;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte13;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte14;
        rawTexdata[num++]     = uber_RGBA_ByteArray.Byte15;
    }
    private void EncodeRGBAFloatTo16Bytes(float r, float g, float b, float a, byte[] rawTexdata, int idx_u, int idx_v)
    {
        const int capacity = 4; // 4 setups
        int       idx      = idx_v * capacity * 16 + idx_u * 16;

        UBER_RGBA_ByteArray barray = new UBER_RGBA_ByteArray();

        barray.R          = r;
        barray.G          = g;
        barray.B          = b;
        barray.A          = a;
        rawTexdata[idx++] = barray.Byte0;
        rawTexdata[idx++] = barray.Byte1;
        rawTexdata[idx++] = barray.Byte2;
        rawTexdata[idx++] = barray.Byte3;
        rawTexdata[idx++] = barray.Byte4;
        rawTexdata[idx++] = barray.Byte5;
        rawTexdata[idx++] = barray.Byte6;
        rawTexdata[idx++] = barray.Byte7;
        rawTexdata[idx++] = barray.Byte8;
        rawTexdata[idx++] = barray.Byte9;
        rawTexdata[idx++] = barray.Byte10;
        rawTexdata[idx++] = barray.Byte11;
        rawTexdata[idx++] = barray.Byte12;
        rawTexdata[idx++] = barray.Byte13;
        rawTexdata[idx++] = barray.Byte14;
        rawTexdata[idx++] = barray.Byte15;
    }
    private void EncodeRGBAFloatTo16Bytes(
        float r,
        float g,
        float b,
        float a,
        byte[] rawTexdata,
        int idx_u,
        int idx_v)
    {
        int num1 = idx_v * 4 * 16 + idx_u * 16;
        UBER_RGBA_ByteArray uberRgbaByteArray = new UBER_RGBA_ByteArray();

        uberRgbaByteArray.R = r;
        uberRgbaByteArray.G = g;
        uberRgbaByteArray.B = b;
        uberRgbaByteArray.A = a;
        byte[] numArray1 = rawTexdata;
        int    index1    = num1;
        int    num2      = index1 + 1;
        int    byte0     = (int)uberRgbaByteArray.Byte0;

        numArray1[index1] = (byte)byte0;
        byte[] numArray2 = rawTexdata;
        int    index2    = num2;
        int    num3      = index2 + 1;
        int    byte1     = (int)uberRgbaByteArray.Byte1;

        numArray2[index2] = (byte)byte1;
        byte[] numArray3 = rawTexdata;
        int    index3    = num3;
        int    num4      = index3 + 1;
        int    byte2     = (int)uberRgbaByteArray.Byte2;

        numArray3[index3] = (byte)byte2;
        byte[] numArray4 = rawTexdata;
        int    index4    = num4;
        int    num5      = index4 + 1;
        int    byte3     = (int)uberRgbaByteArray.Byte3;

        numArray4[index4] = (byte)byte3;
        byte[] numArray5 = rawTexdata;
        int    index5    = num5;
        int    num6      = index5 + 1;
        int    byte4     = (int)uberRgbaByteArray.Byte4;

        numArray5[index5] = (byte)byte4;
        byte[] numArray6 = rawTexdata;
        int    index6    = num6;
        int    num7      = index6 + 1;
        int    byte5     = (int)uberRgbaByteArray.Byte5;

        numArray6[index6] = (byte)byte5;
        byte[] numArray7 = rawTexdata;
        int    index7    = num7;
        int    num8      = index7 + 1;
        int    byte6     = (int)uberRgbaByteArray.Byte6;

        numArray7[index7] = (byte)byte6;
        byte[] numArray8 = rawTexdata;
        int    index8    = num8;
        int    num9      = index8 + 1;
        int    byte7     = (int)uberRgbaByteArray.Byte7;

        numArray8[index8] = (byte)byte7;
        byte[] numArray9 = rawTexdata;
        int    index9    = num9;
        int    num10     = index9 + 1;
        int    byte8     = (int)uberRgbaByteArray.Byte8;

        numArray9[index9] = (byte)byte8;
        byte[] numArray10 = rawTexdata;
        int    index10    = num10;
        int    num11      = index10 + 1;
        int    byte9      = (int)uberRgbaByteArray.Byte9;

        numArray10[index10] = (byte)byte9;
        byte[] numArray11 = rawTexdata;
        int    index11    = num11;
        int    num12      = index11 + 1;
        int    byte10     = (int)uberRgbaByteArray.Byte10;

        numArray11[index11] = (byte)byte10;
        byte[] numArray12 = rawTexdata;
        int    index12    = num12;
        int    num13      = index12 + 1;
        int    byte11     = (int)uberRgbaByteArray.Byte11;

        numArray12[index12] = (byte)byte11;
        byte[] numArray13 = rawTexdata;
        int    index13    = num13;
        int    num14      = index13 + 1;
        int    byte12     = (int)uberRgbaByteArray.Byte12;

        numArray13[index13] = (byte)byte12;
        byte[] numArray14 = rawTexdata;
        int    index14    = num14;
        int    num15      = index14 + 1;
        int    byte13     = (int)uberRgbaByteArray.Byte13;

        numArray14[index14] = (byte)byte13;
        byte[] numArray15 = rawTexdata;
        int    index15    = num15;
        int    num16      = index15 + 1;
        int    byte14     = (int)uberRgbaByteArray.Byte14;

        numArray15[index15] = (byte)byte14;
        byte[] numArray16 = rawTexdata;
        int    index16    = num16;
        int    num17      = index16 + 1;
        int    byte15     = (int)uberRgbaByteArray.Byte15;

        numArray16[index16] = (byte)byte15;
    }