entt update to v3.11.1

This commit is contained in:
2022-11-11 16:22:58 +01:00
committed by Erik Scholz
parent 8036fdf2a9
commit 8d24976a13
14 changed files with 26 additions and 35 deletions

View File

@ -117,7 +117,7 @@ void BatchedSpriteSheet::render(Services::OpenGLRenderer& rs, Engine& engine) {
_vertexBuffer->bind(GL_ARRAY_BUFFER);
_vao->bind();
auto& cam = scene.ctx().at<Camera3D>();
auto& cam = scene.ctx().get<Camera3D>();
auto vp = cam.getViewProjection();
_shader->setUniformMat4f("_VP", vp);

View File

@ -78,7 +78,7 @@ void FastSky::render(MM::Services::OpenGLRenderer& rs, MM::Engine& engine) {
_vao->bind();
{
auto& cam = scene.ctx().at<MM::OpenGL::Camera3D>();
auto& cam = scene.ctx().get<MM::OpenGL::Camera3D>();
MM::OpenGL::Camera3D tmp_cam = cam;
// create cam with y up, bc shader says so
tmp_cam.up = {0, 1, 0};
@ -95,7 +95,7 @@ void FastSky::render(MM::Services::OpenGLRenderer& rs, MM::Engine& engine) {
//}
auto* ctx_ptr = &_default_context;
if (scene.ctx().contains<FastSkyContext>()) {
ctx_ptr = &scene.ctx().at<FastSkyContext>();
ctx_ptr = &scene.ctx().get<FastSkyContext>();
}
_shader->setUniform1f("time", ctx_ptr->time);

View File

@ -138,7 +138,7 @@ void LiteParticles2D::uploadParticles(Services::OpenGLRenderer&, Scene& scene) {
return; // nothing to upload
}
auto& queue = scene.ctx().at<Components::LiteParticles2DUploadQueue>();
auto& queue = scene.ctx().get<Components::LiteParticles2DUploadQueue>();
while (!queue.queue.empty()) {
// get range
@ -200,7 +200,7 @@ void LiteParticles2D::computeParticles(Services::OpenGLRenderer&, Scene& scene)
std::chrono::duration<double, std::ratio<1, 1>> deltaTime = newNow - _last_time;
_last_time = newNow;
float time_delta = deltaTime.count() * scene.ctx().at<MM::Components::TimeDelta>().deltaFactor;
float time_delta = deltaTime.count() * scene.ctx().get<MM::Components::TimeDelta>().deltaFactor;
_time += time_delta;
_tf_shader->setUniform1f("_time_delta", time_delta);
_tf_shader->setUniform1f("_time", _time);
@ -269,7 +269,7 @@ void LiteParticles2D::renderParticles(Services::OpenGLRenderer& rs, Scene& scene
auto& rm_t = MM::ResourceManager<Texture>::ref();
rm_t.get("MM::LiteParticles2DTypes::Render"_hs)->bind(0);
Camera3D& cam = scene.ctx().at<Camera3D>();
Camera3D& cam = scene.ctx().get<Camera3D>();
_points_shader->setUniformMat4f("_vp", cam.getViewProjection());
GLint view_port[4];

View File

@ -72,7 +72,7 @@ void SimpleRect::render(Services::OpenGLRenderer& rs, Engine& engine) {
_shader->bind();
_vao->bind();
Camera3D& cam = scene.ctx().at<Camera3D>();
Camera3D& cam = scene.ctx().get<Camera3D>();
auto vp = cam.getViewProjection();
scene.view<const Components::Transform4x4>().each([this, &scene, &vp](entt::entity e, const auto& t) {

View File

@ -80,7 +80,7 @@ void SimpleSprite::render(Services::OpenGLRenderer& rs, Engine& engine) {
_vao->bind();
Camera3D& cam = scene.ctx().at<Camera3D>();
Camera3D& cam = scene.ctx().get<Camera3D>();
auto vp = cam.getViewProjection();
scene.view<const Components::Transform4x4, Components::OpenGL::Texture>().each([this, &scene, &vp](entt::entity e, const auto& t, auto& tex) {

View File

@ -81,7 +81,7 @@ void SimpleSpriteSheet::render(Services::OpenGLRenderer& rs, Engine& engine) {
_vertexBuffer->bind(GL_ARRAY_BUFFER);
_vao->bind();
Camera3D& cam = scene.ctx().at<Camera3D>();
Camera3D& cam = scene.ctx().get<Camera3D>();
auto vp = cam.getViewProjection();
scene.view<const Components::Transform4x4, SpriteSheetRenderable>().each([this, &scene, &vp](entt::entity e, const auto& t, auto& spr) {

View File

@ -96,7 +96,7 @@ void Tilemap::render(MM::Services::OpenGLRenderer& rs, MM::Engine& engine) {
_vertexBuffer->bind(GL_ARRAY_BUFFER);
_vao->bind();
MM::OpenGL::Camera3D& cam = scene.ctx().at<MM::OpenGL::Camera3D>();
MM::OpenGL::Camera3D& cam = scene.ctx().get<MM::OpenGL::Camera3D>();
auto vp = cam.getViewProjection();
_shader->setUniform3f("_ambient_color", ambient_color);