-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e27e2a6
commit ee5dd04
Showing
10 changed files
with
190 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,60 @@ | ||
#include "ABINKMoviePlayer.h" | ||
|
||
TOSHI_NAMESPACE_USING | ||
|
||
ABINKMoviePlayer::ABINKMoviePlayer() | ||
{ | ||
m_bHasMovieStopped = TTRUE; | ||
m_bIsBINKInitialized = TFALSE; | ||
m_hBink = NULL; | ||
m_iFrameBufferHeight = 0; | ||
m_iFrameBufferWidth = 0; | ||
m_pFrameBufferBits = TNULL; | ||
RADSetMemory(RADMEMALLOC, RADMEMFREE); | ||
SetFrameReady(TFALSE); | ||
} | ||
|
||
TBOOL ABINKMoviePlayer::RenderToFrameBuffer() | ||
{ | ||
return TBOOL(); | ||
} | ||
|
||
TBOOL ABINKMoviePlayer::RenderToFrameBuffer(TPBYTE a_pDest, TINT a_iUnk, TINT a_iDestHeigth, TINT a_iDestPitch, TINT a_iDestX, INT a_iDestY, INT a_iSrcX, INT a_iSrcY) | ||
{ | ||
if (a_iDestHeigth == a_iUnk) { | ||
BinkCopyToBufferRect(m_hBink, a_pDest, a_iDestPitch, a_iDestHeigth, | ||
a_iDestX, a_iDestY, a_iSrcX, a_iSrcY, m_hBink->Width, m_hBink->Height, BINKCOPYALL | BINKNOSKIP | BINKSURFACE32A); | ||
} | ||
return TBOOL(); | ||
} | ||
|
||
void ABINKMoviePlayer::BinkSleep(TINT a_iMicroseconds) | ||
{ | ||
static S32 s_iTotalSleep = 0; | ||
static S32 s_iSleepForward = 0; | ||
static U64 s_iFrequency = 1000; | ||
static S32 s_bFrequencyAquired = 0; | ||
|
||
if (!s_bFrequencyAquired) | ||
{ | ||
s_bFrequencyAquired = 1; | ||
QueryPerformanceFrequency((LARGE_INTEGER*)&s_iFrequency); | ||
} | ||
|
||
s_iTotalSleep += a_iMicroseconds; | ||
|
||
if ((s_iTotalSleep - s_iSleepForward) > 1000) | ||
{ | ||
U64 start, end; | ||
s_iTotalSleep -= s_iSleepForward; | ||
|
||
QueryPerformanceCounter((LARGE_INTEGER*)&start); | ||
Sleep(s_iTotalSleep / 1000); | ||
QueryPerformanceCounter((LARGE_INTEGER*)&end); | ||
|
||
end = ((end - start) * (U64)1000000) / s_iFrequency; | ||
|
||
s_iSleepForward = (U32)end - s_iTotalSleep; | ||
s_iTotalSleep %= 1000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters