Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
ww3dformat.h File Reference
#include "always.h"
#include "wwstring.h"

Go to the source code of this file.

Macros

#define WW3DFORMAT_H
 

Enumerations

enum  WW3DFormat {
  WW3D_FORMAT_UNKNOWN =0 , WW3D_FORMAT_R8G8B8 , WW3D_FORMAT_A8R8G8B8 , WW3D_FORMAT_X8R8G8B8 ,
  WW3D_FORMAT_R5G6B5 , WW3D_FORMAT_X1R5G5B5 , WW3D_FORMAT_A1R5G5B5 , WW3D_FORMAT_A4R4G4B4 ,
  WW3D_FORMAT_R3G3B2 , WW3D_FORMAT_A8 , WW3D_FORMAT_A8R3G3B2 , WW3D_FORMAT_X4R4G4B4 ,
  WW3D_FORMAT_A8P8 , WW3D_FORMAT_P8 , WW3D_FORMAT_L8 , WW3D_FORMAT_A8L8 ,
  WW3D_FORMAT_A4L4 , WW3D_FORMAT_U8V8 , WW3D_FORMAT_L6V5U5 , WW3D_FORMAT_X8L8V8U8 ,
  WW3D_FORMAT_DXT1 , WW3D_FORMAT_DXT2 , WW3D_FORMAT_DXT3 , WW3D_FORMAT_DXT4 ,
  WW3D_FORMAT_DXT5 , WW3D_FORMAT_COUNT
}
 
enum  WW3DZFormat {
  WW3D_ZFORMAT_UNKNOWN =0 , WW3D_ZFORMAT_D16_LOCKABLE , WW3D_ZFORMAT_D32 , WW3D_ZFORMAT_D15S1 ,
  WW3D_ZFORMAT_D24S8 , WW3D_ZFORMAT_D16 , WW3D_ZFORMAT_D24X8 , WW3D_ZFORMAT_D24X4S4 ,
  WW3D_ZFORMAT_COUNT
}
 

Functions

bool Has_Alpha (WW3DFormat format)
 
int Alpha_Bits (WW3DFormat format)
 
void Vector4_to_Color (unsigned int *outc, const Vector4 &inc, const WW3DFormat format)
 
void Color_to_Vector4 (Vector4 *outc, const unsigned int inc, const WW3DFormat format)
 
void Get_WW3D_Format (WW3DFormat &dest_format, WW3DFormat &src_format, unsigned &src_bpp, const Targa &targa)
 
void Get_WW3D_Format (WW3DFormat &src_format, unsigned &src_bpp, const Targa &targa)
 
WW3DFormat Get_Valid_Texture_Format (WW3DFormat format, bool is_compression_allowed)
 
unsigned Get_Bytes_Per_Pixel (WW3DFormat format)
 
void Get_WW3D_Format_Name (WW3DFormat format, StringClass &name)
 
void Get_WW3D_ZFormat_Name (WW3DZFormat format, StringClass &name)
 Get W3D depth stencil format string name.
 
unsigned Get_Num_Depth_Bits (WW3DZFormat zformat)
 
unsigned Get_Num_Stencil_Bits (WW3DZFormat zformat)
 

Macro Definition Documentation

◆ WW3DFORMAT_H

#define WW3DFORMAT_H

Definition at line 47 of file ww3dformat.h.

Enumeration Type Documentation

◆ WW3DFormat

enum WW3DFormat
Enumerator
WW3D_FORMAT_UNKNOWN 
WW3D_FORMAT_R8G8B8 
WW3D_FORMAT_A8R8G8B8 
WW3D_FORMAT_X8R8G8B8 
WW3D_FORMAT_R5G6B5 
WW3D_FORMAT_X1R5G5B5 
WW3D_FORMAT_A1R5G5B5 
WW3D_FORMAT_A4R4G4B4 
WW3D_FORMAT_R3G3B2 
WW3D_FORMAT_A8 
WW3D_FORMAT_A8R3G3B2 
WW3D_FORMAT_X4R4G4B4 
WW3D_FORMAT_A8P8 
WW3D_FORMAT_P8 
WW3D_FORMAT_L8 
WW3D_FORMAT_A8L8 
WW3D_FORMAT_A4L4 
WW3D_FORMAT_U8V8 
WW3D_FORMAT_L6V5U5 
WW3D_FORMAT_X8L8V8U8 
WW3D_FORMAT_DXT1 
WW3D_FORMAT_DXT2 
WW3D_FORMAT_DXT3 
WW3D_FORMAT_DXT4 
WW3D_FORMAT_DXT5 
WW3D_FORMAT_COUNT 

Definition at line 75 of file ww3dformat.h.

◆ WW3DZFormat

Enumerator
WW3D_ZFORMAT_UNKNOWN 
WW3D_ZFORMAT_D16_LOCKABLE 
WW3D_ZFORMAT_D32 
WW3D_ZFORMAT_D15S1 
WW3D_ZFORMAT_D24S8 
WW3D_ZFORMAT_D16 
WW3D_ZFORMAT_D24X8 
WW3D_ZFORMAT_D24X4S4 
WW3D_ZFORMAT_COUNT 

Definition at line 105 of file ww3dformat.h.

Function Documentation

◆ Alpha_Bits()

int Alpha_Bits ( WW3DFormat format)
inline

Definition at line 148 of file ww3dformat.h.

◆ Color_to_Vector4()

void Color_to_Vector4 ( Vector4 * outc,
const unsigned int inc,
const WW3DFormat format )

Definition at line 202 of file ww3dformat.cpp.

◆ Get_Bytes_Per_Pixel()

unsigned Get_Bytes_Per_Pixel ( WW3DFormat format)

Definition at line 393 of file ww3dformat.cpp.

◆ Get_Num_Depth_Bits()

unsigned Get_Num_Depth_Bits ( WW3DZFormat zformat)

Definition at line 415 of file ww3dformat.cpp.

◆ Get_Num_Stencil_Bits()

unsigned Get_Num_Stencil_Bits ( WW3DZFormat zformat)

Definition at line 436 of file ww3dformat.cpp.

◆ Get_Valid_Texture_Format()

WW3DFormat Get_Valid_Texture_Format ( WW3DFormat format,
bool is_compression_allowed )

Definition at line 311 of file ww3dformat.cpp.

◆ Get_WW3D_Format() [1/2]

void Get_WW3D_Format ( WW3DFormat & dest_format,
WW3DFormat & src_format,
unsigned & src_bpp,
const Targa & targa )

Definition at line 272 of file ww3dformat.cpp.

◆ Get_WW3D_Format() [2/2]

void Get_WW3D_Format ( WW3DFormat & src_format,
unsigned & src_bpp,
const Targa & targa )

Definition at line 283 of file ww3dformat.cpp.

◆ Get_WW3D_Format_Name()

void Get_WW3D_Format_Name ( WW3DFormat format,
StringClass & name )

Definition at line 69 of file ww3dformat.cpp.

◆ Get_WW3D_ZFormat_Name()

void Get_WW3D_ZFormat_Name ( WW3DZFormat format,
StringClass & name )

Get W3D depth stencil format string name.

06/27/02 KJM

Definition at line 105 of file ww3dformat.cpp.

◆ Has_Alpha()

bool Has_Alpha ( WW3DFormat format)
inline

Definition at line 126 of file ww3dformat.h.

◆ Vector4_to_Color()

void Vector4_to_Color ( unsigned int * outc,
const Vector4 & inc,
const WW3DFormat format )

Definition at line 134 of file ww3dformat.cpp.