#include <Movie.h>
Public Member Functions | |
CMovie () | |
Standard constructor. | |
~CMovie () | |
Standard Destructor. | |
bool | Init (HWND hWnd, LPDIRECT3DDEVICE9 pd3dDevice, int screenWidth, int screenHeight, CTerrain *pTerrain, CTurtle *pTurtle, CSheep *pSheep, CLanguage *language) |
Init movie with terrain, turtle, sheep and language objects. This function loads music and prepares sprites and fonts for text drawing. | |
bool | OnEvent (LPDIRECT3DDEVICE9 pd3dDevice, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, int *code) |
Movie quits on any user action so not much event handling. | |
void | OnFrameMove (LPDIRECT3DDEVICE9 pd3dDevice, double fTime, float fElapsedTime) |
Animates movie. Everything is hardcoded here, camera movement, model animation, text sliding... | |
void | OnRender (LPDIRECT3DDEVICE9 pd3dDevice) |
Renders movie. Terrain, models, sprites, text. | |
void | stopMovie () |
Stops movie music. | |
void | playMovie () |
Starts movie, plays music, resets models position, camera position and text position. | |
void | OnLostDevice () |
OnLost device releases POOL objects. | |
void | OnResetDevice (LPDIRECT3DDEVICE9 pd3dDevice, int screenWidth, int screenHeight) |
Resets sprites, fonts and particles. |
This class should be made more generic. Right now, it is progremmed to play Intro movie. It loads terrain, and game models, it animates the camera, models and plays the music theme. Everything is hardcoded, no scripting, so to make another movie would mean to write it all from scratch.
CMovie::CMovie | ( | ) |
Standard constructor.
CMovie::~CMovie | ( | ) |
Standard Destructor.
bool CMovie::Init | ( | HWND | hWnd, | |
LPDIRECT3DDEVICE9 | pd3dDevice, | |||
int | screenWidth, | |||
int | screenHeight, | |||
CTerrain * | pTerrain, | |||
CTurtle * | pTurtle, | |||
CSheep * | pSheep, | |||
CLanguage * | language | |||
) |
Init movie with terrain, turtle, sheep and language objects. This function loads music and prepares sprites and fonts for text drawing.
bool CMovie::OnEvent | ( | LPDIRECT3DDEVICE9 | pd3dDevice, | |
HWND | hWnd, | |||
UINT | msg, | |||
WPARAM | wParam, | |||
LPARAM | lParam, | |||
int * | code | |||
) |
Movie quits on any user action so not much event handling.
void CMovie::OnFrameMove | ( | LPDIRECT3DDEVICE9 | pd3dDevice, | |
double | fTime, | |||
float | fElapsedTime | |||
) |
Animates movie. Everything is hardcoded here, camera movement, model animation, text sliding...
It would be wonderful for movie class to use some kind of script file which would define all movements. That way same class could be used for multiple movies, you just make new instance of CMovie and pass sript file to it. Problem is making such script file and parsing it commonly for various movies?
LOOp music (NOT FRIKING WORKING! MAY THE ALL MIGHTY SMITE THOSE WHO MAKE SOUND PLAYING API WITHOUT LOOPING)
void CMovie::OnRender | ( | LPDIRECT3DDEVICE9 | pd3dDevice | ) |
Renders movie. Terrain, models, sprites, text.
void CMovie::stopMovie | ( | ) |
Stops movie music.
void CMovie::playMovie | ( | ) |
Starts movie, plays music, resets models position, camera position and text position.
void CMovie::OnLostDevice | ( | ) |
OnLost device releases POOL objects.
void CMovie::OnResetDevice | ( | LPDIRECT3DDEVICE9 | pd3dDevice, | |
int | screenWidth, | |||
int | screenHeight | |||
) |
Resets sprites, fonts and particles.