Skip to content

Commit da66f61

Browse files
committed
dll fixes and remove __PRETTY_FUNCTION__
1 parent c3b67c5 commit da66f61

4 files changed

Lines changed: 24 additions & 24 deletions

File tree

Engine/src/engine/systems/Reflection.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Toad
1313
{
14-
14+
1515
using json = nlohmann::ordered_json;
1616

1717
// Define string identifier for type X
@@ -25,7 +25,7 @@ inline std::string_view type_name()
2525
return "Unknown";
2626
}
2727

28-
struct SerializedEnum
28+
struct ENGINE_API SerializedEnum
2929
{
3030
union Data
3131
{
@@ -63,7 +63,7 @@ SERIALIZABLE_TYPE(std::string*)
6363
#define ReflectTypes SerializedEnum, bool*, int8_t*, int16_t*, int32_t*, int64_t*, float*, std::string*
6464

6565
template<typename T>
66-
struct ReflectVarsOfT
66+
struct ENGINE_API ReflectVarsOfT
6767
{
6868
std::unordered_map<std::string, T> data;
6969

@@ -100,28 +100,28 @@ struct ReflectVarsOfT
100100
};
101101

102102
template<typename... Ts>
103-
struct ReflectVarsCopy : ReflectVarsOfT<std::remove_pointer_t<Ts>>...
103+
struct ENGINE_API ReflectVarsCopy : ReflectVarsOfT<std::remove_pointer_t<Ts>>...
104104
{
105105
template<typename T>
106-
ENGINE_API ReflectVarsOfT<T>& Get()
106+
ReflectVarsOfT<T>& Get()
107107
{
108108
return static_cast<ReflectVarsOfT<T>&>(*this);
109109
}
110110

111111
template<typename T>
112-
ENGINE_API const ReflectVarsOfT<T>& GetCRef() const
112+
const ReflectVarsOfT<T>& GetCRef() const
113113
{
114114
return static_cast<const ReflectVarsOfT<T>&>(*this);
115115
}
116116

117117
template<typename T>
118-
ENGINE_API T& GetVar(const std::string& name)
118+
T& GetVar(const std::string& name)
119119
{
120120
return Get<T>().data[name];
121121
}
122122

123123
template<typename T>
124-
ENGINE_API void Add(const std::string& name, T value)
124+
void Add(const std::string& name, T value)
125125
{
126126
if (std::is_enum_v<T>)
127127
AddEnum(name, value);
@@ -130,33 +130,33 @@ struct ReflectVarsCopy : ReflectVarsOfT<std::remove_pointer_t<Ts>>...
130130
}
131131

132132
template<typename T>
133-
ENGINE_API void Add(const ReflectVarsOfT<T>& vars)
133+
void Add(const ReflectVarsOfT<T>& vars)
134134
{
135135
ReflectVarsOfT<T>::data.insert(vars.data.begin(), vars.data.end());
136136
}
137137
};
138138

139139
template<typename... Ts>
140-
struct ReflectVars : ReflectVarsOfT<Ts>...
140+
struct ENGINE_API ReflectVars : ReflectVarsOfT<Ts>...
141141
{
142142
ReflectVars()
143143
: ReflectVarsOfT<Ts>()...
144144
{}
145145

146146
template<typename T>
147-
ENGINE_API ReflectVarsOfT<T>& Get()
147+
ReflectVarsOfT<T>& Get()
148148
{
149149
return (ReflectVarsOfT<T>&)(*this);
150150
}
151151

152152
template<typename T>
153-
ENGINE_API T& GetVar(const std::string& name)
153+
T& GetVar(const std::string& name)
154154
{
155155
return Get<T>().data[name];
156156
}
157157

158158
template<typename T>
159-
ENGINE_API void Add(const std::string& name, T value)
159+
void Add(const std::string& name, T value)
160160
{
161161
if constexpr (std::is_enum_v<std::remove_pointer_t<T>>)
162162
AddEnum(name, value);
@@ -165,7 +165,7 @@ struct ReflectVars : ReflectVarsOfT<Ts>...
165165
}
166166

167167
template<typename T>
168-
ENGINE_API void AddEnum(const std::string& name, T value)
168+
void AddEnum(const std::string& name, T value)
169169
{
170170
SerializedEnum serialized;
171171
serialized.enum_name = magic_enum::enum_type_name<decltype(*value)>();
@@ -182,7 +182,7 @@ struct ReflectVars : ReflectVarsOfT<Ts>...
182182
}
183183

184184
template<typename T>
185-
ENGINE_API ReflectVarsOfT<std::remove_pointer_t<T>> CopyVars() const
185+
ReflectVarsOfT<std::remove_pointer_t<T>> CopyVars() const
186186
{
187187
ReflectVarsOfT<std::remove_pointer_t<T>> res;
188188
for (const auto& [n, v] : ReflectVarsOfT<T>::data)
@@ -200,27 +200,27 @@ struct ReflectVars : ReflectVarsOfT<Ts>...
200200
return res;
201201
}
202202

203-
ENGINE_API ReflectVarsCopy<Ts...> Copy() const
203+
ReflectVarsCopy<Ts...> Copy() const
204204
{
205205
ReflectVarsCopy<Ts...> res;
206206
(res.template Add<std::remove_pointer_t<Ts>>(CopyVars<Ts>()), ...);
207207
return res;
208208
}
209209

210-
ENGINE_API void Clear()
210+
void Clear()
211211
{
212212
(ReflectVarsOfT<Ts>::data.clear(), ...);
213213
}
214214

215-
ENGINE_API json Serialize()
215+
json Serialize()
216216
{
217217
json res;
218218
(res.push_back(Get<Ts>().Serialize()), ...);
219219
return res;
220220
}
221221

222222
// update overlapping vars
223-
ENGINE_API void Update(const ReflectVarsCopy<Ts...>& reflection)
223+
void Update(const ReflectVarsCopy<Ts...>& reflection)
224224
{
225225
(std::for_each(Get<Ts>().data.begin(), Get<Ts>().data.end(),
226226
[&reflection](auto& e)

Engine/src/engine/systems/Scene.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static void UpdateVarsOnScript(Script* new_script, Reflection& reflection, const
104104
if (var)
105105
*var = new_value.template get<std::remove_pointer_t<Ts>>();
106106
else
107-
LOGWARNF("[Scene] Script variable {} for script {} is null and is getting disabled, make sure it's exposed. At {}", key, script_name.c_str(), __PRETTY_FUNCTION__);
107+
LOGWARNF("[Scene] Script variable {} for script {} is null and is getting disabled, make sure it's exposed.", key, script_name.c_str());
108108
}
109109
}
110110
}

Engine/src/engine/systems/Timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Timer
1616
ENGINE_API void Start();
1717

1818
template<typename TDur = std::chrono::milliseconds>
19-
ENGINE_API float Elapsed() const
19+
float Elapsed() const
2020
{
2121
return (float)std::chrono::duration_cast<TDur>(TClock::now() - m_start).count();
2222
}

Engine/src/engine/utils/Helpers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace Toad
5050
ENGINE_API void PathToPreferred(std::string& path_str);
5151

5252
template<typename T>
53-
ENGINE_API inline bool GetJsonElement(T& val, const nlohmann::ordered_json& data, std::string_view key, std::string error_msg = "") noexcept
53+
inline bool GetJsonElement(T& val, const nlohmann::ordered_json& data, std::string_view key, std::string error_msg = "") noexcept
5454
{
5555
if (data.contains(key) && !data.at(key).is_null())
5656
{
@@ -75,13 +75,13 @@ namespace Toad
7575
ENGINE_API std::string GetFileContents(const char* file);
7676

7777
template<class T>
78-
ENGINE_API T* GetObjectAsType(Object* obj)
78+
T* GetObjectAsType(Object* obj)
7979
{
8080
return dynamic_cast<T*>(obj);
8181
}
8282

8383
template<class T>
84-
ENGINE_API T* GetScriptAsType(Script* script)
84+
T* GetScriptAsType(Script* script)
8585
{
8686
return dynamic_cast<T*>(script);
8787
}

0 commit comments

Comments
 (0)