Esempio n. 1
0
void CPixelBufferView::OnDeviceReset()
{
	CreateResources();
	m_pixelBufferTexture = CreateTextureFromBitmap(m_pixelBufferBitmap);
	if(!m_checkerboardEffect.IsEmpty()) m_checkerboardEffect->OnResetDevice();
	if(!m_pixelBufferViewEffect.IsEmpty()) m_pixelBufferViewEffect->OnResetDevice();
}
Esempio n. 2
0
const BOOLEAN CSprite::Load(const PCHAR name)
{
    Clear();

    const HPACKAGE package=LoadPackage(name);
    if (package.p==NULL)return FALSE;

    DWORD size;
    // Erst Anzahl in Package testen
    LPVOID data=LoadNextPackageData(&package,NULL,&size);
    anzahl=0;
    while (data)
    {
        anzahl++;
        data=LoadNextPackageData(&package,data,&size);
    }
    if (anzahl==0)
    {
        FreePackage(&package);
        return FALSE;
    }
    // Speicher reservieren

    lpImages=new LPDIRECTDRAWSURFACE7[anzahl];

    // Dann Bilder laden
    data=LoadNextPackageData(&package,NULL,&size);
    anzahl=0;
    while (data)
    {
        HBITMAP bitmap=LoadPictureFromMemory(data,size);
        if (bitmap==0)
        {
            FreePackage(&package);
            return FALSE;
        }

        lpImages[anzahl]=CreateTextureFromBitmap(game->lpDevice,game->lpDD,NULL,bitmap,3,TRUE,TRUE,FALSE);
        if (lpImages[anzahl]!=NULL)
            MakeTransparent(lpImages[anzahl],FALSE);

        DeleteObject(bitmap);

        anzahl++;
        data=LoadNextPackageData(&package,data,&size);
    }

    FreePackage(&package);

#ifdef _DEBUG
    CHAR c[200];
    sprintf(&c[0],"Sprite geladen: %s",name);
    DebugOut(&c[0]);
#endif

    return TRUE;
}
void CPixelBufferView::CreateSelectedPixelBufferTexture()
{
	m_pixelBufferTexture.Reset();

	auto pixelBuffer = GetSelectedPixelBuffer();
	if(!pixelBuffer) return;

	m_pixelBufferTexture = CreateTextureFromBitmap(pixelBuffer->second);
}
Esempio n. 4
0
void CPixelBufferView::SetBitmap(const Framework::CBitmap& bitmap)
{
	m_pixelBufferBitmap = bitmap;
	m_pixelBufferTexture = CreateTextureFromBitmap(bitmap);
	Refresh();
}