additions
This commit is contained in:
@@ -26,9 +26,13 @@ DECLARE_BUILD_STAGE(engine)
|
||||
|
||||
"sv_dll.cpp",
|
||||
"cl_dll.cpp",
|
||||
|
||||
"miniaudio.cpp",
|
||||
|
||||
"kotgui.cpp",
|
||||
};
|
||||
|
||||
if ( GET_PROJECT_VALUE(config, "static") == "true" )
|
||||
if ( GET_PROJECT_VALUE(config, "steam") == "true" )
|
||||
{
|
||||
compileProject.files.AppendTail("steamnetwork.cpp");
|
||||
}
|
||||
@@ -39,6 +43,7 @@ DECLARE_BUILD_STAGE(engine)
|
||||
"../external/cglm/include",
|
||||
FUNNYSTDLIB"public",
|
||||
EXTERNAL"steamworks/public",
|
||||
EXTERNAL
|
||||
};
|
||||
if ( GET_PROJECT_VALUE(config, "steam") == "true" )
|
||||
compileProject.macros.AppendTail({"STEAM", "TRUE"});
|
||||
|
||||
@@ -56,7 +56,6 @@ extern "C" void FunnyMain( int argc, char **argv )
|
||||
CommandLine()->CreateCommandLine(argc, argv);
|
||||
|
||||
EngineConsts_t stConstants = {};
|
||||
V_printf("------------ 1\n");
|
||||
#ifdef STEAM
|
||||
V_printf("Steam :)\n");
|
||||
if(SteamAPI_RestartAppIfNecessary(480))
|
||||
@@ -74,7 +73,7 @@ extern "C" void FunnyMain( int argc, char **argv )
|
||||
stConstants.LaunchServer = LaunchServerAtSteamRelay;
|
||||
stConstants.ConnectSteamServer = ConnectBySteamID;
|
||||
|
||||
//SteamNetworkingUtils()->SetDebugOutputFunction(k_ESteamNetworkingSocketsDebugOutputType_Debug, SteamAPIDebug);
|
||||
SteamNetworkingUtils()->SetDebugOutputFunction(k_ESteamNetworkingSocketsDebugOutputType_Msg, SteamAPIDebug);
|
||||
#endif
|
||||
stConstants.m_bIsDedicated = CommandLine()->CheckParam("-dedicated");
|
||||
stConstants.LaunchLocalBridge = LaunchLocalBridge;
|
||||
@@ -121,6 +120,15 @@ extern "C" void FunnyMain( int argc, char **argv )
|
||||
Console()->Execute();
|
||||
double fPrevious = Plat_GetTime();
|
||||
for (;;) {
|
||||
|
||||
if (!stConstants.m_bIsDedicated)
|
||||
{
|
||||
if (pWindow->IsValid() == false)
|
||||
{
|
||||
g_pWindowManager->DestroyWindow(pWindow);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef STEAM
|
||||
SteamAPI_RunCallbacks();
|
||||
#endif
|
||||
@@ -149,7 +157,14 @@ extern "C" void FunnyMain( int argc, char **argv )
|
||||
|
||||
|
||||
fCurrent = Plat_GetTime();
|
||||
|
||||
};
|
||||
g_pClientGame->Shutdown();
|
||||
g_pServerGame->Shutdown();
|
||||
g_pRenderContext->Shutdown();
|
||||
|
||||
Console()->Shutdown();
|
||||
#ifdef STEAM
|
||||
SteamAPI_Shutdown();
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
31
engine/kotgui.cpp
Normal file
31
engine/kotgui.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "kotgui/kotgui.h"
|
||||
|
||||
class CKotUIManager: public IKotUIManager
|
||||
{
|
||||
public:
|
||||
virtual void BeginDrawing() = 0;
|
||||
virtual void EndDrawing() = 0;
|
||||
|
||||
virtual IRenderContext *GetContext() = 0;
|
||||
virtual IShader *GetShader( EKotUIShader eShader ) = 0;
|
||||
virtual IRenderCommandList *GetCommandList() = 0;
|
||||
};
|
||||
|
||||
namespace kotgui
|
||||
{
|
||||
void DrawText(
|
||||
Alignment_t position,
|
||||
Alignment_t offset,
|
||||
float fRotation,
|
||||
|
||||
Color4 color,
|
||||
|
||||
uint32_t *pText,
|
||||
uint32_t uSize,
|
||||
IRenderFont *pFont,
|
||||
float fTextSize
|
||||
)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
25
engine/miniaudio.cpp
Normal file
25
engine/miniaudio.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "iaudio.h"
|
||||
#include "miniaudio.h"
|
||||
|
||||
class CAudioPlayer
|
||||
{
|
||||
public:
|
||||
virtual void StartAt( double fTime ) = 0;
|
||||
virtual double GetPlayTime() = 0;
|
||||
virtual double Stop() = 0;
|
||||
virtual void Continue() = 0;
|
||||
};
|
||||
|
||||
class CAudio
|
||||
{
|
||||
public:
|
||||
virtual IAudioPlayer *SpawnPlayer() = 0;
|
||||
};
|
||||
|
||||
class CAudioManager: public IAppSystem
|
||||
{
|
||||
public:
|
||||
virtual void CreateAudio( const char *szFile ) = 0;
|
||||
virtual void SetEarsPosition( Vector v ) = 0;
|
||||
virtual void SetEarsRotation( Quat q ) = 0;
|
||||
};
|
||||
@@ -182,7 +182,20 @@ void CSteamNetworkServer::ClientConnected( SteamNetConnectionStatusChangedCallba
|
||||
callback.m_ullUserConnection = pParam->m_hConn;
|
||||
m_pInterface->SetConnectionPollGroup(pParam->m_hConn, m_hPollGroup);
|
||||
m_hConnections.AppendTail(pParam->m_hConn);
|
||||
|
||||
break;
|
||||
case k_ESteamNetworkingConnectionState_ClosedByPeer:
|
||||
case k_ESteamNetworkingConnectionState_ProblemDetectedLocally:
|
||||
callback.m_eType = NET_DISCONNECTED;
|
||||
callback.m_ullUserID = pParam->m_info.m_identityRemote.GetSteamID64();
|
||||
callback.m_ullUserConnection = pParam->m_hConn;
|
||||
for ( int i = 0; i < m_hConnections.GetSize(); i++ )
|
||||
{
|
||||
m_pInterface->CloseConnection(pParam->m_hConn, 0, "Connection denied", 0);
|
||||
if (m_hConnections[i] != pParam->m_hConn)
|
||||
continue;
|
||||
m_hConnections.RemoveAt(i);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user