Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Compiling #49

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/MP_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: MP_Linux

on:
push:
paths:
- '.github/**'
- 'mp/src/**'
pull_request:
paths:
- 'mp/src/**'

jobs:
build:
runs-on:
ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Configure dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential gcc-multilib g++-multilib

- name: Create project
working-directory: mp/src
run: devtools/bin/vpc /sdk2013ce +game /mksln Game

- name: Build project
working-directory: mp/src
run: make -f Game.mak

- name: Pack
shell: bash
run: tar cJfv Linux.tar.xz --exclude="*.dbg" mp/game/mod_sdk2013ce/bin

- name: Upload product
uses: actions/upload-artifact@v2
with:
name: mp_sdk2013ce
path: Linux.tar.xz
31 changes: 24 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,30 @@ You can find Source 2013 CE's roadmap by going to our [Trello board](https://tre
And you can also give us suggestions for fixes and features that you'd like to see in our Discord channel (`#source-SDK-2013-ce`) found in the
Source Modding Community server, which you can join [here](https://discord.gg/BD6WpY5).

# Requirements
To be able to use Source 2013 CE you will need to download **Visual Studio 2019** and install:
* MSVC v142 - VS 2019 C++ x64/x86 build tools
* C++ MFC Library for latest v142 build tools (x86 and x64)
* Windows 11 SDK (10.0.22000.0)

As of July 2023, CE has been tested on Visual Studio 2022 with the latest versions of the requirements listed above. So if desired you can use that instead.
# Compiling

## Compiling on Windows
1. Install Visual Studio:
Install **Visual Studio 2019** or **Visual Studio 2022**
2. Install dependencies:
- MSVC v142 - VS 2019 C++ x64/x86 build tools
- C++ MFC Library for latest v142 build tools (x86 and x64)
- Windows 11 SDK (10.0.22000.0)
3. Navigate to the source directory (`sp/src` or `mp/src`)
4. Generate the project files, use `createallprojects.bat` or `creategameprojects.bat`
5. Open `Everything.sln` or `Game.sln`
6. Build the project by clicking on "BUILD" on toolbar
7. Click on "Build Solution"
8. Locate the compiled mod(s) in the game folder

## Compiling on Linux
1. Install dependencies:
- Debian/Ubuntu: `apt-get install build-essential gcc-multilib g++-multilib`
- Arch Linux: `pacman -S base-devel multilib-devel`
2. Navigate to the source directory (`sp/src` or `mp/src`)
3. Generate the project files, use `createallprojects` or `creategameprojects`
4. Build the project `make -f Everything.mak # or make -f Game.mak`
5. Locate the compiled mod(s) in the game folder

# Contributing
We appreciate any form of help so ideally if you want to help this project out the best way would be to make a pull request.
Expand Down
3 changes: 2 additions & 1 deletion mp/src/devtools/makefile_base_posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
# + command is executed even if Make is invoked in "do not exec" mode

OS := $(shell uname)
HOSTNAME := $(shell hostname)
# Creates errors on Arch Linux and is unused
# HOSTNAME := $(shell hostname)

-include $(SRCROOT)/devtools/steam_def.mak
-include $(SRCROOT)/devtools/sourcesdk_def.mak
Expand Down
2 changes: 1 addition & 1 deletion mp/src/game/client/clientmode_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
}
}

if ( team == 0 && GetLocalTeam() > 0 )
if ( team == 0 && GetLocalTeam() )
{
bValidTeam = false;
}
Expand Down
10 changes: 5 additions & 5 deletions mp/src/game/client/hl2/hud_damageindicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void CHudDamageIndicator::DrawDamageIndicator(int side)
int x1 = m_flDmgX;
int x2 = m_flDmgX + m_flDmgWide;
int y[4] = { (int)m_flDmgY, (int)(m_flDmgY + insetY), (int)(m_flDmgY + m_flDmgTall1 - insetY), (int)(m_flDmgY + m_flDmgTall1) };
int alpha[4] = { 0.0f, 1.0f, 1.0f, 0.0f };
int alpha[4] = { 0, 1, 1, 0 };

// see if we're high damage
bool bHighDamage = false;
Expand All @@ -192,10 +192,10 @@ void CHudDamageIndicator::DrawDamageIndicator(int side)
y[1] = 0.0f;
y[2] = GetTall();
y[3] = GetTall();
alpha[0] = 1.0f;
alpha[1] = 0.0f;
alpha[2] = 0.0f;
alpha[3] = 1.0f;
alpha[0] = 1;
alpha[1] = 0;
alpha[2] = 0;
alpha[3] = 1;
bHighDamage = true;
}

Expand Down
6 changes: 3 additions & 3 deletions mp/src/game/client/vgui_netgraphpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ static ConVar net_graphproportionalfont( "net_graphproportionalfont", "1", FCVAR

#define NUM_LATENCY_SAMPLES 8

#define GRAPH_RED (0.9 * 255)
#define GRAPH_GREEN (0.9 * 255)
#define GRAPH_BLUE (0.7 * 255)
#define GRAPH_RED (int32)(0.9 * 255)
#define GRAPH_GREEN (int32)(0.9 * 255)
#define GRAPH_BLUE (int32)(0.7 * 255)

#define LERP_HEIGHT 24

Expand Down
2 changes: 1 addition & 1 deletion mp/src/game/server/ai_behavior_standoff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
ConVar DrawBattleLines( "ai_drawbattlelines", "0", FCVAR_CHEAT );


static AI_StandoffParams_t AI_DEFAULT_STANDOFF_PARAMS = { AIHCR_MOVE_ON_COVER, true, 1.5, 2.5, 1, 3, 25, 0 };
static AI_StandoffParams_t AI_DEFAULT_STANDOFF_PARAMS = { AIHCR_MOVE_ON_COVER, true, false, 1.5, 2.5, 1, 3, 25, false, 0.0 };

#define MAKE_ACTMAP_KEY( posture, activity ) ( (((unsigned)(posture)) << 16) | ((unsigned)(activity)) )

Expand Down
3 changes: 2 additions & 1 deletion mp/src/game/shared/hl2mp/hl2mp_playeranimstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ Activity CHL2MPPlayerAnimState::TranslateActivity( Activity actDesired )

if ( GetHL2MPPlayer()->GetActiveWeapon() )
{
translateActivity = GetHL2MPPlayer()->GetActiveWeapon()->ActivityOverride( translateActivity, false );
bool activityOverrideValue = false;
translateActivity = GetHL2MPPlayer()->GetActiveWeapon()->ActivityOverride( translateActivity, &activityOverrideValue );
}

return translateActivity;
Expand Down
Binary file added mp/src/lib/public/linux32/libtogl.so
Binary file not shown.
Binary file modified mp/src/lib/public/linux32/mathlib.a
Binary file not shown.
Binary file modified mp/src/lib/public/linux32/raytrace.a
Binary file not shown.
Binary file modified mp/src/lib/public/linux32/tier1.a
Binary file not shown.
Binary file modified mp/src/lib/public/linux32/vgui_controls.a
Binary file not shown.
8 changes: 4 additions & 4 deletions mp/src/mathlib/sse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ _PS_EXTERN_CONST(am_pi_o_2, (float)(M_PI / 2.0));
_PS_EXTERN_CONST(am_2_o_pi, (float)(2.0 / M_PI));
_PS_EXTERN_CONST(am_pi_o_4, (float)(M_PI / 4.0));
_PS_EXTERN_CONST(am_4_o_pi, (float)(4.0 / M_PI));
_PS_EXTERN_CONST_TYPE(am_sign_mask, int32, 0x80000000);
_PS_EXTERN_CONST_TYPE(am_inv_sign_mask, int32, ~0x80000000);
_PS_EXTERN_CONST_TYPE(am_sign_mask, int32, (int32)0x80000000);
_PS_EXTERN_CONST_TYPE(am_inv_sign_mask, int32, (int32)~0x80000000);
_PS_EXTERN_CONST_TYPE(am_min_norm_pos,int32, 0x00800000);
_PS_EXTERN_CONST_TYPE(am_mant_mask, int32, 0x7f800000);
_PS_EXTERN_CONST_TYPE(am_inv_mant_mask, int32, ~0x7f800000);
Expand Down Expand Up @@ -341,8 +341,8 @@ float _SSE_InvRSquared(const float* v)
// #define _PS_CONST(Name, Val) static const ALIGN16 float _ps_##Name[4] ALIGN16_POST = { Val, Val, Val, Val }
#define _PS_CONST_TYPE(Name, Type, Val) static const ALIGN16 Type _ps_##Name[4] ALIGN16_POST = { Val, Val, Val, Val }

_PS_CONST_TYPE(sign_mask, int, 0x80000000);
_PS_CONST_TYPE(inv_sign_mask, int, ~0x80000000);
_PS_CONST_TYPE(sign_mask, int, (int32)0x80000000);
_PS_CONST_TYPE(inv_sign_mask, int, (int32)~0x80000000);


#define _PI32_CONST(Name, Val) static const ALIGN16 int _pi32_##Name[4] ALIGN16_POST = { Val, Val, Val, Val }
Expand Down
18 changes: 9 additions & 9 deletions mp/src/mathlib/sseconst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ const fltx4 g_QuatMultRowSign[4] =
};

const int32 ALIGN16 g_SIMD_clear_signmask[4] ALIGN16_POST = {0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff};
const int32 ALIGN16 g_SIMD_signmask[4] ALIGN16_POST = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 };
const int32 ALIGN16 g_SIMD_lsbmask[4] ALIGN16_POST = { 0xfffffffe, 0xfffffffe, 0xfffffffe, 0xfffffffe };
const int32 ALIGN16 g_SIMD_clear_wmask[4] ALIGN16_POST = { 0xffffffff, 0xffffffff, 0xffffffff, 0 };
const int32 ALIGN16 g_SIMD_AllOnesMask[4] ALIGN16_POST = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; // ~0,~0,~0,~0
const int32 ALIGN16 g_SIMD_signmask[4] ALIGN16_POST = { (int32)0x80000000, (int32)0x80000000, (int32)0x80000000, (int32)0x80000000 };
const int32 ALIGN16 g_SIMD_lsbmask[4] ALIGN16_POST = { (int32)0xfffffffe, (int32)0xfffffffe, (int32)0xfffffffe, (int32)0xfffffffe };
const int32 ALIGN16 g_SIMD_clear_wmask[4] ALIGN16_POST = { (int32)0xffffffff, (int32)0xffffffff, (int32)0xffffffff, 0 };
const int32 ALIGN16 g_SIMD_AllOnesMask[4] ALIGN16_POST = { (int32)0xffffffff, (int32)0xffffffff, (int32)0xffffffff, (int32)0xffffffff }; // ~0,~0,~0,~0
const int32 ALIGN16 g_SIMD_Low16BitsMask[4] ALIGN16_POST = { 0xffff, 0xffff, 0xffff, 0xffff }; // 0xffff x 4

const int32 ALIGN16 g_SIMD_ComponentMask[4][4] ALIGN16_POST =
{
{ 0xFFFFFFFF, 0, 0, 0 }, { 0, 0xFFFFFFFF, 0, 0 }, { 0, 0, 0xFFFFFFFF, 0 }, { 0, 0, 0, 0xFFFFFFFF }
{ (int32)0xFFFFFFFF, 0, 0, 0 }, { 0, (int32)0xFFFFFFFF, 0, 0 }, { 0, 0, (int32)0xFFFFFFFF, 0 }, { 0, 0, 0, (int32)0xFFFFFFFF }
};

const int32 ALIGN16 g_SIMD_SkipTailMask[4][4] ALIGN16_POST =
{
{ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff },
{ 0xffffffff, 0x00000000, 0x00000000, 0x00000000 },
{ 0xffffffff, 0xffffffff, 0x00000000, 0x00000000 },
{ 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000 },
{ (int32)0xffffffff, (int32)0xffffffff, (int32)0xffffffff, (int32)0xffffffff },
{ (int32)0xffffffff, 0x00000000, 0x00000000, 0x00000000 },
{ (int32)0xffffffff, (int32)0xffffffff, 0x00000000, 0x00000000 },
{ (int32)0xffffffff, (int32)0xffffffff, (int32)0xffffffff, 0x00000000 },
};


Expand Down
6 changes: 3 additions & 3 deletions mp/src/public/particles/particles.h
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ class CParticleCollection



class CM128InitialAttributeIterator : public CStridedConstPtr<fltx4>
class CM128InitialAttributeIterator : public CFltx4StridedConstPtr
{
public:
FORCEINLINE CM128InitialAttributeIterator( int nAttribute, CParticleCollection *pParticles )
Expand All @@ -1401,7 +1401,7 @@ class CM128InitialAttributeIterator : public CStridedConstPtr<fltx4>
};


class CM128AttributeIterator : public CStridedConstPtr<fltx4>
class CM128AttributeIterator : public CFltx4StridedConstPtr
{
public:
FORCEINLINE CM128AttributeIterator( int nAttribute, CParticleCollection *pParticles )
Expand All @@ -1419,7 +1419,7 @@ class C4IAttributeIterator : public CStridedConstPtr<FourInts>
}
};

class CM128AttributeWriteIterator : public CStridedPtr<fltx4>
class CM128AttributeWriteIterator : public CFltx4StridedPtr
{
public:
FORCEINLINE CM128AttributeWriteIterator( void )
Expand Down
Loading