From: Mikko Rasa Date: Tue, 5 Sep 2023 10:28:01 +0000 (+0300) Subject: Move a few things to .cpp files X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=955cb6243a1131d64de9d637870f5c3771271b15;p=libs%2Fgl.git Move a few things to .cpp files Otherwise they generate undefined references on MSVC. --- diff --git a/source/animation/animation.cpp b/source/animation/animation.cpp index ea86f9a4..1048cc9e 100644 --- a/source/animation/animation.cpp +++ b/source/animation/animation.cpp @@ -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(a, c), start_slope(1), diff --git a/source/animation/animation.h b/source/animation/animation.h index 2e0536d4..576cb9a5 100644 --- a/source/animation/animation.h +++ b/source/animation/animation.h @@ -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(); diff --git a/source/resources/resourcemanager.cpp b/source/resources/resourcemanager.cpp index 91b37424..36b7091d 100644 --- a/source/resources/resourcemanager.cpp +++ b/source/resources/resourcemanager.cpp @@ -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(); diff --git a/source/resources/resourcemanager.h b/source/resources/resourcemanager.h index 893f7601..97d60fd0 100644 --- a/source/resources/resourcemanager.h +++ b/source/resources/resourcemanager.h @@ -127,6 +127,7 @@ private: LoadingThread thread; public: + ResourceManager(); ~ResourceManager(); void set_loading_policy(LoadingPolicy);