Skip to content

Commit 1cad083

Browse files
committed
First commit to bms branch.
Added all necessary bms branch directories/files to core modules. Added basic patches to bms branch.
1 parent e5ec8f7 commit 1cad083

31 files changed

+4022
-2
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2014 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
#ifndef _CVARS_WRAP_BMS_H
28+
#define _CVARS_WRAP_BMS_H
29+
30+
//-----------------------------------------------------------------------------
31+
// Includes.
32+
//-----------------------------------------------------------------------------
33+
#include "icvar.h"
34+
35+
36+
//-----------------------------------------------------------------------------
37+
// ICVar extension class.
38+
//-----------------------------------------------------------------------------
39+
class ICVarExt
40+
{
41+
public:
42+
static ConCommandBase* GetCommands(ICvar* pCvar)
43+
{
44+
return pCvar->GetCommands();
45+
};
46+
};
47+
48+
#endif // _CVARS_WRAP_BMS_H
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2014 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
#ifndef _EFFECTS_WRAP_PYTHON_BMS_H
28+
#define _EFFECTS_WRAP_PYTHON_BMS_H
29+
30+
//-----------------------------------------------------------------------------
31+
// Includes.
32+
//-----------------------------------------------------------------------------
33+
#include "game/shared/itempents.h"
34+
#include "toolframework/itoolentity.h"
35+
36+
37+
//-----------------------------------------------------------------------------
38+
// External variables.
39+
//-----------------------------------------------------------------------------
40+
extern IServerTools *servertools;
41+
42+
43+
//-----------------------------------------------------------------------------
44+
// Expose CEffectData.
45+
//-----------------------------------------------------------------------------
46+
template<class T, class U>
47+
void export_engine_specific_dispatch_effect_data(T _effects, U DispatchEffectData)
48+
{
49+
// Nothing specific to OrangeBox...
50+
}
51+
52+
53+
//-----------------------------------------------------------------------------
54+
// Expose ITempEntsSystem.
55+
//-----------------------------------------------------------------------------
56+
template<class T, class U>
57+
void export_engine_specific_temp_entities_system(T _effects, U TempEntities)
58+
{
59+
TempEntities.def("dispatch_effect", &ITempEntsSystem::DispatchEffect);
60+
61+
// Singleton...
62+
_effects.attr("temp_entities") = object(ptr(servertools->GetTempEntsSystem()));
63+
}
64+
65+
66+
#endif // _EFFECTS_WRAP_PYTHON_BMS_H
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2014 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
#ifndef _ENGINES_WRAP_BMS_H
28+
#define _ENGINES_WRAP_BMS_H
29+
30+
//-----------------------------------------------------------------------------
31+
// Includes.
32+
//-----------------------------------------------------------------------------
33+
#include "engine/IEngineSound.h"
34+
35+
36+
//-----------------------------------------------------------------------------
37+
// IEngineSound extension class.
38+
//-----------------------------------------------------------------------------
39+
class IEngineSoundExt
40+
{
41+
public:
42+
static void EmitSound(IEngineSound* pEngineSound, IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample,
43+
float flVolume, float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin, const Vector *pDirection,
44+
tuple origins, bool bUpdatePositions, float soundtime, int speakerentity)
45+
{
46+
CUtlVector<Vector> *pUtlVecOrigins = NULL;
47+
CUtlVector<Vector> vecOrigins;
48+
if (len(origins) > 0)
49+
{
50+
pUtlVecOrigins = &vecOrigins;
51+
for(int i=0; i < len(origins); i++)
52+
{
53+
vecOrigins.AddToTail(extract<Vector>(origins[i]));
54+
}
55+
}
56+
57+
pEngineSound->EmitSound(filter, iEntIndex, iChannel, pSample, flVolume, flAttenuation, iFlags, iPitch, 0, pOrigin,
58+
pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity);
59+
}
60+
};
61+
62+
63+
//---------------------------------------------------------------------------------
64+
// IEngineTrace
65+
//---------------------------------------------------------------------------------
66+
inline int GetPointContents(const Vector &vecAbsPosition, IHandleEntity** ppEntity)
67+
{
68+
return enginetrace->GetPointContents(vecAbsPosition, ppEntity);
69+
}
70+
71+
72+
#endif // _ENGINES_WRAP_BMS_H
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2014 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
#ifndef _ENGINES_WRAP_PYTHON_BMS_H
28+
#define _ENGINES_WRAP_PYTHON_BMS_H
29+
30+
//---------------------------------------------------------------------------------
31+
// Includes.
32+
//---------------------------------------------------------------------------------
33+
#include "eiface.h"
34+
#include "engine/IEngineSound.h"
35+
#include "engine/IEngineTrace.h"
36+
37+
38+
//---------------------------------------------------------------------------------
39+
// External variables.
40+
//---------------------------------------------------------------------------------
41+
extern IEngineTrace* enginetrace;
42+
43+
44+
//---------------------------------------------------------------------------------
45+
// IVEngineServer visitor function.
46+
//---------------------------------------------------------------------------------
47+
template<class T>
48+
T IVEngineServer_Visitor(T cls)
49+
{
50+
cls
51+
.def("get_time",
52+
&IVEngineServer::Time,
53+
"Returns a high precision timer for doing profiling work"
54+
)
55+
56+
.def("multiplayer_end_game",
57+
&IVEngineServer::MultiplayerEndGame,
58+
"Matchmaking"
59+
)
60+
61+
.def("create_fake_client_ex",
62+
&IVEngineServer::CreateFakeClientEx,
63+
reference_existing_object_policy()
64+
)
65+
;
66+
67+
return cls;
68+
}
69+
70+
71+
//---------------------------------------------------------------------------------
72+
// IEngineSound visitor function.
73+
//---------------------------------------------------------------------------------
74+
template<class T>
75+
T IEngineSound_Visitor(T cls)
76+
{
77+
return cls;
78+
}
79+
80+
#endif // _ENGINES_WRAP_PYTHON_BMS_H
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2015 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
#ifndef _ENTITIES_CONSTANTS_BMS_WRAP_PYTHON_H
28+
#define _ENTITIES_CONSTANTS_BMS_WRAP_PYTHON_H
29+
30+
//-----------------------------------------------------------------------------
31+
// Includes.
32+
//-----------------------------------------------------------------------------
33+
#include "utilities/wrap_macros.h"
34+
35+
36+
//-----------------------------------------------------------------------------
37+
// Exports damage types.
38+
//-----------------------------------------------------------------------------
39+
template<class T>
40+
void export_engine_specific_damage_types(T _constants)
41+
{
42+
// Nothing specific to BMS...
43+
}
44+
45+
46+
//-----------------------------------------------------------------------------
47+
// Exports SolidFlags_t.
48+
//-----------------------------------------------------------------------------
49+
template<class T, class U>
50+
void export_engine_specific_solid_flags(T _constants, U SolidFlags)
51+
{
52+
// Nothing specific to BMS...
53+
}
54+
55+
56+
//-----------------------------------------------------------------------------
57+
// Exports entity effects.
58+
//-----------------------------------------------------------------------------
59+
template<class T>
60+
void export_engine_specific_entity_effects(T _constants)
61+
{
62+
// Nothing specific to BMS...
63+
}
64+
65+
66+
//-----------------------------------------------------------------------------
67+
// Exports RenderFx_t.
68+
//-----------------------------------------------------------------------------
69+
template<class T, class U>
70+
void export_engine_specific_render_effects(T _constants, U RenderEffects)
71+
{
72+
RenderEffects.value("DISTORT", kRenderFxDistort);
73+
RenderEffects.value("HOLOGRAM", kRenderFxHologram);
74+
RenderEffects.value("EXPLODE", kRenderFxExplode);
75+
RenderEffects.value("CLAMP_MIN_SCALE", kRenderFxClampMinScale);
76+
RenderEffects.value("ENV_RAIN", kRenderFxEnvRain);
77+
RenderEffects.value("ENV_SNOW", kRenderFxEnvSnow);
78+
RenderEffects.value("SPOTLIGHT", kRenderFxSpotlight);
79+
RenderEffects.value("RAGDOLL", kRenderFxRagdoll);
80+
RenderEffects.value("PULSE_FAST_WIDER", kRenderFxPulseFastWider);
81+
}
82+
83+
84+
//-----------------------------------------------------------------------------
85+
// Exports Collision_Group_t.
86+
//-----------------------------------------------------------------------------
87+
template<class T, class U>
88+
void export_engine_specific_collision_group(T _constants, U CollisionGroup)
89+
{
90+
// Nothing specific to BMS...
91+
}
92+
93+
94+
#endif // _ENTITIES_CONSTANTS_BMS_WRAP_PYTHON_H

0 commit comments

Comments
 (0)