Services: port Profile, TextBlock, Camera, particles and ribbons
Profile, TextBlock, Camera (+CameraInt.h), ParticleSystem2 (emitters, track sampling, sort queue), RibbonEmitter, GfxSingletonManager managers and the v1 CParticleEmitter destructor. All pass or approved with explained diffs; 0 fails. Callee-cleanup helpers declared __stdcall, float->int paths use CMath::fint_ (binary uses fistp). CLightning fields named only; it is WoW/Common code. _Triage CAngle removed, Camera.h repointed to CameraInt.h. CM2SceneRender Render calls cast for the new signature. Services links freetype for the Gxu font headers. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -706,7 +706,7 @@ void CM2SceneRender::DrawRibbon() {
|
||||
this->SetupMaterial();
|
||||
this->SetupBillboardView(C3Vector(0.0f, 0.0f, 0.0f));
|
||||
CShaderEffect::SetTexMtx_Identity(0);
|
||||
this->m_curModel->m_ribbonEmitters[this->m_curElement->m_index]->Render(this->m_curModel->m_frameOfReference);
|
||||
this->m_curModel->m_ribbonEmitters[this->m_curElement->m_index]->Render(static_cast<const C44Matrix*>(this->m_curModel->m_frameOfReference));
|
||||
g_theGxDevicePtr->XformSetView(s_identity);
|
||||
|
||||
CGxMatrixStack& world = g_theGxDevicePtr->m_xforms[GxXform_World];
|
||||
@@ -824,7 +824,7 @@ uint32_t CM2SceneRender::DrawBatchedParticle(uint32_t index, M2Element* elements
|
||||
|
||||
for (uint32_t i = 0; i < batched; i++) {
|
||||
emitter = elements[first[i]].m_emitter;
|
||||
emitter->Render(this->m_curModel->m_frameOfReference, data, i == 0);
|
||||
emitter->Render(static_cast<const C44Matrix*>(this->m_curModel->m_frameOfReference), data, i == 0);
|
||||
renderedVertices += emitter->m_renderedParticles * emitter->m_vertsPerParticle;
|
||||
data += vertexSize * emitter->m_renderedParticles * emitter->m_vertsPerParticle;
|
||||
renderedIndices += emitter->m_renderedParticles * emitter->m_indicesPerParticle;
|
||||
@@ -886,7 +886,7 @@ uint32_t CM2SceneRender::DrawParticle(uint32_t index, M2Element* elements, uint3
|
||||
this->SetupLighting();
|
||||
this->SetupMaterial();
|
||||
this->SetupBillboardView(*reinterpret_cast<const C3Vector*>(&this->m_scene->m_viewInv.d0));
|
||||
emitter->Render(this->m_curModel->m_frameOfReference, nullptr, 1);
|
||||
emitter->Render(static_cast<const C44Matrix*>(this->m_curModel->m_frameOfReference), nullptr, 1);
|
||||
g_theGxDevicePtr->XformSetView(s_identity);
|
||||
|
||||
CGxMatrixStack& world = g_theGxDevicePtr->m_xforms[GxXform_World];
|
||||
|
||||
@@ -8,3 +8,8 @@ target_include_directories(Services
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(Services
|
||||
PUBLIC
|
||||
freetype
|
||||
)
|
||||
|
||||
@@ -0,0 +1,445 @@
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <new>
|
||||
#include "Engine/Source/Services/Camera.h"
|
||||
#include "Engine/Source/Gx/CGxDevice/CGxDevice.h"
|
||||
#include "Engine/Source/Gx/Gx.h"
|
||||
#include "Engine/Source/Gxu/Gxu.h"
|
||||
#include "Engine/Source/Services/CameraInt.h"
|
||||
#include "Engine/Source/ShaderEffect/ShaderEffect.h"
|
||||
#include "Engine/Source/Storm/H/storm.h"
|
||||
#include "Engine/Source/Tempest/C2Vector.h"
|
||||
#include "Engine/Source/Tempest/C44Matrix.h"
|
||||
#include "Engine/Source/Tempest/CRect.h"
|
||||
|
||||
// STATIC: 0x00B4A304
|
||||
static float s_inv2Pi = 1.0f / 6.2831855f;
|
||||
|
||||
// INLINED
|
||||
CBaseManaged::CBaseManaged() {
|
||||
this->m_dataTypeId = 0;
|
||||
this->m_flags = 0;
|
||||
this->m_updateFcn = nullptr;
|
||||
this->m_updateData = nullptr;
|
||||
this->m_updatePriority = 0.0f;
|
||||
}
|
||||
|
||||
void CBaseManaged::Update(float time) {
|
||||
}
|
||||
|
||||
void CBaseManaged::Validate(float time) {
|
||||
}
|
||||
|
||||
// INLINED
|
||||
template <class T>
|
||||
TManaged<T>::TManaged(const T& value) {
|
||||
this->m_data = value;
|
||||
}
|
||||
|
||||
// INLINED
|
||||
CAngle::CAngle(float angle) : TManaged<float>(0.0f) {
|
||||
this->Set_(angle);
|
||||
}
|
||||
|
||||
// VERIFY: 17bd52ca auto
|
||||
// OFFSET: [0x004BEB90, 0x004BF580]
|
||||
template <class T>
|
||||
void TManaged<T>::Set_(const T& value) {
|
||||
if (value != this->m_data) {
|
||||
this->m_flags |= 0x8;
|
||||
this->m_data = value;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: a5190ff5 manual
|
||||
// OFFSET: 0x004BEC90
|
||||
void CAngle::Set_(const float& value) {
|
||||
TManaged<float>::Set_(this->ClampTo2Pi(value));
|
||||
this->m_cos = cos(this->m_data);
|
||||
this->m_sin = sin(this->m_data);
|
||||
}
|
||||
|
||||
// VERIFY: 72a398ea auto
|
||||
// OFFSET: 0x004BECF0
|
||||
void CCamera::SetupWorldProjection(const CRect& rect, uint32_t flags) {
|
||||
C44Matrix projection;
|
||||
GxuXformCreateProjection_SG(this->m_fov.m_data, (rect.maxX - rect.minX) / (rect.maxY - rect.minY), this->m_zNear.m_data, this->m_zFar.m_data, projection);
|
||||
g_theGxDevicePtr->XformSetProjection(projection);
|
||||
|
||||
C44Matrix view;
|
||||
C3Vector eye(0.0f, 0.0f, 0.0f);
|
||||
C3Vector target(this->m_target.m_data.x - this->m_position.m_data.x, this->m_target.m_data.y - this->m_position.m_data.y, this->m_target.m_data.z - this->m_position.m_data.z);
|
||||
C3Vector up(this->m_rotation.m_sin * this->m_roll.m_sin, -(this->m_rotation.m_cos * this->m_roll.m_sin), this->m_roll.m_cos);
|
||||
GxuXformCreateLookAtSgCompat(eye, target, up, view);
|
||||
g_theGxDevicePtr->XformSetView(view);
|
||||
|
||||
CShaderEffect::UpdateProjMatrix();
|
||||
}
|
||||
|
||||
// VERIFY: 5a7761be auto
|
||||
// OFFSET: 0x004BEE60
|
||||
void CameraSetupScreenProjection(const CRect& rect, const C2Vector& offset, float depth, int32_t forceOrtho) {
|
||||
float centerX = (rect.minX + rect.maxX) * 0.5f;
|
||||
float centerY = 0.5f * (rect.minY + rect.maxY);
|
||||
float left = rect.minX - centerX;
|
||||
float right = rect.maxX - centerX;
|
||||
float bottom = rect.minY + -centerY;
|
||||
float top = -centerY + rect.maxY;
|
||||
|
||||
C44Matrix projection;
|
||||
|
||||
if (forceOrtho || !g_theGxDevicePtr->StereoEnabled()) {
|
||||
GxuXformCreateOrtho(left, right, bottom, top, -500.0f, 500.0f, projection);
|
||||
projection.Scale(C3Vector(1.0f, 1.0f, -1.0f));
|
||||
} else {
|
||||
GxuXformCreateOrthoDepth(left, right, bottom, top, -500.0f, 500.0f, projection);
|
||||
}
|
||||
|
||||
CGxCaps& caps = g_theGxDevicePtr->Caps();
|
||||
|
||||
if (!caps.m_pixelCenterOnEdge && caps.m_texelCenterOnEdge) {
|
||||
CRect window = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
g_theGxDevicePtr->CapsWindowSizeInScreenCoords(window);
|
||||
projection.d0 = projection.d0 - (rect.maxX - rect.minX) / (window.maxX - window.minX) * 0.5f;
|
||||
projection.d1 = 0.5f * ((rect.maxY - rect.minY) / (window.maxY - window.minY)) + projection.d1;
|
||||
}
|
||||
|
||||
GxXformSetProjection(projection);
|
||||
|
||||
C44Matrix view;
|
||||
view.Translate(C3Vector(offset.x - centerX, offset.y - centerY, 0.0f));
|
||||
GxXformSetView(view);
|
||||
}
|
||||
|
||||
// VERIFY: 523f309e auto
|
||||
// OFFSET: 0x004BF0C0
|
||||
void CameraSetupWorldProjection(CCamera* camera, const CRect& rect, uint32_t flags) {
|
||||
if (!camera) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
camera->SetupWorldProjection(rect, flags);
|
||||
}
|
||||
|
||||
// VERIFY: 6c58d581 manual
|
||||
// OFFSET: 0x004BF0F0
|
||||
void CameraGetLineSegment(float x, float y, C3Vector* start, C3Vector* end) {
|
||||
if (!start || !end || !(x >= 0.0f) || !(x <= 1.0f) || !(y >= 0.0f) || !(y <= 1.0f)) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
C3Vector corners[8];
|
||||
C44Matrix view;
|
||||
C44Matrix projection;
|
||||
CGxDevice* device = g_theGxDevicePtr;
|
||||
view = device->m_xforms[GxXform_View].m_mtx[device->m_xforms[GxXform_View].m_level];
|
||||
projection = device->m_projection;
|
||||
GxuXformCalcFrustumCorners(view, projection, corners);
|
||||
|
||||
float nearLeftX = corners[0].x + (corners[1].x - corners[0].x) * y;
|
||||
float nearLeftY = corners[0].y + (corners[1].y - corners[0].y) * y;
|
||||
float nearLeftZ = corners[0].z + (corners[1].z - corners[0].z) * y;
|
||||
float nearRightX = corners[3].x + (corners[2].x - corners[3].x) * y;
|
||||
float nearRightY = corners[3].y + (corners[2].y - corners[3].y) * y;
|
||||
float nearRightZ = corners[3].z + (corners[2].z - corners[3].z) * y;
|
||||
|
||||
start->x = nearLeftX + (nearRightX - nearLeftX) * x;
|
||||
start->y = nearLeftY + (nearRightY - nearLeftY) * x;
|
||||
start->z = nearLeftZ + (nearRightZ - nearLeftZ) * x;
|
||||
|
||||
float farLeftX = corners[4].x + (corners[5].x - corners[4].x) * y;
|
||||
float farLeftY = corners[4].y + (corners[5].y - corners[4].y) * y;
|
||||
float farLeftZ = corners[4].z + (corners[5].z - corners[4].z) * y;
|
||||
float farRightX = corners[7].x + (corners[6].x - corners[7].x) * y;
|
||||
float farRightY = corners[7].y + (corners[6].y - corners[7].y) * y;
|
||||
float farRightZ = corners[7].z + (corners[6].z - corners[7].z) * y;
|
||||
|
||||
end->x = farLeftX + (farRightX - farLeftX) * x;
|
||||
end->y = farLeftY + (farRightY - farLeftY) * x;
|
||||
end->z = farLeftZ + (farRightZ - farLeftZ) * x;
|
||||
}
|
||||
|
||||
// VERIFY: ad64dcf0 auto
|
||||
// OFFSET: [0x004BF410, 0x004BF4B0]
|
||||
template <class T>
|
||||
void TManaged<T>::Update(float time) {
|
||||
if (this->m_updateFcn) {
|
||||
T value = this->m_data;
|
||||
this->m_updateFcn(time, this->m_updateData, &value);
|
||||
this->Set_(value);
|
||||
}
|
||||
|
||||
this->m_flags &= ~0x4;
|
||||
}
|
||||
|
||||
// VERIFY: f9cfcece auto
|
||||
// OFFSET: [0x004BF450, 0x004BF5D0]
|
||||
template <class T>
|
||||
void TManaged<T>::Validate(float time) {
|
||||
if (this->m_updateFcn) {
|
||||
T value = this->m_data;
|
||||
T original = this->m_data;
|
||||
this->m_updateFcn(time, this->m_updateData, &value);
|
||||
|
||||
if (original != value) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this->m_flags &= ~0x4;
|
||||
}
|
||||
|
||||
// VERIFY: a8b9e377 manual
|
||||
// OFFSET: 0x004BF660
|
||||
CBaseManaged::~CBaseManaged() {
|
||||
}
|
||||
|
||||
// VERIFY: 11178118 manual
|
||||
// OFFSET: [0x004BF6D0, 0x004BF740]
|
||||
CDataMgr::~CDataMgr() {
|
||||
}
|
||||
|
||||
// INLINED
|
||||
CDataMgr::CDataMgr(uint32_t count) {
|
||||
this->m_managed.SetCount(count);
|
||||
}
|
||||
|
||||
// VERIFY: a7d7446b manual
|
||||
// OFFSET: 0x004BF770
|
||||
CCamera::CCamera() : CDataMgr(9), m_position(C3Vector(100.0f, 0.0f, 0.0f)), m_target(C3Vector(0.0f, 0.0f, 0.0f)), m_distance(100.0f), m_zFar(5000.0f), m_zNear(8.0f), m_aoa(0.0f), m_fov(1.5707964f), m_roll(0.0f), m_rotation(0.0f) {
|
||||
this->AddManaged(&this->m_position, 7, 0);
|
||||
this->AddManaged(&this->m_target, 8, 0);
|
||||
this->AddManaged(&this->m_distance, 1, 0);
|
||||
this->AddManaged(&this->m_zFar, 2, 0);
|
||||
this->AddManaged(&this->m_zNear, 3, 0);
|
||||
this->AddManaged(&this->m_aoa, 0, 0);
|
||||
this->AddManaged(&this->m_fov, 4, 0);
|
||||
this->AddManaged(&this->m_roll, 5, 0);
|
||||
this->AddManaged(&this->m_rotation, 6, 0);
|
||||
}
|
||||
|
||||
// VERIFY: d759f72d auto
|
||||
// OFFSET: 0x004BFCA0
|
||||
CCamera* CameraCreate() {
|
||||
void* mem = SMemAlloc(sizeof(CCamera), "HCAMERA", SLOG_OBJECT, 0);
|
||||
CCamera* camera = mem ? new (mem) CCamera : nullptr;
|
||||
|
||||
if (!camera) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return reinterpret_cast<CCamera*>(HandleCreate(camera, "HCAMERA"));
|
||||
}
|
||||
|
||||
// VERIFY: 2e746ce9 manual
|
||||
// OFFSET: 0x004BFCE0
|
||||
CCamera* CameraDuplicate(CCamera* source) {
|
||||
if (!source) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* mem = SMemAlloc(sizeof(CCamera), "HCAMERA", SLOG_OBJECT, 0);
|
||||
CCamera* camera = mem ? new (mem) CCamera : nullptr;
|
||||
|
||||
if (!camera) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
camera->m_position.m_updatePriority = 0.0f;
|
||||
camera->m_position.m_updateFcn = nullptr;
|
||||
camera->m_position.m_updateData = nullptr;
|
||||
camera->m_position.Set_(source->m_position.m_data);
|
||||
|
||||
camera->m_target.m_updatePriority = 0.0f;
|
||||
camera->m_target.m_updateFcn = nullptr;
|
||||
camera->m_target.m_updateData = nullptr;
|
||||
camera->m_target.Set_(source->m_target.m_data);
|
||||
|
||||
camera->m_distance.m_updatePriority = 0.0f;
|
||||
camera->m_distance.m_updateFcn = nullptr;
|
||||
camera->m_distance.m_updateData = nullptr;
|
||||
camera->m_distance.Set_(source->m_distance.m_data);
|
||||
|
||||
camera->m_zNear.m_updatePriority = 0.0f;
|
||||
camera->m_zNear.m_updateFcn = nullptr;
|
||||
camera->m_zNear.m_updateData = nullptr;
|
||||
camera->m_zNear.Set_(source->m_zNear.m_data);
|
||||
|
||||
camera->m_zFar.m_updatePriority = 0.0f;
|
||||
camera->m_zFar.m_updateFcn = nullptr;
|
||||
camera->m_zFar.m_updateData = nullptr;
|
||||
camera->m_zFar.Set_(source->m_zFar.m_data);
|
||||
|
||||
camera->m_aoa.m_updatePriority = 0.0f;
|
||||
camera->m_aoa.m_updateFcn = nullptr;
|
||||
camera->m_aoa.m_updateData = nullptr;
|
||||
camera->m_aoa.Set_(source->m_aoa.m_data);
|
||||
|
||||
camera->m_fov.m_updatePriority = 0.0f;
|
||||
camera->m_fov.m_updateFcn = nullptr;
|
||||
camera->m_fov.m_updateData = nullptr;
|
||||
camera->m_fov.Set_(source->m_fov.m_data);
|
||||
|
||||
camera->m_roll.m_updatePriority = 0.0f;
|
||||
camera->m_roll.m_updateFcn = nullptr;
|
||||
camera->m_roll.m_updateData = nullptr;
|
||||
camera->m_roll.Set_(source->m_roll.m_data);
|
||||
|
||||
camera->m_rotation.m_updatePriority = 0.0f;
|
||||
camera->m_rotation.m_updateFcn = nullptr;
|
||||
camera->m_rotation.m_updateData = nullptr;
|
||||
camera->m_rotation.Set_(source->m_rotation.m_data);
|
||||
|
||||
return reinterpret_cast<CCamera*>(HandleCreate(camera, "HCAMERA"));
|
||||
}
|
||||
|
||||
// VERIFY: 1384d21a auto
|
||||
// OFFSET: 0x004C1140
|
||||
float CAngle::ClampTo2Pi(float angle) {
|
||||
float turns = static_cast<float>(static_cast<int32_t>(angle * s_inv2Pi)) * 6.2831855f;
|
||||
|
||||
if (angle < 0.0f) {
|
||||
turns -= 6.2831855f;
|
||||
}
|
||||
|
||||
return angle - turns;
|
||||
}
|
||||
|
||||
// VERIFY: d430685f manual
|
||||
// OFFSET: 0x004C1180
|
||||
static void GetManagedValue(CDataMgr* mgr, uint32_t index, float* value, uint8_t dataTypeId) {
|
||||
if (!value || !mgr || index >= mgr->m_managed.Count() || !mgr->m_managed[index] || mgr->m_managed[index]->m_dataTypeId != dataTypeId) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
CBaseManaged* data = mgr->m_managed[index];
|
||||
|
||||
if (data->m_flags & 0x4) {
|
||||
if (data->m_flags & 0x2) {
|
||||
data->Validate(0.0f);
|
||||
} else {
|
||||
data->Update(0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
*value = static_cast<TManaged<float>*>(data)->m_data;
|
||||
}
|
||||
|
||||
// VERIFY: c7e90e1f auto
|
||||
// OFFSET: 0x004C11F0
|
||||
float CameraGetFloat(CCamera* camera, uint32_t index) {
|
||||
float value = 0.0f;
|
||||
GetManagedValue(camera, index, &value, 6);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
// VERIFY: ecbbb5cc manual
|
||||
// OFFSET: 0x004C1220
|
||||
static void GetManagedValue(CDataMgr* mgr, uint32_t index, C3Vector* value, uint8_t dataTypeId) {
|
||||
if (!value || !mgr || index >= mgr->m_managed.Count() || !mgr->m_managed[index] || mgr->m_managed[index]->m_dataTypeId != dataTypeId) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
CBaseManaged* data = mgr->m_managed[index];
|
||||
|
||||
if (data->m_flags & 0x4) {
|
||||
if (data->m_flags & 0x2) {
|
||||
data->Validate(0.0f);
|
||||
} else {
|
||||
data->Update(0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
*value = static_cast<TManaged<C3Vector>*>(data)->m_data;
|
||||
}
|
||||
|
||||
// VERIFY: 15f73a5e auto
|
||||
// OFFSET: 0x004C1290
|
||||
void DataMgrGetCoord(CDataMgr* mgr, uint32_t index, C3Vector* value) {
|
||||
GetManagedValue(mgr, index, value, 3);
|
||||
}
|
||||
|
||||
// VERIFY: 6e02d0ab manual
|
||||
// OFFSET: 0x004C12B0
|
||||
void CameraSetCoord(CCamera* camera, uint32_t index, const C3Vector& value, uint32_t keepMask) {
|
||||
C3Vector current(0.0f, 0.0f, 0.0f);
|
||||
GetManagedValue(camera, index, ¤t, 3);
|
||||
|
||||
C3Vector newValue((keepMask & 0x1) ? current.x : value.x, (keepMask & 0x2) ? current.y : value.y, (keepMask & 0x4) ? current.z : value.z);
|
||||
|
||||
if (!camera || index >= camera->m_managed.Count() || !camera->m_managed[index] || camera->m_managed[index]->m_dataTypeId != 3 || (camera->m_managed[index]->m_flags & 0x2)) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
TManaged<C3Vector>* data = static_cast<TManaged<C3Vector>*>(camera->m_managed[index]);
|
||||
data->m_updateFcn = nullptr;
|
||||
data->m_updateData = nullptr;
|
||||
data->m_updatePriority = 0.0f;
|
||||
data->Set_(newValue);
|
||||
}
|
||||
|
||||
// VERIFY: ef5a2ea9 manual
|
||||
// OFFSET: 0x004C1360
|
||||
void CameraSetFloat(CCamera* camera, uint32_t index, float value) {
|
||||
if (!camera || index >= camera->m_managed.Count() || !camera->m_managed[index] || camera->m_managed[index]->m_dataTypeId != 6 || (camera->m_managed[index]->m_flags & 0x2)) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
TManaged<float>* data = static_cast<TManaged<float>*>(camera->m_managed[index]);
|
||||
data->m_updateFcn = nullptr;
|
||||
data->m_updateData = nullptr;
|
||||
data->m_updatePriority = 0.0f;
|
||||
data->Set_(value);
|
||||
}
|
||||
|
||||
// VERIFY: 8e9f0604 manual
|
||||
// OFFSET: 0x004C13B0
|
||||
void CDataMgr::InsertByPriority(CBaseManaged* data) {
|
||||
for (CBaseManaged* node = this->m_updateList.Head(); node; node = this->m_updateList.Next(node)) {
|
||||
if (node->m_updatePriority <= data->m_updatePriority) {
|
||||
this->m_updateList.LinkNode(data, 2, node);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this->m_updateList.LinkToTail(data);
|
||||
}
|
||||
|
||||
// VERIFY: e2e5042b auto
|
||||
// OFFSET: 0x004C14B0
|
||||
void CDataMgr::AddManaged(TManaged<C3Vector>* data, uint32_t index, uint8_t flags) {
|
||||
data->m_flags = flags;
|
||||
data->m_dataTypeId = 3;
|
||||
this->m_managed[index] = data;
|
||||
|
||||
if (flags & 0x1) {
|
||||
this->InsertByPriority(data);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 0e9ed7c7 auto
|
||||
// OFFSET: 0x004C14E0
|
||||
void CDataMgr::AddManaged(TManaged<float>* data, uint32_t index, uint8_t flags) {
|
||||
data->m_flags = flags;
|
||||
data->m_dataTypeId = 6;
|
||||
this->m_managed[index] = data;
|
||||
|
||||
if (flags & 0x1) {
|
||||
this->InsertByPriority(data);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: e9e02e6c manual
|
||||
// OFFSET: [0x004BFA50, 0x004BFC70]
|
||||
CCamera::~CCamera() {
|
||||
}
|
||||
@@ -4,11 +4,20 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
class C2Vector;
|
||||
class C3Vector;
|
||||
class CCamera;
|
||||
class CDataMgr;
|
||||
class CRect;
|
||||
|
||||
CCamera* CameraCreate();
|
||||
void CameraSetCoord(CCamera* camera, uint32_t coord, const C3Vector& value);
|
||||
void CameraSetFloat(CCamera* camera, uint32_t param, float value);
|
||||
CCamera* CameraDuplicate(CCamera* camera);
|
||||
void CameraGetLineSegment(float x, float y, C3Vector* start, C3Vector* end);
|
||||
float CameraGetFloat(CCamera* camera, uint32_t index);
|
||||
void CameraSetCoord(CCamera* camera, uint32_t index, const C3Vector& value, uint32_t keepMask = 0);
|
||||
void CameraSetFloat(CCamera* camera, uint32_t index, float value);
|
||||
void CameraSetupScreenProjection(const CRect& rect, const C2Vector& offset, float depth, int32_t forceOrtho);
|
||||
void CameraSetupWorldProjection(CCamera* camera, const CRect& rect, uint32_t flags);
|
||||
void DataMgrGetCoord(CDataMgr* mgr, uint32_t index, C3Vector* value);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
#ifndef ENGINE_SOURCE_SERVICES_CAMERAINT_H
|
||||
#define ENGINE_SOURCE_SERVICES_CAMERAINT_H
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Base/Handle.h"
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
#include "Engine/Source/Tempest/C3Vector.h"
|
||||
|
||||
class CRect;
|
||||
|
||||
class CBaseManaged {
|
||||
public:
|
||||
/* 0004 */ TSLink<CBaseManaged> m_link;
|
||||
/* 000C */ uint8_t m_dataTypeId;
|
||||
/* 000D */ uint8_t m_flags;
|
||||
/* 0010 */ void (*m_updateFcn)(float, void*, void*);
|
||||
/* 0014 */ void* m_updateData;
|
||||
/* 0018 */ float m_updatePriority;
|
||||
|
||||
CBaseManaged();
|
||||
virtual ~CBaseManaged();
|
||||
virtual void Update(float time);
|
||||
virtual void Validate(float time);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class TManaged : public CBaseManaged {
|
||||
public:
|
||||
/* 001C */ T m_data;
|
||||
|
||||
TManaged(const T& value);
|
||||
virtual void Update(float time);
|
||||
virtual void Validate(float time);
|
||||
virtual void Set_(const T& value);
|
||||
};
|
||||
|
||||
class CAngle : public TManaged<float> {
|
||||
public:
|
||||
/* 0020 */ float m_cos;
|
||||
/* 0024 */ float m_sin;
|
||||
|
||||
CAngle(float angle);
|
||||
float ClampTo2Pi(float angle);
|
||||
virtual void Set_(const float& value);
|
||||
};
|
||||
|
||||
class CDataMgr : public CHandleObject {
|
||||
public:
|
||||
/* 0008 */ TSFixedArray<CBaseManaged*> m_managed;
|
||||
/* 0014 */ TSExplicitList<CBaseManaged, offsetof(CBaseManaged, m_link)> m_updateList;
|
||||
|
||||
CDataMgr(uint32_t count);
|
||||
virtual ~CDataMgr();
|
||||
void AddManaged(TManaged<C3Vector>* data, uint32_t index, uint8_t flags);
|
||||
void AddManaged(TManaged<float>* data, uint32_t index, uint8_t flags);
|
||||
void InsertByPriority(CBaseManaged* data);
|
||||
};
|
||||
|
||||
class CCamera : public CDataMgr {
|
||||
public:
|
||||
/* 0020 */ TManaged<C3Vector> m_position;
|
||||
/* 0048 */ TManaged<C3Vector> m_target;
|
||||
/* 0070 */ TManaged<float> m_distance;
|
||||
/* 0090 */ TManaged<float> m_zFar;
|
||||
/* 00B0 */ TManaged<float> m_zNear;
|
||||
/* 00D0 */ CAngle m_aoa;
|
||||
/* 00F8 */ CAngle m_fov;
|
||||
/* 0120 */ CAngle m_roll;
|
||||
/* 0148 */ CAngle m_rotation;
|
||||
|
||||
CCamera();
|
||||
virtual ~CCamera();
|
||||
void SetupWorldProjection(const CRect& rect, uint32_t flags);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1 +1,146 @@
|
||||
#include "GfxSingletonManager.h"
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <new>
|
||||
#include "Engine/Source/Services/GfxSingletonManager.h"
|
||||
#include "Engine/Source/Services/ParticleSystem.h"
|
||||
#include "Engine/Source/Services/ParticleSystem2.h"
|
||||
#include "Engine/Source/Services/RibbonEmitter.h"
|
||||
#include "Engine/Source/Storm/H/storm.h"
|
||||
#include "Engine/Source/Tempest/CRandom.h"
|
||||
|
||||
// STATIC: 0x00B2D678
|
||||
static float s_scaler = 1.0f;
|
||||
|
||||
// STATIC: 0x00DCE8CC
|
||||
ParticleSystemManager* ParticleSystemManager::s_instance;
|
||||
|
||||
// STATIC: 0x00DCE8D0
|
||||
RibbonManager* RibbonManager::s_instance;
|
||||
|
||||
// VERIFY: 824e6114 auto
|
||||
// OFFSET: 0x00980ED0
|
||||
float ParticleSystemManager::GetScaler() {
|
||||
return s_scaler;
|
||||
}
|
||||
|
||||
// VERIFY: 5b9d99cc auto
|
||||
// OFFSET: 0x00980F70
|
||||
void ParticleSystemManager::SetScaler(float scaler) {
|
||||
if (scaler < 0.0f) {
|
||||
s_scaler = 0.0f;
|
||||
} else if (scaler < 1.0f) {
|
||||
s_scaler = scaler;
|
||||
} else {
|
||||
s_scaler = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: d3a1f51e manual
|
||||
// OFFSET: 0x00981000
|
||||
void ParticleSystemManager::Flush() {
|
||||
for (uint32_t i = this->m_emitters.Count(); i; i--) {
|
||||
this->m_emitters[i - 1]->DecRef();
|
||||
}
|
||||
|
||||
this->m_emitters.m_count = 0;
|
||||
|
||||
for (uint32_t i = this->m_emitters2.Count(); i; i--) {
|
||||
this->m_emitters2[i - 1]->DecRef();
|
||||
}
|
||||
|
||||
this->m_emitters2.m_count = 0;
|
||||
|
||||
for (uint32_t i = this->m_pendingEmitters.Count(); i; i--) {
|
||||
this->m_pendingEmitters[i - 1]->DecRef();
|
||||
}
|
||||
|
||||
this->m_pendingEmitters.m_count = 0;
|
||||
|
||||
for (uint32_t i = this->m_pendingEmitters2.Count(); i; i--) {
|
||||
this->m_pendingEmitters2[i - 1]->DecRef();
|
||||
}
|
||||
|
||||
this->m_pendingEmitters2.m_count = 0;
|
||||
}
|
||||
|
||||
// VERIFY: 2e8d51c6 auto
|
||||
// OFFSET: 0x00981090
|
||||
CParticleEmitter2* ParticleSystemManager::DuplicateEmitter(const CParticleEmitter2* emitter, int32_t copyParticles) {
|
||||
if (!emitter) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CParticleEmitter2* duplicate = const_cast<CParticleEmitter2*>(emitter)->Clone(copyParticles);
|
||||
duplicate->AddRef();
|
||||
*this->m_emitters2.New() = duplicate;
|
||||
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
// VERIFY: 9ed5c945 auto
|
||||
// OFFSET: 0x009810E0
|
||||
void RibbonManager::Flush() {
|
||||
for (uint32_t i = this->m_emitters.Count(); i; i--) {
|
||||
this->m_emitters[i - 1]->DecRef();
|
||||
}
|
||||
|
||||
this->m_emitters.m_count = 0;
|
||||
|
||||
for (uint32_t i = this->m_pendingEmitters.Count(); i; i--) {
|
||||
this->m_pendingEmitters[i - 1]->DecRef();
|
||||
}
|
||||
|
||||
this->m_pendingEmitters.m_count = 0;
|
||||
}
|
||||
|
||||
// VERIFY: 61e3c1a1 manual
|
||||
// OFFSET: 0x00981130
|
||||
ParticleSystemManager* ParticleSystemManager::GetInstance() {
|
||||
if (ParticleSystemManager::s_instance) {
|
||||
return ParticleSystemManager::s_instance;
|
||||
}
|
||||
|
||||
void* mem = SMemAlloc(sizeof(ParticleSystemManager), __FILE__, __LINE__, 0);
|
||||
ParticleSystemManager::s_instance = mem ? new (mem) ParticleSystemManager : nullptr;
|
||||
|
||||
CRndSeed seed((rand() << 16) | static_cast<uint16_t>(rand()));
|
||||
|
||||
for (uint32_t i = 0; i < 128; i++) {
|
||||
CParticleEmitter2::s_rndTable[i] = CRandom::ufloat_(seed);
|
||||
}
|
||||
|
||||
CParticleEmitter2::Init();
|
||||
|
||||
return ParticleSystemManager::s_instance;
|
||||
}
|
||||
|
||||
// VERIFY: fb3884dd manual
|
||||
// OFFSET: 0x00981200
|
||||
ParticleSystemManager::~ParticleSystemManager() {
|
||||
this->Flush();
|
||||
}
|
||||
|
||||
// VERIFY: eda66b90 manual
|
||||
// OFFSET: 0x00981270
|
||||
void ParticleSystemManager::Destroy() {
|
||||
if (ParticleSystemManager::s_instance) {
|
||||
CParticleEmitter2::Destroy();
|
||||
delete ParticleSystemManager::s_instance;
|
||||
}
|
||||
|
||||
ParticleSystemManager::s_instance = nullptr;
|
||||
}
|
||||
|
||||
// VERIFY: ef3840e9 manual
|
||||
// OFFSET: 0x009812B0
|
||||
void RibbonManager::Destroy() {
|
||||
delete RibbonManager::s_instance;
|
||||
RibbonManager::s_instance = nullptr;
|
||||
}
|
||||
|
||||
// INLINED
|
||||
RibbonManager::~RibbonManager() {
|
||||
this->Flush();
|
||||
}
|
||||
|
||||
@@ -3,33 +3,45 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
|
||||
class C3Vector;
|
||||
class CParticleEmitter;
|
||||
class CParticleEmitter2;
|
||||
class CRibbonEmitter;
|
||||
|
||||
class ParticleSystemManager {
|
||||
public:
|
||||
static int32_t (*sm_projectCallback)(const C3Vector&, float&, void*);
|
||||
static void* sm_projectParam;
|
||||
static ParticleSystemManager* s_instance;
|
||||
|
||||
static void Destroy();
|
||||
static ParticleSystemManager* GetInstance();
|
||||
static float GetScaler();
|
||||
static void SetScaler(float scaler);
|
||||
|
||||
/* 0000 */ uint8_t unk_0000[4];
|
||||
/* 0004 */ uint32_t unk_0004;
|
||||
/* 0008 */ uint32_t unk_0008;
|
||||
/* 000C */ uint8_t unk_000C[8];
|
||||
/* 0014 */ uint32_t unk_0014;
|
||||
/* 0018 */ uint32_t unk_0018;
|
||||
/* 001C */ uint8_t unk_001C[8];
|
||||
/* 0024 */ uint32_t unk_0024;
|
||||
/* 0028 */ uint32_t unk_0028;
|
||||
/* 002C */ uint8_t unk_002C[8];
|
||||
/* 0034 */ uint32_t unk_0034;
|
||||
/* 0038 */ uint32_t unk_0038;
|
||||
/* 0000 */ TSGrowableArray<CParticleEmitter*> m_emitters;
|
||||
/* 0010 */ TSGrowableArray<CParticleEmitter2*> m_emitters2;
|
||||
/* 0020 */ TSGrowableArray<CParticleEmitter*> m_pendingEmitters;
|
||||
/* 0030 */ TSGrowableArray<CParticleEmitter2*> m_pendingEmitters2;
|
||||
|
||||
~ParticleSystemManager();
|
||||
CParticleEmitter2* DuplicateEmitter(const CParticleEmitter2* emitter, int32_t copyParticles);
|
||||
void Flush();
|
||||
};
|
||||
|
||||
class RibbonManager {
|
||||
public:
|
||||
static RibbonManager* s_instance;
|
||||
|
||||
static void Destroy();
|
||||
|
||||
/* 0000 */ TSGrowableArray<CRibbonEmitter*> m_emitters;
|
||||
/* 0010 */ TSGrowableArray<CRibbonEmitter*> m_pendingEmitters;
|
||||
|
||||
~RibbonManager();
|
||||
void Flush();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,55 +3,27 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
#include "Engine/Source/Tempest/C2Vector.h"
|
||||
#include "Engine/Source/Tempest/C3Vector.h"
|
||||
#include "Engine/Source/Tempest/CImVector.h"
|
||||
|
||||
class CTexture;
|
||||
struct LightningJoint;
|
||||
struct SpellChainEffectsRec;
|
||||
|
||||
class CLightning {
|
||||
public:
|
||||
/* 0000 */ uint8_t unk_0000;
|
||||
/* 0001 */ uint8_t unk_0001;
|
||||
/* 0002 */ uint8_t unk_0002;
|
||||
/* 0003 */ uint8_t unk_0003;
|
||||
/* 0004 */ uint8_t unk_0004;
|
||||
/* 0005 */ uint8_t unk_0005;
|
||||
/* 0006 */ uint8_t unk_0006;
|
||||
/* 0007 */ uint8_t unk_0007;
|
||||
/* 0008 */ uint8_t unk_0008;
|
||||
/* 0009 */ uint8_t unk_0009;
|
||||
/* 000A */ uint16_t unk_000A;
|
||||
/* 000C */ uint32_t unk_000C;
|
||||
/* 0010 */ uint16_t unk_0010;
|
||||
/* 0012 */ uint8_t unk_0012;
|
||||
/* 0013 */ uint8_t unk_0013;
|
||||
/* 0014 */ uint16_t unk_0014;
|
||||
/* 0016 */ uint16_t unk_0016;
|
||||
/* 0018 */ uint8_t unk_0018;
|
||||
/* 0019 */ uint8_t unk_0019;
|
||||
/* 001A */ uint8_t unk_001A;
|
||||
/* 001B */ uint8_t unk_001B;
|
||||
/* 001C */ uint32_t unk_001C;
|
||||
/* 0020 */ uint32_t unk_0020;
|
||||
/* 0024 */ uint8_t unk_0024;
|
||||
/* 0025 */ uint8_t unk_0025;
|
||||
/* 0026 */ uint8_t unk_0026;
|
||||
/* 0027 */ uint8_t unk_0027;
|
||||
/* 0028 */ uint8_t unk_0028;
|
||||
/* 0029 */ uint8_t unk_0029;
|
||||
/* 002A */ uint8_t unk_002A;
|
||||
/* 002B */ uint8_t unk_002B;
|
||||
/* 002C */ uint32_t unk_002C;
|
||||
/* 0030 */ uint32_t unk_0030;
|
||||
/* 0034 */ uint32_t unk_0034;
|
||||
/* 0038 */ uint32_t unk_0038;
|
||||
/* 003C */ uint32_t unk_003C;
|
||||
/* 0040 */ uint32_t unk_0040;
|
||||
/* 0044 */ uint32_t unk_0044;
|
||||
/* 0048 */ uint32_t unk_0048;
|
||||
/* 004C */ uint32_t unk_004C;
|
||||
/* 0050 */ uint32_t unk_0050;
|
||||
/* 0054 */ uint32_t unk_0054;
|
||||
/* 0058 */ uint32_t unk_0058;
|
||||
/* 005C */ uint32_t unk_005C;
|
||||
/* 0060 */ uint32_t unk_0060;
|
||||
/* 0064 */ uint32_t unk_0064;
|
||||
/* 0000 */ C3Vector m_srcPos;
|
||||
/* 000C */ C3Vector m_dstPos;
|
||||
/* 0018 */ CImVector m_color;
|
||||
/* 001C */ const SpellChainEffectsRec* m_chainEffects;
|
||||
/* 0020 */ TSFixedArray<LightningJoint> m_joints;
|
||||
/* 002C */ TSFixedArray<C3Vector> m_points;
|
||||
/* 0038 */ TSFixedArray<C3Vector> m_positions;
|
||||
/* 0044 */ TSFixedArray<C2Vector> m_texCoords;
|
||||
/* 0050 */ TSFixedArray<CImVector> m_colors;
|
||||
/* 005C */ TSFixedArray<uint16_t> m_indices;
|
||||
/* 0068 */ uint32_t unk_0068;
|
||||
/* 006C */ uint32_t unk_006C;
|
||||
/* 0070 */ uint32_t unk_0070;
|
||||
@@ -59,9 +31,10 @@ class CLightning {
|
||||
/* 0078 */ uint32_t unk_0078;
|
||||
/* 007C */ uint32_t unk_007C;
|
||||
/* 0080 */ uint32_t unk_0080;
|
||||
/* 0084 */ uint32_t unk_0084;
|
||||
/* 0088 */ uint8_t unk_0088[8];
|
||||
/* 0090 */ uint32_t unk_0090;
|
||||
/* 0084 */ CTexture* m_texture;
|
||||
/* 0088 */ void (*m_coordUpdate)(void*, uint32_t, C3Vector*, C3Vector*);
|
||||
/* 008C */ void* m_coordUpdateParam;
|
||||
/* 0090 */ uint32_t m_flags;
|
||||
/* 0094 */ uint32_t unk_0094;
|
||||
/* 0098 */ uint32_t unk_0098;
|
||||
/* 009C */ uint32_t unk_009C;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Services/ParticleSystem.h"
|
||||
#include "Engine/Source/Storm/H/storm.h"
|
||||
|
||||
// INLINED
|
||||
CParticle::~CParticle() {
|
||||
this->m_age = 0.0f;
|
||||
}
|
||||
|
||||
// VERIFY: 07404e3e manual
|
||||
// OFFSET: 0x00982280
|
||||
CParticleEmitter::~CParticleEmitter() {
|
||||
}
|
||||
|
||||
// VERIFY: 520cd03a auto
|
||||
// OFFSET: 0x009822F0
|
||||
void CParticleEmitter::DecRef() {
|
||||
if (this->m_refCount-- == 1) {
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef ENGINE_SOURCE_SERVICES_PARTICLESYSTEM_H
|
||||
#define ENGINE_SOURCE_SERVICES_PARTICLESYSTEM_H
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
|
||||
class CParticle {
|
||||
public:
|
||||
/* 0000 */ float m_age;
|
||||
/* 0004 */ uint8_t unk_0004[0x24];
|
||||
|
||||
~CParticle();
|
||||
};
|
||||
|
||||
class CParticleEmitter {
|
||||
public:
|
||||
/* 0000 */ int32_t m_refCount;
|
||||
/* 0004 */ uint8_t unk_0004[0x2C];
|
||||
/* 0030 */ TSGrowableArray<CParticle> m_particles;
|
||||
/* 0040 */ TSGrowableArray<uint32_t> m_liveList;
|
||||
/* 0050 */ TSGrowableArray<uint32_t> m_freeList;
|
||||
|
||||
~CParticleEmitter();
|
||||
void DecRef();
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,25 +4,25 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Gx/Types.h"
|
||||
#include "Engine/Source/Tempest/C3Vector.h"
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
#include "Engine/Source/Tempest/C3Spline_Bezier3.h"
|
||||
#include "Engine/Source/Tempest/C3Vector.h"
|
||||
#include "Engine/Source/Tempest/C44Matrix.h"
|
||||
#include "Engine/Source/Tempest/C4Quaternion.h"
|
||||
#include "Engine/Source/Tempest/CAaBox.h"
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
#include "Engine/Source/Tempest/CImVector.h"
|
||||
#include "Engine/Source/Tempest/CMemBlock.h"
|
||||
#include "Engine/Source/Tempest/CRandom.h"
|
||||
|
||||
class CM2Model;
|
||||
class CParticle2;
|
||||
class CParticle2_Model;
|
||||
class CParticleEmitter2;
|
||||
class C2Vector;
|
||||
class CImVector;
|
||||
class CM2Model;
|
||||
class CM2Scene;
|
||||
class CParticleEmitter2;
|
||||
class CRange;
|
||||
class CTexture;
|
||||
class fixed16;
|
||||
template <class T>
|
||||
class M2PartTrack;
|
||||
class CM2Scene;
|
||||
class CRange;
|
||||
class CTexture;
|
||||
struct CGxBuf;
|
||||
struct CGxPool;
|
||||
|
||||
@@ -35,12 +35,15 @@ class CParticle2 {
|
||||
/* 001E */ uint16_t m_randomSeed;
|
||||
};
|
||||
|
||||
class CParticle2_Model {
|
||||
class CParticle2_Model : public CParticle2 {
|
||||
public:
|
||||
/* 0000 */ CParticle2 m_base;
|
||||
/* 0020 */ C4Quaternion m_orientation;
|
||||
/* 0030 */ C3Vector m_angularVelocity;
|
||||
/* 003C */ CM2Model* m_model;
|
||||
|
||||
CParticle2_Model();
|
||||
CParticle2_Model(const CParticle2_Model& source);
|
||||
~CParticle2_Model();
|
||||
};
|
||||
|
||||
class CParticleMat {
|
||||
@@ -49,36 +52,84 @@ class CParticleMat {
|
||||
/* 0004 */ uint32_t m_flags;
|
||||
};
|
||||
|
||||
struct CSortableParticleRecord {
|
||||
/* 0000 */ float m_depth;
|
||||
/* 0004 */ CParticle2* m_particle;
|
||||
};
|
||||
|
||||
class CSortableParticleQueue : public CMemBlock {
|
||||
public:
|
||||
/* 0014 */ uint32_t m_chunk;
|
||||
/* 0018 */ uint32_t m_capacity;
|
||||
/* 001C */ uint32_t m_count;
|
||||
|
||||
CSortableParticleQueue(const uint32_t* params);
|
||||
void Erase(uint32_t index, uint32_t count);
|
||||
CSortableParticleRecord Pop();
|
||||
void Push(float depth, CParticle2* particle);
|
||||
};
|
||||
|
||||
class CParticleEmitter2 {
|
||||
public:
|
||||
struct ParticleVertex {
|
||||
/* 0000 */ uint8_t* m_position;
|
||||
/* 0004 */ uint8_t* m_normal;
|
||||
/* 0008 */ uint8_t* m_color;
|
||||
/* 000C */ uint8_t* m_texCoord;
|
||||
/* 0010 */ uint32_t m_positionStride;
|
||||
/* 0014 */ uint32_t m_normalStride;
|
||||
/* 0018 */ uint32_t m_colorStride;
|
||||
/* 001C */ uint32_t m_texCoordStride;
|
||||
/* 0020 */ uint32_t m_count;
|
||||
};
|
||||
|
||||
struct SimpleKey {
|
||||
/* 0000 */ CImVector m_color;
|
||||
/* 0004 */ int32_t m_deltaR;
|
||||
/* 0008 */ int32_t m_deltaG;
|
||||
/* 000C */ int32_t m_deltaB;
|
||||
/* 0010 */ int32_t m_deltaA;
|
||||
/* 0014 */ float m_scale;
|
||||
/* 0018 */ float m_deltaScale;
|
||||
/* 001C */ int32_t m_headCell;
|
||||
/* 0020 */ int32_t m_deltaHeadCell;
|
||||
/* 0024 */ int32_t m_tailCell;
|
||||
/* 0028 */ int32_t m_deltaTailCell;
|
||||
|
||||
SimpleKey();
|
||||
};
|
||||
|
||||
static CGxBuf* s_indexBuf;
|
||||
static CGxPool* s_indexPool;
|
||||
static uint32_t s_initCount;
|
||||
static uint8_t s_noIndexBuffer;
|
||||
static CSortableParticleQueue s_pq;
|
||||
static float s_rndTable[128];
|
||||
static float s_viewDist;
|
||||
|
||||
static void Destroy();
|
||||
static void Init();
|
||||
static void RenderParticleVertices(CGxBuf* buf, EGxVertexBufferFormat format, uint32_t vertexCount, uint32_t indexCount);
|
||||
static void __stdcall RenderIndices(CGxBuf* buf);
|
||||
static void __stdcall RenderParticleVertices(CGxBuf* buf, EGxVertexBufferFormat format, uint32_t vertexCount, uint32_t indexCount);
|
||||
|
||||
/* 0004 */ int32_t m_refCount;
|
||||
/* 0008 */ uint32_t m_emitAccumulator;
|
||||
/* 0008 */ float m_emitAccumulator;
|
||||
/* 000C */ uint32_t m_textureCellShift;
|
||||
/* 0010 */ uint32_t m_textureCellWidth;
|
||||
/* 0014 */ uint32_t m_textureCellHeight;
|
||||
/* 0010 */ float m_textureCellWidth;
|
||||
/* 0014 */ float m_textureCellHeight;
|
||||
/* 0018 */ uint32_t m_priorityPlane;
|
||||
/* 001C */ uint32_t m_renderedParticles;
|
||||
/* 0020 */ int32_t m_emitterType;
|
||||
/* 0024 */ uint32_t m_random;
|
||||
/* 0028 */ uint32_t m_random2;
|
||||
/* 0024 */ CRndSeed m_random;
|
||||
/* 002C */ TSGrowableArray<CParticle2> m_particles;
|
||||
/* 003C */ TSGrowableArray<CParticle2_Model> m_particleModels;
|
||||
/* 004C */ TSGrowableArray<uint32_t> m_liveList;
|
||||
/* 005C */ TSGrowableArray<uint32_t> m_freeList;
|
||||
/* 006C */ uint32_t m_childEmitterCount;
|
||||
/* 0070 */ CParticleEmitter2* m_childEmitters [4];
|
||||
/* 0080 */ uint32_t m_model;
|
||||
/* 0084 */ uint32_t m_scene;
|
||||
/* 0088 */ uint32_t m_childModel;
|
||||
/* 0080 */ CM2Model* m_model;
|
||||
/* 0084 */ CM2Scene* m_scene;
|
||||
/* 0088 */ CM2Model* m_childModel;
|
||||
/* 008C */ uint32_t m_vertsPerParticle;
|
||||
/* 0090 */ uint32_t m_indicesPerParticle;
|
||||
/* 0094 */ uint32_t unk_0094;
|
||||
@@ -94,8 +145,8 @@ class CParticleEmitter2 {
|
||||
/* 00BC */ float m_zsource;
|
||||
/* 00C0 */ float m_initialSpin;
|
||||
/* 00C4 */ float m_initialSpinVariation;
|
||||
/* 00C8 */ float m_spinVariation;
|
||||
/* 00CC */ float m_spin;
|
||||
/* 00C8 */ float m_spin;
|
||||
/* 00CC */ float m_spinVariation;
|
||||
/* 00D0 */ uint32_t m_materialBlend;
|
||||
/* 00D4 */ uint32_t m_materialFlags;
|
||||
/* 00D8 */ const M2PartTrack<C3Vector>* m_colorTrack;
|
||||
@@ -105,19 +156,11 @@ class CParticleEmitter2 {
|
||||
/* 00E8 */ float m_scaleVariationY;
|
||||
/* 00EC */ const M2PartTrack<uint16_t>* m_headCellTrack;
|
||||
/* 00F0 */ const M2PartTrack<uint16_t>* m_tailCellTrack;
|
||||
/* 00F4 */ uint32_t m_replacementColors;
|
||||
/* 00F8 */ uint32_t unk_00F8;
|
||||
/* 00FC */ uint32_t unk_00FC;
|
||||
/* 0100 */ uint32_t unk_0100;
|
||||
/* 0104 */ uint32_t unk_0104;
|
||||
/* 0108 */ uint32_t unk_0108;
|
||||
/* 010C */ uint32_t unk_010C;
|
||||
/* 0110 */ uint32_t unk_0110;
|
||||
/* 0114 */ uint32_t unk_0114;
|
||||
/* 0118 */ uint32_t m_simpleMidTime;
|
||||
/* 011C */ uint32_t m_simpleKeys;
|
||||
/* 0120 */ uint32_t m_textureCols;
|
||||
/* 0124 */ uint32_t m_textureRows;
|
||||
/* 00F4 */ C3Vector m_replacementColors [3];
|
||||
/* 0118 */ float m_simpleMidTime;
|
||||
/* 011C */ SimpleKey* m_simpleKeys;
|
||||
/* 0120 */ uint32_t m_textureRows;
|
||||
/* 0124 */ uint32_t m_textureCols;
|
||||
/* 0128 */ CTexture* m_texture;
|
||||
/* 012C */ uint32_t unk_012C;
|
||||
/* 0130 */ float m_alphaScale;
|
||||
@@ -142,29 +185,23 @@ class CParticleEmitter2 {
|
||||
/* 017C */ float m_followIntercept;
|
||||
/* 0180 */ float m_followSlope;
|
||||
/* 0184 */ C44Matrix m_xform;
|
||||
/* 01C4 */ uint32_t m_cameraPos;
|
||||
/* 01C8 */ uint32_t unk_01C8;
|
||||
/* 01CC */ uint32_t unk_01CC;
|
||||
/* 01C4 */ C3Vector m_viewPos;
|
||||
/* 01D0 */ C3Vector m_parentPosition;
|
||||
/* 01DC */ uint32_t m_ivelTimer;
|
||||
/* 01DC */ float m_ivelTimer;
|
||||
/* 01E0 */ C3Vector m_parentVelocity;
|
||||
/* 01EC */ uint32_t m_xformScale;
|
||||
/* 01EC */ float m_xformScale;
|
||||
/* 01F0 */ uint32_t unk_01F0;
|
||||
/* 01F4 */ uint32_t m_followOffset;
|
||||
/* 01F8 */ uint32_t unk_01F8;
|
||||
/* 01FC */ uint32_t unk_01FC;
|
||||
/* 01F4 */ C3Vector m_followOffset;
|
||||
/* 0200 */ C3Vector m_burstOffset;
|
||||
/* 020C */ uint32_t m_billboardAxis;
|
||||
/* 0210 */ uint32_t unk_0210;
|
||||
/* 0214 */ uint32_t unk_0214;
|
||||
/* 020C */ C3Vector m_billboardAxis;
|
||||
/* 0218 */ CAaBox m_worldBounds;
|
||||
/* 0230 */ uint32_t unk_0230;
|
||||
|
||||
virtual void Sync();
|
||||
virtual void CreateParticle(CParticle2& particle, float time, const C44Matrix& transform);
|
||||
virtual void CreateParticle(CParticle2_Model& particle, float time, const C44Matrix& transform);
|
||||
virtual void Unk0C(int32_t a1);
|
||||
virtual CParticleEmitter2* Clone(int32_t a1) = 0;
|
||||
virtual void DestroyParticle(CParticle2& particle);
|
||||
virtual CParticleEmitter2* Clone(int32_t copyParticles) = 0;
|
||||
virtual ~CParticleEmitter2();
|
||||
virtual void SetWidth(float width) = 0;
|
||||
virtual void SetHeight(float height) = 0;
|
||||
@@ -172,28 +209,60 @@ class CParticleEmitter2 {
|
||||
virtual void SetLongitude(float longitude) = 0;
|
||||
virtual void SetEmissionRate(float rate);
|
||||
|
||||
CParticleEmitter2();
|
||||
CParticleEmitter2(const CParticleEmitter2& source, int32_t copyParticles);
|
||||
CParticleEmitter2* AddRef();
|
||||
void BuildParticleVertices(ParticleVertex& vertex, uint32_t count, const C44Matrix& transform);
|
||||
int32_t BuildVertex(const CParticle2& particle, ParticleVertex& vertex);
|
||||
float CalcVelocity();
|
||||
void ChangeFrameOfReference(const C44Matrix* matrix);
|
||||
void CreateChildEmittersFromModel(CM2Scene* scene, const char* name);
|
||||
void DecRef();
|
||||
void DetermineIfSimple();
|
||||
void EmitNewParticles(float deltaTime, const C44Matrix& transform);
|
||||
void EmitParticle(float time, const C44Matrix& transform);
|
||||
void FillOutParticleVertex(void* buffer, EGxVertexBufferFormat format, ParticleVertex* vertex);
|
||||
uint32_t GetNumBatches();
|
||||
uint32_t GetNumParticleModels();
|
||||
uint32_t GetNumPrimitives();
|
||||
CM2Model* GetParticleModelInternal(uint32_t& index);
|
||||
void GetReplacementColors(CImVector& color0, CImVector& color1, CImVector& color2);
|
||||
int32_t HasLiveParticles();
|
||||
void InternalUpdate(float deltaTime, int32_t child);
|
||||
void InterpolateAllTracks(const CParticle2& particle, CImVector* color, C2Vector* scale, int32_t* headCell, int32_t* tailCell);
|
||||
void InterpolateAllTracksSimple(const CParticle2& particle, CImVector* color, C2Vector* scale, int32_t* headCell, int32_t* tailCell);
|
||||
CImVector InterpolateColorTrack(float t);
|
||||
int32_t MoveParticle(CParticle2& particle, float deltaTime);
|
||||
int32_t MoveParticle(CParticle2_Model& particle, float deltaTime);
|
||||
void PlaceParticleModels(const C44Matrix* frameOfReference);
|
||||
void ProjectParticle(CParticle2& particle);
|
||||
void RandomizeSpin(const CParticle2& particle, float* spin, float* spinRate);
|
||||
void Render(const C44Matrix* frameOfReference, void* buffer, uint32_t first);
|
||||
int32_t RenderParticle(CParticle2_Model& particle, const C44Matrix* frameOfReference);
|
||||
void RenderParticles(const C44Matrix* frameOfReference, void* buffer);
|
||||
void RenderParticlesPrep(const C44Matrix* frameOfReference, const C44Matrix& view);
|
||||
void SetChooseRandomTexture(int32_t choose);
|
||||
void SetFollowParams(float speed1, float scale1, float speed2, float scale2);
|
||||
void SetMaterial(const CParticleMat& material, CTexture* texture);
|
||||
void SetModel(CM2Scene* scene, const char* name);
|
||||
void SetParticleStyle(int32_t a1, int32_t a2, float tailLength, int32_t a4);
|
||||
void SetParticleColors(const CImVector& color0, const CImVector& color1, const CImVector& color2);
|
||||
void SetParticleStyle(int32_t head, int32_t tail, float tailLength, int32_t clampTail);
|
||||
void SetSimpleAlphaKeys();
|
||||
void SetSimpleColorKeys();
|
||||
void SetSimpleHeadCellKeys();
|
||||
void SetSimpleScaleKeys();
|
||||
void SetSimpleTailCellKeys();
|
||||
void SetTexture(CTexture* texture);
|
||||
void SetTextureDimensions(uint32_t rows, uint32_t cols);
|
||||
void SetTwinkleScale(const CRange& scale);
|
||||
void SetZsource(float zsource);
|
||||
void StepUpdate(float deltaTime, int32_t child);
|
||||
void SyncAllocation(uint32_t count);
|
||||
void SyncReserve(uint32_t count, uint32_t used, uint32_t spare);
|
||||
void Update(float deltaTime, const C44Matrix& transform, const C3Vector& viewPos, const C44Matrix* frameOfReference);
|
||||
const CAaBox& WorldBounds() const;
|
||||
void SetParticleColors(const CImVector& color0, const CImVector& color1, const CImVector& color2);
|
||||
void SetTexture(CTexture* texture);
|
||||
void Render(void* frameOfReference, uint8_t* buffer, int32_t first);
|
||||
int32_t UpdateLiveParticle(float deltaTime, CParticle2* particle, uint32_t index);
|
||||
void UpdateXform(const C44Matrix& transform, const C3Vector& viewPos, const C44Matrix* frameOfReference);
|
||||
CAaBox& WorldBounds();
|
||||
};
|
||||
|
||||
class CPlaneParticleEmitter : public CParticleEmitter2 {
|
||||
@@ -204,7 +273,10 @@ class CPlaneParticleEmitter : public CParticleEmitter2 {
|
||||
/* 0240 */ float m_longitude;
|
||||
|
||||
CPlaneParticleEmitter();
|
||||
CParticleEmitter2* Clone(int32_t a1) override;
|
||||
CPlaneParticleEmitter(const CPlaneParticleEmitter& source, int32_t copyParticles);
|
||||
void CreateParticle(CParticle2& particle, float time, const C44Matrix& transform) override;
|
||||
CParticleEmitter2* Clone(int32_t copyParticles) override;
|
||||
~CPlaneParticleEmitter() override;
|
||||
void SetWidth(float width) override;
|
||||
void SetHeight(float height) override;
|
||||
void SetLatitude(float latitude) override;
|
||||
@@ -216,11 +288,14 @@ class CSphereParticleEmitter : public CParticleEmitter2 {
|
||||
/* 0234 */ float m_minRadius;
|
||||
/* 0238 */ float m_maxRadius;
|
||||
/* 023C */ float m_radiusSpan;
|
||||
/* 0240 */ float m_longitude;
|
||||
/* 0244 */ float unk_0244;
|
||||
/* 0240 */ float m_latitude;
|
||||
/* 0244 */ float m_longitude;
|
||||
|
||||
CSphereParticleEmitter();
|
||||
CParticleEmitter2* Clone(int32_t a1) override;
|
||||
CSphereParticleEmitter(const CSphereParticleEmitter& source, int32_t copyParticles);
|
||||
void CreateParticle(CParticle2& particle, float time, const C44Matrix& transform) override;
|
||||
CParticleEmitter2* Clone(int32_t copyParticles) override;
|
||||
~CSphereParticleEmitter() override;
|
||||
void SetWidth(float width) override;
|
||||
void SetHeight(float height) override;
|
||||
void SetLatitude(float latitude) override;
|
||||
@@ -230,15 +305,18 @@ class CSphereParticleEmitter : public CParticleEmitter2 {
|
||||
class CSplineParticleEmitter : public CParticleEmitter2 {
|
||||
public:
|
||||
/* 0234 */ float m_ratePerUnit;
|
||||
/* 0238 */ float m_width;
|
||||
/* 023C */ float m_splineLength;
|
||||
/* 0240 */ float unk_0240;
|
||||
/* 0244 */ float unk_0244;
|
||||
/* 0248 */ float unk_0248;
|
||||
/* 0238 */ float m_start;
|
||||
/* 023C */ float m_end;
|
||||
/* 0240 */ float m_latitude;
|
||||
/* 0244 */ float m_longitude;
|
||||
/* 0248 */ int32_t m_emitAtEnd;
|
||||
/* 024C */ C3Spline_Bezier3 m_spline;
|
||||
|
||||
CSplineParticleEmitter();
|
||||
CParticleEmitter2* Clone(int32_t a1) override;
|
||||
CSplineParticleEmitter(const CSplineParticleEmitter& source, int32_t copyParticles);
|
||||
void CreateParticle(CParticle2& particle, float time, const C44Matrix& transform) override;
|
||||
CParticleEmitter2* Clone(int32_t copyParticles) override;
|
||||
~CSplineParticleEmitter() override;
|
||||
void SetWidth(float width) override;
|
||||
void SetHeight(float height) override;
|
||||
void SetLatitude(float latitude) override;
|
||||
|
||||
@@ -1 +1,427 @@
|
||||
#include "Profile.h"
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <mbstring.h>
|
||||
#include <new>
|
||||
#include "Engine/Source/Services/Profile.h"
|
||||
#include "Engine/Source/BlizzardCore/SFile2-Core.h"
|
||||
#include "Engine/Source/Storm/H/storm.h"
|
||||
|
||||
// VERIFY: c051543c auto
|
||||
// OFFSET: 0x004BBCB0
|
||||
static void StrTrimTrailingSpace(char* str) {
|
||||
char* ptr = str + SStrLen(str) - 1;
|
||||
|
||||
if (ptr >= str) {
|
||||
while (_ismbcspace(*ptr)) {
|
||||
ptr--;
|
||||
}
|
||||
|
||||
ptr[1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 74491526 manual
|
||||
// OFFSET: 0x004BBD00
|
||||
int32_t ProfileInternal::PrfStrToInt(const char* str) {
|
||||
int32_t result = 0;
|
||||
|
||||
if (*str != '\'') {
|
||||
return SStrToInt(str);
|
||||
}
|
||||
|
||||
const char* ptr = str + 1;
|
||||
|
||||
for (int32_t i = 4; i; i--) {
|
||||
char c = *ptr;
|
||||
|
||||
if (!c || c == '\'') {
|
||||
break;
|
||||
}
|
||||
|
||||
result = c | (result << 8);
|
||||
ptr++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// VERIFY: 7f0bd168 auto
|
||||
// OFFSET: 0x004BBD40
|
||||
void ProfileClose(void* profile) {
|
||||
if (profile) {
|
||||
delete static_cast<ProfileInternal::PROFILE*>(profile);
|
||||
}
|
||||
}
|
||||
|
||||
// INLINED
|
||||
char* ProfileInternal::STRINGBLOCK::Data() {
|
||||
return reinterpret_cast<char*>(this + 1);
|
||||
}
|
||||
|
||||
// VERIFY: d2c1e4f1 manual
|
||||
// OFFSET: 0x004BBEA0
|
||||
ProfileInternal::STRINGBLOCK* ProfileInternal::STRINGBLOCK::AllocBlock(uint32_t size) {
|
||||
uint32_t bytes = size <= 4 ? 4 : size;
|
||||
STRINGBLOCK* block = new (SMemAlloc(bytes + sizeof(STRINGBLOCK), __FILE__, __LINE__, 0)) STRINGBLOCK;
|
||||
block->m_size = size;
|
||||
block->m_refs = 0;
|
||||
block->m_used = 0;
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// VERIFY: 34843167 manual
|
||||
// OFFSET: 0x004BC1C0
|
||||
char* ProfileInternal::STRINGBLOCK::AllocString(TSList<STRINGBLOCK, TSGetLink<STRINGBLOCK> >& list, const char* str, int32_t reuse) {
|
||||
if (!str) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (reuse) {
|
||||
for (STRINGBLOCK* block = list.Head(); block; block = list.Next(block)) {
|
||||
if (str >= block->Data() && str < block->Data() + block->m_size) {
|
||||
block->m_refs++;
|
||||
return const_cast<char*>(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t length = SStrLen(str) + 1;
|
||||
STRINGBLOCK* block = list.Head();
|
||||
|
||||
if (!block || length > block->m_size - block->m_used) {
|
||||
block = AllocBlock(length <= 0x1000 ? 0x1000 : length);
|
||||
list.LinkToHead(block);
|
||||
}
|
||||
|
||||
char* dest = block->Data() + block->m_used;
|
||||
memcpy(dest, str, length);
|
||||
block->m_used += length;
|
||||
block->m_refs++;
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
// VERIFY: e84487f4 manual
|
||||
// OFFSET: 0x004BC290
|
||||
void ProfileInternal::STRINGBLOCK::FreeString(TSList<STRINGBLOCK, TSGetLink<STRINGBLOCK> >& list, char* str) {
|
||||
if (!str) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
STRINGBLOCK* found = nullptr;
|
||||
|
||||
for (STRINGBLOCK* block = list.Head(); block; block = list.Next(block)) {
|
||||
if (str >= block->Data() && str < block->Data() + block->m_size) {
|
||||
found = block;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found->m_refs-- == 1) {
|
||||
found->m_used = 0;
|
||||
list.LinkToHead(found);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 2d27ed1d manual
|
||||
// OFFSET: [0x004BCF60, 0x004BCFE0]
|
||||
ProfileInternal::PROFILE::~PROFILE() {
|
||||
this->m_sections.Clear();
|
||||
this->m_strings.Clear();
|
||||
}
|
||||
|
||||
// VERIFY: e55d3f97 manual
|
||||
// OFFSET: 0x004BD150
|
||||
void* ProfileCreate() {
|
||||
return new (SMemAlloc(sizeof(ProfileInternal::PROFILE), __FILE__, __LINE__, 0)) ProfileInternal::PROFILE;
|
||||
}
|
||||
|
||||
// VERIFY: 4d0d24db manual
|
||||
// OFFSET: 0x004BD320
|
||||
int32_t ProfileGetValue(void* profile, const char* section, const char* key, int32_t* value, uint32_t index) {
|
||||
if (!section) {
|
||||
DebugValidate("section");
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!key) {
|
||||
DebugValidate("key");
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!value) {
|
||||
DebugValidate("value");
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*value = 0;
|
||||
|
||||
ProfileInternal::SECTION* sect = static_cast<ProfileInternal::PROFILE*>(profile)->m_sections.Ptr(section);
|
||||
|
||||
if (!sect) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ProfileInternal::KEYVALUE* keyValue = sect->m_keys.Ptr(key);
|
||||
|
||||
if (!keyValue || index >= keyValue->m_values.Count()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* str = keyValue->m_values[index];
|
||||
|
||||
if (!str) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*value = ProfileInternal::PrfStrToInt(str);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 477a2fb3 manual
|
||||
// OFFSET: 0x004BD3B0
|
||||
int32_t ProfileGetValue(void* profile, const char* section, const char* key, char* buffer, uint32_t bufferSize, uint32_t index) {
|
||||
if (!section) {
|
||||
DebugValidate("section");
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!key) {
|
||||
DebugValidate("key");
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!buffer) {
|
||||
DebugValidate("value");
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*buffer = '\0';
|
||||
|
||||
ProfileInternal::SECTION* sect = static_cast<ProfileInternal::PROFILE*>(profile)->m_sections.Ptr(section);
|
||||
|
||||
if (!sect) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ProfileInternal::KEYVALUE* keyValue = sect->m_keys.Ptr(key);
|
||||
|
||||
if (!keyValue || index >= keyValue->m_values.Count()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* str = keyValue->m_values[index];
|
||||
|
||||
if (!str) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
SStrCopy(buffer, str, bufferSize);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 9c09dbf0 manual
|
||||
// OFFSET: 0x004BD440
|
||||
char* ProfileInternal::AddValue(PROFILE* profile, const char* section, const char* key, const char* value, int32_t replace, int32_t reuse) {
|
||||
SECTION* sect = profile->m_sections.Ptr(section);
|
||||
|
||||
if (!sect) {
|
||||
char* name = STRINGBLOCK::AllocString(profile->m_strings, section, reuse);
|
||||
sect = profile->m_sections.New(SStrHashHT(name), name, 0, 0);
|
||||
}
|
||||
|
||||
KEYVALUE* keyValue = sect->m_keys.Ptr(key);
|
||||
|
||||
if (!keyValue) {
|
||||
char* name = STRINGBLOCK::AllocString(profile->m_strings, key, reuse);
|
||||
keyValue = sect->m_keys.New(SStrHashHT(name), name, 0, 0);
|
||||
}
|
||||
|
||||
if (replace) {
|
||||
for (uint32_t i = keyValue->m_values.Count(); i; i--) {
|
||||
STRINGBLOCK::FreeString(profile->m_strings, keyValue->m_values[i - 1]);
|
||||
}
|
||||
|
||||
keyValue->m_values.Clear();
|
||||
}
|
||||
|
||||
char** slot = keyValue->m_values.New();
|
||||
*slot = STRINGBLOCK::AllocString(profile->m_strings, value, reuse);
|
||||
|
||||
return *slot;
|
||||
}
|
||||
|
||||
// VERIFY: 6aeb4c03 manual
|
||||
// OFFSET: 0x004BD580
|
||||
void ProfileInternal::TokenizeStringValues(PROFILE* profile, const char* section, const char* key, char* values) {
|
||||
if (!section || !key || !values || !*values) {
|
||||
return;
|
||||
}
|
||||
|
||||
char* ptr = values;
|
||||
|
||||
do {
|
||||
int32_t quoted = 0;
|
||||
|
||||
if (*ptr == '"') {
|
||||
quoted = 1;
|
||||
ptr++;
|
||||
}
|
||||
|
||||
char* start = ptr;
|
||||
|
||||
if (*ptr) {
|
||||
while (true) {
|
||||
if (quoted) {
|
||||
if (*ptr == '"') {
|
||||
*ptr++ = '\0';
|
||||
|
||||
if (*ptr == ',') {
|
||||
ptr++;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
} else if (*ptr == ',') {
|
||||
*ptr++ = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
if (!*++ptr) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AddValue(profile, section, key, start, 0, 1);
|
||||
} while (*ptr);
|
||||
}
|
||||
|
||||
// VERIFY: f8f127cf manual
|
||||
// OFFSET: 0x004BD600
|
||||
int32_t ProfileInternal::IReadBuffer(PROFILE* profile, const void* data, uint32_t size) {
|
||||
STRINGBLOCK* block = STRINGBLOCK::AllocBlock(size + 1);
|
||||
char* text = block->Data();
|
||||
memcpy(text, data, size);
|
||||
text[size] = '\0';
|
||||
block->m_used = block->m_size;
|
||||
profile->m_strings.LinkToTail(block);
|
||||
|
||||
const char* section = nullptr;
|
||||
const char* lastSection = nullptr;
|
||||
char* key = nullptr;
|
||||
char* value = nullptr;
|
||||
int32_t state = 0;
|
||||
|
||||
for (char* ptr = text; *ptr; ptr++) {
|
||||
switch (state) {
|
||||
case 0:
|
||||
if (SStrChr("\r\n", *ptr)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!SStrCmp(ptr, "//", 2)) {
|
||||
state = 1;
|
||||
} else if (*ptr == '[') {
|
||||
section = ptr + 1;
|
||||
state = 2;
|
||||
} else {
|
||||
key = ptr;
|
||||
state = 4;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 3:
|
||||
if (SStrChr("\r\n", *ptr)) {
|
||||
state = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (SStrChr("\r\n", *ptr)) {
|
||||
section = lastSection;
|
||||
state = 0;
|
||||
} else if (*ptr == ']') {
|
||||
*ptr = '\0';
|
||||
lastSection = section;
|
||||
state = 3;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (SStrChr("\r\n", *ptr)) {
|
||||
state = 0;
|
||||
key = nullptr;
|
||||
} else if (*ptr == '=') {
|
||||
*ptr = '\0';
|
||||
value = ptr + 1;
|
||||
state = 5;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (SStrChr("\r\n", *ptr)) {
|
||||
*ptr = '\0';
|
||||
TokenizeStringValues(profile, section, key, value);
|
||||
state = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (state == 5) {
|
||||
TokenizeStringValues(profile, section, key, value);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// VERIFY: 1b2c8e3e auto
|
||||
// OFFSET: 0x004BD7C0
|
||||
int32_t ProfileInternal::IReadFile(PROFILE* profile, const char* path) {
|
||||
char name[260];
|
||||
SStrCopy(name, path, sizeof(name));
|
||||
StrTrimTrailingSpace(name);
|
||||
|
||||
uint32_t bytes = 0;
|
||||
void* buffer = nullptr;
|
||||
|
||||
if (!SFile::LoadFile(name, &buffer, &bytes, 1, nullptr)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t result = IReadBuffer(profile, buffer, bytes);
|
||||
SFile::Unload(buffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// VERIFY: 23301000 auto
|
||||
// OFFSET: 0x004BD840
|
||||
int32_t ProfileReadFile(void* profile, const char* path) {
|
||||
if (!path) {
|
||||
DebugValidate("path");
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ProfileInternal::IReadFile(static_cast<ProfileInternal::PROFILE*>(profile), path);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,50 @@
|
||||
#ifndef ENGINE_SOURCE_SERVICES_PROFILE_H
|
||||
#define ENGINE_SOURCE_SERVICES_PROFILE_H
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Base/Handle.h"
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
|
||||
namespace ProfileInternal {
|
||||
struct STRINGBLOCK : public TSLinkedNode<STRINGBLOCK> {
|
||||
static STRINGBLOCK* AllocBlock(uint32_t size);
|
||||
static char* AllocString(TSList<STRINGBLOCK, TSGetLink<STRINGBLOCK> >& list, const char* str, int32_t reuse);
|
||||
static void FreeString(TSList<STRINGBLOCK, TSGetLink<STRINGBLOCK> >& list, char* str);
|
||||
|
||||
/* 0008 */ uint32_t m_refs;
|
||||
/* 000C */ uint32_t m_size;
|
||||
/* 0010 */ uint32_t m_used;
|
||||
|
||||
char* Data();
|
||||
};
|
||||
|
||||
struct KEYVALUE : public TSHashObject<KEYVALUE, HASHKEY_CONSTSTRI> {
|
||||
/* 0018 */ TSGrowableArray<char*> m_values;
|
||||
};
|
||||
|
||||
struct SECTION : public TSHashObject<SECTION, HASHKEY_CONSTSTRI> {
|
||||
/* 0018 */ TSHashTable<KEYVALUE, HASHKEY_CONSTSTRI> m_keys;
|
||||
};
|
||||
|
||||
struct PROFILE : public CHandleObject {
|
||||
/* 0008 */ TSHashTable<SECTION, HASHKEY_CONSTSTRI> m_sections;
|
||||
/* 0030 */ TSList<STRINGBLOCK, TSGetLink<STRINGBLOCK> > m_strings;
|
||||
|
||||
virtual ~PROFILE();
|
||||
};
|
||||
|
||||
char* AddValue(PROFILE* profile, const char* section, const char* key, const char* value, int32_t replace, int32_t reuse);
|
||||
int32_t IReadBuffer(PROFILE* profile, const void* data, uint32_t size);
|
||||
int32_t IReadFile(PROFILE* profile, const char* path);
|
||||
int32_t PrfStrToInt(const char* str);
|
||||
void TokenizeStringValues(PROFILE* profile, const char* section, const char* key, char* values);
|
||||
}
|
||||
|
||||
void ProfileClose(void* profile);
|
||||
void* ProfileCreate();
|
||||
int32_t ProfileGetValue(void* profile, const char* section, const char* key, int32_t* value, uint32_t index);
|
||||
int32_t ProfileGetValue(void* profile, const char* section, const char* key, char* buffer, uint32_t bufferSize, uint32_t index);
|
||||
int32_t ProfileReadFile(void* profile, const char* path);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,18 @@
|
||||
#include "RibbonEmitter.h"
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Services/RibbonEmitter.h"
|
||||
#include "Engine/Source/Base/Handle.h"
|
||||
#include "Engine/Source/Gx/CGxDevice/CGxDevice.h"
|
||||
#include "Engine/Source/Gx/Gx.h"
|
||||
#include "Engine/Source/Services/Texture.h"
|
||||
#include "Engine/Source/ShaderEffect/ShaderEffect.h"
|
||||
#include "Engine/Source/Storm/H/storm.h"
|
||||
#include "Engine/Source/Tempest/C44Matrix.h"
|
||||
#include "Engine/Source/Tempest/C4Vector.h"
|
||||
|
||||
// STATIC: 0x00B2D658
|
||||
static int32_t s_ribbonRenderEnable = 1;
|
||||
|
||||
// INLINED
|
||||
CRibbonMat::CRibbonMat() {
|
||||
@@ -9,3 +23,519 @@ CRibbonMat::CRibbonMat() {
|
||||
this->m_cull = 1;
|
||||
this->m_blendMode = 0;
|
||||
}
|
||||
|
||||
// VERIFY: 68bb48ac manual
|
||||
// OFFSET: 0x0097F510
|
||||
void CRibbonEmitter::ConvertTexSlotToTexCoords() {
|
||||
uint32_t cols = this->m_cols;
|
||||
uint32_t row = this->m_texSlot / cols;
|
||||
float u = (this->m_texSlot % cols) * this->m_texCellU + this->m_texCoords.minY;
|
||||
this->m_texSlotCoords.minY = u;
|
||||
float v = row * this->m_texCellV + this->m_texCoords.minX;
|
||||
this->m_texSlotCoords.minX = v;
|
||||
this->m_texSlotCoords.maxY = u + this->m_texCellU;
|
||||
this->m_texSlotCoords.maxX = v + this->m_texCellV;
|
||||
}
|
||||
|
||||
// VERIFY: 507021d0 manual
|
||||
// OFFSET: 0x0097F570
|
||||
void CRibbonEmitter::SetDataEnabled(int32_t enabled) {
|
||||
this->m_flags ^= (this->m_flags ^ (4 * enabled)) & 0x4;
|
||||
|
||||
if (!(this->m_flags & 0x4)) {
|
||||
this->m_flags &= ~0x1;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 2a6d93b6 manual
|
||||
// OFFSET: 0x0097F5B0
|
||||
void CRibbonEmitter::SetUserEnabled(uint32_t enabled) {
|
||||
this->m_flags ^= (this->m_flags ^ (8 * enabled)) & 0x8;
|
||||
|
||||
if (!(this->m_flags & 0x8)) {
|
||||
this->m_flags &= ~0x1;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: f8d931dc auto
|
||||
// OFFSET: 0x0097F5F0
|
||||
void CRibbonEmitter::SetTexSlot(uint32_t slot) {
|
||||
if (this->m_texSlot != slot) {
|
||||
this->m_texSlot = slot;
|
||||
this->ConvertTexSlotToTexCoords();
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: a4ee293a auto
|
||||
// OFFSET: 0x0097F610
|
||||
void CRibbonEmitter::SetAbove(float above) {
|
||||
this->m_above = above;
|
||||
}
|
||||
|
||||
// VERIFY: 3fe02f2e auto
|
||||
// OFFSET: 0x0097F620
|
||||
void CRibbonEmitter::SetBelow(float below) {
|
||||
this->m_below = below;
|
||||
}
|
||||
|
||||
// VERIFY: ca13231a auto
|
||||
// OFFSET: 0x0097F630
|
||||
void CRibbonEmitter::SetGravity(float gravity) {
|
||||
this->m_gravity = gravity;
|
||||
}
|
||||
|
||||
// VERIFY: bfe848c9 auto
|
||||
// OFFSET: 0x0097F640
|
||||
int32_t CRibbonEmitter::IsDead() {
|
||||
return this->m_readPos == this->m_writePos;
|
||||
}
|
||||
|
||||
// VERIFY: 6515ce90 manual
|
||||
// OFFSET: 0x0097F700
|
||||
void CRibbonEmitter::InitInterpDeltas() {
|
||||
float dz = this->m_prevPos.z - this->m_currPos.z;
|
||||
float dy = this->m_prevPos.y - this->m_currPos.y;
|
||||
float dx = this->m_prevPos.x - this->m_currPos.x;
|
||||
float distance = sqrt(dx * dx + (dy * dy + dz * dz));
|
||||
|
||||
this->m_startBelow = C3Vector(this->m_prevPos.x - this->m_prevUp.x * this->m_below, this->m_prevPos.y - this->m_prevUp.y * this->m_below, this->m_prevPos.z - this->m_below * this->m_prevUp.z);
|
||||
this->m_endBelow = C3Vector(this->m_currPos.x - this->m_currUp.x * this->m_below, this->m_currPos.y - this->m_currUp.y * this->m_below, this->m_currPos.z - this->m_below * this->m_currUp.z);
|
||||
this->m_startAbove = C3Vector(this->m_above * this->m_prevUp.x + this->m_prevPos.x, this->m_prevUp.y * this->m_above + this->m_prevPos.y, this->m_above * this->m_prevUp.z + this->m_prevPos.z);
|
||||
this->m_endAbove = C3Vector(this->m_currUp.x * this->m_above + this->m_currPos.x, this->m_currUp.y * this->m_above + this->m_currPos.y, this->m_above * this->m_currUp.z + this->m_currPos.z);
|
||||
this->m_startTangent = C3Vector(this->m_prevDir.x * distance, this->m_prevDir.y * distance, this->m_prevDir.z * distance);
|
||||
this->m_endTangent = C3Vector(this->m_currDir.x * distance, this->m_currDir.y * distance, distance * this->m_currDir.z);
|
||||
}
|
||||
|
||||
// VERIFY: 946634b1 manual
|
||||
// OFFSET: 0x0097F900
|
||||
void CRibbonEmitter::CloseTextureHandles() {
|
||||
uint32_t count = this->m_textures.Count();
|
||||
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
if (this->m_textures[i]) {
|
||||
HandleClose(reinterpret_cast<HOBJECT>(this->m_textures[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 684a7387 manual
|
||||
// OFFSET: 0x0097F940
|
||||
void CRibbonEmitter::SetPos(const C44Matrix& transform, const C3Vector& position, const C44Matrix* frameOfReference) {
|
||||
if (!(this->m_flags & 0x4) || !(this->m_flags & 0x8)) {
|
||||
return;
|
||||
}
|
||||
|
||||
C44Matrix matrix = transform;
|
||||
matrix.d0 = position.x + matrix.d0;
|
||||
matrix.d1 = position.y + matrix.d1;
|
||||
matrix.d2 = position.z + matrix.d2;
|
||||
|
||||
if (frameOfReference) {
|
||||
matrix *= frameOfReference->AffineInverse();
|
||||
}
|
||||
|
||||
this->m_localPos = position;
|
||||
|
||||
if (this->m_flags & 0x1) {
|
||||
this->m_prevPos = this->m_currPos;
|
||||
this->m_prevDir = this->m_currDir;
|
||||
this->m_prevUp = this->m_currUp;
|
||||
} else {
|
||||
this->m_prevDir = C3Vector(matrix.c0, matrix.c1, matrix.c2);
|
||||
this->m_edgeFraction = 0.0f;
|
||||
this->m_prevUp = C3Vector(matrix.b0, matrix.b1, matrix.b2);
|
||||
this->m_prevPos = C3Vector(matrix.d0, matrix.d1, matrix.d2);
|
||||
this->m_flags |= 0x1;
|
||||
}
|
||||
|
||||
this->m_currPos = C3Vector(matrix.d0, matrix.d1, matrix.d2);
|
||||
this->m_currDir = C3Vector(matrix.c0, matrix.c1, matrix.c2);
|
||||
this->m_currUp = C3Vector(matrix.b0, matrix.b1, matrix.b2);
|
||||
}
|
||||
|
||||
// VERIFY: 139ccf62 manual
|
||||
// OFFSET: 0x0097FAD0
|
||||
int32_t CRibbonEmitter::ReplaceTexture(uint32_t type, CTexture* texture) {
|
||||
int32_t replaced = 0;
|
||||
|
||||
for (uint32_t i = 0; i < this->m_textureTypes.Count(); i++) {
|
||||
if (this->m_textureTypes[i] == type) {
|
||||
if (this->m_textures[i]) {
|
||||
HandleClose(reinterpret_cast<HOBJECT>(this->m_textures[i]));
|
||||
}
|
||||
|
||||
replaced++;
|
||||
this->m_textures[i] = reinterpret_cast<CTexture*>(HandleDuplicate(reinterpret_cast<HOBJECT>(texture)));
|
||||
}
|
||||
}
|
||||
|
||||
return replaced;
|
||||
}
|
||||
|
||||
// VERIFY: b358630b auto
|
||||
// OFFSET: 0x0097FB60
|
||||
void CRibbonEmitter::SetColor(float r, float g, float b) {
|
||||
this->m_color.Set(this->m_color.a * 255.0f, r, g, b);
|
||||
}
|
||||
|
||||
// VERIFY: f4dee58f manual
|
||||
// OFFSET: 0x0097FBA0
|
||||
void CRibbonEmitter::SetAlpha(float alpha) {
|
||||
this->m_color.a = static_cast<uint8_t>(static_cast<int32_t>(alpha * 255.0f + 0.5f));
|
||||
}
|
||||
|
||||
// VERIFY: a976a0e7 manual
|
||||
// OFFSET: 0x0097FBE0
|
||||
void CRibbonEmitter::ChangeFrameOfReference(const C44Matrix* matrix) {
|
||||
const C44Matrix& m = *matrix;
|
||||
|
||||
this->m_prevPos *= m;
|
||||
this->m_prevDir = C3Vector(this->m_prevDir.y * m.b0 + this->m_prevDir.z * m.c0 + this->m_prevDir.x * m.a0, m.c1 * this->m_prevDir.z + this->m_prevDir.x * m.a1 + m.b1 * this->m_prevDir.y, this->m_prevDir.y * m.b2 + m.a2 * this->m_prevDir.x + this->m_prevDir.z * m.c2);
|
||||
this->m_prevUp = C3Vector(this->m_prevUp.y * m.b0 + this->m_prevUp.x * m.a0 + this->m_prevUp.z * m.c0, m.c1 * this->m_prevUp.z + m.b1 * this->m_prevUp.y + this->m_prevUp.x * m.a1, this->m_prevUp.x * m.a2 + this->m_prevUp.z * m.c2 + this->m_prevUp.y * m.b2);
|
||||
|
||||
this->m_currPos *= m;
|
||||
this->m_currDir = C3Vector(this->m_currDir.z * m.c0 + this->m_currDir.y * m.b0 + this->m_currDir.x * m.a0, this->m_currDir.x * m.a1 + m.c1 * this->m_currDir.z + m.b1 * this->m_currDir.y, this->m_currDir.z * m.c2 + this->m_currDir.y * m.b2 + this->m_currDir.x * m.a2);
|
||||
this->m_currUp = C3Vector(this->m_currUp.x * m.a0 + this->m_currUp.y * m.b0 + this->m_currUp.z * m.c0, this->m_currUp.x * m.a1 + this->m_currUp.z * m.c1 + this->m_currUp.y * m.b1, this->m_currUp.z * m.c2 + this->m_currUp.y * m.b2 + m.a2 * this->m_currUp.x);
|
||||
|
||||
for (uint32_t i = 0; i < this->m_vertices.Count(); i++) {
|
||||
this->m_vertices.m_data[i].p *= m;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: b79ec970 auto
|
||||
// OFFSET: 0x0097FE40
|
||||
uint32_t CRibbonEmitter::GetNumBatches() {
|
||||
return this->m_materials.Count();
|
||||
}
|
||||
|
||||
// VERIFY: a63fdf92 manual
|
||||
// OFFSET: 0x0097FE50
|
||||
uint32_t CRibbonEmitter::GetNumPrimitives() {
|
||||
if (this->m_readPos >= this->m_writePos) {
|
||||
return 2 * (this->m_writePos + this->m_edgeAges.Count() - this->m_readPos);
|
||||
}
|
||||
|
||||
return 2 * (this->m_writePos - this->m_readPos);
|
||||
}
|
||||
|
||||
// VERIFY: bcdbf864 manual
|
||||
// OFFSET: 0x0097FEF0
|
||||
void CRibbonEmitter::InterpEdge(float age, float t, uint32_t advance) {
|
||||
CGxVertexPCT* vertex = &this->m_vertices.m_data[2 * this->m_writePos];
|
||||
float s = 1.0f - t;
|
||||
|
||||
vertex[0].p.x = (this->m_endBelow.x - s * this->m_endTangent.x) * t + (this->m_startTangent.x * t + this->m_startBelow.x) * s;
|
||||
vertex[0].p.y = (this->m_endBelow.y - this->m_endTangent.y * s) * t + (this->m_startBelow.y + this->m_startTangent.y * t) * s;
|
||||
vertex[0].p.z = (this->m_endBelow.z - s * this->m_endTangent.z) * t + (this->m_startBelow.z + this->m_startTangent.z * t) * s;
|
||||
|
||||
vertex[1].p.x = (this->m_endAbove.x - this->m_endTangent.x * s) * t + (t * this->m_startTangent.x + this->m_startAbove.x) * s;
|
||||
vertex[1].p.y = (this->m_endAbove.y - this->m_endTangent.y * s) * t + (this->m_startTangent.y * t + this->m_startAbove.y) * s;
|
||||
vertex[1].p.z = s * (t * this->m_startTangent.z + this->m_startAbove.z) + (this->m_endAbove.z - s * this->m_endTangent.z) * t;
|
||||
|
||||
this->m_edgeAges.m_data[this->m_writePos] = age;
|
||||
this->m_writePos += advance;
|
||||
|
||||
if (this->m_writePos >= this->m_edgeAges.Count()) {
|
||||
this->m_writePos -= this->m_edgeAges.Count();
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: b2cbdd07 manual
|
||||
// OFFSET: 0x00980090
|
||||
void CRibbonEmitter::Update(float deltaTime, int32_t suppressNewEdges) {
|
||||
float dt = deltaTime;
|
||||
float start = 1.0f;
|
||||
|
||||
if (!(this->m_flags & 0x10) && this->m_edgesPerSec > 0.0f) {
|
||||
dt = 1.0f / this->m_edgesPerSec + 0.000099999997f;
|
||||
}
|
||||
|
||||
if (dt < 0.0f) {
|
||||
dt = 0.0f;
|
||||
} else if (this->m_edgeLifetime <= dt) {
|
||||
dt = this->m_edgeLifetime;
|
||||
}
|
||||
|
||||
while (this->m_readPos != this->m_writePos) {
|
||||
if (this->m_edgeAges.m_data[this->m_readPos] + dt <= this->m_edgeLifetime) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (++this->m_readPos >= this->m_edgeAges.Count()) {
|
||||
this->m_readPos -= this->m_edgeAges.Count();
|
||||
}
|
||||
}
|
||||
|
||||
if (!suppressNewEdges && (this->m_flags & 0x4) && (this->m_flags & 0x8) && (this->m_flags & 0x1)) {
|
||||
float target = dt * this->m_edgesPerSec + this->m_edgeFraction;
|
||||
CImVector color = this->m_color;
|
||||
|
||||
if (g_theGxDevicePtr->Caps().m_colorFormat == GxCF_rgba) {
|
||||
color.b = this->m_color.r;
|
||||
color.g = this->m_color.g;
|
||||
color.r = this->m_color.b;
|
||||
color.a = this->m_color.a;
|
||||
}
|
||||
|
||||
this->InitInterpDeltas();
|
||||
|
||||
if (target >= 1.0f) {
|
||||
float scale = 1.0f / (target - this->m_edgeFraction);
|
||||
int64_t steps = static_cast<int64_t>(floor(target - 1.0f));
|
||||
|
||||
for (int32_t count = static_cast<int32_t>(steps) + 1; count; count--) {
|
||||
float t = (start - this->m_edgeFraction) * scale;
|
||||
this->m_vertices.m_data[2 * this->m_writePos].c = color;
|
||||
this->m_vertices.m_data[2 * this->m_writePos + 1].c = color;
|
||||
this->InterpEdge(-(t * dt), t, 1);
|
||||
start = start + 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
this->m_edgeFraction = target - floor(target);
|
||||
this->InterpEdge(0.0f, 1.0f, 0);
|
||||
|
||||
CGxVertexPCT* vertex = &this->m_vertices.m_data[2 * this->m_writePos];
|
||||
vertex[0].tc.x = this->m_texSlotCoords.minY;
|
||||
vertex[0].tc.y = this->m_texSlotCoords.minX;
|
||||
vertex[1].tc.x = this->m_texSlotCoords.minY;
|
||||
vertex[1].tc.y = this->m_texSlotCoords.maxX;
|
||||
vertex[0].c = color;
|
||||
vertex[1].c = color;
|
||||
}
|
||||
|
||||
this->m_worldBounds.b.x = 3.4028235e38f;
|
||||
this->m_worldBounds.b.y = 3.4028235e38f;
|
||||
this->m_worldBounds.b.z = 3.4028235e38f;
|
||||
this->m_worldBounds.t.x = -3.4028235e38f;
|
||||
this->m_worldBounds.t.y = -3.4028235e38f;
|
||||
this->m_worldBounds.t.z = -3.4028235e38f;
|
||||
|
||||
for (uint32_t i = this->m_readPos; i != this->m_writePos;) {
|
||||
CGxVertexPCT* vertex = &this->m_vertices.m_data[2 * i];
|
||||
float drop = (this->m_edgeAges.m_data[i] * 2.0f + dt) * this->m_gravity * dt;
|
||||
vertex[0].p.z = vertex[0].p.z + drop;
|
||||
vertex[1].p.z = drop + vertex[1].p.z;
|
||||
|
||||
for (uint32_t j = 0; j < 2; j++) {
|
||||
const C3Vector& p = vertex[j].p;
|
||||
|
||||
if (this->m_worldBounds.b.x > p.x) {
|
||||
this->m_worldBounds.b.x = p.x;
|
||||
}
|
||||
|
||||
if (this->m_worldBounds.b.y > p.y) {
|
||||
this->m_worldBounds.b.y = p.y;
|
||||
}
|
||||
|
||||
if (this->m_worldBounds.b.z > p.z) {
|
||||
this->m_worldBounds.b.z = p.z;
|
||||
}
|
||||
|
||||
if (this->m_worldBounds.t.x < p.x) {
|
||||
this->m_worldBounds.t.x = p.x;
|
||||
}
|
||||
|
||||
if (this->m_worldBounds.t.y < p.y) {
|
||||
this->m_worldBounds.t.y = p.y;
|
||||
}
|
||||
|
||||
if (this->m_worldBounds.t.z < p.z) {
|
||||
this->m_worldBounds.t.z = p.z;
|
||||
}
|
||||
}
|
||||
|
||||
this->m_edgeAges.m_data[i] = dt + this->m_edgeAges.m_data[i];
|
||||
|
||||
float u = this->m_edgeAges.m_data[i] * this->m_texCellU * this->m_invEdgeLifetime + this->m_texSlotCoords.minY;
|
||||
vertex[0].tc.x = u;
|
||||
vertex[0].tc.y = this->m_texSlotCoords.minX;
|
||||
vertex[1].tc.x = u;
|
||||
vertex[1].tc.y = this->m_texSlotCoords.maxX;
|
||||
|
||||
if (++i >= this->m_edgeAges.Count()) {
|
||||
i -= this->m_edgeAges.Count();
|
||||
}
|
||||
}
|
||||
|
||||
this->m_flags = (this->m_flags & ~0x30) | 0x10;
|
||||
}
|
||||
|
||||
// VERIFY: 05a5de95 manual
|
||||
// OFFSET: 0x00980510
|
||||
static void DuplicateTextures(const TSGrowableArray<CTexture*>& source, TSGrowableArray<CTexture*>& dest) {
|
||||
uint32_t count = source.m_count;
|
||||
dest.SetCount(count);
|
||||
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
dest.m_data[i] = reinterpret_cast<CTexture*>(HandleDuplicate(reinterpret_cast<HOBJECT>(source.m_data[i])));
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: 6449e9b3 manual
|
||||
// OFFSET: 0x00980590
|
||||
CRibbonEmitter::~CRibbonEmitter() {
|
||||
this->CloseTextureHandles();
|
||||
this->m_flags &= ~0x2;
|
||||
}
|
||||
|
||||
// VERIFY: 459f4678 auto
|
||||
// OFFSET: 0x00980630
|
||||
CRibbonEmitter::CRibbonEmitter() {
|
||||
this->m_refCount = 1;
|
||||
this->m_texSlotCoords.minX = 0.0f;
|
||||
this->m_texSlotCoords.minY = 0.0f;
|
||||
this->m_texSlotCoords.maxX = 0.0f;
|
||||
this->m_texSlotCoords.maxY = 0.0f;
|
||||
this->m_worldBounds.b.x = 3.4028235e38f;
|
||||
this->m_worldBounds.b.y = 3.4028235e38f;
|
||||
this->m_worldBounds.b.z = 3.4028235e38f;
|
||||
this->m_worldBounds.t.x = -3.4028235e38f;
|
||||
this->m_worldBounds.t.y = -3.4028235e38f;
|
||||
this->m_worldBounds.t.z = -3.4028235e38f;
|
||||
this->m_texCoords.minX = 0.0f;
|
||||
this->m_texCoords.minY = 0.0f;
|
||||
this->m_texCoords.maxX = 0.0f;
|
||||
this->m_texCoords.maxY = 0.0f;
|
||||
this->m_flags &= ~0x12;
|
||||
}
|
||||
|
||||
// VERIFY: 85ed808e manual
|
||||
// OFFSET: 0x009808A0
|
||||
void CRibbonEmitter::Initialize(float edgesPerSecond, float edgeLifetime, const CImVector& color, const TSGrowableArray<CTexture*>& textures, const TSGrowableArray<CRibbonMat>& materials, const TSGrowableArray<uint32_t>& textureTypes, const CAaRect& texCoords, uint32_t rows, uint32_t cols) {
|
||||
float edgesPerSec = ceil(edgesPerSecond);
|
||||
|
||||
if (edgeLifetime < 0.25f) {
|
||||
edgeLifetime = 0.25f;
|
||||
}
|
||||
|
||||
uint32_t edgeCount = static_cast<uint32_t>(ceil(edgesPerSec * edgeLifetime) + 2.0f);
|
||||
this->m_edgeAges.SetCount(edgeCount);
|
||||
|
||||
this->m_flags &= ~0x1;
|
||||
this->m_edgeFraction = 0.0f;
|
||||
this->m_readPos = 0;
|
||||
this->m_writePos = 0;
|
||||
|
||||
this->m_vertices.SetCount(2 * edgeCount);
|
||||
this->m_indices.SetCount(4 * edgeCount);
|
||||
|
||||
for (uint32_t i = 0; i < this->m_indices.Count(); i++) {
|
||||
this->m_indices.m_data[i] = i % (2 * edgeCount);
|
||||
}
|
||||
|
||||
this->m_invEdgeLifetime = 1.0f / edgeLifetime;
|
||||
this->m_texCellU = (texCoords.maxY - texCoords.minY) / cols;
|
||||
this->m_texCellV = (texCoords.maxX - texCoords.minX) / rows;
|
||||
this->m_invTexCellU = 1.0f / this->m_texCellU;
|
||||
this->m_invTexCellV = 1.0f / this->m_texCellV;
|
||||
this->m_edgesPerSec = edgesPerSec;
|
||||
this->m_edgeLifetime = edgeLifetime;
|
||||
this->m_color = color;
|
||||
this->m_materials = materials;
|
||||
DuplicateTextures(textures, this->m_textures);
|
||||
this->m_textureTypes = textureTypes;
|
||||
this->m_texCoords = texCoords;
|
||||
this->m_rows = rows;
|
||||
this->m_cols = cols;
|
||||
this->m_texSlot = 0;
|
||||
this->ConvertTexSlotToTexCoords();
|
||||
this->m_flags |= 0xE;
|
||||
this->m_above = 10.0f;
|
||||
this->m_below = 10.0f;
|
||||
this->m_gravity = 0.0f;
|
||||
}
|
||||
|
||||
// VERIFY: 6008d884 auto
|
||||
// OFFSET: 0x00980B50
|
||||
void CRibbonEmitter::DecRef() {
|
||||
if (this->m_refCount-- == 1) {
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: b28c0986 manual
|
||||
// OFFSET: 0x00980B70
|
||||
int32_t CRibbonEmitter::Render(const C44Matrix* frameOfReference) {
|
||||
if (!s_ribbonRenderEnable || this->m_readPos == this->m_writePos) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
C44Matrix world;
|
||||
|
||||
if (frameOfReference) {
|
||||
world = *frameOfReference;
|
||||
}
|
||||
|
||||
world.d0 = world.d0 - this->m_localPos.x;
|
||||
world.d1 = world.d1 - this->m_localPos.y;
|
||||
world.d2 = world.d2 - this->m_localPos.z;
|
||||
g_theGxDevicePtr->XformPushAndSet(GxXform_World, world);
|
||||
|
||||
CGxBuf* vertexBuf = g_theGxDevicePtr->BufStream(GxPoolTarget_Vertex, sizeof(CGxVertexPCT), this->m_vertices.Count());
|
||||
CGxBuf* indexBuf = g_theGxDevicePtr->BufStream(GxPoolTarget_Index, sizeof(uint16_t), this->m_indices.Count());
|
||||
GxBufData(vertexBuf, this->m_vertices.m_data, sizeof(CGxVertexPCT) * this->m_vertices.Count(), 0);
|
||||
GxPrimVertexPtr(vertexBuf, GxVBF_PCT);
|
||||
|
||||
uint32_t indexCount;
|
||||
|
||||
if (this->m_readPos >= this->m_writePos) {
|
||||
indexCount = 2 * (this->m_writePos + this->m_edgeAges.Count() - this->m_readPos) + 2;
|
||||
} else {
|
||||
indexCount = 2 * (this->m_writePos - this->m_readPos) + 2;
|
||||
}
|
||||
|
||||
GxBufData(indexBuf, &this->m_indices.m_data[2 * this->m_readPos], sizeof(uint16_t) * indexCount, 0);
|
||||
g_theGxDevicePtr->PrimIndexPtr(indexBuf);
|
||||
|
||||
CGxBatch batch;
|
||||
batch.m_primType = GxPrim_TriangleStrip;
|
||||
batch.m_start = 0;
|
||||
batch.m_count = indexCount;
|
||||
batch.m_minIndex = 0;
|
||||
batch.m_maxIndex = this->m_vertices.Count() - 1;
|
||||
|
||||
for (uint32_t i = 0; i < this->m_materials.Count(); i++) {
|
||||
g_theGxDevicePtr->RsPush();
|
||||
|
||||
const CRibbonMat& material = this->m_materials.m_data[i];
|
||||
C4Vector emissive;
|
||||
|
||||
if (material.m_lit) {
|
||||
emissive.x = 0.0f;
|
||||
emissive.y = 0.0f;
|
||||
emissive.z = 0.0f;
|
||||
emissive.w = 0.0f;
|
||||
} else {
|
||||
emissive.x = 1.0f;
|
||||
emissive.y = 1.0f;
|
||||
emissive.z = 1.0f;
|
||||
emissive.w = 0.0f;
|
||||
}
|
||||
|
||||
CShaderEffect::SetEmissive(emissive);
|
||||
CShaderEffect::SetFogEnabled(material.m_fogged);
|
||||
CShaderEffect::SetLightingEnabled(material.m_lit);
|
||||
g_theGxDevicePtr->RsSet(GxRs_DepthTest, static_cast<int32_t>(material.m_depthTest));
|
||||
g_theGxDevicePtr->RsSet(GxRs_DepthWrite, static_cast<int32_t>(material.m_depthWrite));
|
||||
g_theGxDevicePtr->RsSet(GxRs_Culling, static_cast<int32_t>(material.m_cull));
|
||||
g_theGxDevicePtr->RsSet(GxRs_BlendingMode, static_cast<int32_t>(material.m_blendMode));
|
||||
CShaderEffect::SetAlphaRefDefault();
|
||||
|
||||
CGxTex* gxTex = TextureGetGxTex(this->m_textures.m_data[i], 0, nullptr);
|
||||
|
||||
if (gxTex) {
|
||||
g_theGxDevicePtr->RsSet(GxRs_Texture0, gxTex);
|
||||
GxTexSetWrap(gxTex, GxTex_Clamp, GxTex_Clamp);
|
||||
CShaderEffect::SetDefaultShaders(0);
|
||||
CShaderEffect::UpdateWorldViewMatrix();
|
||||
g_theGxDevicePtr->Draw(&batch, 1);
|
||||
}
|
||||
|
||||
g_theGxDevicePtr->RsPop();
|
||||
}
|
||||
|
||||
GxXformPop(GxXform_World);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Gx/CGxVertexPCT.h"
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
#include "Engine/Source/Tempest/C3Vector.h"
|
||||
#include "Engine/Source/Tempest/CAaBox.h"
|
||||
#include "Engine/Source/Tempest/CAaRect.h"
|
||||
#include "Engine/Source/Tempest/CImVector.h"
|
||||
|
||||
class C3Vector;
|
||||
class CAaRect;
|
||||
class CImVector;
|
||||
class C44Matrix;
|
||||
class CRibbonEmitter;
|
||||
class CTexture;
|
||||
|
||||
class CRibbonMat {
|
||||
@@ -27,25 +27,68 @@ class CRibbonMat {
|
||||
|
||||
class CRibbonEmitter {
|
||||
public:
|
||||
/* 0000 */ uint8_t unk_0000 [0xF4];
|
||||
/* 0000 */ int32_t m_refCount;
|
||||
/* 0004 */ TSGrowableArray<float> m_edgeAges;
|
||||
/* 0014 */ uint32_t m_writePos;
|
||||
/* 0018 */ uint32_t m_readPos;
|
||||
/* 001C */ float m_edgeFraction;
|
||||
/* 0020 */ C3Vector m_prevPos;
|
||||
/* 002C */ C3Vector m_localPos;
|
||||
/* 0038 */ TSGrowableArray<CGxVertexPCT> m_vertices;
|
||||
/* 0048 */ TSGrowableArray<uint16_t> m_indices;
|
||||
/* 0058 */ float m_invEdgeLifetime;
|
||||
/* 005C */ float m_texCellU;
|
||||
/* 0060 */ float m_texCellV;
|
||||
/* 0064 */ float m_invTexCellU;
|
||||
/* 0068 */ float m_invTexCellV;
|
||||
/* 006C */ CAaRect m_texSlotCoords;
|
||||
/* 007C */ C3Vector m_prevUp;
|
||||
/* 0088 */ C3Vector m_currUp;
|
||||
/* 0094 */ C3Vector m_prevDir;
|
||||
/* 00A0 */ C3Vector m_currDir;
|
||||
/* 00AC */ C3Vector m_startTangent;
|
||||
/* 00B8 */ C3Vector m_endTangent;
|
||||
/* 00C4 */ C3Vector m_startBelow;
|
||||
/* 00D0 */ C3Vector m_endBelow;
|
||||
/* 00DC */ C3Vector m_startAbove;
|
||||
/* 00E8 */ C3Vector m_endAbove;
|
||||
/* 00F4 */ CAaBox m_worldBounds;
|
||||
/* 010C */ uint8_t unk_010C [0x74];
|
||||
/* 010C */ float m_edgesPerSec;
|
||||
/* 0110 */ float m_edgeLifetime;
|
||||
/* 0114 */ TSGrowableArray<CRibbonMat> m_materials;
|
||||
/* 0124 */ TSGrowableArray<CTexture*> m_textures;
|
||||
/* 0134 */ TSGrowableArray<uint32_t> m_textureTypes;
|
||||
/* 0144 */ CImVector m_color;
|
||||
/* 0148 */ CAaRect m_texCoords;
|
||||
/* 0158 */ uint32_t m_rows;
|
||||
/* 015C */ uint32_t m_cols;
|
||||
/* 0160 */ uint32_t m_flags;
|
||||
/* 0164 */ C3Vector m_currPos;
|
||||
/* 0170 */ uint32_t m_texSlot;
|
||||
/* 0174 */ float m_above;
|
||||
/* 0178 */ float m_below;
|
||||
/* 017C */ float m_gravity;
|
||||
|
||||
CRibbonEmitter();
|
||||
~CRibbonEmitter();
|
||||
void Initialize(float edgesPerSecond, float edgeLifetime, const CImVector& color, const TSGrowableArray<CTexture*>& textures, const TSGrowableArray<CRibbonMat>& materials, const TSGrowableArray<uint32_t>& textureTypes, const CAaRect& texCoords, uint32_t rows, uint32_t cols);
|
||||
void SetGravity(float gravity);
|
||||
void ChangeFrameOfReference(const C44Matrix* matrix);
|
||||
void CloseTextureHandles();
|
||||
void ConvertTexSlotToTexCoords();
|
||||
void DecRef();
|
||||
uint32_t GetNumBatches();
|
||||
uint32_t GetNumPrimitives();
|
||||
void InitInterpDeltas();
|
||||
void Initialize(float edgesPerSecond, float edgeLifetime, const CImVector& color, const TSGrowableArray<CTexture*>& textures, const TSGrowableArray<CRibbonMat>& materials, const TSGrowableArray<uint32_t>& textureTypes, const CAaRect& texCoords, uint32_t rows, uint32_t cols);
|
||||
void InterpEdge(float age, float t, uint32_t advance);
|
||||
int32_t IsDead();
|
||||
void Render(void* frameOfReference);
|
||||
void ReplaceTexture(uint32_t type, CTexture* texture);
|
||||
int32_t Render(const C44Matrix* frameOfReference);
|
||||
int32_t ReplaceTexture(uint32_t type, CTexture* texture);
|
||||
void SetAbove(float above);
|
||||
void SetAlpha(float alpha);
|
||||
void SetBelow(float below);
|
||||
void SetColor(float r, float g, float b);
|
||||
void SetDataEnabled(int32_t enabled);
|
||||
void SetGravity(float gravity);
|
||||
void SetPos(const C44Matrix& transform, const C3Vector& position, const C44Matrix* frameOfReference);
|
||||
void SetTexSlot(uint32_t slot);
|
||||
void SetUserEnabled(uint32_t enabled);
|
||||
|
||||
@@ -1 +1,380 @@
|
||||
#include "TextBlock.h"
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <new>
|
||||
#include "Engine/Source/Services/TextBlock.h"
|
||||
#include "Engine/Source/Base/Coordinate.h"
|
||||
#include "Engine/Source/Gxu/GxuFont.h"
|
||||
#include "Engine/Source/Storm/H/storm.h"
|
||||
#include "Engine/Source/Tempest/C2Vector.h"
|
||||
#include "Engine/Source/Tempest/CImVector.h"
|
||||
|
||||
// STATIC: 0x00B4A2A8
|
||||
static TSHashTable<FONTHASHOBJ, HASHKEY_STR> s_fontHash;
|
||||
|
||||
// INLINED
|
||||
TEXTBLOCK::TEXTBLOCK() {
|
||||
this->m_string = nullptr;
|
||||
}
|
||||
|
||||
// INLINED
|
||||
FONTHASHOBJ::FONTHASHOBJ() {
|
||||
this->m_font = nullptr;
|
||||
}
|
||||
|
||||
// VERIFY: 411a7a2f auto
|
||||
// OFFSET: 0x004BD870
|
||||
static uint32_t ConvertStringFlags(uint32_t flags) {
|
||||
uint32_t result = (flags & 0x100) != 0;
|
||||
|
||||
if (flags & 0x200) {
|
||||
result |= 0x4;
|
||||
}
|
||||
|
||||
if (flags & 0x400) {
|
||||
result |= 0x8;
|
||||
}
|
||||
|
||||
if (flags & 0x800) {
|
||||
result |= 0x10;
|
||||
}
|
||||
|
||||
if (flags & 0x40) {
|
||||
result |= 0x2;
|
||||
}
|
||||
|
||||
if (flags & 0x1000) {
|
||||
result |= 0x40;
|
||||
}
|
||||
|
||||
if (flags & 0x2000) {
|
||||
result |= 0x100;
|
||||
}
|
||||
|
||||
if (flags & 0x4000) {
|
||||
result |= 0x200;
|
||||
}
|
||||
|
||||
if (flags & 0x8000) {
|
||||
result |= 0x400;
|
||||
}
|
||||
|
||||
if (flags & 0x80) {
|
||||
result |= 0x800;
|
||||
}
|
||||
|
||||
if (flags & 0x10000) {
|
||||
result |= 0x1000;
|
||||
}
|
||||
|
||||
if (flags & 0x20000) {
|
||||
result |= 0x2000;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// VERIFY: 2b778814 auto
|
||||
// OFFSET: 0x004BD900
|
||||
int32_t TextBlockSetGradient(HTEXTBLOCK string, int32_t start, int32_t length) {
|
||||
return GxuFontStringSetGradient(reinterpret_cast<TEXTBLOCK*>(string)->m_string, start, length);
|
||||
}
|
||||
|
||||
// VERIFY: 77b154ef manual
|
||||
// OFFSET: 0x004BD920
|
||||
TEXTBLOCK::~TEXTBLOCK() {
|
||||
GxuFontDestroyString(this->m_string);
|
||||
}
|
||||
|
||||
// VERIFY: 1ca29484 auto
|
||||
// OFFSET: 0x004BD960
|
||||
const char* TextBlockGetFontName(HTEXTFONT font) {
|
||||
if (!font) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return GxuFontGetFontName(reinterpret_cast<FONTHASHOBJ*>(font)->m_font);
|
||||
}
|
||||
|
||||
// VERIFY: 007ea268 auto
|
||||
// OFFSET: 0x004BD990
|
||||
uint32_t TextBlockGetFontFlags(HTEXTFONT font) {
|
||||
if (!font) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t fontFlags = GxuFontGetFontFlags(reinterpret_cast<FONTHASHOBJ*>(font)->m_font);
|
||||
uint32_t flags = (fontFlags & 0x1) != 0;
|
||||
|
||||
if (fontFlags & 0x8) {
|
||||
flags |= 0x4;
|
||||
}
|
||||
|
||||
if (fontFlags & 0x2) {
|
||||
flags |= 0x2;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
// VERIFY: 252921ac auto
|
||||
// OFFSET: 0x004BD9D0
|
||||
CGxFont* TextBlockGetFontPtr(HTEXTFONT font) {
|
||||
if (!font) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return reinterpret_cast<FONTHASHOBJ*>(font)->m_font;
|
||||
}
|
||||
|
||||
// VERIFY: 76dd741a auto
|
||||
// OFFSET: 0x004BD9F0
|
||||
CGxString* TextBlockGetStringPtr(HTEXTBLOCK string) {
|
||||
if (!string) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return reinterpret_cast<TEXTBLOCK*>(string)->m_string;
|
||||
}
|
||||
|
||||
// VERIFY: bc267847 auto
|
||||
// OFFSET: 0x004BDA10
|
||||
void TextBlockAddShadow(HTEXTBLOCK string, CImVector color, const C2Vector& offset) {
|
||||
if (!string) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
C2Vector ndcOffset = offset;
|
||||
DDCToNDC(offset.x, offset.y, &ndcOffset.x, &ndcOffset.y);
|
||||
GxuFontAddShadow(reinterpret_cast<TEXTBLOCK*>(string)->m_string, color, ndcOffset);
|
||||
}
|
||||
|
||||
// VERIFY: 5d029466 auto
|
||||
// OFFSET: 0x004BDA70
|
||||
void TextBlockRemoveShadow(HTEXTBLOCK string) {
|
||||
if (!string) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
GxuFontRemoveShadow(reinterpret_cast<TEXTBLOCK*>(string)->m_string);
|
||||
}
|
||||
|
||||
// VERIFY: e87143c4 manual
|
||||
// OFFSET: 0x004BDAA0
|
||||
HTEXTBLOCK TextBlockCreate(HTEXTFONT font, const char* text, const CImVector& color, const C3Vector& position, float fontHeight, float blockWidth, float blockHeight, uint32_t flags, float charSpacing, float lineSpacing, float scale) {
|
||||
if (!font || !text) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* mem = SMemAlloc(sizeof(TEXTBLOCK), "HTEXTBLOCK", SLOG_OBJECT, 0);
|
||||
TEXTBLOCK* textBlock = mem ? new (mem) TEXTBLOCK : nullptr;
|
||||
|
||||
C3Vector ndcPosition(0.0f, 0.0f, position.z);
|
||||
DDCToNDC(position.x, position.y, &ndcPosition.x, &ndcPosition.y);
|
||||
|
||||
EGxFontHJusts horzJust = GxHJ_Center;
|
||||
|
||||
if (flags & 0x4) {
|
||||
horzJust = GxHJ_Right;
|
||||
} else if (!(flags & 0x2) && (flags & 0x1)) {
|
||||
horzJust = GxHJ_Left;
|
||||
}
|
||||
|
||||
EGxFontVJusts vertJust = GxVJ_Middle;
|
||||
|
||||
if (flags & 0x8) {
|
||||
vertJust = GxVJ_Top;
|
||||
} else if (flags & 0x20) {
|
||||
vertJust = GxVJ_Bottom;
|
||||
}
|
||||
|
||||
GxuFontCreateString(reinterpret_cast<FONTHASHOBJ*>(font)->m_font, text, DDCToNDCHeight(fontHeight), ndcPosition, DDCToNDCWidth(blockWidth), DDCToNDCHeight(blockHeight), DDCToNDCHeight(lineSpacing), textBlock->m_string, vertJust, horzJust, ConvertStringFlags(flags), color, DDCToNDCWidth(charSpacing), scale);
|
||||
|
||||
return reinterpret_cast<HTEXTBLOCK>(HandleCreate(textBlock, "HTEXTBLOCK"));
|
||||
}
|
||||
|
||||
// VERIFY: 3c68977b auto
|
||||
// OFFSET: 0x004BDBF0
|
||||
void TextBlockSetStringPos(HTEXTBLOCK string, const C3Vector& position) {
|
||||
if (!string) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
C3Vector ndcPosition(0.0f, 0.0f, position.z);
|
||||
DDCToNDC(position.x, position.y, &ndcPosition.x, &ndcPosition.y);
|
||||
GxuFontSetStringPosition(reinterpret_cast<TEXTBLOCK*>(string)->m_string, ndcPosition);
|
||||
}
|
||||
|
||||
// VERIFY: 7827f7e0 manual
|
||||
// OFFSET: 0x004BDC50
|
||||
C3Vector TextBlockGetStringPos(HTEXTBLOCK string) {
|
||||
C3Vector ndcPosition = GxuFontGetStringPosition(reinterpret_cast<TEXTBLOCK*>(string)->m_string);
|
||||
C3Vector position(0.0f, 0.0f, ndcPosition.z);
|
||||
NDCToDDC(ndcPosition.x, ndcPosition.y, &position.x, &position.y);
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
// VERIFY: 3a46df44 auto
|
||||
// OFFSET: 0x004BDCA0
|
||||
void TextBlockUpdateColor(HTEXTBLOCK string, const CImVector& color) {
|
||||
if (!string) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
GxuFontSetStringColor(reinterpret_cast<TEXTBLOCK*>(string)->m_string, color);
|
||||
}
|
||||
|
||||
// VERIFY: 77525dd6 auto
|
||||
// OFFSET: 0x004BDCD0
|
||||
void TextBlockGetTextExtent(HTEXTFONT font, const char* text, uint32_t numBytes, float fontHeight, float* extent, float shadowWidth, float scale, float unused, uint32_t flags) {
|
||||
if (!font || !text || !extent) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
*extent = 0.0f;
|
||||
|
||||
CGxFont* face = reinterpret_cast<FONTHASHOBJ*>(font)->m_font;
|
||||
|
||||
if (!face) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return;
|
||||
}
|
||||
|
||||
GxuFontGetTextExtent(face, text, numBytes, DDCToNDCHeight(fontHeight), extent, DDCToNDCWidth(shadowWidth), scale, DDCToNDCWidth(unused), ConvertStringFlags(flags));
|
||||
NDCToDDC(*extent, 0.0f, extent, nullptr);
|
||||
}
|
||||
|
||||
// VERIFY: 664108fa manual
|
||||
// OFFSET: 0x004BDD80
|
||||
float TextBlockGetWrappedTextHeight(HTEXTFONT font, const char* text, float fontHeight, float blockWidth, const C2Vector& shadowOffset, float scale, float spacing, uint32_t flags) {
|
||||
if (!font || !text || !reinterpret_cast<FONTHASHOBJ*>(font)->m_font) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
C2Vector ndcShadow = shadowOffset;
|
||||
DDCToNDC(ndcShadow.x, ndcShadow.y, &ndcShadow.x, &ndcShadow.y);
|
||||
|
||||
float height = GxuFontGetWrappedTextHeight(reinterpret_cast<FONTHASHOBJ*>(font)->m_font, text, DDCToNDCHeight(fontHeight), DDCToNDCWidth(blockWidth), ndcShadow, scale, DDCToNDCHeight(spacing), ConvertStringFlags(flags));
|
||||
|
||||
return NDCToDDCHeight(height);
|
||||
}
|
||||
|
||||
// VERIFY: a9437d87 manual
|
||||
// OFFSET: 0x004BDE40
|
||||
uint32_t TextBlockGetMaxCharsWithinWidth(HTEXTFONT font, const char* text, float fontHeight, float maxWidth, uint32_t numBytes, float* extent, float shadowWidth, float scale, float unused, uint32_t flags) {
|
||||
if (!font || !text || !reinterpret_cast<FONTHASHOBJ*>(font)->m_font) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t numChars = GxuFontGetMaxCharsWithinWidth(reinterpret_cast<FONTHASHOBJ*>(font)->m_font, text, DDCToNDCHeight(fontHeight), DDCToNDCWidth(maxWidth), numBytes, extent, DDCToNDCWidth(shadowWidth), scale, DDCToNDCWidth(unused), ConvertStringFlags(flags));
|
||||
NDCToDDC(*extent, 0.0f, extent, nullptr);
|
||||
|
||||
return numChars;
|
||||
}
|
||||
|
||||
// VERIFY: ec57cb90 manual
|
||||
// OFFSET: 0x004BDEF0
|
||||
uint32_t TextBlockGetMaxCharsWithinWidthAndHeight(HTEXTFONT font, const char* text, float fontHeight, float blockWidth, float blockHeight, uint32_t numBytes, float shadowWidth, float scale, float spacing, uint32_t flags) {
|
||||
if (!font || !text || !reinterpret_cast<FONTHASHOBJ*>(font)->m_font) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return GxuFontGetMaxCharsWithinWidthAndHeight(reinterpret_cast<FONTHASHOBJ*>(font)->m_font, text, DDCToNDCHeight(fontHeight), DDCToNDCWidth(blockWidth), DDCToNDCHeight(blockHeight), numBytes, DDCToNDCWidth(shadowWidth), scale, DDCToNDCHeight(spacing), ConvertStringFlags(flags));
|
||||
}
|
||||
|
||||
// VERIFY: 2166778f manual
|
||||
// OFFSET: 0x004BDF90
|
||||
uint32_t TextBlockGetMaxCharsWithinWidthFromEnd(HTEXTFONT font, const char* text, float fontHeight, float maxWidth, uint32_t numBytes, float* extent, float shadowWidth, float scale, float unused, uint32_t flags) {
|
||||
if (!font || !text || !reinterpret_cast<FONTHASHOBJ*>(font)->m_font) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t numChars = GxuFontGetMaxCharsWithinWidthFromEnd(reinterpret_cast<FONTHASHOBJ*>(font)->m_font, text, DDCToNDCHeight(fontHeight), DDCToNDCWidth(maxWidth), numBytes, extent, DDCToNDCWidth(shadowWidth), scale, DDCToNDCWidth(unused), ConvertStringFlags(flags));
|
||||
NDCToDDC(*extent, 0.0f, extent, nullptr);
|
||||
|
||||
return numChars;
|
||||
}
|
||||
|
||||
// VERIFY: db0dc9c8 auto
|
||||
// OFFSET: 0x004BE040
|
||||
uint32_t TextBlockWrapText(HTEXTFONT font, const char* text, float fontHeight, float blockWidth, uint32_t* lineStarts, uint32_t maxLines, float shadowWidth, float scale, float unused, uint32_t flags) {
|
||||
if (!font || !text || !reinterpret_cast<FONTHASHOBJ*>(font)->m_font) {
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return GxuFontWrapText(reinterpret_cast<FONTHASHOBJ*>(font)->m_font, text, SStrLen(text), DDCToNDCHeight(fontHeight), DDCToNDCWidth(blockWidth), lineStarts, maxLines, DDCToNDCWidth(shadowWidth), scale, DDCToNDCWidth(unused), ConvertStringFlags(flags));
|
||||
}
|
||||
|
||||
// VERIFY: 6a182661 manual
|
||||
// OFFSET: 0x004BE500
|
||||
FONTHASHOBJ::~FONTHASHOBJ() {
|
||||
if (this->m_font) {
|
||||
GxuFontDestroyFont(this->m_font);
|
||||
}
|
||||
}
|
||||
|
||||
// VERIFY: e00f1e9e manual
|
||||
// OFFSET: 0x004BE9C0
|
||||
HTEXTFONT TextBlockGenerateFont(const char* fontName, uint32_t fontFlags, float fontHeight) {
|
||||
if (!fontName) {
|
||||
DebugValidate("fontName");
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!*fontName) {
|
||||
DebugValidate("*fontName");
|
||||
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
float height = DDCToNDCHeight(fontHeight);
|
||||
|
||||
if (height >= 1.0f) {
|
||||
height = 1.0f;
|
||||
}
|
||||
|
||||
char key[276];
|
||||
SStrPrintf(key, sizeof(key), "%s-%d-%f", fontName, fontFlags, height);
|
||||
|
||||
FONTHASHOBJ* hashObj = s_fontHash.Ptr(key);
|
||||
|
||||
if (hashObj) {
|
||||
return reinterpret_cast<HTEXTFONT>(HandleCreate(hashObj, "HTEXTFONT"));
|
||||
}
|
||||
|
||||
hashObj = s_fontHash.New(SStrHashHT(key), key, 0, 0);
|
||||
|
||||
uint32_t gxFlags = (fontFlags & 0x1) != 0;
|
||||
|
||||
if (fontFlags & 0x4) {
|
||||
gxFlags |= 0x8;
|
||||
}
|
||||
|
||||
if (fontFlags & 0x2) {
|
||||
gxFlags |= 0x2;
|
||||
}
|
||||
|
||||
if (GxuFontCreateFont(fontName, height, hashObj->m_font, gxFlags)) {
|
||||
return reinterpret_cast<HTEXTFONT>(HandleCreate(hashObj, "HTEXTFONT"));
|
||||
}
|
||||
|
||||
s_fontHash.Delete(hashObj);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -4,12 +4,47 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Base/Handle.h"
|
||||
#include "Engine/Source/Services/Types.h"
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
#include "Engine/Source/Tempest/C3Vector.h"
|
||||
|
||||
class CGxString;
|
||||
class C2Vector;
|
||||
class CImVector;
|
||||
struct CGxFont;
|
||||
struct CGxString;
|
||||
|
||||
class TEXTBLOCK : public CHandleObject {
|
||||
public:
|
||||
/* 0008 */ CGxString* m_string;
|
||||
|
||||
TEXTBLOCK();
|
||||
virtual ~TEXTBLOCK();
|
||||
};
|
||||
|
||||
struct FONTHASHOBJ : public CHandleObject, public TSHashObject<FONTHASHOBJ, HASHKEY_STR> {
|
||||
/* 0020 */ CGxFont* m_font;
|
||||
|
||||
FONTHASHOBJ();
|
||||
virtual ~FONTHASHOBJ();
|
||||
};
|
||||
|
||||
void TextBlockAddShadow(HTEXTBLOCK string, CImVector color, const C2Vector& offset);
|
||||
HTEXTBLOCK TextBlockCreate(HTEXTFONT font, const char* text, const CImVector& color, const C3Vector& position, float fontHeight, float blockWidth, float blockHeight, uint32_t flags, float charSpacing, float lineSpacing, float scale);
|
||||
HTEXTFONT TextBlockGenerateFont(const char* fontName, uint32_t fontFlags, float fontHeight);
|
||||
uint32_t TextBlockGetFontFlags(HTEXTFONT font);
|
||||
const char* TextBlockGetFontName(HTEXTFONT font);
|
||||
CGxFont* TextBlockGetFontPtr(HTEXTFONT font);
|
||||
uint32_t TextBlockGetMaxCharsWithinWidth(HTEXTFONT font, const char* text, float fontHeight, float maxWidth, uint32_t numBytes, float* extent, float shadowWidth, float scale, float unused, uint32_t flags);
|
||||
uint32_t TextBlockGetMaxCharsWithinWidthAndHeight(HTEXTFONT font, const char* text, float fontHeight, float blockWidth, float blockHeight, uint32_t numBytes, float shadowWidth, float scale, float spacing, uint32_t flags);
|
||||
uint32_t TextBlockGetMaxCharsWithinWidthFromEnd(HTEXTFONT font, const char* text, float fontHeight, float maxWidth, uint32_t numBytes, float* extent, float shadowWidth, float scale, float unused, uint32_t flags);
|
||||
C3Vector TextBlockGetStringPos(HTEXTBLOCK string);
|
||||
CGxString* TextBlockGetStringPtr(HTEXTBLOCK string);
|
||||
void TextBlockGetTextExtent(HTEXTFONT font, const char* text, uint32_t numBytes, float fontHeight, float* extent, float shadowWidth, float scale, float unused, uint32_t flags);
|
||||
float TextBlockGetWrappedTextHeight(HTEXTFONT font, const char* text, float fontHeight, float blockWidth, const C2Vector& shadowOffset, float scale, float spacing, uint32_t flags);
|
||||
void TextBlockRemoveShadow(HTEXTBLOCK string);
|
||||
int32_t TextBlockSetGradient(HTEXTBLOCK string, int32_t start, int32_t length);
|
||||
void TextBlockSetStringPos(HTEXTBLOCK string, const C3Vector& position);
|
||||
void TextBlockUpdateColor(HTEXTBLOCK string, const CImVector& color);
|
||||
uint32_t TextBlockWrapText(HTEXTFONT font, const char* text, float fontHeight, float blockWidth, uint32_t* lineStarts, uint32_t maxLines, float shadowWidth, float scale, float unused, uint32_t flags);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,6 +31,18 @@ class CAsyncObject {
|
||||
int32_t IsPending();
|
||||
};
|
||||
|
||||
struct HTEXTBLOCK__ {
|
||||
/* 0000 */ int32_t m_unused;
|
||||
};
|
||||
|
||||
typedef HTEXTBLOCK__* HTEXTBLOCK;
|
||||
|
||||
struct HTEXTFONT__ {
|
||||
/* 0000 */ int32_t m_unused;
|
||||
};
|
||||
|
||||
typedef HTEXTFONT__* HTEXTFONT;
|
||||
|
||||
enum PIXEL_FORMAT {
|
||||
PIXEL_DXT1 = 0,
|
||||
PIXEL_DXT3 = 1,
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include "CAngle.h"
|
||||
@@ -1,34 +0,0 @@
|
||||
#ifndef _TRIAGE_CANGLE_H
|
||||
#define _TRIAGE_CANGLE_H
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
|
||||
class CBaseManaged;
|
||||
|
||||
class CBaseManaged {
|
||||
public:
|
||||
/* 0004 */ TSLink<CBaseManaged> m_link;
|
||||
/* 000C */ uint8_t m_dataTypeId;
|
||||
/* 000D */ uint8_t m_flags;
|
||||
/* 000E */ uint8_t unk_000E[2];
|
||||
/* 0010 */ void (__stdcall* m_updateFcn )(float, void*, void*);
|
||||
/* 0014 */ void* m_updateData;
|
||||
/* 0018 */ float m_updatePriority;
|
||||
|
||||
virtual ~CBaseManaged();
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct TManaged : public CBaseManaged {
|
||||
/* 001C */ T m_data;
|
||||
};
|
||||
|
||||
class CAngle : public TManaged<float> {
|
||||
public:
|
||||
/* 0020 */ float m_cos;
|
||||
/* 0024 */ float m_sin;
|
||||
};
|
||||
|
||||
#endif
|
||||
+1
-14
@@ -8,7 +8,7 @@
|
||||
#include "Engine/Source/Storm/H/stpl.h"
|
||||
#include "WoW/Source/Object/WGUID.h"
|
||||
#include "WoW/Source/UIUtil/CSimpleCamera.h"
|
||||
#include "_Triage/CAngle.h"
|
||||
#include "Engine/Source/Services/CameraInt.h"
|
||||
|
||||
class C3Vector;
|
||||
class CM2Model;
|
||||
@@ -30,19 +30,6 @@ class CAMERA_SMOOTH {
|
||||
/* 0014 */ float m_param4;
|
||||
};
|
||||
|
||||
class CCamera {
|
||||
public:
|
||||
/* 0000 */ TManaged<C3Vector> m_position;
|
||||
/* 0028 */ TManaged<C3Vector> m_target;
|
||||
/* 0050 */ TManaged<float> m_distance;
|
||||
/* 0070 */ TManaged<float> m_zFar;
|
||||
/* 0090 */ TManaged<float> m_zNear;
|
||||
/* 00B0 */ CAngle m_aoa;
|
||||
/* 00D8 */ CAngle m_fov;
|
||||
/* 0100 */ CAngle m_roll;
|
||||
/* 0128 */ CAngle m_rotation;
|
||||
};
|
||||
|
||||
class CGCamera : public CSimpleCamera {
|
||||
public:
|
||||
/* 0048 */ CM2Model* m_model;
|
||||
|
||||
Reference in New Issue
Block a user