Пример #1
0
void DumpTree(SObject* root, int depth)
{
    for ( int i = 0; i < depth; i++ )
        FLASHOUTPUT(" ");
    FLASHOUTPUT("Type=%i Name=%s addr=%X\n", root->character ? root->character->type : -1, root->name ? root->name : "", root);
    for ( SObject* obj = root->bottomChild; obj; obj = obj->above )
        DumpTree(obj, depth+1);
}
Пример #2
0
void CBitBuffer::FreeBits()
{
	ReleaseColorInfo(m_cinfo);
	m_cinfo = 0;
	delete bitmap;
	bitmap = 0;

	FLASHOUTPUT( "CBitBuffer::FreeBits\n" );
}
Пример #3
0
void CBitBuffer::invalidate()
{
	FreeBits();
	FLASHOUTPUT( "CBitBuffer::invalidate\n" );
}
Пример #4
0
NativeBitmap::NativeBitmap( NativePlayerWnd* native,
							const SColorTable* table, 
							int _width, 
							int _height, 
							int _depth, 
							int _pixelFormat )
{
	U32 nColors;	
	LOGPALETTE256 logpal = { 0x300, 256	};

	FLASHOUTPUT( "NativeBitmap created\n" );

	width = ( _width + 3 ) & ( ~0x03 );	// increase the width to be byte-aligned
	height = _height;
	depth = _depth;
	format = _pixelFormat;
	nColors = NativeDisplayTester::CurrentScreenColors();

	bytesPerLine = ( width * depth + 7 ) / 8;

	if ( depth < 8 )
	{
		FLASHASSERT( 0 );	// not supported in this version....
	}
	else if ( depth == 8 )
	{
		for ( U32 i=0; i<nColors; i++ )
		{
			logpal.palEntry[i].peRed    = info.bmiColors[i].rgbRed   = table->colors[i].red;
			logpal.palEntry[i].peGreen  = info.bmiColors[i].rgbGreen = table->colors[i].green;
			logpal.palEntry[i].peBlue   = info.bmiColors[i].rgbBlue  = table->colors[i].blue;
										  
			info.bmiColors[i].rgbReserved = 0;
			
			if ( i >= 10 && i < 246 )
				logpal.palEntry[i].peFlags  = PC_NOCOLLAPSE;
			else
				logpal.palEntry[i].peFlags  = 0;
		}

		// Create a Palette object
		palette = ::CreatePalette((LOGPALETTE *)&logpal);
	}
	else
	{
		nColors = 0;
		palette = 0;
	}	
	
	memset( &info.bmiHeader, 0, sizeof( BITMAPINFOHEADER ) );
	info.bmiHeader.biSize = sizeof( BITMAPINFOHEADER ); // + nColors * sizeof( RGBQUAD );
	info.bmiHeader.biWidth = width;
	info.bmiHeader.biHeight = height;
	info.bmiHeader.biPlanes = 1;		// Must be 1. Thank you windows.
	info.bmiHeader.biBitCount = depth;	
	info.bmiHeader.biCompression = BI_RGB;	
	info.bmiHeader.biSizeImage = height * bytesPerLine;	
	info.bmiHeader.biClrUsed = nColors;	
	info.bmiHeader.biClrImportant = nColors;	
	
	HDC hdc = native->GetNWindowDC();

	hBitmap = CreateDIBSection( hdc, (BITMAPINFO*) &info, DIB_RGB_COLORS, (void**) &bits, 0, 0);
//  	HBITMAP hbmOld = (HBITMAP)::SelectObject(hdc, hBitmap);

	
	native->ReleaseWindowDC();

	FLASHASSERT( hBitmap );
}