init
This commit is contained in:
426
expkg/src/Entry.h
Normal file
426
expkg/src/Entry.h
Normal file
@ -0,0 +1,426 @@
|
||||
//
|
||||
// Created by sfd on 25-8-4.
|
||||
//
|
||||
|
||||
#ifndef ENTRY_H
|
||||
#define ENTRY_H
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
|
||||
#include "Core.h"
|
||||
|
||||
namespace PKG
|
||||
{
|
||||
enum class TexFormat
|
||||
{
|
||||
RGBA8888 = 0,
|
||||
DXT5 = 4,
|
||||
DXT3 = 6,
|
||||
DXT1 = 7,
|
||||
RG88 = 8,
|
||||
R8 = 9
|
||||
};
|
||||
|
||||
enum class TexType
|
||||
{
|
||||
None = 0,
|
||||
NoInterpolation = 1,
|
||||
ClampUVs = 2,
|
||||
IsGif = 4,
|
||||
// Placeholders
|
||||
Unk3 = 8,
|
||||
Unk4 = 16,
|
||||
IsVideoTexture = 32,
|
||||
Unk6 = 64,
|
||||
Unk7 = 128,
|
||||
};
|
||||
|
||||
|
||||
enum class MipmapFormat
|
||||
{
|
||||
Invalid = 0,
|
||||
|
||||
/// Raw pixels (4 bytes per pixel) (RGBA8888)
|
||||
RGBA8888 = 1,
|
||||
|
||||
/// Raw pixels (1 byte per pixel) (R8)
|
||||
R8 = 2,
|
||||
|
||||
/// Raw pixels (2 bytes per pixel) (RG88)
|
||||
RG88 = 3,
|
||||
|
||||
/// Raw pixels compressed using DXT5
|
||||
CompressedDXT5,
|
||||
|
||||
/// Raw pixels compressed using DXT3
|
||||
CompressedDXT3,
|
||||
|
||||
/// Raw pixels compressed using DXT1
|
||||
CompressedDXT1,
|
||||
|
||||
|
||||
/// MP4 Video
|
||||
VideoMp4,
|
||||
|
||||
|
||||
/// Windows or OS/2 Bitmap File (*.BMP)
|
||||
|
||||
/// Keep '= 1000' because MipmapFormatExtensions.IsImage uses this to check if format is an image format
|
||||
ImageBMP = 1000,
|
||||
|
||||
|
||||
/// Windows Icon (*.ICO)
|
||||
ImageICO,
|
||||
|
||||
|
||||
/// Independent JPEG Group (*.JPG, *.JIF, *.JPEG, *.JPE)
|
||||
ImageJPEG,
|
||||
|
||||
|
||||
/// JPEG Network Graphics (*.JNG)
|
||||
ImageJNG,
|
||||
|
||||
|
||||
/// Commodore 64 Koala format (*.KOA)
|
||||
ImageKOALA,
|
||||
|
||||
|
||||
/// Amiga IFF (*.IFF, *.LBM)
|
||||
ImageLBM,
|
||||
|
||||
|
||||
/// Amiga IFF (*.IFF, *.LBM)
|
||||
ImageIFF,
|
||||
|
||||
|
||||
/// Multiple Network Graphics (*.MNG)
|
||||
ImageMNG,
|
||||
|
||||
|
||||
/// Portable Bitmap (ASCII) (*.PBM)
|
||||
ImagePBM,
|
||||
|
||||
|
||||
/// Portable Bitmap (BINARY) (*.PBM)
|
||||
ImagePBMRAW,
|
||||
|
||||
|
||||
/// Kodak PhotoCD (*.PCD)
|
||||
ImagePCD,
|
||||
|
||||
|
||||
/// Zsoft Paintbrush PCX bitmap format (*.PCX)
|
||||
ImagePCX,
|
||||
|
||||
|
||||
/// Portable Graymap (ASCII) (*.PGM)
|
||||
ImagePGM,
|
||||
|
||||
|
||||
/// Portable Graymap (BINARY) (*.PGM)
|
||||
ImagePGMRAW,
|
||||
|
||||
|
||||
/// Portable Network Graphics (*.PNG)
|
||||
ImagePNG,
|
||||
|
||||
|
||||
/// Portable Pixelmap (ASCII) (*.PPM)
|
||||
ImagePPM,
|
||||
|
||||
|
||||
/// Portable Pixelmap (BINARY) (*.PPM)
|
||||
ImagePPMRAW,
|
||||
|
||||
|
||||
/// Sun Rasterfile (*.RAS)
|
||||
ImageRAS,
|
||||
|
||||
|
||||
/// truevision Targa files (*.TGA, *.TARGA)
|
||||
ImageTARGA,
|
||||
|
||||
|
||||
/// Tagged Image File Format (*.TIF, *.TIFF)
|
||||
ImageTIFF,
|
||||
|
||||
|
||||
/// Wireless Bitmap (*.WBMP)
|
||||
ImageWBMP,
|
||||
|
||||
|
||||
/// Adobe Photoshop (*.PSD)
|
||||
ImagePSD,
|
||||
|
||||
|
||||
/// Dr. Halo (*.CUT)
|
||||
ImageCUT,
|
||||
|
||||
|
||||
/// X11 Bitmap Format (*.XBM)
|
||||
ImageXBM,
|
||||
|
||||
|
||||
/// X11 Pixmap Format (*.XPM)
|
||||
ImageXPM,
|
||||
|
||||
|
||||
/// DirectDraw Surface (*.DDS)
|
||||
ImageDDS,
|
||||
|
||||
|
||||
/// Graphics Interchange Format (*.GIF)
|
||||
ImageGIF,
|
||||
|
||||
|
||||
/// High Dynamic Range (*.HDR)
|
||||
ImageHDR,
|
||||
|
||||
|
||||
/// Raw Fax format CCITT G3 (*.G3)
|
||||
ImageFAXG3,
|
||||
|
||||
|
||||
/// Silicon Graphics SGI image format (*.SGI)
|
||||
ImageSGI,
|
||||
|
||||
|
||||
/// OpenEXR format (*.EXR)
|
||||
ImageEXR,
|
||||
|
||||
|
||||
/// JPEG-2000 format (*.J2K, *.J2C)
|
||||
ImageJ2K,
|
||||
|
||||
|
||||
/// JPEG-2000 format (*.JP2)
|
||||
ImageJP2,
|
||||
|
||||
|
||||
/// Portable FloatMap (*.PFM)
|
||||
ImagePFM,
|
||||
|
||||
|
||||
/// Macintosh PICT (*.PICT)
|
||||
ImagePICT,
|
||||
|
||||
|
||||
/// RAW camera image (*.*)
|
||||
ImageRAW,
|
||||
};
|
||||
|
||||
enum class FreeImageFormat {
|
||||
/// <summary>
|
||||
/// Unknown format (returned value only, never use it as input value)
|
||||
/// </summary>
|
||||
FIF_UNKNOWN = -1,
|
||||
|
||||
/// <summary>
|
||||
/// Windows or OS/2 Bitmap File (*.BMP)
|
||||
/// </summary>
|
||||
FIF_BMP = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Windows Icon (*.ICO)
|
||||
/// </summary>
|
||||
FIF_ICO = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Independent JPEG Group (*.JPG, *.JIF, *.JPEG, *.JPE)
|
||||
/// </summary>
|
||||
FIF_JPEG = 2,
|
||||
|
||||
/// <summary>
|
||||
/// JPEG Network Graphics (*.JNG)
|
||||
/// </summary>
|
||||
FIF_JNG = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Commodore 64 Koala format (*.KOA)
|
||||
/// </summary>
|
||||
FIF_KOALA = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Amiga IFF (*.IFF, *.LBM)
|
||||
/// </summary>
|
||||
FIF_LBM = 5,
|
||||
|
||||
/// <summary>
|
||||
/// Amiga IFF (*.IFF, *.LBM)
|
||||
/// </summary>
|
||||
FIF_IFF = 5,
|
||||
|
||||
/// <summary>
|
||||
/// Multiple Network Graphics (*.MNG)
|
||||
/// </summary>
|
||||
FIF_MNG = 6,
|
||||
|
||||
/// <summary>
|
||||
/// Portable Bitmap (ASCII) (*.PBM)
|
||||
/// </summary>
|
||||
FIF_PBM = 7,
|
||||
|
||||
/// <summary>
|
||||
/// Portable Bitmap (BINARY) (*.PBM)
|
||||
/// </summary>
|
||||
FIF_PBMRAW = 8,
|
||||
|
||||
/// <summary>
|
||||
/// Kodak PhotoCD (*.PCD)
|
||||
/// </summary>
|
||||
FIF_PCD = 9,
|
||||
|
||||
/// <summary>
|
||||
/// Zsoft Paintbrush PCX bitmap format (*.PCX)
|
||||
/// </summary>
|
||||
FIF_PCX = 10,
|
||||
|
||||
/// <summary>
|
||||
/// Portable Graymap (ASCII) (*.PGM)
|
||||
/// </summary>
|
||||
FIF_PGM = 11,
|
||||
|
||||
/// <summary>
|
||||
/// Portable Graymap (BINARY) (*.PGM)
|
||||
/// </summary>
|
||||
FIF_PGMRAW = 12,
|
||||
|
||||
/// <summary>
|
||||
/// Portable Network Graphics (*.PNG)
|
||||
/// </summary>
|
||||
FIF_PNG = 13,
|
||||
|
||||
/// <summary>
|
||||
/// Portable Pixelmap (ASCII) (*.PPM)
|
||||
/// </summary>
|
||||
FIF_PPM = 14,
|
||||
|
||||
/// <summary>
|
||||
/// Portable Pixelmap (BINARY) (*.PPM)
|
||||
/// </summary>
|
||||
FIF_PPMRAW = 15,
|
||||
|
||||
/// <summary>
|
||||
/// Sun Rasterfile (*.RAS)
|
||||
/// </summary>
|
||||
FIF_RAS = 16,
|
||||
|
||||
/// <summary>
|
||||
/// truevision Targa files (*.TGA, *.TARGA)
|
||||
/// </summary>
|
||||
FIF_TARGA = 17,
|
||||
|
||||
/// <summary>
|
||||
/// Tagged Image File Format (*.TIF, *.TIFF)
|
||||
/// </summary>
|
||||
FIF_TIFF = 18,
|
||||
|
||||
/// <summary>
|
||||
/// Wireless Bitmap (*.WBMP)
|
||||
/// </summary>
|
||||
FIF_WBMP = 19,
|
||||
|
||||
/// <summary>
|
||||
/// Adobe Photoshop (*.PSD)
|
||||
/// </summary>
|
||||
FIF_PSD = 20,
|
||||
|
||||
/// <summary>
|
||||
/// Dr. Halo (*.CUT)
|
||||
/// </summary>
|
||||
FIF_CUT = 21,
|
||||
|
||||
/// <summary>
|
||||
/// X11 Bitmap Format (*.XBM)
|
||||
/// </summary>
|
||||
FIF_XBM = 22,
|
||||
|
||||
/// <summary>
|
||||
/// X11 Pixmap Format (*.XPM)
|
||||
/// </summary>
|
||||
FIF_XPM = 23,
|
||||
|
||||
/// <summary>
|
||||
/// DirectDraw Surface (*.DDS)
|
||||
/// </summary>
|
||||
FIF_DDS = 24,
|
||||
|
||||
/// <summary>
|
||||
/// Graphics Interchange Format (*.GIF)
|
||||
/// </summary>
|
||||
FIF_GIF = 25,
|
||||
|
||||
/// <summary>
|
||||
/// High Dynamic Range (*.HDR)
|
||||
/// </summary>
|
||||
FIF_HDR = 26,
|
||||
|
||||
/// <summary>
|
||||
/// Raw Fax format CCITT G3 (*.G3)
|
||||
/// </summary>
|
||||
FIF_FAXG3 = 27,
|
||||
|
||||
/// <summary>
|
||||
/// Silicon Graphics SGI image format (*.SGI)
|
||||
/// </summary>
|
||||
FIF_SGI = 28,
|
||||
|
||||
/// <summary>
|
||||
/// OpenEXR format (*.EXR)
|
||||
/// </summary>
|
||||
FIF_EXR = 29,
|
||||
|
||||
/// <summary>
|
||||
/// JPEG-2000 format (*.J2K, *.J2C)
|
||||
/// </summary>
|
||||
FIF_J2K = 30,
|
||||
|
||||
/// <summary>
|
||||
/// JPEG-2000 format (*.JP2)
|
||||
/// </summary>
|
||||
FIF_JP2 = 31,
|
||||
|
||||
/// <summary>
|
||||
/// Portable FloatMap (*.PFM)
|
||||
/// </summary>
|
||||
FIF_PFM = 32,
|
||||
|
||||
/// <summary>
|
||||
/// Macintosh PICT (*.PICT)
|
||||
/// </summary>
|
||||
FIF_PICT = 33,
|
||||
|
||||
/// <summary>
|
||||
/// RAW camera image (*.*)
|
||||
/// </summary>
|
||||
FIF_RAW = 34,
|
||||
|
||||
/// <summary>
|
||||
/// RAW camera MP4 (*.mp4)
|
||||
/// </summary>
|
||||
FIF_MP4 = 35,
|
||||
};
|
||||
|
||||
struct PKG_API Entry
|
||||
{
|
||||
std::filesystem::path FullPath;
|
||||
int32_t Offset{};
|
||||
int32_t Length{};
|
||||
std::string Type;
|
||||
};
|
||||
|
||||
struct PKG_API TexHeader
|
||||
{
|
||||
TexFormat Format;
|
||||
TexType Flags;
|
||||
int32_t TextureWidth;
|
||||
int32_t TextureHeight;
|
||||
int32_t ImageWidth;
|
||||
int32_t ImageHeight;
|
||||
uint32_t UnkInt0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //ENTRY_H
|
||||
Reference in New Issue
Block a user