Port single-missing-function modules

LeaveWorld handlers, game object type checks, corpse/dynamic object
virtuals, loot/voice/macro helpers, declined words, ProcessAgreement,
ObjectCreateStaticEx, FFX death/fog-seed/nether-blur passes, software
snow renderer, streaming decal, QuestCache copy, trajectory encoder and
deleting destructor tags. Fixes the missing CMapStaticEntity destructor
model release.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Saty
2026-10-02 14:39:43 +02:00
co-authored by Claude Opus 5.5
parent 761ba11682
commit 393769ff36
79 changed files with 1603 additions and 20 deletions
@@ -287,6 +287,13 @@ bool Blizzard::Mopaq::SFileGetArchiveName(System_SFile::ARCHIVEREC* handle, char
return true;
}
// VERIFY: 77e33064 manual
// OFFSET: 0x0042BF00
bool Blizzard::Mopaq::SFileUnloadFile(void* data) {
SMemFree(data, __FILE__, __LINE__, 0);
return true;
}
// VERIFY: 678ca972 manual
// OFFSET: 0x0045A4B0
bool Blizzard::Mopaq::SFileReadFile(IOMpqUnit* file, void* buffer, uint32_t count, uint32_t* bytesRead) {
@@ -54,6 +54,7 @@ bool SFileLoadFile(System_SFile::ARCHIVEREC* handle, const char* name, void** da
int32_t SFileOpenFileEx(System_SFile::ARCHIVEREC* handle, const char* name, const Blizzard::Util::Digest<16>& md5, uint32_t flags, IOMpqUnit** result);
int32_t SFileOpenFileEx(System_SFile::ARCHIVEREC* handle, const char* name, uint32_t flags, IOMpqUnit** result);
bool SFileReadFile(IOMpqUnit* file, void* buffer, uint32_t count, uint32_t* bytesRead);
bool SFileUnloadFile(void* data);
int32_t SFileSetFilePointer(IOMpqUnit* file, int32_t distance, int32_t* distanceHigh, uint32_t method);
void SFileSetThreadingMode(uint32_t mode);
+1 -1
View File
@@ -24,7 +24,7 @@ EvtContext::EvtContext(uint32_t flags, uint32_t idleTime, uint32_t schedWeight,
}
// VERIFY: a33f23a6 manual
// OFFSET: 0x0047F6C0
// OFFSET: [0x0047F6C0, 0x0047F920]
EvtContext::~EvtContext() {
for (uint32_t i = 0; i < EVENTIDS; i++) {
this->m_queueHandlerList[i].Clear();
+19
View File
@@ -4,3 +4,22 @@
BLLLoader::~BLLLoader() {
this->Unload();
}
// VERIFY: 41b5b6fb manual
// OFFSET: 0x00872320
void* BLLLoader::GetExport(int32_t ordinal) {
uint8_t* image = this->m_image;
if (!image) {
return nullptr;
}
const uint32_t* header = reinterpret_cast<const uint32_t*>(image);
uint32_t index = ordinal - header[6];
if (index >= header[5]) {
return nullptr;
}
return image + *reinterpret_cast<const uint32_t*>(image + header[4] + index * 4);
}
+11
View File
@@ -4,6 +4,9 @@
#include "Engine/Source/Services/SysMessage.h"
#include "Engine/Source/Storm/H/storm.h"
// STATIC: 0x00AC3208
static const SYSMSGSEVERITY s_severities[4] = { { 0xFF, 0xFF, 0xFF, 0, 10.0f }, { 0xFF, 0xFF, 0x7F, 0, 15.0f }, { 0xFF, 0x7F, 0x7F, 0, 15.0f }, { 0x7F, 0xFF, 0xFF, 0, 20.0f } };
// STATIC: 0x00AC3228
static int32_t s_enabled = 1;
@@ -16,6 +19,14 @@ static uint32_t s_categoryFilter = 0xFFFFFFFF;
// STATIC: 0x00B49C74
static int32_t s_minSeverity;
// VERIFY: 847a42a2 auto
// OFFSET: 0x004B4EE0
void SysMsgGetSeverityColor(STATUS_TYPE severity, float& red, float& green, float& blue) {
red = s_severities[severity].m_red * 0.0039215689f;
green = s_severities[severity].m_green * 0.0039215689f;
blue = s_severities[severity].m_blue * 0.0039215689f;
}
// VERIFY: e98afe5a manual
// OFFSET: 0x004B4F60
int32_t SysMsgAdd(const char* text, STATUS_TYPE severity) {
+8
View File
@@ -5,6 +5,14 @@
#include <cstdint>
#include "Engine/Source/Base/Status.h"
struct SYSMSGSEVERITY {
/* 0000 */ uint8_t m_red;
/* 0001 */ uint8_t m_green;
/* 0002 */ uint8_t m_blue;
/* 0003 */ uint8_t unk_0003;
/* 0004 */ float m_duration;
};
int32_t SysMsgAdd(const char* text, STATUS_TYPE severity);
int32_t SysMsgAdd(CStatus* status);
int32_t SysMsgPrintf(STATUS_TYPE severity, const char* format, ...);
+5 -4
View File
@@ -399,7 +399,8 @@ TSList<T, TGetLink>::TSList(const TSList<T, TGetLink>& source) {
this->SetLinkOffset(source.m_linkoffset);
}
// INLINED
// VERIFY: 4c44cf25 manual
// OFFSET: 0x00488A70
template <class T, class TGetLink>
TSList<T, TGetLink>::~TSList() {
this->UnlinkAll();
@@ -415,7 +416,7 @@ void TSList<T, TGetLink>::ChangeLinkOffset(ptrdiff_t linkoffset) {
}
// VERIFY: ab66a452 manual
// OFFSET: [0x0047C470, 0x0047E7C0, 0x0047E830, 0x0047E8A0, 0x00485970, 0x00488940, 0x00489A60, 0x00498AE0, 0x00498B80, 0x0049A610, 0x004B73E0, 0x004B7460, 0x004BA230, 0x004BA2A0, 0x004BCEF0, 0x004C9650, 0x004CA310, 0x004CDA60, 0x004DA510, 0x004F1650, 0x004F92A0, 0x00502270, 0x00503060, 0x00527B00, 0x00528690, 0x0052F090, 0x0053EEB0, 0x0055FD20, 0x0056C9C0, 0x005AE0C0, 0x005B2170, 0x005B2260, 0x005B4CF0, 0x005BE660, 0x005BE6D0, 0x005BE740, 0x005F3DB0, 0x00606480, 0x00615FF0, 0x00617210, 0x00633470, 0x00670070, 0x00687FD0, 0x006BC100, 0x006BDDC0, 0x006BDE40, 0x006BF210, 0x006E4B80, 0x006EBF90, 0x006F2B70, 0x006F2BE0, 0x006FAF40, 0x0074F550, 0x0074F640, 0x00764420, 0x00771C20, 0x00772EF0, 0x00788B20, 0x007FBC20, 0x00804D90, 0x00804E00, 0x00807650, 0x0081A530, 0x0083D2D0, 0x008489F0, 0x00848A60, 0x0086E850, 0x008C8550, 0x008C8640, 0x0095B8E0]
// OFFSET: [0x0047C470, 0x0047E7C0, 0x0047E830, 0x0047E8A0, 0x00485970, 0x00488940, 0x00489A60, 0x00498AE0, 0x00498B80, 0x0049A610, 0x004B73E0, 0x004B7460, 0x004BA230, 0x004BA2A0, 0x004BCEF0, 0x004C9650, 0x004CA310, 0x004CDA60, 0x004DA510, 0x004F1650, 0x004F92A0, 0x00502270, 0x00503060, 0x00527B00, 0x00528690, 0x0052F090, 0x0053EEB0, 0x0055FD20, 0x0056C9C0, 0x005AE0C0, 0x005B2170, 0x005B2260, 0x005B4CF0, 0x005BE660, 0x005BE6D0, 0x005BE740, 0x005F3DB0, 0x00606480, 0x00615FF0, 0x00617210, 0x00633470, 0x00670070, 0x00687FD0, 0x006BC100, 0x006BDDC0, 0x006BDE40, 0x006BF210, 0x006E4B80, 0x006EBF90, 0x006F2B70, 0x006F2BE0, 0x006FAF40, 0x0074F550, 0x0074F640, 0x00764420, 0x00771C20, 0x00772EF0, 0x00788B20, 0x007CB680, 0x007FBC20, 0x00804D90, 0x00804E00, 0x00807650, 0x0081A530, 0x0083D2D0, 0x008489F0, 0x00848A60, 0x0086E850, 0x008C8550, 0x008C8640, 0x0095B8E0]
template <class T, class TGetLink>
void TSList<T, TGetLink>::Clear() {
T* node;
@@ -1017,14 +1018,14 @@ T* TSHashTable<T, TKey>::InternalNew(TSExplicitList<T>* listptr, size_t extrabyt
}
// VERIFY: 4a402d4d manual
// OFFSET: [0x0047C870, 0x0047CA60, 0x0047CB60, 0x0047CB90, 0x004921C0, 0x004922C0, 0x00496AD0, 0x00496BD0, 0x004B84E0, 0x004B85E0, 0x004BB410, 0x004BB510, 0x004BC6C0, 0x004BC930, 0x004BCA30, 0x004BCA60, 0x004BE5C0, 0x004BE6C0, 0x004C0890, 0x004C0990, 0x004C95B0, 0x004C97F0, 0x004CAE00, 0x004CAF00, 0x004CCBB0, 0x004CCDA0, 0x004CCEA0, 0x004CCED0, 0x004CE3C0, 0x004CE4C0, 0x004CF590, 0x004CF690, 0x004D6040, 0x004D6140, 0x004F34D0, 0x004F35D0, 0x00506110, 0x00506430, 0x00506630, 0x00506830, 0x00506930, 0x00506960, 0x00506990, 0x005069C0, 0x00529750, 0x00529850, 0x00529A60, 0x00529B60, 0x00529B90, 0x0052A130, 0x0052F400, 0x0052F500, 0x0053F770, 0x0053F870, 0x00549040, 0x00549140, 0x0055A270, 0x0055A480, 0x0055A580, 0x0055A5B0, 0x00560700, 0x005608A0, 0x00560AB0, 0x00560CB0, 0x00560EA0, 0x00560FA0, 0x00560FD0, 0x00561000, 0x00561030, 0x00561060, 0x00567700, 0x00567800, 0x00576330, 0x00576430, 0x00592E00, 0x00593080, 0x005B64F0, 0x005B6690, 0x005B6790, 0x005B67C0, 0x005C1690, 0x005C1880, 0x005C1980, 0x005C19B0, 0x005C8630, 0x005C8820, 0x005C8920, 0x005C8950, 0x005D27C0, 0x005D28C0, 0x005F0850, 0x005F0950, 0x005F40E0, 0x005F41E0, 0x005F5FB0, 0x005F6240, 0x005F6400, 0x005F6500, 0x005F6530, 0x005F6560, 0x005FCE70, 0x005FCF70, 0x00618450, 0x00618680, 0x006188A0, 0x006189A0, 0x006189D0, 0x00618A00, 0x00672CA0, 0x00672E50, 0x00672F50, 0x00673100, 0x00673200, 0x006733B0, 0x006734B0, 0x00673660, 0x00673760, 0x00673910, 0x00673A10, 0x00673BD0, 0x00673CD0, 0x00673E70, 0x00673F70, 0x00674110, 0x00674210, 0x006743C0, 0x006744C0, 0x00674670, 0x00674770, 0x00674910, 0x00674A10, 0x00674BB0, 0x00674CB0, 0x00674E50, 0x00674F50, 0x006750F0, 0x006751F0, 0x006753B0, 0x006754B0, 0x006754E0, 0x00675510, 0x00675540, 0x00675570, 0x006755A0, 0x006755D0, 0x00675600, 0x00675630, 0x00675660, 0x00675690, 0x006756C0, 0x006756F0, 0x00675720, 0x00675750, 0x00675780, 0x006757B0, 0x006757E0, 0x00675810, 0x00675840, 0x00675870, 0x006758A0, 0x006758D0, 0x00675900, 0x00675930, 0x00675960, 0x00675990, 0x006759C0, 0x006759F0, 0x00675A20, 0x00688560, 0x00688660, 0x006BC390, 0x006BC490, 0x006BF030, 0x006C2D30, 0x006C2E30, 0x006C3180, 0x006C3280, 0x006C8620, 0x006C8720, 0x006E66C0, 0x006E67C0, 0x006E68C0, 0x006E68F0, 0x006F3AD0, 0x006F3C70, 0x006F3EC0, 0x006F40C0, 0x006F4310, 0x006F44D0, 0x006F4690, 0x006F4790, 0x006F47C0, 0x006F47F0, 0x006F4820, 0x006F4850, 0x006F4880, 0x006F48B0, 0x00709F60, 0x0070A150, 0x0070A250, 0x0070A280, 0x00734910, 0x00734A10, 0x00767BC0, 0x00767CC0, 0x00768D00, 0x00768E00, 0x00776E00, 0x007B0860, 0x007B0960, 0x007B71F0, 0x007B72F0, 0x007C0E60, 0x007C0F60, 0x007C1060, 0x007C1090, 0x007DD840, 0x007DDA30, 0x007DDB30, 0x007DDB60, 0x007E04E0, 0x007E05E0, 0x007F2CC0, 0x007F2DC0, 0x007F5400, 0x007F5500, 0x0080A430, 0x0080A620, 0x0080A750, 0x008110B0, 0x008112A0, 0x008114A0, 0x008115A0, 0x008115D0, 0x00811D10, 0x008132F0, 0x008134E0, 0x008135E0, 0x00813610, 0x0081AFD0, 0x0081B0D0, 0x0084A1B0, 0x0084A2B0, 0x0084B910, 0x0084BA10, 0x008767E0, 0x008768E0, 0x00877910, 0x00877A10, 0x0087C0A0, 0x0087C1A0]
// OFFSET: [0x0047C870, 0x0047CA60, 0x0047CB60, 0x0047CB90, 0x004921C0, 0x004922C0, 0x00496AD0, 0x00496BD0, 0x004B84E0, 0x004B85E0, 0x004BB410, 0x004BB510, 0x004BC6C0, 0x004BC930, 0x004BCA30, 0x004BCA60, 0x004BE5C0, 0x004BE6C0, 0x004C0890, 0x004C0990, 0x004C95B0, 0x004C97F0, 0x004CAE00, 0x004CAF00, 0x004CCBB0, 0x004CCDA0, 0x004CCEA0, 0x004CCED0, 0x004CE3C0, 0x004CE4C0, 0x004CF590, 0x004CF690, 0x004D6040, 0x004D6140, 0x004F34D0, 0x004F35D0, 0x00506110, 0x00506430, 0x00506630, 0x00506830, 0x00506930, 0x00506960, 0x00506990, 0x005069C0, 0x00529750, 0x00529850, 0x00529A60, 0x00529B60, 0x00529B90, 0x0052A130, 0x0052F400, 0x0052F500, 0x0053F770, 0x0053F870, 0x00549040, 0x00549140, 0x0055A270, 0x0055A480, 0x0055A580, 0x0055A5B0, 0x00560700, 0x005608A0, 0x00560AB0, 0x00560CB0, 0x00560EA0, 0x00560FA0, 0x00560FD0, 0x00561000, 0x00561030, 0x00561060, 0x00567700, 0x00567800, 0x00576330, 0x00576430, 0x00592E00, 0x00593080, 0x005B64F0, 0x005B6690, 0x005B6790, 0x005B67C0, 0x005C1690, 0x005C1880, 0x005C1980, 0x005C19B0, 0x005C8630, 0x005C8820, 0x005C8920, 0x005C8950, 0x005D27C0, 0x005D28C0, 0x005F0850, 0x005F0950, 0x005F40E0, 0x005F41E0, 0x005F5FB0, 0x005F6240, 0x005F6400, 0x005F6500, 0x005F6530, 0x005F6560, 0x005FCE70, 0x005FCF70, 0x00618450, 0x00618680, 0x006188A0, 0x006189A0, 0x006189D0, 0x00618A00, 0x00672CA0, 0x00672E50, 0x00672F50, 0x00673100, 0x00673200, 0x006733B0, 0x006734B0, 0x00673660, 0x00673760, 0x00673910, 0x00673A10, 0x00673BD0, 0x00673CD0, 0x00673E70, 0x00673F70, 0x00674110, 0x00674210, 0x006743C0, 0x006744C0, 0x00674670, 0x00674770, 0x00674910, 0x00674A10, 0x00674BB0, 0x00674CB0, 0x00674E50, 0x00674F50, 0x006750F0, 0x006751F0, 0x006753B0, 0x006754B0, 0x006754E0, 0x00675510, 0x00675540, 0x00675570, 0x006755A0, 0x006755D0, 0x00675600, 0x00675630, 0x00675660, 0x00675690, 0x006756C0, 0x006756F0, 0x00675720, 0x00675750, 0x00675780, 0x006757B0, 0x006757E0, 0x00675810, 0x00675840, 0x00675870, 0x006758A0, 0x006758D0, 0x00675900, 0x00675930, 0x00675960, 0x00675990, 0x006759C0, 0x006759F0, 0x00675A20, 0x00688560, 0x00688660, 0x006BC390, 0x006BC490, 0x006BF030, 0x006BF130, 0x006C2D30, 0x006C2E30, 0x006C3180, 0x006C3280, 0x006C8620, 0x006C8720, 0x006E66C0, 0x006E67C0, 0x006E68C0, 0x006E68F0, 0x006F3AD0, 0x006F3C70, 0x006F3EC0, 0x006F40C0, 0x006F4310, 0x006F44D0, 0x006F4690, 0x006F4790, 0x006F47C0, 0x006F47F0, 0x006F4820, 0x006F4850, 0x006F4880, 0x006F48B0, 0x00709F60, 0x0070A150, 0x0070A250, 0x0070A280, 0x00734910, 0x00734A10, 0x00767BC0, 0x00767CC0, 0x00768D00, 0x00768E00, 0x00776E00, 0x007B0860, 0x007B0960, 0x007B71F0, 0x007B72F0, 0x007C0E60, 0x007C0F60, 0x007C1060, 0x007C1090, 0x007DD840, 0x007DDA30, 0x007DDB30, 0x007DDB60, 0x007E04E0, 0x007E05E0, 0x007F2CC0, 0x007F2DC0, 0x007F5400, 0x007F5500, 0x0080A430, 0x0080A620, 0x0080A720, 0x0080A750, 0x008110B0, 0x008112A0, 0x008114A0, 0x008115A0, 0x008115D0, 0x00811D10, 0x008132F0, 0x008134E0, 0x008135E0, 0x00813610, 0x0081AFD0, 0x0081B0D0, 0x0084A1B0, 0x0084A2B0, 0x0084B910, 0x0084BA10, 0x008767E0, 0x008768E0, 0x00877910, 0x00877A10, 0x0087C0A0, 0x0087C1A0]
template <class T, class TKey>
TSHashTable<T, TKey>::~TSHashTable() {
this->InternalClear(1);
}
// VERIFY: 8328884c auto
// OFFSET: [0x0047C750, 0x0047C970, 0x00491FC0, 0x00496920, 0x004B8390, 0x004BB270, 0x004BC870, 0x004BC8D0, 0x004BE470, 0x004C04B0, 0x004CACF0, 0x004CCAC0, 0x004CCCB0, 0x004CE2B0, 0x004CF430, 0x004D5D70, 0x004F3390, 0x00506000, 0x00506320, 0x00506530, 0x00506730, 0x005295B0, 0x00529950, 0x0052F300, 0x0053F670, 0x00548F50, 0x0055A130, 0x0055A370, 0x005605F0, 0x005609A0, 0x00560BB0, 0x00560DB0, 0x00567610, 0x00576240, 0x00592D10, 0x005B63F0, 0x005C1790, 0x005C8530, 0x005C8730, 0x005D26B0, 0x005F0750, 0x005F3FE0, 0x005F6150, 0x005F63A0, 0x005FCD70, 0x00618320, 0x00618550, 0x00618780, 0x00670210, 0x006702D0, 0x006703C0, 0x00670480, 0x00670570, 0x00670670, 0x00670760, 0x00670820, 0x00670910, 0x006709D0, 0x00670AC0, 0x00670B80, 0x00670C70, 0x00670D30, 0x00670E20, 0x00670EE0, 0x00670FD0, 0x006710E0, 0x006711D0, 0x00671290, 0x00671380, 0x00671440, 0x006715F0, 0x006716B0, 0x006717A0, 0x00671860, 0x00671950, 0x00671A10, 0x00671B00, 0x00671BC0, 0x006BC140, 0x006BEF20, 0x006C2BE0, 0x006C3080, 0x006C8520, 0x006E64C0, 0x006E65D0, 0x006F3E00, 0x006F3E60, 0x006F3FC0, 0x006F41C0, 0x006F4410, 0x006F45D0, 0x006F4630, 0x00709E60, 0x0070A060, 0x007346A0, 0x007679A0, 0x00768C10, 0x0076D370, 0x00776B60, 0x007B0600, 0x007B70B0, 0x007C0C80, 0x007C0D70, 0x007DD750, 0x007DD940, 0x007E03F0, 0x007F2BC0, 0x007F5310, 0x0080A340, 0x0080A530, 0x00810FC0, 0x008111B0, 0x008113A0, 0x008131D0, 0x008133F0, 0x0081AE80, 0x0084A0A0, 0x0084B820, 0x008766F0, 0x008777F0, 0x0087BFB0]
// OFFSET: [0x0047C750, 0x0047C970, 0x00491FC0, 0x00496920, 0x004B8390, 0x004BB270, 0x004BC870, 0x004BC8D0, 0x004BE470, 0x004C04B0, 0x004CACF0, 0x004CCAC0, 0x004CCCB0, 0x004CE2B0, 0x004CF430, 0x004D5D70, 0x004F3390, 0x00506000, 0x00506320, 0x00506530, 0x00506730, 0x005295B0, 0x00529950, 0x0052F300, 0x0053F670, 0x00548F50, 0x0055A130, 0x0055A370, 0x005605F0, 0x005609A0, 0x00560BB0, 0x00560DB0, 0x00567610, 0x00576240, 0x00592D10, 0x005B63F0, 0x005C1790, 0x005C8530, 0x005C8730, 0x005D26B0, 0x005F0750, 0x005F3FE0, 0x005F6150, 0x005F6340, 0x005F63A0, 0x005FCD70, 0x00618320, 0x00618550, 0x00618780, 0x00670210, 0x006702D0, 0x006703C0, 0x00670480, 0x00670570, 0x00670670, 0x00670760, 0x00670820, 0x00670910, 0x006709D0, 0x00670AC0, 0x00670B80, 0x00670C70, 0x00670D30, 0x00670E20, 0x00670EE0, 0x00670FD0, 0x006710E0, 0x006711D0, 0x00671290, 0x00671380, 0x00671440, 0x006715F0, 0x006716B0, 0x006717A0, 0x00671860, 0x00671950, 0x00671A10, 0x00671B00, 0x00671BC0, 0x006BC140, 0x006BEF20, 0x006C2BE0, 0x006C3080, 0x006C8520, 0x006E64C0, 0x006E65D0, 0x006F3E00, 0x006F3E60, 0x006F3FC0, 0x006F41C0, 0x006F4410, 0x006F45D0, 0x006F4630, 0x00709E60, 0x0070A060, 0x007346A0, 0x007679A0, 0x00768C10, 0x0076D370, 0x00776B60, 0x007B0600, 0x007B70B0, 0x007C0C80, 0x007C0D70, 0x007DD750, 0x007DD940, 0x007E03F0, 0x007F2BC0, 0x007F5310, 0x0080A340, 0x0080A530, 0x00810FC0, 0x008111B0, 0x008113A0, 0x008131D0, 0x008133F0, 0x0081AE80, 0x0084A0A0, 0x0084B820, 0x008766F0, 0x008777F0, 0x0087BFB0]
template <class T, class TKey>
TSHashTable<T, TKey>::TSHashTable() {
this->m_fullnessIndicator = 0;
@@ -0,0 +1,21 @@
#include "IOFileUnit.h"
namespace Storm {
// VERIFY: 5941ff82 manual
// OFFSET: 0x006B9DD0
void IORefcount::Release() {
IORefcount* refcount = this;
do {
IORefcount* next = refcount->m_refcount;
if (--refcount->m_count == 0) {
delete refcount;
}
refcount = next;
} while (refcount);
}
}
@@ -8,6 +8,10 @@ namespace Storm {
class IORefcount {
public:
/* 0004 */ IORefcount* m_refcount;
/* 0008 */ int32_t m_count;
virtual ~IORefcount();
void Release();
};
+12
View File
@@ -227,3 +227,15 @@ C3Vector operator*(const C3Vector& l, float r) {
result.z = r * l.z;
return result;
}
// VERIFY: ac16577f auto
// OFFSET: 0x007E2CE0
void C3Vector::Minimize(const C3Vector& v) {
*this = C3Vector::Min(*this, v);
}
// VERIFY: 1831a383 auto
// OFFSET: 0x007E2D20
void C3Vector::Maximize(const C3Vector& v) {
*this = C3Vector::Max(*this, v);
}
+2
View File
@@ -31,6 +31,8 @@ class C3Vector {
C3Vector(const CImVector& color);
EAxis MajorAxis() const;
EAxis MinorAxis() const;
void Maximize(const C3Vector& v);
void Minimize(const C3Vector& v);
void Normalize();
void NormalizeSafe();
float SquaredMag() const;
+15
View File
@@ -640,6 +640,21 @@ CSoftFloat CSoftFloat::Ceil(const CSoftFloat& value) {
return result;
}
// VERIFY: d339c8ab manual
// OFFSET: 0x0095D620
CSoftFloat CSoftFloat::FromRatio(int32_t numerator, int32_t denominator) {
CSoftFloat den = CSoftFloat::FromInt(denominator);
CSoftFloat num = CSoftFloat::FromInt(numerator);
if (num.m_bits == den.m_bits) {
CSoftFloat result;
result.m_bits = 0x3F800000;
return result;
}
return num * CSoftFloat::Reciprocal(den);
}
// VERIFY: 4edb999a auto
// OFFSET: 0x0095D590
CSoftFloat CSoftFloat::Round(const CSoftFloat& value) {
+1
View File
@@ -34,6 +34,7 @@ class CSoftFloat {
static uint32_t CountLeadingZeros(uint32_t value);
static CSoftFloat Floor(const CSoftFloat& value);
static CSoftFloat FromInt(int32_t value);
static CSoftFloat FromRatio(int32_t numerator, int32_t denominator);
static CSoftFloat Reciprocal(const CSoftFloat& value);
static CSoftFloat Round(const CSoftFloat& value);
+1 -1
View File
@@ -226,7 +226,7 @@ static uint32_t s_numPatchArchives;
static uint32_t s_firstBaseArchive;
// STATIC: 0x00B2FA30
CRndSeed g_rndSeed;
CRndSeed g_rndSeed(0);
// STATIC: 0x00B2FA38
static TSGrowableArray<SArchive*> s_archiveHandles;
+1 -1
View File
@@ -1,6 +1,6 @@
#include "CreatureStats_C.h"
// VERIFY: 54ac2c6d manual
// OFFSET: 0x00667F40
// OFFSET: [0x00667F40, 0x00668830]
CreatureStats_C::~CreatureStats_C() {
}
@@ -546,6 +546,33 @@ NameCache* DBCache<NameCache, uint64_t, CHashKeyGUID>::GetRecordByName(const cha
return entry ? entry->m_record : nullptr;
}
// INLINED
template <>
DBCache<PetNameCache, int32_t, HASHKEY_INT>::REVERSEENTRY* DBCache<PetNameCache, int32_t, HASHKEY_INT>::FindReverseEntry(const char* name) {
if (this->m_reverse.m_slotmask == 0xFFFFFFFF) {
return nullptr;
}
uint32_t hashval = SStrHashHT(name);
TSExplicitList<REVERSEENTRY>& list = this->m_reverse.m_slotlistarray[hashval & this->m_reverse.m_slotmask];
for (REVERSEENTRY* entry = list.Head(); entry; entry = list.Next(entry)) {
if (entry->m_hashval == hashval && (entry->m_key.m_str == name || !SStrCmpUTF8I(entry->m_key.m_str, name, STORM_MAX_STR))) {
return entry;
}
}
return nullptr;
}
// VERIFY: cb2e9c40 auto
// OFFSET: 0x006701F0
template <>
PetNameCache* DBCache<PetNameCache, int32_t, HASHKEY_INT>::GetRecordByName(const char* name) {
REVERSEENTRY* entry = this->FindReverseEntry(name);
return entry ? entry->m_record : nullptr;
}
// VERIFY: fd608d3a manual
// OFFSET: 0x00678F20
template <>
@@ -49,6 +49,9 @@ DBCache<NameCache, uint64_t, CHashKeyGUID>::REVERSEENTRY* DBCache<NameCache, uin
template <>
NameCache* DBCache<NameCache, uint64_t, CHashKeyGUID>::GetRecordByName(const char* name);
template <>
PetNameCache* DBCache<PetNameCache, int32_t, HASHKEY_INT>::GetRecordByName(const char* name);
template <>
void DBCache<NameCache, uint64_t, CHashKeyGUID>::RemoveReverseEntry(const char* name);
+254
View File
@@ -1,4 +1,15 @@
#include "WoW/Source/Game/DeclinedWords.h"
#include <cstring>
#include "Engine/Source/Frame/CSimpleRender.h"
#include "Engine/Source/Storm/H/storm.h"
#include "WoW/Source/Client.h"
#include "WoW/Source/DB/DBClient/DBCacheInstances.h"
#include "WoW/Source/DB/DBClient/DBClient.h"
#include "WoW/Source/DB/Rec/DeclinedWordCasesRec.h"
#include "WoW/Source/DB/Rec/DeclinedWordRec.h"
#include "WoW/Source/Game/GameClient/NameCache.h"
#include "WoW/Source/Game/GameClient/PetNameCache.h"
#include "WoW/Source/Game/ValidateName.h"
// STATIC: 0x00D37DE4
static TSHashTable<DECLINEDWORD, HASHKEY_CONSTSTRI> s_declinedWords;
@@ -8,3 +19,246 @@ static TSHashTable<DECLINEDWORD, HASHKEY_CONSTSTRI> s_declinedWords;
void DeclinedWordsDestroy() {
s_declinedWords.Clear();
}
// VERIFY: a01d8da3 manual
// OFFSET: 0x007E08E0
void DeclinedWordsInitialize() {
g_declinedWordDB.Load(__FILE__, __LINE__);
g_declinedWordCasesDB.Load(__FILE__, __LINE__);
int32_t caseIndex = 0;
DeclinedWordCasesRec* cases = g_declinedWordCasesDB.m_numRecords <= 0 ? nullptr : g_declinedWordCasesDB.m_records;
for (int32_t i = 0; i < g_declinedWordDB.m_numRecords; i++) {
DeclinedWordRec* word = g_declinedWordDB.GetRecordByIndex(i);
if (!cases) {
continue;
}
while (cases->m_declinedWordID < word->m_id) {
cases = g_declinedWordCasesDB.GetRecordByIndex(++caseIndex);
if (!cases) {
break;
}
}
if (cases && cases->m_declinedWordID == word->m_id) {
DECLINEDWORD* entry = s_declinedWords.New(word->m_word, 0, 0);
entry->m_wordId = word->m_id;
entry->m_caseIndex = caseIndex;
}
}
}
// VERIFY: a1a88ad6 manual
// OFFSET: 0x007E0A50
int32_t GetDeclinedWord(const char* word, int32_t declension, char* buffer, uint32_t bufferSize) {
if (!s_declinedWords.m_fulllist.Head()) {
DeclinedWordsInitialize();
}
const char* src = word;
char c = *src;
if (c != '|') {
if (!NameNeedsDeclensions(s_locale, word)) {
return SStrCopy(buffer, word, bufferSize);
}
int32_t index = declension - 1;
if (static_cast<uint32_t>(index) <= 4) {
NameCache* name = g_nameDBCache.GetRecordByName(word);
if (name && name->m_declinedNames) {
return SStrCopy(buffer, name->m_declinedNames->m_names[index], bufferSize);
}
PetNameCache* pet = g_petNameCache.GetRecordByName(word);
if (pet && pet->m_declinedNames) {
return SStrCopy(buffer, pet->m_declinedNames->m_names[index], bufferSize);
}
}
DECLINEDWORD* entry = s_declinedWords.Ptr(word);
if (entry) {
int32_t caseIndex = entry->m_caseIndex;
int32_t wordId = entry->m_wordId;
for (DeclinedWordCasesRec* rec = g_declinedWordCasesDB.GetRecordByIndex(caseIndex); rec && rec->m_declinedWordID == wordId && rec->m_caseIndex <= declension; rec = g_declinedWordCasesDB.GetRecordByIndex(++caseIndex)) {
if (rec->m_caseIndex == declension) {
return SStrCopy(buffer, rec->m_declinedWord, bufferSize);
}
}
return SStrCopy(buffer, word, bufferSize);
}
const char* dash = SStrChr(word, '-');
if (dash) {
char prefix[1024];
uint32_t length = dash - word;
if (length > sizeof(prefix) - 1) {
length = sizeof(prefix) - 1;
}
memcpy(prefix, word, length);
prefix[length] = '\0';
if (index < 0) {
return SStrCopy(buffer, word, bufferSize);
}
if (index < 5) {
NameCache* name = g_nameDBCache.GetRecordByName(prefix);
if (name && name->m_declinedNames) {
uint32_t count = SStrCopy(buffer, name->m_declinedNames->m_names[index], bufferSize);
return count + SStrCopy(&buffer[count], dash, bufferSize - count);
}
PetNameCache* pet = g_petNameCache.GetRecordByName(prefix);
if (pet && pet->m_declinedNames) {
uint32_t count = SStrCopy(buffer, pet->m_declinedNames->m_names[index], bufferSize);
return count + SStrCopy(&buffer[count], dash, bufferSize - count);
}
}
}
char declensions[5][1024];
if (index <= 4 && GetNameDeclensions(s_locale, declensions[0], word, 2, 0)) {
return SStrCopy(buffer, declensions[index], bufferSize);
}
return SStrCopy(buffer, word, bufferSize);
}
char* dest = buffer;
uint32_t count = 0;
while (c == '|') {
if (count < bufferSize) {
*dest++ = '|';
count++;
}
c = *++src;
if (c == 'C' || c == 'c') {
if (count < bufferSize) {
*dest++ = c;
count++;
}
src++;
uint32_t length = 0;
while (*src) {
if (count < bufferSize) {
*dest++ = *src;
count++;
}
length++;
src++;
if (length >= 8) {
break;
}
}
if (length < 8) {
break;
}
} else if (c == 'H' || c == 'T') {
char end = c == 'H' ? 'h' : 't';
while (c != '|' || src[1] != end) {
if (count < bufferSize) {
*dest++ = c;
count++;
}
c = *++src;
if (!c) {
break;
}
}
if (!c) {
break;
}
if (count < bufferSize) {
*dest++ = *src;
count++;
}
src++;
if (count < bufferSize) {
*dest++ = *src;
count++;
}
src++;
} else {
if (count < bufferSize) {
*dest++ = c;
count++;
}
src++;
}
c = *src;
if (!c) {
break;
}
}
if (*src == '[') {
if (count < bufferSize) {
*dest++ = '[';
count++;
}
src++;
}
char inner[1024];
char* innerEnd = inner;
for (uint32_t length = 0; *src && *src != ']' && *src != '|' && length < sizeof(inner) - 1; length++) {
*innerEnd++ = *src++;
}
*innerEnd = '\0';
uint32_t length = GetDeclinedWord(inner, declension, dest, bufferSize - count);
dest += length;
count += length;
for (c = *src; c; c = *++src) {
if (count < bufferSize) {
*dest++ = c;
count++;
}
}
if (count == bufferSize) {
dest--;
}
*dest = '\0';
return count;
}
+1
View File
@@ -10,5 +10,6 @@ struct DECLINEDWORD : public TSHashObject<DECLINEDWORD, HASHKEY_CONSTSTRI> {
};
void DeclinedWordsDestroy();
void DeclinedWordsInitialize();
#endif
@@ -112,8 +112,6 @@ void ComSatClient_Shutdown();
void UpdatePushToTalkKey();
int32_t VoiceChat_TickWrapper(const void* data, void* param);
int32_t Script_VoiceGetCurrentOutputDevice(lua_State* L);
int32_t Script_SetActiveVoiceChannelBySessionID(lua_State* L);
int32_t Script_GetVoiceSessionMemberInfoBySessionID(lua_State* L);
extern int32_t s_comsatDisabledByClient;
@@ -8,6 +8,9 @@
#include "Engine/Source/Storm/Source/SLock.h"
#include <cstring>
// STATIC: 0x00D31A8C
static int32_t s_currentOutputDevice;
// STATIC: 0x00D31A90
static int32_t s_currentCaptureDevice;
@@ -320,6 +323,53 @@ static int32_t Script_GetVoiceStatus(lua_State* L) {
}
// STATIC: 0x00AF29C0
// VERIFY: fa0885a1 manual
// OFFSET: 0x007DAF90
static int32_t Script_VoiceGetCurrentOutputDevice(lua_State* L) {
if (ComSatThread::s_comsat) {
lua_pushnumber(L, s_currentOutputDevice);
} else {
lua_pushnumber(L, -1.0);
}
return 1;
}
// VERIFY: 1197ff58 manual
// OFFSET: 0x007DB280
static int32_t Script_SetActiveVoiceChannelBySessionID(lua_State* L) {
if (!lua_isnumber(L, 1)) {
lua_pushnil(L);
return 1;
}
int32_t id = static_cast<int32_t>(lua_tonumber(L, 1));
if (id <= 0) {
CGChat::SetActiveVoiceSession(nullptr, 4, -1);
lua_pushnumber(L, 1.0);
return 1;
}
if (id >= 32) {
lua_pushnil(L);
return 1;
}
int32_t count = 0;
for (int32_t i = 0; i < 32; i++) {
if (s_comsatData[i].m_sessionID && ++count == id) {
CGChat::SetActiveVoiceSession(s_comsatData[i].m_name, s_comsatData[i].m_type, -1);
lua_pushnumber(L, 1.0);
return 1;
}
}
lua_pushnil(L);
return 1;
}
static FrameScript_Method s_ScriptFunctions[] = {
{ "VoiceEnumerateOutputDevices", &Script_VoiceEnumerateOutputDevices },
{ "VoiceEnumerateCaptureDevices", &Script_VoiceEnumerateCaptureDevices },
+175 -1
View File
@@ -18,6 +18,8 @@
#include "WoW/Source/Game/GameClient/PassFogSeed.h"
#include "WoW/Source/Game/GameClient/PassPropagateFog.h"
#include "WoW/Source/Game/GameClient/PassFogCombine.h"
#include "WoW/Source/WorldClient/FrameTime.h"
#include "Engine/Source/Tempest/C44Matrix.h"
// STATIC: 0x00D38140
static uint32_t* s_seedTexels;
@@ -72,7 +74,7 @@ PassDeath::PassDeath(FFX::Tex** inputs, uint32_t count, FFX::Tex* output, EGxBle
}
// VERIFY: 5970ea32 manual
// OFFSET: 0x007E8770
// OFFSET: [0x007E8770, 0x007E9920]
PassDeath::~PassDeath() {
for (uint32_t i = 0; i < sizeof(this->m_shaders) / sizeof(this->m_shaders[0]); i++) {
if (this->m_shaders[i]) {
@@ -87,6 +89,43 @@ PassDeathNVRC::PassDeathNVRC(FFX::Tex** inputs, uint32_t count, FFX::Tex* output
g_theGxDevicePtr->ShaderCreate(&this->m_shader, GxSh_Pixel, "Shaders\\Pixel", "FFXDeath_nvrc", 1);
}
// VERIFY: b3213b19 manual
// OFFSET: 0x007E9950
PassDeathNVRC::~PassDeathNVRC() {
if (this->m_shader) {
g_theGxDevicePtr->ShaderDestroy(this->m_shader);
}
}
// VERIFY: 7ab3fdf0 manual
// OFFSET: 0x007E8970
bool PassDeathNVRC::Valid() {
return this->m_shader && this->m_shader->Valid();
}
// VERIFY: 45689fc4 manual
// OFFSET: 0x007E99A0
void PassDeathNVRC::Execute() {
FFX::SetupGx(this->m_output);
FFX::SetupGeo_Quad(this->m_output->m_size, this->m_inputs[0]->m_size, this->m_inputs[0]->m_texSize, FFX::s_gridPos, FFX::s_gridTex, this->unk_002C);
CImVector color;
color.b = 0xA8;
color.g = 0x93;
color.r = 0x53;
color.a = 0xFF;
GxPrimVertexPtr(4, FFX::s_gridPos, sizeof(C3Vector), nullptr, 0, &color, 0, FFX::s_gridTex, sizeof(C2Vector), nullptr, 0);
GxPrimIndexPtr(4, FFX::s_quadIndices);
g_theGxDevicePtr->RsSet(GxRs_Texture0, TextureGetGxTex(this->m_inputs[0]->m_texture, 1, nullptr));
g_theGxDevicePtr->RsSet(GxRs_PixelShader, this->m_shader);
GxRsSet(GxRs_BlendingMode, this->m_blend);
GxUpdateAlphaRef(GxRs_AlphaRef);
g_theGxDevicePtr->Draw(&FFX::s_quadBatch, 1);
FFX::SetupReset();
}
// VERIFY: 22ef7cce manual
// OFFSET: 0x007EA260
EffectDeath::EffectDeath() {
@@ -369,3 +408,138 @@ EffectSwirlingFog::~EffectSwirlingFog() {
this->m_seedTex.m_texelSize.x = 0.0f;
this->m_seedTex.m_texelSize.y = 0.0f;
}
// STATIC: 0x00D38150
static float s_netherBlurPhase;
// VERIFY: 487db931 manual
// OFFSET: 0x007E9B10
void PassNetherBlur::Execute() {
float scale = 8.0f;
float elapsed = FrameTime::s_tickTimeSec;
s_netherBlurPhase = static_cast<float>(fmod(elapsed + elapsed + s_netherBlurPhase, 6.2831854820251465));
const C44Matrix* view = FFX::GetOldViewMtx();
float x = (view->c0 + view->b0) * 0.0f + view->a0;
float y = (view->c1 + view->b1) * 0.0f + view->a1;
float z = (view->c2 + view->b2) * 0.0f + view->a2;
if (fabs(z) > 0.000099999997f) {
float inv = 1.0f / z;
x *= inv;
y *= inv;
}
float invLength = 1.0f / sqrt(y * y + x * x);
x *= invLength;
y *= invLength;
float angle = static_cast<float>(acos(x));
if (y < 0.0f) {
angle = 6.2831855f - angle;
}
angle = static_cast<float>(cos(s_netherBlurPhase) * 0.5f + angle);
if (this->unk_0280 > 1.0f) {
this->unk_0280 = static_cast<float>(fmod(this->unk_0280, 1.0));
float* oldest = this->m_noiseTables[0];
this->m_noiseTables[0] = this->m_noiseTables[1];
this->m_noiseTables[1] = this->m_noiseTables[2];
this->m_noiseTables[2] = oldest;
for (uint32_t i = 0; i < 36; i++) {
uint32_t bits = (CRandom::uint32_(this->m_seed) & 0x7FFFFF) | 0x3F800000;
float random = *reinterpret_cast<float*>(&bits) - 1.0f;
this->m_noiseTables[2][i] = static_cast<float>(fmod(random + random - 1.0f, 1.0));
}
}
for (uint32_t i = 0; i < 36; i++) {
this->unk_01E4[i] = (1.0f - this->unk_0280) * this->m_noiseTables[0][i] + this->m_noiseTables[1][i] * this->unk_0280;
}
this->unk_0280 = elapsed * 1.5f + this->unk_0280;
FFX::SetupGx(this->m_output);
if (!FFX::s_useRECT) {
FFX::SetupGeo_Grid(this->m_output->m_size, this->m_inputs[0]->m_size, this->m_inputs[0]->m_texSize, FFX::s_gridPos, FFX::s_gridTex, 6, this->unk_002C);
FFX::SetupVB_PCT(36, FFX::s_gridPos, FFX::s_gridTex, this->unk_01E4);
}
g_theGxDevicePtr->PrimVertexMask(0x51);
FFX::SetupIB(6, 6);
g_theGxDevicePtr->RsSet(GxRs_VertexShader, this->m_vertexShader);
g_theGxDevicePtr->RsSet(GxRs_PixelShader, this->m_pixelShaders[this->m_useRect]);
float constants[4];
constants[0] = angle;
constants[1] = 0.0f;
constants[2] = 0.0f;
constants[3] = 0.0f;
g_theGxDevicePtr->ShaderConstantsSet(GxSh_Vertex, 0, constants, 1);
if (FFX::s_useRECT) {
scale = 4.0f;
constants[0] = 4.0f;
constants[1] = 4.0f;
} else {
constants[0] = 8.0f * this->m_inputs[0]->m_texelSize.x;
constants[1] = this->m_inputs[0]->m_texelSize.y * 8.0f;
}
constants[2] = 0.0f;
constants[3] = 0.0f;
g_theGxDevicePtr->ShaderConstantsSet(GxSh_Vertex, 1, constants, 1);
float convergence = g_theGxDevicePtr->StereoGetConvergence();
g_theGxDevicePtr->ShaderConstantsSet(GxSh_Vertex, 2, &convergence, 1);
CGxTex* target = TextureGetGxTex(FFX::s_quart[1].m_texture, 1, nullptr);
GxRsSet(GxRs_ScissorTest, 0);
g_theGxDevicePtr->DeviceSetRenderTarget(GxBuffers_Color, target, 0);
GxXformSetViewport(0.0f, static_cast<float>(FFX::s_quart[1].m_size.x) / FFX::s_quart[1].m_texSize.x, 0.0f, static_cast<float>(FFX::s_quart[1].m_size.y) / FFX::s_quart[1].m_texSize.y, 0.0f, 1.0f);
GxSceneClear(1, CImVector(0xFF, 0xFF, 0xFF, 0xFF));
g_theGxDevicePtr->RsSet(GxRs_Texture0, TextureGetGxTex(this->m_inputs[0]->m_texture, 1, nullptr));
g_theGxDevicePtr->RsSet(GxRs_Texture1, TextureGetGxTex(this->m_inputs[0]->m_texture, 1, nullptr));
g_theGxDevicePtr->RsSet(GxRs_Texture2, TextureGetGxTex(this->m_inputs[0]->m_texture, 1, nullptr));
g_theGxDevicePtr->RsSet(GxRs_Texture3, TextureGetGxTex(this->m_inputs[0]->m_texture, 1, nullptr));
if (FFX::s_useRECT) {
FFX::SetupGeo_Grid(FFX::s_quart[1].m_size, this->m_inputs[0]->m_size, this->m_inputs[0]->m_texSize, FFX::s_gridPos, FFX::s_gridTex, 6, this->unk_002C);
FFX::SetupVB_PCT(36, FFX::s_gridPos, FFX::s_gridTex, this->unk_01E4);
}
g_theGxDevicePtr->Draw(&FFX::s_gridBatch, 1);
target = TextureGetGxTex(this->m_output->m_texture, 1, nullptr);
GxRsSet(GxRs_ScissorTest, 0);
g_theGxDevicePtr->DeviceSetRenderTarget(GxBuffers_Color, target, 0);
GxXformSetViewport(0.0f, static_cast<float>(this->m_output->m_size.x) / this->m_output->m_texSize.x, 0.0f, static_cast<float>(this->m_output->m_size.y) / this->m_output->m_texSize.y, 0.0f, 1.0f);
GxSceneClear(1, CImVector(0xFF, 0xFF, 0xFF, 0xFF));
g_theGxDevicePtr->RsSet(GxRs_Texture0, TextureGetGxTex(FFX::s_quart[1].m_texture, 1, nullptr));
g_theGxDevicePtr->RsSet(GxRs_Texture1, TextureGetGxTex(FFX::s_quart[1].m_texture, 1, nullptr));
g_theGxDevicePtr->RsSet(GxRs_Texture2, TextureGetGxTex(FFX::s_quart[1].m_texture, 1, nullptr));
g_theGxDevicePtr->RsSet(GxRs_Texture3, TextureGetGxTex(FFX::s_quart[1].m_texture, 1, nullptr));
if (FFX::s_useRECT) {
constants[0] = 0.0f;
constants[1] = 0.0f;
constants[2] = 0.0f;
constants[3] = 0.0f;
constants[0] = this->m_inputs[0]->m_texelSize.x / FFX::s_quart[1].m_texelSize.x * scale;
constants[1] = scale * (this->m_inputs[0]->m_texelSize.y / FFX::s_quart[1].m_texelSize.y);
constants[2] = 0.0f;
constants[3] = 0.0f;
g_theGxDevicePtr->ShaderConstantsSet(GxSh_Vertex, 1, constants, 1);
FFX::SetupGeo_Grid(this->m_output->m_size, FFX::s_quart[1].m_size, FFX::s_quart[1].m_texSize, FFX::s_gridPos, FFX::s_gridTex, 6, this->unk_002C);
FFX::SetupVB_PCT(36, FFX::s_gridPos, FFX::s_gridTex, this->unk_01E4);
}
g_theGxDevicePtr->Draw(&FFX::s_gridBatch, 1);
FFX::SetupReset();
}
@@ -1,5 +1,9 @@
#include "PassFogSeed.h"
#include "Engine/Source/Gx/CGxDevice/CGxDevice.h"
#include "Engine/Source/Gx/CGxBuf.h"
#include "Engine/Source/Gx/Gx.h"
#include "Engine/Source/Services/Texture.h"
#include "Engine/Source/Tempest/CImVector.h"
// STATIC: 0x00AF4938
static uint32_t s_deviceRestored;
@@ -23,3 +27,91 @@ PassFogSeed::PassFogSeed(FFX::Tex** inputs, uint32_t count, FFX::Tex* output, EG
PassFogSeed::~PassFogSeed() {
g_theGxDevicePtr->RemoveDeviceRestoredCallback(PassFogSeed::DeviceRestoredCallback);
}
// VERIFY: 0d91b22f manual
// OFFSET: 0x007E92A0
void PassFogSeed::Execute() {
CGxBuf* buf = g_theGxDevicePtr->BufStream(GxPoolTarget_Vertex, 20, 4);
float* vertices = reinterpret_cast<float*>(g_theGxDevicePtr->BufLock(buf));
vertices[0] = 0.0f;
vertices[1] = 3.0f;
vertices[2] = 0.0f;
vertices[5] = 0.0f;
vertices[6] = 4.0f;
vertices[7] = 0.0f;
vertices[10] = static_cast<float>(this->m_output->m_size.x);
vertices[11] = 4.0f;
vertices[12] = 0.0f;
vertices[15] = static_cast<float>(this->m_output->m_size.x);
vertices[16] = 3.0f;
vertices[17] = 0.0f;
FFX::Tex* input = this->m_inputs[0];
float invWidth = 1.0f / input->m_texSize.x;
float right = (input->m_size.x + 0.5f) * invWidth;
float invHeight = 1.0f / input->m_texSize.y;
float row = ((input->m_size.y + 0.5f) * invHeight - 0.5f * invHeight) / input->m_size.y * this->unk_0030 + 0.5f * invHeight;
float left = 0.5f * invWidth;
vertices[3] = left;
vertices[4] = row;
vertices[8] = left;
vertices[9] = row;
vertices[14] = row;
vertices[13] = right;
vertices[18] = right;
vertices[19] = row;
g_theGxDevicePtr->BufUnlock(buf, 0);
buf->unk_001C = 1;
FFX::SetupGx(this->m_output);
if (s_deviceRestored) {
GxSceneClear(1, CImVector(0, 0, 0, 0));
s_deviceRestored = 0;
}
GxPrimVertexPtr(buf, GxVBF_PT);
g_theGxDevicePtr->PrimVertexMask(0x41);
FFX::SetupIB();
GxRsSet(GxRs_MatDiffuse, static_cast<int32_t>(this->unk_0034));
g_theGxDevicePtr->RsSet(GxRs_Texture0, TextureGetGxTex(this->m_inputs[0]->m_texture, 1, nullptr));
for (int32_t state = GxRs_Texture1; state <= GxRs_Texture15; state++) {
GxRsSet(static_cast<EGxRenderState>(state), 0);
}
GxRsSet(GxRs_PixelShader, 0);
GxRsSet(GxRs_BlendingMode, this->m_blend);
GxUpdateAlphaRef(GxRs_AlphaRef);
g_theGxDevicePtr->Draw(&FFX::s_quadBatch, 1);
buf = g_theGxDevicePtr->BufStream(GxPoolTarget_Vertex, 12, 4);
vertices = reinterpret_cast<float*>(g_theGxDevicePtr->BufLock(buf));
vertices[0] = 0.0f;
vertices[1] = 0.0f;
vertices[2] = 0.0f;
vertices[3] = 0.0f;
vertices[4] = 3.0f;
vertices[5] = 0.0f;
vertices[6] = static_cast<float>(this->m_output->m_size.x);
vertices[7] = 3.0f;
vertices[8] = 0.0f;
vertices[9] = static_cast<float>(this->m_output->m_size.x);
vertices[10] = 0.0f;
vertices[11] = 0.0f;
g_theGxDevicePtr->BufUnlock(buf, 0);
buf->unk_001C = 1;
GxPrimVertexPtr(buf, GxVBF_P);
g_theGxDevicePtr->PrimVertexMask(0x1);
GxRsSet(GxRs_Texture0, 0);
FFX::SetupIB();
g_theGxDevicePtr->Draw(&FFX::s_quadBatch, 1);
FFX::SetupReset();
if (this->unk_0030 < static_cast<uint32_t>(this->m_inputs[0]->m_texSize.y)) {
this->unk_0030++;
} else {
this->unk_0030 = 0;
}
}
+6
View File
@@ -208,3 +208,9 @@ TIMESTAMPCALLBACK* CGameTime::GameTimeRegisterCallback(const WowTime* time, void
node->m_callback = callback;
return node;
}
// VERIFY: 6e0cf24b manual
// OFFSET: 0x004C9730
TIMESTAMPSTRUCT::~TIMESTAMPSTRUCT() {
this->m_callbacks.Clear();
}
+99
View File
@@ -758,6 +758,105 @@ bool CGlueMgr::AgreementsURLCallback(void* param, const char* data, uint32_t siz
return true;
}
// VERIFY: 644e39b6 manual
// OFFSET: 0x004D7940
void ProcessAgreement(SFileImpl* file, const char* name, CVar* cvar, bool localized) {
char path[264];
SStrCopy(path, "data", STORM_MAX_STR);
SStrPack(path, "\\", STORM_MAX_STR);
if (localized) {
SStrPack(path, s_localeCode, STORM_MAX_STR);
SStrPack(path, "\\", STORM_MAX_STR);
}
SStrPack(path, name, STORM_MAX_STR);
void* existing = nullptr;
uint32_t existingSize = 0;
if (OsFileExists(path)) {
HOSFILE input = OsCreateFile(path, OS_GENERIC_READ, 3, OS_OPEN_EXISTING, OS_FILE_ATTRIBUTE_NORMAL, OS_FILE_TYPE_ANY);
if (input != OS_INVALID_FILE) {
uint32_t size = static_cast<uint32_t>(OsGetFileSize(input));
existing = SMemAlloc(size, __FILE__, __LINE__, 0);
if (existing) {
OsReadFile(input, existing, size, &existingSize);
}
OsCloseFile(input);
}
}
uint32_t size = SFileGetFileSize(file, nullptr);
void* data = SMemAlloc(size, __FILE__, __LINE__, 0);
if (!data) {
if (existing) {
SMemFree(existing, __FILE__, __LINE__, 0);
}
return;
}
uint32_t read = 0;
if (!SFileReadFile(file, data, size, &read, nullptr, 0)) {
SMemFree(data, __FILE__, __LINE__, 0);
if (existing) {
SMemFree(existing, __FILE__, __LINE__, 0);
}
return;
}
if (existingSize == read && !memcmp(existing, data, existingSize)) {
SMemFree(data, __FILE__, __LINE__, 0);
if (existing) {
SMemFree(existing, __FILE__, __LINE__, 0);
}
return;
}
if (existing) {
SMemFree(existing, __FILE__, __LINE__, 0);
}
if (OsFileExists(path) && !OsDeleteFile(path)) {
SMemFree(data, __FILE__, __LINE__, 0);
return;
}
HOSFILE output = OsCreateFile(path, OS_GENERIC_WRITE, 0, OS_CREATE_ALWAYS, OS_FILE_ATTRIBUTE_NORMAL, OS_FILE_TYPE_ANY);
if (output == OS_INVALID_FILE) {
SMemFree(data, __FILE__, __LINE__, 0);
return;
}
uint32_t written = 0;
if (!OsWriteFile(output, data, read, &written) || read != written) {
SMemFree(data, __FILE__, __LINE__, 0);
OsCloseFile(output);
return;
}
SMemFree(data, __FILE__, __LINE__, 0);
OsCloseFile(output);
if (cvar->m_intValue >= 1) {
cvar->Set("-1", true, false, false, true);
} else {
cvar->Set("-2", true, false, false, true);
}
}
// VERIFY: 42fb8ddc manual
// OFFSET: 0x004DB9F0
void CGlueMgr::Initialize() {
+3
View File
@@ -9,6 +9,8 @@
#include "WoW/Source/Net/Types.h"
#include "WoW/Source/WowServices/Types.h"
class CVar;
class SFileImpl;
class CDataStore;
struct CHARACTER_CREATE_INFO;
class CHARACTER_INFO;
@@ -176,5 +178,6 @@ extern const uint8_t InterfaceKey[256];
void CancelRealmListQuery();
CharacterSelectionDisplay* GetCharacterInfo(int32_t index);
void ProcessAgreement(SFileImpl* file, const char* name, CVar* cvar, bool localized);
#endif
+1 -1
View File
@@ -116,7 +116,7 @@ void CSimpleModelFFX::Render(void* arg) {
}
// VERIFY: 68232335 manual
// OFFSET: 0x004E6230
// OFFSET: [0x004E6230, 0x004E62D0]
CSimpleModelFFX::~CSimpleModelFFX() {
}
+2 -1
View File
@@ -31,7 +31,8 @@ int32_t Liquid::s_unk_D43AF8;
// STATIC: 0x00D43AFC
int32_t Liquid::s_unk_D43AFC;
// INLINED
// VERIFY: 96a38663 manual
// OFFSET: 0x008A32C0
Liquid::IEnvironment::~IEnvironment() {
}
+1 -1
View File
@@ -13,7 +13,7 @@ ItemStats_C::ItemStats_C() {
}
// VERIFY: 8d459023 manual
// OFFSET: 0x00668020
// OFFSET: [0x00668020, 0x00668860]
ItemStats_C::~ItemStats_C() {
for (uint32_t i = 0; i < 4; i++) {
if (this->m_name[i]) {
+23
View File
@@ -1956,6 +1956,29 @@ void CMovement_C::OnSwimStartLocal(uint32_t eventTime) {
this->AddPlayerMoveEvent(eventTime, MOVEEVENT_START_SWIM, true, 0, 0.0f, 0.0f, 0);
}
// VERIFY: a91c7c3b manual
// OFFSET: 0x006EEA50
void CMovement_C::OnSwimStopLocal(uint32_t eventTime) {
if (this->IsOnSpline()) {
this->StopSwim();
if ((this->m_flags & 0xC010FF) || this->m_moveQueue.Head()) {
if (!this->m_globalUnitsLink.IsLinked()) {
CMovementGlobals* globals = MovementGetGlobals();
if (globals) {
globals->m_movers.LinkToHead(this);
}
}
}
this->m_unit->ProcessLocalMoveEvent(eventTime, MSG_MOVE_STOP_SWIM, true, 0.0f, 0, 0, 255);
return;
}
this->AddPlayerMoveEvent(eventTime, MOVEEVENT_STOP_SWIM, true, 0, 0.0f, 0.0f, 0);
}
// VERIFY: 1011e33b auto
// OFFSET: 0x006F0F70
void CMovement_C::OnTurnStartLocal(uint32_t eventTime, int32_t left) {
+20
View File
@@ -717,6 +717,26 @@ static int32_t FindItemNameCallback(const CGItem_C* item, void* param) {
return SStrCmpUTF8I(name, fullName, length) == 0;
}
// VERIFY: 19b67d6e manual
// OFFSET: 0x00754AF0
CGItem_C* CGBag_C::FindItemByName(const char* name, uint32_t flags) {
if (!name || !*name) {
return nullptr;
}
WOWGUID container;
uint32_t slot;
if (!SStrStr(name, "item:")) {
return this->FindItem(&FindItemNameCallback, const_cast<char*>(name), container, slot, flags);
}
ItemLinkInfo link;
link.Clear();
link.GetItemIdFromLink(name);
return this->FindItem(&FindItemLinkCallback, &link, container, slot, flags);
}
// VERIFY: 57bdbcdf manual
// OFFSET: 0x00754B90
CGItem_C* CGBag_C::GetItemIdByName(const char* name, WOWGUID& container, uint32_t& slot, uint32_t flags) {
+1 -1
View File
@@ -38,7 +38,7 @@ class CGBag_C {
CGItem_C* FindItemOfType(int32_t itemId, uint32_t flags);
CGItem_C* FindItemOfClass(int32_t classId, uint32_t subclassMask, uint32_t flags);
CGItem_C* FindItem(int32_t (*callback)(const CGItem_C* item, void* param), void* param, uint32_t flags);
CGItem_C* FindItemByName(const char* name, uint32_t a2);
CGItem_C* FindItemByName(const char* name, uint32_t flags);
CGItem_C* FindItemByFullName(const char* name, uint32_t flags);
CGItem_C* GetItemIdByName(const char* name, WOWGUID& container, uint32_t& slot, uint32_t flags);
CGItem_C* GetItemPointer(int32_t slot);
@@ -1,4 +1,8 @@
#include "CGGameObject_C_Type_BarberChair.h"
#include "WoW/Source/Object/ObjectClient/Player_C.h"
#include "WoW/Source/Object/ObjectClient/Unit_C.h"
#include "WoW/Source/ObjectMgrClient/ObjectMgrClient.h"
#include "WoW/Source/Ui/Types.h"
// VERIFY: 7687419a manual
// OFFSET: 0x0070C7F0
@@ -10,3 +14,23 @@ CGGameObject_C_Type_BarberChair::CGGameObject_C_Type_BarberChair(CGGameObject_C*
uint32_t CGGameObject_C_Type_BarberChair::GetNumSlots() const {
return 1;
}
// VERIFY: 69c29ea6 manual
// OFFSET: 0x00711EB0
bool CGGameObject_C_Type_BarberChair::CanUseNow(GAME_ERROR_TYPE* error, float* distance, const char** errorText) const {
if (!CGGameObject_C_Type_Chair::CanUseNow(error, distance, errorText)) {
return false;
}
CGPlayer_C* player = ClntObjMgrGetActivePlayerObj();
if (player->m_unit->m_unitFieldDisplayid == player->m_unit->m_unitFieldNativedisplayid && !player->IsShapeShifted()) {
return true;
}
if (error) {
*error = static_cast<GAME_ERROR_TYPE>(ERR_NOT_WHILE_SHAPESHIFTED);
}
return false;
}
@@ -2,8 +2,10 @@
#include "WoW/Source/Object/GameObjectDef.h"
#include "WoW/Source/Object/GameObjectStats.h"
#include "Engine/Source/Tempest/C4Quaternion.h"
#include "WoW/Source/Object/ObjectClient/Player_C.h"
#include "WoW/Source/Object/ObjectClient/Unit_C.h"
#include "WoW/Source/ObjectMgrClient/ObjectMgrClient.h"
#include "WoW/Source/Ui/Types.h"
// VERIFY: a7465a7c manual
// OFFSET: 0x0070C6A0
@@ -70,6 +72,44 @@ bool CGGameObject_C_Type_Chair::CanUse() const {
return true;
}
// VERIFY: c5c874e1 manual
// OFFSET: 0x00711DB0
bool CGGameObject_C_Type_Chair::CanUseNow(GAME_ERROR_TYPE* error, float* distance, const char** errorText) const {
if (!CGGameObject_C_TypeBase::CanUseNow(error, distance, errorText)) {
return false;
}
float rangeSquared = this->m_interactDistance * this->m_interactDistance;
if (distance) {
*distance = this->m_interactDistance;
}
CGPlayer_C* player = ClntObjMgrGetActivePlayerObj();
uint32_t count;
if (player && (count = this->GetNumSlots()) != 0) {
while (count) {
count--;
C3Vector slot = this->m_owner->m_passenger.GetPosition(this->m_slots[count]);
C3Vector position = player->GetPosition();
float dx = position.x - slot.x;
float dy = position.y - slot.y;
float dz = position.z - slot.z;
if (dx * dx + dz * dz + dy * dy < rangeSquared) {
return true;
}
}
}
if (error) {
*error = static_cast<GAME_ERROR_TYPE>(ERR_USE_TOO_FAR);
}
return false;
}
// VERIFY: 9259c9d2 manual
// OFFSET: 0x004F55F0
void GenerateChairPoints(const C44Matrix& matrix, uint32_t count, C3Vector* points, float offset) {
@@ -1,6 +1,7 @@
#include "CGGameObject_C_Type_QuestGiver.h"
#include "WoW/Source/Object/GameObjectDef.h"
#include "WoW/Source/Object/GameObjectStats.h"
#include "Engine/Source/Model2/M2Model.h"
// VERIFY: 369810f6 auto
// OFFSET: 0x007125C0
@@ -35,3 +36,36 @@ void CGGameObject_C_Type_QuestGiver::CloseInteraction() {
this->UpdateAnimState(4);
}
}
// VERIFY: 86ad0112 manual
// OFFSET: 0x0070FE10
void CGGameObject_C_Type_QuestGiver::StartInteraction() {
uint32_t index = CGameObjectDef::GetPropNum(this->m_owner->m_gameObject->m_typeID, 22);
GameObjectStats* stats = this->m_owner->m_stats;
if (stats && index < 24 && stats->m_propValue[index]) {
uint32_t animIndex = CGameObjectDef::GetPropNum(this->m_owner->m_gameObject->m_typeID, 22);
GameObjectStats* animStats = this->m_owner->m_stats;
this->m_owner->PlayCustomAnim(animStats && animIndex < 24 ? animStats->m_propValue[animIndex] - 1 : 0xFFFFFFFF);
return;
}
CM2Model* model = this->m_owner->m_worldModel;
if (!model || !model->IsLoaded(0, 0)) {
return;
}
uint32_t anim = CGGameObject_C_TypeAnimated::s_animSequenceIds[2];
if (!model->HasSequence(anim)) {
M2SequenceInfo info;
info.Clear();
model->GetSequenceInfo(anim, 0, info);
anim = info.m_animId;
}
if (model->GetBoneSequenceId(0xFFFFFFFF) != anim) {
this->UpdateAnimState(2);
}
}
@@ -356,3 +356,23 @@ int32_t CorpseDynamicFlagUpdateHandler(WOWGUID guid, uint32_t fieldOffset, uint3
return 1;
}
// VERIFY: 12175e66 auto
// OFFSET: 0x00706530
float CGCorpse_C::GetFacing() const {
return this->m_passenger.GetFacing(this->m_passenger.m_facing);
}
// VERIFY: 63ae9671 manual
// OFFSET: 0x00705850
void CGCorpse_C::ModelLoaded(CM2Model* model) {
this->CGObject_C::ModelLoaded(model);
if (this->m_corpseFlags & 0x2) {
model->SetBoneSequence(0xFFFFFFFF, 132, 0xFFFFFFFF, 0, 1.0f, 1, 1);
} else {
model->SetBoneSequence(0xFFFFFFFF, 6, 0xFFFFFFFF, 0, 1.0f, 1, 1);
}
this->m_selectionRadius = model->GetBoundingSphere().r * 0.5f;
}
@@ -29,6 +29,8 @@ class CGCorpse_C : public CGObject_C, public CGCorpse {
int32_t ShouldFadeout() override;
float GetTrueScale() const override;
int32_t CanHighlight() const override;
float GetFacing() const override;
void ModelLoaded(CM2Model* model) override;
CGCorpse_C(uint32_t time, const CClientObjCreate& create);
void ApplyGuildColor(int32_t request);
@@ -127,6 +127,12 @@ void CGDynamicObject_C::ShouldRender(uint32_t flags, int32_t& render, int32_t& a
}
}
// VERIFY: 4e1858a9 auto
// OFFSET: 0x00706530
float CGDynamicObject_C::GetFacing() const {
return this->m_passenger.GetFacing(this->m_passenger.m_facing);
}
// VERIFY: 7501382d manual
// OFFSET: 0x007064E0
C3Vector CGDynamicObject_C::GetPosition() const {
@@ -27,6 +27,7 @@ class CGDynamicObject_C : public CGObject_C, public CGDynamicObject {
~CGDynamicObject_C() override;
virtual C3Vector GetPosition() const;
virtual C3Vector GetRawPosition() const;
virtual float GetFacing() const;
virtual C44Matrix GetMatrix() const;
virtual void ShouldRender(uint32_t flags, int32_t& render, int32_t& a3);
+1 -1
View File
@@ -310,7 +310,7 @@ CGItem_C::CGItem_C(uint32_t time, const CClientObjCreate& create) : CGObject_C(t
}
// VERIFY: 6bc496ea manual
// OFFSET: 0x0070B120
// OFFSET: [0x0070B120, 0x0070B1F0]
CGItem_C::~CGItem_C() {
if (!(this->m_itemFlags & 0x2)) {
g_itemDBCache.CancelCallback(this->m_obj->m_entryID, &LoadItemCacheCallback, this);
+1 -1
View File
@@ -1271,7 +1271,7 @@ void CGObject_C::ClearEffectList(int32_t all) {
}
// VERIFY: 82510f34 manual
// OFFSET: 0x00745F90
// OFFSET: [0x004D6010, 0x00745F90]
CGObject_C::~CGObject_C() {
if (this->m_worldObject) {
World::ObjectDestroy(this->m_worldObject);
@@ -4855,6 +4855,48 @@ void Unk7FE510(uint32_t guidLow) {
unk_D3F4EC = guidLow;
}
// INLINED
static uint32_t SetTrajectoryCheckBit(uint32_t value, uint32_t shift) {
uint32_t masked = value & ~(1u << shift);
uint32_t fold = masked ^ (masked >> 16);
fold ^= fold >> 8;
fold = (fold ^ (fold >> 4)) & 0xF;
return masked | (((0x28D7 >> fold) & 1) << shift);
}
// VERIFY: 2a929aab manual
// OFFSET: 0x007FE520
uint32_t Spell_C_EncodeSequenceIntoMissileTrajectory(uint32_t* pitch, uint32_t* speed, uint32_t* source, uint32_t* dest) {
uint32_t sequence = unk_D3F4EC++;
uint32_t key[2];
key[0] = (((source[0] ^ (source[2] & 0xF000)) & 0x2F000) ^ (source[1] & 0x300EE630) ^ (pitch[0] & 0x6000CF0) ^ (dest[1] & 0x60E0400) ^ (speed[0] & 0x240E00) ^ (dest[0] & 0xA9070F01) ^ sequence) | 0x1010101;
key[1] = 0;
uint32_t hash = SStrHash(reinterpret_cast<const char*>(key), 1, 0);
pitch[0] = (pitch[0] & ~0x3u) | ((hash >> 10) & 1) | ((hash >> 27) & 2);
speed[0] = (speed[0] & ~0x9u) | ((hash >> 1) & 1) | ((hash >> 19) & 8);
source[0] = (source[0] & ~0x6u) | (((hash & 0x8000) | ((hash >> 9) & 0x10000)) >> 14);
source[1] ^= ((hash >> 1) ^ source[1]) & 2;
source[1] ^= ((hash >> 11) ^ source[1]) & 8;
source[2] ^= ((hash >> 6) ^ source[2]) & 8;
source[2] ^= ((hash >> 28) ^ source[2]) & 4;
dest[0] = (dest[0] & ~0x6u) | ((hash >> 6) & 2) | ((hash >> 3) & 4);
dest[1] ^= ((hash >> 29) ^ dest[1]) & 1;
dest[1] ^= ((hash >> 3) ^ dest[1]) & 8;
dest[2] ^= ((hash >> 20) ^ dest[2]) & 1;
dest[2] ^= ((hash >> 10) ^ dest[2]) & 4;
pitch[0] = SetTrajectoryCheckBit(pitch[0], 3);
speed[0] = SetTrajectoryCheckBit(speed[0], 1);
source[0] = SetTrajectoryCheckBit(source[0], 3);
source[1] = SetTrajectoryCheckBit(source[1], 2);
source[2] = SetTrajectoryCheckBit(source[2], 0);
dest[0] = SetTrajectoryCheckBit(dest[0], 0);
dest[1] = SetTrajectoryCheckBit(dest[1], 2);
dest[2] = SetTrajectoryCheckBit(dest[2], 1);
return dest[2];
}
// VERIFY: 3100171d manual
// OFFSET: 0x0060A600
uint32_t CGPlayer_C::GetNextLevelXP() const {
@@ -8437,6 +8479,20 @@ int32_t CGPlayer_C::GetLootItemSlotType(uint32_t slot) {
return s_lootItems[slot].m_slotType;
}
// VERIFY: 5e3e02c7 manual
// OFFSET: 0x006DC770
void CGPlayer_C::ClearLootItemSlotType(WOWGUID lootObject, uint32_t slot) {
if (slot >= 18) {
SErrDisplayAppFatalMessage("", "", 0);
}
CGPlayer_C* player = ClntObjMgrGetActivePlayerObj();
if (player && player->m_lootTarget == lootObject) {
s_lootItems[slot].m_slotType = 0;
}
}
// VERIFY: 6d310e19 auto
// OFFSET: 0x006CECA0
int32_t __stdcall CGPlayer_C::OnLootMoneyNotify(CDataStore* msg) {
@@ -14715,3 +14771,9 @@ int32_t Packet_SMSG_VOICE_PARENTAL_CONTROLS(void* param, NETMESSAGE msgId, uint3
return 1;
}
// VERIFY: a5006ce1 auto
// OFFSET: 0x006DC7E0
int32_t CGPlayer_C::GetVirtualItemDisplayRec(uint32_t slot, ItemDisplayInfoRec& rec) const {
return g_itemDisplayInfoDB.GetRecord(this->GetVirtualItemDisplayID(slot), &rec);
}
@@ -244,6 +244,7 @@ class CGPlayer_C : public CGUnit_C, public CGPlayer {
void PlayFoleySound() override;
const CGUnitVirtualItem* GetVirtualItem(uint32_t slot, bool ignoreDisarm) const override;
uint32_t GetVirtualItemDisplayID(uint32_t slot) const override;
int32_t GetVirtualItemDisplayRec(uint32_t slot, ItemDisplayInfoRec& rec) const override;
int32_t GetSpellRank(const SpellRec* spell) const override;
void GetDefenseSkillRank(int32_t& rank, int32_t& bonus) const override;
void GetAttackSkillRank(int32_t hand, int32_t& rank, int32_t& bonus) const override;
@@ -380,6 +381,7 @@ class CGPlayer_C : public CGUnit_C, public CGPlayer {
void ClearLootingObject();
void LootCorpse(CGCorpse_C* corpse, bool autoInteract);
static int32_t GetLootItem(uint32_t slot);
static void ClearLootItemSlotType(WOWGUID lootObject, uint32_t slot);
static int32_t GetLootItemDisplayId(uint32_t slot);
static int32_t GetLootItemCount(uint32_t slot);
static int32_t GetLootItemRandomSuffix(uint32_t slot);
+79
View File
@@ -1,5 +1,6 @@
#include "QuestCache.h"
#include "Engine/Source/Base/CDataStore.h"
#include "Engine/Source/Storm/H/storm.h"
// VERIFY: 43c9bc4a manual
// OFFSET: 0x00634E70
@@ -261,3 +262,81 @@ void QuestCache::Unpack(CDataStore* msg) {
msg->GetString(this->m_objectiveText[i], 0x7FFFFFFF);
}
}
// VERIFY: 7c3f82e4 auto
// OFFSET: 0x00668170
QuestCache& QuestCache::operator=(const QuestCache& source) {
this->m_id = source.m_id;
this->m_method = source.m_method;
this->m_level = source.m_level;
this->m_requiredLevel = source.m_requiredLevel;
this->m_areaIdOrSortId = source.m_areaIdOrSortId;
this->m_infoId = source.m_infoId;
this->m_suggestedPlayers = source.m_suggestedPlayers;
this->m_friendlyFactionId = source.m_friendlyFactionId;
this->m_friendlyFactionAmount = source.m_friendlyFactionAmount;
this->m_hostileFactionId = source.m_hostileFactionId;
this->m_hostileFactionAmount = source.m_hostileFactionAmount;
this->m_nextQuestId = source.m_nextQuestId;
this->m_xPId = source.m_xPId;
this->m_rewardMoney = source.m_rewardMoney;
this->m_rewardMoneyInsteadOfXp = source.m_rewardMoneyInsteadOfXp;
this->m_rewardSpellId = source.m_rewardSpellId;
this->m_effectOnPlayer = source.m_effectOnPlayer;
this->m_rewardHonor = source.m_rewardHonor;
this->m_rewardHonorBonus = source.m_rewardHonorBonus;
this->m_startingItemId = source.m_startingItemId;
this->m_flags = source.m_flags;
this->m_rewardTitleId = source.m_rewardTitleId;
this->m_requiredPlayersKilled = source.m_requiredPlayersKilled;
this->m_rewardTalentPoints = source.m_rewardTalentPoints;
this->m_rewardArenaPoints = source.m_rewardArenaPoints;
this->unk_28E0 = source.unk_28E0;
for (uint32_t i = 0; i < 5; i++) {
this->m_rewardReputationFaction[i] = source.m_rewardReputationFaction[i];
}
for (uint32_t i = 0; i < 5; i++) {
this->m_factionRewardId[i] = source.m_factionRewardId[i];
}
for (uint32_t i = 0; i < 5; i++) {
this->m_rewardReputationOverride[i] = source.m_rewardReputationOverride[i];
}
for (uint32_t i = 0; i < 4; i++) {
this->m_rewardItem[i] = source.m_rewardItem[i];
this->m_rewardItemCount[i] = source.m_rewardItemCount[i];
}
for (uint32_t i = 0; i < 6; i++) {
this->m_rewardChoiceItem[i] = source.m_rewardChoiceItem[i];
this->m_rewardChoiceItemCount[i] = source.m_rewardChoiceItemCount[i];
}
this->m_pointMapId = source.m_pointMapId;
this->m_pointX = source.m_pointX;
this->m_pointY = source.m_pointY;
this->m_pointOptional = source.m_pointOptional;
SStrCopy(this->m_name, source.m_name, sizeof(this->m_name));
SStrCopy(this->m_objText, source.m_objText, sizeof(this->m_objText));
SStrCopy(this->m_description, source.m_description, sizeof(this->m_description));
SStrCopy(this->m_endText, source.m_endText, sizeof(this->m_endText));
SStrCopy(this->m_completionText, source.m_completionText, sizeof(this->m_completionText));
for (uint32_t i = 0; i < 4; i++) {
this->m_objectiveId[i] = source.m_objectiveId[i];
this->m_objectiveRequiredCount[i] = source.m_objectiveRequiredCount[i];
this->m_intermediateItemId[i] = source.m_intermediateItemId[i];
this->m_intermediateItemCount[i] = source.m_intermediateItemCount[i];
SStrCopy(this->m_objectiveText[i], source.m_objectiveText[i], sizeof(this->m_objectiveText[i]));
}
for (uint32_t i = 0; i < 6; i++) {
this->m_collectItemId[i] = source.m_collectItemId[i];
this->m_collectItemCount[i] = source.m_collectItemCount[i];
}
return *this;
}
+1
View File
@@ -61,6 +61,7 @@ class QuestCache {
/* 28E0 */ uint32_t unk_28E0;
QuestCache();
QuestCache& operator=(const QuestCache& source);
void Pack(CDataStore* msg);
void Unpack(CDataStore* msg);
};
+6
View File
@@ -565,3 +565,9 @@ void CGBarberShop::ShutdownGame() {
ClientServices::ClearMessageHandler(SMSG_ENABLE_BARBER_SHOP);
ClientServices::ClearMessageHandler(SMSG_BARBER_SHOP_RESULT);
}
// VERIFY: a8bfef3b manual
// OFFSET: 0x0052F190
USEABLESTYLE::~USEABLESTYLE() {
this->m_styles.Clear();
}
+6
View File
@@ -34,3 +34,9 @@ void CGBankInfo::SetBanker(const WOWGUID& banker) {
CGGameUI::ClearInteractTarget(CGBankInfo::m_banker, 0);
CGBankInfo::m_banker = WOWGUID();
}
// VERIFY: adbb2d02 auto
// OFFSET: 0x0057BA90
void CGBankInfo::LeaveWorld() {
ClntObjMgrUnsetObjMirrorHandler(ClntObjMgrGetActivePlayer(), ID_PLAYER, 0x1A, BankUpdateHandler, nullptr);
}
+1
View File
@@ -11,6 +11,7 @@ class CGBankInfo {
public:
static void SetBanker(const WOWGUID& banker);
static void EnterWorld();
static void LeaveWorld();
static WOWGUID m_banker;
};
+7
View File
@@ -859,3 +859,10 @@ void CGClassTrainer::AddServices(uint32_t count, const int32_t* spellIds, const
FrameScript_SignalEvent(SCRIPT_EVENT_TRAINER_SHOW, nullptr);
}
// VERIFY: 0b0f7a6c auto
// OFFSET: 0x005947B0
void CGClassTrainer::LeaveWorld() {
WOWGUID trainer = { 0 };
CGClassTrainer::SetTrainer(trainer, 0);
}
+1
View File
@@ -51,6 +51,7 @@ class CGClassTrainer {
static void SetTrainer(const WOWGUID& trainer, int32_t type);
static void EnterWorld();
static void LeaveWorld();
static void FilterAndSortServices();
static void RefreshList();
static void InitializeGame();
+11
View File
@@ -182,3 +182,14 @@ void CGDuelInfo::ShutdownGame() {
ClientServices::ClearMessageHandler(SMSG_DUEL_COMPLETE);
ClientServices::ClearMessageHandler(SMSG_DUEL_WINNER);
}
// VERIFY: d4b09e29 auto
// OFFSET: 0x005CFA10
void CGDuelInfo::LeaveWorld() {
s_duelArbiter = WOWGUID();
if (s_countdownTimer) {
ClientKillTimer(s_countdownTimer, CGDuelInfo::ProcessCountdown, "ProcessCountdown");
s_countdownTimer = 0;
}
}
+1
View File
@@ -14,6 +14,7 @@ class CGDuelInfo {
static void InitializeGame();
static int32_t ProcessCountdown(const void* data, void* param);
static void LeaveWorld();
static void AcceptDuel();
static void CancelDuel();
};
+7
View File
@@ -256,3 +256,10 @@ void CGMerchantInfo::UpdateItemQuantity(WOWGUID merchant, int32_t slot, int32_t
FrameScript_SignalEvent(SCRIPT_EVENT_MERCHANT_UPDATE, nullptr);
}
// VERIFY: ff887f91 auto
// OFFSET: 0x00585FE0
void CGMerchantInfo::LeaveWorld() {
CGMerchantInfo::CloseMerchant();
ClntObjMgrUnsetObjMirrorHandler(ClntObjMgrGetActivePlayer(), ID_PLAYER, offsetof(CGPlayerLocalData, m_playerFieldBuybackPrice1), BuybackUpdateHandler, nullptr);
}
+1
View File
@@ -38,6 +38,7 @@ class CGMerchantInfo {
static bool IsBuybackItem(WOWGUID item);
static void CloseMerchant();
static void EnterWorld();
static void LeaveWorld();
static void SortBuybackItems();
static MerchantItem* FindItemById(int32_t itemId);
static int32_t GetRepairCost(CGItem_C* item);
+1 -1
View File
@@ -654,6 +654,6 @@ CGNamePlateFrame::CGNamePlateFrame(CSimpleFrame* parent) : CSimpleFrame(parent),
}
// VERIFY: 44471dc3 manual
// OFFSET: 0x0098FFE0
// OFFSET: [0x0098FFE0, 0x00990030]
CGNamePlateFrame::~CGNamePlateFrame() {
}
+26
View File
@@ -835,3 +835,29 @@ void GuildNameCallback(int32_t id, const WOWGUID& guid, void* param, bool succes
Script_SendUnitSignal(guid, SCRIPT_EVENT_PLAYER_GUILD_UPDATE);
}
}
// VERIFY: 610b1ef3 manual
// OFFSET: 0x005EAF70
void CGCharacterInfo::LeaveWorld() {
WOWGUID guid = ClntObjMgrGetActivePlayer();
if (guid) {
ClntObjMgrUnsetObjMirrorHandler(guid, ID_PLAYER, 0xDA0, PlayerCharacterPointsUpdateHandler, nullptr);
ClntObjMgrUnsetObjMirrorHandler(guid, ID_PLAYER, 0x1068, PlayerEquipmentChangedHandler, nullptr);
}
CGCharacterInfo::m_invAlertStatus.Clear();
WOWGUID none = { 0 };
if (CGCharacterInfo::m_inspectTarget) {
CGCharacterInfo::m_inspectTarget = WOWGUID();
CGCharacterInfo::m_hasHonorData = 0;
CGCharacterInfo::m_honorRequestPending = 0;
for (uint32_t i = 0; i < 3; i++) {
CGCharacterInfo::m_inspectArenaTeams[i].m_teamId = 0;
}
CGTalentInfo_Inspect::SetInspectTarget(none);
}
}
+1
View File
@@ -41,6 +41,7 @@ class CGCharacterInfo {
static void PickupInventoryItem(int32_t slot);
static int32_t PutItemInBackpack(uint32_t slot);
static void EnterWorld();
static void LeaveWorld();
static void SetInspectTarget(const WOWGUID& guid);
static void InitializeGame();
static void ShutdownGame();
+6
View File
@@ -202,3 +202,9 @@ void CGPetitionInfo::AddSignature(WOWGUID petition, WOWGUID signer) {
FrameScript_SignalEvent(SCRIPT_EVENT_PETITION_SHOW, nullptr);
}
}
// VERIFY: 3777712c auto
// OFFSET: 0x005CF610
void CGPetitionInfo::LeaveWorld() {
CGPetitionInfo::m_signers.Clear();
}
+1
View File
@@ -28,6 +28,7 @@ class CGPetitionInfo {
static TSGrowableArray<PetitionSignerInfo> m_signers;
static void EnterWorld();
static void LeaveWorld();
static void InitializeGame();
static void SetPetitionStats(int32_t id);
static void ClearSignatures();
+7
View File
@@ -1161,3 +1161,10 @@ TSGrowableArray<const FactionRec*>* CGReputationInfo::GetFactionChildren(int32_t
FACTION* node = CGReputationInfo::m_factions.Ptr(faction, HASHKEY_NONE());
return node ? &node->m_children : nullptr;
}
// VERIFY: 8b2534a1 auto
// OFFSET: 0x005D24C0
void CGReputationInfo::LeaveWorld() {
CGReputationInfo::m_forcedReactions.m_count = 0;
CGReputationInfo::m_factions.InternalClear(0);
}
+1
View File
@@ -57,6 +57,7 @@ class CGReputationInfo {
static TSHashTable<FACTION, HASHKEY_NONE> m_factions;
static uint32_t m_collapsedHeaders;
static void EnterWorld();
static void LeaveWorld();
static uint32_t AddHeader(int32_t factionId, int32_t parent);
static uint32_t AddFactionHeader(int32_t factionId);
static int32_t AddVisibleFaction(uint32_t repListId, int32_t announce);
+6
View File
@@ -187,3 +187,9 @@ void CGStableInfo::ShutdownGame() {
ClientServices::ClearMessageHandler(MSG_LIST_STABLED_PETS);
ClientServices::ClearMessageHandler(SMSG_STABLE_RESULT);
}
// VERIFY: 37d7284c auto
// OFFSET: 0x005A1160
void CGStableInfo::LeaveWorld() {
CGStableInfo::CloseStables(false);
}
+1
View File
@@ -27,6 +27,7 @@ class CGStableInfo {
static void CloseStables(bool force);
static void EnterWorld();
static void LeaveWorld();
static void InitializeGame();
static StablePetInfo* GetPet(uint32_t index);
static void SelectPet(uint32_t index);
+7
View File
@@ -697,3 +697,10 @@ void CGTaxiMap::ShutdownGame() {
s_pathNodes.InternalClear(0);
CGTaxiMap::FreeRouteLines();
}
// VERIFY: 93b0ba02 auto
// OFFSET: 0x00591AC0
void CGTaxiMap::LeaveWorld() {
CGTaxiMap::FreeRouteLines();
CGTaxiMap::CloseMap();
}
+1
View File
@@ -44,6 +44,7 @@ struct TAXIROUTELINE {
class CGTaxiMap {
public:
static void CloseMap();
static void LeaveWorld();
static CTexture* m_mapTexture;
static int32_t m_numNodes;
static TSGrowableArray<TaxiNodeInfo> m_nodes;
+6
View File
@@ -314,3 +314,9 @@ void CGLCD::Logout() {
CGLCD::m_lcd->Update();
}
}
// VERIFY: 6c3ba040 auto
// OFFSET: 0x00847E90
void LCDHANDLE::SetText(const char* text) {
this->m_text.Copy(text);
}
+5 -1
View File
@@ -2,6 +2,7 @@
#define WOW_SOURCE_UI_UILCD_LCD_H
#include <cstdint>
#include "Engine/Source/Base/RCString.h"
#include "Engine/Source/Storm/H/stpl.h"
class CEzLcd;
@@ -9,7 +10,10 @@ class CGPlayer_C;
struct BattlefieldStatus;
struct LCDHANDLE : public TSHashObject<LCDHANDLE, HASHKEY_CONSTSTRI> {
/* 0018 */ void* unk_0018;
/* 0018 */ uint32_t unk_0018[3];
/* 0024 */ RCString m_text;
void SetText(const char* text);
};
struct MAPDATA : public TSLinkedNode<MAPDATA> {
+46
View File
@@ -162,6 +162,12 @@ MACRONODE* CGUIMacros::GetMacroByID(uint32_t id) {
return s_macros.Ptr(id, HASHKEY_NONE());
}
// VERIFY: 7fa1863e auto
// OFFSET: 0x00566DC0
void CGUIMacros::RunMacro(int32_t id, const char* button) {
CGUIMacros::RunMacro(s_macros.Ptr(id, HASHKEY_NONE()), button);
}
// VERIFY: 1c1a9d37 manual
// OFFSET: 0x00566AC0
void CGUIMacros::GetFullIconPath(uint32_t id, char* buffer, uint32_t size) {
@@ -1162,3 +1168,43 @@ uint32_t CGUIMacros::CreateMacro(const char* name, const char* icon, const char*
return id;
}
// VERIFY: 1e57ffdd auto
// OFFSET: 0x00564900
void MacroQueryCastSequence(MacroSubstring* text) {
lua_State* L = FrameScript_GetContext();
lua_taintexpected++;
const char* savedTaint = lua_tainted;
if (lua_taintexpected && !lua_taintedclosure) {
lua_tainted = nullptr;
}
lua_rawgeti(L, LUA_REGISTRYINDEX, FrameScript_GetErrorHandlerReference());
lua_pushstring(L, "QueryCastSequence");
lua_rawget(L, LUA_GLOBALSINDEX);
lua_pushlstring(L, text->m_start, text->m_end - text->m_start);
if (lua_pcall(L, 1, 3, -3)) {
lua_settop(L, -3);
} else {
const char* spell = lua_tolstring(L, -2, nullptr);
const char* item = lua_tolstring(L, -1, nullptr);
if (spell) {
text->SetText(spell, spell + SStrLen(spell), 0, nullptr);
} else if (item) {
text->SetText(item, item + SStrLen(item), 0, nullptr);
}
lua_settop(L, -5);
}
if (lua_taintexpected && !lua_taintedclosure) {
lua_tainted = savedTaint;
}
if (--lua_taintexpected <= 0) {
lua_taintexpected = 0;
}
}
+2
View File
@@ -15,6 +15,8 @@ class USEABLESTYLE : public TSHashObject<USEABLESTYLE, HASHKEY_NONE> {
public:
/* 0018 */ TSList<STYLEREC, TSGetLink<STYLEREC>> m_styles;
/* 0024 */ uint32_t unk_0024[3];
~USEABLESTYLE();
};
#endif
+1 -1
View File
@@ -1,7 +1,7 @@
#include "MapBaseObj.h"
// VERIFY: a9c26690 manual
// OFFSET: 0x007D71D0
// OFFSET: [0x007D71D0, 0x007D72A0]
CMapBaseObj::~CMapBaseObj() {
}
+10
View File
@@ -32,6 +32,16 @@ void CMapStaticEntity::ModelLightingCallback(CM2Model* model, CM2Lighting* light
lighting->m_flags &= ~8u;
}
// VERIFY: 1601e867 manual
// OFFSET: 0x007A0C10
CMapStaticEntity::~CMapStaticEntity() {
if (this->m_model) {
this->m_model->m_lightingCallback = nullptr;
this->m_model->m_lightingArg = nullptr;
this->m_model->Release();
}
}
// VERIFY: acf45154 manual
// OFFSET: 0x007BD5A0
void CMapStaticEntity::ModelEventCallback(CM2Model* model, uint32_t boneId, uint32_t eventId, uint32_t data, const C3Vector* position, uint32_t time, uint64_t param) {
+2
View File
@@ -27,6 +27,8 @@ class CMapStaticEntity : public CMapBaseObj {
static void ModelEventCallback(CM2Model* model, uint32_t boneId, uint32_t eventId, uint32_t data, const C3Vector* position, uint32_t time, uint64_t param);
static void ModelLightingCallback(CM2Model* model, CM2Lighting* lighting, void* userArg);
~CMapStaticEntity() override;
/* 0024 */ uint8_t m_fadeLevel;
/* 0025 */ uint8_t m_culled;
/* 0026 */ uint8_t unk_0026;
+119
View File
@@ -21,6 +21,8 @@
#include "WoW/Source/WorldClient/CPortalView.h"
#include "WoW/Source/WorldClient/FrameTime.h"
#include "WoW/Source/WorldClient/World.h"
#include "Engine/Source/Gx/CGxBuf.h"
#include "Engine/Source/Tempest/C2Vector.h"
const char* const SnowFlakeParticleBuffer::s_packetName = ".?AU?$Packet@UFlake@Snow@@$0BIAA@$00@@";
@@ -400,6 +402,123 @@ void Snow::RenderPackets() {
g_theGxDevicePtr->RsPop();
}
// VERIFY: 48bcd365 manual
// OFFSET: 0x0078B370
void Snow::RenderPacketsSW() {
if (!this->m_snowFlakePacketList.m_activePackets.Head()) {
return;
}
CGxTex* texture = TextureGetGxTex(this->m_snowFlakeTex, 0, nullptr);
if (!texture) {
return;
}
g_theGxDevicePtr->RsPush();
GxRsSet(GxRs_BlendingMode, 2);
GxRsSet(GxRs_AlphaRef, static_cast<int32_t>(CGxDevice::s_alphaRef[g_theGxDevicePtr->m_appRenderStates.m_data[GxRs_BlendingMode].m_value.m_data.i[0]]));
GxRsSet(GxRs_DepthWrite, 0);
GxRsSet(GxRs_Lighting, 0);
GxRsSet(GxRs_Culling, 0);
GxRsSet(GxRs_Fog, 0);
g_theGxDevicePtr->RsSet(GxRs_Texture0, texture);
C44Matrix view;
GxXformView(view);
float upX = view.a1;
float upY = view.b1;
float upZ = view.c1;
C3Vector corners[3];
C3Vector right(view.a0 - upX, view.b0 - upY, view.c0 - upZ);
C3Vector left(-view.a0 - upX, -view.b0 - upY, -view.c0 - upZ);
float upScale = 1.0f / sqrtf(upZ * upZ + upY * upY + upX * upX);
float rightScale = 1.0f / sqrtf(right.y * right.y + right.x * right.x + right.z * right.z);
float leftScale = 1.0f / sqrtf(left.x * left.x + left.z * left.z + left.y * left.y);
corners[0].x = upX * upScale * 0.083333336f;
corners[0].y = upY * upScale * 0.083333336f;
corners[0].z = upZ * upScale * 0.083333336f;
corners[1].x = right.x * rightScale * 0.083333336f;
corners[1].y = right.y * rightScale * 0.083333336f;
corners[1].z = right.z * rightScale * 0.083333336f;
corners[2].x = left.x * leftScale * 0.083333336f;
corners[2].y = left.y * leftScale * 0.083333336f;
corners[2].z = 0.083333336f * (leftScale * left.z);
C3Vector camera = *World::GetCamPos();
uint32_t now = CWorld::s_elapsedTicks;
CImVector color = World::s_weather->m_color;
GxFormatColor(color);
for (Packet<SnowFlakeParticleBuffer>* packet = this->m_snowFlakePacketList.m_activePackets.Head(); packet; packet = this->m_snowFlakePacketList.m_activePackets.Next(packet)) {
if (packet->m_packetStartTick >= now) {
continue;
}
float age = (now - packet->m_packetStartTick) * 0.0009765625f;
CGxBuf* buf = g_theGxDevicePtr->BufStream(GxPoolTarget_Vertex, 24, 3 * packet->m_currParticle);
uint8_t* vertices = reinterpret_cast<uint8_t*>(g_theGxDevicePtr->BufLock(buf));
uint32_t vertexCount = 0;
for (uint32_t i = 0; i < packet->m_currParticle; i++) {
static C2Vector s_texCoords[3] = { C2Vector(0.5f, -0.75f), C2Vector(-0.5f, 1.5f), C2Vector(1.5f, 1.5f) };
const SnowFlakeParticle& flake = packet->m_particlesBuffer.m_particles[i];
if (age < flake.m_startTime || flake.m_endTime + 0.25f < age) {
continue;
}
float elapsed = (age >= flake.m_endTime ? flake.m_endTime : age) - flake.m_startTime;
float faded = age - flake.m_endTime;
float fadeTime = faded >= 0.0f ? faded : 0.0f;
C3Vector position(flake.m_velocity.x * elapsed + flake.m_position.x, flake.m_velocity.y * elapsed + flake.m_position.y, flake.m_velocity.z * elapsed + flake.m_position.z);
float fade = 1.0f - fadeTime * 4.0f;
float fadeAlpha = 0.0f;
if (fade >= 0.0f) {
fadeAlpha = fade >= 1.0f ? 1.0f : fade;
}
float alpha = elapsed <= 1.0f ? elapsed : 1.0f;
if (fadeAlpha < 1.0f) {
alpha = fadeAlpha;
}
color.a = static_cast<uint8_t>(static_cast<int32_t>(alpha * 255.0f));
C3Vector relative(position.x - camera.x, position.y - camera.y, position.z - camera.z);
for (uint32_t j = 0; j < 3; j++) {
C3Vector* p = reinterpret_cast<C3Vector*>(vertices);
p->x = relative.x + corners[j].x;
p->y = relative.y + corners[j].y;
p->z = relative.z + corners[j].z;
*reinterpret_cast<CImVector*>(vertices + 12) = color;
*reinterpret_cast<C2Vector*>(vertices + 16) = s_texCoords[j];
vertices += 24;
}
vertexCount += 3;
}
g_theGxDevicePtr->BufUnlock(buf, 0);
buf->unk_001C = 1;
if (vertexCount) {
GxPrimVertexPtr(buf, GxVBF_PCT);
CGxBatch batch;
batch.m_primType = GxPrim_Triangles;
batch.m_start = 0;
batch.m_count = vertexCount;
batch.m_minIndex = 0;
batch.m_maxIndex = 0;
g_theGxDevicePtr->Draw(&batch, 0);
}
}
g_theGxDevicePtr->RsPop();
}
// VERIFY: d0ca6942 auto
// OFFSET: 0x0078BA60
void Snow::Render() {
+56
View File
@@ -4790,6 +4790,62 @@ CMapEntity* CMap::ObjectCreateStatic(CM2Model* model, const C44Matrix& matrix, M
return entity;
}
// VERIFY: d82f4501 manual
// OFFSET: 0x00781C90
CMapEntity* CMap::ObjectCreateStaticEx(CM2Model* model, const C44Matrix& matrix, MAP_OBJECT_FUNC func, void* funcParam, uint64_t param64, uintptr_t param32, const char* file, int32_t line) {
CMapEntity* entity = CMap::AllocEntity(0);
entity->m_type |= 0x300;
entity->unk_007C = (entity->unk_007C & 0xFFFFA7D0) | 0x400;
entity->m_func = nullptr;
entity->unk_00B4 = 0;
entity->m_flags = MAPOBJ_FLAG_UNPLACED;
C3Vector ambient = CMap::s_mapLight->m_light.m_ambColor;
CImVector color;
color.b = static_cast<uint8_t>(static_cast<int32_t>(ambient.z > 0.0f ? (ambient.z < 1.0f ? ambient.z * 255.0f + 0.5f : 255.0f) : 0.0f));
color.g = static_cast<uint8_t>(static_cast<int32_t>(ambient.y > 0.0f ? (ambient.y < 1.0f ? ambient.y * 255.0f + 0.5f : 255.0f) : 0.0f));
color.r = static_cast<uint8_t>(static_cast<int32_t>(ambient.x > 0.0f ? (ambient.x < 1.0f ? ambient.x * 255.0f + 0.5f : 255.0f) : 0.0f));
color.a = 0xFF;
entity->unk_00C0 = color;
entity->m_m2AmbientColor = color;
entity->m_flags = MAPOBJ_FLAG_UNPLACED;
entity->m_funcParam32 = param32;
entity->m_funcParam64 = param64;
entity->m_model = model;
entity->m_sphere.c.x = matrix.d0;
entity->m_sphere.c.y = matrix.d1;
entity->m_diffuseLightScale = 1.0f;
entity->m_sphere.c.z = matrix.d2;
entity->unk_00C4 = 1.0f;
entity->m_sphere.r = 0.0f;
entity->m_vec2 = entity->m_sphere.c;
ambient = CMap::s_mapLight->m_light.m_ambColor;
color.b = static_cast<uint8_t>(static_cast<int32_t>(ambient.z > 0.0f ? (ambient.z < 1.0f ? ambient.z * 255.0f + 0.5f : 255.0f) : 0.0f));
color.g = static_cast<uint8_t>(static_cast<int32_t>(ambient.y > 0.0f ? (ambient.y < 1.0f ? ambient.y * 255.0f + 0.5f : 255.0f) : 0.0f));
color.r = static_cast<uint8_t>(static_cast<int32_t>(ambient.x > 0.0f ? (ambient.x < 1.0f ? ambient.x * 255.0f + 0.5f : 255.0f) : 0.0f));
color.a = 0xFF;
entity->unk_00C0 = color;
entity->m_m2AmbientColor = color;
entity->m_scale = sqrtf(matrix.a2 * matrix.a2 + matrix.a1 * matrix.a1 + matrix.a0 * matrix.a0);
entity->m_position.x = matrix.d0;
entity->m_position.y = matrix.d1;
entity->m_position.z = matrix.d2;
CMap::LinkStaticEntity(entity);
if (entity->m_model) {
if (!SStrCmpI(s_invisibleStalkerModel, model->m_shared->m_fileNameWithoutPath, STORM_MAX_STR)) {
entity->unk_007C |= 0x4000;
}
entity->m_model->m_lightingCallback = CMapStaticEntity::ModelLightingCallback;
entity->m_model->m_lightingArg = entity;
entity->m_model->m_refCount++;
}
entity->m_func = func;
entity->m_funcParam = funcParam;
return entity;
}
// VERIFY: 146e9bb7 auto
// OFFSET: 0x0077F110
int32_t World::QueryMapObjFileName(CMapEntity* entity, const char** fileName) {
+97
View File
@@ -23,6 +23,7 @@
#include "Engine/Source/ShaderEffect/ShaderEffect.h"
#include "Engine/Source/Tempest/C4Vector.h"
#include "Engine/Source/Tempest/C44Matrix.h"
#include "Engine/Source/Tempest/C33Matrix.h"
// STATIC: 0x00AF3E08
int32_t s_shadowLOD = 1;
@@ -242,6 +243,102 @@ void CWorldScene::RequestModelStreaming(CM2Model* model, const CAaBox* box) {
}
}
// STATIC: 0x00AF3E14
static float s_decalDepthBelow = 1.6666666f;
// STATIC: 0x00AF3E18
static float s_decalDepthAbove = 1.0f;
// VERIFY: e1de2e5e manual
// OFFSET: 0x007E4480
void CWorldScene::RenderStreamingRequestDecal(CM2Model* model, const CAaBox* box, float scale) {
if (!(box->b.x <= box->t.x || box->b.y <= box->t.y || box->b.z <= box->t.z)) {
return;
}
float halfX = (box->t.x - box->b.x) * 0.5f;
float halfY = 0.5f * (box->t.y - box->b.y);
if (fabs(halfX) < 0.00000023841858f || fabs(halfY) < 0.00000023841858f || fabs(box->t.z - box->b.z) < 0.00000023841858f) {
return;
}
CAaBox local;
local.b.x = -halfX;
local.b.y = -halfY;
local.b.z = box->b.z;
local.t.x = halfX;
local.t.y = halfY;
local.t.z = box->t.z;
C44Matrix transform = model->m_worldTransform;
float modelScale = sqrt(transform.a0 * transform.a0 + transform.a1 * transform.a1 + transform.a2 * transform.a2);
local *= modelScale;
local.b.Minimize(C3Vector(5.0f, 5.0f, 5.0f));
local.b.Maximize(C3Vector(-5.0f, -5.0f, -5.0f));
local.t.Minimize(C3Vector(5.0f, 5.0f, 5.0f));
local.t.Maximize(C3Vector(-5.0f, -5.0f, -5.0f));
float halfZ = (local.t.z - local.b.z) * 0.5f;
C33Matrix rotation(transform);
if (!fequal(modelScale, 1.0f)) {
float inverse = 1.0f / modelScale;
rotation.Scale(C3Vector(inverse, inverse, inverse));
}
C3Vector corners[4];
corners[0] = C3Vector(local.t.x, local.t.y, 0.0f) * rotation;
corners[1] = C3Vector(local.t.x, local.b.y, 0.0f) * rotation;
corners[2] = C3Vector(local.b.x, local.b.y, 0.0f) * rotation;
corners[3] = C3Vector(local.b.x, local.t.y, 0.0f) * rotation;
CAaBox bounds = CAaBox::Bounding(corners, 4);
bounds.b.x += transform.d0;
bounds.b.y += transform.d1;
bounds.t.x += transform.d0;
bounds.t.y += transform.d1;
bounds.b.z = transform.d2 - s_decalDepthBelow * halfZ;
bounds.t.z = transform.d2 + halfZ * s_decalDepthAbove;
C33Matrix boundsScale(1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f);
boundsScale.Scale(C3Vector(bounds.t.y - bounds.b.y, bounds.t.x - bounds.b.x, 1.0f));
C33Matrix localScale(1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f);
localScale.Scale(1.0f / fabs(local.t.y - local.b.y), 1.0f / fabs(local.t.x - local.b.x), 1.0f);
C33Matrix transpose(rotation.a0, rotation.b0, rotation.c0, rotation.a1, rotation.b1, rotation.c1, rotation.a2, rotation.b2, rotation.c2);
C44Matrix projection(boundsScale * transpose * localScale);
g_theGxDevicePtr->RsPush();
GxRsSet(GxRs_BlendingMode, 4);
GxUpdateAlphaRef(GxRs_AlphaRef);
GxRsSet(GxRs_Lighting, 0);
GxRsSet(GxRs_Fog, 0);
GxRsSet(GxRs_DepthWrite, 0);
g_theGxDevicePtr->RsSet(GxRs_Texture0, TextureGetGxTex(s_shadowBlobTexture, 1, nullptr));
GxRsSet(GxRs_FogColor, static_cast<int32_t>(0xFFFFFFFF));
GxRsSet(GxRs_ColorOp0, 5);
GxRsSet(GxRs_AlphaOp0, 3);
float alpha = 0.0f;
if (0.0f == scale) {
GxRsSet(GxRs_DepthFunc, 1);
alpha = 0.0f;
}
if (model->m_fadeAlpha >= alpha) {
alpha = model->m_fadeAlpha;
if (alpha > 1.0f) {
alpha = 1.0f;
}
}
CImVector color;
color.b = 0xFF;
color.g = 0xFF;
color.r = 0xFF;
color.a = static_cast<uint8_t>(static_cast<int32_t>(alpha * 255.0f + 0.5f));
ProjectTex::Render2d(bounds, color, &projection, 0.5f, 0x220122, 0, scale);
g_theGxDevicePtr->RsPop();
}
// VERIFY: 5c146ae6 auto
// OFFSET: 0x007E2C40
CGxTex* ProjectTex2dGetModFadeTex() {
+9
View File
@@ -98,6 +98,15 @@ void LoginResponse::UpdateLoginStatus(LOGIN_STATE state, LOGIN_RESULT result, co
this->LoginServerStatus(state, result, addressString, stateString, resultString, flags);
}
// VERIFY: 070438dd auto
// OFFSET: 0x00465550
void Login::GetFileStatus(const char* fileName, uint64_t size, const uint8_t* md5) {
this->m_fileSize = size;
SStrCopy(this->m_fileName, fileName, sizeof(this->m_fileName));
memcpy(this->m_fileMD5, md5, sizeof(this->m_fileMD5));
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_DOWNLOADFILE, LOGIN_OK, nullptr, 0);
}
// VERIFY: c69b7588 auto
// OFFSET: 0x00465520
bool Login::OnlineIdle() {
+6
View File
@@ -301,6 +301,12 @@ void SHA1::Process(const void* _data, uint32_t length) {
}
}
// VERIFY: 6e49fbc0 auto
// OFFSET: 0x006CA240
void SHA1::Process(const char* string) {
this->Process(string, static_cast<uint32_t>(strlen(string)));
}
// VERIFY: 41a87762 manual
// OFFSET: 0x006CA270
void SHA1::Finish(SHA1::Digest& digest) {
+3 -1
View File
@@ -18,6 +18,7 @@ class SHA1 {
void Prepare();
void Process(const void* data, uint32_t length);
void Process(const char* string);
void Finish(SHA1::Digest& digest);
};
@@ -61,7 +62,8 @@ void HMAC<T>::Init(const uint8_t* key, uint32_t length) {
this->m_hash.Process(this->m_innerPad, sizeof(this->m_innerPad));
}
// INLINED
// VERIFY: 05f98492 auto
// OFFSET: 0x00465780
template <class T>
void HMAC<T>::Finish(typename T::Digest& digest) {
typename T::Digest inner;
+2
View File
@@ -16,6 +16,8 @@ class TIMESTAMPSTRUCT : public TSHashObject<TIMESTAMPSTRUCT, HASHKEY_NONE> {
public:
/* 0018 */ TSList<TIMESTAMPCALLBACK, TSGetLink<TIMESTAMPCALLBACK>> m_callbacks;
/* 0024 */ uint32_t unk_0024[3];
~TIMESTAMPSTRUCT();
};
#endif