Skip to content

Commit 78a0015

Browse files
committed
Merge branch 'refactor/blipdefs_c' of https://github.com/FileEX/mtasa-blue into refactor/blipdefs_c
2 parents 7d4475f + 4cef1c1 commit 78a0015

File tree

677 files changed

+36372
-36467
lines changed

Some content is hidden

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

677 files changed

+36372
-36467
lines changed

.github/workflows/dockerimage.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ on:
1212
- 'Dockerfile.i386'
1313
- 'Dockerfile.armhf'
1414
- 'Dockerfile.arm64'
15-
- 'Dockerfile.osx-x64'
16-
- 'Dockerfile.osx-arm64'
1715

1816
jobs:
1917
build:
@@ -28,10 +26,6 @@ jobs:
2826
dockerfile: Dockerfile.armhf
2927
- tag: arm64
3028
dockerfile: Dockerfile.arm64
31-
- tag: osx-x64
32-
dockerfile: Dockerfile.osx-x64
33-
- tag: osx-arm64
34-
dockerfile: Dockerfile.osx-arm64
3529
runs-on: ubuntu-latest
3630
steps:
3731
- uses: actions/checkout@v4

CONTRIBUTING.md

Lines changed: 1 addition & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -1,192 +1 @@
1-
# Contributors Guide
2-
3-
So you've decided to become a contributor to our project. Excellent!
4-
5-
We are always looking for new developers, so if you're new,
6-
please check out our [Getting Started guide](https://wiki.multitheftauto.com/wiki/Coding_info).
7-
8-
But before we can start accepting your code, there are a couple of
9-
things you should know about how we work.
10-
11-
This document mostly contains guidelines and rules as to how your
12-
code should be structured and how it can be committed without
13-
upsetting any fellow contributors.
14-
15-
## Where to code
16-
17-
As a new potential contributor, you will need to fork our repository and make
18-
commits to your own "branch". Then you can send us a pull request.
19-
20-
Our _`master`_ branch is the main development branch containing the
21-
latest, bleeding-edge code.
22-
23-
Our _other_ branches contain groundbreaking research, radical ideas and other
24-
work-in-progress changes that are meant to be merged into `master` at
25-
a later point in time.
26-
27-
If you're a collaborator, it's your choice whether to push branches to this
28-
repository or to your own fork.
29-
30-
**Branches are "topical" and should not be "personal" to each
31-
user.** This means that a branch should be created for a new feature,
32-
not for a user specific playground.
33-
34-
## What to code
35-
36-
Generally, please try submit pull requests that resolve existing
37-
[issues](https://github.com/multitheftauto/mtasa-blue/issues).
38-
39-
If you're looking for something to work on, take a look at the ["good first issue"]
40-
label, or our [milestones].
41-
42-
["good first issue"]: https://github.com/multitheftauto/mtasa-blue/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22
43-
[milestones]: https://github.com/multitheftauto/mtasa-blue/milestones?direction=asc&sort=due_date
44-
45-
Of course, if you're interested in something else, feel free to experiment
46-
and submit it. But discussing the feature beforehand, in an issue, will
47-
make your pull request more likely to be merged in a timely fashion.
48-
49-
## Committing code
50-
51-
**Make sure your code contributions follow the [Style Guide]**.
52-
53-
[Style Guide]: https://github.com/multitheftauto/mtasa-blue/wiki/Style-Guide
54-
55-
**Commits should be tested when added to master.** Commits
56-
that 'need to be fixed later' which directly affect the state of
57-
the mod will be reverted other than in exceptional circumstances.
58-
59-
**Commit messages should**
60-
61-
- be consistent
62-
- always give a clear indication of what has been changed without having to look at the code
63-
- include issue numbers, using [GitHub keywords](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) where necessary
64-
- [follow the seven rules identified here](http://chris.beams.io/posts/git-commit/)
65-
66-
The most important of the [seven rules](http://chris.beams.io/posts/git-commit/) has been copied below, but please read the article:
67-
68-
1. Separate subject from body with a blank line
69-
2. Limit the subject line to around 60-80 characters (the [seven rules] say 50, but we think ~70 is okay)
70-
3. Use the imperative mood in the subject line
71-
4. Use the body to explain what and why vs. how
72-
73-
**Follow up (addendum) commits should refer to the previous commit.** Do this by
74-
including the previous commit-identifier SHA and, if there's space, a summarised commit message in
75-
the new commit message. Doing this will help identify related commits
76-
if they are viewed at a later date.
77-
78-
**Try to keep pull requests small — they should be about one thing.** When you do multiple things
79-
in one pull request, it's hard to review. If you're fixing stuff as you go, you might want
80-
to make atomic commits and then cherry-pick those commits into separate branches,
81-
leaving the pull request clean.
82-
83-
**Read the ["Code Review"] guide** for more guidelines about the code review process.
84-
85-
**Examples**. Here are some examples of commit messages with a short and descriptive title in the imperative mood.
86-
87-
1. Here we also have a description that explains the content of the commit.
88-
```
89-
Fix vehicle model memory leaks in engineReplaceModel
90-
91-
Fixed 3 memory leaks:
92-
- clump model leak
93-
- vehicle visual data (dummies) leak
94-
- engineReplaceModel added extra references to TXD, and this was not getting unloaded at times
95-
```
96-
97-
2. Here we have a longer description that explains how to use the feature. The body is wrapped at 72 characters.
98-
```
99-
Add "beta" CVAR "_beta_qc_rightclick_command"
100-
101-
This variable lets you execute a command of your choice when you right
102-
click the "quick connect" button.
103-
104-
By default this CVAR is set to "reconnect", but you can set it to
105-
anything - "connect orange.mtasa.com" or "nick timw0w".
106-
107-
In the console, type "_beta_qc_rightclick_command" and press enter. This
108-
will tell you the current value of the CVAR.
109-
110-
You can do "_beta_qc_rightclick_command=nick timw0w" to change the
111-
value of the CVAR.
112-
```
113-
114-
3. Here we say `Fix #1115` so that GitHub automatically closes issue #1115. There's no description.
115-
```
116-
Fix #1115: add async encode/decodeString
117-
```
118-
119-
4. There was no specific issue being fixed here, but GitHub's squash-merge feature automatically appended `(#1177)`,
120-
telling us which pull request created this commit. There's no description.
121-
```
122-
Add "remember this option" checkbox to NVidia Optimus dialog (#1177)
123-
```
124-
125-
5. Here we refer to a previous commit.
126-
```
127-
Addendum to a80f8d6: fix Windows build error
128-
```
129-
130-
## Reviewing code
131-
132-
Contributors should try to review other contributor's commits and provide
133-
feedback as much as possible.
134-
135-
Please read our ["Code Review"] article for information on how to review code effectively.
136-
137-
["Code Review"]: https://github.com/multitheftauto/mtasa-blue/wiki/Code-Review
138-
139-
<!--
140-
141-
TODO(qaisjp): the below content should be part of a code of conduct instead
142-
143-
Ratings and comments are open for the public to review code and provide
144-
feedback. Please be mature and civilised when posting comments.
145-
146-
Make sure you make appropriate use of the GitHub Reactions feature to
147-
rate commits or express agreement/disagreement to a comment. This avoids
148-
spammy comments such as "+1", "-1", "Nice one!", etc.
149-
150-
Since you can only react to comments, not commits, feel free to create
151-
the initial "+1" comment in response to a commit. However, future
152-
similar reactions to a commit should be to the first response comment.
153-
154-
-->
155-
156-
## Gaining and losing merge rights
157-
158-
Merge rights allow you to merge your own approved pull requests and
159-
review other people's pull requests.
160-
161-
We grant merge rights after you have proven yourself to be competent,
162-
which is generally after 3-5 pull requests. This is not fixed and depends
163-
on the extent of your contributions, community status and other factors.
164-
165-
The subject matter of your pull requests do not matter — we are more interested in,
166-
once granted merge rights, whether you are capable of maintaining
167-
a high standard of code and remaining cohesive with other project collaborators.
168-
169-
After gaining merge rights, if your contributions are of a consistently low standard,
170-
or you fail to stick to the rules, your permissions will be revoked.
171-
172-
## Merging pull requests
173-
174-
Before merging, enforced by GitHub's branch protection, pull requests **require**:
175-
- Linux and Windows status checks to pass
176-
- 1 pull request review
177-
178-
If the pull request is large, try and only merge if there at least 2 pull request reviews.
179-
This isn't enforced via branch protection, but please try and stick to this convention
180-
(... unless nobody else is reviewing your PR).
181-
182-
Branch protection is **not enforced** for repository administrators,
183-
and those people are therefore not required to send pull requests. Individual repository admins may,
184-
for the greater good, pledge to submit pull requests despite this lack of enforcement.
185-
186-
For informational purposes, the current repository administrators are those marked as _The MTA Team_ on
187-
[this list](https://forum.mtasa.com/staff/).
188-
189-
**Merge button**
190-
191-
Generally use the "Squash and merge" button. If multiple commits are needed because you think
192-
having the separate commits are useful, use "Rebase and merge".
1+
This information is now available at [mtasa-docs (mtasa-blue CONTRIBUTING.md)](https://github.com/multitheftauto/mtasa-docs/blob/main/mtasa-blue/CONTRIBUTING.md).

Client/cefweb/CWebApp.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ CefRefPtr<CefResourceHandler> CWebApp::HandleError(const SString& strError, unsi
2121

2222
void CWebApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line)
2323
{
24-
command_line->AppendSwitch("disable-gpu-compositing");
25-
command_line->AppendSwitch("disable-gpu");
24+
CWebCore* pWebCore = static_cast<CWebCore*>(g_pCore->GetWebCore());
25+
26+
if (!pWebCore->GetGPUEnabled())
27+
command_line->AppendSwitch("disable-gpu");
28+
29+
command_line->AppendSwitch("disable-gpu-compositing"); // always disable this, causes issues with official builds
30+
2631
// command_line->AppendSwitch("disable-d3d11");
2732
command_line->AppendSwitch("enable-begin-frame-scheduling");
2833

Client/cefweb/CWebCore.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ CWebCore::~CWebCore()
4949
delete m_pXmlConfig;
5050
}
5151

52-
bool CWebCore::Initialise()
52+
bool CWebCore::Initialise(bool gpuEnabled)
5353
{
5454
CefMainArgs mainArgs;
5555
void* sandboxInfo = nullptr;
56+
57+
m_bGPUEnabled = gpuEnabled;
58+
5659
CefRefPtr<CWebApp> app(new CWebApp);
5760

5861
#ifdef CEF_ENABLE_SANDBOX
@@ -71,7 +74,6 @@ bool CWebCore::Initialise()
7174
#else
7275
CefString(&settings.browser_subprocess_path).FromWString(FromUTF8(CalcMTASAPath("MTA\\CEF\\CEFLauncher_d.exe")));
7376
#endif
74-
CefString(&settings.resources_dir_path).FromWString(FromUTF8(CalcMTASAPath("MTA\\CEF")));
7577
CefString(&settings.cache_path).FromWString(FromUTF8(CalcMTASAPath("MTA\\CEF\\cache")));
7678
CefString(&settings.locales_dir_path).FromWString(FromUTF8(CalcMTASAPath("MTA\\CEF\\locales")));
7779
CefString(&settings.log_file).FromWString(FromUTF8(CalcMTASAPath("MTA\\CEF\\cefdebug.txt")));
@@ -870,3 +872,8 @@ void CWebCore::StaticFetchBlacklistFinished(const SHttpDownloadResult& result)
870872
OutputDebugLine("Updated browser blacklist!");
871873
#endif
872874
}
875+
876+
bool CWebCore::GetGPUEnabled() const noexcept
877+
{
878+
return m_bGPUEnabled;
879+
}

Client/cefweb/CWebCore.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CWebCore : public CWebCoreInterface
5454
public:
5555
CWebCore();
5656
~CWebCore();
57-
bool Initialise() override;
57+
bool Initialise(bool gpuEnabled) override;
5858

5959
CWebViewInterface* CreateWebView(unsigned int uiWidth, unsigned int uiHeight, bool bIsLocal, CWebBrowserItem* pWebBrowserRenderItem, bool bTransparent);
6060
void DestroyWebView(CWebViewInterface* pWebViewInterface);
@@ -108,6 +108,8 @@ class CWebCore : public CWebCoreInterface
108108
static void StaticFetchWhitelistFinished(const SHttpDownloadResult& result);
109109
static void StaticFetchBlacklistFinished(const SHttpDownloadResult& result);
110110

111+
bool GetGPUEnabled() const noexcept;
112+
111113
private:
112114
typedef std::pair<bool, eWebFilterType> WebFilterPair;
113115

@@ -129,4 +131,7 @@ class CWebCore : public CWebCoreInterface
129131
CXMLFile* m_pXmlConfig;
130132
int m_iWhitelistRevision;
131133
int m_iBlacklistRevision;
134+
135+
// Shouldn't be changed after init
136+
bool m_bGPUEnabled;
132137
};

Client/cefweb/CWebView.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,10 +936,10 @@ void CWebView::OnBeforeClose(CefRefPtr<CefBrowser> browser)
936936
// //
937937
// //
938938
////////////////////////////////////////////////////////////////////
939-
bool CWebView::OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& target_url, const CefString& target_frame_name,
940-
CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture, const CefPopupFeatures& popupFeatures,
941-
CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings, CefRefPtr<CefDictionaryValue>& extra_info,
942-
bool* no_javascript_access)
939+
bool CWebView::OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int popup_id, const CefString& target_url,
940+
const CefString& target_frame_name, CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture,
941+
const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings,
942+
CefRefPtr<CefDictionaryValue>& extra_info, bool* no_javascript_access)
943943
{
944944
// ATTENTION: This method is called on the IO thread
945945

Client/cefweb/CWebView.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ class CWebView : public CWebViewInterface,
152152

153153
// CefLifeSpawnHandler methods
154154
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) override;
155-
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& target_url, const CefString& target_frame_name,
156-
CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture, const CefPopupFeatures& popupFeatures,
157-
CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings, CefRefPtr<CefDictionaryValue>& extra_info,
158-
bool* no_javascript_access) override;
155+
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int popup_id, const CefString& target_url,
156+
const CefString& target_frame_name, CefLifeSpanHandler::WindowOpenDisposition target_disposition, bool user_gesture,
157+
const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings,
158+
CefRefPtr<CefDictionaryValue>& extra_info, bool* no_javascript_access) override;
159159
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) override;
160160

161161
// CefJSDialogHandler methods

Client/core/CChat.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,11 @@ void CChat::SetCharacterLimit(int charLimit)
11171117
m_iCharacterLimit = charLimit;
11181118
}
11191119

1120+
float CChat::GetChatBottomPosition() const noexcept
1121+
{
1122+
return m_vecBackgroundSize.fY;
1123+
}
1124+
11201125
CChatLine::CChatLine()
11211126
{
11221127
m_bActive = false;

Client/core/CChat.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ class CChat
207207
constexpr int GetDefaultCharacterLimit() const { return m_iDefaultCharacterLimit; }
208208
constexpr int GetMaxCharacterLimit() const { return m_iMaxCharacterLimit; }
209209

210+
float GetChatBottomPosition() const noexcept;
211+
210212
private:
211213
void LoadCVars();
212214

Client/core/CClientVariables.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ void CClientVariables::ValidateValues()
256256
ClampValue("mtavolume", 0.0f, 1.0f);
257257
ClampValue("voicevolume", 0.0f, 1.0f);
258258
ClampValue("mapalpha", 0, 255);
259+
ClampValue("mapimage", 0, 1);
259260
}
260261

261262
void CClientVariables::LoadDefaults()
@@ -273,9 +274,6 @@ void CClientVariables::LoadDefaults()
273274
DEFAULT("host", _S("127.0.0.1")); // hostname
274275
DEFAULT("port", 22003); // port
275276
DEFAULT("password", _S("")); // password
276-
DEFAULT("qc_host", _S("127.0.0.1")); // quick connect hostname
277-
DEFAULT("qc_port", 22003); // quick connect port
278-
DEFAULT("qc_password", _S("")); // quick connect password
279277
DEFAULT("debugfile", _S("")); // debug filename
280278
DEFAULT("console_pos", CVector2D(0, 0)); // console position
281279
DEFAULT("console_size", CVector2D(200, 200)); // console size
@@ -313,7 +311,8 @@ void CClientVariables::LoadDefaults()
313311
DEFAULT("mastervolume", 1.0f); // master volume
314312
DEFAULT("mtavolume", 1.0f); // custom sound's volume
315313
DEFAULT("voicevolume", 1.0f); // voice chat output volume
316-
DEFAULT("mapalpha", 155); // map alpha
314+
DEFAULT("mapalpha", 155); // player map alpha
315+
DEFAULT("mapimage", 0); // player map image
317316
DEFAULT("browser_speed", 1); // Browser speed
318317
DEFAULT("single_download", 0); // Single connection for downloads
319318
DEFAULT("packet_tag", 0); // Tag network packets
@@ -357,7 +356,7 @@ void CClientVariables::LoadDefaults()
357356
DEFAULT("allow_discord_rpc", true); // Enable Discord Rich Presence
358357
DEFAULT("discord_rpc_share_data", false); // Consistent Rich Presence data sharing
359358
DEFAULT("discord_rpc_share_data_firsttime", false); // Display the user data sharing consent dialog box - for the first time
360-
DEFAULT("_beta_qc_rightclick_command", _S("reconnect")); // Command to run when right clicking quick connect (beta - can be removed at any time)
359+
DEFAULT("browser_enable_gpu", true); // Enable GPU in CEF? (allows stuff like WebGL to function)
361360

362361
if (!Exists("locale"))
363362
{

0 commit comments

Comments
 (0)