📄 overlay_win32.c
字号:
/*****************************************************************************
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: overlay_base.c 153 2004-12-20 16:46:49Z picard $
*
* BetaPlayer Overlay plugin
* Copyright (c) 2004 Gabor Kovacs
*
****************************************************************************/
#include "../stdafx.h"
#if defined(_WIN32)
#ifndef STRICT
#define STRICT
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
void OvlInvalidate( overlay_base* p, const rect* Rect, bool_t Local )
{
POINT o;
RECT r;
if (Rect->Height>0 && Rect->Width>0)
{
DEBUG_MSG5(DEBUG_VIDEO,T("Invalidate %d,%d,%d,%d (%d)"),Rect->x,Rect->y,Rect->Width,Rect->Height,Local);
if (Local)
{
// only local invalidate
o.x = 0;
o.y = 0;
ClientToScreen(p->Wnd,&o);
DEBUG_MSG2(DEBUG_VIDEO,T("Invalidate local offset %d,%d"),o.x,o.y);
r.left = Rect->x - o.x;
r.top = Rect->y - o.y;
r.right = r.left + Rect->Width;
r.bottom = r.top + Rect->Height;
InvalidateRect(p->Wnd,&r,0);
}
else
GlobalInvalidate(Rect);
}
}
void OvlValidate( overlay_base* p, const rect* Rect )
{
POINT o;
RECT r;
if (Rect->Height>0 && Rect->Width>0)
{
DEBUG_MSG4(DEBUG_VIDEO,T("Validate %d,%d,%d,%d"),Rect->x,Rect->y,Rect->Width,Rect->Height);
o.x = 0;
o.y = 0;
ClientToScreen(p->Wnd,&o);
DEBUG_MSG2(DEBUG_VIDEO,T("Validate offset %d,%d"),o.x,o.y);
r.left = Rect->x - o.x;
r.top = Rect->y - o.y;
r.right = r.left+Rect->Width;
r.bottom = r.top+Rect->Height;
ValidateRect(p->Wnd,&r);
}
}
void OvlAdjustOrientation(overlay_base* p, bool_t Combine)
{
int Width = GetSystemMetrics(SM_CXSCREEN);
int Height = GetSystemMetrics(SM_CYSCREEN);
int Orientation;
rect Virt;
p->DisableOrientation = 1;
if ((Width == p->Output.Width*2 && Height == p->Output.Height*2) ||
(Width == p->Output.Height*2 && Height == p->Output.Width*2))
p->Output.Pixel.Flags |= PF_PIXELDOUBLE;
Orientation = QueryOrientation();
if (Combine)
p->Output.Direction = CombineDir(0,p->Output.Direction,Orientation);
// still rotated?
PhyToVirt(NULL,&Virt,&p->Output);
if (Width != Height && Virt.Width == Height && Virt.Height == Width)
{
if (Orientation & DIR_MIRRORLEFTRIGHT)
p->Output.Direction ^= DIR_SWAPXY | DIR_MIRRORLEFTRIGHT;
else
p->Output.Direction ^= DIR_SWAPXY | DIR_MIRRORUPDOWN;
}
p->DisableOrientation = 0;
}
void OvlFreeModule(overlay_base* p)
{
if (p->Module)
{
FreeLibrary(p->Module);
p->Module = NULL;
}
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -