Definition at line 9 of file EffectDisintegrate.h.
Public Member Functions | |
EffectDisintegrate () | |
Start as not disintegrated. | |
virtual void | updateEffect () |
Update effect after blit. | |
virtual bool | isDisintegrated () const |
Returns true for object for who the disint effect is finished. | |
virtual bool | isInvisible () const |
virtual void | blit (SDL_Surface *screen, SDL_Surface *surface, int x, int y) |
Disintegration effect. |
|
Start as not disintegrated.
Definition at line 19 of file EffectDisintegrate.cpp. 00020 { 00021 m_disint = DISINT_START; 00022 }
|
|
Disintegration effect. Draw only some pixels. Implements ViewEffect. Definition at line 55 of file EffectDisintegrate.cpp. 00057 { 00058 SurfaceLock lock1(screen); 00059 SurfaceLock lock2(surface); 00060 00061 for (int py = 0; py < surface->h; ++py) { 00062 for (int px = 0; px < surface->w; ++px) { 00063 if (Random::aByte(py * surface->w + px) < m_disint) { 00064 SDL_Color pixel = PixelTool::getColor(surface, px, py); 00065 if (pixel.unused == 255) { 00066 PixelTool::putColor(screen, x + px, y + py, pixel); 00067 } 00068 } 00069 } 00070 } 00071 }
|
|
Returns true for object for who the disint effect is finished.
Reimplemented from ViewEffect. Definition at line 39 of file EffectDisintegrate.cpp. 00040 {
00041 return 0 == m_disint;
00042 }
|
|
Reimplemented from ViewEffect. Definition at line 45 of file EffectDisintegrate.cpp. 00046 { 00047 return isDisintegrated(); 00048 }
|
|
Update effect after blit.
Reimplemented from ViewEffect. Definition at line 25 of file EffectDisintegrate.cpp. 00026 { 00027 if (m_disint > 0) { 00028 m_disint -= DISINT_SPEED; 00029 if (m_disint < 0) { 00030 m_disint = 0; 00031 } 00032 } 00033 }
|