Enfusion Script API
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
TexTools Interface Reference

Static Public Member Functions

static proto bool SaveImageData (string filePath, int width, int height, notnull array< int > data)
 Save raw pixels (ARGB stored in int) to dds file.
 
static proto void RepairTerrainTextureBorders (int width, int height, notnull inout array< int > data)
 Repair borders.
 

Member Function Documentation

◆ RepairTerrainTextureBorders()

static proto void TexTools.RepairTerrainTextureBorders ( int  width,
int  height,
notnull inout array< int data 
)
static

Repair borders.

Real data pictures are from 3,3 to sizeX-3,sizeY-3. Rest of the image must be copied due to DXT compression from the border lines -> in 4x4 DXT block must be just four colors, the other reason is the mip-mapping!

◆ SaveImageData()

static proto bool TexTools.SaveImageData ( string  filePath,
int  width,
int  height,
notnull array< int data 
)
static

Save raw pixels (ARGB stored in int) to dds file.

Usage:

string filePath = "c:\\textures\\test.dds";
int data[256];
// generate same gradient
for (int x = 0; x < 16; x++)
for (int y = 0; y < 16; y++)
{
int clr = y * 16 + 15;
data[x * 16 + y] = ARGB(255, clr, clr, clr);
}
// save dds to file
if (TexTools.SaveImageData(filePath, 16, 16, data) == false)
{
Print("Can't save image", LogLevel.ERROR);
return;
}
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition: LogLevel.c:14
Definition: TexTools.c:15
static proto bool SaveImageData(string filePath, int width, int height, notnull array< int > data)
Save raw pixels (ARGB stored in int) to dds file.

The documentation for this interface was generated from the following file: