2014-01-31 08:23:00 +13:00
|
|
|
|
2019-01-18 15:55:06 +01:00
|
|
|
#include "gxmovie.hpp"
|
|
|
|
|
#include "gxgraphics.hpp"
|
2019-01-18 17:03:37 +01:00
|
|
|
#include "std.hpp"
|
2014-01-31 08:23:00 +13:00
|
|
|
|
2019-01-18 17:03:37 +01:00
|
|
|
gxMovie::gxMovie(gxGraphics* g, IMultiMediaStream* mm) : gfx(g), mm_stream(mm), playing(true)
|
|
|
|
|
{
|
2016-05-07 22:49:54 +02:00
|
|
|
////mm_stream->GetMediaStream( MSPID_PrimaryVideo,&vid_stream );
|
|
|
|
|
////vid_stream->QueryInterface(IID_IDirectDrawMediaStream, (void**)&dd_stream);
|
2014-01-31 08:23:00 +13:00
|
|
|
|
2016-05-07 22:49:54 +02:00
|
|
|
//DDSURFACEDESC desc = { sizeof(desc) };
|
|
|
|
|
//dd_stream->GetFormat(&desc, 0, 0, 0);
|
2014-01-31 08:23:00 +13:00
|
|
|
|
2016-05-07 22:49:54 +02:00
|
|
|
//canvas = gfx->createCanvas(desc.dwWidth, desc.dwHeight, 0); //gxCanvas::CANVAS_NONDISPLAY );
|
|
|
|
|
//canvas->getSurface()->QueryInterface(IID_IDirectDrawSurface, (void**)&dd_surf);
|
2014-01-31 08:23:00 +13:00
|
|
|
|
2016-05-07 22:49:54 +02:00
|
|
|
//src_rect.left = src_rect.top = 0;
|
|
|
|
|
//src_rect.right = desc.dwWidth; src_rect.bottom = desc.dwHeight;
|
2014-01-31 08:23:00 +13:00
|
|
|
|
2016-05-07 22:49:54 +02:00
|
|
|
//dd_stream->CreateSample(dd_surf, &src_rect, 0, &dd_sample);
|
2014-01-31 08:23:00 +13:00
|
|
|
|
2016-05-07 22:49:54 +02:00
|
|
|
//mm_stream->SetState(STREAMSTATE_RUN);
|
2014-01-31 08:23:00 +13:00
|
|
|
}
|
|
|
|
|
|
2019-01-18 17:03:37 +01:00
|
|
|
gxMovie::~gxMovie()
|
|
|
|
|
{
|
2016-05-07 22:49:54 +02:00
|
|
|
/*mm_stream->SetState(STREAMSTATE_STOP);
|
2014-01-31 08:23:00 +13:00
|
|
|
|
|
|
|
|
dd_sample->Release();
|
|
|
|
|
dd_surf->Release();
|
|
|
|
|
dd_stream->Release();
|
|
|
|
|
vid_stream->Release();
|
|
|
|
|
mm_stream->Release();
|
|
|
|
|
|
2016-05-07 22:49:54 +02:00
|
|
|
gfx->freeCanvas(canvas);*/
|
2014-01-31 08:23:00 +13:00
|
|
|
}
|
|
|
|
|
|
2019-01-18 17:03:37 +01:00
|
|
|
bool gxMovie::draw(gxCanvas* dest, int x, int y, int w, int h)
|
|
|
|
|
{
|
|
|
|
|
if (!playing)
|
|
|
|
|
return false;
|
2016-05-07 22:49:54 +02:00
|
|
|
/*if (!dd_sample->Update(0, 0, 0, 0)) {
|
|
|
|
|
RECT dest_rect = { x,y,x + w,y + h };
|
|
|
|
|
dest->getSurface()->Blt(&dest_rect, canvas->getSurface(), &src_rect, DDBLT_WAIT, 0);
|
|
|
|
|
dest->damage(dest_rect);
|
|
|
|
|
} else {
|
|
|
|
|
playing = false;
|
|
|
|
|
}*/
|
2014-01-31 08:23:00 +13:00
|
|
|
return playing;
|
|
|
|
|
}
|