コード例 #1
0
ファイル: SVGASCR8.CPP プロジェクト: garyqinyu/abv
/*--------------------------------------------------------------------------*/
UCHAR *GenericSvgaScreen::GetVideoAddress(void)
{
   #if defined(DOUBLE_BUFFER) && !defined(LOCAL_BUFFERING)
	UCHAR* pMem = GetFrameBufferAddress( mwHRes * mwVRes * 2 );
   #else
	UCHAR* pMem = GetFrameBufferAddress( mwHRes * mwVRes );
   #endif

   #ifdef DPMI_API_DJGPP
	int ret = __djgpp_nearptr_enable();
	if (ret != 0)
	{
        return NULL;
	}
	else
    {
        return NULL;
	}

	__djgpp_nearptr_disable();

   #endif

   #ifdef DOUBLE_BUFFER
   # ifdef LOCAL_BUFFERING
	mpTargetMem = pMem;
	pMem = new UCHAR[mwHRes * mwVRes];
   # else
	pMem += mwHRes * mwVRes;
   # endif
   #endif

	return pMem; 
}
コード例 #2
0
ファイル: GOL.c プロジェクト: varesa/SnakePIC32
/*********************************************************************
* Function: WORD GOLDraw()
*
* PreCondition: none
*
* Input: none
*
* Output: non-zero if drawing is complete
*
* Side Effects: none
*
* Overview: redraws objects in the current linked list
*
* Note: none
*
********************************************************************/
WORD GOLDraw(void)
{
    static OBJ_HEADER   *pCurrentObj = NULL;
    SHORT               done;

    #ifdef USE_DOUBLE_BUFFERING
    static BYTE         DisplayUpdated = 0;
    if(IsDisplayUpdatePending())
    {
        return 0;
    }
    #endif // USE_DOUBLE_BUFFERING

    if(pCurrentObj == NULL)
    {
        if(GOLDrawCallback())
        {
            #ifdef USE_DOUBLE_BUFFERING
				#ifdef USE_TRANSITION_EFFECTS
                if(TransitionPendingStatus)
                {
                    TransitionPendingStatus = 0;
	                while(IsDisplayUpdatePending());
                   	GFXExecutePendingTransition(GetDrawBufferAddress(), GetFrameBufferAddress());
                }
				#endif
            #endif //USE_DOUBLE_BUFFERING
            
            // It's last object jump to head
            pCurrentObj = _pGolObjects;

            #ifdef USE_DOUBLE_BUFFERING
            if(DisplayUpdated)
            {
                RequestDisplayUpdate();
                DisplayUpdated = 0;
                return(0);
            }
            #endif //USE_DOUBLE_BUFFERING
        }
        else
        {
            return (0);     // drawing is not done
        }
    }

    done = 0;
    while(pCurrentObj != NULL)
    {
        if(IsObjUpdated(pCurrentObj))
        {
            done = pCurrentObj->DrawObj(pCurrentObj);

            if(done)
            {
                GOLDrawComplete(pCurrentObj);

			#ifdef USE_DOUBLE_BUFFERING

			    InvalidateRectangle(pCurrentObj->left, pCurrentObj->top,
			                        pCurrentObj->right, pCurrentObj->bottom);
                DisplayUpdated = 1;

			#endif //USE_DOUBLE_BUFFERING

            }
            else
            {
                return (0); // drawing is not done
            }
        }

        pCurrentObj = (OBJ_HEADER *)pCurrentObj->pNxtObj;
    }

	#if defined(USE_TRANSITION_EFFECTS) && defined(USE_DOUBLE_BUFFERING)

        TransitionPendingStatus = GFXIsTransitionPending();
	    InvalidateAll(); //If needed, invalidate only the transition rectangle instead

	#endif

    return (1);             // drawing is completed
}