Code: Select all
//------------------------------------------------
//--- 010 Editor v10.0.2 Binary Template
//
//      File: PopCap (SexyApp/Sexy App) Framework *.TEX (SEXY Texture)
//      Authors: LolHacksRule
//      Version: 1
//      Purpose: Gets data out of the binary.
//      Category: Metadata
//      File Mask: SEXYTEX
//      ID Bytes:
//      History: 
//------------------------------------------------
LittleEndian();
struct Header {
    char    sexyTexHeader[7]<bgcolor=cGreen>; //Should be SEXYTEX
    char    padding[5]<bgcolor=cRed>; //should be 00
} header;
struct TexMetaData {
    uint    texWidth<bgcolor=cBlue>; //Width
    uint    texHeight<bgcolor=cLtBlue>;
    uint    texFmt<bgcolor=cPurple>; //03 = ARGB4444, 02 = ARGB8888
    uint    unknown2<bgcolor=cRed>;
    uint    unknown3<bgcolor=cRed>;
    uint    zLibCompressedTexSize<bgcolor=cRed>;
    char    morePadding[12]<bgcolor=cRed>;
} texMetaDataTable;
Code: Select all
    #RGBA8888 texture
    if texFmt == 0x2:
        print("RGBA8888: format detected")
        texData = rapi.imageDecodeRaw(decompTex, texWidth, texHeight, "r8 g8 b8 a8")
        texFmt = noesis.NOESISTEX_RGBA32
    #RGBA4444 texture
    elif texFmt == 0x3:
        print("RGBA4444: format detected")
        texData = rapi.imageDecodeRaw(decompTex, texWidth, texHeight, "r4 g4 b4 a4")
        texFmt = noesis.NOESISTEX_RGBA32
    else:
        print("UNKNOWN TEXTURE FORMAT DETECTED!")
        return None
    texList.append(NoeTexture(rapi.getInputName(), texWidth, texHeight, texData, texFmt))
    return 1