- added tcMod atlas. Lets you have texture page atlases, and animate them!

- Entity alpha can animate them too (for animated compatible replacement smokepuffs for example)
This commit is contained in:
leilei-
2016-05-19 06:57:02 -04:00
parent d31b9ad6d9
commit 5c4712f192
4 changed files with 158 additions and 0 deletions

View File

@@ -221,6 +221,16 @@ typedef struct {
float frequency;
} waveForm_t;
// leilei - texture atlases
typedef struct {
float width; // columns
float height; // rows
float fps; // frames per second
int frame; // offset frame
float mode; // 0 - static/anim 1 - entityalpha
} atlas_t;
#define TR_MAX_TEXMODS 4
typedef enum {
@@ -231,6 +241,7 @@ typedef enum {
TMOD_SCALE,
TMOD_STRETCH,
TMOD_LIGHTSCALE, // leilei - cel hack
TMOD_ATLAS, // leilei - atlases
TMOD_ROTATE,
TMOD_ENTITY_TRANSLATE
} texMod_t;
@@ -266,6 +277,8 @@ typedef struct {
// used for TMOD_SCROLL
float scroll[2]; // s' = s + scroll[0] * time
// t' = t + scroll[1] * time
// leilei - used for TMOD_ATLAS
atlas_t atlas;
// + = clockwise
// - = counterclockwise
@@ -2130,6 +2143,7 @@ void RB_CalcAlphaFromEntity( unsigned char *dstColors );
void RB_CalcAlphaFromOneMinusEntity( unsigned char *dstColors );
void RB_CalcStretchTexCoords( const waveForm_t *wf, float *texCoords );
void RB_CalcLightscaleTexCoords( float *texCoords );
void RB_CalcAtlasTexCoords( const atlas_t *at, float *st );
void RB_CalcColorFromEntity( unsigned char *dstColors );
void RB_CalcColorFromOneMinusEntity( unsigned char *dstColors );
void RB_CalcSpecularAlpha( unsigned char *alphas );