introduces ios support? still needs metal
This commit is contained in:
@@ -12,6 +12,10 @@ void *g_serverdll;
|
||||
ConVar g_tickrate("tickrate","64",FCVAR_PROTECTED);
|
||||
float g_fAccumulator = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Loads game and client libraries if linking dynamically, otherwise it runs
|
||||
// IGame_Load compiled statically.
|
||||
//-----------------------------------------------------------------------------
|
||||
void IServer::LoadGame( const char *psz )
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
@@ -21,6 +25,10 @@ void IServer::LoadGame( const char *psz )
|
||||
g_serverdll = Plat_LoadLibrary(CUtlString("%s/bin/libserver.so", psz));
|
||||
Plat_LoadLibrary(CUtlString("%s/bin/libclient.so", psz));
|
||||
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
g_serverdll = Plat_LoadLibrary(CUtlString("%s/bin/libserver.dysim", psz));
|
||||
Plat_LoadLibrary(CUtlString("%s/bin/libclient.dysim", psz));
|
||||
#endif
|
||||
void (*GameLoadfn)() = (void(*)())Plat_GetProc(g_serverdll, "IGame_Load");
|
||||
if (!GameLoadfn)
|
||||
@@ -28,6 +36,9 @@ void IServer::LoadGame( const char *psz )
|
||||
GameLoadfn();
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Updates server and client state.
|
||||
//-----------------------------------------------------------------------------
|
||||
void IServer::Think( float fDelta )
|
||||
{
|
||||
g_fAccumulator += fDelta;
|
||||
@@ -37,8 +48,8 @@ void IServer::Think( float fDelta )
|
||||
while(g_fAccumulator>=fTickrate)
|
||||
{
|
||||
IInput::Frame();
|
||||
IConsole::AddCommand("+forward;");
|
||||
IConsole::Execute();
|
||||
|
||||
g_fAccumulator-=fTickrate;
|
||||
for (auto &entity: g_entities)
|
||||
{
|
||||
@@ -52,3 +63,8 @@ void IServer::Think( float fDelta )
|
||||
entity->pClientEntity->Think(fDelta);
|
||||
}
|
||||
};
|
||||
|
||||
void IGame_Exit( int argc, char **argv ) {
|
||||
Plat_Exit(0);
|
||||
}
|
||||
ConCommand ExitCmd("exit", IGame_Exit, 0);
|
||||
|
||||
Reference in New Issue
Block a user