Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <animation.h>
Public Member Functions | |
Animation () | |
Animation (VSFileSystem::VSFile *f, bool Rep=0, float priority=.1, enum FILTER ismipmapped=MIPMAP, bool camorient=false, bool appear_near_by_radius=false, const GFXColor &col=GFXColor(1, 1, 1, 1)) | |
Animation (const char *, bool Rep=0, float priority=.1, enum FILTER ismipmapped=MIPMAP, bool camorient=false, bool appear_near_by_radius=false, const GFXColor &col=GFXColor(1, 1, 1, 1)) | |
~Animation () | |
void | Draw () |
void | SetFaceCam (bool face) |
void | SetInterpolate (bool interp) |
bool | CalculateOrientation (Matrix &result) |
void | DrawNow (const Matrix &final_orientation) |
void | DrawNoTransform (bool cross=true, bool blendoption=false) |
void | DrawAsVSSprite (class VSSprite *spr) |
void | SetDimensions (float wid, float hei) |
void | GetDimensions (float &wid, float &hei) |
QVector | Position () |
void | SetPosition (const QVector &) |
void | SetOrientation (const Vector &p, const Vector &q, const Vector &r) |
![]() | |
virtual void | setTime (double tim) |
virtual double | curTime () const |
virtual unsigned int | numFrames () const |
virtual float | framesPerSecond () const |
virtual unsigned int | numLayers () const |
virtual unsigned int | numPasses () const |
virtual bool | canMultiPass () const |
virtual bool | constFrameRate () const |
AnimatedTexture () | |
AnimatedTexture (int stage, enum FILTER imm, bool detailtexture=false) | |
AnimatedTexture (const char *file, int stage, enum FILTER imm, bool detailtexture=false) | |
AnimatedTexture (VSFileSystem::VSFile &openedfile, int stage, enum FILTER imm, bool detailtexture=false) | |
void | Load (VSFileSystem::VSFile &f, int stage, enum FILTER ismipmapped, bool detailtex=false) |
void | LoadAni (VSFileSystem::VSFile &f, int stage, enum FILTER ismipmapped, bool detailtex=false) |
void | LoadVideoSource (VSFileSystem::VSFile &f) |
virtual void | LoadFrame (int num) |
void | Destroy () |
virtual const Texture * | Original () const |
virtual Texture * | Original () |
~AnimatedTexture () | |
virtual Texture * | Clone () |
virtual void | MakeActive () |
Binds the texture in the GFX library. More... | |
virtual void | MakeActive (int stage) |
virtual void | MakeActive (int stage, int pass) |
bool | SetupPass (int pass, int stage, const enum BLENDFUNC src, const enum BLENDFUNC dst) |
bool | SetupPass (int pass, const enum BLENDFUNC src, const enum BLENDFUNC dst) |
void | SetInterpolateFrames (bool set) |
void | SetInterpolateTCoord (bool set) |
void | SetLoopInterp (bool set) |
void | SetLoop (bool set) |
bool | GetInterpolateFrames () const |
bool | GetInterpolateTCoord () const |
bool | GetLoopInterp () const |
bool | GetLoop () const |
SharedPtr< Audio::Source > | GetTimeSource () const |
void | SetTimeSource (SharedPtr< Audio::Source > source) |
void | ClearTimeSource () |
void | Reset () |
bool | Done () const |
virtual bool | LoadSuccess () |
If the texture has loaded properly returns true. More... | |
![]() | |
void | FileNotFound (const std::string &) |
GFXBOOL | checkold (const std::string &s, bool shared, std::string &hashname) |
Returns if this texture is actually already loaded. More... | |
void | modold (const std::string &s, bool shared, std::string &hashname) |
void | setold () |
Loads the old texture. More... | |
bool | checkbad (const string &s) |
void | setbad (const string &s) |
void | InitTexture () |
Inits the class with default values. More... | |
int | Bind (Texture *other, int maxdimension=65536, GFXBOOL detailtexture=GFXFALSE) |
Binds this texture to the same name as the given texture - for multipart textures. More... | |
Texture (int stage=0, enum FILTER mipmap=MIPMAP, enum TEXTURE_TARGET target=TEXTURE2D, enum TEXTURE_IMAGE_TARGET imagetarget=TEXTURE_2D, enum ADDRESSMODE address_mode=DEFAULT_ADDRESS_MODE) | |
Creates an unbounded texture. Set data and dimensions before binding. Or explicitly load a file. More... | |
Texture (const char *, const char *, int stage=0, enum FILTER mipmap=MIPMAP, enum TEXTURE_TARGET target=TEXTURE2D, enum TEXTURE_IMAGE_TARGET imagetarget=TEXTURE_2D, float alpha=1, int zeroval=0, GFXBOOL force=GFXFALSE, int max_dimension_size=65536, GFXBOOL detail_texture=GFXFALSE, GFXBOOL nocache=false, enum ADDRESSMODE address_mode=DEFAULT_ADDRESS_MODE, Texture *main=0) | |
Creates a texture with a single bitmap as color data and another grayscale .bmp as alpha data. More... | |
Texture (const char *FileName, int stage=0, enum FILTER mipmap=MIPMAP, enum TEXTURE_TARGET target=TEXTURE2D, enum TEXTURE_IMAGE_TARGET imagetarget=TEXTURE_2D, GFXBOOL force=GFXFALSE, int max_dimension_size=65536, GFXBOOL detail_texture=GFXFALSE, GFXBOOL nocache=false, enum ADDRESSMODE address_mode=DEFAULT_ADDRESS_MODE, Texture *main=0) | |
Creates a texture with only color data as a single bitmap. More... | |
Texture (VSFileSystem::VSFile *f, int stage=0, enum FILTER mipmap=MIPMAP, enum TEXTURE_TARGET target=TEXTURE2D, enum TEXTURE_IMAGE_TARGET imagetarget=TEXTURE_2D, GFXBOOL force=GFXFALSE, int max_dimension_size=65536, GFXBOOL detail_texture=GFXFALSE, GFXBOOL nocache=false, enum ADDRESSMODE address_mode=DEFAULT_ADDRESS_MODE, Texture *main=0) | |
void | Load (const char *, const char *, int stage=0, enum FILTER mipmap=MIPMAP, enum TEXTURE_TARGET target=TEXTURE2D, enum TEXTURE_IMAGE_TARGET imagetarget=TEXTURE_2D, float alpha=1, int zeroval=0, GFXBOOL force=GFXFALSE, int max_dimension_size=65536, GFXBOOL detail_texture=GFXFALSE, GFXBOOL nocache=false, enum ADDRESSMODE address_mode=DEFAULT_ADDRESS_MODE, Texture *main=0) |
void | Load (const char *FileName, int stage=0, enum FILTER mipmap=MIPMAP, enum TEXTURE_TARGET target=TEXTURE2D, enum TEXTURE_IMAGE_TARGET imagetarget=TEXTURE_2D, GFXBOOL force=GFXFALSE, int max_dimension_size=65536, GFXBOOL detail_texture=GFXFALSE, GFXBOOL nocache=false, enum ADDRESSMODE address_mode=DEFAULT_ADDRESS_MODE, Texture *main=0) |
virtual | ~Texture () |
Texture copy constructor that increases appropriate refcounts. More... | |
int | getStage () const |
int | getFilter () const |
int | getTarget () const |
int | getImageTarget () const |
bool | operator< (const Texture &b) const |
A way to sort the texture by the original address (to make sure like textures stick togehter. More... | |
bool | operator== (const Texture &b) const |
A way to test if the texture is equal to another based on original values. More... | |
void | setReference (Texture *other) |
Make this instance a reference of "other". More... | |
virtual void | Prioritize (float) |
Changes priority of texture. More... | |
Static Public Member Functions | |
static void | ProcessDrawQueue (std::vector< Animation * > &, float) |
static void | ProcessDrawQueue () |
static bool | NeedsProcessDrawQueue () |
static void | ProcessFarDrawQueue (float) |
static bool | NeedsProcessFarDrawQueue () |
![]() | |
static void | UpdateAllPhysics () |
static void | UpdateAllFrame () |
static AnimatedTexture * | CreateVideoTexture (const std::string &fname, int stage=0, enum FILTER ismipmapped=BILINEAR, bool detailtex=false) |
![]() | |
static Texture * | Exists (std::string s) |
Whether or not the string exists as a texture. More... | |
static Texture * | Exists (std::string s, std::string a) |
Whether or not the color and alpha data already exist. More... | |
Additional Inherited Members | |
![]() | |
StringPool::Reference | texfilename |
The file name used to load this texture. More... | |
enum FILTER | ismipmapped |
the filter mode of this texture More... | |
unsigned char * | data |
The data of this texture (used in between functions, deleted) More... | |
int | name |
The GFXname of this texture. More... | |
int | stage |
The multitexture stage of this texture. More... | |
Vector | mintcoord |
The minimum/maximum texturing coordinates for this texture (have in mind that it is not always enforce, ie. for meshes) (i=s, j=t, k=u) More... | |
Vector | maxtcoord |
Texture * | original |
The original data that would represent this texture. More... | |
bool | bound |
For re-biding. More... | |
uint | boundSizeX |
uint | boundSizeY |
VSImageMode | boundMode |
int | refcount |
The number of references on the original data. More... | |
enum TEXTURE_TARGET | texture_target |
The target this will go to (cubemap or otherwise) More... | |
enum TEXTURE_IMAGE_TARGET | image_target |
enum ADDRESSMODE | address_mode |
The address mode being used with this texture. More... | |
![]() | |
int | Bind (int maxdimension, GFXBOOL detailtexture) |
Binds this texture to GFX library. More... | |
void | UnBind () |
UnBinds from GFX library. More... | |
void | Transfer (int maxdimension, GFXBOOL detailtexture) |
Transfers this texture to GFX library. More... | |
![]() | |
unsigned int | numframes |
float | timeperframe |
unsigned int | active |
unsigned int | nextactive |
float | active_fraction |
double | curtime |
double | lastcurtime |
double | lastrealtime |
bool | constframerate |
bool | done |
Definition at line 41 of file animation.h.
Animation::Animation | ( | ) |
Definition at line 56 of file animation.cpp.
References VSCONSTRUCT2.
Animation::Animation | ( | VSFileSystem::VSFile * | f, |
bool | Rep = 0 , |
||
float | priority = .1 , |
||
enum FILTER | ismipmapped = MIPMAP , |
||
bool | camorient = false , |
||
bool | appear_near_by_radius = false , |
||
const GFXColor & | col = GFXColor( 1, 1, 1, 1 ) |
||
) |
Definition at line 72 of file animation.cpp.
Animation::Animation | ( | const char * | FileName, |
bool | Rep = 0 , |
||
float | priority = .1 , |
||
enum FILTER | ismipmapped = MIPMAP , |
||
bool | camorient = false , |
||
bool | appear_near_by_radius = false , |
||
const GFXColor & | col = GFXColor( 1, 1, 1, 1 ) |
||
) |
Definition at line 81 of file animation.cpp.
References ani_alpha, ani_close, ani_repeat, ani_up, VSFileSystem::AnimFile, VSFileSystem::VSFile::Close(), f, VSFileSystem::VSFile::Fscanf(), Identity(), AnimatedTexture::Load(), VSFileSystem::Ok, VSFileSystem::VSFile::OpenReadOnly(), AnimatedTexture::SetLoop(), AnimatedTexture::SetLoopInterp(), and VSCONSTRUCT2.
Animation::~Animation | ( | ) |
Definition at line 116 of file animation.cpp.
References animationdrawqueue, far_animationdrawqueue, i, and VSDESTRUCT2.
Definition at line 214 of file animation.cpp.
References ani_close, ani_up, VegaConfig::getVariable(), XMLSupport::parse_float(), Position(), QVector, Vector, VectorAndPositionToMatrix(), and vs_config.
void Animation::Draw | ( | ) |
Definition at line 454 of file animation.cpp.
References _Universe, Universe::AccessCamera(), animationdrawqueue, far_animationdrawqueue, g_game, Camera::GetPosition(), Camera::GetR(), VegaConfig::getVariable(), Magnitude(), XMLSupport::parse_float(), Position(), QVector, R, game_data_t::use_animations, game_data_t::use_textures, Vector, vs_config, and game_data_t::zfar.
Referenced by CoordinateSelect::Draw(), LocationSelect::Draw(), and GamePlanet::Draw().
void Animation::DrawAsVSSprite | ( | class VSSprite * | spr) |
Definition at line 309 of file animation.cpp.
References ani_alpha, CULLFACE, VSSprite::DrawHere(), g_game, GFXBegin(), GFXBlendMode(), GFXDisable(), GFXEnable(), GFXEnd(), GFXGetBlendMode(), GFXMODULATETEXTURE, GFXPopBlendMode(), GFXPushBlendMode(), GFXQUAD, GFXTexCoord2f(), GFXTexCoord4f(), GFXTextureCoordGenMode(), GFXTextureEnv(), GFXToggleTexture(), GFXVertexf(), gl_options, INVSRCALPHA, AnimatedTexture::MakeActive(), Texture::maxtcoord, Texture::mintcoord, gl_options_t::Multitexture, NO_GEN, AnimatedTexture::numLayers(), AnimatedTexture::numPasses(), ONE, AnimatedTexture::SetupPass(), SRCALPHA, game_data_t::use_animations, game_data_t::use_textures, Vector, and ZERO.
Definition at line 365 of file animation.cpp.
References ani_alpha, ani_repeat, DEPTHWRITE, AnimatedTexture::Done(), f, g_game, GFXBegin(), GFXBlendMode(), GFXDisable(), GFXEnable(), GFXEnd(), GFXGetBlendMode(), GFXMODULATETEXTURE, GFXQUAD, GFXTexCoord2f(), GFXTexCoord4f(), GFXTextureCoordGenMode(), GFXTextureEnv(), GFXToggleTexture(), GFXVertex3f(), gl_options, INVSRCALPHA, AnimatedTexture::MakeActive(), Texture::maxtcoord, Texture::mintcoord, gl_options_t::Multitexture, NO_GEN, AnimatedTexture::numLayers(), AnimatedTexture::numPasses(), ONE, AnimatedTexture::SetupPass(), SRCALPHA, game_data_t::use_animations, and game_data_t::use_textures.
Referenced by Bolt::Draw().
void Animation::DrawNow | ( | const Matrix & | final_orientation) |
Definition at line 253 of file animation.cpp.
References ani_repeat, AnimatedTexture::Done(), f, g_game, GFXBegin(), GFXEnd(), GFXGetBlendMode(), GFXLoadMatrixModel(), GFXMODULATETEXTURE, GFXQUAD, GFXTexCoord2f(), GFXTexCoord4f(), GFXTextureCoordGenMode(), GFXTextureEnv(), GFXToggleTexture(), GFXVertex3f(), gl_options, AnimatedTexture::MakeActive(), Texture::maxtcoord, Texture::mintcoord, gl_options_t::Multitexture, NO_GEN, AnimatedTexture::numLayers(), AnimatedTexture::numPasses(), AnimatedTexture::SetupPass(), game_data_t::use_animations, and game_data_t::use_textures.
Referenced by bootstrap_draw().
Definition at line 144 of file animation.cpp.
|
static |
Definition at line 159 of file animation.cpp.
References AnimationsLeftInQueue().
|
static |
Definition at line 173 of file animation.cpp.
References AnimationsLeftInFarQueue().
QVector Animation::Position | ( | ) |
Definition at line 135 of file animation.cpp.
References Matrix::p.
Referenced by CalculateOrientation(), Draw(), and ProcessDrawQueue().
|
static |
Definition at line 177 of file animation.cpp.
References _Universe, Universe::AccessCamera(), ani_alpha, FOG_OFF, g_game, Camera::GetPosition(), GFXBlendMode(), GFXColorf(), GFXFogMode(), i, INVSRCALPHA, j, Magnitude(), ONE, Position(), QVector, SRCALPHA, game_data_t::use_animations, and game_data_t::use_textures.
|
static |
Definition at line 150 of file animation.cpp.
References animationdrawqueue, DEPTHWRITE, GFXBlendMode(), GFXDisable(), GFXEnable(), INVSRCALPHA, LIGHTING, SRCALPHA, TEXTURE0, and TEXTURE1.
Referenced by GameStarSystem::Draw(), and ProcessFarDrawQueue().
|
static |
Definition at line 163 of file animation.cpp.
References far_animationdrawqueue, GFXBlendMode(), GFXDisable(), GFXEnable(), INVSRCALPHA, LIGHTING, ProcessDrawQueue(), SRCALPHA, TEXTURE0, and TEXTURE1.
Referenced by Mesh::ProcessZFarMeshes().
Definition at line 139 of file animation.cpp.
Referenced by Bolt::Draw(), and GameUnit< UnitType >::Explode().
void Animation::SetFaceCam | ( | bool | face) |
Definition at line 62 of file animation.cpp.
References ani_up.
Referenced by GameUnit< UnitType >::Explode().
void Animation::SetInterpolate | ( | bool | interp) |
Definition at line 131 of file animation.cpp.
References Matrix::p, and VectorAndPositionToMatrix().
Referenced by GamePlanet::Draw(), and GameUnit< UnitType >::Explode().
void Animation::SetPosition | ( | const QVector & | p) |
Definition at line 127 of file animation.cpp.
References Matrix::p.
Referenced by CoordinateSelect::Draw(), LocationSelect::Draw(), and GamePlanet::Draw().