additions
This commit is contained in:
2
.fpccfg
2
.fpccfg
@@ -2,7 +2,7 @@
|
|||||||
sysroot = "/home/kotofyt/Downloads/wasi-sysroot-29.0/"
|
sysroot = "/home/kotofyt/Downloads/wasi-sysroot-29.0/"
|
||||||
|
|
||||||
[aarch64-apple-ios]
|
[aarch64-apple-ios]
|
||||||
sysroot = "/home/kotofyt/clones/yay/xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
|
sysroot = "/home/kotofyt/Downloads/xcode/Xcode_26.1_Apple_silicon/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
|
||||||
|
|
||||||
[x86_64-apple-ios]
|
[x86_64-apple-ios]
|
||||||
sysroot = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
|
sysroot = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
|
||||||
|
|||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -31,9 +31,6 @@
|
|||||||
[submodule "external/funnystdlib"]
|
[submodule "external/funnystdlib"]
|
||||||
path = external/funnystdlib
|
path = external/funnystdlib
|
||||||
url = https://github.com/KoT3isGood/funnystdlib.git
|
url = https://github.com/KoT3isGood/funnystdlib.git
|
||||||
[submodule "external/SPIRV-Tools"]
|
|
||||||
path = external/SPIRV-Tools
|
|
||||||
url = https://github.com/KoT3isGood/SPIRV-Tools.git
|
|
||||||
[submodule "external/SPIRV-Headers"]
|
[submodule "external/SPIRV-Headers"]
|
||||||
path = external/SPIRV-Headers
|
path = external/SPIRV-Headers
|
||||||
url = https://github.com/KhronosGroup/SPIRV-Headers
|
url = https://github.com/KhronosGroup/SPIRV-Headers
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ DECLARE_BUILD_STAGE(install_game)
|
|||||||
if ( GET_PROJECT_VALUE(config, "bundle") == "true" ) {
|
if ( GET_PROJECT_VALUE(config, "bundle") == "true" ) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filesystem2->MakeDirectory(CUtlString("%s/core/",szOutputDir.GetString()));
|
||||||
filesystem2->CopyFile(szOutputDir, GET_PROJECT_OBJECT(launcher, "launcher"));
|
filesystem2->CopyFile(szOutputDir, GET_PROJECT_OBJECT(launcher, "launcher"));
|
||||||
filesystem2->CopyDirectory(CUtlString("%s/core/",szOutputDir.GetString()), "funnyassets/maps");
|
filesystem2->CopyDirectory(CUtlString("%s/core/",szOutputDir.GetString()), "funnyassets/maps");
|
||||||
filesystem2->CopyDirectory(CUtlString("%s/core/",szOutputDir.GetString()), "funnyassets/models");
|
filesystem2->CopyDirectory(CUtlString("%s/core/",szOutputDir.GetString()), "funnyassets/models");
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ DECLARE_BUILD_STAGE(config)
|
|||||||
ADD_OUTPUT_VALUE("bundle", "true");
|
ADD_OUTPUT_VALUE("bundle", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Target_t::DefaultTarget().GetTriplet() == "x86_64-unknown-linux")
|
if (Target_t::DefaultTarget().GetTriplet() == "x86_64-unknown-linux-gnu")
|
||||||
{
|
{
|
||||||
ADD_OUTPUT_VALUE("static", "false");
|
ADD_OUTPUT_VALUE("static", "false");
|
||||||
ADD_OUTPUT_VALUE("bundle", "false");
|
ADD_OUTPUT_VALUE("bundle", "false");
|
||||||
|
|||||||
@@ -26,9 +26,13 @@ DECLARE_BUILD_STAGE(engine)
|
|||||||
|
|
||||||
"sv_dll.cpp",
|
"sv_dll.cpp",
|
||||||
"cl_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");
|
compileProject.files.AppendTail("steamnetwork.cpp");
|
||||||
}
|
}
|
||||||
@@ -39,6 +43,7 @@ DECLARE_BUILD_STAGE(engine)
|
|||||||
"../external/cglm/include",
|
"../external/cglm/include",
|
||||||
FUNNYSTDLIB"public",
|
FUNNYSTDLIB"public",
|
||||||
EXTERNAL"steamworks/public",
|
EXTERNAL"steamworks/public",
|
||||||
|
EXTERNAL
|
||||||
};
|
};
|
||||||
if ( GET_PROJECT_VALUE(config, "steam") == "true" )
|
if ( GET_PROJECT_VALUE(config, "steam") == "true" )
|
||||||
compileProject.macros.AppendTail({"STEAM", "TRUE"});
|
compileProject.macros.AppendTail({"STEAM", "TRUE"});
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ extern "C" void FunnyMain( int argc, char **argv )
|
|||||||
CommandLine()->CreateCommandLine(argc, argv);
|
CommandLine()->CreateCommandLine(argc, argv);
|
||||||
|
|
||||||
EngineConsts_t stConstants = {};
|
EngineConsts_t stConstants = {};
|
||||||
V_printf("------------ 1\n");
|
|
||||||
#ifdef STEAM
|
#ifdef STEAM
|
||||||
V_printf("Steam :)\n");
|
V_printf("Steam :)\n");
|
||||||
if(SteamAPI_RestartAppIfNecessary(480))
|
if(SteamAPI_RestartAppIfNecessary(480))
|
||||||
@@ -74,7 +73,7 @@ extern "C" void FunnyMain( int argc, char **argv )
|
|||||||
stConstants.LaunchServer = LaunchServerAtSteamRelay;
|
stConstants.LaunchServer = LaunchServerAtSteamRelay;
|
||||||
stConstants.ConnectSteamServer = ConnectBySteamID;
|
stConstants.ConnectSteamServer = ConnectBySteamID;
|
||||||
|
|
||||||
//SteamNetworkingUtils()->SetDebugOutputFunction(k_ESteamNetworkingSocketsDebugOutputType_Debug, SteamAPIDebug);
|
SteamNetworkingUtils()->SetDebugOutputFunction(k_ESteamNetworkingSocketsDebugOutputType_Msg, SteamAPIDebug);
|
||||||
#endif
|
#endif
|
||||||
stConstants.m_bIsDedicated = CommandLine()->CheckParam("-dedicated");
|
stConstants.m_bIsDedicated = CommandLine()->CheckParam("-dedicated");
|
||||||
stConstants.LaunchLocalBridge = LaunchLocalBridge;
|
stConstants.LaunchLocalBridge = LaunchLocalBridge;
|
||||||
@@ -121,6 +120,15 @@ extern "C" void FunnyMain( int argc, char **argv )
|
|||||||
Console()->Execute();
|
Console()->Execute();
|
||||||
double fPrevious = Plat_GetTime();
|
double fPrevious = Plat_GetTime();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
||||||
|
if (!stConstants.m_bIsDedicated)
|
||||||
|
{
|
||||||
|
if (pWindow->IsValid() == false)
|
||||||
|
{
|
||||||
|
g_pWindowManager->DestroyWindow(pWindow);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef STEAM
|
#ifdef STEAM
|
||||||
SteamAPI_RunCallbacks();
|
SteamAPI_RunCallbacks();
|
||||||
#endif
|
#endif
|
||||||
@@ -149,7 +157,14 @@ extern "C" void FunnyMain( int argc, char **argv )
|
|||||||
|
|
||||||
|
|
||||||
fCurrent = Plat_GetTime();
|
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;
|
callback.m_ullUserConnection = pParam->m_hConn;
|
||||||
m_pInterface->SetConnectionPollGroup(pParam->m_hConn, m_hPollGroup);
|
m_pInterface->SetConnectionPollGroup(pParam->m_hConn, m_hPollGroup);
|
||||||
m_hConnections.AppendTail(pParam->m_hConn);
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
2
external/GameNetworkingSockets
vendored
2
external/GameNetworkingSockets
vendored
Submodule external/GameNetworkingSockets updated: 725e273c74...f9224c168b
2
external/SDL
vendored
2
external/SDL
vendored
Submodule external/SDL updated: 7c11a8cb9f...ab19d09939
2
external/SPIRV-Headers
vendored
2
external/SPIRV-Headers
vendored
Submodule external/SPIRV-Headers updated: 6dd7ba9908...1f2dd1627a
1
external/SPIRV-Tools
vendored
1
external/SPIRV-Tools
vendored
Submodule external/SPIRV-Tools deleted from 0436c4b055
2
external/Vulkan-Headers
vendored
2
external/Vulkan-Headers
vendored
Submodule external/Vulkan-Headers updated: 2e0a6e699e...8864cdc896
2
external/Vulkan-Utility-Libraries
vendored
2
external/Vulkan-Utility-Libraries
vendored
Submodule external/Vulkan-Utility-Libraries updated: 4f4c0b6c61...d88097b51e
2
external/VulkanMemoryAllocator
vendored
2
external/VulkanMemoryAllocator
vendored
Submodule external/VulkanMemoryAllocator updated: f0969e908b...b3cbbb43ea
2
external/cglm
vendored
2
external/cglm
vendored
Submodule external/cglm updated: a886d6e170...83d5b2c973
2
external/funnystdlib
vendored
2
external/funnystdlib
vendored
Submodule external/funnystdlib updated: 93d3a073df...8ea2e08b24
6976
external/miniaudio.h
vendored
6976
external/miniaudio.h
vendored
File diff suppressed because it is too large
Load Diff
2
external/slang
vendored
2
external/slang
vendored
Submodule external/slang updated: 5d775e2829...ac1b066c55
2
external/stb
vendored
2
external/stb
vendored
Submodule external/stb updated: 802cd454f2...31c1ad3745
2
external/volk
vendored
2
external/volk
vendored
Submodule external/volk updated: d64d20b4ea...3ca312a4f3
2
external/xtool
vendored
2
external/xtool
vendored
Submodule external/xtool updated: 22655f3e70...c65d45ba60
0
funnyassets/shaders/kotgui/box.shader
Normal file
0
funnyassets/shaders/kotgui/box.shader
Normal file
0
funnyassets/shaders/kotgui/text.shader
Normal file
0
funnyassets/shaders/kotgui/text.shader
Normal file
@@ -239,6 +239,15 @@ void CEntitySystem::NetRecvPacket( NetPacket_t *pPacket )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case k_EMessage_EntityDeleted:
|
||||||
|
C_BaseEntity **ppEntities = m_pEntities;
|
||||||
|
for ( int i = 0; i < MAX_EDICTS; i++ )
|
||||||
|
{
|
||||||
|
if (ppEntities[i] == NULL)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,6 +280,29 @@ CBaseEntity **CEntitySystem::GetEntities()
|
|||||||
return m_pEntities;
|
return m_pEntities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CEntitySystem::DestroyEntityByIndex( uint32_t uIndex )
|
||||||
|
{
|
||||||
|
if ( uIndex >= MAX_EDICTS )
|
||||||
|
return;
|
||||||
|
if (m_pEntities[uIndex])
|
||||||
|
{
|
||||||
|
delete m_pEntities[uIndex];
|
||||||
|
m_pEntities[uIndex] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityDelete_t stClassSync = {
|
||||||
|
k_EMessage_EntityDeleted,
|
||||||
|
uIndex,
|
||||||
|
};
|
||||||
|
if (g_pCurrentConnection)
|
||||||
|
g_pCurrentConnection->SendPacket({&stClassSync, sizeof(stClassSync), 0, PACKET_MUST_ARRIVE});
|
||||||
|
}
|
||||||
|
|
||||||
|
void CEntitySystem::DestroyEntityByPtr( CBaseEntity *pEntity )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void CEntitySystem::SetAllowedEntityForPlayer( uint64_t ullPlayer, CBaseEntity *pEntity )
|
void CEntitySystem::SetAllowedEntityForPlayer( uint64_t ullPlayer, CBaseEntity *pEntity )
|
||||||
{
|
{
|
||||||
if (pEntity)
|
if (pEntity)
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ public:
|
|||||||
virtual void Think( float fDelta );
|
virtual void Think( float fDelta );
|
||||||
virtual CBaseEntity **GetEntities();
|
virtual CBaseEntity **GetEntities();
|
||||||
|
|
||||||
|
virtual void DestroyEntityByIndex( uint32_t uIndex );
|
||||||
|
virtual void DestroyEntityByPtr( CBaseEntity *pEntity );
|
||||||
|
|
||||||
virtual void NetRecvPacket( NetPacket_t *pPacket );
|
virtual void NetRecvPacket( NetPacket_t *pPacket );
|
||||||
virtual void NetSendThink( INetworkBase *pBase );
|
virtual void NetSendThink( INetworkBase *pBase );
|
||||||
virtual void SetAllowedEntityForPlayer( uint64_t ullPlayer, CBaseEntity *pEntity );
|
virtual void SetAllowedEntityForPlayer( uint64_t ullPlayer, CBaseEntity *pEntity );
|
||||||
|
|||||||
@@ -79,6 +79,21 @@ uint32_t NET_ServerCallback( NetCallback_t *pCallback )
|
|||||||
g_pCurrentConnection->SendPacket({&stLocalEntity, sizeof(stLocalEntity), pCallback->m_ullUserConnection, PACKET_MUST_ARRIVE});
|
g_pCurrentConnection->SendPacket({&stLocalEntity, sizeof(stLocalEntity), pCallback->m_ullUserConnection, PACKET_MUST_ARRIVE});
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (pCallback->m_eType == NET_DISCONNECTED)
|
||||||
|
{
|
||||||
|
V_printf("user %llu has disconnected, bye!\n", pCallback->m_ullUserID);
|
||||||
|
|
||||||
|
CBaseEntity **ppEntitites = EntitySystem()->GetEntities();
|
||||||
|
for ( int i = 0; i < MAX_EDICTS; i++ )
|
||||||
|
{
|
||||||
|
if (ppEntitites[i] == NULL)
|
||||||
|
continue;
|
||||||
|
if (ppEntitites[i]->m_ullOwner != pCallback->m_ullUserConnection)
|
||||||
|
continue;
|
||||||
|
EntitySystem()->DestroyEntityByIndex(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ EngineConsts_t *g_pEngineConstants;
|
|||||||
IPhysics *g_pPhysics;
|
IPhysics *g_pPhysics;
|
||||||
IPhysicsWorld *g_pPhysicsWorld;
|
IPhysicsWorld *g_pPhysicsWorld;
|
||||||
|
|
||||||
|
IKotUIManager *g_pKotUI;
|
||||||
|
|
||||||
CreateInterfaceFn GetEngineFactory()
|
CreateInterfaceFn GetEngineFactory()
|
||||||
{
|
{
|
||||||
return Sys_GetFactory("engine");
|
return Sys_GetFactory("engine");
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "networkbase.h"
|
#include "networkbase.h"
|
||||||
#include "iphysics.h"
|
#include "iphysics.h"
|
||||||
#include "ihumandevice.h"
|
#include "ihumandevice.h"
|
||||||
|
#include "kotgui/kotgui.h"
|
||||||
|
|
||||||
class CEngineVars
|
class CEngineVars
|
||||||
{
|
{
|
||||||
@@ -39,6 +40,8 @@ extern EngineConsts_t *g_pEngineConstants;
|
|||||||
extern IPhysics *g_pPhysics;
|
extern IPhysics *g_pPhysics;
|
||||||
extern IPhysicsWorld *g_pPhysicsWorld;
|
extern IPhysicsWorld *g_pPhysicsWorld;
|
||||||
|
|
||||||
|
extern IKotUIManager *g_pKotUI;
|
||||||
|
|
||||||
#define FUNNY_SECURE_PORT 27015
|
#define FUNNY_SECURE_PORT 27015
|
||||||
#define FUNNY_QUERY_PORT 27016
|
#define FUNNY_QUERY_PORT 27016
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ enum EMessageType: uint32_t
|
|||||||
|
|
||||||
k_EMessage_PlayerSetLocalEntity,
|
k_EMessage_PlayerSetLocalEntity,
|
||||||
k_EMessage_ResetEntities,
|
k_EMessage_ResetEntities,
|
||||||
|
k_EMessage_EntityDeleted,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PlayerJoined_t
|
struct PlayerJoined_t
|
||||||
@@ -53,6 +54,12 @@ struct EntityClass_t
|
|||||||
int8_t m_szEntityName[256];
|
int8_t m_szEntityName[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct EntityDelete_t
|
||||||
|
{
|
||||||
|
EMessageType m_eType;
|
||||||
|
CNetworkProtocolUInt32 m_uIndex;
|
||||||
|
};
|
||||||
|
|
||||||
struct EntityDataSync_t
|
struct EntityDataSync_t
|
||||||
{
|
{
|
||||||
EMessageType m_eType;
|
EMessageType m_eType;
|
||||||
@@ -81,6 +88,7 @@ union PlayerPacket_t
|
|||||||
EntityClass_t m_entityClass;
|
EntityClass_t m_entityClass;
|
||||||
EntityDataSync_t m_entityData;
|
EntityDataSync_t m_entityData;
|
||||||
SetLocalEntity_t m_setLocalEntity;
|
SetLocalEntity_t m_setLocalEntity;
|
||||||
|
EntityDelete_t m_deleteEntity;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -41,8 +41,6 @@ EngineMainFn pEngineMain;
|
|||||||
extern "C" void FunnyMain( int argc, char **argv );
|
extern "C" void FunnyMain( int argc, char **argv );
|
||||||
|
|
||||||
int main( int argc, char **argv ) {
|
int main( int argc, char **argv ) {
|
||||||
printf("HIIII!\n");
|
|
||||||
return 0;
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
readlink("/proc/self/exe",szLauncherPath, MAX_PATH);
|
readlink("/proc/self/exe",szLauncherPath, MAX_PATH);
|
||||||
dirname(szLauncherPath);
|
dirname(szLauncherPath);
|
||||||
@@ -83,6 +81,7 @@ int main( int argc, char **argv ) {
|
|||||||
|
|
||||||
pEngineMain(argc, argv);
|
pEngineMain(argc, argv);
|
||||||
dlclose(pEngineLib);
|
dlclose(pEngineLib);
|
||||||
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
GetModuleFileNameA(NULL, szLauncherPath, MAX_PATH);
|
GetModuleFileNameA(NULL, szLauncherPath, MAX_PATH);
|
||||||
@@ -102,6 +101,6 @@ int main( int argc, char **argv ) {
|
|||||||
SetCurrentDirectoryA(szLauncherPath);
|
SetCurrentDirectoryA(szLauncherPath);
|
||||||
pEngineMain(argc, argv);
|
pEngineMain(argc, argv);
|
||||||
#endif
|
#endif
|
||||||
FunnyMain(argc, argv);
|
//FunnyMain(argc, argv);
|
||||||
return 0;
|
//return 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ public:
|
|||||||
virtual void *CreateVulkanSurface( void *pInstance ) override;
|
virtual void *CreateVulkanSurface( void *pInstance ) override;
|
||||||
virtual void DestroyVulkanSurface( void *pInstance ) override;
|
virtual void DestroyVulkanSurface( void *pInstance ) override;
|
||||||
|
|
||||||
|
virtual bool IsValid() override;
|
||||||
|
|
||||||
SDL_WindowID WindowID();
|
SDL_WindowID WindowID();
|
||||||
|
|
||||||
KeyCallbackFn m_fnKeyCallback = NULL;
|
KeyCallbackFn m_fnKeyCallback = NULL;
|
||||||
@@ -40,6 +42,8 @@ public:
|
|||||||
uint32_t m_uRenderWidth;
|
uint32_t m_uRenderWidth;
|
||||||
uint32_t m_uRenderHeight;
|
uint32_t m_uRenderHeight;
|
||||||
|
|
||||||
|
bool m_bIsValid = true;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
VkSurfaceKHR m_hSurface;
|
VkSurfaceKHR m_hSurface;
|
||||||
@@ -60,7 +64,7 @@ void CSDLGameWindow::Init()
|
|||||||
|
|
||||||
void CSDLGameWindow::Shutdown()
|
void CSDLGameWindow::Shutdown()
|
||||||
{
|
{
|
||||||
|
SDL_DestroyWindow(m_pWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSDLGameWindow::Frame( float fDelta )
|
void CSDLGameWindow::Frame( float fDelta )
|
||||||
@@ -122,6 +126,11 @@ SDL_WindowID CSDLGameWindow::WindowID()
|
|||||||
return SDL_GetWindowID(m_pWindow);
|
return SDL_GetWindowID(m_pWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CSDLGameWindow::IsValid()
|
||||||
|
{
|
||||||
|
return m_bIsValid;
|
||||||
|
}
|
||||||
|
|
||||||
class CSDLGameWindowManager: public IGameWindowManager
|
class CSDLGameWindowManager: public IGameWindowManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -239,6 +248,8 @@ void CSDLGameWindowManager::Frame( float fDelta )
|
|||||||
pWindow = a;
|
pWindow = a;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (pWindow == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
switch (event.type)
|
switch (event.type)
|
||||||
{
|
{
|
||||||
@@ -267,7 +278,7 @@ void CSDLGameWindowManager::Frame( float fDelta )
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case SDL_EVENT_QUIT:
|
case SDL_EVENT_QUIT:
|
||||||
Plat_Exit(0);
|
pWindow->m_bIsValid = false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -290,6 +301,7 @@ IGameWindow *CSDLGameWindowManager::CreateWindow()
|
|||||||
|
|
||||||
void CSDLGameWindowManager::DestroyWindow( IGameWindow* pWindow )
|
void CSDLGameWindowManager::DestroyWindow( IGameWindow* pWindow )
|
||||||
{
|
{
|
||||||
|
pWindow->Shutdown();
|
||||||
delete (CSDLGameWindow*)pWindow;
|
delete (CSDLGameWindow*)pWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -820,7 +820,7 @@ void CVkRenderContext::Init()
|
|||||||
stAllocatorInfo.device = s_vkDevice;
|
stAllocatorInfo.device = s_vkDevice;
|
||||||
stAllocatorInfo.instance = s_vkInstance;
|
stAllocatorInfo.instance = s_vkInstance;
|
||||||
|
|
||||||
VmaVulkanFunctions vulkanFunctions;
|
VmaVulkanFunctions vulkanFunctions = {};
|
||||||
vmaImportVulkanFunctionsFromVolk(&stAllocatorInfo, &vulkanFunctions);
|
vmaImportVulkanFunctionsFromVolk(&stAllocatorInfo, &vulkanFunctions);
|
||||||
|
|
||||||
stAllocatorInfo.pVulkanFunctions = &vulkanFunctions;
|
stAllocatorInfo.pVulkanFunctions = &vulkanFunctions;
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ case 5300: return 7;
|
|||||||
case 5301: return 7;
|
case 5301: return 7;
|
||||||
case 5302: return 5;
|
case 5302: return 5;
|
||||||
case 5303: return 4;
|
case 5303: return 4;
|
||||||
case 5304: return 4;
|
case 5304: return 5;
|
||||||
case 5305: return 7;
|
case 5305: return 7;
|
||||||
case 5306: return 8;
|
case 5306: return 8;
|
||||||
case 5307: return 3;
|
case 5307: return 3;
|
||||||
@@ -812,7 +812,7 @@ case 6086: return 2;
|
|||||||
case 6090: return 1;
|
case 6090: return 1;
|
||||||
case 6091: return 1;
|
case 6091: return 1;
|
||||||
case 6092: return 1;
|
case 6092: return 1;
|
||||||
case 6096: return 3;
|
case 6096: return 1;
|
||||||
case 6116: return 3;
|
case 6116: return 3;
|
||||||
case 6117: return 3;
|
case 6117: return 3;
|
||||||
case 6142: return 3;
|
case 6142: return 3;
|
||||||
@@ -839,6 +839,8 @@ case 6251: return 4;
|
|||||||
case 6252: return 6;
|
case 6252: return 6;
|
||||||
case 6253: return 3;
|
case 6253: return 3;
|
||||||
case 6254: return 3;
|
case 6254: return 3;
|
||||||
|
case 6258: return 6;
|
||||||
|
case 6259: return 4;
|
||||||
case 6401: return 5;
|
case 6401: return 5;
|
||||||
case 6402: return 5;
|
case 6402: return 5;
|
||||||
case 6403: return 5;
|
case 6403: return 5;
|
||||||
@@ -3656,6 +3658,7 @@ pTypes[0] = k_ESpirv_RefId;
|
|||||||
pTypes[1] = k_ESpirv_RefId;
|
pTypes[1] = k_ESpirv_RefId;
|
||||||
pTypes[2] = k_ESpirv_RefId;
|
pTypes[2] = k_ESpirv_RefId;
|
||||||
pTypes[3] = k_ESpirv_RefId;
|
pTypes[3] = k_ESpirv_RefId;
|
||||||
|
pTypes[4] = k_ESpirv_RefId;
|
||||||
break;
|
break;
|
||||||
case 5305:
|
case 5305:
|
||||||
pTypes[0] = k_ESpirv_RefId;
|
pTypes[0] = k_ESpirv_RefId;
|
||||||
@@ -5531,9 +5534,7 @@ case 6092:
|
|||||||
pTypes[0] = k_ESpirv_RefId;
|
pTypes[0] = k_ESpirv_RefId;
|
||||||
break;
|
break;
|
||||||
case 6096:
|
case 6096:
|
||||||
pTypes[0] = k_ESpirv_ResultTypeId;
|
pTypes[0] = k_ESpirv_RefId;
|
||||||
pTypes[1] = k_ESpirv_ResultId;
|
|
||||||
pTypes[2] = k_ESpirv_RefId;
|
|
||||||
break;
|
break;
|
||||||
case 6116:
|
case 6116:
|
||||||
pTypes[0] = k_ESpirv_ResultTypeId;
|
pTypes[0] = k_ESpirv_ResultTypeId;
|
||||||
@@ -5693,6 +5694,18 @@ pTypes[0] = k_ESpirv_ResultTypeId;
|
|||||||
pTypes[1] = k_ESpirv_ResultId;
|
pTypes[1] = k_ESpirv_ResultId;
|
||||||
pTypes[2] = k_ESpirv_RefId;
|
pTypes[2] = k_ESpirv_RefId;
|
||||||
break;
|
break;
|
||||||
|
case 6258:
|
||||||
|
pTypes[0] = k_ESpirv_ResultTypeId;
|
||||||
|
pTypes[1] = k_ESpirv_ResultId;
|
||||||
|
pTypes[2] = k_ESpirv_RefId;
|
||||||
|
pTypes[3] = k_ESpirv_RefId;
|
||||||
|
pTypes[4] = k_ESpirv_RefId;
|
||||||
|
break;
|
||||||
|
case 6259:
|
||||||
|
pTypes[0] = k_ESpirv_RefId;
|
||||||
|
pTypes[1] = k_ESpirv_RefId;
|
||||||
|
pTypes[2] = k_ESpirv_RefId;
|
||||||
|
break;
|
||||||
case 6401:
|
case 6401:
|
||||||
pTypes[0] = k_ESpirv_ResultTypeId;
|
pTypes[0] = k_ESpirv_ResultTypeId;
|
||||||
pTypes[1] = k_ESpirv_ResultId;
|
pTypes[1] = k_ESpirv_ResultId;
|
||||||
@@ -8395,12 +8408,12 @@ break;
|
|||||||
case 5147:
|
case 5147:
|
||||||
pTypes[0] = k_ESpirvOperandFlags_None;
|
pTypes[0] = k_ESpirvOperandFlags_None;
|
||||||
pTypes[1] = k_ESpirvOperandFlags_None;
|
pTypes[1] = k_ESpirvOperandFlags_None;
|
||||||
pTypes[2] = k_ESpirvOperandFlags_None;
|
pTypes[2] = k_ESpirvOperandFlags_Array;
|
||||||
break;
|
break;
|
||||||
case 5148:
|
case 5148:
|
||||||
pTypes[0] = k_ESpirvOperandFlags_None;
|
pTypes[0] = k_ESpirvOperandFlags_None;
|
||||||
pTypes[1] = k_ESpirvOperandFlags_None;
|
pTypes[1] = k_ESpirvOperandFlags_None;
|
||||||
pTypes[2] = k_ESpirvOperandFlags_None;
|
pTypes[2] = k_ESpirvOperandFlags_Array;
|
||||||
break;
|
break;
|
||||||
case 5158:
|
case 5158:
|
||||||
pTypes[0] = k_ESpirvOperandFlags_None;
|
pTypes[0] = k_ESpirvOperandFlags_None;
|
||||||
@@ -8756,6 +8769,7 @@ pTypes[0] = k_ESpirvOperandFlags_None;
|
|||||||
pTypes[1] = k_ESpirvOperandFlags_None;
|
pTypes[1] = k_ESpirvOperandFlags_None;
|
||||||
pTypes[2] = k_ESpirvOperandFlags_None;
|
pTypes[2] = k_ESpirvOperandFlags_None;
|
||||||
pTypes[3] = k_ESpirvOperandFlags_None;
|
pTypes[3] = k_ESpirvOperandFlags_None;
|
||||||
|
pTypes[4] = k_ESpirvOperandFlags_Optional;
|
||||||
break;
|
break;
|
||||||
case 5305:
|
case 5305:
|
||||||
pTypes[0] = k_ESpirvOperandFlags_None;
|
pTypes[0] = k_ESpirvOperandFlags_None;
|
||||||
@@ -10902,9 +10916,7 @@ case 6092:
|
|||||||
pTypes[0] = k_ESpirvOperandFlags_Array;
|
pTypes[0] = k_ESpirvOperandFlags_Array;
|
||||||
break;
|
break;
|
||||||
case 6096:
|
case 6096:
|
||||||
pTypes[0] = k_ESpirvOperandFlags_None;
|
pTypes[0] = k_ESpirvOperandFlags_Array;
|
||||||
pTypes[1] = k_ESpirvOperandFlags_None;
|
|
||||||
pTypes[2] = k_ESpirvOperandFlags_Array;
|
|
||||||
break;
|
break;
|
||||||
case 6116:
|
case 6116:
|
||||||
pTypes[0] = k_ESpirvOperandFlags_None;
|
pTypes[0] = k_ESpirvOperandFlags_None;
|
||||||
@@ -11081,6 +11093,20 @@ pTypes[0] = k_ESpirvOperandFlags_None;
|
|||||||
pTypes[1] = k_ESpirvOperandFlags_None;
|
pTypes[1] = k_ESpirvOperandFlags_None;
|
||||||
pTypes[2] = k_ESpirvOperandFlags_Array;
|
pTypes[2] = k_ESpirvOperandFlags_Array;
|
||||||
break;
|
break;
|
||||||
|
case 6258:
|
||||||
|
pTypes[0] = k_ESpirvOperandFlags_None;
|
||||||
|
pTypes[1] = k_ESpirvOperandFlags_None;
|
||||||
|
pTypes[2] = k_ESpirvOperandFlags_None;
|
||||||
|
pTypes[3] = k_ESpirvOperandFlags_None;
|
||||||
|
pTypes[4] = k_ESpirvOperandFlags_None;
|
||||||
|
pTypes[5] = k_ESpirvOperandFlags_Optional;
|
||||||
|
break;
|
||||||
|
case 6259:
|
||||||
|
pTypes[0] = k_ESpirvOperandFlags_None;
|
||||||
|
pTypes[1] = k_ESpirvOperandFlags_None;
|
||||||
|
pTypes[2] = k_ESpirvOperandFlags_None;
|
||||||
|
pTypes[3] = k_ESpirvOperandFlags_Optional;
|
||||||
|
break;
|
||||||
case 6401:
|
case 6401:
|
||||||
pTypes[0] = k_ESpirvOperandFlags_None;
|
pTypes[0] = k_ESpirvOperandFlags_None;
|
||||||
pTypes[1] = k_ESpirvOperandFlags_None;
|
pTypes[1] = k_ESpirvOperandFlags_None;
|
||||||
|
|||||||
31
public/iaudio.h
Normal file
31
public/iaudio.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#ifndef IAUDIO_H
|
||||||
|
#define IAUDIO_H
|
||||||
|
|
||||||
|
#include "tier1/interface.h"
|
||||||
|
#include "tier2/iappsystem.h"
|
||||||
|
#include "trig.h"
|
||||||
|
|
||||||
|
abstract_class IAudioPlayer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void StartAt( double fTime ) = 0;
|
||||||
|
virtual double GetPlayTime() = 0;
|
||||||
|
virtual double Stop() = 0;
|
||||||
|
virtual void Continue() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
abstract_class IAudio
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual IAudioPlayer *SpawnPlayer() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
abstract_class IAudioManager: public IAppSystem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void CreateAudio( const char *szFile ) = 0;
|
||||||
|
virtual void SetEarsPosition( Vector v ) = 0;
|
||||||
|
virtual void SetEarsRotation( Quat q ) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
72
public/kotgui/kotgui.h
Normal file
72
public/kotgui/kotgui.h
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
#ifndef KOTGUI_H
|
||||||
|
#define KOTGUI_H
|
||||||
|
|
||||||
|
#include "../materialsystem/imaterialsystem.h"
|
||||||
|
#include "../materialsystem/igamewindow.h"
|
||||||
|
#include "tier2/iappsystem.h"
|
||||||
|
|
||||||
|
abstract_class IRenderFont
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual IImage *GetAtlas();
|
||||||
|
virtual bool IsLetterPresent( uint32_t letter );
|
||||||
|
virtual float GetLetterX( uint32_t letter );
|
||||||
|
virtual float GetLetterY( uint32_t letter );
|
||||||
|
virtual float GetWidthX( uint32_t letter );
|
||||||
|
virtual float GetWidthY( uint32_t letter );
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Alignment_t
|
||||||
|
{
|
||||||
|
int iX;
|
||||||
|
int iY;
|
||||||
|
float fX;
|
||||||
|
float fY;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Color3
|
||||||
|
{
|
||||||
|
float R;
|
||||||
|
float G;
|
||||||
|
float B;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Color4
|
||||||
|
{
|
||||||
|
float R;
|
||||||
|
float G;
|
||||||
|
float B;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
enum EKotUIShader
|
||||||
|
{
|
||||||
|
k_eKotGUI_Text,
|
||||||
|
k_eKotGUI_Widget,
|
||||||
|
};
|
||||||
|
|
||||||
|
abstract_class IKotUIManager: public IAppSystem2
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void BeginDrawing() = 0;
|
||||||
|
virtual void EndDrawing() = 0;
|
||||||
|
|
||||||
|
|
||||||
|
virtual void DrawText(
|
||||||
|
Alignment_t position,
|
||||||
|
Alignment_t offset,
|
||||||
|
float fRotation,
|
||||||
|
|
||||||
|
Color4 color,
|
||||||
|
|
||||||
|
uint32_t *pText,
|
||||||
|
uint32_t uSize,
|
||||||
|
IRenderFont *pFont,
|
||||||
|
float fTextSize
|
||||||
|
) = 0;
|
||||||
|
};
|
||||||
|
IKotUIManager *KotUIManager();
|
||||||
|
|
||||||
|
#define KOT_UI_INTEFACE_VERSION "KotUI001"
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "tier0/platform.h"
|
#include "tier0/platform.h"
|
||||||
#include "tier2/iappsystem.h"
|
#include "tier2/iappsystem.h"
|
||||||
#include "materialsystem/humandevice_enums.h"
|
#include "humandevice_enums.h"
|
||||||
|
|
||||||
typedef void ( *KeyCallbackFn )( EInputDeviceType eDevice, EInputButton eButton, bool bIsPressed );
|
typedef void ( *KeyCallbackFn )( EInputDeviceType eDevice, EInputButton eButton, bool bIsPressed );
|
||||||
typedef void ( *AxisCallbackFn )( EInputDeviceType eDevice, EInputAxis eAxis, float fd );
|
typedef void ( *AxisCallbackFn )( EInputDeviceType eDevice, EInputAxis eAxis, float fd );
|
||||||
@@ -26,6 +26,8 @@ public:
|
|||||||
|
|
||||||
virtual void *CreateVulkanSurface( void *pInstance ) = 0;
|
virtual void *CreateVulkanSurface( void *pInstance ) = 0;
|
||||||
virtual void DestroyVulkanSurface( void *pInstance ) = 0;
|
virtual void DestroyVulkanSurface( void *pInstance ) = 0;
|
||||||
|
|
||||||
|
virtual bool IsValid() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
abstract_class IGameWindowManager: public IAppSystem
|
abstract_class IGameWindowManager: public IAppSystem
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user