Skip to content

Commit

Permalink
Merge branch 'master' into feature/prop-burnflippedcars
Browse files Browse the repository at this point in the history
  • Loading branch information
botder authored Jul 25, 2023
2 parents 53f21d7 + f3bddb5 commit 02b37b3
Show file tree
Hide file tree
Showing 836 changed files with 153,444 additions and 131,735 deletions.
6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,9 @@ b42518e64803762d27fe6277b36044d1a71fc2c4
# Date: Sat Apr 8 15:17:22 2023 +0300
#
# Apply win-apply-clang-format.bat

6f26c2ad77600c2fd055d9d7a30ced5bf91d4f14
# Author: patrikjuvonen <[email protected]>
# Date: Mon Jun 12 19:01:59 2023 +0300
#
# Apply win-apply-clang-format.bat
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
run: brew link --overwrite mysql

- name: Run Build
run: ./linux-build.sh
run: ./linux-build.sh --os=macosx

linux:
strategy:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/dockerimage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ on:
- '.github/workflows/dockerimage.yaml'
- 'utils/compat/**'
- 'Dockerfile'
- 'Dockerfile.i386'
- 'Dockerfile.armhf'
- 'Dockerfile.arm64'
- 'Dockerfile.osx-x64'
- 'Dockerfile.osx-arm64'

jobs:
build:
Expand All @@ -19,10 +22,16 @@ jobs:
include:
- tag: latest
dockerfile: Dockerfile
- tag: i386
dockerfile: Dockerfile.i386
- tag: armhf
dockerfile: Dockerfile.armhf
- tag: arm64
dockerfile: Dockerfile.arm64
- tag: osx-x64
dockerfile: Dockerfile.osx-x64
- tag: osx-arm64
dockerfile: Dockerfile.osx-arm64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
10 changes: 0 additions & 10 deletions Client/core/CCommandFuncs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ extern bool g_bBoundsChecker;
void CCommandFuncs::Help(const char* szParameters)
{
CConsoleInterface* pConsole = g_pCore->GetConsole();

if (szParameters && atoi(szParameters) == 1)
CCore::GetSingleton().GetMultiplayer()->AllowWindowsCursorShowing(true);
else
CCore::GetSingleton().GetMultiplayer()->AllowWindowsCursorShowing(false);

pConsole->Print(_("***[ COMMAND HELP ]***\n"));

// Loop through all the available commands
Expand All @@ -47,10 +41,6 @@ void CCommandFuncs::Exit(const char* szParameters)

void CCommandFuncs::Ver(const char* szParameters)
{
ShowCursor(TRUE);
HCURSOR hc = LoadCursor(NULL, IDC_ARROW);
SetCursor(hc);

// Compose version string
unsigned short usNetRev = CCore::GetSingleton().GetNetwork()->GetNetRev();
unsigned short usNetRel = CCore::GetSingleton().GetNetwork()->GetNetRel();
Expand Down
21 changes: 21 additions & 0 deletions Client/core/CCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2316,3 +2316,24 @@ SString CCore::GetBlueCopyrightString()
SString strCopyright = BLUE_COPYRIGHT_STRING;
return strCopyright.Replace("%BUILD_YEAR%", std::to_string(BUILD_YEAR).c_str());
}

// Set streaming memory size override [See `engineStreamingSetMemorySize`]
// Use `0` to turn it off, and thus restore the value to the `cvar` setting
void CCore::SetCustomStreamingMemory(size_t sizeBytes) {
// NOTE: The override is applied to the game in `CClientGame::DoPulsePostFrame`
// There's no specific reason we couldn't do it here, but we wont
m_CustomStreamingMemoryLimitBytes = sizeBytes;
}

bool CCore::IsUsingCustomStreamingMemorySize()
{
return m_CustomStreamingMemoryLimitBytes != 0;
}

// Streaming memory size used [In Bytes]
size_t CCore::GetStreamingMemory()
{
return IsUsingCustomStreamingMemorySize()
? m_CustomStreamingMemoryLimitBytes
: CVARS_GET_VALUE<size_t>("streaming_memory") * 1024 * 1024; // MB to B conversion
}
14 changes: 12 additions & 2 deletions Client/core/CCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ class CCore : public CCoreInterface, public CSingleton<CCore>
SString GetBlueCopyrightString();
bool IsFirstFrame() const noexcept { return m_bFirstFrame; }

void SetCustomStreamingMemory(size_t szMB);
bool IsUsingCustomStreamingMemorySize();
size_t GetStreamingMemory();
private:
void ApplyCoreInitSettings();

Expand Down Expand Up @@ -360,8 +363,15 @@ class CCore : public CCoreInterface, public CSingleton<CCore>
bool m_bWaitToSetNick;
uint m_uiNewNickWaitFrames;
EDiagnosticDebugType m_DiagnosticDebug;
float m_fMinStreamingMemory;
float m_fMaxStreamingMemory;

// Below 2 are used for the UI only
float m_fMinStreamingMemory{};
float m_fMaxStreamingMemory{};

// Custom streaming memory limit set by `engineStreamingSetMemorySize` - Reset on server connects (= set to 0), or by the scripter
// `0` means "not set" [so the value should be ignored]
size_t m_CustomStreamingMemoryLimitBytes{};

bool m_bGettingIdleCallsFromMultiplayer;
bool m_bWindowsTimerEnabled;
bool m_bModulesLoaded;
Expand Down
17 changes: 12 additions & 5 deletions Client/core/CCredits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* FILE: core/CCredits.cpp
* PURPOSE: In-game credits window implementation
*
* Multi Theft Auto is available from https://www.multitheftauto.com/
* Multi Theft Auto is available from https://multitheftauto.com/
*
*****************************************************************************/

Expand Down Expand Up @@ -112,6 +112,7 @@ CCredits::CCredits()
"Enes \"cleopatra\" Akıllıok\n"
"Nawaf \"xLive\" Alqarni\n"
"Nicolás \"Platin\" Barrios\n"
"Efe \"efex\" Batır\n"
"Amine \"UndR\" Bidah\n"
"Lukasz \"W\" Biegaj\n"
"Pacal \"buepas\" Buerklin\n"
Expand All @@ -136,6 +137,7 @@ CCredits::CCredits()
"Marcin \"FileEX\" Pawlicki\n"
"Ali \"Haxardous\" Qamber\n"
"Sam \"samr46\" R.\n"
"Fernando Rocha\n"
"Fedor \"Ted\" Sinev\n"
"Jordy \"MegadreamsBE\" Sleeubus\n"
"Simon \"Simi23\" Tamás\n"
Expand All @@ -146,6 +148,7 @@ CCredits::CCredits()
"AfuSensi\n"
"AleksCore\n"
"AlιAѕѕaѕѕιN\n"
"androksi\n"
"ApeLsiN4eG\n"
"asturel\n"
"Audifire\n"
Expand All @@ -166,7 +169,6 @@ CCredits::CCredits()
"emre1702\n"
"Fabio(GNR)\n"
"fastman92\n"
"Fernando Rocha\n"
"FrankZZ\n"
"Gothem\n"
"GRascm\n"
Expand All @@ -191,6 +193,7 @@ CCredits::CCredits()
"MCvarial\n"
"Merlin\n"
"mickdermack\n"
"Mvrat\n"
"NeO_D-Power\n"
"Patrick2562\n"
"PauloKim1246\n"
Expand All @@ -201,6 +204,7 @@ CCredits::CCredits()
"rafalh\n"
"samt2497\n"
"Santi\n"
"Sarrum\n"
"SDraw\n"
"se16n\n"
"Sergeanur\n"
Expand All @@ -209,11 +213,12 @@ CCredits::CCredits()
"TAPL-93\n"
"TEDERIs\n"
"TFP-dev\n"
"theSarrum\n"
"Totto8492\n"
"Tracer\n"
"turret001\n"
"tvc\n"
"vahook\n"
"vyn666\n"
"x0rh4x\n"
"xerox8521\n"
"[GP_A]XetaQuake\n"
Expand Down Expand Up @@ -275,6 +280,7 @@ CCredits::CCredits()
"Docker (https://www.docker.com/)\n"
"Embedded HTTP Server (https://ehs.fritz-elfert.de/)\n"
"FreeType (https://freetype.org/)\n"
"GNU Unifont (https://unifoundry.com/unifont/index.html)\n"
"inspect.lua by kikito (https://github.com/kikito/inspect.lua)\n"
"json-c (https://github.com/json-c/json-c)\n"
"GitBook (https://www.gitbook.com/)\n"
Expand All @@ -301,6 +307,7 @@ CCredits::CCredits()
"SQLite (https://www.sqlite.org/)\n"
"TeamCity by JetBrains (https://www.jetbrains.com/teamcity/)\n"
"Teleport (https://goteleport.com/)\n"
"The Language Icon by A’ Design Award & Competition, Onur Müştak Çobanlı and\nFarhat Datta (https://www.languageicon.org)\n"
"tinygettext (https://github.com/tinygettext/tinygettext/)\n"
"tinyxml (https://sourceforge.net/projects/tinyxml/)\n"
"UnRAR (https://www.rarlab.com/)\n"
Expand Down Expand Up @@ -345,7 +352,7 @@ CCredits::CCredits()
// Create the label
m_pLabels[uiLabelIndex] = reinterpret_cast<CGUILabel*>(pManager->CreateLabel(m_pWindow, strBuffer.c_str()));
m_pLabels[uiLabelIndex]->SetPosition(CVector2D(0.022f, fStartPosition), true);
m_pLabels[uiLabelIndex]->SetSize(CVector2D(532.0f, 1200.0f)); // relative 0.95, 6.0
m_pLabels[uiLabelIndex]->SetSize(CVector2D(532.0f, 1500.0f)); // relative 0.95, 6.0
m_pLabels[uiLabelIndex]->SetHorizontalAlign(CGUI_ALIGN_HORIZONTALCENTER);
++uiLabelIndex;

Expand Down Expand Up @@ -411,7 +418,7 @@ void CCredits::Update()
float fCurrentTop = 1.0f - 0.0001f * static_cast<float>(clock() - m_clkStart);

// If we're too far down or up, make sure we restart next pulse
if (fCurrentTop <= -11.0f || fCurrentTop >= 1.0f)
if (fCurrentTop <= -14.75f || fCurrentTop >= 1.0f)
{
m_clkStart = clock();
}
Expand Down
6 changes: 2 additions & 4 deletions Client/core/CGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void CLocalGUI::SetConsoleVisible(bool bVisible)
CGUI* pGUI = CCore::GetSingleton().GetGUI();
if (bVisible)
pGUI->SetCursorAlpha(1.0f);
else
else if (!g_pCore->IsMenuVisible())
pGUI->SetCursorAlpha(pGUI->GetCurrentServerCursorAlpha());
}
}
Expand Down Expand Up @@ -430,9 +430,7 @@ void CLocalGUI::SetMainMenuVisible(bool bVisible)
pGUI->SelectInputHandlers(INPUT_MOD);
}

if (bVisible)
pGUI->SetCursorAlpha(1.0f);
else
if (!bVisible)
pGUI->SetCursorAlpha(pGUI->GetCurrentServerCursorAlpha());
}
}
Expand Down
Loading

0 comments on commit 02b37b3

Please sign in to comment.