16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-20 07:59:18 +02:00

use openal-soft extensions to pause sounds and defer updates

This commit is contained in:
milek7
2017-08-25 22:02:31 +02:00
parent 9d91b19841
commit 83c0f4b8e2
4 changed files with 76 additions and 35 deletions

View File

@@ -1108,6 +1108,18 @@ bool TWorld::Update()
Ground.Update_Lights();
{
glm::dmat4 cam_matrix;
Camera.SetMatrix(cam_matrix);
glm::vec3 pos(Camera.Pos.x, Camera.Pos.y, Camera.Pos.z);
glm::vec3 at = glm::vec3(0.0, 0.0, -1.0) * glm::mat3(cam_matrix);
glm::vec3 up = glm::vec3(0.0, 1.0, 0.0) * glm::mat3(cam_matrix);
sound_man->set_listener(pos, at, up);
sound_man->update(dt);
}
// render time routines follow:
dt = Timer::GetDeltaRenderTime(); // nie uwzględnia pauzowania ani mnożenia czasu
@@ -1138,18 +1150,6 @@ bool TWorld::Update()
Update_Camera( dt );
{
glm::dmat4 cam_matrix;
Camera.SetMatrix(cam_matrix);
glm::vec3 pos(Camera.Pos.x, Camera.Pos.y, Camera.Pos.z);
glm::vec3 at = glm::vec3(0.0, 0.0, -1.0) * glm::mat3(cam_matrix);
glm::vec3 up = glm::vec3(0.0, 1.0, 0.0) * glm::mat3(cam_matrix);
sound_man->set_listener(pos, at, up);
sound_man->update(dt);
}
GfxRenderer.Update( dt );
ResourceSweep();