Skip to content

Commit

Permalink
Merge branch 'master' into TheNormalnij/model_allocation_server
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Oct 9, 2023
2 parents ddb35c7 + 2846e27 commit 4edb200
Show file tree
Hide file tree
Showing 672 changed files with 32,003 additions and 28,936 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/sync-master-to-maetro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,30 @@ jobs:
name: Sync commits
run: |
# GitHub Actions bot user
git config --global user.name "Mætro Bot"
git config --global user.name "Maetro Bot"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout release/maetro
if ! git merge master --ff --no-edit
then
# Discard locale conflicts
git checkout --ours -- Shared/installer/locale "Shared/data/MTA San Andreas/MTA/locale"
git add --verbose Shared/installer/locale "Shared/data/MTA San Andreas/MTA/locale"
# Discard install_cef.lua conflicts
git checkout --ours -- utils/buildactions/install_cef.lua
git add --verbose utils/buildactions/install_cef.lua
# We should be done with the merge now
git commit --no-edit
fi
git merge master --no-ff --no-edit --no-commit || true
# Discard locale conflicts
git checkout --ours -- Shared/installer/locale "Shared/data/MTA San Andreas/MTA/locale"
git add --verbose Shared/installer/locale "Shared/data/MTA San Andreas/MTA/locale"
# Discard install_cef.lua conflicts
git checkout --ours -- utils/buildactions/install_cef.lua
git add --verbose utils/buildactions/install_cef.lua
# Discard d3dcompiler_47.dll conflicts (Due to old CEF version on maetro)
git checkout --ours -- "Shared/data/MTA San Andreas/MTA/d3dcompiler_47.dll"
git add --verbose "Shared/data/MTA San Andreas/MTA/d3dcompiler_47.dll"
git checkout --ours -- "Client/loader/MainFunctions.cpp"
git add --verbose "Client/loader/MainFunctions.cpp"
# We should be done with the merge now
printf "Synchronize changes from 1.6 master branch [ci skip]\n\n" > commit.txt
git log --expand-tabs=4 --pretty=format:'%h %s' release/maetro..master >> commit.txt
git commit --no-edit --allow-empty -F commit.txt
git push origin release/maetro
4 changes: 2 additions & 2 deletions Client/cefweb/CWebView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ void CWebView::InjectMouseMove(int iPosX, int iPosY)
m_vecMousePosition.y = iPosY;
}

void CWebView::InjectMouseDown(eWebBrowserMouseButton mouseButton)
void CWebView::InjectMouseDown(eWebBrowserMouseButton mouseButton, int count)
{
if (!m_pWebView)
return;
Expand All @@ -355,7 +355,7 @@ void CWebView::InjectMouseDown(eWebBrowserMouseButton mouseButton)
// Save mouse button states
m_mouseButtonStates[static_cast<int>(mouseButton)] = true;

m_pWebView->GetHost()->SendMouseClickEvent(mouseEvent, static_cast<CefBrowserHost::MouseButtonType>(mouseButton), false, 1);
m_pWebView->GetHost()->SendMouseClickEvent(mouseEvent, static_cast<CefBrowserHost::MouseButtonType>(mouseButton), false, count);
}

void CWebView::InjectMouseUp(eWebBrowserMouseButton mouseButton)
Expand Down
2 changes: 1 addition & 1 deletion Client/cefweb/CWebView.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class CWebView : public CWebViewInterface,
bool GetProperty(const SString& strKey, SString& outProperty);

void InjectMouseMove(int iPosX, int iPosY);
void InjectMouseDown(eWebBrowserMouseButton mouseButton);
void InjectMouseDown(eWebBrowserMouseButton mouseButton, int count);
void InjectMouseUp(eWebBrowserMouseButton mouseButton);
void InjectMouseWheel(int iScrollVert, int iScrollHorz);
void InjectKeyboardEvent(const CefKeyEvent& keyEvent);
Expand Down
2 changes: 1 addition & 1 deletion Client/core/CChat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void CChat::Draw(bool bUseCacheTexture, bool bAllowOutline)
// Make sure render target size is reasonable
int iRenderTargetSizeX = Clamp<int>(8, chatSize.fX, pGraphics->GetViewportWidth());
int iRenderTargetSizeY = Clamp<int>(8, chatSize.fY, pGraphics->GetViewportHeight());
m_pCacheTexture = pGraphics->GetRenderItemManager()->CreateRenderTarget(iRenderTargetSizeX, iRenderTargetSizeY, true, true);
m_pCacheTexture = pGraphics->GetRenderItemManager()->CreateRenderTarget(iRenderTargetSizeX, iRenderTargetSizeY, false, true, 0, true);
if (m_pCacheTexture)
m_RenderTargetChatSize = chatSize;
else
Expand Down
32 changes: 28 additions & 4 deletions Client/core/CCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <game/CSettings.h>
#include <Accctrl.h>
#include <Aclapi.h>
#include <filesystem>
#include "Userenv.h" // This will enable SharedUtil::ExpandEnvString
#define ALLOC_STATS_MODULE_NAME "core"
#include "SharedUtil.hpp"
Expand All @@ -28,24 +29,47 @@
using SharedUtil::CalcMTASAPath;
using namespace std;

namespace fs = std::filesystem;

static float fTest = 1;

extern CCore* g_pCore;
bool g_bBoundsChecker = false;
SString g_strJingleBells;

extern fs::path g_gtaDirectory;

template <>
CCore* CSingleton<CCore>::m_pSingleton = NULL;

static auto Win32LoadLibraryA = static_cast<decltype(&LoadLibraryA)>(nullptr);

static HMODULE WINAPI SkipDirectPlay_LoadLibraryA(LPCSTR fileName)
{
if (StrCmpIA("dpnhpast.dll", fileName) != 0)
return Win32LoadLibraryA(fileName);

// GTA:SA expects a valid module handle for DirectPlay. We return a handle for an already loaded library.
return Win32LoadLibraryA("d3d8.dll");
if (!StrCmpIA("dpnhpast.dll", fileName))
return Win32LoadLibraryA("d3d8.dll");

if (!StrCmpIA("enbseries\\enbhelper.dll", fileName))
{
std::error_code ec;

// Try to load enbhelper.dll from our custom launch directory first.
const fs::path inLaunchDir = fs::path{FromUTF8(GetLaunchPath())} / "enbseries" / "enbhelper.dll";

if (fs::is_regular_file(inLaunchDir, ec))
return Win32LoadLibraryA(inLaunchDir.u8string().c_str());

// Try to load enbhelper.dll from the GTA install directory second.
const fs::path inGTADir = g_gtaDirectory / "enbseries" / "enbhelper.dll";

if (fs::is_regular_file(inGTADir, ec))
return Win32LoadLibraryA(inGTADir.u8string().c_str());

return nullptr;
}

return Win32LoadLibraryA(fileName);
}

CCore::CCore()
Expand Down
Loading

0 comments on commit 4edb200

Please sign in to comment.