2012-01-21 21:57:41 +01:00
|
|
|
#ifndef WII_MOVIE_H_
|
|
|
|
#define WII_MOVIE_H_
|
|
|
|
|
|
|
|
#include "gcvid.h"
|
|
|
|
#include "Timer.h"
|
|
|
|
#include "texture.hpp"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class WiiMovie
|
|
|
|
{
|
2012-12-28 15:19:40 +01:00
|
|
|
public:
|
2014-03-18 03:39:42 +01:00
|
|
|
WiiMovie() { inited = false; };
|
2014-03-01 00:11:02 +01:00
|
|
|
void Init(const char * filepath);
|
|
|
|
void DeInit();
|
2014-03-18 03:39:42 +01:00
|
|
|
bool Play(bool loop = false);
|
2012-12-28 15:19:40 +01:00
|
|
|
void Stop();
|
2014-03-01 00:11:02 +01:00
|
|
|
bool Continue();
|
|
|
|
volatile bool loaded;
|
2014-03-18 03:39:42 +01:00
|
|
|
TexData *Frame; //our current texture
|
|
|
|
TexData Buffer[2];
|
|
|
|
u8 BufferPos;
|
2012-12-28 15:19:40 +01:00
|
|
|
protected:
|
|
|
|
static void * UpdateThread(void *arg);
|
|
|
|
void FrameLoadLoop();
|
|
|
|
void ReadNextFrame();
|
|
|
|
void LoadNextFrame();
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2012-12-28 15:19:40 +01:00
|
|
|
u8 * ThreadStack;
|
|
|
|
lwp_t ReadThread;
|
2012-01-21 21:57:41 +01:00
|
|
|
|
2014-03-01 00:11:02 +01:00
|
|
|
ThpVideoFile Video;
|
2014-03-22 22:32:40 +01:00
|
|
|
VideoFrame VideoF;
|
2014-03-01 00:11:02 +01:00
|
|
|
FILE *vFile;
|
2012-12-28 15:19:40 +01:00
|
|
|
float fps;
|
|
|
|
Timer PlayTime;
|
|
|
|
u32 VideoFrameCount;
|
|
|
|
bool Playing;
|
|
|
|
bool ExitRequested;
|
2014-03-18 03:39:42 +01:00
|
|
|
bool inited;
|
2012-01-21 21:57:41 +01:00
|
|
|
};
|
|
|
|
|
2014-03-18 03:39:42 +01:00
|
|
|
struct movieP
|
|
|
|
{
|
|
|
|
float x1;
|
|
|
|
float y1;
|
|
|
|
float x2;
|
|
|
|
float y2;
|
|
|
|
};
|
|
|
|
extern struct movieP normalMoviePos;
|
|
|
|
extern struct movieP zoomedMoviePos;
|
|
|
|
extern struct movieP currentMoviePos;
|
2014-03-01 00:11:02 +01:00
|
|
|
extern WiiMovie movie;
|
|
|
|
|
2012-01-21 21:57:41 +01:00
|
|
|
#endif
|