mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Final formatting pass
This commit is contained in:
parent
c2b2756725
commit
ac800ff1e1
6 changed files with 17 additions and 20 deletions
|
@ -300,8 +300,11 @@ void ControlWaterfallMist(short itemNumber);
|
||||||
void TriggerWaterfallMist(const ItemInfo& item);
|
void TriggerWaterfallMist(const ItemInfo& item);
|
||||||
void KillAllCurrentItems(short itemNumber);
|
void KillAllCurrentItems(short itemNumber);
|
||||||
void TriggerDynamicLight(int x, int y, int z, short falloff, byte r, byte g, byte b);
|
void TriggerDynamicLight(int x, int y, int z, short falloff, byte r, byte g, byte b);
|
||||||
|
|
||||||
|
// TODO: use Spawn prefix instead.
|
||||||
void TriggerDynamicPointLight(const Vector3& pos, const Color& color, float falloff, bool castShadows = false, int hash = 0);
|
void TriggerDynamicPointLight(const Vector3& pos, const Color& color, float falloff, bool castShadows = false, int hash = 0);
|
||||||
void TriggerDynamicSpotLight(const Vector3& pos, const Vector3& dir, const Color& color, float radius, float falloff, float distance, bool castShadows = false, int hash = 0);
|
void TriggerDynamicSpotLight(const Vector3& pos, const Vector3& dir, const Color& color, float radius, float falloff, float distance, bool castShadows = false, int hash = 0);
|
||||||
|
|
||||||
void TriggerRocketFlame(int x, int y, int z, int xv, int yv, int zv, int itemNumber);
|
void TriggerRocketFlame(int x, int y, int z, int xv, int yv, int zv, int itemNumber);
|
||||||
void TriggerRocketSmoke(int x, int y, int z);
|
void TriggerRocketSmoke(int x, int y, int z);
|
||||||
void TriggerFlashSmoke(int x, int y, int z, short roomNumber);
|
void TriggerFlashSmoke(int x, int y, int z, short roomNumber);
|
||||||
|
|
|
@ -561,7 +561,7 @@ namespace TEN::Renderer
|
||||||
|
|
||||||
if (rat->On)
|
if (rat->On)
|
||||||
{
|
{
|
||||||
auto* mesh = GetMesh(Objects[ID_RATS_EMITTER].meshIndex + (rand() % 8));
|
const auto& mesh = *GetMesh(Objects[ID_RATS_EMITTER].meshIndex + (rand() % 8));
|
||||||
|
|
||||||
auto world = rat->Transform;
|
auto world = rat->Transform;
|
||||||
ReflectMatrixOptionally(world);
|
ReflectMatrixOptionally(world);
|
||||||
|
@ -575,21 +575,17 @@ namespace TEN::Renderer
|
||||||
|
|
||||||
_cbStatic.UpdateData(_stStatic, _context.Get());
|
_cbStatic.UpdateData(_stStatic, _context.Get());
|
||||||
|
|
||||||
for (auto& bucket : mesh->Buckets)
|
for (const auto& bucket : mesh.Buckets)
|
||||||
{
|
{
|
||||||
if (bucket.NumVertices == 0)
|
if (bucket.NumVertices == 0)
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
int passes = rendererPass == RendererPass::Opaque && bucket.BlendMode == BlendMode::AlphaTest ? 2 : 1;
|
int passes = rendererPass == RendererPass::Opaque && bucket.BlendMode == BlendMode::AlphaTest ? 2 : 1;
|
||||||
|
|
||||||
for (int p = 0; p < passes; p++)
|
for (int p = 0; p < passes; p++)
|
||||||
{
|
{
|
||||||
if (!SetupBlendModeAndAlphaTest(bucket.BlendMode, rendererPass, p))
|
if (!SetupBlendModeAndAlphaTest(bucket.BlendMode, rendererPass, p))
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
BindTexture(TextureRegister::ColorMap, &std::get<0>(_moveablesTextures[bucket.Texture]), SamplerStateRegister::AnisotropicClamp);
|
BindTexture(TextureRegister::ColorMap, &std::get<0>(_moveablesTextures[bucket.Texture]), SamplerStateRegister::AnisotropicClamp);
|
||||||
BindTexture(TextureRegister::NormalMap, &std::get<1>(_moveablesTextures[bucket.Texture]), SamplerStateRegister::AnisotropicClamp);
|
BindTexture(TextureRegister::NormalMap, &std::get<1>(_moveablesTextures[bucket.Texture]), SamplerStateRegister::AnisotropicClamp);
|
||||||
|
|
|
@ -493,7 +493,7 @@ namespace TEN::Renderer
|
||||||
if (r->mesh.empty())
|
if (r->mesh.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool roomIsReflected = IsRoomReflected(renderView, roomNumber);
|
bool isRoomReflected = IsRoomReflected(renderView, roomNumber);
|
||||||
|
|
||||||
for (int i = 0; i < room.Statics.size(); i++)
|
for (int i = 0; i < room.Statics.size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -523,7 +523,7 @@ namespace TEN::Renderer
|
||||||
if (obj.ObjectMeshes.empty())
|
if (obj.ObjectMeshes.empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!roomIsReflected && !renderView.Camera.Frustum.SphereInFrustum(mesh->Sphere.Center, mesh->Sphere.Radius))
|
if (!isRoomReflected && !renderView.Camera.Frustum.SphereInFrustum(mesh->Sphere.Center, mesh->Sphere.Radius))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Collect the lights
|
// Collect the lights
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#include "framework.h"
|
#include "framework.h"
|
||||||
#include <string>
|
|
||||||
#include <memory>
|
// TODO: To framework.
|
||||||
#include <filesystem>
|
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <d3dcompiler.h>
|
#include <d3dcompiler.h>
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,7 @@ void Renderer::UpdateLaraAnimations(bool force)
|
||||||
rItem.DoneAnimations = true;
|
rItem.DoneAnimations = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TEN::Renderer::Renderer::DrawLara(RenderView& view, RendererPass rendererPass)
|
void Renderer::DrawLara(RenderView& view, RendererPass rendererPass)
|
||||||
{
|
{
|
||||||
// TODO: Avoid Lara global.
|
// TODO: Avoid Lara global.
|
||||||
// Don't draw player if using optics (but still draw reflections).
|
// Don't draw player if using optics (but still draw reflections).
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <wrl/client.h>
|
#include <wrl/client.h>
|
||||||
#include <d3d11.h>
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
using Microsoft::WRL::ComPtr;
|
using Microsoft::WRL::ComPtr;
|
||||||
|
@ -18,25 +17,25 @@ namespace TEN::Renderer::Structures
|
||||||
struct RendererPixelShaderAndBlob
|
struct RendererPixelShaderAndBlob
|
||||||
{
|
{
|
||||||
ComPtr<ID3D11PixelShader> Shader = nullptr;
|
ComPtr<ID3D11PixelShader> Shader = nullptr;
|
||||||
ComPtr<ID3D10Blob> Blob;
|
ComPtr<ID3D10Blob> Blob = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RendererVertexShaderAndBlob
|
struct RendererVertexShaderAndBlob
|
||||||
{
|
{
|
||||||
ComPtr<ID3D11VertexShader> Shader = nullptr;
|
ComPtr<ID3D11VertexShader> Shader = nullptr;
|
||||||
ComPtr<ID3D10Blob> Blob;
|
ComPtr<ID3D10Blob> Blob = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RendererComputeShaderAndBlob
|
struct RendererComputeShaderAndBlob
|
||||||
{
|
{
|
||||||
ComPtr<ID3D11ComputeShader> Shader = nullptr;
|
ComPtr<ID3D11ComputeShader> Shader = nullptr;
|
||||||
ComPtr<ID3D10Blob> Blob;
|
ComPtr<ID3D10Blob> Blob = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RendererShader
|
struct RendererShader
|
||||||
{
|
{
|
||||||
RendererPixelShaderAndBlob Pixel;
|
RendererPixelShaderAndBlob Pixel = {};
|
||||||
RendererVertexShaderAndBlob Vertex;
|
RendererVertexShaderAndBlob Vertex = {};
|
||||||
RendererComputeShaderAndBlob Compute;
|
RendererComputeShaderAndBlob Compute = {};
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue