Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shape_sampler Class Reference

Public Member Functions

 shape_sampler ()
 
void init (unsigned long total_samples)
 
void close ()
 
void operator++ ()
 
int done ()
 
unsigned long operator* ()
 
unsigned long finalsample () const
 

Public Attributes

unsigned long shape [SHAPE_SAMPLES+1]
 

Detailed Description

Definition at line 136 of file softvolume.cpp.

Constructor & Destructor Documentation

shape_sampler::shape_sampler ( )
inline

Definition at line 138 of file softvolume.cpp.

138  : shape_sampler() : pos( 0 )
139  , step( 0 ) {}

Member Function Documentation

void shape_sampler::close ( void  )
inline

Definition at line 147 of file softvolume.cpp.

148  {
149  this->pos = this->step = 0;
150  }
int shape_sampler::done ( )
inline
unsigned long shape_sampler::finalsample ( ) const
inline
void shape_sampler::init ( unsigned long  total_samples)
inline

Definition at line 141 of file softvolume.cpp.

References SHAPE_SAMPLES.

Referenced by Mix_SoftVolume_Change().

142  {
143  if (total_samples == 0) total_samples = 1;
144  this->step = (SHAPE_SAMPLES<<16)/total_samples;
145  this->pos = 0;
146  }
unsigned long shape_sampler::operator* ( )
inline

Definition at line 160 of file softvolume.cpp.

References interpolateF16F16(), shape, and SHAPE_SAMPLE_SAFEPOS.

161  {
163  this->pos>>16 )+1], this->pos&0xFFFF );
164  }
void shape_sampler::operator++ ( )
inline

Definition at line 152 of file softvolume.cpp.

153  {
154  this->pos += this->step;
155  }

Member Data Documentation

unsigned long shape_sampler::shape[SHAPE_SAMPLES+1]

Definition at line 175 of file softvolume.cpp.

Referenced by finalsample(), Mix_SoftVolume_Change(), and operator*().


The documentation for this class was generated from the following file: