sound now works

This commit is contained in:
2026-05-27 01:46:16 +03:00
parent 5fdb17b773
commit 008ce7f5f7
7 changed files with 160 additions and 15 deletions

View File

@@ -70,8 +70,13 @@ void CFunnyGameBridge::Init()
g_pHumanDeviceManager->SetDefaultInput(g_pMainInput);
CreateInterfaceFn fnEngineFactory = Sys_GetFactory("engine");
CreateInterfaceFn fnEngineFactory = GetEngineFactory();
g_pKotUI = (IKotUIManager*)fnEngineFactory(KOT_UI_INTEFACE_VERSION, NULL);
g_pAudioManager = (IAudioManager*)fnEngineFactory(AUDIO_MANAGER_INTERFACE_VERSION, NULL);
g_pAudioManager->Init();
IAudio *pAudio = g_pAudioManager->CreateAudio("game/core/sounds/bonk.wav");
IAudioPlayer *pAudioPlayer = pAudio->SpawnPlayer();
pAudioPlayer->StartAt(0.35);
g_pKotUI->ConnectInterface(g_pRenderContext, RENDER_CONTEXT_INTERFACE_VERSION);
g_pKotUI->Init();

View File

@@ -22,6 +22,7 @@ IPhysics *g_pPhysics;
IPhysicsWorld *g_pPhysicsWorld;
IKotUIManager *g_pKotUI;
IAudioManager *g_pAudioManager;
CreateInterfaceFn GetEngineFactory()
{

View File

@@ -10,6 +10,7 @@
#include "iphysics.h"
#include "ihumandevice.h"
#include "kottui/kottui.h"
#include "iaudio.h"
class CEngineVars
{
@@ -42,6 +43,8 @@ extern IPhysicsWorld *g_pPhysicsWorld;
extern IKotUIManager *g_pKotUI;
extern IAudioManager *g_pAudioManager;
#define FUNNY_SECURE_PORT 27015
#define FUNNY_QUERY_PORT 27016