-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
1,308 additions
and
579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#pragma once | ||
|
||
#include "RE/N/NiPoint3.h" | ||
#include "RE/N/NiPoint.h" | ||
#include "RE/T/TESForm.h" | ||
|
||
namespace RE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSTSingleton.h" | ||
#include "RE/T/TESGlobal.h" | ||
|
||
namespace RE | ||
{ | ||
class Calendar : | ||
public BSTSingletonSDM<Calendar> | ||
{ | ||
public: | ||
[[nodiscard]] static auto GetSingleton() | ||
{ | ||
static REL::Relocation<Calendar**> singleton{ ID::Calendar::Singleton }; | ||
return *singleton; | ||
} | ||
|
||
std::uint32_t GetDay() const noexcept | ||
{ | ||
return gameDay ? static_cast<std::uint32_t>(gameDay->value) : 17u; | ||
} | ||
|
||
std::uint32_t GetDaysPassed() const noexcept | ||
{ | ||
return gameDaysPassed ? static_cast<std::uint32_t>(gameDaysPassed->value) : 0u; | ||
} | ||
|
||
float GetDaysPassedExact() const noexcept | ||
{ | ||
return gameDaysPassed ? gameDaysPassed->value : 0.0f; | ||
} | ||
|
||
float GetHour() const noexcept | ||
{ | ||
return gameHour ? gameHour->value : 12.0f; | ||
} | ||
|
||
float GetHourFromDaysPassed(float a_daysPassed) const noexcept | ||
{ | ||
return std::fmodf(a_daysPassed, 1.0f) * 24.0f; | ||
} | ||
|
||
float GetHoursPassedExact() const noexcept | ||
{ | ||
return gameDaysPassed ? gameDaysPassed->value * 24.0f : 0.0f; | ||
} | ||
|
||
std::uint16_t GetMonth() const noexcept | ||
{ | ||
return gameMonth ? static_cast<std::uint16_t>(gameMonth->value) : 8u; | ||
} | ||
|
||
float GetTimeScale() const | ||
{ | ||
return timeScale->value; | ||
} | ||
|
||
std::uint32_t GetYear() const noexcept | ||
{ | ||
return gameYear ? static_cast<std::uint32_t>(gameYear->value) : 77u; | ||
} | ||
|
||
// members | ||
TESGlobal* gameYear; // 08 | ||
TESGlobal* gameMonth; // 10 | ||
TESGlobal* gameDay; // 18 | ||
TESGlobal* gameHour; // 20 | ||
TESGlobal* gameDaysPassed; // 28 | ||
TESGlobal* timeScale; // 30 | ||
std::uint32_t midnightsPassed; // 38 | ||
float rawDaysPassed; // 3C | ||
}; | ||
static_assert(sizeof(Calendar) == 0x40); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.