no engine anymore

This commit is contained in:
2025-07-30 23:53:26 +03:00
parent 8a29e6b86f
commit 395ced9e28
159 changed files with 2767 additions and 9484 deletions

View File

@@ -1 +1,5 @@
//================= Copyright kotofyt, All rights reserved ==================//
// Purpose: BAN STL. I hate it.
//===========================================================================//
#define std no_you_do_not_use_std

View File

@@ -1,23 +1,30 @@
//================= Copyright kotofyt, All rights reserved ==================//
// Purpose: Command line handler for argc and argv. It also allows to find
// parameters and push your own.
//===========================================================================//
#ifndef TIER1_COMMANDLINE_H
#define TIER1_COMMANDLINE_H
#include "tier0/platform.h"
interface ICommandLine
abstract_class ICommandLine
{
public:
static void CreateCommandLine( int argc, char **argv );
virtual void CreateCommandLine( int argc, char **argv ) = 0;
static bool CheckParam( const char *psz );
static char *ParamValue( const char* psz, const char *szDefaultValue = 0 );
virtual bool CheckParam( const char *psz ) = 0;
virtual char *ParamValue( const char* psz, const char *szDefaultValue = 0 ) = 0;
static void AddParam( char *psz );
static void RemoveParam( char *psz );
virtual void AddParam( char *psz ) = 0;
virtual void RemoveParam( char *psz ) = 0;
static int ParamCount();
static int FindParam( const char *psz );
static const char *GetParam(int nIndex);
virtual int ParamCount() = 0;
virtual int FindParam( const char *psz ) = 0;
virtual const char *GetParam(int nIndex) = 0;
};
ICommandLine *CommandLine();
#endif

28
public/tier1/interface.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef INTERFACE_H
#define INTERFACE_H
#include "tier0/platform.h"
typedef void *( *CreateInterfaceFn )( const char *szName, int *pReturnCode );
typedef void *( *InstantiateInterfaceFn )( void );
class CInterfaceRegistry
{
public:
CInterfaceRegistry( InstantiateInterfaceFn fn, const char *szName );
InstantiateInterfaceFn m_CreateFn;
const char *m_szName;
CInterfaceRegistry *m_pNext;
};
#define EXPOSE_INTERFACE( className, interfaceName, versionName ) \
static void *__Create##className##_interface() { return ( interfaceName* )( new className ); }; \
static CInterfaceRegistry __Create##className##_registry( __Create##className##_interface, versionName );
void *CreateInterface( const char *szName, int *pReturnCode );
#endif

View File

@@ -1 +1,5 @@
//================= Copyright kotofyt, All rights reserved ==================//
// Purpose: Unban STL because C++ doesn't like using something different.
//===========================================================================//
#undef std

View File

@@ -1,3 +1,8 @@
//================= Copyright kotofyt, All rights reserved ==================//
// Purpose: Memory buffers for C++. They store data on heap as you have C
// arrays for stack.
//===========================================================================//
#ifndef TIER1_UTL_BUFFER_H
#define TIER1_UTL_BUFFER_H
@@ -5,9 +10,6 @@
#include "tier0/mem.h"
#include "tier0/platform.h"
#include "tier0/lib.h"
#include "tier0/minmax_off.h"
#include "new"
#include "tier0/minmax.h"
template <typename T>
class CUtlBuffer;

View File

@@ -1,13 +1,13 @@
#ifndef TIER1_UTL_INITIALIZER_LIST_H
#define TIER1_UTL_INITIALIZER_LIST_H
//-----------------------------------------------------------------------------
// C++ only supports std::initializer_list. Because of that we are dependent
// on libc++. That's why I banned usage of the std.
//================= Copyright kotofyt, All rights reserved ==================//
// C++ only supports std::initializer_list, so we need to get around compiler.
//
// fuck C++ once
// fuck C++ twice
// fuck C++ thrice
//-----------------------------------------------------------------------------
//===========================================================================//
#ifndef TIER1_UTL_INITIALIZER_LIST_H
#define TIER1_UTL_INITIALIZER_LIST_H
#include "initializer_list"
template<typename T>

View File

@@ -1,3 +1,7 @@
//================= Copyright kotofyt, All rights reserved ==================//
// Purpose: Mutexes for C++
//===========================================================================//
#ifndef TIER1_UTL_MUTEX_H
#define TIER1_UTL_MUTEX_H

View File

@@ -1,3 +1,7 @@
//================= Copyright kotofyt, All rights reserved ==================//
// Purpose: Own implementation of string.
//===========================================================================//
#ifndef TIER1_UTL_STRING_H
#define TIER1_UTL_STRING_H

View File

@@ -1,13 +1,17 @@
//================= Copyright kotofyt, All rights reserved ==================//
// Purpose: Own implementation of vectors, it is better to use them in local
// namespaces for own .
//===========================================================================//
#ifndef TIER1_UTL_VECTOR_H
#define TIER1_UTL_VECTOR_H
#include "tier1/utlbuffer.h"
#include "tier0/lib.h"
#include "tier1/utlbuffer.h"
#include "tier1/utlinitlist.h"
#include <initializer_list>
//-----------------------------------------------------------------------------
// Basic vector implementation. There isn't much in them.
// Basic vector implementation. There isn't much in them but they work.
//-----------------------------------------------------------------------------
template<typename T>
class CUtlVector
@@ -43,6 +47,7 @@ public:
CUtlVector<T> &operator=(const CUtlVector<T> &vec);
// Iterator stuff
// Do we really need it?
struct Iterator {
T *m_pCurrent;
Iterator( T *pCurrent ) : m_pCurrent(pCurrent) {}