Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <ani_texture.h>
Public Member Functions | |
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 | 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... | |
Protected Attributes | |
unsigned int | numframes |
float | timeperframe |
unsigned int | active |
unsigned int | nextactive |
float | active_fraction |
double | curtime |
double | lastcurtime |
double | lastrealtime |
bool | constframerate |
bool | done |
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... | |
Definition at line 14 of file ani_texture.h.
AnimatedTexture::AnimatedTexture | ( | ) |
Definition at line 377 of file ani_texture.cpp.
Referenced by Clone(), and CreateVideoTexture().
Definition at line 328 of file ani_texture.cpp.
AnimatedTexture::AnimatedTexture | ( | const char * | file, |
int | stage, | ||
enum FILTER | imm, | ||
bool | detailtexture = false |
||
) |
Definition at line 265 of file ani_texture.cpp.
References VSFileSystem::AnimFile, VSFileSystem::VSFile::Close(), f, VSFileSystem::VSFile::Fscanf(), height, VSFileSystem::Ok, VSFileSystem::VSFile::OpenReadOnly(), and width.
AnimatedTexture::AnimatedTexture | ( | VSFileSystem::VSFile & | openedfile, |
int | stage, | ||
enum FILTER | imm, | ||
bool | detailtexture = false |
||
) |
Definition at line 322 of file ani_texture.cpp.
AnimatedTexture::~AnimatedTexture | ( | ) |
Definition at line 369 of file ani_texture.cpp.
References active, Texture::data, and Destroy().
|
inlinevirtual |
void AnimatedTexture::ClearTimeSource | ( | ) |
Definition at line 747 of file ani_texture.cpp.
|
virtual |
Reimplemented from Texture.
Definition at line 344 of file ani_texture.cpp.
References AnimatedTexture(), anis, Texture::bound, Texture::Clone(), f, i, LoadVideoSource(), Texture::name, numframes, and VSFileSystem::VSFile::OpenReadOnly().
|
inlinevirtual |
|
static |
Definition at line 487 of file ani_texture.cpp.
References AnimatedTexture(), f, fprintf, LoadVideoSource(), VSFileSystem::Ok, VSFileSystem::VSFile::OpenReadOnly(), SetLoop(), and VSFileSystem::VideoFile.
Referenced by BaseInterface::Room::BaseVSMovie::SetMovie().
|
inlinevirtual |
Reimplemented from Texture.
Definition at line 71 of file ani_texture.h.
References curtime.
Referenced by UpdateAllFrame().
void AnimatedTexture::Destroy | ( | ) |
Definition at line 382 of file ani_texture.cpp.
References anis, i, and numframes.
Referenced by ~AnimatedTexture().
bool AnimatedTexture::Done | ( | ) | const |
Definition at line 248 of file ani_texture.cpp.
References curtime, done, numframes, and timeperframe.
Referenced by VDU::CheckCommAnimation(), VDU::Draw(), Animation::DrawNoTransform(), Animation::DrawNow(), and VDU::GetCommunicating().
|
inlinevirtual |
Reimplemented from Texture.
Definition at line 81 of file ani_texture.h.
References timeperframe.
Referenced by SpriteStarVlist::SpriteStarVlist().
|
inline |
Definition at line 157 of file ani_texture.h.
Referenced by MakeActive(), numLayers(), numPasses(), and SetupPass().
|
inline |
Definition at line 162 of file ani_texture.h.
Referenced by MakeActive().
|
inline |
Definition at line 172 of file ani_texture.h.
Referenced by MakeActive().
|
inline |
Definition at line 167 of file ani_texture.h.
Referenced by MakeActive().
|
inline |
Definition at line 177 of file ani_texture.h.
Referenced by UpdateAllFrame().
void AnimatedTexture::Load | ( | VSFileSystem::VSFile & | f, |
int | stage, | ||
enum FILTER | ismipmapped, | ||
bool | detailtex = false |
||
) |
Definition at line 424 of file ani_texture.cpp.
References curtime, VSFileSystem::VSFile::GetType(), LoadAni(), LoadVideoSource(), and VSFileSystem::VideoFile.
Referenced by Animation::Animation().
void AnimatedTexture::LoadAni | ( | VSFileSystem::VSFile & | f, |
int | stage, | ||
enum FILTER | ismipmapped, | ||
bool | detailtex = false |
||
) |
Definition at line 506 of file ani_texture.cpp.
References active, alltrim(), anis, curtime, DEFAULT_ADDRESS_MODE, VSFileSystem::VSFile::Eof(), accountXML::file, VSFileSystem::VSFile::Fscanf(), g_game, VSRandom::genrand_int32(), VSFileSystem::VSFile::GetFilename(), VSFileSystem::VSFile::GetType(), GFXFALSE, GFXTRUE, i, j, Texture::maxtcoord, Texture::mintcoord, numframes, VSFileSystem::Ok, Texture::original, XMLSupport::parse_float(), XMLSupport::parse_option_ispresent(), XMLSupport::parse_option_value(), parseAddressMode(), VSFileSystem::VSFile::ReadLine(), Reset(), SetInterpolateFrames(), SetInterpolateTCoord(), SetLoop(), SetLoopInterp(), setTime(), Texture::stage, Texture::Texture(), TEXTURE2D, TEXTURE_2D, timeperframe, game_data_t::use_animations, game_data_t::use_textures, game_data_t::use_videos, Vector, and vsrandom.
Referenced by Load().
|
virtual |
Definition at line 653 of file ani_texture.cpp.
References BILINEAR, VSFileSystem::VSFile::Close(), gl_options_t::compression, f, accountXML::file, g_game, GFXFALSE, GFXTRUE, gl_options, MIPMAP, NEAREST, numframes, VSFileSystem::Ok, VSFileSystem::VSFile::OpenReadOnly(), Texture::original, XMLSupport::parse_option_value(), parseAddressMode(), TEXTURE2D, TEXTURE_2D, TRILINEAR, and game_data_t::use_videos.
Referenced by MakeActive().
|
virtual |
If the texture has loaded properly returns true.
Reimplemented from Texture.
Definition at line 710 of file ani_texture.cpp.
void AnimatedTexture::LoadVideoSource | ( | VSFileSystem::VSFile & | f) |
Definition at line 436 of file ani_texture.cpp.
References anis, BILINEAR, Texture::Bind(), VSFileSystem::VSFile::Close(), Texture::data, e, VidFile::getDuration(), VSFileSystem::VSFile::GetFilename(), VidFile::getFrameBuffer(), VidFile::getFrameRate(), VidFile::getHeight(), VSFileSystem::VSFile::GetType(), VidFile::getWidth(), GFXFALSE, gl_options, Texture::image_target, int, gl_options_t::max_movie_dimension, Texture::maxtcoord, Texture::mintcoord, NEAREST, numframes, VidFile::open(), gl_options_t::pot_video_textures, gl_options_t::rect_textures, Reset(), TEXTURE_RECTANGLE, Texture::texture_target, TEXTURERECT, and timeperframe.
Referenced by Clone(), CreateVideoTexture(), and Load().
|
inlinevirtual |
Binds the texture in the GFX library.
Reimplemented from Texture.
Definition at line 118 of file ani_texture.h.
Referenced by Animation::DrawAsVSSprite(), DrawDamageFlash(), Animation::DrawNoTransform(), Animation::DrawNow(), and MakeActive().
|
inlinevirtual |
Reimplemented from Texture.
Definition at line 54 of file ani_texture.cpp.
References ActivateWhite(), active, active_fraction, GFXColor::b, gl_options_t::compression, curtime, done, e, GFXColor::g, GetInterpolateFrames(), GetInterpolateTCoord(), GetLoop(), GetLoopInterp(), GFXColorf(), GFXFALSE, GFXINTERPOLATETEXTURE, GFXTextureEnv(), gl_options, int, intmax(), intmin(), LoadFrame(), MakeActive(), Texture::MakeActive(), Texture::maxtcoord, Texture::mintcoord, gl_options_t::Multitexture, nextactive, numframes, numFrames(), GFXColor::r, VidFile::seek(), setTime(), timeperframe, Texture::Transfer(), VSFileSystem::vs_dprintf(), and VidFile::Exception::what().
|
inlinevirtual |
Reimplemented from Texture.
Definition at line 76 of file ani_texture.h.
References numframes.
Referenced by MakeActive(), and SpriteStarVlist::SpriteStarVlist().
|
virtual |
Reimplemented from Texture.
Definition at line 715 of file ani_texture.cpp.
References active, GetInterpolateFrames(), gl_options, gl_options_t::Multitexture, and nextactive.
Referenced by Animation::DrawAsVSSprite(), Animation::DrawNoTransform(), and Animation::DrawNow().
|
virtual |
Reimplemented from Texture.
Definition at line 725 of file ani_texture.cpp.
References active, GetInterpolateFrames(), gl_options, gl_options_t::Multitexture, and nextactive.
Referenced by Animation::DrawAsVSSprite(), Animation::DrawNoTransform(), and Animation::DrawNow().
|
virtual |
Reimplemented from Texture.
Definition at line 339 of file ani_texture.cpp.
References active, and Texture::Original().
|
virtual |
Reimplemented from Texture.
Definition at line 334 of file ani_texture.cpp.
References active, and Texture::Original().
void AnimatedTexture::Reset | ( | ) |
Definition at line 399 of file ani_texture.cpp.
References active, curtime, done, numframes, and timeperframe.
Referenced by LoadAni(), LoadVideoSource(), and VDU::SetCommAnimation().
|
inline |
Definition at line 137 of file ani_texture.h.
Referenced by LoadAni().
|
inline |
Definition at line 142 of file ani_texture.h.
Referenced by LoadAni().
|
inline |
Definition at line 152 of file ani_texture.h.
Referenced by Animation::Animation(), CreateVideoTexture(), and LoadAni().
|
inline |
Definition at line 147 of file ani_texture.h.
Referenced by Animation::Animation(), and LoadAni().
|
virtual |
Reimplemented from Texture.
Definition at line 258 of file ani_texture.cpp.
References curtime.
Referenced by LoadAni(), MakeActive(), SpriteStarVlist::SpriteStarVlist(), and UpdateAllFrame().
void AnimatedTexture::SetTimeSource | ( | SharedPtr< Audio::Source > | source) |
Definition at line 737 of file ani_texture.cpp.
|
virtual |
Reimplemented from Texture.
Definition at line 192 of file ani_texture.cpp.
References GetInterpolateFrames(), GFXADDTEXTURE, GFXColorf(), GFXTextureEnv(), gl_options, and gl_options_t::Multitexture.
Referenced by Animation::DrawAsVSSprite(), Animation::DrawNoTransform(), Animation::DrawNow(), and SetupPass().
|
inlinevirtual |
|
static |
Definition at line 218 of file ani_texture.cpp.
References anis, curTime(), GetElapsedTime(), GetTimeSource(), lastcurtime, lastrealtime, realTime(), and setTime().
Referenced by bootstrap_draw(), GameStarSystem::Draw(), BaseInterface::Draw(), and Briefing::Render().
|
static |
Definition at line 212 of file ani_texture.cpp.
References anis, and SIMULATION_ATOM.
Referenced by UpdateAnimatedTexture().
|
protected |
Definition at line 56 of file ani_texture.h.
Referenced by LoadAni(), MakeActive(), numLayers(), numPasses(), Original(), Reset(), and ~AnimatedTexture().
|
protected |
Definition at line 58 of file ani_texture.h.
Referenced by MakeActive().
|
protected |
Definition at line 65 of file ani_texture.h.
Referenced by constFrameRate().
|
protected |
Definition at line 59 of file ani_texture.h.
Referenced by curTime(), Done(), Load(), LoadAni(), MakeActive(), Reset(), and setTime().
|
protected |
Definition at line 66 of file ani_texture.h.
Referenced by Done(), MakeActive(), and Reset().
|
protected |
Definition at line 62 of file ani_texture.h.
Referenced by UpdateAllFrame().
|
protected |
Definition at line 63 of file ani_texture.h.
Referenced by UpdateAllFrame().
|
protected |
Definition at line 57 of file ani_texture.h.
Referenced by MakeActive(), numLayers(), and numPasses().
|
protected |
Definition at line 54 of file ani_texture.h.
Referenced by Clone(), Destroy(), Done(), LoadAni(), LoadFrame(), LoadVideoSource(), MakeActive(), numFrames(), and Reset().
|
protected |
Definition at line 55 of file ani_texture.h.
Referenced by Done(), framesPerSecond(), LoadAni(), LoadVideoSource(), MakeActive(), and Reset().