Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kaito-tokyo/obs-pokemon-sv-screen-builder
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.4.2
Choose a base ref
...
head repository: kaito-tokyo/obs-pokemon-sv-screen-builder
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 2,030 additions and 2,908 deletions.
  1. +116 −16 .clang-format
  2. +0 −9 .cmake-format.json
  3. +5 −5 .github/actions/package-plugin/action.yaml
  4. +4 −4 .github/actions/run-clang-format/action.yaml
  5. +1 −1 .github/actions/setup-macos-codesigning/action.yaml
  6. +1 −0 .github/scripts/.build.zsh
  7. +2 −14 .github/scripts/.package.zsh
  8. +12 −21 .github/scripts/Package-Windows.ps1
  9. +0 −292 .github/scripts/build-linux
  10. +1 −0 .github/scripts/build-linux
  11. +0 −292 .github/scripts/build-macos
  12. +1 −0 .github/scripts/build-macos
  13. +0 −274 .github/scripts/package-linux
  14. +1 −0 .github/scripts/package-linux
  15. +0 −274 .github/scripts/package-macos
  16. +1 −0 .github/scripts/package-macos
  17. +0 −62 .github/scripts/utils.zsh/check_packages
  18. +38 −41 .github/workflows/build-project.yaml
  19. +2 −2 .github/workflows/check-format.yaml
  20. +1 −1 .github/workflows/pr-pull.yaml
  21. +3 −3 .github/workflows/push.yaml
  22. +1 −0 .gitignore
  23. +0 −3 .gitmodules
  24. +4 −0 .prettierrc
  25. +15 −38 CMakeLists.txt
  26. +16 −16 CMakePresets.json
  27. +3 −0 README.md
  28. +7 −7 build-aux/.run-format.zsh
  29. +12 −21 buildspec.json
  30. +0 −21 cmake/BuildMyCurl.cmake
  31. +0 −192 cmake/BuildMyOpenCV.cmake
  32. +44 −0 cmake/FetchCurl.cmake
  33. +37 −63 cmake/FetchOpenCV.cmake
  34. +0 −2 cmake/common/bootstrap.cmake
  35. +1 −1 cmake/common/compiler_common.cmake
  36. +6 −85 cmake/common/helpers_common.cmake
  37. +3 −17 cmake/macos/helpers.cmake
  38. +0 −17 cmake/macos/resources/Distribution.xml
  39. +35 −7 cmake/macos/resources/create-package.cmake.in
  40. +33 −0 cmake/macos/resources/distribution.in
  41. +0 −6 cmake/macos/resources/scripts/postinstall
  42. +22 −4 cmake/windows/compilerconfig.cmake
  43. +4 −3 cmake/windows/helpers.cmake
  44. +8 −2 data-generator/MyRankExtractor.py
  45. +2 −2 data-generator/{SelectionRecognizer.py → MySelectionRecognizer.py}
  46. +4 −3 data-generator/{PokemonRecognizer.py → OpponentPokemonImageRecognizer.py}
  47. +1 −1 data-generator/SceneDetector_lobbyRankShown.py
  48. BIN data/browser/MyPokemonEmpty1.png
  49. BIN data/browser/MyPokemonEmpty2.png
  50. BIN data/browser/MyPokemonEmpty3.png
  51. BIN data/browser/MyPokemonEmpty4.png
  52. BIN data/browser/MyPokemonEmpty5.png
  53. BIN data/browser/MyPokemonEmpty6.png
  54. +70 −16 data/browser/MySelection.html
  55. +156 −15 data/browser/OpponentTeam.html
  56. +3 −0 data/locale/en-US.ini
  57. +6 −0 data/locale/ja-JP.ini
  58. +39 −0 data/preset/MatchStateAggregator.json
  59. +7 −7 data/preset/MyPokemonCropper.json
  60. +4 −0 data/preset/MyPokemonNameRecognizer.json
  61. BIN data/preset/MyRankExtractor.cbor
  62. BIN data/preset/{SelectionRecognizer.cbor → MySelectionRecognizer.cbor}
  63. +4 −0 data/preset/MyToolNameRecognizer.json
  64. +3 −3 data/preset/OpponentPokemonCropper.json
  65. BIN data/preset/OpponentPokemonImageRecognizer.cbor
  66. BIN data/preset/OpponentRankExtractor.cbor
  67. BIN data/preset/PokemonRecognizer.cbor
  68. +5 −0 data/preset/ResultCropper.json
  69. +7 −0 data/preset/ResultRecognizer.json
  70. +2 −2 data/preset/SceneDetector_lobbyMySelect.json
  71. +7 −0 data/preset/SceneDetector_lobbyMySelectV.json
  72. +1 −1 data/preset/SceneDetector_lobbyOpponentSelect.json
  73. BIN data/preset/SceneDetector_lobbyRankShown.cbor
  74. +1 −1 src/Base64/Base64.hpp
  75. +17 −1 src/Croppers/OpponentPokemonCropper.hpp
  76. +22 −0 src/Croppers/ResultCropper.hpp
  77. +23 −16 src/Extractors/MyRankExtractor.hpp
  78. +31 −0 src/Recognizers/MyPokemonNameRecognizer.hpp
  79. +6 −5 src/Recognizers/{SelectionRecognizer.hpp → MySelectionRecognizer.hpp}
  80. +31 −0 src/Recognizers/MyToolNameRecognizer.hpp
  81. +6 −6 src/Recognizers/{PokemonRecognizer.hpp → OpponentPokemonImageRecognizer.hpp}
  82. +55 −0 src/Recognizers/ResultRecognizer.hpp
  83. +97 −104 src/ScreenBuilder/ActionHandler.cpp
  84. +206 −37 src/ScreenBuilder/ActionHandler.hpp
  85. +10 −3 src/ScreenBuilder/HistClassifier.hpp
  86. +32 −8 src/ScreenBuilder/Logger.hpp
  87. +79 −0 src/ScreenBuilder/MatchState.hpp
  88. +98 −0 src/ScreenBuilder/MatchStateAggregator.hpp
  89. +5 −2 src/{obs-browser-api.h → ScreenBuilder/ObsBrowserUtil.hpp}
  90. +6 −3 src/ScreenBuilder/SceneDetector.hpp
  91. +32 −0 src/ScreenBuilder/ScreenState.hpp
  92. +18 −17 src/ScreenBuilder/StateMachine.cpp
  93. +9 −5 src/ScreenBuilder/StateMachine.hpp
  94. +1 −1 src/ScreenBuilder/TemplateClassifier.hpp
  95. +4 −0 src/TextRecognizer/TesseractTextRecognizer/CMakeLists.txt
  96. +12 −0 src/TextRecognizer/TesseractTextRecognizer/TesseractTextRecognizer.cpp
  97. +4 −19 src/TextRecognizer/TextRecognizer.h
  98. +8 −0 src/TextRecognizer/VisionTextRecognizer/CMakeLists.txt
  99. +78 −67 src/TextRecognizer/VisionTextRecognizer/VisionTextRecognizer.mm
  100. +0 −3 src/TextRecognizer/WinRTTextRecognizer/.gitignore
  101. +3 −1 src/TextRecognizer/WinRTTextRecognizer/CMakeLists.txt
  102. +25 −5 src/TextRecognizer/WinRTTextRecognizer/{textRecognizerImpl.cpp → WinRTTextRecognizer.cpp}
  103. +0 −1 src/TextRecognizer/WinRTTextRecognizer/pch.cpp
  104. +0 −10 src/TextRecognizer/WinRTTextRecognizer/pch.h
  105. +48 −0 src/UpdateChecker/CurlClient.hpp
  106. +19 −119 src/UpdateChecker/GitHubClient.hpp
  107. +0 −50 src/UpdateChecker/URLSessionClient/URLSessionClient.mm
  108. +0 −92 src/UpdateChecker/UpdateChecker.cpp
  109. +0 −13 src/UpdateChecker/UpdateChecker.h
  110. +0 −57 src/UpdateChecker/UpdateDialog.cpp
  111. +0 −14 src/UpdateChecker/UpdateDialog.hpp
  112. +0 −8 src/UpdateChecker/WinRTHttpClient/CMakeLists.txt
  113. +0 −36 src/UpdateChecker/WinRTHttpClient/WinRTHttpClient.cpp
  114. +128 −46 src/factory.cpp
  115. +18 −8 src/factory.hpp
  116. +0 −11 src/obs-platform-util.h
  117. +0 −7 src/plugin-main.c
  118. +2 −2 src/plugin-support.c.in
  119. +2 −2 src/plugin-support.h
  120. +88 −25 src/screen-source.cpp
  121. +45 −30 src/screen-source.hpp
  122. +0 −77 src/util/c99defs.h
  123. +0 −129 src/util/config-file.h
  124. +0 −1 vendor/nameof
132 changes: 116 additions & 16 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# please use clang-format version 8 or later
# please use clang-format version 16 or later

Standard: Cpp11
Standard: c++17
AccessModifierOffset: -8
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
#AllowAllArgumentsOnNextLine: false # requires clang-format 9
#AllowAllConstructorInitializersOnNextLine: false # requires clang-format 9
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
#AllowShortLambdasOnASingleLine: Inline # requires clang-format 9
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
@@ -52,8 +52,8 @@ ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
FixNamespaceComments: false
ForEachMacros:
FixNamespaceComments: true
ForEachMacros:
- 'json_object_foreach'
- 'json_object_foreach_safe'
- 'json_array_foreach'
@@ -66,7 +66,7 @@ IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
#ObjCBinPackProtocolList: Auto # requires clang-format 7
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 8
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
@@ -84,25 +84,125 @@ ReflowComments: false
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
#SpaceAfterLogicalNot: false # requires clang-format 9
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
#SpaceBeforeCtorInitializerColon: true # requires clang-format 7
#SpaceBeforeInheritanceColon: true # requires clang-format 7
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true # requires clang-format 7
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
#StatementMacros: # requires clang-format 8
# - 'Q_OBJECT'
StatementMacros:
- 'Q_OBJECT'
TabWidth: 8
#TypenameMacros: # requires clang-format 9
# - 'DARRAY'
TypenameMacros:
- 'DARRAY'
UseTab: ForContinuationAndIndentation
---
Language: ObjC
AccessModifierOffset: 2
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AttributeMacros: ['__unused', '__autoreleasing', '_Nonnull', '__bridge']
BitFieldColonSpacing: Both
#BreakBeforeBraces: Webkit
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakArrays: false
BreakBeforeConceptDeclarations: Allowed
BreakBeforeInlineASMColon: OnlyMultiline
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterComma
ColumnLimit: 120
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: Indent
IndentGotoLabels: false
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: false
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
NamespaceIndentation: All
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: false
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PPIndentWidth: -1
PackConstructorInitializers: NextLine
QualifierAlignment: Leave
ReferenceAlignment: Right
RemoveSemicolon: false
RequiresClausePosition: WithPreceding
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 1
SortIncludes: false
#SortUsingDeclarations: LexicographicNumeric
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInConditionalStatement: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
Standard: c++17
TabWidth: 4
UseTab: Never
9 changes: 0 additions & 9 deletions .cmake-format.json
Original file line number Diff line number Diff line change
@@ -6,15 +6,6 @@
"autosort": true
},
"additional_commands": {
"find_qt": {
"flags": [],
"kwargs": {
"COMPONENTS": "+",
"COMPONENTS_WIN": "+",
"COMPONENTS_MACOS": "+",
"COMPONENTS_LINUX": "+"
}
},
"set_target_properties_obs": {
"pargs": 1,
"flags": [],
10 changes: 5 additions & 5 deletions .github/actions/package-plugin/action.yaml
Original file line number Diff line number Diff line change
@@ -20,14 +20,14 @@ inputs:
description: 'Developer ID for application codesigning (macOS only)'
required: false
default: '-'
codesignTeam:
description: 'Developer team for application codesigning (macOS only)'
required: false
default: ''
installerIdent:
description: 'Developer ID for installer package codesigning (macOS only)'
required: false
default: ''
codesignTeam:
description: 'Developer team for codesigning (macOS only)'
required: false
default: ''
codesignUser:
description: 'Apple ID username for notarization (macOS only)'
required: false
@@ -53,8 +53,8 @@ runs:
working-directory: ${{ inputs.workingDirectory }}
env:
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
CODESIGN_TEAM: ${{ inputs.codesignTeam }}
CODESIGN_IDENT_INSTALLER: ${{ inputs.installerIdent }}
CODESIGN_TEAM: ${{ inputs.codesignTeam }}
CODESIGN_IDENT_USER: ${{ inputs.codesignUser }}
CODESIGN_IDENT_PASS: ${{ inputs.codesignPass }}
run: |
8 changes: 4 additions & 4 deletions .github/actions/run-clang-format/action.yaml
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ runs:
echo ::group::Install Dependencies
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@13/bin" >> $GITHUB_PATH
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@17/bin" >> $GITHUB_PATH
brew install --quiet zsh
echo ::endgroup::
@@ -51,11 +51,11 @@ runs:
}
if (( ${changes[(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)]} )) {
echo ::group::Install clang-format-13
brew install --quiet obsproject/tools/clang-format@13
echo ::group::Install clang-format-17
brew install --quiet obsproject/tools/clang-format@17
echo ::endgroup::
echo ::group::Run clang-format-13
echo ::group::Run clang-format-17
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check
echo ::endgroup::
}
2 changes: 1 addition & 1 deletion .github/actions/setup-macos-codesigning/action.yaml
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ runs:
print -n "${MACOS_SIGNING_CERT}" | base64 --decode --output="${certificate_path}"
: "${MACOS_KEYCHAIN_PASSWORD:="$(print ${RANDOM} | sha1sum | head -c 32)"}"
: "${MACOS_KEYCHAIN_PASSWORD:="$(print ${RANDOM} | shasum | head -c 32)"}"
print '::group::Keychain setup'
security create-keychain -p "${MACOS_KEYCHAIN_PASSWORD}" ${keychain_path}
1 change: 1 addition & 0 deletions .github/scripts/.build.zsh
Original file line number Diff line number Diff line change
@@ -242,6 +242,7 @@ ${_usage_host:-}"
-G "${generator}"
-DQT_VERSION=${QT_VERSION:-6}
-DCMAKE_BUILD_TYPE=${config}
-DCMAKE_INSTALL_PREFIX=/usr
)
local cmake_version
16 changes: 2 additions & 14 deletions .github/scripts/.package.zsh
Original file line number Diff line number Diff line change
@@ -180,25 +180,13 @@ ${_usage_host:-}"
if (( _loglevel > 1 || ${+CI} )) _tarflags="v${_tarflags}"
if (( package )) {
if [[ ! -f ${project_root}/build_macos/installer-macos.generated.pkgproj ]] {
log_error 'Packages project file not found. Run the build script or the CMake build and install procedures first.'
if [[ ! -f ${project_root}/release/${config}/${product_name}.pkg ]] {
log_error 'Installer Package not found. Run the build script or the CMake build and install procedures first.'
return 2
}
check_packages
log_group "Packaging ${product_name}..."
pushd ${project_root}
pkgbuild \
--component "${project_root}/release/obs-backgroundremoval.plugin" \
--install-location "/Library/Application Support/obs-studio/plugins" \
--scripts "${project_root}/cmake/macos/resources/scripts" \
"${project_root}/release/${product_name}-flat.pkg"
productbuild \
--distribution "${project_root}/cmake/macos/resources/Distribution.xml" \
--package-path "${project_root}/release" \
"${project_root}/release/${product_name}.pkg"
rm "${project_root}/release/${product_name}-flat.pkg"
if (( codesign )) {
read_codesign_installer
33 changes: 12 additions & 21 deletions .github/scripts/Package-Windows.ps1
Original file line number Diff line number Diff line change
@@ -64,10 +64,20 @@ function Package {

Remove-Item @RemoveArgs

Log-Group "Archiving ${ProductName}..."
$CompressArgs = @{
Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*")
CompressionLevel = 'Optimal'
DestinationPath = "${ProjectRoot}/release/${OutputName}.zip"
Verbose = ($Env:CI -ne $null)
}
Compress-Archive -Force @CompressArgs
Log-Group

if ( ( $BuildInstaller ) ) {
Log-Group "Packaging ${ProductName}..."
$IsccFile = "${ProjectRoot}/build_${Target}/installer-Windows.generated.iss"

$IsccFile = "${ProjectRoot}/build_${Target}/installer-Windows.generated.iss"
if ( ! ( Test-Path -Path $IsccFile ) ) {
throw 'InnoSetup install script not found. Run the build script or the CMake build and install procedures first.'
}
@@ -80,27 +90,8 @@ function Package {
Remove-Item -Path Package -Recurse
Pop-Location -Stack BuildTemp

Log-Group "Archiving ${ProductName}..."
$CompressArgs = @{
Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*")
CompressionLevel = 'Optimal'
DestinationPath = "${ProjectRoot}/release/${OutputName}.zip"
Verbose = ($Env:CI -ne $null)
}

Compress-Archive -Force @CompressArgs
} else {
Log-Group "Archiving ${ProductName}..."
$CompressArgs = @{
Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*")
CompressionLevel = 'Optimal'
DestinationPath = "${ProjectRoot}/release/${OutputName}.zip"
Verbose = ($Env:CI -ne $null)
}

Compress-Archive -Force @CompressArgs
Log-Group
}
Log-Group
}

Package
Loading