コード例 #1
0
ファイル: powerup.c プロジェクト: paud/d2x-xl
void UpdatePowerupClip (tVideoClip *vcP, tVClipInfo *vciP, int nObject)
{
if (vcP) {
	static fix	xPowerupTime = 0;
	int			h, nFrames = SetupHiresVClip (vcP, vciP);
	fix			xTime, xFudge = (xPowerupTime * (nObject & 3)) >> 4;

	xPowerupTime += gameData.physics.xTime;
	xTime = vciP->xFrameTime - (fix) ((xPowerupTime + xFudge) / gameStates.gameplay.slowmo [0].fSpeed);
	if ((xTime < 0) && (vcP->xFrameTime > 0)) {
		h = (-xTime + vcP->xFrameTime - 1) / vcP->xFrameTime;
		xTime += h * vcP->xFrameTime;
		h %= nFrames;
		if ((nObject & 1) && (OBJECTS [nObject].nType != OBJ_EXPLOSION)) 
			vciP->nCurFrame -= h;
		else
			vciP->nCurFrame += h;
		if (vciP->nCurFrame < 0)
			vciP->nCurFrame = nFrames - (-vciP->nCurFrame % nFrames);
		else 
			vciP->nCurFrame %= nFrames;
		}
	vciP->xFrameTime = xTime;
	xPowerupTime = 0;
	}
else {
コード例 #2
0
static void OglCacheVClipTextures (tVideoClip* vcP, int nTranspType)
{
	CBitmap*	bmP;
	int		h;

for (int i = 0; i < vcP->nFrameCount; i++) {
#if DBG
	h = vcP->frames [i].index;
	if ((nDbgTexture >= 0) && (h == nDbgTexture))
		nDbgTexture = nDbgTexture;
#endif
	LoadBitmap (h = vcP->frames [i].index, 0);
	bmP = &gameData.pig.tex.bitmaps [0][h];
	bmP->SetTranspType (nTranspType);
	bmP->SetupTexture (1, bLoadTextures);
	if (!i && bmP->Override ())
		SetupHiresVClip (vcP, NULL, bmP->Override ());
	}
}