mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-13 14:07:04 +03:00
Remove UpdateEffects as it is updated on CollectEffects anyway
This commit is contained in:
parent
4b75c9ee5f
commit
b449f27b6e
3 changed files with 7 additions and 19 deletions
|
@ -459,7 +459,6 @@ namespace TEN::Renderer
|
||||||
void ClearDynamicLights();
|
void ClearDynamicLights();
|
||||||
void ClearShadowMap();
|
void ClearShadowMap();
|
||||||
void UpdateItemAnimations(RenderView& view);
|
void UpdateItemAnimations(RenderView& view);
|
||||||
void UpdateEffects(RenderView& view);
|
|
||||||
bool PrintDebugMessage(int x, int y, int alpha, byte r, byte g, byte b, LPCSTR Message);
|
bool PrintDebugMessage(int x, int y, int alpha, byte r, byte g, byte b, LPCSTR Message);
|
||||||
|
|
||||||
void InitialiseScreen(int w, int h, bool windowed, HWND handle, bool reset);
|
void InitialiseScreen(int w, int h, bool windowed, HWND handle, bool reset);
|
||||||
|
|
|
@ -375,6 +375,7 @@ namespace TEN::Renderer
|
||||||
newItem->ItemNumber = itemNum;
|
newItem->ItemNumber = itemNum;
|
||||||
newItem->ObjectNumber = item->ObjectNumber;
|
newItem->ObjectNumber = item->ObjectNumber;
|
||||||
newItem->Color = item->Color;
|
newItem->Color = item->Color;
|
||||||
|
newItem->Position = item->Pose.Position.ToVector3();
|
||||||
newItem->Translation = Matrix::CreateTranslation(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z);
|
newItem->Translation = Matrix::CreateTranslation(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z);
|
||||||
newItem->Rotation = Matrix::CreateFromYawPitchRoll(TO_RAD(item->Pose.Orientation.y),
|
newItem->Rotation = Matrix::CreateFromYawPitchRoll(TO_RAD(item->Pose.Orientation.y),
|
||||||
TO_RAD(item->Pose.Orientation.x),
|
TO_RAD(item->Pose.Orientation.x),
|
||||||
|
@ -435,6 +436,7 @@ namespace TEN::Renderer
|
||||||
{
|
{
|
||||||
mesh->staticNumber,
|
mesh->staticNumber,
|
||||||
room.RoomNumber,
|
room.RoomNumber,
|
||||||
|
mesh->pos.Position.ToVector3(),
|
||||||
world,
|
world,
|
||||||
mesh->color,
|
mesh->color,
|
||||||
room.AmbientLight,
|
room.AmbientLight,
|
||||||
|
@ -621,13 +623,12 @@ namespace TEN::Renderer
|
||||||
|
|
||||||
void Renderer11::CollectLightsForEffect(short roomNumber, RendererEffect* effect)
|
void Renderer11::CollectLightsForEffect(short roomNumber, RendererEffect* effect)
|
||||||
{
|
{
|
||||||
CollectLights(effect->Effect->pos.Position.ToVector3(), ITEM_LIGHT_COLLECTION_RADIUS, roomNumber, NO_ROOM, false, effect->LightsToDraw);
|
CollectLights(effect->Position, ITEM_LIGHT_COLLECTION_RADIUS, roomNumber, NO_ROOM, false, effect->LightsToDraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer11::CollectLightsForItem(RendererItem* item)
|
void Renderer11::CollectLightsForItem(RendererItem* item)
|
||||||
{
|
{
|
||||||
auto pos = Vector3::Transform(Vector3::Zero, item->Translation);
|
CollectLights(item->Position, ITEM_LIGHT_COLLECTION_RADIUS, item->RoomNumber, item->PrevRoomNumber, false, item->LightsToDraw);
|
||||||
CollectLights(pos, ITEM_LIGHT_COLLECTION_RADIUS, item->RoomNumber, item->PrevRoomNumber, false, item->LightsToDraw);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer11::CalculateLightFades(RendererItem *item)
|
void Renderer11::CalculateLightFades(RendererItem *item)
|
||||||
|
@ -723,8 +724,9 @@ namespace TEN::Renderer
|
||||||
|
|
||||||
RendererEffect *newEffect = &m_effects[fxNum];
|
RendererEffect *newEffect = &m_effects[fxNum];
|
||||||
|
|
||||||
newEffect->Effect = fx;
|
newEffect->ObjectNumber = fx->objectNumber;
|
||||||
newEffect->Id = fxNum;
|
newEffect->RoomNumber = fx->roomNumber;
|
||||||
|
newEffect->Position = fx->pos.Position.ToVector3();
|
||||||
newEffect->World = Matrix::CreateFromYawPitchRoll(fx->pos.Orientation.y, fx->pos.Position.x, fx->pos.Position.z) * Matrix::CreateTranslation(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z);
|
newEffect->World = Matrix::CreateFromYawPitchRoll(fx->pos.Orientation.y, fx->pos.Position.x, fx->pos.Position.z) * Matrix::CreateTranslation(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z);
|
||||||
newEffect->Mesh = GetMesh(obj->nmeshes ? obj->meshIndex : fx->frameNumber);
|
newEffect->Mesh = GetMesh(obj->nmeshes ? obj->meshIndex : fx->frameNumber);
|
||||||
|
|
||||||
|
|
|
@ -34,19 +34,6 @@ namespace TEN::Renderer
|
||||||
using std::pair;
|
using std::pair;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
void Renderer11::UpdateEffects(RenderView& view)
|
|
||||||
{
|
|
||||||
for (auto room : view.roomsToDraw)
|
|
||||||
{
|
|
||||||
for (auto fx : room->EffectsToDraw)
|
|
||||||
{
|
|
||||||
Matrix translation = Matrix::CreateTranslation(fx->Effect->pos.Position.x, fx->Effect->pos.Position.y, fx->Effect->pos.Position.z);
|
|
||||||
Matrix rotation = Matrix::CreateFromYawPitchRoll(TO_RAD(fx->Effect->pos.Orientation.y), TO_RAD(fx->Effect->pos.Orientation.x), TO_RAD(fx->Effect->pos.Orientation.z));
|
|
||||||
fx->World = rotation * translation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Renderer11::UpdateAnimation(RendererItem *item, RendererObject& obj, ANIM_FRAME** frmptr, short frac, short rate, int mask, bool useObjectWorldRotation)
|
void Renderer11::UpdateAnimation(RendererItem *item, RendererObject& obj, ANIM_FRAME** frmptr, short frac, short rate, int mask, bool useObjectWorldRotation)
|
||||||
{
|
{
|
||||||
static std::vector<int> boneIndexList;
|
static std::vector<int> boneIndexList;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue