1. Shift-Print Screen works with 50% Scan Lines

2. Minor Optimization at Display Logo screen.
This commit is contained in:
mpohoreski 2009-02-18 07:54:24 +00:00
parent bc8106fee7
commit 364de6d77b

View File

@ -1899,7 +1899,8 @@ void VideoDrawLogoBitmap ( HDC hDstDC )
} }
//=========================================================================== //===========================================================================
void VideoDisplayLogo () { void VideoDisplayLogo ()
{
HDC hFrameDC = FrameGetDC(); HDC hFrameDC = FrameGetDC();
// DRAW THE LOGO // DRAW THE LOGO
@ -1925,16 +1926,21 @@ void VideoDisplayLogo () {
SetBkMode(hFrameDC,TRANSPARENT); SetBkMode(hFrameDC,TRANSPARENT);
#define VERSION_TXT "Version " #define VERSION_TXT "Version "
char* szVersion = new char[strlen(VERSION_TXT) + strlen(VERSIONSTRING) + 1];
strcpy(&szVersion[0], VERSION_TXT);
strcpy(&szVersion[strlen(VERSION_TXT)], VERSIONSTRING);
szVersion[strlen(szVersion)] = 0x00;
#define DRAWVERSION(x,y,c) SetTextColor(hFrameDC,c); \ // Daily WTF candidate -- malloc every _frame_ ?!?!
TextOut(hFrameDC, \ // char* szVersion = new char[strlen(VERSION_TXT) + strlen(VERSIONSTRING) + 1];
540+x,358+y, \ // strcpy(&szVersion[0], VERSION_TXT);
szVersion, \ // strcpy(&szVersion[strlen(VERSION_TXT)], VERSIONSTRING);
strlen(szVersion)); // szVersion[strlen(szVersion)] = 0x00;
char szVersion[ 32 ];
sprintf( szVersion, "Version %s", VERSIONSTRING );
#define DRAWVERSION(x,y,c) \
SetTextColor(hFrameDC,c); \
TextOut(hFrameDC, \
540+x,358+y, \
szVersion, \
strlen(szVersion));
if (GetDeviceCaps(hFrameDC,PLANES) * GetDeviceCaps(hFrameDC,BITSPIXEL) <= 4) { if (GetDeviceCaps(hFrameDC,PLANES) * GetDeviceCaps(hFrameDC,BITSPIXEL) <= 4) {
DRAWVERSION( 2, 2,RGB(0x00,0x00,0x00)); DRAWVERSION( 2, 2,RGB(0x00,0x00,0x00));
@ -1947,7 +1953,8 @@ void VideoDisplayLogo () {
DRAWVERSION( 0, 0,PALETTERGB(0x70,0x30,0xE0)); DRAWVERSION( 0, 0,PALETTERGB(0x70,0x30,0xE0));
} }
delete [] szVersion; // Daily WTF candidate -- malloc every _frame_ ?!?!
// delete [] szVersion;
#undef DRAWVERSION #undef DRAWVERSION
FrameReleaseDC(); FrameReleaseDC();
@ -2166,8 +2173,8 @@ void _Video_RedrawScreen( VideoUpdateFuncPtr_t pfUpdate, bool bMixed )
// 50% Half Scan Line // 50% Half Scan Line
if( g_uHalfScanLines ) if( g_uHalfScanLines )
{ {
// We zero out the 1st row (row zero) because the bitmap is upside down // We clear every odd scanline because Shift-Print Screen saves only the even rows
for( int y = 0; y < FRAMEBUFFER_H; y += 2 ) for( int y = 1; y < FRAMEBUFFER_H; y += 2 )
{ {
unsigned char *pSrc = pSrc = frameoffsettable[y]; unsigned char *pSrc = pSrc = frameoffsettable[y];
for( int x = 0; x < FRAMEBUFFER_W; x++ ) for( int x = 0; x < FRAMEBUFFER_W; x++ )