#include <sky.h>
Collaboration diagram for Sky:
Public Member Functions | |
Sky () | |
void | Init () |
void | Reset () |
void | Draw () |
void | Free () |
Private Member Functions | |
void | RedrawParticleList (std::list< Rectanglei > &list) |
void | RedrawParticle (const Rectanglei &particle) const |
Point2i | GetSkyPos () const |
Private Attributes | |
Surface | image |
Point2i | lastPos |
Point2i | tstVect |
Point2i | margin |
Definition at line 32 of file sky.h.
void Sky::Draw | ( | ) |
Definition at line 54 of file sky.cpp.
00055 { 00056 if( lastPos != camera.GetPosition() ){ 00057 lastPos = camera.GetPosition(); 00058 RedrawParticle(camera); 00059 return; 00060 } 00061 00062 RedrawParticleList(*world.to_redraw_now); 00063 RedrawParticleList(*world.to_redraw_particles_now); 00064 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Sky::Free | ( | ) |
Point2i Sky::GetSkyPos | ( | ) | const [private] |
void Sky::Init | ( | ) |
Definition at line 35 of file sky.cpp.
00035 { 00036 // That is temporary -> image will be loaded directly without alpha chanel 00037 Surface tmp_image = ActiveMap().ReadImgSky(); 00038 tmp_image.SetAlpha( 0, 0); 00039 image = tmp_image.DisplayFormat(); 00040 00041 tstVect = image.GetSize().inf( camera.GetSize() ); 00042 margin = tstVect * (camera.GetSize() - image.GetSize())/2; 00043 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Sky::RedrawParticle | ( | const Rectanglei & | particle | ) | const [private] |
Definition at line 73 of file sky.cpp.
00073 { 00074 Rectanglei ds(GetSkyPos() + particle.GetPosition() - camera.GetPosition() - margin, 00075 particle.GetSize() ); 00076 AppWormux::GetInstance()->video.window.Blit(image, ds, particle.GetPosition() - camera.GetPosition()); 00077 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Sky::RedrawParticleList | ( | std::list< Rectanglei > & | list | ) | [private] |
Definition at line 66 of file sky.cpp.
00066 { 00067 std::list<Rectanglei>::iterator it; 00068 00069 for( it = list.begin(); it != list.end(); ++it ) 00070 RedrawParticle(*it); 00071 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Sky::Reset | ( | ) |
Surface Sky::image [private] |
Point2i Sky::lastPos [private] |
Point2i Sky::margin [private] |
Point2i Sky::tstVect [private] |