started working on sounds
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
CUtlVector<CUtlString> all_IncludeDirectories = {
|
||||
"public",
|
||||
"external",
|
||||
"external/cglm/include",
|
||||
"external/stb",
|
||||
"external/SDL/include",
|
||||
|
||||
@@ -18,6 +18,9 @@ CUtlVector<CUtlString> engine_CompiledFiles = {
|
||||
"engine/input.cpp",
|
||||
"engine/networking.cpp",
|
||||
|
||||
/* audio */
|
||||
"engine/ma_audio.cpp",
|
||||
|
||||
"engine/mesh.cpp",
|
||||
|
||||
/* entities */
|
||||
|
||||
49
engine/ma_audio.cpp
Normal file
49
engine/ma_audio.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#define MINIAUDIO_IMPLEMENTATION
|
||||
#include "miniaudio.h"
|
||||
#include "audio.h"
|
||||
|
||||
class CMASound
|
||||
{
|
||||
};
|
||||
|
||||
class CMAAudioManager: public IAudioManager
|
||||
{
|
||||
virtual void Init() override;
|
||||
virtual void Frame() override;
|
||||
virtual void Deinit() override;
|
||||
|
||||
virtual ISound *CreateSound() override;
|
||||
virtual I3DSound *Create3DSound() override;
|
||||
};
|
||||
|
||||
DECLARE_ENGINE_INTERFACE(AudioManager, CMAAudioManager)
|
||||
|
||||
ma_engine ma_audioEngine;
|
||||
|
||||
void CMAAudioManager::Init()
|
||||
{
|
||||
ma_result r;
|
||||
r = ma_engine_init(NULL, &ma_audioEngine);
|
||||
}
|
||||
|
||||
void CMAAudioManager::Frame()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CMAAudioManager::Deinit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
ISound *CMAAudioManager::CreateSound()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
I3DSound *CMAAudioManager::Create3DSound()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
4
engine/ma_audio_apple.mm
Normal file
4
engine/ma_audio_apple.mm
Normal file
@@ -0,0 +1,4 @@
|
||||
#define MINIAUDIO_IMPLEMENTATION
|
||||
#include "miniaudio.h"
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ void IServer::Think( float fDelta )
|
||||
for (auto &entity: EntityManager()->m_entities)
|
||||
{
|
||||
entity->Think(fTickrate);
|
||||
entity->SendToServer();
|
||||
}
|
||||
px_frame(px, fTickrate);
|
||||
INetworking::Frame();
|
||||
|
||||
93468
external/miniaudio.h
vendored
Normal file
93468
external/miniaudio.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,6 @@ CUtlString CLDProject::Link( void )
|
||||
szFileName = CUtlString("lib%s.so", m_szName.GetString());
|
||||
break;
|
||||
}
|
||||
V_printf("%s\n",szFileName.GetString());
|
||||
|
||||
CUtlString szTarget = m_target.GetTriplet();
|
||||
CUtlString szOutputFile = CUtlString("%s/%s/ld/%u_%s/%s",FPC_TEMPORAL_DIRNAME, szTarget.GetString(), hash, m_szName.GetString(), szFileName.GetString());
|
||||
|
||||
@@ -3,4 +3,4 @@ bind a +left;
|
||||
bind d +right;
|
||||
bind w +forward;
|
||||
bind s +back;
|
||||
bind o connect 90271429367739416;
|
||||
bind o connect 90271448333504536;
|
||||
|
||||
Binary file not shown.
@@ -261852,7 +261852,19 @@
|
||||
"origin" "10 -50 3"
|
||||
}
|
||||
|
||||
{
|
||||
"classname" "info_player_start"
|
||||
"origin" "10 -51 3"
|
||||
}
|
||||
{
|
||||
"classname" "info_player_start"
|
||||
"origin" "10 -52 3"
|
||||
}
|
||||
{
|
||||
"classname" "info_player_start"
|
||||
"origin" "10 -53 3"
|
||||
}
|
||||
{
|
||||
"classname" "info_player_start"
|
||||
"origin" "10 -54 3"
|
||||
}
|
||||
|
||||
@@ -195,6 +195,7 @@ void CMOBAPlayer::SendToServer()
|
||||
.fYaw = fYaw,
|
||||
};
|
||||
movement.type = PACKET_TYPE_PLAYER_MOVEMENT;
|
||||
|
||||
if (INetworking::IsClient())
|
||||
{
|
||||
if (g_localClient->pBasePlayer != this)
|
||||
@@ -212,7 +213,6 @@ void CMOBAPlayer::SendToServer()
|
||||
INetworking::SendDataEverybodyExcept(&movement, sizeof(PlayerMovement_t), this, MESSAGE_MODE_RELIABLE);
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
void CMOBAPlayer::RecieveFromServer( void *pData, uint32_t nDataSize )
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#include "windows.h"
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#include "dlfcn.h"
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
#include "TargetConditionals.h"
|
||||
#if TARGET_OS_IPHONE
|
||||
|
||||
24
public/audio.h
Normal file
24
public/audio.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef AUDIO_H
|
||||
#define AUDIO_H
|
||||
|
||||
#include "interface.h"
|
||||
#include "tier0/platform.h"
|
||||
|
||||
abstract_class ISound
|
||||
{
|
||||
virtual void SetVolume() = 0;
|
||||
};
|
||||
|
||||
abstract_class I3DSound: public ISound
|
||||
{
|
||||
virtual void SetPosition() = 0;
|
||||
virtual void SetVelocity() = 0;
|
||||
};
|
||||
|
||||
interface IAudioManager: public IInterface
|
||||
{
|
||||
virtual ISound *CreateSound() = 0;
|
||||
virtual I3DSound *Create3DSound() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user