Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ on: [push]
jobs:
build:

runs-on: windows-2019
runs-on: windows-2022

steps:
- uses: actions/checkout@v2
- name: build
shell: cmd
run: ("C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\msbuild" /t:Rebuild /p:WindowsTargetPlatformVersion=10.0.18362.0 /p:PlatformToolset=v142 /m /p:"Configuration=Release (MOD)" /p:Platform=Win32)
- uses: actions/checkout@v4
- name: set msbuild (windows)
uses: ilammy/msvc-dev-cmd@v1
- name: build-x86
run: msbuild /t:Rebuild /p:WindowsTargetPlatformVersion=10.0 /p:PlatformToolset=v143 /m /p:"Configuration=Release (MOD)" /p:Platform=Win32
- name: build-x64
shell: cmd
run: ("C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\msbuild" /t:Rebuild /p:WindowsTargetPlatformVersion=10.0.18362.0 /p:PlatformToolset=v142 /m /p:"Configuration=Release (MOD)" /p:Platform=x64)
run: msbuild /t:Rebuild /p:WindowsTargetPlatformVersion=10.0 /p:PlatformToolset=v143 /m /p:"Configuration=Release (MOD)" /p:Platform=x64
- name: copy
shell: cmd
run: cmake -E copy "bin\Win32\VSFilter\Release (MOD)\VSFilterMod.dll" dist\x86\VSFilterMod.dll && cmake -E copy "bin\x64\VSFilter\Release (MOD)\VSFilterMod.dll" dist\x64\VSFilterMod.dll
- name: upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: VSFilterMod_bin
path: dist
247 changes: 0 additions & 247 deletions include/stdint.h

This file was deleted.

4 changes: 2 additions & 2 deletions src/subpic/MemSubPic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ STDMETHODIMP CMemSubPic::AlphaBlt(RECT* pSrc, RECT* pDst, SubPicDesc* pTarget)
{
if(s2[3] < 0xff)
{
d2[0] = (((d2[0] - 0x10) * s2[3]) >> 8) + s2[1];
d2[0] = (((d2[0] - RANGE[0][3]) * s2[3]) >> 8) + s2[1];
}
}
}
Expand Down Expand Up @@ -640,7 +640,7 @@ STDMETHODIMP CMemSubPic::AlphaBlt(RECT* pSrc, RECT* pDst, SubPicDesc* pTarget)
unsigned int ia = (s2[3] + s2[3+src.pitch] + is2[3] + is2[3+src.pitch]) >> 2;
if(ia < 0xff)
{
*d2 = (((*d2 - 0x80) * ia) >> 8) + ((s2[0] + s2[src.pitch]) >> 1);
*d2 = (((*d2 - RANGE[i+1][3]) * ia) >> 8) + ((s2[0] + s2[src.pitch]) >> 1);
}
}
}
Expand Down
13 changes: 8 additions & 5 deletions src/subtitles/RTS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ CWord::CWord(STSStyle& style, CStringW str, int ktype, int kstart, int kend, dou
, m_scalex(scalex), m_scaley(scaley)
, m_fDrawn(false), m_p(INT_MAX, INT_MAX)
, m_fLineBreak(false), m_fWhiteSpaceChar(false)
, m_pOpaqueBox(NULL)
, m_pOpaqueBox(NULL), isOpaqueBox(false)
{
if(str.IsEmpty())
{
Expand Down Expand Up @@ -151,8 +151,8 @@ void CWord::Paint(CPoint p, CPoint org)

void CWord::Transform(CPoint org)
{
double scalex = m_style.fontScaleX / 100;
double scaley = m_style.fontScaleY / 100;
double scalex = isOpaqueBox ? 1 : m_style.fontScaleX / 100;
double scaley = isOpaqueBox ? 1 : m_style.fontScaleY / 100;
const double xzoomf = m_scalex * 20000.0;
const double yzoomf = m_scaley * 20000.0;

Expand Down Expand Up @@ -534,6 +534,7 @@ bool CWord::CreateOpaqueBox()
-w, m_ascent + m_descent + h);

m_pOpaqueBox = DNew CPolygon(style, str, 0, 0, 0, 1.0 / 8, 1.0 / 8, 0);
m_pOpaqueBox->isOpaqueBox = true;

return(!!m_pOpaqueBox);
}
Expand Down Expand Up @@ -1118,7 +1119,7 @@ CRect CLine::PaintOutline(SubPicDesc& spd, CRect& clipRect, BYTE* pAlphaMask, CP
if(w->m_style.borderStyle == 0)
{
#ifdef _VSMOD // patch m004. gradient colors
bbox |= w->Draw(spd, clipRect, pAlphaMask, x, y, sw, !w->m_style.alpha[0] && !w->m_style.alpha[1] && !alpha, true, 2, w->m_style.mod_grad, mod_vc);
bbox |= w->Draw(spd, clipRect, pAlphaMask, x, y, sw, !w->m_style.alpha[0] && !w->m_style.alpha[1] && !alpha && !w->m_style.mod_grad.bodyIsGradAlpha, true, 2, w->m_style.mod_grad, mod_vc);
#else
bbox |= w->Draw(spd, clipRect, pAlphaMask, x, y, sw, !w->m_style.alpha[0] && !w->m_style.alpha[1] && !alpha, true);
#endif
Expand Down Expand Up @@ -2235,8 +2236,10 @@ bool CRenderedTextSubtitle::ParseSSATag(CSubtitle* sub, CStringW str, STSStyle&
//if (!fAnimate)
style.mod_grad.mode[i] = 1;

if (i == 0 || i == 1)
if (i == 0 || i == 1) {
style.mod_grad.mode[0] = style.mod_grad.mode[1] = 1;
style.mod_grad.bodyIsGradAlpha = true;
}
}
}
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/subtitles/RTS.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class CWord : public Rasterizer

CPolygon* m_pOpaqueBox;

bool isOpaqueBox;

int m_ktype, m_kstart, m_kend;

int m_width, m_ascent, m_descent;
Expand Down
3 changes: 3 additions & 0 deletions src/subtitles/Rasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,8 @@ CRect Rasterizer::Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int x
int h = mOverlayHeight;
int xo = 0, yo = 0;

int yBeforeClip = y;

// Again, limiting?
if(x < r.left)
{
Expand Down Expand Up @@ -1841,6 +1843,7 @@ CRect Rasterizer::Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int x
rnfo.mod_grad.xoffset = xo;
rnfo.mod_grad.yoffset = yo;
rnfo.typ = typ;
rnfo.mod_grad.clipDiff = clipRect.bottom < yBeforeClip + mOverlayHeight ? yBeforeClip + mOverlayHeight - clipRect.bottom : 0;
#else
// The complex "vector clip mask" I think.
rnfo.am = pAlphaMask + spd.w * y + x;
Expand Down
Loading