]> git.tdb.fi Git - libs/gl.git/commitdiff
Use default member initializers in async loaders
authorMikko Rasa <tdb@tdb.fi>
Tue, 2 Nov 2021 08:47:31 +0000 (10:47 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 2 Nov 2021 13:11:16 +0000 (15:11 +0200)
source/backends/opengl/texture2d_backend.cpp
source/core/mesh.cpp
source/core/mesh.h

index 2f7e503b7d42a9aec7e8055a38fa2446e5805a0a..9efc4351e65b47e8c6a08dda88d5cb3d344e4565 100644 (file)
@@ -16,11 +16,11 @@ private:
        Texture2D &texture;
        IO::Seekable &io;
        Buffer pixel_buffer;
-       char *mapped_address;
+       char *mapped_address = 0;
        Graphics::Image image;
-       Graphics::ImageLoader *img_loader;
-       unsigned n_bytes;
-       int phase;
+       Graphics::ImageLoader *img_loader = 0;
+       unsigned n_bytes = 0;
+       int phase = 0;
 
 public:
        AsyncLoader(Texture2D &, IO::Seekable &);
@@ -106,9 +106,7 @@ void OpenGLTexture2D::unload()
 OpenGLTexture2D::AsyncLoader::AsyncLoader(Texture2D &t, IO::Seekable &i):
        texture(t),
        io(i),
-       mapped_address(0),
-       img_loader(Graphics::ImageLoader::open_io(io)),
-       phase(0)
+       img_loader(Graphics::ImageLoader::open_io(io))
 { }
 
 OpenGLTexture2D::AsyncLoader::~AsyncLoader()
index e2dd853c448dff6c25259bcb42aa46d6a1433c70..07e5e27f928f41911e3ca376850e3fd4ed081c62 100644 (file)
@@ -285,10 +285,7 @@ void Mesh::Loader::batch(PrimitiveType p)
 
 Mesh::AsyncLoader::AsyncLoader(Mesh &m, IO::Seekable &i):
        mesh(m),
-       io(i),
-       vertex_updater(0),
-       index_updater(0),
-       phase(0)
+       io(i)
 {
        mesh.disallow_rendering = true;
        mesh.check_buffers(VERTEX_BUFFER|INDEX_BUFFER);
index 5544ed1f55e0e5cdf772cf9194d26bc9eabbd775..98a028dbc88ea8f231c039ce97dcc48834e3c347 100644 (file)
@@ -49,9 +49,9 @@ private:
        private:
                Mesh &mesh;
                IO::Seekable &io;
-               Bufferable::AsyncUpdater *vertex_updater;
-               Bufferable::AsyncUpdater *index_updater;
-               unsigned phase;
+               Bufferable::AsyncUpdater *vertex_updater = 0;
+               Bufferable::AsyncUpdater *index_updater = 0;
+               unsigned phase = 0;
 
        public:
                AsyncLoader(Mesh &, IO::Seekable &);