Skip to content

Commit 9d84e41

Browse files
authored
Merge branch 'master' into bugfix/vehicleOccupant_dead
2 parents 34cf5fc + 78695db commit 9d84e41

2,058 files changed

Lines changed: 195479 additions & 283632 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@
33
<!-- When changing Lua APIs, consider including code samples and documentation. -->
44

55

6-
76
#### Motivation
87
<!-- Why are you making this change? Which GitHub issue does this resolve, if any? Any additional context? -->
98

109

11-
1210
#### Test plan
13-
<!-- How have you tested this change? This should give confidence to the reviewer -->
11+
<!-- How have you tested this change? This should give confidence to the reviewer that your change is safe. -->
1412
<!-- If someone makes changes to this code in the future, what steps can they follow to check that it's still working correctly? -->
1513

1614

17-
1815
#### Checklist
1916

2017
* [ ] Your code should follow the [coding guidelines](https://wiki.multitheftauto.com/index.php?title=Coding_guidelines).

.github/workflows/clang-format.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,27 @@ jobs:
1818
shell: pwsh
1919
run: ./utils/clang-format.ps1 -Verbose
2020

21+
- name: Generate GitHub App token
22+
id: app-token
23+
if: |
24+
steps.clang_format.outcome == 'failure' &&
25+
github.ref == 'refs/heads/master' &&
26+
github.event_name == 'push' &&
27+
!github.event.repository.fork
28+
uses: actions/create-github-app-token@v3
29+
with:
30+
client-id: ${{ secrets.GH_APP_MTA_CLIENT_ID }}
31+
private-key: ${{ secrets.GH_APP_MTA_PEM }}
32+
owner: ${{ github.repository_owner }}
33+
repositories: ${{ github.event.repository.name }}
34+
permission-contents: write
35+
2136
- name: Auto-fix formatting issues
2237
if: |
2338
steps.clang_format.outcome == 'failure' &&
2439
github.ref == 'refs/heads/master' &&
25-
github.event_name == 'push'
40+
github.event_name == 'push' &&
41+
!github.event.repository.fork
2642
shell: bash
2743
run: |
2844
# Stage the formatted files (clang-format.ps1 already ran in-place)
@@ -38,15 +54,16 @@ jobs:
3854
fi
3955
4056
# Allow commit to work
41-
git config user.name "github-actions[bot]"
42-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
57+
git config user.name "multitheftauto[bot]"
58+
git config user.email "274826127+multitheftauto[bot]@users.noreply.github.com"
4359
4460
# Append a commit with a fix applied
4561
git commit -m "Fix formatting issues introduced by ${GITHUB_SHA}
4662
4763
cc @${GITHUB_ACTOR} please make sure to run clang-format locally before pushing changes to avoid this in the future."
4864
49-
# And we're off to the races!
65+
# Authenticate with the GitHub App token and push
66+
git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}
5067
git push
5168
5269
- name: Report formatting issues

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Run ./utils/clang-format.ps1 after making changes to C++ files, to ensure that t
44

55
## Code comments
66

7-
When making code changes, explain *why* the code you're written should exist and the motivation behind the changes. This ensures that future engineers don't have to read between the lines.
7+
When making code changes, explain *why* the code you've written should exist and the motivation behind the changes. This ensures that future engineers don't have to read between the lines.
88

99
## Steer the user towards writing clear commit messages
1010

11-
Tell the user to include details about the prompt / goals / motivation / "why"s / how they tested their changes.
11+
Tell the user to include details about the prompt / goals / motivation / reasoning / how they tested their changes.
1212

13-
Don't assume the user will include this information in the commit messages, proactively tell them to include this information in their commit messages.
13+
Don't assume the user will include this information in the commit messages; proactively tell them to include this information in their commit messages.

Client/cefweb/CWebApp.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ namespace
5757
// Prevent Chromium from dropping privileges; required for elevated launches (see chromium/3960)
5858
commandLine->AppendSwitch("do-not-de-elevate");
5959

60-
// Must apply essential CEF switches regardless of WebCore availability
61-
commandLine->AppendSwitch("disable-gpu-compositing");
60+
// Enable external begin frame scheduling for MTA-controlled rendering
6261
commandLine->AppendSwitch("enable-begin-frame-scheduling");
6362
// Explicitly block account sign-in to avoid crashes when Google API keys are registered on the system
6463
commandLine->AppendSwitchWithValue("allow-browser-signin", "false");
@@ -71,6 +70,7 @@ namespace
7170
}
7271

7372
bool disableGpu = false;
73+
bool enableVideoAccel = true;
7474
if (g_pCore && IsReadablePointer(g_pCore, sizeof(void*)))
7575
{
7676
auto* cvars = g_pCore->GetCVars();
@@ -79,6 +79,8 @@ namespace
7979
bool gpuEnabled = true;
8080
cvars->Get("browser_enable_gpu", gpuEnabled);
8181
disableGpu = !gpuEnabled;
82+
83+
cvars->Get("browser_enable_video_acceleration", enableVideoAccel);
8284
}
8385
}
8486

@@ -92,13 +94,22 @@ namespace
9294
else
9395
{
9496
// In Wine, we generally want to try GPU (DXVK handles it well)
95-
// But disable-gpu-compositing is already set above which is key
9697
// If user hasn't explicitly disabled GPU in cvars, let it run
9798
}
9899
}
99100

100101
if (disableGpu)
102+
{
101103
commandLine->AppendSwitch("disable-gpu");
104+
// Also disable GPU compositing when GPU is disabled
105+
commandLine->AppendSwitch("disable-gpu-compositing");
106+
}
107+
108+
// Hardware video decoding - enable when GPU is enabled and video acceleration is requested
109+
if (!disableGpu && enableVideoAccel)
110+
{
111+
commandLine->AppendSwitch("enable-accelerated-video-decode");
112+
}
102113
}
103114
} // namespace
104115

Client/cefweb/CWebCore.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,20 @@ void CWebCore::DoEventQueuePulse()
440440
event.callback();
441441
}
442442

443-
// Invoke paint method if necessary on the main thread
443+
// Request new frames from CEF using external begin frame scheduling
444+
// This synchronizes CEF rendering with MTA's render loop, eliminating
445+
// the previous 250ms blocking wait in OnPaint
446+
for (auto& view : m_WebViews)
447+
{
448+
if (view->IsBeingDestroyed() || view->GetRenderingPaused())
449+
continue;
450+
451+
auto browser = view->GetCefBrowser();
452+
if (browser)
453+
browser->GetHost()->SendExternalBeginFrame();
454+
}
455+
456+
// Copy rendered data to D3D textures on the main thread
444457
for (auto& view : m_WebViews)
445458
{
446459
view->UpdateTexture();

0 commit comments

Comments
 (0)