rFileTexture Class Reference

texture class loading the data from a file More...

#include <rTexture.h>

Inheritance diagram for rFileTexture:

Inheritance graph
[legend]
Collaboration diagram for rFileTexture:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 rFileTexture (int group, char const *fileName, bool repx=0, bool repy=0, bool storeAlpha=false, tPath const *path=&tDirectories::Data())
 constructor setting flags
virtual ~rFileTexture ()
 destructor
tString const & GetFileName (void) const
 Gets the texture's filename.
rFileTexture const & GetFileName (tString &fileName) const
 Gets the texture's filename.

Protected Member Functions

virtual void OnSelect ()
 Selects the texture for rendering (core part).

Private Member Functions

rFileTextureSetFileName (tString const &fileName)
 Sets the texture's filename.

Private Attributes

tString fileName_
 the texture's filename
tPath const * path_


Detailed Description

texture class loading the data from a file

Definition at line 161 of file rTexture.h.


Constructor & Destructor Documentation

rFileTexture::rFileTexture ( int  group,
char const *  fileName,
bool  repx = 0,
bool  repy = 0,
bool  storeAlpha = false,
tPath const *  path = &tDirectories::Data() 
)

constructor setting flags

Parameters:
group texture group ( floor/wall)
fileName the filename of the picture to load
repx flag indicating the x repeat mode
repy flag indicating the y repeat mode
storeAlpha flag indicating whether the alpha channel should be stored

Definition at line 671 of file rTexture.cpp.

00672         : rISurfaceTexture( group, repx, repy, storeAlpha )
00673         ,  fileName_( fileName )
00674         ,  path_(path)
00675 {
00676 }

rFileTexture::~rFileTexture ( void   )  [virtual]

destructor

Definition at line 687 of file rTexture.cpp.

00688 {
00689 }


Member Function Documentation

void rFileTexture::OnSelect (  )  [protected, virtual]

Selects the texture for rendering (core part).

Implements rISurfaceTexture.

Definition at line 700 of file rTexture.cpp.

References fileName_, rSurface::GetSurface(), rISurfaceTexture::OnSelect(), path_, rISurfaceTexture::s_reportErrors_, and rISurfaceTexture::Upload().

00701 {
00702 #ifndef DEDICATED
00703     // std::cerr << "loading texture " << fileName_ << "\n";
00704     rSurface surface( fileName_, path_ );
00705     if ( surface.GetSurface() )
00706     {
00707         this->Upload( surface );
00708     }
00709     else if (s_reportErrors_)
00710     {
00711         throw tGenericException( tOutput( "$texture_error_filenotfound", fileName_ ), tOutput("$texture_error_filenotfound_title") );
00712     }
00713     rISurfaceTexture::OnSelect();
00714 #endif
00715 }

Here is the call graph for this function:

tString const & rFileTexture::GetFileName ( void   )  const [inline]

Gets the texture's filename.

Returns:
the texture's filename

Definition at line 387 of file rTexture.h.

References fileName_.

00388 {
00389     return this->fileName_;
00390 }

rFileTexture const & rFileTexture::GetFileName ( tString fileName  )  const [inline]

Gets the texture's filename.

Parameters:
fileName the texture's filename to fill
Returns:
A reference to this to allow chaining

Definition at line 403 of file rTexture.h.

References fileName_.

00404 {
00405     fileName = this->fileName_;
00406     return *this;
00407 }

rFileTexture & rFileTexture::SetFileName ( tString const &  fileName  )  [inline, private]

Sets the texture's filename.

Parameters:
fileName the texture's filename to set
Returns:
A reference to this to allow chaining

Definition at line 420 of file rTexture.h.

References fileName_.

00421 {
00422     this->fileName_ = fileName;
00423     return *this;
00424 }


Member Data Documentation

tString rFileTexture::fileName_ [private]

the texture's filename

Definition at line 171 of file rTexture.h.

Referenced by GetFileName(), OnSelect(), and SetFileName().

tPath const* rFileTexture::path_ [private]

Reimplemented in rResourceTexture::InternalTex.

Definition at line 172 of file rTexture.h.

Referenced by OnSelect().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:52:30 2008 for Armagetron Advanced by  doxygen 1.5.4