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]
69 lines
1.7 KiB
Modula-2
69 lines
1.7 KiB
Modula-2
|
|
|
|
native class IResourceCompilerContext
|
|
{
|
|
void SetExtension( string name );
|
|
void SetCompiler( string name );
|
|
|
|
string FullPath();
|
|
string RelativePath();
|
|
string ResourceName();
|
|
|
|
void SpecifyResourceVersion( int nVersion );
|
|
void RegisterSpecialDependency( string str, uint nUserData, uint nFingerprint );
|
|
|
|
inline bool RegisterReference( string filename )
|
|
{
|
|
CPathBufferString fixedResourceName;
|
|
|
|
if ( !FixupResourceName( filename, &fixedResourceName ) )
|
|
return false;
|
|
|
|
ResourceType_t nType = DeduceResourceTypeFromResourceName( fixedResourceName );
|
|
self->RegisterResourceReference( nType, fixedResourceName );
|
|
return true;
|
|
}
|
|
|
|
inline void RegisterInputFileDependency( string filename, int flags )
|
|
{
|
|
self->RegisterInputFileDependency( filename, (InputFileDependencyFlags_t) flags );
|
|
}
|
|
|
|
inline int WriteBlock( string blockName, void* data, int count )
|
|
{
|
|
auto blockId = MK_RSRC_BLOCK_ID( blockName[0], blockName[1], blockName[2], blockName[3] );
|
|
return self->RegisterAdditionalBlock( blockId, data, count );
|
|
}
|
|
|
|
inline CUtlBuffer GetOverrideData()
|
|
{
|
|
return self->RequestBufferArg( "___OverrideInputData___", INPUT_DEPENDENCY_NORMAL );
|
|
}
|
|
|
|
CResourceStream Data();
|
|
CResourceStream StreamingData();
|
|
IResourceCompilerContextChild CreateChildContext( string pFileName );
|
|
}
|
|
|
|
native class CResourceStream
|
|
{
|
|
void WriteBytes( void* data, int size );
|
|
|
|
void Align( int alignment, int offset );
|
|
void AlignPointer();
|
|
|
|
uint Tell();
|
|
}
|
|
|
|
native class IResourceCompilerContextChild
|
|
{
|
|
inline void SetOverrideInputData( string data )
|
|
{
|
|
CUtlBuffer buf( 0, 0, CUtlBuffer::TEXT_BUFFER );
|
|
buf.PutString( data );
|
|
self->SetOverrideInputData( buf );
|
|
}
|
|
|
|
bool CompileImmediately();
|
|
}
|