mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-23 14:38:13 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
79 lines
2.4 KiB
Modula-2
79 lines
2.4 KiB
Modula-2
|
|
native accessor g_pWorldRendererMgr
|
|
{
|
|
void ServiceWorldRequests();
|
|
|
|
inline uint UpdateObjectsForRendering( StringToken worldGroupId, Vector3 eyePos, float flLODScale, float flMaxVisibleDistance )
|
|
{
|
|
return g_pWorldRendererMgr->UpdateObjectsForRendering( worldGroupId, eyePos, flLODScale, flMaxVisibleDistance );
|
|
}
|
|
|
|
inline IWorldReference CreateWorld( string pMapName, ISceneWorld pSceneWorld, bool bAsyncLoad, bool bIgnoreExistingWorlds, bool bLoadVis, bool bPrecacheOnly, StringToken worldGroupId, Transform transform )
|
|
{
|
|
CreateWorldInfo_t info;
|
|
info.m_pWorldName = pMapName;
|
|
info.m_pSceneWorld = pSceneWorld;
|
|
info.m_bAsyncLoad = bAsyncLoad;
|
|
info.m_bLoadVis = bLoadVis;
|
|
info.m_worldGroupId = worldGroupId;
|
|
info.m_bPrecacheOnly = bPrecacheOnly;
|
|
info.m_bIgnoreExistingWorlds = bIgnoreExistingWorlds;
|
|
info.m_mWorldTransform = transform.ToMatrix();
|
|
|
|
return g_pWorldRendererMgr->CreateWorld( info );
|
|
}
|
|
|
|
bool MountWorldVPK( string pWorldName, string pVpkPath );
|
|
bool UnmountWorldVPK( string pWorldName );
|
|
}
|
|
|
|
native class IWorldReference as NativeEngine.IWorldReference
|
|
{
|
|
void Release();
|
|
bool IsWorldLoaded();
|
|
bool IsErrorWorld();
|
|
bool IsMarkedForDeletion();
|
|
bool GetWorldBounds( cref out Vector3 vMin, cref out Vector vMax );
|
|
ISceneWorld GetSceneWorld();
|
|
|
|
void PrecacheAllWorldNodes( CastTo[WorldNodeFlags_t] uint flags );
|
|
|
|
string GetFolder();
|
|
|
|
inline int GetEntityCount( string pEntityLumpName )
|
|
{
|
|
const CUtlVector< const CEntityKeyValues* > *pEnts = g_pWorldRendererMgr->GetEntityList( self, pEntityLumpName );
|
|
return pEnts ? pEnts->Count() : 0;
|
|
}
|
|
|
|
inline CEntityKeyValues GetEntityKeyValues( string pEntityLumpName, int index )
|
|
{
|
|
const CUtlVector< const CEntityKeyValues* > *pEnts = g_pWorldRendererMgr->GetEntityList( self, pEntityLumpName );
|
|
return pEnts ? pEnts->Element( index ) : 0;
|
|
}
|
|
|
|
inline void SetWorldTransform( Transform transform )
|
|
{
|
|
if ( IWorld *pGeometryWorld = self->GetGeometryWorld() )
|
|
{
|
|
pGeometryWorld->SetWorldTransform( transform.ToMatrix() );
|
|
}
|
|
}
|
|
}
|
|
|
|
native class CEntityKeyValues as NativeEngine.CEntityKeyValues
|
|
{
|
|
string GetValueString( StringToken key, string pDefaultValue );
|
|
int GetKeyCount();
|
|
|
|
inline uint GetKey( int nIdx )
|
|
{
|
|
return self->GetKey( nIdx ).GetHashCode();
|
|
}
|
|
|
|
inline string GetValueString( uint key, string pDefaultValue )
|
|
{
|
|
return self->GetValueString( StringTokenFromHashCode( key ), pDefaultValue );
|
|
}
|
|
}
|