]> git.tdb.fi Git - libs/gl.git/commitdiff
Move a few things to .cpp files
authorMikko Rasa <tdb@tdb.fi>
Tue, 5 Sep 2023 10:28:01 +0000 (13:28 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 5 Sep 2023 10:32:50 +0000 (13:32 +0300)
Otherwise they generate undefined references on MSVC.

source/animation/animation.cpp
source/animation/animation.h
source/resources/resourcemanager.cpp
source/resources/resourcemanager.h

index ea86f9a4799879b5f6455c54cd7ea3322ba6da12..1048cc9ef6747b57447aad8288cbe78aa2b5ba9a 100644 (file)
@@ -484,6 +484,16 @@ Matrix Animation::Iterator::get_pose_matrix(unsigned link) const
 }
 
 
+/* These shortcut constructors must be defined here to avoid an undefined
+reference to vftable. */
+Animation::Loader::Loader(Animation &a):
+       Loader(a, 0)
+{ }
+
+Animation::Loader::Loader(Animation &a, Collection &c):
+       Loader(a, &c)
+{ }
+
 Animation::Loader::Loader(Animation &a, Collection *c):
        DataFile::CollectionObjectLoader<Animation>(a, c),
        start_slope(1),
index 2e0536d419de22e5c1c3901cade56dbe7c4e95ad..576cb9a5af8e1207590ea322cd27582bc8af3be2 100644 (file)
@@ -32,8 +32,8 @@ public:
                int slopes_set;
 
        public:
-               Loader(Animation &a): Loader(a, 0) { }
-               Loader(Animation &a, Collection &c): Loader(a, &c) { }
+               Loader(Animation &);
+               Loader(Animation &, Collection &);
        private:
                Loader(Animation &, Collection *);
                virtual void finish();
index 91b374244090f78397b9cbfe78db63c36c97026b..36b7091d17c2285406c5ad94d6246b6285518466 100644 (file)
@@ -22,6 +22,10 @@ resource_load_error::resource_load_error(const string &name, const exception &ex
 { }
 
 
+// Hide the generated constructor of LoadingThread from the header
+ResourceManager::ResourceManager()
+{ }
+
 ResourceManager::~ResourceManager()
 {
        thread.terminate();
index 893f76017d23d9fe4677dfe08de612365aa8dd7a..97d60fd00087d34cc7c05763858c3c49c16f164c 100644 (file)
@@ -127,6 +127,7 @@ private:
        LoadingThread thread;
 
 public:
+       ResourceManager();
        ~ResourceManager();
 
        void set_loading_policy(LoadingPolicy);