示例#1
0
static int BlitFXInit()
{
    if (nRotateGame & 1) {
        nVidImageWidth = nGameHeight;
        nVidImageHeight = nGameWidth;
    } else {
        nVidImageWidth = nGameWidth;
        nVidImageHeight = nGameHeight;
    }

    if (nUseBlitter >= 7 && nUseBlitter <= 9) {
        nVidImageDepth = 16;								// Use 565 format
    } else {
        nVidImageDepth = sdlsFramebuf->format->BitsPerPixel;// Use color depth of primary surface
    }
    nVidImageBPP = sdlsFramebuf->format->BytesPerPixel;
    nBurnBpp = nVidImageBPP;								// Set Burn library Bytes per pixel

    // Use our callback to get colors:
    SetBurnHighCol(nVidImageDepth);

    // Make the normal memory buffer
    if (VidSAllocVidImage()) {
        BlitFXExit();
        return 1;
    }

    if (BlitFXMakeSurf()) {
        BlitFXExit();
        return 1;
    }

    return 0;
}
static int BlitFXInit()
{
	int nMemLen = 0;

	nVidImageWidth = nGamesWidth;
	nVidImageHeight = nGamesHeight;

	nVidImageDepth = bDrvOkay ? 16 : 32;
	nVidImageBPP = (nVidImageDepth + 7) >> 3;
	nBurnBpp = nVidImageBPP;
	SetBurnHighCol(nVidImageDepth);

	if (!nRotateGame) {
		nVidImagePitch = nVidImageWidth * nVidImageBPP;
	} else {
		nVidImagePitch = nVidImageHeight * nVidImageBPP;
	}

	nMemLen = nVidImageHeight * nVidImagePitch;
	nBurnPitch = nVidImagePitch;

	texture = (unsigned char *)malloc(nTextureWidth * nTextureHeight * nVidImageBPP);

	gamescreen = (unsigned char *)malloc(nMemLen);
	if (gamescreen) {
		memset(gamescreen, 0, nMemLen);
		pVidImage = gamescreen + nVidImagePitch;
		return 0;
	} else {
		pVidImage = NULL;
		return 1;
	}

	return 0;
}
示例#3
0
static int Init()
{
	bRotateGame = (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL);
	bFlipGame = BurnDrvGetFlags() & BDF_ORIENTATION_FLIPPED;

	if (BurnDrvGetFlags() & BDF_ORIENTATION_VERTICAL) {
		BurnDrvGetVisibleSize(&clipy, &clipx);
		BurnDrvGetFullSize(&sizex, &sizey);
	} else {
		BurnDrvGetVisibleSize(&clipx, &clipy);
		BurnDrvGetFullSize(&sizex, &sizey);
	}
   	VidBpp		= nBurnBpp = 2;
	VidMemPitch	= sizex * VidBpp;
	VidMemLen	= sizey * VidMemPitch;
	VidMem = (unsigned char*)malloc(VidMemLen);
	SetBurnHighCol(16);
	bVidScanlines = 0;								// !!!
	nVidFullscreen=0;
	vidgu_init();
	return 0;
}