]> git.tdb.fi Git - libs/gl.git/commitdiff
Add more default member initializers
authorMikko Rasa <tdb@tdb.fi>
Sun, 10 Dec 2023 13:18:19 +0000 (15:18 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 10 Dec 2023 22:29:04 +0000 (00:29 +0200)
Some inner classes in particular were missed in the earlier pass.

40 files changed:
source/animation/animation.cpp
source/animation/animation.h
source/animation/animationplayer.cpp
source/animation/animationplayer.h
source/animation/armature.cpp
source/animation/armature.h
source/backends/opengl/batch_backend.h
source/backends/opengl/extension.cpp
source/backends/opengl/extension.h
source/builders/meshbuilder.cpp
source/builders/meshbuilder.h
source/builders/primitivebuilder.cpp
source/builders/primitivebuilder.h
source/core/batch.cpp
source/core/batch.h
source/core/buffer.cpp
source/core/query.cpp
source/core/query.h
source/core/texture.cpp
source/core/texture.h
source/effects/sky.cpp
source/effects/sky.h
source/glsl/modulecache.cpp
source/glsl/modulecache.h
source/glsl/parser.cpp
source/glsl/parser.h
source/glsl/spirv.cpp
source/glsl/spirv.h
source/glsl/spirvwriter.cpp
source/glsl/spirvwriter.h
source/materials/programdata.cpp
source/materials/programdata.h
source/render/sequence.cpp
source/render/sequence.h
source/resources/resourcemanager.cpp
source/resources/resourcemanager.h
source/resources/resources.cpp
source/resources/resources.h
tools/glslcompiler.cpp
tools/viewer.cpp

index 1de1ff4eea07e668574195793d298aea428c4f2f..a733e7c1eaed3b4a1e0d79b67776b7c517f61a0d 100644 (file)
@@ -423,10 +423,8 @@ Animation::UniformInfo::UniformInfo(const string &n, unsigned s):
 
 Animation::Iterator::Iterator(const Animation &a):
        animation(&a),
-       event_iter(animation->events.begin()),
-       end(false)
-{
-}
+       event_iter(animation->events.begin())
+{ }
 
 Animation::Iterator &Animation::Iterator::operator+=(const Time::TimeDelta &t)
 {
@@ -495,10 +493,7 @@ Animation::Loader::Loader(Animation &a, Collection &c):
 { }
 
 Animation::Loader::Loader(Animation &a, Collection *c):
-       DataFile::CollectionObjectLoader<Animation>(a, c),
-       start_slope(1),
-       end_slope(1),
-       slopes_set(0)
+       DataFile::CollectionObjectLoader<Animation>(a, c)
 {
        add("armature", &Animation::armature);
        add("control_keyframe", &Loader::control_keyframe);
index 997d0d936b59fc6b07a295eea88663d797e7a4d1..8be5ff61d46cdb55c45c87fe3fd49fab42baca58 100644 (file)
@@ -27,9 +27,9 @@ public:
        {
        private:
                Time::TimeDelta current_time;
-               float start_slope;
-               float end_slope;
-               int slopes_set;
+               float start_slope = 1.0f;
+               float end_slope = 1.0f;
+               int slopes_set = 0;
 
        public:
                Loader(Animation &);
@@ -146,10 +146,10 @@ public:
        class MSPGL_API Iterator
        {
        private:
-               const Animation *animation;
+               const Animation *animation = nullptr;
                Time::TimeDelta elapsed;
                std::vector<Event>::const_iterator event_iter;
-               bool end;
+               bool end = false;
 
        public:
                Iterator(const Animation &);
index 6da93d1c99e1f6e51c8c28080b403a001dafec16..de42364abf40b881518fe30e6fbacb3c6e139f6d 100644 (file)
@@ -221,10 +221,7 @@ AnimationPlayer::PlayingAnimation::PlayingAnimation(const Animation &a, float s)
 
 
 AnimationPlayer::Target::Target(Placeable &p):
-       placeable(p),
-       object(nullptr),
-       armature(nullptr),
-       stacked(false)
+       placeable(p)
 { }
 
 void AnimationPlayer::Target::animation_event(Placeable *, const string &name, const Variant &value)
index eccd8bd3dc43e2c3fdc7d784fa95d330c561d56a..7b8fd7ffb610804758f3f9a4cb73dac516d45201 100644 (file)
@@ -21,8 +21,8 @@ class MSPGL_API AnimationPlayer
 private:
        struct PlayingAnimation
        {
-               const Animation *animation;
-               float speed;
+               const Animation *animation = nullptr;
+               float speed = 1.0f;
                Animation::Iterator iterator;
 
                PlayingAnimation(const Animation &, float);
@@ -31,11 +31,11 @@ private:
        struct Target: AnimationEventObserver
        {
                Placeable &placeable;
-               AnimatedObject *object;
+               AnimatedObject *object = nullptr;
                Matrix base_matrix;
-               const Armature *armature;
+               const Armature *armature = nullptr;
                std::vector<PlayingAnimation> animations;
-               bool stacked;
+               bool stacked = false;
                std::vector<AnimationEventObserver *> event_observers;
 
                Target(Placeable &);
index 64e9dc441cc1ef9c73abc86fb19ae2a509b4f112..5fb3403ab8d6b72312f6bef1e283f91fb45a7457 100644 (file)
@@ -39,8 +39,7 @@ unsigned Armature::get_max_link_index() const
 
 Armature::Link::Link(const string &n, unsigned i):
        name(n),
-       index(i),
-       parent(nullptr)
+       index(i)
 { }
 
 void Armature::Link::set_parent(const Link *p)
index 9476812ff5175ffccd8d9f1ed1253dfc5f9daa9e..262a2fb10a524e0b5a74474f9cb3e427e8a54ade 100644 (file)
@@ -39,8 +39,8 @@ public:
 
        private:
                std::string name;
-               unsigned index;
-               const Link *parent;
+               unsigned index = 0;
+               const Link *parent = nullptr;
                Vector3 base;
 
        public:
index 183db91ced92aa1958aacd863b7058135a08e8f8..ed882577c55f674f3a00577ab8f0b253654dcefa 100644 (file)
@@ -13,8 +13,8 @@ class MSPGL_API OpenGLBatch
        friend class OpenGLCommands;
 
 protected:
-       unsigned gl_prim_type;
-       unsigned gl_index_type;
+       unsigned gl_prim_type = 0;
+       unsigned gl_index_type = 0;
 
        OpenGLBatch(PrimitiveType);
 
index a650b65021707c78211b4c96eae72e3392cea46b..c14f4cfc2f0892bae39876e17221b8b3c20b5358 100644 (file)
@@ -36,9 +36,7 @@ namespace GL {
 
 Extension::Extension(const char *n, InitFunc f):
        name(n),
-       init_func(f),
-       init_done(false),
-       support(UNSUPPORTED)
+       init_func(f)
 { }
 
 Extension::operator bool() const
index 27dae6fcd6c8a95d5cccc3a22cc4784d39158d58..f1edec3e2656de78b53f20b878ab92a9324dee03 100644 (file)
@@ -31,10 +31,10 @@ public:
        typedef SupportLevel (*InitFunc)();
 
 private:
-       const char *name;
-       InitFunc init_func;
-       mutable bool init_done;
-       mutable SupportLevel support;
+       const char *name = nullptr;
+       InitFunc init_func = nullptr;
+       mutable bool init_done = false;
+       mutable SupportLevel support = UNSUPPORTED;
 
 public:
        Extension(const char *, InitFunc);
index 395827a43e375ff52726402755fa405dc12b615a..a8a4711755388255fe7ead8f35d558959f012d9e 100644 (file)
@@ -8,8 +8,7 @@ namespace GL {
 
 MeshBuilder::MeshBuilder(Mesh &m):
        PrimitiveBuilder(m.vertices),
-       mesh(m),
-       batch(nullptr)
+       mesh(m)
 { }
 
 MeshBuilder::~MeshBuilder()
index ff52ee684692afbb9dd8f7a23f4b1226ed968711..082db7744b1215850eed45c9f1038226fae0f27b 100644 (file)
@@ -14,7 +14,7 @@ class MSPGL_API MeshBuilder: public PrimitiveBuilder
 {
 private:
        Mesh &mesh;
-       Batch *batch;
+       Batch *batch = nullptr;
 
 public:
        MeshBuilder(Mesh &);
index 85c695c3cea402735d3c8501d297f844bb7f14e8..9c08eb82b55d01515185b4e855ff48355726bd21 100644 (file)
@@ -8,9 +8,7 @@ namespace GL {
 
 PrimitiveBuilder::PrimitiveBuilder(VertexArray &a):
        array(a),
-       vab(array),
-       in_batch(false),
-       offs(0)
+       vab(array)
 { }
 
 void PrimitiveBuilder::begin(PrimitiveType t)
index 74987cfce7c5e5d3b0682efc6097a2e69a67d923..83eb98d7978ced0c99ffcb34d4c51cac79101784 100644 (file)
@@ -23,8 +23,8 @@ protected:
        VertexArray &array;
        VertexArrayBuilder vab;
        PrimitiveType type;
-       bool in_batch;
-       unsigned offs;
+       bool in_batch = false;
+       unsigned offs = 0;
 
        PrimitiveBuilder(VertexArray &);
 public:
index 56c25efb592e990e7438eae5932c53b4b9af7b72..6089b4630b1b1a2b8f8d34bfc4f131f8d65b95a7 100644 (file)
@@ -46,8 +46,7 @@ namespace GL {
 
 Batch::Batch(PrimitiveType t):
        BatchBackend(t),
-       prim_type(t),
-       index_type(VOID)
+       prim_type(t)
 {
        set_index_type(UNSIGNED_SHORT);
 }
index 0bd176d0928652a413d7cb0371680b456204f1fd..fec3998ca6a7ca6d2f20ae9b9cb23a037789d2e3 100644 (file)
@@ -34,8 +34,8 @@ public:
        };
 
 private:
-       PrimitiveType prim_type;
-       DataType index_type;
+       PrimitiveType prim_type = POINTS;
+       DataType index_type = VOID;
        std::vector<std::uint8_t> data;
        unsigned max_index = 0;
        unsigned patch_size = 3;
index ae72f78cc931c7e19d3c05157b3cf87a5d2850f0..f076032bb173fe63e8b16bca7ec814d477089656 100644 (file)
@@ -78,8 +78,7 @@ bool Buffer::unmap()
 Buffer::AsyncTransfer::AsyncTransfer(Buffer &b, size_t o, size_t s):
        buffer(&b),
        offset(o),
-       size(s),
-       dest_addr(nullptr)
+       size(s)
 {
        allocate();
 }
index 13b62801133f29636511b9fe1e55c74d628bfa11..667f146560f556ab68b04677f872315dc24f1a84 100644 (file)
@@ -6,8 +6,7 @@ namespace GL {
 
 QueryPool::QueryPool(QueryType t, unsigned s):
        QueryPoolBackend(t),
-       type(t),
-       size(0)
+       type(t)
 {
        resize(s);
 }
index 0485761b338f8e7ee2491a988f46ebe4e23aa59f..13e1a7db309eeafe5074aa76df2efc5915be6b65 100644 (file)
@@ -38,7 +38,7 @@ public:
 
 private:
        QueryType type;
-       unsigned size;
+       unsigned size = 0;
 
 public:
        QueryPool(QueryType type, unsigned);
index 407333e1fd780b83b27d2ab30c9964eed4b9df6c..3c5e58aa3e208eb16e3d534ad9a8cd3f3d136761 100644 (file)
@@ -102,8 +102,7 @@ Texture::GenericLoader::TypeRegistry &Texture::get_texture_registry()
 
 
 Texture::Loader::Loader(Texture &t, Collection *c):
-       CollectionObjectLoader<Texture>(t, c),
-       levels(0)
+       CollectionObjectLoader<Texture>(t, c)
 {
        add("external_data", &Loader::external_data);
        add("external_image", &Loader::external_image, false);
index 777845b24cc8e2aa23f695c3c4b93124fbc5eff9..c567f4cc6248184539916dc92b1010d6ad9a6415 100644 (file)
@@ -35,7 +35,7 @@ protected:
        class MSPGL_API Loader: public DataFile::CollectionObjectLoader<Texture>
        {
        protected:
-               unsigned levels;
+               unsigned levels = 0;
 
        public:
                Loader(Texture &t): Loader(t, nullptr) { }
index 94ca90fe006aa16c04982f0aa96b8a82fdcf3554..1d1699db008ee691b5dc423842940456cd509d9a 100644 (file)
@@ -165,20 +165,6 @@ void Sky::set_debug_name(const string &name)
 }
 
 
-Sky::Planet::Planet():
-       rayleigh_scatter(0.0f),
-       mie_scatter(0.0f),
-       mie_absorb(0.0f),
-       ozone_absorb(0.0f),
-       rayleigh_density_decay(1e3f),
-       mie_density_decay(1e3f),
-       ozone_band_center(1e4f),
-       ozone_band_extent(1e2f),
-       atmosphere_thickness(2e4f),
-       planet_radius(1e6f),
-       ground_albedo(0.2f)
-{ }
-
 Sky::Planet Sky::Planet::earth()
 {
        Planet planet;
index 043ce74c6b0b95e70b7aa1063224d1db10cf3af9..9819e4f82bc98ea86c3dfd83b49679b633250a74 100644 (file)
@@ -29,19 +29,17 @@ class MSPGL_API Sky: public Effect
 public:
        struct MSPGL_API Planet
        {
-               Color rayleigh_scatter;
-               Color mie_scatter;
-               Color mie_absorb;
-               Color ozone_absorb;
-               float rayleigh_density_decay;
-               float mie_density_decay;
-               float ozone_band_center;
-               float ozone_band_extent;
-               float atmosphere_thickness;
-               float planet_radius;
-               Color ground_albedo;
-
-               Planet();
+               Color rayleigh_scatter = { 0.0f };
+               Color mie_scatter = { 0.0f };
+               Color mie_absorb = { 0.0f };
+               Color ozone_absorb = { 0.0f };
+               float rayleigh_density_decay = 1e3f;
+               float mie_density_decay = 1e3f;
+               float ozone_band_center = 1e4f;
+               float ozone_band_extent = 1e2f;
+               float atmosphere_thickness = 2e4f;
+               float planet_radius = 1e6f;
+               Color ground_albedo = { 0.2f };
 
                static Planet earth();
        };
index a0686902a8b1183d80f85835515bf7c496dd4bb8..ef864dc028a64dc96ad412c67bc44dba41c0d28a 100644 (file)
@@ -10,8 +10,7 @@ namespace GL {
 namespace SL {
 
 ModuleCache::ModuleCache(DataFile::Collection *r):
-       resources(r),
-       next_source(1)
+       resources(r)
 { }
 
 ModuleCache::ModuleCache(const ModuleCache &other)
index ba892f93ec9ca0c2ec563ec7e6090bb6b70d17fb..91f6a5e55d07878847d74326c5d7843b3787b369 100644 (file)
@@ -13,7 +13,7 @@ class ModuleCache
 private:
        DataFile::Collection *resources;
        std::map<std::string, Module *> modules;
-       unsigned next_source;
+       unsigned next_source = 1;
 
 public:
        ModuleCache(DataFile::Collection *);
index 907cb7fe651c48d83672e8987acd161c13349524..a9962afef93bf042b6af400715bdbf4961097794 100644 (file)
@@ -18,8 +18,7 @@ namespace SL {
 
 Parser::Parser(ModuleCache *s):
        mod_cache(s),
-       preprocessor(tokenizer),
-       module(nullptr)
+       preprocessor(tokenizer)
 {
        tokenizer.signal_preprocess.connect(sigc::mem_fun(&preprocessor, &Preprocessor::preprocess));
        preprocessor.signal_version.connect(sigc::mem_fun(this, &Parser::set_required_version));
index d1dd379d30bea40c3d156eaa238ff76404b34037..d46afcdc122cfa9bb56e34df980518f5fad015d8 100644 (file)
@@ -17,16 +17,16 @@ class ModuleCache;
 class Parser
 {
 private:
-       ModuleCache *mod_cache;
+       ModuleCache *mod_cache = nullptr;
        std::string source;
-       int base_index;
-       int source_index;
+       int base_index = 0;
+       int source_index = 0;
        Tokenizer tokenizer;
        Preprocessor preprocessor;
-       bool allow_stage_change;
-       Module *module;
+       bool allow_stage_change = false;
+       Module *module = nullptr;
        std::vector<const Module *> imported_modules;
-       Stage *cur_stage;
+       Stage *cur_stage = nullptr;
        std::set<std::string> global_types;
        std::set<std::string> stage_types;
        std::vector<std::string> errors;
index 88ab30b94282a17e2de9e028e846c3c2256c206a..ce8da1ed285a333994bf346569cbf507cc75875c 100644 (file)
@@ -2085,8 +2085,7 @@ void SpirVGenerator::visit(Jump &jump)
 }
 
 
-SpirVGenerator::TypeKey::TypeKey(BasicTypeDeclaration::Kind kind, bool sign):
-       type_id(0)
+SpirVGenerator::TypeKey::TypeKey(BasicTypeDeclaration::Kind kind, bool sign)
 {
        switch(kind)
        {
index 8436cf14c5898513618f93978da469127a3b8ed2..8e6589b9e04a23ae7d93c000bf389f1be05aca87 100644 (file)
@@ -45,8 +45,8 @@ private:
 
        struct TypeKey
        {
-               Id type_id;
-               unsigned detail;
+               Id type_id = 0;
+               unsigned detail = 0;
 
                TypeKey(Id i, unsigned d): type_id(i), detail(d) { }
                TypeKey(BasicTypeDeclaration::Kind, bool);
@@ -56,7 +56,7 @@ private:
 
        struct ConstantKey
        {
-               Id type_id;
+               Id type_id = 0;
                union
                {
                        int int_value;
index c73b725a68b8c3315c9c2ef0b8b355a9a3aca4d6..4f9e29be4717b797b7255077329c78c500a24174 100644 (file)
@@ -8,10 +8,7 @@ namespace GL {
 namespace SL {
 
 SpirVWriter::SpirVWriter(SpirVContent &c):
-       content(c),
-       op_target(nullptr),
-       op_head_pos(0),
-       current_block_id(0)
+       content(c)
 { }
 
 void SpirVWriter::append(vector<Word> &target, const vector<Word> &source)
index 8456389a48b5df36363b1b6f69bba370168edf6c..6cad9460a512f007f605368b52f75e71b1602b90 100644 (file)
@@ -37,9 +37,9 @@ public:
 
 private:
        SpirVContent &content;
-       std::vector<Word> *op_target;
-       unsigned op_head_pos;
-       Id current_block_id;
+       std::vector<Word> *op_target = nullptr;
+       unsigned op_head_pos = 0;
+       Id current_block_id = 0;
 
 public:
        SpirVWriter(SpirVContent &);
index ac63585eee8958f41e3d03541acde199517c8953..e8cec667159bebe9aabb825b3135ba9ba9b374b0 100644 (file)
@@ -715,10 +715,7 @@ void ProgramData::set_debug_name(const string &name)
 
 
 ProgramData::SharedBlock::SharedBlock(ReflectData::LayoutHash h):
-       block_hash(h),
-       used(0),
-       dirty(0),
-       block(nullptr)
+       block_hash(h)
 {
        indices.type_flag = 0xFD;
 }
@@ -730,9 +727,7 @@ const uint8_t *ProgramData::SharedBlock::get_uniform_indices() const
 
 
 ProgramData::ProgramBlock::ProgramBlock(ReflectData::LayoutHash h):
-       prog_hash(h),
-       bind_point(-1),
-       block_index(-1)
+       prog_hash(h)
 {
        masks.used = ALL_ONES;
        masks.dirty = ALL_ONES;
index 41121e4457976431c7ba20a61afe9b5f95f939eb..d0229b34559bc885d2fdc62ef6d9cf5d17ba2c8c 100644 (file)
@@ -68,8 +68,8 @@ private:
        class ArrayLoader: public DataFile::Loader
        {
        private:
-               DataType type;
-               unsigned element_size;
+               DataType type = VOID;
+               unsigned element_size = 0;
                std::vector<char> data;
 
        public:
@@ -111,10 +111,10 @@ private:
 
        struct SharedBlock
        {
-               ReflectData::LayoutHash block_hash;
-               Mask used;
-               Mask dirty;
-               UniformBlock *block;
+               ReflectData::LayoutHash block_hash = 0;
+               Mask used = 0;
+               Mask dirty = 0;
+               UniformBlock *block = nullptr;
                union
                {
                        std::uint8_t type_flag;
@@ -133,9 +133,9 @@ private:
 
        struct ProgramBlock
        {
-               ReflectData::LayoutHash prog_hash;
-               int bind_point;
-               int block_index;
+               ReflectData::LayoutHash prog_hash = 0;
+               int bind_point = -1;
+               int block_index = -1;
                union
                {
                        UniformBlock *block;
index 6fe2cc0834826fb129c0c9d8c446c47d53f115e7..582e63e9bd13fcc107290f5c9e15ed82678d0de1 100644 (file)
@@ -182,7 +182,6 @@ void Sequence::set_debug_name(const string &name)
 
 Sequence::Step::Step(Tag t, Renderable *r):
        tag(t),
-       lighting(nullptr),
        renderable(r)
 { }
 
index 805aa9e01bc351c9a329099a4af75a5f6fdb12ee..0c7c869c4b12fde77af74340cfcdd810a78be99f 100644 (file)
@@ -42,7 +42,7 @@ public:
        {
        private:
                Tag tag;
-               const Lighting *lighting;
+               const Lighting *lighting = nullptr;
                DepthTest depth_test;
                StencilTest stencil_test;
                Renderable *renderable;
index af780bf07c89306cfa94589b39f257c7d8adada1..a2023f5d760643ec1bef8afb4ccfde0d1940ba54 100644 (file)
@@ -283,10 +283,6 @@ bool ResourceManager::age_order(ManagedResource *mr1, ManagedResource *mr2)
 }
 
 
-ResourceManager::ResourceLocation::ResourceLocation():
-       collection(nullptr)
-{ }
-
 ResourceManager::ResourceLocation::ResourceLocation(DataFile::Collection &c, const string &n):
        collection(&c),
        name(n)
@@ -295,12 +291,7 @@ ResourceManager::ResourceLocation::ResourceLocation(DataFile::Collection &c, con
 
 ResourceManager::ManagedResource::ManagedResource(Resource &r):
        resource(&r),
-       load_priority(r.get_load_priority()),
-       io(nullptr),
-       loader(nullptr),
-       state(NOT_LOADED),
-       last_used(0),
-       data_size(0)
+       load_priority(r.get_load_priority())
 { }
 
 void ResourceManager::ManagedResource::start_loading()
@@ -381,11 +372,7 @@ void ResourceManager::ManagedResource::remove_observer(ResourceObserver &w)
 
 ResourceManager::LoadingThread::LoadingThread():
        Thread("ResourceManager"),
-       sem(1),
-       capacity(2),
-       size(0),
-       loaded_data_size(0),
-       done(false)
+       sem(1)
 {
        launch();
 }
index 4aac2eb30d4e9118923291a553cb9eb0ba48fe3b..1e6fcbc3facb917df7530253cf7174dc3a3aa94e 100644 (file)
@@ -36,10 +36,10 @@ public:
 
        struct ResourceLocation
        {
-               DataFile::Collection *collection;
+               DataFile::Collection *collection = nullptr;
                std::string name;
 
-               ResourceLocation();
+               ResourceLocation() = default;
                ResourceLocation(DataFile::Collection &, const std::string &);
        };
 
@@ -56,14 +56,14 @@ private:
                        LOAD_ERROR
                };
 
-               Resource *resource;
+               Resource *resource = nullptr;
                ResourceLocation location;
-               int load_priority;
-               IO::Seekable *io;
-               Resource::AsyncLoader *loader;
-               State state;
-               unsigned last_used;
-               std::uint64_t data_size;
+               int load_priority = 0;
+               IO::Seekable *io = nullptr;
+               Resource::AsyncLoader *loader = nullptr;
+               State state = NOT_LOADED;
+               unsigned last_used = 0;
+               std::uint64_t data_size = 0;
                std::vector<ResourceObserver *> observers;
 
                ManagedResource(Resource &);
@@ -85,12 +85,12 @@ private:
                Mutex queue_mutex;
                std::deque<ManagedResource *> async_queue;
                std::deque<ManagedResource *> sync_queue;
-               unsigned capacity;
-               unsigned size;
+               unsigned capacity = 2;
+               unsigned size = 0;
                std::list<resource_load_error> error_queue;
                Mutex data_size_mutex;
-               std::uint64_t loaded_data_size;
-               volatile bool done;
+               std::uint64_t loaded_data_size = 0;
+               volatile bool done = false;
 
        public:
                LoadingThread();
index 0239bd165a76e110ed5597b5f513121d191962f3..ec17ec86a5aac0dc7807601bde25aeb242b974cd 100644 (file)
@@ -44,8 +44,7 @@ void init_builtin_data(DataFile::BuiltinSource &);
 
 Resources *Resources::global_resources = nullptr;
 
-Resources::Resources(bool set_as_global):
-       resource_manager(nullptr)
+Resources::Resources(bool set_as_global)
 {
        add_type<Animation>().suffix(".anim").keyword("animation");
        add_type<Armature>().suffix(".arma").keyword("armature");
index cf9ad9f2cf5e687acc56f1784d8831fe95e43bde..ff2bcd5f597b51a5c82decbd51229223454bf05e 100644 (file)
@@ -83,7 +83,7 @@ private:
                virtual void type(const DataFile::Symbol &);
        };
 
-       ResourceManager *resource_manager;
+       ResourceManager *resource_manager = nullptr;
 
        static Resources *global_resources;
 
index dd5a6c6aae86760b16a830d1aad9057d32830c21..48e003b94ba9cbc11ed9567dc28cf2433853c0bd 100644 (file)
@@ -26,12 +26,12 @@ private:
        std::string source_fn;
        std::vector<std::string> include_paths;
        Msp::GL::SL::Features features;
-       Msp::GL::SL::Compiler::Mode compile_mode;
+       Msp::GL::SL::Compiler::Mode compile_mode = Msp::GL::SL::Compiler::PROGRAM;
        std::map<std::string, int> spec_values;
-       bool parse_only;
-       bool combined;
-       Msp::GL::SL::Stage::Type stage;
-       bool dump_ast;
+       bool parse_only = false;
+       bool combined = false;
+       Msp::GL::SL::Stage::Type stage = Msp::GL::SL::Stage::SHARED;
+       bool dump_ast = false;
        std::string out_filename;
 
 public:
@@ -44,12 +44,7 @@ using namespace std;
 using namespace Msp;
 
 GlslCompiler::GlslCompiler(int argc, char **argv):
-       features(GL::SL::Features::latest(GL::OPENGL)),
-       compile_mode(GL::SL::Compiler::PROGRAM),
-       parse_only(false),
-       combined(false),
-       stage(GL::SL::Stage::SHARED),
-       dump_ast(false)
+       features(GL::SL::Features::latest(GL::OPENGL))
 {
        string stage_str;
        vector<string> spec_values_in;
index 0753ae255185d356adae11c4f31827889e4fefcf..8ac41a23330070cb3ce574389c4230537153b89e 100644 (file)
@@ -69,19 +69,19 @@ private:
        Input::Mouse mouse;
        Resources resources;
        GL::WindowView view;
-       GL::Sequence *sequence;
-       GL::Renderable *renderable;
-       GL::AnimatedObject *anim_object;
-       GL::AnimationPlayer *anim_player;
+       GL::Sequence *sequence = nullptr;
+       GL::Renderable *renderable = nullptr;
+       GL::AnimatedObject *anim_object = nullptr;
+       GL::AnimationPlayer *anim_player = nullptr;
        GL::DirectionalLight light;
        GL::Lighting lighting;
        GL::Camera camera;
        Geometry::Angle<float> yaw;
        Geometry::Angle<float> pitch;
-       float distance;
+       float distance = 10.0f;
        Geometry::Angle<float> light_yaw;
        Geometry::Angle<float> light_pitch;
-       unsigned dragging;
+       unsigned dragging = 0;
        Time::TimeStamp last_tick;
 
 public:
@@ -134,13 +134,7 @@ Viewer::Viewer(int argc, char **argv):
        window(display, opts.wnd_opts),
        gl_device(window),
        mouse(window),
-       view(window),
-       sequence(nullptr),
-       renderable(nullptr),
-       anim_object(nullptr),
-       anim_player(nullptr),
-       distance(10),
-       dragging(0)
+       view(window)
 {
        for(list<string>::const_iterator i=opts.resource_locations.begin(); i!=opts.resource_locations.end(); ++i)
        {