예제 #1
0
static int MemToSurf()
{
    VidSoftFXApplyEffectSDL(sdlsBlitFX[1 ^ nDirectAccess]);

    if (nUseSys == 0 && nDirectAccess == 0) {

        // Lock the surface so we can write to it
        if (SDL_LockSurface(sdlsBlitFX[1])) {
            return 1;
        }
        unsigned char* Surf = (unsigned char*)sdlsBlitFX[1]->pixels;
        int nPitch = sdlsBlitFX[1]->pitch;

        // Lock the surface so we can write to it
        if (SDL_LockSurface(sdlsBlitFX[0])) {
            return 1;
        }
        unsigned char* VidSurf = (unsigned char*)sdlsBlitFX[0]->pixels;
        int nVidPitch = sdlsBlitFX[0]->pitch;

        unsigned char *pd, *ps;

        int nHeight = nGameHeight * nSize;

        pd = VidSurf;
        ps = Surf;
        for (int y = 0; y < nHeight; y++, pd += nVidPitch, ps += nPitch) {
            memcpy(pd, ps, nPitch);
        }

        SDL_UnlockSurface(sdlsBlitFX[0]);
        SDL_UnlockSurface(sdlsBlitFX[1]);
    }

    return 0;
}
static int MemToSurf()
{
	VidSoftFXApplyEffectSDL( sdlFramebuf );
	return 0;
}