- Port hit-order Lua stand-ins (unit tokens, tooltips, combat log filters and current entry, bags/containers, quest POI, minimap, titles, world states, trade, group roles, runes, mirror timers, saved-variable registration, Quit) - LoadAddOn: real add-on loading (Blizzard_CombatLog etc. now load) - CombatLogEntry::PushEvent: COMBAT_LOG_EVENT arguments - World map chain: SetMapToCurrentZone, SetMap, GetWorldPosition, landmarks, overlays, highlight, zones, dungeon levels, player position - OpenArchives: locale index was off by one (enUS read the koKR DBC slot, leaving zone/map names empty) - Zone/area sound chain, invisible units (spline mode read size), raid/bag crash fixes, stand-in console, waystone icon for all executables - Coding-rule cleanups: statics/includes at the top, event enums, Lua _Scripts layout Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
106 lines
3.0 KiB
C++
106 lines
3.0 KiB
C++
#include "PortraitButton.h"
|
|
#include "Engine/Source/Gx/CGxDevice/CGxDevice.h"
|
|
#include "Engine/Source/Gx/Gx.h"
|
|
#include "Engine/Source/Tempest/CImVector.h"
|
|
#include "Engine/Source/Tempest/CiRect.h"
|
|
#include "WoW/Source/Ui/ScriptEvents.h"
|
|
#include "Engine/Source/Base/Status.h"
|
|
#include "Engine/Source/Services/Texture.h"
|
|
|
|
// STATIC: 0x00C5CDF0
|
|
static CTexture* s_portraitMaskTexture;
|
|
|
|
// STATIC: 0x00C5CDF4
|
|
static CGxTex* s_portraitMaskGxTex;
|
|
|
|
// STATIC: 0x00C5CDF8
|
|
static CTexture* s_portraitDepthTexture;
|
|
|
|
// STATIC: 0x00C5CDFC
|
|
static int32_t unk_C5CDFC;
|
|
|
|
// STATIC: 0x00C5CE00
|
|
static uint32_t unk_C5CE00;
|
|
|
|
// STATIC: 0x00C5CE04
|
|
static uint32_t unk_C5CE04;
|
|
|
|
// STATIC: 0x00C5CE08
|
|
static TSHashTable<PLAYERPORTRAIT, CHashKeyGUID> unk_C5CE08;
|
|
|
|
// STATIC: 0x00C5CE30
|
|
static TSHashTable<UNITPORTRAIT, HASHKEY_DWORD> unk_C5CE30;
|
|
|
|
static void PortraitDepthTextureCallback(EGxTexCommand command, uint32_t width, uint32_t height, uint32_t depth, uint32_t mipLevel, void* userArg, uint32_t& texelStrideInBytes, const void*& texels) {
|
|
}
|
|
|
|
// VERIFY: 9cb5c23b auto
|
|
// OFFSET: 0x00616DC0
|
|
int32_t RTAlphaSupported() {
|
|
if (g_theGxDevicePtr->DeviceApi() == GxApi_OpenGl && !g_theGxDevicePtr->Caps().m_oglRtAlpha) {
|
|
return 0;
|
|
}
|
|
|
|
int32_t supported = 0;
|
|
GxSceneClear(3, CImVector());
|
|
|
|
CiRect rect;
|
|
rect.minY = 0;
|
|
rect.minX = 0;
|
|
rect.maxY = 64;
|
|
rect.maxX = 64;
|
|
|
|
TSGrowableArray<CImVector> pixels;
|
|
g_theGxDevicePtr->DeviceReadPixels(rect, pixels);
|
|
|
|
for (uint32_t i = 0; i < pixels.Count(); i++) {
|
|
if (pixels[i].a != 0xFF) {
|
|
supported = 1;
|
|
break;
|
|
}
|
|
}
|
|
|
|
return supported;
|
|
}
|
|
|
|
// VERIFY: 4a08269a manual
|
|
// OFFSET: 0x00617070
|
|
void __fastcall UpdateAllPortraits() {
|
|
unk_C5CDFC = RTAlphaSupported();
|
|
|
|
for (PLAYERPORTRAIT* portrait = unk_C5CE08.m_fulllist.Head(); portrait; portrait = unk_C5CE08.Next(portrait)) {
|
|
portrait->unk_0020 = 1;
|
|
}
|
|
|
|
for (UNITPORTRAIT* portrait = unk_C5CE30.m_fulllist.Head(); portrait; portrait = unk_C5CE30.Next(portrait)) {
|
|
portrait->unk_0018 = 1;
|
|
}
|
|
|
|
Script_SendUniqueSignalToAllUnits(SCRIPT_EVENT_UNIT_PORTRAIT_UPDATE);
|
|
}
|
|
|
|
// VERIFY: 237bf2e5 manual
|
|
// OFFSET: 0x00618010
|
|
void PortraitInitialize() {
|
|
CStatus status;
|
|
|
|
s_portraitMaskTexture = TextureCreate("Interface\\CharacterFrame\\TempPortraitAlphaMaskSmall.blp", CGxTexFlags(GxTex_Linear, 0, 0, 0, 0, 0, 1), &status, 0);
|
|
|
|
if (s_portraitMaskTexture) {
|
|
s_portraitMaskGxTex = TextureGetGxTex(s_portraitMaskTexture, 1, nullptr);
|
|
} else {
|
|
s_portraitMaskGxTex = nullptr;
|
|
}
|
|
|
|
unk_C5CDFC = RTAlphaSupported();
|
|
|
|
if (unk_C5CDFC && (g_theGxDevicePtr->DeviceApi() == GxApi_OpenGl || g_theGxDevicePtr->DeviceApi() == GxApi_GLL)) {
|
|
CGxTexFlags flags(GxTex_Linear, 0, 0, 0, 0, 0, 1);
|
|
flags.m_renderTarget = 1;
|
|
s_portraitDepthTexture = TextureCreate(GxTex_2d, 64, 64, 24, GxTex_D24X8, GxTex_D24X8, flags, nullptr, PortraitDepthTextureCallback, "PortraitDepth", 1);
|
|
}
|
|
|
|
unk_C5CE00 = 0;
|
|
unk_C5CE04 = 0;
|
|
}
|