Skip to content

Commit

Permalink
fix: support non-ae
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix committed Sep 7, 2024
1 parent c34f51e commit 9fe9130
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/SKSE/Interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ namespace SKSE
const char* name;
std::uint32_t version;
};

#ifdef SKYRIM_SUPPORT_AE
struct PluginVersionData
{
Expand Down
4 changes: 1 addition & 3 deletions src/SKSE/API.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "SKSE/API.h"

#include "SKSE/Interfaces.h"
#include "SKSE/Logger.h"

namespace SKSE
Expand Down Expand Up @@ -76,10 +77,7 @@ namespace SKSE
}

if (a_log) {
// remove ifdef once 1.5.x support is removed
#ifdef SKYRIM_SUPPORT_AE
log::init();
#endif
}

(void)REL::Module::get();
Expand Down
2 changes: 2 additions & 0 deletions src/SKSE/Interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ namespace SKSE
return reinterpret_cast<const detail::SKSETrampolineInterface*>(this);
}

#ifdef SKYRIM_SUPPORT_AE
const PluginVersionData* PluginVersionData::GetSingleton() noexcept
{
return reinterpret_cast<const PluginVersionData*>(REX::W32::GetProcAddress(REX::W32::GetCurrentModule(), "SKSEPlugin_Version"));
}
#endif
}
3 changes: 3 additions & 0 deletions src/SKSE/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ namespace SKSE

void init()
{
// remove ifdef if 1.5.x support is removed
#ifdef SKYRIM_SUPPORT_AE
auto path = log_directory();
if (!path) {
return;
Expand All @@ -142,6 +144,7 @@ namespace SKSE
#endif
spdlog::set_default_logger(std::move(logger));
spdlog::set_pattern("[%T.%e] [%=5t] [%L] %v");
#endif
}
}
}

0 comments on commit 9fe9130

Please sign in to comment.