summaryrefslogtreecommitdiff
path: root/src/csgo/materialsystem.h
diff options
context:
space:
mode:
authornavewindre <nw@moneybot.cc>2024-07-12 05:40:41 +0200
committernavewindre <nw@moneybot.cc>2024-07-12 05:40:41 +0200
commit28f41cf689def99fb586bfca47b7e1786227a5a2 (patch)
tree4a843c7785035ca548625ccf988ac924b8815f85 /src/csgo/materialsystem.h
parent2ebf959ec02048c15323e1bbfc63faedcf5067b6 (diff)
base shit
Diffstat (limited to 'src/csgo/materialsystem.h')
-rw-r--r--src/csgo/materialsystem.h61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/csgo/materialsystem.h b/src/csgo/materialsystem.h
deleted file mode 100644
index 263f808..0000000
--- a/src/csgo/materialsystem.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#include "csgo.h"
-
-class MATERIAL {
-private:
- static IFACE_ENTRY* get_matsystem( CSGO* csgo ) {
- static IFACE_ENTRY* ret = u_vector_search<IFACE_ENTRY>( csgo->interfaces,
- []( IFACE_ENTRY i ) {
- return fnv1a( "materialsystem.dll" ) == fnv1a( i.module_name )
- && !!strcmp( i.name, "VMaterialSystem" );
- } );
-
- return ret;
- }
-
- static IFACE_ENTRY* get_matsystem_cvar( CSGO* csgo ) {
- static IFACE_ENTRY* ret = u_vector_search<IFACE_ENTRY>( csgo->interfaces,
- []( IFACE_ENTRY i ) {
- return fnv1a( "materialsystem.dll" ) == fnv1a( i.module_name )
- && !!strcmp( i.name, "VEngineCvar" );
- } );
-
- return ret;
- }
-
-public:
- static U32 first_material( CSGO* csgo ) {
- IFACE_ENTRY* mat_system = get_matsystem( csgo );
-
- U16 mat_handle = csgo->read<U16>( mat_system->ptr + 0x250 );
-
- while( mat_handle != 0xffff ) {
- U32 handle_entries = csgo->read<U32>( mat_system->ptr + 0x244 );
- U16 next_handle = csgo->read<U16>( handle_entries + 16 * mat_handle );
-
- if( next_handle == 0xffff )
- return mat_handle;
-
- mat_handle = next_handle;
- }
-
- return 0;
- }
-
- static U16 next_material( CSGO* csgo, U16 mat ) {
- IFACE_ENTRY* mat_system = get_matsystem( csgo );
-
- if( mat == 0xffff )
- return 0;
-
- U32 handle_array = csgo->read<U32>( mat_system->ptr + 0x244 );
- U16 next_handle = csgo->read<U16>( handle_array + 16 + mat + 2 );
- if( next_handle == 0xffff )
- return 0xffff;
-
- for( U16 i = next_handle; i != 0xffff; i = csgo->read<U16>( handle_array * 16 + i ) ) {
- next_handle = i;
- }
-
- return next_handle;
- }
-}; \ No newline at end of file