Add/update core headers

This commit is contained in:
Kawe Mazidjatari 2024-04-05 16:53:51 +02:00
parent 1b2ce75e81
commit 7d0b2d7450
6 changed files with 127 additions and 10 deletions

View File

@ -60,6 +60,7 @@
#include "tier0/module.h"
#include "tier0/basetypes.h"
#include "tier0/platform.h"
#include "tier0/platwindow.h"
#include "tier0/annotations.h"
#include "tier0/commonmacros.h"
#include "tier0/memalloc.h"
@ -67,6 +68,7 @@
#include "tier0/dbg.h"
// Tier1 includes.
#include "tier1/tier1.h"
#include "tier1/cvar.h"
#include "tier1/cmd.h"
#include "common/global.h"

View File

@ -5,13 +5,13 @@
class CEngineAPI : public IEngineAPI
{
public:
virtual bool Connect(CreateInterfaceFn factory) = 0;
virtual bool Connect(const CreateInterfaceFn factory) = 0;
virtual void Disconnect() = 0;
virtual void* QueryInterface(const char* pInterfaceName) = 0;
virtual void* QueryInterface(const char* const pInterfaceName) = 0;
virtual InitReturnVal_t Init() = 0;
virtual void Shutdown() = 0;
virtual AppSystemTier_t GetTier() = 0;
virtual void Reconnect(CreateInterfaceFn factory, const char* pInterfaceName) = 0;
virtual void Reconnect(const CreateInterfaceFn factory, const char* const pInterfaceName) = 0;
// This function must be called before init
virtual bool SetStartupInfo(StartupInfo_t& info) = 0;

View File

@ -57,12 +57,12 @@ public:
virtual ~IAppSystem() = 0; // Prepended on each class derived class in assembly.
// Here's where the app systems get to learn about each other
virtual bool Connect(CreateInterfaceFn factory) = 0;
virtual bool Connect(const CreateInterfaceFn factory) = 0;
virtual void Disconnect() = 0;
// Here's where systems can access other interfaces implemented by this object
// Returns NULL if it doesn't implement the requested interface
virtual void* QueryInterface(const char* pInterfaceName) = 0;
virtual void* QueryInterface(const char* const pInterfaceName) = 0;
// Init, shutdown
virtual InitReturnVal_t Init() = 0;
@ -75,7 +75,7 @@ public:
virtual AppSystemTier_t GetTier() = 0;
// Reconnect to a particular interface
virtual void Reconnect(CreateInterfaceFn factory, const char* pInterfaceName) = 0;
virtual void Reconnect(const CreateInterfaceFn factory, const char* const pInterfaceName) = 0;
};
//-----------------------------------------------------------------------------
@ -88,12 +88,12 @@ public:
virtual ~CBaseAppSystem() = 0; // Prepended on each class derived class in assembly.
// Here's where the app systems get to learn about each other
virtual bool Connect(CreateInterfaceFn factory) = 0;
virtual bool Connect(const CreateInterfaceFn factory) = 0;
virtual void Disconnect() = 0;
// Here's where systems can access other interfaces implemented by this object
// Returns NULL if it doesn't implement the requested interface
virtual void* QueryInterface(const char* pInterfaceName) = 0;
virtual void* QueryInterface(const char* const pInterfaceName) = 0;
// Init, shutdown
virtual InitReturnVal_t Init() = 0;
@ -106,7 +106,15 @@ public:
virtual AppSystemTier_t GetTier() = 0;
// Reconnect to a particular interface
virtual void Reconnect(CreateInterfaceFn factory, const char* pInterfaceName) = 0;
virtual void Reconnect(const CreateInterfaceFn factory, const char* const pInterfaceName) = 0;
};
//-----------------------------------------------------------------------------
// Helper implementation of an IAppSystem for tier0
//-----------------------------------------------------------------------------
template< class IInterface >
class CTier0AppSystem : public CBaseAppSystem< IInterface >
{
};
#endif // IAPPSYSTEM_H

View File

@ -0,0 +1,82 @@
//===== Copyright <20> 1996-2009, Valve Corporation, All rights reserved. ======//
//
// Purpose:
//
// $NoKeywords: $
//
//===========================================================================//
#ifndef PLATWINDOW_H
#define PLATWINDOW_H
#ifdef COMPILER_MSVC32
#pragma once
#endif
#include "tier0/platform.h"
#include "tier0/basetypes.h"
//-----------------------------------------------------------------------------
// Window handle
//-----------------------------------------------------------------------------
DECLARE_POINTER_HANDLE( PlatWindow_t );
#define PLAT_WINDOW_INVALID ( (PlatWindow_t)0 )
//-----------------------------------------------------------------------------
// Window creation
//-----------------------------------------------------------------------------
enum WindowCreateFlags_t
{
WINDOW_CREATE_FULLSCREEN = 0x1,
WINDOW_CREATE_RESIZING = 0x2,
};
PLATFORM_INTERFACE PlatWindow_t Plat_CreateWindow( void *hInstance, const char *pTitle, int nWidth, int nHeight, int nFlags );
//-----------------------------------------------------------------------------
// Window title
//-----------------------------------------------------------------------------
PLATFORM_INTERFACE void Plat_SetWindowTitle( PlatWindow_t hWindow, const char *pTitle );
//-----------------------------------------------------------------------------
// Window movement
//-----------------------------------------------------------------------------
PLATFORM_INTERFACE void Plat_SetWindowPos( PlatWindow_t hWindow, int x, int y );
//-----------------------------------------------------------------------------
// Gets the desktop resolution
//-----------------------------------------------------------------------------
PLATFORM_INTERFACE void Plat_GetDesktopResolution( int *pWidth, int *pHeight );
//-----------------------------------------------------------------------------
// Gets a window size
//-----------------------------------------------------------------------------
PLATFORM_INTERFACE void Plat_GetWindowClientSize( PlatWindow_t hWindow, int *pWidth, int *pHeight );
//-----------------------------------------------------------------------------
// Is the window minimized?
//-----------------------------------------------------------------------------
PLATFORM_INTERFACE bool Plat_IsWindowMinimized( PlatWindow_t hWindow );
//-----------------------------------------------------------------------------
// Gets the shell window in a console app
//-----------------------------------------------------------------------------
PLATFORM_INTERFACE PlatWindow_t Plat_GetShellWindow( );
//-----------------------------------------------------------------------------
// Convert window -> Screen coordinates and back
//-----------------------------------------------------------------------------
PLATFORM_INTERFACE void Plat_WindowToScreenCoords( PlatWindow_t hWnd, int &x, int &y );
PLATFORM_INTERFACE void Plat_ScreenToWindowCoords( PlatWindow_t hWnd, int &x, int &y );
#endif // PLATWINDOW_H

View File

@ -0,0 +1,25 @@
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose: A higher level link library for general use in the game and tools.
//
//===========================================================================//
#ifndef TIER1_H
#define TIER1_H
#include "appframework/IAppSystem.h"
//-----------------------------------------------------------------------------
// Helper empty implementation of an IAppSystem for tier2 libraries
//-----------------------------------------------------------------------------
template< class IInterface, int ConVarFlag = 0 >
class CTier1AppSystem : public CTier0AppSystem< IInterface >
{
virtual bool Connect( const CreateInterfaceFn factory ) = 0;
virtual void Disconnect( ) = 0;
virtual void* QueryInterface( const char* const pInterfaceName ) = 0;
virtual InitReturnVal_t Init( ) = 0;
virtual void Shutdown( ) = 0;
virtual AppSystemTier_t GetTier( ) = 0;
virtual void Reconnect( const CreateInterfaceFn factory, const char* const pInterfaceName ) = 0;
};
#endif // TIER1_H

View File

@ -81,6 +81,6 @@ class VFactory : public IDetour
.FollowNearCallSelf().FindPatternSelf("48 8B 1D", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<InterfaceReg**>();
}
virtual void GetCon(void) const { }
virtual void Detour(const bool bAttach) const { }
virtual void Detour(const bool /*bAttach*/) const { }
};
///////////////////////////////////////////////////////////////////////////////