Skip to content

Commit 99aba70

Browse files
committed
Fixed Linux compiler errors
- Exposed tracing functionality
1 parent 9e2a36b commit 99aba70

File tree

3 files changed

+458
-5
lines changed

3 files changed

+458
-5
lines changed

src/core/modules/engine/engine1/engine_wrap_python.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,22 @@
2424
* Development Team grants this exception to all derivative works.
2525
*/
2626

27+
//---------------------------------------------------------------------------------
28+
// Includes
29+
//---------------------------------------------------------------------------------
2730
#include "eiface.h"
2831
#include "engine/IEngineSound.h"
32+
#include "engine/IEngineTrace.h"
2933

34+
35+
// Externals
36+
extern IEngineTrace* enginetrace;
37+
38+
39+
//---------------------------------------------------------------------------------
40+
// IVEngineServer
41+
//---------------------------------------------------------------------------------
42+
// Visitor function
3043
template<class T>
3144
void IVEngineServer_Visitor(T cls)
3245
{
@@ -70,11 +83,15 @@ void IVEngineServer_Visitor(T cls)
7083
;
7184
}
7285

86+
87+
//---------------------------------------------------------------------------------
88+
// IEngineSound
89+
//---------------------------------------------------------------------------------
7390
inline void IEngineSound_EmitSound(IEngineSound* pEngineSound, IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample,
7491
float flVolume, float flAttenuation, int iFlags = 0, int iPitch = PITCH_NORM, const Vector *pOrigin = NULL, const Vector *pDirection = NULL,
7592
tuple origins = tuple(), bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1)
7693
{
77-
CUtlVector< Vector > pUtlVecOrigins = NULL;
94+
CUtlVector< Vector > pUtlVecOrigins;
7895
for(int i=0; i < len(origins); i++)
7996
{
8097
pUtlVecOrigins.AddToTail(extract<Vector>(origins[i]));
@@ -83,7 +100,17 @@ inline void IEngineSound_EmitSound(IEngineSound* pEngineSound, IRecipientFilter&
83100
pEngineSound->EmitSound(filter, iEntIndex, iChannel, pSample, flVolume, flAttenuation, iFlags, iPitch, 0, pOrigin, pDirection, &pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity);
84101
}
85102

103+
// Visitor function
86104
template<class T>
87105
void IEngineSound_Visitor(T cls)
88106
{
107+
}
108+
109+
110+
//---------------------------------------------------------------------------------
111+
// IEngineTrace
112+
//---------------------------------------------------------------------------------
113+
inline int GetPointContents(const Vector &vecAbsPosition, IHandleEntity** ppEntity)
114+
{
115+
return enginetrace->GetPointContents(vecAbsPosition, ppEntity);
89116
}

src/core/modules/engine/engine3/engine_wrap_python.h

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,27 @@
2424
* Development Team grants this exception to all derivative works.
2525
*/
2626

27+
//---------------------------------------------------------------------------------
28+
// Includes
29+
//---------------------------------------------------------------------------------
2730
#include "eiface.h"
2831
#include "ispsharedmemory.h"
2932
#include "modules/usermessage/usermessage.h"
3033
#include "engine/IEngineSound.h"
34+
#include "engine/IEngineTrace.h"
3135

36+
37+
// Externals
38+
extern IEngineTrace* enginetrace;
39+
40+
41+
//---------------------------------------------------------------------------------
42+
// IVEngineServer
43+
//---------------------------------------------------------------------------------
44+
// Overloads
3245
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(get_single_player_shared_memory_space_overload, GetSinglePlayerSharedMemorySpace, 1, 2);
3346

47+
// Visitor function
3448
template<class T>
3549
void IVEngineServer_Visitor(T cls)
3650
{
@@ -249,11 +263,15 @@ void IVEngineServer_Visitor(T cls)
249263
;
250264
}
251265

266+
267+
//---------------------------------------------------------------------------------
268+
// IEngineSound
269+
//---------------------------------------------------------------------------------
252270
inline void IEngineSound_EmitSound(IEngineSound* pEngineSound, IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample,
253271
float flVolume, float flAttenuation, int iFlags = 0, int iPitch = PITCH_NORM, const Vector *pOrigin = NULL, const Vector *pDirection = NULL,
254272
tuple origins = tuple(), bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1)
255273
{
256-
CUtlVector< Vector > pUtlVecOrigins = NULL;
274+
CUtlVector< Vector > pUtlVecOrigins;
257275
for(int i=0; i < len(origins); i++)
258276
{
259277
pUtlVecOrigins.AddToTail(extract<Vector>(origins[i]));
@@ -262,6 +280,7 @@ inline void IEngineSound_EmitSound(IEngineSound* pEngineSound, IRecipientFilter&
262280
pEngineSound->EmitSound(filter, iEntIndex, iChannel, pSample, -1, pSample, flVolume, flAttenuation, 0, iFlags, iPitch, pOrigin, pDirection, &pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity);
263281
}
264282

283+
// Visitor function
265284
template<class T>
266285
void IEngineSound_Visitor(T cls)
267286
{
@@ -272,4 +291,21 @@ void IEngineSound_Visitor(T cls)
272291
"Returns True if the given sample is looping."
273292
)
274293
;
294+
295+
scope().attr("CONTENTS_BLOCKLIGHT") = CONTENTS_BLOCKLIGHT;
296+
297+
scope().attr("SURF_NOPAINT") = SURF_NOPAINT;
298+
299+
scope().attr("MASK_NPCFLUID") = MASK_NPCFLUID;
300+
scope().attr("MASK_SHOT_BRUSHONLY") = MASK_SHOT_BRUSHONLY;
301+
scope().attr("MASK_NPCWORLDSTATIC_FLUID") = MASK_NPCWORLDSTATIC_FLUID;
302+
}
303+
304+
305+
//---------------------------------------------------------------------------------
306+
// IEngineTrace
307+
//---------------------------------------------------------------------------------
308+
inline int GetPointContents(const Vector &vecAbsPosition, IHandleEntity** ppEntity)
309+
{
310+
return enginetrace->GetPointContents(vecAbsPosition, MASK_ALL, ppEntity);
275311
}

0 commit comments

Comments
 (0)