Skip to content

Commit

Permalink
Apply win-apply-clang-format.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
patrikjuvonen committed Jun 12, 2023
1 parent 39ccaef commit 6f26c2a
Show file tree
Hide file tree
Showing 29 changed files with 115 additions and 115 deletions.
3 changes: 1 addition & 2 deletions Client/core/CLanguageSelector.cpp
Expand Up @@ -257,8 +257,7 @@ void CLanguageSelector::DoPulse()
pItem->fFocusEffectPos += Clamp(-fMaxAmount, pItem->fFocusEffectTarget - pItem->fFocusEffectPos, fMaxAmount);

// Move label
CVector2D vecLabelZoomPos =
pItem->vecLabelInitialPos + CVector2D(pItem->vecLabelInitialSize.fX * pItem->fFocusEffectPos * 0.05f, 0);
CVector2D vecLabelZoomPos = pItem->vecLabelInitialPos + CVector2D(pItem->vecLabelInitialSize.fX * pItem->fFocusEffectPos * 0.05f, 0);
pItem->pLabel->SetPosition(vecLabelZoomPos);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Client/core/Graphics/CTileBatcher.cpp
Expand Up @@ -280,7 +280,7 @@ void CTileBatcher::AddTile(float fX1, float fY1, float fX2, float fY2, float fU1

uint uiTessellationX = 1;
uint uiTessellationY = 1;
bool bUseCustomMatrices{ false };
bool bUseCustomMatrices{false};

// Get settings from shader
if (CShaderInstance* pShaderInstance = DynamicCast<CShaderInstance>(pMaterial))
Expand Down
6 changes: 3 additions & 3 deletions Client/game_sa/CRenderWareSA.ShaderSupport.h
Expand Up @@ -14,9 +14,9 @@
#include "CRenderWareSA.h"

#ifdef MTA_DEBUG
// Comment out the lines below for your desired debug options
// #define SHADER_DEBUG_CHECKS // Do lots of validation which can slow a debug build
// #define SHADER_DEBUG_OUTPUT // Output lots of debug strings
// Comment out the lines below for your desired debug options
// #define SHADER_DEBUG_CHECKS // Do lots of validation which can slow a debug build
// #define SHADER_DEBUG_OUTPUT // Output lots of debug strings
#endif

// Various dodgy pointer values
Expand Down
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/ClientCommands.h
Expand Up @@ -46,7 +46,7 @@ void COMMAND_ServerInfo(const char* szCmdLine);
// DISABLE THESE BEFORE RELEASE
#ifdef MTA_DEBUG
void COMMAND_ShowSyncData(const char* szCmdLine);
// void COMMAND_DumpPlayers ( const char* szCmdLine );
// void COMMAND_DumpPlayers ( const char* szCmdLine );
#endif

#if defined(MTA_DEBUG) || defined(MTA_BETA)
Expand Down
34 changes: 17 additions & 17 deletions Client/mods/deathmatch/logic/luadefs/CLuaDrawingDefs.cpp
Expand Up @@ -1729,25 +1729,25 @@ int CLuaDrawingDefs::DxGetStatus(lua_State* luaVM)
lua_settable(luaVM, -3);

lua::Push(luaVM, "SettingDebugMode");
lua::Push(luaVM, []{
lua::Push(luaVM, [] {
switch (g_pCore->GetDiagnosticDebug())
{
case EDiagnosticDebug::GRAPHICS_6734:
return "#6734 Graphics";
case EDiagnosticDebug::D3D_6732:
return "#6732 D3D";
case EDiagnosticDebug::LOG_TIMING_0000:
return "#0000 Log timing";
case EDiagnosticDebug::JOYSTICK_0000:
return "#0000 Joystick";
case EDiagnosticDebug::LUA_TRACE_0000:
return "#0000 Lua trace";
case EDiagnosticDebug::RESIZE_ALWAYS_0000:
return "#0000 Resize always";
case EDiagnosticDebug::RESIZE_NEVER_0000:
return "#0000 Resize never";
default:
return "Default";
case EDiagnosticDebug::GRAPHICS_6734:
return "#6734 Graphics";
case EDiagnosticDebug::D3D_6732:
return "#6732 D3D";
case EDiagnosticDebug::LOG_TIMING_0000:
return "#0000 Log timing";
case EDiagnosticDebug::JOYSTICK_0000:
return "#0000 Joystick";
case EDiagnosticDebug::LUA_TRACE_0000:
return "#0000 Lua trace";
case EDiagnosticDebug::RESIZE_ALWAYS_0000:
return "#0000 Resize always";
case EDiagnosticDebug::RESIZE_NEVER_0000:
return "#0000 Resize never";
default:
return "Default";
}
}());
lua_settable(luaVM, -3);
Expand Down
2 changes: 1 addition & 1 deletion Client/sdk/game/CStreaming.h
Expand Up @@ -43,5 +43,5 @@ class CStreaming
virtual uint32 GetStreamingBufferSize() = 0;
virtual void MakeSpaceFor(std::uint32_t memoryToCleanInBytes) = 0;
virtual std::uint32_t GetMemoryUsed() const = 0;
virtual void RemoveBigBuildings() = 0;
virtual void RemoveBigBuildings() = 0;
};
64 changes: 32 additions & 32 deletions Client/sdk/ijsify.h
Expand Up @@ -81,45 +81,45 @@ extern DWORD* g_Table;
extern DWORD* g_TableSize;
extern DWORD g_dwTable;

/*
inline void* __cdecl operator new ( unsigned int uiSize )
{
DWORD dwOld, dwData;
/*
inline void* __cdecl operator new ( unsigned int uiSize )
{
DWORD dwOld, dwData;
if ( !g_bBoundsChecker ) {
dwData = (DWORD)HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, uiSize);
VirtualProtect ( (void*)dwData, uiSize, PAGE_EXECUTE_READWRITE, &dwOld );
return (void*)dwData;
}
// define the guard bytes
DWORD dwGuardBegin = 0xBEEFFDFD;
WORD wGuardEnd = 0xDEAC;
if ( !g_bBoundsChecker ) {
dwData = (DWORD)HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, uiSize);
VirtualProtect ( (void*)dwData, uiSize, PAGE_EXECUTE_READWRITE, &dwOld );
return (void*)dwData;
}
// define the guard bytes
DWORD dwGuardBegin = 0xBEEFFDFD;
WORD wGuardEnd = 0xDEAC;
// allocate ( size + 4 (begin) + 2 (end) )
dwData = (DWORD) HeapAlloc ( GetProcessHeap (), HEAP_ZERO_MEMORY, uiSize + 6 );
// allocate ( size + 4 (begin) + 2 (end) )
dwData = (DWORD) HeapAlloc ( GetProcessHeap (), HEAP_ZERO_MEMORY, uiSize + 6 );
// [0 -> 4] insert begin guard bytes
memcpy ( (void*)(dwData), &dwGuardBegin, 4 );
uiSize += 4;
// [0 -> 4] insert begin guard bytes
memcpy ( (void*)(dwData), &dwGuardBegin, 4 );
uiSize += 4;
// [x -> x+2] insert end guard bytes
memcpy ( (void*)(dwData + uiSize), &wGuardEnd, 2 );
uiSize += 2;
// [x -> x+2] insert end guard bytes
memcpy ( (void*)(dwData + uiSize), &wGuardEnd, 2 );
uiSize += 2;
// set guard protection state
VirtualProtect ( (void*)dwData, uiSize, PAGE_EXECUTE_READWRITE | PAGE_GUARD, &dwOld );
// set guard protection state
VirtualProtect ( (void*)dwData, uiSize, PAGE_EXECUTE_READWRITE | PAGE_GUARD, &dwOld );
g_Table[g_dwTable] = dwData;
g_TableSize[g_dwTable++] = (DWORD)uiSize;
g_Table[g_dwTable] = dwData;
g_TableSize[g_dwTable++] = (DWORD)uiSize;
// and return the correct data pointer
return (void*)( dwData + 4 );
// and return the correct data pointer
return (void*)( dwData + 4 );
};
};
inline void __cdecl operator delete ( void* pData )
{
HeapFree ( GetProcessHeap(), 0, pData );
};
*/
inline void __cdecl operator delete ( void* pData )
{
HeapFree ( GetProcessHeap(), 0, pData );
};
*/
#endif
2 changes: 1 addition & 1 deletion Server/core/CCrashHandler.cpp
Expand Up @@ -142,7 +142,7 @@ inline __attribute__((always_inline)) static void SaveBacktraceSummary()
}
}

// Linux/Mac crash callback when using google-breakpad
// Linux/Mac crash callback when using google-breakpad
#ifdef __APPLE__
bool DumpCallback(const char* dump_dir, const char* minidump_id, void* context, bool succeeded)
{
Expand Down
10 changes: 5 additions & 5 deletions Server/core/CCrashHandlerAPI.cpp
Expand Up @@ -46,11 +46,11 @@ static LPTOP_LEVEL_EXCEPTION_FILTER g_pfnOrigFilt = NULL;
// The exception handler
LONG __stdcall CrashHandlerExceptionFilter(EXCEPTION_POINTERS* pExPtrs);

/*//////////////////////////////////////////////////////////////////////
Destructor Class
//////////////////////////////////////////////////////////////////////*/
// See the note in MEMDUMPVALIDATOR.CPP about automatic classes.
// Turn off warning : initializers put in library initialization area
/*//////////////////////////////////////////////////////////////////////
Destructor Class
//////////////////////////////////////////////////////////////////////*/
// See the note in MEMDUMPVALIDATOR.CPP about automatic classes.
// Turn off warning : initializers put in library initialization area
#pragma warning (disable : 4073)
#pragma init_seg(lib)
class CleanUpCrashHandler
Expand Down
2 changes: 1 addition & 1 deletion Server/core/Server.cpp
Expand Up @@ -16,7 +16,7 @@
#include "SharedUtil.hpp"
#include "ErrorCodes.h"
#ifdef WIN_x86
// TODO - 64 bit file hooks
// TODO - 64 bit file hooks
#include "SharedUtil.Win32Utf8FileHooks.hpp"
#endif

Expand Down
14 changes: 7 additions & 7 deletions Server/core/StdInc.h
Expand Up @@ -13,22 +13,22 @@
#include <string>

#ifndef WIN32
// Linux allocation tracking doesn't work in this module for some reason
// Linux allocation tracking doesn't work in this module for some reason
#define WITH_ALLOC_TRACKING 0
#endif
#include "SharedUtil.h"

#ifdef WIN32
//
// Windows
//
//
// Windows
//
#include <conio.h>
#include <direct.h>
#include <windows.h>
#else
//
// POSIX
//
//
// POSIX
//
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
Expand Down
6 changes: 3 additions & 3 deletions Server/dbconmy/StdInc.h
Expand Up @@ -24,9 +24,9 @@
#include <MTAPlatform.h>

#ifdef WIN32
//
// Windows
//
//
// Windows
//
#include <windows.h>
#include <mmsystem.h>
#endif
2 changes: 1 addition & 1 deletion Server/launcher/Main.cpp
Expand Up @@ -26,7 +26,7 @@
#include "SharedUtil.h"

#ifdef WIN32
// Linux gcc 4.4.5 memory corruption on destruction of g_StatEvents (Reason unknown)
// Linux gcc 4.4.5 memory corruption on destruction of g_StatEvents (Reason unknown)
#include "SharedUtil.hpp"
#else
#include <unistd.h>
Expand Down
6 changes: 3 additions & 3 deletions Server/mods/deathmatch/StdInc.h
Expand Up @@ -27,9 +27,9 @@
#include "MTAPlatform.h"

#ifdef WIN32
//
// Windows
//
//
// Windows
//
#include <winsock2.h>
#include <windows.h>
#include <mmsystem.h>
Expand Down
8 changes: 4 additions & 4 deletions Server/mods/deathmatch/logic/CPed.h
Expand Up @@ -269,11 +269,11 @@ class CPed : public CElement
void SetCollisionEnabled(bool bCollisionEnabled) { m_bCollisionsEnabled = bCollisionEnabled; }

long long GetLastFarSyncTick() { return m_llLastFarSyncTick; }
void SetLastFarSyncTick(long long llLastSyncTick) { m_llLastFarSyncTick = llLastSyncTick; }
void SetLastFarSyncTick(long long llLastSyncTick) { m_llLastFarSyncTick = llLastSyncTick; }

void ClearNearPlayersList() { m_nearPlayersList.clear(); }
void AddPlayerToNearList(CPlayer* pPlayer) { m_nearPlayersList.push_back(pPlayer); }
bool IsNearPlayersListEmpty() { return m_nearPlayersList.empty(); }
void ClearNearPlayersList() { m_nearPlayersList.clear(); }
void AddPlayerToNearList(CPlayer* pPlayer) { m_nearPlayersList.push_back(pPlayer); }
bool IsNearPlayersListEmpty() { return m_nearPlayersList.empty(); }
std::vector<CPlayer*>::const_iterator NearPlayersIterBegin() { return m_nearPlayersList.begin(); }
std::vector<CPlayer*>::const_iterator NearPlayersIterEnd() { return m_nearPlayersList.end(); }

Expand Down
10 changes: 5 additions & 5 deletions Server/mods/deathmatch/logic/CPedSync.cpp
Expand Up @@ -111,17 +111,17 @@ void CPedSync::UpdateSyncer(CPed* pPed)
if (pSyncer)
{
// Is he close enough, and in the right dimension?
if (IsSyncerPersistent() || (pPed->GetDimension() == pSyncer->GetDimension()
&& IsPointNearPoint3D(pSyncer->GetPosition(), pPed->GetPosition(), (float)g_TickRateSettings.iPedSyncerDistance)))
return;
if (IsSyncerPersistent() || (pPed->GetDimension() == pSyncer->GetDimension() &&
IsPointNearPoint3D(pSyncer->GetPosition(), pPed->GetPosition(), (float)g_TickRateSettings.iPedSyncerDistance)))
return;

// Stop him from syncing it
StopSync(pPed);
}

if (pPed->IsBeingDeleted())
return;

// Find a new syncer for it
FindSyncer(pPed);
}
Expand Down Expand Up @@ -348,7 +348,7 @@ void CPedSync::UpdateNearPlayersList()

// Check distance accurately because the spatial database is 2D
if ((vecCameraPosition - pPed->GetPosition()).LengthSquared() < DISTANCE_FOR_NEAR_VIEWER * DISTANCE_FOR_NEAR_VIEWER)
pPed->AddPlayerToNearList(pPlayer);
pPed->AddPlayerToNearList(pPlayer);
}
}
}
5 changes: 3 additions & 2 deletions Server/mods/deathmatch/logic/CUnoccupiedVehicleSync.cpp
Expand Up @@ -131,7 +131,8 @@ void CUnoccupiedVehicleSync::UpdateVehicle(CVehicle* pVehicle)
if (pSyncer)
{
// He isn't close enough to the vehicle and in the right dimension?
if (!IsSyncerPersistent() && (!IsPointNearPoint3D(pSyncer->GetPosition(), pVehicle->GetPosition(), (float)g_TickRateSettings.iUnoccupiedVehicleSyncerDistance)) ||
if (!IsSyncerPersistent() &&
(!IsPointNearPoint3D(pSyncer->GetPosition(), pVehicle->GetPosition(), (float)g_TickRateSettings.iUnoccupiedVehicleSyncerDistance)) ||
(pVehicle->GetDimension() != pSyncer->GetDimension()))
{
// Stop him from syncing it
Expand Down Expand Up @@ -497,7 +498,7 @@ void CUnoccupiedVehicleSync::Packet_UnoccupiedVehiclePushSync(CUnoccupiedVehicle
{
OverrideSyncer(pVehicle, pPlayer);
}

// Reset our push time
pVehicle->ResetLastPushTime();
}
Expand Down
2 changes: 1 addition & 1 deletion Server/sdk/MTAPlatform.h
Expand Up @@ -57,7 +57,7 @@ extern "C" bool g_bNoTopBar;
// Define types
typedef int socklen_t;

// Define keys
// Define keys
#define KEY_BACKSPACE 0x08
#define KEY_EXTENDED 0xE0
#define KEY_LEFT 0x4B
Expand Down
2 changes: 1 addition & 1 deletion Shared/mods/deathmatch/logic/CLatentTransferManager.cpp
Expand Up @@ -90,7 +90,7 @@ void CLatentTransferManager::RemoveRemote(NetPlayerID remoteId)
MapRemove(m_SendQueueMap, remoteId);

SAFE_DELETE(pSendQueue);

if (pReceiver && pReceiver->IsInside())
pReceiver->SetDeferredDelete();
else
Expand Down
1 change: 1 addition & 0 deletions Shared/mods/deathmatch/logic/CLatentTransferManager.h
Expand Up @@ -142,6 +142,7 @@ class CLatentSendQueue
class CLatentReceiver
{
friend struct SScopedGuardInsideMark;

public:
ZERO_ON_NEW
CLatentReceiver(NetPlayerID remoteId, ushort usBitStreamVersion);
Expand Down
6 changes: 3 additions & 3 deletions Shared/mods/deathmatch/logic/lua/CLuaFunctionParser.h
Expand Up @@ -439,9 +439,9 @@ struct CLuaFunctionParserBase
continue;
}

int i = -2;
auto k = PopUnsafe<key_t>(L, i);
auto v = PopUnsafe<value_t>(L, i);
int i = -2;
auto k = PopUnsafe<key_t>(L, i);
auto v = PopUnsafe<value_t>(L, i);
map.emplace(std::move(k), std::move(v));
lua_pop(L, 1); // drop value, keep key for lua_next
}
Expand Down
2 changes: 1 addition & 1 deletion Shared/publicsdk/Common.h
Expand Up @@ -38,7 +38,7 @@ using namespace std;
#ifndef __COMMON_H
#define __COMMON_H

// used in the function argument vector
// used in the function argument vector
#define MAX_ARGUMENTS 10
struct FunctionArguments
{
Expand Down
4 changes: 2 additions & 2 deletions Shared/sdk/RTree.h
Expand Up @@ -46,9 +46,9 @@ o Minor updates for MSVC 2005/08 compilers
#ifndef RTREE_H
#define RTREE_H

// NOTE This file compiles under MSVC 6 SP5 and MSVC .Net 2003 it may not work on other compilers without modification.
// NOTE This file compiles under MSVC 6 SP5 and MSVC .Net 2003 it may not work on other compilers without modification.

// NOTE These next few lines may be win32 specific, you may need to modify them to compile on other platform
// NOTE These next few lines may be win32 specific, you may need to modify them to compile on other platform
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
Expand Down

0 comments on commit 6f26c2a

Please sign in to comment.